mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-01-29 12:17:13 +00:00
[Bug] Fix moveset flyout not updating PP from Spite (#3388)
This commit is contained in:
parent
9875fcc59d
commit
da51d6ae12
@ -27,6 +27,7 @@ import { BattlerTagType } from "#enums/battler-tag-type";
|
||||
import { Biome } from "#enums/biome";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import { MoveUsedEvent } from "#app/events/battle-scene.js";
|
||||
|
||||
export enum MoveCategory {
|
||||
PHYSICAL,
|
||||
@ -5337,7 +5338,7 @@ export class ReducePpMoveAttr extends MoveEffectAttr {
|
||||
movesetMove.ppUsed = Math.min(movesetMove.ppUsed + this.reduction, movesetMove.getMovePp());
|
||||
|
||||
const message = i18next.t("battle:ppReduced", {targetName: getPokemonNameWithAffix(target), moveName: movesetMove.getName(), reduction: movesetMove.ppUsed - lastPpUsed});
|
||||
|
||||
user.scene.eventTarget.dispatchEvent(new MoveUsedEvent(target?.id, movesetMove.getMove(), movesetMove.ppUsed));
|
||||
user.scene.queueMessage(message);
|
||||
|
||||
return true;
|
||||
|
@ -2733,7 +2733,7 @@ export class MovePhase extends BattlePhase {
|
||||
if (this.cancelled || this.failed) {
|
||||
if (this.failed) {
|
||||
this.move.usePp(ppUsed); // Only use PP if the move failed
|
||||
this.scene.eventTarget.dispatchEvent(new MoveUsedEvent(this.pokemon?.id, this.move.getMove(), ppUsed));
|
||||
this.scene.eventTarget.dispatchEvent(new MoveUsedEvent(this.pokemon?.id, this.move.getMove(), this.move.ppUsed));
|
||||
}
|
||||
|
||||
// Record a failed move so Abilities like Truant don't trigger next turn and soft-lock
|
||||
@ -2766,7 +2766,7 @@ export class MovePhase extends BattlePhase {
|
||||
|
||||
if (!moveQueue.length || !moveQueue.shift().ignorePP) { // using .shift here clears out two turn moves once they've been used
|
||||
this.move.usePp(ppUsed);
|
||||
this.scene.eventTarget.dispatchEvent(new MoveUsedEvent(this.pokemon?.id, this.move.getMove(), ppUsed));
|
||||
this.scene.eventTarget.dispatchEvent(new MoveUsedEvent(this.pokemon?.id, this.move.getMove(), this.move.ppUsed));
|
||||
}
|
||||
|
||||
if (!allMoves[this.move.moveId].hasAttr(CopyMoveAttr)) {
|
||||
|
@ -147,7 +147,7 @@ export default class BattleFlyout extends Phaser.GameObjects.Container {
|
||||
|
||||
const foundInfo = this.moveInfo.find(x => x?.move.id === moveUsedEvent.move.id);
|
||||
if (foundInfo) {
|
||||
foundInfo.ppUsed = Math.min(foundInfo.ppUsed + moveUsedEvent.ppUsed, foundInfo.maxPp);
|
||||
foundInfo.ppUsed = moveUsedEvent.ppUsed;
|
||||
} else {
|
||||
this.moveInfo.push({move: moveUsedEvent.move, maxPp: moveUsedEvent.move.pp, ppUsed: moveUsedEvent.ppUsed});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user