mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-20 06:19:29 +02:00
slay dnr
This commit is contained in:
parent
3b98003ad0
commit
c9c171c22c
@ -2809,9 +2809,14 @@ export class GrudgeTag extends BattlerTag {
|
||||
lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
|
||||
if (lapseType === BattlerTagLapseType.FAINT) {
|
||||
if (pokemon.isFainted() && pokemon.turnData.attacksReceived.length > 0) {
|
||||
const lastAttackSource = pokemon.scene.getPokemonById(pokemon.turnData.attacksReceived[0].sourceId);
|
||||
const lastMove = pokemon.turnData.attacksReceived[0];
|
||||
const lastAttackSource = pokemon.scene.getPokemonById(lastMove.sourceId);
|
||||
if (lastAttackSource && lastAttackSource?.isOnField()) {
|
||||
lastAttackSource.summonData.moveset[0]?.getMovePp();
|
||||
const lastMoveData = lastAttackSource.getMoveset().find(m => m?.moveId === lastMove.move);
|
||||
if (lastMoveData) {
|
||||
lastMoveData.ppUsed = lastMoveData.getMovePp();
|
||||
pokemon.scene.queueMessage(i18next.t("battlerTags:grudgeOnLapse", { pokemonNameWithAffix: getPokemonNameWithAffix(lastAttackSource), moveName: lastMoveData.getName() }));
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user