mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-08 21:54:58 +00:00
Made AI function code-specific MoveFailureCheck handlers
This commit is contained in:
@@ -85,6 +85,8 @@ end
|
||||
# Raise one of user's stats.
|
||||
#===============================================================================
|
||||
class Battle::Move::StatUpMove < Battle::Move
|
||||
attr_reader :statUp
|
||||
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def pbMoveFailed?(user, targets)
|
||||
@@ -108,6 +110,8 @@ end
|
||||
# Raise multiple of user's stats.
|
||||
#===============================================================================
|
||||
class Battle::Move::MultiStatUpMove < Battle::Move
|
||||
attr_reader :statUp
|
||||
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def pbMoveFailed?(user, targets)
|
||||
@@ -167,6 +171,8 @@ end
|
||||
# Lower one of target's stats.
|
||||
#===============================================================================
|
||||
class Battle::Move::TargetStatDownMove < Battle::Move
|
||||
attr_reader :statDown
|
||||
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbFailsAgainstTarget?(user, target, show_message)
|
||||
@@ -190,6 +196,8 @@ end
|
||||
# Lower multiple of target's stats.
|
||||
#===============================================================================
|
||||
class Battle::Move::TargetMultiStatDownMove < Battle::Move
|
||||
attr_reader :statDown
|
||||
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbFailsAgainstTarget?(user, target, show_message)
|
||||
@@ -479,6 +487,8 @@ end
|
||||
# Weather-inducing move.
|
||||
#===============================================================================
|
||||
class Battle::Move::WeatherMove < Battle::Move
|
||||
attr_reader :weatherType
|
||||
|
||||
def initialize(battle, move)
|
||||
super
|
||||
@weatherType = :None
|
||||
|
||||
@@ -459,6 +459,8 @@ end
|
||||
# side. (Court Change)
|
||||
#===============================================================================
|
||||
class Battle::Move::SwapSideEffects < Battle::Move
|
||||
attr_reader :number_effects, :boolean_effects
|
||||
|
||||
def initialize(battle, move)
|
||||
super
|
||||
@number_effects = [
|
||||
|
||||
@@ -407,6 +407,8 @@ end
|
||||
# (Shell Smash)
|
||||
#===============================================================================
|
||||
class Battle::Move::LowerUserDefSpDef1RaiseUserAtkSpAtkSpd2 < Battle::Move
|
||||
attr_reader :statUp, :statDown
|
||||
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def initialize(battle, move)
|
||||
@@ -1397,7 +1399,7 @@ end
|
||||
# Raises the Attack and Defense of all user's allies by 1 stage each. Bypasses
|
||||
# protections, including Crafty Shield. Fails if there is no ally. (Coaching)
|
||||
#===============================================================================
|
||||
class Battle::Move::RaiseUserAndAlliesAtkDef1 < Battle::Move
|
||||
class Battle::Move::RaiseAlliesAtkDef1 < Battle::Move
|
||||
def ignoresSubstitute?(user); return true; end
|
||||
def canSnatch?; return true; end
|
||||
|
||||
|
||||
@@ -957,7 +957,7 @@ class Battle::Move::SetTargetAbilityToSimple < Battle::Move
|
||||
end
|
||||
|
||||
def pbFailsAgainstTarget?(user, target, show_message)
|
||||
if target.unstoppableAbility? || [:TRUANT, :SIMPLE].include?(target.ability)
|
||||
if target.unstoppableAbility? || [:TRUANT, :SIMPLE].include?(target.ability_id)
|
||||
@battle.pbDisplay(_INTL("But it failed!")) if show_message
|
||||
return true
|
||||
end
|
||||
@@ -1165,7 +1165,7 @@ class Battle::Move::NegateTargetAbility < Battle::Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbFailsAgainstTarget?(user, target, show_message)
|
||||
if target.unstoppableAbility?
|
||||
if target.unstoppableAbility? || target.effects[PBEffects::GastroAcid]
|
||||
@battle.pbDisplay(_INTL("But it failed!")) if show_message
|
||||
return true
|
||||
end
|
||||
|
||||
@@ -453,8 +453,6 @@ class Battle::Move::DoublePowerIfTargetPoisoned < Battle::Move
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
# Power is doubled if the target is paralyzed. Cures the target of paralysis.
|
||||
# (Smelling Salts)
|
||||
|
||||
@@ -137,7 +137,7 @@ class Battle::Move::RestoreUserConsumedItem < Battle::Move
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def pbMoveFailed?(user, targets)
|
||||
if !user.recycleItem
|
||||
if !user.recycleItem || user.item
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
@@ -317,6 +317,7 @@ class Battle::Move::UserConsumeBerryRaiseDefense2 < Battle::Move::StatUpMove
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
# TODO: Should this return super? It can consume the berry at this point.
|
||||
return super
|
||||
end
|
||||
|
||||
|
||||
@@ -668,6 +668,8 @@ end
|
||||
# Uses the last move that was used. (Copycat)
|
||||
#===============================================================================
|
||||
class Battle::Move::UseLastMoveUsed < Battle::Move
|
||||
attr_reader :moveBlacklist
|
||||
|
||||
def callsAnotherMove?; return true; end
|
||||
|
||||
def initialize(battle, move)
|
||||
@@ -983,6 +985,8 @@ end
|
||||
# Uses a random move known by any non-user Pokémon in the user's party. (Assist)
|
||||
#===============================================================================
|
||||
class Battle::Move::UseRandomMoveFromUserParty < Battle::Move
|
||||
attr_reader :moveBlacklist
|
||||
|
||||
def callsAnotherMove?; return true; end
|
||||
|
||||
def initialize(battle, move)
|
||||
@@ -1098,6 +1102,8 @@ end
|
||||
# Uses a random move the user knows. Fails if user is not asleep. (Sleep Talk)
|
||||
#===============================================================================
|
||||
class Battle::Move::UseRandomUserMoveIfAsleep < Battle::Move
|
||||
attr_reader :moveBlacklist
|
||||
|
||||
def usableWhenAsleep?; return true; end
|
||||
def callsAnotherMove?; return true; end
|
||||
|
||||
@@ -1192,6 +1198,8 @@ end
|
||||
# out. (Mimic)
|
||||
#===============================================================================
|
||||
class Battle::Move::ReplaceMoveThisBattleWithTargetLastMoveUsed < Battle::Move
|
||||
attr_reader :moveBlacklist
|
||||
|
||||
def ignoresSubstitute?(user); return true; end
|
||||
|
||||
def initialize(battle, move)
|
||||
@@ -1243,6 +1251,8 @@ end
|
||||
# This move permanently turns into the last move used by the target. (Sketch)
|
||||
#===============================================================================
|
||||
class Battle::Move::ReplaceMoveWithTargetLastMoveUsed < Battle::Move
|
||||
attr_reader :moveBlacklist
|
||||
|
||||
def ignoresSubstitute?(user); return true; end
|
||||
|
||||
def initialize(battle, move)
|
||||
|
||||
@@ -540,6 +540,8 @@ end
|
||||
# The target uses its most recent move again. (Instruct)
|
||||
#===============================================================================
|
||||
class Battle::Move::TargetUsesItsLastUsedMoveAgain < Battle::Move
|
||||
attr_reader :moveBlacklist
|
||||
|
||||
def ignoresSubstitute?(user); return true; end
|
||||
|
||||
def initialize(battle, move)
|
||||
@@ -757,6 +759,8 @@ end
|
||||
# For 4 rounds, the target must use the same move each round. (Encore)
|
||||
#===============================================================================
|
||||
class Battle::Move::DisableTargetUsingDifferentMove < Battle::Move
|
||||
attr_reader :moveBlacklist
|
||||
|
||||
def ignoresSubstitute?(user); return true; end
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user