Solved How can i edit Elite Battle System?

WolfPP

Novice
Member
Posts
38
#1
So, im addin Z-move in EBS:


And I need help with these two details:
1: I would like center the screen for the pokemon that will do z-move;
2: I would like the Z-move symbol to overlap the pokemon image.

Below, the script in 'Animations Script' - Common animations player:

Code:
  # Z-Power
  def pbCommonAnimationZPower(userindex,targetindex,hitnum=0)
    return if targetindex.nil?
    wait(16,true) if self.afterAnim
    poke = @sprites["pokemon#{targetindex}"]
    player = (targetindex%2==0)
    pt = {}
    rndx = []
    rndy = []
    tone = []
    timer = []
    speed = []
    fp = {}   

    vector = @battle.doublebattle ? VECTOR2 : VECTOR1
    back = !@battle.pbIsOpposing?(targetindex)
    factor = poke.zoom_x
    endy = poke.y - poke.bitmap.height*(player ? 1.5 : 1)

    # particle initialization
    for i in 0...16
      fp["c#{i}"] = Sprite.new(poke.viewport)
      fp["c#{i}"].z = poke.z + 10
      fp["c#{i}"].bitmap = pbBitmap(sprintf("Graphics/Animations/ebMega%03d",rand(4)+1))
      fp["c#{i}"].ox = fp["c#{i}"].bitmap.width/2
      fp["c#{i}"].oy = fp["c#{i}"].bitmap.height/2
      fp["c#{i}"].opacity = 0
    end
    # ray initialization
    rangle = []
    cx, cy = getCenter(poke,true)
    for i in 0...8; rangle.push((360/8)*i +  15); end
    for j in 0...8
      fp["r#{j}"] = Sprite.new(viewport)
      fp["r#{j}"].bitmap = pbBitmap("Graphics/Animations/ebUltra005")
      fp["r#{j}"].ox = 0
      fp["r#{j}"].oy = fp["r#{j}"].bitmap.height/2
      fp["r#{j}"].opacity = 0
      fp["r#{j}"].zoom_x = 0
      fp["r#{j}"].zoom_y = 0
      fp["r#{j}"].x = cx
      fp["r#{j}"].y = cy
      a = rand(rangle.length)
      fp["r#{j}"].angle = rangle[a]
      fp["r#{j}"].z = poke.z + 2
      rangle.delete_at(a)
    end
    # ripple initialization
    for j in 0...3
      fp["v#{j}"] = Sprite.new(viewport)
      fp["v#{j}"].bitmap = pbBitmap("Graphics/Animations/ebUltra006")
      fp["v#{j}"].ox = fp["v#{j}"].bitmap.width/2
      fp["v#{j}"].oy = fp["v#{j}"].bitmap.height/2
      fp["v#{j}"].x = cx
      fp["v#{j}"].y = cy
      fp["v#{j}"].opacity = 0
      fp["v#{j}"].zoom_x = 2
      fp["v#{j}"].zoom_y = 2
    end
    # Z-Move Symbol
    cx, cy = getCenter(poke,true)
    for j in 0...3
      fp["v#{j}"] = Sprite.new(viewport)
      fp["v#{j}"].bitmap = pbBitmap("Graphics/Animations/ebZMove001")
      fp["v#{j}"].ox = fp["v#{j}"].bitmap.width/2
      fp["v#{j}"].oy = fp["v#{j}"].bitmap.height/2
      fp["v#{j}"].x = cx
      fp["v#{j}"].y = cy
      fp["v#{j}"].opacity = 0
      fp["v#{j}"].zoom_x = 2
      fp["v#{j}"].zoom_y = 2
    end
    # Yellow circle
    for i in 0...64
      s = rand(2)
      y = rand(64)+1
      c = [Color.new(238,216,22),Color.new(212,232,43),Color.new(230,242,36)][rand(3)]
      fp["#{i}"] = Sprite.new(poke.viewport)
      fp["#{i}"].bitmap = Bitmap.new(14,14)
      fp["#{i}"].bitmap.drawCircle(c)
      fp["#{i}"].ox = fp["#{i}"].bitmap.width/2
      fp["#{i}"].oy = fp["#{i}"].bitmap.height/2
      width = (96/poke.bitmap.width*0.5).to_i
      fp["#{i}"].x = poke.x + rand((64 + width)*poke.zoom_x - 16)*(s==0 ? 1 : -1)
      fp["#{i}"].y = poke.y
      fp["#{i}"].z = poke.z + (rand(2)==0 ? 1 : -1)
      r = rand(4)
      fp["#{i}"].zoom_x = poke.zoom_x*[1,0.9,0.95,0.85][r]*0.84
      fp["#{i}"].zoom_y = poke.zoom_y*[1,0.9,0.95,0.85][r]*0.84
      fp["#{i}"].opacity = 0
      fp["#{i}"].tone = Tone.new(128,128,128)
      tone.push(128)
      rndx.push(fp["#{i}"].x + rand(32)*(s==0 ? 1 : -1))
      rndy.push(endy - y*poke.zoom_y)
      timer.push(0)
      speed.push((rand(50)+1)*0.002)
    end

    for i in 0...64
      #### particle animation
      for j in 0...16
        next if j > (i/8)
        if fp["c#{j}"].opacity == 0 && i < 72
          fp["c#{j}"].opacity = 255
          x, y = randCircleCord(96*factor)
          fp["c#{j}"].x = cx - 96*factor + x
          fp["c#{j}"].y = cy - 96*factor + y
        end
        x2 = cx
        y2 = cy
        x0 = fp["c#{j}"].x
        y0 = fp["c#{j}"].y
        fp["c#{j}"].x += (x2 - x0)*0.1
        fp["c#{j}"].y += (y2 - y0)*0.1
        fp["c#{j}"].opacity -= 16
      end
      # ray animation
      for j in 0...8
        if fp["r#{j}"].opacity == 0 && j <= (i%128)/16 && i < 96
          fp["r#{j}"].opacity = 255
          fp["r#{j}"].zoom_x = 0
          fp["r#{j}"].zoom_y = 0
        end
        fp["r#{j}"].opacity -= 4
        fp["r#{j}"].zoom_x += 0.05
        fp["r#{j}"].zoom_y += 0.05
      end
      # ripple animation
      for j in 0...3
        next if j > (i-32)/8
        next if fp["v#{j}"].zoom_x <= 0
        fp["v#{j}"].opacity += 16
        fp["v#{j}"].zoom_x -= 0.05
        fp["v#{j}"].zoom_y -= 0.05
      end
      #
      for j in 0...64
        next if j>(i*2)
        timer[j] += 1
        fp["#{j}"].x += (rndx[j] - fp["#{j}"].x)*speed[j]
        fp["#{j}"].y -= (fp["#{j}"].y - rndy[j])*speed[j]
        tone[j] -= 8 if tone[j] > 0
        fp["#{j}"].tone = Tone.new(tone[j],tone[j],tone[j])
        fp["#{j}"].angle += 4
        if timer[j] > 8
          fp["#{j}"].opacity -= 8
          fp["#{j}"].zoom_x -= 0.02*poke.zoom_x if fp["#{j}"].zoom_x > 0
          fp["#{j}"].zoom_y -= 0.02*poke.zoom_y if fp["#{j}"].zoom_y > 0
        else
          fp["#{j}"].opacity += 25 if fp["#{j}"].opacity < 200
          fp["#{j}"].zoom_x += 0.025*poke.zoom_x
          fp["#{j}"].zoom_y += 0.025*poke.zoom_y
        end
      end
      wait(1,true)
    end
    pbDisposeSpriteHash(fp)
  end

  # Z Scream
  def pbCommonAnimationZScream(userindex,targetindex,hitnum=0)
    return if targetindex.nil?
    wait(16,true) if self.afterAnim
    poke = @sprites["pokemon#{targetindex}"]
    player = (targetindex%2==0)
    pt = {}
    rndx = []
    rndy = []
    tone = []
    timer = []
    speed = []
    fp = {}   

    vector = @battle.doublebattle ? VECTOR2 : VECTOR1
    back = !@battle.pbIsOpposing?(targetindex)
    factor = poke.zoom_x
    endy = poke.y - poke.bitmap.height*(player ? 1.5 : 1)

    fp["impact"] = Sprite.new(poke.viewport)
    fp["impact"].bitmap = pbBitmap("Graphics/Pictures/impact")
    fp["impact"].ox = fp["impact"].bitmap.width/2
    fp["impact"].oy = fp["impact"].bitmap.height/2
    fp["impact"].x = poke.viewport.rect.width/2
    fp["impact"].y = poke.viewport.rect.height/2
    fp["impact"].z = 999
    fp["impact"].opacity = 0
    k = -2
    for i in 0...24
      fp["impact"].opacity += 64
      fp["impact"].angle += 180 if i%4 == 0
      fp["impact"].mirror = !fp["impact"].mirror if i%4 == 2
      k *= -1 if i%4 == 0
      poke.viewport.color.alpha -= 16
      moveEntireScene(0,k,true,true)
      wait(1,false)
    end
    for i in 0...16
      fp["impact"].opacity -= 64
      fp["impact"].angle += 180 if i%4 == 0
      fp["impact"].mirror = !fp["impact"].mirror if i%4 == 2
      wait(1)
    end
  end
 
