From d2eb5f0e6191645a677ae2c8ebcdde3937237c68 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Mon, 22 Nov 2021 14:46:47 +1300 Subject: [PATCH] Remove shell trap effect code Left strings and animations as those were fine, but code was non-functional and fixing it was not trivial. --- asm/macros/battle_script.inc | 14 -------- data/battle_scripts_1.s | 41 ---------------------- include/battle.h | 2 -- include/battle_scripts.h | 3 -- include/constants/battle_move_effects.h | 1 - include/constants/battle_script_commands.h | 3 -- src/battle_main.c | 3 -- src/battle_script_commands.c | 35 +----------------- src/data/battle_moves.h | 2 +- 9 files changed, 2 insertions(+), 102 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 500ec0919..a65ccaf44 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1933,20 +1933,6 @@ various BS_ATTACKER, VARIOUS_SWAP_SIDE_STATUSES .endm - .macro setshelltrap battler:req - various \battler, VARIOUS_SET_SHELL_TRAP - .endm - - .macro clearshelltrap battler:req - various \battler, VARIOUS_CLEAR_SHELL_TRAP - .endm - - .macro checkshelltrap battler:req, ptr1:req, ptr2:req - various \battler, VARIOUS_CHECK_SHELL_TRAP - .4byte \ptr1 - .4byte \ptr2 - .endm - @ helpful macros .macro setstatchanger stat:req, stages:req, down:req setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7 diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 99e3ad462..eeeba7cf7 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -409,47 +409,6 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectHit @ EFFECT_RISING_VOLTAGE .4byte BattleScript_EffectHit @ EFFECT_BEAK_BLAST .4byte BattleScript_EffectCourtChange @ EFFECT_COURT_CHANGE - .4byte BattleScript_EffectShellTrap @ EFFECT_SHELL_TRAP - -BattleScript_EffectShellTrap:: - checkshelltrap BS_ATTACKER, BattleScript_ShellTrapExplode, BattleScript_MoveEnd - clearshelltrap BS_ATTACKER - attackcanceler - attackstring - goto BattleScript_ButItFailed - -BattleScript_ShellTrapSetUp:: - setshelltrap BS_ATTACKER - printstring STRINGID_EMPTYSTRING3 - waitmessage 0x1 - playanimation BS_ATTACKER B_ANIM_SHELL_TRAP_SETUP, NULL - printstring STRINGID_PREPARESHELLTRAP - waitmessage 0x40 - end2 - -BattleScript_ShellTrapExplode:: - clearshelltrap BS_ATTACKER - attackcanceler - attackstring - ppreduce - critcalc - damagecalc - adjustdamage - attackanimation - waitanimation - effectivenesssound - hitanimation BS_TARGET - waitstate - healthbarupdate BS_TARGET - datahpupdate BS_TARGET - critmessage - waitmessage 0x40 - resultmessage - waitmessage 0x40 - seteffectwithchance - tryfaintmon BS_TARGET, FALSE, NULL - moveendall - end BattleScript_EffectCourtChange:: attackcanceler diff --git a/include/battle.h b/include/battle.h index ad7924017..69161ba6f 100644 --- a/include/battle.h +++ b/include/battle.h @@ -158,8 +158,6 @@ struct ProtectStruct u16 pranksterElevated:1; u16 quickDraw:1; u16 beakBlastCharge:1; - u16 shellTrapSet:1; - u16 shellTrapTriggered:1; u32 physicalDmg; u32 specialDmg; u8 physicalBattlerId; diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 7dfc1a6da..ec1dbb23c 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -418,9 +418,6 @@ extern const u8 BattleScript_NeutralizingGasExits[]; extern const u8 BattleScript_MeltedItem[]; extern const u8 BattleScript_BeakBlastSetUp[]; extern const u8 BattleScript_BeakBlastBurn[]; -extern const u8 BattleScript_ShellTrapSetUp[]; -extern const u8 BattleScript_ShellTrapExplode[]; -extern const u8 BattleScript_EffectShellTrap[]; extern const u8 BattleScript_DefDownSpeedUp[]; #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index 0df43c060..c6afed12c 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -392,7 +392,6 @@ #define EFFECT_RISING_VOLTAGE 386 #define EFFECT_BEAK_BLAST 387 #define EFFECT_COURT_CHANGE 388 -#define EFFECT_SHELL_TRAP 389 #define NUM_BATTLE_MOVE_EFFECTS 390 diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 977a69dbf..897bf35fb 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -211,9 +211,6 @@ #define VARIOUS_TRY_SET_CORROSIVE_GAS 138 #define VARIOUS_SET_BEAK_BLAST 139 #define VARIOUS_SWAP_SIDE_STATUSES 140 -#define VARIOUS_SET_SHELL_TRAP 141 -#define VARIOUS_CLEAR_SHELL_TRAP 142 -#define VARIOUS_CHECK_SHELL_TRAP 143 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 diff --git a/src/battle_main.c b/src/battle_main.c index 25ac66be5..1c2d37dbc 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -4714,9 +4714,6 @@ static void CheckFocusPunch_ClearVarsBeforeTurnStarts(void) case MOVE_BEAK_BLAST: BattleScriptExecute(BattleScript_BeakBlastSetUp); return; - case MOVE_SHELL_TRAP: - BattleScriptExecute(BattleScript_ShellTrapSetUp); - return; } } } diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 6d65bbd62..a58aeed64 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1543,8 +1543,7 @@ static void Cmd_attackcanceler(void) gBattleCommunication[MISS_TYPE] = B_MSG_PROTECTED; gBattlescriptCurrInstr++; } - else if ((gProtectStructs[gBattlerTarget].beakBlastCharge || gProtectStructs[gBattlerTarget].shellTrapSet) - && IsMoveMakingContact(gCurrentMove, gBattlerAttacker)) + else if (gProtectStructs[gBattlerTarget].beakBlastCharge && IsMoveMakingContact(gCurrentMove, gBattlerAttacker)) { gProtectStructs[gBattlerAttacker].touchedProtectLike = TRUE; gBattlescriptCurrInstr++; @@ -4994,21 +4993,6 @@ static void Cmd_moveend(void) gBattlescriptCurrInstr = BattleScript_BeakBlastBurn; effect = 1; } - else if (gProtectStructs[gBattlerTarget].shellTrapSet - && !TestSheerForceFlag(gBattlerAttacker, gCurrentMove) - && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) - { - u32 temp; - gProtectStructs[gBattlerTarget].shellTrapTriggered = TRUE; - gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE; - // Swap battlers so target attacks attacker with Shell Trap - SWAP(gBattlerAttacker, gBattlerTarget, temp); - // Set current move to Shell Trap - gCurrentMove = MOVE_SHELL_TRAP; - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_EffectShellTrap; - effect = TRUE; - } } gBattleScripting.moveendState++; break; @@ -9379,23 +9363,6 @@ static void Cmd_various(void) case VARIOUS_SET_BEAK_BLAST: gProtectStructs[gBattlerAttacker].beakBlastCharge = TRUE; break; - case VARIOUS_SET_SHELL_TRAP: - gProtectStructs[gBattlerAttacker].shellTrapSet = TRUE; - break; - case VARIOUS_CLEAR_SHELL_TRAP: - gProtectStructs[gBattlerAttacker].shellTrapSet = FALSE; - break; - case VARIOUS_CHECK_SHELL_TRAP: - // Attack with Shell Trap - if (gProtectStructs[gBattlerAttacker].shellTrapSet == TRUE && gProtectStructs[gBattlerAttacker].shellTrapTriggered == TRUE) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); - // Attacked with Shell Trap, go to move end - else if (gProtectStructs[gBattlerAttacker].shellTrapSet == FALSE && gProtectStructs[gBattlerAttacker].shellTrapTriggered == TRUE) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 7); - // Shell Trap failed - else - gBattlescriptCurrInstr += 11; - break; case VARIOUS_SWAP_SIDE_STATUSES: { CourtChangeSwapSideStatuses(); diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 57b9bce4f..26c77a8e3 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -10212,7 +10212,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_SHELL_TRAP] = { - .effect = EFFECT_SHELL_TRAP, + .effect = EFFECT_PLACEHOLDER, // EFFECT_SHELL_TRAP, .power = 150, .type = TYPE_FIRE, .accuracy = 100,