mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-04 07:22:19 +02:00
PRE_MOVE Lapse added for Recharge, Recharge now cancels
Added a PRE_MOVE Identifier for Recharge specifically, which now cancels the move and shifts the move queue (since this will no longer occur in doMove. This prevents Confusion/Infatuation from also being triggered after a Pokemon is recharging.
This commit is contained in:
parent
4c2dc8651f
commit
283db6d193
@ -17,6 +17,7 @@ import { BattleStat } from "./battle-stat";
|
|||||||
export enum BattlerTagLapseType {
|
export enum BattlerTagLapseType {
|
||||||
FAINT,
|
FAINT,
|
||||||
MOVE,
|
MOVE,
|
||||||
|
PRE_MOVE,
|
||||||
AFTER_MOVE,
|
AFTER_MOVE,
|
||||||
MOVE_EFFECT,
|
MOVE_EFFECT,
|
||||||
TURN_END,
|
TURN_END,
|
||||||
@ -77,7 +78,7 @@ export interface TerrainBattlerTag {
|
|||||||
|
|
||||||
export class RechargingTag extends BattlerTag {
|
export class RechargingTag extends BattlerTag {
|
||||||
constructor(sourceMove: Moves) {
|
constructor(sourceMove: Moves) {
|
||||||
super(BattlerTagType.RECHARGING, BattlerTagLapseType.MOVE, 1, sourceMove);
|
super(BattlerTagType.RECHARGING, BattlerTagLapseType.PRE_MOVE, 1, sourceMove);
|
||||||
}
|
}
|
||||||
|
|
||||||
onAdd(pokemon: Pokemon): void {
|
onAdd(pokemon: Pokemon): void {
|
||||||
@ -90,6 +91,8 @@ export class RechargingTag extends BattlerTag {
|
|||||||
super.lapse(pokemon, lapseType);
|
super.lapse(pokemon, lapseType);
|
||||||
|
|
||||||
pokemon.scene.queueMessage(getPokemonMessage(pokemon, ' must\nrecharge!'));
|
pokemon.scene.queueMessage(getPokemonMessage(pokemon, ' must\nrecharge!'));
|
||||||
|
(pokemon.scene.getCurrentPhase() as MovePhase).cancel();
|
||||||
|
pokemon.getMoveQueue().shift();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user