diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 5c6a33f073f6..8a8f3b4dd690 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1744,6 +1744,19 @@ callnative BS_WaitFanfare .endm + .macro setbeakblast + callnative BS_SetBeakBlast + .endm + + .macro cantarshotwork failInstr:req + callnative BS_CanTarShotWork + .4byte \failInstr + .endm + + .macro removeterrain + callnative BS_RemoveTerrain + .endm + @ various command changed to more readable macros .macro cancelmultiturnmoves battler:req various \battler, VARIOUS_CANCEL_MULTI_TURN_MOVES @@ -2218,10 +2231,6 @@ .4byte \failInstr .endm - .macro removeterrain - various BS_ATTACKER, VARIOUS_REMOVE_TERRAIN - .endm - .macro trytoclearprimalweather various BS_ATTACKER, VARIOUS_TRY_TO_CLEAR_PRIMAL_WEATHER .endm @@ -2270,11 +2279,6 @@ .4byte \failInstr .endm - .macro cantarshotwork battler:req, failInstr:req - various \battler, VARIOUS_CAN_TAR_SHOT_WORK - .4byte \failInstr - .endm - .macro checkpoltergeist battler:req, failInstr:req various \battler, VARIOUS_CHECK_POLTERGEIST .4byte \failInstr @@ -2316,10 +2320,6 @@ various \battler, VARIOUS_BATTLER_ITEM_TO_LAST_USED_ITEM .endm - .macro setbeakblast battler:req - various \battler, VARIOUS_SET_BEAK_BLAST - .endm - .macro swapsidestatuses various BS_ATTACKER, VARIOUS_SWAP_SIDE_STATUSES .endm diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 52c21dc68a76..198ace6ee529 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -670,7 +670,7 @@ BattleScript_EffectCourtChange:: goto BattleScript_MoveEnd BattleScript_BeakBlastSetUp:: - setbeakblast BS_ATTACKER + setbeakblast flushtextbox playanimation BS_ATTACKER, B_ANIM_BEAK_BLAST_SETUP, NULL printstring STRINGID_HEATUPBEAK @@ -891,7 +891,7 @@ BattleScript_EffectTarShot:: attackcanceler jumpifsubstituteblocks BattleScript_FailedFromAtkString accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE - cantarshotwork BS_TARGET, BattleScript_FailedFromAtkString + cantarshotwork BattleScript_FailedFromAtkString attackstring ppreduce setstatchanger STAT_SPEED, 1, TRUE diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 29878dcdd265..869b1eb3a603 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -192,39 +192,35 @@ #define VARIOUS_EERIE_SPELL_PP_REDUCE 100 #define VARIOUS_JUMP_IF_TEAM_HEALTHY 101 #define VARIOUS_TRY_HEAL_QUARTER_HP 102 -#define VARIOUS_REMOVE_TERRAIN 103 -#define VARIOUS_JUMP_IF_PRANKSTER_BLOCKED 104 -#define VARIOUS_TRY_TO_CLEAR_PRIMAL_WEATHER 105 -#define VARIOUS_GET_ROTOTILLER_TARGETS 106 -#define VARIOUS_JUMP_IF_NOT_ROTOTILLER_AFFECTED 107 -#define VARIOUS_TRY_ACTIVATE_BATTLE_BOND 108 -#define VARIOUS_CONSUME_BERRY 109 -#define VARIOUS_JUMP_IF_CANT_REVERT_TO_PRIMAL 110 -#define VARIOUS_JUMP_IF_SPECIES 111 -#define VARIOUS_UPDATE_ABILITY_POPUP 112 -#define VARIOUS_JUMP_IF_WEATHER_AFFECTED 113 -#define VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED 114 -#define VARIOUS_SET_ATTACKER_STICKY_WEB_USER 115 -#define VARIOUS_TRY_NO_RETREAT 116 -#define VARIOUS_TRY_TAR_SHOT 117 -#define VARIOUS_CAN_TAR_SHOT_WORK 118 -#define VARIOUS_CHECK_POLTERGEIST 119 -#define VARIOUS_CUT_1_3_HP_RAISE_STATS 120 -#define VARIOUS_TRY_END_NEUTRALIZING_GAS 121 -#define VARIOUS_JUMP_IF_UNDER_200 122 -#define VARIOUS_SET_SKY_DROP 123 -#define VARIOUS_CLEAR_SKY_DROP 124 -#define VARIOUS_SKY_DROP_YAWN 125 -#define VARIOUS_CURE_CERTAIN_STATUSES 126 -#define VARIOUS_TRY_RESET_NEGATIVE_STAT_STAGES 127 -#define VARIOUS_JUMP_IF_LAST_USED_ITEM_BERRY 128 -#define VARIOUS_JUMP_IF_LAST_USED_ITEM_HOLD_EFFECT 129 -#define VARIOUS_SAVE_BATTLER_ITEM 130 -#define VARIOUS_RESTORE_BATTLER_ITEM 131 -#define VARIOUS_BATTLER_ITEM_TO_LAST_USED_ITEM 132 -#define VARIOUS_SET_BEAK_BLAST 133 -#define VARIOUS_SWAP_SIDE_STATUSES 134 -#define VARIOUS_SWAP_STATS 135 +#define VARIOUS_JUMP_IF_PRANKSTER_BLOCKED 103 +#define VARIOUS_TRY_TO_CLEAR_PRIMAL_WEATHER 104 +#define VARIOUS_GET_ROTOTILLER_TARGETS 105 +#define VARIOUS_JUMP_IF_NOT_ROTOTILLER_AFFECTED 106 +#define VARIOUS_TRY_ACTIVATE_BATTLE_BOND 107 +#define VARIOUS_CONSUME_BERRY 108 +#define VARIOUS_JUMP_IF_CANT_REVERT_TO_PRIMAL 109 +#define VARIOUS_JUMP_IF_SPECIES 110 +#define VARIOUS_UPDATE_ABILITY_POPUP 111 +#define VARIOUS_JUMP_IF_WEATHER_AFFECTED 112 +#define VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED 113 +#define VARIOUS_SET_ATTACKER_STICKY_WEB_USER 114 +#define VARIOUS_TRY_NO_RETREAT 115 +#define VARIOUS_CHECK_POLTERGEIST 116 +#define VARIOUS_CUT_1_3_HP_RAISE_STATS 117 +#define VARIOUS_TRY_END_NEUTRALIZING_GAS 118 +#define VARIOUS_JUMP_IF_UNDER_200 119 +#define VARIOUS_SET_SKY_DROP 120 +#define VARIOUS_CLEAR_SKY_DROP 121 +#define VARIOUS_SKY_DROP_YAWN 122 +#define VARIOUS_CURE_CERTAIN_STATUSES 123 +#define VARIOUS_TRY_RESET_NEGATIVE_STAT_STAGES 124 +#define VARIOUS_JUMP_IF_LAST_USED_ITEM_BERRY 125 +#define VARIOUS_JUMP_IF_LAST_USED_ITEM_HOLD_EFFECT 126 +#define VARIOUS_SAVE_BATTLER_ITEM 127 +#define VARIOUS_RESTORE_BATTLER_ITEM 128 +#define VARIOUS_BATTLER_ITEM_TO_LAST_USED_ITEM 129 +#define VARIOUS_SWAP_SIDE_STATUSES 130 +#define VARIOUS_SWAP_STATS 131 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index ed854af37e1d..93f15db76fdf 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -10524,12 +10524,6 @@ static void Cmd_various(void) gBattlescriptCurrInstr = cmd->nextInstr; // can heal return; } - case VARIOUS_REMOVE_TERRAIN: - { - VARIOUS_ARGS(); - RemoveAllTerrains(); - break; - } case VARIOUS_JUMP_IF_UNDER_200: { VARIOUS_ARGS(const u8 *jumpInstr); @@ -10847,17 +10841,6 @@ static void Cmd_various(void) } return; } - case VARIOUS_CAN_TAR_SHOT_WORK: - { - VARIOUS_ARGS(const u8 *failInstr); - // Tar Shot will fail if it's already been used on the target and its speed can't be lowered further - if (!gDisableStructs[battler].tarShot - && CompareStat(battler, STAT_SPEED, MAX_STAT_STAGE, CMP_LESS_THAN)) - gBattlescriptCurrInstr = cmd->nextInstr; - else - gBattlescriptCurrInstr = cmd->failInstr; - return; - } case VARIOUS_CURE_CERTAIN_STATUSES: { VARIOUS_ARGS(); @@ -10950,12 +10933,6 @@ static void Cmd_various(void) gBattleMons[battler].item = gLastUsedItem; break; } - case VARIOUS_SET_BEAK_BLAST: - { - VARIOUS_ARGS(); - gProtectStructs[battler].beakBlastCharge = TRUE; - break; - } case VARIOUS_SWAP_SIDE_STATUSES: { VARIOUS_ARGS(); @@ -17311,6 +17288,17 @@ void BS_TryTarShot(void) } } +void BS_CanTarShotWork(void) +{ + NATIVE_ARGS(const u8 *failInstr); + // Tar Shot will fail if it's already been used on the target and its speed can't be lowered further + if (!gDisableStructs[gBattlerTarget].tarShot + && CompareStat(gBattlerTarget, STAT_SPEED, MAX_STAT_STAGE, CMP_LESS_THAN)) + gBattlescriptCurrInstr = cmd->nextInstr; + else + gBattlescriptCurrInstr = cmd->failInstr; +} + void BS_JumpIfBlockedBySoundproof(void) { NATIVE_ARGS(u8 battler, const u8 *jumpInstr); @@ -17547,3 +17535,17 @@ void BS_WaitFanfare(void) gBattlescriptCurrInstr = cmd->nextInstr; } + +void BS_SetBeakBlast(void) +{ + NATIVE_ARGS(); + gProtectStructs[gBattlerAttacker].beakBlastCharge = TRUE; + gBattlescriptCurrInstr = cmd->nextInstr; +} + +void BS_RemoveTerrain(void) +{ + NATIVE_ARGS(); + RemoveAllTerrains(); + gBattlescriptCurrInstr = cmd->nextInstr; +}