Merge branch 'beta' into linger-arena-trap-fix
This commit is contained in:
commit
82a3cea925
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue