From da24b9c25129dfa55085988c2bd934610f516884 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Wed, 31 Mar 2021 21:20:00 -0300 Subject: [PATCH 1/4] Tweaked Oblivious -Made it unaffected by a foe's taunt. -Changed the Battle Script it calls when a foe tries to infatuate. --- src/battle_script_commands.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 0c5250050..119af91aa 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -9689,7 +9689,7 @@ static void Cmd_tryinfatuating(void) if (GetBattlerAbility(gBattlerTarget) == ABILITY_OBLIVIOUS) { - gBattlescriptCurrInstr = BattleScript_ObliviousPreventsAttraction; + gBattlescriptCurrInstr = BattleScript_NotAffected; gLastUsedAbility = ABILITY_OBLIVIOUS; RecordAbilityBattle(gBattlerTarget, ABILITY_OBLIVIOUS); } @@ -11094,7 +11094,13 @@ static void Cmd_jumpifnodamage(void) static void Cmd_settaunt(void) { - if (gDisableStructs[gBattlerTarget].tauntTimer == 0) + if (GetBattlerAbility(gBattlerTarget) == ABILITY_OBLIVIOUS) + { + gBattlescriptCurrInstr = BattleScript_NotAffected; + gLastUsedAbility = ABILITY_OBLIVIOUS; + RecordAbilityBattle(gBattlerTarget, ABILITY_OBLIVIOUS); + } + else if (gDisableStructs[gBattlerTarget].tauntTimer == 0) { u8 turns = 4; if (GetBattlerTurnOrderNum(gBattlerTarget) > GetBattlerTurnOrderNum(gBattlerAttacker)) From ed74430d26a2874c29f3ca2ed43555787c1e2d1e Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Wed, 31 Mar 2021 23:11:27 -0300 Subject: [PATCH 2/4] Added a variation of BattleScript_NotAffected This one triggers the Ability PopUp. --- data/battle_scripts_1.s | 9 +++++++++ include/battle_scripts.h | 1 + src/battle_script_commands.c | 4 ++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 16bb6e92c..373723711 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -4183,6 +4183,15 @@ BattleScript_NotAffected:: waitmessage 0x40 goto BattleScript_MoveEnd +BattleScript_NotAffectedAbilityPopUp:: + copybyte gBattlerAbility, gBattlerTarget + pause 0x20 + call BattleScript_AbilityPopUp + orhalfword gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE + resultmessage + waitmessage 0x40 + goto BattleScript_MoveEnd + BattleScript_EffectUproar:: attackcanceler accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 2fc993b9c..844ffe6cf 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -367,5 +367,6 @@ extern const u8 BattleScript_CustapBerryActivation[]; extern const u8 BattleScript_MicleBerryActivateEnd2[]; extern const u8 BattleScript_MicleBerryActivateRet[]; extern const u8 BattleScript_JabocaRowapBerryActivates[]; +extern const u8 BattleScript_NotAffectedAbilityPopUp[]; #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 119af91aa..ce5b49048 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -9689,7 +9689,7 @@ static void Cmd_tryinfatuating(void) if (GetBattlerAbility(gBattlerTarget) == ABILITY_OBLIVIOUS) { - gBattlescriptCurrInstr = BattleScript_NotAffected; + gBattlescriptCurrInstr = BattleScript_NotAffectedAbilityPopUp; gLastUsedAbility = ABILITY_OBLIVIOUS; RecordAbilityBattle(gBattlerTarget, ABILITY_OBLIVIOUS); } @@ -11096,7 +11096,7 @@ static void Cmd_settaunt(void) { if (GetBattlerAbility(gBattlerTarget) == ABILITY_OBLIVIOUS) { - gBattlescriptCurrInstr = BattleScript_NotAffected; + gBattlescriptCurrInstr = BattleScript_NotAffectedAbilityPopUp; gLastUsedAbility = ABILITY_OBLIVIOUS; RecordAbilityBattle(gBattlerTarget, ABILITY_OBLIVIOUS); } From c21a00a5d1268e4e32e5d5145a593407264bce4b Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Tue, 1 Jun 2021 18:20:33 -0300 Subject: [PATCH 3/4] Replaced magic numbers with constants in BattleScript_NotAffectedAbilityPopUp --- data/battle_scripts_1.s | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index b94d488a0..56a6fc1b7 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -4191,11 +4191,11 @@ BattleScript_NotAffected:: BattleScript_NotAffectedAbilityPopUp:: copybyte gBattlerAbility, gBattlerTarget - pause 0x20 + pause B_WAIT_TIME_SHORT call BattleScript_AbilityPopUp orhalfword gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE resultmessage - waitmessage 0x40 + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectUproar:: From b552db719362dfec91c9dfc36b56f1ba0321905a Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Thu, 3 Jun 2021 07:55:44 -0300 Subject: [PATCH 4/4] =?UTF-8?q?Tweaked=20the=20Oblivious=20immunities=20Po?= =?UTF-8?q?k=C3=A9mon=20that=20are=20infatuated=20or=20taunted=20and=20obt?= =?UTF-8?q?ain=20Oblivious=20through=20Skill=20Swap=20will=20now=20be=20he?= =?UTF-8?q?aled=20of=20said=20conditions=20and=20a=20text=20string=20signa?= =?UTF-8?q?ling=20it=20will=20be=20printed.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/battle_scripts_1.s | 12 ++++++++++++ include/battle_scripts.h | 2 ++ include/constants/battle_string_ids.h | 6 ++++-- src/battle_message.c | 4 ++++ src/battle_util.c | 18 +++++++++++++----- 5 files changed, 35 insertions(+), 7 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 56a6fc1b7..eb4ffe4a7 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -7412,6 +7412,18 @@ BattleScript_AbilityCuredStatus:: updatestatusicon BS_SCRIPTING return +BattleScript_BattlerShookOffTaunt:: + call BattleScript_AbilityPopUp + printstring STRINGID_PKMNSHOOKOFFTHETAUNT + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_BattlerGotOverItsInfatuation:: + call BattleScript_AbilityPopUp + printstring STRINGID_PKMNGOTOVERITSINFATUATION + waitmessage B_WAIT_TIME_LONG + return + BattleScript_IgnoresWhileAsleep:: printstring STRINGID_PKMNIGNORESASLEEP waitmessage B_WAIT_TIME_LONG diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 6aee81458..ea85cf43c 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -368,5 +368,7 @@ extern const u8 BattleScript_MicleBerryActivateEnd2[]; extern const u8 BattleScript_MicleBerryActivateRet[]; extern const u8 BattleScript_JabocaRowapBerryActivates[]; extern const u8 BattleScript_NotAffectedAbilityPopUp[]; +extern const u8 BattleScript_BattlerShookOffTaunt[]; +extern const u8 BattleScript_BattlerGotOverItsInfatuation[]; #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index f929a1e87..266aef147 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -568,8 +568,10 @@ #define STRINGID_CURIOUSMEDICINEENTERS 564 #define STRINGID_CANACTFASTERTHANKSTO 565 #define STRINGID_MICLEBERRYACTIVATES 566 - -#define BATTLESTRINGS_COUNT 567 +#define STRINGID_PKMNSHOOKOFFTHETAUNT 567 +#define STRINGID_PKMNGOTOVERITSINFATUATION 568 + +#define BATTLESTRINGS_COUNT 569 // The below IDs are all indexes into battle message tables, // used to determine which of a set of messages to print. diff --git a/src/battle_message.c b/src/battle_message.c index c7464b70c..d4d5756f9 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -694,9 +694,13 @@ static const u8 sText_AsOneEnters[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} has two static const u8 sText_CuriousMedicineEnters[] = _("{B_EFF_NAME_WITH_PREFIX}'s\nstat changes were reset!"); static const u8 sText_CanActFaster[] = _("{B_ATK_NAME_WITH_PREFIX} can act faster,\nthanks to {B_LAST_ITEM}!"); static const u8 sText_MicleBerryActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} boosted the accuracy of its\nnext move using {B_LAST_ITEM}!"); +static const u8 sText_PkmnShookOffTheTaunt[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} shook off\nthe taunt!"); +static const u8 sText_PkmnGotOverItsInfatuation[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} got over\nits infatuation!"); const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = { + [STRINGID_PKMNGOTOVERITSINFATUATION - 12] = sText_PkmnGotOverItsInfatuation, + [STRINGID_PKMNSHOOKOFFTHETAUNT - 12] = sText_PkmnShookOffTheTaunt, [STRINGID_MICLEBERRYACTIVATES - 12] = sText_MicleBerryActivates, [STRINGID_CANACTFASTERTHANKSTO - 12] = sText_CanActFaster, [STRINGID_CURIOUSMEDICINEENTERS - 12] = sText_CuriousMedicineEnters, diff --git a/src/battle_util.c b/src/battle_util.c index 4c3f795de..fdf8201aa 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -5100,10 +5100,9 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move break; case ABILITY_OBLIVIOUS: if (gBattleMons[battler].status2 & STATUS2_INFATUATION) - { - StringCopy(gBattleTextBuff1, gStatusConditionString_LoveJpn); effect = 3; - } + else if (gDisableStructs[battler].tauntTimer != 0) + effect = 4; break; } if (effect) @@ -5112,17 +5111,26 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move { case 1: // status cleared gBattleMons[battler].status1 = 0; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_AbilityCuredStatus; break; case 2: // get rid of confusion gBattleMons[battler].status2 &= ~(STATUS2_CONFUSION); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_AbilityCuredStatus; break; case 3: // get rid of infatuation gBattleMons[battler].status2 &= ~(STATUS2_INFATUATION); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_BattlerGotOverItsInfatuation; + break; + case 4: // get rid of taunt + gDisableStructs[battler].tauntTimer = 0; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_BattlerShookOffTaunt; break; } - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_AbilityCuredStatus; gBattleScripting.battler = gActiveBattler = gBattlerAbility = battler; BtlController_EmitSetMonData(0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1); MarkBattlerForControllerExec(gActiveBattler);