mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-08 13:44:59 +00:00
Grouped all ability blacklists together
This commit is contained in:
@@ -338,25 +338,54 @@ class PokeBattle_Battler
|
|||||||
end
|
end
|
||||||
alias hasWorkingAbility hasActiveAbility?
|
alias hasWorkingAbility hasActiveAbility?
|
||||||
|
|
||||||
def nonNegatableAbility?
|
# Applies to both losing self's ability (i.e. being replaced by another) and
|
||||||
|
# having self's ability be negated.
|
||||||
|
def unstoppableAbility?
|
||||||
abilityBlacklist = [
|
abilityBlacklist = [
|
||||||
# Form-changing abilities
|
# Form-changing abilities
|
||||||
:BATTLEBOND,
|
:BATTLEBOND,
|
||||||
:DISGUISE,
|
:DISGUISE,
|
||||||
# :FLOWERGIFT, # This can be negated
|
# :FLOWERGIFT, # This can be stopped
|
||||||
# :FORECAST, # This can be negated
|
# :FORECAST, # This can be stopped
|
||||||
:MULTITYPE,
|
:MULTITYPE,
|
||||||
:POWERCONSTRUCT,
|
:POWERCONSTRUCT,
|
||||||
:SCHOOLING,
|
:SCHOOLING,
|
||||||
:SHIELDSDOWN,
|
:SHIELDSDOWN,
|
||||||
:STANCECHANGE,
|
:STANCECHANGE,
|
||||||
:ZENMODE,
|
:ZENMODE,
|
||||||
# Abilities intended to be inherent properties of a certain species
|
# Abilities intended to be inherent properties of a certain species
|
||||||
:COMATOSE,
|
:COMATOSE,
|
||||||
:RKSSYSTEM
|
:RKSSYSTEM
|
||||||
]
|
]
|
||||||
abilityBlacklist.each do |abil|
|
abilityBlacklist.each do |a|
|
||||||
return true if isConst?(@ability,PBAbilities,abil)
|
return true if isConst?(@ability, PBAbilities, a)
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
# Applies to gaining the ability.
|
||||||
|
def ungainableAbility?(abil)
|
||||||
|
abilityBlacklist = [
|
||||||
|
# Form-changing abilities
|
||||||
|
:BATTLEBOND,
|
||||||
|
:DISGUISE,
|
||||||
|
:FLOWERGIFT,
|
||||||
|
:FORECAST,
|
||||||
|
:MULTITYPE,
|
||||||
|
:POWERCONSTRUCT,
|
||||||
|
:SCHOOLING,
|
||||||
|
:SHIELDSDOWN,
|
||||||
|
:STANCECHANGE,
|
||||||
|
:ZENMODE,
|
||||||
|
# Appearance-changing abilities
|
||||||
|
:ILLUSION,
|
||||||
|
:IMPOSTER,
|
||||||
|
# Abilities intended to be inherent properties of a certain species
|
||||||
|
:COMATOSE,
|
||||||
|
:RKSSYSTEM
|
||||||
|
]
|
||||||
|
abilityBlacklist.each do |a|
|
||||||
|
return true if isConst?(abil, PBAbilities, a)
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ class PokeBattle_Battler
|
|||||||
# These effects are passed on if Baton Pass is used, but they need to be
|
# These effects are passed on if Baton Pass is used, but they need to be
|
||||||
# cancelled in certain circumstances anyway
|
# cancelled in certain circumstances anyway
|
||||||
@effects[PBEffects::Telekinesis] = 0 if isSpecies?(:GENGAR) && mega?
|
@effects[PBEffects::Telekinesis] = 0 if isSpecies?(:GENGAR) && mega?
|
||||||
@effects[PBEffects::GastroAcid] = false if nonNegatableAbility?
|
@effects[PBEffects::GastroAcid] = false if unstoppableAbility?
|
||||||
else
|
else
|
||||||
# These effects are passed on if Baton Pass is used
|
# These effects are passed on if Baton Pass is used
|
||||||
@stages[PBStats::ATTACK] = 0
|
@stages[PBStats::ATTACK] = 0
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class PokeBattle_Battler
|
|||||||
# Ending primordial weather, checking Trace
|
# Ending primordial weather, checking Trace
|
||||||
pbContinualAbilityChecks(true)
|
pbContinualAbilityChecks(true)
|
||||||
# Abilities that trigger upon switching in
|
# Abilities that trigger upon switching in
|
||||||
if (!fainted? && nonNegatableAbility?) || abilityActive?
|
if (!fainted? && unstoppableAbility?) || abilityActive?
|
||||||
BattleHandlers.triggerAbilityOnSwitchIn(@ability,self,@battle)
|
BattleHandlers.triggerAbilityOnSwitchIn(@ability,self,@battle)
|
||||||
end
|
end
|
||||||
# Check for end of primordial weather
|
# Check for end of primordial weather
|
||||||
@@ -72,36 +72,13 @@ class PokeBattle_Battler
|
|||||||
# in and not at any later times, even if a traceable ability turns
|
# in and not at any later times, even if a traceable ability turns
|
||||||
# up later. Essentials ignores this, and allows Trace to trigger
|
# up later. Essentials ignores this, and allows Trace to trigger
|
||||||
# whenever it can even in the old battle mechanics.
|
# whenever it can even in the old battle mechanics.
|
||||||
abilityBlacklist = [
|
|
||||||
# Replaces self with another ability
|
|
||||||
:POWEROFALCHEMY,
|
|
||||||
:RECEIVER,
|
|
||||||
:TRACE,
|
|
||||||
# Form-changing abilities
|
|
||||||
:BATTLEBOND,
|
|
||||||
:DISGUISE,
|
|
||||||
:FLOWERGIFT,
|
|
||||||
:FORECAST,
|
|
||||||
:MULTITYPE,
|
|
||||||
:POWERCONSTRUCT,
|
|
||||||
:SCHOOLING,
|
|
||||||
:SHIELDSDOWN,
|
|
||||||
:STANCECHANGE,
|
|
||||||
:ZENMODE,
|
|
||||||
# Appearance-changing abilities
|
|
||||||
:ILLUSION,
|
|
||||||
:IMPOSTER,
|
|
||||||
# Abilities intended to be inherent properties of a certain species
|
|
||||||
:COMATOSE,
|
|
||||||
:RKSSYSTEM
|
|
||||||
]
|
|
||||||
choices = []
|
choices = []
|
||||||
@battle.eachOtherSideBattler(@index) do |b|
|
@battle.eachOtherSideBattler(@index) do |b|
|
||||||
abilityBlacklist.each do |abil|
|
next if b.ungainableAbility? ||
|
||||||
next if !isConst?(b.ability,PBAbilities,abil)
|
isConst?(b.ability, PBAbilities, :POWEROFALCHEMY) ||
|
||||||
choices.push(b)
|
isConst?(b.ability, PBAbilities, :RECEIVER) ||
|
||||||
break
|
isConst?(b.ability, PBAbilities, :TRACE)
|
||||||
end
|
choices.push(b)
|
||||||
end
|
end
|
||||||
if choices.length>0
|
if choices.length>0
|
||||||
choice = choices[@battle.pbRandom(choices.length)]
|
choice = choices[@battle.pbRandom(choices.length)]
|
||||||
@@ -109,7 +86,7 @@ class PokeBattle_Battler
|
|||||||
@ability = choice.ability
|
@ability = choice.ability
|
||||||
@battle.pbDisplay(_INTL("{1} traced {2}'s {3}!",pbThis,choice.pbThis(true),choice.abilityName))
|
@battle.pbDisplay(_INTL("{1} traced {2}'s {3}!",pbThis,choice.pbThis(true),choice.abilityName))
|
||||||
@battle.pbHideAbilitySplash(self)
|
@battle.pbHideAbilitySplash(self)
|
||||||
if !onSwitchIn && (nonNegatableAbility? || abilityActive?)
|
if !onSwitchIn && (unstoppableAbility? || abilityActive?)
|
||||||
BattleHandlers.triggerAbilityOnSwitchIn(@ability,self,@battle)
|
BattleHandlers.triggerAbilityOnSwitchIn(@ability,self,@battle)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -138,7 +115,7 @@ class PokeBattle_Battler
|
|||||||
@battle.pbSetSeen(self)
|
@battle.pbSetSeen(self)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@effects[PBEffects::GastroAcid] = false if nonNegatableAbility?
|
@effects[PBEffects::GastroAcid] = false if unstoppableAbility?
|
||||||
@effects[PBEffects::SlowStart] = 0 if !isConst?(@ability,PBAbilities,:SLOWSTART)
|
@effects[PBEffects::SlowStart] = 0 if !isConst?(@ability,PBAbilities,:SLOWSTART)
|
||||||
# Revert form if Flower Gift/Forecast was lost
|
# Revert form if Flower Gift/Forecast was lost
|
||||||
pbCheckFormOnWeatherChange
|
pbCheckFormOnWeatherChange
|
||||||
|
|||||||
@@ -1996,29 +1996,6 @@ end
|
|||||||
# Target's ability becomes Simple. (Simple Beam)
|
# Target's ability becomes Simple. (Simple Beam)
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
class PokeBattle_Move_063 < PokeBattle_Move
|
class PokeBattle_Move_063 < PokeBattle_Move
|
||||||
def initialize(battle,move)
|
|
||||||
super
|
|
||||||
@abilityBlacklist = [
|
|
||||||
:TRUANT,
|
|
||||||
# This ability
|
|
||||||
:SIMPLE,
|
|
||||||
# Form-changing abilities
|
|
||||||
:BATTLEBOND,
|
|
||||||
:DISGUISE,
|
|
||||||
# :FLOWERGIFT, # This can be replaced
|
|
||||||
# :FORECAST, # This can be replaced
|
|
||||||
:MULTITYPE,
|
|
||||||
:POWERCONSTRUCT,
|
|
||||||
:SCHOOLING,
|
|
||||||
:SHIELDSDOWN,
|
|
||||||
:STANCECHANGE,
|
|
||||||
:ZENMODE,
|
|
||||||
# Abilities intended to be inherent properties of a certain species
|
|
||||||
:COMATOSE,
|
|
||||||
:RKSSYSTEM
|
|
||||||
]
|
|
||||||
end
|
|
||||||
|
|
||||||
def pbMoveFailed?(user,targets)
|
def pbMoveFailed?(user,targets)
|
||||||
if !hasConst?(PBAbilities,:SIMPLE) # Ability isn't defined
|
if !hasConst?(PBAbilities,:SIMPLE) # Ability isn't defined
|
||||||
@battle.pbDisplay(_INTL("But it failed!"))
|
@battle.pbDisplay(_INTL("But it failed!"))
|
||||||
@@ -2028,8 +2005,9 @@ class PokeBattle_Move_063 < PokeBattle_Move
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pbFailsAgainstTarget?(user,target)
|
def pbFailsAgainstTarget?(user,target)
|
||||||
@abilityBlacklist.each do |abil|
|
if target.unstoppableAbility? ||
|
||||||
next if !isConst?(target.ability,PBAbilities,abil)
|
isConst?(target.ability, PBAbilities, :TRUANT) || # For some reason
|
||||||
|
isConst?(target.ability, PBAbilities, :SIMPLE)
|
||||||
@battle.pbDisplay(_INTL("But it failed!"))
|
@battle.pbDisplay(_INTL("But it failed!"))
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@@ -2053,29 +2031,6 @@ end
|
|||||||
# Target's ability becomes Insomnia. (Worry Seed)
|
# Target's ability becomes Insomnia. (Worry Seed)
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
class PokeBattle_Move_064 < PokeBattle_Move
|
class PokeBattle_Move_064 < PokeBattle_Move
|
||||||
def initialize(battle,move)
|
|
||||||
super
|
|
||||||
@abilityBlacklist = [
|
|
||||||
:TRUANT,
|
|
||||||
# This ability
|
|
||||||
:INSOMNIA,
|
|
||||||
# Form-changing abilities
|
|
||||||
:BATTLEBOND,
|
|
||||||
:DISGUISE,
|
|
||||||
# :FLOWERGIFT, # This can be replaced
|
|
||||||
# :FORECAST, # This can be replaced
|
|
||||||
:MULTITYPE,
|
|
||||||
:POWERCONSTRUCT,
|
|
||||||
:SCHOOLING,
|
|
||||||
:SHIELDSDOWN,
|
|
||||||
:STANCECHANGE,
|
|
||||||
:ZENMODE,
|
|
||||||
# Abilities intended to be inherent properties of a certain species
|
|
||||||
:COMATOSE,
|
|
||||||
:RKSSYSTEM
|
|
||||||
]
|
|
||||||
end
|
|
||||||
|
|
||||||
def pbMoveFailed?(user,targets)
|
def pbMoveFailed?(user,targets)
|
||||||
if !hasConst?(PBAbilities,:INSOMNIA) # Ability isn't defined
|
if !hasConst?(PBAbilities,:INSOMNIA) # Ability isn't defined
|
||||||
@battle.pbDisplay(_INTL("But it failed!"))
|
@battle.pbDisplay(_INTL("But it failed!"))
|
||||||
@@ -2085,8 +2040,9 @@ class PokeBattle_Move_064 < PokeBattle_Move
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pbFailsAgainstTarget?(user,target)
|
def pbFailsAgainstTarget?(user,target)
|
||||||
@abilityBlacklist.each do |abil|
|
if target.unstoppableAbility? ||
|
||||||
next if !isConst?(target.ability,PBAbilities,abil)
|
isConst?(target.ability, PBAbilities, :TRUANT) || # For some reason
|
||||||
|
isConst?(target.ability, PBAbilities, :INSOMNIA)
|
||||||
@battle.pbDisplay(_INTL("But it failed!"))
|
@battle.pbDisplay(_INTL("But it failed!"))
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@@ -2112,54 +2068,8 @@ end
|
|||||||
class PokeBattle_Move_065 < PokeBattle_Move
|
class PokeBattle_Move_065 < PokeBattle_Move
|
||||||
def ignoresSubstitute?(user); return true; end
|
def ignoresSubstitute?(user); return true; end
|
||||||
|
|
||||||
def initialize(battle,move)
|
|
||||||
super
|
|
||||||
@abilityBlacklistUnlosable = [
|
|
||||||
# Form-changing abilities
|
|
||||||
:BATTLEBOND,
|
|
||||||
:DISGUISE,
|
|
||||||
# :FLOWERGIFT, # This can be lost
|
|
||||||
# :FORECAST, # This can be lost
|
|
||||||
:MULTITYPE,
|
|
||||||
:POWERCONSTRUCT,
|
|
||||||
:SCHOOLING,
|
|
||||||
:SHIELDSDOWN,
|
|
||||||
:STANCECHANGE,
|
|
||||||
:ZENMODE,
|
|
||||||
# Abilities intended to be inherent properties of a certain species
|
|
||||||
:COMATOSE,
|
|
||||||
:RKSSYSTEM
|
|
||||||
]
|
|
||||||
@abilityBlacklistUngainable = [
|
|
||||||
# Replaces self with another ability
|
|
||||||
:POWEROFALCHEMY,
|
|
||||||
:RECEIVER,
|
|
||||||
:TRACE,
|
|
||||||
# Form-changing abilities
|
|
||||||
:BATTLEBOND,
|
|
||||||
:DISGUISE,
|
|
||||||
:FLOWERGIFT,
|
|
||||||
:FORECAST,
|
|
||||||
:MULTITYPE,
|
|
||||||
:POWERCONSTRUCT,
|
|
||||||
:SCHOOLING,
|
|
||||||
:SHIELDSDOWN,
|
|
||||||
:STANCECHANGE,
|
|
||||||
:ZENMODE,
|
|
||||||
# Appearance-changing abilities
|
|
||||||
:ILLUSION,
|
|
||||||
:IMPOSTER,
|
|
||||||
# Abilities intended to be inherent properties of a certain species
|
|
||||||
:COMATOSE,
|
|
||||||
:RKSSYSTEM,
|
|
||||||
# Abilities that would be overpowered if allowed to be transferred
|
|
||||||
:WONDERGUARD
|
|
||||||
]
|
|
||||||
end
|
|
||||||
|
|
||||||
def pbMoveFailed?(user,targets)
|
def pbMoveFailed?(user,targets)
|
||||||
@abilityBlacklistUnlosable.each do |abil|
|
if user.unstoppableAbility?
|
||||||
next if !isConst?(user.ability,PBAbilities,abil)
|
|
||||||
@battle.pbDisplay(_INTL("But it failed!"))
|
@battle.pbDisplay(_INTL("But it failed!"))
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@@ -2171,8 +2081,11 @@ class PokeBattle_Move_065 < PokeBattle_Move
|
|||||||
@battle.pbDisplay(_INTL("But it failed!"))
|
@battle.pbDisplay(_INTL("But it failed!"))
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@abilityBlacklistUngainable.each do |abil|
|
if target.ungainableAbility? ||
|
||||||
next if !isConst?(target.ability,PBAbilities,abil)
|
isConst?(target.ability, PBAbilities, :POWEROFALCHEMY) ||
|
||||||
|
isConst?(target.ability, PBAbilities, :RECEIVER) ||
|
||||||
|
isConst?(target.ability, PBAbilities, :TRACE) ||
|
||||||
|
isConst?(target.ability, PBAbilities, :WONDERGUARD)
|
||||||
@battle.pbDisplay(_INTL("But it failed!"))
|
@battle.pbDisplay(_INTL("But it failed!"))
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@@ -2198,57 +2111,15 @@ end
|
|||||||
# Target copies user's ability. (Entrainment)
|
# Target copies user's ability. (Entrainment)
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
class PokeBattle_Move_066 < PokeBattle_Move
|
class PokeBattle_Move_066 < PokeBattle_Move
|
||||||
def initialize(battle,move)
|
|
||||||
super
|
|
||||||
@abilityBlacklistUnlosable = [
|
|
||||||
:TRUANT,
|
|
||||||
# Form-changing abilities
|
|
||||||
:BATTLEBOND,
|
|
||||||
:DISGUISE,
|
|
||||||
# :FLOWERGIFT, # This can be lost
|
|
||||||
# :FORECAST, # This can be lost
|
|
||||||
:MULTITYPE,
|
|
||||||
:POWERCONSTRUCT,
|
|
||||||
:SCHOOLING,
|
|
||||||
:SHIELDSDOWN,
|
|
||||||
:STANCECHANGE,
|
|
||||||
:ZENMODE,
|
|
||||||
# Abilities intended to be inherent properties of a certain species
|
|
||||||
:COMATOSE,
|
|
||||||
:RKSSYSTEM
|
|
||||||
]
|
|
||||||
@abilityBlacklistUngainable = [
|
|
||||||
# Replaces self with another ability
|
|
||||||
:POWEROFALCHEMY,
|
|
||||||
:RECEIVER,
|
|
||||||
:TRACE,
|
|
||||||
# Form-changing abilities
|
|
||||||
:BATTLEBOND,
|
|
||||||
:DISGUISE,
|
|
||||||
:FLOWERGIFT,
|
|
||||||
:FORECAST,
|
|
||||||
:MULTITYPE,
|
|
||||||
:POWERCONSTRUCT,
|
|
||||||
:SCHOOLING,
|
|
||||||
:SHIELDSDOWN,
|
|
||||||
:STANCECHANGE,
|
|
||||||
:ZENMODE,
|
|
||||||
# Appearance-changing abilities
|
|
||||||
:ILLUSION,
|
|
||||||
:IMPOSTER,
|
|
||||||
# Abilities intended to be inherent properties of a certain species
|
|
||||||
:COMATOSE,
|
|
||||||
:RKSSYSTEM
|
|
||||||
]
|
|
||||||
end
|
|
||||||
|
|
||||||
def pbMoveFailed?(user,targets)
|
def pbMoveFailed?(user,targets)
|
||||||
if user.ability==0
|
if user.ability==0
|
||||||
@battle.pbDisplay(_INTL("But it failed!"))
|
@battle.pbDisplay(_INTL("But it failed!"))
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@abilityBlacklistUngainable.each do |abil|
|
if user.ungainableAbility? ||
|
||||||
next if !isConst?(user.ability,PBAbilities,abil)
|
isConst?(user.ability, PBAbilities, :POWEROFALCHEMY) ||
|
||||||
|
isConst?(user.ability, PBAbilities, :RECEIVER) ||
|
||||||
|
isConst?(user.ability, PBAbilities, :TRACE)
|
||||||
@battle.pbDisplay(_INTL("But it failed!"))
|
@battle.pbDisplay(_INTL("But it failed!"))
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@@ -2256,8 +2127,7 @@ class PokeBattle_Move_066 < PokeBattle_Move
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pbFailsAgainstTarget?(user,target)
|
def pbFailsAgainstTarget?(user,target)
|
||||||
@abilityBlacklistUnlosable.each do |abil|
|
if target.unstoppableAbility? || isConst?(target.ability, PBAbilities, :TRUANT)
|
||||||
next if !isConst?(target.ability,PBAbilities,abil)
|
|
||||||
@battle.pbDisplay(_INTL("But it failed!"))
|
@battle.pbDisplay(_INTL("But it failed!"))
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@@ -2284,59 +2154,16 @@ end
|
|||||||
class PokeBattle_Move_067 < PokeBattle_Move
|
class PokeBattle_Move_067 < PokeBattle_Move
|
||||||
def ignoresSubstitute?(user); return true; end
|
def ignoresSubstitute?(user); return true; end
|
||||||
|
|
||||||
def initialize(battle,move)
|
|
||||||
super
|
|
||||||
@abilityBlacklistUnlosable = [
|
|
||||||
# Form-changing abilities
|
|
||||||
:BATTLEBOND,
|
|
||||||
:DISGUISE,
|
|
||||||
# :FLOWERGIFT, # This can be lost
|
|
||||||
# :FORECAST, # This can be lost
|
|
||||||
:MULTITYPE,
|
|
||||||
:POWERCONSTRUCT,
|
|
||||||
:SCHOOLING,
|
|
||||||
:SHIELDSDOWN,
|
|
||||||
:STANCECHANGE,
|
|
||||||
:ZENMODE,
|
|
||||||
# Abilities intended to be inherent properties of a certain species
|
|
||||||
:COMATOSE,
|
|
||||||
:RKSSYSTEM
|
|
||||||
]
|
|
||||||
@abilityBlacklistUngainable = [
|
|
||||||
# Form-changing abilities
|
|
||||||
:BATTLEBOND,
|
|
||||||
:DISGUISE,
|
|
||||||
:FLOWERGIFT,
|
|
||||||
:FORECAST,
|
|
||||||
:MULTITYPE,
|
|
||||||
:POWERCONSTRUCT,
|
|
||||||
:SCHOOLING,
|
|
||||||
:SHIELDSDOWN,
|
|
||||||
:STANCECHANGE,
|
|
||||||
:ZENMODE,
|
|
||||||
# Appearance-changing abilities
|
|
||||||
:ILLUSION,
|
|
||||||
:IMPOSTER,
|
|
||||||
# Abilities intended to be inherent properties of a certain species
|
|
||||||
:COMATOSE,
|
|
||||||
:RKSSYSTEM,
|
|
||||||
# Abilities that would be overpowered if allowed to be transferred
|
|
||||||
:WONDERGUARD
|
|
||||||
]
|
|
||||||
end
|
|
||||||
|
|
||||||
def pbMoveFailed?(user,targets)
|
def pbMoveFailed?(user,targets)
|
||||||
if user.ability==0
|
if user.ability==0
|
||||||
@battle.pbDisplay(_INTL("But it failed!"))
|
@battle.pbDisplay(_INTL("But it failed!"))
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@abilityBlacklistUnlosable.each do |abil|
|
if user.unstoppableAbility?
|
||||||
next if !isConst?(user.ability,PBAbilities,abil)
|
|
||||||
@battle.pbDisplay(_INTL("But it failed!"))
|
@battle.pbDisplay(_INTL("But it failed!"))
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@abilityBlacklistUngainable.each do |abil|
|
if user.ungainableAbility? || isConst?(user.ability, PBAbilities, :WONDERGUARD)
|
||||||
next if !isConst?(user.ability,PBAbilities,abil)
|
|
||||||
@battle.pbDisplay(_INTL("But it failed!"))
|
@battle.pbDisplay(_INTL("But it failed!"))
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@@ -2349,13 +2176,11 @@ class PokeBattle_Move_067 < PokeBattle_Move
|
|||||||
@battle.pbDisplay(_INTL("But it failed!"))
|
@battle.pbDisplay(_INTL("But it failed!"))
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@abilityBlacklistUnlosable.each do |abil|
|
if target.unstoppableAbility?
|
||||||
next if !isConst?(target.ability,PBAbilities,abil)
|
|
||||||
@battle.pbDisplay(_INTL("But it failed!"))
|
@battle.pbDisplay(_INTL("But it failed!"))
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@abilityBlacklistUngainable.each do |abil|
|
if target.ungainableAbility? || isConst?(target.ability, PBAbilities, :WONDERGUARD)
|
||||||
next if !isConst?(target.ability,PBAbilities,abil)
|
|
||||||
@battle.pbDisplay(_INTL("But it failed!"))
|
@battle.pbDisplay(_INTL("But it failed!"))
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@@ -2398,29 +2223,8 @@ end
|
|||||||
# Target's ability is negated. (Gastro Acid)
|
# Target's ability is negated. (Gastro Acid)
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
class PokeBattle_Move_068 < PokeBattle_Move
|
class PokeBattle_Move_068 < PokeBattle_Move
|
||||||
def initialize(battle,move)
|
|
||||||
super
|
|
||||||
@abilityBlacklist = [
|
|
||||||
# Form-changing abilities
|
|
||||||
:BATTLEBOND,
|
|
||||||
:DISGUISE,
|
|
||||||
# :FLOWERGIFT, # This can be negated
|
|
||||||
# :FORECAST, # This can be negated
|
|
||||||
:MULTITYPE,
|
|
||||||
:POWERCONSTRUCT,
|
|
||||||
:SCHOOLING,
|
|
||||||
:SHIELDSDOWN,
|
|
||||||
:STANCECHANGE,
|
|
||||||
:ZENMODE,
|
|
||||||
# Abilities intended to be inherent properties of a certain species
|
|
||||||
:COMATOSE,
|
|
||||||
:RKSSYSTEM
|
|
||||||
]
|
|
||||||
end
|
|
||||||
|
|
||||||
def pbFailsAgainstTarget?(user,target)
|
def pbFailsAgainstTarget?(user,target)
|
||||||
@abilityBlacklist.each do |abil|
|
if target.unstoppableAbility?
|
||||||
next if !isConst?(target.ability,PBAbilities,abil)
|
|
||||||
@battle.pbDisplay(_INTL("But it failed!"))
|
@battle.pbDisplay(_INTL("But it failed!"))
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2178,31 +2178,9 @@ end
|
|||||||
# performed its action this round. (Core Enforcer)
|
# performed its action this round. (Core Enforcer)
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
class PokeBattle_Move_165 < PokeBattle_Move
|
class PokeBattle_Move_165 < PokeBattle_Move
|
||||||
def initialize(battle,move)
|
|
||||||
super
|
|
||||||
@abilityBlacklist = [
|
|
||||||
# Form-changing abilities
|
|
||||||
:BATTLEBOND,
|
|
||||||
:DISGUISE,
|
|
||||||
# :FLOWERGIFT, # This can be negated
|
|
||||||
# :FORECAST, # This can be negated
|
|
||||||
:MULTITYPE,
|
|
||||||
:POWERCONSTRUCT,
|
|
||||||
:SCHOOLING,
|
|
||||||
:SHIELDSDOWN,
|
|
||||||
:STANCECHANGE,
|
|
||||||
:ZENMODE,
|
|
||||||
# Abilities intended to be inherent properties of a certain species
|
|
||||||
:COMATOSE,
|
|
||||||
:RKSSYSTEM
|
|
||||||
]
|
|
||||||
end
|
|
||||||
|
|
||||||
def pbEffectAgainstTarget(user,target)
|
def pbEffectAgainstTarget(user,target)
|
||||||
return if target.damageState.substitute || target.effects[PBEffects::GastroAcid]
|
return if target.damageState.substitute || target.effects[PBEffects::GastroAcid]
|
||||||
@abilityBlacklist.each do |abil|
|
return if target.unstoppableAbility?
|
||||||
return if isConst?(target.ability,PBAbilities,abil)
|
|
||||||
end
|
|
||||||
return if @battle.choices[target.index][0]!=:UseItem &&
|
return if @battle.choices[target.index][0]!=:UseItem &&
|
||||||
!((@battle.choices[target.index][0]==:UseMove ||
|
!((@battle.choices[target.index][0]==:UseMove ||
|
||||||
@battle.choices[target.index][0]==:Shift) && target.movedThisRound?)
|
@battle.choices[target.index][0]==:Shift) && target.movedThisRound?)
|
||||||
|
|||||||
@@ -1532,37 +1532,13 @@ BattleHandlers::TargetAbilityOnHit.add(:MUMMY,
|
|||||||
proc { |ability,user,target,move,battle|
|
proc { |ability,user,target,move,battle|
|
||||||
next if !move.pbContactMove?(user)
|
next if !move.pbContactMove?(user)
|
||||||
next if user.fainted?
|
next if user.fainted?
|
||||||
abilityBlacklist = [
|
next if user.unstoppableAbility? || user.ability == ability
|
||||||
# This ability
|
|
||||||
:MUMMY,
|
|
||||||
# Form-changing abilities
|
|
||||||
:BATTLEBOND,
|
|
||||||
:DISGUISE,
|
|
||||||
# :FLOWERGIFT, # This can be replaced
|
|
||||||
# :FORECAST, # This can be replaced
|
|
||||||
:MULTITYPE,
|
|
||||||
:POWERCONSTRUCT,
|
|
||||||
:SCHOOLING,
|
|
||||||
:SHIELDSDOWN,
|
|
||||||
:STANCECHANGE,
|
|
||||||
:ZENMODE,
|
|
||||||
# Abilities intended to be inherent properties of a certain species
|
|
||||||
:COMATOSE,
|
|
||||||
:RKSSYSTEM,
|
|
||||||
]
|
|
||||||
failed = false
|
|
||||||
abilityBlacklist.each do |abil|
|
|
||||||
next if !isConst?(user.ability,PBAbilities,abil)
|
|
||||||
failed = true
|
|
||||||
break
|
|
||||||
end
|
|
||||||
next if failed
|
|
||||||
oldAbil = -1
|
oldAbil = -1
|
||||||
battle.pbShowAbilitySplash(target) if user.opposes?(target)
|
battle.pbShowAbilitySplash(target) if user.opposes?(target)
|
||||||
if user.affectedByContactEffect?(PokeBattle_SceneConstants::USE_ABILITY_SPLASH)
|
if user.affectedByContactEffect?(PokeBattle_SceneConstants::USE_ABILITY_SPLASH)
|
||||||
oldAbil = user.ability
|
oldAbil = user.ability
|
||||||
battle.pbShowAbilitySplash(user,true,false) if user.opposes?(target)
|
battle.pbShowAbilitySplash(user,true,false) if user.opposes?(target)
|
||||||
user.ability = getConst(PBAbilities,:MUMMY)
|
user.ability = ability
|
||||||
battle.pbReplaceAbilitySplash(user) if user.opposes?(target)
|
battle.pbReplaceAbilitySplash(user) if user.opposes?(target)
|
||||||
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
||||||
battle.pbDisplay(_INTL("{1}'s Ability became {2}!",user.pbThis,user.abilityName))
|
battle.pbDisplay(_INTL("{1}'s Ability became {2}!",user.pbThis,user.abilityName))
|
||||||
@@ -2444,38 +2420,11 @@ BattleHandlers::AbilityOnSwitchOut.add(:REGENERATOR,
|
|||||||
BattleHandlers::AbilityChangeOnBattlerFainting.add(:POWEROFALCHEMY,
|
BattleHandlers::AbilityChangeOnBattlerFainting.add(:POWEROFALCHEMY,
|
||||||
proc { |ability,battler,fainted,battle|
|
proc { |ability,battler,fainted,battle|
|
||||||
next if battler.opposes?(fainted)
|
next if battler.opposes?(fainted)
|
||||||
abilityBlacklist = [
|
next if fainted.ungainableAbility? ||
|
||||||
# Replaces self with another ability
|
isConst?(fainted.ability, PBAbilities, :POWEROFALCHEMY) ||
|
||||||
:POWEROFALCHEMY,
|
isConst?(fainted.ability, PBAbilities, :RECEIVER) ||
|
||||||
:RECEIVER,
|
isConst?(fainted.ability, PBAbilities, :TRACE) ||
|
||||||
:TRACE,
|
isConst?(fainted.ability, PBAbilities, :WONDERGUARD)
|
||||||
# Form-changing abilities
|
|
||||||
:BATTLEBOND,
|
|
||||||
:DISGUISE,
|
|
||||||
:FLOWERGIFT,
|
|
||||||
:FORECAST,
|
|
||||||
:MULTITYPE,
|
|
||||||
:POWERCONSTRUCT,
|
|
||||||
:SCHOOLING,
|
|
||||||
:SHIELDSDOWN,
|
|
||||||
:STANCECHANGE,
|
|
||||||
:ZENMODE,
|
|
||||||
# Appearance-changing abilities
|
|
||||||
:ILLUSION,
|
|
||||||
:IMPOSTER,
|
|
||||||
# Abilities intended to be inherent properties of a certain species
|
|
||||||
:COMATOSE,
|
|
||||||
:RKSSYSTEM,
|
|
||||||
# Abilities that would be overpowered if allowed to be transferred
|
|
||||||
:WONDERGUARD
|
|
||||||
]
|
|
||||||
failed = false
|
|
||||||
abilityBlacklist.each do |abil|
|
|
||||||
next if !isConst?(fainted.ability,PBAbilities,abil)
|
|
||||||
failed = true
|
|
||||||
break
|
|
||||||
end
|
|
||||||
next if failed
|
|
||||||
battle.pbShowAbilitySplash(battler,true)
|
battle.pbShowAbilitySplash(battler,true)
|
||||||
battler.ability = fainted.ability
|
battler.ability = fainted.ability
|
||||||
battle.pbReplaceAbilitySplash(battler)
|
battle.pbReplaceAbilitySplash(battler)
|
||||||
|
|||||||
Reference in New Issue
Block a user