mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-20 14:29:28 +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 {
|
lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
|
||||||
if (lapseType === BattlerTagLapseType.FAINT) {
|
if (lapseType === BattlerTagLapseType.FAINT) {
|
||||||
if (pokemon.isFainted() && pokemon.turnData.attacksReceived.length > 0) {
|
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()) {
|
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;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user