mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-04-29 13:03:48 +01:00
[Bug] [UI/UX] Smack Down and Thousand Arrows now display a message for Grounding (#5536)
Fix #5027: Missing confirmation message for moves special effects When using the moves Thousand Arrows and Smack Down, though the special effect of grounding the opponent is applied, a confirming message was not displayed. In this fix a new AddBattlerTagAttr subclass has been created to handle the message display, compared to previous multiple attribute additions. This new subclass verifies the conditions for the message to be displayed through asserting if target is grounded and accesses a new locale message created to display if necessary.
This commit is contained in:
parent
a1a6b0dd5a
commit
3f887988a6
@ -5542,6 +5542,31 @@ export class LeechSeedAttr extends AddBattlerTagAttr {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the appropriate battler tag for Smack Down and Thousand arrows
|
||||
* @extends AddBattlerTagAttr
|
||||
*/
|
||||
export class FallDownAttr extends AddBattlerTagAttr {
|
||||
constructor() {
|
||||
super(BattlerTagType.IGNORE_FLYING, false, false, 1, 1, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds Grounded Tag to the target and checks if fallDown message should be displayed
|
||||
* @param user the {@linkcode Pokemon} using the move
|
||||
* @param target the {@linkcode Pokemon} targeted by the move
|
||||
* @param move the {@linkcode Move} invoking this effect
|
||||
* @param args n/a
|
||||
* @returns `true` if the effect successfully applies; `false` otherwise
|
||||
*/
|
||||
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||
if (!target.isGrounded()) {
|
||||
globalScene.queueMessage(i18next.t("moveTriggers:fallDown", { targetPokemonName: getPokemonNameWithAffix(target) }));
|
||||
}
|
||||
return super.apply(user, target, move, args);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the appropriate battler tag for Gulp Missile when Surf or Dive is used.
|
||||
* @extends MoveEffectAttr
|
||||
@ -9646,7 +9671,7 @@ export function initMoves() {
|
||||
.target(MoveTarget.BOTH_SIDES)
|
||||
.unimplemented(),
|
||||
new AttackMove(Moves.SMACK_DOWN, PokemonType.ROCK, MoveCategory.PHYSICAL, 50, 100, 15, 100, 0, 5)
|
||||
.attr(AddBattlerTagAttr, BattlerTagType.IGNORE_FLYING, false, false, 1, 1, true)
|
||||
.attr(FallDownAttr)
|
||||
.attr(AddBattlerTagAttr, BattlerTagType.INTERRUPTED)
|
||||
.attr(RemoveBattlerTagAttr, [ BattlerTagType.FLYING, BattlerTagType.FLOATING, BattlerTagType.TELEKINESIS ])
|
||||
.attr(HitsTagAttr, BattlerTagType.FLYING)
|
||||
@ -10097,7 +10122,7 @@ export function initMoves() {
|
||||
.triageMove(),
|
||||
new AttackMove(Moves.THOUSAND_ARROWS, PokemonType.GROUND, MoveCategory.PHYSICAL, 90, 100, 10, -1, 0, 6)
|
||||
.attr(NeutralDamageAgainstFlyingTypeMultiplierAttr)
|
||||
.attr(AddBattlerTagAttr, BattlerTagType.IGNORE_FLYING, false, false, 1, 1, true)
|
||||
.attr(FallDownAttr)
|
||||
.attr(HitsTagAttr, BattlerTagType.FLYING)
|
||||
.attr(HitsTagAttr, BattlerTagType.FLOATING)
|
||||
.attr(AddBattlerTagAttr, BattlerTagType.INTERRUPTED)
|
||||
|
Loading…
x
Reference in New Issue
Block a user