From 50d0cd52e8992869adb1cd5be680d9a90825e9d2 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Mon, 22 Nov 2021 15:13:54 +1300 Subject: [PATCH] Clean up Corrosive Gas Remove code and unused move effect. --- include/battle.h | 1 - include/battle_scripts.h | 1 - include/constants/battle.h | 3 +-- src/battle_script_commands.c | 14 +++----------- 4 files changed, 4 insertions(+), 15 deletions(-) diff --git a/include/battle.h b/include/battle.h index 69161ba6fa..9192d4ed33 100644 --- a/include/battle.h +++ b/include/battle.h @@ -245,7 +245,6 @@ struct WishFutureKnock u8 wishMonId[MAX_BATTLERS_COUNT]; u8 weatherDuration; u8 knockedOffMons[2]; // Each battler is represented by a bit. The array entry is dependent on the battler's side. - u8 meltedItemMons[2]; // Same as above }; struct AI_SavedBattleMon diff --git a/include/battle_scripts.h b/include/battle_scripts.h index ec1dbb23c4..2f98ef7a10 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -415,7 +415,6 @@ extern const u8 BattleScript_AttackerFormChangeMoveEffect[]; extern const u8 BattleScript_BothCanNoLongerEscape[]; extern const u8 BattleScript_OctolockEndTurn[]; extern const u8 BattleScript_NeutralizingGasExits[]; -extern const u8 BattleScript_MeltedItem[]; extern const u8 BattleScript_BeakBlastSetUp[]; extern const u8 BattleScript_BeakBlastBurn[]; extern const u8 BattleScript_DefDownSpeedUp[]; diff --git a/include/constants/battle.h b/include/constants/battle.h index 46b6494b28..f615be05f6 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -360,8 +360,7 @@ #define MOVE_EFFECT_RELIC_SONG 0x47 #define MOVE_EFFECT_TRAP_BOTH 0x48 #define MOVE_EFFECT_SCALE_SHOT 0x49 -#define MOVE_EFFECT_MELT_ITEM 0x4A -#define NUM_MOVE_EFFECTS 0x4B +#define NUM_MOVE_EFFECTS 0x4A #define MOVE_EFFECT_AFFECTS_USER 0x4000 #define MOVE_EFFECT_CERTAIN 0x8000 diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index a58aeed646..8e2c59d8a4 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -3160,8 +3160,7 @@ void SetMoveEffect(bool32 primary, u32 certain) | BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK | BATTLE_TYPE_SECRET_BASE)) - && (gWishFutureKnock.knockedOffMons[side] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]] - || gWishFutureKnock.meltedItemMons[side] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]])) + && (gWishFutureKnock.knockedOffMons[side] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]])) { gBattlescriptCurrInstr++; } @@ -5583,11 +5582,6 @@ static void Cmd_switchindataupdate(void) { gBattleMons[gActiveBattler].item = 0; } - // check melted items - if (gWishFutureKnock.meltedItemMons[i] & gBitTable[gBattlerPartyIndexes[gActiveBattler]]) - { - gBattleMons[gActiveBattler].item = 0; - } if (gBattleMoves[gCurrentMove].effect == EFFECT_BATON_PASS) { @@ -12305,16 +12299,14 @@ static void Cmd_tryswapitems(void) // trick u8 sideAttacker = GetBattlerSide(gBattlerAttacker); u8 sideTarget = GetBattlerSide(gBattlerTarget); - // you can't swap items if they were knocked off or melted in regular battles + // You can't swap items if they were knocked off in regular battles if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_FRONTIER | BATTLE_TYPE_SECRET_BASE | BATTLE_TYPE_RECORDED_LINK)) && (gWishFutureKnock.knockedOffMons[sideAttacker] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]] - || gWishFutureKnock.knockedOffMons[sideTarget] & gBitTable[gBattlerPartyIndexes[gBattlerTarget]] - || gWishFutureKnock.meltedItemMons[sideTarget] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]] - || gWishFutureKnock.meltedItemMons[sideTarget] & gBitTable[gBattlerPartyIndexes[gBattlerTarget]])) + || gWishFutureKnock.knockedOffMons[sideTarget] & gBitTable[gBattlerPartyIndexes[gBattlerTarget]])) { gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); }