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

@@ -1307,6 +1307,9 @@ void EnItem00_CustomItemsParticles(Actor* Parent, PlayState* play, GetItemEntry
case RG_DOUBLE_DEFENSE:
color_slot = 8;
break;
case RG_PROGRESSIVE_BOMBCHUS:
color_slot = 9;
break;
default:
return;
}
@@ -1315,34 +1318,40 @@ void EnItem00_CustomItemsParticles(Actor* Parent, PlayState* play, GetItemEntry
return;
}
s16* colors[9][3] = {
{ 34, 255, 76 }, // Minuet and Magic Upgrades Colors
{ 177, 35, 35 }, // Bolero Colors
{ 115, 251, 253 }, // Serenade Color
{ 177, 122, 35 }, // Requiem Color
{ 177, 28, 212 }, // Nocturne Color
{ 255, 255, 92 }, // Prelude Color
{ 31, 152, 49 }, // Stick Upgrade Color
{ 222, 182, 20 }, // Nut Upgrade Color
{ 255, 255, 255 } // Double Defense Color
// Color of the circle for the particles
static Color_RGBA8 mainColors[10][3] = {
{ 34, 255, 76 }, // Minuet, Bean Pack, and Magic Upgrades
{ 177, 35, 35 }, // Bolero
{ 115, 251, 253 }, // Serenade
{ 177, 122, 35 }, // Requiem
{ 177, 28, 212 }, // Nocturne
{ 255, 255, 92 }, // Prelude
{ 31, 152, 49 }, // Stick Upgrade
{ 222, 182, 20 }, // Nut Upgrade
{ 255, 255, 255 }, // Double Defense
{ 19, 120, 182 } // Progressive Bombchu
};
s16* colorsEnv[9][3] = {
{ 30, 110, 30 }, // Minuet and Magic Upgrades Colors
{ 90, 10, 10 }, // Bolero and Double Defense Colors
{ 35, 35, 177 }, // Serenade Color
{ 70, 20, 10 }, // Requiem Color
{ 100, 20, 140 }, // Nocturne Color
{ 100, 100, 10 }, // Prelude Color
{ 5, 50, 10 }, // Stick Upgrade Color
{ 150, 100, 5 }, // Nut Upgrade Color
{ 154, 154, 154 } // White Color placeholder
// Color of the faded flares stretching off the particles
static Color_RGBA8 flareColors[10][3] = {
{ 30, 110, 30 }, // Minuet, Bean Pack, and Magic Upgrades
{ 90, 10, 10 }, // Bolero
{ 35, 35, 177 }, // Serenade
{ 70, 20, 10 }, // Requiem
{ 100, 20, 140 }, // Nocturne
{ 100, 100, 10 }, // Prelude
{ 5, 50, 10 }, // Stick Upgrade
{ 150, 100, 5 }, // Nut Upgrade
{ 154, 154, 154 }, // Double Defense
{ 204, 102, 0 } // Progressive Bombchu
};
static Vec3f velocity = { 0.0f, 0.0f, 0.0f };
static Vec3f accel = { 0.0f, 0.0f, 0.0f };
Color_RGBA8 primColor = { colors[color_slot][0], colors[color_slot][1], colors[color_slot][2], 0 };
Color_RGBA8 envColor = { colors[color_slot][0], colors[color_slot][1], colors[color_slot][2], 0 };
Color_RGBA8 primColor;
Color_RGBA8 envColor;
Color_RGBA8_Copy(&primColor, &mainColors[color_slot]);
Color_RGBA8_Copy(&envColor, &flareColors[color_slot]);
Vec3f pos;
// Make particles more compact for shop items and use a different height offset for them.

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;