mirror of
https://github.com/pret/pokeplatinum.git
synced 2026-08-20 00:15:40 -05:00
Document berry_patches.c, clean up berry_data.c
This commit is contained in:
@@ -1,87 +1,51 @@
|
||||
#ifndef POKEPLATINUM_BERRY_DATA_H
|
||||
#define POKEPLATINUM_BERRY_DATA_H
|
||||
|
||||
#include "struct_decls/struct_berry_data_decl.h"
|
||||
|
||||
#include "narc.h"
|
||||
#include "strbuf.h"
|
||||
|
||||
// These must be #defines for csv2bin
|
||||
#define FIRMNESS_VERY_SOFT 1
|
||||
#define FIRMNESS_SOFT 2
|
||||
#define FIRMNESS_HARD 3
|
||||
#define FIRMNESS_VERY_HARD 4
|
||||
#define FIRMNESS_SUPER_HARD 5
|
||||
|
||||
/*
|
||||
* Constructs a new NARC which contains an open FSFile to the berry data archive.
|
||||
*
|
||||
* @param heapID: ID of the heap to alloc from
|
||||
*
|
||||
* @returns: Pointer to the newly-allocated NARC
|
||||
*/
|
||||
enum BerryAttribute {
|
||||
BERRYATTR_SIZE = 0,
|
||||
BERRYATTR_FIRMNESS,
|
||||
BERRYATTR_YIELD_CATEGORY,
|
||||
BERRYATTR_STAGE_DURATION,
|
||||
BERRYATTR_MOISTURE_DRAIN_RATE,
|
||||
BERRYATTR_SPICINESS,
|
||||
BERRYATTR_DRYNESS,
|
||||
BERRYATTR_SWEETNESS,
|
||||
BERRYATTR_BITTERNESS,
|
||||
BERRYATTR_SOURNESS,
|
||||
BERRYATTR_SMOOTHNESS,
|
||||
};
|
||||
|
||||
typedef struct BerryData {
|
||||
u16 size;
|
||||
u8 firmness;
|
||||
u8 yieldCategory;
|
||||
u8 stageDuration;
|
||||
u8 moistureDrainRate;
|
||||
u8 spiciness;
|
||||
u8 dryness;
|
||||
u8 sweetness;
|
||||
u8 bitterness;
|
||||
u8 sourness;
|
||||
u8 smoothness;
|
||||
} BerryData;
|
||||
|
||||
NARC *BerryData_NARC_ctor(u32 heapID);
|
||||
|
||||
BerryData *sub_020973A8(NARC *param0, u32 param1, u32 param2);
|
||||
|
||||
/*
|
||||
* Closes the wrapped FSFile and returns the NARC allocation to the heap from whence it came.
|
||||
*
|
||||
* @param narc: Pointer to the NARC
|
||||
*/
|
||||
BerryData *BerryData_LoadFromOpenNARC(NARC *narc, u32 memberIdx, u32 heapID);
|
||||
void BerryData_NARC_dtor(NARC *narc);
|
||||
|
||||
/*
|
||||
* Creates a new buffer large enough to hold the data of the specified
|
||||
* NARC member in 'nuts_data.narc', then reads the data.
|
||||
*
|
||||
* @param index: Index of the NARC member within 'nuts_data.narc' which contains the berry's data
|
||||
* @param heapID: ID of the heap to alloc from
|
||||
*
|
||||
* @returns: Pointer to the allocated buffer which contains the data that was read.
|
||||
*/
|
||||
BerryData *BerryData_LoadDataByNarcMemberIndex(u32 index, u32 heapID);
|
||||
|
||||
/*
|
||||
* Creates a new buffer large enough to hold the data of the
|
||||
* specified berry, then reads the data from nuts_data.narc
|
||||
*
|
||||
* @param itemID: Item ID of the berry for which to read the data
|
||||
* @param heapID: ID of the heap to alloc from
|
||||
*
|
||||
* @returns: Pointer to the allocated buffer which contains the data that was read.
|
||||
*/
|
||||
BerryData *BerryData_Load(u32 memberIdx, u32 heapID);
|
||||
BerryData *BerryData_LoadDataByItemID(u32 itemID, u32 heapID);
|
||||
|
||||
/*
|
||||
* Retrieves the value of the specified attribute from a BerryData buffer
|
||||
*
|
||||
* @param berryData: Pointer to the buffer holding the berry data
|
||||
* @param attributeID: ID of the attribute to retrieve the value for
|
||||
*
|
||||
* @returns: The value of the specified attribute
|
||||
*/
|
||||
u32 BerryData_GetAttribute(BerryData *berryData, u32 attributeID);
|
||||
|
||||
/*
|
||||
* Creates a new string buffer large enough to hold the
|
||||
* name of the specified berry, then reads the string.
|
||||
*
|
||||
* @param index: Index of the NARC member within 'nuts_data.narc' which contains the berry's data
|
||||
* @param heapID: ID of the heap to alloc from
|
||||
*
|
||||
* @returns: Pointer to the allocated buffer which contains the string that was read.
|
||||
*/
|
||||
Strbuf *BerryData_AllocAndGetName(u16 index, u32 heapID);
|
||||
|
||||
/*
|
||||
* Creates a new string buffer large enough to hold the
|
||||
* description of the specified berry, then reads the string.
|
||||
*
|
||||
* @param index: Index of the NARC member within 'nuts_data.narc' which contains the berry's data
|
||||
* @param heapID: ID of the heap to alloc from
|
||||
*
|
||||
* @returns: Pointer to the allocated buffer which contains the string that was read.
|
||||
*/
|
||||
Strbuf *BerryData_AllocAndGetDescription(u16 index, u16 heapID);
|
||||
Strbuf *BerryData_AllocAndGetName(u16 memberIdx, u32 heapID);
|
||||
Strbuf *BerryData_AllocAndGetDescription(u16 memberIdx, u16 heapID);
|
||||
|
||||
#endif // POKEPLATINUM_BERRY_DATA_H
|
||||
|
||||
67
include/berry_patches.h
Normal file
67
include/berry_patches.h
Normal file
@@ -0,0 +1,67 @@
|
||||
#ifndef POKEPLATINUM_BERRY_PATCHES_H
|
||||
#define POKEPLATINUM_BERRY_PATCHES_H
|
||||
|
||||
#include "constants/heap.h"
|
||||
|
||||
#define MAX_BERRY_PATCHES 128
|
||||
|
||||
enum BerryGrowthStage {
|
||||
BERRY_GROWTH_STAGE_NONE = 0,
|
||||
BERRY_GROWTH_STAGE_PLANTED,
|
||||
BERRY_GROWTH_STAGE_SPROUTED,
|
||||
BERRY_GROWTH_STAGE_GROWING,
|
||||
BERRY_GROWTH_STAGE_BLOOMING,
|
||||
BERRY_GROWTH_STAGE_FRUIT,
|
||||
};
|
||||
|
||||
enum MulchType {
|
||||
MULCH_TYPE_NONE = 0,
|
||||
MULCH_TYPE_GROWTH,
|
||||
MULCH_TYPE_DAMP,
|
||||
MULCH_TYPE_STABLE,
|
||||
MULCH_TYPE_GOOEY,
|
||||
};
|
||||
|
||||
enum SoilMoisture {
|
||||
SOIL_VERY_DRY = 0,
|
||||
SOIL_DRY,
|
||||
SOIL_MOIST,
|
||||
};
|
||||
|
||||
typedef struct BerryPatch {
|
||||
u8 berryID;
|
||||
u8 growthStage;
|
||||
u16 stageMinutesRemaining;
|
||||
u16 moistureMinutesRemaining;
|
||||
u8 replantCount;
|
||||
u16 yield;
|
||||
u8 moistureRating;
|
||||
u8 yieldRating;
|
||||
u8 mulchType;
|
||||
u8 isGrowing;
|
||||
} BerryPatch;
|
||||
|
||||
typedef struct BerryGrowthData {
|
||||
u8 stageDuration;
|
||||
u8 moistureDrainRate;
|
||||
u8 yieldCategory;
|
||||
} BerryGrowthData;
|
||||
|
||||
void BerryPatches_Clear(BerryPatch *patches);
|
||||
void BerryPatches_Init(BerryPatch *patches, enum HeapId heapID, const u16 *initPatches, int initSize);
|
||||
BerryGrowthData *BerryGrowthData_Init(enum HeapId heapID);
|
||||
enum BerryGrowthStage BerryPatches_GetPatchGrowthStage(const BerryPatch *patches, int patchID);
|
||||
int BerryPatches_GetPatchBerryID(const BerryPatch *patches, int patchID);
|
||||
enum SoilMoisture BerryPatches_GetPatchMoisture(const BerryPatch *patches, int patchID);
|
||||
int BerryPatches_GetPatchYieldRating(const BerryPatch *patches, int patchID);
|
||||
void BerryPatches_PlantInPatch(BerryPatch *patches, int patchID, const BerryGrowthData *growthData, int berryID);
|
||||
void BerryPatches_ResetPatchMoisture(BerryPatch *patches, int patchID);
|
||||
BOOL BerryPatches_IsPatchGrowing(const BerryPatch *patches, int patchID);
|
||||
void BerryPatches_SetIsPatchGrowing(BerryPatch *patches, int patchID, BOOL isGrowing);
|
||||
enum MulchType BerryPatches_GetPatchMulchType(const BerryPatch *patches, int patchID);
|
||||
void BerryPatches_SetPatchMulchType(BerryPatch *patches, int patchID, enum MulchType mulchType);
|
||||
int BerryPatches_GetPatchYield(const BerryPatch *patches, int patchID);
|
||||
int BerryPatches_HarvestPatch(BerryPatch *patches, int patchID);
|
||||
void BerryPatches_ElapseMinutes(BerryPatch *patches, const BerryGrowthData *growthData, int minutesPassed);
|
||||
|
||||
#endif // POKEPLATINUM_BERRY_PATCHES_H
|
||||
@@ -4,12 +4,11 @@
|
||||
#include "constants/savedata/save_table.h"
|
||||
#include "constants/string.h"
|
||||
|
||||
#include "struct_decls/struct_02027854_decl.h"
|
||||
#include "struct_decls/struct_02027860_decl.h"
|
||||
#include "struct_defs/sentence.h"
|
||||
#include "struct_defs/struct_02027854.h"
|
||||
#include "struct_defs/struct_02027860.h"
|
||||
|
||||
#include "berry_patches.h"
|
||||
#include "savedata.h"
|
||||
#include "strbuf.h"
|
||||
|
||||
@@ -21,7 +20,7 @@ typedef struct ExtraSaveKey {
|
||||
} ExtraSaveKey;
|
||||
|
||||
typedef struct MiscSaveBlock {
|
||||
UnkStruct_02027854 unk_00[128];
|
||||
BerryPatch berryPatches[MAX_BERRY_PATCHES];
|
||||
UnkStruct_02027860 unk_680;
|
||||
u16 rivalName[TRAINER_NAME_LEN + 1];
|
||||
u16 tabletName[TABLET_NAME_LEN + 1]; // used in shaymin event
|
||||
@@ -40,7 +39,7 @@ int MiscSaveBlock_SaveSize(void);
|
||||
void MiscSaveBlock_Init(MiscSaveBlock *miscSave);
|
||||
MiscSaveBlock *SaveData_MiscSaveBlock(SaveData *saveData);
|
||||
const MiscSaveBlock *SaveData_MiscSaveBlockConst(const SaveData *saveData);
|
||||
UnkStruct_02027854 *sub_02027854(SaveData *saveData);
|
||||
BerryPatch *MiscSaveBlock_GetBerryPatches(SaveData *saveData);
|
||||
UnkStruct_02027860 *sub_02027860(SaveData *saveData);
|
||||
const u16 *MiscSaveBlock_RivalName(const MiscSaveBlock *miscSave);
|
||||
void MiscSaveBlock_SetRivalName(MiscSaveBlock *miscSave, Strbuf *name);
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
#ifndef POKEPLATINUM_STRUCT_02027854_DECL_H
|
||||
#define POKEPLATINUM_STRUCT_02027854_DECL_H
|
||||
|
||||
typedef struct UnkStruct_02027854_t UnkStruct_02027854;
|
||||
|
||||
#endif // POKEPLATINUM_STRUCT_02027854_DECL_H
|
||||
@@ -1,6 +0,0 @@
|
||||
#ifndef POKEPLATINUM_STRUCT_BERRY_DATA_DECL_H
|
||||
#define POKEPLATINUM_STRUCT_BERRY_DATA_DECL_H
|
||||
|
||||
typedef struct BerryData BerryData;
|
||||
|
||||
#endif // POKEPLATINUM_STRUCT_BERRY_DATA_DECL_H
|
||||
@@ -1,17 +0,0 @@
|
||||
#ifndef POKEPLATINUM_STRUCT_02027854_H
|
||||
#define POKEPLATINUM_STRUCT_02027854_H
|
||||
|
||||
typedef struct UnkStruct_02027854_t {
|
||||
u8 unk_00;
|
||||
u8 unk_01;
|
||||
u16 unk_02;
|
||||
u16 unk_04;
|
||||
u8 unk_06;
|
||||
u16 unk_08;
|
||||
u8 unk_0A;
|
||||
u8 unk_0B;
|
||||
u8 unk_0C;
|
||||
u8 unk_0D;
|
||||
} UnkStruct_02027854;
|
||||
|
||||
#endif // POKEPLATINUM_STRUCT_02027854_H
|
||||
@@ -1,10 +0,0 @@
|
||||
#ifndef POKEPLATINUM_STRUCT_02027BF4_H
|
||||
#define POKEPLATINUM_STRUCT_02027BF4_H
|
||||
|
||||
typedef struct {
|
||||
u8 unk_00;
|
||||
u8 unk_01;
|
||||
u8 unk_02;
|
||||
} UnkStruct_02027BF4;
|
||||
|
||||
#endif // POKEPLATINUM_STRUCT_02027BF4_H
|
||||
@@ -1,24 +0,0 @@
|
||||
#ifndef POKEPLATINUM_UNK_02027B70_H
|
||||
#define POKEPLATINUM_UNK_02027B70_H
|
||||
|
||||
#include "struct_decls/struct_02027854_decl.h"
|
||||
#include "struct_defs/struct_02027BF4.h"
|
||||
|
||||
void sub_02027B70(UnkStruct_02027854 *param0);
|
||||
void sub_02027B90(UnkStruct_02027854 *param0, int param1, const u16 *param2, int param3);
|
||||
UnkStruct_02027BF4 *sub_02027BF4(int param0);
|
||||
int sub_02027D04(const UnkStruct_02027854 *param0, int param1);
|
||||
int sub_02027D10(const UnkStruct_02027854 *param0, int param1);
|
||||
int sub_02027D18(const UnkStruct_02027854 *param0, int param1);
|
||||
int sub_02027D34(const UnkStruct_02027854 *param0, int param1);
|
||||
void sub_02027D40(UnkStruct_02027854 *param0, int param1, const UnkStruct_02027BF4 *param2, int param3);
|
||||
void sub_02027D78(UnkStruct_02027854 *param0, int param1);
|
||||
BOOL sub_02027D84(const UnkStruct_02027854 *param0, int param1);
|
||||
void sub_02027D90(UnkStruct_02027854 *param0, int param1, BOOL param2);
|
||||
int sub_02027D9C(const UnkStruct_02027854 *param0, int param1);
|
||||
void sub_02027DA8(UnkStruct_02027854 *param0, int param1, int param2);
|
||||
int sub_02027DB4(const UnkStruct_02027854 *param0, int param1);
|
||||
int sub_02027DC0(UnkStruct_02027854 *param0, int param1);
|
||||
void sub_02027EAC(UnkStruct_02027854 *param0, const UnkStruct_02027BF4 *param1, int param2);
|
||||
|
||||
#endif // POKEPLATINUM_UNK_02027B70_H
|
||||
@@ -112,7 +112,7 @@ Static main
|
||||
Object main.nef.p/src_unk_0202631C.c.o
|
||||
Object main.nef.p/src_savedata_misc.c.o
|
||||
Object main.nef.p/src_game_options.c.o
|
||||
Object main.nef.p/src_unk_02027B70.c.o
|
||||
Object main.nef.p/src_berry_patches.c.o
|
||||
Object main.nef.p/src_unk_02027F50.c.o
|
||||
Object main.nef.p/src_unk_02027F84.c.o
|
||||
Object main.nef.p/src_unk_02028124.c.o
|
||||
|
||||
@@ -420,8 +420,8 @@ message_bank_files = files(
|
||||
'message_bank_unk_0420.gmm',
|
||||
'message_bank_unk_0421.gmm',
|
||||
'message_bank_unk_0422.gmm',
|
||||
'message_bank_unk_0423.gmm',
|
||||
'message_bank_unk_0424.gmm',
|
||||
'message_bank_berry_descriptions.gmm',
|
||||
'message_bank_berry_names.gmm',
|
||||
'message_bank_unk_0425.gmm',
|
||||
'message_bank_unk_0426.gmm',
|
||||
'message_bank_unk_0427.gmm',
|
||||
|
||||
@@ -421,8 +421,8 @@ message_bank_unk_0419
|
||||
message_bank_unk_0420
|
||||
message_bank_unk_0421
|
||||
message_bank_unk_0422
|
||||
message_bank_unk_0423
|
||||
message_bank_unk_0424
|
||||
message_bank_berry_descriptions
|
||||
message_bank_berry_names
|
||||
message_bank_unk_0425
|
||||
message_bank_unk_0426
|
||||
message_bank_unk_0427
|
||||
|
||||
@@ -1,34 +1,22 @@
|
||||
#include "berry_data.h"
|
||||
|
||||
#include <nitro.h>
|
||||
#include <string.h>
|
||||
#include "constants/items.h"
|
||||
#include "constants/narc.h"
|
||||
|
||||
#include "text/pl_msg.naix"
|
||||
|
||||
#include "message.h"
|
||||
#include "narc.h"
|
||||
#include "strbuf.h"
|
||||
|
||||
typedef struct BerryData {
|
||||
u16 size;
|
||||
u8 firmness;
|
||||
u8 yieldCategory;
|
||||
u8 stageDuration;
|
||||
u8 moistureDrainRate;
|
||||
u8 spiciness;
|
||||
u8 dryness;
|
||||
u8 sweetness;
|
||||
u8 bitterness;
|
||||
u8 sourness;
|
||||
u8 smoothness;
|
||||
} BerryData;
|
||||
|
||||
NARC *BerryData_NARC_ctor(u32 heapID)
|
||||
{
|
||||
return NARC_ctor(NARC_INDEX_ITEMTOOL__ITEMDATA__NUTS_DATA, heapID);
|
||||
}
|
||||
|
||||
BerryData *sub_020973A8(NARC *param0, u32 param1, u32 param2)
|
||||
BerryData *BerryData_LoadFromOpenNARC(NARC *narc, u32 memberIdx, u32 heapID)
|
||||
{
|
||||
return NARC_AllocAndReadWholeMember(param0, 0 + param1, param2);
|
||||
return NARC_AllocAndReadWholeMember(narc, memberIdx, heapID);
|
||||
}
|
||||
|
||||
void BerryData_NARC_dtor(NARC *narc)
|
||||
@@ -36,66 +24,58 @@ void BerryData_NARC_dtor(NARC *narc)
|
||||
NARC_dtor(narc);
|
||||
}
|
||||
|
||||
BerryData *BerryData_LoadDataByNarcMemberIndex(u32 index, u32 heapID)
|
||||
BerryData *BerryData_Load(u32 memberIdx, u32 heapID)
|
||||
{
|
||||
return NARC_AllocAndReadWholeMemberByIndexPair(NARC_INDEX_ITEMTOOL__ITEMDATA__NUTS_DATA, 0 + index, heapID);
|
||||
return NARC_AllocAndReadWholeMemberByIndexPair(NARC_INDEX_ITEMTOOL__ITEMDATA__NUTS_DATA, memberIdx, heapID);
|
||||
}
|
||||
|
||||
BerryData *BerryData_LoadDataByItemID(u32 itemID, u32 heapID)
|
||||
{
|
||||
return BerryData_LoadDataByNarcMemberIndex(itemID - 149, heapID);
|
||||
return BerryData_Load(itemID - FIRST_BERRY_IDX, heapID);
|
||||
}
|
||||
|
||||
u32 BerryData_GetAttribute(BerryData *berryData, u32 attributeID)
|
||||
{
|
||||
switch (attributeID) {
|
||||
case 0:
|
||||
case BERRYATTR_SIZE:
|
||||
return berryData->size;
|
||||
case 1:
|
||||
case BERRYATTR_FIRMNESS:
|
||||
return berryData->firmness;
|
||||
case 2:
|
||||
case BERRYATTR_YIELD_CATEGORY:
|
||||
return berryData->yieldCategory;
|
||||
case 3:
|
||||
case BERRYATTR_STAGE_DURATION:
|
||||
return berryData->stageDuration;
|
||||
case 4:
|
||||
case BERRYATTR_MOISTURE_DRAIN_RATE:
|
||||
return berryData->moistureDrainRate;
|
||||
case 5:
|
||||
case BERRYATTR_SPICINESS:
|
||||
return berryData->spiciness;
|
||||
case 6:
|
||||
case BERRYATTR_DRYNESS:
|
||||
return berryData->dryness;
|
||||
case 7:
|
||||
case BERRYATTR_SWEETNESS:
|
||||
return berryData->sweetness;
|
||||
case 8:
|
||||
case BERRYATTR_BITTERNESS:
|
||||
return berryData->bitterness;
|
||||
case 9:
|
||||
case BERRYATTR_SOURNESS:
|
||||
return berryData->sourness;
|
||||
case 10:
|
||||
case BERRYATTR_SMOOTHNESS:
|
||||
return berryData->smoothness;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Strbuf *BerryData_AllocAndGetName(u16 index, u32 heapID)
|
||||
Strbuf *BerryData_AllocAndGetName(u16 memberIdx, u32 heapID)
|
||||
{
|
||||
MessageLoader *v0;
|
||||
Strbuf *v1;
|
||||
|
||||
v0 = MessageLoader_Init(1, 26, 424, heapID);
|
||||
v1 = MessageLoader_GetNewStrbuf(v0, index);
|
||||
|
||||
MessageLoader_Free(v0);
|
||||
return v1;
|
||||
MessageLoader *loader = MessageLoader_Init(MESSAGE_LOADER_NARC_HANDLE, NARC_INDEX_MSGDATA__PL_MSG, message_bank_berry_names, heapID);
|
||||
Strbuf *name = MessageLoader_GetNewStrbuf(loader, memberIdx);
|
||||
MessageLoader_Free(loader);
|
||||
return name;
|
||||
}
|
||||
|
||||
Strbuf *BerryData_AllocAndGetDescription(u16 index, u16 heapID)
|
||||
Strbuf *BerryData_AllocAndGetDescription(u16 memberIdx, u16 heapID)
|
||||
{
|
||||
MessageLoader *v0;
|
||||
Strbuf *v1;
|
||||
|
||||
v0 = MessageLoader_Init(1, 26, 423, heapID);
|
||||
v1 = MessageLoader_GetNewStrbuf(v0, index);
|
||||
|
||||
MessageLoader_Free(v0);
|
||||
return v1;
|
||||
MessageLoader *loader = MessageLoader_Init(MESSAGE_LOADER_NARC_HANDLE, NARC_INDEX_MSGDATA__PL_MSG, message_bank_berry_descriptions, heapID);
|
||||
Strbuf *desc = MessageLoader_GetNewStrbuf(loader, memberIdx);
|
||||
MessageLoader_Free(loader);
|
||||
return desc;
|
||||
}
|
||||
|
||||
329
src/berry_patches.c
Normal file
329
src/berry_patches.c
Normal file
@@ -0,0 +1,329 @@
|
||||
#include "berry_patches.h"
|
||||
|
||||
#include "constants/heap.h"
|
||||
#include "constants/items.h"
|
||||
|
||||
#include "berry_data.h"
|
||||
#include "heap.h"
|
||||
#include "narc.h"
|
||||
|
||||
#define BASE_HARVEST_STAGES 4
|
||||
#define BASE_MAX_REPLANT_COUNT 10
|
||||
#define MAX_MOISTURE_RATING 100
|
||||
#define MAX_YIELD_RATING 5
|
||||
|
||||
static void ZeroBerryPatch(BerryPatch *berryPatch);
|
||||
static int CalcBerryYield(BerryPatch *berryPatch, const BerryGrowthData *growthData);
|
||||
static int CalcMinutesRemainingInStage(const BerryGrowthData *growthData, int berryID, enum MulchType mulchType);
|
||||
static int CalcMoistureDrainRate(const BerryGrowthData *growthData, int berryID, enum MulchType mulchType);
|
||||
static int GetHarvestTimeWithMulch(const BerryPatch *berryPatch);
|
||||
static int GetTotalReplantCountWithMulch(const BerryPatch *berryPatch);
|
||||
static int CalcTotalStageCount(BerryPatch *berryPatch);
|
||||
static void AdvancePatchGrowth(BerryPatch *berryPatch, const BerryGrowthData *growthData);
|
||||
static void DrainPatchMoisture(BerryPatch *berryPatch, const BerryGrowthData *growthData, int minutesPassed);
|
||||
|
||||
void BerryPatches_Clear(BerryPatch *patches)
|
||||
{
|
||||
MI_CpuClear8(patches, sizeof(BerryPatch) * MAX_BERRY_PATCHES);
|
||||
for (int i = 0; i < MAX_BERRY_PATCHES; i++) {
|
||||
patches[i].growthStage = BERRY_GROWTH_STAGE_NONE;
|
||||
patches[i].berryID = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void BerryPatches_Init(BerryPatch *patches, enum HeapId heapID, const u16 *initPatches, int initSize)
|
||||
{
|
||||
BerryGrowthData *growthData = BerryGrowthData_Init(heapID);
|
||||
|
||||
for (int i = 0; i < MAX_BERRY_PATCHES || i < initSize; i++) {
|
||||
ZeroBerryPatch(&patches[i]);
|
||||
|
||||
patches[i].berryID = initPatches[i * 2] - FIRST_BERRY_IDX + 1;
|
||||
patches[i].growthStage = BERRY_GROWTH_STAGE_FRUIT;
|
||||
patches[i].stageMinutesRemaining = CalcMinutesRemainingInStage(growthData, patches[i].berryID, patches[i].mulchType) * 4;
|
||||
patches[i].yield = initPatches[i * 2 + 1];
|
||||
patches[i].moistureRating = MAX_MOISTURE_RATING;
|
||||
patches[i].yieldRating = 3;
|
||||
}
|
||||
|
||||
Heap_FreeToHeap(growthData);
|
||||
}
|
||||
|
||||
BerryGrowthData *BerryGrowthData_Init(enum HeapId heapID)
|
||||
{
|
||||
BerryGrowthData *growthData;
|
||||
BerryData *berryData;
|
||||
NARC *narc;
|
||||
|
||||
narc = BerryData_NARC_ctor(heapID);
|
||||
growthData = Heap_AllocFromHeap(heapID, sizeof(BerryGrowthData) * NUM_BERRIES);
|
||||
|
||||
for (int i = 0; i < NUM_BERRIES; i++) {
|
||||
berryData = BerryData_LoadFromOpenNARC(narc, i, heapID);
|
||||
|
||||
growthData[i].stageDuration = BerryData_GetAttribute(berryData, BERRYATTR_STAGE_DURATION);
|
||||
growthData[i].moistureDrainRate = BerryData_GetAttribute(berryData, BERRYATTR_MOISTURE_DRAIN_RATE);
|
||||
growthData[i].yieldCategory = BerryData_GetAttribute(berryData, BERRYATTR_YIELD_CATEGORY);
|
||||
|
||||
Heap_FreeToHeap(berryData);
|
||||
}
|
||||
|
||||
BerryData_NARC_dtor(narc);
|
||||
return growthData;
|
||||
}
|
||||
|
||||
static void ZeroBerryPatch(BerryPatch *berryPatch)
|
||||
{
|
||||
berryPatch->berryID = 0;
|
||||
berryPatch->growthStage = BERRY_GROWTH_STAGE_NONE;
|
||||
berryPatch->stageMinutesRemaining = 0;
|
||||
berryPatch->moistureMinutesRemaining = 0;
|
||||
berryPatch->replantCount = 0;
|
||||
berryPatch->yield = 0;
|
||||
berryPatch->moistureRating = 0;
|
||||
berryPatch->yieldRating = 0;
|
||||
berryPatch->mulchType = 0;
|
||||
berryPatch->isGrowing = FALSE;
|
||||
}
|
||||
|
||||
static int CalcBerryYield(BerryPatch *berryPatch, const BerryGrowthData *growthData)
|
||||
{
|
||||
return growthData[berryPatch->berryID - 1].yieldCategory * berryPatch->yieldRating;
|
||||
}
|
||||
|
||||
static int CalcMinutesRemainingInStage(const BerryGrowthData *growthData, int berryID, enum MulchType mulchType)
|
||||
{
|
||||
int minutesRemaining = growthData[berryID - 1].stageDuration * 60;
|
||||
|
||||
if (mulchType == MULCH_TYPE_GROWTH) {
|
||||
minutesRemaining = (minutesRemaining * 3) / 4;
|
||||
} else if (mulchType == MULCH_TYPE_DAMP) {
|
||||
minutesRemaining = minutesRemaining + (minutesRemaining / 2);
|
||||
}
|
||||
|
||||
return minutesRemaining;
|
||||
}
|
||||
|
||||
static int CalcMoistureDrainRate(const BerryGrowthData *growthData, int berryID, enum MulchType mulchType)
|
||||
{
|
||||
int drainRate = growthData[berryID - 1].moistureDrainRate;
|
||||
|
||||
if (mulchType == MULCH_TYPE_DAMP) {
|
||||
return drainRate / 2;
|
||||
} else if (mulchType == MULCH_TYPE_GROWTH) {
|
||||
return drainRate + drainRate / 2;
|
||||
} else {
|
||||
return drainRate;
|
||||
}
|
||||
}
|
||||
|
||||
static int GetHarvestTimeWithMulch(const BerryPatch *berryPatch)
|
||||
{
|
||||
if (berryPatch->mulchType == MULCH_TYPE_STABLE) {
|
||||
return BASE_HARVEST_STAGES + (BASE_HARVEST_STAGES / 2);
|
||||
} else {
|
||||
return BASE_HARVEST_STAGES;
|
||||
}
|
||||
}
|
||||
|
||||
static int GetTotalReplantCountWithMulch(const BerryPatch *berryPatch)
|
||||
{
|
||||
if (berryPatch->mulchType == MULCH_TYPE_GOOEY) {
|
||||
return BASE_MAX_REPLANT_COUNT + (BASE_MAX_REPLANT_COUNT / 2);
|
||||
} else {
|
||||
return BASE_MAX_REPLANT_COUNT;
|
||||
}
|
||||
}
|
||||
|
||||
static int CalcTotalStageCount(BerryPatch *berryPatch)
|
||||
{
|
||||
return 1 + (3 + GetHarvestTimeWithMulch(berryPatch)) * GetTotalReplantCountWithMulch(berryPatch);
|
||||
}
|
||||
|
||||
enum BerryGrowthStage BerryPatches_GetPatchGrowthStage(const BerryPatch *patches, int patchID)
|
||||
{
|
||||
return patches[patchID].growthStage;
|
||||
}
|
||||
|
||||
int BerryPatches_GetPatchBerryID(const BerryPatch *patches, int patchID)
|
||||
{
|
||||
return patches[patchID].berryID;
|
||||
}
|
||||
|
||||
enum SoilMoisture BerryPatches_GetPatchMoisture(const BerryPatch *patches, int patchID)
|
||||
{
|
||||
int moistureRating = patches[patchID].moistureRating;
|
||||
if (moistureRating == 0) {
|
||||
return SOIL_VERY_DRY;
|
||||
} else if (moistureRating <= 50) {
|
||||
return SOIL_DRY;
|
||||
} else {
|
||||
return SOIL_MOIST;
|
||||
}
|
||||
}
|
||||
|
||||
int BerryPatches_GetPatchYieldRating(const BerryPatch *patches, int patchID)
|
||||
{
|
||||
return patches[patchID].yieldRating;
|
||||
}
|
||||
|
||||
void BerryPatches_PlantInPatch(BerryPatch *patches, int patchID, const BerryGrowthData *growthData, int berryID)
|
||||
{
|
||||
patches[patchID].berryID = berryID;
|
||||
patches[patchID].growthStage = BERRY_GROWTH_STAGE_PLANTED;
|
||||
patches[patchID].stageMinutesRemaining = CalcMinutesRemainingInStage(growthData, berryID, patches[patchID].mulchType);
|
||||
patches[patchID].moistureMinutesRemaining = 0;
|
||||
patches[patchID].replantCount = 0;
|
||||
patches[patchID].yield = 0;
|
||||
patches[patchID].moistureRating = MAX_MOISTURE_RATING;
|
||||
patches[patchID].yieldRating = MAX_YIELD_RATING;
|
||||
patches[patchID].isGrowing = TRUE;
|
||||
}
|
||||
|
||||
void BerryPatches_ResetPatchMoisture(BerryPatch *patches, int patchID)
|
||||
{
|
||||
patches[patchID].moistureRating = MAX_MOISTURE_RATING;
|
||||
}
|
||||
|
||||
BOOL BerryPatches_IsPatchGrowing(const BerryPatch *patches, int patchID)
|
||||
{
|
||||
return patches[patchID].isGrowing;
|
||||
}
|
||||
|
||||
void BerryPatches_SetIsPatchGrowing(BerryPatch *patches, int patchID, BOOL isGrowing)
|
||||
{
|
||||
patches[patchID].isGrowing = isGrowing;
|
||||
}
|
||||
|
||||
enum MulchType BerryPatches_GetPatchMulchType(const BerryPatch *patches, int patchID)
|
||||
{
|
||||
return patches[patchID].mulchType;
|
||||
}
|
||||
|
||||
void BerryPatches_SetPatchMulchType(BerryPatch *patches, int patchID, enum MulchType mulchType)
|
||||
{
|
||||
patches[patchID].mulchType = mulchType;
|
||||
}
|
||||
|
||||
int BerryPatches_GetPatchYield(const BerryPatch *patches, int patchID)
|
||||
{
|
||||
return patches[patchID].yield;
|
||||
}
|
||||
|
||||
int BerryPatches_HarvestPatch(BerryPatch *patches, int patchID)
|
||||
{
|
||||
int yield = patches[patchID].yield;
|
||||
ZeroBerryPatch(&patches[patchID]);
|
||||
return yield;
|
||||
}
|
||||
|
||||
static void AdvancePatchGrowth(BerryPatch *berryPatch, const BerryGrowthData *growthData)
|
||||
{
|
||||
switch (berryPatch->growthStage) {
|
||||
case BERRY_GROWTH_STAGE_NONE:
|
||||
GF_ASSERT(FALSE);
|
||||
break;
|
||||
|
||||
case BERRY_GROWTH_STAGE_PLANTED:
|
||||
case BERRY_GROWTH_STAGE_SPROUTED:
|
||||
case BERRY_GROWTH_STAGE_GROWING:
|
||||
berryPatch->growthStage++;
|
||||
break;
|
||||
|
||||
case BERRY_GROWTH_STAGE_BLOOMING:
|
||||
berryPatch->yield = CalcBerryYield(berryPatch, growthData);
|
||||
if (berryPatch->yield < 2) {
|
||||
berryPatch->yield = 2;
|
||||
}
|
||||
|
||||
berryPatch->growthStage++;
|
||||
|
||||
break;
|
||||
|
||||
case BERRY_GROWTH_STAGE_FRUIT:
|
||||
berryPatch->yield = 0;
|
||||
berryPatch->growthStage = BERRY_GROWTH_STAGE_SPROUTED;
|
||||
berryPatch->yieldRating = MAX_YIELD_RATING;
|
||||
berryPatch->replantCount++;
|
||||
if (berryPatch->replantCount == GetTotalReplantCountWithMulch(berryPatch)) {
|
||||
ZeroBerryPatch(berryPatch);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void DrainPatchMoisture(BerryPatch *berryPatch, const BerryGrowthData *growthData, int minutesPassed)
|
||||
{
|
||||
if (berryPatch->growthStage == BERRY_GROWTH_STAGE_FRUIT) {
|
||||
return;
|
||||
}
|
||||
|
||||
int drainageRate = CalcMoistureDrainRate(growthData, berryPatch->berryID, berryPatch->mulchType);
|
||||
minutesPassed += berryPatch->moistureMinutesRemaining;
|
||||
|
||||
int hoursPassed = minutesPassed / 60;
|
||||
berryPatch->moistureMinutesRemaining = minutesPassed % 60;
|
||||
|
||||
if (hoursPassed == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (berryPatch->moistureRating >= drainageRate * hoursPassed) {
|
||||
berryPatch->moistureRating -= drainageRate * hoursPassed;
|
||||
return;
|
||||
}
|
||||
|
||||
if (berryPatch->moistureRating > 0) {
|
||||
int hoursUntilPenalty = (berryPatch->moistureRating + (drainageRate - 1)) / drainageRate;
|
||||
hoursPassed -= hoursUntilPenalty;
|
||||
berryPatch->moistureRating = 0;
|
||||
}
|
||||
|
||||
if (berryPatch->yieldRating > hoursPassed) {
|
||||
berryPatch->yieldRating -= hoursPassed;
|
||||
} else {
|
||||
berryPatch->yieldRating = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void BerryPatches_ElapseMinutes(BerryPatch *patches, const BerryGrowthData *growthData, int minutesPassed)
|
||||
{
|
||||
int i;
|
||||
s32 totalMinutes;
|
||||
BerryPatch *patch;
|
||||
|
||||
for (i = 0; i < MAX_BERRY_PATCHES; i++) {
|
||||
patch = &patches[i];
|
||||
|
||||
if (patch->berryID == 0 || patch->growthStage == BERRY_GROWTH_STAGE_NONE || patch->isGrowing == FALSE) {
|
||||
continue;
|
||||
}
|
||||
|
||||
int maxPatchLifetime = CalcMinutesRemainingInStage(growthData, patch->berryID, patch->mulchType) * CalcTotalStageCount(patch);
|
||||
if (minutesPassed >= maxPatchLifetime) {
|
||||
ZeroBerryPatch(patch);
|
||||
continue;
|
||||
}
|
||||
|
||||
totalMinutes = minutesPassed;
|
||||
while (patch->growthStage != BERRY_GROWTH_STAGE_NONE && totalMinutes != 0) {
|
||||
if (patch->stageMinutesRemaining > totalMinutes) {
|
||||
DrainPatchMoisture(patch, growthData, totalMinutes);
|
||||
patch->stageMinutesRemaining -= totalMinutes;
|
||||
totalMinutes = 0;
|
||||
break;
|
||||
} else {
|
||||
DrainPatchMoisture(patch, growthData, patch->stageMinutesRemaining);
|
||||
AdvancePatchGrowth(patch, growthData);
|
||||
|
||||
totalMinutes -= patch->stageMinutesRemaining;
|
||||
patch->stageMinutesRemaining = CalcMinutesRemainingInStage(growthData, patch->berryID, patch->mulchType);
|
||||
|
||||
if (patch->growthStage == BERRY_GROWTH_STAGE_FRUIT) {
|
||||
patch->stageMinutesRemaining *= GetHarvestTimeWithMulch(patch);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,8 +5,7 @@
|
||||
|
||||
#include "constants/game_options.h"
|
||||
|
||||
#include "struct_decls/struct_02027854_decl.h"
|
||||
|
||||
#include "berry_patches.h"
|
||||
#include "game_options.h"
|
||||
#include "heap.h"
|
||||
#include "location.h"
|
||||
@@ -22,7 +21,6 @@
|
||||
#include "trainer_info.h"
|
||||
#include "unk_02017428.h"
|
||||
#include "unk_0201D15C.h"
|
||||
#include "unk_02027B70.h"
|
||||
#include "unk_0205C980.h"
|
||||
#include "unk_0206A8DC.h"
|
||||
#include "unk_0206B9D8.h"
|
||||
@@ -153,7 +151,7 @@ static int ov57_021D0E90(OverlayManager *param0, int *param1)
|
||||
static void ov57_021D0EAC(int param0, SaveData *param1, BOOL param2)
|
||||
{
|
||||
u32 v0;
|
||||
UnkStruct_02027854 *v1;
|
||||
BerryPatch *v1;
|
||||
TrainerInfo *v2;
|
||||
GameTime *v3;
|
||||
RecordMixedRNG *v4;
|
||||
@@ -176,8 +174,8 @@ static void ov57_021D0EAC(int param0, SaveData *param1, BOOL param2)
|
||||
|
||||
TrainerInfo_SetAppearance(v2, sub_0205C9BC(v0, TrainerInfo_Gender(v2), 0));
|
||||
|
||||
v1 = sub_02027854(param1);
|
||||
sub_02027B90(v1, param0, sBerryInitTable, NELEMS(sBerryInitTable) / 2);
|
||||
v1 = MiscSaveBlock_GetBerryPatches(param1);
|
||||
BerryPatches_Init(v1, param0, sBerryInitTable, NELEMS(sBerryInitTable) / 2);
|
||||
}
|
||||
|
||||
static void TryLoadingSave(int unused, SaveData *saveData)
|
||||
|
||||
@@ -104,7 +104,7 @@ pokeplatinum_c = files(
|
||||
'unk_0202631C.c',
|
||||
'savedata_misc.c',
|
||||
'game_options.c',
|
||||
'unk_02027B70.c',
|
||||
'berry_patches.c',
|
||||
'unk_02027F50.c',
|
||||
'unk_02027F84.c',
|
||||
'unk_02028124.c',
|
||||
|
||||
@@ -2,20 +2,18 @@
|
||||
#include <nitro/sinit.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "struct_decls/struct_02027854_decl.h"
|
||||
|
||||
#include "overlay025/poketch_system.h"
|
||||
#include "overlay048/ov48_0225650C.h"
|
||||
#include "overlay048/struct_ov48_0225650C_1.h"
|
||||
#include "overlay048/struct_ov48_0225650C_decl.h"
|
||||
|
||||
#include "berry_patches.h"
|
||||
#include "bg_window.h"
|
||||
#include "heap.h"
|
||||
#include "inlines.h"
|
||||
#include "savedata_misc.h"
|
||||
#include "sys_task.h"
|
||||
#include "sys_task_manager.h"
|
||||
#include "unk_02027B70.h"
|
||||
#include "unk_0206AFE0.h"
|
||||
#include "vars_flags.h"
|
||||
|
||||
@@ -311,11 +309,11 @@ static BOOL ov48_022563D0(UnkStruct_ov48_0225621C *param0)
|
||||
|
||||
static int ov48_02256408(UnkStruct_ov48_0225621C *param0)
|
||||
{
|
||||
UnkStruct_02027854 *v0 = sub_02027854(PoketchSystem_GetSaveData(param0->poketchSys));
|
||||
BerryPatch *v0 = MiscSaveBlock_GetBerryPatches(PoketchSystem_GetSaveData(param0->poketchSys));
|
||||
int v1, v2;
|
||||
|
||||
for (v1 = 0, v2 = 0; v1 < (NELEMS(Unk_ov48_02256A38)); v1++) {
|
||||
if ((sub_02027D84(v0, v1) == 1) && (sub_02027D04(v0, v1) == 5)) {
|
||||
if ((BerryPatches_IsPatchGrowing(v0, v1) == 1) && (BerryPatches_GetPatchGrowthStage(v0, v1) == 5)) {
|
||||
param0->unk_04.unk_0C[v2].unk_00 = Unk_ov48_02256A38[v1].unk_00;
|
||||
param0->unk_04.unk_0C[v2].unk_01 = Unk_ov48_02256A38[v1].unk_01;
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
#include <nitro.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "struct_decls/struct_berry_data_decl.h"
|
||||
#include "struct_defs/struct_0202A93C.h"
|
||||
|
||||
#include "overlay083/struct_ov83_0223DB4C_sub1.h"
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "struct_decls/struct_0200C440_decl.h"
|
||||
#include "struct_decls/struct_berry_data_decl.h"
|
||||
#include "struct_defs/struct_020972FC.h"
|
||||
#include "struct_defs/struct_02099F80.h"
|
||||
|
||||
@@ -223,7 +222,7 @@ int ov85_02241440(OverlayManager *param0, int *param1)
|
||||
memset(v0, 0, sizeof(UnkStruct_ov85_022417E4));
|
||||
v0->unk_1F8 = OverlayManager_Args(param0);
|
||||
v0->unk_00 = BgConfig_New(36);
|
||||
v0->unk_1FC = BerryData_LoadDataByNarcMemberIndex(v0->unk_1F8->unk_08, 36);
|
||||
v0->unk_1FC = BerryData_Load(v0->unk_1F8->unk_08, 36);
|
||||
|
||||
sub_0208C120(0, 36);
|
||||
|
||||
@@ -854,7 +853,7 @@ static void ov85_02241F0C(UnkStruct_ov85_022417E4 *param0)
|
||||
NARC *v0;
|
||||
|
||||
Heap_FreeToHeap(param0->unk_1FC);
|
||||
param0->unk_1FC = BerryData_LoadDataByNarcMemberIndex(param0->unk_1F8->unk_08, 36);
|
||||
param0->unk_1FC = BerryData_Load(param0->unk_1F8->unk_08, 36);
|
||||
ov85_02241CD0(param0);
|
||||
|
||||
v0 = NARC_ctor(NARC_INDEX_GRAPHIC__NTAG_GRA, 36);
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
|
||||
#include "struct_defs/sentence.h"
|
||||
|
||||
#include "berry_patches.h"
|
||||
#include "unk_02014A84.h"
|
||||
#include "unk_02014D38.h"
|
||||
#include "unk_02027B70.h"
|
||||
#include "unk_02027F50.h"
|
||||
|
||||
int MiscSaveBlock_SaveSize(void)
|
||||
@@ -21,7 +21,7 @@ void MiscSaveBlock_Init(MiscSaveBlock *miscSave)
|
||||
{
|
||||
MI_CpuClearFast(miscSave, sizeof(MiscSaveBlock));
|
||||
|
||||
sub_02027B70(miscSave->unk_00);
|
||||
BerryPatches_Clear(miscSave->berryPatches);
|
||||
sub_02027F50(&miscSave->unk_680);
|
||||
|
||||
MI_CpuFill16(miscSave->rivalName, CHAR_EOS, TRAINER_NAME_LEN + 1);
|
||||
@@ -49,10 +49,10 @@ const MiscSaveBlock *SaveData_MiscSaveBlockConst(const SaveData *saveData)
|
||||
return SaveData_SaveTableConst(saveData, SAVE_TABLE_ENTRY_MISC);
|
||||
}
|
||||
|
||||
UnkStruct_02027854 *sub_02027854(SaveData *saveData)
|
||||
BerryPatch *MiscSaveBlock_GetBerryPatches(SaveData *saveData)
|
||||
{
|
||||
MiscSaveBlock *miscSave = SaveData_SaveTable(saveData, SAVE_TABLE_ENTRY_MISC);
|
||||
return miscSave->unk_00;
|
||||
return miscSave->berryPatches;
|
||||
}
|
||||
|
||||
UnkStruct_02027860 *sub_02027860(SaveData *saveData)
|
||||
|
||||
@@ -1,334 +0,0 @@
|
||||
#include "unk_02027B70.h"
|
||||
|
||||
#include <nitro.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "struct_decls/struct_berry_data_decl.h"
|
||||
#include "struct_defs/struct_02027854.h"
|
||||
#include "struct_defs/struct_02027BF4.h"
|
||||
|
||||
#include "berry_data.h"
|
||||
#include "heap.h"
|
||||
#include "narc.h"
|
||||
|
||||
static void sub_02027C50(UnkStruct_02027854 *param0);
|
||||
static int sub_02027C7C(const UnkStruct_02027BF4 *param0, int param1, int param2);
|
||||
|
||||
void sub_02027B70(UnkStruct_02027854 *param0)
|
||||
{
|
||||
int v0;
|
||||
|
||||
MI_CpuClear8(param0, sizeof(UnkStruct_02027854) * 128);
|
||||
|
||||
for (v0 = 0; v0 < 128; v0++) {
|
||||
param0[v0].unk_01 = 0;
|
||||
param0[v0].unk_00 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_02027B90(UnkStruct_02027854 *param0, int param1, const u16 *param2, int param3)
|
||||
{
|
||||
int v0;
|
||||
UnkStruct_02027BF4 *v1 = sub_02027BF4(param1);
|
||||
|
||||
for (v0 = 0; v0 < 128 || v0 < param3; v0++) {
|
||||
sub_02027C50(¶m0[v0]);
|
||||
param0[v0].unk_00 = param2[v0 * 2] - 149 + 1;
|
||||
param0[v0].unk_01 = 5;
|
||||
param0[v0].unk_02 = sub_02027C7C(v1, param0[v0].unk_00, param0[v0].unk_0C) * 4;
|
||||
param0[v0].unk_08 = param2[v0 * 2 + 1];
|
||||
param0[v0].unk_0A = 100;
|
||||
param0[v0].unk_0B = 3;
|
||||
}
|
||||
|
||||
Heap_FreeToHeap(v1);
|
||||
}
|
||||
|
||||
UnkStruct_02027BF4 *sub_02027BF4(int param0)
|
||||
{
|
||||
int v0;
|
||||
UnkStruct_02027BF4 *v1;
|
||||
BerryData *v2;
|
||||
NARC *v3;
|
||||
|
||||
v3 = BerryData_NARC_ctor(param0);
|
||||
v1 = Heap_AllocFromHeap(param0, sizeof(UnkStruct_02027BF4) * 64);
|
||||
|
||||
for (v0 = 0; v0 < 64; v0++) {
|
||||
v2 = sub_020973A8(v3, v0, param0);
|
||||
|
||||
v1[v0].unk_00 = BerryData_GetAttribute(v2, 3);
|
||||
v1[v0].unk_01 = BerryData_GetAttribute(v2, 4);
|
||||
v1[v0].unk_02 = BerryData_GetAttribute(v2, 2);
|
||||
|
||||
Heap_FreeToHeap(v2);
|
||||
}
|
||||
|
||||
BerryData_NARC_dtor(v3);
|
||||
return v1;
|
||||
}
|
||||
|
||||
static void sub_02027C50(UnkStruct_02027854 *param0)
|
||||
{
|
||||
param0->unk_00 = 0;
|
||||
param0->unk_01 = 0;
|
||||
param0->unk_02 = 0;
|
||||
param0->unk_04 = 0;
|
||||
param0->unk_06 = 0;
|
||||
param0->unk_08 = 0;
|
||||
param0->unk_0A = 0;
|
||||
param0->unk_0B = 0;
|
||||
param0->unk_0C = 0;
|
||||
param0->unk_0D = 0;
|
||||
}
|
||||
|
||||
static int sub_02027C68(UnkStruct_02027854 *param0, const UnkStruct_02027BF4 *param1)
|
||||
{
|
||||
return param1[param0->unk_00 - 1].unk_02 * param0->unk_0B;
|
||||
}
|
||||
|
||||
static int sub_02027C7C(const UnkStruct_02027BF4 *param0, int param1, int param2)
|
||||
{
|
||||
int v0;
|
||||
|
||||
v0 = param0[param1 - 1].unk_00 * 60;
|
||||
|
||||
if (param2 == 1) {
|
||||
v0 = (v0 * 3) / 4;
|
||||
} else if (param2 == 2) {
|
||||
v0 = v0 + (v0 / 2);
|
||||
}
|
||||
|
||||
return v0;
|
||||
}
|
||||
|
||||
static int sub_02027CA8(const UnkStruct_02027BF4 *param0, int param1, int param2)
|
||||
{
|
||||
int v0 = param0[param1 - 1].unk_01;
|
||||
|
||||
if (param2 == 2) {
|
||||
return v0 / 2;
|
||||
} else if (param2 == 1) {
|
||||
return v0 + v0 / 2;
|
||||
} else {
|
||||
return v0;
|
||||
}
|
||||
}
|
||||
|
||||
static int sub_02027CCC(const UnkStruct_02027854 *param0)
|
||||
{
|
||||
if (param0->unk_0C == 3) {
|
||||
return 4 + 2;
|
||||
} else {
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
static int sub_02027CDC(const UnkStruct_02027854 *param0)
|
||||
{
|
||||
if (param0->unk_0C == 4) {
|
||||
return 10 + 5;
|
||||
} else {
|
||||
return 10;
|
||||
}
|
||||
}
|
||||
|
||||
static int sub_02027CEC(UnkStruct_02027854 *param0)
|
||||
{
|
||||
return 1 + (1 + 1 + 1 + sub_02027CCC(param0)) * sub_02027CDC(param0);
|
||||
}
|
||||
|
||||
int sub_02027D04(const UnkStruct_02027854 *param0, int param1)
|
||||
{
|
||||
return param0[param1].unk_01;
|
||||
}
|
||||
|
||||
int sub_02027D10(const UnkStruct_02027854 *param0, int param1)
|
||||
{
|
||||
return param0[param1].unk_00;
|
||||
}
|
||||
|
||||
int sub_02027D18(const UnkStruct_02027854 *param0, int param1)
|
||||
{
|
||||
int v0;
|
||||
|
||||
v0 = param0[param1].unk_0A;
|
||||
|
||||
if (v0 == 0) {
|
||||
return 0;
|
||||
} else if (v0 <= 50) {
|
||||
return 1;
|
||||
} else {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
int sub_02027D34(const UnkStruct_02027854 *param0, int param1)
|
||||
{
|
||||
return param0[param1].unk_0B;
|
||||
}
|
||||
|
||||
void sub_02027D40(UnkStruct_02027854 *param0, int param1, const UnkStruct_02027BF4 *param2, int param3)
|
||||
{
|
||||
param0[param1].unk_00 = param3;
|
||||
param0[param1].unk_01 = 1;
|
||||
param0[param1].unk_02 = sub_02027C7C(param2, param3, param0[param1].unk_0C);
|
||||
param0[param1].unk_04 = 0;
|
||||
param0[param1].unk_06 = 0;
|
||||
param0[param1].unk_08 = 0;
|
||||
param0[param1].unk_0A = 100;
|
||||
param0[param1].unk_0B = 5;
|
||||
param0[param1].unk_0D = 1;
|
||||
}
|
||||
|
||||
void sub_02027D78(UnkStruct_02027854 *param0, int param1)
|
||||
{
|
||||
param0[param1].unk_0A = 100;
|
||||
}
|
||||
|
||||
BOOL sub_02027D84(const UnkStruct_02027854 *param0, int param1)
|
||||
{
|
||||
return param0[param1].unk_0D;
|
||||
}
|
||||
|
||||
void sub_02027D90(UnkStruct_02027854 *param0, int param1, BOOL param2)
|
||||
{
|
||||
param0[param1].unk_0D = param2;
|
||||
}
|
||||
|
||||
int sub_02027D9C(const UnkStruct_02027854 *param0, int param1)
|
||||
{
|
||||
return param0[param1].unk_0C;
|
||||
}
|
||||
|
||||
void sub_02027DA8(UnkStruct_02027854 *param0, int param1, int param2)
|
||||
{
|
||||
param0[param1].unk_0C = param2;
|
||||
}
|
||||
|
||||
int sub_02027DB4(const UnkStruct_02027854 *param0, int param1)
|
||||
{
|
||||
return param0[param1].unk_08;
|
||||
}
|
||||
|
||||
int sub_02027DC0(UnkStruct_02027854 *param0, int param1)
|
||||
{
|
||||
int v0;
|
||||
|
||||
v0 = param0[param1].unk_08;
|
||||
sub_02027C50(¶m0[param1]);
|
||||
|
||||
return v0;
|
||||
}
|
||||
|
||||
static void sub_02027DD4(UnkStruct_02027854 *param0, const UnkStruct_02027BF4 *param1)
|
||||
{
|
||||
switch (param0->unk_01) {
|
||||
case 0:
|
||||
GF_ASSERT(0);
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
param0->unk_01++;
|
||||
break;
|
||||
case 4:
|
||||
param0->unk_08 = sub_02027C68(param0, param1);
|
||||
|
||||
if (param0->unk_08 < 2) {
|
||||
param0->unk_08 = 2;
|
||||
}
|
||||
|
||||
param0->unk_01++;
|
||||
break;
|
||||
case 5:
|
||||
param0->unk_08 = 0;
|
||||
param0->unk_01 = 2;
|
||||
param0->unk_0B = 5;
|
||||
param0->unk_06++;
|
||||
|
||||
if (param0->unk_06 == sub_02027CDC(param0)) {
|
||||
sub_02027C50(param0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_02027E40(UnkStruct_02027854 *param0, const UnkStruct_02027BF4 *param1, int param2)
|
||||
{
|
||||
int v0;
|
||||
int v1;
|
||||
int v2;
|
||||
|
||||
if (param0->unk_01 == 5) {
|
||||
return;
|
||||
}
|
||||
|
||||
v1 = sub_02027CA8(param1, param0->unk_00, param0->unk_0C);
|
||||
param2 += param0->unk_04;
|
||||
|
||||
v0 = param2 / 60;
|
||||
param0->unk_04 = param2 % 60;
|
||||
|
||||
if (v0 == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (param0->unk_0A >= v1 * v0) {
|
||||
param0->unk_0A -= v1 * v0;
|
||||
return;
|
||||
}
|
||||
|
||||
if (param0->unk_0A > 0) {
|
||||
v2 = (param0->unk_0A + (v1 - 1)) / v1;
|
||||
v0 -= v2;
|
||||
param0->unk_0A = 0;
|
||||
}
|
||||
|
||||
if (param0->unk_0B > v0) {
|
||||
param0->unk_0B -= v0;
|
||||
} else {
|
||||
param0->unk_0B = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_02027EAC(UnkStruct_02027854 *param0, const UnkStruct_02027BF4 *param1, int param2)
|
||||
{
|
||||
int v0;
|
||||
s32 v1;
|
||||
UnkStruct_02027854 *v2;
|
||||
|
||||
for (v0 = 0; v0 < 128; v0++) {
|
||||
v2 = ¶m0[v0];
|
||||
|
||||
if ((v2->unk_00 == 0) || (v2->unk_01 == 0) || (v2->unk_0D == 0)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (param2 >= sub_02027C7C(param1, v2->unk_00, v2->unk_0C) * sub_02027CEC(v2)) {
|
||||
sub_02027C50(v2);
|
||||
continue;
|
||||
}
|
||||
|
||||
v1 = param2;
|
||||
|
||||
while (v2->unk_01 != 0 && v1 != 0) {
|
||||
if (v2->unk_02 > v1) {
|
||||
sub_02027E40(v2, param1, v1);
|
||||
v2->unk_02 -= v1;
|
||||
v1 = 0;
|
||||
break;
|
||||
} else {
|
||||
sub_02027E40(v2, param1, v2->unk_02);
|
||||
sub_02027DD4(v2, param1);
|
||||
|
||||
v1 -= v2->unk_02;
|
||||
v2->unk_02 = sub_02027C7C(param1, v2->unk_00, v2->unk_0C);
|
||||
|
||||
if (v2->unk_01 == 5) {
|
||||
v2->unk_02 *= sub_02027CCC(v2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,11 +3,9 @@
|
||||
#include <nitro.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "struct_decls/struct_02027854_decl.h"
|
||||
#include "struct_decls/struct_020508D4_decl.h"
|
||||
#include "struct_decls/struct_02055CBC_decl.h"
|
||||
#include "struct_decls/struct_02061AB4_decl.h"
|
||||
#include "struct_defs/struct_02027BF4.h"
|
||||
|
||||
#include "field/field_system.h"
|
||||
#include "field/field_system_sub2_t.h"
|
||||
@@ -17,6 +15,7 @@
|
||||
#include "overlay005/struct_ov5_021DF47C_decl.h"
|
||||
|
||||
#include "bag.h"
|
||||
#include "berry_patches.h"
|
||||
#include "core_sys.h"
|
||||
#include "easy3d.h"
|
||||
#include "heap.h"
|
||||
@@ -25,7 +24,6 @@
|
||||
#include "savedata_misc.h"
|
||||
#include "sys_task_manager.h"
|
||||
#include "unk_0201CED8.h"
|
||||
#include "unk_02027B70.h"
|
||||
#include "unk_020508D4.h"
|
||||
#include "unk_02054D00.h"
|
||||
#include "unk_020655F4.h"
|
||||
@@ -34,7 +32,7 @@
|
||||
|
||||
struct UnkStruct_02055CBC_t {
|
||||
int unk_00;
|
||||
UnkStruct_02027BF4 *unk_04;
|
||||
BerryGrowthData *unk_04;
|
||||
NNSG3dRenderObj unk_08;
|
||||
NNSG3dResMdl *unk_5C;
|
||||
NNSG3dResFileHeader *unk_60;
|
||||
@@ -94,7 +92,7 @@ UnkStruct_02055CBC *sub_02055C8C(FieldSystem *fieldSystem, int param1)
|
||||
MI_CpuClear8(v0, sizeof(UnkStruct_02055CBC));
|
||||
|
||||
v0->unk_00 = param1;
|
||||
v0->unk_04 = sub_02027BF4(param1);
|
||||
v0->unk_04 = BerryGrowthData_Init(param1);
|
||||
|
||||
sub_02055D14(fieldSystem, v0);
|
||||
return v0;
|
||||
@@ -109,18 +107,18 @@ void sub_02055CBC(UnkStruct_02055CBC *param0)
|
||||
|
||||
void sub_02055CD4(FieldSystem *fieldSystem, int param1)
|
||||
{
|
||||
UnkStruct_02027854 *v0;
|
||||
UnkStruct_02027BF4 *v1;
|
||||
BerryPatch *v0;
|
||||
BerryGrowthData *v1;
|
||||
|
||||
if (fieldSystem->unk_04 == NULL) {
|
||||
v1 = sub_02027BF4(11);
|
||||
v0 = sub_02027854(fieldSystem->saveData);
|
||||
sub_02027EAC(v0, v1, param1);
|
||||
v1 = BerryGrowthData_Init(11);
|
||||
v0 = MiscSaveBlock_GetBerryPatches(fieldSystem->saveData);
|
||||
BerryPatches_ElapseMinutes(v0, v1, param1);
|
||||
Heap_FreeToHeap(v1);
|
||||
} else {
|
||||
v1 = fieldSystem->unk_04->unk_18->unk_04;
|
||||
v0 = sub_02027854(fieldSystem->saveData);
|
||||
sub_02027EAC(v0, v1, param1);
|
||||
v0 = MiscSaveBlock_GetBerryPatches(fieldSystem->saveData);
|
||||
BerryPatches_ElapseMinutes(v0, v1, param1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,13 +156,13 @@ void sub_02055D94(FieldSystem *fieldSystem)
|
||||
{
|
||||
int v0 = 0;
|
||||
MapObject *v1;
|
||||
UnkStruct_02027854 *v2 = sub_02027854(fieldSystem->saveData);
|
||||
BerryPatch *v2 = MiscSaveBlock_GetBerryPatches(fieldSystem->saveData);
|
||||
|
||||
while (sub_020625B0(fieldSystem->mapObjMan, &v1, &v0, (1 << 0)) == 1) {
|
||||
if (sub_020677F4(sub_02062920(v1)) == 1) {
|
||||
if (sub_02055D54(fieldSystem, MapObject_PosVector(v1))) {
|
||||
int v3 = sub_020629D8(v1, 0);
|
||||
sub_02027D90(v2, v3, 1);
|
||||
BerryPatches_SetIsPatchGrowing(v2, v3, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -173,14 +171,14 @@ void sub_02055D94(FieldSystem *fieldSystem)
|
||||
BOOL sub_02055E00(FieldSystem *fieldSystem, MapObject *param1)
|
||||
{
|
||||
int v0, v1, v2;
|
||||
UnkStruct_02027854 *v3 = sub_02027854(fieldSystem->saveData);
|
||||
BerryPatch *v3 = MiscSaveBlock_GetBerryPatches(fieldSystem->saveData);
|
||||
|
||||
v0 = sub_020629D8(param1, 0);
|
||||
v2 = sub_02027D10(v3, v0);
|
||||
v1 = sub_02027DB4(v3, v0);
|
||||
v2 = BerryPatches_GetPatchBerryID(v3, v0);
|
||||
v1 = BerryPatches_GetPatchYield(v3, v0);
|
||||
|
||||
sub_0206D914(fieldSystem, sub_02055C50(v2), sub_02027D34(v3, v0), v1);
|
||||
sub_02027DC0(v3, v0);
|
||||
sub_0206D914(fieldSystem, sub_02055C50(v2), BerryPatches_GetPatchYieldRating(v3, v0), v1);
|
||||
BerryPatches_HarvestPatch(v3, v0);
|
||||
sub_02067834(param1);
|
||||
|
||||
return Bag_TryAddItem(SaveData_GetBag(fieldSystem->saveData), sub_02055C50(v2), v1, 4);
|
||||
@@ -189,82 +187,82 @@ BOOL sub_02055E00(FieldSystem *fieldSystem, MapObject *param1)
|
||||
void sub_02055E80(FieldSystem *fieldSystem, MapObject *param1, u16 param2)
|
||||
{
|
||||
int v0;
|
||||
UnkStruct_02027854 *v1 = sub_02027854(fieldSystem->saveData);
|
||||
BerryPatch *v1 = MiscSaveBlock_GetBerryPatches(fieldSystem->saveData);
|
||||
|
||||
v0 = sub_020629D8(param1, 0);
|
||||
sub_02027DA8(v1, v0, sub_02055C80(param2));
|
||||
BerryPatches_SetPatchMulchType(v1, v0, sub_02055C80(param2));
|
||||
}
|
||||
|
||||
void sub_02055EAC(FieldSystem *fieldSystem, MapObject *param1, u16 param2)
|
||||
{
|
||||
int v0;
|
||||
UnkStruct_02027854 *v1 = sub_02027854(fieldSystem->saveData);
|
||||
BerryPatch *v1 = MiscSaveBlock_GetBerryPatches(fieldSystem->saveData);
|
||||
|
||||
v0 = sub_020629D8(param1, 0);
|
||||
sub_02027D40(v1, v0, fieldSystem->unk_04->unk_18->unk_04, sub_02055C60(param2));
|
||||
BerryPatches_PlantInPatch(v1, v0, fieldSystem->unk_04->unk_18->unk_04, sub_02055C60(param2));
|
||||
}
|
||||
|
||||
void sub_02055EE0(FieldSystem *fieldSystem, MapObject *param1)
|
||||
{
|
||||
int v0;
|
||||
UnkStruct_02027854 *v1 = sub_02027854(fieldSystem->saveData);
|
||||
BerryPatch *v1 = MiscSaveBlock_GetBerryPatches(fieldSystem->saveData);
|
||||
|
||||
v0 = sub_020629D8(param1, 0);
|
||||
sub_02027D78(v1, v0);
|
||||
BerryPatches_ResetPatchMoisture(v1, v0);
|
||||
}
|
||||
|
||||
int sub_02055F00(const FieldSystem *fieldSystem, const MapObject *param1)
|
||||
{
|
||||
int v0;
|
||||
UnkStruct_02027854 *v1 = sub_02027854(fieldSystem->saveData);
|
||||
BerryPatch *v1 = MiscSaveBlock_GetBerryPatches(fieldSystem->saveData);
|
||||
|
||||
v0 = sub_020629D8(param1, 0);
|
||||
return sub_02027D04(v1, v0);
|
||||
return BerryPatches_GetPatchGrowthStage(v1, v0);
|
||||
}
|
||||
|
||||
int sub_02055F20(const FieldSystem *fieldSystem, const MapObject *param1)
|
||||
{
|
||||
int v0;
|
||||
UnkStruct_02027854 *v1 = sub_02027854(fieldSystem->saveData);
|
||||
BerryPatch *v1 = MiscSaveBlock_GetBerryPatches(fieldSystem->saveData);
|
||||
|
||||
v0 = sub_020629D8(param1, 0);
|
||||
return sub_02027D10(v1, v0);
|
||||
return BerryPatches_GetPatchBerryID(v1, v0);
|
||||
}
|
||||
|
||||
u16 sub_02055F40(const FieldSystem *fieldSystem, const MapObject *param1)
|
||||
{
|
||||
int v0;
|
||||
UnkStruct_02027854 *v1 = sub_02027854(fieldSystem->saveData);
|
||||
BerryPatch *v1 = MiscSaveBlock_GetBerryPatches(fieldSystem->saveData);
|
||||
|
||||
v0 = sub_020629D8(param1, 0);
|
||||
return sub_02055C50(sub_02027D10(v1, v0));
|
||||
return sub_02055C50(BerryPatches_GetPatchBerryID(v1, v0));
|
||||
}
|
||||
|
||||
u16 sub_02055F64(const FieldSystem *fieldSystem, const MapObject *param1)
|
||||
{
|
||||
int v0;
|
||||
UnkStruct_02027854 *v1 = sub_02027854(fieldSystem->saveData);
|
||||
BerryPatch *v1 = MiscSaveBlock_GetBerryPatches(fieldSystem->saveData);
|
||||
|
||||
v0 = sub_020629D8(param1, 0);
|
||||
return sub_02055C70(sub_02027D9C(v1, v0));
|
||||
return sub_02055C70(BerryPatches_GetPatchMulchType(v1, v0));
|
||||
}
|
||||
|
||||
int sub_02055F88(const FieldSystem *fieldSystem, const MapObject *param1)
|
||||
{
|
||||
int v0;
|
||||
UnkStruct_02027854 *v1 = sub_02027854(fieldSystem->saveData);
|
||||
BerryPatch *v1 = MiscSaveBlock_GetBerryPatches(fieldSystem->saveData);
|
||||
|
||||
v0 = sub_020629D8(param1, 0);
|
||||
return sub_02027D18(v1, v0);
|
||||
return BerryPatches_GetPatchMoisture(v1, v0);
|
||||
}
|
||||
|
||||
int sub_02055FA8(const FieldSystem *fieldSystem, const MapObject *param1)
|
||||
{
|
||||
int v0;
|
||||
UnkStruct_02027854 *v1 = sub_02027854(fieldSystem->saveData);
|
||||
BerryPatch *v1 = MiscSaveBlock_GetBerryPatches(fieldSystem->saveData);
|
||||
|
||||
v0 = sub_020629D8(param1, 0);
|
||||
return sub_02027DB4(v1, v0);
|
||||
return BerryPatches_GetPatchYield(v1, v0);
|
||||
}
|
||||
|
||||
u32 sub_02055FC8(const FieldSystem *fieldSystem, const MapObject *param1)
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
#include "struct_decls/pokedexdata_decl.h"
|
||||
#include "struct_decls/struct_0202440C_decl.h"
|
||||
#include "struct_decls/struct_02027854_decl.h"
|
||||
#include "struct_decls/struct_02029C68_decl.h"
|
||||
#include "struct_decls/struct_0202A750_decl.h"
|
||||
#include "struct_decls/struct_party_decl.h"
|
||||
@@ -33,6 +32,7 @@
|
||||
#include "savedata/save_table.h"
|
||||
|
||||
#include "bag.h"
|
||||
#include "berry_patches.h"
|
||||
#include "charcode_util.h"
|
||||
#include "field_system.h"
|
||||
#include "heap.h"
|
||||
@@ -51,7 +51,6 @@
|
||||
#include "trainer_info.h"
|
||||
#include "unk_0201D15C.h"
|
||||
#include "unk_0202631C.h"
|
||||
#include "unk_02027B70.h"
|
||||
#include "unk_020298BC.h"
|
||||
#include "unk_0202D7A8.h"
|
||||
#include "unk_0202E2CC.h"
|
||||
@@ -2540,14 +2539,14 @@ static int sub_0206EBE8(FieldSystem *fieldSystem)
|
||||
|
||||
static int sub_0206EC90(FieldSystem *fieldSystem, StringTemplate *param1, UnkStruct_ov6_022465F4 *param2)
|
||||
{
|
||||
UnkStruct_02027854 *v0 = sub_02027854(fieldSystem->saveData);
|
||||
BerryPatch *v0 = MiscSaveBlock_GetBerryPatches(fieldSystem->saveData);
|
||||
int v1, v2;
|
||||
|
||||
v1 = sub_0206EBE8(fieldSystem);
|
||||
v2 = Unk_020F0074[v1 * 2 + 1];
|
||||
StringTemplate_SetLocationName(param1, 0, MapHeader_GetMapLabelTextID(v2));
|
||||
|
||||
switch (sub_02027D04(v0, v1)) {
|
||||
switch (BerryPatches_GetPatchGrowthStage(v0, v1)) {
|
||||
case 5:
|
||||
return 36;
|
||||
case 4:
|
||||
|
||||
Reference in New Issue
Block a user