1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-01-13 19:57:18 +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 1061 additions and 970 deletions

View file

@ -320,7 +320,7 @@ glabel func_80B3487C
/* 01024 80B34CD4 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000
/* 01028 80B34CD8 26060024 */ addiu $a2, $s0, 0x0024 ## $a2 = 00000024
/* 0102C 80B34CDC 3C0741A0 */ lui $a3, 0x41A0 ## $a3 = 41A00000
/* 01030 80B34CE0 0C00CC98 */ jal Actor_SpawnFloorDust
/* 01030 80B34CE0 0C00CC98 */ jal Actor_SpawnFloorDustRing
/* 01034 80B34CE4 E7A80014 */ swc1 $f8, 0x0014($sp)
.L80B34CE8:
/* 01038 80B34CE8 8FBF0034 */ lw $ra, 0x0034($sp)

View file

@ -53,7 +53,7 @@ glabel func_80B35024
/* 01418 80B350C8 14400008 */ bne $v0, $zero, .L80B350EC
/* 0141C 80B350CC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
/* 01420 80B350D0 8FA5005C */ lw $a1, 0x005C($sp)
/* 01424 80B350D4 0C00CE6E */ jal func_800339B8
/* 01424 80B350D4 0C00CE6E */ jal Actor_TestFloorInDirection
/* 01428 80B350D8 8E060068 */ lw $a2, 0x0068($s0) ## 00000068
/* 0142C 80B350DC 54400019 */ bnel $v0, $zero, .L80B35144
/* 01430 80B350E0 8FA4005C */ lw $a0, 0x005C($sp)
@ -281,7 +281,7 @@ glabel func_80B35024
/* 01744 80B353F4 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000
/* 01748 80B353F8 26060024 */ addiu $a2, $s0, 0x0024 ## $a2 = 00000024
/* 0174C 80B353FC 3C0741A0 */ lui $a3, 0x41A0 ## $a3 = 41A00000
/* 01750 80B35400 0C00CC98 */ jal Actor_SpawnFloorDust
/* 01750 80B35400 0C00CC98 */ jal Actor_SpawnFloorDustRing
/* 01754 80B35404 E7A80014 */ swc1 $f8, 0x0014($sp)
/* 01758 80B35408 8FAB005C */ lw $t3, 0x005C($sp)
.L80B3540C:

View file

@ -135,7 +135,7 @@ glabel func_80B355BC
/* 01AC0 80B35770 AFB80018 */ sw $t8, 0x0018($sp)
/* 01AC4 80B35774 AFAF0010 */ sw $t7, 0x0010($sp)
/* 01AC8 80B35778 8FA4004C */ lw $a0, 0x004C($sp)
/* 01ACC 80B3577C 0C00CC98 */ jal Actor_SpawnFloorDust
/* 01ACC 80B3577C 0C00CC98 */ jal Actor_SpawnFloorDustRing
/* 01AD0 80B35780 E7AA0014 */ swc1 $f10, 0x0014($sp)
/* 01AD4 80B35784 8E0902E8 */ lw $t1, 0x02E8($s0) ## 000002E8
/* 01AD8 80B35788 252AFFFF */ addiu $t2, $t1, 0xFFFF ## $t2 = FFFFFFFF

View file

@ -33,7 +33,7 @@ glabel func_80B36740
/* 02AEC 80B3679C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
/* 02AF0 80B367A0 8FA50074 */ lw $a1, 0x0074($sp)
/* 02AF4 80B367A4 8E060068 */ lw $a2, 0x0068($s0) ## 00000068
/* 02AF8 80B367A8 0C00CE6E */ jal func_800339B8
/* 02AF8 80B367A8 0C00CE6E */ jal Actor_TestFloorInDirection
/* 02AFC 80B367AC 860700B6 */ lh $a3, 0x00B6($s0) ## 000000B6
/* 02B00 80B367B0 54400018 */ bnel $v0, $zero, .L80B36814
/* 02B04 80B367B4 860F00B6 */ lh $t7, 0x00B6($s0) ## 000000B6
@ -365,7 +365,7 @@ glabel func_80B36740
/* 02F94 80B36C44 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000
/* 02F98 80B36C48 26060024 */ addiu $a2, $s0, 0x0024 ## $a2 = 00000024
/* 02F9C 80B36C4C 3C0741A0 */ lui $a3, 0x41A0 ## $a3 = 41A00000
/* 02FA0 80B36C50 0C00CC98 */ jal Actor_SpawnFloorDust
/* 02FA0 80B36C50 0C00CC98 */ jal Actor_SpawnFloorDustRing
/* 02FA4 80B36C54 E7A60014 */ swc1 $f6, 0x0014($sp)
/* 02FA8 80B36C58 8FAF003C */ lw $t7, 0x003C($sp)
.L80B36C5C:

