From 243151d9877835bf140ac8c6321da5034b93724d Mon Sep 17 00:00:00 2001 From: Reldnahc Date: Sat, 4 May 2024 19:06:06 -0500 Subject: [PATCH] rename some bounce things to magic coat. give magic coat its move text. --- src/data/battler-tags.ts | 14 ++++++++++---- src/data/enums/battler-tag-type.ts | 2 +- src/data/move.ts | 2 +- src/phases.ts | 4 ++-- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index f21456aa5..0f2594ec6 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -790,10 +790,16 @@ export class ContactBurnProtectedTag extends ProtectedTag { } } -export class BounceTag extends BattlerTag { - constructor(sourceMove: Moves, tagType: BattlerTagType = BattlerTagType.BOUNCE) { +export class MagicCoatTag extends BattlerTag { + constructor(sourceMove: Moves, tagType: BattlerTagType = BattlerTagType.MAGIC_COAT) { super(tagType, BattlerTagLapseType.CUSTOM, 0, sourceMove); } + + onAdd(pokemon: Pokemon): void { + super.onAdd(pokemon); + + pokemon.scene.queueMessage(getPokemonMessage(pokemon, ' shrouded\nitself with Magic Coat!')); + } } export class EnduringTag extends BattlerTag { @@ -1232,8 +1238,8 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: integer, sourc return new TypeBoostTag(tagType, sourceMove, Type.ELECTRIC, 2, true); case BattlerTagType.MAGNET_RISEN: return new MagnetRisenTag(tagType, sourceMove); - case BattlerTagType.BOUNCE: - return new BounceTag(sourceMove); + case BattlerTagType.MAGIC_COAT: + return new MagicCoatTag(sourceMove); case BattlerTagType.NONE: default: return new BattlerTag(tagType, BattlerTagLapseType.CUSTOM, turnCount, sourceMove, sourceId); diff --git a/src/data/enums/battler-tag-type.ts b/src/data/enums/battler-tag-type.ts index fa0ce70ca..603209b6a 100644 --- a/src/data/enums/battler-tag-type.ts +++ b/src/data/enums/battler-tag-type.ts @@ -56,5 +56,5 @@ export enum BattlerTagType { CHARGED = "CHARGED", GROUNDED = "GROUNDED", MAGNET_RISEN = "MAGNET_RISEN", - BOUNCE = "BOUNCE" + MAGIC_COAT = "MAGIC_COAT" } diff --git a/src/data/move.ts b/src/data/move.ts index d393e33b6..2cd009f66 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -4669,7 +4669,7 @@ export function initMoves() { new AttackMove(Moves.SUPERPOWER, Type.FIGHTING, MoveCategory.PHYSICAL, 120, 100, 5, 100, 0, 3) .attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.DEF ], -1, true), new SelfStatusMove(Moves.MAGIC_COAT, Type.PSYCHIC, -1, 15, -1, 4, 3) - .attr(AddBattlerTagAttr, BattlerTagType.BOUNCE), + .attr(AddBattlerTagAttr, BattlerTagType.MAGIC_COAT), new SelfStatusMove(Moves.RECYCLE, Type.NORMAL, -1, 10, -1, 0, 3) .unimplemented(), new AttackMove(Moves.REVENGE, Type.FIGHTING, MoveCategory.PHYSICAL, 60, 100, 10, -1, -4, 3) diff --git a/src/phases.ts b/src/phases.ts index 48e9f2cde..97dac4dba 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -21,7 +21,7 @@ import { Biome } from "./data/enums/biome"; import { ModifierTier } from "./modifier/modifier-tier"; import { FusePokemonModifierType, ModifierPoolType, ModifierType, ModifierTypeFunc, ModifierTypeOption, PokemonModifierType, PokemonMoveModifierType, PokemonPpRestoreModifierType, PokemonPpUpModifierType, RememberMoveModifierType, TmModifierType, getDailyRunStarterModifiers, getEnemyBuffModifierForWave, getModifierType, getPlayerModifierTypeOptions, getPlayerShopModifierTypeOptionsForWave, modifierTypes, regenerateModifierPoolThresholds } from "./modifier/modifier-type"; import SoundFade from "phaser3-rex-plugins/plugins/soundfade"; -import { BattlerTag, BattlerTagLapseType, BounceTag, EncoreTag, HideSpriteTag as HiddenTag, ProtectedTag, TrappedTag } from "./data/battler-tags"; +import { BattlerTag, BattlerTagLapseType, MagicCoatTag, EncoreTag, HideSpriteTag as HiddenTag, ProtectedTag, TrappedTag } from "./data/battler-tags"; import { BattlerTagType } from "./data/enums/battler-tag-type"; import { getPokemonMessage } from "./messages"; import { Starter } from "./ui/starter-select-ui-handler"; @@ -2416,7 +2416,7 @@ export class MoveEffectPhase extends PokemonPhase { let isBounced: BattlerTag | boolean = false; for (let opponent of targets) { - isBounced = this.move.getMove().hasFlag(MoveFlags.MAGIC_COAT_MOVE) && (opponent.findTags(t => t instanceof BounceTag).find(t => opponent.lapseTag(t.tagType)) || opponent.hasAbilityWithAttr(MagicBounceAbAttr)); + isBounced = this.move.getMove().hasFlag(MoveFlags.MAGIC_COAT_MOVE) && (opponent.findTags(t => t instanceof MagicCoatTag).find(t => opponent.lapseTag(t.tagType)) || opponent.hasAbilityWithAttr(MagicBounceAbAttr)); if (isBounced) { this.scene.queueMessage(getPokemonMessage(opponent, '\nbounced the move back!')); const tempTargets = targets;