mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 13:15:01 +00:00
Merge branch 'dev' into dev-gen8
This commit is contained in:
@@ -397,7 +397,7 @@ class PokeBattle_Battler
|
||||
end
|
||||
end
|
||||
# Magic Coat/Magic Bounce checks (for moves which don't target Pokémon)
|
||||
if targets.length==0 && move.canMagicCoat?
|
||||
if targets.length==0 && move.statusMove? && move.canMagicCoat?
|
||||
@battle.pbPriority(true).each do |b|
|
||||
next if b.fainted? || !b.opposes?(user)
|
||||
next if b.semiInvulnerable?
|
||||
|
||||
@@ -9,7 +9,7 @@ class PokeBattle_Battler
|
||||
def pbChangeUser(choice,move,user)
|
||||
# Snatch
|
||||
move.snatched = false
|
||||
if move.canSnatch?
|
||||
if move.statusMove? && move.canSnatch?
|
||||
newUser = nil; strength = 100
|
||||
@battle.eachBattler do |b|
|
||||
next if b.effects[PBEffects::Snatch]==0 ||
|
||||
|
||||
@@ -398,7 +398,7 @@ class PokeBattle_Battler
|
||||
end
|
||||
end
|
||||
# Magic Coat/Magic Bounce
|
||||
if move.canMagicCoat? && !target.semiInvulnerable? && target.opposes?(user)
|
||||
if move.statusMove? && move.canMagicCoat? && !target.semiInvulnerable? && target.opposes?(user)
|
||||
if target.effects[PBEffects::MagicCoat]
|
||||
target.damageState.magicCoat = true
|
||||
target.effects[PBEffects::MagicCoat] = false
|
||||
|
||||
@@ -91,33 +91,32 @@ class PokeBattle_Move
|
||||
def damagingMove?; return @category!=2; end
|
||||
def statusMove?; return @category==2; end
|
||||
|
||||
def usableWhenAsleep?; return false; end
|
||||
def unusableInGravity?; return false; end
|
||||
def healingMove?; return false; end
|
||||
def recoilMove?; return false; end
|
||||
def flinchingMove?; return false; end
|
||||
def callsAnotherMove?; return false; end
|
||||
def usableWhenAsleep?; return false; end
|
||||
def unusableInGravity?; return false; end
|
||||
def healingMove?; return false; end
|
||||
def recoilMove?; return false; end
|
||||
def flinchingMove?; return false; end
|
||||
def callsAnotherMove?; return false; end
|
||||
# Whether the move can/will hit more than once in the same turn (including
|
||||
# Beat Up which may instead hit just once). Not the same as pbNumHits>1.
|
||||
def multiHitMove?; return false; end
|
||||
def chargingTurnMove?; return false; end
|
||||
def successCheckPerHit?; return false; end
|
||||
def hitsFlyingTargets?; return false; end
|
||||
def hitsDiggingTargets?; return false; end
|
||||
def hitsDivingTargets?; return false; end
|
||||
def ignoresReflect?; return false; end # For Brick Break
|
||||
def targetsPosition?; return false; end # For Future Sight/Doom Desire
|
||||
def cannotRedirect?; return false; end # For Snipe Shot
|
||||
def worksWithNoTargets?; return false; end # For Explosion
|
||||
def damageReducedByBurn?; return true; end # For Facade
|
||||
def triggersHyperMode?; return false; end
|
||||
def multiHitMove?; return false; end
|
||||
def chargingTurnMove?; return false; end
|
||||
def successCheckPerHit?; return false; end
|
||||
def hitsFlyingTargets?; return false; end
|
||||
def hitsDiggingTargets?; return false; end
|
||||
def hitsDivingTargets?; return false; end
|
||||
def ignoresReflect?; return false; end # For Brick Break
|
||||
def targetsPosition?; return false; end # For Future Sight/Doom Desire
|
||||
def cannotRedirect?; return false; end # For Snipe Shot
|
||||
def worksWithNoTargets?; return false; end # For Explosion
|
||||
def damageReducedByBurn?; return true; end # For Facade
|
||||
def triggersHyperMode?; return false; end
|
||||
def canSnatch?; return false; end
|
||||
def canMagicCoat?; return false; end
|
||||
|
||||
def contactMove?; return @flags[/a/]; end
|
||||
def canProtectAgainst?; return @flags[/b/]; end
|
||||
def canMagicCoat?; return @flags[/c/]; end
|
||||
def canSnatch?; return @flags[/d/]; end
|
||||
def canMirrorMove?; return @flags[/e/]; end
|
||||
def canKingsRock?; return @flags[/f/]; end
|
||||
def thawsUser?; return @flags[/g/]; end
|
||||
def highCriticalRate?; return @flags[/h/]; end
|
||||
def bitingMove?; return @flags[/i/]; end
|
||||
|
||||
@@ -88,6 +88,8 @@ end
|
||||
# Generic status problem-inflicting classes.
|
||||
#===============================================================================
|
||||
class PokeBattle_SleepMove < PokeBattle_Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
return false if damagingMove?
|
||||
return !target.pbCanSleep?(user,true,self)
|
||||
@@ -107,6 +109,8 @@ end
|
||||
|
||||
|
||||
class PokeBattle_PoisonMove < PokeBattle_Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@toxic = false
|
||||
@@ -131,6 +135,8 @@ end
|
||||
|
||||
|
||||
class PokeBattle_ParalysisMove < PokeBattle_Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
return false if damagingMove?
|
||||
return !target.pbCanParalyze?(user,true,self)
|
||||
@@ -150,6 +156,8 @@ end
|
||||
|
||||
|
||||
class PokeBattle_BurnMove < PokeBattle_Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
return false if damagingMove?
|
||||
return !target.pbCanBurn?(user,true,self)
|
||||
@@ -169,6 +177,8 @@ end
|
||||
|
||||
|
||||
class PokeBattle_FreezeMove < PokeBattle_Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
return false if damagingMove?
|
||||
return !target.pbCanFreeze?(user,true,self)
|
||||
@@ -207,6 +217,8 @@ end
|
||||
|
||||
|
||||
class PokeBattle_ConfuseMove < PokeBattle_Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
return false if damagingMove?
|
||||
return !target.pbCanConfuse?(user,true,self)
|
||||
@@ -230,6 +242,8 @@ end
|
||||
# Generic user's stat increase/decrease classes.
|
||||
#===============================================================================
|
||||
class PokeBattle_StatUpMove < PokeBattle_Move
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
return false if damagingMove?
|
||||
return !user.pbCanRaiseStatStage?(@statUp[0],user,self,true)
|
||||
@@ -250,6 +264,8 @@ end
|
||||
|
||||
|
||||
class PokeBattle_MultiStatUpMove < PokeBattle_Move
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
return false if damagingMove?
|
||||
failed = true
|
||||
@@ -308,6 +324,8 @@ end
|
||||
# Generic target's stat increase/decrease classes.
|
||||
#===============================================================================
|
||||
class PokeBattle_TargetStatDownMove < PokeBattle_Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
return false if damagingMove?
|
||||
return !target.pbCanLowerStatStage?(@statDown[0],user,self,true)
|
||||
@@ -328,6 +346,8 @@ end
|
||||
|
||||
|
||||
class PokeBattle_TargetMultiStatDownMove < PokeBattle_Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
return false if damagingMove?
|
||||
failed = true
|
||||
@@ -489,6 +509,7 @@ end
|
||||
class PokeBattle_HealingMove < PokeBattle_Move
|
||||
def healingMove?; return true; end
|
||||
def pbHealAmount(user); return 1; end
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
if user.hp==user.totalhp
|
||||
|
||||
@@ -58,6 +58,8 @@ end
|
||||
# Makes the target drowsy; it falls asleep at the end of the next turn. (Yawn)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_004 < PokeBattle_Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
if target.effects[PBEffects::Yawn]>0
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
@@ -324,6 +326,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_016 < PokeBattle_Move
|
||||
def ignoresSubstitute?(user); return true; end
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
return false if damagingMove?
|
||||
@@ -365,6 +368,8 @@ end
|
||||
# Cures user of burn, poison and paralysis. (Refresh)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_018 < PokeBattle_Move
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
if ![:BURN, :POISON, :PARALYSIS].include?(user.status)
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
@@ -400,6 +405,7 @@ end
|
||||
# 6+). We achieve this by not targeting any battlers in Gen 5, since
|
||||
# pbSuccessCheckAgainstTarget is only called for targeted battlers.
|
||||
class PokeBattle_Move_019 < PokeBattle_Move
|
||||
def canSnatch?; return true; end
|
||||
def worksWithNoTargets?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
@@ -491,6 +497,8 @@ end
|
||||
# (Safeguard)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_01A < PokeBattle_Move
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
if user.pbOwnSide.effects[PBEffects::Safeguard]>0
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
@@ -655,6 +663,8 @@ end
|
||||
# Increases the user's critical hit rate. (Focus Energy)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_023 < PokeBattle_Move
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
if user.effects[PBEffects::FocusEnergy]>=2
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
@@ -905,6 +915,8 @@ end
|
||||
# (Shell Smash)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_035 < PokeBattle_Move
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statUp = [:ATTACK,2,:SPECIAL_ATTACK,2,:SPEED,2]
|
||||
@@ -1015,6 +1027,8 @@ end
|
||||
# (Belly Drum)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_03A < PokeBattle_Move
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
hpLoss = [user.totalhp/2,1].max
|
||||
if user.hp<=hpLoss
|
||||
@@ -1111,6 +1125,8 @@ end
|
||||
# Increases the target's Special Attack by 1 stage. Confuses the target. (Flatter)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_040 < PokeBattle_Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
failed = true
|
||||
targets.each do |b|
|
||||
@@ -1140,6 +1156,8 @@ end
|
||||
# Increases the target's Attack by 2 stages. Confuses the target. (Swagger)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_041 < PokeBattle_Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
failed = true
|
||||
targets.each do |b|
|
||||
@@ -1597,6 +1615,8 @@ end
|
||||
# For 5 rounds, user's and ally's stat stages cannot be lowered by foes. (Mist)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_056 < PokeBattle_Move
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
if user.pbOwnSide.effects[PBEffects::Mist]>0
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
@@ -1617,6 +1637,8 @@ end
|
||||
# Swaps the user's Attack and Defense stats. (Power Trick)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_057 < PokeBattle_Move
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def pbEffectGeneral(user)
|
||||
user.attack,user.defense = user.defense,user.attack
|
||||
user.effects[PBEffects::PowerTrick] = !user.effects[PBEffects::PowerTrick]
|
||||
@@ -1682,6 +1704,8 @@ end
|
||||
# For 4 rounds, doubles the Speed of all battlers on the user's side. (Tailwind)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_05B < PokeBattle_Move
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
if user.pbOwnSide.effects[PBEffects::Tailwind]>0
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
@@ -1810,6 +1834,8 @@ end
|
||||
# (Conversion)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_05E < PokeBattle_Move
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
if !user.canChangeType?
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
@@ -1888,6 +1914,8 @@ end
|
||||
# Changes user's type depending on the environment. (Camouflage)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_060 < PokeBattle_Move
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
if !user.canChangeType?
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
@@ -1964,6 +1992,8 @@ end
|
||||
# Target becomes Water type. (Soak)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_061 < PokeBattle_Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
if !target.canChangeType? || !GameData::Type.exists?(:WATER) ||
|
||||
!target.pbHasOtherType?(:WATER)
|
||||
@@ -2023,6 +2053,8 @@ end
|
||||
# Target's ability becomes Simple. (Simple Beam)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_063 < PokeBattle_Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
if !GameData::Ability.exists?(:SIMPLE)
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
@@ -2056,6 +2088,8 @@ end
|
||||
# Target's ability becomes Insomnia. (Worry Seed)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_064 < PokeBattle_Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
if !GameData::Ability.exists?(:INSOMNIA)
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
@@ -2131,6 +2165,8 @@ end
|
||||
# Target copies user's ability. (Entrainment)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_066 < PokeBattle_Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
if !user.ability
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
@@ -2241,6 +2277,8 @@ end
|
||||
# Target's ability is negated. (Gastro Acid)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_068 < PokeBattle_Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
if target.unstoppableAbility?
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
|
||||
@@ -805,6 +805,8 @@ end
|
||||
# For 5 rounds, foes' attacks cannot become critical hits. (Lucky Chant)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0A1 < PokeBattle_Move
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
if user.pbOwnSide.effects[PBEffects::LuckyChant]>0
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
@@ -826,6 +828,8 @@ end
|
||||
# (Reflect)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0A2 < PokeBattle_Move
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
if user.pbOwnSide.effects[PBEffects::Reflect]>0
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
@@ -847,6 +851,8 @@ end
|
||||
# For 5 rounds, lowers power of special attacks against the user's side. (Light Screen)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0A3 < PokeBattle_Move
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
if user.pbOwnSide.effects[PBEffects::LightScreen]>0
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
@@ -1006,6 +1012,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0A7 < PokeBattle_Move
|
||||
def ignoresSubstitute?(user); return true; end
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbEffectAgainstTarget(user,target)
|
||||
target.effects[PBEffects::Foresight] = true
|
||||
@@ -1021,6 +1028,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0A8 < PokeBattle_Move
|
||||
def ignoresSubstitute?(user); return true; end
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbEffectAgainstTarget(user,target)
|
||||
target.effects[PBEffects::MiracleEye] = true
|
||||
@@ -1065,6 +1073,8 @@ end
|
||||
# (Quick Guard)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0AB < PokeBattle_ProtectMove
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@effect = PBEffects::QuickGuard
|
||||
@@ -1079,6 +1089,8 @@ end
|
||||
# (Wide Guard)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0AC < PokeBattle_ProtectMove
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@effect = PBEffects::WideGuard
|
||||
@@ -1696,6 +1708,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0B7 < PokeBattle_Move
|
||||
def ignoresSubstitute?(user); return true; end
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
if target.effects[PBEffects::Torment]
|
||||
@@ -1719,6 +1732,8 @@ end
|
||||
# Disables all target's moves that the user also knows. (Imprison)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0B8 < PokeBattle_Move
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
if user.effects[PBEffects::Imprison]
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
@@ -1740,6 +1755,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0B9 < PokeBattle_Move
|
||||
def ignoresSubstitute?(user); return true; end
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
if target.effects[PBEffects::Disable]>0 || !target.lastRegularMoveUsed
|
||||
@@ -1777,6 +1793,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0BA < PokeBattle_Move
|
||||
def ignoresSubstitute?(user); return true; end
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
if target.effects[PBEffects::Taunt]>0
|
||||
@@ -1812,6 +1829,8 @@ end
|
||||
# For 5 rounds, disables the target's healing moves. (Heal Block)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0BB < PokeBattle_Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
if target.effects[PBEffects::HealBlock]>0
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
@@ -1835,6 +1854,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0BC < PokeBattle_Move
|
||||
def ignoresSubstitute?(user); return true; end
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@@ -2515,6 +2535,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0D7 < PokeBattle_Move
|
||||
def healingMove?; return true; end
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
if @battle.positions[user.index].effects[PBEffects::Wish]>0
|
||||
@@ -2587,6 +2608,8 @@ end
|
||||
# (Aqua Ring)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0DA < PokeBattle_Move
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
if user.effects[PBEffects::AquaRing]
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
@@ -2608,6 +2631,8 @@ end
|
||||
# round, and cannot flee or switch out. (Ingrain)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0DB < PokeBattle_Move
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
if user.effects[PBEffects::Ingrain]
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
@@ -2629,6 +2654,8 @@ end
|
||||
# and the Pokémon in the user's position gains the same amount. (Leech Seed)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0DC < PokeBattle_Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
if target.effects[PBEffects::LeechSeed]>=0
|
||||
@battle.pbDisplay(_INTL("{1} evaded the attack!",target.pbThis))
|
||||
@@ -2697,7 +2724,8 @@ end
|
||||
# Heals target by 1/2 of its max HP. (Heal Pulse)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0DF < PokeBattle_Move
|
||||
def healingMove?; return true; end
|
||||
def healingMove?; return true; end
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
if target.hp==target.totalhp
|
||||
@@ -2785,6 +2813,8 @@ end
|
||||
# User faints (if successful).
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0E2 < PokeBattle_TargetMultiStatDownMove
|
||||
def canMagicCoat?; return false; end
|
||||
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statDown = [:ATTACK,2,:SPECIAL_ATTACK,2]
|
||||
@@ -2811,6 +2841,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0E3 < PokeBattle_Move
|
||||
def healingMove?; return true; end
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
if !@battle.pbCanChooseNonActive?(user.index)
|
||||
@@ -2836,6 +2867,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0E4 < PokeBattle_Move
|
||||
def healingMove?; return true; end
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
if !@battle.pbCanChooseNonActive?(user.index)
|
||||
@@ -2978,6 +3010,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0EB < PokeBattle_Move
|
||||
def ignoresSubstitute?(user); return true; end
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
if target.hasActiveAbility?(:SUCTIONCUPS) && !@battle.moldBreaker
|
||||
@@ -3152,6 +3185,8 @@ end
|
||||
# (Anchor Shot, Block, Mean Look, Spider Web, Spirit Shackle, Thousand Waves)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0EF < PokeBattle_Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
return false if damagingMove?
|
||||
if target.effects[PBEffects::MeanLook]>=0
|
||||
@@ -3386,6 +3421,8 @@ end
|
||||
# User recovers the last item it held and consumed. (Recycle)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0F6 < PokeBattle_Move
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
if !user.recycleItem
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
@@ -3631,6 +3668,8 @@ end
|
||||
# effect, and no items can be used on it. (Embargo)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0F8 < PokeBattle_Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
if target.effects[PBEffects::Embargo]>0
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
|
||||
@@ -38,6 +38,8 @@ end
|
||||
# Entry hazard. Lays spikes on the opposing side (max. 3 layers). (Spikes)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_103 < PokeBattle_Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
if user.pbOpposingSide.effects[PBEffects::Spikes]>=3
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
@@ -60,6 +62,8 @@ end
|
||||
# (Toxic Spikes)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_104 < PokeBattle_Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
if user.pbOpposingSide.effects[PBEffects::ToxicSpikes]>=2
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
@@ -81,6 +85,8 @@ end
|
||||
# Entry hazard. Lays stealth rocks on the opposing side. (Stealth Rock)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_105 < PokeBattle_Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
if user.pbOpposingSide.effects[PBEffects::StealthRock]
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
@@ -222,6 +228,8 @@ end
|
||||
# User turns 1/4 of max HP into a substitute. (Substitute)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_10C < PokeBattle_Move
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
if user.effects[PBEffects::Substitute]>0
|
||||
@battle.pbDisplay(_INTL("{1} already has a substitute!",user.pbThis))
|
||||
@@ -323,6 +331,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_10E < PokeBattle_Move
|
||||
def ignoresSubstitute?(user); return true; end
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbFailsAgainstTarget?(user, target)
|
||||
last_move = target.pbGetMoveWithID(target.lastRegularMoveUsed)
|
||||
@@ -460,6 +469,8 @@ end
|
||||
# user's stockpile by 1 (max. 3). (Stockpile)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_112 < PokeBattle_Move
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
if user.effects[PBEffects::Stockpile]>=3
|
||||
@battle.pbDisplay(_INTL("{1} can't stockpile any more!",user.pbThis))
|
||||
@@ -536,6 +547,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_114 < PokeBattle_Move
|
||||
def healingMove?; return true; end
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
if user.effects[PBEffects::Stockpile]==0
|
||||
@@ -691,6 +703,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_119 < PokeBattle_Move
|
||||
def unusableInGravity?; return true; end
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
if user.effects[PBEffects::Ingrain] ||
|
||||
@@ -715,6 +728,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_11A < PokeBattle_Move
|
||||
def unusableInGravity?; return true; end
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
if target.effects[PBEffects::Ingrain] ||
|
||||
@@ -1086,6 +1100,7 @@ end
|
||||
# pbSuccessCheckAgainstTarget is only called for targeted battlers.
|
||||
class PokeBattle_Move_137 < PokeBattle_Move
|
||||
def ignoresSubstitute?(user); return true; end
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
@validTargets = []
|
||||
@@ -1330,6 +1345,8 @@ end
|
||||
# stage each. (Venom Drench)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_140 < PokeBattle_Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
@validTargets = []
|
||||
targets.each do |b|
|
||||
@@ -1365,6 +1382,8 @@ end
|
||||
# Reverses all stat changes of the target. (Topsy-Turvy)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_141 < PokeBattle_Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
if !target.hasAlteredStatStages?
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
@@ -1392,6 +1411,8 @@ end
|
||||
# Gives target the Ghost type. (Trick-or-Treat)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_142 < PokeBattle_Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
if !GameData::Type.exists?(:GHOST) || target.pbHasType?(:GHOST) || !target.canChangeType?
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
@@ -1413,6 +1434,8 @@ end
|
||||
# Gives target the Grass type. (Forest's Curse)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_143 < PokeBattle_Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
if !GameData::Type.exists?(:GRASS) || target.pbHasType?(:GRASS) || !target.canChangeType?
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
@@ -1526,6 +1549,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_148 < PokeBattle_Move
|
||||
def ignoresSubstitute?(user); return true; end
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
if target.effects[PBEffects::Powder]
|
||||
@@ -1547,6 +1571,8 @@ end
|
||||
# This round, the user's side is unaffected by damaging moves. (Mat Block)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_149 < PokeBattle_Move
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
if user.turnCount > 1
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
@@ -1743,6 +1769,8 @@ end
|
||||
# Entry hazard. Lays stealth rocks on the opposing side. (Sticky Web)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_153 < PokeBattle_Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
if user.pbOpposingSide.effects[PBEffects::StickyWeb]
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
@@ -1865,6 +1893,8 @@ end
|
||||
# Poisons the target and decreases its Speed by 1 stage. (Toxic Thread)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_159 < PokeBattle_Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
if !target.pbCanPoison?(user,false,self) &&
|
||||
!target.pbCanLowerStatStage?(:SPEED,user,self)
|
||||
@@ -1902,6 +1932,9 @@ end
|
||||
# (Purify)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_15B < PokeBattle_HealingMove
|
||||
def canSnatch?; return false; end # Because it affects a target
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
if target.status == :NONE
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
@@ -1935,6 +1968,7 @@ end
|
||||
# pbSuccessCheckAgainstTarget is only called for targeted battlers.
|
||||
class PokeBattle_Move_15C < PokeBattle_Move
|
||||
def ignoresSubstitute?(user); return true; end
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
@validTargets = []
|
||||
@@ -2013,6 +2047,8 @@ end
|
||||
# (Laser Focus)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_15E < PokeBattle_Move
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def pbEffectGeneral(user)
|
||||
user.effects[PBEffects::LaserFocus] = 2
|
||||
@battle.pbDisplay(_INTL("{1} concentrated intensely!",user.pbThis))
|
||||
@@ -2039,7 +2075,8 @@ end
|
||||
# it). (Strength Sap)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_160 < PokeBattle_Move
|
||||
def healingMove?; return true; end
|
||||
def healingMove?; return true; end
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
# NOTE: The official games appear to just check whether the target's Attack
|
||||
@@ -2203,6 +2240,8 @@ end
|
||||
# weather is not hail. (Aurora Veil)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_167 < PokeBattle_Move
|
||||
def canSnatch?; return true; end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
if @battle.pbWeather != :Hail
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
@@ -2256,6 +2295,8 @@ end
|
||||
# (Spotlight)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_16A < PokeBattle_Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbEffectAgainstTarget(user,target)
|
||||
target.effects[PBEffects::Spotlight] = 1
|
||||
target.eachAlly do |b|
|
||||
@@ -2388,7 +2429,8 @@ end
|
||||
# (Floral Healing)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_16E < PokeBattle_Move
|
||||
def healingMove?; return true; end
|
||||
def healingMove?; return true; end
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
if target.hp==target.totalhp
|
||||
|
||||
@@ -262,15 +262,14 @@ class PokeBattle_AI
|
||||
end
|
||||
# Prefer flinching external effects (note that move effects which cause
|
||||
# flinching are dealt with in the function code part of score calculation)
|
||||
if skill>=PBTrainerAI.mediumSkill
|
||||
if skill>=PBTrainerAI.mediumSkill && !move.flinchingMove?
|
||||
if !target.hasActiveAbility?(:INNERFOCUS) &&
|
||||
!target.hasActiveAbility?(:SHIELDDUST) &&
|
||||
target.effects[PBEffects::Substitute]==0
|
||||
!target.hasActiveAbility?(:SHIELDDUST) &&
|
||||
target.effects[PBEffects::Substitute]==0
|
||||
canFlinch = false
|
||||
if move.canKingsRock? && user.hasActiveItem?([:KINGSROCK,:RAZORFANG])
|
||||
if user.hasActiveItem?([:KINGSROCK, :RAZORFANG])
|
||||
canFlinch = true
|
||||
end
|
||||
if user.hasActiveAbility?(:STENCH) && !move.flinchingMove?
|
||||
elsif user.hasActiveAbility?(:STENCH)
|
||||
canFlinch = true
|
||||
end
|
||||
realDamage *= 1.3 if canFlinch
|
||||
|
||||
@@ -115,7 +115,7 @@ class PokeBattle_AI
|
||||
target.hasActiveAbility?(:WONDERGUARD)
|
||||
return true if move.damagingMove? && user.index!=target.index && !target.opposes?(user) &&
|
||||
target.hasActiveAbility?(:TELEPATHY)
|
||||
return true if move.canMagicCoat? && target.hasActiveAbility?(:MAGICBOUNCE) &&
|
||||
return true if move.statusMove? && move.canMagicCoat? && target.hasActiveAbility?(:MAGICBOUNCE) &&
|
||||
target.opposes?(user)
|
||||
return true if move.soundMove? && target.hasActiveAbility?(:SOUNDPROOF)
|
||||
return true if move.bombMove? && target.hasActiveAbility?(:BULLETPROOF)
|
||||
|
||||
Reference in New Issue
Block a user