Fixed BGM bug when ending surfing and immediately triggering a trainer battle with an intro BGM, fixed events making all other events check if they trigger after the event moves, fixed Neutralizing Gas triggering twice upon fainting

This commit is contained in:
Maruno17
2023-11-05 15:42:15 +00:00
parent 092fbda34d
commit 156a6fca74
7 changed files with 53 additions and 20 deletions

View File

@@ -8,12 +8,21 @@ class Battle::Battler
end
# Reset form
@battle.peer.pbOnLeavingBattle(@battle, @pokemon, @battle.usedInBattle[idxOwnSide][@index / 2])
# Check for end of Neutralizing Gas/Unnerve
if hasActiveAbility?(:NEUTRALIZINGGAS)
# Treat self as fainted
@hp = 0
@fainted = true
pbAbilitiesOnNeutralizingGasEnding
elsif hasActiveAbility?([:UNNERVE, :ASONECHILLINGNEIGH, :ASONEGRIMNEIGH])
# Treat self as fainted
@hp = 0
@fainted = true
pbItemsOnUnnerveEnding
end
# Treat self as fainted
@hp = 0
@fainted = true
# Check for end of Neutralizing Gas/Unnerve
pbAbilitiesOnNeutralizingGasEnding if hasActiveAbility?(:NEUTRALIZINGGAS, true)
pbItemsOnUnnerveEnding if hasActiveAbility?([:UNNERVE, :ASONECHILLINGNEIGH, :ASONEGRIMNEIGH], true)
# Check for end of primordial weather
@battle.pbEndPrimordialWeather
end