Add in Progressive Bombchu Bags (#5836)

* Adds new Progressive Bombchu Bags option

Also changes existing code to account for Bombchu Bags becoming
a drop down with 3 values instead of a checkbox

* Handle the new lower capacities for ammo refills

* Handle what happens when receiving a bombchu bag

* Remove the trick name of Progressive Bombchu Bag

Since, you know, that's an actual thing now.

* Implements Bombchu Bag handling next to Progressive Bombchu Handling

* clang-formatting

* Add extra bag for plentiful items

* Address review comment

* Move bombchu upgrade level to gSaveContext and add save/load

* Use logic's saveContext for correct logic calculations

* Remove RG_PROGRESSIVE_BOMBCHU

* Fix Bombchu Refill obtainability

* Don't add normal chus to the pool if chu bags are on.

* cmake-format

* Properly reset bombchuUpgradeLevel on savefile init

* Fix error with va_arg on linux

* Fixes small error in the Bombchu Bag description

* Fix bug with bombchu obtainability

* clang-format

* Fix infinite bombchu text

* fix clang-format
This commit is contained in:
Christopher Leggett
2025-12-04 15:14:32 +00:00
committed by GitHub
parent 098cb70460
commit 7e829a0780
28 changed files with 260 additions and 81 deletions

View File

@@ -1259,7 +1259,7 @@ void EnItem00_CustomItemsParticles(Actor* Parent, PlayState* play, GetItemEntry
case RG_DOUBLE_DEFENSE:
colorIndex = PARTICLE_WHITE;
break;
case RG_PROGRESSIVE_BOMBCHUS:
case RG_PROGRESSIVE_BOMBCHU_BAG:
colorIndex = PARTICLE_DARK_BLUE;
break;
case RG_BOTTLE_WITH_FAIRY:

View File

@@ -2211,8 +2211,10 @@ u8 Item_Give(PlayState* play, u8 item) {
AMMO(ITEM_BOMBCHU) = 10;
} else {
AMMO(ITEM_BOMBCHU) += 10;
if (AMMO(ITEM_BOMBCHU) > 50) {
AMMO(ITEM_BOMBCHU) = 50;
if (GameInteractor_Should(VB_CHECK_BOMBCHU_CAPACITY, true)) {
if (AMMO(ITEM_BOMBCHU) > 50) {
AMMO(ITEM_BOMBCHU) = 50;
}
}
}
return Return_Item(item, MOD_NONE, ITEM_NONE);
@@ -2222,8 +2224,10 @@ u8 Item_Give(PlayState* play, u8 item) {
AMMO(ITEM_BOMBCHU) += sAmmoRefillCounts[item - ITEM_BOMBCHUS_5 + 8];
} else {
AMMO(ITEM_BOMBCHU) += sAmmoRefillCounts[item - ITEM_BOMBCHUS_5 + 8];
if (AMMO(ITEM_BOMBCHU) > 50) {
AMMO(ITEM_BOMBCHU) = 50;
if (GameInteractor_Should(VB_CHECK_BOMBCHU_CAPACITY, true)) {
if (AMMO(ITEM_BOMBCHU) > 50) {
AMMO(ITEM_BOMBCHU) = 50;
}
}
}
return Return_Item(item, MOD_NONE, ITEM_NONE);
@@ -2996,8 +3000,10 @@ void Inventory_ChangeAmmo(s16 item, s16 ammoChange) {
} else if (item == ITEM_BOMBCHU) {
AMMO(ITEM_BOMBCHU) += ammoChange;
if (AMMO(ITEM_BOMBCHU) >= 50) {
AMMO(ITEM_BOMBCHU) = 50;
if (GameInteractor_Should(VB_CHECK_BOMBCHU_CAPACITY, true)) {
if (AMMO(ITEM_BOMBCHU) > 50) {
AMMO(ITEM_BOMBCHU) = 50;
}
} else if (AMMO(ITEM_BOMBCHU) < 0) {
AMMO(ITEM_BOMBCHU) = 0;
}
@@ -4908,7 +4914,7 @@ void Interface_DrawAmmoCount(PlayState* play, s16 button, s16 alpha) {
((i == ITEM_SLINGSHOT) && (AMMO(i) == CUR_CAPACITY(UPG_BULLET_BAG))) ||
((i == ITEM_STICK) && (AMMO(i) == CUR_CAPACITY(UPG_STICKS))) ||
((i == ITEM_NUT) && (AMMO(i) == CUR_CAPACITY(UPG_NUTS))) || ((i == ITEM_BOMBCHU) && (ammo == 50)) ||
((i == ITEM_BEAN) && (ammo == 15))) {
((i == ITEM_BEAN) && (ammo == 15)) || GameInteractor_Should(VB_COLOR_AMMO_GREEN, false, i)) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 120, 255, 0, alpha);
}