View file

@ -105,7 +105,7 @@ glabel func_80B45174
/* 01294 80B452E4 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000
/* 01298 80B452E8 260604F0 */ addiu $a2, $s0, 0x04F0 ## $a2 = 000004F0
/* 0129C 80B452EC 3C074040 */ lui $a3, 0x4040 ## $a3 = 40400000
/* 012A0 80B452F0 0C00CC98 */ jal Actor_SpawnFloorDust
/* 012A0 80B452F0 0C00CC98 */ jal Actor_SpawnFloorDustRing
/* 012A4 80B452F4 E7A80014 */ swc1 $f8, 0x0014($sp)
/* 012A8 80B452F8 3C014000 */ lui $at, 0x4000 ## $at = 40000000
/* 012AC 80B452FC 44815000 */ mtc1 $at, $f10 ## $f10 = 2.00
@ -118,7 +118,7 @@ glabel func_80B45174
/* 012C8 80B45318 AFA00018 */ sw $zero, 0x0018($sp)
/* 012CC 80B4531C AFA0001C */ sw $zero, 0x001C($sp)
/* 012D0 80B45320 AFA00020 */ sw $zero, 0x0020($sp)
/* 012D4 80B45324 0C00CC98 */ jal Actor_SpawnFloorDust
/* 012D4 80B45324 0C00CC98 */ jal Actor_SpawnFloorDustRing
/* 012D8 80B45328 E7AA0014 */ swc1 $f10, 0x0014($sp)
.L80B4532C:
/* 012DC 80B4532C 0C02927F */ jal SkelAnime_Update

View file

@ -11,7 +11,7 @@ glabel func_80B462E4
/* 022B8 80B46308 3C064220 */ lui $a2, 0x4220 ## $a2 = 42200000
/* 022BC 80B4630C 24E73FFF */ addiu $a3, $a3, 0x3FFF ## $a3 = 00003FFF
/* 022C0 80B46310 00073C00 */ sll $a3, $a3, 16
/* 022C4 80B46314 0C00CE6E */ jal func_800339B8
/* 022C4 80B46314 0C00CE6E */ jal Actor_TestFloorInDirection
/* 022C8 80B46318 00073C03 */ sra $a3, $a3, 16
/* 022CC 80B4631C 1440000A */ bne $v0, $zero, .L80B46348
/* 022D0 80B46320 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
@ -20,7 +20,7 @@ glabel func_80B462E4
/* 022DC 80B4632C 3C06C220 */ lui $a2, 0xC220 ## $a2 = C2200000
/* 022E0 80B46330 24E73FFF */ addiu $a3, $a3, 0x3FFF ## $a3 = 00003FFF
/* 022E4 80B46334 00073C00 */ sll $a3, $a3, 16
/* 022E8 80B46338 0C00CE6E */ jal func_800339B8
/* 022E8 80B46338 0C00CE6E */ jal Actor_TestFloorInDirection
/* 022EC 80B4633C 00073C03 */ sra $a3, $a3, 16
/* 022F0 80B46340 10400021 */ beq $v0, $zero, .L80B463C8
/* 022F4 80B46344 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000

View file

@ -126,7 +126,7 @@ glabel func_80B463E4
/* 02538 80B46588 8FA5005C */ lw $a1, 0x005C($sp)
/* 0253C 80B4658C 24E73FFF */ addiu $a3, $a3, 0x3FFF ## $a3 = 00003FFF
/* 02540 80B46590 00073C00 */ sll $a3, $a3, 16
/* 02544 80B46594 0C00CE6E */ jal func_800339B8
/* 02544 80B46594 0C00CE6E */ jal Actor_TestFloorInDirection
/* 02548 80B46598 00073C03 */ sra $a3, $a3, 16
/* 0254C 80B4659C 5440003B */ bnel $v0, $zero, .L80B4668C
/* 02550 80B465A0 8FA4005C */ lw $a0, 0x005C($sp)

