Skip to content

Commit

Permalink
Add single stage growth to debug menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Bassoonian committed Dec 7, 2023
1 parent 9fa811d commit 9be5d4f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 9 deletions.
2 changes: 1 addition & 1 deletion include/config/overworld.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
39 changes: 31 additions & 8 deletions src/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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");

Expand Down Expand Up @@ -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},
};

// *******************************
Expand Down Expand Up @@ -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,
};

// *******************************
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 9be5d4f

Please sign in to comment.