summaryrefslogtreecommitdiff
path: root/src/overlays
diff options
context:
space:
mode:
authorengineer124 <47598039+engineer124@users.noreply.github.com>2023-06-06 12:16:34 +1000
committerGitHub <noreply@github.com>2023-06-05 22:16:34 -0400
commit7f5087d0b2014dc1ba2bbfc7ce858f0059a8a7cb (patch)
treea56edb9e5d173d9e24bdce4a373e9fe38253cb34 /src/overlays
parentf92a61db27ed8ee213072df11169777c6794bc1b (diff)
sys_math.c Rename (#1258)
* rename via comments * missed a comment * math header * name boot_80086760.c functions * PR Review * rm cam comment * Elliptic review * alphabetical
Diffstat (limited to 'src/overlays')
-rw-r--r--src/overlays/actors/ovl_Bg_F40_Flift/z_bg_f40_flift.c7
-rw-r--r--src/overlays/actors/ovl_Bg_F40_Swlift/z_bg_f40_swlift.c2
-rw-r--r--src/overlays/actors/ovl_Bg_Icefloe/z_bg_icefloe.c10
-rw-r--r--src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c8
-rw-r--r--src/overlays/actors/ovl_Bg_Spdweb/z_bg_spdweb.c7
-rw-r--r--src/overlays/actors/ovl_Boss_02/z_boss_02.c38
-rw-r--r--src/overlays/actors/ovl_Boss_03/z_boss_03.c56
-rw-r--r--src/overlays/actors/ovl_Boss_04/z_boss_04.c4
-rw-r--r--src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c18
-rw-r--r--src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c2
-rw-r--r--src/overlays/actors/ovl_En_Am/z_en_am.c10
-rw-r--r--src/overlays/actors/ovl_En_Arrow/z_en_arrow.c2
-rw-r--r--src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c8
-rw-r--r--src/overlays/actors/ovl_En_Baguo/z_en_baguo.c6
-rw-r--r--src/overlays/actors/ovl_En_Bat/z_en_bat.c9
-rw-r--r--src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.c2
-rw-r--r--src/overlays/actors/ovl_En_Bee/z_en_bee.c16
-rw-r--r--src/overlays/actors/ovl_En_Bh/z_en_bh.c8
-rw-r--r--src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c8
-rw-r--r--src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.c4
-rw-r--r--src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c4
-rw-r--r--src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c33
-rw-r--r--src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.h2
-rw-r--r--src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c2
-rw-r--r--src/overlays/actors/ovl_En_Bombers/z_en_bombers.c4
-rw-r--r--src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c10
-rw-r--r--src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c4
-rw-r--r--src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c4
-rw-r--r--src/overlays/actors/ovl_En_Col_Man/z_en_col_man.c6
-rw-r--r--src/overlays/actors/ovl_En_Crow/z_en_crow.c4
-rw-r--r--src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c12
-rw-r--r--src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c4
-rw-r--r--src/overlays/actors/ovl_En_Dg/z_en_dg.c10
-rw-r--r--src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c12
-rw-r--r--src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c14
-rw-r--r--src/overlays/actors/ovl_En_Dragon/z_en_dragon.c10
-rw-r--r--src/overlays/actors/ovl_En_Egblock/z_en_egblock.c10
-rw-r--r--src/overlays/actors/ovl_En_Egol/z_en_egol.c17
-rw-r--r--src/overlays/actors/ovl_En_Elf/z_en_elf.c12
-rw-r--r--src/overlays/actors/ovl_En_Elfbub/z_en_elfbub.c2
-rw-r--r--src/overlays/actors/ovl_En_Elfgrp/z_en_elfgrp.c4
-rw-r--r--src/overlays/actors/ovl_En_Elforg/z_en_elforg.c6
-rw-r--r--src/overlays/actors/ovl_En_Encount1/z_en_encount1.c14
-rw-r--r--src/overlays/actors/ovl_En_Encount4/z_en_encount4.c4
-rw-r--r--src/overlays/actors/ovl_En_Estone/z_en_estone.c10
-rw-r--r--src/overlays/actors/ovl_En_Fall/z_en_fall.c8
-rw-r--r--src/overlays/actors/ovl_En_Famos/z_en_famos.c6
-rw-r--r--src/overlays/actors/ovl_En_Firefly/z_en_firefly.c2
-rw-r--r--src/overlays/actors/ovl_En_Fish2/z_en_fish2.c24
-rw-r--r--src/overlays/actors/ovl_En_Fishing/z_en_fishing.c56
-rw-r--r--src/overlays/actors/ovl_En_Fz/z_en_fz.c22
-rw-r--r--src/overlays/actors/ovl_En_Gg2/z_en_gg2.c2
-rw-r--r--src/overlays/actors/ovl_En_Gk/z_en_gk.c2
-rw-r--r--src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.c34
-rw-r--r--src/overlays/actors/ovl_En_Gs/z_en_gs.c4
-rw-r--r--src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c2
-rw-r--r--src/overlays/actors/ovl_En_Hanabi/z_en_hanabi.c10
-rw-r--r--src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.c8
-rw-r--r--src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c8
-rw-r--r--src/overlays/actors/ovl_En_Ik/z_en_ik.c14
-rw-r--r--src/overlays/actors/ovl_En_Jg/z_en_jg.c2
-rw-r--r--src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c2
-rw-r--r--src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c6
-rw-r--r--src/overlays/actors/ovl_En_Kame/z_en_kame.c4
-rw-r--r--src/overlays/actors/ovl_En_Kanban/z_en_kanban.c20
-rw-r--r--src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c6
-rw-r--r--src/overlays/actors/ovl_En_Minislime/z_en_minislime.c30
-rw-r--r--src/overlays/actors/ovl_En_Mkk/z_en_mkk.c10
-rw-r--r--src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.c4
-rw-r--r--src/overlays/actors/ovl_En_Niw/z_en_niw.c22
-rw-r--r--src/overlays/actors/ovl_En_Nwc/z_en_nwc.c12
-rw-r--r--src/overlays/actors/ovl_En_Osk/z_en_osk.c6
-rw-r--r--src/overlays/actors/ovl_En_Owl/z_en_owl.c2
-rw-r--r--src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c10
-rw-r--r--src/overlays/actors/ovl_En_Part/z_en_part.c6
-rw-r--r--src/overlays/actors/ovl_En_Peehat/z_en_peehat.c14
-rw-r--r--src/overlays/actors/ovl_En_Pp/z_en_pp.c26
-rw-r--r--src/overlays/actors/ovl_En_Pr/z_en_pr.c8
-rw-r--r--src/overlays/actors/ovl_En_Pr2/z_en_pr2.c18
-rw-r--r--src/overlays/actors/ovl_En_Prz/z_en_prz.c32
-rw-r--r--src/overlays/actors/ovl_En_Racedog/z_en_racedog.c18
-rw-r--r--src/overlays/actors/ovl_En_Raf/z_en_raf.c6
-rw-r--r--src/overlays/actors/ovl_En_Rat/z_en_rat.c20
-rw-r--r--src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c4
-rw-r--r--src/overlays/actors/ovl_En_Sb/z_en_sb.c6
-rw-r--r--src/overlays/actors/ovl_En_Scopecrow/z_en_scopecrow.c2
-rw-r--r--src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c2
-rw-r--r--src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c2
-rw-r--r--src/overlays/actors/ovl_En_Skb/z_en_skb.c10
-rw-r--r--src/overlays/actors/ovl_En_Slime/z_en_slime.c42
-rw-r--r--src/overlays/actors/ovl_En_Snowman/z_en_snowman.c20
-rw-r--r--src/overlays/actors/ovl_En_Suttari/z_en_suttari.c8
-rw-r--r--src/overlays/actors/ovl_En_Sw/z_en_sw.c2
-rw-r--r--src/overlays/actors/ovl_En_Syateki_Crow/z_en_syateki_crow.c4
-rw-r--r--src/overlays/actors/ovl_En_Syateki_Okuta/z_en_syateki_okuta.c4
-rw-r--r--src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.c6
-rw-r--r--src/overlays/actors/ovl_En_Tanron1/z_en_tanron1.c8
-rw-r--r--src/overlays/actors/ovl_En_Tanron2/z_en_tanron2.c2
-rw-r--r--src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c26
-rw-r--r--src/overlays/actors/ovl_En_Tanron4/z_en_tanron4.c23
-rw-r--r--src/overlays/actors/ovl_En_Tanron5/z_en_tanron5.c16
-rw-r--r--src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c10
-rw-r--r--src/overlays/actors/ovl_En_Tite/z_en_tite.c10
-rw-r--r--src/overlays/actors/ovl_En_Trt2/z_en_trt2.c12
-rw-r--r--src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.c2
-rw-r--r--src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c12
-rw-r--r--src/overlays/actors/ovl_En_Wf/z_en_wf.c10
-rw-r--r--src/overlays/actors/ovl_En_Wiz/z_en_wiz.c8
-rw-r--r--src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c22
-rw-r--r--src/overlays/actors/ovl_En_Wood02/z_en_wood02.c6
-rw-r--r--src/overlays/actors/ovl_En_Yb/z_en_yb.c6
-rw-r--r--src/overlays/actors/ovl_En_Zog/z_en_zog.c8
-rw-r--r--src/overlays/actors/ovl_Obj_Bigicicle/z_obj_bigicicle.c16
-rw-r--r--src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c2
-rw-r--r--src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c8
-rw-r--r--src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c4
-rw-r--r--src/overlays/actors/ovl_Obj_Taru/z_obj_taru.c6
-rw-r--r--src/overlays/actors/ovl_player_actor/z_player.c30
-rw-r--r--src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.c4
-rw-r--r--src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.c12
-rw-r--r--src/overlays/effects/ovl_Effect_Ss_Kirakira/z_eff_ss_kirakira.c4
-rw-r--r--src/overlays/effects/ovl_Effect_Ss_Sbn/z_eff_ss_sbn.c2
122 files changed, 652 insertions, 654 deletions
diff --git a/src/overlays/actors/ovl_Bg_F40_Flift/z_bg_f40_flift.c b/src/overlays/actors/ovl_Bg_F40_Flift/z_bg_f40_flift.c
index 2c9919728..f47bf4394 100644
--- a/src/overlays/actors/ovl_Bg_F40_Flift/z_bg_f40_flift.c
+++ b/src/overlays/actors/ovl_Bg_F40_Flift/z_bg_f40_flift.c
@@ -64,10 +64,11 @@ void func_808D75F0(BgF40Flift* this, PlayState* play) {
}
this->timer--;
if (this->dyna.actor.params == 1) {
- this->dyna.actor.world.pos.y = (sin_rad(this->timer * (M_PI / 24.0f)) * 5.0f) + this->dyna.actor.home.pos.y;
+ this->dyna.actor.world.pos.y =
+ (Math_SinF(this->timer * (M_PI / 24.0f)) * 5.0f) + this->dyna.actor.home.pos.y;
} else {
this->dyna.actor.world.pos.y =
- (sin_rad(this->timer * (M_PI / 24.0f)) * 5.0f) + (926.8f + this->dyna.actor.home.pos.y);
+ (Math_SinF(this->timer * (M_PI / 24.0f)) * 5.0f) + (926.8f + this->dyna.actor.home.pos.y);
}
}
}
@@ -76,7 +77,7 @@ void func_808D7714(BgF40Flift* this, PlayState* play) {
if (this->timer != 0) {
this->timer--;
this->dyna.actor.world.pos.y =
- (((cos_rad(this->timer * (M_PI / 96.0f)) * this->dyna.actor.params) + 1.0f) * 463.4f) +
+ (((Math_CosF(this->timer * (M_PI / 96.0f)) * this->dyna.actor.params) + 1.0f) * 463.4f) +
this->dyna.actor.home.pos.y;
} else {
this->dyna.actor.params = -this->dyna.actor.params;
diff --git a/src/overlays/actors/ovl_Bg_F40_Swlift/z_bg_f40_swlift.c b/src/overlays/actors/ovl_Bg_F40_Swlift/z_bg_f40_swlift.c
index bf6244efe..039d20f3c 100644
--- a/src/overlays/actors/ovl_Bg_F40_Swlift/z_bg_f40_swlift.c
+++ b/src/overlays/actors/ovl_Bg_F40_Swlift/z_bg_f40_swlift.c
@@ -105,7 +105,7 @@ void BgF40Swlift_Update(Actor* thisx, PlayState* play2) {
}
this->timer--;
this->dyna.actor.world.pos.y =
- sHeights[this->dyna.actor.params] + (sin_rad(this->timer * (M_PI / 24.0f)) * 5.0f);
+ sHeights[this->dyna.actor.params] + (Math_SinF(this->timer * (M_PI / 24.0f)) * 5.0f);
}
}
diff --git a/src/overlays/actors/ovl_Bg_Icefloe/z_bg_icefloe.c b/src/overlays/actors/ovl_Bg_Icefloe/z_bg_icefloe.c
index 15a677c29..50e99c1aa 100644
--- a/src/overlays/actors/ovl_Bg_Icefloe/z_bg_icefloe.c
+++ b/src/overlays/actors/ovl_Bg_Icefloe/z_bg_icefloe.c
@@ -96,8 +96,8 @@ void BgIcefloe_Grow(BgIcefloe* this, PlayState* play) {
Vec3f velocity;
Vec3f position;
- velocity.x = randPlusMinusPoint5Scaled(6.0f);
- velocity.z = randPlusMinusPoint5Scaled(6.0f);
+ velocity.x = Rand_CenteredFloat(6.0f);
+ velocity.z = Rand_CenteredFloat(6.0f);
velocity.y = Rand_ZeroFloat(4.0f) + 4.0f;
this->dyna.actor.scale.x += (0.65f * 0.01f);
this->dyna.actor.scale.z += (0.65f * 0.01f);
@@ -127,7 +127,7 @@ void func_80AC4C34(BgIcefloe* this, PlayState* play) {
func_80AC4CF0(this);
} else {
this->dyna.actor.world.pos.y =
- (sin_rad(this->timer * (M_PI / 30.0f)) * 3.0f) + (this->dyna.actor.home.pos.y + 10.0f);
+ (Math_SinF(this->timer * (M_PI / 30.0f)) * 3.0f) + (this->dyna.actor.home.pos.y + 10.0f);
}
}
@@ -144,8 +144,8 @@ void func_80AC4D2C(BgIcefloe* this, PlayState* play) {
Vec3f position;
velocity.y = (this->timer - 38) * (1 / 12.0f);
- velocity.x = randPlusMinusPoint5Scaled(1.5f) * velocity.y;
- velocity.z = randPlusMinusPoint5Scaled(1.5f) * velocity.y;
+ velocity.x = Rand_CenteredFloat(1.5f) * velocity.y;
+ velocity.z = Rand_CenteredFloat(1.5f) * velocity.y;
velocity.y += 0.8f;
position.x = this->dyna.actor.world.pos.x + (2.0f * velocity.x);
position.z = this->dyna.actor.world.pos.z + (2.0f * velocity.z);
diff --git a/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c b/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c
index 740d807d8..a8eea2641 100644
--- a/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c
+++ b/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c
@@ -109,12 +109,12 @@ void BgIcicle_Break(BgIcicle* this, PlayState* play, f32 arg2) {
for (i = 0; i < 2; i++) {
for (j = 0; j < 10; j++) {
- pos.x = this->dyna.actor.world.pos.x + randPlusMinusPoint5Scaled(8.0f);
+ pos.x = this->dyna.actor.world.pos.x + Rand_CenteredFloat(8.0f);
pos.y = this->dyna.actor.world.pos.y + (Rand_ZeroOne() * arg2) + (i * arg2);
- pos.z = this->dyna.actor.world.pos.z + randPlusMinusPoint5Scaled(8.0f);
+ pos.z = this->dyna.actor.world.pos.z + Rand_CenteredFloat(8.0f);
- velocity.x = randPlusMinusPoint5Scaled(7.0f);
- velocity.z = randPlusMinusPoint5Scaled(7.0f);
+ velocity.x = Rand_CenteredFloat(7.0f);
+ velocity.z = Rand_CenteredFloat(7.0f);
velocity.y = (Rand_ZeroOne() * 4.0f) + 8.0f;
EffectSsEnIce_Spawn(play, &pos, (Rand_ZeroOne() * 0.2f) + 0.1f, &velocity, &accel, &primColor, &envColor,
diff --git a/src/overlays/actors/ovl_Bg_Spdweb/z_bg_spdweb.c b/src/overlays/actors/ovl_Bg_Spdweb/z_bg_spdweb.c
index fa80cbf90..c11df8af1 100644
--- a/src/overlays/actors/ovl_Bg_Spdweb/z_bg_spdweb.c
+++ b/src/overlays/actors/ovl_Bg_Spdweb/z_bg_spdweb.c
@@ -240,7 +240,7 @@ void func_809CE234(BgSpdweb* this, PlayState* play) {
spA8.y = this->dyna.actor.world.pos.y;
for (i = 0; i < 6; i++) {
- temp_s0 = (s32)randPlusMinusPoint5Scaled(10240.0f) + phi_s2;
+ temp_s0 = (s32)Rand_CenteredFloat(0x2800) + phi_s2;
temp_f24 = Math_SinS(temp_s0);
temp_f22 = Math_CosS(temp_s0);
@@ -323,7 +323,8 @@ void func_809CE4C8(BgSpdweb* this, PlayState* play) {
this->unk_162--;
}
- this->dyna.actor.world.pos.y = (sin_rad(this->unk_162 * (M_PI / 6)) * this->unk_164) + this->dyna.actor.home.pos.y;
+ this->dyna.actor.world.pos.y =
+ (Math_SinF(this->unk_162 * (M_PI / 6)) * this->unk_164) + this->dyna.actor.home.pos.y;
Math_ApproachZeroF(&this->unk_164, 1.0f, 0.8f);
if (this->unk_162 == 4) {
@@ -388,7 +389,7 @@ void func_809CE830(BgSpdweb* this, PlayState* play) {
spC4.z = this->dyna.actor.world.pos.z + 90.0f * sinQ * cosF1;
for (i = 0; i < 6; i++) {
- temp_s0 = (s32)randPlusMinusPoint5Scaled(0x2800) + temp_s3;
+ temp_s0 = (s32)Rand_CenteredFloat(0x2800) + temp_s3;
sinF2 = Math_SinS(temp_s0);
cosF2 = Math_CosS(temp_s0);
diff --git a/src/overlays/actors/ovl_Boss_02/z_boss_02.c b/src/overlays/actors/ovl_Boss_02/z_boss_02.c
index 7220b5d06..5b19594fb 100644
--- a/src/overlays/actors/ovl_Boss_02/z_boss_02.c
+++ b/src/overlays/actors/ovl_Boss_02/z_boss_02.c
@@ -485,9 +485,9 @@ void Boss02_SpawnEffectSand(TwinmoldEffect* effects, Vec3f* pos, f32 scale) {
if (effects->type == TWINMOLD_EFFECT_NONE) {
effects->type = TWINMOLD_EFFECT_SAND;
effects->pos = *pos;
- effects->velocity.x = randPlusMinusPoint5Scaled(30.0f);
+ effects->velocity.x = Rand_CenteredFloat(30.0f);
effects->velocity.y = Rand_ZeroFloat(7.0f) + 7.0f;
- effects->velocity.z = randPlusMinusPoint5Scaled(30.0f);
+ effects->velocity.z = Rand_CenteredFloat(30.0f);
effects->accel.y = -0.3f;
effects->scale = scale;
effects->alpha = 255;
@@ -507,9 +507,9 @@ void Boss02_SpawnEffectFragment(TwinmoldEffect* effects, Vec3f* pos) {
effects->type = TWINMOLD_EFFECT_FRAGMENT;
effects->pos = *pos;
effects->timer = Rand_ZeroFloat(20.0f);
- effects->velocity.x = randPlusMinusPoint5Scaled(50.0f);
- effects->velocity.y = randPlusMinusPoint5Scaled(50.0f);
- effects->velocity.z = randPlusMinusPoint5Scaled(50.0f);
+ effects->velocity.x = Rand_CenteredFloat(50.0f);
+ effects->velocity.y = Rand_CenteredFloat(50.0f);
+ effects->velocity.z = Rand_CenteredFloat(50.0f);
effects->accel.z = 0.0f;
effects->accel.x = 0.0f;
effects->accel.y = -1.5f;
@@ -774,8 +774,8 @@ void func_809DAB78(Boss02* this, PlayState* play) {
this->actor.world.pos.z = player->actor.world.pos.z;
this->actor.world.pos.y = player->actor.world.pos.y - (600.0f * D_809DF5B0);
} else {
- this->actor.world.pos.x = randPlusMinusPoint5Scaled(5000.0f * D_809DF5B0);
- this->actor.world.pos.z = randPlusMinusPoint5Scaled(5000.0f * D_809DF5B0);
+ this->actor.world.pos.x = Rand_CenteredFloat(5000.0f * D_809DF5B0);
+ this->actor.world.pos.z = Rand_CenteredFloat(5000.0f * D_809DF5B0);
this->actor.world.pos.y = -500.0f * D_809DF5B0;
if (sIsInGiantMode) {
this->actor.world.pos.y += 3150.0f;
@@ -802,8 +802,8 @@ void func_809DAB78(Boss02* this, PlayState* play) {
this->unk_0146[0] = 150;
} else {
this->unk_0144 = 2;
- this->unk_01B0.x = randPlusMinusPoint5Scaled(3000.0f * D_809DF5B0);
- this->unk_01B0.z = randPlusMinusPoint5Scaled(3000.0f * D_809DF5B0);
+ this->unk_01B0.x = Rand_CenteredFloat(3000.0f * D_809DF5B0);
+ this->unk_01B0.z = Rand_CenteredFloat(3000.0f * D_809DF5B0);
if ((fabsf(this->unk_01B0.x) < (500.0f * D_809DF5B0)) &&
(fabsf(this->unk_01B0.z) < (500.0f * D_809DF5B0))) {
this->unk_01B0.x = 500.0f;
@@ -847,12 +847,12 @@ void func_809DAB78(Boss02* this, PlayState* play) {
this->unk_01B0.z = player->actor.world.pos.z;
if (this->unk_0146[0] == 0) {
this->unk_0144 = 3;
- this->unk_01B0.x = randPlusMinusPoint5Scaled(500.0f * D_809DF5B0) + this->actor.world.pos.x;
+ this->unk_01B0.x = Rand_CenteredFloat(500.0f * D_809DF5B0) + this->actor.world.pos.x;
this->unk_01B0.y = -3000.0f * D_809DF5B0;
if (sIsInGiantMode) {
this->unk_01B0.y += 3150.0f;
}
- this->unk_01B0.z = randPlusMinusPoint5Scaled(500.0f * D_809DF5B0) + this->actor.world.pos.z;
+ this->unk_01B0.z = Rand_CenteredFloat(500.0f * D_809DF5B0) + this->actor.world.pos.z;
this->unk_0146[0] = 150;
this->unk_0164 = 0.0f;
}
@@ -917,7 +917,7 @@ void func_809DAB78(Boss02* this, PlayState* play) {
Matrix_MultVecZ(1500.0f * D_809DF5B0, &spA4);
this->unk_0146[0] = 50;
this->unk_01B0.x = player->actor.world.pos.x + spA4.x;
- this->unk_01B0.y = randPlusMinusPoint5Scaled(500.0f * D_809DF5B0) + (600.0f * D_809DF5B0);
+ this->unk_01B0.y = Rand_CenteredFloat(500.0f * D_809DF5B0) + (600.0f * D_809DF5B0);
if (sIsInGiantMode) {
this->unk_01B0.y += 3150.0f;
}
@@ -963,7 +963,7 @@ void func_809DAB78(Boss02* this, PlayState* play) {
this->actor.gravity = -1.0f * D_809DF5B0;
this->actor.velocity.y = 0.0f;
this->actor.terminalVelocity = -1000.0f * D_809DF5B0;
- this->unk_0164 = randPlusMinusPoint5Scaled(0.05f);
+ this->unk_0164 = Rand_CenteredFloat(0.05f);
spCC = player->actor.world.pos.x - this->actor.world.pos.x;
spC4 = player->actor.world.pos.z - this->actor.world.pos.z;
@@ -1205,16 +1205,16 @@ void Boss02_Twinmold_Update(Actor* thisx, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_INBOSS_SAND_OLD - SFX_FLAG);
if (this->unk_0144 > 20) {
- sp3C.x = randPlusMinusPoint5Scaled(100.0f * D_809DF5B0) + this->unk_0170.x;
- sp3C.y = randPlusMinusPoint5Scaled(50.0f * D_809DF5B0) + this->unk_0170.y;
- sp3C.z = randPlusMinusPoint5Scaled(100.0f * D_809DF5B0) + this->unk_0170.z;
+ sp3C.x = Rand_CenteredFloat(100.0f * D_809DF5B0) + this->unk_0170.x;
+ sp3C.y = Rand_CenteredFloat(50.0f * D_809DF5B0) + this->unk_0170.y;
+ sp3C.z = Rand_CenteredFloat(100.0f * D_809DF5B0) + this->unk_0170.z;
Boss02_SpawnEffectSand(play->specialEffects, &sp3C, Rand_ZeroFloat(3.0f) + 6.0f);
}
if ((this->unk_014C % 2) == 0) {
- sp3C.x = randPlusMinusPoint5Scaled(100.0f * D_809DF5B0) + this->unk_0170.x;
- sp3C.y = randPlusMinusPoint5Scaled(50.0f * D_809DF5B0) + this->unk_0170.y;
- sp3C.z = randPlusMinusPoint5Scaled(100.0f * D_809DF5B0) + this->unk_0170.z;
+ sp3C.x = Rand_CenteredFloat(100.0f * D_809DF5B0) + this->unk_0170.x;
+ sp3C.y = Rand_CenteredFloat(50.0f * D_809DF5B0) + this->unk_0170.y;
+ sp3C.z = Rand_CenteredFloat(100.0f * D_809DF5B0) + this->unk_0170.z;
Boss02_SpawnEffectSand(play->specialEffects, &sp3C, Rand_ZeroFloat(3.0f) + 6.0f);
}
}
diff --git a/src/overlays/actors/ovl_Boss_03/z_boss_03.c b/src/overlays/actors/ovl_Boss_03/z_boss_03.c
index ddd9d4830..d44c961e9 100644
--- a/src/overlays/actors/ovl_Boss_03/z_boss_03.c
+++ b/src/overlays/actors/ovl_Boss_03/z_boss_03.c
@@ -162,8 +162,8 @@ void Boss03_SpawnEffectDroplet(PlayState* play, Vec3f* pos) {
eff->unk_34.y = 0.0f;
eff->unk_34.z = Rand_ZeroFloat(2 * M_PI);
eff->unk_02 = Rand_ZeroFloat(100.0f);
- eff->velocity.x = randPlusMinusPoint5Scaled(25.0f);
- eff->velocity.z = randPlusMinusPoint5Scaled(25.0f);
+ eff->velocity.x = Rand_CenteredFloat(25.0f);
+ eff->velocity.z = Rand_CenteredFloat(25.0f);
return;
}
@@ -425,17 +425,17 @@ void Boss03_SpawnDust(Boss03* this, PlayState* play) {
Vec3f accel;
for (i = 0; i < 5; i++) {
- velocity.x = randPlusMinusPoint5Scaled(10.0f);
+ velocity.x = Rand_CenteredFloat(10.0f);
velocity.y = Rand_ZeroFloat(2.0f) + 2.0f;
- velocity.z = randPlusMinusPoint5Scaled(10.0f);
+ velocity.z = Rand_CenteredFloat(10.0f);
accel.y = -0.075f;
accel.z = 0.0f;
accel.x = 0.0f;
pos.y = Rand_ZeroFloat(20.0f) + 5.0f;
- pos.z = randPlusMinusPoint5Scaled(150.0f) + this->insideJawPos.z;
- pos.x = randPlusMinusPoint5Scaled(150.0f) + this->insideJawPos.x;
+ pos.z = Rand_CenteredFloat(150.0f) + this->insideJawPos.z;
+ pos.x = Rand_CenteredFloat(150.0f) + this->insideJawPos.x;
func_800B0EB0(play, &pos, &velocity, &accel, &sGyorgDustPrimColor, &sGyorgDustEnvColor,
Rand_ZeroFloat(200.0f) + 400.0f, 10, Rand_ZeroFloat(10.0f) + 25.0f);
@@ -597,9 +597,9 @@ void func_809E34B8(Boss03* this, PlayState* play) {
if (this->workTimer[WORK_TIMER_UNK2_A] == 0) {
if ((sqrtf(SQ(xDiff) + SQ(zDiff)) < 100.0f) || (this->workTimer[WORK_TIMER_UNK0_A] == 0)) {
for (i = 0; i < 200; i++) {
- this->unk_268.x = randPlusMinusPoint5Scaled(2500.0f);
+ this->unk_268.x = Rand_CenteredFloat(2500.0f);
this->unk_268.y = Rand_ZeroFloat(100.0f) + 150.0f;
- this->unk_268.z = randPlusMinusPoint5Scaled(2500.0f);
+ this->unk_268.z = Rand_CenteredFloat(2500.0f);
xDiff = this->unk_268.x - this->actor.world.pos.x;
zDiff = this->unk_268.z - this->actor.world.pos.z;
@@ -1100,9 +1100,9 @@ void Boss03_JumpOverPlatform(Boss03* this, PlayState* play) {
Vec3f sp30;
for (i = 0; i < 3; i++) {
- sp30.x = this->actor.world.pos.x + randPlusMinusPoint5Scaled(150.0f);
+ sp30.x = this->actor.world.pos.x + Rand_CenteredFloat(150.0f);
sp30.y = this->actor.world.pos.y;
- sp30.z = this->actor.world.pos.z + randPlusMinusPoint5Scaled(150.0f);
+ sp30.z = this->actor.world.pos.z + Rand_CenteredFloat(150.0f);
Boss03_SpawnEffectDroplet(play, &sp30);
}
}
@@ -1337,9 +1337,9 @@ void Boss03_IntroCutscene(Boss03* this, PlayState* play) {
if (1) {}
for (i = 0; i < 3; i++) {
- effectPos.x = randPlusMinusPoint5Scaled(150.0f) + this->actor.world.pos.x;
+ effectPos.x = Rand_CenteredFloat(150.0f) + this->actor.world.pos.x;
effectPos.y = this->actor.world.pos.y;
- effectPos.z = randPlusMinusPoint5Scaled(150.0f) + this->actor.world.pos.z;
+ effectPos.z = Rand_CenteredFloat(150.0f) + this->actor.world.pos.z;
Boss03_SpawnEffectDroplet(play, &effectPos);
}
@@ -1399,9 +1399,9 @@ void Boss03_IntroCutscene(Boss03* this, PlayState* play) {
this->subCamEye = this->actor.world.pos;
for (i = 0; i < bubblesToSpawnNum; i++) {
- effectPos.x = randPlusMinusPoint5Scaled(100.0f) + this->subCamAt.x;
- effectPos.y = (randPlusMinusPoint5Scaled(100.0f) + this->subCamAt.y) - 150.0f;
- effectPos.z = randPlusMinusPoint5Scaled(100.0f) + this->subCamAt.z;
+ effectPos.x = Rand_CenteredFloat(100.0f) + this->subCamAt.x;
+ effectPos.y = (Rand_CenteredFloat(100.0f) + this->subCamAt.y) - 150.0f;
+ effectPos.z = Rand_CenteredFloat(100.0f) + this->subCamAt.z;
Boss03_SpawnEffectBubble(play, &effectPos);
}
@@ -1573,17 +1573,15 @@ void Boss03_DeathCutscene(Boss03* this, PlayState* play) {
this->actor.speed = ((Rand_ZeroFloat(5.0f) + 2.5f) * sp64) + 2.5f;
if (Rand_ZeroOne() < 0.5f) {
- this->shapeRotTargetX =
- ((s16)randPlusMinusPoint5Scaled(500.0f) + this->shapeRotTargetX) + 0x8000;
+ this->shapeRotTargetX = ((s16)(s32)Rand_CenteredFloat(0x1F4) + this->shapeRotTargetX) + 0x8000;
}
if (Rand_ZeroOne() < 0.5f) {
- this->shapeRotTargetZ =
- ((s16)randPlusMinusPoint5Scaled(500.0f) + this->shapeRotTargetZ) + 0x8000;
+ this->shapeRotTargetZ = ((s16)(s32)Rand_CenteredFloat(0x1F4) + this->shapeRotTargetZ) + 0x8000;
}
if (Rand_ZeroOne() < 0.5f) {
- this->shapeRotTargetY = Rand_ZeroFloat(65536.0f);
+ this->shapeRotTargetY = Rand_ZeroFloat(0x10000);
}
this->actor.world.rot.y = Math_Atan2S_XY(-this->actor.world.pos.z, -this->actor.world.pos.x);
@@ -1600,9 +1598,9 @@ void Boss03_DeathCutscene(Boss03* this, PlayState* play) {
sp4C = 150.0f * sp64;
for (i = 0; i < 1; i++) {
- sp78.x = randPlusMinusPoint5Scaled(sp4C) + this->actor.world.pos.x;
+ sp78.x = Rand_CenteredFloat(sp4C) + this->actor.world.pos.x;
sp78.y = this->actor.world.pos.y;
- sp78.z = randPlusMinusPoint5Scaled(sp4C) + this->actor.world.pos.z;
+ sp78.z = Rand_CenteredFloat(sp4C) + this->actor.world.pos.z;
Boss03_SpawnEffectDroplet(play, &sp78);
}
@@ -2073,9 +2071,9 @@ void Boss03_Update(Actor* thisx, PlayState* play2) {
if ((this->unk_240 % 2) == 0) {
for (i = 0; i < this->bubbleEffectSpawnCount; i++) {
- bubblePos.x = randPlusMinusPoint5Scaled(100.0f) + this->actor.world.pos.x;
- bubblePos.y = randPlusMinusPoint5Scaled(100.0f) + this->actor.world.pos.y;
- bubblePos.z = randPlusMinusPoint5Scaled(100.0f) + this->actor.world.pos.z;
+ bubblePos.x = Rand_CenteredFloat(100.0f) + this->actor.world.pos.x;
+ bubblePos.y = Rand_CenteredFloat(100.0f) + this->actor.world.pos.y;
+ bubblePos.z = Rand_CenteredFloat(100.0f) + this->actor.world.pos.z;
Boss03_SpawnEffectBubble(play, &bubblePos);
}
@@ -2106,9 +2104,9 @@ void Boss03_Update(Actor* thisx, PlayState* play2) {
if (this->wetSpotEffectSpawnCount != 0) {
this->wetSpotEffectSpawnCount--;
- wetSpotPos.x = randPlusMinusPoint5Scaled(50.0f) + player->actor.world.pos.x;
+ wetSpotPos.x = Rand_CenteredFloat(50.0f) + player->actor.world.pos.x;
wetSpotPos.y = PLATFORM_HEIGHT;
- wetSpotPos.z = randPlusMinusPoint5Scaled(50.0f) + player->actor.world.pos.z;
+ wetSpotPos.z = Rand_CenteredFloat(50.0f) + player->actor.world.pos.z;
Boss03_SpawnEffectWetSpot(play, &wetSpotPos);
}
}
@@ -2131,9 +2129,9 @@ void Boss03_Update(Actor* thisx, PlayState* play2) {
for (j = 0, i = 0; i < 20; j++) {
Matrix_RotateYF(yRot, MTXMODE_NEW);
Matrix_MultVecZ(Rand_ZeroFloat(60.000004f) + 312.0f, &dropletPos);
- dropletPos.x += this->unk_284 + randPlusMinusPoint5Scaled(40.0f);
+ dropletPos.x += this->unk_284 + Rand_CenteredFloat(40.0f);
dropletPos.y = PLATFORM_HEIGHT;
- dropletPos.z += this->unk_28C + randPlusMinusPoint5Scaled(40.0f);
+ dropletPos.z += this->unk_28C + Rand_CenteredFloat(40.0f);
if (sqrtf(SQ(dropletPos.x) + SQ(dropletPos.z)) < 355.0f) {
Boss03_SpawnEffectDroplet(play, &dropletPos);
diff --git a/src/overlays/actors/ovl_Boss_04/z_boss_04.c b/src/overlays/actors/ovl_Boss_04/z_boss_04.c
index bf250ca18..4e22822a4 100644
--- a/src/overlays/actors/ovl_Boss_04/z_boss_04.c
+++ b/src/overlays/actors/ovl_Boss_04/z_boss_04.c
@@ -439,8 +439,8 @@ void func_809ECD18(Boss04* this, PlayState* play) {
if (Rand_ZeroOne() < 0.1f) {
Math_Vec3f_Copy(&this->unk_6C8, &player->actor.world.pos);
} else {
- this->unk_6C8.x = randPlusMinusPoint5Scaled(600.0f) + this->unk_6E8;
- this->unk_6C8.z = randPlusMinusPoint5Scaled(600.0f) + this->unk_6F0;
+ this->unk_6C8.x = Rand_CenteredFloat(600.0f) + this->unk_6E8;
+ this->unk_6C8.z = Rand_CenteredFloat(600.0f) + this->unk_6F0;
}
}
diff --git a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c
index ef73ef2dd..742b3bb70 100644
--- a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c
+++ b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c
@@ -110,7 +110,7 @@ void EffDust_Destroy(Actor* thisx, PlayState* play) {
void func_80918D64(EffDust* this, PlayState* play) {
s16 theta;
- s16 fi;
+ s16 phi;
s32 i;
s32 j;
f32* distanceTraveled = this->distanceTraveled;
@@ -127,10 +127,10 @@ void func_80918D64(EffDust* this, PlayState* play) {
i = this->index & 0x3F;
if (this->distanceTraveled[i] >= 1.0f) {
// Spherical coordinate system.
- fi = randPlusMinusPoint5Scaled(0x10000);
+ phi = Rand_CenteredFloat(0x10000);
theta = Rand_ZeroFloat(0x1000);
- this->initialPositions[i].x = -(f32)this->actor.home.rot.z * Math_CosS(fi) * Math_CosS(theta);
- this->initialPositions[i].y = -(f32)this->actor.home.rot.z * Math_SinS(fi) * Math_CosS(theta);
+ this->initialPositions[i].x = -(f32)this->actor.home.rot.z * Math_CosS(phi) * Math_CosS(theta);
+ this->initialPositions[i].y = -(f32)this->actor.home.rot.z * Math_SinS(phi) * Math_CosS(theta);
this->initialPositions[i].z = -(f32)this->actor.home.rot.z * Math_SinS(theta);
this->distanceTraveled[i] = 0.0f;
this->index++;
@@ -141,7 +141,7 @@ void func_80918D64(EffDust* this, PlayState* play) {
void func_80918FE4(EffDust* this, PlayState* play) {
s16 theta;
- s16 fi;
+ s16 phi;
f32* distanceTraveled = this->distanceTraveled;
s32 i;
s32 j;
@@ -157,11 +157,11 @@ void func_80918FE4(EffDust* this, PlayState* play) {
i = this->index & 0x3F;
if (this->distanceTraveled[i] >= 1.0f) {
// Spherical coordinate system.
- fi = randPlusMinusPoint5Scaled(0x10000);
+ phi = Rand_CenteredFloat(0x10000);
theta = Rand_ZeroFloat(0x2000);
- this->initialPositions[i].x = 400.0f * Math_CosS(fi) * Math_CosS(theta);
+ this->initialPositions[i].x = 400.0f * Math_CosS(phi) * Math_CosS(theta);
this->initialPositions[i].y = 400.0f * Math_SinS(theta);
- this->initialPositions[i].z = 400.0f * Math_SinS(fi) * Math_CosS(theta);
+ this->initialPositions[i].z = 400.0f * Math_SinS(phi) * Math_CosS(theta);
this->distanceTraveled[i] = 0.0f;
this->index++;
}
@@ -206,7 +206,7 @@ void func_80919230(EffDust* this, PlayState* play) {
i = this->index & 0x3F;
if (this->distanceTraveled[i] >= 1.0f) {
- theta = randPlusMinusPoint5Scaled(0x10000);
+ theta = Rand_CenteredFloat(0x10000);
switch (this->actor.params) {
case EFF_DUST_TYPE_SPIN_ATTACK_CHARGE:
this->initialPositions[i].x = (Rand_ZeroOne() * 4500.0f) + 700.0f;
diff --git a/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c b/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c
index 5fcf75fdf..6e56cc609 100644
--- a/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c
+++ b/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c
@@ -179,7 +179,7 @@ s32 func_80BECD10(EnAkindonuts* this, Path* path, s32 arg2) {
phi_f14 = sp5C[idx + 1].z - sp5C[idx - 1].z;
}
- func_8017B7F8(&sp30, RAD_TO_BINANG(func_80086B30(phi_f12, phi_f14)), &sp44, &sp40, &sp3C);
+ func_8017B7F8(&sp30, RAD_TO_BINANG(Math_FAtan2F(phi_f12, phi_f14)), &sp44, &sp40, &sp3C);
if (((this->actor.world.pos.x * sp44) + (sp40 * this->actor.world.pos.z) + sp3C) > 0.0f) {
sp50 = true;
}
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 b6d32f6ec..7d1f1e140 100644
--- a/src/overlays/actors/ovl_En_Am/z_en_am.c
+++ b/src/overlays/actors/ovl_En_Am/z_en_am.c
@@ -193,9 +193,9 @@ void EnAm_SpawnEffects(EnAm* this, PlayState* play) {
// Dust Clouds that spawn from the hop
for (i = 4; i > 0; i--) {
- effectPos.x = randPlusMinusPoint5Scaled(65.0f) + this->actor.world.pos.x;
- effectPos.y = randPlusMinusPoint5Scaled(10.0f) + (this->actor.world.pos.y + 40.0f);
- effectPos.z = randPlusMinusPoint5Scaled(65.0f) + this->actor.world.pos.z;
+ effectPos.x = Rand_CenteredFloat(65.0f) + this->actor.world.pos.x;
+ effectPos.y = Rand_CenteredFloat(10.0f) + (this->actor.world.pos.y + 40.0f);
+ effectPos.z = Rand_CenteredFloat(65.0f) + this->actor.world.pos.z;
EffectSsKirakira_SpawnSmall(play, &effectPos, &sVelocity, &sAccel, &D_808B1118, &D_808B111C);
}
Actor_PlaySfx(&this->actor, NA_SE_EN_AMOS_WALK);
@@ -254,7 +254,7 @@ void EnAm_ApplyEnemyTexture(EnAm* this, PlayState* play) {
func_808B0358(this);
} else {
tempTextureBlend = this->textureBlend + 20;
- rand = randPlusMinusPoint5Scaled(10.0f);
+ rand = Rand_CenteredFloat(10.0f);
cos = Math_CosS(this->actor.shape.rot.y) * rand;
sin = Math_SinS(this->actor.shape.rot.y) * rand;
this->actor.world.pos.x = this->actor.home.pos.x + cos;
@@ -433,7 +433,7 @@ void func_808B0894(EnAm* this, PlayState* play) {
for (i = 0; i < 8; i++) {
dustPos.x = (Math_SinS(0) * 7.0f) + this->actor.world.pos.x;
- dustPos.y = (randPlusMinusPoint5Scaled(10.0f) * 6.0f) + (this->actor.world.pos.y + 40.0f);
+ dustPos.y = (Rand_CenteredFloat(10.0f) * 6.0f) + (this->actor.world.pos.y + 40.0f);
dustPos.z = (Math_CosS(0) * 7.0f) + this->actor.world.pos.z;
func_800B0EB0(play, &dustPos, &gZeroVec3f, &gZeroVec3f, &D_808B1120, &D_808B1124, 200, 45, 12);
diff --git a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c
index 5f0ef2edf..e47a726a4 100644
--- a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c
+++ b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c
@@ -336,7 +336,7 @@ void func_8088ACE0(EnArrow* this, PlayState* play) {
(this->collider.base.atFlags & AT_BOUNCED)) {
if ((this->collider.base.at != NULL) && (this->collider.base.at->id != ACTOR_OBJ_SYOKUDAI)) {
Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.prevPos);
- this->actor.world.rot.y += BINANG_ROT180((s16)randPlusMinusPoint5Scaled(8000.0f));
+ this->actor.world.rot.y += BINANG_ROT180((s16)(s32)Rand_CenteredFloat(0x1F40));
this->actor.velocity.y = -this->actor.velocity.y;
this->bubble.unk_149 = -1;
return;
diff --git a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c
index 8c2b4eb4b..e8b74f8ec 100644
--- a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c
+++ b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c
@@ -54,9 +54,9 @@ void EnAttackNiw_Init(Actor* thisx, PlayState* play) {
Actor_SetScale(&this->actor, 0.01f);
this->actor.gravity = 0.0f;
- this->randomTargetCenterOffset.x = randPlusMinusPoint5Scaled(100.0f);
- this->randomTargetCenterOffset.y = randPlusMinusPoint5Scaled(10.0f);
- this->randomTargetCenterOffset.z = randPlusMinusPoint5Scaled(100.0f);
+ this->randomTargetCenterOffset.x = Rand_CenteredFloat(100.0f);
+ this->randomTargetCenterOffset.y = Rand_CenteredFloat(10.0f);
+ this->randomTargetCenterOffset.z = Rand_CenteredFloat(100.0f);
Actor_SetScale(&this->actor, 0.01f);
this->actor.flags &= ~ACTOR_FLAG_1; // Unnecessary: this actor does not start with this flag
@@ -311,7 +311,7 @@ void EnAttackNiw_AimAtPlayer(EnAttackNiw* this, PlayState* play) {
}
if (this->randomAngleChangeTimer == 50) {
- this->targetRotY = randPlusMinusPoint5Scaled(200.0f) + this->actor.yawTowardsPlayer;
+ this->targetRotY = Rand_CenteredFloat(200.0f) + this->actor.yawTowardsPlayer;
}
Math_SmoothStepToS(&this->actor.world.rot.y, this->targetRotY, 2, this->rotStep, 0);
diff --git a/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c b/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c
index 4ea6bc475..406270ff8 100644
--- a/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c
+++ b/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c
@@ -449,9 +449,9 @@ void EnBaguo_InitializeEffect(EnBaguo* this, Vec3f* pos, Vec3f* velocity, Vec3f*
effect->accel = *accel;
effect->scale = scale;
effect->timer = timer;
- effect->rotation.x = (s16)randPlusMinusPoint5Scaled(30000.0f);
- effect->rotation.y = (s16)randPlusMinusPoint5Scaled(30000.0f);
- effect->rotation.z = (s16)randPlusMinusPoint5Scaled(30000.0f);
+ effect->rotation.x = (s16)(s32)Rand_CenteredFloat(0x7530);
+ effect->rotation.y = (s16)(s32)Rand_CenteredFloat(0x7530);
+ effect->rotation.z = (s16)(s32)Rand_CenteredFloat(0x7530);
return;
}
}
diff --git a/src/overlays/actors/ovl_En_Bat/z_en_bat.c b/src/overlays/actors/ovl_En_Bat/z_en_bat.c
index 549a2c4bd..acb47b743 100644
--- a/src/overlays/actors/ovl_En_Bat/z_en_bat.c
+++ b/src/overlays/actors/ovl_En_Bat/z_en_bat.c
@@ -161,11 +161,10 @@ void EnBat_Init(Actor* thisx, PlayState* play) {
EnBat_SetupFlyIdle(this);
while (BAD_BAT_GET_NUMBER_TO_SPAWN(thisx) > 1) {
Actor_SpawnAsChildAndCutscene(
- &play->actorCtx, play, ACTOR_EN_BAT, thisx->world.pos.x + randPlusMinusPoint5Scaled(200.0f),
- thisx->world.pos.y + randPlusMinusPoint5Scaled(100.0f),
- thisx->world.pos.z + randPlusMinusPoint5Scaled(200.0f), randPlusMinusPoint5Scaled(0x2000),
- 0xFFFF * Rand_ZeroOne(), 0, BAD_BAT_PARAMS(this->switchFlag, this->paramFlags, 0), CS_ID_NONE,
- thisx->halfDaysBits, NULL);
+ &play->actorCtx, play, ACTOR_EN_BAT, thisx->world.pos.x + Rand_CenteredFloat(200.0f),
+ thisx->world.pos.y + Rand_CenteredFloat(100.0f), thisx->world.pos.z + Rand_CenteredFloat(200.0f),
+ Rand_CenteredFloat(0x2000), 0xFFFF * Rand_ZeroOne(), 0,
+ BAD_BAT_PARAMS(this->switchFlag, this->paramFlags, 0), CS_ID_NONE, thisx->halfDaysBits, NULL);
BAD_BAT_GET_NUMBER_TO_SPAWN(thisx)--;
}
}
diff --git a/src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.c b/src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.c
index 9fabcecc0..d52f12ccf 100644
--- a/src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.c
+++ b/src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.c
@@ -340,7 +340,7 @@ void EnBbfall_Fly(EnBbfall* this, PlayState* play) {
// Bounce upwards off the ground
this->actor.velocity.y *= -1.2f;
this->actor.velocity.y = CLAMP(this->actor.velocity.y, 8.0f, 12.0f);
- this->actor.shape.rot.y += (s16)randPlusMinusPoint5Scaled(73728.0f);
+ this->actor.shape.rot.y += (s16)(s32)Rand_CenteredFloat(0x12000);
}
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
diff --git a/src/overlays/actors/ovl_En_Bee/z_en_bee.c b/src/overlays/actors/ovl_En_Bee/z_en_bee.c
index c03cc005d..1c2d1ed0f 100644
--- a/src/overlays/actors/ovl_En_Bee/z_en_bee.c
+++ b/src/overlays/actors/ovl_En_Bee/z_en_bee.c
@@ -158,9 +158,9 @@ void EnBee_FlyIdle(EnBee* this, PlayState* play) {
nextPos.z += Math_CosS(this->targetYaw) * 30.0f;
if ((this->instanceId % 2) == 0) {
- this->targetYaw += (s16)((s32)randPlusMinusPoint5Scaled(1000.0f) + 4000);
+ this->targetYaw += (s16)((s32)Rand_CenteredFloat(1000.0f) + 4000);
} else {
- this->targetYaw -= (s16)((s32)randPlusMinusPoint5Scaled(1000.0f) + 4000);
+ this->targetYaw -= (s16)((s32)Rand_CenteredFloat(1000.0f) + 4000);
}
this->flightHoverOffset += 1000;
@@ -197,10 +197,10 @@ void EnBee_Attack(EnBee* this, PlayState* play) {
yawOffset = (this->instanceId * 0x700) + 0x2000;
for (i = 0; i < 2; i++) {
- rand = randPlusMinusPoint5Scaled(20.0f);
+ rand = Rand_CenteredFloat(20.0f);
nextPos.x += Math_SinS((f32)this->actor.yawTowardsPlayer + this->targetYaw + yawOffset) * (rand + 30.0f);
nextPos.y = (Math_SinS(this->flightHoverOffset) * 10.0f) + (player->actor.floorHeight + 40.0f);
- rand = randPlusMinusPoint5Scaled(20.0f);
+ rand = Rand_CenteredFloat(20.0f);
nextPos.z += Math_CosS((f32)this->actor.yawTowardsPlayer + this->targetYaw + yawOffset) * (rand + 30.0f);
Math_Vec3f_Copy(&this->targetPos[i], &nextPos);
@@ -210,14 +210,12 @@ void EnBee_Attack(EnBee* this, PlayState* play) {
Math_Vec3f_Copy(&nextPos, &this->targetPos[this->posIndex]);
if ((this->instanceId % 2) == 0) {
- this->targetYaw +=
- (this->instanceId * 0x700) + (s32)randPlusMinusPoint5Scaled((this->instanceId * 0x700) * 0.5f);
+ this->targetYaw += (this->instanceId * 0x700) + (s32)Rand_CenteredFloat((this->instanceId * 0x700) * 0.5f);
} else {
- this->targetYaw -=
- (this->instanceId * 0x700) + (s32)randPlusMinusPoint5Scaled((this->instanceId * 0x700) * 0.5f);
+ this->targetYaw -= (this->instanceId * 0x700) + (s32)Rand_CenteredFloat((this->instanceId * 0x700) * 0.5f);
}
- this->flightHoverOffset += (s32)randPlusMinusPoint5Scaled(500.0f) + 1000;
+ this->flightHoverOffset += (s32)Rand_CenteredFloat(500.0f) + 1000;
if (this->targetYaw > 0x10000) {
this->targetYaw = 0;
diff --git a/src/overlays/actors/ovl_En_Bh/z_en_bh.c b/src/overlays/actors/ovl_En_Bh/z_en_bh.c
index cdd7abee3..6d99ada15 100644
--- a/src/overlays/actors/ovl_En_Bh/z_en_bh.c
+++ b/src/overlays/actors/ovl_En_Bh/z_en_bh.c
@@ -59,9 +59,9 @@ void func_80C22DEC(EnBh* this, PlayState* play) {
xzDist = sqrtf(SQ(xDiff) + SQ(zDiff));
if ((this->timer2 == 0) || (xzDist < 100.0f)) {
- this->pos.x = randPlusMinusPoint5Scaled(300.0f) + this->actor.home.pos.x;
- this->pos.y = randPlusMinusPoint5Scaled(100.0f) + this->actor.home.pos.y;
- this->pos.z = randPlusMinusPoint5Scaled(300.0f) + this->actor.home.pos.z;
+ this->pos.x = Rand_CenteredFloat(300.0f) + this->actor.home.pos.x;
+ this->pos.y = Rand_CenteredFloat(100.0f) + this->actor.home.pos.y;
+ this->pos.z = Rand_CenteredFloat(300.0f) + this->actor.home.pos.z;
this->timer2 = Rand_ZeroFloat(50.0f) + 30.0f;
this->step = 0;
}
@@ -85,7 +85,7 @@ void func_80C22DEC(EnBh* this, PlayState* play) {
this->skelanime.playSpeed = 1.0f;
this->timer = Rand_ZeroFloat(70.0f) + 50.0f;
} else if (((this->timer & 7) == 7) && (Rand_ZeroOne() < 0.5f)) {
- this->unk1E4 = randPlusMinusPoint5Scaled(3000.0f);
+ this->unk1E4 = Rand_CenteredFloat(3000.0f);
}
} else {
SkelAnime_Update(&this->skelanime);
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 713410f23..1b849799a 100644
--- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c
+++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c
@@ -436,9 +436,9 @@ void EnBigokuta_PlayDeathEffects(EnBigokuta* this, PlayState* play) {
bubblePos.y = this->picto.actor.world.pos.y;
for (i = 0; i < 20; i++) {
- bubbleVel.x = randPlusMinusPoint5Scaled(10.0f);
+ bubbleVel.x = Rand_CenteredFloat(10.0f);
bubbleVel.y = Rand_ZeroFloat(5.5f) + 5.5f;
- bubbleVel.z = randPlusMinusPoint5Scaled(10.0f);
+ bubbleVel.z = Rand_CenteredFloat(10.0f);
bubblePos.x = this->picto.actor.world.pos.x + (2.0f * bubbleVel.x);
bubblePos.z = this->picto.actor.world.pos.z + (2.0f * bubbleVel.z);
@@ -604,7 +604,7 @@ s32 EnBigokuta_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec
MTXMODE_APPLY);
}
} else if (this->actionFunc == EnBigokuta_SuckInPlayer) {
- f32 sin = sin_rad(this->timer * (M_PI / 3.0f)) * 0.5f;
+ f32 sin = Math_SinF(this->timer * (M_PI / 3.0f)) * 0.5f;
Matrix_Scale(((this->timer * (2 / 90.0f)) * (0.5f + sin)) + 1.0f,
((this->timer * (2 / 90.0f)) * (0.5f - sin)) + 1.0f, 1.0f - ((this->timer * 0.3f) / 9.0f),
@@ -613,7 +613,7 @@ s32 EnBigokuta_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec
if (this->timer == 0) {
Matrix_Scale(0.9f, 0.9f, 1.15f, MTXMODE_APPLY);
} else if (this->timer > 0) {
- f32 sin = sin_rad(this->timer * (M_PI / 3.0f)) * 0.5f;
+ f32 sin = Math_SinF(this->timer * (M_PI / 3.0f)) * 0.5f;
Matrix_Scale(((0.5f + sin) * 0.2f) + 1.0f, ((0.5f - sin) * 0.2f) + 1.0f, 0.7f, MTXMODE_APPLY);
} else {
diff --git a/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.c b/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.c
index a77733d31..3daaf1f85 100644
--- a/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.c
+++ b/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.c
@@ -267,7 +267,7 @@ void func_80A27B58(EnBigpamet* this) {
this->unk_2A2 = 40;
for (ptr = &this->unk_2FC[0], i = 0; i < ARRAY_COUNT(this->unk_2FC); i++, ptr++) {
- temp_s1 = (s32)randPlusMinusPoint5Scaled(20480.0f) + this->actor.wallYaw;
+ temp_s1 = (s32)Rand_CenteredFloat(0x5000) + this->actor.wallYaw;
temp_s2 = Rand_S16Offset(0x1000, 0x3000);
temp_fs2 = Math_SinS(temp_s2);
@@ -342,7 +342,7 @@ void func_80A27FE8(EnBigpamet* this, PlayState* play) {
pos.y += 8.0f;
if (this->actionFunc != func_80A28D0C) {
- sp32 = (s32)randPlusMinusPoint5Scaled(0x8000) + this->actor.world.rot.y;
+ sp32 = (s32)Rand_CenteredFloat(0x8000) + this->actor.world.rot.y;
pos.x -= 55.0f * Math_SinS(sp32);
pos.z -= 55.0f * Math_CosS(sp32);
}
diff --git a/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c b/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c
index 7c82b50b0..762141ed4 100644
--- a/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c
+++ b/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c
@@ -554,7 +554,7 @@ void EnBigpo_IdleFlying(EnBigpo* this, PlayState* play) {
// flight position calculations
this->hoverHeightCycleTimer = (this->hoverHeightCycleTimer == 0) ? 40 : (this->hoverHeightCycleTimer - 1);
Math_StepToF(&this->savedHeight, player->actor.world.pos.y + 100.0f, 1.5f);
- this->actor.world.pos.y = (sin_rad(this->hoverHeightCycleTimer * (M_PI / 20)) * 10.0f) + this->savedHeight;
+ this->actor.world.pos.y = (Math_SinF(this->hoverHeightCycleTimer * (M_PI / 20)) * 10.0f) + this->savedHeight;
Math_StepToF(&this->actor.speed, 3.0f, 0.2f);
func_800B9010(&this->actor, NA_SE_EN_PO_FLY - SFX_FLAG);
if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 300.0f) {
@@ -827,7 +827,7 @@ void EnBigpo_ScoopSoulIdle(EnBigpo* this, PlayState* play) {
EnBigpo_SetupScoopSoulLeaving(this);
} else {
Actor_OfferGetItem(&this->actor, play, GI_MAX, 35.0f, 60.0f);
- this->actor.world.pos.y = (sin_rad(this->idleTimer * (M_PI / 20)) * 5.0f) + this->savedHeight;
+ this->actor.world.pos.y = (Math_SinF(this->idleTimer * (M_PI / 20)) * 5.0f) + this->savedHeight;
}
}
diff --git a/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c b/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c
index 1a90fd29b..695ac9153 100644
--- a/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c
+++ b/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c
@@ -657,7 +657,7 @@ void EnBigslime_AddWavySurface(EnBigslime* this) {
randFloat = (Rand_ZeroOne() * 40.0f) + 50.0f;
}
- this->vtxSurfacePerturbation[i] = sin_rad((randInt + i) * (M_PI / 3)) * randFloat * 0.001f;
+ this->vtxSurfacePerturbation[i] = Math_SinF((randInt + i) * (M_PI / 3)) * randFloat * 0.001f;
}
}
@@ -673,7 +673,7 @@ void EnBigslime_UpdateWavySurface(EnBigslime* this) {
}
this->wavySurfaceTimer--;
- vtxSurfaceWave = sin_rad(this->wavySurfaceTimer * (M_PI / 12));
+ vtxSurfaceWave = Math_SinF(this->wavySurfaceTimer * (M_PI / 12));
for (i = 0; i < BIGSLIME_NUM_VTX; i++) {
staticVtx = &sBigslimeStaticVtx[i];
dynamicVtx = &sBigslimeDynamicVtx[this->dynamicVtxState][i];
@@ -692,9 +692,9 @@ void EnBigslime_InitFallMinislime(EnBigslime* this) {
for (i = 0; i < MINISLIME_NUM_SPAWN; i++) {
minislime = this->minislime[i];
minislime->actor.params = MINISLIME_INIT_FALL;
- minislime->actor.world.pos.x = randPlusMinusPoint5Scaled(80.0f) + (GBT_ROOM_5_MIN_X + ((i % 4) + 1) * 192.0f);
+ minislime->actor.world.pos.x = Rand_CenteredFloat(80.0f) + (GBT_ROOM_5_MIN_X + ((i % 4) + 1) * 192.0f);
minislime->actor.world.pos.y = Rand_ZeroFloat(250.0f) + (GBT_ROOM_5_CENTER_Y + 50.0f);
- minislime->actor.world.pos.z = randPlusMinusPoint5Scaled(80.0f) + (GBT_ROOM_5_MIN_Z + ((i / 4) + 1) * 192.0f);
+ minislime->actor.world.pos.z = Rand_CenteredFloat(80.0f) + (GBT_ROOM_5_MIN_Z + ((i / 4) + 1) * 192.0f);
}
this->minislimeState = MINISLIME_ACTIVE_INIT_STATE;
@@ -1169,7 +1169,7 @@ void EnBigslime_SetTargetVtxToWideCone(EnBigslime* this) {
s32 j;
for (i = 0; i < BIGSLIME_NUM_RING_FACES / 2; i++) {
- vtxY = (((cos_rad(i * (M_PI / 6)) + 1.0f) * 0.925f) + -0.85f) * BIGSLIME_RADIUS_F;
+ vtxY = (((Math_CosF(i * (M_PI / 6)) + 1.0f) * 0.925f) + -0.85f) * BIGSLIME_RADIUS_F;
for (j = sVtxRingStartIndex[i]; j < sVtxRingStartIndex[i + 1]; j++) {
staticVtx = &sBigslimeStaticVtx[j];
targetVtx = &sBigslimeTargetVtx[j];
@@ -1188,7 +1188,7 @@ void EnBigslime_SetTargetVtxToWideCone(EnBigslime* this) {
}
for (; i < BIGSLIME_NUM_RING_VTX; i++) {
- vtxY = ((cos_rad((i - BIGSLIME_NUM_RING_FACES / 2) * (M_PI / 16)) * 0.05f) + -1.0f) * BIGSLIME_RADIUS_F;
+ vtxY = ((Math_CosF((i - BIGSLIME_NUM_RING_FACES / 2) * (M_PI / 16)) * 0.05f) + -1.0f) * BIGSLIME_RADIUS_F;
for (j = sVtxRingStartIndex[i]; j < sVtxRingStartIndex[i + 1]; j++) {
staticVtx = &sBigslimeStaticVtx[j];
targetVtx = &sBigslimeTargetVtx[j];
@@ -1301,7 +1301,7 @@ void EnBigslime_SetTargetVtxToThinCone(EnBigslime* this) {
sBigslimeTargetVtx[0].n.ob[2] = 0;
for (i = 1; i < BIGSLIME_NUM_RING_FACES / 2; i++) {
- upperSphereCos = (((cos_rad((i - 1) * (M_PI / 5)) + 1.0f) * 0.925f) + -0.85f) * BIGSLIME_RADIUS_F;
+ upperSphereCos = (((Math_CosF((i - 1) * (M_PI / 5)) + 1.0f) * 0.925f) + -0.85f) * BIGSLIME_RADIUS_F;
for (j = sVtxRingStartIndex[i]; j < sVtxRingStartIndex[i + 1]; j++) {
staticVtx = &sBigslimeStaticVtx[j];
targetVtx = &sBigslimeTargetVtx[j];
@@ -1318,7 +1318,7 @@ void EnBigslime_SetTargetVtxToThinCone(EnBigslime* this) {
}
for (; i < BIGSLIME_NUM_RING_FACES; i++) {
- lowerSphereCos = cos_rad((i - BIGSLIME_NUM_RING_FACES / 2) * (M_PI / BIGSLIME_NUM_RING_FACES));
+ lowerSphereCos = Math_CosF((i - BIGSLIME_NUM_RING_FACES / 2) * (M_PI / BIGSLIME_NUM_RING_FACES));
for (j = sVtxRingStartIndex[i]; j < sVtxRingStartIndex[i + 1]; j++) {
staticVtx = &sBigslimeStaticVtx[j];
targetVtx = &sBigslimeTargetVtx[j];
@@ -1361,7 +1361,7 @@ void EnBigslime_SetTargetVtxToInverseCone(EnBigslime* this) {
sBigslimeTargetVtx[0].n.ob[2] = 0;
for (i = 1; i < BIGSLIME_NUM_RING_FACES / 2; i++) {
- upperSphereCos = cos_rad((i - 1) * (M_PI / 10));
+ upperSphereCos = Math_CosF((i - 1) * (M_PI / 10));
for (j = sVtxRingStartIndex[i]; j < sVtxRingStartIndex[i + 1]; j++) {
staticVtx = &sBigslimeStaticVtx[j];
targetVtx = &sBigslimeTargetVtx[j];
@@ -1374,7 +1374,7 @@ void EnBigslime_SetTargetVtxToInverseCone(EnBigslime* this) {
for (; i < BIGSLIME_NUM_RING_FACES; i++) {
lowerSphereCos =
- (((cos_rad((i - BIGSLIME_NUM_RING_FACES / 2) * (M_PI / 5)) + 1) * 0.925f) + -1.0f) * BIGSLIME_RADIUS_F;
+ (((Math_CosF((i - BIGSLIME_NUM_RING_FACES / 2) * (M_PI / 5)) + 1) * 0.925f) + -1.0f) * BIGSLIME_RADIUS_F;
for (j = sVtxRingStartIndex[i]; j < sVtxRingStartIndex[i + 1]; j++) {
staticVtx = &sBigslimeStaticVtx[j];
targetVtx = &sBigslimeTargetVtx[j];
@@ -1692,7 +1692,7 @@ void EnBigslime_WindupThrowPlayer(EnBigslime* this, PlayState* play) {
EnBigslime_UpdateCameraGrabPlayer(this, play);
if (this->windupPunchTimer > 0) {
invWindupPunchTimer = 1.0f / this->windupPunchTimer;
- scale = cos_rad(this->windupPunchTimer * (M_PI / 27)) + 1.0f;
+ scale = Math_CosF(this->windupPunchTimer * (M_PI / 27)) + 1.0f;
player->actor.world.pos.y = this->actor.world.pos.y + (this->actor.scale.y * -500.0f);
// Linearly interpolate gekkoRot.y --> this->actor.world.rot.y
@@ -1705,7 +1705,7 @@ void EnBigslime_WindupThrowPlayer(EnBigslime* this, PlayState* play) {
EnBigslime_GekkoSfxInsideBigslime(this, NA_SE_EN_FROG_PUNCH1);
}
- scale = 0.5f - cos_rad(-this->windupPunchTimer * (M_PI / 5)) * 0.5f;
+ scale = 0.5f - Math_CosF(-this->windupPunchTimer * (M_PI / 5)) * 0.5f;
if (this->windupPunchTimer == -5) {
if (player->stateFlags2 & PLAYER_STATE2_80) {
player->actor.parent = NULL;
@@ -1879,7 +1879,7 @@ void EnBigslime_Freeze(EnBigslime* this, PlayState* play) {
if (vtxIceSeed < BIGSLIME_NUM_VTX) {
dynamicVtx = &sBigslimeDynamicVtx[this->dynamicVtxState][vtxIceSeed];
targetVtx = &sBigslimeTargetVtx[vtxIceSeed];
- randFloat = randPlusMinusPoint5Scaled(40.0f);
+ randFloat = Rand_CenteredFloat(40.0f);
dynamicVtx->n.ob[0] += (s16)(randFloat / this->actor.scale.x);
dynamicVtx->n.ob[1] += (s16)(randFloat / this->actor.scale.y);
dynamicVtx->n.ob[2] += (s16)(randFloat / this->actor.scale.z);
@@ -2444,9 +2444,9 @@ void EnBigslime_SetupFrogSpawn(EnBigslime* this, PlayState* play) {
func_800B0DE0(play, &dustPos, &gZeroVec3f, &gZeroVec3f, &dustPrimColor, &dustEnvColor, 500, 50);
for (i = 0; i < 25; i++) {
- hahenVel.x = randPlusMinusPoint5Scaled(5.0f);
+ hahenVel.x = Rand_CenteredFloat(5.0f);
hahenVel.y = Rand_ZeroFloat(3.0f) + 4.0f;
- hahenVel.z = randPlusMinusPoint5Scaled(5.0f);
+ hahenVel.z = Rand_CenteredFloat(5.0f);
EffectSsHahen_Spawn(play, worldPos, &hahenVel, &hahenAccel, 0, Rand_S16Offset(12, 3), HAHEN_OBJECT_DEFAULT, 10,
0);
}
@@ -2464,7 +2464,8 @@ void EnBigslime_FrogSpawn(EnBigslime* this, PlayState* play) {
this->spawnFrogTimer--;
// Zoom the camera in and out at the newly spawned red frog
- subCamZoom = sin_rad(this->spawnFrogTimer * (M_PI / 5)) * ((0.04f * (this->spawnFrogTimer * 0.1f)) + 0.02f) + 1.0f;
+ subCamZoom =
+ Math_SinF(this->spawnFrogTimer * (M_PI / 5)) * ((0.04f * (this->spawnFrogTimer * 0.1f)) + 0.02f) + 1.0f;
subCamEye.x = subCam->at.x + (this->subCamDistToFrog.x * subCamZoom);
subCamEye.z = subCam->at.z + (this->subCamDistToFrog.z * subCamZoom);
subCamEye.y = subCam->at.y + (this->subCamDistToFrog.y * subCamZoom);
diff --git a/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.h b/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.h
index f10938b37..8f2b5bee3 100644
--- a/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.h
+++ b/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.h
@@ -87,7 +87,7 @@ typedef struct EnBigslime {
s16 isDespawned;
s16 isInitJump;
};
- /* 0x02BC */ s16 wavySurfaceTimer; // decrements from 24, used in sin_rad for currData2
+ /* 0x02BC */ s16 wavySurfaceTimer; // decrements from 24, used in Math_SinF for currData2
/* 0x02BE */ s16 stunTimer;
/* 0x02C0 */ union {
s16 freezeTimer;
diff --git a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c
index 4355759c7..ee00081db 100644
--- a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c
+++ b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c
@@ -120,7 +120,7 @@ s32 EnBomChu_UpdateFloorPoly(EnBomChu* this, CollisionPoly* floorPoly, PlayState
return false;
}
- angle = func_80086C48(normDotUp);
+ angle = Math_FAcosF(normDotUp);
if (angle < 0.001f) {
return false;
}
diff --git a/src/overlays/actors/ovl_En_Bombers/z_en_bombers.c b/src/overlays/actors/ovl_En_Bombers/z_en_bombers.c
index 86cad7219..55f7ff281 100644
--- a/src/overlays/actors/ovl_En_Bombers/z_en_bombers.c
+++ b/src/overlays/actors/ovl_En_Bombers/z_en_bombers.c
@@ -236,8 +236,8 @@ void func_80C03AF4(EnBombers* this, PlayState* play) {
if (this->unk_2A8 == 0) {
Math_Vec3f_Copy(&sp60, &this->actor.home.pos);
- sp60.x += randPlusMinusPoint5Scaled(150.0f);
- sp60.z += randPlusMinusPoint5Scaled(150.0f);
+ sp60.x += Rand_CenteredFloat(150.0f);
+ sp60.z += Rand_CenteredFloat(150.0f);
abs = ABS_ALT(BINANG_SUB(this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &sp60)));
if ((abs < 0x4000) && !BgCheck_EntityLineTest1(&play->colCtx, &this->actor.world.pos, &sp60, &sp6C,
diff --git a/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c b/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c
index 7c2a64841..229a1e695 100644
--- a/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c
+++ b/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c
@@ -266,8 +266,8 @@ void func_80BFE67C(EnBomjima* this, PlayState* play) {
if (this->unk_2C0 == 0) {
Math_Vec3f_Copy(&sp54, &this->actor.home.pos);
- sp54.x += randPlusMinusPoint5Scaled(150.0f);
- sp54.z += randPlusMinusPoint5Scaled(150.0f);
+ sp54.x += Rand_CenteredFloat(150.0f);
+ sp54.z += Rand_CenteredFloat(150.0f);
abs = ABS_ALT(BINANG_SUB(this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &sp54)));
if ((abs < 0x4000) && !BgCheck_EntityLineTest1(&play->colCtx, &this->actor.world.pos, &sp54, &sp6C,
@@ -422,7 +422,7 @@ void func_80BFEB64(EnBomjima* this, PlayState* play) {
}
sp40.x = (Math_SinS(sp3E) * (Rand_ZeroFloat(20.0f) + 40.0f)) + this->bombal->actor.world.pos.x;
- sp40.y = this->bombal->actor.world.pos.y - randPlusMinusPoint5Scaled(40.0f);
+ sp40.y = this->bombal->actor.world.pos.y - Rand_CenteredFloat(40.0f);
sp40.z = (Math_CosS(sp3E) * (Rand_ZeroFloat(20.0f) + 40.0f)) + this->bombal->actor.world.pos.z;
SoundSource_PlaySfxAtFixedWorldPos(play, &sp40, 50, NA_SE_EV_BOMBERS_SHOT_EXPLOSUIN);
@@ -433,8 +433,8 @@ void func_80BFEB64(EnBomjima* this, PlayState* play) {
func_80BFE494(this, 5, 1.0f);
this->unk_29A = 0;
Math_Vec3f_Copy(&this->unk_2A4, &this->actor.home.pos);
- this->unk_2A4.x += randPlusMinusPoint5Scaled(150.0f);
- this->unk_2A4.z += randPlusMinusPoint5Scaled(150.0f);
+ this->unk_2A4.x += Rand_CenteredFloat(150.0f);
+ this->unk_2A4.z += Rand_CenteredFloat(150.0f);
this->unk_2A2++;
}
}
diff --git a/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c b/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c
index 3c0f0da54..fbdcb860f 100644
--- a/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c
+++ b/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c
@@ -275,8 +275,8 @@ void func_80C014E4(EnBomjimb* this, PlayState* play) {
case 0:
if (this->unk_2AE == 0) {
Math_Vec3f_Copy(&sp48, &this->actor.home.pos);
- sp48.x += randPlusMinusPoint5Scaled(150.0f);
- sp48.z += randPlusMinusPoint5Scaled(150.0f);
+ sp48.x += Rand_CenteredFloat(150.0f);
+ sp48.z += Rand_CenteredFloat(150.0f);
abs = ABS_ALT(BINANG_SUB(this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &sp48)));
if ((abs < 0x4000) && !BgCheck_EntityLineTest1(&play->colCtx, &this->actor.world.pos, &sp48, &sp60,
diff --git a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c
index 4becc2fe6..8e3e907bb 100644
--- a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c
+++ b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c
@@ -494,8 +494,8 @@ void EnClearTag_Init(Actor* thisx, PlayState* play) {
vel.z = cosf(i * (33.0f / 40.0f)) * i * .5f;
vel.y = Rand_ZeroFloat(8.0f) + 7.0f;
- vel.x += randPlusMinusPoint5Scaled(0.5f);
- vel.z += randPlusMinusPoint5Scaled(0.5f);
+ vel.x += Rand_CenteredFloat(0.5f);
+ vel.z += Rand_CenteredFloat(0.5f);
accel.x = 0.0f;
accel.y = -1.0f;
diff --git a/src/overlays/actors/ovl_En_Col_Man/z_en_col_man.c b/src/overlays/actors/ovl_En_Col_Man/z_en_col_man.c
index 703585dd4..fa6349871 100644
--- a/src/overlays/actors/ovl_En_Col_Man/z_en_col_man.c
+++ b/src/overlays/actors/ovl_En_Col_Man/z_en_col_man.c
@@ -163,7 +163,7 @@ void func_80AFDFB4(EnColMan* this, PlayState* play) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.velocity.y < 0.0f)) {
if (!this->hasSetRandomValues) {
- this->actor.world.rot.y = randPlusMinusPoint5Scaled(30000.0f);
+ this->actor.world.rot.y = Rand_CenteredFloat(30000.0f);
this->actor.speed = 2.0f + BREG(56) + Rand_ZeroFloat(2.0f);
this->actor.velocity.y = 12.0f + BREG(57) + Rand_ZeroFloat(5.0f);
this->hasSetRandomValues = true;
@@ -172,9 +172,9 @@ void func_80AFDFB4(EnColMan* this, PlayState* play) {
}
for (i = 0; i < 2; i++) {
- velocity.x = randPlusMinusPoint5Scaled(2.0f);
+ velocity.x = Rand_CenteredFloat(2.0f);
velocity.y = Rand_ZeroFloat(2.0f) + 1.0f;
- velocity.z = randPlusMinusPoint5Scaled(2.0f);
+ velocity.z = Rand_CenteredFloat(2.0f);
accel.y = -0.1f;
accel.z = 0.0f;
accel.x = 0.0f;
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 ec9a11b4c..4c88b84cb 100644
--- a/src/overlays/actors/ovl_En_Crow/z_en_crow.c
+++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.c
@@ -552,9 +552,9 @@ s32 EnCrow_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f*
if (this->actor.colChkInfo.health != 0) {
if (limbIndex == OBJECT_CROW_LIMB_UPPER_TAIL) {
- rot->y += (s16)(0xC00 * sin_rad(this->skelAnime.curFrame * (M_PI / 4)));
+ rot->y += (s16)(0xC00 * Math_SinF(this->skelAnime.curFrame * (M_PI / 4)));
} else if (limbIndex == OBJECT_CROW_LIMB_TAIL) {
- rot->y += (s16)(0x1400 * sin_rad((this->skelAnime.curFrame + 2.5f) * (M_PI / 4)));
+ rot->y += (s16)(0x1400 * Math_SinF((this->skelAnime.curFrame + 2.5f) * (M_PI / 4)));
}
}
return false;
diff --git a/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c b/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c
index eaf1839c6..311b6d216 100644
--- a/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c
+++ b/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c
@@ -243,9 +243,9 @@ void func_80BE66E4(EnDaiku2* this, PlayState* play) {
sp70.y += 40.0f;
sp70.z += Math_CosS(this->actor.world.rot.y) * 70.0f;
- sp70.x += randPlusMinusPoint5Scaled(5.0f);
- sp70.y += randPlusMinusPoint5Scaled(5.0f);
- sp70.z += randPlusMinusPoint5Scaled(5.0f);
+ sp70.x += Rand_CenteredFloat(5.0f);
+ sp70.y += Rand_CenteredFloat(5.0f);
+ sp70.z += Rand_CenteredFloat(5.0f);
sp88.y = -1.0f;
@@ -507,9 +507,9 @@ void func_80BE7504(EnDaiku2* this, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, f32 ar
effect->unk_1C = *arg3;
effect->unk_30 = arg4;
effect->unk_34 = arg5;
- effect->unk_28.x = randPlusMinusPoint5Scaled(30000.0f);
- effect->unk_28.y = randPlusMinusPoint5Scaled(30000.0f);
- effect->unk_28.z = randPlusMinusPoint5Scaled(30000.0f);
+ effect->unk_28.x = Rand_CenteredFloat(30000.0f);
+ effect->unk_28.y = Rand_CenteredFloat(30000.0f);
+ effect->unk_28.z = Rand_CenteredFloat(30000.0f);
break;
}
}
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 186494268..422b35e87 100644
--- a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c
+++ b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c
@@ -384,7 +384,7 @@ void EnDekubaba_Grow(EnDekubaba* this, PlayState* play) {
this->size * 0.01f * (0.5f + (15 - this->timer) * 0.5f / 15.0f);
Math_ScaledStepToS(&this->actor.shape.rot.x, 0x1800, 0x800);
- headDistVertical = sin_rad(CLAMP_MAX((15 - this->timer) * (1.0f / 15), 0.7f) * M_PI) * 32.0f + 14.0f;
+ headDistVertical = Math_SinF(CLAMP_MAX((15 - this->timer) * (1.0f / 15), 0.7f) * M_PI) * 32.0f + 14.0f;
if (this->actor.shape.rot.x < -0x38E3) {
headDistHorizontal = 0.0f;
@@ -468,7 +468,7 @@ void EnDekubaba_Retract(EnDekubaba* this, PlayState* play) {
this->size * 0.01f * (0.5f + this->timer * (1.0f / 30));
Math_ScaledStepToS(&this->actor.shape.rot.x, -0x4000, 0x300);
- headDistVertical = (sin_rad(CLAMP_MAX(this->timer * 0.033f, 0.7f) * M_PI) * 32.0f) + 14.0f;
+ headDistVertical = (Math_SinF(CLAMP_MAX(this->timer * 0.033f, 0.7f) * M_PI) * 32.0f) + 14.0f;
if (this->actor.shape.rot.x < -0x38E3) {
headDistHorizontal = 0.0f;
diff --git a/src/overlays/actors/ovl_En_Dg/z_en_dg.c b/src/overlays/actors/ovl_En_Dg/z_en_dg.c
index d80013a99..46c6de979 100644
--- a/src/overlays/actors/ovl_En_Dg/z_en_dg.c
+++ b/src/overlays/actors/ovl_En_Dg/z_en_dg.c
@@ -280,7 +280,7 @@ s32 EnDg_HasReachedPoint(EnDg* this, Path* path, s32 pointIndex) {
diffZ = points[currentPoint + 1].z - points[currentPoint - 1].z;
}
- func_8017B7F8(&point, RAD_TO_BINANG(func_80086B30(diffX, diffZ)), &px, &pz, &d);
+ func_8017B7F8(&point, RAD_TO_BINANG(Math_FAtan2F(diffX, diffZ)), &px, &pz, &d);
if (((this->actor.world.pos.x * px) + (pz * this->actor.world.pos.z) + d) > 0.0f) {
reached = true;
@@ -358,9 +358,9 @@ void EnDg_SpawnFloorDustRing(EnDg* this, PlayState* play) {
Vec3f pos;
if (((this->index + curFrame) % mod) == 0) {
- pos.x = randPlusMinusPoint5Scaled(15.0f) + this->actor.world.pos.x;
+ pos.x = Rand_CenteredFloat(15.0f) + this->actor.world.pos.x;
pos.y = this->actor.world.pos.y;
- pos.z = randPlusMinusPoint5Scaled(15.0f) + this->actor.world.pos.z;
+ pos.z = Rand_CenteredFloat(15.0f) + this->actor.world.pos.z;
Actor_SpawnFloorDustRing(play, &this->actor, &pos, 10.0f, 0, 2.0f, 300, 0, true);
}
}
@@ -900,14 +900,14 @@ void EnDg_JumpAttack(EnDg* this, PlayState* play) {
if (curFrame < 9) {
if (Animation_OnFrame(&this->skelAnime, 0.0f)) {
- sAnimationInfo[DOG_ANIM_JUMP_ATTACK].playSpeed = randPlusMinusPoint5Scaled(1.0f) + 3.0f;
+ sAnimationInfo[DOG_ANIM_JUMP_ATTACK].playSpeed = Rand_CenteredFloat(1.0f) + 3.0f;
}
EnDg_SpawnFloorDustRing(this, play);
} else {
this->dogFlags |= DOG_FLAG_JUMP_ATTACKING;
if (Animation_OnFrame(&this->skelAnime, 9.0f)) {
- f32 rand = randPlusMinusPoint5Scaled(1.5f);
+ f32 rand = Rand_CenteredFloat(1.5f);
sAnimationInfo[DOG_ANIM_JUMP_ATTACK].playSpeed = 1.2f;
this->actor.velocity.y = 2.0f * rand + 3.0f;
diff --git a/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c b/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c
index 5b268f1f8..e24e2691b 100644
--- a/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c
+++ b/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c
@@ -1062,7 +1062,7 @@ void func_8089CB10(EnDinofos* this, PlayState* play) {
}
void func_8089CBEC(EnDinofos* this, PlayState* play) {
- s16 temp_s3 = ((s32)randPlusMinusPoint5Scaled(0x1000) + this->actor.shape.rot.y) + this->unk_28E;
+ s16 temp_s3 = ((s32)Rand_CenteredFloat(0x1000) + this->actor.shape.rot.y) + this->unk_28E;
Vec3f sp88;
Vec3f sp7C;
ColliderJntSphElementDim* dim;
@@ -1081,10 +1081,10 @@ void func_8089CBEC(EnDinofos* this, PlayState* play) {
temp_s0 = CLAMP_MIN(temp_s0, 0);
sp88.x = 11.0f * temp_f20;
- sp88.y = randPlusMinusPoint5Scaled(2.0f) + -5.4f;
+ sp88.y = Rand_CenteredFloat(2.0f) + -5.4f;
sp88.z = 11.0f * temp_f22;
sp7C.x = 0.9f * temp_f20;
- sp7C.y = randPlusMinusPoint5Scaled(0.6f) + 1.4f;
+ sp7C.y = Rand_CenteredFloat(0.6f) + 1.4f;
sp7C.z = 0.9f * temp_f22;
func_800B9010(&this->actor, NA_SE_EN_DODO_J_FIRE - SFX_FLAG);
EffectSsDFire_Spawn(play, &this->limbPos[10], &sp88, &sp7C, 30, 22, 255 - (temp_s0 * 20), 20, 3, 8);
@@ -1098,7 +1098,7 @@ void func_8089CBEC(EnDinofos* this, PlayState* play) {
for (i = 6; i < end; i++) {
dim = &this->colliderJntSph.elements[i].dim;
- temp_s3 = (s32)(cos_rad((this->unk_290 + ((i - 5) << 1)) * (M_PI / 20)) * 0x2C00) + this->actor.shape.rot.y;
+ temp_s3 = (s32)(Math_CosF((this->unk_290 + ((i - 5) << 1)) * (M_PI / 20)) * 0x2C00) + this->actor.shape.rot.y;
dim->worldSphere.center.x = (s32)this->limbPos[10].x + (s32)(Math_SinS(temp_s3) * dim->modelSphere.center.z);
dim->worldSphere.center.y = (s32)this->limbPos[10].y + (s32)dim->modelSphere.center.y;
@@ -1232,9 +1232,9 @@ void func_8089D42C(EnDinofos* this, PlayState* play) {
if ((this->actionFunc == func_8089B834) && (this->unk_290 != 0)) {
Math_ScaledStepToS(&this->unk_28E, Math_SinS(this->unk_290 * 1400) * 0x2C00, 0x300);
} else if (this->actionFunc == func_8089CA74) {
- Math_ScaledStepToS(&this->unk_28E, cos_rad(M_PI) * 0x2C00, 0x233);
+ Math_ScaledStepToS(&this->unk_28E, Math_CosF(M_PI) * 0x2C00, 0x2C00 / 20);
} else if (this->actionFunc == func_8089CBEC) {
- this->unk_28E = cos_rad(this->unk_290 * (M_PI / 20)) * 0x2C00;
+ this->unk_28E = Math_CosF(this->unk_290 * (M_PI / 20)) * 0x2C00;
} else if (!Play_InCsMode(play)) {
temp_v0_2 = this->unk_28E + this->actor.shape.rot.y;
temp_v0_2 = BINANG_SUB(this->actor.yawTowardsPlayer, temp_v0_2);
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 3f149049a..6149a7360 100644
--- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c
+++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c
@@ -371,11 +371,11 @@ void func_80876930(EnDodongo* this, PlayState* play, Vec3f* arg2) {
temp3 = this->unk_334 * 30.0f;
for (i = 0; i < 3; i++) {
- sp88.x = randPlusMinusPoint5Scaled(temp3) + arg2->x;
+ sp88.x = Rand_CenteredFloat(temp3) + arg2->x;
sp88.y = Rand_ZeroFloat(5.0f) + this->actor.floorHeight;
- sp88.z = randPlusMinusPoint5Scaled(temp3) + arg2->z;
- D_8087933C.x = randPlusMinusPoint5Scaled(2.0f);
- D_8087933C.z = randPlusMinusPoint5Scaled(2.0f);
+ sp88.z = Rand_CenteredFloat(temp3) + arg2->z;
+ D_8087933C.x = Rand_CenteredFloat(2.0f);
+ D_8087933C.z = Rand_CenteredFloat(2.0f);
func_800B0DE0(play, &sp88, &gZeroVec3f, &D_8087933C, sp80, sp7C, temp1, temp2);
}
}
@@ -738,9 +738,9 @@ void func_80877E60(EnDodongo* this, PlayState* play) {
this->timer--;
if (this->timer == 10) {
for (i = 10; i >= 0; i--) {
- sp84.x = randPlusMinusPoint5Scaled(10.0f);
- sp84.y = randPlusMinusPoint5Scaled(10.0f);
- sp84.z = randPlusMinusPoint5Scaled(10.0f);
+ sp84.x = Rand_CenteredFloat(10.0f);
+ sp84.y = Rand_CenteredFloat(10.0f);
+ sp84.z = Rand_CenteredFloat(10.0f);
sp78.x = sp84.x * -0.1f;
sp78.y = sp84.y * -0.1f;
sp78.z = sp84.z * -0.1f;
diff --git a/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c b/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c
index d2acb55be..fae9fc4fc 100644
--- a/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c
+++ b/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c
@@ -299,11 +299,11 @@ void EnDragon_SpawnBubbles(EnDragon* this, PlayState* play, Vec3f basePos) {
Vec3f bubblePos;
s32 i;
- bubbleCount = (s32)randPlusMinusPoint5Scaled(5.0f) + 10;
+ bubbleCount = (s32)Rand_CenteredFloat(5.0f) + 10;
colorIndex = 0;
if (this->action == DEEP_PYTHON_ACTION_DEAD) {
colorIndex = 1;
- bubbleCount = (s32)randPlusMinusPoint5Scaled(5.0f) + 10;
+ bubbleCount = (s32)Rand_CenteredFloat(5.0f) + 10;
}
for (i = 0; i < bubbleCount; i++) {
@@ -311,9 +311,9 @@ void EnDragon_SpawnBubbles(EnDragon* this, PlayState* play, Vec3f basePos) {
sBubbleVelocity.x = Rand_ZeroFloat(1.0f) * 23.0f;
sBubbleVelocity.y = Rand_ZeroFloat(1.0f) * 10.0f;
sBubbleVelocity.z = Rand_ZeroFloat(1.0f) * 23.0f;
- bubblePos.x += randPlusMinusPoint5Scaled(i * 30.0f);
- bubblePos.y += randPlusMinusPoint5Scaled(5.0f);
- bubblePos.z += randPlusMinusPoint5Scaled(i * 30.0f);
+ bubblePos.x += Rand_CenteredFloat(i * 30.0f);
+ bubblePos.y += Rand_CenteredFloat(5.0f);
+ bubblePos.z += Rand_CenteredFloat(i * 30.0f);
sBubbleAccel.y = Rand_ZeroFloat(1.0f) * 20.0f * 3.0f;
scale = Rand_S16Offset(380, 240);
EffectSsDtBubble_SpawnCustomColor(play, &bubblePos, &sBubbleVelocity, &sBubbleAccel,
diff --git a/src/overlays/actors/ovl_En_Egblock/z_en_egblock.c b/src/overlays/actors/ovl_En_Egblock/z_en_egblock.c
index 2a9a0ac67..bd9949c61 100644
--- a/src/overlays/actors/ovl_En_Egblock/z_en_egblock.c
+++ b/src/overlays/actors/ovl_En_Egblock/z_en_egblock.c
@@ -134,8 +134,8 @@ void EnEgblock_SpawnEffect(EnEgblock* this, Vec3f* pos, s16 lifetime, s16 arg3)
if (!effect->isActive) {
effect->isActive = true;
effect->pos = *pos;
- effect->pos.x += randPlusMinusPoint5Scaled(50.0f);
- effect->pos.z += randPlusMinusPoint5Scaled(50.0f);
+ effect->pos.x += Rand_CenteredFloat(50.0f);
+ effect->pos.z += Rand_CenteredFloat(50.0f);
effect->timer = lifetime;
effect->alpha = 255;
effect->type = arg3;
@@ -146,9 +146,9 @@ void EnEgblock_SpawnEffect(EnEgblock* this, Vec3f* pos, s16 lifetime, s16 arg3)
effect->velocity.y = 5.0f + (10.0f * Rand_ZeroOne());
effect->velocity.z = 2.0f * (Rand_ZeroOne() - 0.5f);
effect->scale = 0.5f + (0.2f * Rand_ZeroFloat(1.0f));
- effect->rot.x = randPlusMinusPoint5Scaled(0x7530);
- effect->rot.y = randPlusMinusPoint5Scaled(0x7530);
- effect->rot.z = randPlusMinusPoint5Scaled(0x7530);
+ effect->rot.x = Rand_CenteredFloat(0x7530);
+ effect->rot.y = Rand_CenteredFloat(0x7530);
+ effect->rot.z = Rand_CenteredFloat(0x7530);
break;
}
}
diff --git a/src/overlays/actors/ovl_En_Egol/z_en_egol.c b/src/overlays/actors/ovl_En_Egol/z_en_egol.c
index c9750991a..1a54c8c33 100644
--- a/src/overlays/actors/ovl_En_Egol/z_en_egol.c
+++ b/src/overlays/actors/ovl_En_Egol/z_en_egol.c
@@ -610,8 +610,7 @@ void EnEgol_Retreat(EnEgol* this, PlayState* play) {
if ((ABS_ALT(angleToFacing) < 0x3000) && (fabsf(this->actor.world.pos.y - player->actor.world.pos.y) < 50.0f) &&
(this->actor.xzDistToPlayer < 100.0f) && (player->invincibilityTimer == 0)) {
- func_800B8D50(play, &this->actor, 2.0f, (s32)randPlusMinusPoint5Scaled(0x2000) + this->actor.world.rot.y, 5.0f,
- 0x10);
+ func_800B8D50(play, &this->actor, 2.0f, (s32)Rand_CenteredFloat(0x2000) + this->actor.world.rot.y, 5.0f, 0x10);
}
Math_Vec3f_Copy(&spawnPos, &gZeroVec3f);
if ((this->actor.world.pos.y - 50.0f) <= player->actor.world.pos.y) {
@@ -764,11 +763,11 @@ void EnEgol_Laser(EnEgol* this, PlayState* play) {
/*! @bug The following is supposed to calculate the rotation from vertical to the collision poly normal.
* However, the calculation is performed incorrectly. The correct calculation is
- * rotToNorm.x = func_80086B30(nz, ny) * 0x8000 / M_PI;
- * rotToNorm.z = func_80086B30(-nx, sqrtf(1.0f - SQ(nx))) * 0x8000 / M_PI;
+ * rotToNorm.x = Math_FAtan2F(nz, ny) * 0x8000 / M_PI;
+ * rotToNorm.z = Math_FAtan2F(-nx, sqrtf(1.0f - SQ(nx))) * 0x8000 / M_PI;
*/
- rotToNorm.x = RAD_TO_BINANG_ALT2(-func_80086B30(-nz * ny, 1.0f));
- rotToNorm.z = RAD_TO_BINANG_ALT2(func_80086B30(-nx * ny, 1.0f));
+ rotToNorm.x = RAD_TO_BINANG_ALT2(-Math_FAtan2F(-nz * ny, 1.0f));
+ rotToNorm.z = RAD_TO_BINANG_ALT2(Math_FAtan2F(-nx * ny, 1.0f));
if ((this->actor.world.pos.y - 50.0f) <= player->actor.world.pos.y) {
EnEgol_SpawnEffect(this, &hitPos, &rotToNorm, 100, 0.02f, EYEGORE_EFFECT_IMPACT);
@@ -1534,9 +1533,9 @@ void EnEgol_SpawnEffect(EnEgol* this, Vec3f* pos, Vec3s* rot, s16 lifetime, f32
effect->timer = lifetime;
effect->alpha = 255;
effect->type = type;
- effect->rot.x = randPlusMinusPoint5Scaled(0x7530);
- effect->rot.y = randPlusMinusPoint5Scaled(0x7530);
- effect->rot.z = randPlusMinusPoint5Scaled(0x7530);
+ effect->rot.x = Rand_CenteredFloat(0x7530);
+ effect->rot.y = Rand_CenteredFloat(0x7530);
+ effect->rot.z = Rand_CenteredFloat(0x7530);
if ((effect->type == EYEGORE_EFFECT_PIECE_LARGE) || (effect->type == EYEGORE_EFFECT_PIECE_SMALL)) {
effect->accel.y = -1.0f;
effect->velocity.x = 4.0f * (Rand_ZeroOne() - 0.5f);
diff --git a/src/overlays/actors/ovl_En_Elf/z_en_elf.c b/src/overlays/actors/ovl_En_Elf/z_en_elf.c
index 2bb7b6d0d..3dc6e4a72 100644
--- a/src/overlays/actors/ovl_En_Elf/z_en_elf.c
+++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.c
@@ -201,7 +201,7 @@ void func_8088C858(EnElf* this, PlayState* play) {
this->unk_244 = 1;
this->unk_248 = 128;
this->unk_254 = Rand_ZeroFloat(1.0f) + 0.5f;
- this->unk_24C = randPlusMinusPoint5Scaled(0x7FFF);
+ this->unk_24C = Rand_CenteredFloat(0x7FFF);
this->unk_26C = func_8088C9CC;
}
}
@@ -216,7 +216,7 @@ void func_8088C920(EnElf* this, PlayState* play) {
this->unk_244 = 1;
this->unk_248 = 128;
this->unk_254 = Rand_ZeroFloat(1.0f) + 0.5f;
- this->unk_24C = randPlusMinusPoint5Scaled(0x7FFF);
+ this->unk_24C = Rand_CenteredFloat(0x7FFF);
this->unk_26C = func_8088C9CC;
}
}
@@ -264,7 +264,7 @@ void func_8088C9CC(EnElf* this, PlayState* play) {
this->unk_244 = 1;
this->unk_248 = 128;
this->unk_254 = Rand_ZeroFloat(0.5f) + 0.5f;
- this->unk_24C = randPlusMinusPoint5Scaled(0x7FFF);
+ this->unk_24C = Rand_CenteredFloat(0x7FFF);
}
}
@@ -293,7 +293,7 @@ void func_8088CC48(EnElf* this, PlayState* play) {
this->unk_246 = 0;
this->unk_24A = (s32)Rand_ZeroFloat(1048.0f) + 0x200;
this->unk_224 = this->actor.world.pos;
- this->unk_258 = randPlusMinusPoint5Scaled(0x7FFF);
+ this->unk_258 = Rand_CenteredFloat(0x7FFF);
this->unk_26C = func_8088C9CC;
func_8088CBAC(this, play);
this->unk_25C = 0;
@@ -1247,9 +1247,9 @@ void func_8088F5F4(EnElf* this, PlayState* play, s32 sparkleLife) {
Color_RGBA8 envColor;
if (!(this->fairyFlags & 8)) {
- sparklePos.x = randPlusMinusPoint5Scaled(6.0f) + this->actor.world.pos.x;
+ sparklePos.x = Rand_CenteredFloat(6.0f) + this->actor.world.pos.x;
sparklePos.y = (Rand_ZeroOne() * 6.0f) + this->actor.world.pos.y;
- sparklePos.z = randPlusMinusPoint5Scaled(6.0f) + this->actor.world.pos.z;
+ sparklePos.z = Rand_CenteredFloat(6.0f) + this->actor.world.pos.z;
primColor.r = this->innerColor.r;
primColor.g = this->innerColor.g;
diff --git a/src/overlays/actors/ovl_En_Elfbub/z_en_elfbub.c b/src/overlays/actors/ovl_En_Elfbub/z_en_elfbub.c
index e2a5f69e3..2584a1c73 100644
--- a/src/overlays/actors/ovl_En_Elfbub/z_en_elfbub.c
+++ b/src/overlays/actors/ovl_En_Elfbub/z_en_elfbub.c
@@ -66,7 +66,7 @@ void EnElfbub_Init(Actor* thisx, PlayState* play) {
Actor_SetScale(&this->actor, 1.25f);
this->actionFunc = EnElfbub_Idle;
- this->zRot = randPlusMinusPoint5Scaled(0x10000);
+ this->zRot = Rand_CenteredFloat(0x10000);
this->zRotDelta = 1000;
this->xScale = 0.08f;
diff --git a/src/overlays/actors/ovl_En_Elfgrp/z_en_elfgrp.c b/src/overlays/actors/ovl_En_Elfgrp/z_en_elfgrp.c
index a3f17f605..cacef3f4d 100644
--- a/src/overlays/actors/ovl_En_Elfgrp/z_en_elfgrp.c
+++ b/src/overlays/actors/ovl_En_Elfgrp/z_en_elfgrp.c
@@ -262,8 +262,8 @@ void func_80A39DC8(EnElfgrp* this, PlayState* play, s32 arg2, s32 arg3) {
}
for (i = 0; i < arg2; i++) {
- elforg = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ELFORG, randPlusMinusPoint5Scaled(20.0f) + sp6C.x, sp6C.y,
- randPlusMinusPoint5Scaled(20.0f) + sp6C.z, 0, 0, 0, params);
+ elforg = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ELFORG, Rand_CenteredFloat(20.0f) + sp6C.x, sp6C.y,
+ Rand_CenteredFloat(20.0f) + sp6C.z, 0, 0, 0, params);
if (elforg == NULL) {
continue;
}
diff --git a/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c b/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c
index 05351cd3f..9b65ae2a6 100644
--- a/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c
+++ b/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c
@@ -58,7 +58,7 @@ void EnElforg_InitializeParams(EnElforg* this) {
this->actor.speed = 1.0f;
this->targetSpeedXZ = 1.0f;
this->actor.velocity.y = 0.0f;
- this->actor.world.rot.y = randPlusMinusPoint5Scaled(0x10000);
+ this->actor.world.rot.y = Rand_CenteredFloat(0x10000);
this->timer = 0;
this->secondaryTimer = Rand_ZeroFloat(100.0f);
this->actor.shape.yOffset = 0.0f;
@@ -176,9 +176,9 @@ void EnElforg_SpawnSparkles(EnElforg* this, PlayState* play, s32 life) {
s32 pad;
s32 index;
- pos.x = randPlusMinusPoint5Scaled(6.0f) + this->actor.world.pos.x;
+ pos.x = Rand_CenteredFloat(6.0f) + this->actor.world.pos.x;
pos.y = (Rand_ZeroOne() * 6.0f) + this->actor.world.pos.y + (this->actor.shape.yOffset * this->actor.scale.y);
- pos.z = randPlusMinusPoint5Scaled(6.0f) + this->actor.world.pos.z;
+ pos.z = Rand_CenteredFloat(6.0f) + this->actor.world.pos.z;
index = (this->area < STRAY_FAIRY_AREA_CLOCK_TOWN || this->area >= STRAY_FAIRY_AREA_MAX)
? STRAY_FAIRY_AREA_CLOCK_TOWN
: this->area;
diff --git a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c
index 834a6449f..3d8224039 100644
--- a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c
+++ b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c
@@ -102,15 +102,15 @@ void EnEncount1_SpawnActor(EnEncount1* this, PlayState* play) {
this->timer = 0;
switch (this->type) {
case EN_ENCOUNT1_GRASSHOPPER:
- scale = randPlusMinusPoint5Scaled(40.0f) + 200.0f;
+ scale = Rand_CenteredFloat(40.0f) + 200.0f;
rotY = player->actor.shape.rot.y;
if (this->spawnActiveCount & 1) {
rotY = -rotY;
- scale = randPlusMinusPoint5Scaled(20.0f) + 100.0f;
+ scale = Rand_CenteredFloat(20.0f) + 100.0f;
}
- spawnPos.x = player->actor.world.pos.x + (Math_SinS(rotY) * scale) + randPlusMinusPoint5Scaled(40.0f);
+ spawnPos.x = player->actor.world.pos.x + (Math_SinS(rotY) * scale) + Rand_CenteredFloat(40.0f);
spawnPos.y = player->actor.floorHeight + 120.0f;
- spawnPos.z = player->actor.world.pos.z + (Math_CosS(rotY) * scale) + randPlusMinusPoint5Scaled(40.0f);
+ spawnPos.z = player->actor.world.pos.z + (Math_CosS(rotY) * scale) + Rand_CenteredFloat(40.0f);
floorHeight = BgCheck_EntityRaycastFloor5(&play->colCtx, &floorPoly, &bgId, &this->actor, &spawnPos);
if ((floorHeight <= BGCHECK_Y_MIN) ||
((player->actor.depthInWater != BGCHECK_Y_MIN) &&
@@ -125,11 +125,11 @@ void EnEncount1_SpawnActor(EnEncount1* this, PlayState* play) {
break;
case EN_ENCOUNT1_SKULLFISH:
- scale = randPlusMinusPoint5Scaled(250.0f) + 500.0f;
+ scale = Rand_CenteredFloat(250.0f) + 500.0f;
rotY = player->actor.shape.rot.y;
- spawnPos.x = player->actor.world.pos.x + (Math_SinS(rotY) * scale) + randPlusMinusPoint5Scaled(40.0f);
+ spawnPos.x = player->actor.world.pos.x + (Math_SinS(rotY) * scale) + Rand_CenteredFloat(40.0f);
spawnPos.y = player->actor.world.pos.y - Rand_ZeroFloat(20.0f);
- spawnPos.z = player->actor.world.pos.z + (Math_CosS(rotY) * scale) + randPlusMinusPoint5Scaled(40.0f);
+ spawnPos.z = player->actor.world.pos.z + (Math_CosS(rotY) * scale) + Rand_CenteredFloat(40.0f);
floorHeight = BgCheck_EntityRaycastFloor5(&play->colCtx, &floorPoly, &bgId, &this->actor, &spawnPos);
if (!(player->stateFlags1 & PLAYER_STATE1_8000000) || (floorHeight <= BGCHECK_Y_MIN) ||
(player->actor.depthInWater < floorHeight)) {
diff --git a/src/overlays/actors/ovl_En_Encount4/z_en_encount4.c b/src/overlays/actors/ovl_En_Encount4/z_en_encount4.c
index 972d038ae..5e28850c6 100644
--- a/src/overlays/actors/ovl_En_Encount4/z_en_encount4.c
+++ b/src/overlays/actors/ovl_En_Encount4/z_en_encount4.c
@@ -171,8 +171,8 @@ void func_809C42A8(EnEncount4* this, PlayState* play) {
if (this->unk_14C != 0) {
yRot += 0x8000;
}
- pos.x += Math_SinS(yRot) * (40.0f + randPlusMinusPoint5Scaled(40.0f));
- pos.z += Math_CosS(yRot) * (40.0f + randPlusMinusPoint5Scaled(40.0f));
+ pos.x += Math_SinS(yRot) * (40.0f + Rand_CenteredFloat(40.0f));
+ pos.z += Math_CosS(yRot) * (40.0f + Rand_CenteredFloat(40.0f));
if (Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_SKB, pos.x, pos.y, pos.z, 0, 0, 0,
ENSKB_PARAM_0) != NULL) {
this->unk_14C++;
diff --git a/src/overlays/actors/ovl_En_Estone/z_en_estone.c b/src/overlays/actors/ovl_En_Estone/z_en_estone.c
index 85d0527fa..64bfdaecc 100644
--- a/src/overlays/actors/ovl_En_Estone/z_en_estone.c
+++ b/src/overlays/actors/ovl_En_Estone/z_en_estone.c
@@ -64,10 +64,10 @@ void EnEstone_Init(Actor* thisx, PlayState* play) {
s32 pad;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 15.0f);
- this->rotVel.x = this->rotVel.y = this->rotVel.z = randPlusMinusPoint5Scaled(1.0f) * 20.0f;
+ this->rotVel.x = this->rotVel.y = this->rotVel.z = Rand_CenteredFloat(1.0f) * 20.0f;
Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
- this->actor.world.rot.y += (s16)randPlusMinusPoint5Scaled(0x2710);
+ this->actor.world.rot.y += (s16)(s32)Rand_CenteredFloat(0x2710);
this->actor.shape.rot.y = this->actor.world.rot.y;
if (this->actor.params == ENESTONE_TYPE_LARGE) {
@@ -224,9 +224,9 @@ void EnEstone_SpawnEffect(EnEstone* this, Vec3f* pos, Vec3f* velocity, Vec3f* ac
effect->accel = *accel;
effect->scale = scale;
effect->timer = lifetime;
- effect->rot.x = randPlusMinusPoint5Scaled(0x7530);
- effect->rot.y = randPlusMinusPoint5Scaled(0x7530);
- effect->rot.z = randPlusMinusPoint5Scaled(0x7530);
+ effect->rot.x = Rand_CenteredFloat(0x7530);
+ effect->rot.y = Rand_CenteredFloat(0x7530);
+ effect->rot.z = Rand_CenteredFloat(0x7530);
break;
}
}
diff --git a/src/overlays/actors/ovl_En_Fall/z_en_fall.c b/src/overlays/actors/ovl_En_Fall/z_en_fall.c
index 2f226e61c..03989b01f 100644
--- a/src/overlays/actors/ovl_En_Fall/z_en_fall.c
+++ b/src/overlays/actors/ovl_En_Fall/z_en_fall.c
@@ -662,16 +662,16 @@ s32 EnFall_RisingDebris_InitializeEffect(EnFall* this) {
debrisEffects[i].pos.x = this->actor.world.pos.x;
debrisEffects[i].pos.y = this->actor.world.pos.y;
debrisEffects[i].pos.z = this->actor.world.pos.z;
- angle = randPlusMinusPoint5Scaled(0x10000);
+ angle = Rand_CenteredFloat(0x10000);
scale = (1.0f - (Rand_ZeroFloat(1.0f) * Rand_ZeroFloat(1.0f))) * 3000.0f;
debrisEffects[i].pos.x += Math_SinS(angle) * scale;
debrisEffects[i].pos.z += Math_CosS(angle) * scale;
debrisEffects[i].velocity.x = 0.0f;
debrisEffects[i].velocity.z = 0.0f;
debrisEffects[i].velocity.y = 80.0f;
- debrisEffects[i].rot.x = randPlusMinusPoint5Scaled(0x10000);
- debrisEffects[i].rot.y = randPlusMinusPoint5Scaled(0x10000);
- debrisEffects[i].rot.z = randPlusMinusPoint5Scaled(0x10000);
+ debrisEffects[i].rot.x = Rand_CenteredFloat(0x10000);
+ debrisEffects[i].rot.y = Rand_CenteredFloat(0x10000);
+ debrisEffects[i].rot.z = Rand_CenteredFloat(0x10000);
this->activeDebrisEffectCount++;
return true;
}
diff --git a/src/overlays/actors/ovl_En_Famos/z_en_famos.c b/src/overlays/actors/ovl_En_Famos/z_en_famos.c
index 97d1ec357..269866ff0 100644
--- a/src/overlays/actors/ovl_En_Famos/z_en_famos.c
+++ b/src/overlays/actors/ovl_En_Famos/z_en_famos.c
@@ -265,7 +265,7 @@ void EnFamos_SetupDeathDebris(EnFamos* this) {
rock->rotation.y = (s32)Rand_Next() >> 0x10;
rock->rotation.z = (s32)Rand_Next() >> 0x10;
rock->pos.x = Math_SinS(randVelDirection) * 20.0f + this->actor.world.pos.x;
- rock->pos.y = randPlusMinusPoint5Scaled(60.0f) + (this->actor.world.pos.y + 40.0f);
+ rock->pos.y = Rand_CenteredFloat(60.0f) + (this->actor.world.pos.y + 40.0f);
rock->pos.z = Math_CosS(randVelDirection) * 20.0f + this->actor.world.pos.z;
rock->scale = Rand_ZeroFloat(0.002f) + (2.5f * 0.001f);
}
@@ -687,8 +687,8 @@ void EnFamos_DeathExplosion(EnFamos* this, PlayState* play) {
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 4);
}
- this->actor.world.pos.x = randPlusMinusPoint5Scaled(5.0f) + this->targetDest.x;
- this->actor.world.pos.z = randPlusMinusPoint5Scaled(5.0f) + this->targetDest.z;
+ this->actor.world.pos.x = Rand_CenteredFloat(5.0f) + this->targetDest.x;
+ this->actor.world.pos.z = Rand_CenteredFloat(5.0f) + this->targetDest.z;
if (this->stateTimer == 1) {
EnBom* explosion = (EnBom*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, this->actor.world.pos.x,
this->actor.world.pos.y + 40.0f, this->actor.world.pos.z,
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 b26592ac0..fd3b723d8 100644
--- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c
+++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c
@@ -301,7 +301,7 @@ void EnFirefly_FlyIdle(EnFirefly* this, PlayState* play) {
Math_ScaledStepToS(&this->actor.shape.rot.y,
Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), 0x300);
} else if (rand < 0.8f) {
- this->actor.shape.rot.y += (s16)randPlusMinusPoint5Scaled(1536.0f);
+ this->actor.shape.rot.y += (s16)(s32)Rand_CenteredFloat(0x600);
}
// Climb if too close to ground
diff --git a/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c b/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c
index ac3a4246b..923cfeef2 100644
--- a/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c
+++ b/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c
@@ -352,7 +352,7 @@ void func_80B28C14(EnFish2* this, PlayState* play) {
this->unk_2B4 = (s32)Rand_ZeroFloat(20.0f) + 10;
} else if (this->unk_2B4 == 1) {
if ((this->unk_348 == 0) || (Rand_ZeroOne() < 0.6f)) {
- this->unk_348 = randPlusMinusPoint5Scaled(0x2000);
+ this->unk_348 = Rand_CenteredFloat(0x2000);
} else {
this->unk_348 = Math_Vec3f_Pitch(&this->actor.world.pos, &this->unk_324);
if (this->unk_348 < -0x1000) {
@@ -545,8 +545,8 @@ void func_80B295A4(EnFish2* this, PlayState* play) {
Math_ApproachZeroF(&this->actor.speed, 0.3f, 0.3f);
if (this->unk_2B4 != 0) {
Math_Vec3f_Copy(&sp60, &this->unk_318);
- sp60.x += randPlusMinusPoint5Scaled(100.0f);
- sp60.z += randPlusMinusPoint5Scaled(100.0f);
+ sp60.x += Rand_CenteredFloat(100.0f);
+ sp60.z += Rand_CenteredFloat(100.0f);
for (i = 0; i < 2; i++) {
EffectSsBubble_Spawn(play, &sp60, 0.0f, 5.0f, 5.0f, Rand_ZeroFloat(this->unk_330 * 4.0f) + 0.1f);
@@ -912,10 +912,10 @@ void func_80B2A498(EnFish2* this, PlayState* play) {
for (i = 0; i < 10; i++) {
Math_Vec3f_Copy(&sp6C, &this->actor.world.pos);
- sp6C.x += randPlusMinusPoint5Scaled(70.0f);
+ sp6C.x += Rand_CenteredFloat(70.0f);
sp6C.y = this->unk_334 + 10.0f;
- sp6C.z += randPlusMinusPoint5Scaled(70.0f);
- EffectSsGSplash_Spawn(play, &sp6C, NULL, NULL, 0, (s32)randPlusMinusPoint5Scaled(50.0f) + 350);
+ sp6C.z += Rand_CenteredFloat(70.0f);
+ EffectSsGSplash_Spawn(play, &sp6C, NULL, NULL, 0, (s32)Rand_CenteredFloat(50.0f) + 350);
}
}
}
@@ -970,11 +970,11 @@ void EnFish2_Update(Actor* thisx, PlayState* play2) {
if ((play->gameplayFrames % 8) == 0) {
Math_Vec3f_Copy(&sp5C, &this->unk_324);
- sp5C.x += randPlusMinusPoint5Scaled(100.0f);
+ sp5C.x += Rand_CenteredFloat(100.0f);
sp5C.y = this->actor.floorHeight;
- sp5C.z += randPlusMinusPoint5Scaled(100.0f);
+ sp5C.z += Rand_CenteredFloat(100.0f);
- for (i = 0; i < (s32)randPlusMinusPoint5Scaled(5.0f) + 10; i++) {
+ for (i = 0; i < (s32)Rand_CenteredFloat(5.0f) + 10; i++) {
EffectSsBubble_Spawn(play, &sp5C, 0, 5.0f, 5.0f, Rand_ZeroFloat(this->unk_330 * 4.0f) + 0.1f);
}
}
@@ -1102,9 +1102,9 @@ void func_80B2ADB0(EnFish2* this, Vec3f* vec, s16 arg2) {
ptr->unk_20 = VIRTUAL_TO_PHYSICAL(SEGMENTED_TO_VIRTUAL(phi_v0));
ptr->unk_00 = true;
ptr->unk_04 = *vec;
- ptr->unk_04.x += randPlusMinusPoint5Scaled(ptr->unk_00 + (this->unk_330 * 4000.0f));
- ptr->unk_04.y += randPlusMinusPoint5Scaled(20.0f);
- ptr->unk_04.z += randPlusMinusPoint5Scaled(ptr->unk_00 + (this->unk_330 * 4000.0f));
+ ptr->unk_04.x += Rand_CenteredFloat(ptr->unk_00 + (this->unk_330 * 4000.0f));
+ ptr->unk_04.y += Rand_CenteredFloat(20.0f);
+ ptr->unk_04.z += Rand_CenteredFloat(ptr->unk_00 + (this->unk_330 * 4000.0f));
ptr->unk_18 = (this->unk_330 * 20.0f) - (Rand_ZeroFloat(5.0f) * 0.01f);
ptr->unk_1C = 0x42;
ptr->unk_10 = arg2;
diff --git a/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c b/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c
index 2ada30cba..20edbcbc2 100644
--- a/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c
+++ b/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c
@@ -1838,9 +1838,9 @@ void EnFishing_DrawLureAndLine(PlayState* play, Vec3f* linePos, Vec3f* lineRot)
dy = sLurePos.y - sRodTipPos.y;
dz = sLurePos.z - sRodTipPos.z;
- ry = func_80086B30(dx, dz);
+ ry = Math_FAtan2F(dx, dz);
dist = sqrtf(SQ(dx) + SQ(dz));
- rx = -func_80086B30(dy, dist);
+ rx = -Math_FAtan2F(dy, dist);
dist = sqrtf(SQ(dx) + SQ(dy) + SQ(dz)) * 0.001f;
@@ -1865,9 +1865,9 @@ void EnFishing_DrawLureAndLine(PlayState* play, Vec3f* linePos, Vec3f* lineRot)
dy = D_80917218.y - (linePos + i)->y;
dz = D_80917218.z - (linePos + i)->z;
- ry = func_80086B30(dx, dz);
+ ry = Math_FAtan2F(dx, dz);
dist = sqrtf(SQ(dx) + SQ(dz));
- rx = -func_80086B30(dy, dist);
+ rx = -Math_FAtan2F(dy, dist);
dist = sqrtf(SQ(dx) + SQ(dy) + SQ(dz)) * 0.001f;
@@ -3003,9 +3003,9 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
this->actor.shape.rot.y = -0x8000;
if ((this->actor.projectedPos.z < 200.0f) && (this->actor.projectedPos.z > 0.0f)) {
- spC4.x = randPlusMinusPoint5Scaled(5.0f) + 130.0f;
+ spC4.x = Rand_CenteredFloat(5.0f) + 130.0f;
spC4.y = 40.0f;
- spC4.z = randPlusMinusPoint5Scaled(5.0f) + 1280.0f;
+ spC4.z = Rand_CenteredFloat(5.0f) + 1280.0f;
EnFishing_SpawnBubble(NULL, play->specialEffects, &spC4, Rand_ZeroFloat(0.02f) + 0.03f, 1);
}
@@ -3080,9 +3080,9 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
} else {
this->unk_150 = 1;
this->unk_172[0] = Rand_ZeroFloat(30.0f) + 10.0f;
- this->unk_1AC.x = randPlusMinusPoint5Scaled(300.0f);
+ this->unk_1AC.x = Rand_CenteredFloat(300.0f);
this->unk_1AC.y = (WATER_SURFACE_Y(play) - 50.0f) - Rand_ZeroFloat(50.0f);
- this->unk_1AC.z = randPlusMinusPoint5Scaled(300.0f);
+ this->unk_1AC.z = Rand_CenteredFloat(300.0f);
this->unk_188 = 1.0f;
this->unk_18C = 2000.0f;
}
@@ -3144,8 +3144,8 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
Math_ApproachF(&this->unk_1A8, 4096.0f, 1.0f, 256.0f);
if ((play->gameplayFrames % 32) == 0) {
- this->unk_1AC.x = randPlusMinusPoint5Scaled(600.0f);
- this->unk_1AC.z = randPlusMinusPoint5Scaled(600.0f);
+ this->unk_1AC.x = Rand_CenteredFloat(600.0f);
+ this->unk_1AC.z = Rand_CenteredFloat(600.0f);
this->unk_1AC.y = -120.0f;
}
} else if (sp124 > 50.0f) {
@@ -3600,7 +3600,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
for (spA2 = 0; spA2 < 100; spA2++) {
- Matrix_RotateYF(randPlusMinusPoint5Scaled(0.75f * M_PI) +
+ Matrix_RotateYF(Rand_CenteredFloat(0.75f * M_PI) +
BINANG_TO_RAD_ALT(this->actor.yawTowardsPlayer + 0x8000),
MTXMODE_NEW);
Matrix_MultVec3f(&sp10C, &sp100);
@@ -4067,7 +4067,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
func_80903C60(this, 1);
this->unk_17C = this->actor.velocity.y;
this->actor.velocity.y = 0.0f;
- this->unk_162 = randPlusMinusPoint5Scaled(32768.0f);
+ this->unk_162 = (s16)(s32)Rand_CenteredFloat(0x8000);
} else if ((this->actor.world.pos.y < WATER_SURFACE_Y(play)) &&
(this->actor.prevPos.y >= WATER_SURFACE_Y(play))) {
if (this->unk_17C < -5.0f) {
@@ -4128,10 +4128,10 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
if (Rand_ZeroOne() < 0.5f) {
this->unk_15E = 0;
} else {
- this->unk_15E = (s16)randPlusMinusPoint5Scaled(32.0f) + 0x8000;
+ this->unk_15E = (s16)(s32)Rand_CenteredFloat(0x20) + 0x8000;
}
- this->unk_160 = (s16)randPlusMinusPoint5Scaled(16384.0f);
+ this->unk_160 = (s16)(s32)Rand_CenteredFloat(0x4000);
this->unk_188 = 1.0f;
this->unk_18C = 5000.0f;
this->unk_194 = 5000.0f;
@@ -4141,8 +4141,8 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
if ((this->unk_150 == 5) && !(this->unk_154 & 1)) {
Vec3f pos;
- pos.x = randPlusMinusPoint5Scaled(10.0f) + this->actor.world.pos.x;
- pos.z = randPlusMinusPoint5Scaled(10.0f) + this->actor.world.pos.z;
+ pos.x = Rand_CenteredFloat(10.0f) + this->actor.world.pos.x;
+ pos.z = Rand_CenteredFloat(10.0f) + this->actor.world.pos.z;
pos.y = this->actor.floorHeight + 5.0f;
EnFishing_SpawnWaterDust(&this->actor.projectedPos, play->specialEffects, &pos,
(this->unk_1A4 * 0.005f) + 0.15f);
@@ -4160,9 +4160,9 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
this->unk_1CA--;
for (i = 0; i < 2; i++) {
- pos.x = randPlusMinusPoint5Scaled(range) + this->actor.world.pos.x;
- pos.y = randPlusMinusPoint5Scaled(range) + this->actor.world.pos.y;
- pos.z = randPlusMinusPoint5Scaled(range) + this->actor.world.pos.z;
+ pos.x = Rand_CenteredFloat(range) + this->actor.world.pos.x;
+ pos.y = Rand_CenteredFloat(range) + this->actor.world.pos.y;
+ pos.z = Rand_CenteredFloat(range) + this->actor.world.pos.z;
EnFishing_SpawnBubble(&this->actor.projectedPos, play->specialEffects, &pos, Rand_ZeroFloat(0.035f) + 0.04f,
0);
}
@@ -4568,14 +4568,14 @@ void EnFishing_UpdateGroupFishes(PlayState* play) {
spD6 = Math_Atan2S_XY(dist, dy);
if ((dist < 10.0f) || (((fish->timer % 32) == 0) && (Rand_ZeroOne() > 0.5f))) {
- fish->unk_10.y = basePos[groupIndex].y + randPlusMinusPoint5Scaled(10.0f);
+ fish->unk_10.y = basePos[groupIndex].y + Rand_CenteredFloat(10.0f);
if (D_8090CF18 != 0) {
- fish->unk_10.x = basePos[groupIndex].x + randPlusMinusPoint5Scaled(200.0f);
- fish->unk_10.z = basePos[groupIndex].z + randPlusMinusPoint5Scaled(200.0f);
+ fish->unk_10.x = basePos[groupIndex].x + Rand_CenteredFloat(200.0f);
+ fish->unk_10.z = basePos[groupIndex].z + Rand_CenteredFloat(200.0f);
} else {
- fish->unk_10.x = basePos[groupIndex].x + randPlusMinusPoint5Scaled(100.0f);
- fish->unk_10.z = basePos[groupIndex].z + randPlusMinusPoint5Scaled(100.0f);
+ fish->unk_10.x = basePos[groupIndex].x + Rand_CenteredFloat(100.0f);
+ fish->unk_10.z = basePos[groupIndex].z + Rand_CenteredFloat(100.0f);
}
ripplePos = fish->pos;
@@ -5460,8 +5460,8 @@ void EnFishing_UpdateOwner(Actor* thisx, PlayState* play2) {
((play->gameplayFrames % 2) == 0)) {
Vec3f pos;
- pos.x = randPlusMinusPoint5Scaled(20.0f) + player->actor.world.pos.x;
- pos.z = randPlusMinusPoint5Scaled(20.0f) + player->actor.world.pos.z;
+ pos.x = Rand_CenteredFloat(20.0f) + player->actor.world.pos.x;
+ pos.z = Rand_CenteredFloat(20.0f) + player->actor.world.pos.z;
pos.y = player->actor.floorHeight + 5.0f;
EnFishing_SpawnWaterDust(NULL, play->specialEffects, &pos, 0.5f);
}
@@ -5552,9 +5552,9 @@ void EnFishing_UpdateOwner(Actor* thisx, PlayState* play2) {
rot.z = (Camera_GetInputDirYaw(mainCam) * -(M_PI / 0x8000)) + rot.y;
for (i = 0; i < (u8)D_8090CCD0; i++) {
- pos.x = randPlusMinusPoint5Scaled(700.0f) + play->view.eye.x;
+ pos.x = Rand_CenteredFloat(700.0f) + play->view.eye.x;
pos.y = (Rand_ZeroFloat(100.0f) + 150.0f) - 170.0f;
- pos.z = randPlusMinusPoint5Scaled(700.0f) + play->view.eye.z;
+ pos.z = Rand_CenteredFloat(700.0f) + play->view.eye.z;
if (pos.z < 1160.0f) {
SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &pos, &projectedPos, &sProjectedW);
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 150f3c8c1..71f980d47 100644
--- a/src/overlays/actors/ovl_En_Fz/z_en_fz.c
+++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.c
@@ -306,14 +306,14 @@ void func_809328F4(EnFz* this, PlayState* play, Vec3f* arg2, s32 arg3, f32 arg4)
sp88.b = 200;
for (i = 0; i < arg3; i++) {
- temp_f24 = randPlusMinusPoint5Scaled(0.3f) + 0.6f;
- temp_s1 = (s32)randPlusMinusPoint5Scaled(5.0f) + 12;
- spA8.x = randPlusMinusPoint5Scaled(arg4) + arg2->x;
+ temp_f24 = Rand_CenteredFloat(0.3f) + 0.6f;
+ temp_s1 = (s32)Rand_CenteredFloat(5.0f) + 12;
+ spA8.x = Rand_CenteredFloat(arg4) + arg2->x;
spA8.y = Rand_ZeroFloat(arg4) + arg2->y;
- spA8.z = randPlusMinusPoint5Scaled(arg4) + arg2->z;
- sp9C.x = randPlusMinusPoint5Scaled(10.0f);
+ spA8.z = Rand_CenteredFloat(arg4) + arg2->z;
+ sp9C.x = Rand_CenteredFloat(10.0f);
sp9C.y = Rand_ZeroFloat(10.0f) + 2.0f;
- sp9C.z = randPlusMinusPoint5Scaled(10.0f);
+ sp9C.z = Rand_CenteredFloat(10.0f);
EffectSsEnIce_Spawn(play, &spA8, temp_f24, &sp9C, &sp90, &sp8C, &sp88, temp_s1);
}
@@ -329,9 +329,9 @@ void func_80932AF4(EnFz* this) {
Vec3f sp2C;
if (!(this->unk_BC6 & 0xF)) {
- sp44.x = randPlusMinusPoint5Scaled(40.0f) + this->actor.world.pos.x;
- sp44.y = randPlusMinusPoint5Scaled(40.0f) + this->actor.world.pos.y + 30.0f;
- sp44.z = randPlusMinusPoint5Scaled(40.0f) + this->actor.world.pos.z;
+ sp44.x = Rand_CenteredFloat(40.0f) + this->actor.world.pos.x;
+ sp44.y = Rand_CenteredFloat(40.0f) + this->actor.world.pos.y + 30.0f;
+ sp44.z = Rand_CenteredFloat(40.0f) + this->actor.world.pos.z;
sp2C.x = sp2C.z = 0.0f;
sp2C.y = 0.1f;
sp38.x = sp38.y = sp38.z = 0.0f;
@@ -345,9 +345,9 @@ void func_80932BD4(EnFz* this) {
Vec3f sp2C;
if (!(this->unk_BC6 & 3)) {
- sp44.x = randPlusMinusPoint5Scaled(40.0f) + this->actor.world.pos.x;
+ sp44.x = Rand_CenteredFloat(40.0f) + this->actor.world.pos.x;
sp44.y = this->unk_BB4;
- sp44.z = randPlusMinusPoint5Scaled(40.0f) + this->actor.world.pos.z;
+ sp44.z = Rand_CenteredFloat(40.0f) + this->actor.world.pos.z;
sp2C.x = sp2C.z = 0.0f;
sp2C.y = 0.1f;
sp38.x = sp38.y = sp38.z = 0.0f;
diff --git a/src/overlays/actors/ovl_En_Gg2/z_en_gg2.c b/src/overlays/actors/ovl_En_Gg2/z_en_gg2.c
index e05945680..3540b1a24 100644
--- a/src/overlays/actors/ovl_En_Gg2/z_en_gg2.c
+++ b/src/overlays/actors/ovl_En_Gg2/z_en_gg2.c
@@ -310,7 +310,7 @@ s32 func_80B3B648(EnGg2* this, Path* path, s32 arg2_) {
phi_f14 = points[arg2 + 1].z - points[arg2 - 1].z;
}
- func_8017B7F8(&sp30, RAD_TO_BINANG(func_80086B30(phi_f12, phi_f14)), &sp44, &sp40, &sp3C);
+ func_8017B7F8(&sp30, RAD_TO_BINANG(Math_FAtan2F(phi_f12, phi_f14)), &sp44, &sp40, &sp3C);
if (((this->actor.world.pos.x * sp44) + (sp40 * this->actor.world.pos.z) + sp3C) > 0.0f) {
ret = true;
diff --git a/src/overlays/actors/ovl_En_Gk/z_en_gk.c b/src/overlays/actors/ovl_En_Gk/z_en_gk.c
index 8692f937c..1db4d7c5b 100644
--- a/src/overlays/actors/ovl_En_Gk/z_en_gk.c
+++ b/src/overlays/actors/ovl_En_Gk/z_en_gk.c
@@ -374,7 +374,7 @@ s32 func_80B50C78(EnGk* this, Path* path, s32 arg2_) {
phi_f14 = sp5C[arg2 + 1].z - sp5C[arg2 - 1].z;
}
- func_8017B7F8(&sp30, RAD_TO_BINANG(func_80086B30(phi_f12, phi_f14)), &sp44, &sp40, &sp3C);
+ func_8017B7F8(&sp30, RAD_TO_BINANG(Math_FAtan2F(phi_f12, phi_f14)), &sp44, &sp40, &sp3C);
if (((this->actor.world.pos.x * sp44) + (sp40 * this->actor.world.pos.z) + sp3C) > 0.0f) {
ret = true;
diff --git a/src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.c b/src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.c
index 7fbed6122..bfd2d19ab 100644
--- a/src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.c
+++ b/src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.c
@@ -246,7 +246,7 @@ void EnGrasshopper_Init(Actor* thisx, PlayState* play) {
this->type;
}
- this->baseFlyHeight = randPlusMinusPoint5Scaled(50.0f) + this->flyingHomePos.y;
+ this->baseFlyHeight = Rand_CenteredFloat(50.0f) + this->flyingHomePos.y;
EnGrasshopper_SetupFly(this);
}
@@ -343,7 +343,7 @@ void EnGrasshopper_DecideAction(EnGrasshopper* this, PlayState* play) {
void EnGrasshopper_SetupFly(EnGrasshopper* this) {
EnGrasshopper_ChangeAnim(this, EN_GRASSHOPPER_ANIM_FLY);
- this->baseFlyHeight = randPlusMinusPoint5Scaled(50.0f) + this->flyingHomePos.y;
+ this->baseFlyHeight = Rand_CenteredFloat(50.0f) + this->flyingHomePos.y;
this->action = EN_GRASSHOPPER_ACTION_FLY;
this->actionFunc = EnGrasshopper_Fly;
}
@@ -384,7 +384,7 @@ void EnGrasshopper_Fly(EnGrasshopper* this, PlayState* play) {
}
if (this->shouldTurn) {
- this->baseFlyHeight = randPlusMinusPoint5Scaled(50.0f) + this->flyingHomePos.y;
+ this->baseFlyHeight = Rand_CenteredFloat(50.0f) + this->flyingHomePos.y;
this->targetRot.y = Math_Atan2S(diffX, diffZ);
this->timer = Rand_S16Offset(30, 30);
}
@@ -412,7 +412,7 @@ void EnGrasshopper_Fly(EnGrasshopper* this, PlayState* play) {
this->targetRot.y = Math_Atan2S(diffX, diffZ);
this->timer = Rand_S16Offset(30, 70);
- this->baseFlyHeight = randPlusMinusPoint5Scaled(50.0f) + this->flyingHomePos.y;
+ this->baseFlyHeight = Rand_CenteredFloat(50.0f) + this->flyingHomePos.y;
}
}
}
@@ -441,7 +441,7 @@ void EnGrasshopper_RoamInCircles(EnGrasshopper* this, PlayState* play) {
this->baseFlyHeight = Math_SinS(this->bobPhase) * 10.0f;
if (this->timer == 0) {
- this->baseFlyHeight = randPlusMinusPoint5Scaled(10.0f);
+ this->baseFlyHeight = Rand_CenteredFloat(10.0f);
this->timer = Rand_S16Offset(30, 30);
}
@@ -583,8 +583,8 @@ void EnGrasshopper_ApproachPlayer(EnGrasshopper* this, PlayState* play) {
if ((this->splashCount < 3) || !(play->gameplayFrames % 8)) {
this->splashCount++;
Math_Vec3f_Copy(&splashPos, &this->tailTipPos);
- splashPos.x += randPlusMinusPoint5Scaled(20.0f);
- splashPos.z += randPlusMinusPoint5Scaled(20.0f);
+ splashPos.x += Rand_CenteredFloat(20.0f);
+ splashPos.z += Rand_CenteredFloat(20.0f);
EffectSsGSplash_Spawn(play, &splashPos, NULL, NULL, 0, (((s32)Rand_ZeroOne() * 100) + 400));
SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 50, NA_SE_EV_BOMB_DROP_WATER);
}
@@ -633,8 +633,8 @@ void EnGrasshopper_Attack(EnGrasshopper* this, PlayState* play) {
if ((this->splashCount < 3) || !(play->gameplayFrames % 8)) {
this->splashCount++;
Math_Vec3f_Copy(&splashPos, &this->tailTipPos);
- splashPos.x += randPlusMinusPoint5Scaled(20.0f);
- splashPos.z += randPlusMinusPoint5Scaled(20.0f);
+ splashPos.x += Rand_CenteredFloat(20.0f);
+ splashPos.z += Rand_CenteredFloat(20.0f);
EffectSsGSplash_Spawn(play, &splashPos, NULL, NULL, 0, ((s32)Rand_ZeroOne() * 100) + 400);
SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 50, NA_SE_EV_BOMB_DROP_WATER);
}
@@ -796,8 +796,8 @@ void EnGrasshopper_Fall(EnGrasshopper* this, PlayState* play) {
for (i = 0; i < 3; i++) {
Math_Vec3f_Copy(&splashPos, &this->actor.world.pos);
- splashPos.x += randPlusMinusPoint5Scaled((i * 5.0f) + 20.0f);
- splashPos.z += randPlusMinusPoint5Scaled((i * 5.0f) + 20.0f);
+ splashPos.x += Rand_CenteredFloat((i * 5.0f) + 20.0f);
+ splashPos.z += Rand_CenteredFloat((i * 5.0f) + 20.0f);
EffectSsGSplash_Spawn(play, &splashPos, NULL, NULL, 0, (((s32)Rand_ZeroOne() * 100) + 400));
}
@@ -826,7 +826,7 @@ void EnGrasshopper_Fall(EnGrasshopper* this, PlayState* play) {
for (i = 0; i < ARRAY_COUNT(sFireVelocityAndAccel); i++) {
Math_Vec3f_Copy(&firePos, &this->actor.world.pos);
- firePos.x += randPlusMinusPoint5Scaled(30.0f);
+ firePos.x += Rand_CenteredFloat(30.0f);
if (!isUnderWater) {
firePos.y = this->actor.floorHeight;
} else if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z,
@@ -834,7 +834,7 @@ void EnGrasshopper_Fall(EnGrasshopper* this, PlayState* play) {
firePos.y = waterSurface;
}
- firePos.z += randPlusMinusPoint5Scaled(30.0f);
+ firePos.z += Rand_CenteredFloat(30.0f);
func_800B3030(play, &firePos, &sFireVelocityAndAccel[i], &sFireVelocityAndAccel[i], 100, 0, 2);
}
@@ -1062,10 +1062,10 @@ void EnGrasshopper_InitializeEffect(EnGrasshopper* this, Vec3f* pos) {
effect->isEnabled = true;
effect->pos = *pos;
effect->timer = 10;
- effect->velocity.x = randPlusMinusPoint5Scaled(20.0f);
- effect->velocity.y = randPlusMinusPoint5Scaled(20.0f);
- effect->velocity.z = randPlusMinusPoint5Scaled(20.0f);
- effect->yaw = randPlusMinusPoint5Scaled(30000.0f);
+ effect->velocity.x = Rand_CenteredFloat(20.0f);
+ effect->velocity.y = Rand_CenteredFloat(20.0f);
+ effect->velocity.z = Rand_CenteredFloat(20.0f);
+ effect->yaw = Rand_CenteredFloat(30000.0f);
return;
}
}
diff --git a/src/overlays/actors/ovl_En_Gs/z_en_gs.c b/src/overlays/actors/ovl_En_Gs/z_en_gs.c
index d8004bef8..6f6f2cad9 100644
--- a/src/overlays/actors/ovl_En_Gs/z_en_gs.c
+++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.c
@@ -815,9 +815,9 @@ s32 func_809995A4(EnGs* this, PlayState* play) {
Vec3f sp60;
for (i = 0; i < 3; i++) {
- sp60.x = randPlusMinusPoint5Scaled(15.0f);
+ sp60.x = Rand_CenteredFloat(15.0f);
sp60.y = Rand_ZeroFloat(-1.0f);
- sp60.z = randPlusMinusPoint5Scaled(15.0f);
+ sp60.z = Rand_CenteredFloat(15.0f);
sp6C.x = this->actor.world.pos.x + (2.0f * sp60.x);
sp6C.y = this->actor.world.pos.y + 7.0f;
diff --git a/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c b/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c
index bcc5882a2..f5885b3cf 100644
--- a/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c
+++ b/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c
@@ -265,7 +265,7 @@ void func_80B22500(EnHakurock* this, PlayState* play) {
if (this->counter > 0) {
this->counter--;
if ((this->counter & 1) == 0) {
- this->actor.world.pos.y = (sin_rad(this->counter * (M_PI / 20)) * 4.0f) + this->actor.floorHeight;
+ this->actor.world.pos.y = (Math_SinF(this->counter * (M_PI / 20)) * 4.0f) + this->actor.floorHeight;
} else {
this->actor.world.pos.y = this->actor.floorHeight;
}
diff --git a/src/overlays/actors/ovl_En_Hanabi/z_en_hanabi.c b/src/overlays/actors/ovl_En_Hanabi/z_en_hanabi.c
index ce60a0187..4294a8320 100644
--- a/src/overlays/actors/ovl_En_Hanabi/z_en_hanabi.c
+++ b/src/overlays/actors/ovl_En_Hanabi/z_en_hanabi.c
@@ -107,9 +107,9 @@ void func_80B22E0C(EnHanabiStruct* arg0) {
arg0->unk_20.y *= arg0->unk_14.x;
arg0->unk_20.y -= 1.0f;
- arg0->unk_20.x += randPlusMinusPoint5Scaled(0.8f);
- arg0->unk_20.y += randPlusMinusPoint5Scaled(0.8f);
- arg0->unk_20.z += randPlusMinusPoint5Scaled(0.8f);
+ arg0->unk_20.x += Rand_CenteredFloat(0.8f);
+ arg0->unk_20.y += Rand_CenteredFloat(0.8f);
+ arg0->unk_20.z += Rand_CenteredFloat(0.8f);
if (arg0->unk_01 > 0) {
arg0->unk_01--;
@@ -286,10 +286,10 @@ void func_80B236C8(EnHanabi* this, PlayState* play) {
}
sp34.x += sp30 * Math_SinS(this->actor.home.rot.y);
- sp34.y += randPlusMinusPoint5Scaled(300.0f);
+ sp34.y += Rand_CenteredFloat(300.0f);
sp34.z += sp30 * Math_CosS(this->actor.home.rot.y);
- if (this->actor.home.rot.x >= 0x259) {
+ if (this->actor.home.rot.x > 0x258) {
sp28 = func_80B22C80(&sp34, this->unk_148, 2.0f);
} else {
sp28 = func_80B22C80(&sp34, this->unk_148, 1.0f);
diff --git a/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.c b/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.c
index e0f9301ce..8ad694a11 100644
--- a/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.c
+++ b/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.c
@@ -173,8 +173,8 @@ void func_80BDB2B8(EnHiddenNuts* this, PlayState* play) {
Math_Vec3f_Copy(&sp74, &this->actor.world.pos);
- sp74.x += randPlusMinusPoint5Scaled(15.0f);
- sp74.z += randPlusMinusPoint5Scaled(15.0f);
+ sp74.x += Rand_CenteredFloat(15.0f);
+ sp74.z += Rand_CenteredFloat(15.0f);
EffectSsDtBubble_SpawnCustomColor(play, &sp74, &sp94, &sp88, &sp84, &sp80, Rand_S16Offset(120, 90), 30,
true);
@@ -216,8 +216,8 @@ void func_80BDB59C(EnHiddenNuts* this, PlayState* play) {
Math_Vec3f_Copy(&sp78, &this->actor.world.pos);
- sp78.x += randPlusMinusPoint5Scaled(15.0f);
- sp78.z += randPlusMinusPoint5Scaled(15.0f);
+ sp78.x += Rand_CenteredFloat(15.0f);
+ sp78.z += Rand_CenteredFloat(15.0f);
EffectSsDtBubble_SpawnCustomColor(play, &sp78, &sp98, &sp8C, &sp88, &sp84, Rand_S16Offset(120, 90), 30,
true);
diff --git a/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c b/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c
index 7c01fa788..1a0105788 100644
--- a/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c
+++ b/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c
@@ -814,11 +814,11 @@ void func_80C215E4(PlayState* play, EnHintSkb* this, Vec3f* arg2) {
s32 pad;
sp5C.y = this->actor.floorHeight;
- sp5C.x = (sin_rad(sp40) * 15.0f) + arg2->x;
- sp5C.z = (cos_rad(sp40) * 15.0f) + arg2->z;
+ sp5C.x = (Math_SinF(sp40) * 15.0f) + arg2->x;
+ sp5C.z = (Math_CosF(sp40) * 15.0f) + arg2->z;
- sp44.x = randPlusMinusPoint5Scaled(1.0f);
- sp44.z = randPlusMinusPoint5Scaled(1.0f);
+ sp44.x = Rand_CenteredFloat(1.0f);
+ sp44.z = Rand_CenteredFloat(1.0f);
sp50.y += (Rand_ZeroOne() - 0.5f) * 4.0f;
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 d4a534ad1..a116c323a 100644
--- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c
+++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c
@@ -487,7 +487,7 @@ void EnIk_VerticalAttack(EnIk* this, PlayState* play) {
if ((this->skelAnime.curFrame > 13.0f) && (this->skelAnime.curFrame < 23.0f)) {
this->colliderQuad.base.atFlags |= AT_ON;
if (this->drawArmorFlags) {
- this->actor.speed = sin_rad((this->skelAnime.curFrame - 13.0f) * (M_PI / 20)) * 10.0f;
+ this->actor.speed = Math_SinF((this->skelAnime.curFrame - 13.0f) * (M_PI / 20)) * 10.0f;
}
} else {
this->colliderQuad.base.atFlags &= ~AT_ON;
@@ -550,7 +550,7 @@ void EnIk_HorizontalDoubleAttack(EnIk* this, PlayState* play) {
} else {
phi_f2 = this->skelAnime.curFrame - 1.0f;
}
- this->actor.speed = sin_rad((M_PI / 8) * phi_f2) * 4.5f;
+ this->actor.speed = Math_SinF((M_PI / 8) * phi_f2) * 4.5f;
}
this->colliderQuad.base.atFlags |= AT_ON;
} else {
@@ -685,9 +685,9 @@ void EnIk_Die(EnIk* this, PlayState* play) {
if (this->timer != 0) {
this->timer--;
for (i = 6 - (this->timer >> 2); i >= 0; i--) {
- effectPos.x = randPlusMinusPoint5Scaled(80.0f) + this->actor.world.pos.x;
- effectPos.z = randPlusMinusPoint5Scaled(80.0f) + this->actor.world.pos.z;
- effectPos.y = randPlusMinusPoint5Scaled(50.0f) + (this->actor.world.pos.y + 20.0f);
+ effectPos.x = Rand_CenteredFloat(80.0f) + this->actor.world.pos.x;
+ effectPos.z = Rand_CenteredFloat(80.0f) + this->actor.world.pos.z;
+ effectPos.y = Rand_CenteredFloat(50.0f) + (this->actor.world.pos.y + 20.0f);
func_800B3030(play, &effectPos, &sEffectVelAndAccel, &sEffectVelAndAccel, 100, 0, 2);
}
if (this->timer == 0) {
@@ -845,9 +845,9 @@ void EnIk_UpdateArmor(EnIk* this, PlayState* play) {
ikEffect->pos.y = this->actor.floorHeight;
for (i = 0; i < 4; i++) {
- effectPos.x = randPlusMinusPoint5Scaled(20.0f) + ikEffect->pos.x;
+ effectPos.x = Rand_CenteredFloat(20.0f) + ikEffect->pos.x;
effectPos.y = Rand_ZeroFloat(20.0f) + ikEffect->pos.y;
- effectPos.z = randPlusMinusPoint5Scaled(20.0f) + ikEffect->pos.z;
+ effectPos.z = Rand_CenteredFloat(20.0f) + ikEffect->pos.z;
func_800B3030(play, &effectPos, &gZeroVec3f, &gZeroVec3f, 40, 7, 2);
}
diff --git a/src/overlays/actors/ovl_En_Jg/z_en_jg.c b/src/overlays/actors/ovl_En_Jg/z_en_jg.c
index df217b86d..449acf212 100644
--- a/src/overlays/actors/ovl_En_Jg/z_en_jg.c
+++ b/src/overlays/actors/ovl_En_Jg/z_en_jg.c
@@ -242,7 +242,7 @@ s32 EnJg_ReachedPoint(EnJg* this, Path* path, s32 pointIndex) {
diffZ = points[currentPoint + 1].z - points[currentPoint - 1].z;
}
- func_8017B7F8(&point, RAD_TO_BINANG(func_80086B30(diffX, diffZ)), &px, &pz, &d);
+ func_8017B7F8(&point, RAD_TO_BINANG(Math_FAtan2F(diffX, diffZ)), &px, &pz, &d);
if (((this->actor.world.pos.x * px) + (pz * this->actor.world.pos.z) + d) > 0.0f) {
reached = true;
diff --git a/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c b/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c
index a1da5941b..d572c1331 100644
--- a/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c
+++ b/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c
@@ -1461,7 +1461,7 @@ void func_80B88964(EnKaizoku* this, PlayState* play) {
void func_80B88CD8(EnKaizoku* this) {
EnKaizoku_ChangeAnim(this, EN_KAIZOKU_ANIM_3);
- this->picto.actor.speed = randPlusMinusPoint5Scaled(12.0f);
+ this->picto.actor.speed = Rand_CenteredFloat(12.0f);
this->skelAnime.playSpeed = 1.0f;
this->picto.actor.world.rot.y = this->picto.actor.shape.rot.y;
this->unk_2B2 = Rand_ZeroOne() * 30.0f + 30.0f;
diff --git a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c
index 930a0d7a3..fc8d3d201 100644
--- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c
+++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c
@@ -1006,11 +1006,11 @@ void EnKakasi_DiggingAway(EnKakasi* this, PlayState* play) {
if ((play->gameplayFrames % 4) == 0) {
Math_Vec3f_Copy(&tempWorldPos, &this->picto.actor.world.pos);
tempWorldPos.y = this->picto.actor.floorHeight;
- tempWorldPos.x += randPlusMinusPoint5Scaled(2.0f);
- tempWorldPos.z += randPlusMinusPoint5Scaled(2.0f);
+ tempWorldPos.x += Rand_CenteredFloat(2.0f);
+ tempWorldPos.z += Rand_CenteredFloat(2.0f);
if (play->sceneId == SCENE_8ITEMSHOP) {
- EffectSsGSplash_Spawn(play, &tempWorldPos, 0, 0, 0, randPlusMinusPoint5Scaled(100.0f) + 200.0f);
+ EffectSsGSplash_Spawn(play, &tempWorldPos, 0, 0, 0, Rand_CenteredFloat(100.0f) + 200.0f);
SoundSource_PlaySfxAtFixedWorldPos(play, &tempWorldPos, 0x32, NA_SE_EV_BOMB_DROP_WATER);
} else {
diff --git a/src/overlays/actors/ovl_En_Kame/z_en_kame.c b/src/overlays/actors/ovl_En_Kame/z_en_kame.c
index d9d5ef7d8..820dd1f4e 100644
--- a/src/overlays/actors/ovl_En_Kame/z_en_kame.c
+++ b/src/overlays/actors/ovl_En_Kame/z_en_kame.c
@@ -606,9 +606,9 @@ void func_80AD8388(EnKame* this, PlayState* play) {
this->actor.scale.y = this->actor.scale.x;
this->actor.scale.z = this->actor.scale.x;
}
- sp34.x = randPlusMinusPoint5Scaled(40.0f) + this->actor.world.pos.x;
+ sp34.x = Rand_CenteredFloat(40.0f) + this->actor.world.pos.x;
sp34.y = this->actor.world.pos.y + 15.0f;
- sp34.z = randPlusMinusPoint5Scaled(40.0f) + this->actor.world.pos.z;
+ sp34.z = Rand_CenteredFloat(40.0f) + this->actor.world.pos.z;
func_800B3030(play, &sp34, &gZeroVec3f, &gZeroVec3f, 100, 0, 2);
}
}
diff --git a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c
index e1d9df24c..ff7e4bb08 100644
--- a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c
+++ b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c
@@ -135,8 +135,8 @@ void func_80954960(EnKanban* this) {
ny = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.y);
nz = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.z);
- this->floorRot.x = -func_80086B30(-nz * ny, 1.0f);
- this->floorRot.z = func_80086B30(-nx * ny, 1.0f);
+ this->floorRot.x = -Math_FAtan2F(-nz * ny, 1.0f);
+ this->floorRot.z = Math_FAtan2F(-nx * ny, 1.0f);
}
}
@@ -350,7 +350,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play) {
piece->actionState = ENKANBAN_AIR;
piece->actor.gravity = -1.0f;
piece->actor.world.rot.y =
- BINANG_ROT180((s32)randPlusMinusPoint5Scaled(0x4000) + this->actor.yawTowardsPlayer);
+ BINANG_ROT180((s32)Rand_CenteredFloat(0x4000) + this->actor.yawTowardsPlayer);
if ((hitItem->toucher.dmgFlags & 0x10) || (hitItem->toucher.dmgFlags & 8) ||
(hitItem->toucher.dmgFlags & 0x80000000)) {
@@ -369,7 +369,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play) {
piece->bounceZ = Rand_ZeroFloat(7.0f) + 3.0f;
}
- piece->spinVel.y = randPlusMinusPoint5Scaled(0x1800);
+ piece->spinVel.y = Rand_CenteredFloat(0x1800);
if (Rand_ZeroOne() < 0.5f) {
piece->direction = 1;
@@ -526,7 +526,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play) {
this->actor.velocity.y = 0.0f;
} else {
this->actor.velocity.y *= -0.3f;
- this->actor.world.rot.y += (s16)randPlusMinusPoint5Scaled(0x4000);
+ this->actor.world.rot.y += (s16)(s32)Rand_CenteredFloat(0x4000);
}
bounced = true;
} else {
@@ -653,8 +653,8 @@ void EnKanban_Update(Actor* thisx, PlayState* play) {
dustCount = this->partCount * 0.5f;
for (j = 0; j < dustCount + 3; j++) {
- pos.x = randPlusMinusPoint5Scaled((this->partCount * 0.5f) + 20.0f) + this->actor.world.pos.x;
- pos.z = randPlusMinusPoint5Scaled((this->partCount * 0.5f) + 20.0f) + this->actor.world.pos.z;
+ pos.x = Rand_CenteredFloat((this->partCount * 0.5f) + 20.0f) + this->actor.world.pos.x;
+ pos.z = Rand_CenteredFloat((this->partCount * 0.5f) + 20.0f) + this->actor.world.pos.z;
func_800B0F18(play, &pos, &velocity, &accel, &primColor, &envColor, 100, 5,
Rand_ZeroFloat(5.0f) + 14.0f);
}
@@ -750,7 +750,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play) {
this->actionState = ENKANBAN_AIR;
this->actor.gravity = -1.0f;
- this->actor.world.rot.y = randPlusMinusPoint5Scaled(0x10000);
+ this->actor.world.rot.y = Rand_CenteredFloat(0x10000);
if (this->partCount >= 4) {
this->bounceX = Rand_ZeroFloat(10.0f) + 6.0f;
this->bounceZ = Rand_ZeroFloat(10.0f) + 6.0f;
@@ -763,7 +763,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play) {
this->actor.speed = Rand_ZeroFloat(1.5f);
}
- this->spinVel.y = randPlusMinusPoint5Scaled(0x1800);
+ this->spinVel.y = Rand_CenteredFloat(0x1800);
if (Rand_ZeroOne() < 0.5f) {
this->direction = 1;
@@ -808,7 +808,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play) {
this->actor.speed = 4.0f + bombStrength;
}
- this->spinVel.y = randPlusMinusPoint5Scaled(0x1800);
+ this->spinVel.y = Rand_CenteredFloat(0x1800);
if (Rand_ZeroOne() < 0.5f) {
this->direction = 1;
diff --git a/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c b/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c
index 315bc1ffd..94590f5b6 100644
--- a/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c
+++ b/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c
@@ -233,9 +233,9 @@ void EnMinifrog_SpawnDust(EnMinifrog* this, PlayState* play) {
vec5.z = this->actor.world.pos.z - (5.0f * Math_CosS(yaw) * Math_CosS(pitch));
for (i = 0; i < 5; i++) {
- vel.x = randPlusMinusPoint5Scaled(4.0f);
- vel.y = randPlusMinusPoint5Scaled(4.0f);
- vel.z = randPlusMinusPoint5Scaled(4.0f);
+ vel.x = Rand_CenteredFloat(4.0f);
+ vel.y = Rand_CenteredFloat(4.0f);
+ vel.z = Rand_CenteredFloat(4.0f);
accel.x = -vel.x * 0.1f;
accel.y = -vel.y * 0.1f;
accel.z = -vel.z * 0.1f;
diff --git a/src/overlays/actors/ovl_En_Minislime/z_en_minislime.c b/src/overlays/actors/ovl_En_Minislime/z_en_minislime.c
index 3aac9ae11..68d08b223 100644
--- a/src/overlays/actors/ovl_En_Minislime/z_en_minislime.c
+++ b/src/overlays/actors/ovl_En_Minislime/z_en_minislime.c
@@ -209,11 +209,11 @@ void EnMinislime_AddIceSmokeEffect(EnMinislime* this, PlayState* play) {
Vec3f pos;
Vec3f vel;
- pos.x = (randPlusMinusPoint5Scaled(200.0f) * this->actor.scale.x) + this->actor.world.pos.x;
+ pos.x = (Rand_CenteredFloat(200.0f) * this->actor.scale.x) + this->actor.world.pos.x;
pos.y = CLAMP_MIN(this->actor.world.pos.y, GBT_ROOM_5_MIN_Y + 30.0f);
- pos.z = (randPlusMinusPoint5Scaled(200.0f) * this->actor.scale.z) + this->actor.world.pos.z;
- vel.x = randPlusMinusPoint5Scaled(1.5f);
- vel.z = randPlusMinusPoint5Scaled(1.5f);
+ pos.z = (Rand_CenteredFloat(200.0f) * this->actor.scale.z) + this->actor.world.pos.z;
+ vel.x = Rand_CenteredFloat(1.5f);
+ vel.z = Rand_CenteredFloat(1.5f);
vel.y = 2.0f;
EffectSsIceSmoke_Spawn(play, &pos, &vel, &gZeroVec3f, 500);
}
@@ -401,8 +401,8 @@ void EnMinislime_GrowAndShrink(EnMinislime* this, PlayState* play) {
this->growShrinkTimer--;
scaleFactor = (this->growShrinkTimer / 6) + 1.0f;
this->actor.scale.z = this->actor.scale.x =
- ((cos_rad(this->growShrinkTimer * (M_PI / 3)) * (scaleFactor * (2.0f / 30.0f))) + 1.5f) * 0.1f;
- this->actor.scale.y = ((sin_rad(this->growShrinkTimer * (M_PI / 3)) * (scaleFactor * 0.05f)) + 0.75f) * 0.1f;
+ ((Math_CosF(this->growShrinkTimer * (M_PI / 3)) * (scaleFactor * (2.0f / 30.0f))) + 1.5f) * 0.1f;
+ this->actor.scale.y = ((Math_SinF(this->growShrinkTimer * (M_PI / 3)) * (scaleFactor * 0.05f)) + 0.75f) * 0.1f;
if (this->actor.params == MINISLIME_SETUP_GEKKO_THROW) {
EnMinislime_SetupMoveToGekko(this);
} else if ((this->actor.xzDistToPlayer < 150.0f) && (this->growShrinkTimer < 38)) {
@@ -424,11 +424,12 @@ void EnMinislime_Idle(EnMinislime* this, PlayState* play) {
f32 speedXZ;
this->idleTimer--;
- speedXZ = sin_rad(this->idleTimer * (M_PI / 10));
+ speedXZ = Math_SinF(this->idleTimer * (M_PI / 10));
this->actor.speed = speedXZ * 1.5f;
this->actor.speed = CLAMP_MIN(this->actor.speed, 0.0f);
Math_StepToF(&this->actor.scale.x, ((0.14f * speedXZ) + 1.5f) * 0.1f, 0.010000001f);
- Math_StepToF(&this->actor.scale.y, ((cos_rad(this->idleTimer * (M_PI / 10)) * 0.07f) + 0.75f) * 0.1f, 0.010000001f);
+ Math_StepToF(&this->actor.scale.y, ((Math_CosF(this->idleTimer * (M_PI / 10)) * 0.07f) + 0.75f) * 0.1f,
+ 0.010000001f);
Math_StepToF(&this->actor.scale.z, 0.3f - this->actor.scale.x, 0.010000001f);
if (this->idleTimer == 0) {
if (this->actor.xzDistToPlayer < 300.0f) {
@@ -537,13 +538,13 @@ void EnMinislime_Knockback(EnMinislime* this, PlayState* play) {
this->knockbackTimer--;
Math_StepToF(&this->actor.speed, 0.0f, 1.0f);
sqrtFrozenTimer = sqrtf(this->knockbackTimer);
- this->actor.scale.x = ((cos_rad(this->knockbackTimer * (M_PI / 3)) * (0.05f * sqrtFrozenTimer)) + 1.0f) * 0.15f;
+ this->actor.scale.x = ((Math_CosF(this->knockbackTimer * (M_PI / 3)) * (0.05f * sqrtFrozenTimer)) + 1.0f) * 0.15f;
this->actor.scale.z = this->actor.scale.x;
if (this->knockbackTimer == 15) {
this->collider.base.acFlags |= AC_ON;
}
- this->actor.scale.y = ((sin_rad(this->knockbackTimer * (M_PI / 3)) * (0.05f * sqrtFrozenTimer)) + 1.0f) * 0.075f;
+ this->actor.scale.y = ((Math_SinF(this->knockbackTimer * (M_PI / 3)) * (0.05f * sqrtFrozenTimer)) + 1.0f) * 0.075f;
if (this->actor.params == MINISLIME_SETUP_GEKKO_THROW) {
EnMinislime_SetupMoveToGekko(this);
} else if (this->knockbackTimer == 0) {
@@ -575,9 +576,10 @@ void EnMinislime_DefeatIdle(EnMinislime* this, PlayState* play) {
f32 xzScale;
this->idleTimer--;
- xzScale = sin_rad(this->idleTimer * (M_PI / 10));
+ xzScale = Math_SinF(this->idleTimer * (M_PI / 10));
Math_StepToF(&this->actor.scale.x, ((0.14f * xzScale) + 1.5f) * 0.1f, 0.010000001f);
- Math_StepToF(&this->actor.scale.y, ((0.07f * cos_rad(this->idleTimer * (M_PI / 10))) + 0.75f) * 0.1f, 0.010000001f);
+ Math_StepToF(&this->actor.scale.y, ((0.07f * Math_CosF(this->idleTimer * (M_PI / 10))) + 0.75f) * 0.1f,
+ 0.010000001f);
Math_StepToF(&this->actor.scale.z, 0.3f - this->actor.scale.x, 0.010000001f);
if (this->idleTimer == 0) {
this->idleTimer = 20;
@@ -670,9 +672,9 @@ void EnMinislime_GekkoThrow(EnMinislime* this, PlayState* play) {
f32 xzScale;
this->throwTimer--;
- xzScale = sin_rad(this->throwTimer * (M_PI / 5));
+ xzScale = Math_SinF(this->throwTimer * (M_PI / 5));
this->actor.scale.x = ((0.3f * xzScale) + 1.5f) * 0.1f;
- this->actor.scale.y = ((cos_rad(this->throwTimer * (M_PI / 5)) * 0.2f) + 0.75f) * 0.1f;
+ this->actor.scale.y = ((Math_CosF(this->throwTimer * (M_PI / 5)) * 0.2f) + 0.75f) * 0.1f;
this->actor.scale.z = 0.3f - this->actor.scale.x;
if (this->throwTimer == 0) {
this->throwTimer = 10;
diff --git a/src/overlays/actors/ovl_En_Mkk/z_en_mkk.c b/src/overlays/actors/ovl_En_Mkk/z_en_mkk.c
index 9b4722fba..4e9af5578 100644
--- a/src/overlays/actors/ovl_En_Mkk/z_en_mkk.c
+++ b/src/overlays/actors/ovl_En_Mkk/z_en_mkk.c
@@ -274,7 +274,7 @@ void func_80A4E2E8(EnMkk* this, PlayState* play) {
Math_ScaledStepToS(&this->unk_150, this->actor.yawTowardsPlayer, 0x400);
}
this->actor.shape.rot.y =
- (s32)(sin_rad(this->unk_14E * ((2 * M_PI) / 15)) * (614.4f * this->actor.speed)) + this->unk_150;
+ (s32)(Math_SinF(this->unk_14E * ((2 * M_PI) / 15)) * (614.4f * this->actor.speed)) + this->unk_150;
func_800B9010(&this->actor, NA_SE_EN_KUROSUKE_MOVE - SFX_FLAG);
if (sp20) {
this->unk_14B &= ~2;
@@ -379,16 +379,16 @@ void func_80A4E84C(EnMkk* this) {
this->unk_154.y = this->actor.world.pos.y;
this->unk_154.x = this->actor.world.pos.x -
10.0f * Math_SinS(this->actor.shape.rot.y +
- (s32)(1228.8f * this->actor.speed * sin_rad(this->unk_14E * (M_PI / 5))));
+ (s32)(1228.8f * this->actor.speed * Math_SinF(this->unk_14E * (M_PI / 5))));
this->unk_154.z = this->actor.world.pos.z -
10.0f * Math_CosS(this->actor.shape.rot.y +
- (s32)(1228.8f * this->actor.speed * sin_rad(this->unk_14E * (M_PI / 5))));
+ (s32)(1228.8f * this->actor.speed * Math_SinF(this->unk_14E * (M_PI / 5))));
this->unk_160.x = this->unk_154.x -
12.0f * Math_SinS(this->actor.shape.rot.y -
- (s32)(1228.8f * this->actor.speed * sin_rad(this->unk_14E * (M_PI / 5))));
+ (s32)(1228.8f * this->actor.speed * Math_SinF(this->unk_14E * (M_PI / 5))));
this->unk_160.z = this->unk_154.z -
12.0f * Math_CosS(this->actor.shape.rot.y -
- (s32)(1228.8f * this->actor.speed * sin_rad(this->unk_14E * (M_PI / 5))));
+ (s32)(1228.8f * this->actor.speed * Math_SinF(this->unk_14E * (M_PI / 5))));
}
}
diff --git a/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.c b/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.c
index 41f872488..472196ae9 100644
--- a/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.c
+++ b/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.c
@@ -87,9 +87,9 @@ void EnNimotsu_Update(Actor* thisx, PlayState* play) {
}
if ((play->state.frames % 3) == 0) {
- dustPosition.x = this->actor.world.pos.x + randPlusMinusPoint5Scaled(15.0f);
+ dustPosition.x = this->actor.world.pos.x + Rand_CenteredFloat(15.0f);
dustPosition.y = this->actor.world.pos.y;
- dustPosition.z = this->actor.world.pos.z + randPlusMinusPoint5Scaled(15.0f);
+ dustPosition.z = this->actor.world.pos.z + Rand_CenteredFloat(15.0f);
Actor_SpawnFloorDustRing(play, &this->actor, &dustPosition, 20.0f, 0, 2.0f, 0, 0, 0);
}
}
diff --git a/src/overlays/actors/ovl_En_Niw/z_en_niw.c b/src/overlays/actors/ovl_En_Niw/z_en_niw.c
index 4982f7e75..0e96590d5 100644
--- a/src/overlays/actors/ovl_En_Niw/z_en_niw.c
+++ b/src/overlays/actors/ovl_En_Niw/z_en_niw.c
@@ -280,7 +280,7 @@ void EnNiw_SpawnAttackNiw(EnNiw* this, PlayState* play) {
yView = play->view.at.y - play->view.eye.y;
zView = play->view.at.z - play->view.eye.z;
newNiwPos.x = ((Rand_ZeroOne() - 0.5f) * xView) + play->view.eye.x;
- newNiwPos.y = randPlusMinusPoint5Scaled(0.3f) + (play->view.eye.y + 50.0f + (yView * 0.5f));
+ newNiwPos.y = Rand_CenteredFloat(0.3f) + (play->view.eye.y + 50.0f + (yView * 0.5f));
newNiwPos.z = ((Rand_ZeroOne() - 0.5f) * zView) + play->view.eye.z;
attackNiw = Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_ATTACK_NIW, newNiwPos.x,
newNiwPos.y, newNiwPos.z, 0, 0, 0, ATTACK_NIW_REGULAR);
@@ -340,8 +340,8 @@ void EnNiw_SetupIdle(EnNiw* this) {
void EnNiw_Idle(EnNiw* this, PlayState* play) {
f32 posX2;
f32 posZ2;
- f32 posX1 = randPlusMinusPoint5Scaled(100.0f);
- f32 posZ1 = randPlusMinusPoint5Scaled(100.0f);
+ f32 posX1 = Rand_CenteredFloat(100.0f);
+ f32 posZ1 = Rand_CenteredFloat(100.0f);
s16 nextAnimIndex;
if (this->niwType == NIW_TYPE_REGULAR) {
@@ -438,9 +438,9 @@ void EnNiw_Held(EnNiw* this, PlayState* play) {
this->heldTimer = (s32)(Rand_ZeroFloat(1.0f) * 10.0f) + 10;
}
- this->actor.shape.rot.x = (s16)randPlusMinusPoint5Scaled(5000.0f) + this->actor.world.rot.x;
- this->actor.shape.rot.y = (s16)randPlusMinusPoint5Scaled(5000.0f) + this->actor.world.rot.y;
- this->actor.shape.rot.z = (s16)randPlusMinusPoint5Scaled(5000.0f) + this->actor.world.rot.z;
+ this->actor.shape.rot.x = (s16)(s32)Rand_CenteredFloat(0x1388) + this->actor.world.rot.x;
+ this->actor.shape.rot.y = (s16)(s32)Rand_CenteredFloat(0x1388) + this->actor.world.rot.y;
+ this->actor.shape.rot.z = (s16)(s32)Rand_CenteredFloat(0x1388) + this->actor.world.rot.z;
if (this->niwType == NIW_TYPE_REGULAR) {
if (Actor_HasNoParent(&this->actor, play)) {
this->actor.shape.rot.z = 0;
@@ -773,9 +773,9 @@ void EnNiw_Update(Actor* thisx, PlayState* play) {
featherCount = 4;
}
for (i = 0; i < featherCount; i++) {
- pos.x = randPlusMinusPoint5Scaled(10.0f) + this->actor.world.pos.x;
- pos.y = randPlusMinusPoint5Scaled(10.0f) + (this->actor.world.pos.y + this->unk308);
- pos.z = randPlusMinusPoint5Scaled(10.0f) + this->actor.world.pos.z;
+ pos.x = Rand_CenteredFloat(10.0f) + this->actor.world.pos.x;
+ pos.y = Rand_CenteredFloat(10.0f) + (this->actor.world.pos.y + this->unk308);
+ pos.z = Rand_CenteredFloat(10.0f) + this->actor.world.pos.z;
featherScale = Rand_ZeroFloat(6.0f) + 6.0f;
if ((this->unk29E == 2) && (this->unk308 != 0)) {
@@ -785,9 +785,9 @@ void EnNiw_Update(Actor* thisx, PlayState* play) {
if (this->unk308 == 0) {
featherScale = Rand_ZeroFloat(2.0f) + 2.0f;
}
- vel.x = randPlusMinusPoint5Scaled(3.0f);
+ vel.x = Rand_CenteredFloat(3.0f);
vel.y = Rand_ZeroFloat(2.0f) * 0.5f + 2.0f;
- vel.z = randPlusMinusPoint5Scaled(3.0f);
+ vel.z = Rand_CenteredFloat(3.0f);
accel.z = accel.x = 0.0f;
accel.y = -0.15f;
diff --git a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c
index fc6ef71db..2f8914edc 100644
--- a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c
+++ b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c
@@ -110,9 +110,9 @@ void EnNwc_SpawnDust(EnNwc* this, PlayState* play) {
vec5.z = this->actor.world.pos.z - 5.0f * Math_CosS(yaw) * Math_CosS(pitch);
for (i = 0; i < 5; i++) {
- vel.x = randPlusMinusPoint5Scaled(4.0f);
- vel.y = randPlusMinusPoint5Scaled(4.0f);
- vel.z = randPlusMinusPoint5Scaled(4.0f);
+ vel.x = Rand_CenteredFloat(4.0f);
+ vel.y = Rand_CenteredFloat(4.0f);
+ vel.z = Rand_CenteredFloat(4.0f);
accel.x = -vel.x * 0.1f;
accel.y = -vel.y * 0.1f;
accel.z = -vel.z * 0.1f;
@@ -182,7 +182,7 @@ void EnNwc_ChangeState(EnNwc* this, s16 newState) {
case NWC_STATE_TURNING:
this->stateTimer = Rand_ZeroFloat(20.0f) + 15.0f;
this->actionFunc = EnNwc_Turn;
- this->fallingRotY = (s16)(s32)randPlusMinusPoint5Scaled(0x10000);
+ this->fallingRotY = (s16)(s32)Rand_CenteredFloat(0x10000);
break;
case NWC_STATE_HOPPING_FORWARD:
@@ -193,7 +193,7 @@ void EnNwc_ChangeState(EnNwc* this, s16 newState) {
case NWC_STATE_FOLLOWING:
this->actionFunc = EnNwc_Follow;
this->transformTimer = 0;
- this->randomRot = (s16)(s32)randPlusMinusPoint5Scaled(10000.0f);
+ this->randomRot = (s16)(s32)Rand_CenteredFloat(0x2710);
break;
case NWC_STATE_RUNNING:
@@ -331,7 +331,7 @@ void EnNwc_Follow(EnNwc* this, PlayState* play) {
}
} else { // not too close: keep moving
- this->randomRot += (s16)randPlusMinusPoint5Scaled(1500.0f);
+ this->randomRot += (s16)(s32)Rand_CenteredFloat(0x5DC);
if (this->randomRot > 0x1388) {
this->randomRot = 0x1388;
} else if (this->randomRot < -0x1388) {
diff --git a/src/overlays/actors/ovl_En_Osk/z_en_osk.c b/src/overlays/actors/ovl_En_Osk/z_en_osk.c
index 7a40b38f5..c1ce34949 100644
--- a/src/overlays/actors/ovl_En_Osk/z_en_osk.c
+++ b/src/overlays/actors/ovl_En_Osk/z_en_osk.c
@@ -118,9 +118,9 @@ void func_80BF5E68(EnOsk* this, AnimationHeader** animations, s16 index, f32 pla
void func_80BF5EBC(EnOsk* this, PlayState* play) {
Vec3f sp2C;
- sp2C.x = randPlusMinusPoint5Scaled(30.0f) + this->actor.world.pos.x;
- sp2C.z = randPlusMinusPoint5Scaled(30.0f) + this->actor.world.pos.z;
- sp2C.y = randPlusMinusPoint5Scaled(30.0f) + this->actor.world.pos.y;
+ sp2C.x = Rand_CenteredFloat(30.0f) + this->actor.world.pos.x;
+ sp2C.z = Rand_CenteredFloat(30.0f) + this->actor.world.pos.z;
+ sp2C.y = Rand_CenteredFloat(30.0f) + this->actor.world.pos.y;
func_800B3030(play, &sp2C, &D_80BF7018, &D_80BF7018, 100, 0, 2);
}
diff --git a/src/overlays/actors/ovl_En_Owl/z_en_owl.c b/src/overlays/actors/ovl_En_Owl/z_en_owl.c
index 52f611c0e..e5b4cabe3 100644
--- a/src/overlays/actors/ovl_En_Owl/z_en_owl.c
+++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.c
@@ -271,7 +271,7 @@ void func_8095AB1C(EnOwl* this, PlayState* play) {
}
void func_8095AB4C(EnOwl* this) {
- if (randPlusMinusPoint5Scaled(1.0f) < 0.0f) {
+ if (Rand_CenteredFloat(1.0f) < 0.0f) {
this->actionFlags |= 0x20;
} else {
this->actionFlags &= ~0x20;
diff --git a/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c b/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c
index 079e3027d..4c75fac65 100644
--- a/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c
+++ b/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c
@@ -306,7 +306,7 @@ s32 func_8086A2CC(EnPametfrog* this, CollisionPoly* floorPoly) {
return false;
}
- rotation = func_80086C48(arg0);
+ rotation = Math_FAcosF(arg0);
if (rotation < 0.0001f) {
return false;
}
@@ -523,7 +523,7 @@ void EnPametfrog_FallOffSnapper(EnPametfrog* this, PlayState* play) {
this->timer--;
}
- sin = sin_rad(this->timer * (M_PI / 3)) * ((0.02f * (this->timer * (1.0f / 6.0f))) + 0.005f) + 1.0f;
+ sin = Math_SinF(this->timer * (M_PI / 3)) * ((0.02f * (this->timer * (1.0f / 6.0f))) + 0.005f) + 1.0f;
EnPametfrog_ShakeCamera(this, play, 300.0f * sin, 100.0f * sin);
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
EnPametfrog_StopCutscene(this, play);
@@ -966,9 +966,9 @@ void EnPametfrog_SetupSpawnFrog(EnPametfrog* this, PlayState* play) {
Flags_SetClearTemp(play, play->roomCtx.curRoom.num);
for (i = 0; i < 25; i++) {
- vel.x = randPlusMinusPoint5Scaled(5.0f);
+ vel.x = Rand_CenteredFloat(5.0f);
vel.y = Rand_ZeroFloat(3.0f) + 4.0f;
- vel.z = randPlusMinusPoint5Scaled(5.0f);
+ vel.z = Rand_CenteredFloat(5.0f);
EffectSsHahen_Spawn(play, &this->actor.world.pos, &vel, &sAccel, 0, Rand_S16Offset(12, 3), HAHEN_OBJECT_DEFAULT,
10, 0);
}
@@ -981,7 +981,7 @@ void EnPametfrog_SpawnFrog(EnPametfrog* this, PlayState* play) {
f32 magShake;
this->timer--;
- magShake = (sin_rad(this->timer * (M_PI / 5)) * ((0.04f * (this->timer * 0.1f)) + 0.02f)) + 1.0f;
+ magShake = (Math_SinF(this->timer * (M_PI / 5)) * ((0.04f * (this->timer * 0.1f)) + 0.02f)) + 1.0f;
EnPametfrog_ShakeCamera(this, play, 75.0f * magShake, 10.0f * magShake);
if (this->timer == 0) {
EnPametfrog_StopCutscene(this, play);
diff --git a/src/overlays/actors/ovl_En_Part/z_en_part.c b/src/overlays/actors/ovl_En_Part/z_en_part.c
index ac073358f..e56970e10 100644
--- a/src/overlays/actors/ovl_En_Part/z_en_part.c
+++ b/src/overlays/actors/ovl_En_Part/z_en_part.c
@@ -90,10 +90,10 @@ void func_808654C4(EnPart* this, PlayState* play) {
break;
case ENPART_TYPE_4:
for (i = 7; i >= 0; i--) {
- effectPos.x = randPlusMinusPoint5Scaled(60.0f) + this->actor.world.pos.x;
- effectPos.y = randPlusMinusPoint5Scaled(50.0f) +
+ effectPos.x = Rand_CenteredFloat(60.0f) + this->actor.world.pos.x;
+ effectPos.y = Rand_CenteredFloat(50.0f) +
(this->actor.world.pos.y + (this->actor.shape.yOffset * this->actor.scale.y));
- effectPos.z = randPlusMinusPoint5Scaled(60.0f) + this->actor.world.pos.z;
+ effectPos.z = Rand_CenteredFloat(60.0f) + this->actor.world.pos.z;
effectVelocity.y = Rand_ZeroOne() + 1.0f;
effectScale = Rand_S16Offset(80, 100);
EffectSsDtBubble_SpawnColorProfile(play, &effectPos, &effectVelocity, &gZeroVec3f, effectScale, 25,
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 d4996d74f..645b7edf5 100644
--- a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c
+++ b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c
@@ -257,9 +257,9 @@ void func_80897258(PlayState* play, EnPeehat* this, Vec3f* arg2, f32 arg3, f32 a
sp44.x = (Math_SinS(sp42) * arg3) + arg2->x;
sp44.z = (Math_CosS(sp42) * arg3) + arg2->z;
- D_80899564.x = randPlusMinusPoint5Scaled(1.05f);
- D_80899564.z = randPlusMinusPoint5Scaled(1.05f);
- D_80899558.y = randPlusMinusPoint5Scaled(4.0f) + 8.0f;
+ D_80899564.x = Rand_CenteredFloat(1.05f);
+ D_80899564.z = Rand_CenteredFloat(1.05f);
+ D_80899558.y = Rand_CenteredFloat(4.0f) + 8.0f;
EffectSsHahen_Spawn(play, &sp44, &D_80899558, &D_80899564, 0, (Rand_ZeroFloat(5.0f) + 12.0f) * arg4,
HAHEN_OBJECT_DEFAULT, 10, NULL);
@@ -506,7 +506,7 @@ void func_80897F44(EnPeehat* this, PlayState* play) {
this->actor.world.pos.y -= 1.0f;
}
- cos = cos_rad(this->unk_2B8);
+ cos = Math_CosF(this->unk_2B8);
this->actor.world.pos.y += cos * 1.4f;
this->unk_2B8 += fabsf(cos * 0.18f) + 0.07f;
this->unk_2B0--;
@@ -514,7 +514,7 @@ void func_80897F44(EnPeehat* this, PlayState* play) {
if (this->unk_2B0 <= 0) {
this->actor.speed = Rand_ZeroFloat(0.5f) + 2.5f;
this->unk_2B0 = Rand_ZeroFloat(10.0f) + 10.0f;
- this->unk_2B6 = randPlusMinusPoint5Scaled(1000.0f);
+ this->unk_2B6 = Rand_CenteredFloat(1000.0f);
}
SkelAnime_Update(&this->skelAnime);
@@ -549,10 +549,10 @@ void func_80898144(EnPeehat* this, PlayState* play) {
} else {
this->actor.world.pos.y += 1.0f;
}
- cos = cos_rad(this->unk_2B8);
+ cos = Math_CosF(this->unk_2B8);
this->actor.world.pos.y += cos * 1.4f;
- cos = cos_rad(this->unk_2B8);
+ cos = Math_CosF(this->unk_2B8);
this->unk_2B8 += fabsf(cos * 0.18f) + 0.07f;
step = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos);
diff --git a/src/overlays/actors/ovl_En_Pp/z_en_pp.c b/src/overlays/actors/ovl_En_Pp/z_en_pp.c
index 6d16c1418..48c8cd5ab 100644
--- a/src/overlays/actors/ovl_En_Pp/z_en_pp.c
+++ b/src/overlays/actors/ovl_En_Pp/z_en_pp.c
@@ -397,17 +397,17 @@ void EnPp_SpawnDust(EnPp* this, PlayState* play) {
Vec3f accel;
for (i = 0; i < ARRAY_COUNT(this->backFootPos); i++) {
- velocity.x = randPlusMinusPoint5Scaled(2.0f);
+ velocity.x = Rand_CenteredFloat(2.0f);
velocity.y = Rand_ZeroFloat(2.0f) + 1.0f;
- velocity.z = randPlusMinusPoint5Scaled(2.0f);
+ velocity.z = Rand_CenteredFloat(2.0f);
accel.y = -0.1f;
accel.z = 0.0f;
accel.x = 0.0f;
- pos.x = this->backFootPos[i].x + randPlusMinusPoint5Scaled(10.0f);
+ pos.x = this->backFootPos[i].x + Rand_CenteredFloat(10.0f);
pos.y = Rand_ZeroFloat(3.0f) + this->actor.floorHeight + 1.0f;
- pos.z = this->backFootPos[i].z + randPlusMinusPoint5Scaled(10.0f);
+ pos.z = this->backFootPos[i].z + Rand_CenteredFloat(10.0f);
func_800B0EB0(play, &pos, &velocity, &accel, &sDustPrimColor, &sDustEnvColor, (Rand_ZeroFloat(50.0f) + 60.0f),
30, (Rand_ZeroFloat(5.0f) + 20.0f));
@@ -534,8 +534,8 @@ void EnPp_Idle(EnPp* this, PlayState* play) {
if ((this->timer == 0) && (this->secondaryTimer == 0)) {
this->secondaryTimer = Rand_ZeroFloat(20.0f) + 20.0f;
Math_Vec3f_Copy(&posToLookAt, &this->actor.home.pos);
- posToLookAt.x += randPlusMinusPoint5Scaled(50.0f);
- posToLookAt.z += randPlusMinusPoint5Scaled(50.0f);
+ posToLookAt.x += Rand_CenteredFloat(50.0f);
+ posToLookAt.z += Rand_CenteredFloat(50.0f);
this->targetRotY = Math_Vec3f_Yaw(&this->actor.world.pos, &posToLookAt);
this->actor.speed = 0.0f;
if (this->animIndex != EN_PP_ANIM_IDLE) {
@@ -1046,8 +1046,8 @@ void EnPp_Dead(EnPp* this, PlayState* play) {
if (this->actor.world.pos.y < waterSurface) {
for (i = 0; i < 5; i++) {
Math_Vec3f_Copy(&splashPos, &this->actor.world.pos);
- splashPos.x += randPlusMinusPoint5Scaled(10 + (5 * i));
- splashPos.z += randPlusMinusPoint5Scaled(40 + (5 * i));
+ splashPos.x += Rand_CenteredFloat(10 + (5 * i));
+ splashPos.z += Rand_CenteredFloat(40 + (5 * i));
EffectSsGSplash_Spawn(play, &splashPos, NULL, NULL, 0, (Rand_ZeroOne() * 100.0f) + 400.0f);
}
@@ -1143,9 +1143,9 @@ void EnPp_Mask_Detach(EnPp* this, PlayState* play) {
for (i = 0; i < ARRAY_COUNT(sMaskFireVelocityAndAccel); i++) {
Math_Vec3f_Copy(&maskFirePos, &this->maskFlamesBasePos);
- maskFirePos.x += randPlusMinusPoint5Scaled(20.0f);
+ maskFirePos.x += Rand_CenteredFloat(20.0f);
maskFirePos.y = this->actor.floorHeight;
- maskFirePos.z += randPlusMinusPoint5Scaled(20.0f);
+ maskFirePos.z += Rand_CenteredFloat(20.0f);
func_800B3030(play, &maskFirePos, &sMaskFireVelocityAndAccel[i],
&sMaskFireVelocityAndAccel[i], 70, 0, 2);
}
@@ -1173,7 +1173,7 @@ void EnPp_BodyPart_SetupMove(EnPp* this) {
this->deadBodyPartRotationalVelocity.z = (this->deadBodyPartIndex * 0x2E) + 0xFF00;
if (EN_PP_GET_TYPE(&this->actor) != EN_PP_TYPE_BODY_PART_BODY) {
this->actor.speed = Rand_ZeroFloat(4.0f) + 4.0f;
- this->actor.world.rot.y = ((s32)randPlusMinusPoint5Scaled(223.0f) + 0x1999) * this->deadBodyPartIndex;
+ this->actor.world.rot.y = ((s32)Rand_CenteredFloat(223.0f) + 0x1999) * this->deadBodyPartIndex;
}
this->action = EN_PP_ACTION_BODY_PART_MOVE;
@@ -1213,8 +1213,8 @@ void EnPp_BodyPart_Move(EnPp* this, PlayState* play) {
if (EN_PP_GET_TYPE(&this->actor) == EN_PP_TYPE_BODY_PART_BODY) {
for (i = 0; i < 6; i++) {
Math_Vec3f_Copy(&splashPos, &this->actor.world.pos);
- splashPos.x += randPlusMinusPoint5Scaled(10 + (5 * i));
- splashPos.z += randPlusMinusPoint5Scaled(40 + (5 * i));
+ splashPos.x += Rand_CenteredFloat(10 + (5 * i));
+ splashPos.z += Rand_CenteredFloat(40 + (5 * i));
EffectSsGSplash_Spawn(play, &splashPos, NULL, NULL, 0, (Rand_ZeroOne() * 100.0f) + 400.0f);
}
} else {
diff --git a/src/overlays/actors/ovl_En_Pr/z_en_pr.c b/src/overlays/actors/ovl_En_Pr/z_en_pr.c
index 30fd0ee15..98762c907 100644
--- a/src/overlays/actors/ovl_En_Pr/z_en_pr.c
+++ b/src/overlays/actors/ovl_En_Pr/z_en_pr.c
@@ -319,7 +319,7 @@ void func_80A32A40(EnPr* this, PlayState* play) {
WaterBox* sp30;
Math_Vec3f_Copy(&sp34, &this->actor.world.pos);
- sp34.y = randPlusMinusPoint5Scaled(50.0f) + this->actor.home.pos.y;
+ sp34.y = Rand_CenteredFloat(50.0f) + this->actor.home.pos.y;
if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &this->unk_2B4,
&sp30)) {
@@ -551,9 +551,9 @@ void EnPr_Update(Actor* thisx, PlayState* play) {
Math_Vec3f_Copy(&sp40, &this->unk_2D4);
this->unk_204 = 0;
- sp40.x += randPlusMinusPoint5Scaled(20.0f);
- sp40.y += randPlusMinusPoint5Scaled(5.0f);
- sp40.z += randPlusMinusPoint5Scaled(20.0f);
+ sp40.x += Rand_CenteredFloat(20.0f);
+ sp40.y += Rand_CenteredFloat(5.0f);
+ sp40.z += Rand_CenteredFloat(20.0f);
for (i = 0; i < (s32)Rand_ZeroFloat(5.0f) + 5; i++) {
EffectSsBubble_Spawn(play, &sp40, 0.0f, 5.0f, 5.0f, Rand_ZeroFloat(0.03f) + 0.07f);
diff --git a/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c b/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c
index f4747b4c6..a4dd96d4b 100644
--- a/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c
+++ b/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c
@@ -390,8 +390,8 @@ void func_80A748E8(EnPr2* this, PlayState* play) {
if (this->unk_1DA == 1) {
this->unk_1D8 = Rand_S16Offset(100, 100);
Math_Vec3f_Copy(&sp3C, &this->unk_228);
- sp3C.x += randPlusMinusPoint5Scaled(300.0f);
- sp3C.z += randPlusMinusPoint5Scaled(300.0f);
+ sp3C.x += Rand_CenteredFloat(300.0f);
+ sp3C.z += Rand_CenteredFloat(300.0f);
Math_Vec3f_Copy(&this->unk_21C, &sp3C);
}
} else {
@@ -536,7 +536,7 @@ void func_80A751B4(EnPr2* this) {
this->actor.shape.rot.z = this->actor.world.rot.z;
this->unk_1D8 = 30;
this->actor.speed = Rand_ZeroFloat(0.5f);
- this->actor.world.rot.y = randPlusMinusPoint5Scaled(0x8000);
+ this->actor.world.rot.y = Rand_CenteredFloat(0x8000);
}
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 10);
this->unk_1D4 = 3;
@@ -596,9 +596,9 @@ void func_80A75310(EnPr2* this, PlayState* play) {
for (i = 0; i < 10; i++) {
Math_Vec3f_Copy(&sp64, &this->actor.world.pos);
- sp64.x += randPlusMinusPoint5Scaled(20.0f);
- sp64.y += randPlusMinusPoint5Scaled(5.0f);
- sp64.z += randPlusMinusPoint5Scaled(20.0f);
+ sp64.x += Rand_CenteredFloat(20.0f);
+ sp64.y += Rand_CenteredFloat(5.0f);
+ sp64.z += Rand_CenteredFloat(20.0f);
frame = Rand_ZeroFloat(0.03f) + 0.07f;
EffectSsBubble_Spawn(play, &sp64, 0.0f, 5.0f, 5.0f, frame);
@@ -675,9 +675,9 @@ void EnPr2_Update(Actor* thisx, PlayState* play) {
Math_Vec3f_Copy(&sp58, &this->unk_270);
this->unk_1D6 = false;
- sp58.x += randPlusMinusPoint5Scaled(20.0f);
- sp58.y += randPlusMinusPoint5Scaled(5.0f);
- sp58.z += randPlusMinusPoint5Scaled(20.0f);
+ sp58.x += Rand_CenteredFloat(20.0f);
+ sp58.y += Rand_CenteredFloat(5.0f);
+ sp58.z += Rand_CenteredFloat(20.0f);
for (i = 0; i < 2; i++) {
rand = Rand_ZeroFloat(0.03f) + 0.07f;
diff --git a/src/overlays/actors/ovl_En_Prz/z_en_prz.c b/src/overlays/actors/ovl_En_Prz/z_en_prz.c
index d71de14f7..ef37cf9f0 100644
--- a/src/overlays/actors/ovl_En_Prz/z_en_prz.c
+++ b/src/overlays/actors/ovl_En_Prz/z_en_prz.c
@@ -127,7 +127,7 @@ void EnPrz_Init(Actor* thisx, PlayState* play) {
this->unk_220 = &this->actor;
this->unk_1EC = 255;
- this->unk_202 = randPlusMinusPoint5Scaled((this->unk_1E6 * 100.0f) + 1000.0f);
+ this->unk_202 = Rand_CenteredFloat((this->unk_1E6 * 100.0f) + 1000.0f);
func_80A76388(this);
}
@@ -176,7 +176,7 @@ void func_80A76070(EnPrz* this, s16 arg1, PlayState* play) {
temp_s0 = -100;
}
- if (fabsf(this->actor.world.rot.y - (f32)arg1) < (randPlusMinusPoint5Scaled(20.0f) + 100.0f)) {
+ if (fabsf(this->actor.world.rot.y - (f32)arg1) < (Rand_CenteredFloat(20.0f) + 100.0f)) {
Math_ApproachZeroF(&this->unk_218, 0.5f, 20.0f);
} else {
Math_ApproachF(&this->unk_218, temp_s0, 0.5f, 5.0f);
@@ -218,7 +218,7 @@ s32 func_80A762C0(EnPrz* this, PlayState* play) {
}
void func_80A76388(EnPrz* this) {
- this->actor.speed = randPlusMinusPoint5Scaled(1.0f) + 4.0f;
+ this->actor.speed = Rand_CenteredFloat(1.0f) + 4.0f;
func_80A75F18(this, 0);
this->unk_1EA = 1;
this->actionFunc = func_80A763E8;
@@ -251,11 +251,11 @@ void func_80A763E8(EnPrz* this, PlayState* play) {
if ((this->unk_1EE == 0) && (this->unk_1F2 == 0)) {
s16 rot;
- this->unk_214 = randPlusMinusPoint5Scaled(40.0f);
+ this->unk_214 = Rand_CenteredFloat(40.0f);
rot = BINANG_ROT180(this->unk_220->world.rot.y);
this->unk_1D8.x += Math_SinS(rot) * this->unk_214;
- this->unk_1D8.y = randPlusMinusPoint5Scaled(40.0f) + (this->unk_220->world.pos.y + 40.0f);
+ this->unk_1D8.y = Rand_CenteredFloat(40.0f) + (this->unk_220->world.pos.y + 40.0f);
rot = BINANG_ROT180(this->unk_220->world.rot.y);
this->unk_1D8.z += Math_CosS(rot) * this->unk_214;
@@ -302,7 +302,7 @@ void func_80A76634(EnPrz* this, PlayState* play) {
}
void func_80A76748(EnPrz* this) {
- this->actor.speed = randPlusMinusPoint5Scaled(1.0f) + 3.0f;
+ this->actor.speed = Rand_CenteredFloat(1.0f) + 3.0f;
this->unk_1EE = 0;
this->unk_1EA = 3;
this->skelAnime.playSpeed = 2.0f;
@@ -317,7 +317,7 @@ void func_80A767A8(EnPrz* this, PlayState* play) {
if (func_80A762C0(this, play)) {
func_80A75F18(this, 0);
- this->actor.speed = randPlusMinusPoint5Scaled(1.0f) + 4.0f;
+ this->actor.speed = Rand_CenteredFloat(1.0f) + 4.0f;
func_80A76604(this, play);
return;
}
@@ -353,8 +353,8 @@ void func_80A767A8(EnPrz* this, PlayState* play) {
this->unk_1C8 = 1;
}
- this->unk_1D8.y = (player->actor.world.pos.y + D_80A771E0[GET_PLAYER_FORM]) +
- randPlusMinusPoint5Scaled((2.0f * this->unk_1E6) + 1.0f);
+ this->unk_1D8.y =
+ (player->actor.world.pos.y + D_80A771E0[GET_PLAYER_FORM]) + Rand_CenteredFloat((2.0f * this->unk_1E6) + 1.0f);
func_80A76070(this, Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_1D8), play);
}
@@ -374,7 +374,7 @@ void func_80A76A1C(EnPrz* this) {
this->unk_1FE = this->actor.world.rot.y;
this->actor.speed = Rand_ZeroFloat(0.5f);
- this->actor.world.rot.y = randPlusMinusPoint5Scaled(0x8000);
+ this->actor.world.rot.y = Rand_CenteredFloat(0x8000);
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 30);
this->unk_1EE = 50;
@@ -409,9 +409,9 @@ void func_80A76B14(EnPrz* this, PlayState* play) {
for (i = 0; i < 10; i++) {
Math_Vec3f_Copy(&sp6C, &this->actor.world.pos);
- sp6C.x += randPlusMinusPoint5Scaled(20.0f);
- sp6C.y += randPlusMinusPoint5Scaled(5.0f);
- sp6C.z += randPlusMinusPoint5Scaled(20.0f);
+ sp6C.x += Rand_CenteredFloat(20.0f);
+ sp6C.y += Rand_CenteredFloat(5.0f);
+ sp6C.z += Rand_CenteredFloat(20.0f);
EffectSsBubble_Spawn(play, &sp6C, 0.0f, 5.0f, 5.0f, Rand_ZeroFloat(0.03f) + 0.07f);
}
@@ -473,9 +473,9 @@ void EnPrz_Update(Actor* thisx, PlayState* play) {
Math_Vec3f_Copy(&sp38, &this->unk_1CC);
this->unk_1C8 = 0;
- sp38.x += randPlusMinusPoint5Scaled(20.0f);
- sp38.y += randPlusMinusPoint5Scaled(5.0f);
- sp38.z += randPlusMinusPoint5Scaled(20.0f);
+ sp38.x += Rand_CenteredFloat(20.0f);
+ sp38.y += Rand_CenteredFloat(5.0f);
+ sp38.z += Rand_CenteredFloat(20.0f);
EffectSsBubble_Spawn(play, &sp38, 0.0f, 5.0f, 5.0f, Rand_ZeroFloat(0.03f) + 0.07f);
}
diff --git a/src/overlays/actors/ovl_En_Racedog/z_en_racedog.c b/src/overlays/actors/ovl_En_Racedog/z_en_racedog.c
index ba7676655..d4e83a388 100644
--- a/src/overlays/actors/ovl_En_Racedog/z_en_racedog.c
+++ b/src/overlays/actors/ovl_En_Racedog/z_en_racedog.c
@@ -275,8 +275,8 @@ s16 EnRacedog_GetYRotation(Path* path, s32 pointIndex, Vec3f* pos, f32* distSQ)
if (path != NULL) {
point = Lib_SegmentedToVirtual(path->points);
point = &point[pointIndex];
- diffXRand = (randPlusMinusPoint5Scaled(100.0f) + point->x) - pos->x;
- diffZRand = (randPlusMinusPoint5Scaled(100.0f) + point->z) - pos->z;
+ diffXRand = (Rand_CenteredFloat(100.0f) + point->x) - pos->x;
+ diffZRand = (Rand_CenteredFloat(100.0f) + point->z) - pos->z;
diffX = point->x - pos->x;
diffZ = point->z - pos->z;
} else {
@@ -474,9 +474,9 @@ void EnRacedog_UpdateSpeed(EnRacedog* this) {
// The dog is past the very start, but is still less than 1/4th of the way through the race track.
// This code will give the blue dog a higher base speed than any other dog (6.0 instead of 5.0).
if (sDogInfo[this->index].color == DOG_COLOR_BLUE) {
- this->targetSpeed = sBaseSpeeds[sDogInfo[this->index].color][0] + randPlusMinusPoint5Scaled(1.0f);
+ this->targetSpeed = sBaseSpeeds[sDogInfo[this->index].color][0] + Rand_CenteredFloat(1.0f);
} else {
- this->targetSpeed = 5.0f + randPlusMinusPoint5Scaled(1.0f);
+ this->targetSpeed = 5.0f + Rand_CenteredFloat(1.0f);
}
if (DOG_IS_IN_GOOD_CONDITION(this) && (this->index != sFirstPlaceIndex)) {
@@ -485,9 +485,9 @@ void EnRacedog_UpdateSpeed(EnRacedog* this) {
} else if (this->currentPoint < (quarterPathCount * 3)) {
// The dog is between 1/4th and 3/4ths of the way through the race track.
if (this->currentPoint < sDogInfo[this->index].pointToUseSecondBaseSpeed) {
- this->targetSpeed = 5.0f + randPlusMinusPoint5Scaled(1.0f);
+ this->targetSpeed = 5.0f + Rand_CenteredFloat(1.0f);
} else {
- this->targetSpeed = sBaseSpeeds[sDogInfo[this->index].color][1] + randPlusMinusPoint5Scaled(1.0f);
+ this->targetSpeed = sBaseSpeeds[sDogInfo[this->index].color][1] + Rand_CenteredFloat(1.0f);
if (DOG_IS_IN_GOOD_CONDITION(this) && (this->index != sFirstPlaceIndex)) {
this->targetSpeed *= sDogInfo[this->index].goodConditionSpeedMultiplier;
@@ -497,7 +497,7 @@ void EnRacedog_UpdateSpeed(EnRacedog* this) {
// The dog is more than 3/4ths of the way through the race track.
EnRacedog_CalculateFinalStretchTargetSpeed(this);
} else {
- this->targetSpeed = randPlusMinusPoint5Scaled(1.0f) + 5.0f;
+ this->targetSpeed = Rand_CenteredFloat(1.0f) + 5.0f;
}
}
}
@@ -657,9 +657,9 @@ void EnRacedog_SpawnFloorDustRing(EnRacedog* this, PlayState* play) {
Vec3f pos;
if (((this->index + curFrame) % mod) == 0) {
- pos.x = this->actor.world.pos.x + randPlusMinusPoint5Scaled(15.0f);
+ pos.x = this->actor.world.pos.x + Rand_CenteredFloat(15.0f);
pos.y = this->actor.world.pos.y;
- pos.z = this->actor.world.pos.z + randPlusMinusPoint5Scaled(15.0f);
+ pos.z = this->actor.world.pos.z + Rand_CenteredFloat(15.0f);
Actor_SpawnFloorDustRing(play, &this->actor, &pos, 10.0f, 0, 2.0f, 300, 0, true);
}
}
diff --git a/src/overlays/actors/ovl_En_Raf/z_en_raf.c b/src/overlays/actors/ovl_En_Raf/z_en_raf.c
index 055b308f2..1a4024f51 100644
--- a/src/overlays/actors/ovl_En_Raf/z_en_raf.c
+++ b/src/overlays/actors/ovl_En_Raf/z_en_raf.c
@@ -895,9 +895,9 @@ void EnRaf_InitializeEffect(EnRaf* this, Vec3f* pos, Vec3f* velocity, Vec3f* acc
effect->accel = *accel;
effect->scale = scale;
effect->timer = timer;
- effect->rotation.x = randPlusMinusPoint5Scaled(30000.0f);
- effect->rotation.y = randPlusMinusPoint5Scaled(30000.0f);
- effect->rotation.z = randPlusMinusPoint5Scaled(30000.0f);
+ effect->rotation.x = Rand_CenteredFloat(30000.0f);
+ effect->rotation.y = Rand_CenteredFloat(30000.0f);
+ effect->rotation.z = Rand_CenteredFloat(30000.0f);
return;
}
}
diff --git a/src/overlays/actors/ovl_En_Rat/z_en_rat.c b/src/overlays/actors/ovl_En_Rat/z_en_rat.c
index 7d585c234..e08cb5574 100644
--- a/src/overlays/actors/ovl_En_Rat/z_en_rat.c
+++ b/src/overlays/actors/ovl_En_Rat/z_en_rat.c
@@ -230,7 +230,7 @@ s32 EnRat_UpdateFloorPoly(EnRat* this, CollisionPoly* floorPoly, PlayState* play
return false;
}
- angle = func_80086C48(normDotUp);
+ angle = Math_FAcosF(normDotUp);
if (angle < 0.001f) {
return false;
}
@@ -324,9 +324,9 @@ void EnRat_ChooseDirection(EnRat* this) {
angle -= 0x8000;
}
- angle += (s16)randPlusMinusPoint5Scaled(0x800);
+ angle += (s16)(s32)Rand_CenteredFloat(0x800);
} else {
- angle = (Rand_ZeroOne() < 0.1f) ? (s16)randPlusMinusPoint5Scaled(0x800) : 0;
+ angle = (Rand_ZeroOne() < 0.1f) ? (s16)(s32)Rand_CenteredFloat(0x800) : 0;
}
}
@@ -633,9 +633,9 @@ void EnRat_UpdateSparkOffsets(EnRat* this) {
for (i = 0; i < ARRAY_COUNT(this->sparkOffsets); i++) {
ptr = &this->sparkOffsets[i];
- ptr->x = randPlusMinusPoint5Scaled(6.0f);
- ptr->y = randPlusMinusPoint5Scaled(6.0f);
- ptr->z = randPlusMinusPoint5Scaled(6.0f);
+ ptr->x = Rand_CenteredFloat(6.0f);
+ ptr->y = Rand_CenteredFloat(6.0f);
+ ptr->z = Rand_CenteredFloat(6.0f);
}
}
@@ -937,14 +937,14 @@ void EnRat_PostLimbDraw(PlayState* play2, s32 limbIndex, Gfx** dList, Vec3s* rot
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, gBombCapDL);
if (EN_RAT_GET_TYPE(&this->actor) == EN_RAT_TYPE_DUNGEON) {
- redModifier = fabsf(cos_rad(this->timer * (M_PI / 30.f)));
+ redModifier = fabsf(Math_CosF(this->timer * (M_PI / 30.f)));
} else {
if (this->timer >= 120) {
- redModifier = fabsf(cos_rad((this->timer % 30) * (M_PI / 30.0f)));
+ redModifier = fabsf(Math_CosF((this->timer % 30) * (M_PI / 30.0f)));
} else if (this->timer >= 30) {
- redModifier = fabsf(cos_rad((this->timer % 6) * (M_PI / 6.0f)));
+ redModifier = fabsf(Math_CosF((this->timer % 6) * (M_PI / 6.0f)));
} else {
- redModifier = fabsf(cos_rad((this->timer % 3) * (M_PI / 3.0f)));
+ redModifier = fabsf(Math_CosF((this->timer % 3) * (M_PI / 3.0f)));
}
}
diff --git a/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c b/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c
index 351b2f146..dfff2735c 100644
--- a/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c
+++ b/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c
@@ -161,7 +161,7 @@ s32 EnRuppecrow_ReachedPointClockwise(EnRuppecrow* this, Path* path, s32 pointIn
diffZ = points[currentPoint + 1].z - points[currentPoint - 1].z;
}
- func_8017B7F8(&point, RAD_TO_BINANG(func_80086B30(diffX, diffZ)), &px, &pz, &d);
+ func_8017B7F8(&point, RAD_TO_BINANG(Math_FAtan2F(diffX, diffZ)), &px, &pz, &d);
if (((this->actor.world.pos.x * px) + (pz * this->actor.world.pos.z) + d) > 0.0f) {
reached = true;
}
@@ -194,7 +194,7 @@ s32 EnRuppecrow_ReachedPointCounterClockwise(EnRuppecrow* this, Path* path, s32
diffZ = points[currentPoint - 1].z - points[currentPoint + 1].z;
}
- func_8017B7F8(&point, RAD_TO_BINANG(func_80086B30(diffX, diffZ)), &px, &pz, &d);
+ func_8017B7F8(&point, RAD_TO_BINANG(Math_FAtan2F(diffX, diffZ)), &px, &pz, &d);
if (((this->actor.world.pos.x * px) + (pz * this->actor.world.pos.z) + d) > 0.0f) {
reached = true;
}
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 b34ee8c64..17ad656a4 100644
--- a/src/overlays/actors/ovl_En_Sb/z_en_sb.c
+++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.c
@@ -417,9 +417,9 @@ void EnSb_Draw(Actor* thisx, PlayState* play) {
fireDecr = this->fireCount - 1;
if (!(fireDecr & 1)) {
offset = &sFlamePosOffsets[fireDecr & 3];
- flamePos.x = randPlusMinusPoint5Scaled(5.0f) + (this->actor.world.pos.x + offset->x);
- flamePos.y = randPlusMinusPoint5Scaled(5.0f) + (this->actor.world.pos.y + offset->y);
- flamePos.z = randPlusMinusPoint5Scaled(5.0f) + (this->actor.world.pos.z + offset->z);
+ flamePos.x = Rand_CenteredFloat(5.0f) + (this->actor.world.pos.x + offset->x);
+ flamePos.y = Rand_CenteredFloat(5.0f) + (this->actor.world.pos.y + offset->y);
+ flamePos.z = Rand_CenteredFloat(5.0f) + (this->actor.world.pos.z + offset->z);
EffectSsEnFire_SpawnVec3f(play, &this->actor, &flamePos, 100, 0, 0, -1);
}
}
diff --git a/src/overlays/actors/ovl_En_Scopecrow/z_en_scopecrow.c b/src/overlays/actors/ovl_En_Scopecrow/z_en_scopecrow.c
index 9779de80c..448683376 100644
--- a/src/overlays/actors/ovl_En_Scopecrow/z_en_scopecrow.c
+++ b/src/overlays/actors/ovl_En_Scopecrow/z_en_scopecrow.c
@@ -192,7 +192,7 @@ s32 func_80BCD334(EnScopecrow* this, Path* path, s32 pointIndex) {
phi_fa1 = points[index + 1].z - points[index - 1].z;
}
- func_8017B7F8(&sp30, RAD_TO_BINANG(func_80086B30(phi_fa0, phi_fa1)), &sp3C.z, &sp3C.y, &sp3C.x);
+ func_8017B7F8(&sp30, RAD_TO_BINANG(Math_FAtan2F(phi_fa0, phi_fa1)), &sp3C.z, &sp3C.y, &sp3C.x);
if (((this->actor.world.pos.x * sp3C.z) + (sp3C.y * this->actor.world.pos.z) + sp3C.x) > 0.0f) {
ret = true;
diff --git a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c
index 08b4b2817..cf634321e 100644
--- a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c
+++ b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c
@@ -654,7 +654,7 @@ s32 func_80BCC2AC(EnScopenuts* this, Path* path, s32 arg2_) {
phi_f14 = sp5C[arg2 + 1].z - sp5C[arg2 - 1].z;
}
- func_8017B7F8(&sp30, RAD_TO_BINANG(func_80086B30(phi_f12, phi_f14)), &sp44, &sp40, &sp3C);
+ func_8017B7F8(&sp30, RAD_TO_BINANG(Math_FAtan2F(phi_f12, phi_f14)), &sp44, &sp40, &sp3C);
if (((this->actor.world.pos.x * sp44) + (sp40 * this->actor.world.pos.z) + sp3C) > 0.0f) {
sp50 = true;
diff --git a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c
index e22791c82..73edc4267 100644
--- a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c
+++ b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c
@@ -916,7 +916,7 @@ s32 func_80ADCE4C(EnSellnuts* this, Path* path, s32 arg2) {
pointY = points[var + 1].z - points[var - 1].z;
}
- func_8017B7F8(&sp30, RAD_TO_BINANG(func_80086B30(pointX, pointY)), &sp44, &sp40, &sp3C);
+ func_8017B7F8(&sp30, RAD_TO_BINANG(Math_FAtan2F(pointX, pointY)), &sp44, &sp40, &sp3C);
if (((this->actor.world.pos.x * sp44) + (sp40 * this->actor.world.pos.z) + sp3C) > 0.0f) {
ret = true;
}
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 e67808d38..a8167009c 100644
--- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c
+++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c
@@ -165,10 +165,10 @@ void func_809947B0(PlayState* play, EnSkb* this, Vec3f* inPos) {
s32 pad;
pos.y = this->actor.floorHeight;
- pos.x = (sin_rad(sp40) * 15.0f) + inPos->x;
- pos.z = (cos_rad(sp40) * 15.0f) + inPos->z;
- accel.x = randPlusMinusPoint5Scaled(1.0f);
- accel.z = randPlusMinusPoint5Scaled(1.0f);
+ pos.x = (Math_SinF(sp40) * 15.0f) + inPos->x;
+ pos.z = (Math_CosF(sp40) * 15.0f) + inPos->z;
+ accel.x = Rand_CenteredFloat(1.0f);
+ accel.z = Rand_CenteredFloat(1.0f);
velocity.y += (Rand_ZeroOne() - 0.5f) * 4.0f;
EffectSsHahen_Spawn(play, &pos, &velocity, &accel, 0, ((Rand_ZeroOne() * 5.0f) + 12.0f) * 0.8f,
HAHEN_OBJECT_DEFAULT, 10, NULL);
@@ -579,7 +579,7 @@ void func_80995A8C(EnSkb* this, PlayState* play) {
}
if ((this->unk_3D8 != 0) && ((play->gameplayFrames % 16) == 0)) {
- this->unk_3DA = randPlusMinusPoint5Scaled(50000.0f);
+ this->unk_3DA = Rand_CenteredFloat(50000.0f);
}
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer + this->unk_3DA, 1, 0x2EE, 0);
diff --git a/src/overlays/actors/ovl_En_Slime/z_en_slime.c b/src/overlays/actors/ovl_En_Slime/z_en_slime.c
index 5c962978e..5e71d1a54 100644
--- a/src/overlays/actors/ovl_En_Slime/z_en_slime.c
+++ b/src/overlays/actors/ovl_En_Slime/z_en_slime.c
@@ -328,15 +328,15 @@ void EnSlime_Idle(EnSlime* this, PlayState* play) {
timerFactor = sqrtf(this->timer) * 0.2f;
EnSlime_Blink(this);
- scale = ((sin_rad(this->timer * (2.0f * M_PI / 5.0f)) * (0.13f * timerFactor)) + 1.0f) * 0.01f;
+ scale = ((Math_SinF(this->timer * (2.0f * M_PI / 5.0f)) * (0.13f * timerFactor)) + 1.0f) * 0.01f;
this->actor.scale.x = scale;
this->actor.scale.z = scale;
if (this->timer < 24) {
- this->actor.scale.y = ((cos_rad(this->timer * (2.0f * M_PI / 5.0f)) * (0.05f * timerFactor)) + 1.0f) * 0.01f;
+ this->actor.scale.y = ((Math_CosF(this->timer * (2.0f * M_PI / 5.0f)) * (0.05f * timerFactor)) + 1.0f) * 0.01f;
}
- this->actor.shape.rot.x = randPlusMinusPoint5Scaled(0x200) * timerFactor;
- this->actor.shape.rot.z = randPlusMinusPoint5Scaled(0x200) * timerFactor;
+ this->actor.shape.rot.x = Rand_CenteredFloat(0x200) * timerFactor;
+ this->actor.shape.rot.z = Rand_CenteredFloat(0x200) * timerFactor;
// If player is not wearing the stone mask, is within 280 units of the chuchu,
// and the chuchu is facing the player, initialize chase/attack cycle.
@@ -361,7 +361,7 @@ void EnSlime_SetupMoveInDirection(EnSlime* this) {
if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 120.0f) {
this->idleRotY = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
} else if (Rand_ZeroOne() < 0.7f) {
- this->idleRotY = (s32)randPlusMinusPoint5Scaled(0x4000) + this->actor.shape.rot.y;
+ this->idleRotY = (s32)Rand_CenteredFloat(0x4000) + this->actor.shape.rot.y;
}
this->actor.world.rot.y = this->actor.shape.rot.y;
this->actionFunc = EnSlime_MoveInDirection;
@@ -390,7 +390,7 @@ void EnSlime_MoveInDirection(EnSlime* this, PlayState* play) {
}
// Update actor scale, xz speed, and rotation to provide amorphous effect
- sinFactor = fabsf(sin_rad(this->timer * (M_PI / 24)));
+ sinFactor = fabsf(Math_SinF(this->timer * (M_PI / 24)));
Math_StepToF(&this->actor.scale.z, ((0.15f * sinFactor) + 1.0f) * 0.01f, 0.0002f);
Math_StepToF(&this->actor.scale.x, (1.0f - (0.2f * sinFactor)) * 0.01f, 0.0002f);
Math_StepToF(&this->actor.scale.y, (1.0f - (0.1f * sinFactor)) * 0.01f, 0.0002f);
@@ -443,7 +443,7 @@ void EnSlime_MoveToHome(EnSlime* this, PlayState* play) {
this->idleRotY = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
}
- timerFactor = fabsf(sin_rad(this->timer * (M_PI / 24)));
+ timerFactor = fabsf(Math_SinF(this->timer * (M_PI / 24)));
Math_StepToF(&this->actor.scale.z, ((0.15f * timerFactor) + 1.0f) * 0.01f, 0.0002f);
Math_StepToF(&this->actor.scale.x, (1.0f - (0.2f * timerFactor)) * 0.01f, 0.0002f);
Math_StepToF(&this->actor.scale.y, (1.0f - (0.1f * timerFactor)) * 0.01f, 0.0002f);
@@ -567,14 +567,14 @@ void EnSlime_Land(EnSlime* this, PlayState* play) {
this->timer--;
scaleY = ((this->timer / 5) + 1) * 1.6f;
rotXZ = sqrtf(this->timer) * 0.2f;
- scaleXZ = ((cos_rad(this->timer * (2.0f * M_PI / 5.0f)) * (0.05f * scaleY)) + 1.0f) * 0.01f;
+ scaleXZ = ((Math_CosF(this->timer * (2.0f * M_PI / 5.0f)) * (0.05f * scaleY)) + 1.0f) * 0.01f;
this->actor.scale.x = scaleXZ;
this->actor.scale.z = scaleXZ;
if (this->timer < 15) {
- this->actor.scale.y = (1.0f - (sin_rad(this->timer * (2.0f * M_PI / 5.0f)) * (0.04f * scaleY))) * 0.01f;
+ this->actor.scale.y = (1.0f - (Math_SinF(this->timer * (2.0f * M_PI / 5.0f)) * (0.04f * scaleY))) * 0.01f;
}
- this->actor.shape.rot.x = randPlusMinusPoint5Scaled(0x200) * rotXZ;
- this->actor.shape.rot.z = randPlusMinusPoint5Scaled(0x200) * rotXZ;
+ this->actor.shape.rot.x = Rand_CenteredFloat(0x200) * rotXZ;
+ this->actor.shape.rot.z = Rand_CenteredFloat(0x200) * rotXZ;
if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > this->distLimit) {
EnSlime_SetupMoveToHome(this);
@@ -623,16 +623,16 @@ void EnSlime_ReactToBluntHit(EnSlime* this, PlayState* play) {
Math_StepToF(&this->actor.speed, 0.0f, 1.0f);
timerFactor = sqrtf(this->timer);
if (this->timer < 30) {
- scale = ((cos_rad(this->timer * (2.0f * M_PI / 5.0f)) * (0.08f * timerFactor)) + 1.0f) * 0.01f;
+ scale = ((Math_CosF(this->timer * (2.0f * M_PI / 5.0f)) * (0.08f * timerFactor)) + 1.0f) * 0.01f;
this->actor.scale.x = scale;
this->actor.scale.z = scale;
}
if (this->timer == 15) {
this->collider.base.acFlags |= AC_ON;
}
- this->actor.scale.y = ((sin_rad((f32)this->timer * (2.0f * M_PI / 5.0f)) * (0.07f * timerFactor)) + 1.0f) * 0.01f;
- this->actor.shape.rot.x = randPlusMinusPoint5Scaled(0x200) * timerFactor;
- this->actor.shape.rot.z = randPlusMinusPoint5Scaled(0x200) * timerFactor;
+ this->actor.scale.y = ((Math_SinF((f32)this->timer * (2.0f * M_PI / 5.0f)) * (0.07f * timerFactor)) + 1.0f) * 0.01f;
+ this->actor.shape.rot.x = Rand_CenteredFloat(0x200) * timerFactor;
+ this->actor.shape.rot.z = Rand_CenteredFloat(0x200) * timerFactor;
if (this->timer == 0) {
if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > this->distLimit) {
@@ -680,9 +680,9 @@ void EnSlime_SetupDamaged(EnSlime* this, PlayState* play, s32 arg2) {
EffectSsGSplash_Spawn(play, &effectPos, NULL, NULL, 1, 550);
for (i = 0; i < 10; i++) {
- effectPos.x = randPlusMinusPoint5Scaled(40.0f) + this->actor.world.pos.x + ySin;
- effectPos.y = randPlusMinusPoint5Scaled(10.0f) + this->actor.world.pos.y + 40.0f;
- effectPos.z = randPlusMinusPoint5Scaled(40.0f) + this->actor.world.pos.z + yCos;
+ effectPos.x = Rand_CenteredFloat(40.0f) + this->actor.world.pos.x + ySin;
+ effectPos.y = Rand_CenteredFloat(10.0f) + this->actor.world.pos.y + 40.0f;
+ effectPos.z = Rand_CenteredFloat(40.0f) + this->actor.world.pos.z + yCos;
effectVelocity.x = ((Rand_ZeroOne() * 3.5f) + 1.0f) * -Math_SinS(this->actor.world.rot.y);
effectVelocity.z = ((Rand_ZeroOne() * 3.5f) + 1.0f) * -Math_CosS(this->actor.world.rot.y);
@@ -1184,9 +1184,9 @@ void EnSlime_Draw(Actor* thisx, PlayState* play) {
}
if (this->actionFunc == EnSlime_Damaged) {
- wobbleScale.x = 1.0f - (sin_rad((f32)this->timer * (M_PI / 2.0f)) * 0.3f);
- wobbleScale.y = (sin_rad((f32)this->timer * (M_PI / 2.0f)) * 0.3f) + 1.0f;
- wobbleScale.z = 1.0f - (cos_rad((f32)this->timer * (M_PI / 2.0f)) * 0.3f);
+ wobbleScale.x = 1.0f - (Math_SinF((f32)this->timer * (M_PI / 2.0f)) * 0.3f);
+ wobbleScale.y = (Math_SinF((f32)this->timer * (M_PI / 2.0f)) * 0.3f) + 1.0f;
+ wobbleScale.z = 1.0f - (Math_CosF((f32)this->timer * (M_PI / 2.0f)) * 0.3f);
Matrix_RotateXFApply(this->wobbleRot.x);
Matrix_RotateZF(this->wobbleRot.z, MTXMODE_APPLY);
diff --git a/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c b/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c
index ed3235345..e22a5a73b 100644
--- a/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c
+++ b/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c
@@ -475,18 +475,18 @@ void EnSnowman_ReadySnowball(EnSnowman* this, PlayState* play) {
Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x1000);
if ((EN_SNOWMAN_GET_TYPE(&this->actor) != EN_SNOWMAN_TYPE_LARGE) && this->isHoldingSnowball &&
((play->gameplayFrames % 2) != 0)) {
- pos.x = randPlusMinusPoint5Scaled(10.0f) + this->snowballPos.x;
- pos.y = randPlusMinusPoint5Scaled(10.0f) + this->snowballPos.y;
- pos.z = randPlusMinusPoint5Scaled(10.0f) + this->snowballPos.z;
+ pos.x = Rand_CenteredFloat(10.0f) + this->snowballPos.x;
+ pos.y = Rand_CenteredFloat(10.0f) + this->snowballPos.y;
+ pos.z = Rand_CenteredFloat(10.0f) + this->snowballPos.z;
func_800B0DE0(play, &pos, &sDustVelocity, &gZeroVec3f, &sDustPrimColor, &sDustEnvColor, 500, 30);
} else if (EN_SNOWMAN_GET_TYPE(&this->actor) == EN_SNOWMAN_TYPE_LARGE) {
if ((this->skelAnime.curFrame > 3.0f) && (this->skelAnime.curFrame < 14.0f) &&
((play->gameplayFrames % 2) != 0)) {
- pos.x = (this->actor.world.pos.x + (70.0f * Math_SinS(this->actor.shape.rot.y))) +
- randPlusMinusPoint5Scaled(40.0f);
- pos.y = this->actor.world.pos.y + randPlusMinusPoint5Scaled(20.0f);
- pos.z = (this->actor.world.pos.z + (70.0f * Math_CosS(this->actor.shape.rot.y))) +
- randPlusMinusPoint5Scaled(40.0f);
+ pos.x =
+ (this->actor.world.pos.x + (70.0f * Math_SinS(this->actor.shape.rot.y))) + Rand_CenteredFloat(40.0f);
+ pos.y = this->actor.world.pos.y + Rand_CenteredFloat(20.0f);
+ pos.z =
+ (this->actor.world.pos.z + (70.0f * Math_CosS(this->actor.shape.rot.y))) + Rand_CenteredFloat(40.0f);
func_800B0DE0(play, &pos, &sDustVelocity, &gZeroVec3f, &sDustPrimColor, &sDustEnvColor, 1000, 150);
}
}
@@ -619,8 +619,8 @@ void EnSnowman_Melt(EnSnowman* this, PlayState* play) {
this->work.timer--;
if ((this->work.timer >= 38) && (!(this->work.timer & 1))) {
smokeVelocity.y = (this->work.timer - 38) * (1.0f / 12.0f);
- smokeVelocity.x = randPlusMinusPoint5Scaled(1.5f) * smokeVelocity.y;
- smokeVelocity.z = randPlusMinusPoint5Scaled(1.5f) * smokeVelocity.y;
+ smokeVelocity.x = Rand_CenteredFloat(1.5f) * smokeVelocity.y;
+ smokeVelocity.z = Rand_CenteredFloat(1.5f) * smokeVelocity.y;
smokeVelocity.y += 0.8f;
smokePos.x = ((smokeVelocity.x >= 0.0f ? 1.0f : -1.0f) * Rand_ZeroFloat(20.0f) * this->eenoScale) +
this->actor.world.pos.x;
diff --git a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c
index e86d1e1bd..12d8d22a8 100644
--- a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c
+++ b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c
@@ -536,9 +536,9 @@ void func_80BAB374(EnSuttari* this, PlayState* play) {
Vec3f sp38;
if ((curFrame % 3) == 0) {
- sp38.x = randPlusMinusPoint5Scaled(15.0f) + this->actor.world.pos.x;
+ sp38.x = Rand_CenteredFloat(15.0f) + this->actor.world.pos.x;
sp38.y = this->actor.world.pos.y;
- sp38.z = randPlusMinusPoint5Scaled(15.0f) + this->actor.world.pos.z;
+ sp38.z = Rand_CenteredFloat(15.0f) + this->actor.world.pos.z;
Actor_SpawnFloorDustRing(play, &this->actor, &sp38, 10.0f, 0, 2.0f, 0, 0, 0);
}
}
@@ -623,7 +623,7 @@ s32 func_80BAB758(EnSuttari* this, Path* path, s32 arg2) {
sp54 = sp5C[index + 1].x - sp5C[index - 1].x;
sp48 = sp5C[index + 1].z - sp5C[index - 1].z;
}
- func_8017B7F8(&sp30, RAD_TO_BINANG(func_80086B30(sp54, sp48)), &sp44, &sp40, &sp3C);
+ func_8017B7F8(&sp30, RAD_TO_BINANG(Math_FAtan2F(sp54, sp48)), &sp44, &sp40, &sp3C);
if (((sp44 * this->actor.world.pos.x) + (sp40 * this->actor.world.pos.z) + sp3C) > 0.0f) {
ret = true;
}
@@ -653,7 +653,7 @@ s32 func_80BAB8F4(EnSuttari* this, Path* path, s32 arg2) {
sp54 = sp5C[index - 1].x - sp5C[index + 1].x;
sp48 = sp5C[index - 1].z - sp5C[index + 1].z;
}
- func_8017B7F8(&sp30, RAD_TO_BINANG(func_80086B30(sp54, sp48)), &sp44, &sp40, &sp3C);
+ func_8017B7F8(&sp30, RAD_TO_BINANG(Math_FAtan2F(sp54, sp48)), &sp44, &sp40, &sp3C);
if (((sp44 * this->actor.world.pos.x) + (sp40 * this->actor.world.pos.z) + sp3C) > 0.0f) {
ret = true;
}
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 a705a8546..4937125dc 100644
--- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c
+++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c
@@ -304,7 +304,7 @@ s32 func_808D91C4(EnSw* this, CollisionPoly* arg1) {
return false;
}
- sp4C = func_80086C48(temp_f12);
+ sp4C = Math_FAcosF(temp_f12);
if (sp4C < 0.001f) {
return false;
}
diff --git a/src/overlays/actors/ovl_En_Syateki_Crow/z_en_syateki_crow.c b/src/overlays/actors/ovl_En_Syateki_Crow/z_en_syateki_crow.c
index 5f5194523..af419ba23 100644
--- a/src/overlays/actors/ovl_En_Syateki_Crow/z_en_syateki_crow.c
+++ b/src/overlays/actors/ovl_En_Syateki_Crow/z_en_syateki_crow.c
@@ -292,9 +292,9 @@ s32 EnSyatekiCrow_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList,
EnSyatekiCrow* this = THIS;
if (limbIndex == OBJECT_CROW_LIMB_UPPER_TAIL) {
- rot->y += (s16)(0xC00 * sin_rad(this->skelAnime.curFrame * (M_PI / 4)));
+ rot->y += (s16)(0xC00 * Math_SinF(this->skelAnime.curFrame * (M_PI / 4)));
} else if (limbIndex == OBJECT_CROW_LIMB_TAIL) {
- rot->y += (s16)(0x1400 * sin_rad((this->skelAnime.curFrame + 2.5f) * (M_PI / 4)));
+ rot->y += (s16)(0x1400 * Math_SinF((this->skelAnime.curFrame + 2.5f) * (M_PI / 4)));
}
return false;
diff --git a/src/overlays/actors/ovl_En_Syateki_Okuta/z_en_syateki_okuta.c b/src/overlays/actors/ovl_En_Syateki_Okuta/z_en_syateki_okuta.c
index 324307d8a..91ed08140 100644
--- a/src/overlays/actors/ovl_En_Syateki_Okuta/z_en_syateki_okuta.c
+++ b/src/overlays/actors/ovl_En_Syateki_Okuta/z_en_syateki_okuta.c
@@ -404,7 +404,7 @@ void func_80A36CB0(EnSyatekiOkuta* this) {
}
} else if (this->actionFunc == func_80A36488) {
this->unk_1D8.x = this->unk_1D8.z = 1.0f;
- this->unk_1D8.y = (sin_rad((M_PI / 16) * curFrame) * 0.2f) + 1.0f;
+ this->unk_1D8.y = (Math_SinF((M_PI / 16) * curFrame) * 0.2f) + 1.0f;
} else if (this->actionFunc == func_80A36504) {
if (curFrame < 3.0f) {
this->unk_1D8.y = 1.0f;
@@ -440,7 +440,7 @@ s32 func_80A370EC(EnSyatekiOkuta* this, f32 arg1, Vec3f* arg2) {
if (this->actionFunc == func_80A363B4) {
arg2->y = 1.0f;
arg2->z = 1.0f;
- arg2->x = (sin_rad((M_PI / 16) * arg1) * 0.4f) + 1.0f;
+ arg2->x = (Math_SinF((M_PI / 16) * arg1) * 0.4f) + 1.0f;
} else if (this->actionFunc == func_80A365EC) {
if ((arg1 >= 35.0f) || (arg1 < 25.0f)) {
return false;
diff --git a/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.c b/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.c
index 52aa71cad..347d78088 100644
--- a/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.c
+++ b/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.c
@@ -408,9 +408,9 @@ void EnSyatekiWf_Dead(EnSyatekiWf* this, PlayState* play) {
s32 i;
for (i = (s32)this->skelAnime.animLength - (s32)this->skelAnime.curFrame; i >= 0; i--) {
- firePos.x = randPlusMinusPoint5Scaled(60.0f) + this->actor.world.pos.x;
- firePos.z = randPlusMinusPoint5Scaled(60.0f) + this->actor.world.pos.z;
- firePos.y = randPlusMinusPoint5Scaled(50.0f) + (this->actor.world.pos.y + 20.0f);
+ firePos.x = Rand_CenteredFloat(60.0f) + this->actor.world.pos.x;
+ firePos.z = Rand_CenteredFloat(60.0f) + this->actor.world.pos.z;
+ firePos.y = Rand_CenteredFloat(50.0f) + (this->actor.world.pos.y + 20.0f);
func_800B3030(play, &firePos, &sFireVelocityAndAccel, &sFireVelocityAndAccel, 100, 0, 2);
}
}
diff --git a/src/overlays/actors/ovl_En_Tanron1/z_en_tanron1.c b/src/overlays/actors/ovl_En_Tanron1/z_en_tanron1.c
index 495c16c13..c71676061 100644
--- a/src/overlays/actors/ovl_En_Tanron1/z_en_tanron1.c
+++ b/src/overlays/actors/ovl_En_Tanron1/z_en_tanron1.c
@@ -248,9 +248,9 @@ void func_80BB5318(EnTanron1* this, PlayState* play) {
ptr->unk_20 = Math_Atan2S(temp.x, temp.z);
ptr->unk_1E = Math_Atan2S(temp.y, sqrtf(SQXZ(temp)));
if ((ptr->unk_26 & 0xF) == 0) {
- ptr->unk_30 = randPlusMinusPoint5Scaled(temp_f30);
- ptr->unk_34 = randPlusMinusPoint5Scaled(temp_f30 * 0.5f);
- ptr->unk_38 = randPlusMinusPoint5Scaled(temp_f30);
+ ptr->unk_30 = Rand_CenteredFloat(temp_f30);
+ ptr->unk_34 = Rand_CenteredFloat(temp_f30 * 0.5f);
+ ptr->unk_38 = Rand_CenteredFloat(temp_f30);
}
temp.x = player->actor.world.pos.x - ptr->unk_00.x;
@@ -336,7 +336,7 @@ void func_80BB5318(EnTanron1* this, PlayState* play) {
Math_ApproachF(&ptr->unk_30, ptr->unk_34, 1.0f, 0.5f);
if ((ptr->unk_26 & 0xF) == 0) {
if (Rand_ZeroOne() < 0.5f) {
- ptr->unk_34 = randPlusMinusPoint5Scaled(12.0f);
+ ptr->unk_34 = Rand_CenteredFloat(12.0f);
}
ptr->unk_3C = BgCheck_EntityRaycastFloor1(&play->colCtx, &sp98, &ptr->unk_00);
sp9C = ptr->unk_00.y;
diff --git a/src/overlays/actors/ovl_En_Tanron2/z_en_tanron2.c b/src/overlays/actors/ovl_En_Tanron2/z_en_tanron2.c
index dd4f389a3..785308dad 100644
--- a/src/overlays/actors/ovl_En_Tanron2/z_en_tanron2.c
+++ b/src/overlays/actors/ovl_En_Tanron2/z_en_tanron2.c
@@ -236,7 +236,7 @@ void func_80BB6BD8(EnTanron2* this, PlayState* play) {
switch (this->unk_158) {
case 0:
if (Rand_ZeroOne() > 0.2f) {
- sp32 = Rand_ZeroFloat(65536.0f);
+ sp32 = Rand_ZeroFloat(0x10000);
} else {
sp32 = Math_Atan2S(sp2C, sp28);
}
diff --git a/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c b/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c
index b86b9c714..81a4ac2af 100644
--- a/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c
+++ b/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c
@@ -100,8 +100,8 @@ void EnTanron3_CreateEffect(PlayState* play, Vec3f* effectPos) {
effectPtr->unk_34.y = 0.0f;
effectPtr->unk_34.z = Rand_ZeroFloat(2 * M_PI);
effectPtr->unk_02 = Rand_ZeroFloat(100.0f);
- effectPtr->velocity.x = randPlusMinusPoint5Scaled(25.0f);
- effectPtr->velocity.z = randPlusMinusPoint5Scaled(25.0f);
+ effectPtr->velocity.x = Rand_CenteredFloat(25.0f);
+ effectPtr->velocity.z = Rand_CenteredFloat(25.0f);
break;
}
}
@@ -155,9 +155,9 @@ void EnTanron3_SetupLive(EnTanron3* this, PlayState* play) {
this->workTimer[WORK_TIMER_PICK_NEW_DEVIATION] = 50;
this->actor.speed = 5.0f;
this->speedMaxStep = 0.5f;
- this->deviation.x = randPlusMinusPoint5Scaled(500.0f);
- this->deviation.y = randPlusMinusPoint5Scaled(100.0f);
- this->deviation.z = randPlusMinusPoint5Scaled(500.0f);
+ this->deviation.x = Rand_CenteredFloat(500.0f);
+ this->deviation.y = Rand_CenteredFloat(100.0f);
+ this->deviation.z = Rand_CenteredFloat(500.0f);
Math_Vec3f_Copy(&this->targetPos, &this->actor.world.pos);
this->timer = Rand_ZeroFloat(100.0f);
}
@@ -245,9 +245,9 @@ void EnTanron3_Live(EnTanron3* this, PlayState* play) {
if (this->workTimer[WORK_TIMER_OUT_OF_WATER] == 0) {
if ((this->workTimer[WORK_TIMER_PICK_NEW_DEVIATION] == 0) && (this->actor.speed > 1.0f)) {
this->workTimer[WORK_TIMER_PICK_NEW_DEVIATION] = Rand_ZeroFloat(20.0f);
- this->deviation.x = randPlusMinusPoint5Scaled(100.0f);
- this->deviation.y = randPlusMinusPoint5Scaled(50.0f + extraScaleY);
- this->deviation.z = randPlusMinusPoint5Scaled(100.0f);
+ this->deviation.x = Rand_CenteredFloat(100.0f);
+ this->deviation.y = Rand_CenteredFloat(50.0f + extraScaleY);
+ this->deviation.z = Rand_CenteredFloat(100.0f);
}
this->targetPosWithDeviation.y = this->targetPos.y + this->deviation.y + 50.0f;
}
@@ -297,17 +297,17 @@ void EnTanron3_Live(EnTanron3* this, PlayState* play) {
this->actor.speed = Rand_ZeroFloat(2.0f) + 2.0f;
if (Rand_ZeroOne() < 0.5f) {
this->targetShapeRotation.x =
- (s16)randPlusMinusPoint5Scaled(500.0f) + this->targetShapeRotation.x + 0x8000;
+ (s16)(s32)Rand_CenteredFloat(0x1F4) + this->targetShapeRotation.x + 0x8000;
}
if (Rand_ZeroOne() < 0.5f) {
this->targetShapeRotation.z =
- (s16)randPlusMinusPoint5Scaled(500.0f) + this->targetShapeRotation.z + 0x8000;
+ (s16)(s32)Rand_CenteredFloat(0x1F4) + this->targetShapeRotation.z + 0x8000;
}
if (Rand_ZeroOne() < 0.5f) {
this->targetShapeRotation.y = (s16)Rand_ZeroFloat(0x10000);
}
this->actor.world.rot.y = Math_Atan2S_XY(this->actor.world.pos.z, this->actor.world.pos.x) +
- (s16)randPlusMinusPoint5Scaled(0xCE20);
+ (s16)(s32)Rand_CenteredFloat(0xCE20);
}
Math_ApproachS(&this->actor.shape.rot.y, this->targetShapeRotation.y, 3, 0x500);
@@ -316,9 +316,9 @@ void EnTanron3_Live(EnTanron3* this, PlayState* play) {
if ((Rand_ZeroOne() < 0.5f) & !(this->timer & 0x3)) {
Vec3f effectPos;
- effectPos.x = randPlusMinusPoint5Scaled(30.0f) + this->actor.world.pos.x;
+ effectPos.x = Rand_CenteredFloat(30.0f) + this->actor.world.pos.x;
effectPos.y = this->actor.world.pos.y;
- effectPos.z = randPlusMinusPoint5Scaled(30.0f) + this->actor.world.pos.z;
+ effectPos.z = Rand_CenteredFloat(30.0f) + this->actor.world.pos.z;
EnTanron3_CreateEffect(play, &effectPos);
}
break;
diff --git a/src/overlays/actors/ovl_En_Tanron4/z_en_tanron4.c b/src/overlays/actors/ovl_En_Tanron4/z_en_tanron4.c
index 5c62c50ee..074eaec79 100644
--- a/src/overlays/actors/ovl_En_Tanron4/z_en_tanron4.c
+++ b/src/overlays/actors/ovl_En_Tanron4/z_en_tanron4.c
@@ -65,10 +65,9 @@ void EnTanron4_Init(Actor* thisx, PlayState* play2) {
s32 i;
for (i = 0; i < thisx->params; i++) {
- Actor_Spawn(&play->actorCtx, play, ACTOR_EN_TANRON4,
- thisx->world.pos.x + randPlusMinusPoint5Scaled(500.0f),
- thisx->world.pos.y + randPlusMinusPoint5Scaled(100.0f),
- thisx->world.pos.z + randPlusMinusPoint5Scaled(500.0f), 0, Rand_ZeroFloat(65536.0f), 0,
+ Actor_Spawn(&play->actorCtx, play, ACTOR_EN_TANRON4, thisx->world.pos.x + Rand_CenteredFloat(500.0f),
+ thisx->world.pos.y + Rand_CenteredFloat(100.0f),
+ thisx->world.pos.z + Rand_CenteredFloat(500.0f), 0, Rand_ZeroFloat(0x10000), 0,
SEAGULL_CLONE);
}
}
@@ -112,9 +111,9 @@ void EnTanron4_FlyNearHome(EnTanron4* this, PlayState* play) {
distToTarget = sqrtf(SQ(xDiff) + SQ(zDiff));
if ((this->timers[SEAGULL_TIMER_CHOOSE_TARGET] == 0) || (distToTarget < 100.0f)) {
- this->targetPos.x = this->actor.home.pos.x + randPlusMinusPoint5Scaled(500.0f);
- this->targetPos.y = this->actor.home.pos.y + randPlusMinusPoint5Scaled(100.0f);
- this->targetPos.z = this->actor.home.pos.z + randPlusMinusPoint5Scaled(500.0f);
+ this->targetPos.x = this->actor.home.pos.x + Rand_CenteredFloat(500.0f);
+ this->targetPos.y = this->actor.home.pos.y + Rand_CenteredFloat(100.0f);
+ this->targetPos.z = this->actor.home.pos.z + Rand_CenteredFloat(500.0f);
this->timers[SEAGULL_TIMER_CHOOSE_TARGET] = Rand_ZeroFloat(100.0f) + 60.0f;
this->step = 0;
@@ -151,7 +150,7 @@ void EnTanron4_FlyNearHome(EnTanron4* this, PlayState* play) {
case SEAGULL_FLY_GLIDE:
if (((this->randRollTimer % 8) == 0) && (Rand_ZeroOne() < 0.5f)) {
- this->rollTarget = randPlusMinusPoint5Scaled(3000.0f + KREG(44));
+ this->rollTarget = Rand_CenteredFloat(3000.0f + KREG(44));
}
if (this->timers[SEAGULL_TIMER_FLY_STATE] == 0) {
@@ -192,9 +191,9 @@ void EnTanron4_FlyNearActor(EnTanron4* this, PlayState* play) {
distToTarget = sqrtf(SQ(xDiff) + SQ(zDiff));
if ((this->timers[SEAGULL_TIMER_CHOOSE_TARGET] == 0) || (distToTarget < 100.0f)) {
- this->targetPos.x = targetActor->world.pos.x + randPlusMinusPoint5Scaled(200.0f + KREG(82));
- this->targetPos.y = targetActor->world.pos.y + KREG(80) + 100.0f + randPlusMinusPoint5Scaled(100.0f + KREG(81));
- this->targetPos.z = targetActor->world.pos.z + randPlusMinusPoint5Scaled(200.0f + KREG(82));
+ this->targetPos.x = targetActor->world.pos.x + Rand_CenteredFloat(200.0f + KREG(82));
+ this->targetPos.y = targetActor->world.pos.y + KREG(80) + 100.0f + Rand_CenteredFloat(100.0f + KREG(81));
+ this->targetPos.z = targetActor->world.pos.z + Rand_CenteredFloat(200.0f + KREG(82));
this->timers[SEAGULL_TIMER_CHOOSE_TARGET] = Rand_ZeroFloat(100.0f) + 60.0f;
this->step = 0;
@@ -230,7 +229,7 @@ void EnTanron4_FlyNearActor(EnTanron4* this, PlayState* play) {
case SEAGULL_FLY_GLIDE:
if (((this->randRollTimer % 8) == 0) && (Rand_ZeroOne() < 0.5f)) {
- this->rollTarget = randPlusMinusPoint5Scaled(3000.0f + KREG(44));
+ this->rollTarget = Rand_CenteredFloat(3000.0f + KREG(44));
}
if (this->timers[SEAGULL_TIMER_FLY_STATE] == 0) {
diff --git a/src/overlays/actors/ovl_En_Tanron5/z_en_tanron5.c b/src/overlays/actors/ovl_En_Tanron5/z_en_tanron5.c
index 18e24c5e7..a56b01c3b 100644
--- a/src/overlays/actors/ovl_En_Tanron5/z_en_tanron5.c
+++ b/src/overlays/actors/ovl_En_Tanron5/z_en_tanron5.c
@@ -101,9 +101,9 @@ void func_80BE4930(EnTanron5Effect* effect, Vec3f* arg1, f32 arg2) {
effect->unk_00 = *arg1;
- effect->unk_0C = randPlusMinusPoint5Scaled(10.0f);
+ effect->unk_0C = Rand_CenteredFloat(10.0f);
effect->unk_10 = Rand_ZeroFloat(2.0f) + 3.0f;
- effect->unk_14 = randPlusMinusPoint5Scaled(10.0f);
+ effect->unk_14 = Rand_CenteredFloat(10.0f);
effect->unk_18.y = -0.15f;
effect->unk_18.x = 0.0f;
@@ -127,9 +127,9 @@ void func_80BE4A2C(EnTanron5Effect* effect, Vec3f* arg1, f32 arg2) {
effect->unk_00 = *arg1;
- effect->unk_0C = randPlusMinusPoint5Scaled(30.0f);
+ effect->unk_0C = Rand_CenteredFloat(30.0f);
effect->unk_10 = Rand_ZeroFloat(7.0f);
- effect->unk_14 = randPlusMinusPoint5Scaled(30.0f);
+ effect->unk_14 = Rand_CenteredFloat(30.0f);
effect->unk_18.y = -0.3f;
effect->unk_18.x = 0.0f;
@@ -154,8 +154,8 @@ void EnTanron5_Init(Actor* thisx, PlayState* play) {
return;
}
- this->unk_198 = randPlusMinusPoint5Scaled(0x2000);
- this->unk_19A = randPlusMinusPoint5Scaled(0x2000);
+ this->unk_198 = Rand_CenteredFloat(0x2000);
+ this->unk_19A = Rand_CenteredFloat(0x2000);
if (ENTANRON5_GET(&this->actor) < ENTANRON5_107) {
Actor_SetScale(&this->actor, (Rand_ZeroFloat(0.025f) + 0.085f) * D_80BE5DD0);
@@ -327,8 +327,8 @@ void EnTanron5_Update(Actor* thisx, PlayState* play2) {
spAC = 50.0f;
}
- sp9C.x = (randPlusMinusPoint5Scaled(spA8) * D_80BE5DD0) + spB8.x;
- sp9C.z = (randPlusMinusPoint5Scaled(spA8) * D_80BE5DD0) + spB8.z;
+ sp9C.x = (Rand_CenteredFloat(spA8) * D_80BE5DD0) + spB8.x;
+ sp9C.z = (Rand_CenteredFloat(spA8) * D_80BE5DD0) + spB8.z;
sp9C.y = this->actor.floorHeight + (spAC * D_80BE5DD0);
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_TANRON5, sp9C.x, sp9C.y, sp9C.z,
diff --git a/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c b/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c
index 2bef1cda2..87589ae8c 100644
--- a/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c
+++ b/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c
@@ -193,12 +193,12 @@ void func_80C10984(EnThiefbird* this, s32 arg1) {
for (i = 0; i < ARRAY_COUNT(this->unk_3F0); i++, ptr++) {
if (ptr->unk_22 == 0) {
ptr->unk_22 = (s32)Rand_ZeroFloat(20.0f) + 40;
- ptr->unk_00.x = randPlusMinusPoint5Scaled(30.0f) + this->actor.focus.pos.x;
- ptr->unk_00.y = randPlusMinusPoint5Scaled(30.0f) + this->actor.focus.pos.y;
- ptr->unk_00.z = randPlusMinusPoint5Scaled(30.0f) + this->actor.focus.pos.z;
- ptr->unk_0C.x = randPlusMinusPoint5Scaled(5.0f);
+ ptr->unk_00.x = Rand_CenteredFloat(30.0f) + this->actor.focus.pos.x;
+ ptr->unk_00.y = Rand_CenteredFloat(30.0f) + this->actor.focus.pos.y;
+ ptr->unk_00.z = Rand_CenteredFloat(30.0f) + this->actor.focus.pos.z;
+ ptr->unk_0C.x = Rand_CenteredFloat(5.0f);
ptr->unk_0C.y = Rand_ZeroOne() + 2.0f;
- ptr->unk_0C.z = randPlusMinusPoint5Scaled(5.0f);
+ ptr->unk_0C.z = Rand_CenteredFloat(5.0f);
ptr->unk_1C = Rand_ZeroFloat(1000.0f);
ptr->unk_18 = (Rand_ZeroFloat(20.0f) + 40.0f) * 0.0001f;
ptr->unk_1E = (s32)Rand_Next() >> 0x10;
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 cfae13191..1ae0e073b 100644
--- a/src/overlays/actors/ovl_En_Tite/z_en_tite.c
+++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.c
@@ -253,9 +253,9 @@ void func_80893BCC(EnTite* this, PlayState* play) {
for (i = 5; i < ARRAY_COUNT(this->limbPos); i++) {
for (j = 0; j < 2; j++) {
ptr = &this->limbPos[i];
- sp7C.x = ptr->x + randPlusMinusPoint5Scaled(1.0f);
- sp7C.y = ptr->y + randPlusMinusPoint5Scaled(1.0f);
- sp7C.z = ptr->z + randPlusMinusPoint5Scaled(1.0f);
+ sp7C.x = ptr->x + Rand_CenteredFloat(1.0f);
+ sp7C.y = ptr->y + Rand_CenteredFloat(1.0f);
+ sp7C.z = ptr->z + Rand_CenteredFloat(1.0f);
func_800B0DE0(play, &sp7C, &gZeroVec3f, &D_80896B64, &D_80896B3C, &D_80896B40,
(s32)Rand_ZeroFloat(16.0f) + 80, 15);
}
@@ -808,9 +808,9 @@ void func_80895738(EnTite* this, PlayState* play) {
void func_8089595C(EnTite* this, PlayState* play) {
Vec3f sp2C;
- sp2C.x = randPlusMinusPoint5Scaled(20.0f) + this->actor.world.pos.x;
+ sp2C.x = Rand_CenteredFloat(20.0f) + this->actor.world.pos.x;
sp2C.y = this->actor.world.pos.y + 15.0f;
- sp2C.z = randPlusMinusPoint5Scaled(20.0f) + this->actor.world.pos.z;
+ sp2C.z = Rand_CenteredFloat(20.0f) + this->actor.world.pos.z;
func_800B0DE0(play, &sp2C, &gZeroVec3f, &D_80896B44, &D_80896B3C, &D_80896B40, 500, 50);
}
diff --git a/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c b/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c
index bf0f9cc31..29560fdce 100644
--- a/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c
+++ b/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c
@@ -499,9 +499,9 @@ void func_80AD434C(EnTrt2* this, PlayState* play) {
Vec3f sp5C = { 0.0f, 0.5f, 0.0f };
for (i = (s32)this->skelAnime.animLength - (s32)this->skelAnime.curFrame; i >= 0; i -= 2) {
- sp68.x = randPlusMinusPoint5Scaled(60.0f) + this->actor.world.pos.x;
- sp68.z = randPlusMinusPoint5Scaled(60.0f) + this->actor.world.pos.z;
- sp68.y = randPlusMinusPoint5Scaled(50.0f) + (this->actor.world.pos.y + 20.0f);
+ sp68.x = Rand_CenteredFloat(60.0f) + this->actor.world.pos.x;
+ sp68.z = Rand_CenteredFloat(60.0f) + this->actor.world.pos.z;
+ sp68.y = Rand_CenteredFloat(50.0f) + (this->actor.world.pos.y + 20.0f);
func_800B3030(play, &sp68, &sp5C, &sp5C, 100, 0, 3);
}
@@ -592,7 +592,7 @@ s32 func_80AD475C(EnTrt2* this, Path* path, s32 arg2) {
phi_f14 = points[arg + 1].z - points[arg - 1].z;
}
- func_8017B7F8(&sp30, RAD_TO_BINANG(func_80086B30(phi_f12, phi_f14)), &sp44, &sp40, &sp3C);
+ func_8017B7F8(&sp30, RAD_TO_BINANG(Math_FAtan2F(phi_f12, phi_f14)), &sp44, &sp40, &sp3C);
if (((this->actor.world.pos.x * sp44) + (sp40 * this->actor.world.pos.z) + sp3C) > 0.0f) {
ret = true;
@@ -639,9 +639,9 @@ f32 func_80AD49B8(Path* path, s32 arg1, Vec3f* arg2, Vec3s* arg3) {
void func_80AD4A78(EnTrt2* this, PlayState* play) {
Vec3f sp34;
- sp34.x = randPlusMinusPoint5Scaled(15.0f) + this->actor.world.pos.x;
+ sp34.x = Rand_CenteredFloat(15.0f) + this->actor.world.pos.x;
sp34.y = this->actor.world.pos.y;
- sp34.z = randPlusMinusPoint5Scaled(15.0f) + this->actor.world.pos.z;
+ sp34.z = Rand_CenteredFloat(15.0f) + this->actor.world.pos.z;
Actor_SpawnFloorDustRing(play, &this->actor, &sp34, 50.0f, 0, 2.0f, 0, 0, 0);
}
diff --git a/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.c b/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.c
index 6cd2641a1..f877a26a8 100644
--- a/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.c
+++ b/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.c
@@ -301,7 +301,7 @@ s32 func_80B76600(EnTruMt* this, Path* path, s32 arg2) {
phi_f14 = sp5C[idx + 1].z - sp5C[idx - 1].z;
}
- func_8017B7F8(&sp30, RAD_TO_BINANG(func_80086B30(phi_f12, phi_f14)), &sp44, &sp40, &sp3C);
+ func_8017B7F8(&sp30, RAD_TO_BINANG(Math_FAtan2F(phi_f12, phi_f14)), &sp44, &sp40, &sp3C);
if (((this->actor.world.pos.x * sp44) + (sp40 * this->actor.world.pos.z) + sp3C) > 0.0f) {
sp50 = true;
}
diff --git a/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c b/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c
index b14f82424..c8ec8f8c4 100644
--- a/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c
+++ b/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c
@@ -159,9 +159,9 @@ void EnWaterEffect_Update(Actor* thisx, PlayState* play2) {
if ((this->unk_DC4 % 32) == 0) {
if (Rand_ZeroOne() < 0.5f) {
Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 10.0f, 40.0f, UPDBGCHECKINFO_FLAG_4);
- sp88.x = randPlusMinusPoint5Scaled(50.0f) + this->actor.world.pos.x;
+ sp88.x = Rand_CenteredFloat(50.0f) + this->actor.world.pos.x;
sp88.y = this->actor.world.pos.y;
- sp88.z = randPlusMinusPoint5Scaled(50.0f) + this->actor.world.pos.z;
+ sp88.z = Rand_CenteredFloat(50.0f) + this->actor.world.pos.z;
if ((this->actor.world.pos.y + this->actor.depthInWater) <= this->actor.floorHeight) {
phi_v1 = 0;
} else {
@@ -367,9 +367,9 @@ void func_80A599E8(EnWaterEffect* this, Vec3f* arg1, u8 arg2) {
if (arg2 >= 2) {
if (arg2 == 2) {
- ptr->unk_10.x = randPlusMinusPoint5Scaled(10.0f);
+ ptr->unk_10.x = Rand_CenteredFloat(10.0f);
ptr->unk_10.y = Rand_ZeroFloat(3.0f) + 5.0f;
- ptr->unk_10.z = randPlusMinusPoint5Scaled(10.0f);
+ ptr->unk_10.z = Rand_CenteredFloat(10.0f);
}
ptr->unk_2C.z = 0.0017f;
ptr->unk_2C.x = 0.003f;
@@ -421,9 +421,9 @@ void func_80A59C04(Actor* thisx, PlayState* play2) {
if (this->unk_DC6 == 0) {
this->unk_DC6 = Rand_ZeroFloat(150.0f) + 100.0f;
Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 10.0f, 40.0f, UPDBGCHECKINFO_FLAG_4);
- sp74.x = randPlusMinusPoint5Scaled(50.0f) + this->actor.world.pos.x;
+ sp74.x = Rand_CenteredFloat(50.0f) + this->actor.world.pos.x;
sp74.y = this->actor.world.pos.y;
- sp74.z = randPlusMinusPoint5Scaled(50.0f) + this->actor.world.pos.z;
+ sp74.z = Rand_CenteredFloat(50.0f) + this->actor.world.pos.z;
func_80A599E8(this, &sp74, 0);
}
}
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 b05bc4869..26301730f 100644
--- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c
+++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c
@@ -489,9 +489,9 @@ void func_80990C6C(EnWf* this, PlayState* play, s32 arg2) {
}
for (i = 0; i < arg2; i++) {
- sp88.x = randPlusMinusPoint5Scaled(50.0f) + this->actor.world.pos.x;
+ sp88.x = Rand_CenteredFloat(50.0f) + this->actor.world.pos.x;
sp88.y = Rand_ZeroFloat(5.0f) + this->actor.world.pos.y;
- sp88.z = randPlusMinusPoint5Scaled(50.0f) + this->actor.world.pos.z;
+ sp88.z = Rand_CenteredFloat(50.0f) + this->actor.world.pos.z;
func_800B0F18(play, &sp88, &gZeroVec3f, &D_809942DC, phi_s1, phi_s1, phi_s6, 5,
Rand_ZeroFloat(5.0f) + 14.0f);
}
@@ -1199,9 +1199,9 @@ void func_80992E0C(EnWf* this, PlayState* play) {
this->unk_2A0--;
for (i = (25 - this->unk_2A0) >> 1; i >= 0; i--) {
- sp60.x = randPlusMinusPoint5Scaled(60.0f) + this->actor.world.pos.x;
- sp60.z = randPlusMinusPoint5Scaled(60.0f) + this->actor.world.pos.z;
- sp60.y = randPlusMinusPoint5Scaled(50.0f) + (this->actor.world.pos.y + 20.0f);
+ sp60.x = Rand_CenteredFloat(60.0f) + this->actor.world.pos.x;
+ sp60.z = Rand_CenteredFloat(60.0f) + this->actor.world.pos.z;
+ sp60.y = Rand_CenteredFloat(50.0f) + (this->actor.world.pos.y + 20.0f);
func_800B3030(play, &sp60, &D_809942F0, &D_809942F0, 100, 0, 2);
}
diff --git a/src/overlays/actors/ovl_En_Wiz/z_en_wiz.c b/src/overlays/actors/ovl_En_Wiz/z_en_wiz.c
index 7fd55f4ee..6ce68a0e3 100644
--- a/src/overlays/actors/ovl_En_Wiz/z_en_wiz.c
+++ b/src/overlays/actors/ovl_En_Wiz/z_en_wiz.c
@@ -1297,7 +1297,7 @@ void EnWiz_UpdateDamage(EnWiz* this, PlayState* play) {
scaleStep = Rand_S16Offset(20, 10);
Math_Vec3f_Copy(&pos, &this->ghostPos[i]);
pos.x += (f32)Rand_S16Offset(20, 20) * ((Rand_ZeroOne() < 0.5f) ? -1 : 1);
- pos.y += 70.0f + randPlusMinusPoint5Scaled(30.0f);
+ pos.y += 70.0f + Rand_CenteredFloat(30.0f);
pos.z += (f32)Rand_S16Offset(20, 20) * ((Rand_ZeroOne() < 0.5f) ? -1 : 1);
func_800B0DE0(play, &pos, &velocity, &accel, &sDustPrimColor, &sDustEnvTimer,
Rand_S16Offset(350, 100), scaleStep);
@@ -1419,9 +1419,9 @@ void EnWiz_PostLimbDrawXlu(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* r
Matrix_Translate(0.0f, 0.0f, 0.0f, MTXMODE_APPLY);
Matrix_MultVec3f(&staffFlamePos, &flamePos);
- flamePos.x += randPlusMinusPoint5Scaled(4.0f);
- flamePos.y += randPlusMinusPoint5Scaled(7.0f);
- flamePos.z += randPlusMinusPoint5Scaled(5.0f);
+ flamePos.x += Rand_CenteredFloat(4.0f);
+ flamePos.y += Rand_CenteredFloat(7.0f);
+ flamePos.z += Rand_CenteredFloat(5.0f);
func_800B3030(play, &flamePos, &gZeroVec3f, &gZeroVec3f, ((Rand_ZeroFloat(1.0f) * 50.0f) + 70.0f), 10, 1);
SoundSource_PlaySfxAtFixedWorldPos(play, &flamePos, 10, NA_SE_EN_EXTINCT);
}
diff --git a/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c b/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c
index 8251a896b..e6fc7e776 100644
--- a/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c
+++ b/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c
@@ -152,7 +152,7 @@ void EnWiz_SetupMoveMagicProjectile(EnWizFire* this, PlayState* play) {
Matrix_RotateXS(this->actor.world.rot.x, MTXMODE_APPLY);
if (this->type != EN_WIZ_FIRE_TYPE_MAGIC_PROJECTILE) {
- velocity.z = randPlusMinusPoint5Scaled(2.0f) + 8.0f;
+ velocity.z = Rand_CenteredFloat(2.0f) + 8.0f;
} else {
velocity.z = 12.0f;
}
@@ -223,8 +223,8 @@ void EnWiz_MoveMagicProjectile(EnWizFire* this, PlayState* play) {
this->increaseLowestUsedIndexTimer = 10;
Matrix_Push();
- Matrix_RotateYS((s16)randPlusMinusPoint5Scaled(0x100) + this->actor.world.rot.y, MTXMODE_NEW);
- velocity.z = randPlusMinusPoint5Scaled(2.0f) + 8.0f;
+ Matrix_RotateYS((s16)(s32)Rand_CenteredFloat(0x100) + this->actor.world.rot.y, MTXMODE_NEW);
+ velocity.z = Rand_CenteredFloat(2.0f) + 8.0f;
Matrix_MultVec3f(&velocity, &this->actor.velocity);
Matrix_Pop();
@@ -257,7 +257,7 @@ void EnWiz_MoveMagicProjectile(EnWizFire* this, PlayState* play) {
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_WIZ_FIRE, this->actor.world.pos.x,
this->actor.world.pos.y, this->actor.world.pos.z, 0, arcingProjectileRotY, 0,
EN_WIZ_FIRE_TYPE_ARCING_MAGIC_PROJECTILE);
- arcingProjectileRotY += BINANG_ADD((s32)randPlusMinusPoint5Scaled(0x1000), 0x3333);
+ arcingProjectileRotY += BINANG_ADD((s32)Rand_CenteredFloat(0x1000), 0x10000 / 5);
}
Actor_PlaySfx(&this->actor, NA_SE_IT_BOMB_EXPLOSION);
@@ -313,9 +313,9 @@ void EnWiz_MoveMagicProjectile(EnWizFire* this, PlayState* play) {
void EnWiz_SetupSmallFlame(EnWizFire* this, PlayState* play) {
this->targetScale = 0.02f;
this->timer = Rand_S16Offset(50, 50);
- this->scaleMod.x = randPlusMinusPoint5Scaled(1.0f) * 0.007f;
- this->scaleMod.y = randPlusMinusPoint5Scaled(1.0f) * 0.005f;
- this->scaleMod.z = randPlusMinusPoint5Scaled(1.0f) * 0.007f;
+ this->scaleMod.x = Rand_CenteredFloat(1.0f) * 0.007f;
+ this->scaleMod.y = Rand_CenteredFloat(1.0f) * 0.005f;
+ this->scaleMod.z = Rand_CenteredFloat(1.0f) * 0.007f;
this->actionFunc = EnWiz_SmallFlame;
}
@@ -379,13 +379,13 @@ void EnWiz_Pool(EnWizFire* this, PlayState* play) {
Vec3f accel = { 0.0f, 0.0f, 0.0f };
Vec3f pos;
- accel.x = randPlusMinusPoint5Scaled(3.0f) / 10.0f;
+ accel.x = Rand_CenteredFloat(3.0f) / 10.0f;
accel.y = 0.23f;
- accel.z = randPlusMinusPoint5Scaled(3.0f) / 10.0f;
+ accel.z = Rand_CenteredFloat(3.0f) / 10.0f;
Math_Vec3f_Copy(&pos, &this->actor.world.pos);
- pos.x += randPlusMinusPoint5Scaled(150.0f);
- pos.z += randPlusMinusPoint5Scaled(150.0f);
+ pos.x += Rand_CenteredFloat(150.0f);
+ pos.z += Rand_CenteredFloat(150.0f);
Math_ApproachF(&this->poolScale, 0.022f, 0.3f, 0.01f);
this->collider.dim.radius = this->poolScale * 4300.0f;
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 874e0a63e..cf4331ffa 100644
--- a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c
+++ b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c
@@ -264,8 +264,8 @@ void EnWood02_Init(Actor* thisx, PlayState* play) {
case WOOD_LEAF_YELLOW:
this->unk_14A[0] = 75;
actorScale = 0.02f;
- this->actor.velocity.x = randPlusMinusPoint5Scaled(6.0f);
- this->actor.velocity.z = randPlusMinusPoint5Scaled(6.0f);
+ this->actor.velocity.x = Rand_CenteredFloat(6.0f);
+ this->actor.velocity.z = Rand_CenteredFloat(6.0f);
this->actor.velocity.y = (Rand_ZeroOne() * 1.25f) + -3.1f;
break;
}
@@ -409,7 +409,7 @@ void EnWood02_Update(Actor* thisx, PlayState* play2) {
for (i = 3; i >= 0; i--) {
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_WOOD02, dropsSpawnPt.x, dropsSpawnPt.y, dropsSpawnPt.z,
- 0, randPlusMinusPoint5Scaled(0xFFFF), 0, leavesParams);
+ 0, Rand_CenteredFloat(0xFFFF), 0, leavesParams);
}
}
diff --git a/src/overlays/actors/ovl_En_Yb/z_en_yb.c b/src/overlays/actors/ovl_En_Yb/z_en_yb.c
index 1dbe5d2e8..9df560150 100644
--- a/src/overlays/actors/ovl_En_Yb/z_en_yb.c
+++ b/src/overlays/actors/ovl_En_Yb/z_en_yb.c
@@ -242,9 +242,9 @@ void EnYb_Disappear(EnYb* this, PlayState* play) {
EnYb_UpdateAnimation(this, play);
for (i = 3; i >= 0; i--) {
- sp60.x = randPlusMinusPoint5Scaled(60.0f) + this->actor.world.pos.x;
- sp60.z = randPlusMinusPoint5Scaled(60.0f) + this->actor.world.pos.z;
- sp60.y = randPlusMinusPoint5Scaled(50.0f) + (this->actor.world.pos.y + 20.0f);
+ sp60.x = Rand_CenteredFloat(60.0f) + this->actor.world.pos.x;
+ sp60.z = Rand_CenteredFloat(60.0f) + this->actor.world.pos.z;
+ sp60.y = Rand_CenteredFloat(50.0f) + (this->actor.world.pos.y + 20.0f);
func_800B3030(play, &sp60, &D_80BFB2E8, &D_80BFB2E8, 100, 0, 2);
}
diff --git a/src/overlays/actors/ovl_En_Zog/z_en_zog.c b/src/overlays/actors/ovl_En_Zog/z_en_zog.c
index 979187532..96de52b88 100644
--- a/src/overlays/actors/ovl_En_Zog/z_en_zog.c
+++ b/src/overlays/actors/ovl_En_Zog/z_en_zog.c
@@ -394,9 +394,9 @@ void func_80B93D2C(EnZog* this, PlayState* play) {
void func_80B93DE8(Vec3f* arg0, PlayState* play, s32 arg2) {
Vec3f sp2C;
- sp2C.x = randPlusMinusPoint5Scaled(30.0f) + arg0->x;
+ sp2C.x = Rand_CenteredFloat(30.0f) + arg0->x;
sp2C.y = arg0->y + 3.0f;
- sp2C.z = randPlusMinusPoint5Scaled(30.0f) + arg0->z;
+ sp2C.z = Rand_CenteredFloat(30.0f) + arg0->z;
EffectSsKirakira_SpawnDispersed(play, &sp2C, &D_80B9598C, &D_80B95998, &D_80B959A4, &D_80B959A8, 1000, arg2);
}
@@ -865,9 +865,9 @@ void func_80B94E34(EnZog* this, PlayState* play) {
Vec3f sp38;
Lib_Vec3f_TranslateAndRotateY(&this->actor.world.pos, this->actor.shape.rot.y, &D_80B959AC, &sp38);
- sp38.x += randPlusMinusPoint5Scaled(30.0f);
+ sp38.x += Rand_CenteredFloat(30.0f);
sp38.y += 20.0f;
- sp38.z += randPlusMinusPoint5Scaled(30.0f);
+ sp38.z += Rand_CenteredFloat(30.0f);
if (WaterBox_GetSurface1(play, &play->colCtx, sp38.x, sp38.z, &sp38.y, &sp44) &&
(this->actor.world.pos.y < sp38.y)) {
EffectSsGSplash_Spawn(play, &sp38, NULL, NULL, 1,
diff --git a/src/overlays/actors/ovl_Obj_Bigicicle/z_obj_bigicicle.c b/src/overlays/actors/ovl_Obj_Bigicicle/z_obj_bigicicle.c
index 85468c59c..61805fd49 100644
--- a/src/overlays/actors/ovl_Obj_Bigicicle/z_obj_bigicicle.c
+++ b/src/overlays/actors/ovl_Obj_Bigicicle/z_obj_bigicicle.c
@@ -159,13 +159,13 @@ void func_80AE8DE4(ObjBigicicle* this, PlayState* play) {
f32 temp_f20 = this->actor.scale.x * (50.0f / 3.0f);
for (i = 0; i < 10; i++) {
- sp98.x = (randPlusMinusPoint5Scaled(4.0f) * temp_f20) + this->actor.world.pos.x;
+ sp98.x = (Rand_CenteredFloat(4.0f) * temp_f20) + this->actor.world.pos.x;
sp98.y = ((Rand_ZeroFloat(20.0f) - 35.0f) * temp_f20) + this->actor.world.pos.y;
- sp98.z = (randPlusMinusPoint5Scaled(4.0f) * temp_f20) + this->actor.world.pos.z;
+ sp98.z = (Rand_CenteredFloat(4.0f) * temp_f20) + this->actor.world.pos.z;
- sp8C.x = randPlusMinusPoint5Scaled(13.0f);
+ sp8C.x = Rand_CenteredFloat(13.0f);
sp8C.y = Rand_ZeroFloat(2.0f);
- sp8C.z = randPlusMinusPoint5Scaled(13.0f);
+ sp8C.z = Rand_CenteredFloat(13.0f);
EffectSsHahen_Spawn(play, &sp98, &sp8C, &D_80AE987C, HAHEN_XLU, (Rand_ZeroFloat(20.0f) + 30.0f) * temp_f20,
OBJECT_BIGICICLE, 40, object_bigicicle_DL_0009B0);
@@ -222,8 +222,8 @@ void func_80AE9180(ObjBigicicle* this, PlayState* play) {
if (this->unk_14A > 0) {
this->unk_14A--;
- this->actor.shape.rot.x = BINANG_ADD((s32)(randPlusMinusPoint5Scaled(1408.0f) * 0.02f * this->unk_14A), 0x4000);
- this->actor.shape.rot.z = randPlusMinusPoint5Scaled(1408.0f) * 0.02f * this->unk_14A;
+ this->actor.shape.rot.x = BINANG_ADD((s32)(Rand_CenteredFloat(0x580) * 0.02f * this->unk_14A), 0x4000);
+ this->actor.shape.rot.z = Rand_CenteredFloat(0x580) * 0.02f * this->unk_14A;
} else {
this->actor.shape.rot.x = 0x4000;
this->actor.shape.rot.z = 0;
@@ -271,9 +271,9 @@ void func_80AE939C(ObjBigicicle* this, PlayState* play) {
f32 temp_f20 = this->actor.scale.x * (50.0f / 3.0f);
for (i = 0; i < 20; i++) {
- sp8C.x = randPlusMinusPoint5Scaled(15.0f);
+ sp8C.x = Rand_CenteredFloat(15.0f);
sp8C.y = Rand_ZeroFloat(7.0f) + 3.0f;
- sp8C.z = randPlusMinusPoint5Scaled(15.0f);
+ sp8C.z = Rand_CenteredFloat(15.0f);
sp98.x = this->actor.world.pos.x + (sp8C.x * 5.0f * temp_f20);
sp98.y = this->actor.world.pos.y + (sp8C.y * 7.0f * temp_f20);
diff --git a/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c b/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c
index c2270f15b..4971b39bc 100644
--- a/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c
+++ b/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c
@@ -119,7 +119,7 @@ u32 func_80BB9A1C(ObjChan* this, f32 arg1) {
sp20 = Math_SinS(this->unk1D4) * this->unk1D0;
temp_f6 = (Math_CosS(this->unk1D4) * (400 * M_PI / 0x8000) * this->unk1D0) + arg1;
if (temp_f6 != 0.0f) {
- this->unk1D4 = RAD_TO_BINANG(func_80086B30(sp20 * (400 * M_PI / 0x8000), temp_f6));
+ this->unk1D4 = RAD_TO_BINANG(Math_FAtan2F(sp20 * (400 * M_PI / 0x8000), temp_f6));
} else if (sp20 >= 0.0f) {
this->unk1D4 = 0x4000;
} else {
diff --git a/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c b/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c
index 4cc81013e..7559c4db7 100644
--- a/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c
+++ b/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c
@@ -130,8 +130,8 @@ void func_80B9C5E8(ObjHunsui* this, PlayState* play) {
this->unk_18C = 0;
Math_Vec3f_Copy(&sp40, &player->actor.world.pos);
- sp40.x += randPlusMinusPoint5Scaled(10.0f);
- sp40.z += randPlusMinusPoint5Scaled(10.0f);
+ sp40.x += Rand_CenteredFloat(10.0f);
+ sp40.z += Rand_CenteredFloat(10.0f);
sp40.y += Rand_ZeroFloat(2.0f);
EffectSsGSplash_Spawn(play, &sp40, NULL, NULL, 2.0f * Rand_ZeroOne(), 1);
@@ -144,8 +144,8 @@ void func_80B9C5E8(ObjHunsui* this, PlayState* play) {
Math_Vec3f_Copy(&sp40, &player->actor.world.pos);
this->unk_18C = 0;
- sp40.x += randPlusMinusPoint5Scaled(10.0f);
- sp40.z += randPlusMinusPoint5Scaled(10.0f);
+ sp40.x += Rand_CenteredFloat(10.0f);
+ sp40.z += Rand_CenteredFloat(10.0f);
sp40.y += Rand_ZeroFloat(45.0f);
EffectSsGSplash_Spawn(play, &sp40, NULL, NULL, 1, 1);
diff --git a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c
index 10937f985..d1601e69d 100644
--- a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c
+++ b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c
@@ -156,9 +156,9 @@ void func_80931828(ObjIcePoly* this, PlayState* play) {
temp = spA0.y - sp90;
for (i = 0; i < 30; i++) {
- sp94.x = randPlusMinusPoint5Scaled(12.0f);
+ sp94.x = Rand_CenteredFloat(12.0f);
sp94.y = Rand_ZeroFloat(15.0f);
- sp94.z = randPlusMinusPoint5Scaled(12.0f);
+ sp94.z = Rand_CenteredFloat(12.0f);
spA0.x = (this->colliders1[0].dim.radius * (sp94.x * (1.0f / 12))) + this->actor.world.pos.x;
spA0.z = (this->colliders1[0].dim.radius * (sp94.z * (1.0f / 12))) + this->actor.world.pos.z;
diff --git a/src/overlays/actors/ovl_Obj_Taru/z_obj_taru.c b/src/overlays/actors/ovl_Obj_Taru/z_obj_taru.c
index aeaddd2ee..6eac0ddbc 100644
--- a/src/overlays/actors/ovl_Obj_Taru/z_obj_taru.c
+++ b/src/overlays/actors/ovl_Obj_Taru/z_obj_taru.c
@@ -141,10 +141,10 @@ void func_80B9B9C8(ObjTaru* this, PlayState* play) {
for (i = 0; i < 4; i++) {
for (j = phi_fp; j < phi_s5; j++) {
- temp_fs0 = randPlusMinusPoint5Scaled(10.0f) + -105.0f + (j * 30.0f);
- temp_fs1 = randPlusMinusPoint5Scaled(4.0f);
+ temp_fs0 = Rand_CenteredFloat(10.0f) + -105.0f + (j * 30.0f);
+ temp_fs1 = Rand_CenteredFloat(4.0f);
spD8.x = temp_fs0 * cos;
- spD8.y = randPlusMinusPoint5Scaled(10.0f) + 15.0f + (i * 30.0f);
+ spD8.y = Rand_CenteredFloat(10.0f) + 15.0f + (i * 30.0f);
spD8.z = temp_fs0 * sin;
spCC.x = (spD8.x * 0.05f) + (temp_fs1 * sin);
spCC.y = Rand_ZeroFloat(5.0f) + 2.0f;
diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c
index 9bf780859..bbde013ef 100644
--- a/src/overlays/actors/ovl_player_actor/z_player.c
+++ b/src/overlays/actors/ovl_player_actor/z_player.c
@@ -6280,9 +6280,9 @@ void func_80836C70(PlayState* play, Player* this, PlayerBodyPart bodyPartIndex)
for (i = 0; i < 4; i++) {
Vec3f velocity;
- velocity.x = randPlusMinusPoint5Scaled(4.0f);
+ velocity.x = Rand_CenteredFloat(4.0f);
velocity.y = Rand_ZeroFloat(2.0f);
- velocity.z = randPlusMinusPoint5Scaled(4.0f);
+ velocity.z = Rand_CenteredFloat(4.0f);
D_8085D130.y = -0.2f;
EffectSsHahen_Spawn(play, &this->bodyPartsPos[bodyPartIndex], &velocity, &D_8085D130, 0, 10, OBJECT_LINK_NUTS,
16, object_link_nuts_DL_008860);
@@ -9507,9 +9507,9 @@ void func_8083F57C(Player* this, PlayState* play) {
}
void func_8083F828(Vec3f* arg0, Vec3f* arg1, f32 arg2, f32 arg3, f32 arg4) {
- arg1->x = randPlusMinusPoint5Scaled(arg3) + arg0->x;
- arg1->y = randPlusMinusPoint5Scaled(arg4) + (arg0->y + arg2);
- arg1->z = randPlusMinusPoint5Scaled(arg3) + arg0->z;
+ arg1->x = Rand_CenteredFloat(arg3) + arg0->x;
+ arg1->y = Rand_CenteredFloat(arg4) + (arg0->y + arg2);
+ arg1->z = Rand_CenteredFloat(arg3) + arg0->z;
}
Color_RGBA8 D_8085D26C = { 255, 255, 255, 255 };
@@ -9528,8 +9528,8 @@ s32 func_8083F8A8(PlayState* play, Player* this, f32 radius, s32 countMax, f32 r
count = (count >= ABS_ALT(countMax)) ? ABS_ALT(countMax) : count;
for (i = 0; i < count; i++) {
func_8083F828(&this->actor.world.pos, &pos, 0.0f, 40.0f, 10.0f);
- D_8085D27C.x = randPlusMinusPoint5Scaled(3.0f);
- D_8085D27C.z = randPlusMinusPoint5Scaled(3.0f);
+ D_8085D27C.x = Rand_CenteredFloat(3.0f);
+ D_8085D27C.z = Rand_CenteredFloat(3.0f);
EffectSsDust_Spawn(play, 0, &pos, &D_8085D27C, &D_8085D270, &D_8085D26C, &D_8085D26C, scale, scaleStep, 42,
0);
}
@@ -9555,9 +9555,9 @@ s32 func_8083F8A8(PlayState* play, Player* this, f32 radius, s32 countMax, f32 r
count = (count >= countMax) ? countMax : count;
for (i = 0; i < count; i++) {
func_8083F828(&this->actor.world.pos, &pos, 0.0f, 20.0f, 20.0f);
- velocity.x = randPlusMinusPoint5Scaled(3.0f);
+ velocity.x = Rand_CenteredFloat(3.0f);
velocity.y = Rand_ZeroFloat(2.0f);
- velocity.z = randPlusMinusPoint5Scaled(3.0f);
+ velocity.z = Rand_CenteredFloat(3.0f);
D_8085D288.y = -0.1f;
EffectSsHahen_Spawn(play, &pos, &velocity, &D_8085D288, 0, 0x96, 1, 0x10, gKakeraLeafTip);
}
@@ -11237,9 +11237,9 @@ void func_808445C4(PlayState* play, Player* this) {
randIndex = Rand_ZeroFloat(PLAYER_BODYPART_MAX - 0.1f);
bodyPartsPos = randIndex + this->bodyPartsPos;
- pos.x = (randPlusMinusPoint5Scaled(5.0f) + bodyPartsPos->x) - this->actor.world.pos.x;
- pos.y = (randPlusMinusPoint5Scaled(5.0f) + bodyPartsPos->y) - this->actor.world.pos.y;
- pos.z = (randPlusMinusPoint5Scaled(5.0f) + bodyPartsPos->z) - this->actor.world.pos.z;
+ pos.x = (Rand_CenteredFloat(5.0f) + bodyPartsPos->x) - this->actor.world.pos.x;
+ pos.y = (Rand_CenteredFloat(5.0f) + bodyPartsPos->y) - this->actor.world.pos.y;
+ pos.z = (Rand_CenteredFloat(5.0f) + bodyPartsPos->z) - this->actor.world.pos.z;
EffectSsFhgFlash_SpawnShock(play, &this->actor, &pos, scale, 1);
func_800B8F98(&this->actor, NA_SE_PL_SPARK - SFX_FLAG);
}
@@ -19575,9 +19575,9 @@ void func_80859D70(PlayState* play, Player* this, UNK_TYPE arg2) {
this->rightHandType = 0xFF;
} else {
posInfo = &D_8085E368[this->transformation];
- randPos.x = randPlusMinusPoint5Scaled(posInfo->range.x) + posInfo->base.x;
- randPos.y = randPlusMinusPoint5Scaled(posInfo->range.y) + posInfo->base.y;
- randPos.z = randPlusMinusPoint5Scaled(posInfo->range.z) + posInfo->base.z;
+ randPos.x = Rand_CenteredFloat(posInfo->range.x) + posInfo->base.x;
+ randPos.y = Rand_CenteredFloat(posInfo->range.y) + posInfo->base.y;
+ randPos.z = Rand_CenteredFloat(posInfo->range.z) + posInfo->base.z;
SkinMatrix_Vec3fMtxFMultXYZ(&this->shieldMf, &randPos, &effectPos);
EffectSsKirakira_SpawnDispersed(play, &effectPos, &gZeroVec3f, &gZeroVec3f, &D_8085E3A4, &D_8085E3A8, 600, -10);
}
diff --git a/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.c b/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.c
index 14d5d5c6e..cf019c6cf 100644
--- a/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.c
+++ b/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.c
@@ -60,7 +60,7 @@ u32 EffectSsEnIce_Init(PlayState* play, u32 index, EffectSs* this, void* initPar
this->rEnvColorG = initParams->envColor.g;
this->rEnvColorB = initParams->envColor.b;
this->rAlphaMode = 1;
- this->rPitch = randPlusMinusPoint5Scaled(0x10000);
+ this->rPitch = Rand_CenteredFloat(0x10000);
} else if (initParams->type == ENICE_TYPE_NORMAL) {
Math_Vec3f_Copy(&this->pos, &initParams->pos);
Math_Vec3f_Copy(&this->vec, &initParams->pos);
@@ -142,7 +142,7 @@ void EffectSsEnIce_UpdateFlying(PlayState* play, u32 index, EffectSs* this) {
} else {
this->actor = NULL;
if (this->life >= 9) {
- rand = randPlusMinusPoint5Scaled(0xFFFF);
+ rand = Rand_CenteredFloat(0xFFFF);
this->accel.x = Math_SinS(rand) * (Rand_ZeroOne() + 1.0f);
this->accel.z = Math_CosS(rand) * (Rand_ZeroOne() + 1.0f);
this->life = 8;
diff --git a/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.c b/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.c
index f2038c768..4edc1e3b1 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.c
+++ b/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.c
@@ -90,9 +90,9 @@ void EffectSsFhgFlash_Update(PlayState* play, u32 index, EffectSs* this) {
Player* player = GET_PLAYER(play);
randBodyPart = Rand_ZeroFloat(PLAYER_BODYPART_MAX - 0.1f);
- this->pos.x = player->bodyPartsPos[randBodyPart].x + randPlusMinusPoint5Scaled(10.0f);
- this->pos.y = player->bodyPartsPos[randBodyPart].y + randPlusMinusPoint5Scaled(15.0f);
- this->pos.z = player->bodyPartsPos[randBodyPart].z + randPlusMinusPoint5Scaled(10.0f);
+ this->pos.x = player->bodyPartsPos[randBodyPart].x + Rand_CenteredFloat(10.0f);
+ this->pos.y = player->bodyPartsPos[randBodyPart].y + Rand_CenteredFloat(15.0f);
+ this->pos.z = player->bodyPartsPos[randBodyPart].z + Rand_CenteredFloat(10.0f);
} else if ((this->rParams >= FHGFLASH_SHOCK_GOHT_2) && (this->rParams <= FHGFLASH_SHOCK_GOHT_6)) {
s32 pad;
Vec3f* bodyPartPos;
@@ -105,9 +105,9 @@ void EffectSsFhgFlash_Update(PlayState* play, u32 index, EffectSs* this) {
bodyPartPos = &goht->unk_2F00[this->rParams][index].unk_00;
}
- this->pos.x = randPlusMinusPoint5Scaled(70.0f) + bodyPartPos->x;
- this->pos.y = randPlusMinusPoint5Scaled(70.0f) + bodyPartPos->y;
- this->pos.z = randPlusMinusPoint5Scaled(70.0f) + bodyPartPos->z;
+ this->pos.x = Rand_CenteredFloat(70.0f) + bodyPartPos->x;
+ this->pos.y = Rand_CenteredFloat(70.0f) + bodyPartPos->y;
+ this->pos.z = Rand_CenteredFloat(70.0f) + bodyPartPos->z;
}
if (this->life < 100) {
this->rAlpha -= 50;
diff --git a/src/overlays/effects/ovl_Effect_Ss_Kirakira/z_eff_ss_kirakira.c b/src/overlays/effects/ovl_Effect_Ss_Kirakira/z_eff_ss_kirakira.c
index 4e395141b..4e8f11f5c 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Kirakira/z_eff_ss_kirakira.c
+++ b/src/overlays/effects/ovl_Effect_Ss_Kirakira/z_eff_ss_kirakira.c
@@ -139,8 +139,8 @@ void func_80977DB4(PlayState* play, u32 index, EffectSs* this) {
void func_80977E6C(PlayState* play, u32 index, EffectSs* this) {
this->velocity.x *= 0.95f;
this->velocity.z *= 0.95f;
- this->accel.x = randPlusMinusPoint5Scaled(0.2f);
- this->accel.z = randPlusMinusPoint5Scaled(0.2f);
+ this->accel.x = Rand_CenteredFloat(0.2f);
+ this->accel.z = Rand_CenteredFloat(0.2f);
this->rEnvColorA += this->rAlphaStep;
if (this->rEnvColorA < 0) {
diff --git a/src/overlays/effects/ovl_Effect_Ss_Sbn/z_eff_ss_sbn.c b/src/overlays/effects/ovl_Effect_Ss_Sbn/z_eff_ss_sbn.c
index f79e59340..69b24c029 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Sbn/z_eff_ss_sbn.c
+++ b/src/overlays/effects/ovl_Effect_Ss_Sbn/z_eff_ss_sbn.c
@@ -68,7 +68,7 @@ u32 EffectSsSbn_Init(PlayState* play, u32 index, EffectSs* this, void* initParam
this->rReg4 = 250;
this->rReg4Step = 30;
- this->rScale = randPlusMinusPoint5Scaled(100.0f) + (initParams->scale * 120.0f);
+ this->rScale = Rand_CenteredFloat(100.0f) + (initParams->scale * 120.0f);
if (this->rScale < 600) {
this->rScale = 600;
} else if (this->rScale > 1500) {