View file

@ -210,7 +210,7 @@ glabel func_80B4781C
/* 03AA8 80B47AF8 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000
/* 03AAC 80B47AFC 260604F0 */ addiu $a2, $s0, 0x04F0 ## $a2 = 000004F0
/* 03AB0 80B47B00 3C074040 */ lui $a3, 0x4040 ## $a3 = 40400000
/* 03AB4 80B47B04 0C00CC98 */ jal Actor_SpawnFloorDust
/* 03AB4 80B47B04 0C00CC98 */ jal Actor_SpawnFloorDustRing
/* 03AB8 80B47B08 E7A60014 */ swc1 $f6, 0x0014($sp)
/* 03ABC 80B47B0C 3C014000 */ lui $at, 0x4000 ## $at = 40000000
/* 03AC0 80B47B10 44814000 */ mtc1 $at, $f8 ## $f8 = 2.00
@ -223,7 +223,7 @@ glabel func_80B4781C
/* 03ADC 80B47B2C AFA00018 */ sw $zero, 0x0018($sp)
/* 03AE0 80B47B30 AFA0001C */ sw $zero, 0x001C($sp)
/* 03AE4 80B47B34 AFA00020 */ sw $zero, 0x0020($sp)
/* 03AE8 80B47B38 0C00CC98 */ jal Actor_SpawnFloorDust
/* 03AE8 80B47B38 0C00CC98 */ jal Actor_SpawnFloorDustRing
/* 03AEC 80B47B3C E7A80014 */ swc1 $f8, 0x0014($sp)
/* 03AF0 80B47B40 C60A0090 */ lwc1 $f10, 0x0090($s0) ## 00000090
/* 03AF4 80B47B44 C7B00074 */ lwc1 $f16, 0x0074($sp)

View file

@ -11,7 +11,7 @@ glabel func_80B483E4
/* 043B8 80B48408 3C064220 */ lui $a2, 0x4220 ## $a2 = 42200000
/* 043BC 80B4840C 24E73FFF */ addiu $a3, $a3, 0x3FFF ## $a3 = 00003FFF
/* 043C0 80B48410 00073C00 */ sll $a3, $a3, 16
/* 043C4 80B48414 0C00CE6E */ jal func_800339B8
/* 043C4 80B48414 0C00CE6E */ jal Actor_TestFloorInDirection
/* 043C8 80B48418 00073C03 */ sra $a3, $a3, 16
/* 043CC 80B4841C 1440000A */ bne $v0, $zero, .L80B48448
/* 043D0 80B48420 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
@ -20,7 +20,7 @@ glabel func_80B483E4
/* 043DC 80B4842C 3C06C220 */ lui $a2, 0xC220 ## $a2 = C2200000
/* 043E0 80B48430 24E73FFF */ addiu $a3, $a3, 0x3FFF ## $a3 = 00003FFF
/* 043E4 80B48434 00073C00 */ sll $a3, $a3, 16
/* 043E8 80B48438 0C00CE6E */ jal func_800339B8
/* 043E8 80B48438 0C00CE6E */ jal Actor_TestFloorInDirection
/* 043EC 80B4843C 00073C03 */ sra $a3, $a3, 16
/* 043F0 80B48440 10400046 */ beq $v0, $zero, .L80B4855C
/* 043F4 80B48444 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000

View file

@ -47,7 +47,7 @@ glabel func_80B48578
/* 045B4 80B48604 A7A80056 */ sh $t0, 0x0056($sp)
/* 045B8 80B48608 24E73FFF */ addiu $a3, $a3, 0x3FFF ## $a3 = 00003FFF
/* 045BC 80B4860C 00073C00 */ sll $a3, $a3, 16
/* 045C0 80B48610 0C00CE6E */ jal func_800339B8
/* 045C0 80B48610 0C00CE6E */ jal Actor_TestFloorInDirection
/* 045C4 80B48614 00073C03 */ sra $a3, $a3, 16
/* 045C8 80B48618 1440003B */ bne $v0, $zero, .L80B48708
/* 045CC 80B4861C 87A80056 */ lh $t0, 0x0056($sp)

