Clean up Glaive Rush implementation

This commit is contained in:
innerthunder 2024-11-14 16:38:38 -08:00
parent f778bd5877
commit 6eb0e96db3
5 changed files with 15 additions and 16 deletions

View File

@ -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, * 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 * 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.ALWAYS_CRIT:
case BattlerTagType.IGNORE_ACCURACY: case BattlerTagType.IGNORE_ACCURACY:
return new BattlerTag(tagType, BattlerTagLapseType.TURN_END, 2, sourceMove); return new BattlerTag(tagType, BattlerTagLapseType.TURN_END, 2, sourceMove);
case BattlerTagType.ALWAYS_GET_HIT: case BattlerTagType.GLAIVE_RUSH:
case BattlerTagType.RECEIVE_DOUBLE_DAMAGE: return new GlaiveRushTag();
return new BattlerTag(tagType, BattlerTagLapseType.PRE_MOVE, 1, sourceMove);
case BattlerTagType.BYPASS_SLEEP: case BattlerTagType.BYPASS_SLEEP:
return new BattlerTag(tagType, BattlerTagLapseType.TURN_END, turnCount, sourceMove); return new BattlerTag(tagType, BattlerTagLapseType.TURN_END, turnCount, sourceMove);
case BattlerTagType.IGNORE_FLYING: case BattlerTagType.IGNORE_FLYING:

View File

@ -5213,8 +5213,8 @@ export class AddBattlerTagAttr extends MoveEffectAttr {
this.tagType = tagType; this.tagType = tagType;
this.turnCountMin = turnCountMin; this.turnCountMin = turnCountMin;
this.turnCountMax = turnCountMax !== undefined ? turnCountMax : turnCountMin; this.turnCountMax = turnCountMax ?? turnCountMin;
this.failOnOverlap = !!failOnOverlap; this.failOnOverlap = failOnOverlap;
this.cancelOnFail = cancelOnFail; this.cancelOnFail = cancelOnFail;
} }
@ -5257,7 +5257,7 @@ export class AddBattlerTagAttr extends MoveEffectAttr {
case BattlerTagType.DROWSY: case BattlerTagType.DROWSY:
case BattlerTagType.DISABLED: case BattlerTagType.DISABLED:
case BattlerTagType.HEAL_BLOCK: case BattlerTagType.HEAL_BLOCK:
case BattlerTagType.RECEIVE_DOUBLE_DAMAGE: case BattlerTagType.GLAIVE_RUSH:
return -5; return -5;
case BattlerTagType.SEEDED: case BattlerTagType.SEEDED:
case BattlerTagType.SALT_CURED: case BattlerTagType.SALT_CURED:
@ -5278,7 +5278,6 @@ export class AddBattlerTagAttr extends MoveEffectAttr {
case BattlerTagType.ENCORE: case BattlerTagType.ENCORE:
return -2; return -2;
case BattlerTagType.MINIMIZED: case BattlerTagType.MINIMIZED:
case BattlerTagType.ALWAYS_GET_HIT:
return 0; return 0;
case BattlerTagType.INGRAIN: case BattlerTagType.INGRAIN:
case BattlerTagType.IGNORE_ACCURACY: 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) new AttackMove(Moves.ICE_SPINNER, Type.ICE, MoveCategory.PHYSICAL, 80, 100, 15, -1, 0, 9)
.attr(ClearTerrainAttr), .attr(ClearTerrainAttr),
new AttackMove(Moves.GLAIVE_RUSH, Type.DRAGON, MoveCategory.PHYSICAL, 120, 100, 5, -1, 0, 9) 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.GLAIVE_RUSH, true, false, 0, 0, true, 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");
}),
new StatusMove(Moves.REVIVAL_BLESSING, Type.NORMAL, -1, 1, -1, 0, 9) new StatusMove(Moves.REVIVAL_BLESSING, Type.NORMAL, -1, 1, -1, 0, 9)
.triageMove() .triageMove()
.attr(RevivalBlessingAttr) .attr(RevivalBlessingAttr)

View File

@ -61,8 +61,7 @@ export enum BattlerTagType {
ICE_FACE = "ICE_FACE", ICE_FACE = "ICE_FACE",
DISGUISE = "DISGUISE", DISGUISE = "DISGUISE",
STOCKPILING = "STOCKPILING", STOCKPILING = "STOCKPILING",
RECEIVE_DOUBLE_DAMAGE = "RECEIVE_DOUBLE_DAMAGE", GLAIVE_RUSH = "GLAIVE_RUSH",
ALWAYS_GET_HIT = "ALWAYS_GET_HIT",
DISABLED = "DISABLED", DISABLED = "DISABLED",
SUBSTITUTE = "SUBSTITUTE", SUBSTITUTE = "SUBSTITUTE",
IGNORE_GHOST = "IGNORE_GHOST", IGNORE_GHOST = "IGNORE_GHOST",

View File

@ -2651,7 +2651,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
/** Doubles damage if this Pokemon's last move was Glaive Rush */ /** Doubles damage if this Pokemon's last move was Glaive Rush */
const glaiveRushMultiplier = new Utils.IntegerHolder(1); const glaiveRushMultiplier = new Utils.IntegerHolder(1);
if (this.getTag(BattlerTagType.RECEIVE_DOUBLE_DAMAGE)) { if (this.getTag(BattlerTagType.GLAIVE_RUSH)) {
glaiveRushMultiplier.value = 2; glaiveRushMultiplier.value = 2;
} }

View File

@ -552,7 +552,7 @@ export class MoveEffectPhase extends PokemonPhase {
return true; return true;
} }
if (target.getTag(BattlerTagType.ALWAYS_GET_HIT)) { if (target.getTag(BattlerTagType.GLAIVE_RUSH)) {
return true; return true;
} }