From d2e489ae3a2dc7d9d896517963cdcaec479311e8 Mon Sep 17 00:00:00 2001 From: PrabbyDD Date: Thu, 12 Sep 2024 10:16:29 -0700 Subject: [PATCH] fixing some messages and putting burn up and double shock in same class --- src/data/battler-tags.ts | 28 +++++++++++----------------- src/test/moves/roost.test.ts | 3 --- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index 354b00a1582..2b77afe495a 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -1870,22 +1870,18 @@ export class CursedTag extends BattlerTag { return ret; } } - -export class DoubleShockedTag extends BattlerTag { - constructor() { - super(BattlerTagType.DOUBLE_SHOCKED, BattlerTagLapseType.CUSTOM, 1, Moves.DOUBLE_SHOCK); - } -} - -export class BurnedUpTag extends BattlerTag { - constructor() { - super(BattlerTagType.BURNED_UP, BattlerTagLapseType.CUSTOM, 1, Moves.BURN_UP); +/** + * Battler tag for attacks that remove a type post use. + */ +export class RemovedTypeTag extends BattlerTag { + constructor(tagType: BattlerTagType, lapseType: BattlerTagLapseType, sourceMove: Moves) { + super(tagType, lapseType, 1, sourceMove); } } /** * Battler tag for effects that ground the source, allowing Ground-type moves to hit them. - * @item `IGNORE_FLYING`: Persistent grounding effects (i.e. from Smack Down and Thousand Waves) + * @description `IGNORE_FLYING`: Persistent grounding effects (i.e. from Smack Down and Thousand Waves) */ export class GroundedTag extends BattlerTag { constructor(tagType: BattlerTagType, lapseType: BattlerTagLapseType, sourceMove: Moves) { @@ -1894,10 +1890,8 @@ export class GroundedTag extends BattlerTag { } /** - * @item `ROOSTED`: Tag for temporary grounding if only source of ungrounding is flying and pokemon uses Roost. + * @description `ROOSTED`: Tag for temporary grounding if only source of ungrounding is flying and pokemon uses Roost. * Roost removes flying type from a pokemon for a single turn. - * - * Need to add check for terrastalized pokemon */ export class RoostedTag extends BattlerTag { @@ -1947,7 +1941,7 @@ export class RoostedTag extends BattlerTag { if (this.isBasePureFlying && !isCurrentlyDualType) { modifiedTypes = [Type.NORMAL]; } else { - if ((!!pokemon.getTag(BurnedUpTag) || !!pokemon.getTag(DoubleShockedTag)) && isOriginallyDualType && !isCurrentlyDualType) { + if (!!pokemon.getTag(RemovedTypeTag) && isOriginallyDualType && !isCurrentlyDualType) { modifiedTypes = [Type.UNKNOWN]; } else { modifiedTypes = currentTypes.filter(type => type !== Type.FLYING); @@ -2323,9 +2317,9 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: number, source case BattlerTagType.ROOSTED: return new RoostedTag(); case BattlerTagType.BURNED_UP: - return new BurnedUpTag(); + return new RemovedTypeTag(tagType, BattlerTagLapseType.CUSTOM, sourceMove); case BattlerTagType.DOUBLE_SHOCKED: - return new DoubleShockedTag(); + return new RemovedTypeTag(tagType, BattlerTagLapseType.CUSTOM, sourceMove); case BattlerTagType.SALT_CURED: return new SaltCuredTag(sourceId); case BattlerTagType.CURSED: diff --git a/src/test/moves/roost.test.ts b/src/test/moves/roost.test.ts index 0f77d3f262f..df7fc7096b0 100644 --- a/src/test/moves/roost.test.ts +++ b/src/test/moves/roost.test.ts @@ -38,7 +38,6 @@ describe("Moves - Roost", () => { /** * Roost's behavior should be defined as: * The pokemon loses its flying type for a turn. If the pokemon was ungroundd solely due to being a flying type, it will be grounded until end of turn. - * * 1. Pure Flying type pokemon -> become normal type until end of turn * 2. Dual Flying/X type pokemon -> become type X until end of turn * 3. Pokemon that use burn up into roost (ex. Moltres) -> become flying due to burn up, then typeless until end of turn after using roost @@ -47,8 +46,6 @@ describe("Moves - Roost", () => { * and pokemon post Burn up become () * 5. If a pokemon is also ungrounded due to other reasons (such as levitate), it will stay ungrounded post roost, despite not being flying type. * 6. Non flying types using roost (such as dunsparce) are already grounded, so this move will only heal and have no other effects. - * - * Also making the user pokemon go first so we can check if the pokemon took damage post roost */ test(