View file

@ -1,30 +1,30 @@
<Root>
<File Name="object_mb" Segment="6">
<Skeleton Name="gEnMbSkel_008F38" Type="Flex" LimbType="Standard" Offset="0x8F38"/>
<Skeleton Name="gEnMbSkel_014190" Type="Flex" LimbType="Standard" Offset="0x14190"/>
<Animation Name="gEnMbFallForwardAnim" Offset="0x6A4"/><!--Unused-->
<Animation Name="gEnMbAnim_00095C" Offset="0x95C"/><!--Unused-->
<Animation Name="gEnMbAnim_001000" Offset="0x1000"/><!--Unused-->
<Animation Name="gEnMbFallBackAnim" Offset="0x16B4"/>
<Animation Name="gEnMbAnim_001950" Offset="0x1950"/>
<Animation Name="gEnMbStandStillAnim" Offset="0x28E0"/>
<Animation Name="gEnMbReadyAttackAnim" Offset="0x2C10"/>
<Animation Name="gEnMbChargePlayerAnim" Offset="0x2F10"/>
<Animation Name="gEnMbLookLeftAndRightAnim" Offset="0x41A8"/>
<Animation Name="gEnMbResumePatrolAnim" Offset="0x9280"/>
<Animation Name ="gEnMbAnim_009450" Offset="0x9450"/> <!--Unused -->
<Animation Name="gEnMbWalkAnim" Offset="0x9FC0"/>
<Animation Name="gEnMbUnusedGrabSpearAnim" Offset="0xA410"/>
<Animation Name="gEnMbUnusedGrabSpear2Anim" Offset="0xA80C"/>
<Animation Name="gEnMbAnim_00ABE0" Offset="0xABE0"/>
<Animation Name="gEnMbAnim_00B4BC" Offset="0xB4BC"/>
<Animation Name="gEnMbAnim_00BE58" Offset="0xBE58"/>
<Animation Name="gEnMbAnim_00C44C" Offset="0xC44C"/>
<Animation Name="gEnMbAnim_00CF1C" Offset="0xCF1C"/>
<Animation Name="gEnMbAnim_00D380" Offset="0xD380"/>
<Animation Name="gEnMbAnim_00D5D4" Offset="0xD5D4"/>
<Animation Name="gEnMbAnim_00E18C" Offset="0xE18C"/>
<Animation Name="gEnMbAnim_00EBE4" Offset="0xEBE4"/>
<Skeleton Name="gEnMbSpearSkel" Type="Flex" LimbType="Standard" Offset="0x8F38"/>
<Skeleton Name="gEnMbClubSkel" Type="Flex" LimbType="Standard" Offset="0x14190"/>
<Animation Name="gEnMbSpearFallFaceDownAnim" Offset="0x6A4"/><!--Unused-->
<Animation Name="gEnMbSpearDamagedFromBehindAnim" Offset="0x95C"/>
<Animation Name="gEnMbSpearDamagedUngrabSpearAnim" Offset="0x1000"/><!--Unused-->
<Animation Name="gEnMbSpearFallOnItsBackAnim" Offset="0x16B4"/>
<Animation Name="gEnMbSpearDamagedFromFrontAnim" Offset="0x1950"/>
<Animation Name="gEnMbSpearStandStillAnim" Offset="0x28E0"/>
<Animation Name="gEnMbSpearPrepareChargeAnim" Offset="0x2C10"/>
<Animation Name="gEnMbSpearChargeAnim" Offset="0x2F10"/>
<Animation Name="gEnMbSpearLookLeftAndRightAnim" Offset="0x41A8"/>
<Animation Name="gEnMbSpearSlowDownAnim" Offset="0x9280"/>
<Animation Name="gEnMbSpearLookLeftAnim" Offset="0x9450"/><!--Unused -->
<Animation Name="gEnMbSpearWalkAnim" Offset="0x9FC0"/>
<Animation Name="gEnMbSpearUngrabSpearAnim" Offset="0xA410"/><!--Unused -->
<Animation Name="gEnMbSpearGrabSpearAnim" Offset="0xA80C"/><!--Unused -->
<Animation Name="gEnMbClubStrikeDownAnim" Offset="0xABE0"/>
<Animation Name="gEnMbClubLiftClubAnim" Offset="0xB4BC"/>
<Animation Name="gEnMbClubFallOnItsBackAnim" Offset="0xBE58"/>
<Animation Name="gEnMbClubDamagedKneelAnim" Offset="0xC44C"/>
<Animation Name="gEnMbClubStandStillClubUpAnim" Offset="0xCF1C"/><!--Unused -->
<Animation Name="gEnMbClubKneelingAnim" Offset="0xD380"/><!--Unused -->
<Animation Name="gEnMbClubBeatenKneelingAnim" Offset="0xD5D4"/>
<Animation Name="gEnMbClubStandUpAnim" Offset="0xE18C"/>
<Animation Name="gEnMbClubStandStillClubDownAnim" Offset="0xEBE4"/>
<DList Name="gEnMbDL_006930" Offset="0x06930"/>
<DList Name="gEnMbDL_006A18" Offset="0x06A18"/>
<DList Name="gEnMbDL_006B20" Offset="0x06B20"/>

