Skip to content

Commit

Permalink
Merge pull request #77 from lhearachel/berry-init
Browse files Browse the repository at this point in the history
Document berry initialization table for a new game
  • Loading branch information
lhearachel authored Oct 3, 2023
2 parents 95c276c + ac09b59 commit 2a64ecf
Show file tree
Hide file tree
Showing 2 changed files with 133 additions and 239 deletions.
131 changes: 131 additions & 0 deletions include/data/berry_init.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
#include "constants/items.h"

/**
* @brief Table of initial berry states for the various mulch-beds across the
* overworld.
*
* This table is used to initialize the state of the mulch-beds at the time a
* new game is started. Entries in the table should be read in pairs; the first
* element is the berry planted in that particular mulch-bed, and the second is
* the number of that berry that can be harvested from the resulting tree.
*/
static const u16 sBerryInitTable[] = {
ITEM_ORAN_BERRY, 1,
ITEM_CHERI_BERRY, 1,
ITEM_CHESTO_BERRY, 1,
ITEM_PECHA_BERRY, 1,
ITEM_ORAN_BERRY, 1,
ITEM_PECHA_BERRY, 1,
ITEM_RAZZ_BERRY, 2,
ITEM_BLUK_BERRY, 2,
ITEM_CHERI_BERRY, 1,
ITEM_ORAN_BERRY, 2,
ITEM_SITRUS_BERRY, 1,
ITEM_WEPEAR_BERRY, 2,
ITEM_WEPEAR_BERRY, 2,
ITEM_KELPSY_BERRY, 1,
ITEM_CHERI_BERRY, 1,
ITEM_PECHA_BERRY, 1,
ITEM_ORAN_BERRY, 1,
ITEM_ORAN_BERRY, 1,
ITEM_RAWST_BERRY, 1,
ITEM_RAWST_BERRY, 1,
ITEM_RAZZ_BERRY, 1,
ITEM_RAZZ_BERRY, 1,
ITEM_CHERI_BERRY, 1,
ITEM_ORAN_BERRY, 1,
ITEM_ORAN_BERRY, 1,
ITEM_BLUK_BERRY, 1,
ITEM_NANAB_BERRY, 2,
ITEM_RAZZ_BERRY, 2,
ITEM_BLUK_BERRY, 2,
ITEM_PINAP_BERRY, 2,
ITEM_LEPPA_BERRY, 1,
ITEM_CHESTO_BERRY, 1,
ITEM_RAZZ_BERRY, 1,
ITEM_RAZ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 1,
ITEM_SITRUS_BERRY, 2,
ITEM_BLUK_BERRY, 3,
ITEM_NANAB_BERRY, 3,
ITEM_WEPEAR_BERRY, 3,
ITEM_POMEG_BERRY, 1,
ITEM_POMEG_BERRY, 1,
ITEM_HONDEW_BERRY, 2,
ITEM_HONDEW_BERRY, 2,
ITEM_KELPSY_BERRY, 1,
ITEM_KELPSY_BERRY, 1,
ITEM_TAMATO_BERRY, 1,
ITEM_TAMATO_BERRY, 1,
ITEM_QUALOT_BERRY, 1,
ITEM_QUALOT_BERRY, 1,
ITEM_POMEG_BERRY, 1,
ITEM_POMEG_BERRY, 1,
ITEM_HONDEW_BERRY, 1,
ITEM_HONDEW_BERRY, 1,
ITEM_TAMATO_BERRY, 1,
ITEM_TAMATO_BERRY, 1,
ITEM_GREPA_BERRY, 1,
ITEM_GREPA_BERRY, 1,
ITEM_QUALOT_BERRY, 1,
ITEM_QUALOT_BERRY, 1,
ITEM_LUM_BERRY, 1,
ITEM_LEPPA_BERRY, 1,
ITEM_QUALOT_BERRY, 2,
ITEM_GREPA_BERRY, 2,
ITEM_KELPSY_BERRY, 2,
ITEM_KELPSY_BERRY, 2,
ITEM_GREPA_BERRY, 1,
ITEM_GREPA_BERRY, 1
};
241 changes: 2 additions & 239 deletions src/overlay057/ov57_021D0D80.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,244 +151,7 @@ static int ov57_021D0E90 (UnkStruct_020067E8 * param0, int * param1)
return 1;
}

static const u16 Unk_ov57_021D0FA0[] = {
0x9B,
0x1,
0x95,
0x1,
0x96,
0x1,
0x97,
0x1,
0x9B,
0x1,
0x97,
0x1,
0xA4,
0x2,
0xA5,
0x2,
0x95,
0x1,
0x9B,
0x2,
0x9E,
0x1,
0xA7,
0x2,
0xA7,
0x2,
0xAA,
0x1,
0x95,
0x1,
0x97,
0x1,
0x9B,
0x1,
0x9B,
0x1,
0x98,
0x1,
0x98,
0x1,
0xA4,
0x1,
0xA4,
0x1,
0x95,
0x1,
0x9B,
0x1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"data/berry_init.h"

static void ov57_021D0EAC (int param0, SaveData * param1, BOOL param2)
{
Expand Down Expand Up @@ -417,5 +180,5 @@ 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, Unk_ov57_021D0FA0, NELEMS(Unk_ov57_021D0FA0) / 2);
sub_02027B90(v1, param0, sBerryInitTable, NELEMS(sBerryInitTable) / 2);
}

0 comments on commit 2a64ecf

Please sign in to comment.