From 189baf8e79e0e1aa6d39402307a961e30ad32bdc Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Fri, 24 Apr 2026 21:55:03 +0200 Subject: [PATCH] `Item_DropCollectibleRandom`: params macro and drop tables enum (#2707) * `Item_DropCollectibleRandom`: params macro and drop tables enum * fixup --- include/z_en_item00.h | 20 +++++++++++++ src/code/z_en_item00.c | 30 +++++++++---------- src/overlays/actors/ovl_En_Am/z_en_am.c | 3 +- .../actors/ovl_En_Anubice/z_en_anubice.c | 3 +- src/overlays/actors/ovl_En_Bb/z_en_bb.c | 3 +- .../actors/ovl_En_Bigokuta/z_en_bigokuta.c | 3 +- src/overlays/actors/ovl_En_Bili/z_en_bili.c | 3 +- .../actors/ovl_En_Bubble/z_en_bubble.c | 3 +- src/overlays/actors/ovl_En_Bw/z_en_bw.c | 6 ++-- src/overlays/actors/ovl_En_Crow/z_en_crow.c | 3 +- .../actors/ovl_En_Dekubaba/z_en_dekubaba.c | 3 +- .../actors/ovl_En_Dekunuts/z_en_dekunuts.c | 3 +- src/overlays/actors/ovl_En_Dh/z_en_dh.c | 3 +- src/overlays/actors/ovl_En_Dha/z_en_dha.c | 3 +- .../actors/ovl_En_Dodojr/z_en_dodojr.c | 3 +- .../actors/ovl_En_Dodongo/z_en_dodongo.c | 3 +- src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c | 3 +- .../actors/ovl_En_Firefly/z_en_firefly.c | 3 +- .../actors/ovl_En_Floormas/z_en_floormas.c | 3 +- src/overlays/actors/ovl_En_Fw/z_en_fw.c | 3 +- src/overlays/actors/ovl_En_Fz/z_en_fz.c | 3 +- src/overlays/actors/ovl_En_Goma/z_en_goma.c | 3 +- src/overlays/actors/ovl_En_Ik/z_en_ik.c | 3 +- src/overlays/actors/ovl_En_Ishi/z_en_ishi.c | 7 +++-- src/overlays/actors/ovl_En_Kusa/z_en_kusa.c | 7 +++-- src/overlays/actors/ovl_En_Mb/z_en_mb.c | 6 ++-- src/overlays/actors/ovl_En_Ny/z_en_ny.c | 3 +- src/overlays/actors/ovl_En_Okuta/z_en_okuta.c | 3 +- .../actors/ovl_En_Peehat/z_en_peehat.c | 21 ++++++++----- .../ovl_En_Po_Sisters/z_en_po_sisters.c | 3 +- src/overlays/actors/ovl_En_Rd/z_en_rd.c | 6 ++-- src/overlays/actors/ovl_En_Reeba/z_en_reeba.c | 6 ++-- src/overlays/actors/ovl_En_Rr/z_en_rr.c | 3 +- src/overlays/actors/ovl_En_Sb/z_en_sb.c | 3 +- src/overlays/actors/ovl_En_Skb/z_en_skb.c | 3 +- src/overlays/actors/ovl_En_St/z_en_st.c | 3 +- src/overlays/actors/ovl_En_Sw/z_en_sw.c | 3 +- src/overlays/actors/ovl_En_Test/z_en_test.c | 6 ++-- src/overlays/actors/ovl_En_Tite/z_en_tite.c | 6 ++-- .../actors/ovl_En_Torch2/z_en_torch2.c | 3 +- src/overlays/actors/ovl_En_Tp/z_en_tp.c | 3 +- src/overlays/actors/ovl_En_Vali/z_en_vali.c | 3 +- src/overlays/actors/ovl_En_Vm/z_en_vm.c | 3 +- .../actors/ovl_En_Wallmas/z_en_wallmas.c | 6 ++-- .../actors/ovl_En_Weiyer/z_en_weiyer.c | 3 +- src/overlays/actors/ovl_En_Wf/z_en_wf.c | 3 +- .../actors/ovl_En_Wood02/z_en_wood02.c | 5 ++-- src/overlays/actors/ovl_En_Zf/z_en_zf.c | 4 +-- 48 files changed, 158 insertions(+), 80 deletions(-) diff --git a/include/z_en_item00.h b/include/z_en_item00.h index 4eb1ae735b..3b79a23883 100644 --- a/include/z_en_item00.h +++ b/include/z_en_item00.h @@ -4,6 +4,26 @@ #include "ultra64.h" #include "actor.h" +#define COLLECTIBLE_DROP_RANDOM_PARAMS(dropTable, params8000) (((dropTable) * 16) | ((params8000) ? 0x8000 : 0)) + +typedef enum CollectibleDropTable { + /* 0 */ COLLECTIBLE_DROP_TABLE_0, + /* 1 */ COLLECTIBLE_DROP_TABLE_1, + /* 2 */ COLLECTIBLE_DROP_TABLE_2, + /* 3 */ COLLECTIBLE_DROP_TABLE_3, + /* 4 */ COLLECTIBLE_DROP_TABLE_4, + /* 5 */ COLLECTIBLE_DROP_TABLE_5, + /* 6 */ COLLECTIBLE_DROP_TABLE_6, + /* 7 */ COLLECTIBLE_DROP_TABLE_7, + /* 8 */ COLLECTIBLE_DROP_TABLE_8, + /* 9 */ COLLECTIBLE_DROP_TABLE_9, + /* 10 */ COLLECTIBLE_DROP_TABLE_10, + /* 11 */ COLLECTIBLE_DROP_TABLE_11, + /* 12 */ COLLECTIBLE_DROP_TABLE_12, + /* 13 */ COLLECTIBLE_DROP_TABLE_13, + /* 14 */ COLLECTIBLE_DROP_TABLE_14 +} CollectibleDropTable; + typedef enum Item00Type { /* 0x00 */ ITEM00_RUPEE_GREEN, /* 0x01 */ ITEM00_RUPEE_BLUE, diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index 3cddc6a9fd..1fe2d00527 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -99,7 +99,7 @@ static void* sItemDropTex[] = { }; static u8 sItemDropIds[] = { - // 0 + // COLLECTIBLE_DROP_TABLE_0 ITEM00_RUPEE_GREEN, ITEM00_RUPEE_BLUE, ITEM00_NONE, @@ -117,7 +117,7 @@ static u8 sItemDropIds[] = { ITEM00_NONE, ITEM00_RUPEE_BLUE, - // 1 + // COLLECTIBLE_DROP_TABLE_1 ITEM00_RUPEE_GREEN, ITEM00_MAGIC_SMALL, ITEM00_RUPEE_GREEN, @@ -135,7 +135,7 @@ static u8 sItemDropIds[] = { ITEM00_NONE, ITEM00_MAGIC_SMALL, - // 2 + // COLLECTIBLE_DROP_TABLE_2 ITEM00_RUPEE_GREEN, ITEM00_RUPEE_GREEN, ITEM00_MAGIC_SMALL, @@ -153,7 +153,7 @@ static u8 sItemDropIds[] = { ITEM00_FLEXIBLE, ITEM00_MAGIC_SMALL, - // 3 + // COLLECTIBLE_DROP_TABLE_3 ITEM00_RUPEE_GREEN, ITEM00_RUPEE_GREEN, ITEM00_NUTS, @@ -171,7 +171,7 @@ static u8 sItemDropIds[] = { ITEM00_NONE, ITEM00_NONE, - // 4 + // COLLECTIBLE_DROP_TABLE_4 ITEM00_RUPEE_GREEN, ITEM00_RUPEE_GREEN, ITEM00_SEEDS, @@ -189,7 +189,7 @@ static u8 sItemDropIds[] = { ITEM00_NONE, ITEM00_MAGIC_SMALL, - // 5 + // COLLECTIBLE_DROP_TABLE_5 ITEM00_RUPEE_GREEN, ITEM00_MAGIC_SMALL, ITEM00_RUPEE_GREEN, @@ -207,7 +207,7 @@ static u8 sItemDropIds[] = { ITEM00_NONE, ITEM00_MAGIC_SMALL, - // 6 + // COLLECTIBLE_DROP_TABLE_6 ITEM00_RUPEE_GREEN, ITEM00_RUPEE_BLUE, ITEM00_NONE, @@ -225,7 +225,7 @@ static u8 sItemDropIds[] = { ITEM00_NONE, ITEM00_MAGIC_LARGE, - // 7 + // COLLECTIBLE_DROP_TABLE_7 ITEM00_RUPEE_GREEN, ITEM00_NONE, ITEM00_RUPEE_BLUE, @@ -243,7 +243,7 @@ static u8 sItemDropIds[] = { ITEM00_NONE, ITEM00_MAGIC_LARGE, - // 8 + // COLLECTIBLE_DROP_TABLE_8 ITEM00_ARROWS_LARGE, ITEM00_ARROWS_MEDIUM, ITEM00_ARROWS_MEDIUM, @@ -261,7 +261,7 @@ static u8 sItemDropIds[] = { ITEM00_ARROWS_LARGE, ITEM00_ARROWS_LARGE, - // 9 + // COLLECTIBLE_DROP_TABLE_9 ITEM00_MAGIC_LARGE, ITEM00_MAGIC_SMALL, ITEM00_MAGIC_SMALL, @@ -279,7 +279,7 @@ static u8 sItemDropIds[] = { ITEM00_MAGIC_SMALL, ITEM00_MAGIC_LARGE, - // 10 + // COLLECTIBLE_DROP_TABLE_10 ITEM00_BOMBS_A, ITEM00_NONE, ITEM00_BOMBS_A, @@ -297,7 +297,7 @@ static u8 sItemDropIds[] = { ITEM00_NONE, ITEM00_BOMBS_A, - // 11 + // COLLECTIBLE_DROP_TABLE_11 ITEM00_RECOVERY_HEART, ITEM00_RECOVERY_HEART, ITEM00_RECOVERY_HEART, @@ -315,7 +315,7 @@ static u8 sItemDropIds[] = { ITEM00_RECOVERY_HEART, ITEM00_RECOVERY_HEART, - // 12 + // COLLECTIBLE_DROP_TABLE_12 ITEM00_RUPEE_RED, ITEM00_RUPEE_BLUE, ITEM00_RUPEE_BLUE, @@ -333,7 +333,7 @@ static u8 sItemDropIds[] = { ITEM00_RUPEE_RED, ITEM00_RUPEE_RED, - // 13 + // COLLECTIBLE_DROP_TABLE_13 ITEM00_SEEDS, ITEM00_NONE, ITEM00_NUTS, @@ -351,7 +351,7 @@ static u8 sItemDropIds[] = { ITEM00_RECOVERY_HEART, ITEM00_SEEDS, - // 14 + // COLLECTIBLE_DROP_TABLE_14 ITEM00_RECOVERY_HEART, ITEM00_NONE, ITEM00_SEEDS, diff --git a/src/overlays/actors/ovl_En_Am/z_en_am.c b/src/overlays/actors/ovl_En_Am/z_en_am.c index b3f31ec53f..9161638b8e 100644 --- a/src/overlays/actors/ovl_En_Am/z_en_am.c +++ b/src/overlays/actors/ovl_En_Am/z_en_am.c @@ -880,7 +880,8 @@ void EnAm_Update(Actor* thisx, PlayState* play) { } Actor_PlaySfx(&this->dyna.actor, NA_SE_EN_AMOS_DEAD); - Item_DropCollectibleRandom(play, &this->dyna.actor, &this->dyna.actor.world.pos, 0xA0); + Item_DropCollectibleRandom(play, &this->dyna.actor, &this->dyna.actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_10, false)); for (i = 9; i >= 0; i--) { dustPos.x = (sinf(dustPosScale) * 7.0f) + this->dyna.actor.world.pos.x; diff --git a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c index 7f060f2ea7..913e722a8b 100644 --- a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c +++ b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c @@ -365,7 +365,8 @@ void EnAnubice_Die(EnAnubice* this, PlayState* play) { if ((this->animLastFrame <= curFrame) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { Math_ApproachF(&this->actor.shape.yOffset, -4230.0f, 0.5f, 300.0f); if (this->actor.shape.yOffset < -2000.0f) { - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xC0); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_12, false)); Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Bb/z_en_bb.c b/src/overlays/actors/ovl_En_Bb/z_en_bb.c index 88a2de6c8b..59a3a06a22 100644 --- a/src/overlays/actors/ovl_En_Bb/z_en_bb.c +++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.c @@ -509,7 +509,8 @@ void EnBb_Death(EnBb* this, PlayState* play) { if (!BodyBreak_SpawnParts(&this->actor, &this->bodyBreak, play, enpartType)) { return; } - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xD0); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_13, false)); } else { if (this->flamePrimAlpha) { if (this->flamePrimAlpha <= 20) { diff --git a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c index 51cab89db8..b67018dae3 100644 --- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c +++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c @@ -663,7 +663,8 @@ void func_809BE26C(EnBigokuta* this, PlayState* play) { Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0); Camera_SetStateFlag(play->cameraPtrs[CAM_ID_MAIN], CAM_STATE_CHECK_BG); SfxSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 50, NA_SE_EN_OCTAROCK_BUBLE); - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xB0); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_11, false)); Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Bili/z_en_bili.c b/src/overlays/actors/ovl_En_Bili/z_en_bili.c index 74b679b7e2..8c59981d48 100644 --- a/src/overlays/actors/ovl_En_Bili/z_en_bili.c +++ b/src/overlays/actors/ovl_En_Bili/z_en_bili.c @@ -496,7 +496,8 @@ void EnBili_Die(EnBili* this, PlayState* play) { return; } this->actor.draw = NULL; - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x50); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_5, false)); } if (this->timer != 0) { diff --git a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c index 0624c84add..d16e9fee9e 100644 --- a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c +++ b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c @@ -157,7 +157,8 @@ s32 EnBubble_Explosion(EnBubble* this, PlayState* play) { EffectSsDtBubble_SpawnCustomColor(play, &effectPos, &effectVel, &effectAccel, &sEffectPrimColor, &sEffectEnvColor, Rand_S16Offset(100, 50), 0x19, 0); } - Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, 0x50); + Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_5, false)); this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; return Rand_S16Offset(90, 60); } diff --git a/src/overlays/actors/ovl_En_Bw/z_en_bw.c b/src/overlays/actors/ovl_En_Bw/z_en_bw.c index 332a29c93f..09ce94acac 100644 --- a/src/overlays/actors/ovl_En_Bw/z_en_bw.c +++ b/src/overlays/actors/ovl_En_Bw/z_en_bw.c @@ -691,7 +691,8 @@ void func_809D0424(EnBw* this, PlayState* play) { } else { this->unk_230 = 1; } - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x90); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_9, false)); func_809D00F4(this); } } @@ -734,7 +735,8 @@ void func_809D0584(EnBw* this, PlayState* play) { } else { this->unk_230 = 1; } - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x90); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_9, false)); func_809D00F4(this); } } else if ((this->unk_220 != 1) && (this->unk_220 != 6)) { diff --git a/src/overlays/actors/ovl_En_Crow/z_en_crow.c b/src/overlays/actors/ovl_En_Crow/z_en_crow.c index 195494c853..2b185e6362 100644 --- a/src/overlays/actors/ovl_En_Crow/z_en_crow.c +++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.c @@ -368,7 +368,8 @@ void EnCrow_Die(EnCrow* this, PlayState* play) { if (Math_StepToF(&this->actor.scale.x, 0.0f, step)) { if (this->actor.params == 0) { sDeathCount++; - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_0, false)); } else { Item_DropCollectible(play, &this->actor.world.pos, ITEM00_RUPEE_RED); } diff --git a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c index a06c6efebc..a133dda66b 100644 --- a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c +++ b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c @@ -1013,7 +1013,8 @@ void EnDekubaba_ShrinkDie(EnDekubaba* this, PlayState* play) { Item_DropCollectible(play, &this->actor.world.pos, ITEM00_NUTS); } } else { - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x30); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_3, false)); } Actor_Kill(&this->actor); } diff --git a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c index 1197e36c9d..d50d263bf9 100644 --- a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c +++ b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c @@ -443,7 +443,8 @@ void EnDekunuts_Die(EnDekunuts* this, PlayState* play) { 150, 150, 1, 13, 1); effectPos.y = this->actor.world.pos.y + 10.0f; EffectSsHahen_SpawnBurst(play, &effectPos, 3.0f, 0, 12, 3, 15, HAHEN_OBJECT_DEFAULT, 10, NULL); - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x30); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_3, false)); if (this->actor.child != NULL) { Actor_ChangeCategory(play, &play->actorCtx, this->actor.child, ACTORCAT_PROP); } diff --git a/src/overlays/actors/ovl_En_Dh/z_en_dh.c b/src/overlays/actors/ovl_En_Dh/z_en_dh.c index dc7007f672..d56663831d 100644 --- a/src/overlays/actors/ovl_En_Dh/z_en_dh.c +++ b/src/overlays/actors/ovl_En_Dh/z_en_dh.c @@ -520,7 +520,8 @@ void EnDh_CollisionCheck(EnDh* this, PlayState* play) { lastHealth = this->actor.colChkInfo.health; if (Actor_ApplyDamage(&this->actor) == 0) { EnDh_SetupDeath(this); - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x90); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_9, false)); } else { if (((lastHealth >= 15) && (this->actor.colChkInfo.health < 15)) || ((lastHealth >= 9) && (this->actor.colChkInfo.health < 9)) || diff --git a/src/overlays/actors/ovl_En_Dha/z_en_dha.c b/src/overlays/actors/ovl_En_Dha/z_en_dha.c index d93711b6c3..f06b0e6c68 100644 --- a/src/overlays/actors/ovl_En_Dha/z_en_dha.c +++ b/src/overlays/actors/ovl_En_Dha/z_en_dha.c @@ -417,7 +417,8 @@ void EnDha_UpdateHealth(EnDha* this, PlayState* play) { if (Actor_ApplyDamage(&this->actor) == 0) { EnDha_SetupDeath(this); this->actor.colChkInfo.health = 8; - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xE0); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_14, false)); } else { Actor_PlaySfx(&this->actor, NA_SE_EN_DEADHAND_DAMAGE); this->unk_1C0 = 9; diff --git a/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c b/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c index 3697c6593e..1097c47c4c 100644 --- a/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c +++ b/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c @@ -607,7 +607,8 @@ void EnDodojr_DeathSequence(EnDodojr* this, PlayState* play) { void EnDodojr_DropItem(EnDodojr* this, PlayState* play) { if (DECR(this->timer) == 0) { - Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, 0x40); + Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_4, false)); Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c index ccbb01753d..cd968914d9 100644 --- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c +++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c @@ -710,7 +710,8 @@ void EnDodongo_Death(EnDodongo* this, PlayState* play) { if (this->timer != 0) { this->timer--; if (this->timer == 0) { - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x40); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_4, false)); Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c index 91d9941dba..b1a7d1f87a 100644 --- a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c +++ b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c @@ -588,7 +588,8 @@ void EnEiyer_Dead(EnEiyer* this, PlayState* play) { this->actor.world.pos.y -= 2.0f; if (this->actor.shape.shadowAlpha == 0) { - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 80); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_5, false)); Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c index 5de7f1e5a9..93ca3bc91b 100644 --- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c +++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c @@ -461,7 +461,8 @@ void EnFirefly_Die(EnFirefly* this, PlayState* play) { Math_StepToF(&this->actor.scale.x, 0.0f, 0.00034f); this->actor.scale.y = this->actor.scale.z = this->actor.scale.x; if (this->timer == 0) { - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xE0); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_14, false)); Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c index 0cf427357e..7737e17bba 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -447,7 +447,8 @@ void EnFloormas_Die(EnFloormas* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EN_FLOORMASTER_SPLIT); } else { // Die - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x90); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_9, false)); EnFloormas_SetupSmallShrink(this, play); } } diff --git a/src/overlays/actors/ovl_En_Fw/z_en_fw.c b/src/overlays/actors/ovl_En_Fw/z_en_fw.c index d6ffe1e590..6e08db0282 100644 --- a/src/overlays/actors/ovl_En_Fw/z_en_fw.c +++ b/src/overlays/actors/ovl_En_Fw/z_en_fw.c @@ -276,7 +276,8 @@ void EnFw_Run(EnFw* this, PlayState* play) { } flareDancer = this->actor.parent; flareDancer->params |= 0x4000; - Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, 0xA0); + Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_10, false)); Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Fz/z_en_fz.c b/src/overlays/actors/ovl_En_Fz/z_en_fz.c index e2f5d28e09..808a871708 100644 --- a/src/overlays/actors/ovl_En_Fz/z_en_fz.c +++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.c @@ -573,7 +573,8 @@ void EnFz_SetupDespawn(EnFz* this, PlayState* play) { this->isActive = false; this->timer = 60; Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_PROP); - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x60); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_6, false)); this->actionFunc = EnFz_Despawn; } diff --git a/src/overlays/actors/ovl_En_Goma/z_en_goma.c b/src/overlays/actors/ovl_En_Goma/z_en_goma.c index c290012270..88e2efac00 100644 --- a/src/overlays/actors/ovl_En_Goma/z_en_goma.c +++ b/src/overlays/actors/ovl_En_Goma/z_en_goma.c @@ -443,7 +443,8 @@ void EnGoma_Dead(EnGoma* this, PlayState* play) { } SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_EXTINCT); Actor_Kill(&this->actor); - Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, 0x30); + Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_3, false)); } this->visualState = 2; } diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/src/overlays/actors/ovl_En_Ik/z_en_ik.c index ad944a3957..40ef9a24f0 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -715,7 +715,8 @@ void EnIk_Die(EnIk* this, PlayState* play) { } if (this->animationTimer == 0) { - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xB0); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_11, false)); if (this->switchFlag != 0xFF) { Flags_SetSwitch(play, this->switchFlag); diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c index aedb18900b..173c8cf9a8 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -269,11 +269,12 @@ void EnIshi_DropCollectible(EnIshi* this, PlayState* play) { if (PARAMS_GET_U(this->actor.params, 0, 1) == ROCK_SMALL) { dropParams = PARAMS_GET_U(this->actor.params, 8, 4); - if (dropParams >= 0xD) { - dropParams = 0; + if (dropParams >= COLLECTIBLE_DROP_TABLE_13) { + dropParams = COLLECTIBLE_DROP_TABLE_0; } - Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, dropParams << 4); + Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(dropParams, false)); } } diff --git a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c index dfde84fe60..9e905ca5fa 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c @@ -143,10 +143,11 @@ void EnKusa_DropCollectible(EnKusa* this, PlayState* play) { case ENKUSA_TYPE_2: dropParams = PARAMS_GET_U(this->actor.params, 8, 4); - if (dropParams >= 0xD) { - dropParams = 0; + if (dropParams >= COLLECTIBLE_DROP_TABLE_13) { + dropParams = COLLECTIBLE_DROP_TABLE_0; } - Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, dropParams << 4); + Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(dropParams, false)); break; case ENKUSA_TYPE_1: if (Rand_ZeroOne() < 0.5f) { diff --git a/src/overlays/actors/ovl_En_Mb/z_en_mb.c b/src/overlays/actors/ovl_En_Mb/z_en_mb.c index 75eb4b1d49..bc06afc2b2 100644 --- a/src/overlays/actors/ovl_En_Mb/z_en_mb.c +++ b/src/overlays/actors/ovl_En_Mb/z_en_mb.c @@ -1150,7 +1150,8 @@ void EnMb_ClubDead(EnMb* this, PlayState* play) { 9, true); } } else { - Item_DropCollectibleRandom(play, &this->actor, &effPos, 0xC0); + Item_DropCollectibleRandom(play, &this->actor, &effPos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_12, false)); Actor_Kill(&this->actor); } } else if ((s32)this->skelAnime.curFrame == 15 || (s32)this->skelAnime.curFrame == 22) { @@ -1385,7 +1386,8 @@ void EnMb_SpearDead(EnMb* this, PlayState* play) { true); } } else { - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xE0); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_14, false)); Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Ny/z_en_ny.c b/src/overlays/actors/ovl_En_Ny/z_en_ny.c index 79778e54c4..d25e65932f 100644 --- a/src/overlays/actors/ovl_En_Ny/z_en_ny.c +++ b/src/overlays/actors/ovl_En_Ny/z_en_ny.c @@ -456,7 +456,8 @@ void EnNy_SetupDie(EnNy* this, PlayState* play) { } this->timer = 0; if (this->unk_1D0 == 0) { - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xA0); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_10, false)); } else { Item_DropCollectible(play, &this->actor.world.pos, ITEM00_ARROWS_SMALL); } diff --git a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c index b8cd31b2ce..938e7ebdaf 100644 --- a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c +++ b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c @@ -445,7 +445,8 @@ void EnOkuta_Die(EnOkuta* this, PlayState* play) { } else { if (Math_StepToF(&this->actor.scale.x, 0.0f, 0.0005f)) { SfxSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 30, NA_SE_EN_OCTAROCK_BUBLE); - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x70); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_7, false)); for (i = 0; i < 20; i++) { velocity.x = (Rand_ZeroOne() - 0.5f) * 7.0f; velocity.y = Rand_ZeroOne() * 7.0f; diff --git a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c index 7502487ccc..698f42c6a7 100644 --- a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c +++ b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c @@ -302,9 +302,12 @@ void EnPeehat_HitWhenGrounded(EnPeehat* this, PlayState* play) { Vec3f itemDropPos = this->actor.world.pos; itemDropPos.y += 70.0f; - Item_DropCollectibleRandom(play, &this->actor, &itemDropPos, 0x40); - Item_DropCollectibleRandom(play, &this->actor, &itemDropPos, 0x40); - Item_DropCollectibleRandom(play, &this->actor, &itemDropPos, 0x40); + Item_DropCollectibleRandom(play, &this->actor, &itemDropPos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_4, false)); + Item_DropCollectibleRandom(play, &this->actor, &itemDropPos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_4, false)); + Item_DropCollectibleRandom(play, &this->actor, &itemDropPos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_4, false)); this->unk_2D4 = 240; } else { s32 i; @@ -607,7 +610,8 @@ void EnPeehat_Larva_StateSeekPlayer(EnPeehat* this, PlayState* play) { if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { EffectSsDeadSound_SpawnStationary(play, &this->actor.projectedPos, NA_SE_EN_PIHAT_SM_DEAD, 1, 1, 40); } - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x20); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_2, false)); Actor_Kill(&this->actor); } } @@ -888,9 +892,12 @@ void EnPeehat_StateExplode(EnPeehat* this, PlayState* play) { } this->animTimer--; if (this->animTimer == 0) { - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x40); - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x40); - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x40); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_4, false)); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_4, false)); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_4, false)); Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index fe82003ca3..bac5e73916 100644 --- a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -405,7 +405,8 @@ void func_80AD99D4(EnPoSisters* this, PlayState* play) { void func_80AD9A54(EnPoSisters* this, PlayState* play) { this->unk_19A = 0; this->actor.world.pos.y = this->unk_234[0].y; - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x80); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_8, false)); this->actionFunc = func_80ADB17C; } diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/src/overlays/actors/ovl_En_Rd/z_en_rd.c index b41be053d9..11d7ac0b6f 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -795,7 +795,8 @@ void EnRd_Stunned(EnRd* this, PlayState* play) { if (this->actor.colChkInfo.health == 0) { EnRd_UpdateMourningTarget(play, &this->actor, true); EnRd_SetupDead(this); - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x90); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_9, false)); } else { EnRd_SetupDamaged(this); } @@ -867,7 +868,8 @@ void EnRd_UpdateDamage(EnRd* this, PlayState* play) { if (this->actor.colChkInfo.health == 0) { EnRd_UpdateMourningTarget(play, &this->actor, true); EnRd_SetupDead(this); - Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, 0x90); + Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_9, false)); } else { EnRd_SetupDamaged(this); } diff --git a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c index aeff74445a..c6b8589047 100644 --- a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c +++ b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c @@ -509,9 +509,11 @@ void EnReeba_Die(EnReeba* this, PlayState* play) { EffectSsDeadDb_Spawn(play, &pos, &velocity, &accel, 120, 0, 255, 255, 255, 255, 255, 0, 0, 1, 9, true); if (this->type == LEEVER_TYPE_SMALL) { - Item_DropCollectibleRandom(play, &this->actor, &pos, 0xE0); + Item_DropCollectibleRandom(play, &this->actor, &pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_14, false)); } else { - Item_DropCollectibleRandom(play, &this->actor, &pos, 0xC0); + Item_DropCollectibleRandom(play, &this->actor, &pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_12, false)); } if (this->actor.parent != NULL) { diff --git a/src/overlays/actors/ovl_En_Rr/z_en_rr.c b/src/overlays/actors/ovl_En_Rr/z_en_rr.c index e18f1cb0cd..67c83dd2d2 100644 --- a/src/overlays/actors/ovl_En_Rr/z_en_rr.c +++ b/src/overlays/actors/ovl_En_Rr/z_en_rr.c @@ -732,7 +732,8 @@ void EnRr_Death(EnRr* this, PlayState* play) { break; case RR_DROP_RANDOM_RUPEE: default: - Item_DropCollectibleRandom(play, &this->actor, &dropPos, 12 << 4); + Item_DropCollectibleRandom(play, &this->actor, &dropPos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_12, false)); break; } Actor_Kill(&this->actor); diff --git a/src/overlays/actors/ovl_En_Sb/z_en_sb.c b/src/overlays/actors/ovl_En_Sb/z_en_sb.c index 98ab740df9..aadb6a5244 100644 --- a/src/overlays/actors/ovl_En_Sb/z_en_sb.c +++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.c @@ -470,7 +470,8 @@ void EnSb_Update(Actor* thisx, PlayState* play) { } if (BodyBreak_SpawnParts(&this->actor, &this->bodyBreak, play, this->actor.params)) { if (!this->hitByWindArrow) { - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x80); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_8, false)); } else { Item_DropCollectible(play, &this->actor.world.pos, ITEM00_ARROWS_SMALL); } diff --git a/src/overlays/actors/ovl_En_Skb/z_en_skb.c b/src/overlays/actors/ovl_En_Skb/z_en_skb.c index 43ccbba8dd..72d1f55bde 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -442,7 +442,8 @@ void EnSkb_SetupDeath(EnSkb* this, PlayState* play) { void EnSkb_Death(EnSkb* this, PlayState* play) { if (BodyBreak_SpawnParts(&this->actor, &this->bodyBreak, play, 1)) { if (this->actor.scale.x == 0.01f) { - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x10); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_1, false)); } else if (this->actor.scale.x <= 0.015f) { Item_DropCollectible(play, &this->actor.world.pos, ITEM00_RUPEE_BLUE); } else { diff --git a/src/overlays/actors/ovl_En_St/z_en_st.c b/src/overlays/actors/ovl_En_St/z_en_st.c index e6e55facd9..f9b9e6e2a4 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.c +++ b/src/overlays/actors/ovl_En_St/z_en_st.c @@ -1014,7 +1014,8 @@ void EnSt_Die(EnSt* this, PlayState* play) { if (DECR(this->finishDeathTimer) != 0) { EnSt_SpawnDeadEffect(this, play); } else { - Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, 0xE0); + Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_14, false)); Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/src/overlays/actors/ovl_En_Sw/z_en_sw.c index b745742836..b2a2ecdd94 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -704,7 +704,8 @@ void func_80B0DC7C(EnSw* this, PlayState* play) { this->actor.shape.rot.x += 0x1000; this->actor.shape.rot.z += 0x1000; } else { - Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, 0x30); + Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_3, false)); Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Test/z_en_test.c b/src/overlays/actors/ovl_En_Test/z_en_test.c index 550fafa726..8dc9f764c8 100644 --- a/src/overlays/actors/ovl_En_Test/z_en_test.c +++ b/src/overlays/actors/ovl_En_Test/z_en_test.c @@ -1537,7 +1537,8 @@ void func_80862E6C(EnTest* this, PlayState* play) { EnTest_SetupJumpBack(this); } else if ((this->actor.params == STALFOS_TYPE_5) && !Actor_FindNearby(play, &this->actor, ACTOR_EN_TEST, ACTORCAT_ENEMY, 8000.0f)) { - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xD0); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_13, false)); if (this->actor.parent != NULL) { this->actor.parent->home.rot.z--; @@ -1645,7 +1646,8 @@ void func_808633E8(EnTest* this, PlayState* play) { this->actor.params = STALFOS_TYPE_1; if (BodyBreak_SpawnParts(&this->actor, &this->bodyBreak, play, this->actor.params)) { - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xD0); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_13, false)); if (this->actor.parent != NULL) { this->actor.parent->home.rot.z--; diff --git a/src/overlays/actors/ovl_En_Tite/z_en_tite.c b/src/overlays/actors/ovl_En_Tite/z_en_tite.c index 08fad96d3c..b61f66d3a6 100644 --- a/src/overlays/actors/ovl_En_Tite/z_en_tite.c +++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.c @@ -786,9 +786,11 @@ void EnTite_DeathCry(EnTite* this, PlayState* play) { void EnTite_FallApart(EnTite* this, PlayState* play) { if (BodyBreak_SpawnParts(&this->actor, &this->bodyBreak, play, this->actor.params + 0xB)) { if (this->actor.params == TEKTITE_BLUE) { - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xE0); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_14, false)); } else { - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x40); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_4, false)); } Actor_Kill(&this->actor); } diff --git a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c index 9d54250bcd..0dfd057933 100644 --- a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c +++ b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c @@ -610,7 +610,8 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { sDeathFlag++; sActionState = ENTORCH2_DEATH; Enemy_StartFinishingBlow(play, &this->actor); - Item_DropCollectibleRandom(play, &this->actor, &thisx->world.pos, 0xC0); + Item_DropCollectibleRandom(play, &this->actor, &thisx->world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_12, false)); this->stateFlags3 &= ~PLAYER_STATE3_2; } else { func_800F5ACC(NA_BGM_MINI_BOSS); diff --git a/src/overlays/actors/ovl_En_Tp/z_en_tp.c b/src/overlays/actors/ovl_En_Tp/z_en_tp.c index ef62bfb826..c1ad2ac47a 100644 --- a/src/overlays/actors/ovl_En_Tp/z_en_tp.c +++ b/src/overlays/actors/ovl_En_Tp/z_en_tp.c @@ -335,7 +335,8 @@ void EnTp_Die(EnTp* this, PlayState* play) { effectPos.y = ((Rand_ZeroOne() - 0.5f) * 5.0f) + this->actor.world.pos.y; EffectSsDeadDb_Spawn(play, &effectPos, &effectVelAccel, &effectVelAccel, 100, 0, 255, 255, 255, 255, 0, 0, 255, 1, 9, 1); - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x50); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_5, false)); } else { #if OOT_VERSION < NTSC_1_1 for (i = 0; i < 2; i++) diff --git a/src/overlays/actors/ovl_En_Vali/z_en_vali.c b/src/overlays/actors/ovl_En_Vali/z_en_vali.c index b69184006f..251528bad5 100644 --- a/src/overlays/actors/ovl_En_Vali/z_en_vali.c +++ b/src/overlays/actors/ovl_En_Vali/z_en_vali.c @@ -258,7 +258,8 @@ void EnVali_SetupDivideAndDie(EnVali* this, PlayState* play) { this->actor.world.rot.y += 0x10000 / 3; } - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x50); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_5, false)); this->timer = Rand_S16Offset(10, 10); this->bodyCollider.base.acFlags &= ~AC_ON; SfxSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EN_BARI_SPLIT); diff --git a/src/overlays/actors/ovl_En_Vm/z_en_vm.c b/src/overlays/actors/ovl_En_Vm/z_en_vm.c index b8bc829e00..0a6059cf7f 100644 --- a/src/overlays/actors/ovl_En_Vm/z_en_vm.c +++ b/src/overlays/actors/ovl_En_Vm/z_en_vm.c @@ -395,7 +395,8 @@ void EnVm_Die(EnVm* this, PlayState* play) { bomb->timer = 0; } - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xA0); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_10, false)); Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index 2a63684f9c..f493c4fd8a 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -264,7 +264,8 @@ void EnWallmas_SetupDie(EnWallmas* this, PlayState* play) { EffectSsDeadDb_Spawn(play, &this->actor.world.pos, &zeroVec, &zeroVec, 250, -10, 255, 255, 255, 255, 0, 0, 255, 1, 9, true); - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xC0); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_12, false)); this->actionFunc = EnWallmas_Die; } @@ -428,7 +429,8 @@ void EnWallmas_Cooldown(EnWallmas* this, PlayState* play) { void EnWallmas_Die(EnWallmas* this, PlayState* play) { if (Math_StepToF(&this->actor.scale.x, 0.0f, 0.0015) != 0) { Actor_SetScale(&this->actor, 0.01f); - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xC0); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_12, false)); Actor_Kill(&this->actor); } this->actor.scale.z = this->actor.scale.x; diff --git a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c index 78a284a881..7092c4651b 100644 --- a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c +++ b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c @@ -491,7 +491,8 @@ void EnWeiyer_Dead(EnWeiyer* this, PlayState* play) { this->actor.world.pos.y -= 2.0f; if (this->actor.shape.shadowAlpha == 0) { - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xE0); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_14, false)); Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Wf/z_en_wf.c b/src/overlays/actors/ovl_En_Wf/z_en_wf.c index aed59d0990..fbae4f022b 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -1229,7 +1229,8 @@ void EnWf_Die(EnWf* this, PlayState* play) { } if (SkelAnime_Update(&this->skelAnime)) { - Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xD0); + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, + COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_13, false)); if (this->switchFlag != 0xFF) { Flags_SetSwitch(play, this->switchFlag); diff --git a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c index bb1acebc24..af5cdcaa34 100644 --- a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c +++ b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c @@ -353,7 +353,8 @@ void EnWood02_Update(Actor* thisx, PlayState* play2) { dropsSpawnPt.y += 200.0f; if ((this->unk_14C >= 0) && (this->unk_14C < 0x64)) { - Item_DropCollectibleRandom(play, &this->actor, &dropsSpawnPt, this->unk_14C << 4); + Item_DropCollectibleRandom(play, &this->actor, &dropsSpawnPt, + COLLECTIBLE_DROP_RANDOM_PARAMS(this->unk_14C, false)); } else { if (this->actor.home.rot.z != 0) { this->actor.home.rot.z &= 0x1FFF; @@ -399,7 +400,7 @@ void EnWood02_Update(Actor* thisx, PlayState* play2) { (player->rideActor->speed != 0.0f))) { if ((this->unk_14C >= 0) && (this->unk_14C < 0x64)) { Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, - ((this->unk_14C << 4) | 0x8000)); + COLLECTIBLE_DROP_RANDOM_PARAMS(this->unk_14C, true)); } this->unk_14C = -0x15; Actor_PlaySfx(&this->actor, NA_SE_EV_TREE_SWING); diff --git a/src/overlays/actors/ovl_En_Zf/z_en_zf.c b/src/overlays/actors/ovl_En_Zf/z_en_zf.c index 9481a81ed8..2f68851c97 100644 --- a/src/overlays/actors/ovl_En_Zf/z_en_zf.c +++ b/src/overlays/actors/ovl_En_Zf/z_en_zf.c @@ -2044,11 +2044,11 @@ void EnZf_UpdateDamage(EnZf* this, PlayState* play) { Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8); if (Actor_ApplyDamage(&this->actor) == 0) { - dropParams = 0x40; + dropParams = COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_4, false); EnZf_SetupDie(this); if (this->actor.params == ENZF_TYPE_DINOLFOS) { - dropParams = 0xE0; + dropParams = COLLECTIBLE_DROP_RANDOM_PARAMS(COLLECTIBLE_DROP_TABLE_14, false); } Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, dropParams);