Renamed all move function codes

This commit is contained in:
Maruno17
2021-09-06 20:56:37 +01:00
parent c7fd147040
commit c670c63bf5
37 changed files with 13302 additions and 13571 deletions

View File

@@ -522,7 +522,8 @@ class PokeBattle_Battler
def takesSandstormDamage?
return false if !takesIndirectDamage?
return false if pbHasType?(:GROUND) || pbHasType?(:ROCK) || pbHasType?(:STEEL)
return false if inTwoTurnAttack?("0CA","0CB") # Dig, Dive
return false if inTwoTurnAttack?("TwoTurnAttackInvulnerableUnderground",
"TwoTurnAttackInvulnerableUnderwater")
return false if hasActiveAbility?([:OVERCOAT,:SANDFORCE,:SANDRUSH,:SANDVEIL])
return false if hasActiveItem?(:SAFETYGOGGLES)
return true
@@ -531,7 +532,8 @@ class PokeBattle_Battler
def takesHailDamage?
return false if !takesIndirectDamage?
return false if pbHasType?(:ICE)
return false if inTwoTurnAttack?("0CA","0CB") # Dig, Dive
return false if inTwoTurnAttack?("TwoTurnAttackInvulnerableUnderground",
"TwoTurnAttackInvulnerableUnderwater")
return false if hasActiveAbility?([:OVERCOAT,:ICEBODY,:SNOWCLOAK])
return false if hasActiveItem?(:SAFETYGOGGLES)
return true
@@ -627,7 +629,12 @@ class PokeBattle_Battler
end
def semiInvulnerable?
return inTwoTurnAttack?("0C9","0CA","0CB","0CC","0CD","0CE","14D")
return inTwoTurnAttack?("TwoTurnAttackInvulnerableInSky",
"TwoTurnAttackInvulnerableUnderground",
"TwoTurnAttackInvulnerableUnderwater",
"TwoTurnAttackInvulnerableInSkyParalyzeTarget",
"TwoTurnAttackInvulnerableRemoveProtections",
"TwoTurnAttackInvulnerableInSkyTargetCannotAct")
end
def pbEncoredMoveIndex

View File

@@ -372,7 +372,7 @@ class PokeBattle_Battler
# Pokémon which becomes Ghost-type because of Protean, it should
# target and curse itself. I think this is silly, so I'm making it
# choose a random opponent to curse instead.
if move.function=="10D" && targets.length==0 # Curse
if move.function=="CurseTargetOrLowerUserSpd1RaiseUserAtkDef1" && targets.length==0
choice[3] = -1
targets = pbFindTargets(choice,move,user)
end
@@ -658,7 +658,7 @@ class PokeBattle_Battler
if move.pbDamagingMove?
targets.each do |b|
next if b.damageState.unaffected
# NOTE: This method is also used for the OKHO special message.
# NOTE: This method is also used for the OHKO special message.
move.pbHitEffectivenessMessages(user,b,targets.length)
# Record data about the hit for various effects' purposes
move.pbRecordDamageLost(user,b)

View File

@@ -535,17 +535,19 @@ class PokeBattle_Battler
# Future Sight
hitsInvul = true if @battle.futureSight
# Helping Hand
hitsInvul = true if move.function=="09C"
hitsInvul = true if move.function=="PowerUpAllyMove"
if !hitsInvul
# Semi-invulnerable moves
if target.effects[PBEffects::TwoTurnAttack]
if target.inTwoTurnAttack?("0C9","0CC","0CE") # Fly, Bounce, Sky Drop
if target.inTwoTurnAttack?("TwoTurnAttackInvulnerableInSky",
"TwoTurnAttackInvulnerableInSkyParalyzeTarget",
"TwoTurnAttackInvulnerableInSkyTargetCannotAct")
miss = true if !move.hitsFlyingTargets?
elsif target.inTwoTurnAttack?("0CA") # Dig
elsif target.inTwoTurnAttack?("TwoTurnAttackInvulnerableUnderground")
miss = true if !move.hitsDiggingTargets?
elsif target.inTwoTurnAttack?("0CB") # Dive
elsif target.inTwoTurnAttack?("TwoTurnAttackInvulnerableUnderwater")
miss = true if !move.hitsDivingTargets?
elsif target.inTwoTurnAttack?("0CD","14D") # Shadow Force, Phantom Force
elsif target.inTwoTurnAttack?("TwoTurnAttackInvulnerableRemoveProtections")
miss = true
end
end

View File

@@ -145,7 +145,7 @@ class PokeBattle_Battler
user.pbConsumeItem
end
# Room Service
if move.function == "11F" && @battle.field.effects[PBEffects::TrickRoom] > 0 # Trick Room
if move.function == "StartSlowerBattlersActFirst" && @battle.field.effects[PBEffects::TrickRoom] > 0
@battle.battlers.each do |b|
next if !b.hasActiveItem?(:ROOMSERVICE)
next if !b.pbCanLowerStatStage?(:SPEED, b)