Last edited:

WolfPP

Novice
Member
Posts
38
#3
I do not know; maybe someone else can help, but I am loving those graphics...
Mr.Gela helps us about the z-symbol.



Now, we only need to know how to centralize the screen for the pokemon that will use z-move;

EDIT2:

IT's Done!

Zeak6464, Mr.Gela and Coffee Guy give me a little (and important) help. Thanks guys!


(Yearh, now lets start to fix Inferno Overdrive and create zmove animation to EBS :D)
 
Last edited:

WolfPP

Novice
Member
Posts
38
#5
I think you have to check some script in move animation. Some moves did have the script for centralize the screen.
I made it and finish. Look gif:



Now i need to fix zmove anim in this gif and create to all zmove.
If someone want to join us to create zmove animation to EBS, will be a pleasure! :D
 

kmb

dabbling in game design
Member
Posts
61
#6
Don't mean to hi-jack the thread, but how hard is it to incorporate EBS in version 17.2? Do all of the existing scripts work afterward? I'm loving the way this all looks!
 

WolfPP

Novice
Member
Posts
38
#7
Don't mean to hi-jack the thread, but how hard is it to incorporate EBS in version 17.2? Do all of the existing scripts work afterward? I'm loving the way this all looks!
I made the script usin a fresh EBS (Next Generation Edition) and PE v17.2 fresh too.

When i post tutorial to add ingame, you will need use a text compare (like this) to add some scripts in someplaces, like PokeBattle_Battle; PokeBattle_Battler, PokeItem_Effects, etc.

EBS is a simple plug and play, but Zmove is not.

If you read it, please check this:
Click here
 
Last edited:
Top