Skip to content

Commit

Permalink
Merge branch 'beta' into freeze-dry-implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
geeilhan authored Nov 12, 2024
2 parents 75640e4 + 6f3fd0f commit 9164c3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/data/move.ts
Original file line number Diff line number Diff line change
Expand Up @@ -668,12 +668,12 @@ export default class Move implements Localizable {
}

/**
* Sees if, given the target pokemon, a move fails on it (by looking at each {@linkcode MoveAttr} of this move
* Sees if a move has a custom failure text (by looking at each {@linkcode MoveAttr} of this move)
* @param user {@linkcode Pokemon} using the move
* @param target {@linkcode Pokemon} receiving the move
* @param move {@linkcode Move} using the move
* @param cancelled {@linkcode Utils.BooleanHolder} to hold boolean value
* @returns string of the failed text, or null
* @returns string of the custom failure text, or `null` if it uses the default text ("But it failed!")
*/
getFailedText(user: Pokemon, target: Pokemon, move: Move, cancelled: Utils.BooleanHolder): string | null {
for (const attr of this.attrs) {
Expand Down
6 changes: 2 additions & 4 deletions src/phases/move-phase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,8 @@ export class MovePhase extends BattlePhase {
this.pokemon.pushMoveHistory({ move: this.move.moveId, targets: this.targets, result: MoveResult.FAIL, virtual: this.move.virtual });

const failureMessage = move.getFailedText(this.pokemon, targets[0], move, new BooleanHolder(false));
if (failureMessage) {
this.showMoveText();
this.showFailedText(failureMessage);
}
this.showMoveText();
this.showFailedText(failureMessage ?? undefined);

// Remove the user from its semi-invulnerable state (if applicable)
this.pokemon.lapseTags(BattlerTagLapseType.MOVE_EFFECT);
Expand Down

0 comments on commit 9164c3b

Please sign in to comment.