mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-21 00:52:47 +02:00
[Bug] Fix no EXP awarded if all active pokemon faint (#4688)
Party pokemon will now gain EXP from EXP Share even if all the active pokemon are fainted --------- Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
This commit is contained in:
parent
193c5ffb0c
commit
0c54fc1be0
@ -78,10 +78,15 @@ export class FaintPhase extends PokemonPhase {
|
||||
}
|
||||
}
|
||||
|
||||
/** In case the current pokemon was just switched in, make sure it is counted as participating in the combat */
|
||||
/**
|
||||
* In case the current pokemon was just switched in, make sure it is counted as participating in the combat.
|
||||
* For EXP_SHARE purposes, if the current pokemon faints as the combat ends and it was the ONLY player pokemon
|
||||
* involved in combat, it needs to be counted as a participant so the other party pokemon can get their EXP,
|
||||
* so the fainted pokemon has been included.
|
||||
*/
|
||||
for (const pokemon of globalScene.getPlayerField()) {
|
||||
if (pokemon?.isActive(true) && pokemon.isPlayer()) {
|
||||
globalScene.currentBattle.addParticipant(pokemon as PlayerPokemon);
|
||||
if (pokemon?.isActive() || pokemon?.isFainted()) {
|
||||
globalScene.currentBattle.addParticipant(pokemon);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user