Item_DropCollectibleRandom: params macro and drop tables enum (#2707)

* `Item_DropCollectibleRandom`: params macro and drop tables enum

* fixup
This commit is contained in:
Dragorn421
2026-04-24 21:55:03 +02:00
committed by GitHub
parent 9c0dafe8d2
commit 189baf8e79
48 changed files with 158 additions and 80 deletions
+20
View File
@@ -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,
+15 -15
View File
@@ -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,
+2 -1
View File
@@ -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;
@@ -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);
}
}
+2 -1
View File
@@ -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) {
@@ -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);
}
}
+2 -1
View File
@@ -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) {
@@ -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);
}
+4 -2
View File
@@ -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)) {
+2 -1
View File
@@ -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);
}
@@ -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);
}
@@ -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);
}
+2 -1
View File
@@ -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)) ||
+2 -1
View File
@@ -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;
@@ -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);
}
}
@@ -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);
}
}
@@ -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);
}
}
@@ -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);
}
}
@@ -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);
}
}
+2 -1
View File
@@ -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;
}
+2 -1
View File
@@ -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;
}
+2 -1
View File
@@ -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;
}
+2 -1
View File
@@ -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);
+4 -3
View File
@@ -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));
}
}
+4 -3
View File
@@ -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) {
+4 -2
View File
@@ -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);
}
}
+2 -1
View File
@@ -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);
}
@@ -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;
@@ -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);
}
}
@@ -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;
}
+4 -2
View File
@@ -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);
}
@@ -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) {
+2 -1
View File
@@ -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);
+2 -1
View File
@@ -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);
}
+2 -1
View File
@@ -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 {
+2 -1
View File
@@ -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);
}
}
+2 -1
View File
@@ -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);
}
}
+4 -2
View File
@@ -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--;
+4 -2
View File
@@ -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);
}
@@ -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);
+2 -1
View File
@@ -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++)
+2 -1
View File
@@ -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);
+2 -1
View File
@@ -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);
}
}
@@ -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;
@@ -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);
}
}
+2 -1
View File
@@ -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);
@@ -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);
+2 -2
View File
@@ -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);