This commit is contained in:
PrabbyDD 2025-04-12 17:11:16 -05:00 committed by GitHub
commit d03a052812
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 5 deletions

View File

@ -96,12 +96,19 @@ export class FaintPhase extends PokemonPhase {
}
}
/** In case the current pokemon was just switched in, make sure it is counted as participating in the combat */
for (const pokemon of globalScene.getPlayerField()) {
if (pokemon?.isActive(true) && pokemon.isPlayer()) {
globalScene.currentBattle.addParticipant(pokemon as PlayerPokemon);
/**
* 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.
*/
globalScene.getPlayerField().forEach((pokemon, i) => {
if (pokemon?.isActive() || pokemon?.isFainted()) {
if (pokemon.isPlayer()) {
globalScene.currentBattle.addParticipant(pokemon as PlayerPokemon);
}
}
}
});
if (!this.tryOverrideForBattleSpec()) {
this.doFaint();