From 5c485d9769d262dc16c01275524279cfd2fb3079 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Mon, 15 Nov 2021 14:02:33 -0300 Subject: [PATCH] Fixed Fling when gLastUsedItem is 0 Also renamed VARIOUS_JUMP_IF_NO_FLING_POWER to VARIOUS_JUMP_IF_FLING_FAILS. --- asm/macros/battle_script.inc | 4 ++-- data/battle_scripts_1.s | 2 +- include/constants/battle_script_commands.h | 2 +- src/battle_script_commands.c | 8 ++++++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 3999da4fc..fef12b4d5 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1925,8 +1925,8 @@ various BS_ATTACKER, VARIOUS_SHELL_SIDE_ARM_CHECK .endm - .macro jumpifnoflingpower battler:req, ptr:req - various \battler, VARIOUS_JUMP_IF_NO_FLING_POWER + .macro jumpifflingfails battler:req, ptr:req + various \battler, VARIOUS_JUMP_IF_FLING_FAILS .4byte \ptr .endm diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 2019fe388..c7d53ee55 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -405,7 +405,7 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectHit @ EFFECT_BOLT_BEAK BattleScript_EffectFling: - jumpifnoflingpower BS_ATTACKER, BattleScript_ButItFailedAtkStringPpReduce + jumpifflingfails BS_ATTACKER, BattleScript_ButItFailedAtkStringPpReduce jumpifstatus3 BS_ATTACKER, STATUS3_EMBARGO, BattleScript_ButItFailedAtkStringPpReduce jumpifword CMP_COMMON_BITS, gFieldStatuses, STATUS_FIELD_MAGIC_ROOM, BattleScript_ButItFailedAtkStringPpReduce .if B_KLUTZ_FLING_INTERACTION >= GEN_5 diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 6f3620f57..0dd3fb023 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -208,7 +208,7 @@ #define VARIOUS_SET_OCTOLOCK 135 #define VARIOUS_CUT_1_3_HP_RAISE_STATS 136 #define VARIOUS_TRY_END_NEUTRALIZING_GAS 137 -#define VARIOUS_JUMP_IF_NO_FLING_POWER 138 +#define VARIOUS_JUMP_IF_FLING_FAILS 138 #define VARIOUS_JUMP_IF_HOLD_EFFECT 139 #define VARIOUS_CURE_CERTAIN_STATUSES 140 #define VARIOUS_TRY_RESET_NEGATIVE_STAT_STAGES 141 diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 1cad382a8..742bfdd76 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -9285,12 +9285,16 @@ static void Cmd_various(void) gBattlescriptCurrInstr += 7; return; } - case VARIOUS_JUMP_IF_NO_FLING_POWER: + case VARIOUS_JUMP_IF_FLING_FAILS: #ifdef ITEM_EXPANSION if (!ItemId_GetFlingPower(gBattleMons[gActiveBattler].item)) gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); - else + else if (gLastUsedItem == ITEM_NONE) + #else + if (gLastUsedItem == ITEM_NONE) #endif + gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + else gBattlescriptCurrInstr += 7; return; case VARIOUS_CURE_CERTAIN_STATUSES: