1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-05 22:00:15 +00:00

EnMb documented (Moblins) (#861)

* Document Moblins (EnMb)

* Use actual decomp-style function names

* Add renamed functions to actorfixer.py

* Add general documentation and add EnMbType enum to check moblin subtype

* Add fig's doc comment on Actor_TestFloorInDirection

* Revert documentation on z_eff_ss_dead.c

* remove `gSPFogPosition(?,?)` comments on `gSPFogFactor` uses in z_rcp.c

* run formatter
This commit is contained in:
Dragorn421 2021-08-08 13:28:28 +02:00 committed by GitHub
parent ca2ea1ce2d
commit 9455c885f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 1095 additions and 1004 deletions

View file

@ -692,9 +692,9 @@ void BossDodongo_Walk(BossDodongo* this, GlobalContext* globalCtx) {
} else if (this->unk_1BC != 2) {
if (((s32)this->skelAnime.curFrame == 1) || ((s32)this->skelAnime.curFrame == 31)) {
if ((s32)this->skelAnime.curFrame == 1) {
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->unk_410, 25.0f, 0xA, 8.0f, 0x1F4, 0xA, 0);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->unk_410, 25.0f, 0xA, 8.0f, 0x1F4, 0xA, 0);
} else {
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->unk_404, 25.0f, 0xA, 8.0f, 0x1F4, 0xA, 0);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->unk_404, 25.0f, 0xA, 8.0f, 0x1F4, 0xA, 0);
}
if (this->unk_1BC != 0) {
@ -789,7 +789,8 @@ void BossDodongo_Roll(BossDodongo* this, GlobalContext* globalCtx) {
}
if (!(this->unk_19E & 1)) {
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->actor.world.pos, 40.0f, 3, 8.0f, 0x1F4, 0xA, 0);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, 40.0f, 3, 8.0f, 0x1F4, 0xA,
0);
}
}
}
@ -1421,8 +1422,8 @@ void BossDodongo_DeathCutscene(BossDodongo* this, GlobalContext* globalCtx) {
Camera_AddQuake(&globalCtx->mainCamera, 2, 1, 8);
}
if (!(this->unk_19E & 1)) {
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->actor.world.pos, 40.0f, 3, 8.0f, 0x1F4, 0xA,
0);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, 40.0f, 3, 8.0f, 0x1F4,
0xA, 0);
}
tempSin = cornerPos->x - this->actor.world.pos.x;
tempCos = cornerPos->z - this->actor.world.pos.z;
@ -1546,8 +1547,8 @@ void BossDodongo_DeathCutscene(BossDodongo* this, GlobalContext* globalCtx) {
} else {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_K_ROLL - SFX_FLAG);
if (!(this->unk_19E & 1)) {
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->actor.world.pos, 40.0f, 3, 8.0f, 0x1F4, 0xA,
0);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, 40.0f, 3, 8.0f, 0x1F4,
0xA, 0);
}
}
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.2f, 0.1f, 0.0f);

View file

@ -174,11 +174,11 @@ void BossGanon2_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void func_808FD4D4(BossGanon2* this, GlobalContext* globalCtx, s16 arg2, s16 arg3) {
if ((arg2 == 0) || (arg2 == 1)) {
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->unk_1D0, 25.0f, arg3, 8.0f, 0x1F4, 0xA, 1);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->unk_1D0, 25.0f, arg3, 8.0f, 0x1F4, 0xA, 1);
}
if ((arg2 == 0) || (arg2 == 2)) {
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->unk_1DC, 25.0f, arg3, 8.0f, 0x1F4, 0xA, 1);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->unk_1DC, 25.0f, arg3, 8.0f, 0x1F4, 0xA, 1);
}
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MGANON_WALK);

View file

