From 9be5d4fba16778c295b7b3157e5c64c92944b207 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Thu, 7 Dec 2023 12:05:12 +0100 Subject: [PATCH] Add single stage growth to debug menu --- include/config/overworld.h | 2 +- src/debug.c | 39 ++++++++++++++++++++++++++++++-------- 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/include/config/overworld.h b/include/config/overworld.h index 9d181a3174..ca122b782d 100644 --- a/include/config/overworld.h +++ b/include/config/overworld.h @@ -14,7 +14,7 @@ // Berry settings #define OW_BERRY_MUTATIONS FALSE // If enabled, Berry plants can mutate based on berries planted next to them. -#define OW_BERRY_MULCH_USAGE TRUE // If enabled, Mulch can be used on soil to fertilize it. Otherwise, it is considered unusable. +#define OW_BERRY_MULCH_USAGE FALSE // If enabled, Mulch can be used on soil to fertilize it. Otherwise, it is considered unusable. Note that moisture effects only work with OW_BERRY_MOISTURE enabled! #define OW_BERRY_WEEDS FALSE // If enabled, weeds may grow on Berry plants that the player needs to take care of. #define OW_BERRY_PESTS FALSE // If enabled, pests may approach Berry plants that the player needs to take care of. #define OW_BERRY_MOISTURE FALSE // If enabled, Berry watering is not a matter of watering it once per stage, but rather of keeping the soil moist. diff --git a/src/debug.c b/src/debug.c index 4599d64a72..0fa79f56b9 100644 --- a/src/debug.c +++ b/src/debug.c @@ -218,6 +218,7 @@ enum BerryFunctionsMenu { DEBUG_BERRY_FUNCTIONS_MENU_CLEAR_ALL, DEBUG_BERRY_FUNCTIONS_MENU_READY, + DEBUG_BERRY_FUNCTIONS_MENU_NEXT_STAGE, DEBUG_BERRY_FUNCTIONS_MENU_WEEDS, DEBUG_BERRY_FUNCTIONS_MENU_PESTS, }; @@ -414,6 +415,7 @@ static void DebugAction_Sound_MUS_SelectId(u8 taskId); static void DebugAction_BerryFunctions_ClearAll(u8 taskId); static void DebugAction_BerryFunctions_Ready(u8 taskId); +static void DebugAction_BerryFunctions_NextStage(u8 taskId); static void DebugAction_BerryFunctions_Pests(u8 taskId); static void DebugAction_BerryFunctions_Weeds(u8 taskId); @@ -600,6 +602,7 @@ static const u8 sDebugText_Sound_Music_ID[] = _("Music Id: {STR_VAR_3} // Berry Function Menu static const u8 sDebugText_BerryFunctions_ClearAll[] = _("Clear map trees"); static const u8 sDebugText_BerryFunctions_Ready[] = _("Ready map trees"); +static const u8 sDebugText_BerryFunctions_NextStage[] = _("Grow map trees"); static const u8 sDebugText_BerryFunctions_Pests[] = _("Give map trees pests"); static const u8 sDebugText_BerryFunctions_Weeds[] = _("Give map trees weeds"); @@ -785,10 +788,11 @@ static const struct ListMenuItem sDebugMenu_Items_Sound[] = static const struct ListMenuItem sDebugMenu_Items_BerryFunctions[] = { - [DEBUG_BERRY_FUNCTIONS_MENU_CLEAR_ALL] = {sDebugText_BerryFunctions_ClearAll, DEBUG_BERRY_FUNCTIONS_MENU_CLEAR_ALL}, - [DEBUG_BERRY_FUNCTIONS_MENU_READY] = {sDebugText_BerryFunctions_Ready, DEBUG_BERRY_FUNCTIONS_MENU_READY}, - [DEBUG_BERRY_FUNCTIONS_MENU_PESTS] = {sDebugText_BerryFunctions_Pests, DEBUG_BERRY_FUNCTIONS_MENU_PESTS}, - [DEBUG_BERRY_FUNCTIONS_MENU_WEEDS] = {sDebugText_BerryFunctions_Weeds, DEBUG_BERRY_FUNCTIONS_MENU_WEEDS}, + [DEBUG_BERRY_FUNCTIONS_MENU_CLEAR_ALL] = {sDebugText_BerryFunctions_ClearAll, DEBUG_BERRY_FUNCTIONS_MENU_CLEAR_ALL}, + [DEBUG_BERRY_FUNCTIONS_MENU_READY] = {sDebugText_BerryFunctions_Ready, DEBUG_BERRY_FUNCTIONS_MENU_READY}, + [DEBUG_BERRY_FUNCTIONS_MENU_NEXT_STAGE] = {sDebugText_BerryFunctions_NextStage, DEBUG_BERRY_FUNCTIONS_MENU_NEXT_STAGE}, + [DEBUG_BERRY_FUNCTIONS_MENU_PESTS] = {sDebugText_BerryFunctions_Pests, DEBUG_BERRY_FUNCTIONS_MENU_PESTS}, + [DEBUG_BERRY_FUNCTIONS_MENU_WEEDS] = {sDebugText_BerryFunctions_Weeds, DEBUG_BERRY_FUNCTIONS_MENU_WEEDS}, }; // ******************************* @@ -892,10 +896,11 @@ static void (*const sDebugMenu_Actions_Sound[])(u8) = static void (*const sDebugMenu_Actions_BerryFunctions[])(u8) = { - [DEBUG_BERRY_FUNCTIONS_MENU_CLEAR_ALL] = DebugAction_BerryFunctions_ClearAll, - [DEBUG_BERRY_FUNCTIONS_MENU_READY] = DebugAction_BerryFunctions_Ready, - [DEBUG_BERRY_FUNCTIONS_MENU_PESTS] = DebugAction_BerryFunctions_Pests, - [DEBUG_BERRY_FUNCTIONS_MENU_WEEDS] = DebugAction_BerryFunctions_Weeds, + [DEBUG_BERRY_FUNCTIONS_MENU_CLEAR_ALL] = DebugAction_BerryFunctions_ClearAll, + [DEBUG_BERRY_FUNCTIONS_MENU_READY] = DebugAction_BerryFunctions_Ready, + [DEBUG_BERRY_FUNCTIONS_MENU_NEXT_STAGE] = DebugAction_BerryFunctions_NextStage, + [DEBUG_BERRY_FUNCTIONS_MENU_PESTS] = DebugAction_BerryFunctions_Pests, + [DEBUG_BERRY_FUNCTIONS_MENU_WEEDS] = DebugAction_BerryFunctions_Weeds, }; // ******************************* @@ -4704,6 +4709,24 @@ static void DebugAction_BerryFunctions_Ready(u8 taskId) Debug_DestroyMenu_Full(taskId); } +static void DebugAction_BerryFunctions_NextStage(u8 taskId) +{ + u8 i; + struct BerryTree *tree; + + for (i = 0; i < OBJECT_EVENTS_COUNT; i++) + { + if (gObjectEvents[i].movementType == MOVEMENT_TYPE_BERRY_TREE_GROWTH) + { + tree = &gSaveBlock1Ptr->berryTrees[GetObjectEventBerryTreeId(i)]; + BerryTreeGrow(tree); + } + } + + ScriptContext_Enable(); + Debug_DestroyMenu_Full(taskId); +} + static void DebugAction_BerryFunctions_Pests(u8 taskId) { u8 i;