Skip to content

Commit

Permalink
Refactor growth time and add six stage toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
Bassoonian committed Dec 7, 2023
1 parent c8d356a commit 9d09b36
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 74 deletions.
40 changes: 40 additions & 0 deletions data/scripts/berry_tree.inc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ BerryTreeScript::
case BERRY_STAGE_PLANTED, BerryTree_EventScript_CheckBerryStage1
case BERRY_STAGE_SPROUTED, BerryTree_EventScript_CheckBerryStage2
case BERRY_STAGE_TALLER, BerryTree_EventScript_CheckBerryStage3
case BERRY_STAGE_TRUNK, BerryTree_EventScript_CheckBerryStageTrunk
case BERRY_STAGE_BUDDING, BerryTree_EventScript_CheckBerryStageBudding
case BERRY_STAGE_FLOWERING, BerryTree_EventScript_CheckBerryStage4
case BERRY_STAGE_BERRIES, BerryTree_EventScript_CheckBerryFullyGrown
end
Expand Down Expand Up @@ -105,6 +107,22 @@ BerryTree_EventScript_CheckBerryStage3::
waitbuttonpress
goto BerryTree_EventScript_WantToWater

BerryTree_EventScript_CheckBerryStageTrunk::
lockall
special ObjectEventInteractionGetBerryName
message BerryTree_Text_BerryGrowthStageTrunk
waitmessage
waitbuttonpress
goto BerryTree_EventScript_WantToWater

BerryTree_EventScript_CheckBerryStageBudding::
lockall
special ObjectEventInteractionGetBerryName
message BerryTree_Text_BerryGrowthStageBudding
waitmessage
waitbuttonpress
goto BerryTree_EventScript_WantToWater

BerryTree_EventScript_CheckBerryStage4::
call BerryTree_EventScript_GetCareAdverb
lockall
Expand Down Expand Up @@ -245,17 +263,39 @@ BerryTree_Text_PlantedOneBerry:
.string "the soft, loamy soil.$"

BerryTree_Text_BerryGrowthStage1:
.if OW_BERRY_SIX_STAGES == TRUE
.string "This is where you planted the\n{STR_VAR_1} BERRY!$"
.else
.string "One {STR_VAR_1} was planted here.$"
.endif

BerryTree_Text_BerryGrowthStage2:
.if OW_BERRY_SIX_STAGES == TRUE
.string "The {STR_VAR_1} is sprouting!$"
.else
.string "{STR_VAR_1} has sprouted.$"
.endif

BerryTree_Text_BerryGrowthStage3:
.if OW_BERRY_SIX_STAGES == TRUE
.string "The {STR_VAR_1}'s seedling is growing well!$"
.else
.string "This {STR_VAR_1} plant is growing taller.$"
.endif

BerryTree_Text_BerryGrowthStageTrunk:
.string "The {STR_VAR_1}'s trunk is getting bigger!$"

BerryTree_Text_BerryGrowthStageBudding:
.string "The {STR_VAR_1} tree has buds!$"

BerryTree_Text_BerryGrowthStage4:
.if OW_BERRY_SIX_STAGES == TRUE
.string "The {STR_VAR_1} tree is in bloom!$"
.else
.string "These {STR_VAR_1} flowers are blooming\n"
.string "{STR_VAR_2}.$"
.endif

BerryTree_Text_CareAdverbGreat:
.string "very beautifully$"
Expand Down
3 changes: 2 additions & 1 deletion include/config/overworld.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
#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.
#define OW_BERRY_VARIABLE_DRAIN_RATE FALSE // If moisture is enabled, this setting uses the Gen4 drain rates for different berries
#define OW_BERRY_VARIABLE_DRAIN_RATE FALSE // If moisture is enabled, this setting uses the Gen4 drain rates for different berries.
#define OW_BERRY_SIX_STAGES FALSE // In XY, Berries go through six stages instead of four. This toggle does not affect the time it takes for a tree to be ready for harvest. Without OW_BERRY_MOISTURE, the two extra stages count as BERRY_STAGE_TALLER for watering purposes.

// Out-of-battle Ability effects
#define OW_SYNCHRONIZE_NATURE GEN_LATEST // In Gen8, if a Pokémon with Synchronize is leading the party, it's 100% guaranteed that wild Pokémon will have the same Nature, as opposed to 50% previously. Stationary Pokémon are excluded in Gen3. In Gen6, all No Eggs Discovered gift Pokémon will have the same Nature, while in Gen7 all gift Pokémon will, regardless of Egg Group - In Gen 8, no gift Pokémon are affected. In Gen9, this ability has no out-of-battle effect.
Expand Down
2 changes: 2 additions & 0 deletions include/constants/berry.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#define BERRY_STAGE_TALLER 3
#define BERRY_STAGE_FLOWERING 4
#define BERRY_STAGE_BERRIES 5
#define BERRY_STAGE_TRUNK 6 // These follow BERRY_STAGE_BERRIES to preserve save compatibility
#define BERRY_STAGE_BUDDING 7
#define BERRY_STAGE_SPARKLING 255

// Berries can be watered in the following stages:
Expand Down
4 changes: 2 additions & 2 deletions include/global.berry.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct Berry
u8 minYield;
const u8 *description1;
const u8 *description2;
u8 stageDuration;
u8 growthDuration;
u8 spicy;
u8 dry;
u8 sweet;
Expand All @@ -36,7 +36,7 @@ struct Berry2
u8 minYield;
u8 *description1;
u8 *description2;
u8 stageDuration;
u8 growthDuration;
u8 spicy;
u8 dry;
u8 sweet;
Expand Down
Loading

0 comments on commit 9d09b36

Please sign in to comment.