Tweak: Unique GetItemEntry for Progressive Bombchus with particle effects (#2732)

* give progressive bombchus its own getitementry to allow custom draw effects

* fix timestamp item check
This commit is contained in:
Adam Bird
2023-04-21 19:01:19 -04:00
committed by GitHub
parent 37c0345529
commit 42ff9742ed
3 changed files with 46 additions and 32 deletions

View File

@@ -1703,7 +1703,7 @@ void Randomizer_GameplayStats_SetTimestamp(uint16_t item) {
return;
}
// Count any bombchu pack as bombchus
if (item >= RG_BOMBCHU_5 && item <= RG_BOMBCHU_DROP) {
if ((item >= RG_BOMBCHU_5 && item <= RG_BOMBCHU_DROP) || item == RG_PROGRESSIVE_BOMBCHUS) {
if (gSaveContext.sohStats.itemTimestamp[ITEM_BOMBCHU] = 0) {
gSaveContext.sohStats.itemTimestamp[ITEM_BOMBCHU] = time;
}
@@ -2548,6 +2548,19 @@ u16 Randomizer_Item_Give(PlayState* play, GetItemEntry giEntry) {
return Return_Item_Entry(giEntry, RG_NONE);
}
if (item == RG_PROGRESSIVE_BOMBCHUS) {
if (INV_CONTENT(ITEM_BOMBCHU) == ITEM_NONE) {
INV_CONTENT(ITEM_BOMBCHU) = ITEM_BOMBCHU;
AMMO(ITEM_BOMBCHU) = 20;
} else {
AMMO(ITEM_BOMBCHU) += AMMO(ITEM_BOMBCHU) < 5 ? 10 : 5;
if (AMMO(ITEM_BOMBCHU) > 50) {
AMMO(ITEM_BOMBCHU) = 50;
}
}
return Return_Item_Entry(giEntry, RG_NONE);
}
temp = gSaveContext.inventory.items[slot];
osSyncPrintf("Item_Register(%d)=%d %d\n", slot, item, temp);
INV_CONTENT(item) = item;