Fixed Magic Guard not being checked for damage from Shadow Sky weather/Spiky Shield/Dry Skin/Solar Power, fixed As One not having Unnerve's effect, fixed Gulp Missile paralysing the wrong Pokémon, added message for obtaining multiple machine items at once

This commit is contained in:
Maruno17
2023-04-20 18:04:15 +01:00
parent b9bf3e8b83
commit 4bab130785
6 changed files with 41 additions and 21 deletions

View File

@@ -13,7 +13,7 @@ class Battle::Battler
@fainted = true
# Check for end of Neutralizing Gas/Unnerve
pbAbilitiesOnNeutralizingGasEnding if hasActiveAbility?(:NEUTRALIZINGGAS, true)
pbItemsOnUnnerveEnding if hasActiveAbility?(:UNNERVE, true)
pbItemsOnUnnerveEnding if hasActiveAbility?([:UNNERVE, :ASONECHILLINGNEIGH, :ASONEGRIMNEIGH], true)
# Check for end of primordial weather
@battle.pbEndPrimordialWeather
end
@@ -29,7 +29,7 @@ class Battle::Battler
Battle::AbilityEffects.triggerOnBattlerFainting(b.ability, b, self, @battle)
end
pbAbilitiesOnNeutralizingGasEnding if hasActiveAbility?(:NEUTRALIZINGGAS, true)
pbItemsOnUnnerveEnding if hasActiveAbility?(:UNNERVE, true)
pbItemsOnUnnerveEnding if hasActiveAbility?([:UNNERVE, :ASONECHILLINGNEIGH, :ASONEGRIMNEIGH], true)
end
# Used for Emergency Exit/Wimp Out. Returns whether self has switched out.
@@ -162,7 +162,8 @@ class Battle::Battler
def pbOnLosingAbility(oldAbil, suppressed = false)
if oldAbil == :NEUTRALIZINGGAS && (suppressed || !@effects[PBEffects::GastroAcid])
pbAbilitiesOnNeutralizingGasEnding
elsif oldAbil == :UNNERVE && (suppressed || !@effects[PBEffects::GastroAcid])
elsif [:UNNERVE, :ASONECHILLINGNEIGH, :ASONEGRIMNEIGH].include?(oldAbil) &&
(suppressed || !@effects[PBEffects::GastroAcid])
pbItemsOnUnnerveEnding
elsif oldAbil == :ILLUSION && @effects[PBEffects::Illusion]
@effects[PBEffects::Illusion] = nil
@@ -200,7 +201,7 @@ class Battle::Battler
# Held item consuming/removing
#=============================================================================
def canConsumeBerry?
return false if @battle.pbCheckOpposingAbility(:UNNERVE, @index)
return false if @battle.pbCheckOpposingAbility([:UNNERVE, :ASONECHILLINGNEIGH, :ASONEGRIMNEIGH], @index)
return true
end