Rand_Next

This commit is contained in:
Derek Hensley 2022-06-26 15:01:29 -07:00
parent eeedc218b1
commit ba1046ac54
14 changed files with 39 additions and 39 deletions

View File

@ -201,7 +201,7 @@ void func_80ABC2E0(BgHakuginBombwall* this, PlayState* play) {
spBC.y = (Rand_ZeroOne() * 17.0f) + 7.0f;
spBC.z = ((Rand_ZeroOne() - 0.5f) * 10.0f) + (temp_f24 * 0.13333334f);
temp_s1 = (Rand_Next() & 3) + (i >> 2) + 4;
temp_s1 = (Rand_Next() % 4) + (i >> 2) + 4;
if ((Rand_Next() % 4) == 0) {
phi_v0 = 32;

View File

@ -346,10 +346,10 @@ void func_80A9B554(BgHakuginPost* this, PlayState* play, BgHakuginPostUnkStruct*
unkStruct2->unk_20.x = (s32)Rand_Next() >> 0x10;
unkStruct2->unk_20.y = (s32)Rand_Next() >> 0x10;
unkStruct2->unk_20.z = (s32)Rand_Next() >> 0x10;
unkStruct2->unk_26 = (Rand_Next() & 0x3FFF) - 0x1FFF;
unkStruct2->unk_28 = (Rand_Next() & 0x1FFF) - 0xFFF;
unkStruct2->unk_2A = (Rand_Next() & 0x1FFF) - 0xFFF;
unkStruct2->unk_2C = (Rand_Next() & 0x1F) + 0x4B;
unkStruct2->unk_26 = (Rand_Next() % 0x4000) - 0x1FFF;
unkStruct2->unk_28 = (Rand_Next() % 0x2000) - 0xFFF;
unkStruct2->unk_2A = (Rand_Next() % 0x2000) - 0xFFF;
unkStruct2->unk_2C = (Rand_Next() % 0x20) + 0x4B;
unkStruct2->unk_2D = 2;
}
@ -372,7 +372,7 @@ void func_80A9B554(BgHakuginPost* this, PlayState* play, BgHakuginPostUnkStruct*
for (i = 65, val = 0; i < ARRAY_COUNT(unkStruct->unk_02A4); i++, val += 0x4A7) {
unkStruct2 = &unkStruct->unk_02A4[i];
unkStruct2->unk_00 = Rand_ZeroOne() * 0.007f + 0.002f;
temp_s1_3 = (Rand_Next() & 0x7FF) + val;
temp_s1_3 = (Rand_Next() % 0x800) + val;
temp_f24 = Math_SinS(temp_s1_3);
temp_f28 = Math_CosS(temp_s1_3);
unkStruct2->unk_04.x = temp_f24 * 225.5f + spB8.x;
@ -389,10 +389,10 @@ void func_80A9B554(BgHakuginPost* this, PlayState* play, BgHakuginPostUnkStruct*
unkStruct2->unk_20.x = (s32)Rand_Next() >> 0x10;
unkStruct2->unk_20.y = (s32)Rand_Next() >> 0x10;
unkStruct2->unk_20.z = (s32)Rand_Next() >> 0x10;
unkStruct2->unk_26 = (Rand_Next() & 0x1FFF) - 0xFFF;
unkStruct2->unk_28 = (Rand_Next() & 0x1FFF) - 0xFFF;
unkStruct2->unk_2A = (Rand_Next() & 0x1FFF) - 0xFFF;
unkStruct2->unk_2C = (Rand_Next() & 0x1F) + 0x41;
unkStruct2->unk_26 = (Rand_Next() % 0x2000) - 0xFFF;
unkStruct2->unk_28 = (Rand_Next() % 0x2000) - 0xFFF;
unkStruct2->unk_2A = (Rand_Next() % 0x2000) - 0xFFF;
unkStruct2->unk_2C = (Rand_Next() % 0x20) + 0x41;
unkStruct2->unk_2D = 0;
}
}
@ -568,7 +568,7 @@ void func_80A9C228(BgHakuginPost* this, PlayState* play, BgHakuginPostUnkStruct*
if (unkStruct->unk_0000[i].unk_34 == 2) {
for (j = 0, val = 0; j < 3; j++, val += 0x5555) {
temp_f20 = Rand_ZeroOne() * 264.0f;
temp_s0 = (Rand_Next() & 0xFFF) + val;
temp_s0 = (Rand_Next() % 0x1000) + val;
spB8.x = Math_SinS(temp_s0) * temp_f20 + spC8->unk_14.x;
spB8.z = Math_CosS(temp_s0) * temp_f20 + spC8->unk_14.z;
@ -594,7 +594,7 @@ void func_80A9C228(BgHakuginPost* this, PlayState* play, BgHakuginPostUnkStruct*
if ((unkStruct->unk_0000[i].unk_2F & 2) && (spC4 != NULL) && ((spC4->unk_34 == 3) || (spC4->unk_34 == 4))) {
for (j = 0, val = 0; j < 18; j++, val += 0xE38) {
temp_f20 = (Rand_ZeroOne() * 0.3f + 1.0f) * 220.0f;
temp_s0 = (Rand_Next() & 0xFFF) + val;
temp_s0 = (Rand_Next() % 0x1000) + val;
spB8.x = Math_SinS(temp_s0) * temp_f20;
spB8.z = Math_CosS(temp_s0) * temp_f20;

View File

@ -200,7 +200,7 @@ void func_80BD4A14(BgIkanaBombwall* this, PlayState* play) {
spCC.y = (Rand_ZeroOne() * 18.0f) + 4.0f;
spCC.z = ((Rand_ZeroOne() - 0.5f) * 3.0f * temp_fs1) + ((temp_fs1 * temp_fs3) * 0.033333335f);
temp_v1 = (Rand_Next() & 3) + (i >> 1) + 6;
temp_v1 = (Rand_Next() % 4) + (i >> 1) + 6;
if ((i & 3) == 0) {
phi_v0 = 32;

View File

@ -304,8 +304,8 @@ void func_8091E070(EnFish* this) {
this->actor.gravity = 0.0f;
this->actor.terminalVelocity = 0.0f;
if ((Rand_Next() & 3) == 0) {
if (((Rand_Next() & 7) == 0) && (this->unk_278 != 0)) {
if ((Rand_Next() % 4) == 0) {
if (((Rand_Next() % 8) == 0) && (this->unk_278 != 0)) {
phi_a1 = 80;
} else {
phi_a1 = 45;

View File

@ -169,9 +169,9 @@ void func_80ACE680(EnFuMato* this) {
this->dyna.actor.velocity.y = 1.0f;
this->dyna.actor.velocity.x = 2.0f * Rand_Centered();
this->dyna.actor.velocity.z = 2.0f * Rand_Centered();
this->unk_2FC.x = Rand_Next() & 0xFFF;
this->unk_2FC.y = Rand_Next() & 0xFFF;
this->unk_2FC.z = Rand_Next() & 0xFFF;
this->unk_2FC.x = Rand_Next() % 0x1000;
this->unk_2FC.y = Rand_Next() % 0x1000;
this->unk_2FC.z = Rand_Next() % 0x1000;
this->unk_302 = 3;
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_WOODPLATE_BOUND);
this->actionFunc = func_80ACE718;

View File

@ -954,7 +954,7 @@ void EnGoroiwa_Init(Actor* thisx, PlayState* play) {
Actor_ProcessInitChain(&this->actor, sInitChain);
this->actor.world.rot.x = 0;
this->actor.world.rot.z = 0;
this->actor.world.rot.y = Rand_Next() & 0xFFFF;
this->actor.world.rot.y = Rand_Next() % 0x10000;
this->actor.shape.rot.y = this->actor.world.rot.y;
this->actor.shape.rot.x = 0;
this->actor.shape.rot.z = 0;

View File

@ -124,7 +124,7 @@ void EnInsect_Init(Actor* thisx, PlayState* play) {
EnInsect* this = THIS;
f32 rand;
this->actor.world.rot.y = Rand_Next() & 0xFFFF;
this->actor.world.rot.y = Rand_Next() % 0x10000;
this->actor.home.rot.y = this->actor.world.rot.y;
this->actor.shape.rot.y = this->actor.world.rot.y;

View File

@ -301,7 +301,7 @@ void func_80C1418C(EnJgameTsn* this, PlayState* play) {
}
void func_80C141DC(EnJgameTsn* this) {
this->unk_218 = Rand_Next() & 3;
this->unk_218 = Rand_Next() % 4;
this->unk_2FC = 0;
*this->unk_208[this->unk_218] |= 1;
this->actionFunc = func_80C14230;

View File

@ -600,8 +600,8 @@ void func_80B274BC(EnKendoJs* this, PlayState* play) {
}
play_sound(NA_SE_SY_FOUND);
func_80B279F0(this, play, (((s32)Rand_Next() & 0xFF) % 3) + 1);
func_80B279F0(this, play, (((s32)Rand_Next() & 0xFF) % 3) + 4);
func_80B279F0(this, play, ((u8)Rand_Next() % 3) + 1);
func_80B279F0(this, play, ((u8)Rand_Next() % 3) + 4);
this->unk_290 = 0;
this->unk_284++;
} else if (this->unk_290 == 120) {

View File

@ -741,7 +741,7 @@ void func_80A5CD0C(EnKusa2* this) {
s32 pad;
for (i = 0; i < 2; i++) {
temp_s0 = Rand_Next() & 0xFFFF;
temp_s0 = Rand_Next() % 0x10000;
temp_f20 = Rand_ZeroOne() * 30.0f;
spA8.x = Math_SinS(temp_s0) * temp_f20;
@ -756,9 +756,9 @@ void func_80A5CD0C(EnKusa2* this) {
spA8.y += this->actor.world.pos.y;
spA8.z += this->actor.world.pos.z;
sp94.x = Rand_Next() & 0xFFFF;
sp94.y = Rand_Next() & 0xFFFF;
sp94.z = Rand_Next() & 0xFFFF;
sp94.x = Rand_Next() % 0x10000;
sp94.y = Rand_Next() % 0x10000;
sp94.z = Rand_Next() % 0x10000;
sp8C.x = (Rand_Next() % 0x4000) - 0x1FFF;
sp8C.y = (Rand_Next() % 0x2000) - 0xFFF;
@ -794,9 +794,9 @@ void func_80A5CF44(EnKusa2* this) {
spA8.y += this->actor.world.pos.y;
spA8.z += this->actor.world.pos.z;
sp94.x = Rand_Next() & 0xFFFF;
sp94.y = Rand_Next() & 0xFFFF;
sp94.z = Rand_Next() & 0xFFFF;
sp94.x = Rand_Next() % 0x10000;
sp94.y = Rand_Next() % 0x10000;
sp94.z = Rand_Next() % 0x10000;
sp8C.x = (Rand_Next() % 0x4000) - 0x1FFF;
sp8C.y = (Rand_Next() % 0x2000) - 0xFFF;
@ -836,9 +836,9 @@ void func_80A5D178(EnKusa2* this) {
spB0.y += this->actor.world.pos.y;
spB0.z += this->actor.world.pos.z;
sp9C.x = Rand_Next() & 0xFFFF;
sp9C.y = Rand_Next() & 0xFFFF;
sp9C.z = Rand_Next() & 0xFFFF;
sp9C.x = Rand_Next() % 0x10000;
sp9C.y = Rand_Next() % 0x10000;
sp9C.z = Rand_Next() % 0x10000;
sp94.x = Rand_S16Offset(-12000, 24000);
sp94.y = (Rand_Next() % 0x4000) - 0x1FFF;

View File

@ -380,8 +380,8 @@ void func_80B37590(EnMaruta* this, PlayState* play) {
sp38 = D_80B38850[this->unk_210];
func_80B3828C(&sp38, &this->unk_194, Rand_Next() & 0xFFF, Rand_Next() & 0xFFF, 0);
this->unk_21A = Rand_Next() & 0x7FF;
func_80B3828C(&sp38, &this->unk_194, Rand_Next() % 0x1000, Rand_Next() % 0x1000, 0);
this->unk_21A = Rand_Next() % 0x800;
if (this->unk_210 == 7) {
this->unk_21A |= 0x3F;

View File

@ -916,7 +916,7 @@ void func_80A6A824(EnMushi2* this, PlayState* play) {
}
void func_80A6A984(EnMushi2* this) {
if (Rand_Next() & 1) {
if ((Rand_Next() % 2) != 0) {
this->unk_370 = 0x800;
} else {
this->unk_370 = -0x800;
@ -1032,7 +1032,7 @@ void func_80A6AE7C(EnMushi2* this, PlayState* play) {
temp_f2 = this->actor.scale.x - (1.0f / 20000.0f);
Actor_SetScale(&this->actor, CLAMP_MIN(temp_f2, 0.001f));
if ((this->actor.flags & ACTOR_FLAG_40) && (this->actor.depthInWater > 5.0f) &&
(this->actor.depthInWater < 30.0f) && ((s32)(Rand_Next() & 0x1FF) < this->unk_368)) {
(this->actor.depthInWater < 30.0f) && ((s32)(Rand_Next() % 0x200) < this->unk_368)) {
EffectSsBubble_Spawn(play, &this->actor.world.pos, -5.0f, 5.0f, 5.0f,
((Rand_ZeroOne() * 4.0f) + 2.0f) * this->actor.scale.x);
}

View File

@ -848,7 +848,7 @@ void func_80B72430(EnRailSkb* this, PlayState* play, s32 arg2) {
sp50.y += Rand_Centered() * 4.0f;
EffectSsHahen_Spawn(play, &sp5C, &sp50, &sp44, 0, (Rand_Next() & 7) + 10, -1, 10, NULL);
EffectSsHahen_Spawn(play, &sp5C, &sp50, &sp44, 0, (Rand_Next() % 8) + 10, -1, 10, NULL);
func_800BBFB0(play, &sp5C, 10.0f, 1, 150, 0, 1);
}
}

View File

@ -673,7 +673,7 @@ void EnRailgibud_SpawnEffectsForSinkingIntoTheGround(EnRailgibud* this, PlayStat
rockFragmentAccel.z = Rand_Centered();
rockFragmentVelocity.y += Rand_Centered() * 4.0f;
EffectSsHahen_Spawn(play, &rockFragmentPos, &rockFragmentVelocity, &rockFragmentAccel, 0,
(Rand_Next() & 7) + 10, -1, 10, NULL);
(Rand_Next() % 8) + 10, -1, 10, NULL);
EnRailgibud_SpawnDust(play, &rockFragmentPos, 10.0f, 10, 150, 0);
}
}