From bfb7333507ab825a6cd116acf30de4d7a74c2e22 Mon Sep 17 00:00:00 2001 From: Evan Date: Thu, 21 Jan 2021 12:03:30 -0700 Subject: [PATCH 1/2] memento gen4 failing --- include/constants/battle_config.h | 1 + src/battle_script_commands.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index f7b38000c2..5e0491b610 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -112,6 +112,7 @@ #define B_PP_REDUCED_BY_SPITE GEN_6 // In Gen4+, Spite reduces the foe's last move's PP by 4, instead of 2 to 5. #define B_CAN_SPITE_FAIL GEN_6 // In Gen4+, Spite can no longer fail if the foe's last move only has 1 remaining PP. #define B_CRASH_IF_TARGET_IMMUNE GEN_6 // In Gen4+, The user of Jump Kick or Hi Jump Kick will "keep going and crash" if it attacks a target that is immune to the move. +#define B_MEMENTO_FAIL GEN_4 // in Gen4+, memento fails if there is no target or if the target is protected or behind substitute. But not if atk/sp.atk are at -6 // Ability settings #define B_ABILITY_WEATHER GEN_6 // In Gen6+, ability-induced weather lasts 5 turns. Before, it lasted until the battle ended or until it was changed by a move. diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 6c5f37a7d4..4eb6aaf091 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -10952,9 +10952,16 @@ static void Cmd_sethail(void) static void Cmd_jumpifattackandspecialattackcannotfall(void) // memento { + #if B_MEMENTO_FAIL == GEN_3 if (gBattleMons[gBattlerTarget].statStages[STAT_ATK] == MIN_STAT_STAGE && gBattleMons[gBattlerTarget].statStages[STAT_SPATK] == MIN_STAT_STAGE && gBattleCommunication[6] != 1) + #else + if (gBattleCommunication[6] != 1 + || gStatuses3[gBattlerTarget] & STATUS3_SEMI_INVULNERABLE + || IsBattlerProtected(gBattlerTarget, gCurrentMove) + || DoesSubstituteBlockMove(gBattlerAttacker, gBattlerTarget, gCurrentMove)) + #endif { gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); } From 5aff5333dc76794f84469882c06e8cab8fb37c10 Mon Sep 17 00:00:00 2001 From: Evan Date: Thu, 21 Jan 2021 12:05:01 -0700 Subject: [PATCH 2/2] fix B_MEMENTO_FAIL comment --- include/constants/battle_config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 5e0491b610..ef9405cc5a 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -112,7 +112,7 @@ #define B_PP_REDUCED_BY_SPITE GEN_6 // In Gen4+, Spite reduces the foe's last move's PP by 4, instead of 2 to 5. #define B_CAN_SPITE_FAIL GEN_6 // In Gen4+, Spite can no longer fail if the foe's last move only has 1 remaining PP. #define B_CRASH_IF_TARGET_IMMUNE GEN_6 // In Gen4+, The user of Jump Kick or Hi Jump Kick will "keep going and crash" if it attacks a target that is immune to the move. -#define B_MEMENTO_FAIL GEN_4 // in Gen4+, memento fails if there is no target or if the target is protected or behind substitute. But not if atk/sp.atk are at -6 +#define B_MEMENTO_FAIL GEN_4 // In Gen4+, memento fails if there is no target or if the target is protected or behind substitute. But not if atk/sp.atk are at -6 // Ability settings #define B_ABILITY_WEATHER GEN_6 // In Gen6+, ability-induced weather lasts 5 turns. Before, it lasted until the battle ended or until it was changed by a move.