diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 9384a0f9d..1405dd258 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1774,6 +1774,10 @@ .4byte \ptr .endm + .macro setbeakblast battler:req + various \battler, VARIOUS_SET_BEAK_BLAST + .endm + @ helpful macros .macro setstatchanger stat:req, stages:req, down:req setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7 diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 65bac00d7..ee401010a 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -822,6 +822,7 @@ gBattleAnims_General:: .4byte General_SlideOffScreen @ B_ANIM_SLIDE_OFFSCREEN .4byte General_RestoreBg @ B_ANIM_RESTORE_BG .4byte General_TotemFlare @ B_ANIM_TOTEM_FLARE + .4byte General_BeakBlastSetUp @ B_ANIM_BEAK_BLAST_SETUP .align 2 gBattleAnims_Special:: @@ -11673,7 +11674,7 @@ Move_INSTRUCT:: blendoff end -Move_BEAK_BLAST:: +General_BeakBlastSetUp: loadspritegfx ANIM_TAG_SMALL_EMBER @Fire playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER delay 0x3 @@ -11681,7 +11682,7 @@ Move_BEAK_BLAST:: launchtemplate gFireSpiralOutwardSpriteTemplate 0x3 0x4 0x0 0x0 0x38 0x0 waitforvisualfinish end -BeakBlastUnleash: +Move_BEAK_BLAST:: loadspritegfx ANIM_TAG_IMPACT launchtask AnimTask_BlendBattleAnimPal 0xA 0x5 ANIM_PAL_ATK 0x2 0x0 0x9 0x1F waitforvisualfinish diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index e1e7fbf9d..02da8a3bb 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -374,7 +374,37 @@ gBattleScriptsForMoveEffects:: @ 82D86A8 .4byte BattleScript_EffectMeteorBeam .4byte BattleScript_EffectRisingVoltage .4byte BattleScript_EffectCorrosiveGas + .4byte BattleScript_EffectBeakBlast +BattleScript_EffectBeakBlast:: + attackcanceler + jumpifnodamage BattleScript_HitFromAccCheck + ppreduce + printstring STRINGID_PKMNLOSTFOCUS + waitmessage 0x40 + goto BattleScript_MoveEnd + +BattleScript_BeakBlastSetUp:: + setbeakblast BS_ATTACKER + printstring STRINGID_EMPTYSTRING3 + waitmessage 0x1 + playanimation BS_ATTACKER, B_ANIM_BEAK_BLAST_SETUP, NULL + printstring STRINGID_HEATUPBEAK + waitmessage 0x40 + end2 + +BattleScript_BeakBlastBurn:: + jumpifstatus BS_TARGET, STATUS1_BURN, BattleScript_AlreadyBurned + jumpiftype BS_TARGET, TYPE_FIRE, BattleScript_NotAffected + jumpifability BS_TARGET, ABILITY_WATER_VEIL, BattleScript_WaterVeilPrevents + jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects + jumpifflowerveil BattleScript_FlowerVeilProtects + jumpifleafguard BattleScript_LeafGuardProtects + jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_BeakBlastBurnReturn + setmoveeffect MOVE_EFFECT_BURN | MOVE_EFFECT_AFFECTS_USER + seteffectprimary +BattleScript_BeakBlastBurnReturn: + return BattleScript_EffectCorrosiveGas:: attackcanceler accuracycheck BattleScript_PrintMoveMissed, NO_ACC_CALC_CHECK_LOCK_ON diff --git a/include/battle.h b/include/battle.h index 7212c4084..a86c6d34e 100644 --- a/include/battle.h +++ b/include/battle.h @@ -144,6 +144,7 @@ struct ProtectStruct u32 usedThroatChopPreventedMove:1; u32 micle:1; u32 custap:1; // also quick claw + u32 beakBlastCharge:1; u32 physicalDmg; u32 specialDmg; u8 physicalBattlerId; diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 7ae55d01f..ffb824f0b 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -370,5 +370,7 @@ extern const u8 BattleScript_NotAffectedAbilityPopUp[]; extern const u8 BattleScript_BattlerShookOffTaunt[]; extern const u8 BattleScript_BattlerGotOverItsInfatuation[]; extern const u8 BattleScript_MeltedItem[]; +extern const u8 BattleScript_BeakBlastSetUp[]; +extern const u8 BattleScript_BeakBlastBurn[]; #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index c04bc14f7..cfccef926 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -523,6 +523,7 @@ #define B_ANIM_SLIDE_OFFSCREEN 26 // for Emergency Exit #define B_ANIM_RESTORE_BG 27 // for Terrain Endings #define B_ANIM_TOTEM_FLARE 28 // Totem boosts aura flare +#define B_ANIM_BEAK_BLAST_SETUP 29 // special animations table (gBattleAnims_Special) #define B_ANIM_LVL_UP 0 diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index d88b34a53..1ccba4d43 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -358,7 +358,8 @@ #define EFFECT_METEOR_BEAM 352 #define EFFECT_RISING_VOLTAGE 353 #define EFFECT_CORROSIVE_GAS 354 +#define EFFECT_BEAK_BLAST 355 -#define NUM_BATTLE_MOVE_EFFECTS 355 +#define NUM_BATTLE_MOVE_EFFECTS 356 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index f35dbe2e3..ea96e6b4d 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -174,6 +174,7 @@ #define VARIOUS_TOTEM_BOOST 103 #define VARIOUS_TRY_ACTIVATE_GRIM_NEIGH 104 #define VARIOUS_TRY_SET_CORROSIVE_GAS 105 +#define VARIOUS_SET_BEAK_BLAST 106 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 72f178de7..698b7e595 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -573,8 +573,9 @@ #define STRINGID_PKMNINSNAPTRAP 569 #define STRINGID_METEORBEAMCHARGING 570 #define STRINGID_ITEMMELTED 571 +#define STRINGID_HEATUPBEAK 572 -#define BATTLESTRINGS_COUNT 572 +#define BATTLESTRINGS_COUNT 573 // The below IDs are all indexes into battle message tables, // used to determine which of a set of messages to print. diff --git a/src/battle_main.c b/src/battle_main.c index 9cf56abf7..f053c13ef 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -4598,13 +4598,19 @@ static void CheckFocusPunch_ClearVarsBeforeTurnStarts(void) { gActiveBattler = gBattlerAttacker = gBattleStruct->focusPunchBattlerId; gBattleStruct->focusPunchBattlerId++; - if (gChosenMoveByBattler[gActiveBattler] == MOVE_FOCUS_PUNCH - && !(gBattleMons[gActiveBattler].status1 & STATUS1_SLEEP) + if (!(gBattleMons[gActiveBattler].status1 & STATUS1_SLEEP) && !(gDisableStructs[gBattlerAttacker].truantCounter) && !(gProtectStructs[gActiveBattler].noValidMoves)) { - BattleScriptExecute(BattleScript_FocusPunchSetUp); - return; + switch(gChosenMoveByBattler[gActiveBattler]) + { + case MOVE_FOCUS_PUNCH: + BattleScriptExecute(BattleScript_FocusPunchSetUp); + return; + case MOVE_BEAK_BLAST: + BattleScriptExecute(BattleScript_BeakBlastSetUp); + return; + } } } } diff --git a/src/battle_message.c b/src/battle_message.c index 4d1ae2ddb..d2ae86e13 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -699,9 +699,11 @@ static const u8 sText_PkmnShookOffTheTaunt[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX static const u8 sText_PkmnGotOverItsInfatuation[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} got over\nits infatuation!"); static const u8 sText_MeteorBeamCharging[] = _("{B_ATK_NAME_WITH_PREFIX} is overflowing\nwith space energy!"); static const u8 sText_PkmnItemMelted[] = _("{B_ATK_NAME_WITH_PREFIX} corroded\n{B_DEF_NAME_WITH_PREFIX}'s {B_LAST_ITEM}!"); +static const u8 sText_HeatingUpBeak[] = _("{B_ATK_NAME_WITH_PREFIX} started\nheating up its beak!"); const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = { + [STRINGID_HEATUPBEAK - 12] = sText_HeatingUpBeak, [STRINGID_ITEMMELTED - 12] = sText_PkmnItemMelted, [STRINGID_METEORBEAMCHARGING - 12] = sText_MeteorBeamCharging, [STRINGID_PKMNINSNAPTRAP - 12] = sText_PkmnInSnapTrap, diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 9915654c5..0565f06d1 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -4807,6 +4807,12 @@ static void Cmd_moveend(void) gBattlescriptCurrInstr = BattleScript_BanefulBunkerEffect; effect = 1; } + else if (gProtectStructs[gBattlerTarget].beakBlastCharge) + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_BeakBlastBurn; + effect = 1; + } } gBattleScripting.moveendState++; break; @@ -7867,6 +7873,7 @@ static void Cmd_various(void) case MOVE_MIRROR_COAT: case MOVE_METAL_BURST: case MOVE_ME_FIRST: + case MOVE_BEAK_BLAST: gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); break; default: @@ -8457,6 +8464,9 @@ static void Cmd_various(void) gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); } return; + case VARIOUS_SET_BEAK_BLAST: + gProtectStructs[gActiveBattler].beakBlastCharge = 1; + break; } gBattlescriptCurrInstr += 3; diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 20449e446..2455b90cd 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -10127,7 +10127,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_BEAK_BLAST] = { - .effect = EFFECT_PLACEHOLDER, + .effect = EFFECT_BEAK_BLAST, .power = 100, .type = TYPE_FLYING, .accuracy = 100,