mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 14:14:59 +00:00
Added class GameData::Stat
This commit is contained in:
@@ -90,8 +90,8 @@ class PokeBattle_Move
|
||||
# Calculate all multiplier effects
|
||||
modifiers = {}
|
||||
modifiers[:base_accuracy] = baseAcc
|
||||
modifiers[:accuracy_stage] = user.stages[PBStats::ACCURACY]
|
||||
modifiers[:evasion_stage] = target.stages[PBStats::EVASION]
|
||||
modifiers[:accuracy_stage] = user.stages[:ACCURACY]
|
||||
modifiers[:evasion_stage] = target.stages[:EVASION]
|
||||
modifiers[:accuracy_multiplier] = 1.0
|
||||
modifiers[:evasion_multiplier] = 1.0
|
||||
pbCalcAccuracyModifiers(user,target,modifiers)
|
||||
@@ -203,16 +203,16 @@ class PokeBattle_Move
|
||||
|
||||
def pbGetAttackStats(user,target)
|
||||
if specialMove?
|
||||
return user.spatk, user.stages[PBStats::SPATK]+6
|
||||
return user.spatk, user.stages[:SPECIAL_ATTACK]+6
|
||||
end
|
||||
return user.attack, user.stages[PBStats::ATTACK]+6
|
||||
return user.attack, user.stages[:ATTACK]+6
|
||||
end
|
||||
|
||||
def pbGetDefenseStats(user,target)
|
||||
if specialMove?
|
||||
return target.spdef, target.stages[PBStats::SPDEF]+6
|
||||
return target.spdef, target.stages[:SPECIAL_DEFENSE]+6
|
||||
end
|
||||
return target.defense, target.stages[PBStats::DEFENSE]+6
|
||||
return target.defense, target.stages[:DEFENSE]+6
|
||||
end
|
||||
|
||||
def pbCalcDamage(user,target,numTargets=1)
|
||||
|
||||
@@ -561,7 +561,7 @@ end
|
||||
class PokeBattle_Move_01C < PokeBattle_StatUpMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statUp = [PBStats::ATTACK,1]
|
||||
@statUp = [:ATTACK,1]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -573,7 +573,7 @@ end
|
||||
class PokeBattle_Move_01D < PokeBattle_StatUpMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statUp = [PBStats::DEFENSE,1]
|
||||
@statUp = [:DEFENSE,1]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -585,7 +585,7 @@ end
|
||||
class PokeBattle_Move_01E < PokeBattle_StatUpMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statUp = [PBStats::DEFENSE,1]
|
||||
@statUp = [:DEFENSE,1]
|
||||
end
|
||||
|
||||
def pbEffectGeneral(user)
|
||||
@@ -602,7 +602,7 @@ end
|
||||
class PokeBattle_Move_01F < PokeBattle_StatUpMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statUp = [PBStats::SPEED,1]
|
||||
@statUp = [:SPEED,1]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -614,7 +614,7 @@ end
|
||||
class PokeBattle_Move_020 < PokeBattle_StatUpMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statUp = [PBStats::SPATK,1]
|
||||
@statUp = [:SPECIAL_ATTACK,1]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -627,7 +627,7 @@ end
|
||||
class PokeBattle_Move_021 < PokeBattle_StatUpMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statUp = [PBStats::SPDEF,1]
|
||||
@statUp = [:SPECIAL_DEFENSE,1]
|
||||
end
|
||||
|
||||
def pbEffectGeneral(user)
|
||||
@@ -645,7 +645,7 @@ end
|
||||
class PokeBattle_Move_022 < PokeBattle_StatUpMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statUp = [PBStats::EVASION,1]
|
||||
@statUp = [:EVASION,1]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -677,7 +677,7 @@ end
|
||||
class PokeBattle_Move_024 < PokeBattle_MultiStatUpMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statUp = [PBStats::ATTACK,1,PBStats::DEFENSE,1]
|
||||
@statUp = [:ATTACK,1,:DEFENSE,1]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -689,7 +689,7 @@ end
|
||||
class PokeBattle_Move_025 < PokeBattle_MultiStatUpMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statUp = [PBStats::ATTACK,1,PBStats::DEFENSE,1,PBStats::ACCURACY,1]
|
||||
@statUp = [:ATTACK,1,:DEFENSE,1,:ACCURACY,1]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -701,7 +701,7 @@ end
|
||||
class PokeBattle_Move_026 < PokeBattle_MultiStatUpMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statUp = [PBStats::ATTACK,1,PBStats::SPEED,1]
|
||||
@statUp = [:ATTACK,1,:SPEED,1]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -713,7 +713,7 @@ end
|
||||
class PokeBattle_Move_027 < PokeBattle_MultiStatUpMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statUp = [PBStats::ATTACK,1,PBStats::SPATK,1]
|
||||
@statUp = [:ATTACK,1,:SPECIAL_ATTACK,1]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -726,7 +726,7 @@ end
|
||||
class PokeBattle_Move_028 < PokeBattle_MultiStatUpMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statUp = [PBStats::ATTACK,1,PBStats::SPATK,1]
|
||||
@statUp = [:ATTACK,1,:SPECIAL_ATTACK,1]
|
||||
end
|
||||
|
||||
def pbOnStartUse(user,targets)
|
||||
@@ -744,7 +744,7 @@ end
|
||||
class PokeBattle_Move_029 < PokeBattle_MultiStatUpMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statUp = [PBStats::ATTACK,1,PBStats::ACCURACY,1]
|
||||
@statUp = [:ATTACK,1,:ACCURACY,1]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -757,7 +757,7 @@ end
|
||||
class PokeBattle_Move_02A < PokeBattle_MultiStatUpMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statUp = [PBStats::DEFENSE,1,PBStats::SPDEF,1]
|
||||
@statUp = [:DEFENSE,1,:SPECIAL_DEFENSE,1]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -770,7 +770,7 @@ end
|
||||
class PokeBattle_Move_02B < PokeBattle_MultiStatUpMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statUp = [PBStats::SPATK,1,PBStats::SPDEF,1,PBStats::SPEED,1]
|
||||
@statUp = [:SPECIAL_ATTACK,1,:SPECIAL_DEFENSE,1,:SPEED,1]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -782,7 +782,7 @@ end
|
||||
class PokeBattle_Move_02C < PokeBattle_MultiStatUpMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statUp = [PBStats::SPATK,1,PBStats::SPDEF,1]
|
||||
@statUp = [:SPECIAL_ATTACK,1,:SPECIAL_DEFENSE,1]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -795,9 +795,7 @@ end
|
||||
class PokeBattle_Move_02D < PokeBattle_MultiStatUpMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statUp = [PBStats::ATTACK,1,PBStats::DEFENSE,1,
|
||||
PBStats::SPATK,1,PBStats::SPDEF,1,
|
||||
PBStats::SPEED,1]
|
||||
@statUp = [:ATTACK,1,:DEFENSE,1,:SPECIAL_ATTACK,1,:SPECIAL_DEFENSE,1,:SPEED,1]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -809,7 +807,7 @@ end
|
||||
class PokeBattle_Move_02E < PokeBattle_StatUpMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statUp = [PBStats::ATTACK,2]
|
||||
@statUp = [:ATTACK,2]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -821,7 +819,7 @@ end
|
||||
class PokeBattle_Move_02F < PokeBattle_StatUpMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statUp = [PBStats::DEFENSE,2]
|
||||
@statUp = [:DEFENSE,2]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -833,7 +831,7 @@ end
|
||||
class PokeBattle_Move_030 < PokeBattle_StatUpMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statUp = [PBStats::SPEED,2]
|
||||
@statUp = [:SPEED,2]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -846,7 +844,7 @@ end
|
||||
class PokeBattle_Move_031 < PokeBattle_StatUpMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statUp = [PBStats::SPEED,2]
|
||||
@statUp = [:SPEED,2]
|
||||
end
|
||||
|
||||
def pbEffectGeneral(user)
|
||||
@@ -866,7 +864,7 @@ end
|
||||
class PokeBattle_Move_032 < PokeBattle_StatUpMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statUp = [PBStats::SPATK,2]
|
||||
@statUp = [:SPECIAL_ATTACK,2]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -878,7 +876,7 @@ end
|
||||
class PokeBattle_Move_033 < PokeBattle_StatUpMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statUp = [PBStats::SPDEF,2]
|
||||
@statUp = [:SPECIAL_DEFENSE,2]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -890,7 +888,7 @@ end
|
||||
class PokeBattle_Move_034 < PokeBattle_StatUpMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statUp = [PBStats::EVASION,2]
|
||||
@statUp = [:EVASION,2]
|
||||
end
|
||||
|
||||
def pbEffectGeneral(user)
|
||||
@@ -909,8 +907,8 @@ end
|
||||
class PokeBattle_Move_035 < PokeBattle_Move
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statUp = [PBStats::ATTACK,2,PBStats::SPATK,2,PBStats::SPEED,2]
|
||||
@statDown = [PBStats::DEFENSE,1,PBStats::SPDEF,1]
|
||||
@statUp = [:ATTACK,2,:SPECIAL_ATTACK,2,:SPEED,2]
|
||||
@statDown = [:DEFENSE,1,:SPECIAL_DEFENSE,1]
|
||||
end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
@@ -958,7 +956,7 @@ end
|
||||
class PokeBattle_Move_036 < PokeBattle_MultiStatUpMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statUp = [PBStats::SPEED,2,PBStats::ATTACK,1]
|
||||
@statUp = [:SPEED,2,:ATTACK,1]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -970,8 +968,8 @@ end
|
||||
class PokeBattle_Move_037 < PokeBattle_Move
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
@statArray = []
|
||||
PBStats.eachBattleStat do |s|
|
||||
@statArray.push(s) if target.pbCanRaiseStatStage?(s,user,self)
|
||||
GameData::Stat.each_battle do |s|
|
||||
@statArray.push(s.id) if target.pbCanRaiseStatStage?(s.id,user,self)
|
||||
end
|
||||
if @statArray.length==0
|
||||
@battle.pbDisplay(_INTL("{1}'s stats won't go any higher!",target.pbThis))
|
||||
@@ -994,7 +992,7 @@ end
|
||||
class PokeBattle_Move_038 < PokeBattle_StatUpMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statUp = [PBStats::DEFENSE,3]
|
||||
@statUp = [:DEFENSE,3]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1006,7 +1004,7 @@ end
|
||||
class PokeBattle_Move_039 < PokeBattle_StatUpMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statUp = [PBStats::SPATK,3]
|
||||
@statUp = [:SPECIAL_ATTACK,3]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1023,7 +1021,7 @@ class PokeBattle_Move_03A < PokeBattle_Move
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
return true if !user.pbCanRaiseStatStage?(PBStats::ATTACK,user,self,true)
|
||||
return true if !user.pbCanRaiseStatStage?(:ATTACK,user,self,true)
|
||||
return false
|
||||
end
|
||||
|
||||
@@ -1031,11 +1029,11 @@ class PokeBattle_Move_03A < PokeBattle_Move
|
||||
hpLoss = [user.totalhp/2,1].max
|
||||
user.pbReduceHP(hpLoss,false)
|
||||
if user.hasActiveAbility?(:CONTRARY)
|
||||
user.stages[PBStats::ATTACK] = -6
|
||||
user.stages[:ATTACK] = -6
|
||||
@battle.pbCommonAnimation("StatDown",user)
|
||||
@battle.pbDisplay(_INTL("{1} cut its own HP and minimized its Attack!",user.pbThis))
|
||||
else
|
||||
user.stages[PBStats::ATTACK] = 6
|
||||
user.stages[:ATTACK] = 6
|
||||
@battle.pbCommonAnimation("StatUp",user)
|
||||
@battle.pbDisplay(_INTL("{1} cut its own HP and maximized its Attack!",user.pbThis))
|
||||
end
|
||||
@@ -1051,7 +1049,7 @@ end
|
||||
class PokeBattle_Move_03B < PokeBattle_StatDownMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statDown = [PBStats::ATTACK,1,PBStats::DEFENSE,1]
|
||||
@statDown = [:ATTACK,1,:DEFENSE,1]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1064,7 +1062,7 @@ end
|
||||
class PokeBattle_Move_03C < PokeBattle_StatDownMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statDown = [PBStats::DEFENSE,1,PBStats::SPDEF,1]
|
||||
@statDown = [:DEFENSE,1,:SPECIAL_DEFENSE,1]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1077,7 +1075,7 @@ end
|
||||
class PokeBattle_Move_03D < PokeBattle_StatDownMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statDown = [PBStats::SPEED,1,PBStats::DEFENSE,1,PBStats::SPDEF,1]
|
||||
@statDown = [:SPEED,1,:DEFENSE,1,:SPECIAL_DEFENSE,1]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1089,7 +1087,7 @@ end
|
||||
class PokeBattle_Move_03E < PokeBattle_StatDownMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statDown = [PBStats::SPEED,1]
|
||||
@statDown = [:SPEED,1]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1101,7 +1099,7 @@ end
|
||||
class PokeBattle_Move_03F < PokeBattle_StatDownMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statDown = [PBStats::SPATK,2]
|
||||
@statDown = [:SPECIAL_ATTACK,2]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1114,7 +1112,7 @@ class PokeBattle_Move_040 < PokeBattle_Move
|
||||
def pbMoveFailed?(user,targets)
|
||||
failed = true
|
||||
targets.each do |b|
|
||||
next if !b.pbCanRaiseStatStage?(PBStats::SPATK,user,self) &&
|
||||
next if !b.pbCanRaiseStatStage?(:SPECIAL_ATTACK,user,self) &&
|
||||
!b.pbCanConfuse?(user,false,self)
|
||||
failed = false
|
||||
break
|
||||
@@ -1127,8 +1125,8 @@ class PokeBattle_Move_040 < PokeBattle_Move
|
||||
end
|
||||
|
||||
def pbEffectAgainstTarget(user,target)
|
||||
if target.pbCanRaiseStatStage?(PBStats::SPATK,user,self)
|
||||
target.pbRaiseStatStage(PBStats::SPATK,1,user)
|
||||
if target.pbCanRaiseStatStage?(:SPECIAL_ATTACK,user,self)
|
||||
target.pbRaiseStatStage(:SPECIAL_ATTACK,1,user)
|
||||
end
|
||||
target.pbConfuse if target.pbCanConfuse?(user,false,self)
|
||||
end
|
||||
@@ -1143,7 +1141,7 @@ class PokeBattle_Move_041 < PokeBattle_Move
|
||||
def pbMoveFailed?(user,targets)
|
||||
failed = true
|
||||
targets.each do |b|
|
||||
next if !b.pbCanRaiseStatStage?(PBStats::ATTACK,user,self) &&
|
||||
next if !b.pbCanRaiseStatStage?(:ATTACK,user,self) &&
|
||||
!b.pbCanConfuse?(user,false,self)
|
||||
failed = false
|
||||
break
|
||||
@@ -1156,8 +1154,8 @@ class PokeBattle_Move_041 < PokeBattle_Move
|
||||
end
|
||||
|
||||
def pbEffectAgainstTarget(user,target)
|
||||
if target.pbCanRaiseStatStage?(PBStats::ATTACK,user,self)
|
||||
target.pbRaiseStatStage(PBStats::ATTACK,2,user)
|
||||
if target.pbCanRaiseStatStage?(:ATTACK,user,self)
|
||||
target.pbRaiseStatStage(:ATTACK,2,user)
|
||||
end
|
||||
target.pbConfuse if target.pbCanConfuse?(user,false,self)
|
||||
end
|
||||
@@ -1171,7 +1169,7 @@ end
|
||||
class PokeBattle_Move_042 < PokeBattle_TargetStatDownMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statDown = [PBStats::ATTACK,1]
|
||||
@statDown = [:ATTACK,1]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1182,7 +1180,7 @@ end
|
||||
class PokeBattle_Move_043 < PokeBattle_TargetStatDownMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statDown = [PBStats::DEFENSE,1]
|
||||
@statDown = [:DEFENSE,1]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1194,7 +1192,7 @@ end
|
||||
class PokeBattle_Move_044 < PokeBattle_TargetStatDownMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statDown = [PBStats::SPEED,1]
|
||||
@statDown = [:SPEED,1]
|
||||
end
|
||||
|
||||
def pbBaseDamage(baseDmg,user,target)
|
||||
@@ -1213,7 +1211,7 @@ end
|
||||
class PokeBattle_Move_045 < PokeBattle_TargetStatDownMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statDown = [PBStats::SPATK,1]
|
||||
@statDown = [:SPECIAL_ATTACK,1]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1225,7 +1223,7 @@ end
|
||||
class PokeBattle_Move_046 < PokeBattle_TargetStatDownMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statDown = [PBStats::SPDEF,1]
|
||||
@statDown = [:SPECIAL_DEFENSE,1]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1237,7 +1235,7 @@ end
|
||||
class PokeBattle_Move_047 < PokeBattle_TargetStatDownMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statDown = [PBStats::ACCURACY,1]
|
||||
@statDown = [:ACCURACY,1]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1249,7 +1247,7 @@ end
|
||||
class PokeBattle_Move_048 < PokeBattle_TargetStatDownMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statDown = [PBStats::EVASION, (Settings::MECHANICS_GENERATION >= 6) ? 2 : 1]
|
||||
@statDown = [:EVASION, (Settings::MECHANICS_GENERATION >= 6) ? 2 : 1]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1264,7 +1262,7 @@ class PokeBattle_Move_049 < PokeBattle_TargetStatDownMove
|
||||
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statDown = [PBStats::EVASION,1]
|
||||
@statDown = [:EVASION,1]
|
||||
end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
@@ -1364,7 +1362,7 @@ end
|
||||
class PokeBattle_Move_04A < PokeBattle_TargetMultiStatDownMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statDown = [PBStats::ATTACK,1,PBStats::DEFENSE,1]
|
||||
@statDown = [:ATTACK,1,:DEFENSE,1]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1376,7 +1374,7 @@ end
|
||||
class PokeBattle_Move_04B < PokeBattle_TargetStatDownMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statDown = [PBStats::ATTACK,2]
|
||||
@statDown = [:ATTACK,2]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1388,7 +1386,7 @@ end
|
||||
class PokeBattle_Move_04C < PokeBattle_TargetStatDownMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statDown = [PBStats::DEFENSE,2]
|
||||
@statDown = [:DEFENSE,2]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1402,7 +1400,7 @@ class PokeBattle_Move_04D < PokeBattle_TargetStatDownMove
|
||||
super
|
||||
inc = 2
|
||||
inc = 1 if @id == :STRINGSHOT && Settings::MECHANICS_GENERATION <= 5
|
||||
@statDown = [PBStats::SPEED,inc]
|
||||
@statDown = [:SPEED,inc]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1415,7 +1413,7 @@ end
|
||||
class PokeBattle_Move_04E < PokeBattle_TargetStatDownMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statDown = [PBStats::SPATK,2]
|
||||
@statDown = [:SPECIAL_ATTACK,2]
|
||||
end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
@@ -1453,7 +1451,7 @@ end
|
||||
class PokeBattle_Move_04F < PokeBattle_TargetStatDownMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statDown = [PBStats::SPDEF,2]
|
||||
@statDown = [:SPECIAL_DEFENSE,2]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1506,7 +1504,7 @@ class PokeBattle_Move_052 < PokeBattle_Move
|
||||
def ignoresSubstitute?(user); return true; end
|
||||
|
||||
def pbEffectAgainstTarget(user,target)
|
||||
[PBStats::ATTACK,PBStats::SPATK].each do |s|
|
||||
[:ATTACK,:SPECIAL_ATTACK].each do |s|
|
||||
user.stages[s],target.stages[s] = target.stages[s],user.stages[s]
|
||||
end
|
||||
@battle.pbDisplay(_INTL("{1} switched all changes to its Attack and Sp. Atk with the target!",user.pbThis))
|
||||
@@ -1522,7 +1520,7 @@ class PokeBattle_Move_053 < PokeBattle_Move
|
||||
def ignoresSubstitute?(user); return true; end
|
||||
|
||||
def pbEffectAgainstTarget(user,target)
|
||||
[PBStats::DEFENSE,PBStats::SPDEF].each do |s|
|
||||
[:DEFENSE,:SPECIAL_DEFENSE].each do |s|
|
||||
user.stages[s],target.stages[s] = target.stages[s],user.stages[s]
|
||||
end
|
||||
@battle.pbDisplay(_INTL("{1} switched all changes to its Defense and Sp. Def with the target!",user.pbThis))
|
||||
@@ -1538,8 +1536,8 @@ class PokeBattle_Move_054 < PokeBattle_Move
|
||||
def ignoresSubstitute?(user); return true; end
|
||||
|
||||
def pbEffectAgainstTarget(user,target)
|
||||
PBStats.eachBattleStat do |s|
|
||||
user.stages[s],target.stages[s] = target.stages[s],user.stages[s]
|
||||
GameData::Stat.each_battle do |s|
|
||||
user.stages[s.id],target.stages[s.id] = target.stages[s.id],user.stages[s.id]
|
||||
end
|
||||
@battle.pbDisplay(_INTL("{1} switched stat changes with the target!",user.pbThis))
|
||||
end
|
||||
@@ -1554,7 +1552,7 @@ class PokeBattle_Move_055 < PokeBattle_Move
|
||||
def ignoresSubstitute?(user); return true; end
|
||||
|
||||
def pbEffectAgainstTarget(user,target)
|
||||
PBStats.eachBattleStat { |s| user.stages[s] = target.stages[s] }
|
||||
GameData::Stat.each_battle { |s| user.stages[s.id] = target.stages[s.id] }
|
||||
if Settings::NEW_CRITICAL_HIT_RATE_MECHANICS
|
||||
user.effects[PBEffects::FocusEnergy] = target.effects[PBEffects::FocusEnergy]
|
||||
user.effects[PBEffects::LaserFocus] = target.effects[PBEffects::LaserFocus]
|
||||
|
||||
@@ -217,8 +217,8 @@ end
|
||||
class PokeBattle_Move_08E < PokeBattle_Move
|
||||
def pbBaseDamage(baseDmg,user,target)
|
||||
mult = 1
|
||||
PBStats.eachBattleStat { |s| mult += user.stages[s] if user.stages[s]>0 }
|
||||
return 20*mult
|
||||
GameData::Stat.each_battle { |s| mult += user.stages[s.id] if user.stages[s.id] > 0 }
|
||||
return 20 * mult
|
||||
end
|
||||
end
|
||||
|
||||
@@ -231,8 +231,8 @@ end
|
||||
class PokeBattle_Move_08F < PokeBattle_Move
|
||||
def pbBaseDamage(baseDmg,user,target)
|
||||
mult = 3
|
||||
PBStats.eachBattleStat { |s| mult += target.stages[s] if target.stages[s]>0 }
|
||||
return [20*mult,200].min
|
||||
GameData::Stat.each_battle { |s| mult += target.stages[s.id] if target.stages[s.id] > 0 }
|
||||
return [20 * mult, 200].min
|
||||
end
|
||||
end
|
||||
|
||||
@@ -264,23 +264,23 @@ def pbHiddenPower(pkmn)
|
||||
types = []
|
||||
GameData::Type.each { |t| types.push(t.id) if !t.pseudo_type && ![:NORMAL, :SHADOW].include?(t.id)}
|
||||
types.sort! { |a, b| GameData::Type.get(a).id_number <=> GameData::Type.get(b).id_number }
|
||||
idxType |= (iv[PBStats::HP]&1)
|
||||
idxType |= (iv[PBStats::ATTACK]&1)<<1
|
||||
idxType |= (iv[PBStats::DEFENSE]&1)<<2
|
||||
idxType |= (iv[PBStats::SPEED]&1)<<3
|
||||
idxType |= (iv[PBStats::SPATK]&1)<<4
|
||||
idxType |= (iv[PBStats::SPDEF]&1)<<5
|
||||
idxType |= (iv[:HP]&1)
|
||||
idxType |= (iv[:ATTACK]&1)<<1
|
||||
idxType |= (iv[:DEFENSE]&1)<<2
|
||||
idxType |= (iv[:SPEED]&1)<<3
|
||||
idxType |= (iv[:SPECIAL_ATTACK]&1)<<4
|
||||
idxType |= (iv[:SPECIAL_DEFENSE]&1)<<5
|
||||
idxType = (types.length-1)*idxType/63
|
||||
type = types[idxType]
|
||||
if Settings::MECHANICS_GENERATION <= 5
|
||||
powerMin = 30
|
||||
powerMax = 70
|
||||
power |= (iv[PBStats::HP]&2)>>1
|
||||
power |= (iv[PBStats::ATTACK]&2)
|
||||
power |= (iv[PBStats::DEFENSE]&2)<<1
|
||||
power |= (iv[PBStats::SPEED]&2)<<2
|
||||
power |= (iv[PBStats::SPATK]&2)<<3
|
||||
power |= (iv[PBStats::SPDEF]&2)<<4
|
||||
power |= (iv[:HP]&2)>>1
|
||||
power |= (iv[:ATTACK]&2)
|
||||
power |= (iv[:DEFENSE]&2)<<1
|
||||
power |= (iv[:SPEED]&2)<<2
|
||||
power |= (iv[:SPECIAL_ATTACK]&2)<<3
|
||||
power |= (iv[:SPECIAL_DEFENSE]&2)<<4
|
||||
power = powerMin+(powerMax-powerMin)*power/63
|
||||
end
|
||||
return [type,power]
|
||||
@@ -925,24 +925,24 @@ class PokeBattle_Move_0A4 < PokeBattle_Move
|
||||
when 9
|
||||
target.pbFreeze if target.pbCanFreeze?(user,false,self)
|
||||
when 5
|
||||
if target.pbCanLowerStatStage?(PBStats::ATTACK,user,self)
|
||||
target.pbLowerStatStage(PBStats::ATTACK,1,user)
|
||||
if target.pbCanLowerStatStage?(:ATTACK,user,self)
|
||||
target.pbLowerStatStage(:ATTACK,1,user)
|
||||
end
|
||||
when 14
|
||||
if target.pbCanLowerStatStage?(PBStats::DEFENSE,user,self)
|
||||
target.pbLowerStatStage(PBStats::DEFENSE,1,user)
|
||||
if target.pbCanLowerStatStage?(:DEFENSE,user,self)
|
||||
target.pbLowerStatStage(:DEFENSE,1,user)
|
||||
end
|
||||
when 3
|
||||
if target.pbCanLowerStatStage?(PBStats::SPATK,user,self)
|
||||
target.pbLowerStatStage(PBStats::SPATK,1,user)
|
||||
if target.pbCanLowerStatStage?(:SPECIAL_ATTACK,user,self)
|
||||
target.pbLowerStatStage(:SPECIAL_ATTACK,1,user)
|
||||
end
|
||||
when 4, 6, 12
|
||||
if target.pbCanLowerStatStage?(PBStats::SPEED,user,self)
|
||||
target.pbLowerStatStage(PBStats::SPEED,1,user)
|
||||
if target.pbCanLowerStatStage?(:SPEED,user,self)
|
||||
target.pbLowerStatStage(:SPEED,1,user)
|
||||
end
|
||||
when 8
|
||||
if target.pbCanLowerStatStage?(PBStats::ACCURACY,user,self)
|
||||
target.pbLowerStatStage(PBStats::ACCURACY,1,user)
|
||||
if target.pbCanLowerStatStage?(:ACCURACY,user,self)
|
||||
target.pbLowerStatStage(:ACCURACY,1,user)
|
||||
end
|
||||
when 7, 11, 13
|
||||
target.pbFlinch(user)
|
||||
@@ -1997,7 +1997,7 @@ class PokeBattle_Move_0C1 < PokeBattle_Move
|
||||
|
||||
def pbBaseDamage(baseDmg,user,target)
|
||||
i = @beatUpList.shift # First element in array, and removes it from array
|
||||
atk = @battle.pbParty(user.index)[i].baseStats[PBStats::ATTACK]
|
||||
atk = @battle.pbParty(user.index)[i].baseStats[:ATTACK]
|
||||
return 5+(atk/10)
|
||||
end
|
||||
end
|
||||
@@ -2120,8 +2120,8 @@ class PokeBattle_Move_0C8 < PokeBattle_TwoTurnMove
|
||||
end
|
||||
|
||||
def pbChargingTurnEffect(user,target)
|
||||
if user.pbCanRaiseStatStage?(PBStats::DEFENSE,user,self)
|
||||
user.pbRaiseStatStage(PBStats::DEFENSE,1,user)
|
||||
if user.pbCanRaiseStatStage?(:DEFENSE,user,self)
|
||||
user.pbRaiseStatStage(:DEFENSE,1,user)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -2778,7 +2778,7 @@ end
|
||||
class PokeBattle_Move_0E2 < PokeBattle_TargetMultiStatDownMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statDown = [PBStats::ATTACK,2,PBStats::SPATK,2]
|
||||
@statDown = [:ATTACK,2,:SPECIAL_ATTACK,2]
|
||||
end
|
||||
|
||||
# NOTE: The user faints even if the target's stats cannot be changed, so this
|
||||
|
||||
@@ -267,9 +267,9 @@ class PokeBattle_Move_10D < PokeBattle_Move
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
return false if user.pbHasType?(:GHOST)
|
||||
if !user.pbCanLowerStatStage?(PBStats::SPEED,user,self) &&
|
||||
!user.pbCanRaiseStatStage?(PBStats::ATTACK,user,self) &&
|
||||
!user.pbCanRaiseStatStage?(PBStats::DEFENSE,user,self)
|
||||
if !user.pbCanLowerStatStage?(:SPEED,user,self) &&
|
||||
!user.pbCanRaiseStatStage?(:ATTACK,user,self) &&
|
||||
!user.pbCanRaiseStatStage?(:DEFENSE,user,self)
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
@@ -287,17 +287,17 @@ class PokeBattle_Move_10D < PokeBattle_Move
|
||||
def pbEffectGeneral(user)
|
||||
return if user.pbHasType?(:GHOST)
|
||||
# Non-Ghost effect
|
||||
if user.pbCanLowerStatStage?(PBStats::SPEED,user,self)
|
||||
user.pbLowerStatStage(PBStats::SPEED,1,user)
|
||||
if user.pbCanLowerStatStage?(:SPEED,user,self)
|
||||
user.pbLowerStatStage(:SPEED,1,user)
|
||||
end
|
||||
showAnim = true
|
||||
if user.pbCanRaiseStatStage?(PBStats::ATTACK,user,self)
|
||||
if user.pbRaiseStatStage(PBStats::ATTACK,1,user,showAnim)
|
||||
if user.pbCanRaiseStatStage?(:ATTACK,user,self)
|
||||
if user.pbRaiseStatStage(:ATTACK,1,user,showAnim)
|
||||
showAnim = false
|
||||
end
|
||||
end
|
||||
if user.pbCanRaiseStatStage?(PBStats::DEFENSE,user,self)
|
||||
user.pbRaiseStatStage(PBStats::DEFENSE,1,user,showAnim)
|
||||
if user.pbCanRaiseStatStage?(:DEFENSE,user,self)
|
||||
user.pbRaiseStatStage(:DEFENSE,1,user,showAnim)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -482,14 +482,14 @@ class PokeBattle_Move_112 < PokeBattle_Move
|
||||
@battle.pbDisplay(_INTL("{1} stockpiled {2}!",
|
||||
user.pbThis,user.effects[PBEffects::Stockpile]))
|
||||
showAnim = true
|
||||
if user.pbCanRaiseStatStage?(PBStats::DEFENSE,user,self)
|
||||
if user.pbRaiseStatStage(PBStats::DEFENSE,1,user,showAnim)
|
||||
if user.pbCanRaiseStatStage?(:DEFENSE,user,self)
|
||||
if user.pbRaiseStatStage(:DEFENSE,1,user,showAnim)
|
||||
user.effects[PBEffects::StockpileDef] += 1
|
||||
showAnim = false
|
||||
end
|
||||
end
|
||||
if user.pbCanRaiseStatStage?(PBStats::SPDEF,user,self)
|
||||
if user.pbRaiseStatStage(PBStats::SPDEF,1,user,showAnim)
|
||||
if user.pbCanRaiseStatStage?(:SPECIAL_DEFENSE,user,self)
|
||||
if user.pbRaiseStatStage(:SPECIAL_DEFENSE,1,user,showAnim)
|
||||
user.effects[PBEffects::StockpileSpDef] += 1
|
||||
end
|
||||
end
|
||||
@@ -522,14 +522,14 @@ class PokeBattle_Move_113 < PokeBattle_Move
|
||||
return if @battle.pbAllFainted?(target.idxOwnSide)
|
||||
showAnim = true
|
||||
if user.effects[PBEffects::StockpileDef]>0 &&
|
||||
user.pbCanLowerStatStage?(PBStats::DEFENSE,user,self)
|
||||
if user.pbLowerStatStage(PBStats::DEFENSE,user.effects[PBEffects::StockpileDef],user,showAnim)
|
||||
user.pbCanLowerStatStage?(:DEFENSE,user,self)
|
||||
if user.pbLowerStatStage(:DEFENSE,user.effects[PBEffects::StockpileDef],user,showAnim)
|
||||
showAnim = false
|
||||
end
|
||||
end
|
||||
if user.effects[PBEffects::StockpileSpDef]>0 &&
|
||||
user.pbCanLowerStatStage?(PBStats::SPDEF,user,self)
|
||||
user.pbLowerStatStage(PBStats::SPDEF,user.effects[PBEffects::StockpileSpDef],user,showAnim)
|
||||
user.pbCanLowerStatStage?(:SPECIAL_DEFENSE,user,self)
|
||||
user.pbLowerStatStage(:SPECIAL_DEFENSE,user.effects[PBEffects::StockpileSpDef],user,showAnim)
|
||||
end
|
||||
user.effects[PBEffects::Stockpile] = 0
|
||||
user.effects[PBEffects::StockpileDef] = 0
|
||||
@@ -573,14 +573,14 @@ class PokeBattle_Move_114 < PokeBattle_Move
|
||||
@battle.pbDisplay(_INTL("{1}'s stockpiled effect wore off!",user.pbThis))
|
||||
showAnim = true
|
||||
if user.effects[PBEffects::StockpileDef]>0 &&
|
||||
user.pbCanLowerStatStage?(PBStats::DEFENSE,user,self)
|
||||
if user.pbLowerStatStage(PBStats::DEFENSE,user.effects[PBEffects::StockpileDef],user,showAnim)
|
||||
user.pbCanLowerStatStage?(:DEFENSE,user,self)
|
||||
if user.pbLowerStatStage(:DEFENSE,user.effects[PBEffects::StockpileDef],user,showAnim)
|
||||
showAnim = false
|
||||
end
|
||||
end
|
||||
if user.effects[PBEffects::StockpileSpDef]>0 &&
|
||||
user.pbCanLowerStatStage?(PBStats::SPDEF,user,self)
|
||||
user.pbLowerStatStage(PBStats::SPDEF,user.effects[PBEffects::StockpileSpDef],user,showAnim)
|
||||
user.pbCanLowerStatStage?(:SPECIAL_DEFENSE,user,self)
|
||||
user.pbLowerStatStage(:SPECIAL_DEFENSE,user.effects[PBEffects::StockpileSpDef],user,showAnim)
|
||||
end
|
||||
user.effects[PBEffects::Stockpile] = 0
|
||||
user.effects[PBEffects::StockpileDef] = 0
|
||||
@@ -929,9 +929,9 @@ end
|
||||
class PokeBattle_Move_121 < PokeBattle_Move
|
||||
def pbGetAttackStats(user,target)
|
||||
if specialMove?
|
||||
return target.spatk, target.stages[PBStats::SPATK]+6
|
||||
return target.spatk, target.stages[:SPECIAL_ATTACK]+6
|
||||
end
|
||||
return target.attack, target.stages[PBStats::ATTACK]+6
|
||||
return target.attack, target.stages[:ATTACK]+6
|
||||
end
|
||||
end
|
||||
|
||||
@@ -943,7 +943,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_122 < PokeBattle_Move
|
||||
def pbGetDefenseStats(user,target)
|
||||
return target.defense, target.stages[PBStats::DEFENSE]+6
|
||||
return target.defense, target.stages[:DEFENSE]+6
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1100,8 +1100,8 @@ class PokeBattle_Move_137 < PokeBattle_Move
|
||||
@validTargets = []
|
||||
@battle.eachSameSideBattler(user) do |b|
|
||||
next if !b.hasActiveAbility?([:MINUS,:PLUS])
|
||||
next if !b.pbCanRaiseStatStage?(PBStats::DEFENSE,user,self) &&
|
||||
!b.pbCanRaiseStatStage?(PBStats::SPDEF,user,self)
|
||||
next if !b.pbCanRaiseStatStage?(:DEFENSE,user,self) &&
|
||||
!b.pbCanRaiseStatStage?(:SPECIAL_DEFENSE,user,self)
|
||||
@validTargets.push(b)
|
||||
end
|
||||
if @validTargets.length==0
|
||||
@@ -1121,13 +1121,13 @@ class PokeBattle_Move_137 < PokeBattle_Move
|
||||
|
||||
def pbEffectAgainstTarget(user,target)
|
||||
showAnim = true
|
||||
if target.pbCanRaiseStatStage?(PBStats::DEFENSE,user,self)
|
||||
if target.pbRaiseStatStage(PBStats::DEFENSE,1,user,showAnim)
|
||||
if target.pbCanRaiseStatStage?(:DEFENSE,user,self)
|
||||
if target.pbRaiseStatStage(:DEFENSE,1,user,showAnim)
|
||||
showAnim = false
|
||||
end
|
||||
end
|
||||
if target.pbCanRaiseStatStage?(PBStats::SPDEF,user,self)
|
||||
target.pbRaiseStatStage(PBStats::SPDEF,1,user,showAnim)
|
||||
if target.pbCanRaiseStatStage?(:SPECIAL_DEFENSE,user,self)
|
||||
target.pbRaiseStatStage(:SPECIAL_DEFENSE,1,user,showAnim)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1146,12 +1146,12 @@ class PokeBattle_Move_138 < PokeBattle_Move
|
||||
def ignoresSubstitute?(user); return true; end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
return true if !target.pbCanRaiseStatStage?(PBStats::SPDEF,user,self,true)
|
||||
return true if !target.pbCanRaiseStatStage?(:SPECIAL_DEFENSE,user,self,true)
|
||||
return false
|
||||
end
|
||||
|
||||
def pbEffectAgainstTarget(user,target)
|
||||
target.pbRaiseStatStage(PBStats::SPDEF,1,user)
|
||||
target.pbRaiseStatStage(:SPECIAL_DEFENSE,1,user)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1165,7 +1165,7 @@ class PokeBattle_Move_139 < PokeBattle_TargetStatDownMove
|
||||
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statDown = [PBStats::ATTACK,1]
|
||||
@statDown = [:ATTACK,1]
|
||||
end
|
||||
|
||||
def pbAccuracyCheck(user,target); return true; end
|
||||
@@ -1182,7 +1182,7 @@ class PokeBattle_Move_13A < PokeBattle_TargetMultiStatDownMove
|
||||
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statDown = [PBStats::ATTACK,1,PBStats::SPATK,1]
|
||||
@statDown = [:ATTACK,1,:SPECIAL_ATTACK,1]
|
||||
end
|
||||
|
||||
def pbAccuracyCheck(user,target); return true; end
|
||||
@@ -1199,7 +1199,7 @@ class PokeBattle_Move_13B < PokeBattle_StatDownMove
|
||||
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statDown = [PBStats::DEFENSE,1]
|
||||
@statDown = [:DEFENSE,1]
|
||||
end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
@@ -1237,7 +1237,7 @@ class PokeBattle_Move_13C < PokeBattle_TargetStatDownMove
|
||||
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statDown = [PBStats::SPATK,1]
|
||||
@statDown = [:SPECIAL_ATTACK,1]
|
||||
end
|
||||
|
||||
def pbAccuracyCheck(user,target); return true; end
|
||||
@@ -1251,7 +1251,7 @@ end
|
||||
class PokeBattle_Move_13D < PokeBattle_TargetStatDownMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statDown = [PBStats::SPATK,2]
|
||||
@statDown = [:SPECIAL_ATTACK,2]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1267,8 +1267,8 @@ class PokeBattle_Move_13E < PokeBattle_Move
|
||||
@battle.eachBattler do |b|
|
||||
next if !b.pbHasType?(:GRASS)
|
||||
next if b.airborne? || b.semiInvulnerable?
|
||||
next if !b.pbCanRaiseStatStage?(PBStats::ATTACK,user,self) &&
|
||||
!b.pbCanRaiseStatStage?(PBStats::SPATK,user,self)
|
||||
next if !b.pbCanRaiseStatStage?(:ATTACK,user,self) &&
|
||||
!b.pbCanRaiseStatStage?(:SPECIAL_ATTACK,user,self)
|
||||
@validTargets.push(b.index)
|
||||
end
|
||||
if @validTargets.length==0
|
||||
@@ -1288,13 +1288,13 @@ class PokeBattle_Move_13E < PokeBattle_Move
|
||||
|
||||
def pbEffectAgainstTarget(user,target)
|
||||
showAnim = true
|
||||
if target.pbCanRaiseStatStage?(PBStats::ATTACK,user,self)
|
||||
if target.pbRaiseStatStage(PBStats::ATTACK,1,user,showAnim)
|
||||
if target.pbCanRaiseStatStage?(:ATTACK,user,self)
|
||||
if target.pbRaiseStatStage(:ATTACK,1,user,showAnim)
|
||||
showAnim = false
|
||||
end
|
||||
end
|
||||
if target.pbCanRaiseStatStage?(PBStats::SPATK,user,self)
|
||||
target.pbRaiseStatStage(PBStats::SPATK,1,user,showAnim)
|
||||
if target.pbCanRaiseStatStage?(:SPECIAL_ATTACK,user,self)
|
||||
target.pbRaiseStatStage(:SPECIAL_ATTACK,1,user,showAnim)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1311,7 +1311,7 @@ class PokeBattle_Move_13F < PokeBattle_Move
|
||||
@battle.eachBattler do |b|
|
||||
next if !b.pbHasType?(:GRASS)
|
||||
next if b.semiInvulnerable?
|
||||
next if !b.pbCanRaiseStatStage?(PBStats::DEFENSE,user,self)
|
||||
next if !b.pbCanRaiseStatStage?(:DEFENSE,user,self)
|
||||
@validTargets.push(b.index)
|
||||
end
|
||||
if @validTargets.length==0
|
||||
@@ -1324,11 +1324,11 @@ class PokeBattle_Move_13F < PokeBattle_Move
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
return false if @validTargets.include?(target.index)
|
||||
return true if !target.pbHasType?(:GRASS) || target.semiInvulnerable?
|
||||
return !target.pbCanRaiseStatStage?(PBStats::DEFENSE,user,self,true)
|
||||
return !target.pbCanRaiseStatStage?(:DEFENSE,user,self,true)
|
||||
end
|
||||
|
||||
def pbEffectAgainstTarget(user,target)
|
||||
target.pbRaiseStatStage(PBStats::DEFENSE,1,user)
|
||||
target.pbRaiseStatStage(:DEFENSE,1,user)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1344,9 +1344,9 @@ class PokeBattle_Move_140 < PokeBattle_Move
|
||||
targets.each do |b|
|
||||
next if !b || b.fainted?
|
||||
next if !b.poisoned?
|
||||
next if !b.pbCanLowerStatStage?(PBStats::ATTACK,user,self) &&
|
||||
!b.pbCanLowerStatStage?(PBStats::SPATK,user,self) &&
|
||||
!b.pbCanLowerStatStage?(PBStats::SPEED,user,self)
|
||||
next if !b.pbCanLowerStatStage?(:ATTACK,user,self) &&
|
||||
!b.pbCanLowerStatStage?(:SPECIAL_ATTACK,user,self) &&
|
||||
!b.pbCanLowerStatStage?(:SPEED,user,self)
|
||||
@validTargets.push(b.index)
|
||||
end
|
||||
if @validTargets.length==0
|
||||
@@ -1359,7 +1359,7 @@ class PokeBattle_Move_140 < PokeBattle_Move
|
||||
def pbEffectAgainstTarget(user,target)
|
||||
return if !@validTargets.include?(target.index)
|
||||
showAnim = true
|
||||
[PBStats::ATTACK,PBStats::SPATK,PBStats::SPEED].each do |s|
|
||||
[:ATTACK,:SPECIAL_ATTACK,:SPEED].each do |s|
|
||||
next if !target.pbCanLowerStatStage?(s,user,self)
|
||||
if target.pbLowerStatStage(s,1,user,showAnim)
|
||||
showAnim = false
|
||||
@@ -1376,8 +1376,8 @@ end
|
||||
class PokeBattle_Move_141 < PokeBattle_Move
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
failed = true
|
||||
PBStats.eachBattleStat do |s|
|
||||
next if target.stages[s]==0
|
||||
GameData::Stat.each_battle do |s|
|
||||
next if target.stages[s.id] == 0
|
||||
failed = false
|
||||
break
|
||||
end
|
||||
@@ -1389,7 +1389,7 @@ class PokeBattle_Move_141 < PokeBattle_Move
|
||||
end
|
||||
|
||||
def pbEffectAgainstTarget(user,target)
|
||||
PBStats.eachBattleStat { |s| target.stages[s] *= -1 }
|
||||
GameData::Stat.each_battle { |s| target.stages[s.id] *= -1 }
|
||||
@battle.pbDisplay(_INTL("{1}'s stats were reversed!",target.pbThis))
|
||||
end
|
||||
end
|
||||
@@ -1636,9 +1636,9 @@ end
|
||||
class PokeBattle_Move_14E < PokeBattle_TwoTurnMove
|
||||
def pbMoveFailed?(user,targets)
|
||||
return false if user.effects[PBEffects::TwoTurnAttack] # Charging turn
|
||||
if !user.pbCanRaiseStatStage?(PBStats::SPATK,user,self) &&
|
||||
!user.pbCanRaiseStatStage?(PBStats::SPDEF,user,self) &&
|
||||
!user.pbCanRaiseStatStage?(PBStats::SPEED,user,self)
|
||||
if !user.pbCanRaiseStatStage?(:SPECIAL_ATTACK,user,self) &&
|
||||
!user.pbCanRaiseStatStage?(:SPECIAL_DEFENSE,user,self) &&
|
||||
!user.pbCanRaiseStatStage?(:SPEED,user,self)
|
||||
@battle.pbDisplay(_INTL("{1}'s stats won't go any higher!",user.pbThis))
|
||||
return true
|
||||
end
|
||||
@@ -1651,7 +1651,7 @@ class PokeBattle_Move_14E < PokeBattle_TwoTurnMove
|
||||
|
||||
def pbAttackingTurnEffect(user,target)
|
||||
showAnim = true
|
||||
[PBStats::SPATK,PBStats::SPDEF,PBStats::SPEED].each do |s|
|
||||
[:SPECIAL_ATTACK,:SPECIAL_DEFENSE,:SPEED].each do |s|
|
||||
next if !user.pbCanRaiseStatStage?(s,user,self)
|
||||
if user.pbRaiseStatStage(s,2,user,showAnim)
|
||||
showAnim = false
|
||||
@@ -1684,8 +1684,8 @@ end
|
||||
class PokeBattle_Move_150 < PokeBattle_Move
|
||||
def pbEffectAfterAllHits(user,target)
|
||||
return if !target.damageState.fainted
|
||||
return if !user.pbCanRaiseStatStage?(PBStats::ATTACK,user,self)
|
||||
user.pbRaiseStatStage(PBStats::ATTACK,3,user)
|
||||
return if !user.pbCanRaiseStatStage?(:ATTACK,user,self)
|
||||
user.pbRaiseStatStage(:ATTACK,3,user)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1698,7 +1698,7 @@ end
|
||||
class PokeBattle_Move_151 < PokeBattle_TargetMultiStatDownMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statDown = [PBStats::ATTACK,1,PBStats::SPATK,1]
|
||||
@statDown = [:ATTACK,1,:SPECIAL_ATTACK,1]
|
||||
end
|
||||
|
||||
def pbEndOfMoveUsageEffect(user,targets,numHits,switchedBattlers)
|
||||
@@ -1874,7 +1874,7 @@ end
|
||||
class PokeBattle_Move_159 < PokeBattle_Move
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
if !target.pbCanPoison?(user,false,self) &&
|
||||
!target.pbCanLowerStatStage?(PBStats::SPEED,user,self)
|
||||
!target.pbCanLowerStatStage?(:SPEED,user,self)
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
@@ -1883,8 +1883,8 @@ class PokeBattle_Move_159 < PokeBattle_Move
|
||||
|
||||
def pbEffectAgainstTarget(user,target)
|
||||
target.pbPoison(user) if target.pbCanPoison?(user,false,self)
|
||||
if target.pbCanLowerStatStage?(PBStats::SPEED,user,self)
|
||||
target.pbLowerStatStage(PBStats::SPEED,1,user)
|
||||
if target.pbCanLowerStatStage?(:SPEED,user,self)
|
||||
target.pbLowerStatStage(:SPEED,1,user)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1947,8 +1947,8 @@ class PokeBattle_Move_15C < PokeBattle_Move
|
||||
@validTargets = []
|
||||
@battle.eachSameSideBattler(user) do |b|
|
||||
next if !b.hasActiveAbility?([:MINUS,:PLUS])
|
||||
next if !b.pbCanRaiseStatStage?(PBStats::ATTACK,user,self) &&
|
||||
!b.pbCanRaiseStatStage?(PBStats::SPATK,user,self)
|
||||
next if !b.pbCanRaiseStatStage?(:ATTACK,user,self) &&
|
||||
!b.pbCanRaiseStatStage?(:SPECIAL_ATTACK,user,self)
|
||||
@validTargets.push(b)
|
||||
end
|
||||
if @validTargets.length==0
|
||||
@@ -1967,13 +1967,13 @@ class PokeBattle_Move_15C < PokeBattle_Move
|
||||
|
||||
def pbEffectAgainstTarget(user,target)
|
||||
showAnim = true
|
||||
if target.pbCanRaiseStatStage?(PBStats::ATTACK,user,self)
|
||||
if target.pbRaiseStatStage(PBStats::ATTACK,1,user,showAnim)
|
||||
if target.pbCanRaiseStatStage?(:ATTACK,user,self)
|
||||
if target.pbRaiseStatStage(:ATTACK,1,user,showAnim)
|
||||
showAnim = false
|
||||
end
|
||||
end
|
||||
if target.pbCanRaiseStatStage?(PBStats::SPATK,user,self)
|
||||
target.pbRaiseStatStage(PBStats::SPATK,1,user,showAnim)
|
||||
if target.pbCanRaiseStatStage?(:SPECIAL_ATTACK,user,self)
|
||||
target.pbRaiseStatStage(:SPECIAL_ATTACK,1,user,showAnim)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1998,14 +1998,14 @@ class PokeBattle_Move_15D < PokeBattle_Move
|
||||
pbShowAnimation(@id,user,target,1) # Stat stage-draining animation
|
||||
@battle.pbDisplay(_INTL("{1} stole the target's boosted stats!",user.pbThis))
|
||||
showAnim = true
|
||||
PBStats.eachBattleStat do |s|
|
||||
next if target.stages[s]<=0
|
||||
if user.pbCanRaiseStatStage?(s,user,self)
|
||||
if user.pbRaiseStatStage(s,target.stages[s],user,showAnim)
|
||||
GameData::Stat.each_battle do |s|
|
||||
next if target.stages[s.id] <= 0
|
||||
if user.pbCanRaiseStatStage?(s.id,user,self)
|
||||
if user.pbRaiseStatStage(s.id,target.stages[s.id],user,showAnim)
|
||||
showAnim = false
|
||||
end
|
||||
end
|
||||
target.stages[s] = 0
|
||||
target.stages[s.id] = 0
|
||||
end
|
||||
end
|
||||
super
|
||||
@@ -2033,7 +2033,7 @@ end
|
||||
class PokeBattle_Move_15F < PokeBattle_StatDownMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statDown = [PBStats::DEFENSE,1]
|
||||
@statDown = [:DEFENSE,1]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2054,10 +2054,10 @@ class PokeBattle_Move_160 < PokeBattle_Move
|
||||
# works even if the stat stage cannot be changed due to an ability or
|
||||
# other effect.
|
||||
if !@battle.moldBreaker && target.hasActiveAbility?(:CONTRARY) &&
|
||||
target.statStageAtMax?(PBStats::ATTACK)
|
||||
target.statStageAtMax?(:ATTACK)
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
elsif target.statStageAtMin?(PBStats::ATTACK)
|
||||
elsif target.statStageAtMin?(:ATTACK)
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
@@ -2069,11 +2069,11 @@ class PokeBattle_Move_160 < PokeBattle_Move
|
||||
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]
|
||||
atk = target.attack
|
||||
atkStage = target.stages[PBStats::ATTACK]+6
|
||||
atkStage = target.stages[:ATTACK]+6
|
||||
healAmt = (atk.to_f*stageMul[atkStage]/stageDiv[atkStage]).floor
|
||||
# Reduce target's Attack stat
|
||||
if target.pbCanLowerStatStage?(PBStats::ATTACK,user,self)
|
||||
target.pbLowerStatStage(PBStats::ATTACK,1,user)
|
||||
if target.pbCanLowerStatStage?(:ATTACK,user,self)
|
||||
target.pbLowerStatStage(:ATTACK,1,user)
|
||||
end
|
||||
# Heal user
|
||||
if target.hasActiveAbility?(:LIQUIDOOZE)
|
||||
@@ -2160,10 +2160,10 @@ class PokeBattle_Move_164 < PokeBattle_Move_163
|
||||
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]
|
||||
atk = user.attack
|
||||
atkStage = user.stages[PBStats::ATTACK]+6
|
||||
atkStage = user.stages[:ATTACK]+6
|
||||
realAtk = (atk.to_f*stageMul[atkStage]/stageDiv[atkStage]).floor
|
||||
spAtk = user.spatk
|
||||
spAtkStage = user.stages[PBStats::SPATK]+6
|
||||
spAtkStage = user.stages[:SPECIAL_ATTACK]+6
|
||||
realSpAtk = (spAtk.to_f*stageMul[spAtkStage]/stageDiv[spAtkStage]).floor
|
||||
# Determine move's category
|
||||
@calcCategory = (realAtk>realSpAtk) ? 0 : 1
|
||||
|
||||
Reference in New Issue
Block a user