@ -368,13 +368,13 @@ void BossGoma_Init(Actor* thisx, GlobalContext* globalCtx) {
void BossGoma_PlayEffectsAndSfx(BossGoma* this, GlobalContext* globalCtx, s16 arg2, s16 amountMinus1) {
if (arg2 == 0 || arg2 == 1 || arg2 == 3) {
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->rightHandBackLimbWorldPos, 25.0f, amountMinus1, 8.0f, 500,
10, 1);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->rightHandBackLimbWorldPos, 25.0f, amountMinus1, 8.0f,
500, 10, 1);
}
if (arg2 == 0 || arg2 == 2 || arg2 == 3) {
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->leftHandBackLimbWorldPos, 25.0f, amountMinus1, 8.0f, 500,
10, 1);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->leftHandBackLimbWorldPos, 25.0f, amountMinus1, 8.0f,
500, 10, 1);
}
if (arg2 == 0) {
@ -1374,7 +1374,7 @@ void BossGoma_FloorLandStruckDown(BossGoma* this, GlobalContext* globalCtx) {
this->framesUntilNextAction = 150;
}
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->actor.world.pos, 55.0f, 4, 8.0f, 500, 10, 1);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, 55.0f, 4, 8.0f, 500, 10, 1);
}
/**
@ -1400,7 +1400,7 @@ void BossGoma_FloorStunned(BossGoma* this, GlobalContext* globalCtx) {
SkelAnime_Update(&this->skelanime);
if (this->timer == 1) {
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->actor.world.pos, 55.0f, 4, 8.0f, 500, 10, 1);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, 55.0f, 4, 8.0f, 500, 10, 1);
}
Math_ApproachZeroF(&this->actor.speedXZ, 0.5f, 1.0f);

View file

@ -2805,7 +2805,7 @@ void BossTw_TwinrovaDeathCS(BossTw* this, GlobalContext* globalCtx) {
Vec3f pos;
Vec3f velocity;
Vec3f accel = { 0.0f, 0.0f, 0.0f };
for (i = 0; i < 50; i++) {
velocity.x = Rand_CenteredFloat(3.0f);
velocity.y = Rand_CenteredFloat(3.0f);

View file

@ -562,8 +562,8 @@ void func_809973E8(DoorShutter* this, GlobalContext* globalCtx) {
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, this->dyna.actor.velocity.y)) {
if (this->dyna.actor.velocity.y > 20.0f) {
this->dyna.actor.floorHeight = this->dyna.actor.home.pos.y;
Actor_SpawnFloorDust(globalCtx, &this->dyna.actor, &this->dyna.actor.world.pos, 45.0f, 0xA, 8.0f, 0x1F4,
0xA, 0);
Actor_SpawnFloorDustRing(globalCtx, &this->dyna.actor, &this->dyna.actor.world.pos, 45.0f, 0xA, 8.0f, 0x1F4,
0xA, 0);
}
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONE_BOUND);
quakeId = Quake_Add(Gameplay_GetCamera(globalCtx, 0), 3);
@ -599,8 +599,8 @@ void func_809975C0(DoorShutter* this, GlobalContext* globalCtx) {
this->unk_164 = 10;
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONE_BOUND);
func_8099803C(globalCtx, 2, 10, parent->subCameraId);
Actor_SpawnFloorDust(globalCtx, &this->dyna.actor, &this->dyna.actor.world.pos, 70.0f, 20, 8.0f, 500, 10,
1);
Actor_SpawnFloorDustRing(globalCtx, &this->dyna.actor, &this->dyna.actor.world.pos, 70.0f, 20, 8.0f, 500,
10, 1);
}
}
}

View file

@ -270,7 +270,7 @@ void EnAm_SpawnEffects(EnAm* this, GlobalContext* globalCtx) {
}
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EN_AMOS_WALK);
Actor_SpawnFloorDust(globalCtx, &this->dyna.actor, &this->dyna.actor.world.pos, 4.0f, 3, 8.0f, 0x12C, 0xF, 0);
Actor_SpawnFloorDustRing(globalCtx, &this->dyna.actor, &this->dyna.actor.world.pos, 4.0f, 3, 8.0f, 0x12C, 0xF, 0);
}
void EnAm_SetupSleep(EnAm* this) {

View file

@ -715,7 +715,7 @@ void EnBb_Down(EnBb* this, GlobalContext* globalCtx) {
this->actor.velocity.y = 10.0f;
}
this->actor.bgCheckFlags &= ~1;
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->actor.world.pos, 7.0f, 2, 2.0f, 0, 0, 0);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, 7.0f, 2, 2.0f, 0, 0, 0);
Math_SmoothStepToS(&this->actor.world.rot.y, -this->actor.yawTowardsPlayer, 1, 0xBB8, 0);
}
this->actor.shape.rot.y = this->actor.world.rot.y;
@ -1115,7 +1115,7 @@ void EnBb_Stunned(EnBb* this, GlobalContext* globalCtx) {
} else {
this->actor.velocity.y = 0.0f;
}
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->actor.world.pos, 7.0f, 2, 2.0f, 0, 0, 0);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, 7.0f, 2, 2.0f, 0, 0, 0);
}
if (this->actor.colorFilterTimer == 0) {
this->actor.shape.yOffset = 200.0f;

View file

@ -326,7 +326,8 @@ void func_809CEA24(EnBw* this, GlobalContext* globalCtx) {
if (this->unk_224 != 0) {
this->unk_224--;
}
if ((this->unk_234 == 0) && !func_800339B8(&this->actor, globalCtx, 50.0f, this->unk_236 + this->unk_238)) {
if ((this->unk_234 == 0) &&
!Actor_TestFloorInDirection(&this->actor, globalCtx, 50.0f, this->unk_236 + this->unk_238)) {
if (this->unk_238 != 0x4000) {
this->unk_238 = 0x4000;
} else {
@ -351,7 +352,7 @@ void func_809CEA24(EnBw* this, GlobalContext* globalCtx) {
this->actor.speedXZ * 1000.0f, 0);
if ((this->actor.xzDistToPlayer < 90.0f) && (this->actor.yDistToPlayer < 50.0f) &&
Actor_IsFacingPlayer(&this->actor, 0x1554) &&
func_800339B8(&this->actor, globalCtx, 71.24802f, this->actor.yawTowardsPlayer)) {
Actor_TestFloorInDirection(&this->actor, globalCtx, 71.24802f, this->actor.yawTowardsPlayer)) {
func_809CF8F0(this);
}
} else {
@ -460,7 +461,7 @@ void func_809CF984(EnBw* this, GlobalContext* globalCtx) {
Actor_Kill(&this->actor);
return;
}
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->actor.world.pos, 30.0f, 0xB, 4.0f, 0, 0, 0);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, 30.0f, 0xB, 4.0f, 0, 0, 0);
this->unk_222 = 3000;
this->actor.flags &= ~0x01000000;
this->actor.speedXZ = 0.0f;
@ -494,7 +495,7 @@ void func_809CFC4C(EnBw* this, GlobalContext* globalCtx) {
this->unk_258 += this->unk_25C;
Math_SmoothStepToF(&this->unk_260, 0.075f, 1.0f, 0.005f, 0.0f);
if (this->actor.bgCheckFlags & 2) {
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->actor.world.pos, 30.0f, 0xB, 4.0f, 0, 0, 0);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, 30.0f, 0xB, 4.0f, 0, 0, 0);
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND);
}
if (this->unk_224 != 0) {
@ -544,7 +545,7 @@ void func_809CFF98(EnBw* this, GlobalContext* globalCtx) {
Math_SmoothStepToF(&this->unk_248, 0.6f, 1.0f, 0.05f, 0.0f);
SkelAnime_Update(&this->skelAnime);
if (this->actor.bgCheckFlags & 3) {
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->actor.world.pos, 30.0f, 0xB, 4.0f, 0, 0, 0);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, 30.0f, 0xB, 4.0f, 0, 0, 0);
this->unk_222 = 0xBB8;
this->unk_250 = 0.0f;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND);
@ -667,7 +668,7 @@ void func_809D0424(EnBw* this, GlobalContext* globalCtx) {
if (func_800355E4(globalCtx, &this->collider2.base)) {
this->unk_230 = 0;
this->actor.scale.y -= 0.009f;
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->actor.world.pos, 30.0f, 0xB, 4.0f, 0, 0, 0);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, 30.0f, 0xB, 4.0f, 0, 0, 0);
} else {
this->unk_230 = 1;
}
@ -681,7 +682,7 @@ void func_809D0584(EnBw* this, GlobalContext* globalCtx) {
if ((this->actor.bgCheckFlags & 0x10) && (this->actor.bgCheckFlags & 1)) {
this->unk_230 = 0;
this->actor.scale.y -= 0.009f;
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->actor.world.pos, 30.0f, 0xB, 4.0f, 0, 0, 0);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, 30.0f, 0xB, 4.0f, 0, 0, 0);
func_809D00F4(this);
} else {
if (this->collider2.base.acFlags & AC_HIT) {
@ -709,8 +710,8 @@ void func_809D0584(EnBw* this, GlobalContext* globalCtx) {
if (func_800355E4(globalCtx, &this->collider2.base)) {
this->unk_230 = 0;
this->actor.scale.y -= 0.009f;
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->actor.world.pos, 30.0f, 0xB, 4.0f, 0, 0,
0);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, 30.0f, 0xB, 4.0f, 0,
0, 0);
} else {
this->unk_230 = 1;
}
@ -789,7 +790,7 @@ void EnBw_Update(Actor* thisx, GlobalContext* globalCtx2) {
this->collider1.info.toucher.effect = 1;
}
this->unk_234 = func_800339B8(thisx, globalCtx, 50.0f, thisx->world.rot.y);
this->unk_234 = Actor_TestFloorInDirection(thisx, globalCtx, 50.0f, thisx->world.rot.y);
if ((this->unk_220 == 4) || (this->unk_220 == 6) || (this->unk_220 == 5) || (this->unk_220 == 1) ||
(this->unk_234 != 0)) {
Actor_MoveForward(thisx);

View file

@ -551,13 +551,13 @@ void EnDodongo_Walk(EnDodongo* this, GlobalContext* globalCtx) {
if ((s32)this->skelAnime.curFrame < 21) {
if (!this->rightFootStep) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_J_WALK);
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->leftFootPos, 10.0f, 3, 2.0f, 0xC8, 0xF, 0);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->leftFootPos, 10.0f, 3, 2.0f, 0xC8, 0xF, 0);
this->rightFootStep = true;
}
} else {
if (this->rightFootStep) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_J_WALK);
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->rightFootPos, 10.0f, 3, 2.0f, 0xC8, 0xF, 0);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->rightFootPos, 10.0f, 3, 2.0f, 0xC8, 0xF, 0);
this->rightFootStep = false;
}
}
@ -642,11 +642,11 @@ void EnDodongo_SweepTail(EnDodongo* this, GlobalContext* globalCtx) {
tailPos.x = this->sphElements[1].dim.worldSphere.center.x;
tailPos.y = this->sphElements[1].dim.worldSphere.center.y;
tailPos.z = this->sphElements[1].dim.worldSphere.center.z;
Actor_SpawnFloorDust(globalCtx, &this->actor, &tailPos, 5.0f, 2, 2.0f, 100, 15, 0);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &tailPos, 5.0f, 2, 2.0f, 100, 15, 0);
tailPos.x = this->sphElements[2].dim.worldSphere.center.x;
tailPos.y = this->sphElements[2].dim.worldSphere.center.y;
tailPos.z = this->sphElements[2].dim.worldSphere.center.z;
Actor_SpawnFloorDust(globalCtx, &this->actor, &tailPos, 5.0f, 2, 2.0f, 100, 15, 0);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &tailPos, 5.0f, 2, 2.0f, 100, 15, 0);
if (this->colliderBody.base.atFlags & AT_HIT) {
Player* player = PLAYER;

View file

@ -201,8 +201,8 @@ void EnFireRock_Fall(EnFireRock* this, GlobalContext* globalCtx) {
case FIRE_ROCK_SPAWNED_FALLING2:
func_80033E88(&this->actor, globalCtx, 5, 2);
case FIRE_ROCK_BROKEN_PIECE1:
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale, 1,
8.0f, 500, 10, 0);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale,
1, 8.0f, 500, 10, 0);
for (i = 0; i < 5; i++) {
flamePos.x = Rand_CenteredFloat(20.0f) + this->actor.world.pos.x;
flamePos.y = this->actor.floorHeight;
@ -212,8 +212,8 @@ void EnFireRock_Fall(EnFireRock* this, GlobalContext* globalCtx) {
this->actionFunc = EnFireRock_SpawnMoreBrokenPieces;
break;
default:
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale, 3,
8.0f, 200, 10, 0);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale,
3, 8.0f, 200, 10, 0);
Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_EXPLOSION);
Actor_Kill(&this->actor);
break;

View file

@ -255,7 +255,7 @@ void EnFloormas_SetupHover(EnFloormas* this, GlobalContext* globalCtx) {
this->actor.speedXZ = 0.0f;
this->actor.gravity = 0.0f;
EnFloormas_MakeInvulnerable(this);
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->actor.world.pos, 15.0f, 6, 20.0f, 0x12C, 0x64, 1);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, 15.0f, 6, 20.0f, 0x12C, 0x64, 1);
Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_ATTACK);
this->actionFunc = EnFloormas_Hover;
}

View file

@ -323,8 +323,9 @@ void EnFz_SpawnIceSmokeActiveState(EnFz* this) {
void EnFz_ApplyDamage(EnFz* this, GlobalContext* globalCtx) {
Vec3f vec;
if (this->isMoving && ((this->actor.bgCheckFlags & 8) ||
(func_800339B8(&this->actor, globalCtx, 60.0f, this->actor.world.rot.y) == 0))) {
if (this->isMoving &&
((this->actor.bgCheckFlags & 8) ||
(Actor_TestFloorInDirection(&this->actor, globalCtx, 60.0f, this->actor.world.rot.y) == 0))) {
this->actor.bgCheckFlags &= ~8;
this->isMoving = false;
this->speedXZ = 0.0f;

View file

@ -366,8 +366,8 @@ void EnGeldB_Wait(EnGeldB* this, GlobalContext* globalCtx) {
this->actor.focus.pos = this->actor.world.pos;
this->actor.bgCheckFlags &= ~2;
this->actor.velocity.y = 0.0f;
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->leftFootPos, 3.0f, 2, 2.0f, 0, 0, 0);
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->rightFootPos, 3.0f, 2, 2.0f, 0, 0, 0);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->leftFootPos, 3.0f, 2, 2.0f, 0, 0, 0);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->rightFootPos, 3.0f, 2, 2.0f, 0, 0, 0);
}
if (SkelAnime_Update(&this->skelAnime)) {
EnGeldB_SetupReady(this);
@ -391,8 +391,8 @@ void EnGeldB_Flee(EnGeldB* this, GlobalContext* globalCtx) {
}
if (this->skelAnime.curFrame == 2.0f) {
this->actor.gravity = 0.0f;
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->leftFootPos, 3.0f, 2, 2.0f, 0, 0, 0);
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->rightFootPos, 3.0f, 2, 2.0f, 0, 0, 0);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->leftFootPos, 3.0f, 2, 2.0f, 0, 0, 0);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->rightFootPos, 3.0f, 2, 2.0f, 0, 0, 0);
}
if (SkelAnime_Update(&this->skelAnime)) {
Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.floorHeight + 300.0f, 1.0f, 20.5f, 0.0f);
@ -664,8 +664,8 @@ void EnGeldB_Circle(EnGeldB* this, GlobalContext* globalCtx) {
this->actor.speedXZ = 8.0f;
}
}
if ((this->actor.bgCheckFlags & 8) ||
!func_800339B8(&this->actor, globalCtx, this->actor.speedXZ, this->actor.shape.rot.y + 0x3E80)) {
if ((this->actor.bgCheckFlags & 8) || !Actor_TestFloorInDirection(&this->actor, globalCtx, this->actor.speedXZ,
this->actor.shape.rot.y + 0x3E80)) {
if (this->actor.bgCheckFlags & 8) {
if (this->actor.speedXZ >= 0.0f) {
phi_v1 = this->actor.shape.rot.y + 0x3E80;
@ -764,7 +764,7 @@ void EnGeldB_SpinDodge(EnGeldB* this, GlobalContext* globalCtx) {
this->actor.world.rot.y = this->actor.yawTowardsPlayer + 0x3A98;
if ((this->actor.bgCheckFlags & 8) ||
!func_800339B8(&this->actor, globalCtx, this->actor.speedXZ, this->actor.shape.rot.y + 0x3E80)) {
!Actor_TestFloorInDirection(&this->actor, globalCtx, this->actor.speedXZ, this->actor.shape.rot.y + 0x3E80)) {
if (this->actor.bgCheckFlags & 8) {
if (this->actor.speedXZ >= 0.0f) {
phi_v1 = this->actor.shape.rot.y + 0x3E80;
@ -923,8 +923,8 @@ void EnGeldB_SpinAttack(EnGeldB* this, GlobalContext* globalCtx) {
if ((s32)this->skelAnime.curFrame < 9) {
this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer;
} else if ((s32)this->skelAnime.curFrame == 13) {
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->leftFootPos, 3.0f, 2, 2.0f, 0, 0, 0);
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->rightFootPos, 3.0f, 2, 2.0f, 0, 0, 0);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->leftFootPos, 3.0f, 2, 2.0f, 0, 0, 0);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->rightFootPos, 3.0f, 2, 2.0f, 0, 0, 0);
this->swordState = 1;
this->actor.speedXZ = 10.0f;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GERUDOFT_ATTACK);
@ -1213,7 +1213,7 @@ void EnGeldB_Sidestep(EnGeldB* this, GlobalContext* globalCtx) {
}
if ((this->actor.bgCheckFlags & 8) ||
!func_800339B8(&this->actor, globalCtx, this->actor.speedXZ, this->actor.shape.rot.y + 0x3E80)) {
!Actor_TestFloorInDirection(&this->actor, globalCtx, this->actor.speedXZ, this->actor.shape.rot.y + 0x3E80)) {
if (this->actor.bgCheckFlags & 8) {
if (this->actor.speedXZ >= 0.0f) {
phi_v1 = this->actor.shape.rot.y + 0x3E80;

File diff suppressed because it is too large Load diff

View file

@ -8,35 +8,46 @@ struct EnMb;
typedef void (*EnMbActionFunc)(struct EnMb*, GlobalContext*);
typedef enum {
/* 0 */ ENMB_STATE_SPEAR_SPEARPATH_DAMAGED,
/* 1 */ ENMB_STATE_CLUB_DEAD,
/* 2 */ ENMB_STATE_CLUB_KNEELING_DAMAGED,
/* 3 */ ENMB_STATE_CLUB_KNEELING,
/* 5 */ ENMB_STATE_STUNNED = 5,
/* 6 */ ENMB_STATE_IDLE,
/* 9 */ ENMB_STATE_WALK = 9,
/* 10 */ ENMB_STATE_ATTACK,
/* 11 */ ENMB_STATE_ATTACK_END
} EnMbState;
typedef struct EnMb {
/* 0x0000 */ Actor actor;
/* 0x014C */ Vec3s bodyPartsPos[10];
/* 0x0188 */ u8 unk_188;
/* 0x0188 */ u8 damageEffect;
/* 0x018C */ SkelAnime skelAnime;
/* 0x01D0 */ Vec3s jointTable[28];
/* 0x0278 */ Vec3s morphTable[28];
/* 0x0320 */ s32 unk_320;
/* 0x0320 */ EnMbState state;
/* 0x0324 */ EnMbActionFunc actionFunc;
/* 0x0328 */ s16 unk_328;
/* 0x032A */ s16 unk_32A;
/* 0x032C */ s16 soundTimer;
/* 0x032E */ s16 unk_32E;
/* 0x0330 */ s16 unk_330;
/* 0x0328 */ s16 iceEffectTimer;
/* 0x032A */ s16 timer1;
/* 0x032C */ s16 timer2;
/* 0x032E */ s16 timer3;
/* 0x0330 */ s16 yawToWaypoint;
/* 0x0332 */ s16 unk_332;
/* 0x0334 */ s16 attackParams;
/* 0x0334 */ s16 attack;
/* 0x0338 */ Vec3f effSpawnPos;
/* 0x0344 */ Vec3f waypointPos;
/* 0x0350 */ char unk_34A[0xC];
/* 0x035C */ s8 waypoint;
/* 0x035D */ s8 path;
/* 0x035E */ s8 direction;
/* 0x035F */ s8 unk_35F;
/* 0x0360 */ f32 unk_360;
/* 0x0364 */ f32 unk_364;
/* 0x0368 */ ColliderCylinder collider1;
/* 0x03B4 */ ColliderQuad collider2;
/* 0x0434 */ ColliderTris collider3;
/* 0x0454 */ ColliderTrisElement collider3Items[2];
/* 0x0360 */ f32 maxHomeDist;
/* 0x0364 */ f32 playerDetectionRange;
/* 0x0368 */ ColliderCylinder hitbox;
/* 0x03B4 */ ColliderQuad attackCollider; // for attacking the player
/* 0x0434 */ ColliderTris frontShielding; // Moblins don't have shields, but this acts as one
/* 0x0454 */ ColliderTrisElement frontShieldingTris[2];
} EnMb; // size = 0x050C
extern const ActorInit En_Mb_InitVars;

