diff --git a/data/scripts/berry_tree.inc b/data/scripts/berry_tree.inc index 8ad300df52..4f4f723f1c 100644 --- a/data/scripts/berry_tree.inc +++ b/data/scripts/berry_tree.inc @@ -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 @@ -23,6 +25,8 @@ BerryTree_EventScript_CheckSoil:: faceplayer specialvar VAR_RESULT, PlayerHasBerries goto_if_eq VAR_RESULT, TRUE, BerryTree_EventScript_WantToPlant + specialvar VAR_RESULT, PlayerHasMulch + goto_if_eq VAR_RESULT, TRUE, BerryTree_EventScript_WantToMulch message BerryTree_Text_ItsSoftLoamySoil waitmessage waitbuttonpress @@ -30,11 +34,42 @@ BerryTree_EventScript_CheckSoil:: end BerryTree_EventScript_WantToPlant:: + specialvar VAR_RESULT, PlayerHasMulch + goto_if_eq VAR_RESULT, TRUE, BerryTree_EventScript_WantToPlantMulch msgbox BerryTree_Text_WantToPlant, MSGBOX_YESNO goto_if_eq VAR_RESULT, YES, BerryTree_EventScript_ChooseBerryToPlant goto_if_eq VAR_RESULT, NO, BerryTree_EventScript_CancelPlanting end +BerryTree_EventScript_WantToMulch:: +.if OW_BERRY_MULCH_USAGE == TRUE + msgbox BerryTree_Text_WantToMulch, MSGBOX_YESNO + goto_if_eq VAR_RESULT, YES, BerryTree_EventScript_ChooseMulchToUse + goto_if_eq VAR_RESULT, NO, BerryTree_EventScript_CancelPlanting +.endif + end + +BerryTree_EventScript_WantToPlantMulch:: +.if OW_BERRY_MULCH_USAGE == TRUE + message BerryTree_Text_ItsSoftLoamySoil + waitmessage + multichoice 0, 0, MULTI_BERRY_PLOT, FALSE + switch VAR_RESULT + case 0, BerryTree_EventScript_ChooseMulchToUse + case 1, BerryTree_EventScript_ChooseBerryToPlant + case 2, BerryTree_EventScript_CancelPlanting + case MULTI_B_PRESSED, BerryTree_EventScript_CancelPlanting + +BerryTree_EventScript_ChooseMulchToUse:: + fadescreen FADE_TO_BLACK + closemessage + special Bag_ChooseMulch + waitstate + goto_if_eq VAR_ITEM_ID, 0, BerryTree_EventScript_CancelPlanting + removeitem VAR_ITEM_ID + call BerryTree_EventScript_UseMulch +.endif + BerryTree_EventScript_ChooseBerryToPlant:: fadescreen FADE_TO_BLACK closemessage @@ -72,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 @@ -103,13 +154,25 @@ BerryTree_EventScript_CheckBerryFullyGrown:: lock faceplayer special ObjectEventInteractionGetBerryCountString +.if OW_BERRY_MUTATIONS == TRUE + goto_if_eq VAR_RESULT, TRUE, BerryTree_EventScript_CheckBerryFullyGrown_Mutation +.endif msgbox BerryTree_Text_WantToPick, MSGBOX_YESNO goto_if_eq VAR_RESULT, YES, BerryTree_EventScript_PickBerry goto_if_eq VAR_RESULT, NO, BerryTree_EventScript_CancelPickingBerry +.set BERRY_NORMAL_BAG_FULL, 0 +.set BERRY_NORMAL_SPACE_IN_BAG, 1 +.set BERRY_MUTATION_BAG_FULL, 2 +.set BERRY_MUTATION_SPACE_IN_BAG, 3 + BerryTree_EventScript_PickBerry:: special ObjectEventInteractionPickBerryTree - goto_if_eq VAR_0x8004, 0, BerryTree_EventScript_BerryPocketFull + goto_if_eq VAR_0x8004, BERRY_NORMAL_BAG_FULL, BerryTree_EventScript_BerryPocketFull +.if OW_BERRY_MUTATIONS == TRUE + goto_if_eq VAR_0x8004, BERRY_MUTATION_BAG_FULL, BerryTree_EventScript_BerryPocketFull_Mutation + goto_if_eq VAR_0x8004, BERRY_MUTATION_SPACE_IN_BAG, BerryTree_EventScript_PickBerry_Mutation +.endif special IncrementDailyPickedBerries special ObjectEventInteractionRemoveBerryTree message BerryTree_Text_PickedTheBerry @@ -145,8 +208,16 @@ BerryTree_EventScript_ItemUsePlantBerry:: end BerryTree_EventScript_WantToWater:: +.if OW_BERRY_PESTS == TRUE + call BerryTree_EventScript_CheckForPests +.endif +.if OW_BERRY_WEEDS == TRUE + call BerryTree_EventScript_CheckForWeed +.endif checkitem ITEM_WAILMER_PAIL goto_if_eq VAR_RESULT, FALSE, BerryTree_EventScript_DontWater + specialvar VAR_RESULT, CanWaterBerryPlot + goto_if_eq VAR_RESULT, FALSE, BerryTree_EventScript_DontWater special ObjectEventInteractionGetBerryName msgbox BerryTree_Text_WantToWater, MSGBOX_YESNO goto_if_eq VAR_RESULT, YES, BerryTree_EventScript_WaterBerry @@ -194,17 +265,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}!$" +.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$" @@ -249,3 +342,123 @@ BerryTree_Text_PlantIsDelighted: BerryTree_Text_ExclamationPoint: .string "!$" + +.if OW_BERRY_MUTATIONS == TRUE +BerryTree_EventScript_CheckBerryFullyGrown_Mutation: + msgbox BerryTree_Text_WantToPick_Mutation, MSGBOX_YESNO + goto_if_eq VAR_RESULT, YES, BerryTree_EventScript_PickBerry + goto_if_eq VAR_RESULT, NO, BerryTree_EventScript_CancelPickingBerry_Mutation + +BerryTree_EventScript_CancelPickingBerry_Mutation:: + message BerryTree_Text_BerryLeftUnpicked_Mutation + waitmessage + waitbuttonpress + release + end + +BerryTree_EventScript_BerryPocketFull_Mutation:: + message BerryTree_Text_BerryPocketFull_Mutation + waitmessage + waitbuttonpress + release + end + +BerryTree_EventScript_PickBerry_Mutation:: + special IncrementDailyPickedBerries + special ObjectEventInteractionRemoveBerryTree + message BerryTree_Text_PickedTheBerry_Mutation + playfanfare MUS_OBTAIN_BERRY + waitmessage + waitfanfare + waitbuttonpress + message BerryTree_Text_PutAwayBerry_Mutation + waitmessage + waitbuttonpress + release + end + +BerryTree_Text_WantToPick_Mutation: + .string "You found {STR_VAR_2} {STR_VAR_1}\n" + .string "and 1 {STR_VAR_3}!\p" + .string "Do you want to pick them?$" + +BerryTree_Text_BerryLeftUnpicked_Mutation: + .string "{PLAYER} left the {STR_VAR_1}\n" + .string "and the {STR_VAR_3} unpicked.$" + +BerryTree_Text_BerryPocketFull_Mutation: + .string "The BAG's BERRIES POCKET is full.\p" + .string "The {STR_VAR_1} and the\n" + .string "{STR_VAR_3} couldn't be taken.$" + +BerryTree_Text_PickedTheBerry_Mutation: + .string "{PLAYER} picked the {STR_VAR_2} {STR_VAR_1}\n" + .string "and the {STR_VAR_3}.$" + +BerryTree_Text_PutAwayBerry_Mutation: + .string "{PLAYER} put away the {STR_VAR_1}\n" + .string "and the {STR_VAR_3} in the BAG's\l" + .string "BERRIES POCKET.\p" + .string "The soil returned to its soft and\n" + .string "loamy state.$" +.endif + +.if OW_BERRY_MULCH_USAGE == TRUE +BerryTree_EventScript_UseMulch:: + special ObjectEventInteractionApplyMulch + message BerryTree_Text_ScatteredMulch + waitmessage + waitbuttonpress + return + +BerryTree_Text_WantToMulch: + .string "It's soft, loamy soil.\n" + .string "Put down some fertilizer?$" + +BerryTree_Text_ScatteredMulch: + .string "{PLAYER} scattered the {STR_VAR_1}\n" + .string "on the soft, loamy soil.$" +.endif + +.if OW_BERRY_WEEDS == TRUE +BerryTree_EventScript_CheckForWeed:: + specialvar VAR_RESULT, ObjectEventInteractionBerryHasWeed + call_if_eq VAR_RESULT, TRUE, BerryTree_EventScript_WeedIsGrowing + return + +BerryTree_EventScript_WeedIsGrowing:: + msgbox BerryTree_Text_WeedIsGrowing, MSGBOX_YESNO + goto_if_eq VAR_RESULT, YES, BerryTree_EventScript_PullOutWeed + return + +BerryTree_EventScript_PullOutWeed:: + special ObjectEventInteractionPullBerryWeed + message BerryTree_Text_PulledOutTheWeed + waitmessage + waitbuttonpress + return + +BerryTree_Text_WeedIsGrowing: + .string "A weed is growing here.\n" + .string "Do you want to pull it out?$" + +BerryTree_Text_PulledOutTheWeed: + .string "{PLAYER} pulled out the weed!$" +.endif + +.if OW_BERRY_PESTS == TRUE +BerryTree_EventScript_CheckForPests:: + specialvar VAR_RESULT, ObjectEventInteractionBerryHasPests + call_if_eq VAR_RESULT, TRUE, BerryTree_EventScript_EncounterPests + return + +BerryTree_EventScript_EncounterPests:: + message BerryTree_Text_APokemonAppeared + waitmessage + waitbuttonpress + dowildbattle + return + +BerryTree_Text_APokemonAppeared: + .string "A Pokémon appeared!$" +.endif diff --git a/data/scripts/debug.inc b/data/scripts/debug.inc index 4d14a2a2a6..4c74fc1cbd 100644 --- a/data/scripts/debug.inc +++ b/data/scripts/debug.inc @@ -215,6 +215,24 @@ Debug_ShowExpansionVersion:: Debug_ExpansionVersion: .string "pokeemerald-expansion {STR_VAR_1}$" +Debug_BerryPestsDisabled:: + msgbox DebugText_BerryPestsDisabled, MSGBOX_DEFAULT + release + end + +DebugText_BerryPestsDisabled: + .string "OW_BERRY_PESTS is disabled.\n" + .string "Unable to force pests onto berry trees.$" + +Debug_BerryWeedsDisabled:: + msgbox DebugText_BerryWeedsDisabled, MSGBOX_DEFAULT + release + end + +DebugText_BerryWeedsDisabled: + .string "OW_BERRY_WEEDS is disabled.\n" + .string "Unable to force weeds onto berry trees.$" + .endif Debug_FlagsAndVarNotSetBattleConfigMessage:: diff --git a/data/specials.inc b/data/specials.inc index 152210c176..d5e659e1f9 100644 --- a/data/specials.inc +++ b/data/specials.inc @@ -542,3 +542,11 @@ gSpecials:: def_special TrySkyBattle def_special VsSeekerResetObjectMovementAfterChargeComplete def_special VsSeekerFreezeObjectsAfterChargeComplete + def_special PlayerHasMulch + def_special Bag_ChooseMulch + def_special ObjectEventInteractionApplyMulch + def_special ObjectEventInteractionPullBerryWeed + def_special ObjectEventInteractionClearBerryPests + def_special ObjectEventInteractionBerryHasWeed + def_special ObjectEventInteractionBerryHasPests + def_special CanWaterBerryPlot diff --git a/include/berry.h b/include/berry.h index 22b9158ee2..ba1bbb1d12 100644 --- a/include/berry.h +++ b/include/berry.h @@ -1,7 +1,6 @@ #ifndef GUARD_BERRY_H #define GUARD_BERRY_H -void ClearEnigmaBerries(void); void SetEnigmaBerry(u8 *src); bool32 IsEnigmaBerryValid(void); const struct Berry *GetBerryInfo(u8 berry); @@ -19,12 +18,15 @@ u8 ItemIdToBerryType(u16 item); void GetBerryNameByBerryType(u8 berry, u8 *string); void ResetBerryTreeSparkleFlag(u8 id); void Bag_ChooseBerry(void); +void Bag_ChooseMulch(void); void ObjectEventInteractionGetBerryTreeData(void); void ObjectEventInteractionPlantBerryTree(void); void ObjectEventInteractionPickBerryTree(void); void ObjectEventInteractionRemoveBerryTree(void); +void ObjectEventInteractionApplyMulch(void); bool8 PlayerHasBerries(void); void SetBerryTreesSeen(void); +bool32 BerryTreeGrow(struct BerryTree *tree); extern const struct Berry gBerries[]; diff --git a/include/config/overworld.h b/include/config/overworld.h index 513eb36723..c19ceeac7b 100644 --- a/include/config/overworld.h +++ b/include/config/overworld.h @@ -13,6 +13,23 @@ #define OW_PC_JAPAN_WALDA_ICONS TRUE // In the US release of Emerald, the Cross, Bolt, and Plusle icons for Walda's wallpapers were left blank from the Japan release. Setting this to TRUE will restore them. #define OW_PC_HEAL GEN_LATEST // In Gen8+, Pokémon are not healed when deposited in the PC. +// Berry settings +// These generational defines only make a distinction for Berries! +#define GEN_6_XY GEN_6 +#define GEN_6_ORAS GEN_LATEST + 1 + +#define OW_BERRY_MUTATIONS FALSE // If enabled, Berry plants can mutate based on berries planted next to them. +#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_ALWAYS_WATERABLE FALSE // If OW_BERRY_MOISTURE is enabled, this setting allows the player to continuously water soil; dry soil will cause a decrease in Berry Yield (like Gen4). When off, soil can only be watered when dry and watering increases yield (like Gen6). +#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. Without OW_BERRY_MOISTURE, weeding bonuses are rounded down. +#define OW_BERRY_PESTS FALSE // If enabled, pests may approach Berry plants that the player needs to take care of. Without OW_BERRY_MOISTURE, pest bonuses are rounded down. +#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. + +#define OW_BERRY_GROWTH_RATE GEN_3 // Presets for how long each Berry plant takes to grow. +#define OW_BERRY_YIELD_RATE GEN_3 // Presets for how many Berries each plant can yield. +#define OW_BERRY_DRAIN_RATE GEN_6_ORAS // If OW_BERRY_MOISTURE is enabled, this setting changes how fast the soil dries out. GEN_4 uses a Berry-dependent drain rate, GEN_6_XY dries out in 24 hours (4 hours with the relevant Mulch) and GEN_6_ORAS dries out in 4 hours. Other values are illegal. + // 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. #define OW_COMPOUND_EYES GEN_LATEST // Prior to Gen9, if a Pokémon with Compound Eyes is leading the party, the wild held item rate is increased to 60%/20%. diff --git a/include/constants/berry.h b/include/constants/berry.h index 3ba59c0f5e..bc86f44ce6 100644 --- a/include/constants/berry.h +++ b/include/constants/berry.h @@ -10,6 +10,13 @@ #define BERRY_FIRMNESS_VERY_HARD 4 #define BERRY_FIRMNESS_SUPER_HARD 5 +#define BERRY_COLOR_RED 0 +#define BERRY_COLOR_BLUE 1 +#define BERRY_COLOR_PURPLE 2 +#define BERRY_COLOR_GREEN 3 +#define BERRY_COLOR_YELLOW 4 +#define BERRY_COLOR_PINK 5 + #define FLAVOR_SPICY 0 #define FLAVOR_DRY 1 #define FLAVOR_SWEET 2 @@ -23,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: diff --git a/include/constants/items.h b/include/constants/items.h index 0be82dcb5f..63ea57dff5 100644 --- a/include/constants/items.h +++ b/include/constants/items.h @@ -1017,6 +1017,7 @@ #define ITEM_TO_BERRY(itemId)(((itemId) - FIRST_BERRY_INDEX) + 1) #define ITEM_TO_MAIL(itemId)((itemId) - FIRST_MAIL_INDEX) #define MAIL_NONE 0xFF +#define ITEM_TO_MULCH(itemId)(((itemId) - ITEM_GROWTH_MULCH) + 1) #define NUM_TECHNICAL_MACHINES 100 #define NUM_HIDDEN_MACHINES 8 diff --git a/include/constants/script_menu.h b/include/constants/script_menu.h index e9dc39d058..73b972afa8 100644 --- a/include/constants/script_menu.h +++ b/include/constants/script_menu.h @@ -122,6 +122,7 @@ #define MULTI_SLATEPORT_TENT_RULES 111 #define MULTI_FALLARBOR_TENT_RULES 112 #define MULTI_TAG_MATCH_TYPE 113 +#define MULTI_BERRY_PLOT 114 // Lilycove SS Tidal Multichoice Selections #define SSTIDAL_SELECTION_SLATEPORT 0 diff --git a/include/event_object_movement.h b/include/event_object_movement.h index b48522ebc8..276c4340de 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -94,7 +94,6 @@ extern const struct OamData gObjectEventBaseOam_32x32; extern const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[]; extern const u8 gReflectionEffectPaletteMap[]; -extern const u8 *const gBerryTreeObjectEventGraphicsIdTablePointers[]; extern const struct SpriteFrameImage *const gBerryTreePicTablePointers[]; extern const u8 *const gBerryTreePaletteSlotTablePointers[]; diff --git a/include/global.berry.h b/include/global.berry.h index 29f1cfe14a..a8a76c089e 100644 --- a/include/global.berry.h +++ b/include/global.berry.h @@ -7,19 +7,24 @@ struct Berry { const u8 name[BERRY_NAME_LENGTH + 1]; - u8 firmness; - u16 size; + u8 firmness:4; + u8 color:4; + u16 size:10; + u16 weedsBonus:3; + u16 pestsBonus:3; u8 maxYield; - u8 minYield; + u8 minYield:4; + u8 waterBonus:4; const u8 *description1; const u8 *description2; - u8 stageDuration; + u8 growthDuration; u8 spicy; u8 dry; u8 sweet; u8 bitter; u8 sour; u8 smoothness; + u8 drainRate; }; // with no const fields @@ -27,20 +32,24 @@ struct Berry struct Berry2 { u8 name[BERRY_NAME_LENGTH + 1]; - u8 firmness; - u16 size; + u8 firmness:4; + u8 color:4; + u16 size:10; + u16 weedsBonus:3; + u16 pestsBonus:3; u8 maxYield; - u8 minYield; + u8 minYield:4; + u8 waterBonus:4; u8 *description1; u8 *description2; - u8 stageDuration; + u8 growthDuration; u8 spicy; u8 dry; u8 sweet; u8 bitter; u8 sour; u8 smoothness; - //u8 padding; + u8 drainRate; }; struct EnigmaBerry @@ -62,16 +71,21 @@ struct BattleEnigmaBerry struct BerryTree { - u8 berry; - u8 stage:7; + u8 berry:7; + u8 weeds:1; + u8 stage:3; + u8 mulch:4; u8 stopGrowth:1; - u16 minutesUntilNextStage; - u8 berryYield; + u16 minutesUntilNextStage:14; + u16 mutationA:2; + u8 berryYield:5; + u8 pests:1; + u8 mutationB:2; u8 regrowthCount:4; - u8 watered1:1; - u8 watered2:1; - u8 watered3:1; - u8 watered4:1; + u8 watered:4; // Used to keep track of bonuses in case of gradient watering + u16 moistureLevel:7; + u16 moistureClock:7; + u16 padding:2; }; #endif // GUARD_GLOBAL_BERRY_H diff --git a/include/item_menu.h b/include/item_menu.h index d4ae5a4c5f..75912eca62 100644 --- a/include/item_menu.h +++ b/include/item_menu.h @@ -17,6 +17,7 @@ enum { ITEMMENULOCATION_APPRENTICE, ITEMMENULOCATION_WALLY, ITEMMENULOCATION_PCBOX, + ITEMMENULOCATION_BERRY_TREE_MULCH, ITEMMENULOCATION_LAST, }; @@ -101,6 +102,7 @@ void DoWallyTutorialBagMenu(void); void ResetBagScrollPositions(void); void ChooseBerryForMachine(void (*exitCallback)(void)); void CB2_ChooseBerry(void); +void CB2_ChooseMulch(void); void Task_FadeAndCloseBagMenu(u8 taskId); void BagMenu_YesNo(u8 taskId, u8 windowType, const struct YesNoFuncTable* funcTable); void UpdatePocketItemList(u8 pocketId); diff --git a/include/item_use.h b/include/item_use.h index a5fe1ee97f..c5a21862fd 100644 --- a/include/item_use.h +++ b/include/item_use.h @@ -46,6 +46,7 @@ u8 CanUseDigOrEscapeRopeOnCurMap(void); u8 CheckIfItemIsTMHMOrEvolutionStone(u16 itemId); void FieldUseFunc_VsSeeker(u8 taskId); void Task_ItemUse_CloseMessageBoxAndReturnToField_VsSeeker(u8 taskId); +void DisplayDadsAdviceCannotUseItemMessage(u8 taskId, bool8 isUsingRegisteredKeyItemOnField); enum { BALL_THROW_UNABLE_TWO_MONS, diff --git a/include/strings.h b/include/strings.h index 589c2b4646..bb4c3f9de2 100644 --- a/include/strings.h +++ b/include/strings.h @@ -3055,4 +3055,7 @@ extern const u8 gText_ExpShareOff[]; extern const u8 gText_BasePointsResetToZero[]; +extern const u8 gText_Fertilize[]; +extern const u8 gText_PlantBerry[]; + #endif // GUARD_STRINGS_H diff --git a/src/berry.c b/src/berry.c index 88a5d0f9f3..a73c9ddf12 100644 --- a/src/berry.c +++ b/src/berry.c @@ -9,13 +9,13 @@ #include "item_menu.h" #include "main.h" #include "random.h" +#include "script_pokemon_util.h" #include "string_util.h" #include "text.h" #include "constants/event_object_movement.h" #include "constants/items.h" static u32 GetEnigmaBerryChecksum(struct EnigmaBerry *enigmaBerry); -static bool32 BerryTreeGrow(struct BerryTree *tree); static u16 BerryTypeToItemId(u16 berry); static u8 BerryTreeGetNumStagesWatered(struct BerryTree *tree); static u8 GetNumStagesWateredByBerryTreeId(u8 id); @@ -23,142 +23,34 @@ static u8 CalcBerryYieldInternal(u16 max, u16 min, u8 water); static u8 CalcBerryYield(struct BerryTree *tree); static u8 GetBerryCountByBerryTreeId(u8 id); static u16 GetStageDurationByBerryType(u8); +static u8 GetDrainRateByBerryType(u8); +static u8 GetWaterBonusByBerryType(u8); +static u8 GetWeedingBonusByBerryType(u8); +static u8 GetPestsBonusByBerryType(u8); +static void SetTreeMutations(u8 id, u8 berry); +static u8 GetTreeMutationValue(u8 id); +static u16 GetBerryPestSpecies(u8 berryId); +static void TryForWeeds(struct BerryTree *tree); +static void TryForPests(struct BerryTree *tree); +static void AddTreeBonus(struct BerryTree *tree, u8 bonus); -//.rodata -static const u8 sBerryDescriptionPart1_Cheri[] = _("Blooms with delicate pretty flowers."); -static const u8 sBerryDescriptionPart2_Cheri[] = _("The bright red Berry is very spicy."); -static const u8 sBerryDescriptionPart1_Chesto[] = _("The Berry's thick skin and fruit are"); -static const u8 sBerryDescriptionPart2_Chesto[] = _("very tough. It is dry-tasting all over."); -static const u8 sBerryDescriptionPart1_Pecha[] = _("Very sweet and delicious."); -static const u8 sBerryDescriptionPart2_Pecha[] = _("Also very tender - handle with care."); -static const u8 sBerryDescriptionPart1_Rawst[] = _("If the leaves grow long and curly,"); -static const u8 sBerryDescriptionPart2_Rawst[] = _("the Berry seems to grow very bitter."); -static const u8 sBerryDescriptionPart1_Aspear[] = _("The hard Berry is dense with a rich"); -static const u8 sBerryDescriptionPart2_Aspear[] = _("juice. It is quite sour."); -static const u8 sBerryDescriptionPart1_Leppa[] = _("Grows slower than Cheri and others."); -static const u8 sBerryDescriptionPart2_Leppa[] = _("The smaller the Berry, the tastier."); -static const u8 sBerryDescriptionPart1_Oran[] = _("A peculiar Berry with a mix of flavors."); -static const u8 sBerryDescriptionPart2_Oran[] = _("Berries grow in half a day."); -static const u8 sBerryDescriptionPart1_Persim[] = _("Loves sunlight. The Berry's color"); -static const u8 sBerryDescriptionPart2_Persim[] = _("grows vivid when exposed to the sun."); -static const u8 sBerryDescriptionPart1_Lum[] = _("Slow to grow. If raised with loving"); -static const u8 sBerryDescriptionPart2_Lum[] = _("care, it may grow two Berries."); -static const u8 sBerryDescriptionPart1_Sitrus[] = _("Closely related to Oran. The large"); -static const u8 sBerryDescriptionPart2_Sitrus[] = _("Berry has a well-rounded flavor."); -static const u8 sBerryDescriptionPart1_Figy[] = _("The Berry, which looks chewed up,"); -static const u8 sBerryDescriptionPart2_Figy[] = _("brims with spicy substances."); -static const u8 sBerryDescriptionPart1_Wiki[] = _("The Berry is said to have grown lumpy"); -static const u8 sBerryDescriptionPart2_Wiki[] = _("to help Pokémon grip it."); -static const u8 sBerryDescriptionPart1_Mago[] = _("The Berry turns curvy as it grows."); -static const u8 sBerryDescriptionPart2_Mago[] = _("The curvier, the sweeter and tastier."); -static const u8 sBerryDescriptionPart1_Aguav[] = _("The flower is dainty. It is rare in its"); -static const u8 sBerryDescriptionPart2_Aguav[] = _("ability to grow without light."); -static const u8 sBerryDescriptionPart1_Iapapa[] = _("The Berry is very big and sour."); -static const u8 sBerryDescriptionPart2_Iapapa[] = _("It takes at least a day to grow."); -static const u8 sBerryDescriptionPart1_Razz[] = _("The red Berry tastes slightly spicy."); -static const u8 sBerryDescriptionPart2_Razz[] = _("It grows quickly in just four hours."); -static const u8 sBerryDescriptionPart1_Bluk[] = _("The Berry is blue on the outside, but"); -static const u8 sBerryDescriptionPart2_Bluk[] = _("it blackens the mouth when eaten."); -static const u8 sBerryDescriptionPart1_Nanab[] = _("This Berry was the seventh"); -static const u8 sBerryDescriptionPart2_Nanab[] = _("discovered in the world. It is sweet."); -static const u8 sBerryDescriptionPart1_Wepear[] = _("The flower is small and white. It has a"); -static const u8 sBerryDescriptionPart2_Wepear[] = _("delicate balance of bitter and sour."); -static const u8 sBerryDescriptionPart1_Pinap[] = _("Weak against wind and cold."); -static const u8 sBerryDescriptionPart2_Pinap[] = _("The fruit is spicy and the skin, sour."); -static const u8 sBerryDescriptionPart1_Pomeg[] = _("However much it is watered,"); -static const u8 sBerryDescriptionPart2_Pomeg[] = _("it only grows up to six Berries."); -static const u8 sBerryDescriptionPart1_Kelpsy[] = _("A rare variety shaped like a root."); -static const u8 sBerryDescriptionPart2_Kelpsy[] = _("Grows a very large flower."); -static const u8 sBerryDescriptionPart1_Qualot[] = _("Loves water. Grows strong even in"); -static const u8 sBerryDescriptionPart2_Qualot[] = _("locations with constant rainfall."); -static const u8 sBerryDescriptionPart1_Hondew[] = _("A Berry that is very valuable and"); -static const u8 sBerryDescriptionPart2_Hondew[] = _("rarely seen. It is very delicious."); -static const u8 sBerryDescriptionPart1_Grepa[] = _("Despite its tenderness and round"); -static const u8 sBerryDescriptionPart2_Grepa[] = _("shape, the Berry is unimaginably sour."); -static const u8 sBerryDescriptionPart1_Tamato[] = _("The Berry is lip-bendingly spicy."); -static const u8 sBerryDescriptionPart2_Tamato[] = _("It takes time to grow."); -static const u8 sBerryDescriptionPart1_Cornn[] = _("A Berry from an ancient era. May not"); -static const u8 sBerryDescriptionPart2_Cornn[] = _("grow unless planted in quantity."); -static const u8 sBerryDescriptionPart1_Magost[] = _("A Berry that is widely said to have"); -static const u8 sBerryDescriptionPart2_Magost[] = _("a finely balanced flavor."); -static const u8 sBerryDescriptionPart1_Rabuta[] = _("A rare variety that is overgrown with"); -static const u8 sBerryDescriptionPart2_Rabuta[] = _("hair. It is quite bitter."); -static const u8 sBerryDescriptionPart1_Nomel[] = _("Quite sour. Just one bite makes it"); -static const u8 sBerryDescriptionPart2_Nomel[] = _("impossible to taste for three days."); -static const u8 sBerryDescriptionPart1_Spelon[] = _("The vividly red Berry is very spicy."); -static const u8 sBerryDescriptionPart2_Spelon[] = _("Its warts secrete a spicy substance."); -static const u8 sBerryDescriptionPart1_Pamtre[] = _("Drifts on the sea from somewhere."); -static const u8 sBerryDescriptionPart2_Pamtre[] = _("It is thought to grow elsewhere."); -static const u8 sBerryDescriptionPart1_Watmel[] = _("A huge Berry, with some over 20"); -static const u8 sBerryDescriptionPart2_Watmel[] = _("inches discovered. Exceedingly sweet."); -static const u8 sBerryDescriptionPart1_Durin[] = _("Bitter to even look at. It is so"); -static const u8 sBerryDescriptionPart2_Durin[] = _("bitter, no one has ever eaten it as is."); -static const u8 sBerryDescriptionPart1_Belue[] = _("It is glossy and looks delicious, but"); -static const u8 sBerryDescriptionPart2_Belue[] = _("it is awfully sour. Takes time to grow."); -static const u8 sBerryDescriptionPart1_Chilan[] = _("It can be made into a whistle that"); -static const u8 sBerryDescriptionPart2_Chilan[] = _("produces an indescribable sound."); -static const u8 sBerryDescriptionPart1_Occa[] = _("Said to grow in the tropics once,"); -static const u8 sBerryDescriptionPart2_Occa[] = _("it boasts an intensely hot spiciness."); -static const u8 sBerryDescriptionPart1_Passho[] = _("Its flesh is dotted with many tiny"); -static const u8 sBerryDescriptionPart2_Passho[] = _("bubbles that keep it afloat in water."); -static const u8 sBerryDescriptionPart1_Wacan[] = _("Energy drawn from lightning strikes"); -static const u8 sBerryDescriptionPart2_Wacan[] = _("makes this Berry grow big and rich."); -static const u8 sBerryDescriptionPart1_Rindo[] = _("This berry has a vegetable-like flavor,"); -static const u8 sBerryDescriptionPart2_Rindo[] = _("but is rich in health-promoting fiber."); -static const u8 sBerryDescriptionPart1_Yache[] = _("This Berry has a refreshing dry and"); -static const u8 sBerryDescriptionPart2_Yache[] = _("sour flavor. Tastes better chilled."); -static const u8 sBerryDescriptionPart1_Chople[] = _("Contains a substance that generates"); -static const u8 sBerryDescriptionPart2_Chople[] = _("heat. Can even fire up a chilly heart."); -static const u8 sBerryDescriptionPart1_Kebia[] = _("Brilliant green on the outside, inside"); -static const u8 sBerryDescriptionPart2_Kebia[] = _("it is packed with black-colored flesh."); -static const u8 sBerryDescriptionPart1_Shuca[] = _("The sweet pulp has just the hint of a"); -static const u8 sBerryDescriptionPart2_Shuca[] = _("a hard-edged and fragrant bite to it."); -static const u8 sBerryDescriptionPart1_Coba[] = _("This Berry is said to be a cross of"); -static const u8 sBerryDescriptionPart2_Coba[] = _("two Berries blown in from far away."); -static const u8 sBerryDescriptionPart1_Payapa[] = _("Said to sense human emotions, it swells"); -static const u8 sBerryDescriptionPart2_Payapa[] = _("roundly when a person approaches."); -static const u8 sBerryDescriptionPart1_Tanga[] = _("It grows a flower at the tip that lures"); -static const u8 sBerryDescriptionPart2_Tanga[] = _("Bug Pokémon with its stringy petals."); -static const u8 sBerryDescriptionPart1_Charti[] = _("Often used for pickles because of its"); -static const u8 sBerryDescriptionPart2_Charti[] = _("dry flavor. Sometimes eaten raw."); -static const u8 sBerryDescriptionPart1_Kasib[] = _("Old superstitions say it has an odd"); -static const u8 sBerryDescriptionPart2_Kasib[] = _("power. A popular good-luck charm."); -static const u8 sBerryDescriptionPart1_Haban[] = _("Less bitter if enough of this Berry"); -static const u8 sBerryDescriptionPart2_Haban[] = _("is boiled down. Makes a good jam."); -static const u8 sBerryDescriptionPart1_Colbur[] = _("Tiny hooks on the surface latch onto"); -static const u8 sBerryDescriptionPart2_Colbur[] = _("Pokémon to reach far-off places."); -static const u8 sBerryDescriptionPart1_Babiri[] = _("Very tough with a strong flavor. It"); -static const u8 sBerryDescriptionPart2_Babiri[] = _("was used to make medicine in the past."); -static const u8 sBerryDescriptionPart1_Roseli[] = _("In nature, they grow in wide rings"); -static const u8 sBerryDescriptionPart2_Roseli[] = _("for reasons that are still unknown."); -static const u8 sBerryDescriptionPart1_Liechi[] = _("A mysterious Berry. It is rumored to"); -static const u8 sBerryDescriptionPart2_Liechi[] = _("contain the power of the sea."); -static const u8 sBerryDescriptionPart1_Ganlon[] = _("A mysterious Berry. It is rumored to"); -static const u8 sBerryDescriptionPart2_Ganlon[] = _("contain the power of the land."); -static const u8 sBerryDescriptionPart1_Salac[] = _("A mysterious Berry. It is rumored to"); -static const u8 sBerryDescriptionPart2_Salac[] = _("contain the power of the sky."); -static const u8 sBerryDescriptionPart1_Petaya[] = _("A mysterious Berry. It is rumored to"); -static const u8 sBerryDescriptionPart2_Petaya[] = _("contain the power of all living things."); -static const u8 sBerryDescriptionPart1_Apicot[] = _("A very mystifying Berry. No telling"); -static const u8 sBerryDescriptionPart2_Apicot[] = _("what may happen or how it can be used."); -static const u8 sBerryDescriptionPart1_Lansat[] = _("Said to be a legendary Berry."); -static const u8 sBerryDescriptionPart2_Lansat[] = _("Holding it supposedly brings joy."); -static const u8 sBerryDescriptionPart1_Starf[] = _("So strong, it was abandoned at the"); -static const u8 sBerryDescriptionPart2_Starf[] = _("world's edge. Considered a mirage."); -static const u8 sBerryDescriptionPart1_Enigma[] = _("A completely enigmatic Berry."); -static const u8 sBerryDescriptionPart2_Enigma[] = _("Appears to have the power of stars."); -static const u8 sBerryDescriptionPart1_Micle[] = _("It makes other food eaten at the"); -static const u8 sBerryDescriptionPart2_Micle[] = _("same time taste sweet."); -static const u8 sBerryDescriptionPart1_Custap[] = _("The flesh underneath the Custap"); -static const u8 sBerryDescriptionPart2_Custap[] = _("Berry's skin is sweet and creamy soft."); -static const u8 sBerryDescriptionPart1_Jaboca[] = _("The drupelets that make up this berry"); -static const u8 sBerryDescriptionPart2_Jaboca[] = _("pop rythmically if handled roughly."); -static const u8 sBerryDescriptionPart1_Rowap[] = _("People once worked top-shaped pieces"); -static const u8 sBerryDescriptionPart2_Rowap[] = _("of this berry free to use as toys."); -static const u8 sBerryDescriptionPart1_Kee[] = _("A berry that is incredibly spicy at"); -static const u8 sBerryDescriptionPart2_Kee[] = _("first, then extremely bitter."); -static const u8 sBerryDescriptionPart1_Maranga[] = _("Its outside is very bitter, but its"); -static const u8 sBerryDescriptionPart2_Maranga[] = _("inside tastes like a sweet drink."); +// Check include/config/overworld.h configs and throw an error if illegal +#if OW_BERRY_GROWTH_RATE < GEN_3 || (OW_BERRY_GROWTH_RATE > GEN_7 && OW_BERRY_GROWTH_RATE != GEN_6_ORAS) +#error "OW_BERRY_GROWTH_RATE must be between GEN_3 and GEN_7!" +#endif + +#if OW_BERRY_YIELD_RATE < GEN_3 || (OW_BERRY_YIELD_RATE > GEN_6 && OW_BERRY_GROWTH_RATE != GEN_6_ORAS) +#error "OW_BERRY_YIELD_RATE must be between GEN_3 and GEN_6!" +#elif OW_BERRY_YIELD_RATE == GEN_5 +#error "OW_BERRY_YIELD_RATE can not be GEN_5!" +#endif + +#if OW_BERRY_MOISTURE && OW_BERRY_DRAIN_RATE != GEN_4 && OW_BERRY_DRAIN_RATE != GEN_6_XY && OW_BERRY_DRAIN_RATE != GEN_6_ORAS +#error "OW_BERRY_DRAIN_RATE must be GEN_5, GEN_6_XY or GEN_6_ORAS!" +#endif + +#define GROWTH_DURATION(g3, g4, g5, xy, oras, g7) OW_BERRY_GROWTH_RATE == GEN_3 ? g3 : OW_BERRY_GROWTH_RATE == GEN_4 ? g4 : OW_BERRY_GROWTH_RATE == GEN_5 ? g5 : OW_BERRY_GROWTH_RATE == GEN_6_XY ? xy : OW_BERRY_GROWTH_RATE == GEN_6_ORAS ? oras : g7 +#define YIELD_RATE(g3, g4, xy, oras) GROWTH_DURATION(g3, g4, 0, xy, oras, 0) const struct Berry gBerries[] = { @@ -166,1224 +58,1564 @@ const struct Berry gBerries[] = { .name = _("Cheri"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_RED, .size = 20, - .maxYield = 3, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Cheri, - .description2 = sBerryDescriptionPart2_Cheri, - .stageDuration = 3, + .maxYield = YIELD_RATE(3, 5, 15, 20), + .minYield = YIELD_RATE(2, 2, 4, 4), + .description1 = COMPOUND_STRING("Blooms with delicate pretty flowers."), + .description2 = COMPOUND_STRING("The bright red Berry is very spicy."), + .growthDuration = GROWTH_DURATION(12, 12, 18, 24, 16, 24), .spicy = 10, .dry = 0, .sweet = 0, .bitter = 0, .sour = 0, .smoothness = 25, + .drainRate = 15, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_CHESTO_BERRY - FIRST_BERRY_INDEX] = { .name = _("Chesto"), .firmness = BERRY_FIRMNESS_SUPER_HARD, + .color = BERRY_COLOR_PURPLE, .size = 80, - .maxYield = 3, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Chesto, - .description2 = sBerryDescriptionPart2_Chesto, - .stageDuration = 3, + .maxYield = YIELD_RATE(3, 5, 15, 20), + .minYield = YIELD_RATE(2, 2, 4, 4), + .description1 = COMPOUND_STRING("The Berry's thick skin and fruit are"), + .description2 = COMPOUND_STRING("very tough. It is dry-tasting all over."), + .growthDuration = GROWTH_DURATION(12, 12, 18, 24, 16, 24), .spicy = 0, .dry = 10, .sweet = 0, .bitter = 0, .sour = 0, .smoothness = 25, + .drainRate = 15, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_PECHA_BERRY - FIRST_BERRY_INDEX] = { .name = _("Pecha"), .firmness = BERRY_FIRMNESS_VERY_SOFT, + .color = BERRY_COLOR_PINK, .size = 40, - .maxYield = 3, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Pecha, - .description2 = sBerryDescriptionPart2_Pecha, - .stageDuration = 3, + .maxYield = YIELD_RATE(3, 5, 15, 20), + .minYield = YIELD_RATE(2, 2, 4, 4), + .description1 = COMPOUND_STRING("Very sweet and delicious."), + .description2 = COMPOUND_STRING("Also very tender - handle with care."), + .growthDuration = GROWTH_DURATION(12, 12, 18, 24, 16, 24), .spicy = 0, .dry = 0, .sweet = 10, .bitter = 0, .sour = 0, .smoothness = 25, + .drainRate = 15, + .waterBonus = 10, + .weedsBonus = 4, + .pestsBonus = 6, }, [ITEM_RAWST_BERRY - FIRST_BERRY_INDEX] = { .name = _("Rawst"), .firmness = BERRY_FIRMNESS_HARD, + .color = BERRY_COLOR_GREEN, .size = 32, - .maxYield = 3, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Rawst, - .description2 = sBerryDescriptionPart2_Rawst, - .stageDuration = 3, + .maxYield = YIELD_RATE(3, 5, 15, 20), + .minYield = YIELD_RATE(2, 2, 4, 4), + .description1 = COMPOUND_STRING("If the leaves grow long and curly,"), + .description2 = COMPOUND_STRING("the Berry seems to grow very bitter."), + .growthDuration = GROWTH_DURATION(12, 12, 18, 24, 16, 24), .spicy = 0, .dry = 0, .sweet = 0, .bitter = 10, .sour = 0, .smoothness = 25, + .drainRate = 15, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_ASPEAR_BERRY - FIRST_BERRY_INDEX] = { .name = _("Aspear"), .firmness = BERRY_FIRMNESS_SUPER_HARD, + .color = BERRY_COLOR_YELLOW, .size = 50, - .maxYield = 3, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Aspear, - .description2 = sBerryDescriptionPart2_Aspear, - .stageDuration = 3, + .maxYield = YIELD_RATE(3, 5, 15, 20), + .minYield = YIELD_RATE(2, 2, 4, 4), + .description1 = COMPOUND_STRING("The hard Berry is dense with a rich"), + .description2 = COMPOUND_STRING("juice. It is quite sour."), + .growthDuration = GROWTH_DURATION(12, 12, 18, 24, 16, 24), .spicy = 0, .dry = 0, .sweet = 0, .bitter = 0, .sour = 10, .smoothness = 25, + .drainRate = 15, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_LEPPA_BERRY - FIRST_BERRY_INDEX] = { .name = _("Leppa"), .firmness = BERRY_FIRMNESS_VERY_HARD, + .color = BERRY_COLOR_RED, .size = 28, - .maxYield = 3, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Leppa, - .description2 = sBerryDescriptionPart2_Leppa, - .stageDuration = 4, + .maxYield = YIELD_RATE(3, 5, 15, 22), + .minYield = YIELD_RATE(2, 2, 2, 2), + .description1 = COMPOUND_STRING("Grows slower than Cheri and others."), + .description2 = COMPOUND_STRING("The smaller the Berry, the tastier."), + .growthDuration = GROWTH_DURATION(16, 16, 24, 24, 16, 24), .spicy = 10, .dry = 0, .sweet = 10, .bitter = 10, .sour = 10, .smoothness = 20, + .drainRate = 15, + .waterBonus = 15, + .weedsBonus = 3, + .pestsBonus = 6, }, [ITEM_ORAN_BERRY - FIRST_BERRY_INDEX] = { .name = _("Oran"), .firmness = BERRY_FIRMNESS_SUPER_HARD, + .color = BERRY_COLOR_BLUE, .size = 35, - .maxYield = 3, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Oran, - .description2 = sBerryDescriptionPart2_Oran, - .stageDuration = 3, + .maxYield = YIELD_RATE(3, 5, 15, 20), + .minYield = YIELD_RATE(2, 2, 4, 4), + .description1 = COMPOUND_STRING("A peculiar Berry with a mix of flavors."), + .description2 = COMPOUND_STRING("Berries grow in half a day."), + .growthDuration = GROWTH_DURATION(12, 16, 24, 24, 16, 24), .spicy = 10, .dry = 10, .sweet = 10, .bitter = 10, .sour = 10, .smoothness = 20, + .drainRate = 15, + .waterBonus = 10, + .weedsBonus = 4, + .pestsBonus = 6, }, [ITEM_PERSIM_BERRY - FIRST_BERRY_INDEX] = { .name = _("Persim"), .firmness = BERRY_FIRMNESS_HARD, + .color = BERRY_COLOR_PINK, .size = 47, - .maxYield = 3, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Persim, - .description2 = sBerryDescriptionPart2_Persim, - .stageDuration = 3, + .maxYield = YIELD_RATE(3, 5, 15, 20), + .minYield = YIELD_RATE(2, 2, 4, 4), + .description1 = COMPOUND_STRING("Loves sunlight. The Berry's color"), + .description2 = COMPOUND_STRING("grows vivid when exposed to the sun."), + .growthDuration = GROWTH_DURATION(12, 16, 24, 24, 16, 24), .spicy = 10, .dry = 10, .sweet = 10, .bitter = 10, .sour = 10, .smoothness = 20, + .drainRate = 15, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_LUM_BERRY - FIRST_BERRY_INDEX] = { .name = _("Lum"), .firmness = BERRY_FIRMNESS_SUPER_HARD, + .color = BERRY_COLOR_GREEN, .size = 34, - .maxYield = 2, - .minYield = 1, - .description1 = sBerryDescriptionPart1_Lum, - .description2 = sBerryDescriptionPart2_Lum, - .stageDuration = 12, + .maxYield = YIELD_RATE(2, 5, 20, 18), + .minYield = YIELD_RATE(1, 2, 3, 2), + .description1 = COMPOUND_STRING("Slow to grow. If raised with loving"), + .description2 = COMPOUND_STRING("care, it may grow two Berries."), + .growthDuration = GROWTH_DURATION(48, 48, 72, 48, 32, 48), .spicy = 10, .dry = 10, .sweet = 10, .bitter = 10, .sour = 10, .smoothness = 20, + .drainRate = 8, + .waterBonus = 12, + .weedsBonus = 1, + .pestsBonus = 6, }, [ITEM_SITRUS_BERRY - FIRST_BERRY_INDEX] = { .name = _("Sitrus"), .firmness = BERRY_FIRMNESS_VERY_HARD, + .color = BERRY_COLOR_YELLOW, .size = 95, - .maxYield = 3, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Sitrus, - .description2 = sBerryDescriptionPart2_Sitrus, - .stageDuration = 6, + .maxYield = YIELD_RATE(3, 5, 20, 27), + .minYield = YIELD_RATE(2, 2, 3, 3), + .description1 = COMPOUND_STRING("Closely related to Oran. The large"), + .description2 = COMPOUND_STRING("Berry has a well-rounded flavor."), + .growthDuration = GROWTH_DURATION(24, 32, 48, 48, 32, 48), .spicy = 10, .dry = 10, .sweet = 10, .bitter = 10, .sour = 10, .smoothness = 20, + .drainRate = 7, + .waterBonus = 12, + .weedsBonus = 1, + .pestsBonus = 6, }, [ITEM_FIGY_BERRY - FIRST_BERRY_INDEX] = { .name = _("Figy"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_RED, .size = 100, - .maxYield = 3, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Figy, - .description2 = sBerryDescriptionPart2_Figy, - .stageDuration = 6, + .maxYield = YIELD_RATE(3, 5, 15, 15), + .minYield = YIELD_RATE(2, 1, 3, 3), + .description1 = COMPOUND_STRING("The Berry, which looks chewed up,"), + .description2 = COMPOUND_STRING("brims with spicy substances."), + .growthDuration = GROWTH_DURATION(24, 20, 30, 24, 16, 24), .spicy = 10, .dry = 0, .sweet = 0, .bitter = 0, .sour = 0, .smoothness = 25, + .drainRate = 10, + .waterBonus = 15, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_WIKI_BERRY - FIRST_BERRY_INDEX] = { .name = _("Wiki"), .firmness = BERRY_FIRMNESS_HARD, + .color = BERRY_COLOR_PURPLE, .size = 115, - .maxYield = 3, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Wiki, - .description2 = sBerryDescriptionPart2_Wiki, - .stageDuration = 6, + .maxYield = YIELD_RATE(3, 5, 15, 15), + .minYield = YIELD_RATE(2, 1, 3, 3), + .description1 = COMPOUND_STRING("The Berry is said to have grown lumpy"), + .description2 = COMPOUND_STRING("to help Pokémon grip it."), + .growthDuration = GROWTH_DURATION(24, 20, 30, 24, 16, 24), .spicy = 0, .dry = 10, .sweet = 0, .bitter = 0, .sour = 0, .smoothness = 25, + .drainRate = 10, + .waterBonus = 15, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_MAGO_BERRY - FIRST_BERRY_INDEX] = { .name = _("Mago"), .firmness = BERRY_FIRMNESS_HARD, + .color = BERRY_COLOR_PINK, .size = 126, - .maxYield = 3, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Mago, - .description2 = sBerryDescriptionPart2_Mago, - .stageDuration = 6, + .maxYield = YIELD_RATE(3, 5, 15, 15), + .minYield = YIELD_RATE(2, 1, 3, 3), + .description1 = COMPOUND_STRING("The Berry turns curvy as it grows."), + .description2 = COMPOUND_STRING("The curvier, the sweeter and tastier."), + .growthDuration = GROWTH_DURATION(24, 20, 30, 24, 16, 24), .spicy = 0, .dry = 0, .sweet = 10, .bitter = 0, .sour = 0, .smoothness = 25, + .drainRate = 10, + .waterBonus = 15, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_AGUAV_BERRY - FIRST_BERRY_INDEX] = { .name = _("Aguav"), .firmness = BERRY_FIRMNESS_SUPER_HARD, + .color = BERRY_COLOR_GREEN, .size = 64, - .maxYield = 3, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Aguav, - .description2 = sBerryDescriptionPart2_Aguav, - .stageDuration = 6, + .maxYield = YIELD_RATE(3, 5, 15, 15), + .minYield = YIELD_RATE(2, 1, 3, 3), + .description1 = COMPOUND_STRING("The flower is dainty. It is rare in its"), + .description2 = COMPOUND_STRING("ability to grow without light."), + .growthDuration = GROWTH_DURATION(24, 20, 30, 24, 16, 24), .spicy = 0, .dry = 0, .sweet = 0, .bitter = 10, .sour = 0, .smoothness = 25, + .drainRate = 10, + .waterBonus = 15, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_IAPAPA_BERRY - FIRST_BERRY_INDEX] = { .name = _("Iapapa"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_YELLOW, .size = 223, - .maxYield = 3, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Iapapa, - .description2 = sBerryDescriptionPart2_Iapapa, - .stageDuration = 6, + .maxYield = YIELD_RATE(3, 5, 15, 15), + .minYield = YIELD_RATE(2, 1, 3, 3), + .description1 = COMPOUND_STRING("The Berry is very big and sour."), + .description2 = COMPOUND_STRING("It takes at least a day to grow."), + .growthDuration = GROWTH_DURATION(24, 20, 30, 24, 16, 24), .spicy = 0, .dry = 0, .sweet = 0, .bitter = 0, .sour = 10, .smoothness = 25, + .drainRate = 10, + .waterBonus = 15, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_RAZZ_BERRY - FIRST_BERRY_INDEX] = { .name = _("Razz"), .firmness = BERRY_FIRMNESS_VERY_HARD, + .color = BERRY_COLOR_RED, .size = 120, - .maxYield = 6, - .minYield = 3, - .description1 = sBerryDescriptionPart1_Razz, - .description2 = sBerryDescriptionPart2_Razz, - .stageDuration = 1, + .maxYield = YIELD_RATE(6, 10, 15, 20), + .minYield = YIELD_RATE(3, 2, 3, 4), + .description1 = COMPOUND_STRING("The red Berry tastes slightly spicy."), + .description2 = COMPOUND_STRING("It grows quickly in just four hours."), + .growthDuration = GROWTH_DURATION(4, 8, 12, 24, 16, 24), .spicy = 10, .dry = 10, .sweet = 0, .bitter = 0, .sour = 0, .smoothness = 20, + .drainRate = 35, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_BLUK_BERRY - FIRST_BERRY_INDEX] = { .name = _("Bluk"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_PURPLE, .size = 108, - .maxYield = 6, - .minYield = 3, - .description1 = sBerryDescriptionPart1_Bluk, - .description2 = sBerryDescriptionPart2_Bluk, - .stageDuration = 1, + .maxYield = YIELD_RATE(6, 10, 15, 20), + .minYield = YIELD_RATE(3, 2, 3, 4), + .description1 = COMPOUND_STRING("The Berry is blue on the outside, but"), + .description2 = COMPOUND_STRING("it blackens the mouth when eaten."), + .growthDuration = GROWTH_DURATION(4, 8, 12, 24, 16, 24), .spicy = 0, .dry = 10, .sweet = 10, .bitter = 0, .sour = 0, .smoothness = 20, + .drainRate = 35, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_NANAB_BERRY - FIRST_BERRY_INDEX] = { .name = _("Nanab"), .firmness = BERRY_FIRMNESS_VERY_HARD, + .color = BERRY_COLOR_PINK, .size = 77, - .maxYield = 6, - .minYield = 3, - .description1 = sBerryDescriptionPart1_Nanab, - .description2 = sBerryDescriptionPart2_Nanab, - .stageDuration = 1, + .maxYield = YIELD_RATE(6, 10, 15, 20), + .minYield = YIELD_RATE(3, 2, 3, 4), + .description1 = COMPOUND_STRING("This Berry was the seventh"), + .description2 = COMPOUND_STRING("discovered in the world. It is sweet."), + .growthDuration = GROWTH_DURATION(4, 8, 12, 24, 16, 24), .spicy = 0, .dry = 0, .sweet = 10, .bitter = 10, .sour = 0, .smoothness = 20, + .drainRate = 35, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_WEPEAR_BERRY - FIRST_BERRY_INDEX] = { .name = _("Wepear"), .firmness = BERRY_FIRMNESS_SUPER_HARD, + .color = BERRY_COLOR_GREEN, .size = 74, - .maxYield = 6, - .minYield = 3, - .description1 = sBerryDescriptionPart1_Wepear, - .description2 = sBerryDescriptionPart2_Wepear, - .stageDuration = 1, + .maxYield = YIELD_RATE(6, 10, 15, 20), + .minYield = YIELD_RATE(3, 2, 3, 4), + .description1 = COMPOUND_STRING("The flower is small and white. It has a"), + .description2 = COMPOUND_STRING("delicate balance of bitter and sour."), + .growthDuration = GROWTH_DURATION(4, 8, 12, 24, 16, 24), .spicy = 0, .dry = 0, .sweet = 0, .bitter = 10, .sour = 10, .smoothness = 20, + .drainRate = 35, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_PINAP_BERRY - FIRST_BERRY_INDEX] = { .name = _("Pinap"), .firmness = BERRY_FIRMNESS_HARD, + .color = BERRY_COLOR_YELLOW, .size = 80, - .maxYield = 6, - .minYield = 3, - .description1 = sBerryDescriptionPart1_Pinap, - .description2 = sBerryDescriptionPart2_Pinap, - .stageDuration = 1, + .maxYield = YIELD_RATE(6, 10, 15, 20), + .minYield = YIELD_RATE(3, 2, 3, 4), + .description1 = COMPOUND_STRING("Weak against wind and cold."), + .description2 = COMPOUND_STRING("The fruit is spicy and the skin, sour."), + .growthDuration = GROWTH_DURATION(4, 8, 12, 24, 16, 24), .spicy = 10, .dry = 0, .sweet = 0, .bitter = 0, .sour = 10, .smoothness = 20, + .drainRate = 35, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_POMEG_BERRY - FIRST_BERRY_INDEX] = { .name = _("Pomeg"), .firmness = BERRY_FIRMNESS_VERY_HARD, + .color = BERRY_COLOR_RED, .size = 135, - .maxYield = 6, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Pomeg, - .description2 = sBerryDescriptionPart2_Pomeg, - .stageDuration = 3, + .maxYield = YIELD_RATE(6, 5, 20, 26), + .minYield = YIELD_RATE(2, 1, 1, 2), + .description1 = COMPOUND_STRING("However much it is watered,"), + .description2 = COMPOUND_STRING("it only grows up to six Berries."), + .growthDuration = GROWTH_DURATION(12, 32, 48, 48, 32, 48), .spicy = 10, .dry = 0, .sweet = 10, .bitter = 10, .sour = 0, .smoothness = 20, + .drainRate = 8, + .waterBonus = 5, + .weedsBonus = 3, + .pestsBonus = 6, }, [ITEM_KELPSY_BERRY - FIRST_BERRY_INDEX] = { .name = _("Kelpsy"), .firmness = BERRY_FIRMNESS_HARD, + .color = BERRY_COLOR_BLUE, .size = 150, - .maxYield = 6, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Kelpsy, - .description2 = sBerryDescriptionPart2_Kelpsy, - .stageDuration = 3, + .maxYield = YIELD_RATE(6, 5, 20, 26), + .minYield = YIELD_RATE(2, 1, 1, 2), + .description1 = COMPOUND_STRING("A rare variety shaped like a root."), + .description2 = COMPOUND_STRING("Grows a very large flower."), + .growthDuration = GROWTH_DURATION(12, 32, 48, 48, 32, 48), .spicy = 0, .dry = 10, .sweet = 0, .bitter = 10, .sour = 10, .smoothness = 20, + .drainRate = 8, + .waterBonus = 5, + .weedsBonus = 3, + .pestsBonus = 6, }, [ITEM_QUALOT_BERRY - FIRST_BERRY_INDEX] = { .name = _("Qualot"), .firmness = BERRY_FIRMNESS_HARD, + .color = BERRY_COLOR_YELLOW, .size = 110, - .maxYield = 6, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Qualot, - .description2 = sBerryDescriptionPart2_Qualot, - .stageDuration = 3, + .maxYield = YIELD_RATE(6, 5, 20, 26), + .minYield = YIELD_RATE(2, 1, 1, 2), + .description1 = COMPOUND_STRING("Loves water. Grows strong even in"), + .description2 = COMPOUND_STRING("locations with constant rainfall."), + .growthDuration = GROWTH_DURATION(12, 32, 48, 48, 32, 48), .spicy = 10, .dry = 0, .sweet = 10, .bitter = 0, .sour = 10, .smoothness = 20, + .drainRate = 8, + .waterBonus = 5, + .weedsBonus = 3, + .pestsBonus = 6, }, [ITEM_HONDEW_BERRY - FIRST_BERRY_INDEX] = { .name = _("Hondew"), .firmness = BERRY_FIRMNESS_HARD, + .color = BERRY_COLOR_GREEN, .size = 162, - .maxYield = 6, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Hondew, - .description2 = sBerryDescriptionPart2_Hondew, - .stageDuration = 3, + .maxYield = YIELD_RATE(6, 5, 20, 26), + .minYield = YIELD_RATE(2, 1, 1, 2), + .description1 = COMPOUND_STRING("A Berry that is very valuable and"), + .description2 = COMPOUND_STRING("rarely seen. It is very delicious."), + .growthDuration = GROWTH_DURATION(12, 32, 48, 48, 32, 48), .spicy = 10, .dry = 10, .sweet = 0, .bitter = 10, .sour = 0, .smoothness = 20, + .drainRate = 8, + .waterBonus = 5, + .weedsBonus = 3, + .pestsBonus = 6, }, [ITEM_GREPA_BERRY - FIRST_BERRY_INDEX] = { .name = _("Grepa"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_YELLOW, .size = 149, - .maxYield = 6, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Grepa, - .description2 = sBerryDescriptionPart2_Grepa, - .stageDuration = 3, + .maxYield = YIELD_RATE(6, 5, 20, 26), + .minYield = YIELD_RATE(2, 1, 1, 2), + .description1 = COMPOUND_STRING("Despite its tenderness and round"), + .description2 = COMPOUND_STRING("shape, the Berry is unimaginably sour."), + .growthDuration = GROWTH_DURATION(12, 32, 48, 48, 32, 48), .spicy = 0, .dry = 10, .sweet = 10, .bitter = 0, .sour = 10, .smoothness = 20, + .drainRate = 8, + .waterBonus = 5, + .weedsBonus = 3, + .pestsBonus = 6, }, [ITEM_TAMATO_BERRY - FIRST_BERRY_INDEX] = { .name = _("Tamato"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_RED, .size = 200, - .maxYield = 4, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Tamato, - .description2 = sBerryDescriptionPart2_Tamato, - .stageDuration = 6, + .maxYield = YIELD_RATE(4, 5, 20, 26), + .minYield = YIELD_RATE(2, 1, 1, 2), + .description1 = COMPOUND_STRING("The Berry is lip-bendingly spicy."), + .description2 = COMPOUND_STRING("It takes time to grow."), + .growthDuration = GROWTH_DURATION(24, 32, 48, 48, 32, 48), .spicy = 20, .dry = 10, .sweet = 0, .bitter = 0, .sour = 0, .smoothness = 30, + .drainRate = 8, + .waterBonus = 5, + .weedsBonus = 3, + .pestsBonus = 6, }, [ITEM_CORNN_BERRY - FIRST_BERRY_INDEX] = { .name = _("Cornn"), .firmness = BERRY_FIRMNESS_HARD, + .color = BERRY_COLOR_PURPLE, .size = 75, - .maxYield = 4, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Cornn, - .description2 = sBerryDescriptionPart2_Cornn, - .stageDuration = 6, + .maxYield = YIELD_RATE(4, 10, 15, 15), + .minYield = YIELD_RATE(2, 2, 3, 3), + .description1 = COMPOUND_STRING("A Berry from an ancient era. May not"), + .description2 = COMPOUND_STRING("grow unless planted in quantity."), + .growthDuration = GROWTH_DURATION(24, 24, 36, 24, 16, 24), .spicy = 0, .dry = 20, .sweet = 10, .bitter = 0, .sour = 0, .smoothness = 30, + .drainRate = 10, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_MAGOST_BERRY - FIRST_BERRY_INDEX] = { .name = _("Magost"), .firmness = BERRY_FIRMNESS_HARD, + .color = BERRY_COLOR_PINK, .size = 140, - .maxYield = 4, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Magost, - .description2 = sBerryDescriptionPart2_Magost, - .stageDuration = 6, + .maxYield = YIELD_RATE(4, 10, 15, 15), + .minYield = YIELD_RATE(2, 2, 3, 3), + .description1 = COMPOUND_STRING("A Berry that is widely said to have"), + .description2 = COMPOUND_STRING("a finely balanced flavor."), + .growthDuration = GROWTH_DURATION(24, 24, 36, 24, 16, 24), .spicy = 0, .dry = 0, .sweet = 20, .bitter = 10, .sour = 0, .smoothness = 30, + .drainRate = 10, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_RABUTA_BERRY - FIRST_BERRY_INDEX] = { .name = _("Rabuta"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_GREEN, .size = 226, - .maxYield = 4, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Rabuta, - .description2 = sBerryDescriptionPart2_Rabuta, - .stageDuration = 6, + .maxYield = YIELD_RATE(4, 10, 15, 15), + .minYield = YIELD_RATE(2, 2, 3, 3), + .description1 = COMPOUND_STRING("A rare variety that is overgrown with"), + .description2 = COMPOUND_STRING("hair. It is quite bitter."), + .growthDuration = GROWTH_DURATION(24, 24, 36, 24, 16, 24), .spicy = 0, .dry = 0, .sweet = 0, .bitter = 20, .sour = 10, .smoothness = 30, + .drainRate = 10, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_NOMEL_BERRY - FIRST_BERRY_INDEX] = { .name = _("Nomel"), .firmness = BERRY_FIRMNESS_SUPER_HARD, + .color = BERRY_COLOR_YELLOW, .size = 285, - .maxYield = 4, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Nomel, - .description2 = sBerryDescriptionPart2_Nomel, - .stageDuration = 6, + .maxYield = YIELD_RATE(4, 10, 15, 15), + .minYield = YIELD_RATE(2, 2, 3, 3), + .description1 = COMPOUND_STRING("Quite sour. Just one bite makes it"), + .description2 = COMPOUND_STRING("impossible to taste for three days."), + .growthDuration = GROWTH_DURATION(24, 24, 36, 24, 16, 24), .spicy = 10, .dry = 0, .sweet = 0, .bitter = 0, .sour = 20, .smoothness = 30, + .drainRate = 10, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_SPELON_BERRY - FIRST_BERRY_INDEX] = { .name = _("Spelon"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_RED, .size = 133, - .maxYield = 2, - .minYield = 1, - .description1 = sBerryDescriptionPart1_Spelon, - .description2 = sBerryDescriptionPart2_Spelon, - .stageDuration = 18, + .maxYield = YIELD_RATE(2, 15, 15, 15), + .minYield = YIELD_RATE(1, 2, 3, 3), + .description1 = COMPOUND_STRING("The vividly red Berry is very spicy."), + .description2 = COMPOUND_STRING("Its warts secrete a spicy substance."), + .growthDuration = GROWTH_DURATION(72, 60, 90, 24, 16, 24), .spicy = 40, .dry = 10, .sweet = 0, .bitter = 0, .sour = 0, .smoothness = 70, + .drainRate = 8, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_PAMTRE_BERRY - FIRST_BERRY_INDEX] = { .name = _("Pamtre"), .firmness = BERRY_FIRMNESS_VERY_SOFT, + .color = BERRY_COLOR_PURPLE, .size = 244, - .maxYield = 2, - .minYield = 1, - .description1 = sBerryDescriptionPart1_Pamtre, - .description2 = sBerryDescriptionPart2_Pamtre, - .stageDuration = 18, + .maxYield = YIELD_RATE(2, 15, 15, 15), + .minYield = YIELD_RATE(1, 3, 3, 3), + .description1 = COMPOUND_STRING("Drifts on the sea from somewhere."), + .description2 = COMPOUND_STRING("It is thought to grow elsewhere."), + .growthDuration = GROWTH_DURATION(72, 60, 90, 24, 16, 24), .spicy = 0, .dry = 40, .sweet = 10, .bitter = 0, .sour = 0, .smoothness = 70, + .drainRate = 8, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_WATMEL_BERRY - FIRST_BERRY_INDEX] = { .name = _("Watmel"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_PINK, .size = 250, - .maxYield = 2, - .minYield = 1, - .description1 = sBerryDescriptionPart1_Watmel, - .description2 = sBerryDescriptionPart2_Watmel, - .stageDuration = 18, + .maxYield = YIELD_RATE(2, 15, 15, 15), + .minYield = YIELD_RATE(1, 2, 3, 3), + .description1 = COMPOUND_STRING("A huge Berry, with some over 20"), + .description2 = COMPOUND_STRING("inches discovered. Exceedingly sweet."), + .growthDuration = GROWTH_DURATION(72, 60, 90, 24, 16, 24), .spicy = 0, .dry = 0, .sweet = 40, .bitter = 10, .sour = 0, .smoothness = 70, + .drainRate = 8, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_DURIN_BERRY - FIRST_BERRY_INDEX] = { .name = _("Durin"), .firmness = BERRY_FIRMNESS_HARD, + .color = BERRY_COLOR_GREEN, .size = 280, - .maxYield = 2, - .minYield = 1, - .description1 = sBerryDescriptionPart1_Durin, - .description2 = sBerryDescriptionPart2_Durin, - .stageDuration = 18, + .maxYield = YIELD_RATE(2, 15, 15, 15), + .minYield = YIELD_RATE(1, 3, 3, 3), + .description1 = COMPOUND_STRING("Bitter to even look at. It is so"), + .description2 = COMPOUND_STRING("bitter, no one has ever eaten it as is."), + .growthDuration = GROWTH_DURATION(72, 60, 90, 24, 16, 24), .spicy = 0, .dry = 0, .sweet = 0, .bitter = 40, .sour = 10, .smoothness = 70, + .drainRate = 8, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_BELUE_BERRY - FIRST_BERRY_INDEX] = { .name = _("Belue"), .firmness = BERRY_FIRMNESS_VERY_SOFT, + .color = BERRY_COLOR_PURPLE, .size = 300, - .maxYield = 2, - .minYield = 1, - .description1 = sBerryDescriptionPart1_Belue, - .description2 = sBerryDescriptionPart2_Belue, - .stageDuration = 18, + .maxYield = YIELD_RATE(2, 15, 15, 15), + .minYield = YIELD_RATE(1, 2, 3, 3), + .description1 = COMPOUND_STRING("It is glossy and looks delicious, but"), + .description2 = COMPOUND_STRING("it is awfully sour. Takes time to grow."), + .growthDuration = GROWTH_DURATION(72, 60, 90, 24, 16, 24), .spicy = 10, .dry = 0, .sweet = 0, .bitter = 0, .sour = 40, .smoothness = 70, + .drainRate = 8, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_CHILAN_BERRY - FIRST_BERRY_INDEX] = { .name = _("Chilan"), .firmness = BERRY_FIRMNESS_VERY_SOFT, + .color = BERRY_COLOR_YELLOW, .size = 34, - .maxYield = 5, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Chilan, - .description2 = sBerryDescriptionPart2_Chilan, - .stageDuration = 18, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), + .description1 = COMPOUND_STRING("It can be made into a whistle that"), + .description2 = COMPOUND_STRING("produces an indescribable sound."), + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 0, .dry = 25, .sweet = 10, .bitter = 0, .sour = 0, .smoothness = 35, + .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_OCCA_BERRY - FIRST_BERRY_INDEX] = { .name = _("Occa"), .firmness = BERRY_FIRMNESS_SUPER_HARD, + .color = BERRY_COLOR_RED, .size = 90, - .maxYield = 5, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Occa, - .description2 = sBerryDescriptionPart2_Occa, - .stageDuration = 18, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), + .description1 = COMPOUND_STRING("Said to grow in the tropics once,"), + .description2 = COMPOUND_STRING("it boasts an intensely hot spiciness."), + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 15, .dry = 0, .sweet = 10, .bitter = 0, .sour = 0, .smoothness = 30, + .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_PASSHO_BERRY - FIRST_BERRY_INDEX] = { .name = _("Passho"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_BLUE, .size = 33, - .maxYield = 5, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Passho, - .description2 = sBerryDescriptionPart2_Passho, - .stageDuration = 18, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), + .description1 = COMPOUND_STRING("Its flesh is dotted with many tiny"), + .description2 = COMPOUND_STRING("bubbles that keep it afloat in water."), + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 0, .dry = 15, .sweet = 0, .bitter = 10, .sour = 0, .smoothness = 30, + .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_WACAN_BERRY - FIRST_BERRY_INDEX] = { .name = _("Wacan"), .firmness = BERRY_FIRMNESS_VERY_SOFT, + .color = BERRY_COLOR_YELLOW, .size = 250, - .maxYield = 5, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Wacan, - .description2 = sBerryDescriptionPart2_Wacan, - .stageDuration = 18, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), + .description1 = COMPOUND_STRING("Energy drawn from lightning strikes"), + .description2 = COMPOUND_STRING("makes this Berry grow big and rich."), + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 0, .dry = 0, .sweet = 15, .bitter = 0, .sour = 10, .smoothness = 30, + .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_RINDO_BERRY - FIRST_BERRY_INDEX] = { .name = _("Rindo"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_GREEN, .size = 156, - .maxYield = 5, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Rindo, - .description2 = sBerryDescriptionPart2_Rindo, - .stageDuration = 18, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), + .description1 = COMPOUND_STRING("This berry has a vegetable-like flavor,"), + .description2 = COMPOUND_STRING("but is rich in health-promoting fiber."), + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 10, .dry = 0, .sweet = 0, .bitter = 15, .sour = 0, .smoothness = 30, + .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_YACHE_BERRY - FIRST_BERRY_INDEX] = { .name = _("Yache"), .firmness = BERRY_FIRMNESS_VERY_HARD, + .color = BERRY_COLOR_BLUE, .size = 135, - .maxYield = 5, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Yache, - .description2 = sBerryDescriptionPart2_Yache, - .stageDuration = 18, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), + .description1 = COMPOUND_STRING("This Berry has a refreshing dry and"), + .description2 = COMPOUND_STRING("sour flavor. Tastes better chilled."), + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 0, .dry = 10, .sweet = 0, .bitter = 0, .sour = 15, .smoothness = 30, + .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_CHOPLE_BERRY - FIRST_BERRY_INDEX] = { .name = _("Chople"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_RED, .size = 77, - .maxYield = 5, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Chople, - .description2 = sBerryDescriptionPart2_Chople, - .stageDuration = 18, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), + .description1 = COMPOUND_STRING("Contains a substance that generates"), + .description2 = COMPOUND_STRING("heat. Can even fire up a chilly heart."), + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 15, .dry = 0, .sweet = 0, .bitter = 10, .sour = 0, .smoothness = 30, + .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_KEBIA_BERRY - FIRST_BERRY_INDEX] = { .name = _("Kebia"), .firmness = BERRY_FIRMNESS_HARD, + .color = BERRY_COLOR_GREEN, .size = 90, - .maxYield = 5, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Kebia, - .description2 = sBerryDescriptionPart2_Kebia, - .stageDuration = 18, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), + .description1 = COMPOUND_STRING("Brilliant green on the outside, inside"), + .description2 = COMPOUND_STRING("it is packed with black-colored flesh."), + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 0, .dry = 15, .sweet = 0, .bitter = 0, .sour = 10, .smoothness = 30, + .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_SHUCA_BERRY - FIRST_BERRY_INDEX] = { .name = _("Shuca"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_YELLOW, .size = 42, - .maxYield = 5, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Shuca, - .description2 = sBerryDescriptionPart2_Shuca, - .stageDuration = 18, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), + .description1 = COMPOUND_STRING("The sweet pulp has just the hint of a"), + .description2 = COMPOUND_STRING("a hard-edged and fragrant bite to it."), + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 10, .dry = 0, .sweet = 15, .bitter = 0, .sour = 0, .smoothness = 30, + .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_COBA_BERRY - FIRST_BERRY_INDEX] = { .name = _("Coba"), .firmness = BERRY_FIRMNESS_VERY_HARD, + .color = BERRY_COLOR_BLUE, .size = 278, - .maxYield = 5, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Coba, - .description2 = sBerryDescriptionPart2_Coba, - .stageDuration = 18, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), + .description1 = COMPOUND_STRING("This Berry is said to be a cross of"), + .description2 = COMPOUND_STRING("two Berries blown in from far away."), + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 0, .dry = 10, .sweet = 0, .bitter = 15, .sour = 0, .smoothness = 30, + .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_PAYAPA_BERRY - FIRST_BERRY_INDEX] = { .name = _("Payapa"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_PURPLE, .size = 252, - .maxYield = 5, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Payapa, - .description2 = sBerryDescriptionPart2_Payapa, - .stageDuration = 18, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), + .description1 = COMPOUND_STRING("Said to sense human emotions, it swells"), + .description2 = COMPOUND_STRING("roundly when a person approaches."), + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 0, .dry = 0, .sweet = 10, .bitter = 0, .sour = 15, .smoothness = 30, + .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_TANGA_BERRY - FIRST_BERRY_INDEX] = { .name = _("Tanga"), .firmness = BERRY_FIRMNESS_VERY_SOFT, + .color = BERRY_COLOR_GREEN, .size = 42, - .maxYield = 5, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Tanga, - .description2 = sBerryDescriptionPart2_Tanga, - .stageDuration = 18, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), + .description1 = COMPOUND_STRING("It grows a flower at the tip that lures"), + .description2 = COMPOUND_STRING("Bug Pokémon with its stringy petals."), + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 20, .dry = 0, .sweet = 0, .bitter = 0, .sour = 10, .smoothness = 35, + .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_CHARTI_BERRY - FIRST_BERRY_INDEX] = { .name = _("Charti"), .firmness = BERRY_FIRMNESS_VERY_SOFT, + .color = BERRY_COLOR_YELLOW, .size = 28, - .maxYield = 5, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Charti, - .description2 = sBerryDescriptionPart2_Charti, - .stageDuration = 18, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), + .description1 = COMPOUND_STRING("Often used for pickles because of its"), + .description2 = COMPOUND_STRING("dry flavor. Sometimes eaten raw."), + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 10, .dry = 20, .sweet = 0, .bitter = 0, .sour = 0, .smoothness = 35, + .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_KASIB_BERRY - FIRST_BERRY_INDEX] = { .name = _("Kasib"), .firmness = BERRY_FIRMNESS_HARD, + .color = BERRY_COLOR_PURPLE, .size = 144, - .maxYield = 5, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Kasib, - .description2 = sBerryDescriptionPart2_Kasib, - .stageDuration = 18, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), + .description1 = COMPOUND_STRING("Old superstitions say it has an odd"), + .description2 = COMPOUND_STRING("power. A popular good-luck charm."), + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 0, .dry = 10, .sweet = 20, .bitter = 0, .sour = 0, .smoothness = 35, + .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_HABAN_BERRY - FIRST_BERRY_INDEX] = { .name = _("Haban"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_RED, .size = 23, - .maxYield = 5, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Haban, - .description2 = sBerryDescriptionPart2_Haban, - .stageDuration = 18, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), + .description1 = COMPOUND_STRING("Less bitter if enough of this Berry"), + .description2 = COMPOUND_STRING("is boiled down. Makes a good jam."), + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 0, .dry = 0, .sweet = 10, .bitter = 20, .sour = 0, .smoothness = 35, + .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_COLBUR_BERRY - FIRST_BERRY_INDEX] = { .name = _("Colbur"), .firmness = BERRY_FIRMNESS_SUPER_HARD, + .color = BERRY_COLOR_PURPLE, .size = 39, - .maxYield = 5, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Colbur, - .description2 = sBerryDescriptionPart2_Colbur, - .stageDuration = 18, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), + .description1 = COMPOUND_STRING("Tiny hooks on the surface latch onto"), + .description2 = COMPOUND_STRING("Pokémon to reach far-off places."), + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 0, .dry = 0, .sweet = 0, .bitter = 10, .sour = 20, .smoothness = 35, + .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_BABIRI_BERRY - FIRST_BERRY_INDEX] = { .name = _("Babiri"), .firmness = BERRY_FIRMNESS_SUPER_HARD, + .color = BERRY_COLOR_GREEN, .size = 265, - .maxYield = 5, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Babiri, - .description2 = sBerryDescriptionPart2_Babiri, - .stageDuration = 18, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), + .description1 = COMPOUND_STRING("Very tough with a strong flavor. It"), + .description2 = COMPOUND_STRING("was used to make medicine in the past."), + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 25, .dry = 10, .sweet = 0, .bitter = 0, .sour = 0, .smoothness = 35, + .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_ROSELI_BERRY - FIRST_BERRY_INDEX] = { .name = _("Roseli"), .firmness = BERRY_FIRMNESS_HARD, + .color = BERRY_COLOR_PINK, .size = 35, - .maxYield = 5, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Roseli, - .description2 = sBerryDescriptionPart2_Roseli, - .stageDuration = 18, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), + .description1 = COMPOUND_STRING("In nature, they grow in wide rings"), + .description2 = COMPOUND_STRING("for reasons that are still unknown."), + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 0, .dry = 0, .sweet = 25, .bitter = 10, .sour = 0, .smoothness = 35, + .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_LIECHI_BERRY - FIRST_BERRY_INDEX] = { .name = _("Liechi"), .firmness = BERRY_FIRMNESS_VERY_HARD, + .color = BERRY_COLOR_RED, .size = 111, - .maxYield = 2, - .minYield = 1, - .description1 = sBerryDescriptionPart1_Liechi, - .description2 = sBerryDescriptionPart2_Liechi, - .stageDuration = 24, + .maxYield = YIELD_RATE(2, 5, 10, 13), + .minYield = YIELD_RATE(1, 1, 1, 2), + .description1 = COMPOUND_STRING("A mysterious Berry. It is rumored to"), + .description2 = COMPOUND_STRING("contain the power of the sea."), + .growthDuration = GROWTH_DURATION(96, 96, 144, 96, 48, 72), .spicy = 40, .dry = 0, .sweet = 40, .bitter = 0, .sour = 10, .smoothness = 80, + .drainRate = 4, + .waterBonus = 2, + .weedsBonus = 0, + .pestsBonus = 2, }, [ITEM_GANLON_BERRY - FIRST_BERRY_INDEX] = { .name = _("Ganlon"), .firmness = BERRY_FIRMNESS_VERY_HARD, + .color = BERRY_COLOR_PURPLE, .size = 33, - .maxYield = 2, - .minYield = 1, - .description1 = sBerryDescriptionPart1_Ganlon, - .description2 = sBerryDescriptionPart2_Ganlon, - .stageDuration = 24, + .maxYield = YIELD_RATE(2, 5, 10, 13), + .minYield = YIELD_RATE(1, 1, 1, 2), + .description1 = COMPOUND_STRING("A mysterious Berry. It is rumored to"), + .description2 = COMPOUND_STRING("contain the power of the land."), + .growthDuration = GROWTH_DURATION(96, 96, 144, 96, 48, 72), .spicy = 0, .dry = 40, .sweet = 0, .bitter = 40, .sour = 0, .smoothness = 80, + .drainRate = 4, + .waterBonus = 2, + .weedsBonus = 0, + .pestsBonus = 2, }, [ITEM_SALAC_BERRY - FIRST_BERRY_INDEX] = { .name = _("Salac"), .firmness = BERRY_FIRMNESS_VERY_HARD, + .color = BERRY_COLOR_GREEN, .size = 95, - .maxYield = 2, - .minYield = 1, - .description1 = sBerryDescriptionPart1_Salac, - .description2 = sBerryDescriptionPart2_Salac, - .stageDuration = 24, + .maxYield = YIELD_RATE(2, 5, 10, 13), + .minYield = YIELD_RATE(1, 1, 1, 2), + .description1 = COMPOUND_STRING("A mysterious Berry. It is rumored to"), + .description2 = COMPOUND_STRING("contain the power of the sky."), + .growthDuration = GROWTH_DURATION(96, 96, 144, 96, 48, 72), .spicy = 0, .dry = 0, .sweet = 40, .bitter = 0, .sour = 40, .smoothness = 80, + .drainRate = 4, + .waterBonus = 2, + .weedsBonus = 0, + .pestsBonus = 2, }, [ITEM_PETAYA_BERRY - FIRST_BERRY_INDEX] = { .name = _("Petaya"), .firmness = BERRY_FIRMNESS_VERY_HARD, + .color = BERRY_COLOR_PINK, .size = 237, - .maxYield = 2, - .minYield = 1, - .description1 = sBerryDescriptionPart1_Petaya, - .description2 = sBerryDescriptionPart2_Petaya, - .stageDuration = 24, + .maxYield = YIELD_RATE(2, 5, 10, 13), + .minYield = YIELD_RATE(1, 1, 1, 2), + .description1 = COMPOUND_STRING("A mysterious Berry. It is rumored to"), + .description2 = COMPOUND_STRING("contain the power of all living things."), + .growthDuration = GROWTH_DURATION(96, 96, 144, 96, 48, 72), .spicy = 40, .dry = 0, .sweet = 0, .bitter = 40, .sour = 0, .smoothness = 80, + .drainRate = 4, + .waterBonus = 2, + .weedsBonus = 0, + .pestsBonus = 2, }, [ITEM_APICOT_BERRY - FIRST_BERRY_INDEX] = { .name = _("Apicot"), .firmness = BERRY_FIRMNESS_HARD, + .color = BERRY_COLOR_BLUE, .size = 75, - .maxYield = 2, - .minYield = 1, - .description1 = sBerryDescriptionPart1_Apicot, - .description2 = sBerryDescriptionPart2_Apicot, - .stageDuration = 24, + .maxYield = YIELD_RATE(2, 5, 10, 13), + .minYield = YIELD_RATE(1, 1, 1, 2), + .description1 = COMPOUND_STRING("A very mystifying Berry. No telling"), + .description2 = COMPOUND_STRING("what may happen or how it can be used."), + .growthDuration = GROWTH_DURATION(96, 96, 144, 96, 48, 72), .spicy = 0, .dry = 40, .sweet = 0, .bitter = 0, .sour = 40, .smoothness = 80, + .drainRate = 4, + .waterBonus = 2, + .weedsBonus = 0, + .pestsBonus = 2, }, [ITEM_LANSAT_BERRY - FIRST_BERRY_INDEX] = { .name = _("Lansat"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_RED, .size = 97, - .maxYield = 2, - .minYield = 1, - .description1 = sBerryDescriptionPart1_Lansat, - .description2 = sBerryDescriptionPart2_Lansat, - .stageDuration = 24, + .maxYield = YIELD_RATE(2, 5, 5, 7), + .minYield = YIELD_RATE(1, 1, 1, 1), + .description1 = COMPOUND_STRING("Said to be a legendary Berry."), + .description2 = COMPOUND_STRING("Holding it supposedly brings joy."), + .growthDuration = GROWTH_DURATION(96, 96, 144, 120, 48, 72), .spicy = 10, .dry = 10, .sweet = 10, .bitter = 10, .sour = 10, .smoothness = 30, + .drainRate = 4, + .waterBonus = 1, + .weedsBonus = 0, + .pestsBonus = 1, }, [ITEM_STARF_BERRY - FIRST_BERRY_INDEX] = { .name = _("Starf"), .firmness = BERRY_FIRMNESS_SUPER_HARD, + .color = BERRY_COLOR_GREEN, .size = 153, - .maxYield = 2, - .minYield = 1, - .description1 = sBerryDescriptionPart1_Starf, - .description2 = sBerryDescriptionPart2_Starf, - .stageDuration = 24, + .maxYield = YIELD_RATE(2, 5, 5, 7), + .minYield = YIELD_RATE(1, 1, 1, 1), + .description1 = COMPOUND_STRING("So strong, it was abandoned at the"), + .description2 = COMPOUND_STRING("world's edge. Considered a mirage."), + .growthDuration = GROWTH_DURATION(96, 96, 144, 120, 48, 72), .spicy = 10, .dry = 10, .sweet = 10, .bitter = 10, .sour = 10, .smoothness = 30, + .drainRate = 4, + .waterBonus = 1, + .weedsBonus = 0, + .pestsBonus = 1, }, [ITEM_ENIGMA_BERRY - FIRST_BERRY_INDEX] = { .name = _("Enigma"), .firmness = BERRY_FIRMNESS_HARD, + .color = BERRY_COLOR_PURPLE, .size = 155, - .maxYield = 5, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Enigma, - .description2 = sBerryDescriptionPart2_Enigma, - .stageDuration = 24, + .maxYield = YIELD_RATE(2, 5, 5, 13), + .minYield = YIELD_RATE(1, 1, 1, 1), + .description1 = COMPOUND_STRING("A completely enigmatic Berry."), + .description2 = COMPOUND_STRING("Appears to have the power of stars."), + .growthDuration = GROWTH_DURATION(96, 96, 144, 72, 48, 72), .spicy = 40, .dry = 10, .sweet = 0, .bitter = 0, .sour = 0, .smoothness = 60, + .drainRate = 7, + .waterBonus = 2, + .weedsBonus = 0, + .pestsBonus = 0, }, [ITEM_MICLE_BERRY - FIRST_BERRY_INDEX] = { .name = _("Micle"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_GREEN, .size = 41, - .maxYield = 5, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Micle, - .description2 = sBerryDescriptionPart2_Micle, - .stageDuration = 24, + .maxYield = YIELD_RATE(2, 5, 5, 13), + .minYield = YIELD_RATE(1, 1, 1, 1), + .description1 = COMPOUND_STRING("It makes other food eaten at the"), + .description2 = COMPOUND_STRING("same time taste sweet."), + .growthDuration = GROWTH_DURATION(96, 96, 144, 72, 48, 72), .spicy = 0, .dry = 40, .sweet = 10, .bitter = 0, .sour = 0, .smoothness = 60, + .drainRate = 7, + .waterBonus = 2, + .weedsBonus = 0, + .pestsBonus = 0, }, [ITEM_CUSTAP_BERRY - FIRST_BERRY_INDEX] = { .name = _("Custap"), .firmness = BERRY_FIRMNESS_SUPER_HARD, + .color = BERRY_COLOR_RED, .size = 267, - .maxYield = 5, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Custap, - .description2 = sBerryDescriptionPart2_Custap, - .stageDuration = 24, + .maxYield = YIELD_RATE(2, 5, 5, 13), + .minYield = YIELD_RATE(1, 1, 1, 1), + .description1 = COMPOUND_STRING("The flesh underneath the Custap"), + .description2 = COMPOUND_STRING("Berry's skin is sweet and creamy soft."), + .growthDuration = GROWTH_DURATION(96, 96, 144, 72, 48, 72), .spicy = 0, .dry = 0, .sweet = 40, .bitter = 10, .sour = 0, .smoothness = 60, + .drainRate = 7, + .waterBonus = 2, + .weedsBonus = 0, + .pestsBonus = 0, }, [ITEM_JABOCA_BERRY - FIRST_BERRY_INDEX] = { .name = _("Jaboca"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_YELLOW, .size = 33, - .maxYield = 5, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Jaboca, - .description2 = sBerryDescriptionPart2_Jaboca, - .stageDuration = 24, + .maxYield = YIELD_RATE(2, 5, 5, 13), + .minYield = YIELD_RATE(1, 1, 1, 1), + .description1 = COMPOUND_STRING("The drupelets that make up this berry"), + .description2 = COMPOUND_STRING("pop rythmically if handled roughly."), + .growthDuration = GROWTH_DURATION(96, 96, 144, 72, 48, 72), .spicy = 0, .dry = 0, .sweet = 0, .bitter = 40, .sour = 10, .smoothness = 60, + .drainRate = 7, + .waterBonus = 2, + .weedsBonus = 0, + .pestsBonus = 0, }, [ITEM_ROWAP_BERRY - FIRST_BERRY_INDEX] = { .name = _("Rowap"), .firmness = BERRY_FIRMNESS_VERY_SOFT, + .color = BERRY_COLOR_BLUE, .size = 52, - .maxYield = 5, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Rowap, - .description2 = sBerryDescriptionPart2_Rowap, - .stageDuration = 24, + .maxYield = YIELD_RATE(2, 5, 5, 13), + .minYield = YIELD_RATE(1, 1, 1, 1), + .description1 = COMPOUND_STRING("People once worked top-shaped pieces"), + .description2 = COMPOUND_STRING("of this berry free to use as toys."), + .growthDuration = GROWTH_DURATION(96, 96, 144, 72, 48, 72), .spicy = 10, .dry = 0, .sweet = 0, .bitter = 0, .sour = 40, .smoothness = 60, + .drainRate = 7, + .waterBonus = 2, + .weedsBonus = 0, + .pestsBonus = 0, }, [ITEM_KEE_BERRY - FIRST_BERRY_INDEX] = { .name = _("Kee"), .firmness = BERRY_FIRMNESS_UNKNOWN, + .color = BERRY_COLOR_YELLOW, .size = 0, - .maxYield = 5, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Kee, - .description2 = sBerryDescriptionPart2_Kee, - .stageDuration = 24, + .maxYield = YIELD_RATE(2, 5, 10, 13), + .minYield = YIELD_RATE(1, 1, 1, 2), + .description1 = COMPOUND_STRING("A berry that is incredibly spicy at"), + .description2 = COMPOUND_STRING("first, then extremely bitter."), + .growthDuration = GROWTH_DURATION(96, 96, 144, 96, 48, 72), .spicy = 30, .dry = 30, .sweet = 10, .bitter = 10, .sour = 10, .smoothness = 60, + .drainRate = 7, + .waterBonus = 2, + .weedsBonus = 0, + .pestsBonus = 2, }, [ITEM_MARANGA_BERRY - FIRST_BERRY_INDEX] = { .name = _("Marnga"), // "Maranga" is too long .firmness = BERRY_FIRMNESS_UNKNOWN, + .color = BERRY_COLOR_BLUE, .size = 0, - .maxYield = 5, - .minYield = 2, - .description1 = sBerryDescriptionPart1_Maranga, - .description2 = sBerryDescriptionPart2_Maranga, - .stageDuration = 24, + .maxYield = YIELD_RATE(2, 5, 10, 13), + .minYield = YIELD_RATE(1, 1, 1, 2), + .description1 = COMPOUND_STRING("Its outside is very bitter, but its"), + .description2 = COMPOUND_STRING("inside tastes like a sweet drink."), + .growthDuration = GROWTH_DURATION(96, 96, 144, 96, 48, 72), .spicy = 10, .dry = 10, .sweet = 30, .bitter = 30, .sour = 10, .smoothness = 60, + .drainRate = 7, + .waterBonus = 2, + .weedsBonus = 0, + .pestsBonus = 2, }, [ITEM_ENIGMA_BERRY_E_READER - FIRST_BERRY_INDEX] = { .name = _("Enigma"), .firmness = BERRY_FIRMNESS_UNKNOWN, + .color = BERRY_COLOR_PURPLE, .size = 0, - .maxYield = 2, - .minYield = 1, - .description1 = sBerryDescriptionPart1_Enigma, - .description2 = sBerryDescriptionPart2_Enigma, - .stageDuration = 24, + .maxYield = YIELD_RATE(2, 5, 5, 13), + .minYield = YIELD_RATE(1, 1, 1, 1), + .description1 = COMPOUND_STRING("A completely enigmatic Berry."), + .description2 = COMPOUND_STRING("Appears to have the power of stars."), + .growthDuration = GROWTH_DURATION(96, 96, 144, 72, 48, 72), .spicy = 40, .dry = 40, .sweet = 40, .bitter = 40, .sour = 40, .smoothness = 40, + .drainRate = 7, + .waterBonus = 2, + .weedsBonus = 0, + .pestsBonus = 0, }, }; @@ -1435,12 +1667,6 @@ const struct BerryCrushBerryData gBerryCrush_BerryData[] = { const struct BerryTree gBlankBerryTree = {}; -// unused -void ClearEnigmaBerries(void) -{ - CpuFill16(0, &gSaveBlock1Ptr->enigmaBerry, sizeof(gSaveBlock1Ptr->enigmaBerry)); -} - void SetEnigmaBerry(u8 *src) { u32 i; @@ -1466,7 +1692,7 @@ static u32 GetEnigmaBerryChecksum(struct EnigmaBerry *enigmaBerry) bool32 IsEnigmaBerryValid(void) { - if (!gSaveBlock1Ptr->enigmaBerry.berry.stageDuration) + if (!gSaveBlock1Ptr->enigmaBerry.berry.growthDuration) return FALSE; if (!gSaveBlock1Ptr->enigmaBerry.berry.maxYield) return FALSE; @@ -1496,19 +1722,31 @@ bool32 ObjectEventInteractionWaterBerryTree(void) { struct BerryTree *tree = GetBerryTreeInfo(GetObjectEventBerryTreeId(gSelectedObjectEvent)); + if (OW_BERRY_MOISTURE) + { + tree->moistureLevel = 100; + if (OW_BERRY_ALWAYS_WATERABLE) + { + return TRUE; + } + AddTreeBonus(tree, GetWaterBonusByBerryType(tree->berry)); + } + switch (tree->stage) { case BERRY_STAGE_PLANTED: - tree->watered1 = TRUE; + tree->watered |= (1 << 0); break; case BERRY_STAGE_SPROUTED: - tree->watered2 = TRUE; + tree->watered |= (1 << 1); break; case BERRY_STAGE_TALLER: - tree->watered3 = TRUE; + case BERRY_STAGE_TRUNK: + case BERRY_STAGE_BUDDING: + tree->watered |= (1 << 2); break; case BERRY_STAGE_FLOWERING: - tree->watered4 = TRUE; + tree->watered |= (1 << 3); break; default: return FALSE; @@ -1541,7 +1779,7 @@ void ClearBerryTrees(void) gSaveBlock1Ptr->berryTrees[i] = gBlankBerryTree; } -static bool32 BerryTreeGrow(struct BerryTree *tree) +bool32 BerryTreeGrow(struct BerryTree *tree) { if (tree->stopGrowth) return FALSE; @@ -1554,26 +1792,46 @@ static bool32 BerryTreeGrow(struct BerryTree *tree) tree->berryYield = CalcBerryYield(tree); case BERRY_STAGE_PLANTED: case BERRY_STAGE_SPROUTED: - case BERRY_STAGE_TALLER: + case BERRY_STAGE_TRUNK: tree->stage++; break; + case BERRY_STAGE_TALLER: + if (OW_BERRY_SIX_STAGES) + tree->stage = BERRY_STAGE_TRUNK; + else + tree->stage++; + break; + case BERRY_STAGE_BUDDING: + tree->berryYield = CalcBerryYield(tree); + tree->stage = BERRY_STAGE_BERRIES; + break; case BERRY_STAGE_BERRIES: - tree->watered1 = 0; - tree->watered2 = 0; - tree->watered3 = 0; - tree->watered4 = 0; + tree->watered = 0; tree->berryYield = 0; tree->stage = BERRY_STAGE_SPROUTED; - if (++tree->regrowthCount == 10) + tree->moistureLevel = 100; + if (++tree->regrowthCount == ((tree->mulch == ITEM_TO_MULCH(ITEM_GOOEY_MULCH)) ? 15 : 10)) *tree = gBlankBerryTree; break; } return TRUE; } +static u16 GetMulchAffectedGrowthRate(u16 berryDuration, u8 mulch, u8 stage) +{ + if (stage == BERRY_STAGE_BERRIES) + return berryDuration; + if (mulch == ITEM_TO_MULCH(ITEM_GROWTH_MULCH)) + return berryDuration / 4 * 3; + if (mulch == ITEM_TO_MULCH(ITEM_DAMP_MULCH)) + return berryDuration / 2 * 3; + return berryDuration; +} + void BerryTreeTimeUpdate(s32 minutes) { int i; + u8 drainVal; struct BerryTree *tree; for (i = 0; i < BERRY_TREES_COUNT; i++) @@ -1590,6 +1848,51 @@ void BerryTreeTimeUpdate(s32 minutes) { s32 time = minutes; + // Check moisture gradient, pests and weeds + while (time > 0 && tree->stage != BERRY_STAGE_BERRIES) + { + tree->moistureClock += 1; + time -= 1; + if (tree->moistureClock % 60 == 0) + { + if (OW_BERRY_MOISTURE) + { + drainVal = (OW_BERRY_DRAIN_RATE == GEN_4) ? GetDrainRateByBerryType(tree->berry) : (OW_BERRY_DRAIN_RATE == GEN_6_XY) ? 4 : 25; + if (OW_BERRY_MULCH_USAGE) + { + if (tree->mulch == ITEM_TO_MULCH(ITEM_GROWTH_MULCH)) + drainVal *= 2; + if (tree->mulch == ITEM_TO_MULCH(ITEM_DAMP_MULCH)) + drainVal /= 2; + if (tree->mulch == ITEM_TO_MULCH(ITEM_BOOST_MULCH) || tree->mulch == ITEM_TO_MULCH(ITEM_AMAZE_MULCH)) + drainVal = 25; + } + if (OW_BERRY_ALWAYS_WATERABLE && tree->moistureLevel == 0) + { + if (tree->berryYield > GetBerryInfo(tree->berry)->minYield + GetBerryInfo(tree->berry)->maxYield / 5) + tree->berryYield -= GetBerryInfo(tree->berry)->maxYield / 5; + else + tree->berryYield = GetBerryInfo(tree->berry)->minYield; + } + else if (tree->moistureLevel <= drainVal) + tree->moistureLevel = 0; + else + tree->moistureLevel -= drainVal; + if (OW_BERRY_DRAIN_RATE == GEN_6_XY && tree->moistureLevel <= 4) // Without variable drain rate (and without mulches), this needs to trigger after 24 hours, hence the extra check + tree->moistureLevel = 0; + } + if (tree->moistureClock == 120) + { + TryForWeeds(tree); + TryForPests(tree); + tree->moistureClock = 0; + } + } + } + + // Check Berry growth + time = minutes; + while (time != 0) { if (tree->minutesUntilNextStage > time) @@ -1598,11 +1901,11 @@ void BerryTreeTimeUpdate(s32 minutes) break; } time -= tree->minutesUntilNextStage; - tree->minutesUntilNextStage = GetStageDurationByBerryType(tree->berry); + tree->minutesUntilNextStage = GetMulchAffectedGrowthRate(GetStageDurationByBerryType(tree->berry), tree->mulch, tree->stage); if (!BerryTreeGrow(tree)) break; if (tree->stage == BERRY_STAGE_BERRIES) - tree->minutesUntilNextStage *= 4; + tree->minutesUntilNextStage = GetStageDurationByBerryType(tree->berry) * ((tree->mulch == ITEM_TO_MULCH(ITEM_STABLE_MULCH)) ? 6 : 4); } } } @@ -1613,20 +1916,24 @@ void PlantBerryTree(u8 id, u8 berry, u8 stage, bool8 allowGrowth) { struct BerryTree *tree = GetBerryTreeInfo(id); - *tree = gBlankBerryTree; tree->berry = berry; - tree->minutesUntilNextStage = GetStageDurationByBerryType(berry); + tree->minutesUntilNextStage = GetMulchAffectedGrowthRate(GetStageDurationByBerryType(berry), tree->mulch, stage); tree->stage = stage; + tree->moistureLevel = 100; + if (OW_BERRY_ALWAYS_WATERABLE) + tree->berryYield = GetBerryInfo(berry)->maxYield; if (stage == BERRY_STAGE_BERRIES) { tree->berryYield = CalcBerryYield(tree); - tree->minutesUntilNextStage *= 4; + tree->minutesUntilNextStage *= ((tree->mulch == ITEM_TO_MULCH(ITEM_STABLE_MULCH)) ? 6 : 4); } // Stop growth, to keep tree at this stage until the player has seen it // allowGrowth is always true for berry trees the player has planted if (!allowGrowth) tree->stopGrowth = TRUE; + + SetTreeMutations(id, berry); } void RemoveBerryTree(u8 id) @@ -1644,6 +1951,11 @@ u8 GetStageByBerryTreeId(u8 id) return gSaveBlock1Ptr->berryTrees[id].stage; } +u8 GetMulchByBerryTreeId(u8 id) +{ + return gSaveBlock1Ptr->berryTrees[id].mulch; +} + u8 ItemIdToBerryType(u16 item) { u16 berry = item - FIRST_BERRY_INDEX; @@ -1684,13 +1996,13 @@ static u8 BerryTreeGetNumStagesWatered(struct BerryTree *tree) { u8 count = 0; - if (tree->watered1) + if (tree->watered & (1 << 0)) count++; - if (tree->watered2) + if (tree->watered & (1 << 1)) count++; - if (tree->watered3) + if (tree->watered & (1 << 2)) count++; - if (tree->watered4) + if (tree->watered & (1 << 3)) count++; return count; } @@ -1716,7 +2028,7 @@ static u8 CalcBerryYieldInternal(u16 max, u16 min, u8 water) u32 rand; u32 extraYield; - if (water == 0) + if (water == 0 || OW_BERRY_MOISTURE) return min; else { @@ -1736,10 +2048,19 @@ static u8 CalcBerryYieldInternal(u16 max, u16 min, u8 water) static u8 CalcBerryYield(struct BerryTree *tree) { const struct Berry *berry = GetBerryInfo(tree->berry); - u8 min = berry->minYield; + u8 min = tree->berryYield; u8 max = berry->maxYield; + u8 result; + if (OW_BERRY_MULCH_USAGE && (tree->mulch == ITEM_TO_MULCH(ITEM_RICH_MULCH) || tree->mulch == ITEM_TO_MULCH(ITEM_AMAZE_MULCH))) + min += 2; + if (!(OW_BERRY_MOISTURE && OW_BERRY_ALWAYS_WATERABLE)) + min += berry->minYield; + if (min >= max) + result = max; + else + result = CalcBerryYieldInternal(max, min, BerryTreeGetNumStagesWatered(tree)); - return CalcBerryYieldInternal(max, min, BerryTreeGetNumStagesWatered(tree)); + return result; } static u8 GetBerryCountByBerryTreeId(u8 id) @@ -1749,7 +2070,36 @@ static u8 GetBerryCountByBerryTreeId(u8 id) static u16 GetStageDurationByBerryType(u8 berry) { - return GetBerryInfo(berry)->stageDuration * 60; + return GetBerryInfo(berry)->growthDuration * 60 / (OW_BERRY_SIX_STAGES ? 6 : 4); +} + +static u8 GetDrainRateByBerryType(u8 berry) +{ + return GetBerryInfo(berry)->drainRate; +} + +static u8 GetWaterBonusByBerryType(u8 berry) +{ + return GetBerryInfo(berry)->waterBonus; +} + +static u8 GetWeedingBonusByBerryType(u8 berry) +{ + u8 bonus = GetBerryInfo(berry)->weedsBonus; + return (bonus == 0) ? 1 : bonus * 5; +} + +static u8 GetPestsBonusByBerryType(u8 berry) +{ + u8 bonus = GetBerryInfo(berry)->pestsBonus; + return (bonus == 0) ? 2 : bonus * 5; +} + +bool8 CanWaterBerryPlot(void) +{ + if (!OW_BERRY_MOISTURE || OW_BERRY_ALWAYS_WATERABLE) + return TRUE; + return (gSaveBlock1Ptr->berryTrees[GetObjectEventBerryTreeId(gSelectedObjectEvent)].moistureLevel == 0); } void ObjectEventInteractionGetBerryTreeData(void) @@ -1787,6 +2137,15 @@ void ObjectEventInteractionGetBerryCountString(void) u8 berry = GetBerryTypeByBerryTreeId(treeId); u8 count = GetBerryCountByBerryTreeId(treeId); GetBerryCountStringByBerryType(berry, gStringVar1, count); + berry = GetTreeMutationValue(treeId); + if (berry > 0) + { + count = 1; + GetBerryCountStringByBerryType(berry, gStringVar3, count); + gSpecialVar_Result = TRUE; + } + else + gSpecialVar_Result = FALSE; } void Bag_ChooseBerry(void) @@ -1794,6 +2153,11 @@ void Bag_ChooseBerry(void) SetMainCallback2(CB2_ChooseBerry); } +void Bag_ChooseMulch(void) +{ + SetMainCallback2(CB2_ChooseMulch); +} + void ObjectEventInteractionPlantBerryTree(void) { u8 berry = ItemIdToBerryType(gSpecialVar_ItemId); @@ -1802,12 +2166,31 @@ void ObjectEventInteractionPlantBerryTree(void) ObjectEventInteractionGetBerryTreeData(); } +void ObjectEventInteractionApplyMulch(void) +{ + u8 mulch = ITEM_TO_MULCH(gSpecialVar_ItemId); + + gSaveBlock1Ptr->berryTrees[GetObjectEventBerryTreeId(gSelectedObjectEvent)].mulch = mulch; + StringExpandPlaceholders(gStringVar1, gItems[gSpecialVar_ItemId].name); +} + void ObjectEventInteractionPickBerryTree(void) { u8 id = GetObjectEventBerryTreeId(gSelectedObjectEvent); u8 berry = GetBerryTypeByBerryTreeId(id); + u8 mutation = GetTreeMutationValue(id); - gSpecialVar_0x8004 = AddBagItem(BerryTypeToItemId(berry), GetBerryCountByBerryTreeId(id)); + if (!OW_BERRY_MUTATIONS || mutation == 0) + { + gSpecialVar_0x8004 = AddBagItem(BerryTypeToItemId(berry), GetBerryCountByBerryTreeId(id)); + return; + } + gSpecialVar_0x8004 = (CheckBagHasSpace(BerryTypeToItemId(berry), GetBerryCountByBerryTreeId(id)) && CheckBagHasSpace(BerryTypeToItemId(mutation), 1)) + 2; + if (gSpecialVar_0x8004 == 3) + { + AddBagItem(BerryTypeToItemId(berry), GetBerryCountByBerryTreeId(id)); + AddBagItem(BerryTypeToItemId(mutation), 1); + } } void ObjectEventInteractionRemoveBerryTree(void) @@ -1816,11 +2199,43 @@ void ObjectEventInteractionRemoveBerryTree(void) SetBerryTreeJustPicked(gSpecialVar_LastTalked, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup); } +void ObjectEventInteractionPullBerryWeed(void) +{ + struct BerryTree *tree = GetBerryTreeInfo(GetObjectEventBerryTreeId(gSelectedObjectEvent)); + tree->weeds = FALSE; + AddTreeBonus(tree, GetWeedingBonusByBerryType(tree->berry)); +} + +void ObjectEventInteractionClearBerryPests(void) +{ + struct BerryTree *tree = GetBerryTreeInfo(GetObjectEventBerryTreeId(gSelectedObjectEvent)); + tree->pests = FALSE; + AddTreeBonus(tree, GetPestsBonusByBerryType(tree->berry)); +} + bool8 PlayerHasBerries(void) { return IsBagPocketNonEmpty(POCKET_BERRIES); } +bool8 ObjectEventInteractionBerryHasWeed(void) +{ + return gSaveBlock1Ptr->berryTrees[GetObjectEventBerryTreeId(gSelectedObjectEvent)].weeds; +} + +bool8 ObjectEventInteractionBerryHasPests(void) +{ + u16 species; + if (!OW_BERRY_PESTS || !gSaveBlock1Ptr->berryTrees[GetObjectEventBerryTreeId(gSelectedObjectEvent)].pests) + return FALSE; + species = GetBerryPestSpecies(gSaveBlock1Ptr->berryTrees[GetObjectEventBerryTreeId(gSelectedObjectEvent)].berry); + if (species == SPECIES_NONE) + return FALSE; + CreateScriptedWildMon(species, 14 + Random() % 3, ITEM_NONE); + gSaveBlock1Ptr->berryTrees[GetObjectEventBerryTreeId(gSelectedObjectEvent)].pests = FALSE; + return TRUE; +} + // Berry tree growth is frozen at their initial stage (usually, fully grown) until the player has seen the tree // For all berry trees on screen, allow normal growth void SetBerryTreesSeen(void) @@ -1849,3 +2264,210 @@ void SetBerryTreesSeen(void) } } } + +bool8 PlayerHasMulch(void) +{ + if (!OW_BERRY_MULCH_USAGE) + return FALSE; + if (CheckBagHasItem(ITEM_GROWTH_MULCH, 1)) + return TRUE; + if (CheckBagHasItem(ITEM_DAMP_MULCH, 1)) + return TRUE; + if (CheckBagHasItem(ITEM_STABLE_MULCH, 1)) + return TRUE; + if (CheckBagHasItem(ITEM_GOOEY_MULCH, 1)) + return TRUE; + if (CheckBagHasItem(ITEM_RICH_MULCH, 1)) + return TRUE; + if (CheckBagHasItem(ITEM_SURPRISE_MULCH, 1)) + return TRUE; + if (CheckBagHasItem(ITEM_BOOST_MULCH, 1)) + return TRUE; + if (CheckBagHasItem(ITEM_AMAZE_MULCH, 1)) + return TRUE; + return FALSE; +} + +#if OW_BERRY_MUTATIONS == TRUE +#define BERRY_MUTATION_CHANCE 25 + +static const u8 sBerryMutations[][3] = { + {ITEM_TO_BERRY(ITEM_IAPAPA_BERRY), ITEM_TO_BERRY(ITEM_MAGO_BERRY), ITEM_TO_BERRY(ITEM_POMEG_BERRY)}, + {ITEM_TO_BERRY(ITEM_CHESTO_BERRY), ITEM_TO_BERRY(ITEM_PERSIM_BERRY), ITEM_TO_BERRY(ITEM_KELPSY_BERRY)}, + {ITEM_TO_BERRY(ITEM_ORAN_BERRY), ITEM_TO_BERRY(ITEM_PECHA_BERRY), ITEM_TO_BERRY(ITEM_QUALOT_BERRY)}, + {ITEM_TO_BERRY(ITEM_CHESTO_BERRY), ITEM_TO_BERRY(ITEM_PERSIM_BERRY), ITEM_TO_BERRY(ITEM_KELPSY_BERRY)}, + {ITEM_TO_BERRY(ITEM_ASPEAR_BERRY), ITEM_TO_BERRY(ITEM_LEPPA_BERRY), ITEM_TO_BERRY(ITEM_HONDEW_BERRY)}, + {ITEM_TO_BERRY(ITEM_AGUAV_BERRY), ITEM_TO_BERRY(ITEM_FIGY_BERRY), ITEM_TO_BERRY(ITEM_GREPA_BERRY)}, + {ITEM_TO_BERRY(ITEM_LUM_BERRY), ITEM_TO_BERRY(ITEM_SITRUS_BERRY), ITEM_TO_BERRY(ITEM_TAMATO_BERRY)}, + {ITEM_TO_BERRY(ITEM_HONDEW_BERRY), ITEM_TO_BERRY(ITEM_YACHE_BERRY), ITEM_TO_BERRY(ITEM_LIECHI_BERRY)}, + {ITEM_TO_BERRY(ITEM_QUALOT_BERRY), ITEM_TO_BERRY(ITEM_TANGA_BERRY), ITEM_TO_BERRY(ITEM_GANLON_BERRY)}, + {ITEM_TO_BERRY(ITEM_GREPA_BERRY), ITEM_TO_BERRY(ITEM_ROSELI_BERRY), ITEM_TO_BERRY(ITEM_SALAC_BERRY)}, + {ITEM_TO_BERRY(ITEM_POMEG_BERRY), ITEM_TO_BERRY(ITEM_KASIB_BERRY), ITEM_TO_BERRY(ITEM_PETAYA_BERRY)}, + {ITEM_TO_BERRY(ITEM_KELPSY_BERRY), ITEM_TO_BERRY(ITEM_WACAN_BERRY), ITEM_TO_BERRY(ITEM_APICOT_BERRY)}, + {ITEM_TO_BERRY(ITEM_GANLON_BERRY), ITEM_TO_BERRY(ITEM_LIECHI_BERRY), ITEM_TO_BERRY(ITEM_KEE_BERRY)}, + {ITEM_TO_BERRY(ITEM_SALAC_BERRY), ITEM_TO_BERRY(ITEM_PETAYA_BERRY), ITEM_TO_BERRY(ITEM_MARANGA_BERRY)}, + // Up to one more Mutation can be added here for a total of 15 (only 4 bits are allocated) +}; + +static u8 GetMutationOutcome(u8 berry1, u8 berry2) +{ + u8 i; + for(i = 0; i < ARRAY_COUNT(sBerryMutations); i++) + { + if ((sBerryMutations[i][0] == berry1 && sBerryMutations[i][1] == berry2) + ||(sBerryMutations[i][0] == berry2 && sBerryMutations[i][1] == berry1)) + return (i + 1); + } + return 0; +} + +static u8 TryForMutation(u8 berryTreeId, u8 berry) +{ + u8 i, j, mulch; + s16 x1, x2, y1, y2; + + // Get location of current tree + for (i = 0; i < OBJECT_EVENTS_COUNT; i++) + { + if (gObjectEvents[i].trainerRange_berryTreeId == berryTreeId && gObjectEvents[i].movementType == MOVEMENT_TYPE_BERRY_TREE_GROWTH) + break; + } + if (i == OBJECT_EVENTS_COUNT) + return 0; + + x1 = gObjectEvents[i].currentCoords.x; + y1 = gObjectEvents[i].currentCoords.y; + + mulch = GetMulchByBerryTreeId(GetObjectEventBerryTreeId(i)); + + // Try mutation for each adjacent tree + for (j = 0; j < OBJECT_EVENTS_COUNT; j++) + { + if (gObjectEvents[j].active && gObjectEvents[j].movementType == MOVEMENT_TYPE_BERRY_TREE_GROWTH && GetStageByBerryTreeId(GetObjectEventBerryTreeId(j)) != BERRY_STAGE_NO_BERRY && j != i) + { + x2 = gObjectEvents[j].currentCoords.x; + y2 = gObjectEvents[j].currentCoords.y; + if (Random() % 100 < (BERRY_MUTATION_CHANCE * (mulch == ITEM_TO_MULCH(ITEM_SURPRISE_MULCH) || mulch == ITEM_TO_MULCH(ITEM_AMAZE_MULCH))) && ( + (x1 == x2 && y1 == y2 - 1) || + (x1 == x2 && y1 == y2 + 1) || + (x1 == x2 - 1 && y1 == y2) || + (x1 == x2 + 1 && y1 == y2))) + return GetMutationOutcome(berry, gSaveBlock1Ptr->berryTrees[GetObjectEventBerryTreeId(j)].berry); + } + } + return 0; +} +#endif + +struct TreeMutationBitfield { + u8 a: 2; + u8 b: 2; + u8 unused: 4; +}; + +union TreeMutation { + u8 value; + struct TreeMutationBitfield asField; +}; + +static u8 GetTreeMutationValue(u8 id) +{ +#if OW_BERRY_MUTATIONS + struct BerryTree *tree = GetBerryTreeInfo(id); + union TreeMutation myMutation; + if (tree->stopGrowth) // Pre-generated trees shouldn't have mutations + return 0; + myMutation.asField.a = tree->mutationA; + myMutation.asField.b = tree->mutationB; + return sBerryMutations[myMutation.value - 1][2]; +#else + return 0; +#endif +} + +static void SetTreeMutations(u8 id, u8 berry) +{ +#if OW_BERRY_MUTATIONS == TRUE + struct BerryTree *tree = GetBerryTreeInfo(id); + union TreeMutation myMutation; + + myMutation.value = TryForMutation(id, berry); + tree->mutationA = myMutation.asField.a; + tree->mutationB = myMutation.asField.b; +#endif +} + +static u16 GetBerryPestSpecies(u8 berryId) +{ +#if OW_BERRY_PESTS == TRUE + const struct Berry *berry = GetBerryInfo(berryId); + switch(berry->color) + { + case BERRY_COLOR_RED: + return P_FAMILY_LEDYBA ? SPECIES_LEDYBA : SPECIES_NONE; + break; + case BERRY_COLOR_BLUE: + return P_FAMILY_VOLBEAT_ILLUMISE ? SPECIES_VOLBEAT : SPECIES_NONE; + break; + case BERRY_COLOR_PURPLE: + return P_FAMILY_VOLBEAT_ILLUMISE ? SPECIES_ILLUMISE : SPECIES_NONE; + break; + case BERRY_COLOR_GREEN: + return P_FAMILY_BURMY ? SPECIES_BURMY_PLANT_CLOAK : SPECIES_NONE; + break; + case BERRY_COLOR_YELLOW: + return P_FAMILY_COMBEE ? SPECIES_COMBEE : SPECIES_NONE; + break; + case BERRY_COLOR_PINK: + return P_FAMILY_SCATTERBUG ? SPECIES_SPEWPA : SPECIES_NONE; + break; + } +#endif + return SPECIES_NONE; +} + +#define BERRY_WEEDS_CHANCE 15 +#define BERRY_PESTS_CHANCE 15 + +static void TryForWeeds(struct BerryTree *tree) +{ + if (!OW_BERRY_WEEDS) + return; + if (tree->weeds == TRUE) + return; + if (Random() % 100 < BERRY_WEEDS_CHANCE) + tree->weeds = TRUE; +} + +static void TryForPests(struct BerryTree *tree) +{ + if (!OW_BERRY_WEEDS) + return; + if (tree->pests == TRUE) + return; + if (Random() % 100 < BERRY_PESTS_CHANCE && tree->stage > BERRY_STAGE_PLANTED) + tree->pests = TRUE; +} + +static void AddTreeBonus(struct BerryTree *tree, u8 bonus) +{ + if (OW_BERRY_MOISTURE) // use watered field to save track of intermediate bonuses + { + tree->watered += bonus; + while (tree->watered > 10) + { + tree->watered -= 10; + bonus = tree->berryYield + 1; + if (bonus > GetBerryInfo(tree->berry)->maxYield) + bonus = GetBerryInfo(tree->berry)->maxYield; + tree->berryYield = bonus; + } + } + else + { + bonus = tree->berryYield + bonus / 10; + if (bonus > GetBerryInfo(tree->berry)->maxYield) + bonus = GetBerryInfo(tree->berry)->maxYield; + tree->berryYield = bonus; + } +} diff --git a/src/data/items.h b/src/data/items.h index 39038cb991..4ac253b152 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -144,6 +144,10 @@ static const u8 sTeraShardDesc[] = _("These shards may\n" "form when a Tera\n" "Pokémon faints."); +static const u8 sGenericMulchDesc[] = _("A fertilizer that\n" + "is unsuitable for\n" + "local soil."); + const struct Item gItems[] = { [ITEM_NONE] = @@ -2676,12 +2680,17 @@ const struct Item gItems[] = { .name = _("Growth Mulch"), .price = 200, +#if OW_BERRY_MULCH_USAGE == TRUE .description = COMPOUND_STRING("A fertilizer that\n" "accelerates the\n" "growth of Berries."), +#else + .description = sGenericMulchDesc, +#endif .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, // Todo + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .secondaryId = ITEM_TO_MULCH(ITEM_GROWTH_MULCH), .flingPower = 30, }, @@ -2689,12 +2698,17 @@ const struct Item gItems[] = { .name = _("Damp Mulch"), .price = 200, +#if OW_BERRY_MULCH_USAGE == TRUE .description = COMPOUND_STRING("A fertilizer that\n" "decelerates the\n" "growth of Berries."), +#else + .description = sGenericMulchDesc, +#endif .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, // Todo + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .secondaryId = ITEM_TO_MULCH(ITEM_DAMP_MULCH), .flingPower = 30, }, @@ -2702,12 +2716,17 @@ const struct Item gItems[] = { .name = _("Stable Mulch"), .price = 200, +#if OW_BERRY_MULCH_USAGE == TRUE .description = COMPOUND_STRING("A fertilizer that\n" "ups the life time\n" "of Berry trees."), +#else + .description = sGenericMulchDesc, +#endif .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, // Todo + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .secondaryId = ITEM_TO_MULCH(ITEM_STABLE_MULCH), .flingPower = 30, }, @@ -2715,12 +2734,17 @@ const struct Item gItems[] = { .name = _("Gooey Mulch"), .price = 200, +#if OW_BERRY_MULCH_USAGE == TRUE .description = COMPOUND_STRING("A fertilizer that\n" "makes more Berries\n" "regrow after fall."), +#else + .description = sGenericMulchDesc, +#endif .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, // Todo + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .secondaryId = ITEM_TO_MULCH(ITEM_GOOEY_MULCH), .flingPower = 30, }, @@ -2728,12 +2752,17 @@ const struct Item gItems[] = { .name = _("Rich Mulch"), .price = 200, +#if OW_BERRY_MULCH_USAGE == TRUE .description = COMPOUND_STRING("A fertilizer that\n" "ups the number of\n" "Berries harvested."), +#else + .description = sGenericMulchDesc, +#endif .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, // Todo + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .secondaryId = ITEM_TO_MULCH(ITEM_RICH_MULCH), .flingPower = 30, }, @@ -2741,12 +2770,17 @@ const struct Item gItems[] = { .name = _("SurprseMulch"), .price = 200, +#if OW_BERRY_MULCH_USAGE == TRUE .description = COMPOUND_STRING("A fertilizer that\n" "ups the chance of\n" "Berry mutations."), +#else + .description = sGenericMulchDesc, +#endif .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, // Todo + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .secondaryId = ITEM_TO_MULCH(ITEM_SURPRISE_MULCH), .flingPower = 30, }, @@ -2754,12 +2788,17 @@ const struct Item gItems[] = { .name = _("Boost Mulch"), .price = 200, +#if OW_BERRY_MULCH_USAGE == TRUE .description = COMPOUND_STRING("A fertilizer that\n" "ups the dry speed\n" "of soft soil."), +#else + .description = sGenericMulchDesc, +#endif .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, // Todo + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .secondaryId = ITEM_TO_MULCH(ITEM_BOOST_MULCH), .flingPower = 30, }, @@ -2767,12 +2806,17 @@ const struct Item gItems[] = { .name = _("Amaze Mulch"), .price = 200, +#if OW_BERRY_MULCH_USAGE == TRUE .description = COMPOUND_STRING("A fertilizer Rich\n" "Surprising and\n" "Boosting as well."), +#else + .description = sGenericMulchDesc, +#endif .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, // Todo + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .secondaryId = ITEM_TO_MULCH(ITEM_AMAZE_MULCH), .flingPower = 30, }, diff --git a/src/data/object_events/berry_tree_graphics_tables.h b/src/data/object_events/berry_tree_graphics_tables.h index 2969b6a78e..d2127199fd 100755 --- a/src/data/object_events/berry_tree_graphics_tables.h +++ b/src/data/object_events/berry_tree_graphics_tables.h @@ -10,7 +10,7 @@ static const struct SpriteFrameImage sPicTable_CheriBerryTree[] = { overworld_frame(gObjectEventPic_CheriBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Cheri[] = {3, 4, 4, 4, 4}; +const u8 gBerryTreePaletteSlotTable_Cheri[] = {3, 4, 4, 4, 4, 4, 4}; static const struct SpriteFrameImage sPicTable_ChestoBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -24,7 +24,7 @@ static const struct SpriteFrameImage sPicTable_ChestoBerryTree[] = { overworld_frame(gObjectEventPic_ChestoBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Chesto[] = {3, 4, 2, 2, 2}; +const u8 gBerryTreePaletteSlotTable_Chesto[] = {3, 4, 2, 2, 2, 2, 2}; static const struct SpriteFrameImage sPicTable_PechaBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -38,7 +38,7 @@ static const struct SpriteFrameImage sPicTable_PechaBerryTree[] = { overworld_frame(gObjectEventPic_PechaBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Pecha[] = {3, 4, 4, 4, 4}; +const u8 gBerryTreePaletteSlotTable_Pecha[] = {3, 4, 4, 4, 4, 4, 4}; static const struct SpriteFrameImage sPicTable_RawstBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -52,7 +52,7 @@ static const struct SpriteFrameImage sPicTable_RawstBerryTree[] = { overworld_frame(gObjectEventPic_RawstBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Rawst[] = {3, 4, 4, 4, 4}; +const u8 gBerryTreePaletteSlotTable_Rawst[] = {3, 4, 4, 4, 4, 4, 4}; static const struct SpriteFrameImage sPicTable_AspearBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -66,7 +66,7 @@ static const struct SpriteFrameImage sPicTable_AspearBerryTree[] = { overworld_frame(gObjectEventPic_AspearBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Aspear[] = {3, 4, 3, 3, 3}; +const u8 gBerryTreePaletteSlotTable_Aspear[] = {3, 4, 3, 3, 3, 3, 3}; static const struct SpriteFrameImage sPicTable_LeppaBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -80,7 +80,7 @@ static const struct SpriteFrameImage sPicTable_LeppaBerryTree[] = { overworld_frame(gObjectEventPic_LeppaBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Leppa[] = {3, 4, 3, 3, 3}; +const u8 gBerryTreePaletteSlotTable_Leppa[] = {3, 4, 3, 3, 3, 3, 3}; static const struct SpriteFrameImage sPicTable_OranBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -94,7 +94,7 @@ static const struct SpriteFrameImage sPicTable_OranBerryTree[] = { overworld_frame(gObjectEventPic_OranBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Oran[] = {3, 4, 2, 2, 2}; +const u8 gBerryTreePaletteSlotTable_Oran[] = {3, 4, 2, 2, 2, 2, 2}; static const struct SpriteFrameImage sPicTable_PersimBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -108,7 +108,7 @@ static const struct SpriteFrameImage sPicTable_PersimBerryTree[] = { overworld_frame(gObjectEventPic_PersimBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Persim[] = {3, 4, 2, 2, 2}; +const u8 gBerryTreePaletteSlotTable_Persim[] = {3, 4, 2, 2, 2, 2, 2}; static const struct SpriteFrameImage sPicTable_LumBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -122,7 +122,7 @@ static const struct SpriteFrameImage sPicTable_LumBerryTree[] = { overworld_frame(gObjectEventPic_LumBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Lum[] = {3, 4, 4, 4, 4}; +const u8 gBerryTreePaletteSlotTable_Lum[] = {3, 4, 4, 4, 4, 4, 4}; static const struct SpriteFrameImage sPicTable_SitrusBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -136,7 +136,7 @@ static const struct SpriteFrameImage sPicTable_SitrusBerryTree[] = { overworld_frame(gObjectEventPic_SitrusBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Sitrus[] = {3, 4, 4, 4, 4}; +const u8 gBerryTreePaletteSlotTable_Sitrus[] = {3, 4, 4, 4, 4, 4, 4}; static const struct SpriteFrameImage sPicTable_FigyBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -150,7 +150,7 @@ static const struct SpriteFrameImage sPicTable_FigyBerryTree[] = { overworld_frame(gObjectEventPic_FigyBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Figy[] = {3, 4, 3, 3, 3}; +const u8 gBerryTreePaletteSlotTable_Figy[] = {3, 4, 3, 3, 3, 3, 3}; static const struct SpriteFrameImage sPicTable_WikiBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -164,7 +164,7 @@ static const struct SpriteFrameImage sPicTable_WikiBerryTree[] = { overworld_frame(gObjectEventPic_WikiBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Wiki[] = {3, 4, 3, 3, 3}; +const u8 gBerryTreePaletteSlotTable_Wiki[] = {3, 4, 3, 3, 3, 3, 3}; static const struct SpriteFrameImage sPicTable_MagoBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -178,7 +178,7 @@ static const struct SpriteFrameImage sPicTable_MagoBerryTree[] = { overworld_frame(gObjectEventPic_MagoBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Mago[] = {3, 4, 3, 3, 3}; +const u8 gBerryTreePaletteSlotTable_Mago[] = {3, 4, 3, 3, 3, 3, 3}; static const struct SpriteFrameImage sPicTable_AguavBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -192,7 +192,7 @@ static const struct SpriteFrameImage sPicTable_AguavBerryTree[] = { overworld_frame(gObjectEventPic_AguavBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Aguav[] = {3, 4, 4, 4, 4}; +const u8 gBerryTreePaletteSlotTable_Aguav[] = {3, 4, 4, 4, 4, 4, 4}; static const struct SpriteFrameImage sPicTable_IapapaBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -206,7 +206,7 @@ static const struct SpriteFrameImage sPicTable_IapapaBerryTree[] = { overworld_frame(gObjectEventPic_IapapaBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Iapapa[] = {3, 4, 3, 3, 3}; +const u8 gBerryTreePaletteSlotTable_Iapapa[] = {3, 4, 3, 3, 3, 3, 3}; static const struct SpriteFrameImage sPicTable_RazzBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -220,7 +220,7 @@ static const struct SpriteFrameImage sPicTable_RazzBerryTree[] = { overworld_frame(gObjectEventPic_RazzBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Razz[] = {3, 4, 4, 4, 4}; +const u8 gBerryTreePaletteSlotTable_Razz[] = {3, 4, 4, 4, 4, 4, 4}; static const struct SpriteFrameImage sPicTable_WepearBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -234,7 +234,7 @@ static const struct SpriteFrameImage sPicTable_WepearBerryTree[] = { overworld_frame(gObjectEventPic_WepearBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Wepear[] = {3, 4, 2, 2, 2}; +const u8 gBerryTreePaletteSlotTable_Wepear[] = {3, 4, 2, 2, 2, 2, 2}; static const struct SpriteFrameImage sPicTable_PomegBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -248,7 +248,7 @@ static const struct SpriteFrameImage sPicTable_PomegBerryTree[] = { overworld_frame(gObjectEventPic_PomegBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Pomeg[] = {3, 4, 3, 3, 3}; +const u8 gBerryTreePaletteSlotTable_Pomeg[] = {3, 4, 3, 3, 3, 3, 3}; static const struct SpriteFrameImage sPicTable_KelpsyBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -262,7 +262,7 @@ static const struct SpriteFrameImage sPicTable_KelpsyBerryTree[] = { overworld_frame(gObjectEventPic_KelpsyBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Kelpsy[] = {3, 4, 2, 2, 2}; +const u8 gBerryTreePaletteSlotTable_Kelpsy[] = {3, 4, 2, 2, 2, 2, 2}; static const struct SpriteFrameImage sPicTable_HondewBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -276,7 +276,7 @@ static const struct SpriteFrameImage sPicTable_HondewBerryTree[] = { overworld_frame(gObjectEventPic_HondewBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Hondew[] = {3, 4, 5, 5, 5}; +const u8 gBerryTreePaletteSlotTable_Hondew[] = {3, 4, 5, 5, 5, 5, 5}; static const struct SpriteFrameImage sPicTable_GrepaBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -290,7 +290,7 @@ static const struct SpriteFrameImage sPicTable_GrepaBerryTree[] = { overworld_frame(gObjectEventPic_GrepaBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Grepa[] = {3, 4, 3, 3, 3}; +const u8 gBerryTreePaletteSlotTable_Grepa[] = {3, 4, 3, 3, 3, 3, 3}; static const struct SpriteFrameImage sPicTable_TamatoBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -304,7 +304,7 @@ static const struct SpriteFrameImage sPicTable_TamatoBerryTree[] = { overworld_frame(gObjectEventPic_TamatoBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Tamato[] = {3, 4, 2, 2, 2}; +const u8 gBerryTreePaletteSlotTable_Tamato[] = {3, 4, 2, 2, 2, 2, 2}; static const struct SpriteFrameImage sPicTable_CornnBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -318,7 +318,7 @@ static const struct SpriteFrameImage sPicTable_CornnBerryTree[] = { overworld_frame(gObjectEventPic_CornnBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Cornn[] = {3, 4, 2, 2, 2}; +const u8 gBerryTreePaletteSlotTable_Cornn[] = {3, 4, 2, 2, 2, 2, 2}; static const struct SpriteFrameImage sPicTable_RabutaBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -332,7 +332,7 @@ static const struct SpriteFrameImage sPicTable_RabutaBerryTree[] = { overworld_frame(gObjectEventPic_RabutaBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Rabuta[] = {3, 4, 4, 4, 4}; +const u8 gBerryTreePaletteSlotTable_Rabuta[] = {3, 4, 4, 4, 4, 4, 4}; static const struct SpriteFrameImage sPicTable_NomelBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -346,7 +346,7 @@ static const struct SpriteFrameImage sPicTable_NomelBerryTree[] = { overworld_frame(gObjectEventPic_NomelBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Nomel[] = {3, 4, 3, 3, 3}; +const u8 gBerryTreePaletteSlotTable_Nomel[] = {3, 4, 3, 3, 3, 3, 3}; static const struct SpriteFrameImage sPicTable_SpelonBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -360,7 +360,7 @@ static const struct SpriteFrameImage sPicTable_SpelonBerryTree[] = { overworld_frame(gObjectEventPic_SpelonBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Spelon[] = {3, 4, 3, 3, 3}; +const u8 gBerryTreePaletteSlotTable_Spelon[] = {3, 4, 3, 3, 3, 3, 3}; static const struct SpriteFrameImage sPicTable_PamtreBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -374,7 +374,7 @@ static const struct SpriteFrameImage sPicTable_PamtreBerryTree[] = { overworld_frame(gObjectEventPic_PamtreBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Pamtre[] = {3, 4, 2, 2, 2}; +const u8 gBerryTreePaletteSlotTable_Pamtre[] = {3, 4, 2, 2, 2, 2, 2}; static const struct SpriteFrameImage sPicTable_DurinBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -388,7 +388,7 @@ static const struct SpriteFrameImage sPicTable_DurinBerryTree[] = { overworld_frame(gObjectEventPic_DurinBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Durin[] = {3, 4, 4, 4, 4}; +const u8 gBerryTreePaletteSlotTable_Durin[] = {3, 4, 4, 4, 4, 4, 4}; static const struct SpriteFrameImage sPicTable_OccaBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -402,7 +402,7 @@ static const struct SpriteFrameImage sPicTable_OccaBerryTree[] = { overworld_frame(gObjectEventPic_OccaBerryTree, 2, 4, 5) }; -const u8 gBerryTreePaletteSlotTable_Occa[] = {3, 4, 4, 4, 4}; +const u8 gBerryTreePaletteSlotTable_Occa[] = {3, 4, 4, 4, 4, 4, 4}; static const struct SpriteFrameImage sPicTable_YacheBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -416,7 +416,7 @@ static const struct SpriteFrameImage sPicTable_YacheBerryTree[] = { overworld_frame(gObjectEventPic_YacheBerryTree, 2, 4, 5) }; -const u8 gBerryTreePaletteSlotTable_Yache[] = {3, 4, 4, 4, 4}; +const u8 gBerryTreePaletteSlotTable_Yache[] = {3, 4, 4, 4, 4, 4, 4}; static const struct SpriteFrameImage sPicTable_ChopleBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -430,7 +430,7 @@ static const struct SpriteFrameImage sPicTable_ChopleBerryTree[] = { overworld_frame(gObjectEventPic_ChopleBerryTree, 2, 4, 5) }; -const u8 gBerryTreePaletteSlotTable_Chople[] = {3, 4, 3, 3, 3}; +const u8 gBerryTreePaletteSlotTable_Chople[] = {3, 4, 3, 3, 3, 3, 3}; static const struct SpriteFrameImage sPicTable_KebiaBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -444,7 +444,7 @@ static const struct SpriteFrameImage sPicTable_KebiaBerryTree[] = { overworld_frame(gObjectEventPic_KebiaBerryTree, 2, 4, 5) }; -const u8 gBerryTreePaletteSlotTable_Kebia[] = {3, 4, 4, 4, 4}; +const u8 gBerryTreePaletteSlotTable_Kebia[] = {3, 4, 4, 4, 4, 4, 4}; static const struct SpriteFrameImage sPicTable_ShucaBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -458,7 +458,7 @@ static const struct SpriteFrameImage sPicTable_ShucaBerryTree[] = { overworld_frame(gObjectEventPic_ShucaBerryTree, 2, 4, 5) }; -const u8 gBerryTreePaletteSlotTable_Shuca[] = {3, 4, 5, 5, 5}; +const u8 gBerryTreePaletteSlotTable_Shuca[] = {3, 4, 5, 5, 5, 5, 5}; static const struct SpriteFrameImage sPicTable_PayapaBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -472,7 +472,7 @@ static const struct SpriteFrameImage sPicTable_PayapaBerryTree[] = { overworld_frame(gObjectEventPic_PayapaBerryTree, 2, 4, 5) }; -const u8 gBerryTreePaletteSlotTable_Payapa[] = {3, 4, 5, 5, 5}; +const u8 gBerryTreePaletteSlotTable_Payapa[] = {3, 4, 5, 5, 5, 5, 5}; static const struct SpriteFrameImage sPicTable_TangaBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -486,7 +486,7 @@ static const struct SpriteFrameImage sPicTable_TangaBerryTree[] = { overworld_frame(gObjectEventPic_TangaBerryTree, 2, 4, 5) }; -const u8 gBerryTreePaletteSlotTable_Tanga[] = {3, 4, 4, 4, 4}; +const u8 gBerryTreePaletteSlotTable_Tanga[] = {3, 4, 4, 4, 4, 4, 4}; static const struct SpriteFrameImage sPicTable_KasibBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -500,7 +500,7 @@ static const struct SpriteFrameImage sPicTable_KasibBerryTree[] = { overworld_frame(gObjectEventPic_KasibBerryTree, 2, 4, 5) }; -const u8 gBerryTreePaletteSlotTable_Kasib[] = {3, 4, 4, 4, 4}; +const u8 gBerryTreePaletteSlotTable_Kasib[] = {3, 4, 4, 4, 4, 4, 4}; static const struct SpriteFrameImage sPicTable_HabanBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -514,7 +514,7 @@ static const struct SpriteFrameImage sPicTable_HabanBerryTree[] = { overworld_frame(gObjectEventPic_HabanBerryTree, 2, 4, 5) }; -const u8 gBerryTreePaletteSlotTable_Haban[] = {3, 4, 3, 3, 3}; +const u8 gBerryTreePaletteSlotTable_Haban[] = {3, 4, 3, 3, 3, 3, 3}; static const struct SpriteFrameImage sPicTable_ColburBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -528,7 +528,7 @@ static const struct SpriteFrameImage sPicTable_ColburBerryTree[] = { overworld_frame(gObjectEventPic_ColburBerryTree, 2, 4, 5) }; -const u8 gBerryTreePaletteSlotTable_Colbur[] = {3, 4, 5, 5, 5}; +const u8 gBerryTreePaletteSlotTable_Colbur[] = {3, 4, 5, 5, 5, 5, 5}; static const struct SpriteFrameImage sPicTable_RoseliBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -542,7 +542,7 @@ static const struct SpriteFrameImage sPicTable_RoseliBerryTree[] = { overworld_frame(gObjectEventPic_RoseliBerryTree, 2, 4, 5) }; -const u8 gBerryTreePaletteSlotTable_Roseli[] = {3, 4, 4, 4, 4}; +const u8 gBerryTreePaletteSlotTable_Roseli[] = {3, 4, 4, 4, 4, 4, 4}; static const struct SpriteFrameImage sPicTable_LiechiBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -556,7 +556,7 @@ static const struct SpriteFrameImage sPicTable_LiechiBerryTree[] = { overworld_frame(gObjectEventPic_LiechiBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Liechi[] = {3, 4, 4, 4, 4}; +const u8 gBerryTreePaletteSlotTable_Liechi[] = {3, 4, 4, 4, 4, 4, 4}; static const struct SpriteFrameImage sPicTable_LansatBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -570,7 +570,7 @@ static const struct SpriteFrameImage sPicTable_LansatBerryTree[] = { overworld_frame(gObjectEventPic_LansatBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Lansat[] = {3, 4, 2, 2, 2}; +const u8 gBerryTreePaletteSlotTable_Lansat[] = {3, 4, 2, 2, 2, 2, 2}; const struct SpriteFrameImage sPicTable_MicleBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -584,7 +584,7 @@ const struct SpriteFrameImage sPicTable_MicleBerryTree[] = { overworld_frame(gObjectEventPic_MicleBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Micle[] = {3, 4, 4, 4, 4}; +const u8 gBerryTreePaletteSlotTable_Micle[] = {3, 4, 4, 4, 4, 4, 4}; const struct SpriteFrameImage sPicTable_CustapBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -598,7 +598,7 @@ const struct SpriteFrameImage sPicTable_CustapBerryTree[] = { overworld_frame(gObjectEventPic_CustapBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Custap[] = {3, 4, 5, 5, 5}; +const u8 gBerryTreePaletteSlotTable_Custap[] = {3, 4, 5, 5, 5, 5, 5}; const struct SpriteFrameImage sPicTable_JabocaBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -612,7 +612,7 @@ const struct SpriteFrameImage sPicTable_JabocaBerryTree[] = { overworld_frame(gObjectEventPic_JabocaBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Jaboca[] = {3, 4, 5, 5, 5}; +const u8 gBerryTreePaletteSlotTable_Jaboca[] = {3, 4, 5, 5, 5, 5, 5}; const struct SpriteFrameImage sPicTable_RowapBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -626,11 +626,11 @@ const struct SpriteFrameImage sPicTable_RowapBerryTree[] = { overworld_frame(gObjectEventPic_RowapBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Rowap[] = {3, 4, 5, 5, 5}; +const u8 gBerryTreePaletteSlotTable_Rowap[] = {3, 4, 5, 5, 5, 5, 5}; -const u8 gDeadBerryTreeObjectEventGraphicsIdTable[] = {OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES}; +const u8 gDeadBerryTreeObjectEventGraphicsIdTable[] = {OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES}; -const u8 gBerryTreeObjectEventGraphicsIdTable[] = {OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_LATE_STAGES, OBJ_EVENT_GFX_BERRY_TREE_LATE_STAGES, OBJ_EVENT_GFX_BERRY_TREE_LATE_STAGES}; +const u8 gBerryTreeObjectEventGraphicsIdTable[] = {OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_LATE_STAGES, OBJ_EVENT_GFX_BERRY_TREE_LATE_STAGES, OBJ_EVENT_GFX_BERRY_TREE_LATE_STAGES, OBJ_EVENT_GFX_BERRY_TREE_LATE_STAGES, OBJ_EVENT_GFX_BERRY_TREE_LATE_STAGES}; const struct SpriteFrameImage *const gBerryTreePicTablePointers[] = { [ITEM_CHERI_BERRY - FIRST_BERRY_INDEX] = sPicTable_CheriBerryTree, @@ -774,73 +774,3 @@ const u8 *const gBerryTreePaletteSlotTablePointers[] = { [ITEM_ENIGMA_BERRY_E_READER - FIRST_BERRY_INDEX] = gBerryTreePaletteSlotTable_Durin, }; -const u8 *const gBerryTreeObjectEventGraphicsIdTablePointers[] = { - [ITEM_CHERI_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_CHESTO_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_PECHA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_RAWST_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_ASPEAR_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_LEPPA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_ORAN_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_PERSIM_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_LUM_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_SITRUS_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_FIGY_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_WIKI_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_MAGO_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_AGUAV_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_IAPAPA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_RAZZ_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_BLUK_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_NANAB_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_WEPEAR_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_PINAP_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_POMEG_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_KELPSY_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_QUALOT_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_HONDEW_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_GREPA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_TAMATO_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_CORNN_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_MAGOST_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_RABUTA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_NOMEL_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_SPELON_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_PAMTRE_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_WATMEL_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_DURIN_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_BELUE_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_CHILAN_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_OCCA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_PASSHO_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_WACAN_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_RINDO_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_YACHE_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_CHOPLE_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_KEBIA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_SHUCA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_COBA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_PAYAPA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_TANGA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_CHARTI_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_KASIB_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_HABAN_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_COLBUR_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_BABIRI_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_ROSELI_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_LIECHI_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_GANLON_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_SALAC_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_PETAYA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_APICOT_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_LANSAT_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_STARF_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_ENIGMA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_MICLE_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_CUSTAP_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_JABOCA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_ROWAP_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_KEE_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_MARANGA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_ENIGMA_BERRY_E_READER - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, -}; diff --git a/src/data/object_events/object_event_anims.h b/src/data/object_events/object_event_anims.h index f96e52de53..e68910d159 100755 --- a/src/data/object_events/object_event_anims.h +++ b/src/data/object_events/object_event_anims.h @@ -1105,6 +1105,8 @@ static const union AnimCmd *const sAnimTable_BerryTree[] = { [BERRY_STAGE_PLANTED - 1] = sAnim_BerryTreeStage0, [BERRY_STAGE_SPROUTED - 1] = sAnim_BerryTreeStage1, [BERRY_STAGE_TALLER - 1] = sAnim_BerryTreeStage2, + [BERRY_STAGE_TRUNK - 1] = sAnim_BerryTreeStage2, + [BERRY_STAGE_BUDDING - 1] = sAnim_BerryTreeStage2, [BERRY_STAGE_FLOWERING - 1] = sAnim_BerryTreeStage3, [BERRY_STAGE_BERRIES - 1] = sAnim_BerryTreeStage4, }; diff --git a/src/data/script_menu.h b/src/data/script_menu.h index 79355748c7..c5afa87043 100644 --- a/src/data/script_menu.h +++ b/src/data/script_menu.h @@ -771,6 +771,13 @@ static const struct MenuAction MultichoiceList_TagMatchType[] = {gText_Exit}, }; +static const struct MenuAction MultichoiceList_BerryPlot[] = +{ + {gText_Fertilize}, + {gText_PlantBerry}, + {gText_Exit}, +}; + static const struct MenuAction MultichoiceList_Exit[] = { {gText_Exit}, @@ -898,6 +905,7 @@ static const struct MultichoiceListStruct sMultichoiceLists[] = [MULTI_SLATEPORT_TENT_RULES] = MULTICHOICE(MultichoiceList_SlateportTentRules), [MULTI_FALLARBOR_TENT_RULES] = MULTICHOICE(MultichoiceList_FallarborTentRules), [MULTI_TAG_MATCH_TYPE] = MULTICHOICE(MultichoiceList_TagMatchType), + [MULTI_BERRY_PLOT] = MULTICHOICE(MultichoiceList_BerryPlot), }; const u8 *const gStdStrings[] = diff --git a/src/debug.c b/src/debug.c index ad6c0e8137..420f7191ad 100644 --- a/src/debug.c +++ b/src/debug.c @@ -6,9 +6,11 @@ //AsparagusEduardo: https://github.com/AsparagusEduardo/pokeemerald/tree/InfusedEmerald_v2 //Ghoulslash: https://github.com/ghoulslash/pokeemerald //Jaizu: https://jaizu.moe/ +//AND OTHER RHH POKEEMERALD-EXPANSION CONTRIBUTORS #include "global.h" #include "battle.h" #include "battle_setup.h" +#include "berry.h" #include "clock.h" #include "coins.h" #include "credits.h" @@ -96,6 +98,7 @@ enum UtilMenu DEBUG_UTIL_MENU_ITEM_PLAYER_ID, DEBUG_UTIL_MENU_ITEM_CHEAT, DEBUG_UTIL_MENU_ITEM_EXPANSION_VER, + DEBUG_UTIL_MENU_ITEM_BERRY_FUNCTIONS, }; enum PartyBoxesMenu @@ -217,6 +220,15 @@ enum SoundMenu DEBUG_SOUND_MENU_ITEM_MUS, }; +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, +}; + // ******************************* // Constants #define DEBUG_MENU_FONT FONT_NORMAL @@ -333,6 +345,7 @@ static void DebugTask_HandleMenuInput_Battle(u8 taskId); static void DebugTask_HandleMenuInput_Give(u8 taskId); static void DebugTask_HandleMenuInput_Fill(u8 taskId); static void DebugTask_HandleMenuInput_Sound(u8 taskId); +static void DebugTask_HandleMenuInput_BerryFunctions(u8 taskId); static void DebugAction_Util_Fly(u8 taskId); static void DebugAction_Util_Warp_Warp(u8 taskId); @@ -351,6 +364,7 @@ static void DebugAction_Util_Player_Gender(u8 taskId); static void DebugAction_Util_Player_Id(u8 taskId); static void DebugAction_Util_CheatStart(u8 taskId); static void DebugAction_Util_ExpansionVersion(u8 taskId); +static void DebugAction_Util_BerryFunctions(u8 taskId); static void DebugAction_PartyBoxes_AccessPC(u8 taskId); static void DebugAction_PartyBoxes_MoveReminder(u8 taskId); @@ -416,6 +430,11 @@ static void DebugAction_Sound_SE_SelectId(u8 taskId); static void DebugAction_Sound_MUS(u8 taskId); 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); extern const u8 Debug_FlagsNotSetOverworldConfigMessage[]; extern const u8 Debug_FlagsNotSetBattleConfigMessage[]; @@ -442,6 +461,9 @@ extern const u8 Debug_CheckROMSpace[]; extern const u8 Debug_BoxFilledMessage[]; extern const u8 Debug_ShowExpansionVersion[]; +extern const u8 Debug_BerryPestsDisabled[]; +extern const u8 Debug_BerryWeedsDisabled[]; + extern const u8 FallarborTown_MoveRelearnersHouse_EventScript_ChooseMon[]; #include "data/map_group_count.h" @@ -493,6 +515,7 @@ static const u8 sDebugText_Util_Player_Gender[] = _("Toggle gender"); static const u8 sDebugText_Util_Player_Id[] = _("New Trainer ID"); static const u8 sDebugText_Util_CheatStart[] = _("Cheat start"); static const u8 sDebugText_Util_ExpansionVersion[] = _("Expansion Version"); +static const u8 sDebugText_Util_BerryFunctions[] = _("Berry Functions…{CLEAR_TO 110}{RIGHT_ARROW}"); // Party/Boxes Menu static const u8 sDebugText_PartyBoxes_AccessPC[] = _("Access PC"); static const u8 sDebugText_PartyBoxes_MoveReminder[] = _("Move Reminder"); @@ -605,6 +628,12 @@ static const u8 sDebugText_Sound_SFX[] = _("SFX…{CLEAR_TO 110}{ static const u8 sDebugText_Sound_SFX_ID[] = _("SFX ID: {STR_VAR_3} {START_BUTTON} Stop\n{STR_VAR_1} \n{STR_VAR_2}"); static const u8 sDebugText_Sound_Music[] = _("Music…{CLEAR_TO 110}{RIGHT_ARROW}"); static const u8 sDebugText_Sound_Music_ID[] = _("Music ID: {STR_VAR_3} {START_BUTTON} Stop\n{STR_VAR_1} \n{STR_VAR_2}"); +// 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"); static const u8 sDebugText_Digit_1[] = _("{LEFT_ARROW}+1{RIGHT_ARROW} "); static const u8 sDebugText_Digit_10[] = _("{LEFT_ARROW}+10{RIGHT_ARROW} "); @@ -657,19 +686,20 @@ static const struct ListMenuItem sDebugMenu_Items_Main[] = static const struct ListMenuItem sDebugMenu_Items_Utilities[] = { - [DEBUG_UTIL_MENU_ITEM_FLY] = {sDebugText_Util_FlyToMap, DEBUG_UTIL_MENU_ITEM_FLY}, - [DEBUG_UTIL_MENU_ITEM_WARP] = {sDebugText_Util_WarpToMap, DEBUG_UTIL_MENU_ITEM_WARP}, - [DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = {sDebugText_Util_SaveBlockSpace, DEBUG_UTIL_MENU_ITEM_SAVEBLOCK}, - [DEBUG_UTIL_MENU_ITEM_ROM_SPACE] = {sDebugText_Util_ROMSpace, DEBUG_UTIL_MENU_ITEM_ROM_SPACE}, - [DEBUG_UTIL_MENU_ITEM_WEATHER] = {sDebugText_Util_Weather, DEBUG_UTIL_MENU_ITEM_WEATHER}, - [DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = {sDebugText_Util_CheckWallClock, DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK}, - [DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = {sDebugText_Util_SetWallClock, DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK}, - [DEBUG_UTIL_MENU_ITEM_WATCHCREDITS] = {sDebugText_Util_WatchCredits, DEBUG_UTIL_MENU_ITEM_WATCHCREDITS}, - [DEBUG_UTIL_MENU_ITEM_PLAYER_NAME] = {sDebugText_Util_Player_Name, DEBUG_UTIL_MENU_ITEM_PLAYER_NAME}, - [DEBUG_UTIL_MENU_ITEM_PLAYER_GENDER] = {sDebugText_Util_Player_Gender, DEBUG_UTIL_MENU_ITEM_PLAYER_GENDER}, - [DEBUG_UTIL_MENU_ITEM_PLAYER_ID] = {sDebugText_Util_Player_Id, DEBUG_UTIL_MENU_ITEM_PLAYER_ID}, - [DEBUG_UTIL_MENU_ITEM_CHEAT] = {sDebugText_Util_CheatStart, DEBUG_UTIL_MENU_ITEM_CHEAT}, - [DEBUG_UTIL_MENU_ITEM_EXPANSION_VER] = {sDebugText_Util_ExpansionVersion,DEBUG_UTIL_MENU_ITEM_EXPANSION_VER}, + [DEBUG_UTIL_MENU_ITEM_FLY] = {sDebugText_Util_FlyToMap, DEBUG_UTIL_MENU_ITEM_FLY}, + [DEBUG_UTIL_MENU_ITEM_WARP] = {sDebugText_Util_WarpToMap, DEBUG_UTIL_MENU_ITEM_WARP}, + [DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = {sDebugText_Util_SaveBlockSpace, DEBUG_UTIL_MENU_ITEM_SAVEBLOCK}, + [DEBUG_UTIL_MENU_ITEM_ROM_SPACE] = {sDebugText_Util_ROMSpace, DEBUG_UTIL_MENU_ITEM_ROM_SPACE}, + [DEBUG_UTIL_MENU_ITEM_WEATHER] = {sDebugText_Util_Weather, DEBUG_UTIL_MENU_ITEM_WEATHER}, + [DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = {sDebugText_Util_CheckWallClock, DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK}, + [DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = {sDebugText_Util_SetWallClock, DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK}, + [DEBUG_UTIL_MENU_ITEM_WATCHCREDITS] = {sDebugText_Util_WatchCredits, DEBUG_UTIL_MENU_ITEM_WATCHCREDITS}, + [DEBUG_UTIL_MENU_ITEM_PLAYER_NAME] = {sDebugText_Util_Player_Name, DEBUG_UTIL_MENU_ITEM_PLAYER_NAME}, + [DEBUG_UTIL_MENU_ITEM_PLAYER_GENDER] = {sDebugText_Util_Player_Gender, DEBUG_UTIL_MENU_ITEM_PLAYER_GENDER}, + [DEBUG_UTIL_MENU_ITEM_PLAYER_ID] = {sDebugText_Util_Player_Id, DEBUG_UTIL_MENU_ITEM_PLAYER_ID}, + [DEBUG_UTIL_MENU_ITEM_CHEAT] = {sDebugText_Util_CheatStart, DEBUG_UTIL_MENU_ITEM_CHEAT}, + [DEBUG_UTIL_MENU_ITEM_EXPANSION_VER] = {sDebugText_Util_ExpansionVersion, DEBUG_UTIL_MENU_ITEM_EXPANSION_VER}, + [DEBUG_UTIL_MENU_ITEM_BERRY_FUNCTIONS] = {sDebugText_Util_BerryFunctions, DEBUG_UTIL_MENU_ITEM_BERRY_FUNCTIONS}, }; static const struct ListMenuItem sDebugMenu_Items_PartyBoxes[] = @@ -791,6 +821,15 @@ static const struct ListMenuItem sDebugMenu_Items_Sound[] = [DEBUG_SOUND_MENU_ITEM_MUS] = {sDebugText_Sound_Music, DEBUG_SOUND_MENU_ITEM_MUS}, }; +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_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}, +}; + // ******************************* // Menu Actions static void (*const sDebugMenu_Actions_Main[])(u8) = @@ -808,19 +847,20 @@ static void (*const sDebugMenu_Actions_Main[])(u8) = static void (*const sDebugMenu_Actions_Utilities[])(u8) = { - [DEBUG_UTIL_MENU_ITEM_FLY] = DebugAction_Util_Fly, - [DEBUG_UTIL_MENU_ITEM_WARP] = DebugAction_Util_Warp_Warp, - [DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = DebugAction_Util_CheckSaveBlock, - [DEBUG_UTIL_MENU_ITEM_ROM_SPACE] = DebugAction_Util_CheckROMSpace, - [DEBUG_UTIL_MENU_ITEM_WEATHER] = DebugAction_Util_Weather, - [DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = DebugAction_Util_CheckWallClock, - [DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = DebugAction_Util_SetWallClock, - [DEBUG_UTIL_MENU_ITEM_WATCHCREDITS] = DebugAction_Util_WatchCredits, - [DEBUG_UTIL_MENU_ITEM_PLAYER_NAME] = DebugAction_Util_Player_Name, - [DEBUG_UTIL_MENU_ITEM_PLAYER_GENDER] = DebugAction_Util_Player_Gender, - [DEBUG_UTIL_MENU_ITEM_PLAYER_ID] = DebugAction_Util_Player_Id, - [DEBUG_UTIL_MENU_ITEM_CHEAT] = DebugAction_Util_CheatStart, - [DEBUG_UTIL_MENU_ITEM_EXPANSION_VER] = DebugAction_Util_ExpansionVersion, + [DEBUG_UTIL_MENU_ITEM_FLY] = DebugAction_Util_Fly, + [DEBUG_UTIL_MENU_ITEM_WARP] = DebugAction_Util_Warp_Warp, + [DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = DebugAction_Util_CheckSaveBlock, + [DEBUG_UTIL_MENU_ITEM_ROM_SPACE] = DebugAction_Util_CheckROMSpace, + [DEBUG_UTIL_MENU_ITEM_WEATHER] = DebugAction_Util_Weather, + [DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = DebugAction_Util_CheckWallClock, + [DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = DebugAction_Util_SetWallClock, + [DEBUG_UTIL_MENU_ITEM_WATCHCREDITS] = DebugAction_Util_WatchCredits, + [DEBUG_UTIL_MENU_ITEM_PLAYER_NAME] = DebugAction_Util_Player_Name, + [DEBUG_UTIL_MENU_ITEM_PLAYER_GENDER] = DebugAction_Util_Player_Gender, + [DEBUG_UTIL_MENU_ITEM_PLAYER_ID] = DebugAction_Util_Player_Id, + [DEBUG_UTIL_MENU_ITEM_CHEAT] = DebugAction_Util_CheatStart, + [DEBUG_UTIL_MENU_ITEM_EXPANSION_VER] = DebugAction_Util_ExpansionVersion, + [DEBUG_UTIL_MENU_ITEM_BERRY_FUNCTIONS] = DebugAction_Util_BerryFunctions, }; static void (*const sDebugMenu_Actions_PartyBoxes[])(u8) = @@ -895,6 +935,15 @@ static void (*const sDebugMenu_Actions_Sound[])(u8) = [DEBUG_SOUND_MENU_ITEM_MUS] = DebugAction_Sound_MUS, }; +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_NEXT_STAGE] = DebugAction_BerryFunctions_NextStage, + [DEBUG_BERRY_FUNCTIONS_MENU_PESTS] = DebugAction_BerryFunctions_Pests, + [DEBUG_BERRY_FUNCTIONS_MENU_WEEDS] = DebugAction_BerryFunctions_Weeds, +}; + // ******************************* // Windows static const struct WindowTemplate sDebugMenuWindowTemplateMain = @@ -1031,6 +1080,12 @@ static const struct ListMenuTemplate sDebugMenu_ListTemplate_Sound = .totalItems = ARRAY_COUNT(sDebugMenu_Items_Sound), }; +static const struct ListMenuTemplate sDebugMenu_ListTemplate_BerryFunctions = +{ + .items = sDebugMenu_Items_BerryFunctions, + .moveCursorFunc = ListMenuDefaultCursorMoveFunc, + .totalItems = ARRAY_COUNT(sDebugMenu_Items_BerryFunctions), +}; // ******************************* // Functions universal @@ -1681,6 +1736,25 @@ static void DebugTask_HandleMenuInput_Sound(u8 taskId) } } +static void DebugTask_HandleMenuInput_BerryFunctions(u8 taskId) +{ + void (*func)(u8); + u32 input = ListMenu_ProcessInput(gTasks[taskId].tMenuTaskId); + + if (JOY_NEW(A_BUTTON)) + { + PlaySE(SE_SELECT); + if ((func = sDebugMenu_Actions_BerryFunctions[input]) != NULL) + func(taskId); + } + else if (JOY_NEW(B_BUTTON)) + { + PlaySE(SE_SELECT); + Debug_DestroyMenu(taskId); + Debug_ReShowMainMenu(); + } +} + // ******************************* // Open sub-menus static void DebugAction_OpenUtilitiesMenu(u8 taskId) @@ -1708,7 +1782,6 @@ static void DebugAction_OpenFlagsVarsMenu(u8 taskId) Debug_ShowMenu(DebugTask_HandleMenuInput_FlagsVars, gMultiuseListMenuTemplate); } - static void DebugAction_OpenGiveMenu(u8 taskId) { Debug_DestroyMenu(taskId); @@ -1727,6 +1800,12 @@ static void DebugAction_OpenSoundMenu(u8 taskId) Debug_ShowMenu(DebugTask_HandleMenuInput_Sound, sDebugMenu_ListTemplate_Sound); } +static void DebugAction_Util_BerryFunctions(u8 taskId) +{ + Debug_DestroyMenu(taskId); + Debug_ShowMenu(DebugTask_HandleMenuInput_BerryFunctions, sDebugMenu_ListTemplate_BerryFunctions); +} + // ******************************* // Actions Utilities @@ -4791,6 +4870,111 @@ SOUND_LIST_SE }; #undef X +// ******************************* +// Actions BerryFunctions + +static void DebugAction_BerryFunctions_ClearAll(u8 taskId) +{ + u8 i; + + for (i = 0; i < OBJECT_EVENTS_COUNT; i++) + { + if (gObjectEvents[i].movementType == MOVEMENT_TYPE_BERRY_TREE_GROWTH) + { + RemoveBerryTree(GetObjectEventBerryTreeId(i)); + SetBerryTreeJustPicked(gObjectEvents[i].localId, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup); + } + } + + ScriptContext_Enable(); + Debug_DestroyMenu_Full(taskId); +} + +static void DebugAction_BerryFunctions_Ready(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)]; + if (tree->stage != BERRY_STAGE_NO_BERRY) + { + tree->stage = BERRY_STAGE_BERRIES - 1; + BerryTreeGrow(tree); + } + } + } + + ScriptContext_Enable(); + 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; + + if (!OW_BERRY_PESTS) + { + Debug_DestroyMenu_Full_Script(taskId, Debug_BerryPestsDisabled); + return; + } + + for (i = 0; i < OBJECT_EVENTS_COUNT; i++) + { + if (gObjectEvents[i].movementType == MOVEMENT_TYPE_BERRY_TREE_GROWTH) + { + if (gSaveBlock1Ptr->berryTrees[GetObjectEventBerryTreeId(i)].stage != BERRY_STAGE_PLANTED) + gSaveBlock1Ptr->berryTrees[GetObjectEventBerryTreeId(i)].pests = TRUE; + } + } + + ScriptContext_Enable(); + Debug_DestroyMenu_Full(taskId); +} + +static void DebugAction_BerryFunctions_Weeds(u8 taskId) +{ + u8 i; + + if (!OW_BERRY_WEEDS) + { + Debug_DestroyMenu_Full_Script(taskId, Debug_BerryWeedsDisabled); + return; + } + + for (i = 0; i < OBJECT_EVENTS_COUNT; i++) + { + if (gObjectEvents[i].movementType == MOVEMENT_TYPE_BERRY_TREE_GROWTH) + { + gSaveBlock1Ptr->berryTrees[GetObjectEventBerryTreeId(i)].weeds = TRUE; + } + } + + ScriptContext_Enable(); + Debug_DestroyMenu_Full(taskId); +} + // ******************************* // Actions Party/Boxes diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 6cd6955031..fc14b5127a 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -1888,7 +1888,7 @@ static void SetBerryTreeGraphics(struct ObjectEvent *objectEvent, struct Sprite if (berryId > ITEM_TO_BERRY(LAST_BERRY_INDEX)) berryId = 0; - ObjectEventSetGraphicsId(objectEvent, gBerryTreeObjectEventGraphicsIdTablePointers[berryId][berryStage]); + ObjectEventSetGraphicsId(objectEvent, gBerryTreeObjectEventGraphicsIdTable[berryStage]); sprite->images = gBerryTreePicTablePointers[berryId]; sprite->oam.paletteNum = gBerryTreePaletteSlotTablePointers[berryId][berryStage]; StartSpriteAnim(sprite, berryStage); diff --git a/src/item_menu.c b/src/item_menu.c index 8067742579..3753e4f2dc 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -210,6 +210,7 @@ static void ConfirmToss(u8); static void CancelToss(u8); static void ConfirmSell(u8); static void CancelSell(u8); +static void Task_FadeAndCloseBagMenuIfMulch(u8 taskId); static const struct BgTemplate sBgTemplates_ItemMenu[] = { @@ -351,7 +352,8 @@ static const TaskFunc sContextMenuFuncs[] = { [ITEMMENULOCATION_QUIZ_LADY] = Task_ItemContext_Normal, [ITEMMENULOCATION_APPRENTICE] = Task_ItemContext_Normal, [ITEMMENULOCATION_WALLY] = NULL, - [ITEMMENULOCATION_PCBOX] = Task_ItemContext_GiveToPC + [ITEMMENULOCATION_PCBOX] = Task_ItemContext_GiveToPC, + [ITEMMENULOCATION_BERRY_TREE_MULCH] = Task_FadeAndCloseBagMenuIfMulch, }; static const struct YesNoFuncTable sYesNoTossFunctions = {ConfirmToss, CancelToss}; @@ -577,6 +579,12 @@ void CB2_ChooseBerry(void) GoToBagMenu(ITEMMENULOCATION_BERRY_TREE, BERRIES_POCKET, CB2_ReturnToFieldContinueScript); } +// Choosing mulch to use +void CB2_ChooseMulch(void) +{ + GoToBagMenu(ITEMMENULOCATION_BERRY_TREE_MULCH, ITEMS_POCKET, CB2_ReturnToFieldContinueScript); +} + // Choosing berry for Berry Blender or Berry Crush void ChooseBerryForMachine(void (*exitCallback)(void)) { @@ -629,7 +637,8 @@ void GoToBagMenu(u8 location, u8 pocket, void ( *exitCallback)()) if (pocket < POCKETS_COUNT) gBagPosition.pocket = pocket; if (gBagPosition.location == ITEMMENULOCATION_BERRY_TREE || - gBagPosition.location == ITEMMENULOCATION_BERRY_BLENDER_CRUSH) + gBagPosition.location == ITEMMENULOCATION_BERRY_BLENDER_CRUSH || + gBagPosition.location == ITEMMENULOCATION_BERRY_TREE_MULCH) gBagMenu->pocketSwitchDisabled = TRUE; gBagMenu->newScreenCallback = NULL; gBagMenu->toSwapPos = NOT_SWAPPING; @@ -1078,6 +1087,23 @@ void Task_FadeAndCloseBagMenu(u8 taskId) gTasks[taskId].func = Task_CloseBagMenu; } +static void Task_FadeAndCloseBagMenuIfMulch(u8 taskId) +{ + if (gSpecialVar_ItemId == ITEM_GROWTH_MULCH || + gSpecialVar_ItemId == ITEM_DAMP_MULCH || + gSpecialVar_ItemId == ITEM_STABLE_MULCH || + gSpecialVar_ItemId == ITEM_GOOEY_MULCH || + gSpecialVar_ItemId == ITEM_RICH_MULCH || + gSpecialVar_ItemId == ITEM_SURPRISE_MULCH || + gSpecialVar_ItemId == ITEM_BOOST_MULCH || + gSpecialVar_ItemId == ITEM_AMAZE_MULCH) + { + Task_FadeAndCloseBagMenu(taskId); + return; + } + DisplayDadsAdviceCannotUseItemMessage(taskId, FALSE); +} + static void Task_CloseBagMenu(u8 taskId) { s16 *data = gTasks[taskId].data; @@ -1588,6 +1614,7 @@ static void OpenContextMenu(u8 taskId) case ITEMMENULOCATION_SHOP: case ITEMMENULOCATION_BERRY_TREE: case ITEMMENULOCATION_ITEMPC: + case ITEMMENULOCATION_BERRY_TREE_MULCH: default: if (MenuHelpers_IsLinkActive() == TRUE || InUnionRoom() == TRUE) { diff --git a/src/item_use.c b/src/item_use.c index b16169a9ba..585f5c754a 100644 --- a/src/item_use.c +++ b/src/item_use.c @@ -161,7 +161,7 @@ static void DisplayCannotUseItemMessage(u8 taskId, bool8 isUsingRegisteredKeyIte DisplayItemMessageOnField(taskId, gStringVar4, Task_CloseCantUseKeyItemMessage); } -static void DisplayDadsAdviceCannotUseItemMessage(u8 taskId, bool8 isUsingRegisteredKeyItemOnField) +void DisplayDadsAdviceCannotUseItemMessage(u8 taskId, bool8 isUsingRegisteredKeyItemOnField) { DisplayCannotUseItemMessage(taskId, isUsingRegisteredKeyItemOnField, gText_DadsAdvice); } diff --git a/src/strings.c b/src/strings.c index f23ad3fca5..565f0a8f62 100644 --- a/src/strings.c +++ b/src/strings.c @@ -267,7 +267,8 @@ const u8 *const gBagMenu_ReturnToStrings[] = [ITEMMENULOCATION_QUIZ_LADY] = gText_TheField, [ITEMMENULOCATION_APPRENTICE] = gText_TheField, [ITEMMENULOCATION_WALLY] = gText_TheBattle, - [ITEMMENULOCATION_PCBOX] = gText_ThePC + [ITEMMENULOCATION_PCBOX] = gText_ThePC, + [ITEMMENULOCATION_BERRY_TREE_MULCH] = gText_TheField, }; const u8 *const gPyramidBagMenu_ReturnToStrings[] = @@ -1843,3 +1844,5 @@ const u8 gText_Berries[] = _("BERRIES"); const u8 gText_ExpShareOn[] = _("The Exp. Share has been turned on.{PAUSE_UNTIL_PRESS}"); const u8 gText_ExpShareOff[] = _("The Exp. Share has been turned off.{PAUSE_UNTIL_PRESS}"); const u8 gText_BasePointsResetToZero[] = _("{STR_VAR_1}'s base points\nwere all reset to zero!{PAUSE_UNTIL_PRESS}"); +const u8 gText_Fertilize[] = _("FERTILIZE"); +const u8 gText_PlantBerry[] = _("PLANT BERRY");