From 639b066c7bc24100cd93f844f825a8066b978bc9 Mon Sep 17 00:00:00 2001 From: jatinkohli Date: Fri, 17 May 2024 22:46:35 -0700 Subject: [PATCH] Implement beak blast burning on contact --- src/data/battler-tags.ts | 20 ++++++++++++++++++++ src/data/enums/battler-tag-type.ts | 3 ++- src/data/move.ts | 2 +- src/phases.ts | 4 +++- 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index 4c3f09cab30..71067aceaf7 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -872,6 +872,24 @@ export class ContactPoisonProtectedTag extends ProtectedTag { } } +export class BeakBlastTag extends BattlerTag { + constructor() { + super(BattlerTagType.BEAK_BLAST, BattlerTagLapseType.CUSTOM, 0, Moves.BEAK_BLAST); + } + + lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean { + const ret = super.lapse(pokemon, lapseType); + + 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 ContactBurnProtectedTag extends ProtectedTag { constructor(sourceMove: Moves) { super(sourceMove, BattlerTagType.BURNING_BULWARK); @@ -1358,6 +1376,8 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: integer, sourc return new ContactStatChangeProtectedTag(sourceMove, tagType, BattleStat.SPD, -1); case BattlerTagType.BANEFUL_BUNKER: return new ContactPoisonProtectedTag(sourceMove); + case BattlerTagType.BEAK_BLAST: + return new BeakBlastTag(); case BattlerTagType.BURNING_BULWARK: return new ContactBurnProtectedTag(sourceMove); case BattlerTagType.ENDURING: diff --git a/src/data/enums/battler-tag-type.ts b/src/data/enums/battler-tag-type.ts index 9411d70a670..80164994bd9 100644 --- a/src/data/enums/battler-tag-type.ts +++ b/src/data/enums/battler-tag-type.ts @@ -56,5 +56,6 @@ export enum BattlerTagType { CHARGED = "CHARGED", GROUNDED = "GROUNDED", MAGNET_RISEN = "MAGNET_RISEN", - MINIMIZED = "MINIMIZED" + MINIMIZED = "MINIMIZED", + BEAK_BLAST = "BEAK_BLAST" } diff --git a/src/data/move.ts b/src/data/move.ts index 6849a0fe7ce..8211146a4c4 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -6338,7 +6338,7 @@ export function initMoves() { new StatusMove(Moves.INSTRUCT, Type.PSYCHIC, -1, 15, -1, 0, 7) .unimplemented(), new AttackMove(Moves.BEAK_BLAST, Type.FLYING, MoveCategory.PHYSICAL, 100, 100, 15, -1, 5, 7) - .attr(ChargeAttr, ChargeAnim.BEAK_BLAST_CHARGING, "started\nheating up its beak!", undefined, false, true, -3) + .attr(ChargeAttr, ChargeAnim.BEAK_BLAST_CHARGING, "started\nheating up its beak!", BattlerTagType.BEAK_BLAST, true, true, -3) .ballBombMove() .makesContact(false) .partial(), diff --git a/src/phases.ts b/src/phases.ts index f70fe9e857a..55c92550dcd 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 { BattlerTagLapseType, EncoreTag, HideSpriteTag as HiddenTag, ProtectedTag, TrappedTag } from "./data/battler-tags"; +import { BattlerTagLapseType, BeakBlastTag, EncoreTag, HideSpriteTag as HiddenTag, ProtectedTag, TrappedTag } from "./data/battler-tags"; import { BattlerTagType } from "./data/enums/battler-tag-type"; import { getPokemonMessage, getPokemonPrefix } from "./messages"; import { Starter } from "./ui/starter-select-ui-handler"; @@ -2524,6 +2524,8 @@ export class MoveEffectPhase extends PokemonPhase { const hitResult = !isProtected ? target.apply(user, this.move) : HitResult.NO_EFFECT; + target.findTags(t => t instanceof BeakBlastTag).find(t => target.lapseTag(t.tagType)) + this.scene.triggerPokemonFormChange(user, SpeciesFormChangePostMoveTrigger); applyAttrs.push(new Promise(resolve => {