From 1905ecc828d956ad55d345c12461863e776f16e6 Mon Sep 17 00:00:00 2001 From: Madmadness65 Date: Wed, 13 Mar 2024 16:37:36 -0500 Subject: [PATCH] Implement Burning Bulwark --- src/data/battler-tags.ts | 22 ++++++++++++++++++++++ src/data/enums/battler-tag-type.ts | 1 + src/data/move.ts | 4 ++-- src/phases.ts | 2 -- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index a94568b6e..0ca94272b 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -608,6 +608,26 @@ export class ContactPoisonProtectedTag extends ProtectedTag { } } +export class ContactBurnProtectedTag extends ProtectedTag { + constructor(sourceMove: Moves) { + super(sourceMove, BattlerTagType.BURNING_BULWARK); + } + + lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean { + const ret = super.lapse(pokemon, lapseType); + + if (lapseType === BattlerTagLapseType.CUSTOM) { + const effectPhase = pokemon.scene.getCurrentPhase(); + if (effectPhase instanceof MoveEffectPhase && effectPhase.move.getMove().hasFlag(MoveFlags.MAKES_CONTACT)) { + const attacker = effectPhase.getPokemon(); + attacker.trySetStatus(StatusEffect.BURN, true); + } + } + + return ret; + } +} + export class EnduringTag extends BattlerTag { constructor(sourceMove: Moves) { super(BattlerTagType.ENDURING, BattlerTagLapseType.CUSTOM, 0, sourceMove); @@ -810,6 +830,8 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: integer, sourc return new ProtectedTag(sourceMove); case BattlerTagType.BANEFUL_BUNKER: return new ContactPoisonProtectedTag(sourceMove); + case BattlerTagType.BURNING_BULWARK: + return new ContactBurnProtectedTag(sourceMove); case BattlerTagType.ENDURING: return new EnduringTag(sourceMove); case BattlerTagType.PERISH_SONG: diff --git a/src/data/enums/battler-tag-type.ts b/src/data/enums/battler-tag-type.ts index b65e011b1..20f73e63a 100644 --- a/src/data/enums/battler-tag-type.ts +++ b/src/data/enums/battler-tag-type.ts @@ -23,6 +23,7 @@ export enum BattlerTagType { THUNDER_CAGE = "THUNDER_CAGE", PROTECTED = "PROTECTED", BANEFUL_BUNKER = "BANEFUL_BUNKER", + BURNING_BULWARK = "BURNING_BULWARK", ENDURING = "ENDURING", PERISH_SONG = "PERISH_SONG", TRUANT = "TRUANT", diff --git a/src/data/move.ts b/src/data/move.ts index dcb1894ee..b0a311c89 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -4690,8 +4690,8 @@ export function initMoves() { .ignoresVirtual(), new AttackMove(Moves.TERA_STARSTORM, "Tera Starstorm (P)", Type.NORMAL, MoveCategory.SPECIAL, 120, 100, 5, -1, "With the power of its crystals, the user bombards and eliminates the target. When used by Terapagos in its Stellar Form, this move damages all opposing Pokémon.", -1, 0, 9), new AttackMove(Moves.FICKLE_BEAM, "Fickle Beam (P)", Type.DRAGON, MoveCategory.SPECIAL, 80, 100, 5, -1, "The user shoots a beam of light to inflict damage. Sometimes all the user's heads shoot beams in unison, doubling the move's power.", -1, 0, 9), - new StatusMove(Moves.BURNING_BULWARK, "Burning Bulwark (P)", Type.FIRE, -1, 10, -1, "The user's intensely hot fur protects it from attacks and also burns any attacker that makes direct contact with it.", 100, 4, 9) - .attr(ProtectAttr), + new StatusMove(Moves.BURNING_BULWARK, "Burning Bulwark", Type.FIRE, -1, 10, -1, "The user's intensely hot fur protects it from attacks and also burns any attacker that makes direct contact with it.", 100, 4, 9) + .attr(ProtectAttr, BattlerTagType.BURNING_BULWARK), new AttackMove(Moves.THUNDERCLAP, "Thunderclap (P)", Type.ELECTRIC, MoveCategory.SPECIAL, 70, 100, 5, -1, "This move enables the user to attack first with a jolt of electricity. This move fails if the target is not readying an attack.", -1, 1, 9), new AttackMove(Moves.MIGHTY_CLEAVE, "Mighty Cleave", Type.ROCK, MoveCategory.PHYSICAL, 95, 100, 5, -1, "The user wields the light that has accumulated atop its head to cleave the target. This move hits even if the target protects itself.", -1, 0, 9) .ignoresProtect(), diff --git a/src/phases.ts b/src/phases.ts index b30d98cf1..f6256bede 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -2090,8 +2090,6 @@ export class MoveEffectPhase extends PokemonPhase { continue; } - console.log(target.findTags(t => t instanceof ProtectedTag), 'TAGS') - const isProtected = !this.move.getMove().hasFlag(MoveFlags.IGNORE_PROTECT) && target.findTags(t => t instanceof ProtectedTag).find(t => target.lapseTag(t.tagType)); moveHistoryEntry.result = MoveResult.SUCCESS;