View file

@ -483,15 +483,15 @@ void BodyBreak_Alloc(BodyBreak* bodyBreak, s32 count, GlobalContext* globalCtx);
void BodyBreak_SetInfo(BodyBreak* bodyBreak, s32 limbIndex, s32 minLimbIndex, s32 maxLimbIndex, u32 count, Gfx** dList,
s16 objectId);
s32 BodyBreak_SpawnParts(Actor* actor, BodyBreak* bodyBreak, GlobalContext* globalCtx, s16 type);
void Actor_SpawnFloorDust(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, f32 arg3, s32 arg4, f32 arg5, s16 arg6,
s16 arg7, u8 arg8);
void Actor_SpawnFloorDustRing(GlobalContext* globalCtx, Actor* actor, Vec3f* posXZ, f32 radius, s32 amountMinusOne, f32 randAccelWeight,
s16 scale, s16 scaleStep, u8 useLighting);
void func_80033480(GlobalContext* globalCtx, Vec3f* arg1, f32 arg2, s32 arg3, s16 arg4, s16 arg5, u8 arg6);
Actor* Actor_GetCollidedExplosive(GlobalContext* globalCtx, Collider* collider);
Actor* func_80033684(GlobalContext* globalCtx, Actor* explosiveActor);
Actor* Actor_GetProjectileActor(GlobalContext* globalCtx, Actor* refActor, f32 radius);
void Actor_ChangeCategory(GlobalContext* globalCtx, ActorContext* actorCtx, Actor* actor, u8 actorCategory);
void Actor_SetTextWithPrefix(GlobalContext* globalCtx, Actor* actor, s16 textIdLower);
s16 func_800339B8(Actor* actor, GlobalContext* globalCtx, f32 arg2, s16 arg3);
s16 Actor_TestFloorInDirection(Actor* actor, GlobalContext* globalCtx, f32 distance, s16 angle);
s32 Actor_IsTargeted(GlobalContext* globalCtx, Actor* actor);
s32 Actor_OtherIsTargeted(GlobalContext* globalCtx, Actor* actor);
f32 func_80033AEC(Vec3f* arg0, Vec3f* arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5);

View file

