From 26a4622982cf0d73b861ad655bd11ea787a10a4e Mon Sep 17 00:00:00 2001 From: PurpleHato Date: Tue, 26 Jul 2022 00:44:38 +0200 Subject: [PATCH] ADD: Rando particles on NUTS and STICK Upgrade (#907) * ADD: Rando particles on NUTS and STICK Upgrade (Completely forgot they were a thing...) * TWEAK: spacing comment --- soh/src/code/z_en_item00.c | 51 ++++++++++++------- .../actors/ovl_En_Ex_Item/z_en_ex_item.c | 6 ++- .../ovl_Item_Etcetera/z_item_etcetera.c | 6 ++- .../actors/ovl_Item_Ocarina/z_item_ocarina.c | 3 +- 4 files changed, 43 insertions(+), 23 deletions(-) diff --git a/soh/src/code/z_en_item00.c b/soh/src/code/z_en_item00.c index 6ca5d81b5..b31209d83 100644 --- a/soh/src/code/z_en_item00.c +++ b/soh/src/code/z_en_item00.c @@ -1232,27 +1232,40 @@ void EnItem00_CustomItemsParticles(Actor* Parent, GlobalContext* globalCtx, s16 case GI_PRELUDE_OF_LIGHT: color_slot = 5; break; + case GI_STICK_UPGRADE_20: + case GI_STICK_UPGRADE_30: + color_slot = 6; + break; + case GI_NUT_UPGRADE_30: + case GI_NUT_UPGRADE_40: + color_slot = 7; + break; } - s16* colors[7][3] = { - { 34, 255, 76 }, // Minuet and Magic Upgrades Colors - { 177, 35, 35 }, // Bolero and Double Defense Colors - { 115, 251, 253 }, // Serenade Color - { 177, 122, 35 }, // Requiem Color - { 177, 28, 212 }, // Nocturne Color - { 255, 255, 92 }, // Prelude Color - { 255, 255, 255} // White Color placeholder + s16* colors[9][3] = { + { 34, 255, 76 }, // Minuet and Magic Upgrades Colors + { 177, 35, 35 }, // Bolero and Double Defense 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 } // White Color placeholder }; - s16* colorsEnv[7][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 - { 154, 154, 154 } // White Color placeholder + 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 }; + static Vec3f velocity = { 0.0f, 0.2f, 0.0f }; static Vec3f accel = { 0.0f, 0.05f, 0.0f }; Color_RGBA8 primColor = { colors[color_slot][0], colors[color_slot][1], colors[color_slot][2], 0 }; @@ -1305,7 +1318,8 @@ void EnItem00_DrawCollectible(EnItem00* this, GlobalContext* globalCtx) { f32 mtxScale = 16.0f; Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); s32 randoGetItemId = Randomizer_GetRandomizedItemId(this->getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum); - if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) { + if ((randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) || + (randoGetItemId >= GI_STICK_UPGRADE_20 && randoGetItemId <= GI_NUT_UPGRADE_40)) { EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId); } GetItem_Draw(globalCtx, Randomizer_GetItemModelFromId(randoGetItemId)); @@ -1365,7 +1379,8 @@ void EnItem00_DrawHeartPiece(EnItem00* this, GlobalContext* globalCtx) { f32 mtxScale = 16.0f; Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); s32 randoGetItemId = Randomizer_GetRandomizedItemId(GI_HEART_PIECE, this->actor.id, this->ogParams, globalCtx->sceneNum); - if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) { + if ((randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) || + (randoGetItemId >= GI_STICK_UPGRADE_20 && randoGetItemId <= GI_NUT_UPGRADE_40)) { EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId); } GetItem_Draw(globalCtx, Randomizer_GetItemModelFromId(randoGetItemId)); diff --git a/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c b/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c index b42ad6cbf..c5d0238e7 100644 --- a/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c +++ b/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c @@ -520,7 +520,8 @@ void EnExItem_DrawItems(EnExItem* this, GlobalContext* globalCtx) { break; } - if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) { + if ((randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) || + (randoGetItemId >= GI_STICK_UPGRADE_20 && randoGetItemId <= GI_NUT_UPGRADE_40)) { EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId); } } @@ -534,7 +535,8 @@ void EnExItem_DrawHeartPiece(EnExItem* this, GlobalContext* globalCtx) { if (gSaveContext.n64ddFlag) { s32 randoGetItemId = Randomizer_GetItemIdFromKnownCheck( RC_MARKET_BOMBCHU_BOWLING_SECOND_PRIZE, GI_HEART_PIECE); - if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) { + if ((randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) || + (randoGetItemId >= GI_STICK_UPGRADE_20 && randoGetItemId <= GI_NUT_UPGRADE_40)) { EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId); } GetItem_Draw(globalCtx, Randomizer_GetItemModelFromId(randoGetItemId)); diff --git a/soh/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c b/soh/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c index cfa115daf..b0354008d 100644 --- a/soh/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c +++ b/soh/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c @@ -230,7 +230,8 @@ void ItemEtcetera_DrawThroughLens(Actor* thisx, GlobalContext* globalCtx) { if(gSaveContext.n64ddFlag && globalCtx->sceneNum == 16) { s32 randoGetItemId = GetChestGameRandoGetItemId(this->actor.room, this->giDrawId, globalCtx); - if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) { + if ((randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) || + (randoGetItemId >= GI_STICK_UPGRADE_20 && randoGetItemId <= GI_NUT_UPGRADE_40)) { EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId); } if (randoGetItemId != GI_NONE) { @@ -255,7 +256,8 @@ void ItemEtcetera_Draw(Actor* thisx, GlobalContext* globalCtx) { randoGetItemId = Randomizer_GetItemIdFromKnownCheck(RC_LH_UNDERWATER_ITEM, GI_LETTER_RUTO); } - if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) { + if ((randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) || + (randoGetItemId >= GI_STICK_UPGRADE_20 && randoGetItemId <= GI_NUT_UPGRADE_40)) { EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId); } diff --git a/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c b/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c index 9992d08b3..72fc68876 100644 --- a/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c +++ b/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c @@ -215,7 +215,8 @@ void ItemOcarina_Draw(Actor* thisx, GlobalContext* globalCtx) { if (gSaveContext.n64ddFlag) { s32 randoGetItemId = Randomizer_GetItemIdFromKnownCheck(RC_HF_OCARINA_OF_TIME_ITEM, GI_OCARINA_OOT); - if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) { + if ((randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) || + (randoGetItemId >= GI_STICK_UPGRADE_20 && randoGetItemId <= GI_NUT_UPGRADE_40)) { EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId); } GetItem_Draw(globalCtx, Randomizer_GetItemModelFromId(randoGetItemId));