class PokeBattle_ZMove < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
movedata=PBZMoveData.new(@id)
className=sprintf("PokeBattle_Move_%03X",movedata.function)
if Object.const_defined?(className) && movedata.function != 0x0 # Unique Z-Moves
ret=Kernel.const_get(className).new(@battle,PBMove.new(0))
ret.zmove=true
return ret.pbEffect(attacker,opponent,hitnum,alltargets,showanimation)
elsif @category==3 && @basemove != nil
if @basemove.basedamage>0
return super(attacker,opponent,hitnum,alltargets,showanimation)
elsif isConst?(@basemove.id,PBMoves,:NATUREPOWER) # Z-Nature Power
className2="PokeBattle_Move_1AC"
ret=Kernel.const_get(className2).new(@battle,PBMove.new(0))
ret.zmove=false
return ret.pbEffect(attacker,opponent,hitnum,alltargets,showanimation)
elsif isConst?(@basemove.id,PBMoves,:MIRRORMOVE) # Z-Mirror Move
className2="PokeBattle_Move_1AE"
ret=Kernel.const_get(className2).new(@battle,PBMove.new(0))
ret.zmove=false
return ret.pbEffect(attacker,opponent,hitnum,alltargets,showanimation)
elsif isConst?(@basemove.id,PBMoves,:COPYCAT) # Z-Copycat
className2="PokeBattle_Move_1AF"
ret=Kernel.const_get(className2).new(@battle,PBMove.new(0))
ret.zmove=false
return ret.pbEffect(attacker,opponent,hitnum,alltargets,showanimation)
elsif isConst?(@basemove.id,PBMoves,:MEFIRST) # Z-Me First
className2="PokeBattle_Move_1B0"
ret=Kernel.const_get(className2).new(@battle,PBMove.new(0))
ret.zmove=false
return ret.pbEffect(attacker,opponent,hitnum,alltargets,showanimation)
elsif isConst?(@basemove.id,PBMoves,:SLEEPTALK) # Z-Sleep Talk
className2="PokeBattle_Move_1B1"
ret=Kernel.const_get(className2).new(@battle,PBMove.new(0))
ret.zmove=false
return ret.pbEffect(attacker,opponent,hitnum,alltargets,showanimation)
elsif @basemove.category==2 # other Status Z-Moves
className2=sprintf("PokeBattle_Move_%03X",@basemove.zfunction)
className3=sprintf("PokeBattle_Move_%03X",@basemove.function)
ret=Kernel.const_get(className2).new(@battle,PBMove.new(0))
ret.zmove=true
bob=ret.pbEffect(attacker,opponent,hitnum,alltargets,showanimation)
ret=Kernel.const_get(className3).new(@battle,PBMove.new(0))
ret.zmove=false
return ret.pbEffect(attacker,opponent,hitnum,alltargets,showanimation)
end
end
end
def pbAdditionalEffect(attacker,opponent)
movedata=PBZMoveData.new(@id)
className=sprintf("PokeBattle_Move_%03X",movedata.function)
if Object.const_defined?(className) && movedata.function != 0x0
ret=Kernel.const_get(className).new(@battle,PBMove.new(0))
return ret.pbAdditionalEffect(attacker,opponent)
else
return super(attacker,opponent)
end
end
def pbAccuracyCheck(attacker,opponent)
movedata=PBZMoveData.new(@id)
className=sprintf("PokeBattle_Move_%03X",movedata.function)
if Object.const_defined?(className) && movedata.function != 0x0
ret=Kernel.const_get(className).new(@battle,PBMove.new(0))
return ret.pbAccuracyCheck(attacker,opponent)
else
return super(attacker,opponent)
end
end
def pbModifyDamage(damagemult,attacker,opponent)
movedata=PBZMoveData.new(@id)
className=sprintf("PokeBattle_Move_%03X",movedata.function)
if Object.const_defined?(className) && movedata.function != 0x0
ret=Kernel.const_get(className).new(@battle,PBMove.new(0))
return ret.pbModifyDamage(damagemult,attacker,opponent)
else
return super(damagemult,attacker,opponent)
end
end
def pbBaseDamage(basedmg,attacker,opponent)
movedata=PBZMoveData.new(@id)
className=sprintf("PokeBattle_Move_%03X",movedata.function)
if Object.const_defined?(className) && movedata.function != 0x0
ret=Kernel.const_get(className).new(@battle,PBMove.new(0))
return ret.pbBaseDamage(basedmg,attacker,opponent)
else
return super(basedmg,attacker,opponent)
end
end
def pbBaseDamageMultiplier(damagemult,attacker,opponent)
movedata=PBZMoveData.new(@id)
className=sprintf("PokeBattle_Move_%03X",movedata.function)
if Object.const_defined?(className) && movedata.function != 0x0
ret=Kernel.const_get(className).new(@battle,PBMove.new(0))
return ret.pbModifyDamage(damagemult,attacker,opponent)
else
return super(damagemult,attacker,opponent)
end
end
def flingarray
movedata=PBZMoveData.new(@id)
className=sprintf("PokeBattle_Move_%03X",movedata.function)
if Object.const_defined?(className) && movedata.function != 0x0
ret=Kernel.const_get(className).new(@battle,PBMove.new(0))
return ret.flingarray
else
return nil
end
end
def pbCalcDamage(attacker,opponent,options=0,hitnum=0)
movedata=PBZMoveData.new(@id)
className=sprintf("PokeBattle_Move_%03X",movedata.function)
if Object.const_defined?(className) && movedata.function != 0x0
ret=Kernel.const_get(className).new(@battle,PBMove.new(0))
return pbCalcDamage(attacker,opponent,options,hitnum)
else
return super(attacker,opponent,options,hitnum)
end
end
def isZMove?
return @zmove
end
def initialize(battle,move,submove=nil)
@id = move.id
@battle = battle
@name = (PBZMoves.getName(id) rescue nil) # Get the move's name
# Get data on the move
movedata = PBZMoveData.new(id)
@function = movedata.function
@basedamage = movedata.basedamage
@type = movedata.type
@accuracy = movedata.accuracy
@addlEffect = movedata.addlEffect
@target = movedata.target
@priority = movedata.priority
@flags = movedata.flags
@category = movedata.category
@thismove = move
@pp = move.pp # Can be changed with Mimic/Transform
@basemove = nil
@zmove = true
if submove != nil
@basemove = PokeBattle_Move.pbFromPBMove(battle,submove)
if @category==3 && @basemove.category==2 # Type-based status Z-Moves
@function = @basemove.function
@target = @basemove.target
@priority = @basemove.priority
@flags = @basemove.flags
@thismove = @basemove.thismove
end
end
end
end
class PokeBattle_Move
def zFunction
if [getID(PBMoves,:ASSIST),getID(PBMoves,:HEALINGWISH),
getID(PBMoves,:METRONOME),getID(PBMoves,:LUNARDANCE)].include?(self.id)
return 0x0 # no effect
elsif [getID(PBMoves,:BULKUP),getID(PBMoves,:HONECLAWS),
getID(PBMoves,:HOWL),getID(PBMoves,:LASERFOCUS),
getID(PBMoves,:LEER),getID(PBMoves,:MEDITATE),
getID(PBMoves,:ODORSLEUTH),getID(PBMoves,:POWERTRICK),
getID(PBMoves,:ROTOTILLER),getID(PBMoves,:SCREECH),
getID(PBMoves,:SHARPEN),getID(PBMoves,:TAILWHIP),
getID(PBMoves,:TAUNT),getID(PBMoves,:TOPSYTURVY),
getID(PBMoves,:WILLOWISP),getID(PBMoves,:WORKUP),
getID(PBMoves,:HUNDREDARROWS),getID(PBMoves,:CORROSION),
getID(PBMoves,:RALLYATTACK)].include?(self.id)
return 0x1C # Raise Attack by 1
elsif [getID(PBMoves,:MIRRORMOVE)].include?(self.id)
return 0x2E # Raise Attack by 2
elsif [getID(PBMoves,:SPLASH)].include?(self.id)
return 0x1A8 # Raise Attack by 3
elsif [getID(PBMoves,:AQUARING),getID(PBMoves,:BABYDOLLEYES),
getID(PBMoves,:BANEFULBUNKER),getID(PBMoves,:BLOCK),
getID(PBMoves,:CHARM),getID(PBMoves,:DEFENDORDER),
getID(PBMoves,:FAIRYLOCK),getID(PBMoves,:FEATHERDANCE),
getID(PBMoves,:FLOWERSHIELD),getID(PBMoves,:GRASSYTERRAIN),
getID(PBMoves,:GROWL),getID(PBMoves,:HARDEN),
getID(PBMoves,:MATBLOCK),getID(PBMoves,:NOBLEROAR),
getID(PBMoves,:PAINSPLIT),getID(PBMoves,:PLAYNICE),
getID(PBMoves,:POISONGAS),getID(PBMoves,:POISONPOWDER),
getID(PBMoves,:QUICKGUARD),getID(PBMoves,:REFLECT),
getID(PBMoves,:ROAR),getID(PBMoves,:SPIDERWEB),
getID(PBMoves,:SPIKES),getID(PBMoves,:SPIKYSHIELD),
getID(PBMoves,:STEALTHROCK),getID(PBMoves,:STRENGTHSAP),
getID(PBMoves,:TEARFULLOK),getID(PBMoves,:TICKLE),
getID(PBMoves,:TORMENT),getID(PBMoves,:TOXIC),
getID(PBMoves,:TOXICSPIKES),getID(PBMoves,:VENOMDRENCH),
getID(PBMoves,:WIDEGUARD),getID(PBMoves,:WITHDRAW),
getID(PBMoves,:LIVEWIRE),getID(PBMoves,:OILSPILL),
getID(PBMoves,:TRIDEECHESS),getID(PBMoves,:RALLYDEFENSE)].include?(self.id)
return 0x1D # Raise Defense by 1
elsif [getID(PBMoves,:CONFUSERAY),getID(PBMoves,:ELECTRIFY),
getID(PBMoves,:EMBARGO),getID(PBMoves,:FAKETEARS),
getID(PBMoves,:GEARUP),getID(PBMoves,:GRAVITY),
getID(PBMoves,:GROWTH),getID(PBMoves,:INSTRUCT),
getID(PBMoves,:IONDELUGE),getID(PBMoves,:METALSOUND),
getID(PBMoves,:MINDREADER),getID(PBMoves,:MIRACLEEYE),
getID(PBMoves,:NIGHTMARE),getID(PBMoves,:PSYCHICTERRAIN),
getID(PBMoves,:REFLECTTYPE),getID(PBMoves,:SIMPLEBEAK),
getID(PBMoves,:SOAK),getID(PBMoves,:SWEETKISS),
getID(PBMoves,:TEETERDANCE),getID(PBMoves,:TELEKINESIS),
getID(PBMoves,:SHRINK),getID(PBMoves,:MEDUSA),
getID(PBMoves,:MUDCOAT),getID(PBMoves,:POLLENDELUGE),
getID(PBMoves,:DUSTDELUGE),getID(PBMoves,:FLARE),
getID(PBMoves,:RALLYSPATK)].include?(self.id)
return 0x20 # Raise Special Attack by 1
elsif [getID(PBMoves,:HEALBLOCK),getID(PBMoves,:PSYCHOSHIFT)].include?(self.id)
return 0x32 # Raise Special Attack by 2
elsif [getID(PBMoves,:CHARGE),getID(PBMoves,:CONFIDE),
getID(PBMoves,:COSMICPOWER),getID(PBMoves,:CRAFTYSHIELD),
getID(PBMoves,:EERIEIMPULSE),getID(PBMoves,:ENTRAINMENT),
getID(PBMoves,:FLATTER),getID(PBMoves,:GLARE),
getID(PBMoves,:INGRAIN),getID(PBMoves,:LIGHTSCREEN),
getID(PBMoves,:MAGICROOM),getID(PBMoves,:MAGNETICFLUX),
getID(PBMoves,:MEANLOOK),getID(PBMoves,:MISTYTERRAIN),
getID(PBMoves,:MUDSPORT),getID(PBMoves,:SPOTLIGHT),
getID(PBMoves,:STUNSPORE),getID(PBMoves,:THUNDERWAVE),
getID(PBMoves,:WATERSPORT),getID(PBMoves,:WHIRLWIND),
getID(PBMoves,:WISH),getID(PBMoves,:WONDERROOM),
getID(PBMoves,:RALLYSPDEF)].include?(self.id)
return 0x20 # Raise Special Defense by 1
elsif [getID(PBMoves,:AROMATICMIST),getID(PBMoves,:CAPTIVATE),
getID(PBMoves,:IMPRISON),getID(PBMoves,:MAGICCOAT),
getID(PBMoves,:POWDER)].include?(self.id)
return 0x33 # Raise Special Defense by 2
elsif [getID(PBMoves,:AFTERYOU),getID(PBMoves,:AURORAVEIL),
getID(PBMoves,:ELECTRICTERRAIN),getID(PBMoves,:ENCORE),
getID(PBMoves,:GASTROACID),getID(PBMoves,:GRASSWHISTLE),
getID(PBMoves,:GUARDSPLIT),getID(PBMoves,:GUARDSWAP),
getID(PBMoves,:HAIL),getID(PBMoves,:HYPNOSIS),
getID(PBMoves,:LOCKON),getID(PBMoves,:LOVELYKISS),
getID(PBMoves,:POWERSPLIT),getID(PBMoves,:POWERSWAP),
getID(PBMoves,:QUASH),getID(PBMoves,:RAINDANCE),
getID(PBMoves,:ROLEPLAY),getID(PBMoves,:SAFEGUARD),
getID(PBMoves,:SANDSTORM),getID(PBMoves,:SCARYFACE),
getID(PBMoves,:SING),getID(PBMoves,:SKILLSWAP),
getID(PBMoves,:SLEEPPOWDER),getID(PBMoves,:SPEEDSWAP),
getID(PBMoves,:STICKYWEB),getID(PBMoves,:STRINGSHOT),
getID(PBMoves,:SUNNYDAY),getID(PBMoves,:SUPERSONIC),
getID(PBMoves,:TOXICTHREAD),getID(PBMoves,:WORRYSEED),
getID(PBMoves,:YAWN),getID(PBMoves,:PURITYPULSE),
getID(PBMoves,:PIXIEDUST),getID(PBMoves,:RALLYSPEED)].include?(self.id)
return 0x1F # Raise Speed by 1
elsif [getID(PBMoves,:ALLYSWITCH),getID(PBMoves,:BESTOW),
getID(PBMoves,:MEFIRST),getID(PBMoves,:RECYCLE),
getID(PBMoves,:SNATCH),getID(PBMoves,:SWITCHEROO),
getID(PBMoves,:TRICK)].include?(self.id)
return 0x30 # Raise Speed by 2
elsif [getID(PBMoves,:COPYCAT),getID(PBMoves,:DEFENSECURL),
getID(PBMoves,:DEFOG),getID(PBMoves,:FOCUSENERGY),
getID(PBMoves,:MIMIC),getID(PBMoves,:SWEETSCENT),
getID(PBMoves,:TRICKROOM),getID(PBMoves,:RALLYACCURACY)].include?(self.id)
return 0x1A9 # Raise Accuracy by 1
elsif [getID(PBMoves,:CAMOFLAGE),getID(PBMoves,:DETECT),
getID(PBMoves,:FLASH),getID(PBMoves,:KINESIS),
getID(PBMoves,:LUCKYCHANT),getID(PBMoves,:MAGNETRISE),
getID(PBMoves,:SANDATTACK),getID(PBMoves,:SMOKESCREEN),
getID(PBMoves,:SNOWATTACK),getID(PBMoves,:POLLENATTACK),
getID(PBMoves,:RALLYEVASION)].include?(self.id)
return 0x30 # Raise Evasion by 1
elsif [getID(PBMoves,:CELEBRATE),getID(PBMoves,:CONVERSION),
getID(PBMoves,:FORESTSCURSE),getID(PBMoves,:GEOMANCY),
getID(PBMoves,:HAPPYHOUR),getID(PBMoves,:HOLDHANDS),
getID(PBMoves,:PURIFY),getID(PBMoves,:SKETCH),
getID(PBMoves,:TRICKORTREAT),getID(PBMoves,:ORIGINPOINT),
getID(PBMoves,:LEVIOSA),getID(PBMoves,:IONSTORM),
getID(PBMoves,:IMPUREAIR),getID(PBMoves,:RALLYSPECTRUM)].include?(self.id)
return 0x2D # Raise all stats by 1
elsif [getID(PBMoves,:ACCUPRESSURE),getID(PBMoves,:FORESIGHT),
getID(PBMoves,:HEARTSWAP),getID(PBMoves,:SLEEPTALK),
getID(PBMoves,:TAILWIND)].include?(self.id)
return 0x23 # Raise critical hit ratio
elsif [getID(PBMoves,:AROMATHERAPY),getID(PBMoves,:BELLYDRUM),
getID(PBMoves,:CONVERSION2),getID(PBMoves,:HAZE),
getID(PBMoves,:HEALBELL),getID(PBMoves,:MIST),
getID(PBMoves,:PSYCHUP),getID(PBMoves,:REFRESH),
getID(PBMoves,:SPITE),getID(PBMoves,:STOCKPILE),
getID(PBMoves,:TELEPORT),getID(PBMoves,:TRANSFORM),
getID(PBMoves,:GENETICMEMORY)].include?(self.id)
return 0x1AB # Refills user's health fully
elsif [getID(PBMoves,:MEMENTO),getID(PBMoves,:PARTINGSHOT)].include?(self.id)
return 0x1A7 # Refills user's replacement's HP fully
elsif [getID(PBMoves,:DESTINYBOND),getID(PBMoves,:GRUDGE)].include?(self.id)
return 0x117 # Becomes center of attention
elsif isConst?(self.id,PBMoves,:CURSE)
return 0x1AD # Refills user's HP fully if user is Ghost type, otherwise raises Attack by 1
elsif self.category==2
return 0x50 # Resets user's stat changes
end
end
end