[P2] No Exp Gained after Switching in a Pokemon as the Opponent Faints (#4687)

* fixing the exp bug

* fixing the exp bug

* dont think need to reset turn data there

* changing a little bit

* Update src/phases/faint-phase.ts

Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>

---------

Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
This commit is contained in:
PrabbyDD 2024-10-29 14:38:57 -07:00 committed by GitHub
parent afe6d2900d
commit 15dedf06ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 0 deletions

View File

@ -65,6 +65,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 */
this.scene.getPlayerField().forEach((pokemon, i) => {
if (pokemon?.isActive(true)) {
if (pokemon.isPlayer()) {
this.scene.currentBattle.addParticipant(pokemon as PlayerPokemon);
}
}
});
if (!this.tryOverrideForBattleSpec()) {
this.doFaint();
}