-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Increase item bag capacity
original source: MapleFall's pokecommunity post and Lunos' 999 items branch
This code increases the bag item capacity from 99 up to 999 items
include/shop.his now atsrc/shop.cand is slightly different code to the original
the below code is also on a branch:
compare here / branch here
change #define MAX_BAG_ITEM_CAPACITY 99 (at line 451)
to
#define MAX_BAG_ITEM_CAPACITY 999
__
change #define BAG_ITEM_CAPACITY_DIGITS 2 (at line 455)
to
#define BAG_ITEM_CAPACITY_DIGITS 3
in section struct PyramidBag (line 224)
change u8 quantity[FRONTIER_LVL_MODE_COUNT][PYRAMID_BAG_ITEMS_COUNT];
to
u16 quantity[FRONTIER_LVL_MODE_COUNT][PYRAMID_BAG_ITEMS_COUNT];
(data no longer stored in include/shop.h)
in section struct ShopData (line 94)
change u8 maxQuantity;
to
u16 maxQuantity;
in these 3 sections (they are all after each other)
static void SwapItems(u8 id1, u8 id2) (line 725)
static void MovePyramidBagItemSlotInList(u8 from, u8 to) (line 735)
static void CompactItems(void) (line 768)
change u8 *quantities = gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.lvlMode];
to
u16 *quantities = gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.lvlMode];
__
in section void TryStoreHeldItemsInPyramidBag(void) (line 1402)
change u8 *newQuantities = Alloc(PYRAMID_BAG_ITEMS_COUNT * sizeof(*newQuantities));
to
u16 *newQuantities = Alloc(PYRAMID_BAG_ITEMS_COUNT * sizeof(*newQuantities));
in these 4 sections (they're all after each other):
static bool8 CheckPyramidBagHasItem(u16 itemId, u16 count) (line 685)
static bool8 CheckPyramidBagHasSpace(u16 itemId, u16 count) (line 707)
bool8 AddPyramidBagItem(u16 itemId, u16 count) (line 729)
bool8 RemovePyramidBagItem(u16 itemId, u16 count) (line 802)
change u8 *quantities = gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.lvlMode];
to
u16 *quantities = gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.lvlMode];
in these 2 sections:
bool8 AddPyramidBagItem(u16 itemId, u16 count) (line 729)
bool8 RemovePyramidBagItem(u16 itemId, u16 count) (line 802)
change u8 *newQuantities = Alloc(PYRAMID_BAG_ITEMS_COUNT * sizeof(*newQuantities));
to
u16 *newQuantities = Alloc(PYRAMID_BAG_ITEMS_COUNT * sizeof(*newQuantities));
these 4 sections are after each other
__
in section bool8 ScrCmd_additem(struct ScriptContext *ctx) (line 488)
change gSpecialVar_Result = AddBagItem(itemId, (u8)quantity);
to
gSpecialVar_Result = AddBagItem(itemId, quantity);
__
in section bool8 ScrCmd_removeitem(struct ScriptContext *ctx) (line 497)
change gSpecialVar_Result = RemoveBagItem(itemId, (u8)quantity);
to
gSpecialVar_Result = RemoveBagItem(itemId, quantity);
__
in section bool8 ScrCmd_checkitemspace(struct ScriptContext *ctx) (line 506)
change gSpecialVar_Result = CheckBagHasSpace(itemId, (u8)quantity);
to
gSpecialVar_Result = CheckBagHasSpace(itemId, quantity);
in section bool8 ScrCmd_checkitem(struct ScriptContext *ctx) (line 515)
change gSpecialVar_Result = CheckBagHasItem(itemId, (u8)quantity);
to
gSpecialVar_Result = CheckBagHasItem(itemId, quantity);