@ -1410,15 +1410,15 @@ void Audio_SequenceChannelProcessScript(SequenceChannel* channel) {
case 0x10:
if (lowBits < 8) {
channel->soundScriptIO[lowBits] = -1;
if (Audio_SyncLoadSample(channel->bankId, scriptState->value, &channel->soundScriptIO[lowBits]) ==
-1) {
if (Audio_SyncLoadSample(channel->bankId, scriptState->value,
&channel->soundScriptIO[lowBits]) == -1) {
break;
}
} else {
lowBits -= 8;
channel->soundScriptIO[lowBits] = -1;
if (Audio_SyncLoadSample(channel->bankId, channel->unk_22 + 0x100, &channel->soundScriptIO[lowBits]) ==
-1) {
if (Audio_SyncLoadSample(channel->bankId, channel->unk_22 + 0x100,
&channel->soundScriptIO[lowBits]) == -1) {
break;
}
}

View file

@ -2212,20 +2212,20 @@ void Actor_Draw(GlobalContext* globalCtx, Actor* actor) {
gSPSegment(POLY_XLU_DISP++, 0x06, globalCtx->objectCtx.status[actor->objBankIndex].segment);
if (actor->colorFilterTimer != 0) {
Color_RGBA8 sp2C = { 0, 0, 0, 255 };
Color_RGBA8 color = { 0, 0, 0, 255 };
if (actor->colorFilterParams & 0x8000) {
sp2C.r = sp2C.g = sp2C.b = ((actor->colorFilterParams & 0x1F00) >> 5) | 7;
color.r = color.g = color.b = ((actor->colorFilterParams & 0x1F00) >> 5) | 7;
} else if (actor->colorFilterParams & 0x4000) {
sp2C.r = ((actor->colorFilterParams & 0x1F00) >> 5) | 7;
color.r = ((actor->colorFilterParams & 0x1F00) >> 5) | 7;
} else {
sp2C.b = ((actor->colorFilterParams & 0x1F00) >> 5) | 7;
color.b = ((actor->colorFilterParams & 0x1F00) >> 5) | 7;
}
if (actor->colorFilterParams & 0x2000) {
func_80026860(globalCtx, &sp2C, actor->colorFilterTimer, actor->colorFilterParams & 0xFF);
func_80026860(globalCtx, &color, actor->colorFilterTimer, actor->colorFilterParams & 0xFF);
} else {
func_80026400(globalCtx, &sp2C, actor->colorFilterTimer, actor->colorFilterParams & 0xFF);
func_80026400(globalCtx, &color, actor->colorFilterTimer, actor->colorFilterParams & 0xFF);
}
}
@ -3167,33 +3167,35 @@ s32 BodyBreak_SpawnParts(Actor* actor, BodyBreak* bodyBreak, GlobalContext* glob
return true;
}
void Actor_SpawnFloorDust(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, f32 arg3, s32 arg4, f32 randAccelWeight,
s16 scale, s16 scaleStep, u8 arg8) {
void Actor_SpawnFloorDustRing(GlobalContext* globalCtx, Actor* actor, Vec3f* posXZ, f32 radius, s32 amountMinusOne,
f32 randAccelWeight, s16 scale, s16 scaleStep, u8 useLighting) {
Vec3f pos;
Vec3f velocity = { 0.0f, 0.0f, 0.0f };
Vec3f accel = { 0.0f, 0.3f, 0.0f };
f32 var;
f32 angle;
s32 i;
var = (Rand_ZeroOne() - 0.5f) * 6.28f;
angle = (Rand_ZeroOne() - 0.5f) * (2.0f * 3.14f);
pos.y = actor->floorHeight;
accel.y += (Rand_ZeroOne() - 0.5f) * 0.2f;
for (i = arg4; i >= 0; i--) {
pos.x = (Math_SinF(var) * arg3) + arg2->x;
pos.z = (Math_CosF(var) * arg3) + arg2->z;
for (i = amountMinusOne; i >= 0; i--) {
pos.x = Math_SinF(angle) * radius + posXZ->x;
pos.z = Math_CosF(angle) * radius + posXZ->z;
accel.x = (Rand_ZeroOne() - 0.5f) * randAccelWeight;
accel.z = (Rand_ZeroOne() - 0.5f) * randAccelWeight;
if (scale == 0) {
func_8002857C(globalCtx, &pos, &velocity, &accel);
} else if (arg8 != 0) {
func_800286CC(globalCtx, &pos, &velocity, &accel, scale, scaleStep);
} else {
func_8002865C(globalCtx, &pos, &velocity, &accel, scale, scaleStep);
if (useLighting) {
func_800286CC(globalCtx, &pos, &velocity, &accel, scale, scaleStep);
} else {
func_8002865C(globalCtx, &pos, &velocity, &accel, scale, scaleStep);
}
}
var += 6.28f / (arg4 + 1.0f);
angle += (2.0f * 3.14f) / (amountMinusOne + 1.0f);
}
}
@ -3388,24 +3390,33 @@ void Actor_SetTextWithPrefix(GlobalContext* globalCtx, Actor* actor, s16 baseTex
actor->textId = prefix | baseTextId;
}
s16 func_800339B8(Actor* actor, GlobalContext* globalCtx, f32 arg2, s16 arg3) {
/**
* Checks if a given actor will be standing on the ground after being translated
* by the provided distance and angle.
*
* Returns true if the actor will be standing on ground.
*/
s16 Actor_TestFloorInDirection(Actor* actor, GlobalContext* globalCtx, f32 distance, s16 angle) {
s16 ret;
s16 sp44;
f32 sp40;
f32 sp3C;
Vec3f sp30;
s16 prevBgCheckFlags;
f32 dx;
f32 dz;
Vec3f prevActorPos;
Math_Vec3f_Copy(&prevActorPos, &actor->world.pos);
prevBgCheckFlags = actor->bgCheckFlags;
dx = Math_SinS(angle) * distance;
dz = Math_CosS(angle) * distance;
actor->world.pos.x += dx;
actor->world.pos.z += dz;
Math_Vec3f_Copy(&sp30, &actor->world.pos);
sp44 = actor->bgCheckFlags;
sp40 = Math_SinS(arg3) * arg2;
sp3C = Math_CosS(arg3) * arg2;
actor->world.pos.x += sp40;
actor->world.pos.z += sp3C;
Actor_UpdateBgCheckInfo(globalCtx, actor, 0.0f, 0.0f, 0.0f, 4);
Math_Vec3f_Copy(&actor->world.pos, &sp30);
Math_Vec3f_Copy(&actor->world.pos, &prevActorPos);
ret = actor->bgCheckFlags & 1;
actor->bgCheckFlags = sp44;
actor->bgCheckFlags = prevBgCheckFlags;
return ret;
}

View file

@ -782,11 +782,11 @@ Gfx* Gfx_SetFog(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 n, s32 f) {
gDPSetFogColor(gfx++, r, g, b, a);
if (n >= 1000) {
gSPFogFactor(gfx++, 0, 0); // gSPFogPosition(gfx++, ?, ?)
gSPFogFactor(gfx++, 0, 0);
} else if (n >= 997) {
gSPFogFactor(gfx++, 0x7FFF, 0x8100); // gSPFogPosition(gfx++, ?, ?)
gSPFogFactor(gfx++, 0x7FFF, 0x8100);
} else if (n < 0) {
gSPFogFactor(gfx++, 0, 255); // gSPFogPosition(gfx++, ?, ?)
gSPFogFactor(gfx++, 0, 255);
} else {
gSPFogPosition(gfx++, n, f);
}
@ -804,11 +804,11 @@ Gfx* Gfx_SetFogWithSync(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 n, s32 f) {
gDPSetFogColor(gfx++, r, g, b, a);
if (n >= 1000) {
gSPFogFactor(gfx++, 0, 0); // gSPFogPosition(gfx++, ?, ?)
gSPFogFactor(gfx++, 0, 0);
} else if (n >= 997) {
gSPFogFactor(gfx++, 0x7FFF, 0x8100); // gSPFogPosition(gfx++, ?, ?)
gSPFogFactor(gfx++, 0x7FFF, 0x8100);
} else if (n < 0) {
gSPFogFactor(gfx++, 0, 255); // gSPFogPosition(gfx++, ?, ?)
gSPFogFactor(gfx++, 0, 255);
} else {
gSPFogPosition(gfx++, n, f);
}

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

View file

@ -86,9 +86,11 @@ animdict ={
"func_80035650": "Actor_SetDropFlag",
"func_8003573C": "Actor_SetDropFlagJntSph",
"func_80033780": "Actor_GetProjectileActor",
"func_80033260": "Actor_SpawnFloorDust",
"func_80033260": "Actor_SpawnFloorDustRing",
"Actor_SpawnFloorDust": "Actor_SpawnFloorDustRing",
"func_80032C7C": "Enemy_StartFinishingBlow",
"actorCtx.unk_00": "actorCtx.freezeFlashTimer",
"func_800339B8": "Actor_TestFloorInDirection",
}
def replace_anim(file):