Fixed a fainted Pokémon's damage state being reset immediately and stopping certain abilities/effects working properly if they reference it

This commit is contained in:
Maruno17
2020-09-19 01:00:52 +01:00
parent 3cf88f6f72
commit 3f99fd39e3

View File

@@ -65,6 +65,7 @@ class PokeBattle_Battler
def pbInitialize(pkmn,idxParty,batonPass=false)
pbInitPokemon(pkmn,idxParty)
pbInitEffects(batonPass)
@damageState.reset
end
def pbInitPokemon(pkmn,idxParty)
@@ -138,7 +139,6 @@ class PokeBattle_Battler
@effects[PBEffects::Substitute] = 0
@effects[PBEffects::Telekinesis] = 0
end
@damageState.reset
@fainted = (@hp==0)
@initialHP = 0
@lastAttacker = []
@@ -302,7 +302,7 @@ class PokeBattle_Battler
end
end
# Used only to erase the battler of a Shadow Pokémon that has been snagged.
# Used to erase the battler of a Pokémon that has been caught.
def pbReset
@pokemon = nil
@pokemonIndex = -1