From 6eb0e96db3800d25bdc407445686c1459f6297bd Mon Sep 17 00:00:00 2001 From: innerthunder Date: Thu, 14 Nov 2024 16:38:38 -0800 Subject: [PATCH] Clean up Glaive Rush implementation --- src/data/battler-tags.ts | 11 ++++++++--- src/data/move.ts | 13 ++++--------- src/enums/battler-tag-type.ts | 3 +-- src/field/pokemon.ts | 2 +- src/phases/move-effect-phase.ts | 2 +- 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index 5c6d9d66b7c..1a310fb1436 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -2489,6 +2489,12 @@ export class AutotomizedTag extends BattlerTag { } } +export class GlaiveRushTag extends BattlerTag { + constructor() { + super(BattlerTagType.GLAIVE_RUSH, BattlerTagLapseType.PRE_MOVE, 1, Moves.GLAIVE_RUSH); + } +} + /** * Tag implementing the {@link https://bulbapedia.bulbagarden.net/wiki/Substitute_(doll)#Effect | Substitute Doll} effect, * for use with the moves Substitute and Shed Tail. Pokemon with this tag deflect most forms of received attack damage @@ -3033,9 +3039,8 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: number, source case BattlerTagType.ALWAYS_CRIT: case BattlerTagType.IGNORE_ACCURACY: return new BattlerTag(tagType, BattlerTagLapseType.TURN_END, 2, sourceMove); - case BattlerTagType.ALWAYS_GET_HIT: - case BattlerTagType.RECEIVE_DOUBLE_DAMAGE: - return new BattlerTag(tagType, BattlerTagLapseType.PRE_MOVE, 1, sourceMove); + case BattlerTagType.GLAIVE_RUSH: + return new GlaiveRushTag(); case BattlerTagType.BYPASS_SLEEP: return new BattlerTag(tagType, BattlerTagLapseType.TURN_END, turnCount, sourceMove); case BattlerTagType.IGNORE_FLYING: diff --git a/src/data/move.ts b/src/data/move.ts index a288c0e9618..47ef870e283 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -5213,8 +5213,8 @@ export class AddBattlerTagAttr extends MoveEffectAttr { this.tagType = tagType; this.turnCountMin = turnCountMin; - this.turnCountMax = turnCountMax !== undefined ? turnCountMax : turnCountMin; - this.failOnOverlap = !!failOnOverlap; + this.turnCountMax = turnCountMax ?? turnCountMin; + this.failOnOverlap = failOnOverlap; this.cancelOnFail = cancelOnFail; } @@ -5257,7 +5257,7 @@ export class AddBattlerTagAttr extends MoveEffectAttr { case BattlerTagType.DROWSY: case BattlerTagType.DISABLED: case BattlerTagType.HEAL_BLOCK: - case BattlerTagType.RECEIVE_DOUBLE_DAMAGE: + case BattlerTagType.GLAIVE_RUSH: return -5; case BattlerTagType.SEEDED: case BattlerTagType.SALT_CURED: @@ -5278,7 +5278,6 @@ export class AddBattlerTagAttr extends MoveEffectAttr { case BattlerTagType.ENCORE: return -2; case BattlerTagType.MINIMIZED: - case BattlerTagType.ALWAYS_GET_HIT: return 0; case BattlerTagType.INGRAIN: case BattlerTagType.IGNORE_ACCURACY: @@ -10475,11 +10474,7 @@ export function initMoves() { new AttackMove(Moves.ICE_SPINNER, Type.ICE, MoveCategory.PHYSICAL, 80, 100, 15, -1, 0, 9) .attr(ClearTerrainAttr), new AttackMove(Moves.GLAIVE_RUSH, Type.DRAGON, MoveCategory.PHYSICAL, 120, 100, 5, -1, 0, 9) - .attr(AddBattlerTagAttr, BattlerTagType.ALWAYS_GET_HIT, true, false, 0, 0, true) - .attr(AddBattlerTagAttr, BattlerTagType.RECEIVE_DOUBLE_DAMAGE, true, false, 0, 0, true) - .condition((user, target, move) => { - return !(target.getTag(BattlerTagType.PROTECTED)?.tagType === "PROTECTED" || target.scene.arena.getTag(ArenaTagType.MAT_BLOCK)?.tagType === "MAT_BLOCK"); - }), + .attr(AddBattlerTagAttr, BattlerTagType.GLAIVE_RUSH, true, false, 0, 0, true, true), new StatusMove(Moves.REVIVAL_BLESSING, Type.NORMAL, -1, 1, -1, 0, 9) .triageMove() .attr(RevivalBlessingAttr) diff --git a/src/enums/battler-tag-type.ts b/src/enums/battler-tag-type.ts index b2bbc1e6189..ea8ae8f6282 100644 --- a/src/enums/battler-tag-type.ts +++ b/src/enums/battler-tag-type.ts @@ -61,8 +61,7 @@ export enum BattlerTagType { ICE_FACE = "ICE_FACE", DISGUISE = "DISGUISE", STOCKPILING = "STOCKPILING", - RECEIVE_DOUBLE_DAMAGE = "RECEIVE_DOUBLE_DAMAGE", - ALWAYS_GET_HIT = "ALWAYS_GET_HIT", + GLAIVE_RUSH = "GLAIVE_RUSH", DISABLED = "DISABLED", SUBSTITUTE = "SUBSTITUTE", IGNORE_GHOST = "IGNORE_GHOST", diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 5d912f7d6e6..009ec92cd10 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -2651,7 +2651,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { /** Doubles damage if this Pokemon's last move was Glaive Rush */ const glaiveRushMultiplier = new Utils.IntegerHolder(1); - if (this.getTag(BattlerTagType.RECEIVE_DOUBLE_DAMAGE)) { + if (this.getTag(BattlerTagType.GLAIVE_RUSH)) { glaiveRushMultiplier.value = 2; } diff --git a/src/phases/move-effect-phase.ts b/src/phases/move-effect-phase.ts index afc8dd0475d..467c920f82b 100644 --- a/src/phases/move-effect-phase.ts +++ b/src/phases/move-effect-phase.ts @@ -552,7 +552,7 @@ export class MoveEffectPhase extends PokemonPhase { return true; } - if (target.getTag(BattlerTagType.ALWAYS_GET_HIT)) { + if (target.getTag(BattlerTagType.GLAIVE_RUSH)) { return true; }