Add custom collectible thing

This commit is contained in:
Garrett Cox
2024-12-04 20:26:11 -06:00
committed by Malkierian
parent 8bb5d1f1b7
commit 045de62c95
7 changed files with 275 additions and 15 deletions
+3
View File
@@ -399,6 +399,9 @@ DrawItemTableEntry sDrawItemTable[] = {
* Calls the corresponding draw function for the given draw ID
*/
void GetItem_Draw(PlayState* play, s16 drawId) {
if (drawId < 0 || drawId >= GID_MAXIMUM) {
return;
}
sDrawItemTable[drawId].drawFunc(play, drawId);
}
+18 -3
View File
@@ -1873,9 +1873,19 @@ u8 Return_Item(u8 itemID, ModIndex modId, ItemID returnItem) {
* @return u8
*/
u8 Item_Give(PlayState* play, u8 item) {
// prevents getting sticks without the bag in case something got missed
if (IS_RANDO && (item == ITEM_STICK || item == ITEM_STICKS_5 || item == ITEM_STICKS_10) &&
Randomizer_GetSettingValue(RSK_SHUFFLE_DEKU_STICK_BAG) && CUR_UPG_VALUE(UPG_STICKS) == 0) {
// TODO: Add ShouldItemGive
// if (!GameInteractor_ShouldItemGive(item) || item == ITEM_SHIP) {
if (item == ITEM_SHIP) {
return ITEM_NONE;
}
//prevents getting sticks without the bag in case something got missed
if (
IS_RANDO &&
(item == ITEM_STICK || item == ITEM_STICKS_5 || item == ITEM_STICKS_10) &&
Randomizer_GetSettingValue(RSK_SHUFFLE_DEKU_STICK_BAG) &&
CUR_UPG_VALUE(UPG_STICKS) == 0
) {
return item;
}
@@ -2476,6 +2486,11 @@ u8 Item_CheckObtainability(u8 item) {
s16 slot = SLOT(item);
s32 temp;
// SOH [Enhancements] Added to enable custom item gives
if (item == ITEM_SHIP) {
return ITEM_NONE;
}
if (item >= ITEM_STICKS_5) {
slot = SLOT(sExtraItemBases[item - ITEM_STICKS_5]);
}