From 0422a013c4ef8ce48184eb3a2bd550f32d370938 Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Mon, 7 Jul 2025 19:33:57 +0200 Subject: [PATCH] Add Set Hidden Nature option to the debug menu (#7281) --- data/scripts/debug.inc | 89 ++++++++++++++++++++++++++++++++++++++++++ data/specials.inc | 1 + src/debug.c | 4 +- src/field_specials.c | 7 ++++ 4 files changed, 100 insertions(+), 1 deletion(-) diff --git a/data/scripts/debug.inc b/data/scripts/debug.inc index 05eeb4ecaf..e43df32813 100644 --- a/data/scripts/debug.inc +++ b/data/scripts/debug.inc @@ -353,6 +353,44 @@ Debug_EventScript_InflictStatus1_Single: releaseall end +Debug_EventScript_SetHiddenNature:: + special ChoosePartyMon + waitstate + goto_if_ge VAR_0x8004, PARTY_SIZE, Debug_EventScript_InflictStatus1_Close + specialvar VAR_RESULT, ScriptGetPartyMonSpecies + goto_if_eq VAR_RESULT, SPECIES_EGG, Debug_EventScript_InflictStatus1_Close + dynmultipush Debug_EventScript_ChangeNature_Text_Hardy, 0 + dynmultipush Debug_EventScript_ChangeNature_Text_Lonely, 1 + dynmultipush Debug_EventScript_ChangeNature_Text_Brave, 2 + dynmultipush Debug_EventScript_ChangeNature_Text_Adamant, 3 + dynmultipush Debug_EventScript_ChangeNature_Text_Naughty, 4 + dynmultipush Debug_EventScript_ChangeNature_Text_Bold, 5 + dynmultipush Debug_EventScript_ChangeNature_Text_Docile, 6 + dynmultipush Debug_EventScript_ChangeNature_Text_Relaxed, 7 + dynmultipush Debug_EventScript_ChangeNature_Text_Impish, 8 + dynmultipush Debug_EventScript_ChangeNature_Text_Lax, 9 + dynmultipush Debug_EventScript_ChangeNature_Text_Timid, 10 + dynmultipush Debug_EventScript_ChangeNature_Text_Hasty, 11 + dynmultipush Debug_EventScript_ChangeNature_Text_Serious, 12 + dynmultipush Debug_EventScript_ChangeNature_Text_Jolly, 13 + dynmultipush Debug_EventScript_ChangeNature_Text_Naive, 14 + dynmultipush Debug_EventScript_ChangeNature_Text_Modest, 15 + dynmultipush Debug_EventScript_ChangeNature_Text_Mild, 16 + dynmultipush Debug_EventScript_ChangeNature_Text_Quiet, 17 + dynmultipush Debug_EventScript_ChangeNature_Text_Bashful, 18 + dynmultipush Debug_EventScript_ChangeNature_Text_Rash, 19 + dynmultipush Debug_EventScript_ChangeNature_Text_Calm, 20 + dynmultipush Debug_EventScript_ChangeNature_Text_Gentle, 21 + dynmultipush Debug_EventScript_ChangeNature_Text_Sassy, 22 + dynmultipush Debug_EventScript_ChangeNature_Text_Careful, 23 + dynmultipush Debug_EventScript_ChangeNature_Text_Quirky, 24 + dynmultistack 0, 0, TRUE, 7, FALSE, 0, NULL + switch VAR_RESULT + case MULTI_B_PRESSED, Debug_EventScript_InflictStatus1_Close + special SetHiddenNature + releaseall + end + Debug_EventScript_InflictStatus1_Single_Poison: setstatus1 STATUS1_POISON, VAR_0x8004 releaseall @@ -461,6 +499,57 @@ Debug_EventScript_InflictStatus1_Text_Freeze: Debug_EventScript_InflictStatus1_Text_Frostbite: .string "Frostbite$" +Debug_EventScript_ChangeNature_Text_Hardy: + .string "Hardy$" +Debug_EventScript_ChangeNature_Text_Lonely: + .string "Lonely$" +Debug_EventScript_ChangeNature_Text_Brave: + .string "Brave$" +Debug_EventScript_ChangeNature_Text_Adamant: + .string "Adamant$" +Debug_EventScript_ChangeNature_Text_Naughty: + .string "Naughty$" +Debug_EventScript_ChangeNature_Text_Bold: + .string "Bold$" +Debug_EventScript_ChangeNature_Text_Docile: + .string "Docile$" +Debug_EventScript_ChangeNature_Text_Relaxed: + .string "Relaxed$" +Debug_EventScript_ChangeNature_Text_Impish: + .string "Impish$" +Debug_EventScript_ChangeNature_Text_Lax: + .string "Lax$" +Debug_EventScript_ChangeNature_Text_Timid: + .string "Timid$" +Debug_EventScript_ChangeNature_Text_Hasty: + .string "Hasty$" +Debug_EventScript_ChangeNature_Text_Serious: + .string "Serious$" +Debug_EventScript_ChangeNature_Text_Jolly: + .string "Jolly$" +Debug_EventScript_ChangeNature_Text_Naive: + .string "Naive$" +Debug_EventScript_ChangeNature_Text_Modest: + .string "Modest$" +Debug_EventScript_ChangeNature_Text_Mild: + .string "Mild$" +Debug_EventScript_ChangeNature_Text_Quiet: + .string "Quiet$" +Debug_EventScript_ChangeNature_Text_Bashful: + .string "Bashful$" +Debug_EventScript_ChangeNature_Text_Rash: + .string "Rash$" +Debug_EventScript_ChangeNature_Text_Calm: + .string "Calm$" +Debug_EventScript_ChangeNature_Text_Gentle: + .string "Gentle$" +Debug_EventScript_ChangeNature_Text_Sassy: + .string "Sassy$" +Debug_EventScript_ChangeNature_Text_Careful: + .string "Careful$" +Debug_EventScript_ChangeNature_Text_Quirky: + .string "Quirky$" + Debug_EventScript_EWRAMCounters:: callnative CheckEWRAMCounters msgbox Debug_EventScript_EWRAMCounters_Text, MSGBOX_DEFAULT diff --git a/data/specials.inc b/data/specials.inc index c95cea9a7e..0a2ae2da50 100644 --- a/data/specials.inc +++ b/data/specials.inc @@ -563,3 +563,4 @@ gSpecials:: def_special UseBlankMessageToCancelPokemonPic def_special EnterCode def_special GetCodeFeedback + def_special SetHiddenNature diff --git a/src/debug.c b/src/debug.c index 3f970ae7fc..041734ebf5 100644 --- a/src/debug.c +++ b/src/debug.c @@ -345,6 +345,7 @@ extern const u8 Debug_EventScript_FontTest[]; extern const u8 Debug_EventScript_CheckEVs[]; extern const u8 Debug_EventScript_CheckIVs[]; extern const u8 Debug_EventScript_InflictStatus1[]; +extern const u8 Debug_EventScript_SetHiddenNature[]; extern const u8 Debug_EventScript_Script_1[]; extern const u8 Debug_EventScript_Script_2[]; extern const u8 Debug_EventScript_Script_3[]; @@ -572,6 +573,7 @@ static const struct DebugMenuOption sDebugMenu_Actions_Party[] = { COMPOUND_STRING("Hatch an Egg"), DebugAction_ExecuteScript, Debug_HatchAnEgg }, { COMPOUND_STRING("Heal party"), DebugAction_Party_HealParty }, { COMPOUND_STRING("Inflict Status1"), DebugAction_ExecuteScript, Debug_EventScript_InflictStatus1 }, + { COMPOUND_STRING("Set Hidden Nature"), DebugAction_ExecuteScript, Debug_EventScript_SetHiddenNature }, { COMPOUND_STRING("Check EVs"), DebugAction_ExecuteScript, Debug_EventScript_CheckEVs }, { COMPOUND_STRING("Check IVs"), DebugAction_ExecuteScript, Debug_EventScript_CheckIVs }, { COMPOUND_STRING("Clear Party"), DebugAction_Party_ClearParty }, @@ -3418,7 +3420,7 @@ static void DebugAction_Sound_MUS_SelectId(u8 taskId) } } -static const u32 gDebugFollowerNPCGraphics[] = +static const u32 gDebugFollowerNPCGraphics[] = { OBJ_EVENT_GFX_RIVAL_BRENDAN_NORMAL, OBJ_EVENT_GFX_RIVAL_MAY_NORMAL, diff --git a/src/field_specials.c b/src/field_specials.c index 927326e399..549a3b9198 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -4361,3 +4361,10 @@ void GetCodeFeedback(void) else gSpecialVar_Result = 0; } + +void SetHiddenNature(void) +{ + u32 hiddenNature = gSpecialVar_Result; + SetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_HIDDEN_NATURE, &hiddenNature); + CalculateMonStats(&gPlayerParty[gSpecialVar_0x8004]); +}