View file

@ -200,8 +200,8 @@ void func_80AE5054(EnReeba* this, GlobalContext* globalCtx) {
SkelAnime_Update(&this->skelanime);
if ((globalCtx->gameplayFrames % 4) == 0) {
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale, 1, 8.0f,
500, 10, 1);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale, 1,
8.0f, 500, 10, 1);
}
if (this->unk_278 == 0) {
@ -341,8 +341,8 @@ void func_80AE56E0(EnReeba* this, GlobalContext* globalCtx) {
if ((this->unk_284 + 10.0f) <= this->actor.shape.yOffset) {
if ((globalCtx->gameplayFrames % 4) == 0) {
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale, 1,
8.0f, 500, 10, 1);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale, 1,
8.0f, 500, 10, 1);
}
Math_ApproachF(&this->actor.shape.yOffset, this->unk_284, 1.0f, this->unk_288);

View file

@ -662,7 +662,7 @@ void func_80B0DB00(EnSw* this, GlobalContext* globalCtx) {
}
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND);
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->actor.world.pos, 16.0f, 0xC, 2.0f, 0x78, 0xA, 0);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, 16.0f, 0xC, 2.0f, 0x78, 0xA, 0);
}
}

View file

@ -597,7 +597,7 @@ void EnTest_WalkAndBlock(EnTest* this, GlobalContext* globalCtx) {
}
if ((this->actor.params == STALFOS_TYPE_CEILING) &&
!func_800339B8(&this->actor, globalCtx, this->actor.speedXZ, this->actor.world.rot.y)) {
!Actor_TestFloorInDirection(&this->actor, globalCtx, this->actor.speedXZ, this->actor.world.rot.y)) {
this->actor.speedXZ *= -1.0f;
}
@ -826,7 +826,7 @@ void func_80860F84(EnTest* this, GlobalContext* globalCtx) {
if ((this->actor.bgCheckFlags & 8) ||
((this->actor.params == STALFOS_TYPE_CEILING) &&
!func_800339B8(&this->actor, globalCtx, this->actor.speedXZ, this->actor.world.rot.y))) {
!Actor_TestFloorInDirection(&this->actor, globalCtx, this->actor.speedXZ, this->actor.world.rot.y))) {
if (this->actor.bgCheckFlags & 8) {
if (this->actor.speedXZ >= 0.0f) {
newYaw = this->actor.shape.rot.y + 0x3FFF;
@ -1398,7 +1398,7 @@ void func_808628C8(EnTest* this, GlobalContext* globalCtx) {
if ((this->actor.bgCheckFlags & 8) ||
((this->actor.params == STALFOS_TYPE_CEILING) &&
!func_800339B8(&this->actor, globalCtx, this->actor.speedXZ, this->actor.shape.rot.y + 0x3FFF))) {
!Actor_TestFloorInDirection(&this->actor, globalCtx, this->actor.speedXZ, this->actor.shape.rot.y + 0x3FFF))) {
if (this->actor.bgCheckFlags & 8) {
if (this->actor.speedXZ >= 0.0f) {
newYaw = (this->actor.shape.rot.y + 0x3FFF);
@ -1905,7 +1905,7 @@ void EnTest_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, V
if ((this->unk_7C8 == 0x15) || (this->unk_7C8 == 0x16)) {
if (this->actor.speedXZ != 0.0f) {
Matrix_MultVec3f(&D_80864658, &sp64);
Actor_SpawnFloorDust(globalCtx, &this->actor, &sp64, 10.0f, 1, 8.0f, 0x64, 0xF, 0);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &sp64, 10.0f, 1, 8.0f, 0x64, 0xF, 0);
}
}
}

View file

@ -814,7 +814,7 @@ void EnTite_FlipOnBack(EnTite* this, GlobalContext* globalCtx) {
if (this->actor.bgCheckFlags & 3) {
// Upon landing, spawn dust and make noise
if (this->actor.bgCheckFlags & 2) {
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->actor.world.pos, 20.0f, 0xB, 4.0f, 0, 0, 0);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, 20.0f, 0xB, 4.0f, 0, 0, 0);
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND);
}
this->vOnBackTimer--;

View file

@ -308,7 +308,7 @@ void EnTrap_Update(Actor* thisx, GlobalContext* globalCtx) {
}
break;
}
if (!func_800339B8(thisx, globalCtx, 50.0f, this->vClosestDirection)) {
if (!Actor_TestFloorInDirection(thisx, globalCtx, 50.0f, this->vClosestDirection)) {
this->vMovementMetric = 0.0f;
}
// if in initial position:

View file

@ -187,7 +187,7 @@ void EnWallmas_SetupLand(EnWallmas* this, GlobalContext* globalCtx) {
Animation_Change(&this->skelAnime, objSegChangee, 1.0f, 41.0f, Animation_GetLastFrame(objSegFrameCount),
ANIMMODE_ONCE, -3.0f);
Actor_SpawnFloorDust(globalCtx, &this->actor, &this->actor.world.pos, 15.0f, 6, 20.0f, 0x12C, 0x64, 1);
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, 15.0f, 6, 20.0f, 0x12C, 0x64, 1);
Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_LAND);
this->actionFunc = EnWallmas_Land;
}

View file

@ -14041,10 +14041,10 @@ s32 func_80852F38(GlobalContext* globalCtx, Player* this) {
this->stateFlags2 |= 0x80;
func_80832224(this);
func_80832698(this, NA_SE_VO_LI_HELD);
return 1;
return true;
}
return 0;
return false;
}
// Sets up player cutscene