#===============================================================================
# This move inflicts physical or special damage, whichever will be more
# effective. This may also poison the target. (Shell Side Arm)
#===============================================================================
class PokeBattle_Move_201 < PokeBattle_PoisonMove
def initialize(battle,move)
super
@calcCategory = 1
end
def physicalMove?(thisType=nil); return (@calcCategory==0); end
def specialMove?(thisType=nil); return (@calcCategory==1); end
def contactMove?; return (@calcCategory==0); end
def pbOnStartUse(user,targets)
stageMul = [2,2,2,2,2,2, 2, 3,4,5,6,7,8]
stageDiv = [8,7,6,5,4,3, 2, 2,2,2,2,2,2]
# Calculate user's effective attacking value
atk = user.attack
atkStage = user.stages[PBStats::ATTACK]+6
realAtk = (atk.to_f*stageMul[atkStage]/stageDiv[atkStage]).floor
spAtk = user.spatk
spAtkStage = user.stages[PBStats::SPATK]+6
realSpAtk = (spAtk.to_f*stageMul[spAtkStage]/stageDiv[spAtkStage]).floor
# Calculate target's effective defending value
oppDef = targets[0].defense
oppDefStage = targets[0].stages[PBStats::DEFENSE]+6
realOppDef = (oppDef.to_f*stageMul[oppDefStage]/stageDiv[oppDefStage]).floor
oppSpDef = targets[0].spdef
oppSpDefStage = targets[0].stages[PBStats::SPDEF]+6
realOppSpDef = (oppSpDef.to_f*stageMul[oppSpDefStage]/stageDiv[oppSpDefStage]).floor
# Determine move's category
finalPhysical =((((2*user.level/5+2)*90*realAtk)/realOppDef)/50)
finalSpecial =((((2*user.level/5+2)*90*realSpAtk)/realOppSpDef)/50)
@calcCategory=0 if finalPhysical>finalSpecial
@[email protected](2) if finalPhysical==finalSpecial
end
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
hitNum=1 if @calcCategory==0 # Physical anim
super
end
end