mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-19 14:52:19 +02:00
Apply PP
This commit is contained in:
parent
558b6120d3
commit
82702d0b46
@ -350,15 +350,11 @@ export class MovePhase extends BattlePhase {
|
|||||||
|
|
||||||
// "commit" to using the move, deducting PP.
|
// "commit" to using the move, deducting PP.
|
||||||
if (!this.ignorePp) {
|
if (!this.ignorePp) {
|
||||||
let ppUsed = 1 + this.getPpIncreaseFromPressure(targets);
|
const ppUsed = new NumberHolder(1 + this.getPpIncreaseFromPressure(targets));
|
||||||
|
|
||||||
const ignorePPChallenge = new BooleanHolder(false);
|
applyChallenges(ChallengeType.MODIFY_PP_USE, this.pokemon, this.move.moveId, ppUsed);
|
||||||
applyChallenges(ChallengeType.MODIFY_PP_USE, ignorePPChallenge);
|
|
||||||
if (ignorePPChallenge.value) {
|
|
||||||
ppUsed = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.move.usePp(ppUsed);
|
this.move.usePp(ppUsed.value);
|
||||||
globalScene.eventTarget.dispatchEvent(new MoveUsedEvent(this.pokemon?.id, this.move.getMove(), this.move.ppUsed));
|
globalScene.eventTarget.dispatchEvent(new MoveUsedEvent(this.pokemon?.id, this.move.getMove(), this.move.ppUsed));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user