Fixed Particle effects in the new getItem system.

This commit is contained in:
Christopher Leggett 2022-08-07 11:35:37 -04:00
parent 3258fc5fb3
commit 75aaefaf04
No known key found for this signature in database
GPG Key ID: 7093AE5FF7037D79

View File

@ -1208,38 +1208,56 @@ void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) {
} }
} }
void EnItem00_CustomItemsParticles(Actor* Parent, GlobalContext* globalCtx, s16 getItemId) { void EnItem00_CustomItemsParticles(Actor* Parent, GlobalContext* globalCtx, GetItemEntry giEntry) {
s16 color_slot; s16 color_slot;
switch (getItemId) { switch (giEntry.modIndex) {
case GI_MINUET_OF_FOREST: case 0:
case GI_SINGLE_MAGIC: switch (giEntry.itemId) {
case GI_DOUBLE_MAGIC: case ITEM_SONG_MINUET:
color_slot = 0; color_slot = 0;
break;
case ITEM_SONG_BOLERO:
color_slot = 1;
break;
case ITEM_SONG_SERENADE:
color_slot = 2;
break;
case ITEM_SONG_REQUIEM:
color_slot = 3;
break;
case ITEM_SONG_NOCTURNE:
color_slot = 4;
break;
case ITEM_SONG_PRELUDE:
color_slot = 5;
break;
case ITEM_STICK_UPGRADE_20:
case ITEM_STICK_UPGRADE_30:
color_slot = 6;
break;
case ITEM_NUT_UPGRADE_30:
case ITEM_NUT_UPGRADE_40:
color_slot = 7;
break;
default:
return;
}
break; break;
case GI_BOLERO_OF_FIRE: case 1:
case GI_DOUBLE_DEFENSE: switch (giEntry.itemId) {
color_slot = 1; case RG_MAGIC_SINGLE:
break; case RG_MAGIC_DOUBLE:
case GI_SERENADE_OF_WATER: color_slot = 0;
color_slot = 2; break;
break; case RG_DOUBLE_DEFENSE:
case GI_REQUIEM_OF_SPIRIT: color_slot = 1;
color_slot = 3; break;
break; default:
case GI_NOCTURNE_OF_SHADOW: return;
color_slot = 4; }
break;
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; break;
default:
return;
} }
s16* colors[9][3] = { s16* colors[9][3] = {
@ -1320,10 +1338,7 @@ void EnItem00_DrawCollectible(EnItem00* this, GlobalContext* globalCtx) {
s32 randoGetItemId = Randomizer_GetRandomizedItemId(this->getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum); s32 randoGetItemId = Randomizer_GetRandomizedItemId(this->getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum);
GetItemEntry randoGetItemEntry = GetItemEntry randoGetItemEntry =
Randomizer_GetRandomizedItem(this->getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum); Randomizer_GetRandomizedItem(this->getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum);
if ((randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) || EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemEntry);
(randoGetItemId >= GI_STICK_UPGRADE_20 && randoGetItemId <= GI_NUT_UPGRADE_40)) {
EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId);
}
GetItem_Draw(globalCtx, randoGetItemEntry.gi); GetItem_Draw(globalCtx, randoGetItemEntry.gi);
} else { } else {
s32 texIndex = this->actor.params - 3; s32 texIndex = this->actor.params - 3;
@ -1383,10 +1398,7 @@ void EnItem00_DrawHeartPiece(EnItem00* this, GlobalContext* globalCtx) {
s32 randoGetItemId = Randomizer_GetRandomizedItemId(GI_HEART_PIECE, this->actor.id, this->ogParams, globalCtx->sceneNum); s32 randoGetItemId = Randomizer_GetRandomizedItemId(GI_HEART_PIECE, this->actor.id, this->ogParams, globalCtx->sceneNum);
GetItemEntry randoGetItemEntry = GetItemEntry randoGetItemEntry =
Randomizer_GetRandomizedItem(GI_HEART_PIECE, this->actor.id, this->ogParams, globalCtx->sceneNum); Randomizer_GetRandomizedItem(GI_HEART_PIECE, this->actor.id, this->ogParams, globalCtx->sceneNum);
if ((randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) || EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemEntry);
(randoGetItemId >= GI_STICK_UPGRADE_20 && randoGetItemId <= GI_NUT_UPGRADE_40)) {
EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId);
}
GetItem_Draw(globalCtx, ABS(randoGetItemEntry.gi - 1)); GetItem_Draw(globalCtx, ABS(randoGetItemEntry.gi - 1));
} else { } else {
s32 pad; s32 pad;