mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-21 14:59:26 +02:00
Merge branch 'charge-move-overhaul' of https://github.com/innerthunder/pokerogue into charge-move-overhaul
This commit is contained in:
commit
3c425396f5
@ -310,11 +310,31 @@ export class MovePhase extends BattlePhase {
|
|||||||
|
|
||||||
/** Queues a {@linkcode MoveChargePhase} for this phase's invoked move. */
|
/** Queues a {@linkcode MoveChargePhase} for this phase's invoked move. */
|
||||||
protected chargeMove() {
|
protected chargeMove() {
|
||||||
|
const move = this.move.getMove();
|
||||||
|
const targets = this.getActiveTargetPokemon();
|
||||||
|
|
||||||
|
if (move.applyConditions(this.pokemon, targets[0], move)) {
|
||||||
// Protean and Libero apply on the charging turn of charge moves
|
// Protean and Libero apply on the charging turn of charge moves
|
||||||
applyPreAttackAbAttrs(PokemonTypeChangeAbAttr, this.pokemon, null, this.move.getMove());
|
applyPreAttackAbAttrs(PokemonTypeChangeAbAttr, this.pokemon, null, this.move.getMove());
|
||||||
|
|
||||||
this.showMoveText();
|
this.showMoveText();
|
||||||
this.scene.unshiftPhase(new MoveChargePhase(this.scene, this.pokemon.getBattlerIndex(), this.targets[0], this.move));
|
this.scene.unshiftPhase(new MoveChargePhase(this.scene, this.pokemon.getBattlerIndex(), this.targets[0], this.move));
|
||||||
|
} else {
|
||||||
|
// Copied from useMove()
|
||||||
|
this.pokemon.pushMoveHistory({ move: this.move.moveId, targets: this.targets, result: MoveResult.FAIL, virtual: this.move.virtual });
|
||||||
|
|
||||||
|
let failedText: string | undefined;
|
||||||
|
const failureMessage = move.getFailedText(this.pokemon, targets[0], move, new BooleanHolder(false));
|
||||||
|
|
||||||
|
if (failureMessage) {
|
||||||
|
failedText = failureMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.showFailedText(failedText);
|
||||||
|
|
||||||
|
// Remove the user from its semi-invulnerable state (if applicable)
|
||||||
|
this.pokemon.lapseTags(BattlerTagLapseType.MOVE_EFFECT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user