diff options
| author | petrie911 <69443847+petrie911@users.noreply.github.com> | 2024-04-05 15:11:36 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-05 17:11:36 -0300 |
| commit | 126a55aa0eadaf8b2ed8f370cbba63368be7a964 (patch) | |
| tree | 3d1c9ff5d4ba097105a815659c3b87f9d36e3bed /src/engine | |
| parent | ac41c180a9e68d31d18cfc57b46032f4ccaa052a (diff) | |
Event Actor docs that kind of ballooned into a bunch of stuff (#200)
* stuff
* too much
* Torch commit
* torch again
Diffstat (limited to 'src/engine')
| -rw-r--r-- | src/engine/fox_360.c | 371 | ||||
| -rw-r--r-- | src/engine/fox_852F0.c | 2 | ||||
| -rw-r--r-- | src/engine/fox_beam.c | 49 | ||||
| -rw-r--r-- | src/engine/fox_bg.c | 85 | ||||
| -rw-r--r-- | src/engine/fox_boss.c | 22 | ||||
| -rw-r--r-- | src/engine/fox_context.c | 34 | ||||
| -rw-r--r-- | src/engine/fox_demo.c | 142 | ||||
| -rw-r--r-- | src/engine/fox_display.c | 132 | ||||
| -rw-r--r-- | src/engine/fox_edata_info.c | 58 | ||||
| -rw-r--r-- | src/engine/fox_edisplay.c | 154 | ||||
| -rw-r--r-- | src/engine/fox_effect.c | 74 | ||||
| -rw-r--r-- | src/engine/fox_enmy.c | 237 | ||||
| -rw-r--r-- | src/engine/fox_enmy2.c | 3507 | ||||
| -rw-r--r-- | src/engine/fox_game.c | 20 | ||||
| -rw-r--r-- | src/engine/fox_hud.c | 97 | ||||
| -rw-r--r-- | src/engine/fox_message.c | 8 | ||||
| -rw-r--r-- | src/engine/fox_play.c | 141 | ||||
| -rw-r--r-- | src/engine/fox_shapes.c | 2 | ||||
| -rw-r--r-- | src/engine/fox_std_lib.c | 4 | ||||
| -rw-r--r-- | src/engine/fox_tank.c | 26 | ||||
| -rw-r--r-- | src/engine/fox_versus.c | 22 |
21 files changed, 2594 insertions, 2593 deletions
diff --git a/src/engine/fox_360.c b/src/engine/fox_360.c index 9d84304d..9dbdfa93 100644 --- a/src/engine/fox_360.c +++ b/src/engine/fox_360.c @@ -16,16 +16,16 @@ { -300.0f, 800.0f, 6800.0f }, { 300.0f, 900.0f, 7200.0f }, }; -/* static */ s32 D_360_800C9ACC[4] = { 0, 1, 2, 3 }; -/* static */ s32 D_360_800C9ADC[4] = { -1, 10, 11, 12 }; -/* static */ s32 D_360_800C9AEC[4] = { -1, 21, 23, 25 }; +/* static */ AllRangeAi D_360_800C9ACC[4] = { AI360_FOX, AI360_FALCO, AI360_SLIPPY, AI360_PEPPY }; +/* static */ s32 D_360_800C9ADC[4] = { -1, AI360_10, AI360_10 + 1, AI360_10 + 2 }; +/* static */ s32 D_360_800C9AEC[4] = { -1, AI360_10 + 11, AI360_10 + 13, AI360_10 + 15 }; /* static */ Vec3f D_360_800C9AFC[4] = { { 9500.0f, 5000.0f, 9500.0f }, { 10000.0f, 5000.0f, 10000.0f }, { 10000.0f, 5000.0f, 9500.0f }, { 9500.0f, 5000.0f, 10000.0f }, }; -/* static */ s32 D_360_800C9B2C[4] = { 0, 1, 3, 2 }; +/* static */ s32 D_360_800C9B2C[4] = { AI360_FOX, AI360_FALCO, AI360_PEPPY, AI360_SLIPPY }; /* static */ f32 D_360_800C9B3C[4] = { 330.0f, 90.0f, 280.0f, 70.0f }; s32 D_360_800C9B4C = 96 * 30; /* static */ Vec3f D_360_800C9B50[6] = { @@ -364,10 +364,10 @@ void func_360_8002F180(void) { } Actor_Initialize(actor); actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_197; + actor->obj.id = OBJ_ACTOR_ALLRANGE; Object_SetInfo(&actor->info, actor->obj.id); if (i == 0) { - actor->aiType = 1000; + actor->aiType = AI360_EVENT_HANDLER; } else { actor->obj.pos.x = D_360_800C9A9C[i].x; actor->obj.pos.y = D_360_800C9A9C[i].y; @@ -380,7 +380,7 @@ void func_360_8002F180(void) { } actor->state = 2; actor->unk_0F4.y = 180.0f; - if (actor->aiIndex < 0) { + if (actor->aiIndex <= -1) { actor->state = 3; } actor->health = 50; @@ -388,7 +388,7 @@ void func_360_8002F180(void) { actor->unk_0C9 = 1; } actor->iwork[11] = 1; - if (actor->aiType < 4) { + if (actor->aiType <= AI360_PEPPY) { AUDIO_PLAY_SFX(0x3100000C, actor->sfxSource, 4); actor->info.hitbox = SEGMENTED_TO_VIRTUAL(D_edata_800CC01C); actor->info.unk_1C = 0.0f; @@ -411,8 +411,8 @@ void func_360_8002F3E0(void) { actor->obj.pos.x = D_360_800C9AFC[i].x; actor->obj.pos.y = D_360_800C9AFC[i].y; actor->obj.pos.z = D_360_800C9AFC[i].z; - actor->obj.id = OBJ_ACTOR_197; - actor->aiType = i + 4; + actor->obj.id = OBJ_ACTOR_ALLRANGE; + actor->aiType = i + AI360_WOLF; actor->aiIndex = D_360_800C9B2C[i]; gActors[actor->aiIndex].aiIndex = -1; actor->health = 100; @@ -424,7 +424,7 @@ void func_360_8002F3E0(void) { actor->iwork[11] = 1; if (gCurrentLevel == LEVEL_VENOM_2) { actor->obj.rot.z = D_360_800C9B3C[i]; - actor->unk_044 = 25; + actor->itemDrop = DROP_SILVER_STAR; } Object_SetInfo(&actor->info, actor->obj.id); if (gCurrentLevel == LEVEL_VENOM_2) { @@ -472,7 +472,7 @@ void func_360_8002F69C(Actor* actor) { if ((gCurrentLevel == LEVEL_VENOM_2) || (gCurrentLevel == LEVEL_BOLSE)) { gPlayer[0].unk_034 = 20.0f; } - AUDIO_PLAY_BGM(SEQ_ID_43 | 0x8000); + AUDIO_PLAY_BGM(SEQ_ID_STAR_WOLF | SEQ_FLAG); func_360_8002EE34(); if ((gCurrentLevel == LEVEL_FORTUNA) || (gCurrentLevel == LEVEL_VENOM_2)) { gPlayer[0].camEye.x = 4500.0f; @@ -491,8 +491,9 @@ void func_360_8002F69C(Actor* actor) { for (i = 1, otherActor = &gActors[1]; i < 8; i++, otherActor++) { if ((otherActor->obj.status == OBJ_ACTIVE) && (otherActor->state == 2) && (otherActor->health < 70) && (otherActor->timer_0C6 != 0) && (otherActor->unk_0D4 == 1)) { - if ((gActors[otherActor->aiIndex].state == 3) && (gActors[otherActor->aiIndex].aiType < 8)) { - gActors[otherActor->aiIndex].iwork[2] = 0; + if ((gActors[otherActor->aiIndex].state == 3) && + (gActors[otherActor->aiIndex].aiType < AI360_KATT)) { + gActors[otherActor->aiIndex].iwork[2] = AI360_FOX; gActors[otherActor->aiIndex].state = 2; gActors[otherActor->aiIndex].aiIndex = otherActor->aiType; if (D_display_800CA234 == &gActors[otherActor->aiIndex]) { @@ -501,20 +502,20 @@ void func_360_8002F69C(Actor* actor) { } if (gActors[otherActor->aiIndex].iwork[3] == 0) { switch (gActors[otherActor->aiIndex].aiType) { - case 1: + case AI360_FALCO: func_360_8002F5F4(gMsg_ID_9160, RCID_FALCO); break; - case 2: + case AI360_SLIPPY: func_360_8002F5F4(gMsg_ID_9170, RCID_SLIPPY); break; - case 3: + case AI360_PEPPY: func_360_8002F5F4(gMsg_ID_9180, RCID_PEPPY); break; } gActors[otherActor->aiIndex].iwork[3] = 200; } } - if (otherActor->aiType == 4) { + if (otherActor->aiType == AI360_WOLF) { if (gCurrentLevel != LEVEL_VENOM_2) { otherActor->state = 3; otherActor->unk_04E = 300; @@ -526,13 +527,13 @@ void func_360_8002F69C(Actor* actor) { } } if (gTeamShields[1] <= 0) { - gActors[5].aiIndex = 0; + gActors[AI360_LEON].aiIndex = AI360_FOX; } if (gTeamShields[2] <= 0) { - gActors[7].aiIndex = 0; + gActors[AI360_ANDREW].aiIndex = AI360_FOX; } if (gTeamShields[3] <= 0) { - gActors[6].aiIndex = 0; + gActors[AI360_PIGMA].aiIndex = AI360_FOX; } } } @@ -545,9 +546,9 @@ void func_360_8002FB4C(Actor* actor) { s32 j; s32 i; - for (i = 10, actor1 = &gActors[10]; i < 60; i++, actor1++) { - if ((actor1->obj.status == OBJ_ACTIVE) && (actor1->obj.id == OBJ_ACTOR_197) && (actor1->unk_0B6 == 0) && - (actor1->aiIndex < 0)) { + for (i = 10, actor1 = &gActors[10]; i < ARRAY_COUNT(gActors); i++, actor1++) { + if ((actor1->obj.status == OBJ_ACTIVE) && (actor1->obj.id == OBJ_ACTOR_ALLRANGE) && (actor1->unk_0B6 == 0) && + (actor1->aiIndex <= -1)) { var_a0 = false; for (j = 1, actor2 = &gActors[1]; j < 4; j++, actor2++) { if ((j != actor->index) && (i == actor2->aiIndex)) { @@ -557,7 +558,7 @@ void func_360_8002FB4C(Actor* actor) { if (!var_a0) { actor->aiIndex = i; actor->state = 2; - actor->iwork[2] = 0; + actor->iwork[2] = AI360_FOX; break; } } @@ -569,7 +570,8 @@ void func_360_8002FC00(Actor* actor) { s32 i; for (i = 0, otherActor = &gActors[10]; i < 50; i++, otherActor++) { - if ((otherActor->obj.status == OBJ_DYING) && (otherActor->aiIndex > 0) && (otherActor->aiIndex < 4)) { + if ((otherActor->obj.status == OBJ_DYING) && (otherActor->aiIndex >= AI360_FALCO) && + (otherActor->aiIndex <= AI360_PEPPY)) { Actor* actor2; s32 j; @@ -588,13 +590,13 @@ void func_360_8002FC00(Actor* actor) { D_display_Timer_800CA238 = 0; } switch (gActors[otherActor->aiIndex].aiType) { - case 1: + case AI360_FALCO: func_360_8002F5F4(gMsg_ID_9160, RCID_FALCO); break; - case 2: + case AI360_SLIPPY: func_360_8002F5F4(gMsg_ID_9170, RCID_SLIPPY); break; - case 3: + case AI360_PEPPY: func_360_8002F5F4(gMsg_ID_9180, RCID_PEPPY); break; } @@ -636,7 +638,7 @@ void func_360_8002FEF0(Actor* actor) { if (newActor->obj.status == OBJ_FREE) { Actor_Initialize(newActor); newActor->obj.status = OBJ_INIT; - newActor->obj.id = OBJ_ACTOR_291; + newActor->obj.id = OBJ_ACTOR_SUPPLIES; if (gCurrentLevel == LEVEL_SECTOR_Z) { newActor->obj.pos.x = 200.0f; newActor->obj.pos.y = -500.0f; @@ -767,7 +769,7 @@ s32 func_360_8003049C(Actor* actor) { } sp44 = 1200.0f; var_ft5 = 650.0f; - if (actor->aiType < 8) { + if (actor->aiType < AI360_KATT) { var_ft5 = 720.0f; } @@ -794,14 +796,15 @@ void func_360_8003088C(Actor* actor) { Vec3f sp3C; if (actor->unk_0D0 != 0) { - if (actor->aiType == 100) { + if (actor->aiType == AI360_GREAT_FOX) { actor->unk_0D0 = 0; } - if ((actor->unk_0D0 >= 2) && (actor->aiType >= 4) && (actor->aiType < 8)) { + if ((actor->unk_0D0 >= 2) && (actor->aiType >= AI360_WOLF) && (actor->aiType < AI360_KATT)) { actor->damage = 10; actor->timer_0C2 = 10; } - if (((actor->aiType < 4) || (actor->aiType == 9) || (actor->aiType == 8)) && (actor->unk_0D0 == 2)) { + if (((actor->aiType <= AI360_PEPPY) || (actor->aiType == AI360_BILL) || (actor->aiType == AI360_KATT)) && + (actor->unk_0D0 == 2)) { actor->unk_0D0 = 0; } if ((actor->unk_0D0 == 2) && (actor->fwork[22] > 0.0f)) { @@ -813,8 +816,9 @@ void func_360_8003088C(Actor* actor) { if (actor->unk_0D0 != 0) { var_a1 = false; if ((actor->unk_0B6 == 3) || - ((gCurrentLevel == LEVEL_BOLSE) && (gBosses[1].obj.status != OBJ_FREE) && (actor->aiType >= 4)) || - ((gCurrentLevel == LEVEL_VENOM_2) && (actor->aiType >= 4) && (actor->aiType < 10) && + ((gCurrentLevel == LEVEL_BOLSE) && (gBosses[1].obj.status != OBJ_FREE) && + (actor->aiType >= AI360_WOLF)) || + ((gCurrentLevel == LEVEL_VENOM_2) && (actor->aiType >= AI360_WOLF) && (actor->aiType < AI360_10) && (actor->unk_0D0 == 2))) { actor->damage = 0; var_a1 = true; @@ -822,13 +826,13 @@ void func_360_8003088C(Actor* actor) { actor->unk_0D4 = 0; } } - if (actor->aiType >= 4) { - if (((actor->unk_0D0 != 3) || (actor->aiType != 4)) && - ((actor->aiType != 200) || (actor->unk_0D0 != 2))) { + if (actor->aiType >= AI360_WOLF) { + if (((actor->unk_0D0 != 3) || (actor->aiType != AI360_WOLF)) && + ((actor->aiType != AI360_MISSILE) || (actor->unk_0D0 != 2))) { actor->health -= actor->damage; } - } else if ((actor->aiType < 4) && (actor->state != 6)) { - if (actor->aiType == 1) { + } else if ((actor->aiType <= AI360_PEPPY) && (actor->state != 6)) { + if (actor->aiType == AI360_FALCO) { gTeamDamage[actor->aiType] = actor->damage; } else { gTeamDamage[actor->aiType] = actor->damage * 2; @@ -836,7 +840,7 @@ void func_360_8003088C(Actor* actor) { } if (actor->health <= 0) { actor->health = 0; - if (actor->aiType == 200) { + if (actor->aiType == AI360_MISSILE) { SectorZ_80199900(actor, 1); if (actor->unk_0D4 == 1) { if (gActors[8].obj.status == OBJ_ACTIVE) { @@ -896,7 +900,7 @@ void func_360_8003088C(Actor* actor) { actor->timer_0BC = RAND_INT(50.0f); } } - if ((actor->aiType >= 4) && (actor->aiType < 8)) { + if ((actor->aiType >= AI360_WOLF) && (actor->aiType < AI360_KATT)) { actor->timer_0BC = RAND_INT(40.0f) + 60.0f; } if (actor->damage >= 20) { @@ -909,7 +913,7 @@ void func_360_8003088C(Actor* actor) { D_360_8015F921++; } switch (actor->aiType) { - case 4: + case AI360_WOLF: D_ctx_80177CD0[0] = 0; if (gCurrentLevel == LEVEL_VENOM_2) { func_360_8002F64C(gMsg_ID_19458, RCID_WOLF); @@ -917,7 +921,7 @@ void func_360_8003088C(Actor* actor) { func_360_8002F64C(gMsg_ID_9365, RCID_WOLF); } break; - case 5: + case AI360_LEON: D_ctx_80177CD0[1] = 0; if (gCurrentLevel == LEVEL_VENOM_2) { func_360_8002F64C(gMsg_ID_19459, RCID_LEON); @@ -925,7 +929,7 @@ void func_360_8003088C(Actor* actor) { func_360_8002F64C(gMsg_ID_9366, RCID_LEON); } break; - case 6: + case AI360_PIGMA: D_ctx_80177CD0[2] = 0; if (gCurrentLevel == LEVEL_VENOM_2) { func_360_8002F64C(gMsg_ID_19460, RCID_PIGMA); @@ -933,7 +937,7 @@ void func_360_8003088C(Actor* actor) { func_360_8002F64C(gMsg_ID_9367, RCID_PIGMA); } break; - case 7: + case AI360_ANDREW: D_ctx_80177CD0[3] = 0; if (gCurrentLevel == LEVEL_VENOM_2) { func_360_8002F64C(gMsg_ID_19461, RCID_ANDREW); @@ -942,20 +946,20 @@ void func_360_8003088C(Actor* actor) { } break; } - if ((actor->aiType >= 4) && (actor->aiType < 8)) { + if ((actor->aiType >= AI360_WOLF) && (actor->aiType < AI360_KATT)) { D_360_8015F904 = 150; } switch (actor->unk_0D4) { case 1: - if (actor->aiType >= 10) { + if (actor->aiType >= AI360_10) { switch (actor->iwork[2]) { - case 1: + case AI360_FALCO: func_360_8002F5F4(gMsg_ID_20170, RCID_FALCO); break; - case 2: + case AI360_SLIPPY: func_360_8002F5F4(gMsg_ID_20150, RCID_SLIPPY); break; - case 3: + case AI360_PEPPY: func_360_8002F5F4(gMsg_ID_20160, RCID_PEPPY); break; } @@ -964,7 +968,7 @@ void func_360_8003088C(Actor* actor) { case 102: case 103: case 104: - if ((actor->aiType >= 4) && (actor->aiType < 8)) { + if ((actor->aiType >= AI360_WOLF) && (actor->aiType < AI360_KATT)) { if ((D_ctx_80177CD0[0] + D_ctx_80177CD0[1] + D_ctx_80177CD0[2] + D_ctx_80177CD0[3]) == 0) { switch (actor->unk_0D4) { case 102: @@ -1002,13 +1006,13 @@ void func_360_8003088C(Actor* actor) { actor->timer_0C6 = 20; actor->iwork[8] = 20; } - if (actor->aiType == 200) { + if (actor->aiType == AI360_MISSILE) { AUDIO_PLAY_SFX(0x29034003, actor->sfxSource, 4); } else if (actor->iwork[7] == 0) { AUDIO_PLAY_SFX(0x2903300E, actor->sfxSource, 4); } func_effect_8007D10C(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 1.5f); - if (actor->aiType < 100) { + if (actor->aiType < AI360_GREAT_FOX) { Matrix_RotateY(gCalcMatrix, actor->unk_0F4.y * M_DTOR, 0); sp48.x = 30.0f; if (Rand_ZeroOne() < 0.5f) { @@ -1032,41 +1036,41 @@ void func_360_8003088C(Actor* actor) { if ((gRadioState == 0) && (gActors[0].obj.status == OBJ_ACTIVE)) { if (actor->unk_0D0 == 3) { switch (actor->aiType) { - case 1: + case AI360_FALCO: func_360_8002F5F4(gMsg_ID_20210, RCID_FALCO); break; - case 3: + case AI360_PEPPY: func_360_8002F5F4(gMsg_ID_20200, RCID_PEPPY); break; - case 2: + case AI360_SLIPPY: func_360_8002F5F4(gMsg_ID_20190, RCID_SLIPPY); break; - case 8: + case AI360_KATT: func_360_8002F5F4(gMsg_ID_20084, RCID_KATT); break; } } else if (actor->unk_0D4 < 105) { - if (actor->aiType >= 4) { + if (actor->aiType >= AI360_WOLF) { if (actor->unk_0D4 == 1) { if ((gCurrentLevel == LEVEL_KATINA) && (actor->unk_0B6 == 1) && (D_360_8015F920 == 0)) { D_360_8015F920 = 1; Radio_PlayMessage(gMsg_ID_18015, RCID_BILL); - } else if (actor->aiType == 8) { + } else if (actor->aiType == AI360_KATT) { func_360_8002F5F4(gMsg_ID_20084, RCID_KATT); - } else if (actor->aiType == 9) { + } else if (actor->aiType == AI360_BILL) { func_360_8002F5F4(gMsg_ID_20085, RCID_BILL); } else if (gCurrentLevel == LEVEL_VENOM_2) { switch (actor->aiType) { - case 4: + case AI360_WOLF: func_360_8002F5F4(gMsg_ID_19454, RCID_WOLF); break; - case 5: + case AI360_LEON: func_360_8002F5F4(gMsg_ID_19455, RCID_LEON); break; - case 6: + case AI360_PIGMA: func_360_8002F5F4(gMsg_ID_19456, RCID_PIGMA); break; - case 7: + case AI360_ANDREW: func_360_8002F5F4(gMsg_ID_19457, RCID_ANDREW); break; } @@ -1074,20 +1078,21 @@ void func_360_8003088C(Actor* actor) { } } else if (actor->unk_0D4 == 1) { switch (actor->aiType) { - case 1: + case AI360_FALCO: func_360_8002F5F4(gMsg_ID_20060, RCID_FALCO); break; - case 3: + case AI360_PEPPY: func_360_8002F5F4(gMsg_ID_20070, RCID_PEPPY); break; - case 2: + case AI360_SLIPPY: func_360_8002F5F4(gMsg_ID_20080, RCID_SLIPPY); break; } } - } else if ((actor->aiType < 4) && (actor->iwork[6] != 0) && (actor->iwork[2] != 0)) { + } else if ((actor->aiType <= AI360_PEPPY) && (actor->iwork[6] != 0) && + (actor->iwork[2] != AI360_FOX)) { switch (actor->aiType) { - case 1: + case AI360_FALCO: if (gTeamShields[1] >= 90) { func_360_8002F5F4(gMsg_ID_9130, RCID_FALCO); } else { @@ -1098,7 +1103,7 @@ void func_360_8003088C(Actor* actor) { D_display_Timer_800CA238 = 320; } break; - case 2: + case AI360_SLIPPY: if (gTeamShields[2] >= 90) { func_360_8002F5F4(gMsg_ID_9140, RCID_SLIPPY); } else { @@ -1109,7 +1114,7 @@ void func_360_8003088C(Actor* actor) { D_display_Timer_800CA238 = 320; } break; - case 3: + case AI360_PEPPY: if (gTeamShields[3] >= 90) { func_360_8002F5F4(gMsg_ID_9150, RCID_PEPPY); } else { @@ -1155,7 +1160,7 @@ bool func_360_80031900(Actor* actor) { return false; } -void func_360_800319AC(Actor* this) { +void ActorAllRange_Update(Actor* this) { u8 sp10F; s32 sp108; s32 sp104; @@ -1188,13 +1193,13 @@ void func_360_800319AC(Actor* this) { s32 pad2; s32 pad3; - if (this->aiType == 1000) { + if (this->aiType == AI360_EVENT_HANDLER) { this->timer_0C2 = 10; this->info.unk_1C = 0.0f; func_360_8003010C(this); return; } - if ((this->iwork[17] != 0) && (this->iwork[16] == 0) && (this->aiType >= 4)) { + if ((this->iwork[17] != 0) && (this->iwork[16] == 0) && (this->aiType >= AI360_WOLF)) { switch (RAND_INT(3.9f)) { case 0: case 1: @@ -1215,7 +1220,7 @@ void func_360_800319AC(Actor* this) { this->iwork[16] = 0; } } - if ((this->timer_0CA[0] != 0) && (gCurrentLevel != LEVEL_VENOM_2) && (this->aiType < 10) && + if ((this->timer_0CA[0] != 0) && (gCurrentLevel != LEVEL_VENOM_2) && (this->aiType < AI360_10) && (this->timer_0CA[0] < 5) && !(gGameFrameCount & 0x1F)) { this->iwork[16] = 10; } @@ -1244,7 +1249,7 @@ void func_360_800319AC(Actor* this) { } break; case 10: - this->timer_0BC = 0x23; + this->timer_0BC = 35; if (Rand_ZeroOne() < 0.5f) { this->fwork[7] = 360.0f; this->fwork[8] = 0.0f; @@ -1274,17 +1279,17 @@ void func_360_800319AC(Actor* this) { } else { this->iwork[11] = 1; } - if (this->aiType < 10) { + if (this->aiType < AI360_10) { func_360_80031858(this); if (this->iwork[10] == 200) { switch (this->aiType) { - case 4: - case 5: - case 6: - case 7: - case 8: + case AI360_WOLF: + case AI360_LEON: + case AI360_PIGMA: + case AI360_ANDREW: + case AI360_KATT: break; - case 1: + case AI360_FALCO: if (gPlayer[0].shields < (Play_GetMaxShields() / 2)) { Radio_PlayMessage(gMsg_ID_20298, RCID_FALCO); } else if (Rand_ZeroOne() < 0.5f) { @@ -1293,7 +1298,7 @@ void func_360_800319AC(Actor* this) { Radio_PlayMessage(gMsg_ID_20301, RCID_FALCO); } break; - case 2: + case AI360_SLIPPY: if (gPlayer[0].shields < (Play_GetMaxShields() / 2)) { Radio_PlayMessage(gMsg_ID_20297, RCID_SLIPPY); } else if (Rand_ZeroOne() < 0.5f) { @@ -1302,7 +1307,7 @@ void func_360_800319AC(Actor* this) { Radio_PlayMessage(gMsg_ID_20300, RCID_SLIPPY); } break; - case 3: + case AI360_PEPPY: if (gPlayer[0].shields < (Play_GetMaxShields() / 2)) { Radio_PlayMessage(gMsg_ID_20296, RCID_PEPPY); } else if (Rand_ZeroOne() < 0.5f) { @@ -1311,7 +1316,7 @@ void func_360_800319AC(Actor* this) { Radio_PlayMessage(gMsg_ID_20299, RCID_PEPPY); } break; - case 9: + case AI360_BILL: Radio_PlayMessage(gMsg_ID_18120, RCID_BILL); break; } @@ -1319,18 +1324,19 @@ void func_360_800319AC(Actor* this) { } sp104 = 0; this->iwork[5] = 0; - if ((this->aiType > 0) && (this->aiType < 4) && (gTeamShields[this->aiType] <= 0) && (this->state != 6)) { + if ((this->aiType > AI360_FOX) && (this->aiType <= AI360_PEPPY) && (gTeamShields[this->aiType] <= 0) && + (this->state != 6)) { this->state = 6; if (this->timer_0C2 < 100) { gTeamShields[this->aiType] = 1; switch (this->aiType) { - case 1: + case AI360_FALCO: Radio_PlayMessage(gMsg_ID_20220, RCID_FALCO); break; - case 2: + case AI360_SLIPPY: Radio_PlayMessage(gMsg_ID_20222, RCID_SLIPPY); break; - case 3: + case AI360_PEPPY: Radio_PlayMessage(gMsg_ID_20221, RCID_PEPPY); break; } @@ -1384,7 +1390,7 @@ void func_360_800319AC(Actor* this) { this->fwork[1] = 200.0f; } if (this->timer_0BC == 0) { - if (this->aiType == 4) { + if (this->aiType == AI360_WOLF) { this->state = 3; if (gCurrentLevel == LEVEL_VENOM_2) { this->unk_04E = 200; @@ -1393,7 +1399,7 @@ void func_360_800319AC(Actor* this) { } } else { this->state = 2; - if (this->aiType == 8) { + if (this->aiType == AI360_KATT) { this->fwork[7] = 360.0f; this->fwork[8] = 0.0f; } @@ -1409,7 +1415,7 @@ void func_360_800319AC(Actor* this) { } if (this->timer_0BC == 0) { this->state = 3; - if ((gCurrentLevel == LEVEL_BOLSE) && (this->aiIndex >= 0)) { + if ((gCurrentLevel == LEVEL_BOLSE) && (this->aiIndex > -1)) { this->state = 2; } } @@ -1422,30 +1428,30 @@ void func_360_800319AC(Actor* this) { spEC = fabsf(this->fwork[4] - this->obj.pos.x); spE8 = fabsf(this->fwork[6] - this->obj.pos.z); sp10F = 0xB; - if (this->aiType == 1) { + if (this->aiType == AI360_FALCO) { spF0 = 0.5f; } else if ((this->unk_0B6 != 2) && (this->unk_0B6 == 3)) { spF0 = 0.5f; } - if (this->aiIndex == 0) { + if (this->aiIndex == AI360_FOX) { spF0 = 0.2f; } - if (this->aiIndex < 0) { + if (this->aiIndex <= -1) { this->state = 3; } else { - if (gActors[this->aiIndex].aiType == 200) { + if (gActors[this->aiIndex].aiType == AI360_MISSILE) { spF0 = 0.8f; spF4 = spF8 = 3000.0f; this->fwork[3] = 2.0f; } - if (this->aiIndex == 0) { + if (this->aiIndex == AI360_FOX) { if (gCurrentLevel != LEVEL_VENOM_2) { if (((gPlayer[0].unk_4DC != 0) && (this->iwork[4] > 10)) || ((gCurrentLevel == LEVEL_BOLSE) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_0))) { this->state = 3; this->unk_04E = 300; this->timer_0BC = 160; - if (this->aiType == 4) { + if (this->aiType == AI360_WOLF) { func_360_8002F5F4(gMsg_ID_9369, RCID_WOLF); } break; @@ -1454,8 +1460,8 @@ void func_360_800319AC(Actor* this) { break; } } - if ((this->aiType >= 4) && (this->aiType != 8) && - ((gCurrentLevel != LEVEL_VENOM_2) || (this->aiType != 4))) { + if ((this->aiType >= AI360_WOLF) && (this->aiType != AI360_KATT) && + ((gCurrentLevel != LEVEL_VENOM_2) || (this->aiType != AI360_WOLF))) { spCC = SIN_DEG((this->index * 45) + gGameFrameCount) * 100.0f; spC8 = COS_DEG((this->index * 45) + (gGameFrameCount * 2)) * 100.0f; spC4 = SIN_DEG((this->index * 45) + gGameFrameCount) * 100.0f; @@ -1466,11 +1472,11 @@ void func_360_800319AC(Actor* this) { this->fwork[6] = gPlayer[0].unk_138 + spC4; this->fwork[1] = gPlayer[0].unk_0D0 + 10.0f; } - if ((gActors[0].state == 6) && (this->aiType < 4)) { + if ((gActors[0].state == 6) && (this->aiType <= AI360_PEPPY)) { this->fwork[3] = 3.0f; this->fwork[1] = gPlayer[0].unk_0D0 - 5.0f; this->iwork[11] = 2; - } else if ((gCurrentLevel == LEVEL_VENOM_2) && (this->aiType >= 4)) { + } else if ((gCurrentLevel == LEVEL_VENOM_2) && (this->aiType >= AI360_WOLF)) { this->fwork[3] = 1.6f; this->fwork[1] = 55.0f; } else { @@ -1484,8 +1490,8 @@ void func_360_800319AC(Actor* this) { } else { spF0 = 0.7f; } - } else if (this->aiIndex != 100) { - if (this->aiType >= 10) { + } else if (this->aiIndex != AI360_GREAT_FOX) { + if (this->aiType >= AI360_10) { spCC = SIN_DEG((this->index * 45) + gGameFrameCount) * 200.0f; spC8 = COS_DEG((this->index * 45) + (gGameFrameCount * 2)) * 200.0f; spC4 = SIN_DEG((this->index * 45) + gGameFrameCount) * 200.0f; @@ -1493,10 +1499,10 @@ void func_360_800319AC(Actor* this) { this->fwork[4] = gActors[this->aiIndex].obj.pos.x + spCC; this->fwork[5] = gActors[this->aiIndex].obj.pos.y + spC8; this->fwork[6] = gActors[this->aiIndex].obj.pos.z + spC4; - if ((gCurrentLevel == LEVEL_VENOM_2) && (this->aiType >= 4)) { + if ((gCurrentLevel == LEVEL_VENOM_2) && (this->aiType >= AI360_WOLF)) { this->fwork[1] = 55.0f; this->fwork[3] = 1.6f; - } else if ((gCurrentLevel == LEVEL_FORTUNA) && (this->aiType >= 0xB)) { + } else if ((gCurrentLevel == LEVEL_FORTUNA) && (this->aiType > AI360_10)) { this->fwork[3] = 1.4f; this->fwork[1] = 50.0f; } else { @@ -1512,10 +1518,10 @@ void func_360_800319AC(Actor* this) { this->fwork[6] = gBosses[0].obj.pos.z; this->fwork[1] = 40.0f; } - if ((this->aiIndex >= 0) && (this->aiIndex != 100) && (gActors[0].state != 6)) { + if ((this->aiIndex > -1) && (this->aiIndex != AI360_GREAT_FOX) && (gActors[0].state != 6)) { if (spE8 < spF8) { if (spEC < spF8) { - if (this->aiIndex != 0) { + if (this->aiIndex != AI360_FOX) { this->fwork[1] = gActors[this->aiIndex].fwork[0] - 5.0f; } else { this->fwork[1] = gPlayer[0].unk_0D0 - 5.0f; @@ -1534,21 +1540,21 @@ void func_360_800319AC(Actor* this) { this->iwork[5] = 1; if (!((this->index + gGameFrameCount) & sp10F) && (Rand_ZeroOne() < spF0) && func_360_80031900(this) && ((gActors[0].state == 2) || (gCurrentLevel == LEVEL_TRAINING))) { - if ((this->aiIndex == 0) && (gCurrentLevel != LEVEL_TRAINING)) { + if ((this->aiIndex == AI360_FOX) && (gCurrentLevel != LEVEL_TRAINING)) { if ((this->iwork[4] > 250) && (gCurrentLevel != LEVEL_VENOM_ANDROSS)) { if ((Rand_ZeroOne() < 0.5f) || (gCurrentLevel == LEVEL_VENOM_2)) { this->iwork[4] = 0; switch (this->aiType) { - case 4: + case AI360_WOLF: func_360_8002E4F8(gMsg_ID_19450, RCID_WOLF); break; - case 5: + case AI360_LEON: func_360_8002E4F8(gMsg_ID_19451, RCID_LEON); break; - case 6: + case AI360_PIGMA: func_360_8002E4F8(gMsg_ID_19452, RCID_PIGMA); break; - case 7: + case AI360_ANDREW: func_360_8002E4F8(gMsg_ID_19453, RCID_ANDREW); break; } @@ -1567,7 +1573,7 @@ void func_360_800319AC(Actor* this) { if (Rand_ZeroOne() < 0.5f) { gActors[this->aiIndex].iwork[6]++; switch (this->aiIndex) { - case 1: + case AI360_FALCO: if ((gCurrentLevel == LEVEL_VENOM_2) && (Rand_ZeroOne() < 0.5f)) { func_360_8002F5F4(gMsg_ID_19462, RCID_FALCO); } else if ((gActors[this->aiIndex].iwork[6] >= 3) && (Rand_ZeroOne() < 0.5f)) { @@ -1581,7 +1587,7 @@ void func_360_800319AC(Actor* this) { D_display_Timer_800CA238 = 320; } break; - case 2: + case AI360_SLIPPY: if ((gCurrentLevel == LEVEL_VENOM_2) && (Rand_ZeroOne() < 0.5f)) { func_360_8002F5F4(gMsg_ID_19463, RCID_SLIPPY); } else if ((gActors[this->aiIndex].iwork[6] >= 3) && (Rand_ZeroOne() < 0.5f)) { @@ -1595,13 +1601,13 @@ void func_360_800319AC(Actor* this) { D_display_Timer_800CA238 = 320; } break; - case 3: + case AI360_PEPPY: if ((gCurrentLevel == LEVEL_VENOM_2) && (Rand_ZeroOne() < 0.5f)) { - func_360_8002F5F4(gMsg_ID_19464, 0x1E); + func_360_8002F5F4(gMsg_ID_19464, RCID_PEPPY); } else if ((gActors[this->aiIndex].iwork[6] >= 3) && (Rand_ZeroOne() < 0.5f)) { - func_360_8002F5F4(gMsg_ID_20312, 0x1E); + func_360_8002F5F4(gMsg_ID_20312, RCID_PEPPY); } else { - func_360_8002F5F4(gMsg_ID_9120, 0x1E); + func_360_8002F5F4(gMsg_ID_9120, RCID_PEPPY); } gActors[this->aiIndex].iwork[2] = this->aiType; if ((D_display_800CA234 == NULL) || (gTeamShields[this->aiIndex] <= 50)) { @@ -1609,22 +1615,22 @@ void func_360_800319AC(Actor* this) { D_display_Timer_800CA238 = 320; } break; - case 4: + case AI360_WOLF: if (D_ctx_80177CD0[0] != 0) { func_360_8002F5F4(gMsg_ID_9330, RCID_WOLF); } break; - case 5: + case AI360_LEON: if (D_ctx_80177CD0[1] != 0) { func_360_8002F5F4(gMsg_ID_9340, RCID_LEON); } break; - case 6: + case AI360_PIGMA: if (D_ctx_80177CD0[2] != 0) { func_360_8002F5F4(gMsg_ID_9350, RCID_PIGMA); } break; - case 7: + case AI360_ANDREW: if (D_ctx_80177CD0[3] != 0) { func_360_8002F5F4(gMsg_ID_9360, RCID_ANDREW); } @@ -1632,31 +1638,31 @@ void func_360_800319AC(Actor* this) { } } else { switch (this->aiType) { - case 1: + case AI360_FALCO: if ((gCurrentLevel == LEVEL_FORTUNA) && (Rand_ZeroOne() < 0.5f)) { func_360_8002F5F4(gMsg_ID_9211, RCID_FALCO); } else { func_360_8002F5F4(gMsg_ID_9190, RCID_FALCO); } - gActors[this->aiIndex].iwork[2] = 1; + gActors[this->aiIndex].iwork[2] = AI360_FALCO; break; - case 2: + case AI360_SLIPPY: if ((gCurrentLevel == LEVEL_FORTUNA) && (Rand_ZeroOne() < 0.5f)) { func_360_8002F5F4(gMsg_ID_9212, RCID_SLIPPY); } else { func_360_8002F5F4(gMsg_ID_9200, RCID_SLIPPY); } - gActors[this->aiIndex].iwork[2] = 2; + gActors[this->aiIndex].iwork[2] = AI360_SLIPPY; break; - case 3: + case AI360_PEPPY: if ((gCurrentLevel == LEVEL_FORTUNA) && (Rand_ZeroOne() < 0.5f)) { func_360_8002F5F4(gMsg_ID_9213, RCID_PEPPY); } else { func_360_8002F5F4(gMsg_ID_9210, RCID_PEPPY); } - gActors[this->aiIndex].iwork[2] = 3; + gActors[this->aiIndex].iwork[2] = AI360_PEPPY; break; - case 4: + case AI360_WOLF: if (gCurrentLevel != LEVEL_VENOM_2) { if (this->iwork[6] == 0) { this->iwork[6] = 1; @@ -1673,40 +1679,40 @@ void func_360_800319AC(Actor* this) { } } break; - case 5: + case AI360_LEON: if (gCurrentLevel == LEVEL_VENOM_2) { - if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == 1)) { + if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == AI360_FALCO)) { func_360_8002F5F4(gMsg_ID_9323, RCID_LEON); } else { func_360_8002F5F4(gMsg_ID_19451, RCID_LEON); } - } else if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == 1)) { + } else if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == AI360_FALCO)) { func_360_8002F5F4(gMsg_ID_9323, RCID_LEON); } else { func_360_8002F5F4(gMsg_ID_9300, RCID_LEON); } break; - case 6: + case AI360_PIGMA: if (gCurrentLevel == LEVEL_VENOM_2) { - if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == 3)) { + if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == AI360_PEPPY)) { func_360_8002F5F4(gMsg_ID_9324, RCID_PIGMA); } else { func_360_8002F5F4(gMsg_ID_19452, RCID_PIGMA); } - } else if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == 3)) { + } else if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == AI360_PEPPY)) { func_360_8002F5F4(gMsg_ID_9324, RCID_PIGMA); } else { func_360_8002F5F4(gMsg_ID_9310, RCID_PIGMA); } break; - case 7: + case AI360_ANDREW: if (gCurrentLevel == LEVEL_VENOM_2) { - if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == 2)) { + if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == AI360_SLIPPY)) { func_360_8002F5F4(gMsg_ID_9325, RCID_ANDREW); } else { func_360_8002F5F4(gMsg_ID_19453, RCID_ANDREW); } - } else if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == 2)) { + } else if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == AI360_SLIPPY)) { func_360_8002F5F4(gMsg_ID_9325, RCID_ANDREW); } else { func_360_8002F5F4(gMsg_ID_9320, RCID_ANDREW); @@ -1718,7 +1724,7 @@ void func_360_800319AC(Actor* this) { } else { this->iwork[4] = 0; } - if ((this->aiIndex > 0) && + if ((this->aiIndex >= AI360_FALCO) && ((gActors[this->aiIndex].obj.status == OBJ_DYING) || (gActors[this->aiIndex].state == 6) || (gActors[this->aiIndex].obj.status == OBJ_FREE))) { this->state = 3; @@ -1732,9 +1738,9 @@ void func_360_800319AC(Actor* this) { case 3: sp104 = 1; if (this->timer_0BC == 0) { - if ((this->aiType < 10) || (gCurrentLevel == LEVEL_BOLSE)) { + if ((this->aiType < AI360_10) || (gCurrentLevel == LEVEL_BOLSE)) { if (gCurrentLevel == LEVEL_VENOM_2) { - if (this->aiType >= 4) { + if (this->aiType >= AI360_WOLF) { this->fwork[3] = 1.6f; this->fwork[1] = 55.0f; } else { @@ -1749,11 +1755,11 @@ void func_360_800319AC(Actor* this) { this->fwork[3] = 1.0f; this->fwork[1] = 38.0f; } - if ((gCurrentLevel == LEVEL_SECTOR_Z) && (gActors[0].state == 0xA)) { + if ((gCurrentLevel == LEVEL_SECTOR_Z) && (gActors[0].state == 10)) { this->fwork[10] = 30.0f; } if ((gLevelType == LEVELTYPE_SPACE) && (gCurrentLevel != LEVEL_BOLSE)) { - if ((gCurrentLevel == LEVEL_SECTOR_Z) && (this->aiType == 8)) { + if ((gCurrentLevel == LEVEL_SECTOR_Z) && (this->aiType == AI360_KATT)) { spE4 = RAND_FLOAT_CENTERED(0.0f); spE0 = RAND_FLOAT_CENTERED(500.0f); spDC = RAND_FLOAT_CENTERED(5000.0f) + 12000.0f; @@ -1787,18 +1793,18 @@ void func_360_800319AC(Actor* this) { this->timer_0C0 = RAND_INT(200.0f) + 200; this->fwork[10] = 30.0f; } - if ((this->aiIndex > 0) && (gActors[this->aiIndex].obj.id == OBJ_ACTOR_197) && + if ((this->aiIndex >= AI360_FALCO) && (gActors[this->aiIndex].obj.id == OBJ_ACTOR_ALLRANGE) && (gActors[this->aiIndex].timer_0C2 == 0) && (gActors[this->aiIndex].obj.status == OBJ_ACTIVE)) { this->state = 2; - this->iwork[2] = 0; + this->iwork[2] = AI360_FOX; } - if (this->aiIndex == 0) { + if (this->aiIndex == AI360_FOX) { if (this->unk_04E != 0) { this->unk_04E--; } if (this->unk_04E == 0) { this->state = 2; - this->iwork[2] = 0; + this->iwork[2] = AI360_FOX; } } break; @@ -1830,7 +1836,7 @@ void func_360_800319AC(Actor* this) { if (this->obj.rot.z >= 360.0f) { this->obj.rot.z -= 360.0f; } - this->timer_0BC = 0x28; + this->timer_0BC = 40; this->unk_046 += 1; } this->obj.pos.y -= 3.0f; @@ -1882,9 +1888,9 @@ void func_360_800319AC(Actor* this) { spD4 = this->fwork[19]; sp108 = 0; if (sp104 == 1) { - if (this->aiType < 100) { + if (this->aiType < AI360_GREAT_FOX) { sp108 = func_360_8003049C(this); - if ((sp108 != 0) && (this->aiType < 10) && (this->timer_0BE == 0) && + if ((sp108 != 0) && (this->aiType < AI360_10) && (this->timer_0BE == 0) && ((this->fwork[7] < 0.01f) || (this->fwork[7] > 359.9f))) { this->timer_0BE = RAND_INT(200.0f) + 200; if (Rand_ZeroOne() < 0.5f) { @@ -1897,7 +1903,7 @@ void func_360_800319AC(Actor* this) { } } if (sp108 != 0) { - if ((this->aiType < 10) || (gCurrentLevel != LEVEL_FORTUNA)) { + if ((this->aiType < AI360_10) || (gCurrentLevel != LEVEL_FORTUNA)) { spD8 += 40.0f * sp108; } else { spD8 += 20.0f * sp108; @@ -1936,7 +1942,7 @@ void func_360_800319AC(Actor* this) { } if ((this->fwork[7] > 0.01f) && (this->fwork[7] < 359.9f)) { Math_SmoothStepToAngle(&this->obj.rot.z, this->fwork[7], 0.2f, 100.0f, 0.01f); - if ((this->aiType == 8) && !(gGameFrameCount & 1)) { + if ((this->aiType == AI360_KATT) && !(gGameFrameCount & 1)) { if ((this->fwork[7] > 10.0f) && (this->fwork[7] < 350.0f)) { Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, 0); Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, 1); @@ -1983,7 +1989,7 @@ void func_360_800319AC(Actor* this) { sp90.x = spBC * sp90.z; sp90.z = spB4 * sp90.z; - if ((gCurrentLevel == LEVEL_VENOM_2) && (this->aiType >= 4)) { + if ((gCurrentLevel == LEVEL_VENOM_2) && (this->aiType >= AI360_WOLF)) { Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, 0); Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, 1); Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, 1); @@ -2014,7 +2020,7 @@ void func_360_800319AC(Actor* this) { func_360_8003088C(this); radarMark = &gRadarMarks[this->index]; radarMark->unk_00 = 1; - if (this->aiType == 200) { + if (this->aiType == AI360_MISSILE) { radarMark->unk_02 = 100; } else { radarMark->unk_02 = this->aiType; @@ -2030,13 +2036,13 @@ void func_360_800319AC(Actor* this) { this->iwork[1]--; if ((this->iwork[1] == 0) && (gActors[0].state == 2) && (gRadioState == 0)) { switch (this->aiType) { - case 1: + case AI360_FALCO: func_360_8002F5F4(gMsg_ID_9220, RCID_FALCO); break; - case 2: + case AI360_SLIPPY: func_360_8002F5F4(gMsg_ID_9230, RCID_SLIPPY); break; - case 3: + case AI360_PEPPY: if ((Rand_ZeroOne() < 0.1f) && (gCurrentLevel == LEVEL_KATINA)) { func_360_8002F5F4(gMsg_ID_18150, RCID_PEPPY); } else { @@ -2047,8 +2053,8 @@ void func_360_800319AC(Actor* this) { } } if ((gCurrentLevel != LEVEL_KATINA) && (gCurrentLevel != LEVEL_VENOM_ANDROSS) && (this->timer_0C2 == 0)) { - if (((this->aiType >= 10) && (this->aiType < 100)) || - ((this->aiType >= 4) && (this->aiType < 10) && (this->timer_0C6 != 0))) { + if (((this->aiType >= AI360_10) && (this->aiType < AI360_GREAT_FOX)) || + ((this->aiType >= AI360_WOLF) && (this->aiType < AI360_10) && (this->timer_0C6 != 0))) { s32 var_a3 = 0; if (((gCurrentLevel == LEVEL_BOLSE) || (gCurrentLevel == LEVEL_SECTOR_Z)) && (this->timer_0C6 == 0)) { @@ -2062,12 +2068,11 @@ void func_360_800319AC(Actor* this) { this->obj.pos.x -= this->vel.x; this->obj.pos.y -= this->vel.y; this->obj.pos.z -= this->vel.z; - if ((temp_v0_27 >= 2) && (this->aiType >= 0xB)) { + if ((temp_v0_27 >= 2) && (this->aiType > AI360_10)) { this->timer_0BE = 2; this->obj.status = OBJ_DYING; - this->unk_044 = 0; - func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 0.0f, 0.0f, 0.0f, 5.0f, - 0xF); + this->itemDrop = DROP_NONE; + func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 0.0f, 0.0f, 0.0f, 5.0f, 15); func_effect_8007A6F0(&this->obj.pos, 0x2903A008); } else { this->unk_0D0 = 1; @@ -2166,15 +2171,15 @@ bool func_360_800352E0(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* return false; } -void func_360_80035448(Actor* actor) { +void ActorAllRange_Draw(Actor* actor) { f32 sp38; s32 pad[3]; Vec3f sp1E4 = { 0.0f, 0.0f, 0.0f }; Vec3f sp7C[30]; f32 pad2; - if (actor->aiType != 1000) { - if ((actor->iwork[8] != 0) && (actor->aiType < 100)) { + if (actor->aiType != AI360_EVENT_HANDLER) { + if ((actor->iwork[8] != 0) && (actor->aiType < AI360_GREAT_FOX)) { pad2 = SIN_DEG(actor->iwork[8] * 400.0f); sp38 = actor->iwork[8] * pad2; Matrix_RotateY(gGfxMatrix, M_DTOR * sp38, 1); @@ -2187,19 +2192,19 @@ void func_360_80035448(Actor* actor) { gSPFogPosition(gMasterDisp++, gFogNear, 1005); } switch (actor->aiType) { - case 0: - case 1: - case 2: - case 3: + case AI360_FOX: + case AI360_FALCO: + case AI360_SLIPPY: + case AI360_PEPPY: Matrix_Push(&gGfxMatrix); func_edisplay_8005B388(actor); Matrix_Pop(&gGfxMatrix); func_360_80035098(actor); break; - case 4: - case 5: - case 6: - case 7: + case AI360_WOLF: + case AI360_LEON: + case AI360_PIGMA: + case AI360_ANDREW: if (gCurrentLevel == LEVEL_VENOM_2) { gSPDisplayList(gMasterDisp++, D_STAR_WOLF_F0103D0); Matrix_Push(&gGfxMatrix); @@ -2222,20 +2227,20 @@ void func_360_80035448(Actor* actor) { } } break; - case 8: + case AI360_KATT: gSPDisplayList(gMasterDisp++, D_D009A40); func_edisplay_8005ADAC(actor); break; - case 9: + case AI360_BILL: gSPDisplayList(gMasterDisp++, D_D00B880); func_edisplay_8005ADAC(actor); break; - case 100: + case AI360_GREAT_FOX: func_edisplay_8005F670(&actor->obj.pos); actor->unk_0B6 = 1; func_demo_8004FEC0(actor); break; - case 200: + case AI360_MISSILE: Animation_GetFrameData(&D_SZ_6006D64, 0, sp7C); Animation_DrawSkeleton(3, D_SZ_6006E50, sp7C, func_360_800352E0, NULL, actor, gCalcMatrix); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -400.0f, 1); @@ -2282,7 +2287,7 @@ void func_360_80035448(Actor* actor) { } else if (gCurrentLevel == LEVEL_VERSUS) { gSPDisplayList(gMasterDisp++, D_versus_3015740); } else if (gCurrentLevel == LEVEL_TRAINING) { - if (actor->aiIndex == 0) { + if (actor->aiIndex == AI360_FOX) { gSPDisplayList(gMasterDisp++, D_STAR_WOLF_F00F200); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -60.0f, 1); func_edisplay_8005B1E8(actor, 3); diff --git a/src/engine/fox_852F0.c b/src/engine/fox_852F0.c index 27364304..3444511a 100644 --- a/src/engine/fox_852F0.c +++ b/src/engine/fox_852F0.c @@ -31,7 +31,7 @@ void func_800846F0(FrameBuffer* arg0) { sp4C[0] = (sp4C[1] + sp4C[2] + sp4C[3] + sp4C[4]) / 4; sp38[0] = (sp38[1] + sp38[2] + sp38[3] + sp38[4]) / 4; - var_v0[0] = (sp60[0] << 0xB) | (sp4C[0] << 0x6) | (sp38[0] << 0x1); + var_v0[0] = (sp60[0] << 11) | (sp4C[0] << 6) | (sp38[0] << 1); } } osWritebackDCacheAll(); diff --git a/src/engine/fox_beam.c b/src/engine/fox_beam.c index ef5b476f..b23aa806 100644 --- a/src/engine/fox_beam.c +++ b/src/engine/fox_beam.c @@ -57,10 +57,10 @@ void func_beam_80035E78(PlayerShot* shot) { shot->unk_64 = 30; shot->unk_58 = 150; func_8001CE28(shot->playerNum, shot->sfxSource); - D_play_Timer_80161A60 = 4; + gScreenFlashTimer = 4; if (shot->obj.pos.y < (gGroundLevel + 450.0f)) { - D_ctx_80178480 = 15; - if (D_80161A88 == 2) { + gCameraShake = 15; + if (D_ctx_80161A88 == 2) { func_effect_8007D9DC(shot->obj.pos.x, gGroundLevel + 2.0f, shot->obj.pos.z, shot->unk_48 * 0.1f, shot->unk_48 * 3.0f, 0); func_effect_8007D9DC(shot->obj.pos.x, gGroundLevel + 2.0f, shot->obj.pos.z, shot->unk_48 * 0.1f, @@ -184,7 +184,7 @@ void func_beam_800365E4(f32 xPos, f32 yPos, f32 zPos, f32 arg3, f32 arg4, f32 ar s32 unk44, s32 time) { s32 i; - if ((D_ctx_801784AC != 4) && (gLevelType == LEVELTYPE_PLANET) && (D_80161A88 != 2) && + if ((D_ctx_801784AC != 4) && (gLevelType == LEVELTYPE_PLANET) && (D_ctx_80161A88 != 2) && (gCurrentLevel != LEVEL_SOLAR) && (gCurrentLevel != LEVEL_BOLSE) && (gCurrentLevel != LEVEL_TRAINING) && (gCurrentLevel != LEVEL_ZONESS)) { for (i = 0; i < 50; i++) { @@ -213,7 +213,7 @@ void func_beam_800366CC(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 yRot, void func_beam_80036770(f32 xPos, f32 yPos, f32 zPos, f32 yRot, f32 scale) { s32 i; - if ((D_ctx_801784AC != 4) && (gLevelType == LEVELTYPE_PLANET) && (D_80161A88 <= 0) && + if ((D_ctx_801784AC != 4) && (gLevelType == LEVELTYPE_PLANET) && (D_ctx_80161A88 <= 0) && (gCurrentLevel != LEVEL_TRAINING) && (gCurrentLevel != LEVEL_SOLAR) && (gCurrentLevel != LEVEL_ZONESS)) { for (i = 0; i < 50; i++) { if (gEffects[i].obj.status == OBJ_FREE) { @@ -485,7 +485,7 @@ bool func_beam_8003774C(PlayerShot* shot, ObjectId objId, Object* obj) { sp7C.z = obj->pos.z - shot->obj.pos.z; // undefined behavior: if this check fails, the function returns no value if (((fabsf(sp7C.x) < 1100.0f) && (fabsf(sp7C.z) < 1100.0f) && (shot->obj.pos.y < 900.0f)) || - (objId == OBJ_BOSS_313) || (objId == OBJ_UNK_1000) || (objId == OBJ_80_39)) { + (objId == OBJ_BOSS_313) || (objId == ACTOR_EVENT_ID) || (objId == OBJ_80_39)) { Matrix_RotateY(gCalcMatrix, -obj->rot.y * M_DTOR, 0); sp7C.x = shot->obj.pos.x - obj->pos.x; sp7C.y = shot->obj.pos.y - obj->pos.y; @@ -526,7 +526,7 @@ bool func_beam_8003774C(PlayerShot* shot, ObjectId objId, Object* obj) { case OBJ_BOSS_309: objId = COL1_7; break; - case OBJ_UNK_1000: + case ACTOR_EVENT_ID: objId = COL1_3; break; case OBJ_BOSS_313: @@ -684,10 +684,10 @@ void func_beam_80037CF4(PlayerShot* shot, Actor* actor, s32 hitIndex) { actor->unk_0D8.x = shot->obj.pos.x; actor->unk_0D8.y = shot->obj.pos.y; actor->unk_0D8.z = shot->obj.pos.z; - if (((actor->obj.id == OBJ_ACTOR_200) && (actor->unk_0D2 == 0) && + if (((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0D2 == 0) && ((actor->unk_0B4 == 48) || (actor->unk_0B4 == 49) || (actor->unk_0B4 == 50))) || - ((actor->obj.id == OBJ_ACTOR_197) && (actor->fwork[23] > 1.0f)) || - ((actor->obj.id == OBJ_ACTOR_200) && (actor->unk_0D2 == 0) && (actor->unk_0B4 == 67)) || + ((actor->obj.id == OBJ_ACTOR_ALLRANGE) && (actor->fwork[23] > 1.0f)) || + ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0D2 == 0) && (actor->unk_0B4 == 67)) || ((actor->obj.id == OBJ_ACTOR_261) && (shot->obj.id != PLAYERSHOT_8) && ((actor->state < 3) || (actor->state >= 5))) || ((actor->obj.id == OBJ_ACTOR_260) && (shot->obj.id != PLAYERSHOT_8) && (actor->timer_0BC != 0))) { @@ -763,9 +763,9 @@ void func_beam_80038140(PlayerShot* shot) { return; } break; - case OBJ_ACTOR_200: + case OBJ_ACTOR_EVENT: if (actor->unk_0B4 == 42) { - if (func_beam_8003774C(shot, OBJ_UNK_1000, &actor->obj)) { + if (func_beam_8003774C(shot, ACTOR_EVENT_ID, &actor->obj)) { actor->unk_0D0 = 1; actor->unk_0D2 = shot->playerNum; return; @@ -787,8 +787,8 @@ void func_beam_80038140(PlayerShot* shot) { break; default: if (actor->info.unk_16 != 0) { - if (actor->obj.id == OBJ_ACTOR_197) { - if ((actor->aiType >= 4) && (actor->aiType < 10) && + if (actor->obj.id == OBJ_ACTOR_ALLRANGE) { + if ((actor->aiType >= AI360_WOLF) && (actor->aiType < AI360_10) && (((gCurrentLevel == LEVEL_VENOM_2) && (shot->playerNum < 104)) || ((gCurrentLevel != LEVEL_VENOM_2) && (shot->playerNum == 0))) && (shot->obj.id != PLAYERSHOT_8) && @@ -1591,7 +1591,7 @@ void func_beam_8003B55C(PlayerShot* shot, s32 index) { Vec3f sp44; Vec3f sp38; - if ((D_80161A88 == 2) && (shot->obj.pos.y < (gGroundLevel + 50.0f)) && (index == 0)) { + if ((D_ctx_80161A88 == 2) && (shot->obj.pos.y < (gGroundLevel + 50.0f)) && (index == 0)) { func_effect_8007ACE0(shot->obj.pos.x, gGroundLevel, shot->obj.pos.z, 0.1f, 1.5f, shot->obj.rot.y + 20.0f); func_effect_8007ACE0(shot->obj.pos.x, gGroundLevel, shot->obj.pos.z, 0.1f, 1.5f, shot->obj.rot.y - 20.0f); } @@ -1620,7 +1620,7 @@ void func_beam_8003B55C(PlayerShot* shot, s32 index) { func_beam_80036770(shot->obj.pos.x, gGroundLevel + 2.0f, shot->obj.pos.z, shot->obj.rot.y, 2.0f); } } - if (D_80161A88 == 2) { + if (D_ctx_80161A88 == 2) { Object_Kill(&shot->obj, shot->sfxSource); return; } @@ -1872,7 +1872,7 @@ void func_beam_8003C4D0(PlayerShot* shot, s32 damage) { if ((actor->obj.status == OBJ_ACTIVE) && (actor->timer_0C2 == 0) && !((gCurrentLevel == LEVEL_MACBETH) && (OBJ_ACTOR_205 <= actor->obj.id) && (actor->obj.id < OBJ_ACTOR_214)) && - !((actor->obj.id == OBJ_ACTOR_200) && (actor->iwork[12] != 0)) && + !((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->iwork[12] != 0)) && ((actor->scale >= 0.0f) || (actor->obj.id == OBJ_ACTOR_271))) { sp68 = actor->obj.pos.x - shot->obj.pos.x; sp64 = actor->obj.pos.y - shot->obj.pos.y; @@ -1887,8 +1887,9 @@ void func_beam_8003C4D0(PlayerShot* shot, s32 damage) { if ((actor->obj.id == OBJ_ACTOR_193) || (actor->obj.id == OBJ_ACTOR_186) || (actor->obj.id == OBJ_ACTOR_190) || (actor->obj.id == OBJ_ACTOR_202) || (actor->obj.id == OBJ_ACTOR_201) || (actor->obj.id == OBJ_ACTOR_187) || - ((actor->obj.id == OBJ_ACTOR_200) && (actor->unk_0B4 == 78)) || - ((actor->obj.id == OBJ_ACTOR_200) && (actor->unk_0B4 == 38)) || (actor->obj.id == OBJ_ACTOR_196)) { + ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == 78)) || + ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == 38)) || + (actor->obj.id == OBJ_ACTOR_196)) { actor->unk_0D0 = 2; actor->unk_0D2 = 0; actor->unk_0D4 = shot->playerNum + 1; @@ -1897,7 +1898,7 @@ void func_beam_8003C4D0(PlayerShot* shot, s32 damage) { if (actor->info.bonus != 0) { shot->bonus++; } - } else if ((actor->obj.id == OBJ_ACTOR_200) && (actor->scale >= 0.5f) && (damage >= 31)) { + } else if ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->scale >= 0.5f) && (damage >= 31)) { actor->unk_0D4 = shot->playerNum + 1; actor->vel.x = sp68 * 0.03f; actor->vel.y = sp64 * 0.03f; @@ -1965,13 +1966,13 @@ void func_beam_8003C4D0(PlayerShot* shot, s32 damage) { if (sqrtf(SQ(sp68) + SQ(sp64) + SQ(sp60)) < temp_fs2) { player->unk_288 = shot->playerNum + 1; switch (player->form) { - case 0: + case FORM_ARWING: Player_ApplyDamage(player, 0, 80); break; - case 1: + case FORM_LANDMASTER: Player_ApplyDamage(player, 0, 60); break; - case 3: + case FORM_ON_FOOT: Player_ApplyDamage(player, 0, 180); break; } @@ -2064,7 +2065,7 @@ void func_beam_8003CF90(PlayerShot* shot) { Player* player; if ((shot->obj.pos.y < gGroundLevel) || (shot->unk_64 == 1)) { - if ((D_80161A88 == 2) && (shot->obj.pos.y < gGroundLevel)) { + if ((D_ctx_80161A88 == 2) && (shot->obj.pos.y < gGroundLevel)) { shot->unk_48 = 10.0f; func_effect_8007D9DC(shot->obj.pos.x, gGroundLevel + 2.0f, shot->obj.pos.z, shot->unk_48 * 0.1f, shot->unk_48 * 3.0f, 0); diff --git a/src/engine/fox_bg.c b/src/engine/fox_bg.c index 189a66e5..71952a96 100644 --- a/src/engine/fox_bg.c +++ b/src/engine/fox_bg.c @@ -754,49 +754,50 @@ void func_bg_80040954(void) { f32 var_fs2; f32 var_fv0; - if ((gCurrentLevel != LEVEL_VENOM_ANDROSS) && (gLevelType != LEVELTYPE_SPACE) && - (D_ctx_80178380[gPlayerNum] != 0)) { - var_fs2 = 1.0f; - if (D_ctx_80178380[gPlayerNum] < 80) { - var_fs2 = D_ctx_80178380[gPlayerNum] / 80.0f; - } - var_fs2 *= D_bg_800C9E5C[gLevelType]; + if ((gCurrentLevel == LEVEL_VENOM_ANDROSS) || (gLevelType == LEVELTYPE_SPACE) || + (D_ctx_80178380[gPlayerNum] == 0)) { + return; + } + var_fs2 = 1.0f; + if (D_ctx_80178380[gPlayerNum] < 80) { + var_fs2 = D_ctx_80178380[gPlayerNum] / 80.0f; + } + var_fs2 *= D_bg_800C9E5C[gLevelType]; + Matrix_Push(&gGfxMatrix); + Matrix_RotateZ(gGfxMatrix, gPlayer[gPlayerNum].unk_034 * M_DTOR, 1); + Matrix_Translate(gGfxMatrix, D_ctx_801783D0, D_ctx_801783D4, -200.0f, 1); + RCP_SetupDL_62(); + temp_fs0 = D_ctx_801783D0 * -0.03f; + temp_fs1 = D_ctx_801783D4 * 0.03f; + var_s1 = &D_bg_800C9D94[5]; + var_s4 = &D_bg_800C9DE4[5]; + var_s5 = &D_bg_800C9C5C[5]; + var_s6 = &D_bg_800C9D2C[5]; + var_s7 = &D_bg_800C9CC4[5]; + if (gCurrentLevel == LEVEL_KATINA) { + var_s1 = &D_bg_800C9DBC[5]; + var_s4 = &D_bg_800C9E18[5]; + var_s5 = &D_bg_800C9C90[5]; + var_s6 = &D_bg_800C9D60[5]; + var_s7 = &D_bg_800C9CF8[5]; + } + for (i = 5; i < 13; i++, var_s1++, var_s4++, var_s5++, var_s6++, var_s7++) { Matrix_Push(&gGfxMatrix); - Matrix_RotateZ(gGfxMatrix, gPlayer[gPlayerNum].unk_034 * M_DTOR, 1); - Matrix_Translate(gGfxMatrix, D_ctx_801783D0, D_ctx_801783D4, -200.0f, 1); - RCP_SetupDL_62(); - temp_fs0 = D_ctx_801783D0 * -0.03f; - temp_fs1 = D_ctx_801783D4 * 0.03f; - var_s1 = &D_bg_800C9D94[5]; - var_s4 = &D_bg_800C9DE4[5]; - var_s5 = &D_bg_800C9C5C[5]; - var_s6 = &D_bg_800C9D2C[5]; - var_s7 = &D_bg_800C9CC4[5]; - if (gCurrentLevel == LEVEL_KATINA) { - var_s1 = &D_bg_800C9DBC[5]; - var_s4 = &D_bg_800C9E18[5]; - var_s5 = &D_bg_800C9C90[5]; - var_s6 = &D_bg_800C9D60[5]; - var_s7 = &D_bg_800C9CF8[5]; + Matrix_Translate(gGfxMatrix, *var_s7 * temp_fs0, *var_s7 * -temp_fs1, 0.0f, 1); + Matrix_Scale(gGfxMatrix, *var_s6, *var_s6, *var_s6, 1); + if (((i == 5) || (i == 11)) && (gCurrentLevel != LEVEL_KATINA)) { + Matrix_RotateX(gGfxMatrix, M_PI / 2, 1); } - for (i = 5; i < 13; i++, var_s1++, var_s4++, var_s5++, var_s6++, var_s7++) { - Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, *var_s7 * temp_fs0, *var_s7 * -temp_fs1, 0.0f, 1); - Matrix_Scale(gGfxMatrix, *var_s6, *var_s6, *var_s6, 1); - if (((i == 5) || (i == 11)) && (gCurrentLevel != LEVEL_KATINA)) { - Matrix_RotateX(gGfxMatrix, M_PI / 2, 1); - } - Matrix_SetGfxMtx(&gMasterDisp); - var_fv0 = *var_s4; - if (i >= 5) { - var_fv0 *= var_fs2; - } - gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, var_s1->r, var_s1->g, var_s1->b, (s32) var_fv0); - gSPDisplayList(gMasterDisp++, *var_s5); - Matrix_Pop(&gGfxMatrix); + Matrix_SetGfxMtx(&gMasterDisp); + var_fv0 = *var_s4; + if (i >= 5) { + var_fv0 *= var_fs2; } + gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, var_s1->r, var_s1->g, var_s1->b, (s32) var_fv0); + gSPDisplayList(gMasterDisp++, *var_s5); Matrix_Pop(&gGfxMatrix); } + Matrix_Pop(&gGfxMatrix); } void func_bg_80040CDC(void) { @@ -868,7 +869,7 @@ void func_bg_80040CE4(void) { } } Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, gPlayer[gPlayerNum].unk_0AC, -3.0f + D_ctx_8017847C, sp1D4, 1); + Matrix_Translate(gGfxMatrix, gPlayer[gPlayerNum].unk_0AC, -3.0f + gCameraShakeY, sp1D4, 1); if (D_ctx_80177C70 == 2) { Matrix_Scale(gGfxMatrix, 1.2f, 1.2f, 1.0f, 1); } @@ -886,7 +887,7 @@ void func_bg_80040CE4(void) { temp_fv0 = Math_ModF((10000.0f - gPlayer[gPlayerNum].unk_0AC) * 0.32f, 128.0f); gDPSetupTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, temp_fv0, temp_s0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); - switch (D_80161A88) { + switch (D_ctx_80161A88) { case 0: gDPLoadTileTexture(gMasterDisp++, D_CO_601B6C0, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32); gBgColor = 0x845; // 8, 8, 32 @@ -913,7 +914,7 @@ void func_bg_80040CE4(void) { Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_CO_601B640); } else { - D_80161A88 = 0; + D_ctx_80161A88 = 0; gBgColor = 0x845; // 8, 8, 32 for (i = 0; i < 4; i++) { Matrix_Push(&gGfxMatrix); @@ -1131,7 +1132,7 @@ void func_bg_80042D38(void) { xEye = gPlayer[gPlayerNum].camEye.x; if (0) {} zEye = gPlayer[gPlayerNum].camEye.z; - Matrix_Translate(gGfxMatrix, xEye, 2.0f + D_ctx_8017847C, zEye, 1); + Matrix_Translate(gGfxMatrix, xEye, 2.0f + gCameraShakeY, zEye, 1); Matrix_Scale(gGfxMatrix, 1.5f, 1.0f, 1.0f, 1); RCP_SetupDL_37(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 125); diff --git a/src/engine/fox_boss.c b/src/engine/fox_boss.c index 4ccfb68e..419702df 100644 --- a/src/engine/fox_boss.c +++ b/src/engine/fox_boss.c @@ -2,11 +2,15 @@ s32 gBossFrameCount; -s32 D_boss_800C9E90[28] = { - 0x8012, 0x8013, 0x8015, 0x8017, 0x8017, 0x8019, 0x8018, 0x801B, 0x8016, 0x8018, 0x8012, 0x8020, 0x8014, 0x801E, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +s32 D_boss_800C9E90[] = { + SEQ_ID_CO_BOSS_1 | SEQ_FLAG, SEQ_ID_ME_BOSS | SEQ_FLAG, SEQ_ID_SX_BOSS | SEQ_FLAG, SEQ_ID_A6_BOSS | SEQ_FLAG, + SEQ_ID_A6_BOSS | SEQ_FLAG, SEQ_ID_SY_BOSS | SEQ_FLAG, SEQ_ID_VE_BOSS | SEQ_FLAG, SEQ_ID_SO_BOSS | SEQ_FLAG, + SEQ_ID_ZO_BOSS | SEQ_FLAG, SEQ_ID_VE_BOSS | SEQ_FLAG, SEQ_ID_CO_BOSS_1 | SEQ_FLAG, SEQ_ID_MA_BOSS | SEQ_FLAG, + SEQ_ID_TI_BOSS | SEQ_FLAG, SEQ_ID_AQ_BOSS | SEQ_FLAG, }; +s32 PAD_boss_C9EC4[14] = { 0 }; + const f32 D_boss_800D55D0[] = { 6000.0f, 18000.0f, -6000.0f, -18000.0f }; void func_boss_80042EC0(Boss* boss) { @@ -37,22 +41,22 @@ void func_boss_80042EC0(Boss* boss) { D_ctx_80177850 = 15; } -void func_boss_80042FAC(Boss* boss) { +void Boss299_Init(Boss* boss) { } -void func_boss_80042FB8(Boss* boss) { +void Boss299_Update(Boss* boss) { } -void func_boss_80042FC4(Boss* boss) { +void Boss299_Draw(Boss* boss) { } -void func_boss_80042FD0(Boss* boss) { +void Boss300_Init(Boss* boss) { } -void func_boss_80042FDC(Boss* boss) { +void Boss300_Update(Boss* boss) { } -void func_boss_80042FE8(Boss* boss) { +void Boss300_Draw(Boss* boss) { } void func_boss_80042FF4(Actor* actor, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, diff --git a/src/engine/fox_context.c b/src/engine/fox_context.c index c1d8ad0e..e2a7a97a 100644 --- a/src/engine/fox_context.c +++ b/src/engine/fox_context.c @@ -20,7 +20,7 @@ s32 gPlayerNum; s32 gCamCount; s32 gTeamShields[6]; s32 gSavedTeamShields[6]; -UNK_TYPE D_ctx_801778F0[6]; +s32 D_ctx_801778F0[6]; s32 gTeamDamage[6]; u8 D_ctx_80177930; // next planet path f32 gGroundLevel; @@ -33,8 +33,8 @@ f32 gCsCamEyeZ; f32 gCsCamAtX; f32 gCsCamAtY; f32 gCsCamAtZ; -Vec3f D_ctx_801779D8; -Vec3f D_ctx_801779E8; +Vec3f gPlayerCamEye; +Vec3f gPlayerCamAt; bool gExpertMode; s32 D_ctx_80177A10[10]; f32 D_ctx_80177A48[10]; @@ -50,12 +50,12 @@ s32 D_ctx_80177B50[7]; s32 D_ctx_80177B70[7]; PlanetId D_ctx_80177B90[7]; s32 D_ctx_80177BB0[7]; -s32 D_ctx_80177BD8[22]; // overruns D_ctx_80177C30? +s32 D_ctx_80177BD8[22]; // overruns D_ctx_80177C38? s32 D_ctx_80177C38[6]; s32 D_ctx_80177C58[6]; u8 gSoundMode; s32 gVolumeSettings[3]; -u16 D_ctx_80177C90; +u16 gBgmSeqId; u8 gLevelType; s32 D_ctx_80177CA0; UNK_TYPE F_80177CA8; @@ -161,8 +161,8 @@ f32 D_ctx_80178448; f32 D_ctx_80178450[3]; f32 D_ctx_80178460[3]; f32 D_ctx_80178470[3]; -f32 D_ctx_8017847C; -s32 D_ctx_80178480; +f32 gCameraShakeY; +s32 gCameraShake; s32 D_ctx_80178484; bool D_ctx_80178488; UNK_TYPE F_8017848C; @@ -226,21 +226,21 @@ UNK_TYPE P_800D31A0 = 0; s32 D_ctx_80178570; // Color32 light color 2 modifier? s32 D_ctx_80178574; s32 D_ctx_80178578; -s32 D_80161A70; // Color32? start of bss -s32 D_80161A74; -s32 D_80161A78; -s32 D_80161A7C; -s32 D_80161A80; -s32 D_80161A84; -s32 D_80161A88; -s32 D_80161A8C; +s32 D_ctx_80161A70; // Color32? start of bss +s32 D_ctx_80161A74; +s32 D_ctx_80161A78; +s32 D_ctx_80161A7C; +s32 D_ctx_80161A80; +s32 D_ctx_80161A84; +s32 D_ctx_80161A88; +s32 D_ctx_80161A8C; u8 gGoldRingCount[4]; -u8 D_80161A94[4]; +u8 D_ctx_80161A94[4]; s32 gHitCount; s32 gSavedHitCount; s16 gLifeCount[4]; LaserStrength gLaserStrength[4]; -s32 D_80161AB8; +s32 D_ctx_80161AB8; UNK_TYPE F_80161AC0[4]; UNK_TYPE F_80161AD0[4]; UNK_TYPE F_80161AE0[4]; diff --git a/src/engine/fox_demo.c b/src/engine/fox_demo.c index 6a7577a9..a37f5747 100644 --- a/src/engine/fox_demo.c +++ b/src/engine/fox_demo.c @@ -114,7 +114,7 @@ void func_demo_80048AC0(s32 teamId) { s32 teamShield; if (teamId == 1) { - if (gTeamShields[1] < 0x40) { + if (gTeamShields[1] < 64) { Radio_PlayMessage(gMsg_ID_20303, RCID_FALCO); return; } @@ -242,7 +242,7 @@ void func_demo_80048E40(Player* player) { break; case 100: - D_ctx_80177840 = 0x64; + D_ctx_80177840 = 100; break; case 200: @@ -273,7 +273,7 @@ void func_demo_80048E40(Player* player) { default: break; } - if (gCsFrameCount >= 0x1C3) { + if (gCsFrameCount > 450) { Math_SmoothStepToF(&D_ctx_80177A48[0], 1.0f, 0.1f, 0.004f, 0.0f); player->unk_0D0 += 2.0f; player->unk_0E4 += 0.1f; @@ -358,7 +358,7 @@ void func_demo_80049630(Actor* actor) { case 1: actor->state = 2; AUDIO_PLAY_SFX(0x09000002U, actor->sfxSource, 0); - actor->timer_0BC = 0x96; + actor->timer_0BC = 150; actor->fwork[29] = 5.0f; case 2: @@ -450,7 +450,7 @@ void func_demo_80049C0C(Player* player) { s32 pad[4]; player->pos.x += player->vel.x; - player->unk_228 = 0; + player->flags_228 = 0; player->unk_238 = 0; player->pos.y += player->vel.y; player->pos.z += player->vel.z; @@ -497,7 +497,7 @@ void func_demo_80049C0C(Player* player) { } func_demo_80049968(&gActors[3], 3); - player->timer_1F8 = 0x32; + player->timer_1F8 = 50; break; case 1: @@ -506,7 +506,7 @@ void func_demo_80049C0C(Player* player) { D_ctx_80178414 *= 1.05f; if (player->timer_1F8 == 0) { player->unk_1D0 = 2; - player->timer_1F8 = 0x96; + player->timer_1F8 = 150; } player->unk_190 = 2.0f; player->unk_08C -= 2.0f; @@ -538,12 +538,12 @@ void func_demo_80049C0C(Player* player) { var_v0 = 1; player->unk_190 = 2.0f; - if ((player->timer_1F8 == 0x5F) && (gTeamShields[1] > 0)) { + if ((player->timer_1F8 == 95) && (gTeamShields[1] > 0)) { gActors[0].state = var_v0; AUDIO_PLAY_SFX(0x0940802AU, gActors[0].sfxSource, 0); } - if ((player->timer_1F8 == 0x5A) && (gTeamShields[3] > 0)) { + if ((player->timer_1F8 == 90) && (gTeamShields[3] > 0)) { gActors[2].state = var_v0; AUDIO_PLAY_SFX(0x0940802AU, gActors[2].sfxSource, 0); } @@ -576,7 +576,7 @@ void func_demo_80049C0C(Player* player) { if (D_ctx_80178340 == 255) { func_play_800A6148(); player->unk_1D0 = 5; - player->timer_1F8 = 0xA; + player->timer_1F8 = 10; player->unk_08C = -10000.0f; player->unk_0AC = player->unk_0B8 = player->unk_0B0 = player->unk_0BC = player->pos.x = player->pos.y = player->pos.z = player->unk_130 = player->unk_034 = player->unk_138 = @@ -609,7 +609,7 @@ void func_demo_80049C0C(Player* player) { case 6: Math_SmoothStepToF(&D_ctx_80178414, 0.0f, 0.2f, 1000.0f, 0.1f); Math_SmoothStepToF(&player->unk_08C, 0.0f, 0.2f, 500.0f, 0.1f); - if (player->timer_1F8 < 0x1E) { + if (player->timer_1F8 < 30) { for (var_v0 = 0; var_v0 < 3; var_v0++) { func_demo_80049B44(); } @@ -617,13 +617,13 @@ void func_demo_80049C0C(Player* player) { if (player->timer_1F8 == 30) { D_ctx_80178410 = 300; - AUDIO_PLAY_BGM(SEQ_ID_58 | 0x8000); + AUDIO_PLAY_BGM(SEQ_ID_WARP_ZONE | SEQ_FLAG); } if (player->timer_1F8 == 0) { D_bg_8015F960 = 0.0f; D_ctx_80178414 = 0.0f; - player->state_1C8 = 3; + player->state_1C8 = PLAYERSTATE_1C8_3; player->unk_014 = 0.0f; player->unk_018 = 0.0f; D_ctx_801782B8 = 0; @@ -772,8 +772,8 @@ void func_demo_8004A888(Effect* effect) { effect->vel.y = sp20.y; effect->vel.z = sp20.z; effect->obj.id = OBJ_EFFECT_352; - effect->timer_50 = 0x28; - effect->unk_46 = 0x90; + effect->timer_50 = 40; + effect->unk_46 = 144; effect->scale2 = RAND_FLOAT(30.0f) + 10.0f; if (Rand_ZeroOne() < 0.5f) { @@ -813,7 +813,7 @@ void func_demo_8004AAF4(Player* player) { D_ctx_80177E84 = 1; if (gCurrentLevel == LEVEL_VENOM_ANDROSS) { Radio_PlayMessage(gMsg_ID_19466, RCID_FOX); - AUDIO_PLAY_BGM(SEQ_ID_61 | 0x8000); + AUDIO_PLAY_BGM(SEQ_ID_AND_BRAIN | SEQ_FLAG); } else if (gCurrentLevel != LEVEL_TRAINING) { Radio_PlayMessage(gMsg_ID_20180, RCID_FOX); if (gCurrentLevel == LEVEL_SECTOR_Y) { @@ -860,15 +860,15 @@ void func_demo_8004AAF4(Player* player) { player->unk_204 = 2; } - if ((gCsFrameCount >= 0x88) && (gCsFrameCount < 0xB4)) { + if ((gCsFrameCount > 135) && (gCsFrameCount < 180)) { Math_SmoothStepToF(&D_ctx_801779A8[player->num], 30.0f, 1.0f, 10.0f, 0.0f); } - if (gCsFrameCount == 0x8A) { + if (gCsFrameCount == 138) { AUDIO_PLAY_SFX(0x09000007U, player->sfxSource, 0); } - if (gCsFrameCount == 0xBE) { + if (gCsFrameCount == 190) { AUDIO_PLAY_SFX(0x09000013U, player->sfxSource, 0); } @@ -888,7 +888,7 @@ void func_demo_8004AAF4(Player* player) { for (i = 0, actor = &gActors[2]; i < 3; i++, actor++) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_198; + actor->obj.id = OBJ_ACTOR_TEAM_BOSS; actor->obj.pos.x = D_demo_800CA080[i] + player->pos.x; actor->obj.pos.y = D_demo_800CA08C[i] + player->pos.y; actor->obj.pos.z = player->unk_138 - 1000.0f; @@ -957,7 +957,7 @@ void func_demo_8004B368(Player* player) { s32 pad2[2]; f32 var_fa1; - player->unk_228 = 0; + player->flags_228 = 0; Math_SmoothStepToF(&player->unk_034, 0.0f, 0.1f, 5.0f, 0.01f); @@ -986,7 +986,7 @@ void func_demo_8004B368(Player* player) { player->camEye.y += ((player->camAt.y + 500.0f) - player->camEye.y) * 0.01f; player->camEye.z += ((D_ctx_80178448 + (2000.0f * D_ctx_80177950)) - player->camEye.z) * 0.01f; - if (player->timer_1FC >= 0x1A) { + if (player->timer_1FC > 25) { D_ctx_80177A48[2] += 1.5f * player->unk_004; Math_SmoothStepToF(&player->unk_0EC, (player->unk_004 * (-450.0f)) * D_ctx_80177950, 0.2f, 20.0f, 0.1f); } else { @@ -1014,8 +1014,8 @@ void func_demo_8004B368(Player* player) { if (player->timer_1F8 == 0) { player->unk_1D0 = 0; - player->timer_1F8 = 0x78; - player->timer_1FC = 0x14; + player->timer_1F8 = 120; + player->timer_1FC = 20; D_ctx_80177A48[0] = 0.001f; gCsCamEyeX = player->camEye.x; gCsCamEyeY = player->camEye.y; @@ -1066,7 +1066,7 @@ void func_demo_8004B368(Player* player) { } if (player->timer_1F8 == 0) { player->unk_1D0 = 1; - player->timer_1F8 = 0x96; + player->timer_1F8 = 150; player->wings.unk_10 = 0.0f; player->wings.unk_08 = 0.0f; player->wings.unk_0C = 0.0f; @@ -1092,19 +1092,19 @@ void func_demo_8004B368(Player* player) { Math_SmoothStepToF(&player->unk_0E4, 20.0f, 0.1f, 0.2f, 0.01f); Math_SmoothStepToF(&player->pos.x, player->camEye.x, 0.1f, 2.0f, 0.0f); - if (player->timer_1F8 < 0x6F) { + if (player->timer_1F8 <= 110) { Math_SmoothStepToF(&player->unk_0EC, player->unk_004 * 360.0f, 0.1f, 2.5f, 0.0f); } else { Math_SmoothStepToF(&player->unk_0EC, player->unk_004 * 180.0f, 0.1f, 2.5f, 0.0f); } if ((180.0f - fabsf(player->unk_0EC)) <= 3.0f) { - D_80161A88 = 1; + D_ctx_80161A88 = 1; } if (player->timer_1F8 == 0) { - player->timer_1F8 = 0xC8; - player->timer_1FC = 0x1F4; + player->timer_1F8 = 200; + player->timer_1FC = 500; player->unk_1D0 = 2; player->unk_000 = (player->unk_004 = (player->unk_008 = (D_ctx_80178418 = 0.0f))); player->unk_0D0 = 0.0f; @@ -1169,7 +1169,7 @@ void func_demo_8004B368(Player* player) { if (gTeamShields[3] > 0) { func_demo_8004A840(2); } - D_80161A88 = 0; + D_ctx_80161A88 = 0; } Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, 0); @@ -1235,7 +1235,7 @@ void func_demo_8004B368(Player* player) { break; case 816: - if ((gTeamShields[1] == (-1)) || (gTeamShields[1] == 0)) { + if ((gTeamShields[1] == -1) || (gTeamShields[1] == 0)) { Radio_PlayMessage(gMsg_ID_20331, RCID_ROB64); } else { Radio_PlayMessage(gMsg_ID_2320, RCID_FALCO); @@ -1249,7 +1249,7 @@ void func_demo_8004B368(Player* player) { D_ctx_8017842C += 0.2f; if (player->timer_1F8 == 0) { player->unk_1D0 = 4; - player->timer_1F8 = 0x1E; + player->timer_1F8 = 30; player->unk_000 = 0.0f; player->unk_194 = 5.0f; player->unk_190 = 5.0f; @@ -1272,7 +1272,7 @@ void func_demo_8004B368(Player* player) { D_ctx_80177A48[9] = player->vel.z; player->unk_1D0 = 5; player->unk_0D0 = 0.0f; - player->timer_1F8 = 0xA; + player->timer_1F8 = 10; func_effect_80078E50(player->pos.x, player->pos.y, player->unk_138, 30.0f); } gCsCamAtX = player->pos.x; @@ -1306,7 +1306,7 @@ void func_demo_8004B368(Player* player) { case 1255: player->unk_1D0 = 3; - player->timer_1F8 = 0xA; + player->timer_1F8 = 10; func_play_800A6028(player->sfxSource, 0x09000002U); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 50); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50); @@ -1403,7 +1403,7 @@ void func_demo_8004C930(Player* player) { func_play_800AA800(player); } else { if (gCsFrameCount == 170) { - AUDIO_PLAY_BGM(SEQ_ID_38); + AUDIO_PLAY_BGM(SEQ_ID_GOOD_END); } func_demo_8004B368(player); func_play_800AA800(player); @@ -1464,9 +1464,9 @@ void func_demo_8004CCC0(Player* player) { switch (player->unk_1D0) { case 0: if (player->unk_19C != 0) { - player->timer_1F8 = 0xA; + player->timer_1F8 = 10; } else { - player->timer_1F8 = 0x1E; + player->timer_1F8 = 30; } player->unk_1D0 = 1; if (player->unk_4D8 > 180.0f) { @@ -1478,9 +1478,9 @@ void func_demo_8004CCC0(Player* player) { if (player->timer_1F8 == 0) { player->unk_1D0 = 2; if (player->unk_19C != 0) { - player->timer_1F8 = 0x3C; + player->timer_1F8 = 60; } else { - player->timer_1F8 = 0x50; + player->timer_1F8 = 80; } } player->camEye.x += player->vel.x * 0.2f; @@ -1614,8 +1614,8 @@ void func_demo_8004D440(Player* player) { Audio_KillSfxBySourceAndId(player->sfxSource, 0x0900C010U); func_play_800A5FA0(player->sfxSource, 0x0903F004U, player->num); player->state_1C8 = PLAYERSTATE_1C8_6; - player->timer_1F8 = 0x46; - player->timer_224 = 0x14; + player->timer_1F8 = 70; + player->timer_224 = 20; D_ctx_8017837C = 7; if (player->unk_1D4 != 0) { @@ -1658,17 +1658,17 @@ void func_demo_8004D440(Player* player) { if (D_ctx_801778A4 == D_ctx_80177DB8[player->unk_288 - 1]) { player->unk_288 = -1; if (player->unk_284 == 0) { - func_effect_8007C688(player->pos.x, player->pos.y, player->unk_138, 3.0f, 0x3E8); + func_effect_8007C688(player->pos.x, player->pos.y, player->unk_138, 3.0f, 1000); } } } if (gBombCount[gPlayerNum] != 0) { gBombCount[gPlayerNum] = 0; - func_demo_8004D3D4(player, 0x147, &gItems[1]); + func_demo_8004D3D4(player, OBJ_ITEM_BOMB, &gItems[1]); } if (gLaserStrength[gPlayerNum] != 0) { gLaserStrength[gPlayerNum] = 0; - func_demo_8004D3D4(player, 0x142, &gItems[0]); + func_demo_8004D3D4(player, OBJ_ITEM_LASERS, &gItems[0]); } } } @@ -1677,10 +1677,10 @@ void func_demo_8004D738(Player* player) { player->pos.y += 30.0f; func_effect_8007D0E0(player->pos.x, player->pos.y, player->unk_138, 6.0f); if (gCamCount == 1) { - func_effect_8007BFFC(player->pos.x, player->pos.y, player->unk_138, 0.0f, 0.0f, 0.0f, 3.0f, 0x50); - func_effect_8007C688(player->pos.x, player->pos.y, player->unk_138, 3.0f, 0x320); + func_effect_8007BFFC(player->pos.x, player->pos.y, player->unk_138, 0.0f, 0.0f, 0.0f, 3.0f, 80); + func_effect_8007C688(player->pos.x, player->pos.y, player->unk_138, 3.0f, 800); } else { - func_effect_8007BFFC(player->pos.x, player->pos.y, player->unk_138, 0.0f, 0.0f, 0.0f, 3.0f, 0xA); + func_effect_8007BFFC(player->pos.x, player->pos.y, player->unk_138, 0.0f, 0.0f, 0.0f, 3.0f, 10); } func_demo_8004D440(player); } @@ -1750,8 +1750,7 @@ void func_demo_8004D828(Player* player) { (player->timer_1F8 == 0)) { if (gCamCount != 4) { if (player->unk_284 == 0) { - func_effect_8007C688(player->pos.x, player->pos.y, player->unk_138 - (2.0f * player->vel.z), 3.0f, - 0x50); + func_effect_8007C688(player->pos.x, player->pos.y, player->unk_138 - (2.0f * player->vel.z), 3.0f, 80); } if (player->pos.y < player->unk_0A4) { func_enmy_80062C38(player->pos.x, player->pos.z); @@ -1768,7 +1767,7 @@ void func_demo_8004D828(Player* player) { } func_effect_8007D0E0(player->pos.x, player->pos.y, player->unk_138, 5.0f); func_effect_8007BFFC(player->pos.x, player->pos.y, player->unk_138, player->vel.x, 0.0f, player->vel.z, 5.0f, - 0x14); + 20); func_demo_8004D440(player); } Math_SmoothStepToF(&player->unk_034, 0.0f, 0.05f, 5.0f, 0.00001f); @@ -1858,13 +1857,13 @@ void func_demo_8004DEF8(Player* player) { (player->timer_1F8 == 0)) { if (player->pos.y < player->unk_0A4) { func_effect_8007C688(player->pos.x, gGroundLevel + 20.0f, player->unk_138 - (2.0f * player->vel.z), 3.0f, - 0x320); + 800); func_enmy_80062C38(player->pos.x, player->pos.z); } func_effect_8007D0E0(player->pos.x, player->pos.y - (2.0f * player->vel.y), player->unk_138 - (2.0f * player->vel.z), 6.0f); func_effect_8007BFFC(player->pos.x, player->pos.y - player->vel.y, player->unk_138 - (2.0f * player->vel.z), - 0.0f, 0.0f, 0.0f, 3.0f, 0x14); + 0.0f, 0.0f, 0.0f, 3.0f, 20); if (gLevelType == LEVELTYPE_PLANET) { for (i = 0; i < 2; i++) { func_play_800A69F8(2, player->pos.x, player->pos.y, player->unk_138); @@ -1883,14 +1882,14 @@ void func_demo_8004DEF8(Player* player) { player->unk_034 += 10.0f; } - if ((D_80161A88 == 2) && (player->pos.y <= player->unk_0A4)) { + if ((D_ctx_80161A88 == 2) && (player->pos.y <= player->unk_0A4)) { func_effect_8007D9DC(player->pos.x, gGroundLevel + 2.0f, player->unk_138, 3.0f, 20.0f, 0); func_effect_8007ADF4(player->pos.x, gGroundLevel, player->unk_138, 0.1f, 2.0f); } } void func_demo_8004E3D8(Player* player) { - player->unk_228 = 0; + player->flags_228 = 0; player->unk_280 = 0; if (gGameFrameCount & 1) { @@ -1947,7 +1946,7 @@ void func_demo_8004E4D4(Actor* actor) { case 1: actor->state = 2; - actor->timer_0BC = 0x32; + actor->timer_0BC = 50; actor->fwork[9] = 2.0f; AUDIO_PLAY_SFX(0x09000002U, actor->sfxSource, 0); actor->fwork[29] = 5.0f; @@ -1968,9 +1967,9 @@ void func_demo_8004E4D4(Actor* actor) { break; case 10: - actor->state = 0xB; - actor->timer_0BC = 0x96; - actor->timer_0BE = 0x28; + actor->state = 11; + actor->timer_0BC = 150; + actor->timer_0BE = 40; AUDIO_PLAY_SFX(0x09000002U, actor->sfxSource, 0); actor->fwork[29] = 5.0f; /* fallthrough */ @@ -2103,10 +2102,10 @@ void func_demo_8004EBD0(Actor* actor) { case 2: if (actor->timer_0BC == 110) { - gPlayer[0].timer_1F8 = 0x2710; + gPlayer[0].timer_1F8 = 10000; } if (actor->timer_0BC == 260) { - gPlayer[0].timer_1FC = 0x2710; + gPlayer[0].timer_1FC = 10000; } if (actor->timer_0BC == 0) { actor->state++; @@ -2182,7 +2181,7 @@ void func_demo_8004F05C(Actor* actor) { case 1: actor->state = 2; - actor->timer_0BC = 0x64; + actor->timer_0BC = 100; AUDIO_PLAY_SFX(0x09000002U, actor->sfxSource, 0U); actor->fwork[29] = 5.0f; @@ -2228,7 +2227,7 @@ void func_demo_8004F05C(Actor* actor) { if (actor->timer_0BC == 0) { if (actor->obj.pos.x >= -3500.0f) { if (actor->obj.pos.z <= 3000.0f) { - if ((fabsf(actor->obj.pos.y) <= 400.0f) && (gCsFrameCount < 0x12D)) { + if ((fabsf(actor->obj.pos.y) <= 400.0f) && (gCsFrameCount <= 300)) { func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 8.0f); } } @@ -2267,7 +2266,7 @@ void func_demo_8004F05C(Actor* actor) { case 0: actor->obj.rot.z = actor->unk_0F4.z; - if (actor->unk_0B6 == 0xA) { + if (actor->unk_0B6 == 10) { actor->obj.pos.z = gPlayer[0].camEye.z + 12000.0f; } break; @@ -2395,12 +2394,12 @@ void func_demo_8004F8AC(Actor* actor) { break; case LEVEL_FORTUNA: - if (actor->unk_0B6 == 0xB) { + if (actor->unk_0B6 == 11) { switch (actor->state) { case 0: - if (gCsFrameCount == 0x64) { + if (gCsFrameCount == 100) { actor->state = 1; - actor->timer_0BC = 0x32; + actor->timer_0BC = 50; actor->iwork[0] = 255; AUDIO_PLAY_SFX(0x2902F026U, actor->sfxSource, 0); } @@ -2410,9 +2409,8 @@ void func_demo_8004F8AC(Actor* actor) { Math_SmoothStepToF(&actor->scale, 0.5f, 0.03f, 0.01f, 0.0f); D_ctx_80178348 = D_ctx_80178340 = D_ctx_80178350 = D_ctx_80178354 = 0; - if ((actor->timer_0BC == 0x2B) || (actor->timer_0BC == 0x2E) || - (actor->timer_0BC == 0x31)) { - D_ctx_80178340 = 0xC0; + if ((actor->timer_0BC == 43) || (actor->timer_0BC == 46) || (actor->timer_0BC == 49)) { + D_ctx_80178340 = 192; D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = 255; } @@ -2428,7 +2426,7 @@ void func_demo_8004F8AC(Actor* actor) { D_ctx_80178378 = gActors[0].obj.pos.z - 70.0f; D_ctx_80178360 = 255; D_ctx_80178364 = 255; - D_ctx_80178368 = 0x50; + D_ctx_80178368 = 80; break; } } @@ -2543,7 +2541,7 @@ void func_demo_8004FEC0(Actor* actor) { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, actor->unk_046); gSPDisplayList(gMasterDisp++, D_ENMY_PLANET_40018A0); - if (actor->unk_046 >= 0x33) { + if (actor->unk_046 > 50) { func_edisplay_8005ADAC(actor); } break; @@ -2859,7 +2857,7 @@ void func_demo_8004FEC0(Actor* actor) { RCP_SetupDL_49(); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, actor->iwork[0]); - gDPSetEnvColor(gMasterDisp++, 255, 0xC0, 128, 255); + gDPSetEnvColor(gMasterDisp++, 255, 192, 128, 255); Matrix_RotateY( gGfxMatrix, diff --git a/src/engine/fox_display.c b/src/engine/fox_display.c index f9eee36d..2cc32156 100644 --- a/src/engine/fox_display.c +++ b/src/engine/fox_display.c @@ -32,7 +32,7 @@ void func_display_80051B30(void) { Vec3f sp68; Vec3f sp5C; - if ((D_ctx_80177854 == 0x64) || (D_display_800CA234 == NULL)) { + if ((D_ctx_80177854 == 100) || (D_display_800CA234 == NULL)) { return; } if ((D_display_800CA234->obj.status != OBJ_ACTIVE) || (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_3)) { @@ -60,13 +60,13 @@ void func_display_80051B30(void) { } RCP_SetupDL(&gMasterDisp, 0xC); switch (D_display_800CA234->aiType) { - case 3: + case AI360_PEPPY: gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 30, 0, 255); break; - case 2: + case AI360_SLIPPY: gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 00, 179, 67, 255); break; - case 1: + case AI360_FALCO: gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 30, 30, 255, 255); break; } @@ -130,11 +130,11 @@ bool func_display_800520FC(s32 limbIndex, Gfx** gfxPtr, Vec3f* pos, Vec3f* rot, gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); if (player->num == 1) { - if (limbIndex == 0x10) { + if (limbIndex == 16) { rot->y += player->unk_154; rot->y -= player->unk_180; } - if (limbIndex == 0x16) { + if (limbIndex == 22) { rot->y += -player->unk_158 * 0.8f; rot->x -= player->unk_15C; } @@ -155,7 +155,7 @@ bool func_display_800520FC(s32 limbIndex, Gfx** gfxPtr, Vec3f* pos, Vec3f* rot, rot->y += player->unk_168; } } else { - if (limbIndex == 0xB) { + if (limbIndex == 11) { if (player->num == 0) { rot->y += -player->unk_154 * 0.8f; } @@ -167,11 +167,11 @@ bool func_display_800520FC(s32 limbIndex, Gfx** gfxPtr, Vec3f* pos, Vec3f* rot, rot->y += player->unk_154 * 0.8f; } } - if (limbIndex == 0x10) { + if (limbIndex == 16) { rot->y += -player->unk_158 * 0.8f; rot->x -= player->unk_15C; } - if ((limbIndex == 0x11) && (player->num != 2)) { + if ((limbIndex == 17) && (player->num != 2)) { rot->y += player->unk_180; rot->x -= player->unk_180; rot->y += -player->unk_158 * 0.2f; @@ -185,7 +185,7 @@ void func_display_800523A8(s32 limbIndex, Vec3f* rot, void* data) { Vec3f sp1C; Player* player = (Player*) data; - if (limbIndex == 0xB) { + if (limbIndex == 11) { sp1C.x = 3.0f; sp1C.y = 1.0f; sp1C.z = -28.0f; @@ -197,7 +197,7 @@ void func_display_80052420(s32 limbIndex, Vec3f* rot, void* data) { Vec3f sp1C; Player* player = (Player*) data; - if (limbIndex == 0x10) { + if (limbIndex == 16) { sp1C.x = 13.0f; sp1C.y = 2.0f; sp1C.z = 28.0f; @@ -209,7 +209,7 @@ void func_display_80052498(s32 limbIndex, Vec3f* rot, void* data) { Vec3f sp1C; Player* player = (Player*) data; - if (limbIndex == 0xB) { + if (limbIndex == 11) { sp1C.x = 0.0f; sp1C.y = 2.0f; sp1C.z = 29.0f; @@ -221,7 +221,7 @@ void func_display_8005250C(s32 limbIndex, Vec3f* rot, void* data) { Vec3f sp1C; Player* player = (Player*) data; - if (limbIndex == 0xB) { + if (limbIndex == 11) { sp1C.x = 19.0f; sp1C.y = 1.0f; sp1C.z = 32.0f; @@ -711,7 +711,7 @@ void func_display_80054300(Player* player) { if (player->unk_068 > 30.0f) { gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); } - if ((D_80161A88 == 2) && (player->unk_068 < 10.0f)) { + if ((D_ctx_80161A88 == 2) && (player->unk_068 < 10.0f)) { player->unk_23C = 90; } else { player->unk_23C = 180; @@ -853,8 +853,8 @@ void func_display_80054CA4(Player* player) { gDPSetEnvColor(gMasterDisp++, 255, 0, 255, (s32) D_ctx_80177AB8[player->num]); gSPDisplayList(gMasterDisp++, D_101CD70); Matrix_Pop(&gGfxMatrix); - Texture_Scroll(D_101D070, 0x20, 0x20, 3); - Texture_Scroll(D_101D070, 0x20, 0x20, 3); + Texture_Scroll(D_101D070, 32, 32, 3); + Texture_Scroll(D_101D070, 32, 32, 3); } } @@ -982,7 +982,7 @@ void func_display_80054E80(Player* player) { void func_display_80055788(Player* player) { f32 sp54; - if (gChargeTimers[player->num] >= 0xB) { + if (gChargeTimers[player->num] >= 11) { RCP_SetupDL(&gMasterDisp, 0x43); Matrix_Push(&gGfxMatrix); sp54 = gChargeTimers[player->num] / 20.0f; @@ -1188,7 +1188,7 @@ void func_display_800564C0(Player* player, s32 arg1) { Matrix_Push(&gGfxMatrix); if (player->form == FORM_LANDMASTER) { if (player->unk_1D4 != 0) { - Matrix_Translate(gGfxMatrix, 0.0f, D_ctx_8017847C, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, gCameraShakeY, 0.0f, 1); } Matrix_Translate(gGfxMatrix, player->pos.x, player->pos.y + player->unk_18C + 30.0f, player->unk_138 + player->unk_144, 1); @@ -1228,7 +1228,7 @@ void func_display_800564C0(Player* player, s32 arg1) { return; } Matrix_Pop(&gGfxMatrix); - Matrix_Translate(gCalcMatrix, player->pos.x, player->pos.y + D_ctx_8017847C, + Matrix_Translate(gCalcMatrix, player->pos.x, player->pos.y + gCameraShakeY, player->unk_138 + player->unk_144, 0); Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134 + 180.0f) * M_DTOR, 1); Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_134) * M_DTOR), 1); @@ -1413,7 +1413,7 @@ void func_display_80057504(void) { Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, D_display_80161578[i].x, D_display_80161578[i].y, D_display_80161578[i].z, 1); - if ((D_ctx_80177854 != 0x64) && (i == gPlayerNum)) { + if ((D_ctx_80177854 != 100) && (i == gPlayerNum)) { Math_SmoothStepToF(&D_display_801615A8[i], 0.0f, 0.5f, 20.0f, 0); Math_SmoothStepToF(&D_display_801615B8[i], 1.0, 0.5f, 0.2f, 0); } @@ -1466,12 +1466,12 @@ void func_display_800578C4(Player* player) { case 0: Math_SmoothStepToAngle(&player->wings.unk_30, 0.0f, 0.2f, 3.0f, 0.0f); Math_SmoothStepToAngle(&player->wings.unk_34, 0.0f, 0.2f, 3.0f, 0.0f); - D_ctx_801779D8.x = player->camEye.x; - D_ctx_801779D8.y = player->camEye.y; - D_ctx_801779D8.z = player->camEye.z; - D_ctx_801779E8.x = player->camAt.x; - D_ctx_801779E8.y = player->camAt.y; - D_ctx_801779E8.z = player->camAt.z; + gPlayerCamEye.x = player->camEye.x; + gPlayerCamEye.y = player->camEye.y; + gPlayerCamEye.z = player->camEye.z; + gPlayerCamAt.x = player->camAt.x; + gPlayerCamAt.y = player->camAt.y; + gPlayerCamAt.z = player->camAt.z; break; case 1: case 2: @@ -1500,12 +1500,12 @@ void func_display_800578C4(Player* player) { Matrix_RotateX(gCalcMatrix, (player->unk_0E8 + D_display_800CA380) * M_DTOR, 0); Matrix_RotateY(gCalcMatrix, (player->unk_0E4 + D_display_800CA384) * M_DTOR, 1); Matrix_MultVec3f(gCalcMatrix, &sp4C, &sp40); - D_ctx_801779D8.x = player->pos.x + sp40.x; - D_ctx_801779D8.y = player->pos.y + sp40.y + 20.0f; - D_ctx_801779D8.z = player->unk_138 + sp40.z; - D_ctx_801779E8.x = (SIN_DEG(gGameFrameCount * 3.0f) * 3.0f) + player->pos.x; - D_ctx_801779E8.y = (COS_DEG(gGameFrameCount * 4.0f) * 3.0f) + player->pos.y; - D_ctx_801779E8.z = (SIN_DEG(gGameFrameCount * 3.5f) * 3.0f) + player->unk_138; + gPlayerCamEye.x = player->pos.x + sp40.x; + gPlayerCamEye.y = player->pos.y + sp40.y + 20.0f; + gPlayerCamEye.z = player->unk_138 + sp40.z; + gPlayerCamAt.x = (SIN_DEG(gGameFrameCount * 3.0f) * 3.0f) + player->pos.x; + gPlayerCamAt.y = (COS_DEG(gGameFrameCount * 4.0f) * 3.0f) + player->pos.y; + gPlayerCamAt.z = (SIN_DEG(gGameFrameCount * 3.5f) * 3.0f) + player->unk_138; break; } } @@ -1545,35 +1545,35 @@ void func_display_80057D00(void) { sp78.x = player->camEye.x - player->pos.x; sp78.y = player->camEye.y - player->pos.y; sp78.z = player->camEye.z - (player->unk_138 + player->unk_144); - Matrix_MultVec3f(gCalcMatrix, &sp78, &D_ctx_801779D8); - D_ctx_801779D8.x += player->pos.x; - D_ctx_801779D8.y += player->pos.y; - D_ctx_801779D8.z += player->unk_138 + player->unk_144; + Matrix_MultVec3f(gCalcMatrix, &sp78, &gPlayerCamEye); + gPlayerCamEye.x += player->pos.x; + gPlayerCamEye.y += player->pos.y; + gPlayerCamEye.z += player->unk_138 + player->unk_144; sp78.x = player->camAt.x - player->pos.x; sp78.y = player->camAt.y - player->pos.y; sp78.z = player->camAt.z - (player->unk_138 + player->unk_144); - Matrix_MultVec3f(gCalcMatrix, &sp78, &D_ctx_801779E8); - D_ctx_801779E8.x += player->pos.x; - D_ctx_801779E8.y += player->pos.y; - D_ctx_801779E8.z += player->unk_138 + player->unk_144; + Matrix_MultVec3f(gCalcMatrix, &sp78, &gPlayerCamAt); + gPlayerCamAt.x += player->pos.x; + gPlayerCamAt.y += player->pos.y; + gPlayerCamAt.z += player->unk_138 + player->unk_144; if ((player->unk_238 != 0) && (player->unk_110 > 5.0f)) { - D_ctx_801779E8.x += SIN_DEG(gGameFrameCount * 150.0f) * player->unk_110 * 0.2f; + gPlayerCamAt.x += SIN_DEG(gGameFrameCount * 150.0f) * player->unk_110 * 0.2f; } } else if (player->state_1C8 == PLAYERSTATE_1C8_7) { func_display_800578C4(player); } else { - D_ctx_801779D8.x = player->camEye.x; - D_ctx_801779D8.y = player->camEye.y; - D_ctx_801779D8.z = player->camEye.z; - D_ctx_801779E8.x = player->camAt.x; - D_ctx_801779E8.y = player->camAt.y; - D_ctx_801779E8.z = player->camAt.z; - } - player->unk_058 = -Math_Atan2F(D_ctx_801779D8.x - D_ctx_801779E8.x, D_ctx_801779D8.z - D_ctx_801779E8.z); - player->unk_05C = -Math_Atan2F(D_ctx_801779D8.y - D_ctx_801779E8.y, sqrtf(SQ(D_ctx_801779D8.z - D_ctx_801779E8.z) + - SQ(D_ctx_801779D8.x - D_ctx_801779E8.x))); + gPlayerCamEye.x = player->camEye.x; + gPlayerCamEye.y = player->camEye.y; + gPlayerCamEye.z = player->camEye.z; + gPlayerCamAt.x = player->camAt.x; + gPlayerCamAt.y = player->camAt.y; + gPlayerCamAt.z = player->camAt.z; + } + player->unk_058 = -Math_Atan2F(gPlayerCamEye.x - gPlayerCamAt.x, gPlayerCamEye.z - gPlayerCamAt.z); + player->unk_05C = -Math_Atan2F(gPlayerCamEye.y - gPlayerCamAt.y, + sqrtf(SQ(gPlayerCamEye.z - gPlayerCamAt.z) + SQ(gPlayerCamEye.x - gPlayerCamAt.x))); Matrix_RotateY(gCalcMatrix, -player->unk_058, 0); Matrix_RotateX(gCalcMatrix, player->unk_05C, 1); Matrix_RotateZ(gCalcMatrix, -player->unk_034 * M_DTOR, 1); @@ -1583,25 +1583,25 @@ void func_display_80057D00(void) { Matrix_MultVec3f(gCalcMatrix, &sp78, &sp6C); if (D_ctx_80178410 != 0) { D_ctx_80178428 = DEG_TO_RAD(gPlayer[0].unk_034); - func_play_800B6F50(D_ctx_801779D8.x, D_ctx_801779D8.y, D_ctx_801779D8.z, D_ctx_801779E8.x, D_ctx_801779E8.y, - D_ctx_801779E8.z); + func_play_800B6F50(gPlayerCamEye.x, gPlayerCamEye.y, gPlayerCamEye.z, gPlayerCamAt.x, gPlayerCamAt.y, + gPlayerCamAt.z); func_bg_8003DAF0(); } func_bg_8003E1E8(); func_bg_80040450(); Matrix_Push(&gGfxMatrix); - Matrix_LookAt(gGfxMatrix, D_ctx_801779D8.x, D_ctx_801779D8.y, D_ctx_801779D8.z, D_ctx_801779E8.x, D_ctx_801779E8.y, - D_ctx_801779E8.z, sp6C.x, sp6C.y, sp6C.z, 1); + Matrix_LookAt(gGfxMatrix, gPlayerCamEye.x, gPlayerCamEye.y, gPlayerCamEye.z, gPlayerCamAt.x, gPlayerCamAt.y, + gPlayerCamAt.z, sp6C.x, sp6C.y, sp6C.z, 1); if ((gLevelType == LEVELTYPE_PLANET) || (gCurrentLevel == LEVEL_BOLSE)) { if ((gCurrentLevel == LEVEL_TITANIA) && ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2) || (gPlayer[0].unk_19C != 0))) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, D_ctx_8017847C, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, gCameraShakeY, 0.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); Ground_801B58AC(&gMasterDisp, D_ctx_80177CC8); D_ctx_80177CC8 = 0.0f; Matrix_Pop(&gGfxMatrix); - } else if (D_80161A88 != 2) { + } else if (D_ctx_80161A88 != 2) { D_bg_8015F964 = 0; func_bg_80040CE4(); } @@ -1616,7 +1616,7 @@ void func_display_80057D00(void) { func_display_800564C0(opponent, 0); func_display_80057814(opponent); } - if ((D_80161A88 == 2) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2)) { + if ((D_ctx_80161A88 == 2) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2)) { Lights_SetOneLight(&gMasterDisp, gLight2x, -1 * gLight2y, gLight2z, gLight2R, gLight2G, gLight2B, gAmbientR, gAmbientG, gAmbientB); Matrix_Push(&gGfxMatrix); @@ -1631,11 +1631,11 @@ void func_display_80057D00(void) { } Lights_SetOneLight(&gMasterDisp, gLight1x, gLight1y, gLight1z, gLight1R, gLight1G, gLight1B, gAmbientR, gAmbientG, gAmbientB); - func_edisplay_80060714(1); + Object_Draw(1); TexturedLine_Draw(); D_display_80161410 = 1; func_beam_8003DA0C(); - if ((D_80161A88 == 2) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2)) { + if ((D_ctx_80161A88 == 2) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2)) { Matrix_Push(&gGfxMatrix); Matrix_Scale(gGfxMatrix, 1.0f, -1.0f, 1.0f, 1); D_display_80161410 = -1; @@ -1643,7 +1643,7 @@ void func_display_80057D00(void) { Matrix_Pop(&gGfxMatrix); } D_display_80161410 = -1; - if ((D_80161A88 == 2) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2)) { + if ((D_ctx_80161A88 == 2) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2)) { Matrix_Push(&gGfxMatrix); Matrix_Scale(gGfxMatrix, 1.0f, -1.0f, 1.0f, 1); for (i = 0, opponent = gPlayer; i < gCamCount; i++, opponent++) { @@ -1655,17 +1655,17 @@ void func_display_80057D00(void) { } } if (gCurrentLevel == LEVEL_AQUAS) { - func_edisplay_8006089C(0); + Effect_Draw(0); } - if ((D_80161A88 == 2) || (D_ctx_80177AC8 != 0)) { + if ((D_ctx_80161A88 == 2) || (D_ctx_80177AC8 != 0)) { D_bg_8015F964 = 1; - func_edisplay_8006089C(1); + Effect_Draw(1); func_bg_80040CE4(); } if ((gCurrentLevel != LEVEL_AQUAS) && (((gCurrentLevel != LEVEL_CORNERIA) && (gCurrentLevel != LEVEL_VENOM_ANDROSS)) || ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_7) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2)))) { - func_edisplay_8006089C(0); + Effect_Draw(0); } D_display_80161410 = 1; for (i = 0, opponent = gPlayer; i < gCamCount; i++, opponent++) { @@ -1680,7 +1680,7 @@ void func_display_80057D00(void) { } if (((gCurrentLevel == LEVEL_CORNERIA) || (gCurrentLevel == LEVEL_VENOM_ANDROSS)) && ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_7) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_2))) { - func_edisplay_8006089C(0); + Effect_Draw(0); } BonusText_DrawAll(); Matrix_Pop(&gGfxMatrix); diff --git a/src/engine/fox_edata_info.c b/src/engine/fox_edata_info.c index aab57d35..3a2f8611 100644 --- a/src/engine/fox_edata_info.c +++ b/src/engine/fox_edata_info.c @@ -131,10 +131,10 @@ ObjectInfo D_edata_800CC124[0x190] = { /* OBJ_80_36, */ {(void*) func_edisplay_80059B20, 1, (ObjectFunc) func_enmy_800652CC, D_TI_60066E0, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_80_37, */ {(void*) func_edisplay_80059B20, 1, (ObjectFunc) func_enmy_800652CC, D_TI_600672C, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_80_38, */ {(void*) func_edisplay_80059B20, 1, (ObjectFunc) func_enmy_800652CC, D_TI_6006778, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_80_39, */ {(void*) func_edisplay_80059AEC, 1, (ObjectFunc) func_enmy2_8006D350, D_edata_800CBF34, 6000.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_80_39, */ {(void*) Obj39_Draw, 1, (ObjectFunc) Obj39_Update, D_edata_800CBF34, 6000.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_80_40, */ {(void*) func_edisplay_80059F68, 1, (ObjectFunc) func_enmy_80066D5C, D_CO_603E4A4, 1000.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_80_41, */ {(void*) func_edisplay_80059FDC, 1, (ObjectFunc) func_enmy_80066EA8, D_CO_603E4DC, 300.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_80_42, */ {(void*) func_edisplay_80059BBC, 1, (ObjectFunc) func_enmy2_8006B95C, D_CO_603E514, 1000.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_80_42, */ {(void*) Obj42_Draw, 1, (ObjectFunc) Obj42_Update, D_CO_603E514, 1000.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_80_43, */ {(void*) D_ZO_6024AC0, 0, (ObjectFunc) NULL, D_ZO_602B9EC, 200.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_80_44, */ {(void*) D_ZO_600F560, 0, (ObjectFunc) NULL, D_ZO_602BA20, 1500.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_80_45, */ {(void*) D_ZO_600EC90, 0, (ObjectFunc) NULL, D_ZO_602BAE4, 1500.0f, 0, 0, 40, 0, 0.0f, 0 }, @@ -146,7 +146,7 @@ ObjectInfo D_edata_800CC124[0x190] = { /* OBJ_80_51, */ {(void*) D_VE1_6006F50, 0, (ObjectFunc) NULL, D_VE1_601B584, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_80_52, */ {(void*) D_VE1_6005780, 0, (ObjectFunc) Venom1_80193540, D_VE1_601B5F4, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_80_53, */ {(void*) D_AQ_6003610, 0, (ObjectFunc) NULL, D_VE1_601B644, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_80_54, */ {(void*) D_CO_6000E00, 0, (ObjectFunc) func_enmy2_8006AA98, D_CO_603E0EC, 1000.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_80_54, */ {(void*) D_CO_6000E00, 0, (ObjectFunc) Obj54_Update, D_CO_603E0EC, 1000.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_80_55, */ {(void*) D_CO_6013B50, 0, (ObjectFunc) NULL, D_CO_603E88C, 1000.0f, 0, 0, 41, 0, 0.0f, 0 }, /* OBJ_80_56, */ {(void*) Corneria_8018F31C, 2, (ObjectFunc) Corneria_8018F044, D_CO_603E8A8, 1000.0f, 0, 0, 39, 0, 0.0f, 0 }, /* OBJ_80_57, */ {(void*) Titania_8018F8B8, 1, (ObjectFunc) Titania_8018F4D8, D_TI_6006BF0, 800.0f, 0, 0, 40, 0, 0.0f, 0 }, @@ -203,7 +203,7 @@ ObjectInfo D_edata_800CC124[0x190] = { /* OBJ_80_108 */ {(void*) D_SY_60102C0, 0, (ObjectFunc) NULL, D_SY_6034588, 4000.0f, 0, 0, 41, 0, 0.0f, 0 }, /* OBJ_80_109 */ {(void*) D_SY_60036A0, 0, (ObjectFunc) SectorY_801A4E44, D_SY_6034664, 4000.0f, 0, 0, 41, 0, 0.0f, 0 }, /* OBJ_80_110 */ {(void*) D_SY_6005360, 0, (ObjectFunc) NULL, D_SY_6034770, 4000.0f, 0, 0, 41, 0, 0.0f, 0 }, - /* OBJ_80_111 */ {(void*) func_enmy2_80074F90, 1, (ObjectFunc) NULL, D_edata_800CBF34, 2000.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_80_111 */ {(void*) Obj111_Draw, 1, (ObjectFunc) NULL, D_edata_800CBF34, 2000.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJ_80_112 */ {(void*) D_SY_600F6C0, 0, (ObjectFunc) SectorY_801A52B8, D_SY_60347F0, 4000.0f, 0, 0, 41, 0, 0.0f, 0 }, /* OBJ_80_113 */ {(void*) D_SY_601B610, 0, (ObjectFunc) NULL, D_edata_800CBF34, 2000.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_80_114 */ {(void*) D_SY_601C6A0, 0, (ObjectFunc) NULL, D_edata_800CBF34, 2000.0f, 0, 0, 40, 0, 0.0f, 0 }, @@ -281,22 +281,22 @@ ObjectInfo D_edata_800CC124[0x190] = { /* OBJ_ACTOR_186 */ {(void*) func_edisplay_8005B7CC, 1, (ObjectFunc) Meteo_8018795C, D_ME_602F724, 200.0f, 0, 1, 39, 0, 1.0f, 1 }, /* OBJ_ACTOR_187 */ {(void*) D_ME_6018450, 0, (ObjectFunc) Meteo_801877C4, D_ME_602F740, 200.0f, 0, 1, 39, 0, 1.0f, 1 }, /* OBJ_ACTOR_188 */ {(void*) Aquas_801BEC74, 1, (ObjectFunc) Aquas_801BEC68, D_AQ_6030BE0, 200.0f, 0, 1, 39, 0, 1.0f, 1 }, - /* OBJ_ACTOR_189 */ {(void*) func_edisplay_8005A094, 1, (ObjectFunc) func_enmy2_8006C008, D_edata_800CBF34, 0.0f, 0, 0, 39, 0, 0.0f, 0 }, + /* OBJ_ACTOR_189 */ {(void*) Actor189_Draw, 1, (ObjectFunc) Actor189_Update, D_edata_800CBF34, 0.0f, 0, 0, 39, 0, 0.0f, 0 }, /* OBJ_ACTOR_190 */ {(void*) func_edisplay_8005B848, 1, (ObjectFunc) func_enmy_800656D4, D_edata_800CBFE4, 100.0f, 0, 1, 39, 0, 1.0f, 0 }, /* OBJ_ACTOR_191 */ {(void*) func_edisplay_8005B848, 1, (ObjectFunc) func_enmy_800656D4, D_edata_800CBFE4, 100.0f, 0, 1, 39, 0, 1.0f, 0 }, /* OBJ_ACTOR_192 */ {(void*) func_edisplay_8005B9A4, 1, (ObjectFunc) func_enmy_8006654C, D_CO_603E54C, 200.0f, 0, 1, 39, 0, 50.0f, 1 }, /* OBJ_ACTOR_193 */ {(void*) func_edisplay_8005BA30, 1, (ObjectFunc) func_enmy_800669A0, D_CO_603E598, 100.0f, 0, 1, 39, 0, 0.0f, 0 }, - /* OBJ_ACTOR_194 */ {(void*) func_enmy2_8006B74C, 1, (ObjectFunc) func_enmy2_8006B094, D_edata_800CC000, 200.0f, 0, 1, 39, 0, 0.0f, 1 }, + /* OBJ_ACTOR_194 */ {(void*) Actor194_Draw, 1, (ObjectFunc) Actor194_Update, D_edata_800CC000, 200.0f, 0, 1, 39, 0, 0.0f, 1 }, /* OBJ_ACTOR_195 */ {(void*) func_demo_8004FEC0, 1, (ObjectFunc) func_demo_8004F8AC, D_edata_800CBF34, 20000.0f, 0, 1, 39, 0, 0.0f, 0 }, - /* OBJ_ACTOR_196 */ {(void*) func_edisplay_80059BF0, 1, (ObjectFunc) func_enmy2_8006BB78, D_CO_603E5B4, 200.0f, 0, 1, 39, 0, 1.0f, 1 }, - /* OBJ_ACTOR_197 */ {(void*) func_360_80035448, 1, (ObjectFunc) func_360_800319AC, D_edata_800CC038, 20000.0f, 0, 1, 39, 1, 1.0f, 1 }, - /* OBJ_ACTOR_198 */ {(void*) func_360_80035448, 1, (ObjectFunc) func_hud_80092EC0, D_edata_800CC01C, 20000.0f, 0, 0, 39, 1, 0.0f, 0 }, + /* OBJ_ACTOR_196 */ {(void*) Actor196_Draw, 1, (ObjectFunc) Actor196_Update, D_CO_603E5B4, 200.0f, 0, 1, 39, 0, 1.0f, 1 }, + /* OBJ_ACTOR_ALLRANGE */ {(void*) ActorAllRange_Draw, 1, (ObjectFunc) ActorAllRange_Update, D_edata_800CC038, 20000.0f, 0, 1, 39, 1, 1.0f, 1 }, + /* OBJ_ACTOR_TEAM_BOSS */ {(void*) ActorAllRange_Draw, 1, (ObjectFunc) ActorTeamBoss_Update, D_edata_800CC01C, 20000.0f, 0, 0, 39, 1, 0.0f, 0 }, /* OBJ_ACTOR_199 */ {(void*) Andross_80188448, 1, (ObjectFunc) Andross_801880E4, D_edata_800CBF34, 20000.0f, 0, 0, 39, 1, 0.0f, 0 }, - /* OBJ_ACTOR_200 */ {(void*) func_enmy2_80074FF0, 1, (ObjectFunc) func_enmy2_80072594, D_edata_800CBF34, 2000.0f, 0, 1, 39, 0, 0.0f, 1 }, - /* OBJ_ACTOR_201 */ {(void*) func_edisplay_800598E8, 1, (ObjectFunc) func_enmy2_8006AC08, D_ME_602F684, 100.0f, 0, 1, 39, 0, 1.0f, 1 }, - /* OBJ_ACTOR_202 */ {(void*) func_edisplay_80059A24, 1, (ObjectFunc) func_enmy2_8006AD18, D_ME_602F6A0, 100.0f, 0, 1, 39, 0, 180.0f, 1 }, - /* OBJ_ACTOR_203 */ {(void*) SectorX_8018F884, 1, (ObjectFunc) SectorX_8018F330, D_edata_800CBF34, 1000.0f, 0, 0, 39, 0, 0.0f, 0 }, - /* OBJ_ACTOR_204 */ {(void*) SectorY_801A4CB0, 1, (ObjectFunc) SectorY_801A3BD4, D_SY_603405C, 1000.0f, 0, 0, 39, 0, 1.0f, 1 }, + /* OBJ_ACTOR_EVENT */ {(void*) ActorEvent_Draw, 1, (ObjectFunc) ActorEvent_Update, D_edata_800CBF34, 2000.0f, 0, 1, 39, 0, 0.0f, 1 }, + /* OBJ_ACTOR_201 */ {(void*) Actor201_Draw, 1, (ObjectFunc) Actor201_Update, D_ME_602F684, 100.0f, 0, 1, 39, 0, 1.0f, 1 }, + /* OBJ_ACTOR_202 */ {(void*) Actor202_Draw, 1, (ObjectFunc) Actor202_Update, D_ME_602F6A0, 100.0f, 0, 1, 39, 0, 180.0f, 1 }, + /* OBJ_ACTOR_SLIPPY_SX */ {(void*) SectorX_8018F884, 1, (ObjectFunc) SectorX_8018F330, D_edata_800CBF34, 1000.0f, 0, 0, 39, 0, 0.0f, 0 }, + /* OBJ_ACTOR_204 */ {(void*) SectorY_Actor204_Draw, 1, (ObjectFunc) SectorY_Actor204_Update, D_SY_603405C, 1000.0f, 0, 0, 39, 0, 1.0f, 1 }, /* OBJ_ACTOR_205 */ {(void*) Macbeth_801A12C4, 1, (ObjectFunc) Macbeth_8019C778, D_MA_60359C8, 20000.0f, 0, 0, 40, 1, 0.0f, 0 }, /* OBJ_ACTOR_206 */ {(void*) Macbeth_801A12C4, 1, (ObjectFunc) Macbeth_801AC438, D_MA_6035A48, 20000.0f, 0, 0, 40, 1, 0.0f, 0 }, /* OBJ_ACTOR_207 */ {(void*) Macbeth_801AC294, 2, (ObjectFunc) Macbeth_801A7E7C, D_MA_603677C, 20000.0f, 0, 0, 40, 1, 0.0f, 0 }, @@ -326,10 +326,10 @@ ObjectInfo D_edata_800CC124[0x190] = { /* OBJ_ACTOR_231 */ {(void*) Titania_8018BE84, 1, (ObjectFunc) Titania_8018B9D0, D_TI_6006858, 0.0f, 0, 0, 39, 1, 0.0f, 1 }, /* OBJ_ACTOR_232 */ {(void*) Titania_8018B6AC, 1, (ObjectFunc) Titania_8018B268, D_TI_6006890, 0.0f, 0, 0, 39, 1, 20.0f, 1 }, /* OBJ_ACTOR_233 */ {(void*) Titania_8018A1C0, 1, (ObjectFunc) Titania_80189CC8, D_TI_60068F0, 200.0f, 0, 0, 39, 1, 1.0f, 1 }, - /* OBJ_ACTOR_234 */ {(void*) func_enmy2_80077218, 1, (ObjectFunc) func_enmy2_800771CC, D_edata_800CBF34, 2000.0f, 0, 0, 39, 0, 0.0f, 5 }, + /* OBJ_ACTOR_234 */ {(void*) Actor234_Draw, 1, (ObjectFunc) Actor234_Update, D_edata_800CBF34, 2000.0f, 0, 0, 39, 0, 0.0f, 5 }, /* OBJ_ACTOR_235 */ {(void*) Zoness_80190430, 2, (ObjectFunc) Zoness_801904CC, D_ZO_602C294, 1000.0f, 0, 1, 40, 0, 1.0f, 1 }, /* OBJ_ACTOR_236 */ {(void*) Zoness_80190F08, 1, (ObjectFunc) Zoness_80190A00, D_ZO_602BC58, 5000.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_ACTOR_237 */ {(void*) func_enmy2_8006A978, 1, (ObjectFunc) func_enmy2_8006A96C, D_edata_800CBF34, 200.0f, 0, 0, 40, 0, 0.0f, 2 }, + /* OBJ_ACTOR_237 */ {(void*) Actor237_Draw, 1, (ObjectFunc) Actor237_Update, D_edata_800CBF34, 200.0f, 0, 0, 40, 0, 0.0f, 2 }, /* OBJ_ACTOR_238 */ {(void*) Zoness_801914C4, 2, (ObjectFunc) Zoness_80191010, D_edata_800CBE8C, 200.0f, 0, 1, 40, 0, 1.0f, 1 }, /* OBJ_ACTOR_239 */ {(void*) NULL, 1, (ObjectFunc) NULL, D_edata_800CBF34, 1000.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJ_ACTOR_240 */ {(void*) Zoness_80191B4C, 1, (ObjectFunc) Zoness_80191680, D_edata_800CBE8C, 1500.0f, 0, 1, 40, 0, 20.0f, 0 }, @@ -383,7 +383,7 @@ ObjectInfo D_edata_800CC124[0x190] = { /* OBJ_ACTOR_288 */ {(void*) NULL, 1, (ObjectFunc) Andross_801893B8, D_edata_800CBF34, 1000.0f, 0, 0, 20, 1, 0.0f, 0 }, /* OBJ_ACTOR_289 */ {(void*) func_edata_800596B0, 1, (ObjectFunc) Andross_80189470, D_edata_800CBF34, 1000.0f, 0, 0, 20, 1, 0.0f, 0 }, /* OBJ_ACTOR_290 */ {(void*) NULL, 1, (ObjectFunc) Andross_8018933C, D_edata_800CBF34, 1000.0f, 0, 0, 20, 0, 0.0f, 0 }, - /* OBJ_ACTOR_291 */ {(void*) func_enmy_80067874, 1, (ObjectFunc) func_enmy_8006753C, D_edata_800CBEA8, 1000.0f, 0, 0, 0, 0, 1.0f, 0 }, + /* OBJ_ACTOR_SUPPLIES */ {(void*) ActorSupplies_Draw, 1, (ObjectFunc) ActorSupplies_Update, D_edata_800CBEA8, 1000.0f, 0, 0, 0, 0, 1.0f, 0 }, /* OBJ_BOSS_292 */ {(void*) Corneria_8018AA74, 2, (ObjectFunc) Corneria_80189058, D_CO_603E620, 20000.0f, 0, 0, 40, 1, 0.0f, 10 }, /* OBJ_BOSS_293 */ {(void*) Corneria_8018ECAC, 1, (ObjectFunc) Corneria_8018C19C, D_CO_603E840, 20000.0f, 0, 0, 40, 0, 0.0f, 10 }, /* OBJ_BOSS_294 */ {(void*) Corneria_8018ED78, 1, (ObjectFunc) Corneria_8018DDAC, D_CO_603E714, 20000.0f, 0, 0, 40, 0, 0.0f, 10 }, @@ -391,8 +391,8 @@ ObjectInfo D_edata_800CC124[0x190] = { /* OBJ_BOSS_296 */ {(void*) Corneria_8018EF90, 1, (ObjectFunc) Corneria_8018E76C, D_CO_603E7C4, 20000.0f, 0, 0, 40, 0, 0.0f, 10 }, /* OBJ_BOSS_297 */ {(void*) Meteo_8018BACC, 1, (ObjectFunc) Meteo_8018978C, D_ME_602F75C, 20000.0f, 0, 0, 40, 0, 0.0f, 10 }, /* OBJ_BOSS_298 */ {(void*) Meteo_801887D0, 1, (ObjectFunc) Meteo_80188344, D_ME_602FA50, 20000.0f, 0, 0, 40, 0, 0.0f, 10 }, - /* OBJ_BOSS_299 */ {(void*) func_boss_80042FC4, 2, (ObjectFunc) func_boss_80042FB8, D_edata_800CBF34, 20000.0f, 0, 0, 40, 0, 0.0f, 10 }, - /* OBJ_BOSS_300 */ {(void*) func_boss_80042FE8, 1, (ObjectFunc) func_boss_80042FDC, D_edata_800CBF34, 20000.0f, 0, 0, 40, 0, 0.0f, 10 }, + /* OBJ_BOSS_299 */ {(void*) Boss299_Draw, 2, (ObjectFunc) Boss299_Update, D_edata_800CBF34, 20000.0f, 0, 0, 40, 0, 0.0f, 10 }, + /* OBJ_BOSS_300 */ {(void*) Boss300_Draw, 1, (ObjectFunc) Boss300_Update, D_edata_800CBF34, 20000.0f, 0, 0, 40, 0, 0.0f, 10 }, /* OBJ_BOSS_301 */ {(void*) Aquas_801BEC5C, 1, (ObjectFunc) Aquas_801BEC50, D_AQ_6030B10, 0.0f, 0, 0, 40, 0, 0.0f, 10 }, /* OBJ_BOSS_A6 */ {(void*) Area6_8018C54C, 1, (ObjectFunc) Area6_80187944, D_A6_6028454, 2000.0f, 0, 0, 40, 0, 0.0f, 10 }, /* OBJ_BOSS_303 */ {(void*) SectorX_80193434, 2, (ObjectFunc) SectorX_80190078, D_SX_6032550, 20000.0f, 0, 0, 20, 0, 0.0f, 10 }, @@ -414,12 +414,12 @@ ObjectInfo D_edata_800CC124[0x190] = { /* OBJ_BOSS_319 */ {(void*) Venom1_801985E4, 1, (ObjectFunc) Venom1_80194398,D_VE1_8019A9B8, 3000.0f, 0, 0, 40, 1, 0.0f, 10 }, /* OBJ_BOSS_320 */ {(void*) Andross_801928C8, 2, (ObjectFunc) Andross_8018DBF0, D_ANDROSS_C038DC0, 10000.0f, 0, 0, 40, 0, 0.0f, 10 }, /* OBJ_BOSS_321 */ {(void*) Andross_8018B8C0, 1, (ObjectFunc) Andross_80189B70, D_ANDROSS_C038F24, 10000.0f, 0, 0, 40, 0, 0.0f, 10 }, - /* OBJ_ITEM_LASERS */ {(void*) func_edisplay_8005CC9C, 1, (ObjectFunc) func_enmy_80067F6C, D_edata_800CBFA8, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_ITEM_CHECKPOINT */ {(void*) func_edisplay_8005C5F0, 1, (ObjectFunc) func_enmy_80068914, D_edata_800CBF38, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_ITEM_SILVER_RING */ {(void*) func_edisplay_8005C900, 1, (ObjectFunc) func_enmy_80068020, D_edata_800CBF54, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_ITEM_SILVER_STAR */ {(void*) func_edisplay_8005C9C0, 1, (ObjectFunc) func_enmy_800685D8, D_edata_800CBF54, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_ITEM_METEO_WARP */ {(void*) func_edisplay_8005CDA8, 1, (ObjectFunc) func_enmy_80068688, D_edata_800CBF70, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_ITEM_BOMB */ {(void*) func_edisplay_8005CB44, 1, (ObjectFunc) func_enmy_80067BEC, D_edata_800CBFC8, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_ITEM_LASERS */ {(void*) ItemLasers_Draw, 1, (ObjectFunc) ItemLasers_Update, D_edata_800CBFA8, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_ITEM_CHECKPOINT */ {(void*) ItemCheckpoint_Draw, 1, (ObjectFunc) ItemCheckpoint_Update, D_edata_800CBF38, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_ITEM_SILVER_RING */ {(void*) ItemSilverRing_Draw, 1, (ObjectFunc) ItemSupplyRing_Update, D_edata_800CBF54, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_ITEM_SILVER_STAR */ {(void*) ItemSilverStar_Draw, 1, (ObjectFunc) ItemSilverStar_Update, D_edata_800CBF54, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_ITEM_METEO_WARP */ {(void*) ItemMeteoWarp_Draw, 1, (ObjectFunc) ItemMeteoWarp_Update, D_edata_800CBF70, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_ITEM_BOMB */ {(void*) ItemBomb_Draw, 1, (ObjectFunc) ItemPickup_Update, D_edata_800CBFC8, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJ_ITEM_328 */ {(void*) NULL, 1, (ObjectFunc) func_enmy_80068C88, D_edata_800CBF8C, 1500.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJ_ITEM_329 */ {(void*) NULL, 1, (ObjectFunc) func_enmy_80068C88, D_edata_800CBF8C, 1500.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJ_ITEM_330 */ {(void*) NULL, 1, (ObjectFunc) func_enmy_80068C88, D_edata_800CBF8C, 1500.0f, 0, 0, 0, 0, 0.0f, 0 }, @@ -427,10 +427,10 @@ ObjectInfo D_edata_800CC124[0x190] = { /* OBJ_ITEM_332 */ {(void*) NULL, 1, (ObjectFunc) func_enmy_80068C88, D_edata_800CBF8C, 1500.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJ_ITEM_333 */ {(void*) NULL, 1, (ObjectFunc) func_enmy_80068C88, D_edata_800CBF8C, 1500.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJ_ITEM_334 */ {(void*) NULL, 1, (ObjectFunc) func_enmy_80068C48, D_edata_800CBF18, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_ITEM_1UP */ {(void*) D_1022120, 0, (ObjectFunc) func_enmy_80067B1C, D_edata_800CBE8C, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_ITEM_GOLD_RING */ {(void*) func_edisplay_8005CA80, 1, (ObjectFunc) func_enmy_800685F8, D_edata_800CBF54, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_ITEM_WING_REPAIR */ {(void*) D_arwing_3007650, 0, (ObjectFunc) func_enmy_80068618, D_edata_800CBFA8, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_ITEM_TRAINING_RING */ {(void*) gItemTrainingRingDL, 0, (ObjectFunc) Training_80198968, D_TR_6009CFC, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_ITEM_1UP */ {(void*) D_1022120, 0, (ObjectFunc) Item1up_Update, D_edata_800CBE8C, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_ITEM_GOLD_RING */ {(void*) ItemGoldRing_Draw, 1, (ObjectFunc) ItemGoldRing_Update, D_edata_800CBF54, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_ITEM_WING_REPAIR */ {(void*) D_arwing_3007650, 0, (ObjectFunc) ItemWingRepair_Update, D_edata_800CBFA8, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_ITEM_TRAINING_RING */ {(void*) gItemTrainingRingDL, 0, (ObjectFunc) Training_ItemRing_Update, D_TR_6009CFC, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJ_EFFECT_339 */ {(void*) func_effect_8007D55C, 1, (ObjectFunc) func_effect_8007D2F4, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 }, /* OBJ_EFFECT_340 */ {(void*) func_effect_8007D55C, 1, (ObjectFunc) func_effect_8007D748, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 }, /* OBJ_EFFECT_341 */ {(void*) func_effect_8007D55C, 1, (ObjectFunc) func_effect_8007D8A8, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 }, diff --git a/src/engine/fox_edisplay.c b/src/engine/fox_edisplay.c index a5bfcfe7..fa7bb842 100644 --- a/src/engine/fox_edisplay.c +++ b/src/engine/fox_edisplay.c @@ -59,7 +59,7 @@ void func_edisplay_80059850(Object_4C* obj4C) { void func_edisplay_800598DC(s32 arg0) { } -void func_edisplay_800598E8(Actor* actor) { +void Actor201_Draw(Actor* actor) { RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); gSPDisplayList(gMasterDisp++, D_MA_6025B50); RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); @@ -88,7 +88,7 @@ f32 D_edisplay_800CFA2C[] = { 1.0f, 1.0f, 0.95f, 0.9f, 0.85f, 0.8f, 0.75f, 0.7f, 0.65f, 0.6f, }; -void func_edisplay_80059A24(Actor* actor) { +void Actor202_Draw(Actor* actor) { Vec3f sp30[30]; f32 temp = D_edisplay_800CF9B0[actor->unk_0B6] - 114.0f; @@ -98,7 +98,7 @@ void func_edisplay_80059A24(Actor* actor) { Animation_DrawSkeleton(1, D_ME_601E9D0, sp30, NULL, func_edisplay_800599A4, &actor->index, &gIdentityMatrix); } -void func_edisplay_80059AEC(Object_80* obj80) { +void Obj39_Draw(Object_80* obj80) { gSPDisplayList(gMasterDisp++, D_ME_601AE40); } @@ -114,11 +114,11 @@ void func_edisplay_80059B20(Object_80* obj80) { void func_edisplay_80059BB0(void* arg0) { } -void func_edisplay_80059BBC(Object_80* obj80) { +void Obj42_Draw(Object_80* obj80) { gSPDisplayList(gMasterDisp++, D_CO_6023AC0); } -void func_edisplay_80059BF0(Actor* actor) { +void Actor196_Draw(Actor* actor) { if (actor->unk_0B6 != 0) { gSPDisplayList(gMasterDisp++, D_CO_6032BC0); } @@ -169,13 +169,13 @@ void func_edisplay_80059C40(Object_4C* obj4C) { RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } -void func_edisplay_80059F68(Item* item) { +void func_edisplay_80059F68(Object_80* obj80) { Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -95.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_CO_602DA20); } -void func_edisplay_80059FDC(Item* item) { +void func_edisplay_80059FDC(Object_80* obj80) { gSPDisplayList(gMasterDisp++, D_CO_6035DA0); } @@ -236,7 +236,7 @@ Gfx* D_edisplay_800CFC64[] = { D_AQ_6023940, D_AQ_6023D70, D_AQ_60249C0, D_AQ_60 Gfx* D_edisplay_800CFC7C[] = { D_ZO_601B570, D_ZO_601B710, D_ZO_60209B0, D_ZO_6020B70, D_ZO_6020D50, D_ZO_601B8F0, D_ZO_601B3B0, D_ZO_601B1C0, D_ZO_6011660 }; -void func_edisplay_8005A094(Actor* actor) { +void Actor189_Draw(Actor* actor) { switch (actor->state) { case 0: Matrix_Translate(gGfxMatrix, 18.0f, 15.0f, -15.0f, 1); @@ -291,11 +291,11 @@ void func_edisplay_8005A094(Actor* actor) { } else { if (gBosses[0].fwork[3] < 4800.0f) { RCP_SetupDL(&gMasterDisp, 0x1E); - gDPSetFogColor(gMasterDisp++, 0x40, 0x20, 0x20, gFogAlpha); + gDPSetFogColor(gMasterDisp++, 64, 32, 32, gFogAlpha); gSPFogPosition(gMasterDisp++, gFogNear, gFogFar); } else { RCP_SetupDL(&gMasterDisp, 0x1E); - gDPSetFogColor(gMasterDisp++, 0x10, 0x10, 0x10, gFogAlpha); + gDPSetFogColor(gMasterDisp++, 16, 16, 16, gFogAlpha); gSPFogPosition(gMasterDisp++, gFogNear, gFogFar); } Graphics_SetScaleMtx(actor->scale); @@ -413,7 +413,7 @@ void func_edisplay_8005A094(Actor* actor) { break; default: if (actor->state > 9) { - if (actor->state == 0x24) { + if (actor->state == 36) { gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); } gSPDisplayList(gMasterDisp++, D_edisplay_800CFA54[actor->state - 10]); @@ -635,8 +635,8 @@ void func_edisplay_8005BAB4(ObjectId objId, s32 index) { RCP_SetupDL(&gMasterDisp, 0x40); break; case OBJ_ACTOR_195: - case OBJ_ACTOR_198: - case OBJ_ACTOR_200: + case OBJ_ACTOR_TEAM_BOSS: + case OBJ_ACTOR_EVENT: switch (gActors[index].unk_0B4) { case 3: Matrix_Scale(gGfxMatrix, 2.3f, 0.0f, 2.3f, 1); @@ -683,7 +683,7 @@ void func_edisplay_8005BAB4(ObjectId objId, s32 index) { case OBJ_BOSS_295: case OBJ_BOSS_296: COS_DEG(gBosses[index].obj.rot.z); - if (D_80161A88 == 2) { + if (D_ctx_80161A88 == 2) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 90); } else { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 150); @@ -760,7 +760,7 @@ void func_edisplay_8005BAB4(ObjectId objId, s32 index) { } } -void func_edisplay_8005C5F0(Item* item) { +void ItemCheckpoint_Draw(Item* item) { s32 i; if ((gGameFrameCount & 0x18) && (item->state == 0)) { @@ -791,7 +791,7 @@ void func_edisplay_8005C5F0(Item* item) { gSPClearGeometryMode(gMasterDisp++, G_TEXTURE_GEN); } -void func_edisplay_8005C900(Item* item) { +void ItemSilverRing_Draw(Item* item) { RCP_SetupDL(&gMasterDisp, 0x1D); gSPTexture(gMasterDisp++, 3000, 0, 0, G_TX_RENDERTILE, G_ON); gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR); @@ -800,7 +800,7 @@ void func_edisplay_8005C900(Item* item) { gSPClearGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR); } -void func_edisplay_8005C9C0(Item* item) { +void ItemSilverStar_Draw(Item* item) { RCP_SetupDL(&gMasterDisp, 0x1D); gSPTexture(gMasterDisp++, 3000, 0, 0, G_TX_RENDERTILE, G_ON); gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR); @@ -809,7 +809,7 @@ void func_edisplay_8005C9C0(Item* item) { gSPClearGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR); } -void func_edisplay_8005CA80(Item* item) { +void ItemGoldRing_Draw(Item* item) { RCP_SetupDL(&gMasterDisp, 0x1D); gSPTexture(gMasterDisp++, 1900, 1700, 0, G_TX_RENDERTILE, G_ON); gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR); @@ -818,7 +818,7 @@ void func_edisplay_8005CA80(Item* item) { gSPClearGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR); } -void func_edisplay_8005CB44(Item* item) { +void ItemBomb_Draw(Item* item) { if (gCurrentLevel == LEVEL_AQUAS) { Graphics_SetScaleMtx(item->scale); gSPDisplayList(gMasterDisp++, D_blue_marine_3005980); @@ -835,7 +835,7 @@ void func_edisplay_8005CB44(Item* item) { } } -void func_edisplay_8005CC9C(Item* item) { +void ItemLasers_Draw(Item* item) { Graphics_SetScaleMtx(item->scale * 0.1f); RCP_SetupDL(&gMasterDisp, 0x1D); gSPTexture(gMasterDisp++, 2000, 2000, 0, G_TX_RENDERTILE, G_ON); @@ -847,7 +847,7 @@ void func_edisplay_8005CC9C(Item* item) { gSPDisplayList(gMasterDisp++, D_101A8E0); } -void func_edisplay_8005CDA8(Item* item) { +void ItemMeteoWarp_Draw(Item* item) { s32 i; item->obj.rot.y = (Math_Atan2F(gPlayer[gPlayerNum].camEye.x - item->obj.pos.x, @@ -941,9 +941,9 @@ void func_edisplay_8005D3CC(Object* obj, f32 xRot, f32 yRot, f32 zRot, s32 drawT } void Object_80_Draw(Object_80* obj80, s32 arg1) { - obj80->obj.pos.y += D_ctx_8017847C; + obj80->obj.pos.y += gCameraShakeY; func_edisplay_8005D008(&obj80->obj, obj80->info.drawType); - obj80->obj.pos.y -= D_ctx_8017847C; + obj80->obj.pos.y -= gCameraShakeY; if (obj80->info.drawType == 0) { if ((obj80->obj.id == OBJ_80_19) || (obj80->obj.id == OBJ_80_55) || (obj80->obj.id == OBJ_80_9) || (obj80->obj.id == OBJ_80_50)) { @@ -978,9 +978,9 @@ void Object_80_Draw(Object_80* obj80, s32 arg1) { void Object_4C_Draw(Object_4C* obj4C, s32 arg1) { if (arg1 >= 0) { - obj4C->obj.pos.y += D_ctx_8017847C; + obj4C->obj.pos.y += gCameraShakeY; func_edisplay_8005D008(&obj4C->obj, 0); - obj4C->obj.pos.y -= D_ctx_8017847C; + obj4C->obj.pos.y -= gCameraShakeY; if (obj4C->info.drawType == 0) { gSPDisplayList(gMasterDisp++, obj4C->info.dList); } else if (obj4C->info.draw != NULL) { @@ -989,26 +989,26 @@ void Object_4C_Draw(Object_4C* obj4C, s32 arg1) { } } -void Actor_Draw2(Actor* actor) { +void Actor_DrawOnRails(Actor* actor) { Vec3f sp34 = { 0.0f, 0.0f, 0.0f }; if (actor->info.draw != NULL) { switch (actor->obj.id) { case OBJ_ACTOR_194: - func_enmy2_8006B74C(actor); + Actor194_Draw(actor); return; case OBJ_ACTOR_236: Zoness_80190F08(actor); return; } - if ((actor->obj.id == OBJ_ACTOR_200) && (actor->unk_0B4 == 200)) { - func_enmy2_8006B74C(actor); + if ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == EINFO_200)) { + Actor194_Draw(actor); } else { if (actor->info.unk_19 != 0) { - actor->obj.pos.y += D_ctx_8017847C; + actor->obj.pos.y += gCameraShakeY; func_edisplay_8005D008(&actor->obj, actor->info.drawType); - actor->obj.pos.y -= D_ctx_8017847C; - } else if ((actor->obj.id == OBJ_ACTOR_200) && (actor->unk_0B4 != 31)) { + actor->obj.pos.y -= gCameraShakeY; + } else if ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 != EINFO_31)) { func_edisplay_8005D3CC(&actor->obj, actor->vwork[29].x, actor->vwork[29].y, actor->vwork[29].z + actor->unk_0F4.z, actor->info.drawType); } else { @@ -1020,7 +1020,8 @@ void Actor_Draw2(Actor* actor) { } else { actor->info.draw(&actor->obj); func_edisplay_8005F1EC(actor->sfxSource); - if (((actor->obj.id == OBJ_ACTOR_198) || ((actor->obj.id == OBJ_ACTOR_203) && (actor->unk_0B6 > 0))) && + if (((actor->obj.id == OBJ_ACTOR_TEAM_BOSS) || + ((actor->obj.id == OBJ_ACTOR_SLIPPY_SX) && (actor->unk_0B6 > 0))) && (D_display_80161410 > 0)) { Matrix_MultVec3f(gGfxMatrix, &sp34, &D_ctx_80177E98[actor->aiType]); } @@ -1036,7 +1037,7 @@ void Actor_Draw2(Actor* actor) { } } -void Actor_Draw1(Actor* actor) { +void Actor_DrawAllRange(Actor* actor) { s32 var_v1; Vec3f sp50 = { 0.0f, 0.0f, 0.0f }; f32 var_fa1; @@ -1054,7 +1055,7 @@ void Actor_Draw1(Actor* actor) { Matrix_Pop(&gGfxMatrix); var_fv0 = 0.0f; var_fv1 = -12000.0f; - if ((actor->obj.id == OBJ_ACTOR_197) && (actor->aiType >= 100)) { + if ((actor->obj.id == OBJ_ACTOR_ALLRANGE) && (actor->aiType >= AI360_GREAT_FOX)) { var_fv0 = 1000.0f; var_fv1 = -25000.0f; } @@ -1066,8 +1067,8 @@ void Actor_Draw1(Actor* actor) { Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, 1); actor->info.draw(&actor->obj); D_edisplay_801615EC = 1; - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) && (actor->obj.id == OBJ_ACTOR_197) && - (actor->aiType == 200)) { + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) && (actor->obj.id == OBJ_ACTOR_ALLRANGE) && + (actor->aiType == AI360_MISSILE)) { D_ctx_80177E98[0] = D_edisplay_801615E0; } } @@ -1077,7 +1078,7 @@ void Actor_Draw1(Actor* actor) { Matrix_Translate(gGfxMatrix, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 1); Matrix_MultVec3f(gGfxMatrix, &sp50, &D_edisplay_801615E0); if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_2) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_0) || - ((actor->obj.id == OBJ_ACTOR_197) && (actor->aiType >= 100)) || + ((actor->obj.id == OBJ_ACTOR_ALLRANGE) && (actor->aiType >= AI360_GREAT_FOX)) || ((actor->obj.id == OBJ_ACTOR_195) && (actor->info.bonus != 0))) { var_ft5 = var_fv0 = 3000.0f; var_fv1 = -29000.0f; @@ -1099,9 +1100,10 @@ void Actor_Draw1(Actor* actor) { actor->info.draw(&actor->obj); D_edisplay_801615EC = 1; if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) && - (((actor->obj.id == OBJ_ACTOR_197) && - ((actor->aiType < 4) || (actor->aiType == 8) || (actor->aiType == 9))) || - (actor->obj.id == OBJ_ACTOR_198))) { + (((actor->obj.id == OBJ_ACTOR_ALLRANGE) && + ((actor->aiType <= AI360_PEPPY) || (actor->aiType == AI360_KATT) || + (actor->aiType == AI360_BILL))) || + (actor->obj.id == OBJ_ACTOR_TEAM_BOSS))) { D_ctx_80177E98[actor->aiType] = D_edisplay_801615E0; } } @@ -1137,9 +1139,9 @@ void Boss_Draw(Boss* boss, s32 arg1) { Vec3f sp30 = { 0.0f, 0.0f, 0.0f }; if (boss->info.unk_19 != 0) { - boss->obj.pos.y += boss->unk_068 + D_ctx_8017847C; + boss->obj.pos.y += boss->unk_068 + gCameraShakeY; func_edisplay_8005D1F0(&boss->obj, boss->info.drawType); - boss->obj.pos.y -= boss->unk_068 + D_ctx_8017847C; + boss->obj.pos.y -= boss->unk_068 + gCameraShakeY; } else { func_edisplay_8005D1F0(&boss->obj, boss->info.drawType); } @@ -1190,16 +1192,16 @@ void Boss_Draw(Boss* boss, s32 arg1) { } } -void Effect_Draw1(Effect* effect, s32 arg1) { +void Effect_DrawOnRails(Effect* effect, s32 arg1) { if ((arg1 < 0) && (effect->obj.pos.y < 7.0f)) { return; } if ((effect->obj.id == OBJ_EFFECT_353) || (effect->obj.id == OBJ_EFFECT_369)) { func_edisplay_8005D3CC(&effect->obj, effect->unk_60.x, effect->unk_60.y, effect->unk_60.z, 0); } else if (effect->info.unk_14 == -1) { - effect->obj.pos.y += D_ctx_8017847C; + effect->obj.pos.y += gCameraShakeY; func_edisplay_8005D008(&effect->obj, 0); - effect->obj.pos.y -= D_ctx_8017847C; + effect->obj.pos.y -= gCameraShakeY; } else { func_edisplay_8005D008(&effect->obj, 0); } @@ -1208,14 +1210,14 @@ void Effect_Draw1(Effect* effect, s32 arg1) { } } -void Effect_Draw2(Effect* effect) { +void Effect_DrawAllRange(Effect* effect) { Vec3f sp4C = { 0.0f, 0.0f, 0.0f }; Vec3f sp40; f32 var_fv0; u8 sp3B = 0; if (effect->info.unk_14 == -1) { - Matrix_Translate(gGfxMatrix, effect->obj.pos.x, effect->obj.pos.y + D_ctx_8017847C, + Matrix_Translate(gGfxMatrix, effect->obj.pos.x, effect->obj.pos.y + gCameraShakeY, effect->obj.pos.z + D_ctx_80177D20, 1); } else { Matrix_Translate(gGfxMatrix, effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z + D_ctx_80177D20, 1); @@ -1291,7 +1293,7 @@ void func_edisplay_8005EA24(Actor* actor) { Matrix_RotateY(gGfxMatrix, (actor->obj.rot.y + 180.0f) * M_DTOR, 1); Matrix_RotateZ(gGfxMatrix, actor->obj.rot.z * M_DTOR, 1); Matrix_SetGfxMtx(&gMasterDisp); - if (actor->aiType < 4) { + if (actor->aiType <= AI360_PEPPY) { Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 30.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1032780); @@ -1301,7 +1303,7 @@ void func_edisplay_8005EA24(Actor* actor) { } else { gSPDisplayList(gMasterDisp++, D_KA_600DBC0); } - } else if ((actor->aiType < 8) || (gCurrentLevel != LEVEL_FORTUNA)) { + } else if ((actor->aiType < AI360_KATT) || (gCurrentLevel != LEVEL_FORTUNA)) { gSPDisplayList(gMasterDisp++, D_STAR_WOLF_F014310); } else if (gCurrentLevel == LEVEL_FORTUNA) { gSPDisplayList(gMasterDisp++, D_FO_6009F90); @@ -1313,7 +1315,7 @@ void func_edisplay_8005EA24(Actor* actor) { void func_edisplay_8005ECD8(s32 index, Object* obj) { RCP_SetupDL(&gMasterDisp, 0x42); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, 180); - if (obj->id == OBJ_ACTOR_197) { + if (obj->id == OBJ_ACTOR_ALLRANGE) { func_edisplay_8005EA24(&gActors[index]); } else { switch (obj->id) { @@ -1327,14 +1329,14 @@ void func_edisplay_8005ECD8(s32 index, Object* obj) { obj->pos.z + D_ctx_80177D20, 1); break; case OBJ_BOSS_316: - Matrix_Translate(gGfxMatrix, obj->pos.x, gGroundLevel + 2.0f + D_ctx_8017847C, obj->pos.z, 1); + Matrix_Translate(gGfxMatrix, obj->pos.x, gGroundLevel + 2.0f + gCameraShakeY, obj->pos.z, 1); break; default: Matrix_Translate(gGfxMatrix, obj->pos.x, gGroundLevel + 2.0f, obj->pos.z + D_ctx_80177D20, 1); break; } - if ((D_ctx_801784AC != 4) || (obj->id == OBJ_ACTOR_200) || (obj->id == OBJ_ACTOR_195) || - (obj->id == OBJ_ACTOR_198)) { + if ((D_ctx_801784AC != 4) || (obj->id == OBJ_ACTOR_EVENT) || (obj->id == OBJ_ACTOR_195) || + (obj->id == OBJ_ACTOR_TEAM_BOSS)) { Matrix_Scale(gGfxMatrix, 1.0f, 0.0f, 1.0f, 1); Matrix_RotateY(gGfxMatrix, obj->rot.y * M_DTOR, 1); } @@ -1348,7 +1350,7 @@ void func_edisplay_8005ECD8(s32 index, Object* obj) { } } -void func_edisplay_8005F030(f32* sfxSrc) { +void Object_ClampSfxSource(f32* sfxSrc) { if (sfxSrc[0] > 5000.0f) { sfxSrc[0] = 5000.0f; } @@ -1378,15 +1380,15 @@ void func_edisplay_8005F0E8(f32* sfxSrc, Vec3f* pos) { } else { Matrix_RotateY(gCalcMatrix, gPlayer[0].unk_058, 0); Matrix_RotateX(gCalcMatrix, gPlayer[0].unk_05C, 1); - sp2C.x = pos->x - D_ctx_801779D8.x; - sp2C.y = pos->y - D_ctx_801779D8.y; - sp2C.z = pos->z + D_ctx_80177D20 - D_ctx_801779D8.z; + sp2C.x = pos->x - gPlayerCamEye.x; + sp2C.y = pos->y - gPlayerCamEye.y; + sp2C.z = pos->z + D_ctx_80177D20 - gPlayerCamEye.z; Matrix_MultVec3f(gCalcMatrix, &sp2C, &sp20); sfxSrc[0] = sp20.x; sfxSrc[1] = sp20.y; sfxSrc[2] = sp20.z; } - func_edisplay_8005F030(sfxSrc); + Object_ClampSfxSource(sfxSrc); } void func_edisplay_8005F1EC(f32* sfxSrc) { @@ -1402,7 +1404,7 @@ void func_edisplay_8005F1EC(f32* sfxSrc) { sfxSrc[1] = sp20.y; sfxSrc[2] = sp20.z; } - func_edisplay_8005F030(sfxSrc); + Object_ClampSfxSource(sfxSrc); } void func_edisplay_8005F290(f32* sfxSrc, Vec3f* pos) { @@ -1413,7 +1415,7 @@ void func_edisplay_8005F290(f32* sfxSrc, Vec3f* pos) { sfxSrc[1] = pos->y; sfxSrc[2] = pos->z; } - func_edisplay_8005F030(sfxSrc); + Object_ClampSfxSource(sfxSrc); } void Object_58_Draw(Object_58* obj58) { @@ -1438,7 +1440,7 @@ void Object_58_Draw(Object_58* obj58) { sp38 = 0.9f; } if ((gLevelType == LEVELTYPE_PLANET) || (gCurrentLevel == LEVEL_BOLSE)) { - Matrix_Translate(gGfxMatrix, obj58->obj.pos.x, obj58->obj.pos.y + D_ctx_8017847C, obj58->obj.pos.z, 1); + Matrix_Translate(gGfxMatrix, obj58->obj.pos.x, obj58->obj.pos.y + gCameraShakeY, obj58->obj.pos.z, 1); } else { Matrix_Translate(gGfxMatrix, obj58->obj.pos.x, obj58->obj.pos.y, obj58->obj.pos.z, 1); } @@ -1636,7 +1638,7 @@ void Object_DrawAll(s32 arg0) { func_edisplay_8005F670(&actor->obj.pos); } func_edisplay_800597C0(arg0); - Actor_Draw2(actor); + Actor_DrawOnRails(actor); Matrix_Pop(&gGfxMatrix); if (actor->unk_0C9 != 0) { Matrix_Push(&gGfxMatrix); @@ -1646,7 +1648,7 @@ void Object_DrawAll(s32 arg0) { break; case LEVELMODE_ALL_RANGE: Matrix_Push(&gGfxMatrix); - Actor_Draw1(actor); + Actor_DrawAllRange(actor); Matrix_Pop(&gGfxMatrix); if ((actor->unk_0C9 != 0) && (D_edisplay_801615EC != 0) && ((D_edisplay_801615E0.z > -4000.0f) || (gCurrentLevel != LEVEL_KATINA))) { @@ -1674,7 +1676,7 @@ void Object_DrawAll(s32 arg0) { gAmbientB); } -void func_edisplay_8006046C(s32 arg0) { +void Effect_DrawAll(s32 arg0) { s32 i; Boss* boss; Effect* effect; @@ -1688,11 +1690,11 @@ void func_edisplay_8006046C(s32 arg0) { } if (gLevelMode == LEVELMODE_ALL_RANGE) { Matrix_Push(&gGfxMatrix); - Effect_Draw2(effect); + Effect_DrawAllRange(effect); Matrix_Pop(&gGfxMatrix); } else { Matrix_Push(&gGfxMatrix); - Effect_Draw1(effect, arg0); + Effect_DrawOnRails(effect, arg0); Matrix_Pop(&gGfxMatrix); func_edisplay_8005F1EC(effect->sfxSource); if (effect->obj.id == OBJ_EFFECT_374) { @@ -1718,10 +1720,10 @@ void func_edisplay_8006046C(s32 arg0) { } } -void func_edisplay_80060714(s32 arg0) { +void Object_Draw(s32 arg0) { D_display_80161410 = 1; Object_DrawAll(1); - if ((D_80161A88 == 2) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2)) { + if ((D_ctx_80161A88 == 2) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2)) { D_display_80161410 = -1; Lights_SetOneLight(&gMasterDisp, gLight1x, -1 * gLight1y, gLight1z, gLight1R, gLight1G, gLight1B, gAmbientR, gAmbientG, gAmbientB); @@ -1734,15 +1736,15 @@ void func_edisplay_80060714(s32 arg0) { } } -void func_edisplay_8006089C(u8 arg0) { +void Effect_Draw(u8 arg0) { if (arg0 == 0) { D_display_80161410 = 1; - func_edisplay_8006046C(1); - } else if ((D_80161A88 == 2) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2)) { + Effect_DrawAll(1); + } else if ((D_ctx_80161A88 == 2) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2)) { D_display_80161410 = -1; Matrix_Push(&gGfxMatrix); Matrix_Scale(gGfxMatrix, 1.0f, -1.0f, 1.0f, 1); - func_edisplay_8006046C(-1); + Effect_DrawAll(-1); Matrix_Pop(&gGfxMatrix); } D_display_80161410 = 1; @@ -1814,10 +1816,10 @@ void TexturedLine_Draw(void) { } } -void func_edisplay_80060D94(s32 arg0) { - TexturedLine* texLine = &gTexturedLines[arg0]; +void TexturedLine_DrawPath(s32 index) { + TexturedLine* texLine = &gTexturedLines[index]; - if (texLine->unk_2F == 0xFF) { + if (texLine->unk_2F == 255) { RCP_SetupDL(&gMasterDisp, 5); } else { RCP_SetupDL(&gMasterDisp, 0xE); diff --git a/src/engine/fox_effect.c b/src/engine/fox_effect.c index 5150e0db..c1c712ce 100644 --- a/src/engine/fox_effect.c +++ b/src/engine/fox_effect.c @@ -332,7 +332,7 @@ static f32 D_800D1534[][10] = { void func_effect_800780F8(Effect* effect) { s32 i; - if (effect->unk_4A >= 0xB) { + if (effect->unk_4A >= 11) { if (!((effect->index + gGameFrameCount) & 1)) { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 128, 128, 32); } else { @@ -512,7 +512,7 @@ void func_effect_80078D60(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scal effect->state = 2; } - effect->timer_50 = 0xE; + effect->timer_50 = 14; Object_SetInfo(&effect->info, effect->obj.id); } @@ -875,7 +875,7 @@ void func_effect_8007A28C(Effect* effect) { effect->obj.rot.y += 1.0f; Math_SmoothStepToF(&effect->scale2, effect->scale1, 0.05f, 1.5f, 0.001f); - if (effect->timer_50 >= 0xB) { + if (effect->timer_50 >= 11) { D_ctx_801779A8[0] = 60.0f; } if (effect->timer_50 == 48) { @@ -1034,7 +1034,7 @@ void func_effect_8007A994(Effect* effect) { } effect->unk_44 -= effect->unk_46; - if (effect->unk_44 < 0x15) { + if (effect->unk_44 <= 20) { Object_Kill(&effect->obj, effect->sfxSource); } effect->unk_4A++; @@ -1078,7 +1078,7 @@ void func_effect_8007AC0C(Effect* effect, f32 xPos, f32 unused_posY, f32 zPos, f effect->obj.pos.y = gGroundLevel; effect->obj.pos.z = zPos; - effect->unk_44 = 0xB4; + effect->unk_44 = 180; effect->scale2 = scale2; effect->scale1 = scale1; effect->obj.rot.y = yRot; @@ -1108,7 +1108,7 @@ void func_effect_8007AD58(Effect* effect, f32 xPos, f32 unused_posY, f32 zPos, f effect->obj.pos.y = gGroundLevel; effect->obj.pos.z = zPos; - effect->unk_44 = 0xB4; + effect->unk_44 = 180; effect->scale2 = scale2; effect->scale1 = scale1; effect->obj.rot.y = yRot; @@ -1193,7 +1193,7 @@ void func_effect_8007B180(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scal effect->obj.pos.y = yPos; effect->obj.pos.z = zPos; - effect->unk_44 = 0xFF; + effect->unk_44 = 255; effect->scale1 = scale1; Object_SetInfo(&effect->info, effect->obj.id); AUDIO_PLAY_SFX(0x1100000C, effect->sfxSource, 0); @@ -1438,12 +1438,12 @@ void func_effect_8007BB14(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scal effect->unk_48 = -effect->unk_48; } - effect->unk_4A = 0xB4; + effect->unk_4A = 180; effect->unk_46 = 8; if (scale2 > 15.0f) { effect->unk_46 = 5; - effect->unk_4A = 0x50; + effect->unk_4A = 80; } effect->scale2 = scale2 * 0.25f; @@ -1629,7 +1629,7 @@ void func_effect_8007C3B4(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 xVel effect->unk_4C = RAND_INT(12.0f); effect->obj.rot.z = RAND_FLOAT(360.0f); Object_SetInfo(&effect->info, effect->obj.id); - effect->unk_44 = 0xFF; + effect->unk_44 = 255; } void func_effect_8007C484(f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 scale2, s32 arg7) { @@ -1841,7 +1841,7 @@ void func_effect_8007CD7C(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scal if (Rand_ZeroOne() < 0.5f) { effect->unk_48 = -effect->unk_48; } - effect->unk_4A = 0xFF; + effect->unk_4A = 255; effect->scale2 = scale2; effect->obj.rot.z = RAND_FLOAT(360.0f); @@ -2009,7 +2009,7 @@ void func_effect_8007D2F4(Effect* effect) { D_ctx_80178370 = effect->obj.pos.x; D_ctx_80178374 = effect->obj.pos.y; D_ctx_80178378 = effect->obj.pos.z; - D_ctx_80178360 = 0xFF; + D_ctx_80178360 = 255; D_ctx_80178364 = 50; D_ctx_80178368 = 0; } @@ -2097,7 +2097,7 @@ void func_effect_8007D748(Effect* effect) { D_ctx_80178370 = effect->obj.pos.x; D_ctx_80178374 = effect->obj.pos.y; D_ctx_80178378 = effect->obj.pos.z; - D_ctx_80178360 = 0xFF; + D_ctx_80178360 = 255; D_ctx_80178364 = 50; D_ctx_80178368 = 0; } @@ -2188,7 +2188,7 @@ void func_effect_8007DB70(Effect* effect) { func_effect_8007D0E0(effect->obj.pos.x, effect->obj.pos.y + 30.0f, effect->obj.pos.z, 7.0f); func_effect_8007BFFC(effect->obj.pos.x, effect->obj.pos.y + 30.0f, effect->obj.pos.z, 0.0f, 0.0f, 0.0f, 4.0f, 5); - if ((effect->obj.pos.y < (gGroundLevel + 10.0f)) || (D_80161A88 != 2)) { + if ((effect->obj.pos.y < (gGroundLevel + 10.0f)) || (D_ctx_80161A88 != 2)) { func_beam_800365E4(effect->obj.pos.x, 3.0f, effect->obj.pos.z, effect->obj.pos.x, effect->obj.pos.z, 0.0f, 0.0f, 90.0f, 5.0f, 0, 0); break; @@ -2374,7 +2374,7 @@ void func_effect_8007E6B8(Effect* effect, u32 objId, f32 xPos, f32 yPos, f32 zPo effect->obj.pos.y = yPos; effect->obj.pos.z = zPos; - Object_SetInfo(&effect->info, objId & 0xFFFF); + Object_SetInfo(&effect->info, effect->obj.id); sp50 = Math_Atan2F(gPlayer[0].pos.x - xPos, gPlayer[0].unk_138 - zPos); temp_ft4 = sqrtf(SQ(gPlayer[0].pos.x - xPos) + SQ(gPlayer[0].unk_138 - zPos)); sp54 = -Math_Atan2F(gPlayer[0].pos.y - yPos, temp_ft4); @@ -2644,7 +2644,7 @@ void func_effect_8007F438(Effect* effect) { } if (effect->unk_46 == 0) { - effect->unk_46 = 0x1E; + effect->unk_46 = 30; effect->unk_44 += 1; effect->unk_44 &= 1; } else { @@ -2730,7 +2730,7 @@ void func_effect_8007F6B0(Effect* effect) { } else if (gCurrentLevel == LEVEL_FORTUNA) { func_effect_8007BC7C(effect->obj.pos.x + sin, yPos, effect->obj.pos.z + cos, 20.0f); } else if (gCurrentLevel == LEVEL_TITANIA) { - func_effect_8007A900(effect->obj.pos.x + sin, yPos, effect->obj.pos.z + cos, 10.0f, 0xFF, 0xF, 0); + func_effect_8007A900(effect->obj.pos.x + sin, yPos, effect->obj.pos.z + cos, 10.0f, 255, 15, 0); } } } @@ -2775,7 +2775,7 @@ void func_effect_8007F958(Effect* effect) { if (gCurrentLevel == LEVEL_FORTUNA) { func_effect_8007BC7C(effect->obj.pos.x + sin, yPos, effect->obj.pos.z + cos, 8.0f); } else if (gCurrentLevel == LEVEL_TITANIA) { - func_effect_8007A900(effect->obj.pos.x + sin, yPos, effect->obj.pos.z + cos, 8.0f, 0xFF, 0xF, 0); + func_effect_8007A900(effect->obj.pos.x + sin, yPos, effect->obj.pos.z + cos, 8.0f, 255, 15, 0); } } } @@ -2899,7 +2899,7 @@ void func_effect_8007FE88(Effect* effect) { } } else if (effect->obj.pos.y < gGroundLevel) { Object_Kill(&effect->obj, effect->sfxSource); - if (D_80161A88 != 2) { + if (D_ctx_80161A88 != 2) { effect->obj.pos.y = gGroundLevel; func_effect_8007D074(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 2.0f); } @@ -3030,7 +3030,7 @@ void func_effect_8008040C(Effect* effect) { } } else if (effect->obj.pos.y < gGroundLevel) { Object_Kill(&effect->obj, effect->sfxSource); - if (D_80161A88 != 2) { + if (D_ctx_80161A88 != 2) { effect->obj.pos.y = gGroundLevel; func_effect_8007D074(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 2.0f); } @@ -3093,9 +3093,9 @@ void func_effect_80080ACC(Effect* effect) { temp_ft2 = (((f32) effect->unk_44 / (f32) effect->unk_46) * 255.0f); effect->unk_48 = temp_ft2; if (temp_ft2 >= 256) { - effect->unk_48 = 0xFF; + effect->unk_48 = 255; } - if (effect->unk_48 < 0x20) { + if (effect->unk_48 < 32) { Object_Kill(&effect->obj, effect->sfxSource); } break; @@ -3147,11 +3147,11 @@ void func_effect_80080D04(Effect* effect) { switch (effect->unk_7A) { case 0: - if (effect->unk_44 != 0x40) { + if (effect->unk_44 != 64) { RCP_SetupDL(&gMasterDisp, effect->unk_44); } gSPDisplayList(gMasterDisp++, effect->unk_74); - if (effect->unk_44 != 0x40) { + if (effect->unk_44 != 64) { RCP_SetupDL(&gMasterDisp, 0x40); } break; @@ -3161,7 +3161,7 @@ void func_effect_80080D04(Effect* effect) { effect->unk_48 = effect->unk_46; } - if (effect->unk_44 != 0x40) { + if (effect->unk_44 != 64) { RCP_SetupDL(&gMasterDisp, effect->unk_44); } @@ -3177,7 +3177,7 @@ void func_effect_80080D04(Effect* effect) { gSPDisplayList(gMasterDisp++, effect->unk_74); } - if (effect->unk_44 != 0x40) { + if (effect->unk_44 != 64) { RCP_SetupDL(&gMasterDisp, 0x40); } break; @@ -3325,7 +3325,7 @@ void func_effect_8008165C(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scal switch (effect->state) { case 4: - effect->unk_4A = 0xFF; + effect->unk_4A = 255; effect->unk_46 = 1; break; @@ -3337,12 +3337,12 @@ void func_effect_8008165C(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scal effect->unk_46 = 5; effect->unk_44 = RAND_FLOAT_CENTERED(20.0f) * 1.5f; effect->info.unk_14 = 0; - effect->unk_4A = 0xFF; + effect->unk_4A = 255; break; case 6: - effect->unk_4A = 0xFF; - effect->unk_46 = 0xA; + effect->unk_4A = 255; + effect->unk_46 = 10; break; case 7: @@ -3575,7 +3575,7 @@ void func_effect_80081C5C(Effect* effect) { Object_Kill(&effect->obj, effect->sfxSource); func_effect_8007D0E0(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 5.0f); } else if (fabsf(gPlayer[0].unk_138 - effect->obj.pos.z) < 1000.0f) { - func_enmy2_8006F0D8(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 15.0f); + ActorEvent_8006F0D8(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 15.0f); Object_Kill(&effect->obj, effect->sfxSource); } sp84 = 50.0f; @@ -3677,8 +3677,8 @@ void func_effect_80081C5C(Effect* effect) { gEffects[ARRAY_COUNT(gEffects) - 1].obj.status = gEffects[ARRAY_COUNT(gEffects) - 2].obj.status = OBJ_FREE; func_effect_80081BEC(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 1.0f, 10); - D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = 0xFF; - D_ctx_80178340 = D_ctx_80178358 = 0xFF; + D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = 255; + D_ctx_80178340 = D_ctx_80178358 = 255; D_ctx_80178358 = 0; D_ctx_8017835C = 25; effect->timer_50 = 10; @@ -3748,11 +3748,11 @@ void func_effect_80081C5C(Effect* effect) { case 0: D_ctx_801779A8[0] = 50.0f; if (effect->unk_46 == 10) { - D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = 0xFF; - D_ctx_80178340 = D_ctx_80178358 = 0xFF; + D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = 255; + D_ctx_80178340 = D_ctx_80178358 = 255; D_ctx_80178358 = 0; D_ctx_8017835C = 25; - D_ctx_80178480 = 50; + gCameraShake = 50; } if (effect->unk_46 == 0) { D_ctx_80178348 = (D_ctx_80178350 = (D_ctx_80178354 = (D_ctx_80178340 = 0))); @@ -4067,7 +4067,7 @@ void func_effect_80083C70(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 xVel s32 arg8) { Effect_Initialize(effect); effect->obj.status = OBJ_INIT; - effect->obj.id = 0x18F; + effect->obj.id = OBJ_EFFECT_399; effect->obj.pos.x = xPos; effect->unk_60.x = xPos; effect->unk_60.y = yPos; diff --git a/src/engine/fox_enmy.c b/src/engine/fox_enmy.c index 115c6cc9..938296e4 100644 --- a/src/engine/fox_enmy.c +++ b/src/engine/fox_enmy.c @@ -29,32 +29,32 @@ ObjectInit* D_enmy_800CFDA0[] = { D_FO_600EAD4, NULL, D_KA_6011044, D_BO_600FF74, D_SZ_6006EB4, D_VE2_6014D94, D_versus_302DE3C, }; static s32 D_enmy_800CFDF4[] = { - OBJ_80_0, - OBJ_ITEM_SILVER_RING, - OBJ_ITEM_SILVER_RING, - OBJ_ITEM_SILVER_RING, - OBJ_ITEM_SILVER_RING, - OBJ_ITEM_BOMB, - OBJ_ITEM_BOMB, - OBJ_ITEM_BOMB, - OBJ_ITEM_BOMB, - OBJ_ITEM_LASERS, - OBJ_ITEM_LASERS, - OBJ_ITEM_LASERS, - OBJ_ITEM_LASERS, - OBJ_ITEM_1UP, - OBJ_ITEM_GOLD_RING, - OBJ_ITEM_GOLD_RING, - OBJ_ITEM_GOLD_RING, - OBJ_ITEM_GOLD_RING, - OBJ_ITEM_GOLD_RING, - OBJ_ITEM_LASERS, - OBJ_ITEM_BOMB, - OBJ_ITEM_SILVER_RING, - OBJ_ITEM_SILVER_RING, - OBJ_ITEM_WING_REPAIR, - OBJ_80_0, - OBJ_ITEM_SILVER_STAR, + /* 0 */ OBJ_80_0, + /* 1 */ OBJ_ITEM_SILVER_RING, + /* 2 */ OBJ_ITEM_SILVER_RING, + /* 3 */ OBJ_ITEM_SILVER_RING, + /* 4 */ OBJ_ITEM_SILVER_RING, + /* 5 */ OBJ_ITEM_BOMB, + /* 6 */ OBJ_ITEM_BOMB, + /* 7 */ OBJ_ITEM_BOMB, + /* 8 */ OBJ_ITEM_BOMB, + /* 9 */ OBJ_ITEM_LASERS, + /* 10 */ OBJ_ITEM_LASERS, + /* 11 */ OBJ_ITEM_LASERS, + /* 12 */ OBJ_ITEM_LASERS, + /* 13 */ OBJ_ITEM_1UP, + /* 14 */ OBJ_ITEM_GOLD_RING, + /* 15 */ OBJ_ITEM_GOLD_RING, + /* 16 */ OBJ_ITEM_GOLD_RING, + /* 17 */ OBJ_ITEM_GOLD_RING, + /* 18 */ OBJ_ITEM_GOLD_RING, + /* 19 */ OBJ_ITEM_LASERS, + /* 20 */ OBJ_ITEM_BOMB, + /* 21 */ OBJ_ITEM_SILVER_RING, + /* 22 */ OBJ_ITEM_SILVER_RING, + /* 23 */ OBJ_ITEM_WING_REPAIR, + /* 24 */ OBJ_80_0, + /* 25 */ OBJ_ITEM_SILVER_STAR, }; static f32 D_enmy_800CFE5C[] = { 0.0f, 1.0f, 0.5f, 0.33f, 0.25f, 1.0f, 0.5f, 0.33f, 0.25f, 1.0f, 0.5f, 0.33f, 0.25f, @@ -382,10 +382,10 @@ void func_enmy_80061F0C(Actor* actor, ObjectInit* objInit, s32 arg2) { actor->obj.rot.y = actor->unk_0F4.y = objInit->rot.y; actor->obj.rot.x = actor->unk_0F4.x = objInit->rot.x; actor->unk_0F4.z = objInit->rot.z; - actor->obj.id = OBJ_ACTOR_200; + actor->obj.id = OBJ_ACTOR_EVENT; actor->timer_0C2 = 10; actor->unk_0B4 = 4095; - actor->aiType = objInit->id - OBJ_UNK_1000; + actor->aiType = objInit->id - ACTOR_EVENT_ID; Object_SetInfo(&actor->info, actor->obj.id); actor->info.unk_10 = 3000.0f; @@ -434,7 +434,7 @@ void Object_Load(ObjectInit* objInit, f32 arg1, f32 arg2, f32 arg3, f32 arg4) { break; } } - } else if (objInit->id == OBJ_ACTOR_198) { + } else if (objInit->id == OBJ_ACTOR_TEAM_BOSS) { for (i = 0; i < 3; i++) { if (gActors[i].obj.status == OBJ_FREE) { Actor_Load(&gActors[i], objInit); @@ -571,7 +571,7 @@ void func_enmy_80062664(void) { for (i = 0, objInit = &D_ctx_80178310[D_ctx_80177DC8]; i < 10000; i++, D_ctx_80177DC8++, objInit++) { if ((objInit->id > OBJ_INVALID) && D_ctx_80177D20 <= objInit->zPos1 && objInit->zPos1 <= D_ctx_80177D20 + 200.0f) { - if ((gCurrentLevel == LEVEL_VENOM_1) && (objInit->id >= OBJ_UNK_1000)) { + if ((gCurrentLevel == LEVEL_VENOM_1) && (objInit->id >= ACTOR_EVENT_ID)) { if (((objInit->rot.y < 180.0f) && (objInit->xPos < gPlayer[0].unk_0AC)) || ((objInit->rot.y > 180.0f) && (gPlayer[0].unk_0AC < objInit->xPos))) { Object_Load(objInit, var_fs1, var_fs2, var_fs3, var_fs4); @@ -889,7 +889,7 @@ s32 func_enmy_8006351C(s32 index, Vec3f* pos, Vec3f* arg2, s32 arg3) { for (i = 0; i < ARRAY_COUNT(gActors); i++, actor++) { if ((actor->obj.status >= OBJ_ACTIVE) && (fabsf(pos->x - actor->obj.pos.x) < 1000.0f) && (fabsf(pos->z - actor->obj.pos.z) < 1500.0f) && (index != i) && (actor->info.unk_16 != 2) && - ((actor->obj.id != OBJ_ACTOR_197) || (actor->aiType >= 4)) && (actor->timer_0C2 == 0)) { + !((actor->obj.id == OBJ_ACTOR_ALLRANGE) && (actor->aiType <= AI360_PEPPY)) && (actor->timer_0C2 == 0)) { if (actor->obj.id == OBJ_ACTOR_180) { if (func_enmy_8006326C(pos, arg2, actor->obj.id, &actor->obj)) { return 2; @@ -910,8 +910,9 @@ s32 func_enmy_8006351C(s32 index, Vec3f* pos, Vec3f* arg2, s32 arg3) { actor->unk_0D0 = 1; actor->damage = 10; actor->unk_0D2 = -1; - if (!(((actor->obj.id == OBJ_ACTOR_200) && (actor->iwork[12] != 0)) || - ((actor->obj.id == OBJ_ACTOR_197) && ((actor->aiType < 10) || (actor->aiType >= 100))))) { + if (!(((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->iwork[12] != 0)) || + ((actor->obj.id == OBJ_ACTOR_ALLRANGE) && + ((actor->aiType < AI360_10) || (actor->aiType >= AI360_GREAT_FOX))))) { actor->health = 0; } actor->unk_0D8.x = pos->x; @@ -1019,14 +1020,14 @@ void Object_Init(s32 index, ObjectId objId) { case OBJ_80_54: AUDIO_PLAY_SFX(0x11000000, gObjects80[index].sfxSource, 0); break; - case OBJ_ACTOR_198: - func_hud_80092D48(&gActors[index]); + case OBJ_ACTOR_TEAM_BOSS: + ActorTeamBoss_Init(&gActors[index]); break; case OBJ_ACTOR_235: gActors[index].fwork[10] = fabsf(Math_ModF(gActors[index].obj.pos.x, 100.0f)); break; case OBJ_ACTOR_247: - Zoness_8019D060(&gActors[index]); + Zoness_Actor247_Init(&gActors[index]); break; case OBJ_EFFECT_368: if (gCurrentLevel == LEVEL_TITANIA) { @@ -1178,13 +1179,13 @@ void Object_Init(s32 index, ObjectId objId) { gActors[index].unk_0C9 = 1; break; case OBJ_BOSS_320: - Andross_8018D16C(&gBosses[index]); + Andross_Boss320_Init(&gBosses[index]); break; case OBJ_BOSS_316: - Katina_80193CA4(&gBosses[index]); + Katina_Boss316_Init(&gBosses[index]); break; case OBJ_BOSS_314: - SectorY_80197CC4(&gBosses[index]); + SectorY_Boss314_Init(&gBosses[index]); break; case OBJ_ACTOR_205: case OBJ_ACTOR_206: @@ -1227,25 +1228,25 @@ void Object_Init(s32 index, ObjectId objId) { AUDIO_PLAY_SFX(0x31000016, gActors[index].sfxSource, 4); break; case OBJ_BOSS_297: - Meteo_80188A40(&gBosses[index]); + Meteo_Boss297_Init(&gBosses[index]); break; case OBJ_BOSS_299: - func_boss_80042FAC(&gBosses[index]); + Boss299_Init(&gBosses[index]); break; case OBJ_BOSS_300: - func_boss_80042FD0(&gBosses[index]); + Boss300_Init(&gBosses[index]); break; case OBJ_BOSS_292: - Corneria_801878D8(&gBosses[index]); + Corneria_Boss292_Init(&gBosses[index]); break; case OBJ_BOSS_293: - Corneria_8018BE7C(&gBosses[index]); + Corneria_Boss293_Init(&gBosses[index]); break; case OBJ_BOSS_A6: - Area6_80187754(&gBosses[index]); + Area6_BossA6_Init(&gBosses[index]); break; case OBJ_ACTOR_231: - Titania_8018B96C(&gActors[index]); + Titania_Actor231_Init(&gActors[index]); break; case OBJ_ACTOR_232: Titania_8018ADC4(&gActors[index]); @@ -1266,7 +1267,7 @@ void Object_Init(s32 index, ObjectId objId) { Titania_8018EFF0(&gObjects4C[index]); break; case OBJ_BOSS_306: - Titania_8018FA48(&gBosses[index]); + Titania_Boss306_Init(&gBosses[index]); break; case OBJ_ACTOR_240: Zoness_801915A4(&gActors[index]); @@ -1275,7 +1276,7 @@ void Object_Init(s32 index, ObjectId objId) { Zoness_80191BB8(&gActors[index]); break; case OBJ_BOSS_ZO: - Zoness_801932AC(&gBosses[index]); + Zoness_BossZo_Init(&gBosses[index]); break; case OBJ_ACTOR_250: Zoness_8019B1F0(&gActors[index]); @@ -1296,7 +1297,7 @@ void Object_Init(s32 index, ObjectId objId) { Aquas_801AF9FC(&gActors[index]); break; case OBJ_BOSS_AQ: - Aquas_801B10F8(&gBosses[index]); + Aquas_BossAq_Init(&gBosses[index]); break; case OBJ_ACTOR_259: Aquas_801B6344(&gActors[index]); @@ -1311,7 +1312,7 @@ void Object_Init(s32 index, ObjectId objId) { Titania_8018F0D8(&gObjects80[index]); break; case OBJ_BOSS_319: - Venom1_801935CC(&gBosses[index]); + Venom1_Boss319_Init(&gBosses[index]); break; case OBJ_ACTOR_280: Venom1_8019250C(&gActors[index]); @@ -1361,7 +1362,7 @@ void func_enmy_80065380(Actor* actor, f32 xPos, f32 yPos, f32 zPos, f32 arg4, f3 actor->obj.pos.x = xPos; actor->obj.pos.y = yPos; actor->obj.pos.z = zPos; - actor->unk_046 = 0xFF; + actor->unk_046 = 255; actor->unk_048 = 900; actor->obj.rot.z = RAND_FLOAT(360.0f); actor->obj.rot.y = RAND_FLOAT(360.0f); @@ -1582,16 +1583,16 @@ void func_enmy_800656D4(Actor* actor) { func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 3.0f); Object_Kill(&actor->obj, actor->sfxSource); if (actor->unk_0D0 != 0) { - actor->unk_044 = 2; + actor->itemDrop = DROP_SILVER_RING_50p; if ((gCurrentLevel == LEVEL_CORNERIA)) { if (gLevelMode == LEVELMODE_ALL_RANGE) { - actor->unk_044 = 2; + actor->itemDrop = DROP_SILVER_RING_50p; } else { - actor->unk_044 = 4; + actor->itemDrop = DROP_SILVER_RING_25p; } } if (gCurrentLevel == LEVEL_AREA_6) { - actor->unk_044 = 22; + actor->itemDrop = DROP_SILVER_RING_10p; } func_enmy_80066254(actor); } @@ -1615,7 +1616,7 @@ void func_enmy_800660F0(Actor* actor) { if (item->obj.status == OBJ_FREE) { Item_Initialize(item); item->obj.status = OBJ_INIT; - item->obj.id = D_enmy_800CFDF4[actor->unk_044]; + item->obj.id = D_enmy_800CFDF4[actor->itemDrop]; item->obj.pos.x = actor->obj.pos.x; item->obj.pos.y = actor->obj.pos.y; item->obj.pos.z = actor->obj.pos.z; @@ -1647,12 +1648,12 @@ void func_enmy_80066254(Actor* actor) { !((D_versus_80178768[0] == 0) && (D_versus_80178768[1] == 0) && (D_versus_80178768[2] == 0))) { D_ctx_80177C30[actor->unk_0D4 - 1] += actor->info.bonus; } - } else if ((actor->obj.id != OBJ_ACTOR_197) || (actor->unk_0B6 != 1)) { + } else if ((actor->obj.id != OBJ_ACTOR_ALLRANGE) || (actor->unk_0B6 != 1)) { if ((actor->unk_0D4 == 1) && (actor->info.bonus != 0)) { gHitCount += actor->info.bonus; D_ctx_80177850 = 15; - if ((gLevelMode == LEVELMODE_ALL_RANGE) && (D_play_80161A62 != 0)) { - switch (D_play_80161A62) { + if ((gLevelMode == LEVELMODE_ALL_RANGE) && (gDropHitCountItem != 0)) { + switch (gDropHitCountItem) { case 9: if (gCurrentLevel == LEVEL_KATINA) { Radio_PlayMessage(gMsg_ID_18031, RCID_BILL); @@ -1661,22 +1662,22 @@ void func_enmy_80066254(Actor* actor) { case 4: case 19: case 29: - actor->unk_044 = 14; + actor->itemDrop = DROP_GOLD_RING_1; break; case 14: - actor->unk_044 = 9; + actor->itemDrop = DROP_LASERS; break; } - D_play_80161A62 = 0; + gDropHitCountItem = 0; } - if (actor->obj.id == OBJ_ACTOR_197) { - if ((actor->aiType >= 4) && (actor->aiType < 8)) { + if (actor->obj.id == OBJ_ACTOR_ALLRANGE) { + if ((actor->aiType >= AI360_WOLF) && (actor->aiType < AI360_KATT)) { func_360_8002E3E0(actor); } } } - if (actor->unk_044) { - if (D_enmy_800CFE5C[actor->unk_044] < 0.0f) { + if (actor->itemDrop) { + if (D_enmy_800CFE5C[actor->itemDrop] < 0.0f) { otherActor = gActors; for (i = 0, otherActor = gActors; i < ARRAY_COUNT(gActors); i++, otherActor++) { if ((otherActor->obj.status != OBJ_FREE) && (otherActor->index != actor->index) && @@ -1686,7 +1687,7 @@ void func_enmy_80066254(Actor* actor) { } func_enmy_800660F0(actor); AUDIO_PLAY_SFX(0x4900000C, gDefaultSfxSource, 4); - } else if (actor->unk_044 == 24) { + } else if (actor->itemDrop == DROP_TEAM_MESG) { if (gTeamShields[3] > 0) { Radio_PlayMessage(gMsg_ID_20261, RCID_PEPPY); } else if (gTeamShields[2] > 0) { @@ -1694,7 +1695,7 @@ void func_enmy_80066254(Actor* actor) { } else if (gTeamShields[1] > 0) { Radio_PlayMessage(gMsg_ID_20262, RCID_FALCO); } - } else if (Rand_ZeroOne() <= D_enmy_800CFE5C[actor->unk_044]) { + } else if (Rand_ZeroOne() <= D_enmy_800CFE5C[actor->itemDrop]) { func_enmy_800660F0(actor); } } @@ -1718,15 +1719,15 @@ void func_enmy_8006654C(Actor* actor) { if (Animation_GetFrameCount(&D_CO_6029528) < actor->unk_0B6) { actor->unk_0B6 = 0; } - if ((actor->obj.rot.z < 15.0f) && (actor->unk_0B6 < 0x14)) { + if ((actor->obj.rot.z < 15.0f) && (actor->unk_0B6 < 20)) { actor->obj.rot.z += 1.0f; } - if ((actor->obj.rot.z > -15.0f) && (actor->unk_0B6 >= 0x15)) { + if ((actor->obj.rot.z > -15.0f) && (actor->unk_0B6 > 20)) { actor->obj.rot.z -= 1.0f; } - if ((actor->unk_0B6 == 0x14) || (actor->unk_0B6 == 0x28)) { + if ((actor->unk_0B6 == 20) || (actor->unk_0B6 == 40)) { actor->state++; - actor->timer_0BC = 0x14; + actor->timer_0BC = 20; } break; case 1: @@ -1767,7 +1768,7 @@ void func_enmy_8006684C(Actor* actor) { actor->vel.y = 0.0f; if (actor->timer_0BE == 1) { Object_Kill(&actor->obj, actor->sfxSource); - actor->unk_044 = 1; + actor->itemDrop = DROP_SILVER_RING; func_enmy_80066254(actor); AUDIO_PLAY_SFX(0x2903B009, actor->sfxSource, 4); BonusText_Display(actor->obj.pos.x, actor->obj.pos.y + 250.0f, actor->obj.pos.z, 3); @@ -1859,7 +1860,7 @@ void func_enmy_80066D5C(Object_80* obj80) { obj80->unk_44 = 40; func_enmy_80066A8C(obj80); obj80->state = 0; - D_ctx_80178480 = 25; + gCameraShake = 25; AUDIO_PLAY_SFX(0x19130003, obj80->sfxSource, 4); } break; @@ -1982,7 +1983,7 @@ void func_enmy_800674B4(f32 xPos, f32 yPos, f32 zPos, f32 xRot, f32 yRot, f32 ar } } -void func_enmy_8006753C(Actor* actor) { +void ActorSupplies_Update(Actor* actor) { Player* player = &gPlayer[0]; s32 i; @@ -2004,13 +2005,13 @@ void func_enmy_8006753C(Actor* actor) { func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 5.0f); if (((player[0].wings.rightState <= WINGSTATE_BROKEN) || (player[0].wings.leftState <= WINGSTATE_BROKEN)) && (player[0].form != FORM_LANDMASTER)) { - actor->unk_044 = 23; + actor->itemDrop = DROP_WING_REPAIR; } else if (gPlayer[0].shields < 128) { - actor->unk_044 = 25; + actor->itemDrop = DROP_SILVER_STAR; } else if ((gLaserStrength[0] == LASERS_SINGLE) && (player[0].form != FORM_LANDMASTER)) { - actor->unk_044 = 9; + actor->itemDrop = DROP_LASERS; } else { - actor->unk_044 = 5; + actor->itemDrop = DROP_BOMB; } func_enmy_80066254(actor); for (i = 0; i < 6; i++) { @@ -2031,7 +2032,7 @@ void func_enmy_8006753C(Actor* actor) { gRadarMarks[63].unk_10 = 0.0f; } -void func_enmy_80067874(Actor* actor) { +void ActorSupplies_Draw(Actor* actor) { s32 i; Lights_SetOneLight(&gMasterDisp, -60, -60, 60, 150, 150, 150, 20, 20, 20); @@ -2065,7 +2066,7 @@ void func_enmy_80067A40(void) { } } -void func_enmy_80067B1C(Item* item) { +void Item1up_Update(Item* item) { func_enmy_80066EF0(item); func_enmy_800671D0(item); if (item->collected) { @@ -2080,7 +2081,7 @@ void func_enmy_80067B1C(Item* item) { } } -void func_enmy_80067BEC(Item* item) { +void ItemPickup_Update(Item* item) { func_enmy_80066EF0(item); func_enmy_800671D0(item); if (item->state == 0) { @@ -2134,7 +2135,7 @@ void func_enmy_80067BEC(Item* item) { } } -void func_enmy_80067F6C(Item* item) { +void ItemLasers_Update(Item* item) { if (!gVersusMode && ((gPlayer[0].wings.leftState <= WINGSTATE_BROKEN) || (gPlayer[0].wings.rightState <= WINGSTATE_BROKEN))) { item->obj.id = OBJ_ITEM_WING_REPAIR; @@ -2142,11 +2143,11 @@ void func_enmy_80067F6C(Item* item) { item->timer_48 = 2000; AUDIO_PLAY_SFX(0x1900302B, item->sfxSource, 0); } else { - func_enmy_80067BEC(item); + ItemPickup_Update(item); } } -void func_enmy_80068020(Item* item) { +void ItemSupplyRing_Update(Item* item) { Vec3f sp4C; Vec3f sp40; @@ -2159,7 +2160,7 @@ void func_enmy_80068020(Item* item) { item->state = 1; item->timer_48 = 50; if (item->obj.id == OBJ_ITEM_SILVER_RING) { - gPlayer[item->playerNum].heal += 0x20; + gPlayer[item->playerNum].heal += 32; func_enmy_80060F30(gPlayer[item->playerNum].sfxSource, 0x4900200E, item->playerNum); } else if (item->obj.id == OBJ_ITEM_GOLD_RING) { gGoldRingCount[0]++; @@ -2170,15 +2171,15 @@ void func_enmy_80068020(Item* item) { if (gCurrentLevel != LEVEL_TRAINING) { gLifeCount[item->playerNum]++; } - gPlayer[item->playerNum].heal += 0x20; + gPlayer[item->playerNum].heal += 32; BonusText_Display(gPlayer[item->playerNum].pos.x, gPlayer[item->playerNum].pos.y, gPlayer[item->playerNum].unk_138, BONUS_TEXT_1UP); } else { - gPlayer[item->playerNum].heal += 0x20; + gPlayer[item->playerNum].heal += 32; func_enmy_80060F30(gPlayer[item->playerNum].sfxSource, 0x49003013, item->playerNum); } } else { - gPlayer[item->playerNum].heal += 0x80; + gPlayer[item->playerNum].heal += 128; func_enmy_80060F30(gPlayer[item->playerNum].sfxSource, 0x4900200D, item->playerNum); } } @@ -2223,15 +2224,15 @@ void func_enmy_80068020(Item* item) { } } -void func_enmy_800685D8(Item* item) { - func_enmy_80068020(item); +void ItemSilverStar_Update(Item* item) { + ItemSupplyRing_Update(item); } -void func_enmy_800685F8(Item* item) { - func_enmy_80068020(item); +void ItemGoldRing_Update(Item* item) { + ItemSupplyRing_Update(item); } -void func_enmy_80068618(Item* item) { +void ItemWingRepair_Update(Item* item) { func_enmy_80066EF0(item); func_enmy_800671D0(item); if (item->collected) { @@ -2243,7 +2244,7 @@ void func_enmy_80068618(Item* item) { } } -void func_enmy_80068688(Item* item) { +void ItemMeteoWarp_Update(Item* item) { func_enmy_80066EF0(item); if (item->state > 0) { if (item->state == 1) { @@ -2285,7 +2286,7 @@ void func_enmy_80068688(Item* item) { } } -void func_enmy_80068914(Item* item) { +void ItemCheckpoint_Update(Item* item) { s32 i; func_enmy_80066EF0(item); @@ -2320,7 +2321,7 @@ void func_enmy_80068914(Item* item) { gPlayer[item->playerNum].heal = 128; item->state++; item->timer_48 = 15; - D_80161A8C = D_80161A88; + D_ctx_80161A8C = D_ctx_80161A88; D_ctx_80177CB0 = -item->obj.pos.z; D_ctx_80177CB0 -= 250.0f; D_ctx_80177CA0 = D_ctx_80177DC8; @@ -2361,13 +2362,13 @@ void func_enmy_80068C88(Item* item) { case OBJ_ITEM_333: break; case OBJ_ITEM_328: - gPlayer[0].unk_228 = 0x30; + gPlayer[0].flags_228 = 0x30; break; case OBJ_ITEM_329: - gPlayer[0].unk_228 = 0x20; + gPlayer[0].flags_228 = 0x20; break; case OBJ_ITEM_330: - gPlayer[0].unk_228 = 0x10; + gPlayer[0].flags_228 = 0x10; break; } } @@ -2435,12 +2436,12 @@ void func_enmy_80068FE0(Object_4C* obj4C) { } } -void func_enmy_800690D0(s32 index, ObjectId objId) { +void Object_Dying(s32 index, ObjectId objId) { switch (objId) { - case OBJ_ACTOR_200: - func_enmy2_8007717C(&gActors[index]); + case OBJ_ACTOR_EVENT: + ActorEvent_Dying(&gActors[index]); break; - case OBJ_ACTOR_197: + case OBJ_ACTOR_ALLRANGE: if (gCurrentLevel == LEVEL_VENOM_ANDROSS) { Andross_801888F4(&gActors[index]); } else { @@ -2451,7 +2452,7 @@ void func_enmy_800690D0(s32 index, ObjectId objId) { func_enmy2_800763A4(&gActors[index]); break; case OBJ_ACTOR_194: - func_enmy2_8006B0A0(&gActors[index]); + Actor194_Init(&gActors[index]); break; case OBJ_ACTOR_186: Meteo_80187B08(&gActors[index]); @@ -2486,12 +2487,12 @@ void func_enmy_800693E8(Actor* actor) { actor->obj.pos.y += actor->vel.y; actor->vel.y -= actor->gravity; - if ((D_80161AB8 != 0) && (actor->obj.id != OBJ_ACTOR_198) && - ((gCurrentLevel != LEVEL_MACBETH) || (actor->obj.id == OBJ_ACTOR_200))) { + if ((D_ctx_80161AB8 != 0) && (actor->obj.id != OBJ_ACTOR_TEAM_BOSS) && + ((gCurrentLevel != LEVEL_MACBETH) || (actor->obj.id == OBJ_ACTOR_EVENT))) { f32 var_fv0 = 4000.0f; if ((actor->obj.id == OBJ_ACTOR_236) || (gCurrentLevel == LEVEL_MACBETH) || - ((actor->obj.id == OBJ_ACTOR_200) && (actor->unk_0B4 == 56))) { + ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == 56))) { var_fv0 = 8000.0f; } else if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_8) { var_fv0 = 100000.0f; @@ -2512,7 +2513,7 @@ void func_enmy_800693E8(Actor* actor) { case OBJ_ACTOR_194: D_ctx_80176550[actor->unk_046] = 0; break; - case OBJ_ACTOR_200: + case OBJ_ACTOR_EVENT: if ((actor->unk_0B4 >= 200) && (actor->unk_0B4 < 300)) { D_ctx_80176550[actor->unk_046] = 0; } else if ((actor->unk_0B4 == 38) && (actor->unk_046 != 2)) { @@ -2532,7 +2533,7 @@ void func_enmy_80069658(Boss* boss) { boss->obj.pos.y += boss->vel.y; boss->obj.pos.z += boss->vel.z; boss->vel.y -= boss->gravity; - if ((D_80161AB8 != 0) && ((boss->obj.pos.z + D_ctx_80177D20) > (boss->info.unk_10 - gPlayer[0].camEye.z))) { + if ((D_ctx_80161AB8 != 0) && ((boss->obj.pos.z + D_ctx_80177D20) > (boss->info.unk_10 - gPlayer[0].camEye.z))) { if (gPlayer[0].camEye.z) {} // fake Object_Kill(&boss->obj, boss->sfxSource); } @@ -2563,7 +2564,7 @@ void func_enmy_800696F8(Object_80* obj80) { } void func_enmy_80069858(Object_4C* obj4C) { - if (D_80161AB8 != 0) { + if (D_ctx_80161AB8 != 0) { f32 temp_fv0 = fabsf(obj4C->obj.pos.x - gPlayer[0].camEye.x); f32 var_fa0 = 500.0f; @@ -2583,7 +2584,7 @@ void func_enmy_80069924(Effect* effect) { effect->obj.pos.x += effect->vel.x; effect->obj.pos.y += effect->vel.y; effect->obj.pos.z += effect->vel.z; - if (D_80161AB8 != 0) { + if (D_ctx_80161AB8 != 0) { if ((gPlayer[0].camEye.z + effect->info.unk_10) < (effect->obj.pos.z + D_ctx_80177D20)) { Object_Kill(&effect->obj, effect->sfxSource); } else if ((fabsf(effect->obj.pos.y - gPlayer[0].camEye.y) > 25000.0f) || @@ -2594,7 +2595,7 @@ void func_enmy_80069924(Effect* effect) { } void func_enmy_80069A10(Item* item) { - if (D_80161AB8 != 0) { + if (D_ctx_80161AB8 != 0) { f32 temp = (0.0f - gPlayer[0].camEye.z); if ((item->info.unk_10 - temp) < (item->obj.pos.z + D_ctx_80177D20)) { @@ -2659,7 +2660,7 @@ void Actor_Update(Actor* actor) { case OBJ_DYING: func_enmy_800693E8(actor); if (actor->obj.status != OBJ_FREE) { - func_enmy_800690D0(actor->index, actor->obj.id); + Object_Dying(actor->index, actor->obj.id); } break; } @@ -2702,7 +2703,7 @@ void Boss_Update(Boss* boss) { case OBJ_DYING: func_enmy_80069658(boss); if (boss->obj.status != OBJ_FREE) { - func_enmy_800690D0(boss->index, boss->obj.id); + Object_Dying(boss->index, boss->obj.id); } break; } @@ -2742,7 +2743,7 @@ void Object_4C_Update(Object_4C* obj4C) { break; case OBJ_DYING: func_enmy_80069858(obj4C); - func_enmy_800690D0(obj4C->index, obj4C->obj.id); + Object_Dying(obj4C->index, obj4C->obj.id); break; } } @@ -2860,12 +2861,12 @@ void Object_UpdateAll(void) { Item* item; Effect* effect; - D_80161AB8 = 0; + D_ctx_80161AB8 = 0; if ((gLevelMode == LEVELMODE_ON_RAILS) && ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_1) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_4) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_8) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_9) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_6))) { - D_80161AB8 = 1; + D_ctx_80161AB8 = 1; } if (gLevelMode != LEVELMODE_ALL_RANGE) { if ((D_ctx_80178488 != 0) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2)) { diff --git a/src/engine/fox_enmy2.c b/src/engine/fox_enmy2.c index 7a981ad3..e8f103f3 100644 --- a/src/engine/fox_enmy2.c +++ b/src/engine/fox_enmy2.c @@ -25,7 +25,7 @@ s32 D_enmy2_800CFF80[4] = { 0, 0, 0, 0 }; s32 D_enmy2_800CFF90 = 0; s32 D_enmy2_80161690; -void func_enmy2_8006A7B0(u16* msg, s32 character) { +void ActorEvent_SetMessage(u16* msg, s32 character) { PRINTF("Enm->obj.pos.y + tmp_xyz.y=<%10.3f>\n"); if ((gRadioState == 0) || (D_ctx_80177D68 != character)) { Radio_PlayMessage(msg, character); @@ -69,13 +69,13 @@ void func_enmy2_8006A900(f32 xPos, f32 yPos, f32 zPos, f32 arg3) { } } -void func_enmy2_8006A96C(Actor* actor) { +void Actor237_Update(Actor* this) { } -void func_enmy2_8006A978(Actor* actor) { +void Actor237_Draw(Actor* this) { } -void func_enmy2_8006A984(Effect* effect, f32 xPos, f32 yPos, f32 zPos) { +void Ovj54_8006A984(Effect* effect, f32 xPos, f32 yPos, f32 zPos) { Effect_Initialize(effect); effect->obj.status = OBJ_INIT; effect->obj.id = OBJ_EFFECT_365; @@ -92,144 +92,143 @@ void func_enmy2_8006A984(Effect* effect, f32 xPos, f32 yPos, f32 zPos) { Object_SetInfo(&effect->info, effect->obj.id); } -void func_enmy2_8006AA3C(f32 xPos, f32 yPos, f32 zPos) { +void Obj54_8006AA3C(f32 xPos, f32 yPos, f32 zPos) { s32 i; for (i = 0; i < ARRAY_COUNT(gEffects); i++) { if (gEffects[i].obj.status == OBJ_FREE) { - func_enmy2_8006A984(&gEffects[i], xPos, yPos, zPos); + Ovj54_8006A984(&gEffects[i], xPos, yPos, zPos); break; } } } -void func_enmy2_8006AA98(Object_80* obj80) { +void Obj54_Update(Object_80* this) { Vec3f sp24; Vec3f sp18; Texture_Scroll(D_CO_60038F8, 32, 32, 1); if ((gGameFrameCount % 4) == 0) { - Matrix_RotateY(gCalcMatrix, obj80->obj.rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, 0); sp18.x = RAND_FLOAT_CENTERED(700.0f); sp18.y = RAND_FLOAT(50.0f); sp18.z = 700.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp18, &sp24); - func_enmy2_8006AA3C(obj80->obj.pos.x + sp24.x, obj80->obj.pos.y + sp24.y + 50.0f, obj80->obj.pos.z + sp24.z); + Obj54_8006AA3C(this->obj.pos.x + sp24.x, this->obj.pos.y + sp24.y + 50.0f, this->obj.pos.z + sp24.z); } } -bool func_enmy2_8006ABA4(Actor* actor) { - if ((fabsf(actor->obj.pos.x - gPlayer[0].pos.x) < 700.0f) && - (fabsf(actor->obj.pos.y - gPlayer[0].pos.y) < 700.0f)) { +bool Actor201_8006ABA4(Actor* this) { + if ((fabsf(this->obj.pos.x - gPlayer[0].pos.x) < 700.0f) && (fabsf(this->obj.pos.y - gPlayer[0].pos.y) < 700.0f)) { return true; } return false; } -void func_enmy2_8006AC08(Actor* actor) { +void Actor201_Update(Actor* this) { f32 sp2C; - if (func_enmy2_8006ABA4(actor) && (actor->timer_0BC == 0)) { - func_effect_8007F11C(OBJ_EFFECT_353, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, D_ctx_80177828); - actor->timer_0BC = 20; + if (Actor201_8006ABA4(this) && (this->timer_0BC == 0)) { + func_effect_8007F11C(OBJ_EFFECT_353, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, D_ctx_80177828); + this->timer_0BC = 20; } - sp2C = actor->obj.pos.z + D_ctx_80177D20; - actor->obj.rot.y = Math_RadToDeg(Math_Atan2F(gPlayer[0].camEye.x - actor->obj.pos.x, gPlayer[0].camEye.z - sp2C)); - actor->obj.rot.x = - -Math_RadToDeg(Math_Atan2F(gPlayer[0].camEye.y - actor->obj.pos.y, - sqrtf(SQ(gPlayer[0].camEye.z - sp2C) + SQ(gPlayer[0].camEye.x - actor->obj.pos.x)))); + sp2C = this->obj.pos.z + D_ctx_80177D20; + this->obj.rot.y = Math_RadToDeg(Math_Atan2F(gPlayer[0].camEye.x - this->obj.pos.x, gPlayer[0].camEye.z - sp2C)); + this->obj.rot.x = + -Math_RadToDeg(Math_Atan2F(gPlayer[0].camEye.y - this->obj.pos.y, + sqrtf(SQ(gPlayer[0].camEye.z - sp2C) + SQ(gPlayer[0].camEye.x - this->obj.pos.x)))); } -void func_enmy2_8006AD18(Actor* actor) { +void Actor202_Update(Actor* this) { bool sp34; - actor->gravity = 1.5f; + this->gravity = 1.5f; sp34 = false; - actor->obj.rot.y = Math_RadToDeg( - Math_Atan2F(gPlayer[gPlayerNum].pos.x - actor->obj.pos.x, gPlayer[gPlayerNum].unk_138 - actor->obj.pos.z)); - if (actor->obj.pos.y < -500.0f) { - actor->obj.pos.y = -500.0f; - actor->vel.y = 0.0f; - actor->vel.x = 0.0f; - actor->vel.z = 0.0f; + this->obj.rot.y = Math_RadToDeg( + Math_Atan2F(gPlayer[gPlayerNum].pos.x - this->obj.pos.x, gPlayer[gPlayerNum].unk_138 - this->obj.pos.z)); + if (this->obj.pos.y < -500.0f) { + this->obj.pos.y = -500.0f; + this->vel.y = 0.0f; + this->vel.x = 0.0f; + this->vel.z = 0.0f; sp34 = true; - actor->iwork[1] = true; + this->iwork[1] = true; } if (!(gGameFrameCount & 0x1F)) { - func_effect_8007F11C(OBJ_EFFECT_353, actor->obj.pos.x, actor->obj.pos.y + 180.0f, actor->obj.pos.z, + func_effect_8007F11C(OBJ_EFFECT_353, this->obj.pos.x, this->obj.pos.y + 180.0f, this->obj.pos.z, D_ctx_80177828); } - switch (actor->state) { + switch (this->state) { case 0: - actor->unk_0B6++; + this->unk_0B6++; - if (actor->unk_0B6 >= 30) { - actor->unk_0B6 = 0; + if (this->unk_0B6 >= 30) { + this->unk_0B6 = 0; } - if (actor->unk_0B6 == 0x15) { - actor->state = 1; + if (this->unk_0B6 == 21) { + this->state = 1; - actor->vel.y = 40.0f; - actor->vel.z = -40.0f; - actor->vel.x = 10.0f; + this->vel.y = 40.0f; + this->vel.z = -40.0f; + this->vel.x = 10.0f; - actor->iwork[0] = 1 - actor->iwork[0]; + this->iwork[0] = 1 - this->iwork[0]; - if (actor->iwork[0]) { - actor->vel.x *= -1.0f; + if (this->iwork[0]) { + this->vel.x *= -1.0f; } - if (actor->iwork[1]) { - actor->vel.x = 0.0f; - actor->vel.z = -20.0f; + if (this->iwork[1]) { + this->vel.x = 0.0f; + this->vel.z = -20.0f; } } break; case 1: - if (actor->vel.y > 10.0f) { - actor->unk_0B6++; - if (actor->unk_0B6 >= 30) { - actor->unk_0B6 = 29; + if (this->vel.y > 10.0f) { + this->unk_0B6++; + if (this->unk_0B6 >= 30) { + this->unk_0B6 = 29; } } else { - actor->unk_0B6--; - if (actor->unk_0B6 < 0) { - actor->unk_0B6 = 0; + this->unk_0B6--; + if (this->unk_0B6 < 0) { + this->unk_0B6 = 0; } } if (sp34) { - actor->state = 0; + this->state = 0; } break; } - if (actor->unk_0D0 != 0) { - actor->health -= 10; - if ((actor->health <= 0) || (actor->unk_0D0 >= 2)) { - func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y + 180.0f, actor->obj.pos.z, 10.0f); - func_effect_8007BFFC(actor->obj.pos.x, actor->obj.pos.y + 180.0f, actor->obj.pos.z, actor->vel.x, - actor->vel.y, actor->vel.z, 8.0f, 30); - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); - gHitCount += actor->info.bonus; + if (this->unk_0D0 != 0) { + this->health -= 10; + if ((this->health <= 0) || (this->unk_0D0 >= 2)) { + func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y + 180.0f, this->obj.pos.z, 10.0f); + func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y + 180.0f, this->obj.pos.z, this->vel.x, this->vel.y, + this->vel.z, 8.0f, 30); + Object_Kill(&this->obj, this->sfxSource); + func_effect_8007A6F0(&this->obj.pos, 0x2903A008); + gHitCount += this->info.bonus; D_ctx_80177850 = 15; } else { - actor->unk_0D0 = 0; - actor->timer_0C6 = 20; - AUDIO_PLAY_SFX(0x2903300E, actor->sfxSource, 4); - func_effect_8007D1E0(actor->obj.pos.x, actor->obj.pos.y + 180.0f, actor->obj.pos.z, 5.0f); + this->unk_0D0 = 0; + this->timer_0C6 = 20; + AUDIO_PLAY_SFX(0x2903300E, this->sfxSource, 4); + func_effect_8007D1E0(this->obj.pos.x, this->obj.pos.y + 180.0f, this->obj.pos.z, 5.0f); } } } -void func_enmy2_8006B094(Actor* actor) { +void Actor194_Update(Actor* this) { } static s16 D_800CFF94[16] = { @@ -241,57 +240,57 @@ static f32 D_800CFFC4[16] = { }; static Gfx* D_800D0004[3] = { D_ENMY_SPACE_4000170, D_ENMY_SPACE_40084D0, D_ENMY_SPACE_400A630 }; -void func_enmy2_8006B0A0(Actor* actor) { +void Actor194_Init(Actor* this) { Vec3f sp34; s32 temp_hi; - actor->unk_04E++; + this->unk_04E++; - if (actor->unk_04E >= 100) { - actor->unk_04E = 0; + if (this->unk_04E >= 100) { + this->unk_04E = 0; } - D_ctx_80176558[actor->unk_046][actor->unk_04E] = actor->obj.pos.x; - D_ctx_80176878[actor->unk_046][actor->unk_04E] = actor->obj.pos.y; - D_ctx_80176B98[actor->unk_046][actor->unk_04E] = actor->obj.pos.z; - D_ctx_80176EB8[actor->unk_046][actor->unk_04E] = actor->obj.rot.x; - D_ctx_801771D8[actor->unk_046][actor->unk_04E] = actor->obj.rot.y; - D_ctx_80177500[actor->unk_046][actor->unk_04E] = actor->obj.rot.z; + D_ctx_80176558[this->unk_046][this->unk_04E] = this->obj.pos.x; + D_ctx_80176878[this->unk_046][this->unk_04E] = this->obj.pos.y; + D_ctx_80176B98[this->unk_046][this->unk_04E] = this->obj.pos.z; + D_ctx_80176EB8[this->unk_046][this->unk_04E] = this->obj.rot.x; + D_ctx_801771D8[this->unk_046][this->unk_04E] = this->obj.rot.y; + D_ctx_80177500[this->unk_046][this->unk_04E] = this->obj.rot.z; - actor->obj.rot.x -= 10.0f; - actor->obj.rot.y += 3.0f; - actor->obj.rot.z += 5.0f; + this->obj.rot.x -= 10.0f; + this->obj.rot.y += 3.0f; + this->obj.rot.z += 5.0f; - Math_Vec3fFromAngles(&sp34, actor->obj.rot.x, actor->obj.rot.y, 40.0f); + Math_Vec3fFromAngles(&sp34, this->obj.rot.x, this->obj.rot.y, 40.0f); - actor->vel.x = sp34.x; - actor->vel.y = sp34.y; - actor->vel.z = sp34.z; + this->vel.x = sp34.x; + this->vel.y = sp34.y; + this->vel.z = sp34.z; - if ((actor->timer_0BC == 0) && !(gGameFrameCount & 3)) { - temp_hi = (D_800CFF94[actor->unk_04A] + actor->unk_04E) % 100; - if (actor->unk_04A == 0) { - func_effect_8007D2C8(D_ctx_80176558[actor->unk_046][temp_hi], D_ctx_80176878[actor->unk_046][temp_hi], - D_ctx_80176B98[actor->unk_046][temp_hi], 7.0f); + if ((this->timer_0BC == 0) && !(gGameFrameCount & 3)) { + temp_hi = (D_800CFF94[this->unk_04A] + this->unk_04E) % 100; + if (this->unk_04A == 0) { + func_effect_8007D2C8(D_ctx_80176558[this->unk_046][temp_hi], D_ctx_80176878[this->unk_046][temp_hi], + D_ctx_80176B98[this->unk_046][temp_hi], 7.0f); } else { - func_effect_8007D2C8(D_ctx_80176558[actor->unk_046][temp_hi], D_ctx_80176878[actor->unk_046][temp_hi], - D_ctx_80176B98[actor->unk_046][temp_hi], 4.0f); + func_effect_8007D2C8(D_ctx_80176558[this->unk_046][temp_hi], D_ctx_80176878[this->unk_046][temp_hi], + D_ctx_80176B98[this->unk_046][temp_hi], 4.0f); } - AUDIO_PLAY_SFX(0x2903B009, actor->sfxSource, 4); - actor->unk_04A++; + AUDIO_PLAY_SFX(0x2903B009, this->sfxSource, 4); + this->unk_04A++; - if (actor->unk_04A > 15) { - Object_Kill(&actor->obj, actor->sfxSource); - D_ctx_80176550[actor->unk_046] = 0; - gHitCount += actor->info.bonus; + if (this->unk_04A > 15) { + Object_Kill(&this->obj, this->sfxSource); + D_ctx_80176550[this->unk_046] = 0; + gHitCount += this->info.bonus; D_ctx_80177850 = 15; } } } -void func_enmy2_8006B46C(Actor* actor, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, u8 arg7, f32 arg8, - s32 arg9) { +void Actor194_8006B46C(Actor* this, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, u8 arg7, f32 arg8, + s32 arg9) { Vec3f sp34 = { 0.0f, 0.0f, 0.0f }; Matrix_Push(&gGfxMatrix); @@ -308,11 +307,11 @@ void func_enmy2_8006B46C(Actor* actor, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f if (arg7 != 1) { RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); - if ((arg7 == 0) && (actor->timer_0CA[0] != 0)) { - sp34.y += actor->info.unk_1C; + if ((arg7 == 0) && (this->timer_0CA[0] != 0)) { + sp34.y += this->info.unk_1C; Matrix_MultVec3f(gGfxMatrix, &sp34, D_display_80161578); if (D_display_80161578->z > -500.0f) { - actor->timer_0CA[0] = 0; + this->timer_0CA[0] = 0; } } } else { @@ -329,33 +328,33 @@ void func_enmy2_8006B46C(Actor* actor, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } -void func_enmy2_8006B74C(Actor* actor) { +void Actor194_Draw(Actor* this) { s16 var_s0; s16 temp_hi; - for (var_s0 = actor->unk_04A; var_s0 < 16; var_s0++) { - temp_hi = (D_800CFF94[var_s0] + actor->unk_04E) % 100; - func_enmy2_8006B46C(actor, D_ctx_80176558[actor->unk_046][temp_hi], D_ctx_80176878[actor->unk_046][temp_hi], - D_ctx_80176B98[actor->unk_046][temp_hi], D_ctx_80176EB8[actor->unk_046][temp_hi], - D_ctx_801771D8[actor->unk_046][temp_hi], D_ctx_80177500[actor->unk_046][temp_hi], - D_800CFFB4[var_s0], D_800CFFC4[var_s0], actor->timer_0C6 & 1); + for (var_s0 = this->unk_04A; var_s0 < 16; var_s0++) { + temp_hi = (D_800CFF94[var_s0] + this->unk_04E) % 100; + Actor194_8006B46C(this, D_ctx_80176558[this->unk_046][temp_hi], D_ctx_80176878[this->unk_046][temp_hi], + D_ctx_80176B98[this->unk_046][temp_hi], D_ctx_80176EB8[this->unk_046][temp_hi], + D_ctx_801771D8[this->unk_046][temp_hi], D_ctx_80177500[this->unk_046][temp_hi], + D_800CFFB4[var_s0], D_800CFFC4[var_s0], this->timer_0C6 & 1); } } -void func_enmy2_8006B95C(Object_80* obj80) { - obj80->obj.pos.x += obj80->vel.x; - obj80->obj.pos.y += obj80->vel.y; - obj80->obj.pos.z += obj80->vel.z; +void Obj42_Update(Object_80* this) { + this->obj.pos.x += this->vel.x; + this->obj.pos.y += this->vel.y; + this->obj.pos.z += this->vel.z; - switch (obj80->state) { + switch (this->state) { case 0: - obj80->vel.y -= 1.0f; + this->vel.y -= 1.0f; - if (obj80->obj.pos.y < gGroundLevel + 40.0f) { - obj80->obj.pos.y = gGroundLevel + 40.0f; - AUDIO_PLAY_SFX(0x19130003, obj80->sfxSource, 0); - obj80->state = 2; - obj80->vel.y = 0.0f; + if (this->obj.pos.y < gGroundLevel + 40.0f) { + this->obj.pos.y = gGroundLevel + 40.0f; + AUDIO_PLAY_SFX(0x19130003, this->sfxSource, 0); + this->state = 2; + this->vel.y = 0.0f; } break; @@ -363,7 +362,7 @@ void func_enmy2_8006B95C(Object_80* obj80) { break; case 1: - obj80->obj.rot.x += 10.0f; + this->obj.rot.x += 10.0f; break; } } @@ -395,97 +394,96 @@ void func_enmy2_8006BB1C(f32 xPos, f32 yPos, f32 zPos) { } } -void func_enmy2_8006BB78(Actor* actor) { +void Actor196_Update(Actor* this) { Vec3f sp44; - switch (actor->state) { + switch (this->state) { case 0: - actor->fwork[10] = RAND_FLOAT_CENTERED(1000.0f); - actor->state = 1; + this->fwork[10] = RAND_FLOAT_CENTERED(1000.0f); + this->state = 1; break; case 1: - switch (actor->unk_046) { + switch (this->unk_046) { case 0: - actor->fwork[0] += 2.0f; - if (actor->fwork[0] > 10.0f) { - actor->unk_046 = 1; + this->fwork[0] += 2.0f; + if (this->fwork[0] > 10.0f) { + this->unk_046 = 1; } break; case 1: - actor->fwork[0] -= 2.0f; - if (actor->fwork[0] < -10.0f) { - actor->unk_046 = 0; + this->fwork[0] -= 2.0f; + if (this->fwork[0] < -10.0f) { + this->unk_046 = 0; } break; } - Math_Vec3fFromAngles(&sp44, actor->obj.rot.x, actor->obj.rot.y, 10.0f); - actor->vel.x = sp44.x; - actor->vel.y = sp44.y; - actor->vel.z = sp44.z; - if (fabsf((actor->obj.pos.z + actor->fwork[10]) - gPlayer[0].unk_138) < 3000.0f) { - actor->state = 2; - actor->timer_0BC = 20; - actor->vel.z = 0.0f; - actor->vel.x = 0.0f; + Math_Vec3fFromAngles(&sp44, this->obj.rot.x, this->obj.rot.y, 10.0f); + this->vel.x = sp44.x; + this->vel.y = sp44.y; + this->vel.z = sp44.z; + if (fabsf((this->obj.pos.z + this->fwork[10]) - gPlayer[0].unk_138) < 3000.0f) { + this->state = 2; + this->timer_0BC = 20; + this->vel.z = 0.0f; + this->vel.x = 0.0f; } break; case 2: - if (actor->timer_0BC == 0) { - actor->state = 3; - actor->unk_0B6 = 1; - actor->obj.pos.y += 30.0f; - actor->timer_0BC = 30; - actor->vel.y = 30.0f; - actor->gravity = 1.0f; + if (this->timer_0BC == 0) { + this->state = 3; + this->unk_0B6 = 1; + this->obj.pos.y += 30.0f; + this->timer_0BC = 30; + this->vel.y = 30.0f; + this->gravity = 1.0f; } break; case 3: - if (actor->timer_0BC == 1) { - func_effect_8007F11C(OBJ_EFFECT_353, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, - D_ctx_80177828); + if (this->timer_0BC == 1) { + func_effect_8007F11C(OBJ_EFFECT_353, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, D_ctx_80177828); } - if (actor->vel.y < 12.0f) { - Math_SmoothStepToF(&actor->obj.rot.x, 180.0f, 0.1f, 7.0f, 0.01f); + if (this->vel.y < 12.0f) { + Math_SmoothStepToF(&this->obj.rot.x, 180.0f, 0.1f, 7.0f, 0.01f); } - if (actor->obj.pos.y < (gGroundLevel + 10.0f)) { - actor->obj.pos.y = gGroundLevel; - actor->state = 4; - actor->unk_0B6 = 0; - actor->vel.y = 0.0f; - actor->gravity = 0.0f; - actor->obj.rot.x = 0.0f; + if (this->obj.pos.y < (gGroundLevel + 10.0f)) { + this->obj.pos.y = gGroundLevel; + this->state = 4; + this->unk_0B6 = 0; + this->vel.y = 0.0f; + this->gravity = 0.0f; + this->obj.rot.x = 0.0f; } break; case 4: - if (actor->timer_0BC == 0) { - actor->state = 0; - actor->obj.rot.y = RAND_FLOAT(360.0f); + if (this->timer_0BC == 0) { + this->state = 0; + this->obj.rot.y = RAND_FLOAT(360.0f); } break; } - if ((actor->obj.pos.y <= (gGroundLevel + 10.0f)) && !(gGameFrameCount & 7)) { - func_enmy2_8006BB1C(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z); + if ((this->obj.pos.y <= (gGroundLevel + 10.0f)) && !(gGameFrameCount & 7)) { + func_enmy2_8006BB1C(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z); } if (!(gGameFrameCount & 7)) { - func_enmy2_8006A900(RAND_FLOAT_CENTERED(50.0f) + actor->obj.pos.x, actor->obj.pos.y + 10.0f, - RAND_FLOAT_CENTERED(50.0f) + actor->obj.pos.z, 0.5f); + func_enmy2_8006A900(RAND_FLOAT_CENTERED(50.0f) + this->obj.pos.x, this->obj.pos.y + 10.0f, + RAND_FLOAT_CENTERED(50.0f) + this->obj.pos.z, 0.5f); } - if ((actor->unk_0D0 != 0) && (actor->unk_0B6 != 0)) { - func_effect_8007BFFC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 0.0f, actor->vel.y, 0.0f, 3.0f, 5); - Object_Kill(&actor->obj, actor->sfxSource); - actor->unk_044 = 1; - func_enmy_80066254(actor); + if ((this->unk_0D0 != 0) && (this->unk_0B6 != 0)) { + func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 0.0f, this->vel.y, 0.0f, 3.0f, 5); + Object_Kill(&this->obj, this->sfxSource); + this->itemDrop = DROP_SILVER_RING; + func_enmy_80066254(this); } - actor->unk_0D0 = 0; + this->unk_0D0 = 0; } static f32 D_800D001C[5] = { 0.0f, 30.0f, 60.0f, -60.0f, -30.0f }; // could be in-function @@ -498,123 +496,123 @@ void func_enmy2_8006BF7C(f32 xPos, f32 yPos, f32 zPos) { } static Vec3f D_800D0030 = { 0.0f, -10.0f, 0.0f }; // could be in-function -void func_enmy2_8006C008(Actor* actor) { +void Actor189_Update(Actor* this) { f32 sp4C; f32 sp48; f32 sp44; s32 sp40; - switch (actor->state) { + switch (this->state) { case 40: - if (actor->unk_04A & 4) { - actor->obj.pos.x = gPlayer[0].pos.x + actor->fwork[3]; - actor->obj.pos.z = gPlayer[0].unk_138 + actor->fwork[4]; + if (this->unk_04A & 4) { + this->obj.pos.x = gPlayer[0].pos.x + this->fwork[3]; + this->obj.pos.z = gPlayer[0].unk_138 + this->fwork[4]; } - actor->obj.rot.x += actor->fwork[0]; - actor->obj.rot.y += actor->fwork[1]; - actor->obj.rot.z += actor->fwork[2]; + this->obj.rot.x += this->fwork[0]; + this->obj.rot.y += this->fwork[1]; + this->obj.rot.z += this->fwork[2]; - if (((actor->unk_04A & 1) == 1) && !(actor->timer_0BC & 3)) { - func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->scale); + if (((this->unk_04A & 1) == 1) && !(this->timer_0BC & 3)) { + func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->scale); } - if ((actor->fwork[5] + actor->obj.pos.y) < 0.0f) { - if (actor->iwork[0] >= 2) { - actor->fwork[2] = 0.0f; - actor->fwork[1] = 0.0f; - actor->fwork[0] = 0.0f; - actor->vel.x = 0.0f; - actor->vel.y = 0.0f; - actor->vel.z = 0.0f; - actor->gravity = 0.0f; + if ((this->fwork[5] + this->obj.pos.y) < 0.0f) { + if (this->iwork[0] >= 2) { + this->fwork[2] = 0.0f; + this->fwork[1] = 0.0f; + this->fwork[0] = 0.0f; + this->vel.x = 0.0f; + this->vel.y = 0.0f; + this->vel.z = 0.0f; + this->gravity = 0.0f; } else { - if (actor->unk_04A & 4) { - switch (actor->unk_046) { + if (this->unk_04A & 4) { + switch (this->unk_046) { case 2: - AUDIO_PLAY_SFX(0x19000024, actor->sfxSource, 4); + AUDIO_PLAY_SFX(0x19000024, this->sfxSource, 4); break; case 25: - AUDIO_PLAY_SFX(0x29003031, actor->sfxSource, 4); + AUDIO_PLAY_SFX(0x29003031, this->sfxSource, 4); break; } } - Math_SmoothStepToF(&actor->fwork[0], 0.0f, 0.8f, 1.0f, 0.01f); - Math_SmoothStepToF(&actor->fwork[1], 0.0f, 0.8f, 1.0f, 0.01f); - Math_SmoothStepToF(&actor->fwork[2], 0.0f, 0.8f, 1.0f, 0.01f); - Math_SmoothStepToF(&actor->vel.x, 0.0f, 0.5f, 1.0f, 0.01f); - actor->obj.pos.y = 0.0f; - actor->iwork[0] += 1; - if (actor->vel.y < 0.0f) { - if (actor->unk_04A & 2) { - actor->vel.y = actor->vel.y * -0.05f; + Math_SmoothStepToF(&this->fwork[0], 0.0f, 0.8f, 1.0f, 0.01f); + Math_SmoothStepToF(&this->fwork[1], 0.0f, 0.8f, 1.0f, 0.01f); + Math_SmoothStepToF(&this->fwork[2], 0.0f, 0.8f, 1.0f, 0.01f); + Math_SmoothStepToF(&this->vel.x, 0.0f, 0.5f, 1.0f, 0.01f); + this->obj.pos.y = 0.0f; + this->iwork[0] += 1; + if (this->vel.y < 0.0f) { + if (this->unk_04A & 2) { + this->vel.y = this->vel.y * -0.05f; } else { - actor->vel.y = actor->vel.y * -0.3f; + this->vel.y = this->vel.y * -0.3f; } } } - actor->unk_04A &= ~4; + this->unk_04A &= ~4; } break; case 45: - actor->obj.rot.y += actor->fwork[0]; - actor->obj.rot.z += actor->fwork[1]; + this->obj.rot.y += this->fwork[0]; + this->obj.rot.z += this->fwork[1]; break; case 46: - actor->obj.rot.x += actor->fwork[0]; - actor->obj.rot.y += actor->fwork[1]; - actor->obj.rot.z += actor->fwork[2]; - - Ground_801B6E20(actor->obj.pos.x, actor->obj.pos.z + D_ctx_80177D20, &sp4C, &sp48, &sp4C); - - if (actor->obj.pos.y < sp48) { - actor->obj.pos.y = sp48; - actor->iwork[2]++; - if (actor->iwork[2] >= 2) { - actor->vel.x = 0.0f; - actor->vel.y = 0.0f; - actor->vel.z = 0.0f; - actor->fwork[0] = 0.0f; - actor->fwork[1] = 0.0f; - actor->fwork[2] = 0.0f; - actor->gravity = 0.0f; + this->obj.rot.x += this->fwork[0]; + this->obj.rot.y += this->fwork[1]; + this->obj.rot.z += this->fwork[2]; + + Ground_801B6E20(this->obj.pos.x, this->obj.pos.z + D_ctx_80177D20, &sp4C, &sp48, &sp4C); + + if (this->obj.pos.y < sp48) { + this->obj.pos.y = sp48; + this->iwork[2]++; + if (this->iwork[2] >= 2) { + this->vel.x = 0.0f; + this->vel.y = 0.0f; + this->vel.z = 0.0f; + this->fwork[0] = 0.0f; + this->fwork[1] = 0.0f; + this->fwork[2] = 0.0f; + this->gravity = 0.0f; } else { - actor->vel.y = -actor->vel.y * 0.3f; + this->vel.y = -this->vel.y * 0.3f; } } break; case 47: - Ground_801B6E20(actor->obj.pos.x, actor->obj.pos.z + D_ctx_80177D20, &sp4C, &sp48, &sp4C); + Ground_801B6E20(this->obj.pos.x, this->obj.pos.z + D_ctx_80177D20, &sp4C, &sp48, &sp4C); - if (actor->obj.pos.y < actor->fwork[3] + (-100.0f + sp48)) { - actor->obj.pos.y = actor->fwork[3] + sp48; - actor->iwork[0] = 0; - actor->iwork[2] = 1; - actor->vel.x = 0.0f; - actor->vel.y = 0.0f; - actor->vel.z = 0.0f; - actor->gravity = 0.0f; - actor->fwork[0] = 0.0f; - actor->fwork[1] = 0.0f; - actor->fwork[2] = 0.0f; + if (this->obj.pos.y < this->fwork[3] + (-100.0f + sp48)) { + this->obj.pos.y = this->fwork[3] + sp48; + this->iwork[0] = 0; + this->iwork[2] = 1; + this->vel.x = 0.0f; + this->vel.y = 0.0f; + this->vel.z = 0.0f; + this->gravity = 0.0f; + this->fwork[0] = 0.0f; + this->fwork[1] = 0.0f; + this->fwork[2] = 0.0f; } - actor->obj.rot.x += actor->fwork[0]; - actor->obj.rot.y += actor->fwork[1]; - actor->obj.rot.z += actor->fwork[2]; + this->obj.rot.x += this->fwork[0]; + this->obj.rot.y += this->fwork[1]; + this->obj.rot.z += this->fwork[2]; - if ((actor->iwork[0] == 1) && !(gGameFrameCount & 7)) { - func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 2.0f); + if ((this->iwork[0] == 1) && !(gGameFrameCount & 7)) { + func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 2.0f); } - if (actor->iwork[2] == 1) { - if ((actor->iwork[1] == 1) && ((actor->unk_048 == 8) || (actor->unk_048 == 9))) { - func_effect_8007D2C8(actor->obj.pos.x, sp48 + 20.0f, actor->obj.pos.z, 8.0f); + if (this->iwork[2] == 1) { + if ((this->iwork[1] == 1) && ((this->unk_048 == 8) || (this->unk_048 == 9))) { + func_effect_8007D2C8(this->obj.pos.x, sp48 + 20.0f, this->obj.pos.z, 8.0f); } - Object_Kill(&actor->obj, actor->sfxSource); + Object_Kill(&this->obj, this->sfxSource); } break; @@ -624,200 +622,192 @@ void func_enmy2_8006C008(Actor* actor) { case 52: case 53: case 55: - if (((actor->timer_0BC == 0) || (func_enmy_8006351C(actor->index, &actor->obj.pos, &D_800D0030, 1) != 0) || - (actor->obj.pos.y < (gGroundLevel + 10.0f))) && - (actor->timer_0BE == 0)) { - func_effect_8007B8F8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + 50.0f, - actor->scale * 10.0f); - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); + if (((this->timer_0BC == 0) || (func_enmy_8006351C(this->index, &this->obj.pos, &D_800D0030, 1) != 0) || + (this->obj.pos.y < (gGroundLevel + 10.0f))) && + (this->timer_0BE == 0)) { + func_effect_8007B8F8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + 50.0f, this->scale * 10.0f); + Object_Kill(&this->obj, this->sfxSource); + func_effect_8007A6F0(&this->obj.pos, 0x2903A008); } break; case 56: - Math_SmoothStepToF(&actor->scale, 0.0f, 0.1f, 2.0f, 0.0001f); - if (((actor->timer_0BC == 0) || (func_enmy_8006351C(actor->index, &actor->obj.pos, &D_800D0030, 1) != 0) || - (actor->obj.pos.y < (gGroundLevel + 10.0f))) && - (actor->timer_0BE == 0)) { - func_effect_8007B8F8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + 50.0f, - actor->scale * 10.0f); - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); + Math_SmoothStepToF(&this->scale, 0.0f, 0.1f, 2.0f, 0.0001f); + if (((this->timer_0BC == 0) || (func_enmy_8006351C(this->index, &this->obj.pos, &D_800D0030, 1) != 0) || + (this->obj.pos.y < (gGroundLevel + 10.0f))) && + (this->timer_0BE == 0)) { + func_effect_8007B8F8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + 50.0f, this->scale * 10.0f); + Object_Kill(&this->obj, this->sfxSource); + func_effect_8007A6F0(&this->obj.pos, 0x2903A008); } break; case 58: - if (actor->unk_046 == 0) { - actor->unk_046++; - actor->fwork[0] = RAND_FLOAT_CENTERED(30.0f); - actor->fwork[1] = RAND_FLOAT_CENTERED(30.0f); - actor->fwork[2] = RAND_FLOAT_CENTERED(30.0f); - } - - actor->obj.rot.x += actor->fwork[0]; - actor->obj.rot.y += actor->fwork[1]; - actor->obj.rot.z += actor->fwork[2]; - - if (((actor->timer_0BC == 0) || (func_enmy_8006351C(actor->index, &actor->obj.pos, &D_800D0030, 1) != 0) || - (actor->obj.pos.y < (gGroundLevel + 10.0f))) && - (actor->timer_0BE == 0)) { - func_effect_8007B8F8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + 50.0f, - actor->scale * 10.0f); - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); + if (this->unk_046 == 0) { + this->unk_046++; + this->fwork[0] = RAND_FLOAT_CENTERED(30.0f); + this->fwork[1] = RAND_FLOAT_CENTERED(30.0f); + this->fwork[2] = RAND_FLOAT_CENTERED(30.0f); + } + + this->obj.rot.x += this->fwork[0]; + this->obj.rot.y += this->fwork[1]; + this->obj.rot.z += this->fwork[2]; + + if (((this->timer_0BC == 0) || (func_enmy_8006351C(this->index, &this->obj.pos, &D_800D0030, 1) != 0) || + (this->obj.pos.y < (gGroundLevel + 10.0f))) && + (this->timer_0BE == 0)) { + func_effect_8007B8F8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + 50.0f, this->scale * 10.0f); + Object_Kill(&this->obj, this->sfxSource); + func_effect_8007A6F0(&this->obj.pos, 0x2903A008); } break; case 54: - if (((actor->timer_0BC == 0) || (func_enmy_8006351C(actor->index, &actor->obj.pos, &D_800D0030, 1) != 0) || - (actor->obj.pos.y < (gGroundLevel + 10.0f))) && - (actor->timer_0BE == 0)) { - func_effect_8007B8F8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + 70.0f, - actor->scale * 20.0f); - func_effect_8007B8F8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + 70.0f, - actor->scale * 20.0f); - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); + if (((this->timer_0BC == 0) || (func_enmy_8006351C(this->index, &this->obj.pos, &D_800D0030, 1) != 0) || + (this->obj.pos.y < (gGroundLevel + 10.0f))) && + (this->timer_0BE == 0)) { + func_effect_8007B8F8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + 70.0f, this->scale * 20.0f); + func_effect_8007B8F8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + 70.0f, this->scale * 20.0f); + Object_Kill(&this->obj, this->sfxSource); + func_effect_8007A6F0(&this->obj.pos, 0x2903A008); } break; case 50: - if ((actor->iwork[0] == 2) && (actor->timer_0BC == 0)) { - func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 5.0f); - actor->timer_0BC = 4; + if ((this->iwork[0] == 2) && (this->timer_0BC == 0)) { + func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 5.0f); + this->timer_0BC = 4; } - actor->obj.rot.x += actor->fwork[0]; - actor->obj.rot.y += actor->fwork[1]; - actor->obj.rot.z += actor->fwork[2]; - if (func_enmy_8006351C(actor->index, &actor->obj.pos, &D_tank_800C9F2C, 1) != 0) { - actor->vel.x *= -0.7f; + this->obj.rot.x += this->fwork[0]; + this->obj.rot.y += this->fwork[1]; + this->obj.rot.z += this->fwork[2]; + if (func_enmy_8006351C(this->index, &this->obj.pos, &D_tank_800C9F2C, 1) != 0) { + this->vel.x *= -0.7f; } - if (actor->obj.pos.y < gGroundLevel) { - Object_Kill(&actor->obj, actor->sfxSource); + if (this->obj.pos.y < gGroundLevel) { + Object_Kill(&this->obj, this->sfxSource); } break; case 57: - actor->obj.rot.x += actor->fwork[0]; - actor->obj.rot.y += actor->fwork[1]; - actor->obj.rot.z += actor->fwork[2]; + this->obj.rot.x += this->fwork[0]; + this->obj.rot.y += this->fwork[1]; + this->obj.rot.z += this->fwork[2]; - if (func_enmy_8006351C(actor->index, &actor->obj.pos, &D_tank_800C9F2C, 1) != 0) { - actor->vel.x *= -0.7f; + if (func_enmy_8006351C(this->index, &this->obj.pos, &D_tank_800C9F2C, 1) != 0) { + this->vel.x *= -0.7f; } - if (actor->obj.pos.y < gGroundLevel) { - if (actor->iwork[0] >= 3) { - actor->vel.y = 0.0f; - actor->gravity = 0.0f; - actor->fwork[2] = 0.0f; - actor->fwork[1] = 0.0f; - actor->fwork[0] = 0.0f; + if (this->obj.pos.y < gGroundLevel) { + if (this->iwork[0] >= 3) { + this->vel.y = 0.0f; + this->gravity = 0.0f; + this->fwork[2] = 0.0f; + this->fwork[1] = 0.0f; + this->fwork[0] = 0.0f; } else { - actor->iwork[0]++; - actor->vel.y = -actor->vel.y * 0.7f; - actor->obj.pos.y = gGroundLevel; - actor->fwork[0] *= 0.5f; - actor->fwork[1] *= 0.5f; - actor->fwork[2] *= 0.5f; + this->iwork[0]++; + this->vel.y = -this->vel.y * 0.7f; + this->obj.pos.y = gGroundLevel; + this->fwork[0] *= 0.5f; + this->fwork[1] *= 0.5f; + this->fwork[2] *= 0.5f; } } break; default: - if (actor->unk_046 == 0) { - actor->unk_046++; - actor->fwork[10] = RAND_FLOAT_CENTERED(30.0f); - actor->fwork[11] = RAND_FLOAT_CENTERED(30.0f); - actor->fwork[12] = RAND_FLOAT_CENTERED(30.0f); - } - - actor->obj.rot.x += actor->fwork[10]; - actor->obj.rot.y += actor->fwork[11]; - actor->obj.rot.z += actor->fwork[12]; - - if (actor->state == 0x46) { - if ((actor->timer_0BC == 0) || - (func_enmy_8006351C(actor->index, &actor->obj.pos, &D_800D0030, 1) != 0) || - (actor->obj.pos.y < (gGroundLevel + 10.0f))) { - Object_Kill(&actor->obj, actor->sfxSource); + if (this->unk_046 == 0) { + this->unk_046++; + this->fwork[10] = RAND_FLOAT_CENTERED(30.0f); + this->fwork[11] = RAND_FLOAT_CENTERED(30.0f); + this->fwork[12] = RAND_FLOAT_CENTERED(30.0f); + } + + this->obj.rot.x += this->fwork[10]; + this->obj.rot.y += this->fwork[11]; + this->obj.rot.z += this->fwork[12]; + + if (this->state == 70) { + if ((this->timer_0BC == 0) || (func_enmy_8006351C(this->index, &this->obj.pos, &D_800D0030, 1) != 0) || + (this->obj.pos.y < (gGroundLevel + 10.0f))) { + Object_Kill(&this->obj, this->sfxSource); } - } else if (actor->state == 0x27) { - if (((actor->timer_0BC == 0) || - (func_enmy_8006351C(actor->index, &actor->obj.pos, &D_800D0030, 1) != 0) || - (actor->obj.pos.y < (gGroundLevel + 10.0f))) && - (actor->timer_0BE == 0)) { - func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 10.0f); - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); + } else if (this->state == 39) { + if (((this->timer_0BC == 0) || (func_enmy_8006351C(this->index, &this->obj.pos, &D_800D0030, 1) != 0) || + (this->obj.pos.y < (gGroundLevel + 10.0f))) && + (this->timer_0BE == 0)) { + func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 10.0f); + Object_Kill(&this->obj, this->sfxSource); + func_effect_8007A6F0(&this->obj.pos, 0x2903A008); } - } else if (((actor->state >= 0x29) && (actor->state < 0x2D)) || (actor->state == 0x3B)) { - if (((actor->timer_0BC == 0) || - (func_enmy_8006351C(actor->index, &actor->obj.pos, &D_800D0030, 1) != 0)) && - (actor->timer_0BE == 0)) { - func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 2.0f * actor->scale); - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); + } else if (((this->state >= 41) && (this->state < 45)) || (this->state == 59)) { + if (((this->timer_0BC == 0) || + (func_enmy_8006351C(this->index, &this->obj.pos, &D_800D0030, 1) != 0)) && + (this->timer_0BE == 0)) { + func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 2.0f * this->scale); + Object_Kill(&this->obj, this->sfxSource); + func_effect_8007A6F0(&this->obj.pos, 0x2903A008); } - if (func_play_800A73E4(&sp44, &sp40, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z)) { - func_effect_8007B228(actor->obj.pos.x, sp44, actor->obj.pos.z, 2.0f); - Object_Kill(&actor->obj, actor->sfxSource); + if (func_play_800A73E4(&sp44, &sp40, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z)) { + func_effect_8007B228(this->obj.pos.x, sp44, this->obj.pos.z, 2.0f); + Object_Kill(&this->obj, this->sfxSource); } - } else if (actor->state >= 0xA) { - if (!(actor->timer_0BC & 3)) { - func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->scale); + } else if (this->state >= 10) { + if (!(this->timer_0BC & 3)) { + func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->scale); } - if (((actor->timer_0BC == 0) || - (func_enmy_8006351C(actor->index, &actor->obj.pos, &D_800D0030, 1) != 0) || - (actor->obj.pos.y < (gGroundLevel + 10.0f))) && - (actor->timer_0BE == 0)) { - func_effect_8007BFFC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->vel.x, - actor->vel.y, actor->vel.z, actor->scale * 1.5f, 4); - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); + if (((this->timer_0BC == 0) || (func_enmy_8006351C(this->index, &this->obj.pos, &D_800D0030, 1) != 0) || + (this->obj.pos.y < (gGroundLevel + 10.0f))) && + (this->timer_0BE == 0)) { + func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->vel.x, this->vel.y, + this->vel.z, this->scale * 1.5f, 4); + Object_Kill(&this->obj, this->sfxSource); + func_effect_8007A6F0(&this->obj.pos, 0x2903A008); } } else { - if ((actor->state == 3) && !(actor->timer_0BC & 7)) { - func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 1.5f); + if ((this->state == 3) && !(this->timer_0BC & 7)) { + func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 1.5f); } - if ((func_enmy_8006351C(actor->index, &actor->obj.pos, &D_800D0030, 1) != 0) || - (actor->obj.pos.y < (gGroundLevel + 10.0f))) { + if ((func_enmy_8006351C(this->index, &this->obj.pos, &D_800D0030, 1) != 0) || + (this->obj.pos.y < (gGroundLevel + 10.0f))) { if (gLevelType == LEVELTYPE_SPACE) { - func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 2.0f); - Object_Kill(&actor->obj, actor->sfxSource); + func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 2.0f); + Object_Kill(&this->obj, this->sfxSource); return; } - actor->vel.y *= -0.2f; - actor->obj.pos.y += actor->vel.y * 5.0f; - actor->iwork[0]++; + this->vel.y *= -0.2f; + this->obj.pos.y += this->vel.y * 5.0f; + this->iwork[0]++; - if (actor->iwork[0] >= 2) { - Object_Kill(&actor->obj, actor->sfxSource); + if (this->iwork[0] >= 2) { + Object_Kill(&this->obj, this->sfxSource); } - if ((actor->state != 2) && (actor->state != 4)) { - func_enmy2_8006BF7C(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z); + if ((this->state != 2) && (this->state != 4)) { + func_enmy2_8006BF7C(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z); } else if (gCurrentLevel == LEVEL_FORTUNA) { - func_effect_8007BC7C(RAND_FLOAT_CENTERED(10.0f) + actor->obj.pos.x, actor->obj.pos.y, - actor->obj.pos.z, 1.0f); - func_effect_8007BC7C(RAND_FLOAT_CENTERED(10.0f) + actor->obj.pos.x, actor->obj.pos.y, - actor->obj.pos.z, 1.0f); - func_effect_8007BC7C(RAND_FLOAT_CENTERED(10.0f) + actor->obj.pos.x, actor->obj.pos.y, - actor->obj.pos.z, 1.0f); + func_effect_8007BC7C(RAND_FLOAT_CENTERED(10.0f) + this->obj.pos.x, this->obj.pos.y, + this->obj.pos.z, 1.0f); + func_effect_8007BC7C(RAND_FLOAT_CENTERED(10.0f) + this->obj.pos.x, this->obj.pos.y, + this->obj.pos.z, 1.0f); + func_effect_8007BC7C(RAND_FLOAT_CENTERED(10.0f) + this->obj.pos.x, this->obj.pos.y, + this->obj.pos.z, 1.0f); } } - if (actor->state == 4) { - if ((gCurrentLevel == LEVEL_KATINA) && (actor->timer_0BC == 0)) { - Object_Kill(&actor->obj, actor->sfxSource); + if (this->state == 4) { + if ((gCurrentLevel == LEVEL_KATINA) && (this->timer_0BC == 0)) { + Object_Kill(&this->obj, this->sfxSource); } } else { - if (actor->timer_0BC & 1) { - func_effect_8007D24C(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 1.0f); + if (this->timer_0BC & 1) { + func_effect_8007D24C(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 1.0f); } - if ((gLevelType == LEVELTYPE_SPACE) && (actor->timer_0BC == 0)) { - Object_Kill(&actor->obj, actor->sfxSource); + if ((gLevelType == LEVELTYPE_SPACE) && (this->timer_0BC == 0)) { + Object_Kill(&this->obj, this->sfxSource); } } } @@ -837,9 +827,9 @@ void func_enmy2_8006D0F4(Actor* actor) { s32 count; Hitbox* hitbox; - D_80161A7C = 110; - D_80161A80 = 110; - D_80161A84 = 110; + D_ctx_80161A7C = 110; + D_ctx_80161A80 = 110; + D_ctx_80161A84 = 110; D_ctx_80178544 = 40; for (i = 0; i < ARRAY_COUNT(gObjects80); i++) { @@ -864,9 +854,9 @@ void func_enmy2_8006D0F4(Actor* actor) { hitbox = (Hitbox*) hitboxData; if (func_play_800A78C4(hitbox, gObjects80[i].obj.pos.x, gObjects80[i].obj.pos.y, gObjects80[i].obj.pos.z, temp_fs0, temp_fs1, temp_fs2)) { - D_80161A7C = 10; - D_80161A80 = 10; - D_80161A84 = 10; + D_ctx_80161A7C = 10; + D_ctx_80161A80 = 10; + D_ctx_80161A84 = 10; actor->unk_0C8 = 5; } hitboxData += 6; @@ -876,8 +866,8 @@ void func_enmy2_8006D0F4(Actor* actor) { } } -void func_enmy2_8006D350(Object_80* obj80) { - obj80->obj.rot.z += 1.0f; +void Obj39_Update(Object_80* this) { + this->obj.rot.z += 1.0f; } static UnkStruct_D003C D_800D003C[108] = { @@ -996,7 +986,7 @@ static u8 D_800D0DBC[6][4] = { { 80, 255, 80, 255 }, { 255, 80, 80, 255 }, { 255, 255, 80, 255 }, }; -void func_enmy2_8006D36C(Actor* actor) { +void ActorEvent_ProcessScript(Actor* this) { u16** levelScripts; u16* actorScript; u16* msg; @@ -1051,527 +1041,527 @@ void func_enmy2_8006D36C(Actor* actor) { levelScripts = SEGMENTED_TO_VIRTUAL(D_CO_603D9E8); break; } - actorScript = SEGMENTED_TO_VIRTUAL(levelScripts[actor->aiType]); + actorScript = SEGMENTED_TO_VIRTUAL(levelScripts[this->aiType]); - switch (actorScript[actor->aiIndex] & (0x7F << 9)) { - case EVOP_STOP_SCRIPT << 9: - actor->state = 200; - if (actor->info.unk_10 > 10000.0f) { - actor->info.unk_10 = 100.0f; + switch (EV_OPC_MASK(actorScript[this->aiIndex])) { + case EV_OPC(EVOP_STOP_SCRIPT): + this->state = EVSTATE_SCRIPT_END; + if (this->info.unk_10 > 10000.0f) { + this->info.unk_10 = 100.0f; } break; - case EVOP_INIT_ACTOR << 9: - Audio_KillSfxBySource(actor->sfxSource); - actor->unk_0B4 = actorScript[actor->aiIndex + 1]; + case EV_OPC(EVOP_INIT_ACTOR): + Audio_KillSfxBySource(this->sfxSource); + this->unk_0B4 = actorScript[this->aiIndex + 1]; - if (actor->unk_0B4 == 40) { - actor->timer_0C2 = 10000; + if (this->unk_0B4 == EINFO_40) { + this->timer_0C2 = 10000; } else { - actor->timer_0C2 = 0; + this->timer_0C2 = 0; } - actor->fwork[11] = 0.0f; - actor->fwork[12] = 0.0f; + this->fwork[11] = 0.0f; + this->fwork[12] = 0.0f; - if ((actor->unk_0B4 == 64) || (actor->unk_0B4 == 81)) { - actor->fwork[15] = 0.0f; - } else if (actor->unk_0B4 == 79) { - actor->info.drawType = 2; + if ((this->unk_0B4 == EINFO_64) || (this->unk_0B4 == EINFO_81)) { + this->fwork[15] = 0.0f; + } else if (this->unk_0B4 == EINFO_79) { + this->info.drawType = 2; } - actor->health = actorScript[actor->aiIndex] & 0x1FF; - actor->aiIndex += 2; + this->health = actorScript[this->aiIndex] & 0x1FF; + this->aiIndex += 2; - if ((actor->unk_0B4 >= 200) && (actor->unk_0B4 < 300)) { - actor->unk_046 = 100; - actor->info.hitbox = D_edata_800CBEC4; - actor->info.unk_1C = 1.0f; + if ((this->unk_0B4 >= EINFO_200) && (this->unk_0B4 < EINFO_300)) { + this->unk_046 = 100; + this->info.hitbox = D_edata_800CBEC4; + this->info.unk_1C = 1.0f; for (i = 0; i < 2; i++) { if (D_ctx_80176550[i] == 0) { D_ctx_80176550[i] = 1; - actor->unk_046 = i; + this->unk_046 = i; for (j = 0; j < 100; j++) { - D_ctx_80176878[i][j] = actor->obj.pos.y; - D_ctx_80176B98[i][j] = actor->obj.pos.z; + D_ctx_80176878[i][j] = this->obj.pos.y; + D_ctx_80176B98[i][j] = this->obj.pos.z; } - if (actor->unk_0B4 == 200) { - AUDIO_PLAY_SFX(0x11032049, actor->sfxSource, 4); + if (this->unk_0B4 == EINFO_200) { + AUDIO_PLAY_SFX(0x11032049, this->sfxSource, 4); } break; } } - if (actor->unk_046 == 100) { - Object_Kill(&actor->obj, actor->sfxSource); + if (this->unk_046 == 100) { + Object_Kill(&this->obj, this->sfxSource); } } - if ((actor->unk_0B4 == 2) || (actor->unk_0B4 == 43)) { - actor->unk_0C9 = 1; - actor->iwork[11] = 1; + if ((this->unk_0B4 == EINFO_2) || (this->unk_0B4 == EINFO_43)) { + this->unk_0C9 = 1; + this->iwork[11] = 1; } - if (actor->unk_0B4 == 81) { - actor->unk_0C9 = 1; + if (this->unk_0B4 == EINFO_81) { + this->unk_0C9 = 1; } if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) { - if (actor->unk_0B4 == 86) { - Audio_PlayFanfare(SEQ_ID_54, 20, 10, 10); + if (this->unk_0B4 == EINFO_86) { + Audio_PlayFanfare(SEQ_ID_KATT, 20, 10, 10); } - if (actor->unk_0B4 == 85) { - Audio_PlayFanfare(SEQ_ID_55, 20, 10, 10); + if (this->unk_0B4 == EINFO_85) { + Audio_PlayFanfare(SEQ_ID_BILL, 20, 10, 10); } } - if (actor->unk_0B4 == 103) { - actor->unk_0B6 = 0; + if (this->unk_0B4 == EINFO_103) { + this->unk_0B6 = 0; } - if (actor->unk_0B4 == 104) { - actor->unk_0B6 = Animation_GetFrameCount(&D_VE2_6014658) - 1; + if (this->unk_0B4 == EINFO_104) { + this->unk_0B6 = Animation_GetFrameCount(&D_VE2_6014658) - 1; } - if (actor->unk_0B4 < 200) { - actor->info.hitbox = SEGMENTED_TO_VIRTUAL(D_800D003C[actor->unk_0B4].hitbox); - actor->scale = D_800D003C[actor->unk_0B4].scale; - actor->info.unk_16 = D_800D003C[actor->unk_0B4].info_unk_16; - actor->info.unk_14 = D_800D003C[actor->unk_0B4].info_unk_14; - actor->info.unk_19 = D_800D003C[actor->unk_0B4].info_unk_19; - actor->info.unk_1C = D_800D003C[actor->unk_0B4].info_unk_1C; - actor->info.bonus = D_800D003C[actor->unk_0B4].bonus; + if (this->unk_0B4 < EINFO_200) { + this->info.hitbox = SEGMENTED_TO_VIRTUAL(D_800D003C[this->unk_0B4].hitbox); + this->scale = D_800D003C[this->unk_0B4].scale; + this->info.unk_16 = D_800D003C[this->unk_0B4].info_unk_16; + this->info.unk_14 = D_800D003C[this->unk_0B4].info_unk_14; + this->info.unk_19 = D_800D003C[this->unk_0B4].info_unk_19; + this->info.unk_1C = D_800D003C[this->unk_0B4].info_unk_1C; + this->info.bonus = D_800D003C[this->unk_0B4].bonus; - if (actor->unk_0B4 == 78) { - actor->info.damage = 0; + if (this->unk_0B4 == EINFO_78) { + this->info.damage = 0; } - actor->info.unk_10 = D_800D003C[actor->unk_0B4].info_unk_10; - actor->fwork[25] = D_800D003C[actor->unk_0B4].unk_10; + this->info.unk_10 = D_800D003C[this->unk_0B4].info_unk_10; + this->fwork[25] = D_800D003C[this->unk_0B4].unk_10; - switch (D_800D003C[actor->unk_0B4].sfx) { + switch (D_800D003C[this->unk_0B4].sfx) { case 1: - if (!((gCurrentLevel == LEVEL_SOLAR) || (actor->unk_0B4 == 6) || - ((gCurrentLevel == LEVEL_CORNERIA) && (actor->unk_0B4 == 8)))) { - AUDIO_PLAY_SFX(0x31000011, actor->sfxSource, 4); + if (!((gCurrentLevel == LEVEL_SOLAR) || (this->unk_0B4 == EINFO_6) || + ((gCurrentLevel == LEVEL_CORNERIA) && (this->unk_0B4 == EINFO_8)))) { + AUDIO_PLAY_SFX(0x31000011, this->sfxSource, 4); } break; case 2: - AUDIO_PLAY_SFX(0x3100000C, actor->sfxSource, 4); + AUDIO_PLAY_SFX(0x3100000C, this->sfxSource, 4); break; case 3: - AUDIO_PLAY_SFX(0x11030010, actor->sfxSource, 0); + AUDIO_PLAY_SFX(0x11030010, this->sfxSource, 0); break; case 4: - AUDIO_PLAY_SFX(0x31012039, actor->sfxSource, 4); + AUDIO_PLAY_SFX(0x31012039, this->sfxSource, 4); break; case 5: - AUDIO_PLAY_SFX(0x1900302B, actor->sfxSource, 0); + AUDIO_PLAY_SFX(0x1900302B, this->sfxSource, 0); break; case 6: - AUDIO_PLAY_SFX(0x31000014, actor->sfxSource, 4); + AUDIO_PLAY_SFX(0x31000014, this->sfxSource, 4); break; case 7: - AUDIO_PLAY_SFX(0x31000015, actor->sfxSource, 4); + AUDIO_PLAY_SFX(0x31000015, this->sfxSource, 4); break; } - if (gPlayer[0].unk_138 < actor->obj.pos.z) { - actor->info.unk_10 = 3000.0f; + if (gPlayer[0].unk_138 < this->obj.pos.z) { + this->info.unk_10 = 3000.0f; } - if (actor->info.unk_16 == 0) { - actor->obj.rot.z = actor->fwork[23] = actor->unk_0F4.z; - if (actor->unk_0B4 != 31) { - actor->unk_0F4.z = 0.0f; + if (this->info.unk_16 == 0) { + this->obj.rot.z = this->fwork[23] = this->unk_0F4.z; + if (this->unk_0B4 != EINFO_31) { + this->unk_0F4.z = 0.0f; } } } - func_enmy2_8006D36C(actor); + ActorEvent_ProcessScript(this); break; - case EVOP_105 << 9: - actor->iwork[12] = actorScript[actor->aiIndex + 1]; + case EV_OPC(EVOP_SET_IWORK_12): + this->iwork[12] = actorScript[this->aiIndex + 1]; - if (actor->iwork[12] < 4) { - D_enmy2_800CFF80[actor->iwork[12]] = actor->index; + if (this->iwork[12] < 4) { + D_enmy2_800CFF80[this->iwork[12]] = this->index; } - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_113 << 9: - actor->iwork[15] = actorScript[actor->aiIndex + 1]; - actor->iwork[16] = actorScript[actor->aiIndex] & 0x1FF; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_ADD_TO_GROUP): + this->iwork[15] = actorScript[this->aiIndex + 1]; + this->iwork[16] = actorScript[this->aiIndex] & 0x1FF; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_3 << 9: - D_ctx_80177E78 = actor->index; - D_ctx_80177F10.x = actor->obj.pos.x; - D_ctx_80177F10.y = actor->obj.pos.y; - D_ctx_80177F10.z = actor->obj.pos.z; - D_ctx_80177E88.x = actor->obj.rot.x; - D_ctx_80177E88.y = actor->obj.rot.y; - D_ctx_80177E88.z = actor->obj.rot.z; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_SET_TO_IWORK_9): + D_ctx_80177E78 = this->index; + D_ctx_80177F10.x = this->obj.pos.x; + D_ctx_80177F10.y = this->obj.pos.y; + D_ctx_80177F10.z = this->obj.pos.z; + D_ctx_80177E88.x = this->obj.rot.x; + D_ctx_80177E88.y = this->obj.rot.y; + D_ctx_80177E88.z = this->obj.rot.z; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_112 << 9: - if (actorScript[actor->aiIndex + 1] == 14) { - actor->state = 10; - actor->fwork[11] = 0.0f; - actor->aiIndex += 2; + case EV_OPC(EVOP_SET_ACTION): + if (actorScript[this->aiIndex + 1] == EVACT_14) { + this->state = EVSTATE_10; + this->fwork[11] = 0.0f; + this->aiIndex += 2; break; } - if (actorScript[actor->aiIndex + 1] == 15) { - actor->info.hitbox = SEGMENTED_TO_VIRTUAL(D_edata_800CBEC4); - actor->state = 11; - actor->aiIndex += 2; + if (actorScript[this->aiIndex + 1] == EVACT_15) { + this->info.hitbox = SEGMENTED_TO_VIRTUAL(D_edata_800CBEC4); + this->state = EVSTATE_11; + this->aiIndex += 2; break; } - actor->unk_048 = actorScript[actor->aiIndex + 1]; + this->unk_048 = actorScript[this->aiIndex + 1]; - if (actor->unk_048 == 3) { - actor->timer_04C = 4; + if (this->unk_048 == EVACT_3) { + this->timer_04C = 4; } - if (actor->unk_048 == 13) { - actor->timer_0BE = 50; + if (this->unk_048 == EVACT_13) { + this->timer_0BE = 50; } - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_116 << 9: - actor->unk_044 = actorScript[actor->aiIndex + 1]; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_DROP_ITEM): + this->itemDrop = actorScript[this->aiIndex + 1]; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_118 << 9: - Audio_SetBaseSfxReverb(actorScript[actor->aiIndex + 1]); - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_SET_REVERB): + Audio_SetBaseSfxReverb(actorScript[this->aiIndex + 1]); + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_PLAY_MSG << 9: - msg = Message_PtrFromId(actorScript[actor->aiIndex + 1]); + case EV_OPC(EVOP_PLAY_MSG): + msg = Message_PtrFromId(actorScript[this->aiIndex + 1]); if ((msg != NULL) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3)) { - Radio_PlayMessage(msg, actorScript[actor->aiIndex] & 0x1FF); + Radio_PlayMessage(msg, actorScript[this->aiIndex] & 0x1FF); } - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_119 << 9: - if ((D_80161A88 == 2) && (actorScript[actor->aiIndex + 1] != 2)) { + case EV_OPC(EVOP_SET_GROUND): + if ((D_ctx_80161A88 == 2) && (actorScript[this->aiIndex + 1] != 2)) { Audio_KillSfxBySourceAndId(gPlayer[0].sfxSource, 0x1100000B); } - D_80161A88 = actorScript[actor->aiIndex + 1]; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); - actor->obj.status = OBJ_FREE; + D_ctx_80161A88 = actorScript[this->aiIndex + 1]; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); + this->obj.status = OBJ_FREE; break; - case EVOP_56 << 9: - D_enmy2_800CFF90 = actorScript[actor->aiIndex] & 0x1FF; - D_enmy2_80161690 = actorScript[actor->aiIndex + 1]; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_SET_CALL): + D_enmy2_800CFF90 = actorScript[this->aiIndex] & 0x1FF; + D_enmy2_80161690 = actorScript[this->aiIndex + 1]; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_57 << 9: - gTeamShields[actorScript[actor->aiIndex + 1]] = 0xFF; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_RESTORE_TEAM): + gTeamShields[actorScript[this->aiIndex + 1]] = 255; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_58 << 9: - func_8001D2FC(actor->sfxSource, actorScript[actor->aiIndex + 1]); - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_PLAY_SFX): + Audio_PlayEventSfx(this->sfxSource, actorScript[this->aiIndex + 1]); + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_59 << 9: - func_8001D3A0(actor->sfxSource, actorScript[actor->aiIndex + 1]); - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_STOP_SFX): + Audio_StopEventSfx(this->sfxSource, actorScript[this->aiIndex + 1]); + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_122 << 9: + case EV_OPC(EVOP_STOP_BGM): SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 50); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50); - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_121 << 9: - if (actor->iwork[12] == actorScript[actor->aiIndex + 1]) { - actor->unk_0D0 = 1; - actor->damage = actorScript[actor->aiIndex] & 0x1FF; - actor->unk_0D4 = 100; + case EV_OPC(EVOP_DAMAGE_TEAM): + if (this->iwork[12] == actorScript[this->aiIndex + 1]) { + this->unk_0D0 = 1; + this->damage = actorScript[this->aiIndex] & 0x1FF; + this->unk_0D4 = 100; } else { - gTeamDamage[actorScript[actor->aiIndex + 1]] = actorScript[actor->aiIndex] & 0x1FF; + gTeamDamage[actorScript[this->aiIndex + 1]] = actorScript[this->aiIndex] & 0x1FF; } - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_MAKE_TEXLINE << 9: - actor->iwork[7] = 1; + case EV_OPC(EVOP_MAKE_TEXLINE): + this->iwork[7] = 1; for (i = 0; i < ARRAY_COUNT(gTexturedLines); i++) { if (gTexturedLines[i].mode == 0) { gTexturedLines[i].mode = 1; gTexturedLines[i].unk_28 = 3.0f; - gTexturedLines[i].unk_04.x = actor->obj.pos.x - actor->vel.x; - gTexturedLines[i].unk_04.y = actor->obj.pos.y - actor->vel.y; - gTexturedLines[i].unk_04.z = actor->obj.pos.z - actor->vel.z; - gTexturedLines[i].unk_2C = D_800D0DBC[actorScript[actor->aiIndex + 1]][0]; - gTexturedLines[i].unk_2D = D_800D0DBC[actorScript[actor->aiIndex + 1]][1]; - gTexturedLines[i].unk_2E = D_800D0DBC[actorScript[actor->aiIndex + 1]][2]; - gTexturedLines[i].unk_2F = D_800D0DBC[actorScript[actor->aiIndex + 1]][3]; - actor->iwork[8] = i; + gTexturedLines[i].unk_04.x = this->obj.pos.x - this->vel.x; + gTexturedLines[i].unk_04.y = this->obj.pos.y - this->vel.y; + gTexturedLines[i].unk_04.z = this->obj.pos.z - this->vel.z; + gTexturedLines[i].unk_2C = D_800D0DBC[actorScript[this->aiIndex + 1]][0]; + gTexturedLines[i].unk_2D = D_800D0DBC[actorScript[this->aiIndex + 1]][1]; + gTexturedLines[i].unk_2E = D_800D0DBC[actorScript[this->aiIndex + 1]][2]; + gTexturedLines[i].unk_2F = D_800D0DBC[actorScript[this->aiIndex + 1]][3]; + this->iwork[8] = i; break; } } - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_STOP_TEXLINE << 9: - actor->iwork[7] = 0; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_STOP_TEXLINE): + this->iwork[7] = 0; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_40 << 9: - actor->state = 6; - actor->timer_0BC = actorScript[actor->aiIndex + 1]; - actor->fwork[24] = actorScript[actor->aiIndex] & 0x1FF; - actor->aiIndex += 2; + case EV_OPC(EVOP_SET_STATE_6): + this->state = EVSTATE_6; + this->timer_0BC = actorScript[this->aiIndex + 1]; + this->fwork[24] = actorScript[this->aiIndex] & 0x1FF; + this->aiIndex += 2; break; - case EVOP_41 << 9: - actor->state = 7; - actor->timer_0BC = actorScript[actor->aiIndex + 1]; - actor->fwork[24] = actorScript[actor->aiIndex] & 0x1FF; - actor->aiIndex += 2; + case EV_OPC(EVOP_SET_STATE_7): + this->state = EVSTATE_7; + this->timer_0BC = actorScript[this->aiIndex + 1]; + this->fwork[24] = actorScript[this->aiIndex] & 0x1FF; + this->aiIndex += 2; break; - case EVOP_42 << 9: - actor->state = 8; - actor->timer_0BC = actorScript[actor->aiIndex + 1]; - actor->fwork[24] = actorScript[actor->aiIndex] & 0x1FF; - actor->aiIndex += 2; + case EV_OPC(EVOP_SET_STATE_8): + this->state = EVSTATE_8; + this->timer_0BC = actorScript[this->aiIndex + 1]; + this->fwork[24] = actorScript[this->aiIndex] & 0x1FF; + this->aiIndex += 2; break; - case EVOP_43 << 9: - actor->state = 9; - actor->timer_0BC = actorScript[actor->aiIndex + 1]; - actor->fwork[24] = actorScript[actor->aiIndex] & 0x1FF; - actor->aiIndex += 2; + case EV_OPC(EVOP_SET_STATE_9): + this->state = EVSTATE_9; + this->timer_0BC = actorScript[this->aiIndex + 1]; + this->fwork[24] = actorScript[this->aiIndex] & 0x1FF; + this->aiIndex += 2; break; - case EVOP_45 << 9: - actor->state = 1; - actor->iwork[1] = D_enmy2_800CFF80[actorScript[actor->aiIndex] & 0x1FF]; - actor->fwork[17] = actorScript[actor->aiIndex + 1]; - actor->timer_0BC = 0; - actor->aiIndex += 2; + case EV_OPC(EVOP_SET_IWORK_1_TO_IWORK_12): + this->state = EVSTATE_1; + this->iwork[1] = D_enmy2_800CFF80[actorScript[this->aiIndex] & 0x1FF]; + this->fwork[17] = actorScript[this->aiIndex + 1]; + this->timer_0BC = 0; + this->aiIndex += 2; break; - case EVOP_44 << 9: - actor->state = 0xD; - actor->timer_0BC = actorScript[actor->aiIndex + 1]; - actor->fwork[24] = actorScript[actor->aiIndex] & 0x1FF; - actor->aiIndex += 2; + case EV_OPC(EVOP_SET_STATE_13): + this->state = EVSTATE_13; + this->timer_0BC = actorScript[this->aiIndex + 1]; + this->fwork[24] = actorScript[this->aiIndex] & 0x1FF; + this->aiIndex += 2; break; - case EVOP_46 << 9: - actor->state = 0xE; - actor->timer_0BC = actorScript[actor->aiIndex + 1]; - actor->fwork[24] = actorScript[actor->aiIndex] & 0x1FF; - actor->aiIndex += 2; + case EV_OPC(EVOP_SET_STATE_14): + this->state = EVSTATE_14; + this->timer_0BC = actorScript[this->aiIndex + 1]; + this->fwork[24] = actorScript[this->aiIndex] & 0x1FF; + this->aiIndex += 2; break; - case EVOP_47 << 9: - actor->state = 0xF; - actor->timer_0BC = actorScript[actor->aiIndex + 1]; - actor->fwork[24] = actorScript[actor->aiIndex] & 0x1FF; - actor->aiIndex += 2; + case EV_OPC(EVOP_SET_STATE_15): + this->state = EVSTATE_15; + this->timer_0BC = actorScript[this->aiIndex + 1]; + this->fwork[24] = actorScript[this->aiIndex] & 0x1FF; + this->aiIndex += 2; break; - case EVOP_BRANCH << 9: - actor->iwork[2] = actorScript[actor->aiIndex + 1]; - actor->iwork[3] = actorScript[actor->aiIndex] & 0x1FF; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_SET_TRIGGER): + this->iwork[2] = actorScript[this->aiIndex + 1]; + this->iwork[3] = actorScript[this->aiIndex] & 0x1FF; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_LOOP << 9: - if (actorScript[actor->aiIndex + 1] < actor->iwork[0]) { - actor->aiIndex += 2; - actor->iwork[0] = 0; - } else if ((actorScript[actor->aiIndex] & 0x1FF) < 200) { - actor->aiIndex = (actorScript[actor->aiIndex] & 0x1FF) * 2; - actor->iwork[0]++; + case EV_OPC(EVOP_LOOP): + if (actorScript[this->aiIndex + 1] < this->iwork[0]) { + this->aiIndex += 2; + this->iwork[0] = 0; + } else if ((actorScript[this->aiIndex] & 0x1FF) < 200) { + this->aiIndex = (actorScript[this->aiIndex] & 0x1FF) * 2; + this->iwork[0]++; } else { - actor->aiType = (actorScript[actor->aiIndex] & 0x1FF) - 200; - actor->aiIndex = 0; - actor->iwork[0] = 0; + this->aiType = (actorScript[this->aiIndex] & 0x1FF) - 200; + this->aiIndex = 0; + this->iwork[0] = 0; } - func_enmy2_8006D36C(actor); + ActorEvent_ProcessScript(this); break; - case EVOP_48 << 9: - actor->state = 1; - actor->timer_0BC = actorScript[actor->aiIndex + 1]; - actor->aiIndex += 2; + case EV_OPC(EVOP_SET_STATE_1): + this->state = EVSTATE_1; + this->timer_0BC = actorScript[this->aiIndex + 1]; + this->aiIndex += 2; break; - case EVOP_SET_SPEED << 9: - actor->fwork[0] = actorScript[actor->aiIndex] & 0x7F; - actor->fwork[1] = actor->fwork[0]; - actor->iwork[5] = actorScript[actor->aiIndex] & 0x180; - actor->timer_0BC = actorScript[actor->aiIndex + 1]; - actor->state = 1; - actor->aiIndex += 2; + case EV_OPC(EVOP_SET_SPEED): + this->fwork[0] = actorScript[this->aiIndex] & 0x7F; + this->fwork[1] = this->fwork[0]; + this->iwork[5] = EV_ZMODE_MASK(actorScript[this->aiIndex]); + this->timer_0BC = actorScript[this->aiIndex + 1]; + this->state = EVSTATE_1; + this->aiIndex += 2; break; - case EVOP_2 << 9: - actor->fwork[22] = actorScript[actor->aiIndex + 1] & 0xFF; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_SET_BASE_ZVEL): + this->fwork[22] = actorScript[this->aiIndex + 1] & 0xFF; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_SET_ACCEL << 9: - actor->fwork[1] = actorScript[actor->aiIndex] & 0x7F; - actor->iwork[5] = actorScript[actor->aiIndex] & 0x180; - actor->timer_0BC = actorScript[actor->aiIndex + 1]; - actor->state = 1; - actor->aiIndex += 2; + case EV_OPC(EVOP_SET_ACCEL): + this->fwork[1] = actorScript[this->aiIndex] & 0x7F; + this->iwork[5] = EV_ZMODE_MASK(actorScript[this->aiIndex]); + this->timer_0BC = actorScript[this->aiIndex + 1]; + this->state = EVSTATE_1; + this->aiIndex += 2; break; - case EVOP_4 << 9: - actor->timer_0C0 = actorScript[actor->aiIndex + 1]; - actor->iwork[13] = 1; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_SET_IWORK_13): + this->timer_0C0 = actorScript[this->aiIndex + 1]; + this->iwork[13] = 1; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_8 << 9: - actor->iwork[13] = 0; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_CLEAR_IWORK_13): + this->iwork[13] = 0; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_9 << 9: - actor->state = 2; - actor->fwork[2] = actorScript[actor->aiIndex] & 0x1FF; - actor->fwork[3] = actorScript[actor->aiIndex + 1] * 0.1f; - actor->aiIndex += 2; + case EV_OPC(EVOP_F4_PLUS_X): + this->state = EVSTATE_F4_PLUS_X; + this->fwork[2] = actorScript[this->aiIndex] & 0x1FF; + this->fwork[3] = actorScript[this->aiIndex + 1] * 0.1f; + this->aiIndex += 2; break; - case EVOP_10 << 9: - actor->state = 3; - actor->fwork[2] = actorScript[actor->aiIndex] & 0x1FF; - actor->fwork[3] = actorScript[actor->aiIndex + 1] * 0.1f; - actor->aiIndex += 2; + case EV_OPC(EVOP_F4_MINUS_X): + this->state = EVSTATE_F4_MINUS_X; + this->fwork[2] = actorScript[this->aiIndex] & 0x1FF; + this->fwork[3] = actorScript[this->aiIndex + 1] * 0.1f; + this->aiIndex += 2; break; - case EVOP_11 << 9: - actor->state = 4; - actor->fwork[2] = actorScript[actor->aiIndex] & 0x1FF; - actor->fwork[3] = actorScript[actor->aiIndex + 1] * 0.1f; - actor->aiIndex += 2; + case EV_OPC(EVOP_F4_PLUS_Y): + this->state = EVSTATE_F4_PLUS_Y; + this->fwork[2] = actorScript[this->aiIndex] & 0x1FF; + this->fwork[3] = actorScript[this->aiIndex + 1] * 0.1f; + this->aiIndex += 2; break; - case EVOP_12 << 9: - actor->state = 5; - actor->fwork[2] = actorScript[actor->aiIndex] & 0x1FF; - actor->fwork[3] = actorScript[actor->aiIndex + 1] * 0.1f; - actor->aiIndex += 2; + case EV_OPC(EVOP_F4_MINUS_Y): + this->state = EVSTATE_F4_MINUS_Y; + this->fwork[2] = actorScript[this->aiIndex] & 0x1FF; + this->fwork[3] = actorScript[this->aiIndex + 1] * 0.1f; + this->aiIndex += 2; break; - case EVOP_16 << 9: - actor->fwork[4] = actorScript[actor->aiIndex] & 0x1FF; - actor->fwork[5] = actorScript[actor->aiIndex + 1] * 0.1f; - actor->fwork[6] = 1.0f; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_ROT_PLUS_X): + this->fwork[4] = actorScript[this->aiIndex] & 0x1FF; + this->fwork[5] = actorScript[this->aiIndex + 1] * 0.1f; + this->fwork[6] = 1.0f; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_17 << 9: - actor->fwork[4] = actorScript[actor->aiIndex] & 0x1FF; - actor->fwork[5] = actorScript[actor->aiIndex + 1] * 0.1f; - actor->fwork[6] = -1.0f; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_ROT_MINUS_X): + this->fwork[4] = actorScript[this->aiIndex] & 0x1FF; + this->fwork[5] = actorScript[this->aiIndex + 1] * 0.1f; + this->fwork[6] = -1.0f; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_18 << 9: - actor->fwork[7] = actorScript[actor->aiIndex] & 0x1FF; - actor->fwork[8] = actorScript[actor->aiIndex + 1] * 0.1f; - actor->fwork[9] = 1.0f; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_ROT_PLUS_Y): + this->fwork[7] = actorScript[this->aiIndex] & 0x1FF; + this->fwork[8] = actorScript[this->aiIndex + 1] * 0.1f; + this->fwork[9] = 1.0f; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_19 << 9: - actor->fwork[7] = actorScript[actor->aiIndex] & 0x1FF; - actor->fwork[8] = actorScript[actor->aiIndex + 1] * 0.1f; - actor->fwork[9] = -1.0f; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_ROT_MINUS_Y): + this->fwork[7] = actorScript[this->aiIndex] & 0x1FF; + this->fwork[8] = actorScript[this->aiIndex + 1] * 0.1f; + this->fwork[9] = -1.0f; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_20 << 9: - actor->fwork[10] = actorScript[actor->aiIndex] & 0x1FF; - actor->fwork[11] = actorScript[actor->aiIndex + 1] * 0.1f; - actor->fwork[12] = 1.0f; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_ROT_PLUS_Z): + this->fwork[10] = actorScript[this->aiIndex] & 0x1FF; + this->fwork[11] = actorScript[this->aiIndex + 1] * 0.1f; + this->fwork[12] = 1.0f; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_21 << 9: - actor->fwork[10] = actorScript[actor->aiIndex] & 0x1FF; - actor->fwork[11] = actorScript[actor->aiIndex + 1] * 0.1f; - actor->fwork[12] = -1.0f; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_ROT_MINUS_Z): + this->fwork[10] = actorScript[this->aiIndex] & 0x1FF; + this->fwork[11] = actorScript[this->aiIndex + 1] * 0.1f; + this->fwork[12] = -1.0f; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_SET_ROTATE << 9: - actor->iwork[6] = 1; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_SET_ROTATE): + this->iwork[6] = 1; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_STOP_ROTATE << 9: - actor->iwork[6] = 0; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_STOP_ROTATE): + this->iwork[6] = 0; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; } } -void func_enmy2_8006EA50(Actor* actor) { - if ((actor->iwork[7] != 0) && (gTexturedLines[actor->iwork[8]].mode != 0)) { - gTexturedLines[actor->iwork[8]].unk_10.x = actor->obj.pos.x; - gTexturedLines[actor->iwork[8]].unk_10.y = actor->obj.pos.y; - gTexturedLines[actor->iwork[8]].unk_10.z = actor->obj.pos.z; +void ActorEvent_UpdateTexLines(Actor* this) { + if ((this->iwork[7] != 0) && (gTexturedLines[this->iwork[8]].mode != 0)) { + gTexturedLines[this->iwork[8]].unk_10.x = this->obj.pos.x; + gTexturedLines[this->iwork[8]].unk_10.y = this->obj.pos.y; + gTexturedLines[this->iwork[8]].unk_10.z = this->obj.pos.z; } } -void func_enmy2_8006EAC4(Effect* effect, f32 xPos, f32 yPos, f32 zPos) { +void ActorEvent_8006EAC4(Effect* effect, f32 xPos, f32 yPos, f32 zPos) { Effect_Initialize(effect); effect->obj.status = OBJ_INIT; effect->obj.id = OBJ_EFFECT_374; @@ -1585,18 +1575,18 @@ void func_enmy2_8006EAC4(Effect* effect, f32 xPos, f32 yPos, f32 zPos) { AUDIO_PLAY_SFX(0x2900201D, effect->sfxSource, 4); } -void func_enmy2_8006EB64(f32 xPos, f32 yPos, f32 zPos) { +void ActorEvent_8006EB64(f32 xPos, f32 yPos, f32 zPos) { s32 i; for (i = 50; i < ARRAY_COUNT(gEffects); i++) { if (gEffects[i].obj.status == OBJ_FREE) { - func_enmy2_8006EAC4(&gEffects[i], xPos, yPos, zPos); + ActorEvent_8006EAC4(&gEffects[i], xPos, yPos, zPos); break; } } } -void func_enmy2_8006EBC0(Actor* actor, f32 xPos, f32 yPos, f32 zPos) { +void ActorEvent_8006EBC0(Actor* actor, f32 xPos, f32 yPos, f32 zPos) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; actor->obj.id = OBJ_ACTOR_225; @@ -1610,12 +1600,12 @@ void func_enmy2_8006EBC0(Actor* actor, f32 xPos, f32 yPos, f32 zPos) { AUDIO_PLAY_SFX(0x2900201D, actor->sfxSource, 4); } -void func_enmy2_8006EC60(f32 xPos, f32 yPos, f32 zPos) { +void ActorEvent_8006EC60(f32 xPos, f32 yPos, f32 zPos) { s32 i; for (i = 0; i < ARRAY_COUNT(gActors); i++) { if (gActors[i].obj.status == OBJ_FREE) { - func_enmy2_8006EBC0(&gActors[i], xPos, yPos, zPos); + ActorEvent_8006EBC0(&gActors[i], xPos, yPos, zPos); break; } } @@ -1650,12 +1640,12 @@ void func_enmy2_8006ECBC(PlayerShotId objId, PlayerShot* shot, s32 unk0E4, f32 x shot->playerNum = unk0E4 + 100; if (gLevelMode == LEVELMODE_ALL_RANGE) { - if (unk0E4 + 100 < 104) { + if (unk0E4 + 100 <= AI360_PEPPY + 100) { AUDIO_PLAY_SFX(0x2900000D, shot->sfxSource, 4); } else { AUDIO_PLAY_SFX(0x29002002, shot->sfxSource, 4); } - } else if ((unk0E4 < 60) && (gActors[unk0E4].obj.id == OBJ_ACTOR_200) && (gActors[unk0E4].iwork[12] > 0)) { + } else if ((unk0E4 < 60) && (gActors[unk0E4].obj.id == OBJ_ACTOR_EVENT) && (gActors[unk0E4].iwork[12] > 0)) { AUDIO_PLAY_SFX(0x2900000D, shot->sfxSource, 4); } else if (unk0E4 + 100 == 200) { shot->playerNum = 100; @@ -1691,7 +1681,7 @@ void func_enmy2_8006EFA0(s32 unk0E4, f32 xPos, f32 yPos, f32 zPos, f32 arg4, f32 } } -void func_enmy2_8006F044(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 arg4) { +void ActorEvent_8006F044(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 arg4) { Effect_Initialize(effect); effect->obj.status = OBJ_INIT; effect->obj.id = OBJ_EFFECT_347; @@ -1706,18 +1696,18 @@ void func_enmy2_8006F044(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 arg4) func_effect_8007A6F0(&effect->obj.pos, 0x2903B009); } -void func_enmy2_8006F0D8(f32 xPos, f32 yPos, f32 zPos, f32 arg3) { +void ActorEvent_8006F0D8(f32 xPos, f32 yPos, f32 zPos, f32 arg3) { s32 i; for (i = 0; i < ARRAY_COUNT(gEffects); i++) { if (gEffects[i].obj.status == OBJ_FREE) { - func_enmy2_8006F044(&gEffects[i], xPos, yPos, zPos, arg3); + ActorEvent_8006F044(&gEffects[i], xPos, yPos, zPos, arg3); break; } } } -void func_enmy2_8006F140(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 arg4) { +void ActorEvent_8006F140(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 arg4) { Effect_Initialize(effect); effect->obj.status = OBJ_INIT; effect->obj.id = OBJ_EFFECT_394; @@ -1735,18 +1725,18 @@ void func_enmy2_8006F140(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 arg4) func_effect_8007A6F0(&effect->obj.pos, 0x2903B009); } -void func_enmy2_8006F1EC(f32 xPos, f32 yPos, f32 zPos, f32 arg3) { +void ActorEvent_8006F1EC(f32 xPos, f32 yPos, f32 zPos, f32 arg3) { s32 i; for (i = 0; i < ARRAY_COUNT(gEffects); i++) { if (gEffects[i].obj.status == OBJ_FREE) { - func_enmy2_8006F140(&gEffects[i], xPos, yPos, zPos, arg3); + ActorEvent_8006F140(&gEffects[i], xPos, yPos, zPos, arg3); break; } } } -void func_enmy2_8006F254(Actor* actor) { +void ActorEvent_8006F254(Actor* actor) { Vec3f sp54; Vec3f sp48; @@ -1767,164 +1757,163 @@ void func_enmy2_8006F254(Actor* actor) { sp48.z, 1.0f); } -void func_enmy2_8006F40C(Actor* actor) { +void ActorEvent_ProcessActions(Actor* this) { s32 var_v1; Vec3f sp78; Vec3f sp6C; Object_4C* obj4C; - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) && (actor->unk_0B4 != 0x34) && (actor->unk_0B4 != 0x67) && - (actor->unk_0B4 != 0x68) && (actor->unk_0B4 != 0x30) && (actor->unk_0B4 != 0x31) && (actor->unk_0B4 != 0x32)) { - switch (actor->unk_048) { - case 0: + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) && (this->unk_0B4 != EINFO_52) && (this->unk_0B4 != EINFO_103) && + (this->unk_0B4 != EINFO_104) && (this->unk_0B4 != EINFO_48) && (this->unk_0B4 != EINFO_49) && + (this->unk_0B4 != EINFO_50)) { + switch (this->unk_048) { + case EVACT_0: break; - case 1: - func_enmy2_8006F254(actor); - actor->unk_048 = 0; + case EVACT_1: + ActorEvent_8006F254(this); + this->unk_048 = EVACT_0; break; - case 2: - if (actor->obj.pos.z < (gPlayer[0].unk_138 - 600.0f)) { - func_effect_8007F11C(OBJ_EFFECT_353, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, + case EVACT_2: + if (this->obj.pos.z < (gPlayer[0].unk_138 - 600.0f)) { + func_effect_8007F11C(OBJ_EFFECT_353, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, D_ctx_80177828); } - actor->unk_048 = 0; + this->unk_048 = EVACT_0; break; - case 3: - if (actor->timer_0BE == 0) { - actor->timer_0BE = 6; + case EVACT_3: + if (this->timer_0BE == 0) { + this->timer_0BE = 6; sp78.x = 0.0f; sp78.y = 0.0f; sp78.z = 100.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp78, &sp6C); - func_enmy2_8006EEFC(actor->index, actor->obj.pos.x + (sp6C.x * 1.5), - actor->obj.pos.y + (sp6C.y * 1.5), actor->obj.pos.z + (sp6C.z * 1.5), sp6C.x, - sp6C.y, sp6C.z, actor->unk_0F4.x, actor->unk_0F4.y, - actor->vwork[29].z + actor->unk_0F4.z); - actor->timer_0C2 = 2; - actor->timer_04C--; - if (actor->timer_04C <= 0) { - actor->unk_048 = 0; + func_enmy2_8006EEFC(this->index, this->obj.pos.x + (sp6C.x * 1.5), this->obj.pos.y + (sp6C.y * 1.5), + this->obj.pos.z + (sp6C.z * 1.5), sp6C.x, sp6C.y, sp6C.z, this->unk_0F4.x, + this->unk_0F4.y, this->vwork[29].z + this->unk_0F4.z); + this->timer_0C2 = 2; + this->timer_04C--; + if (this->timer_04C <= 0) { + this->unk_048 = EVACT_0; } } break; - case 4: - func_enmy2_8006EB64(actor->obj.pos.x, actor->obj.pos.y - 20.0f, actor->obj.pos.z); - actor->unk_048 = 0; + case EVACT_4: + ActorEvent_8006EB64(this->obj.pos.x, this->obj.pos.y - 20.0f, this->obj.pos.z); + this->unk_048 = EVACT_0; break; - case 5: - Matrix_RotateY(gCalcMatrix, actor->vwork[29].y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->vwork[29].x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, (actor->vwork[29].z + actor->unk_0F4.z) * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, actor->unk_0F4.y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, actor->unk_0F4.x * M_DTOR, 1); + case EVACT_5: + Matrix_RotateY(gCalcMatrix, this->vwork[29].y * M_DTOR, 0); + Matrix_RotateX(gCalcMatrix, this->vwork[29].x * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, (this->vwork[29].z + this->unk_0F4.z) * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, this->unk_0F4.y * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, this->unk_0F4.x * M_DTOR, 1); sp78.x = 0.0f; sp78.y = 0.0f; sp78.z = D_ctx_80177828; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp78, &sp6C); - func_effect_8007F04C(OBJ_EFFECT_355, actor->obj.pos.x + sp6C.x, actor->obj.pos.y + sp6C.y, - actor->obj.pos.z + sp6C.z, actor->obj.rot.x, actor->obj.rot.y, actor->obj.rot.z, - actor->vwork[29].x, actor->vwork[29].y, actor->vwork[29].z + actor->unk_0F4.z, - sp6C.x, sp6C.y, sp6C.z, 1.0f); - actor->unk_048 = 0; + func_effect_8007F04C(OBJ_EFFECT_355, this->obj.pos.x + sp6C.x, this->obj.pos.y + sp6C.y, + this->obj.pos.z + sp6C.z, this->obj.rot.x, this->obj.rot.y, this->obj.rot.z, + this->vwork[29].x, this->vwork[29].y, this->vwork[29].z + this->unk_0F4.z, sp6C.x, + sp6C.y, sp6C.z, 1.0f); + this->unk_048 = EVACT_0; break; - case 6: - if (actor->obj.pos.z < (gPlayer[0].unk_138 - 600.0f)) { - func_effect_8007F11C(OBJ_EFFECT_355, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, + case EVACT_6: + if (this->obj.pos.z < (gPlayer[0].unk_138 - 600.0f)) { + func_effect_8007F11C(OBJ_EFFECT_355, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, D_ctx_80177828); } - actor->unk_048 = 0; + this->unk_048 = EVACT_0; break; - case 7: - if (actor->obj.pos.z < (gPlayer[0].unk_138 - 600.0f)) { - func_effect_8007F11C(OBJ_EFFECT_356, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 60.0f); + case EVACT_7: + if (this->obj.pos.z < (gPlayer[0].unk_138 - 600.0f)) { + func_effect_8007F11C(OBJ_EFFECT_356, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 60.0f); } - actor->unk_048 = 0; + this->unk_048 = EVACT_0; break; - case 8: + case EVACT_8: sp6C.x = gPlayer[0].pos.x; sp6C.y = gPlayer[0].pos.y; gPlayer[0].pos.x += RAND_FLOAT_CENTERED(300.0f); gPlayer[0].pos.y += RAND_FLOAT_CENTERED(300.0f); - func_effect_8007F11C(OBJ_EFFECT_353, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, - D_ctx_80177828); + func_effect_8007F11C(OBJ_EFFECT_353, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, D_ctx_80177828); gPlayer[0].pos.x = sp6C.x; gPlayer[0].pos.y = sp6C.y; - actor->unk_048 = 0; + this->unk_048 = EVACT_0; break; - case 9: + case EVACT_9: if (gCurrentLevel == LEVEL_AQUAS) { - func_enmy2_8006F1EC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 12.0f); + ActorEvent_8006F1EC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 12.0f); } else { - func_enmy2_8006F0D8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 40.0f); + ActorEvent_8006F0D8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 40.0f); } - Object_Kill(&actor->obj, actor->sfxSource); + Object_Kill(&this->obj, this->sfxSource); break; - case 10: + case EVACT_10: if (gCurrentLevel == LEVEL_AQUAS) { - func_enmy2_8006F1EC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 6.0f); + ActorEvent_8006F1EC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 6.0f); } else { - func_enmy2_8006F0D8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 15.0f); + ActorEvent_8006F0D8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 15.0f); } - Object_Kill(&actor->obj, actor->sfxSource); + Object_Kill(&this->obj, this->sfxSource); break; - case 11: - func_effect_8007BFFC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->vel.x, actor->vel.y, - actor->vel.z, actor->scale * 3.0f, 15); - func_enmy_80066254(actor); - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007A6F0(&actor->obj.pos, 0x2903B009); + case EVACT_11: + func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->vel.x, this->vel.y, + this->vel.z, this->scale * 3.0f, 15); + func_enmy_80066254(this); + Object_Kill(&this->obj, this->sfxSource); + func_effect_8007A6F0(&this->obj.pos, 0x2903B009); break; - case 12: - func_enmy_80066254(actor); - Object_Kill(&actor->obj, actor->sfxSource); + case EVACT_12: + func_enmy_80066254(this); + Object_Kill(&this->obj, this->sfxSource); break; - case 13: - if (actor->timer_0BE > 25) { - Math_SmoothStepToF(&actor->fwork[15], 90.0f, 0.2f, 8.0f, 0.01f); + case EVACT_13: + if (this->timer_0BE > 25) { + Math_SmoothStepToF(&this->fwork[15], 90.0f, 0.2f, 8.0f, 0.01f); } - if (actor->timer_0BE < 25) { - Math_SmoothStepToF(&actor->fwork[15], 0.0f, 0.2f, 8.0f, 0.01f); + if (this->timer_0BE < 25) { + Math_SmoothStepToF(&this->fwork[15], 0.0f, 0.2f, 8.0f, 0.01f); } - if (actor->timer_0BE == 30) { - func_enmy2_8006EC60(actor->obj.pos.x, actor->obj.pos.y - 50.0f, actor->obj.pos.z); + if (this->timer_0BE == 30) { + ActorEvent_8006EC60(this->obj.pos.x, this->obj.pos.y - 50.0f, this->obj.pos.z); } - if (actor->timer_0BE == 0) { - actor->unk_048 = 0; + if (this->timer_0BE == 0) { + this->unk_048 = EVACT_0; } break; - case 16: - func_effect_8007F11C(OBJ_EFFECT_353, actor->obj.pos.x + 190.0f, actor->obj.pos.y + 90.0f, - actor->obj.pos.z + 220.0f, D_ctx_80177828); - func_effect_8007F11C(OBJ_EFFECT_353, actor->obj.pos.x - 190.0f, actor->obj.pos.y + 90.0f, - actor->obj.pos.z + 220.0f, D_ctx_80177828); - actor->unk_048 = 0; + case EVACT_16: + func_effect_8007F11C(OBJ_EFFECT_353, this->obj.pos.x + 190.0f, this->obj.pos.y + 90.0f, + this->obj.pos.z + 220.0f, D_ctx_80177828); + func_effect_8007F11C(OBJ_EFFECT_353, this->obj.pos.x - 190.0f, this->obj.pos.y + 90.0f, + this->obj.pos.z + 220.0f, D_ctx_80177828); + this->unk_048 = EVACT_0; break; - case 17: - if (actor->obj.pos.z < (gPlayer[0].camEye.z - 600.0f)) { - func_effect_8007F20C(OBJ_EFFECT_353, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, + case EVACT_17: + if (this->obj.pos.z < (gPlayer[0].camEye.z - 600.0f)) { + func_effect_8007F20C(OBJ_EFFECT_353, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, D_ctx_80177828); } - actor->unk_048 = 0; + this->unk_048 = EVACT_0; break; - case 18: + case EVACT_18: for (var_v1 = 0, obj4C = gObjects4C; var_v1 < 40; var_v1++, obj4C++) { if ((obj4C->obj.status == OBJ_ACTIVE) && (obj4C->obj.id == OBJ_4C_175)) { @@ -1935,9 +1924,9 @@ void func_enmy2_8006F40C(Actor* actor) { f32 sp54; obj4C->obj.status = OBJ_FREE; - sp64 = obj4C->obj.pos.x - actor->obj.pos.x; - sp60 = obj4C->obj.pos.y - actor->obj.pos.y; - sp5C = obj4C->obj.pos.z - actor->obj.pos.z; + sp64 = obj4C->obj.pos.x - this->obj.pos.x; + sp60 = obj4C->obj.pos.y - this->obj.pos.y; + sp5C = obj4C->obj.pos.z - this->obj.pos.z; sp54 = Math_Atan2F(sp64, sp5C); sp54 = Math_RadToDeg(sp54); sp58 = -Math_Atan2F(sp60, sqrtf(SQ(sp64) + SQ(sp5C))); @@ -1948,67 +1937,66 @@ void func_enmy2_8006F40C(Actor* actor) { sp6C.y = 0.0f; sp6C.z = 50.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp6C, &sp78); - func_enmy2_8006EFA0(100, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, sp78.x, sp78.y, + func_enmy2_8006EFA0(100, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, sp78.x, sp78.y, sp78.z, sp58, sp54, 0.0f); break; } } - actor->unk_048 = 0; + this->unk_048 = EVACT_0; break; - case 19: - func_effect_80083D2C(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 40.0f); - actor->unk_048 = 0; + case EVACT_19: + func_effect_80083D2C(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 40.0f); + this->unk_048 = EVACT_0; break; } } } -void func_enmy2_8006FE28(Actor* actor) { - if ((fabsf(actor->obj.pos.x - gPlayer[0].pos.x) < 100.0f) && - (fabsf(actor->obj.pos.y - gPlayer[0].pos.y) < 100.0f) && - (fabsf(actor->obj.pos.z - gPlayer[0].unk_138) < 50.0f)) { +void ActorEvent_8006FE28(Actor* this) { + if ((fabsf(this->obj.pos.x - gPlayer[0].pos.x) < 100.0f) && (fabsf(this->obj.pos.y - gPlayer[0].pos.y) < 100.0f) && + (fabsf(this->obj.pos.z - gPlayer[0].unk_138) < 50.0f)) { func_enmy_80067A40(); - Audio_KillSfxBySourceAndId(actor->sfxSource, 0x1900302B); - Object_Kill(&actor->obj, actor->sfxSource); + Audio_KillSfxBySourceAndId(this->sfxSource, 0x1900302B); + Object_Kill(&this->obj, this->sfxSource); } } -void func_enmy2_8006FEEC(Actor* actor) { +void ActorEvent_8006FEEC(Actor* this) { s32 i; - if ((actor->unk_0D0 != 0) && (actor->health != 0)) { - actor->unk_0D0 = 0; - actor->timer_0C6 = 15; - actor->health -= actor->damage; + if ((this->unk_0D0 != 0) && (this->health != 0)) { + this->unk_0D0 = 0; + this->timer_0C6 = 15; + this->health -= this->damage; - if (actor->health <= 0) { + if (this->health <= 0) { for (i = 3; i < 11; i++) { - Zoness_801900FC(&actor->vwork[i], &actor->vwork[i + 11], RAND_FLOAT_CENTERED(20.0f), RAND_FLOAT(-10.0f), - RAND_FLOAT(10.0f), 41, actor->scale, 200, i); - } - actor->unk_044 = 0; - func_enmy_80066254(actor); - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007A6F0(&actor->obj.pos, 0x29018036); - func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 4.0f); + Zoness_801900FC(&this->vwork[i], &this->vwork[i + 11], RAND_FLOAT_CENTERED(20.0f), RAND_FLOAT(-10.0f), + RAND_FLOAT(10.0f), 41, this->scale, 200, i); + } + this->itemDrop = DROP_NONE; + func_enmy_80066254(this); + Object_Kill(&this->obj, this->sfxSource); + func_effect_8007A6F0(&this->obj.pos, 0x29018036); + func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 4.0f); } else { - AUDIO_PLAY_SFX(0x29033037, actor->sfxSource, 4); + AUDIO_PLAY_SFX(0x29033037, this->sfxSource, 4); } } } -bool func_enmy2_800700A4(Actor* actor) { - if ((actor->state != 12) && (actor->iwork[12] > 0) && (actor->iwork[12] < 4) && - (gTeamShields[actor->iwork[12]] <= 0)) { - actor->state = 12; - actor->iwork[2] = 0; - actor->fwork[10] = 360.0f; - actor->fwork[11] = 20.0f; - gTeamShields[actor->iwork[12]] = 1; +bool ActorEvent_800700A4(Actor* this) { + if ((this->state != EVSTATE_TEAM_RETREAT) && (this->iwork[12] > 0) && (this->iwork[12] < 4) && + (gTeamShields[this->iwork[12]] <= 0)) { + this->state = EVSTATE_TEAM_RETREAT; + this->iwork[2] = 0; + this->fwork[10] = 360.0f; + this->fwork[11] = 20.0f; + gTeamShields[this->iwork[12]] = 1; - switch (actor->iwork[12]) { + switch (this->iwork[12]) { case 1: Radio_PlayMessage(gMsg_ID_20220, RCID_FALCO); break; @@ -2019,267 +2007,268 @@ bool func_enmy2_800700A4(Actor* actor) { Radio_PlayMessage(gMsg_ID_20221, RCID_PEPPY); break; } - gTeamShields[actor->iwork[12]] = -1; - gTeamDamage[actor->iwork[12]] = 0; - actor->timer_0C2 = 5000; - actor->unk_0D0 = 0; + gTeamShields[this->iwork[12]] = -1; + gTeamDamage[this->iwork[12]] = 0; + this->timer_0C2 = 5000; + this->unk_0D0 = 0; return true; } return false; } -void func_enmy2_800701E0(Actor* actor) { +void ActorEvent_800701E0(Actor* this) { Vec3f sp3C; f32 var_fv1; f32 temp_fv1; - if (func_enmy2_800700A4(actor)) { + if (ActorEvent_800700A4(this)) { return; } - if ((actor->unk_0D0 != 0) && (actor->unk_0B4 == 0x43) && (actor->unk_0D2 == 0)) { - actor->unk_0D0 = 0; + if ((this->unk_0D0 != 0) && (this->unk_0B4 == EINFO_67) && (this->unk_0D2 == 0)) { + this->unk_0D0 = 0; } - if ((actor->unk_0D0 != 0) && (actor->unk_0B4 == 83) && (actor->timer_0C2 >= 2)) { - actor->unk_0D0 = 0; + if ((this->unk_0D0 != 0) && (this->unk_0B4 == EINFO_83) && (this->timer_0C2 >= 2)) { + this->unk_0D0 = 0; } - if ((actor->unk_0D0 != 0) && (((actor->unk_0B4 == 64) && (actor->unk_0D2 == 2)) || (actor->unk_0B4 != 64))) { - if (actor->iwork[12] >= 4) { - actor->damage = 0; + if ((this->unk_0D0 != 0) && + (((this->unk_0B4 == EINFO_64) && (this->unk_0D2 == 2)) || (this->unk_0B4 != EINFO_64))) { + if (this->iwork[12] >= 4) { + this->damage = 0; } - if ((actor->iwork[12] > 0) && (actor->iwork[12] < 4)) { - gTeamShields[actor->iwork[12]] -= actor->damage; - } else if ((actor->unk_0B4 == 83) && ((actor->damage == 30) || (actor->damage == 31))) { - actor->health = 0; + if ((this->iwork[12] > 0) && (this->iwork[12] < 4)) { + gTeamShields[this->iwork[12]] -= this->damage; + } else if ((this->unk_0B4 == EINFO_83) && ((this->damage == 30) || (this->damage == 31))) { + this->health = 0; } else { - actor->health -= actor->damage; + this->health -= this->damage; } - if (actor->health <= 0) { - if (actor->unk_0B4 == 106) { - BonusText_Display(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 3); + if (this->health <= 0) { + if (this->unk_0B4 == EINFO_106) { + BonusText_Display(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 3); if (1) {} gHitCount += 4; D_ctx_80177850 = 15; } - if (actor->unk_0B4 != 83) { - if ((actor->unk_0B4 == 6) && (gCurrentLevel == LEVEL_SOLAR)) { - AUDIO_PLAY_SFX(0x29018036, actor->sfxSource, 4); + if (this->unk_0B4 != EINFO_83) { + if ((this->unk_0B4 == EINFO_6) && (gCurrentLevel == LEVEL_SOLAR)) { + AUDIO_PLAY_SFX(0x29018036, this->sfxSource, 4); } else { - AUDIO_PLAY_SFX(0x2903700B, actor->sfxSource, 4); + AUDIO_PLAY_SFX(0x2903700B, this->sfxSource, 4); } - actor->obj.status = OBJ_DYING; + this->obj.status = OBJ_DYING; var_fv1 = 0.7f; if (gLevelType == LEVELTYPE_SPACE) { var_fv1 = 0.3f; } - if (((Rand_ZeroOne() < var_fv1) || (actor->iwork[12] != 0)) && (actor->info.unk_14 == 0) && - (actor->unk_0B4 != 13) && (actor->unk_0B4 != 14) && (actor->unk_0B4 != 61) && - (actor->damage <= 30) && (actor->unk_0B4 != 62) && (actor->unk_0B4 != 64) && - (actor->unk_0B4 != 72) && (actor->unk_0B4 != 68)) { - func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->scale * 4.0f); - actor->unk_0D0 = 0; + if (((Rand_ZeroOne() < var_fv1) || (this->iwork[12] != 0)) && (this->info.unk_14 == 0) && + (this->unk_0B4 != EINFO_13) && (this->unk_0B4 != EINFO_14) && (this->unk_0B4 != EINFO_61) && + (this->damage <= 30) && (this->unk_0B4 != EINFO_62) && (this->unk_0B4 != EINFO_64) && + (this->unk_0B4 != EINFO_72) && (this->unk_0B4 != EINFO_68)) { + func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->scale * 4.0f); + this->unk_0D0 = 0; } - actor->timer_0C2 = 10; - actor->timer_0BE = 0; - actor->unk_046 = 0xFF; - actor->unk_048 = 900; - actor->unk_0C9 = 1; + this->timer_0C2 = 10; + this->timer_0BE = 0; + this->unk_046 = 255; + this->unk_048 = 900; + this->unk_0C9 = 1; if (gLevelType == LEVELTYPE_PLANET) { - actor->timer_04C = RAND_INT(2.9f); - if (actor->unk_0B4 == 2) { - actor->timer_04C = 1; - if (actor->obj.pos.x < actor->unk_0D8.x) { - func_play_800A69F8(1, actor->obj.pos.x + 20.0f, actor->obj.pos.y, actor->obj.pos.z); - actor->fwork[17] = 777.0f; + this->timer_04C = RAND_INT(2.9f); + if (this->unk_0B4 == EINFO_2) { + this->timer_04C = 1; + if (this->obj.pos.x < this->unk_0D8.x) { + func_play_800A69F8(1, this->obj.pos.x + 20.0f, this->obj.pos.y, this->obj.pos.z); + this->fwork[17] = 777.0f; } else { - func_play_800A69F8(0, actor->obj.pos.x - 20.0f, actor->obj.pos.y, actor->obj.pos.z); - actor->fwork[18] = 777.0f; + func_play_800A69F8(0, this->obj.pos.x - 20.0f, this->obj.pos.y, this->obj.pos.z); + this->fwork[18] = 777.0f; } } - actor->timer_0BC = 300; + this->timer_0BC = 300; if (gLevelMode != LEVELMODE_ALL_RANGE) { - actor->vel.x *= 0.5f; - actor->vel.y = RAND_FLOAT(5.0f); - if (actor->vel.z < 0.0f) { - actor->vel.z = actor->vel.z; + this->vel.x *= 0.5f; + this->vel.y = RAND_FLOAT(5.0f); + if (this->vel.z < 0.0f) { + this->vel.z = this->vel.z; } else { - actor->vel.z = actor->vel.z * 0.3f; + this->vel.z = this->vel.z * 0.3f; } - if (((actor->obj.pos.z + D_ctx_80177D20) > -3000.0f) && (actor->vel.z > 0.0f)) { - actor->vel.z = RAND_FLOAT(-10.0f); + if (((this->obj.pos.z + D_ctx_80177D20) > -3000.0f) && (this->vel.z > 0.0f)) { + this->vel.z = RAND_FLOAT(-10.0f); } } - if (actor->unk_0B4 == 90) { - actor->timer_04C = 999; + if (this->unk_0B4 == EINFO_90) { + this->timer_04C = 999; } } else { - switch (actor->unk_0B4) { - case 13: - func_enmy_800654E4(&actor->obj); + switch (this->unk_0B4) { + case EINFO_13: + func_enmy_800654E4(&this->obj); break; - case 61: - Meteo_8018CCF8(actor); + case EINFO_61: + Meteo_8018CCF8(this); break; - case 27: - actor->obj.pos.y -= actor->vel.y; - actor->obj.status = OBJ_ACTIVE; - func_effect_8007D0E0(actor->obj.pos.x - actor->vel.x, actor->obj.pos.y + 30.0f, - actor->obj.pos.z - actor->vel.z, actor->scale * 5.0f); - actor->unk_0D0 = 0; - actor->timer_0C2 = 10000; - actor->info.unk_1C = 0.0f; - gHitCount += actor->info.bonus; - D_ctx_80177850 = 0xF; + case EINFO_27: + this->obj.pos.y -= this->vel.y; + this->obj.status = OBJ_ACTIVE; + func_effect_8007D0E0(this->obj.pos.x - this->vel.x, this->obj.pos.y + 30.0f, + this->obj.pos.z - this->vel.z, this->scale * 5.0f); + this->unk_0D0 = 0; + this->timer_0C2 = 10000; + this->info.unk_1C = 0.0f; + gHitCount += this->info.bonus; + D_ctx_80177850 = 15; break; default: - actor->timer_0BC = 35; - actor->timer_04C = 2; - actor->vel.y = RAND_FLOAT_CENTERED(20.0f); - actor->vel.x = RAND_FLOAT_CENTERED(20.0f); - actor->vel.z = 0.0f; + this->timer_0BC = 35; + this->timer_04C = 2; + this->vel.y = RAND_FLOAT_CENTERED(20.0f); + this->vel.x = RAND_FLOAT_CENTERED(20.0f); + this->vel.z = 0.0f; break; } } } - if (actor->unk_0B4 == 0x52) { - AUDIO_PLAY_SFX(0x11000055, actor->sfxSource, 0); - actor->unk_0D0 = 1; - func_effect_8007C688(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 3.0f, 0x3C); + if (this->unk_0B4 == EINFO_82) { + AUDIO_PLAY_SFX(0x11000055, this->sfxSource, 0); + this->unk_0D0 = 1; + func_effect_8007C688(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 3.0f, 60); } } else { - actor->timer_0C6 = 20; - if ((actor->unk_0B4 == 6) && (gCurrentLevel == LEVEL_SOLAR)) { - AUDIO_PLAY_SFX(0x29033037, actor->sfxSource, 4); - } else if (actor->health < 20) { - AUDIO_PLAY_SFX(0x2943500F, actor->sfxSource, 4); + this->timer_0C6 = 20; + if ((this->unk_0B4 == EINFO_6) && (gCurrentLevel == LEVEL_SOLAR)) { + AUDIO_PLAY_SFX(0x29033037, this->sfxSource, 4); + } else if (this->health < 20) { + AUDIO_PLAY_SFX(0x2943500F, this->sfxSource, 4); } else { - AUDIO_PLAY_SFX(0x2903300E, actor->sfxSource, 4); + AUDIO_PLAY_SFX(0x2903300E, this->sfxSource, 4); } - if ((actor->unk_0B4 != 0xD) && (actor->unk_0B4 != 0x3D) && (actor->unk_0B4 != 0x53)) { - func_effect_8007D10C(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->scale * 1.5f); + if ((this->unk_0B4 != EINFO_13) && (this->unk_0B4 != EINFO_61) && (this->unk_0B4 != EINFO_83)) { + func_effect_8007D10C(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->scale * 1.5f); } - if (((gLevelMode == LEVELMODE_ALL_RANGE) || (gLevelMode == LEVELMODE_UNK_2)) && (actor->unk_0B4 != 0x15) && - (actor->unk_0B4 != 0x17)) { - actor->fwork[13] = 20.0f; - if (actor->obj.pos.x < actor->unk_0D8.x) { - actor->fwork[13] *= -1.0f; + if (((gLevelMode == LEVELMODE_ALL_RANGE) || (gLevelMode == LEVELMODE_UNK_2)) && + (this->unk_0B4 != EINFO_21) && (this->unk_0B4 != EINFO_23)) { + this->fwork[13] = 20.0f; + if (this->obj.pos.x < this->unk_0D8.x) { + this->fwork[13] *= -1.0f; } } - if (actor->unk_0D4 == 1) { - switch (actor->iwork[12]) { + if (this->unk_0D4 == 1) { + switch (this->iwork[12]) { case 1: - if (actor->unk_0D0 == 3) { - func_enmy2_8006A7B0(gMsg_ID_20210, RCID_FALCO); + if (this->unk_0D0 == 3) { + ActorEvent_SetMessage(gMsg_ID_20210, RCID_FALCO); } else { - func_enmy2_8006A7B0(gMsg_ID_20060, RCID_FALCO); + ActorEvent_SetMessage(gMsg_ID_20060, RCID_FALCO); } break; case 3: - if (actor->unk_0D0 == 3) { - func_enmy2_8006A7B0(gMsg_ID_20200, RCID_PEPPY); + if (this->unk_0D0 == 3) { + ActorEvent_SetMessage(gMsg_ID_20200, RCID_PEPPY); } else { - func_enmy2_8006A7B0(gMsg_ID_20070, RCID_PEPPY); + ActorEvent_SetMessage(gMsg_ID_20070, RCID_PEPPY); } break; case 2: - if (actor->unk_0D0 == 3) { - func_enmy2_8006A7B0(gMsg_ID_20190, RCID_SLIPPY); + if (this->unk_0D0 == 3) { + ActorEvent_SetMessage(gMsg_ID_20190, RCID_SLIPPY); } else { - func_enmy2_8006A7B0(gMsg_ID_20080, RCID_SLIPPY); + ActorEvent_SetMessage(gMsg_ID_20080, RCID_SLIPPY); } break; case 4: - func_enmy2_8006A7B0(gMsg_ID_20084, RCID_KATT); + ActorEvent_SetMessage(gMsg_ID_20084, RCID_KATT); break; case 5: - func_enmy2_8006A7B0(gMsg_ID_20085, RCID_BILL); + ActorEvent_SetMessage(gMsg_ID_20085, RCID_BILL); break; } } - actor->unk_0D0 = 0; + this->unk_0D0 = 0; } } - if ((actor->iwork[12] == 0) && (actor->iwork[13] == 0) && (actor->info.unk_16 != 2) && + if ((this->iwork[12] == 0) && (this->iwork[13] == 0) && (this->info.unk_16 != 2) && (gLevelType == LEVELTYPE_SPACE)) { - sp3C.x = actor->vel.x; - sp3C.y = actor->vel.y; - sp3C.z = actor->vel.z; + sp3C.x = this->vel.x; + sp3C.y = this->vel.y; + sp3C.z = this->vel.z; - if ((func_enmy_8006351C(actor->index, &actor->obj.pos, &sp3C, 0) != 0) || - (actor->obj.pos.y < (gGroundLevel + 20.0f))) { - actor->obj.status = OBJ_DYING; - actor->obj.pos.z -= actor->vel.z; - actor->unk_0D0 = 1; - if (actor->unk_0B4 == 13) { - actor->obj.id = OBJ_ACTOR_182; - func_enmy_800654E4(&actor->obj); + if ((func_enmy_8006351C(this->index, &this->obj.pos, &sp3C, 0) != 0) || + (this->obj.pos.y < (gGroundLevel + 20.0f))) { + this->obj.status = OBJ_DYING; + this->obj.pos.z -= this->vel.z; + this->unk_0D0 = 1; + if (this->unk_0B4 == EINFO_13) { + this->obj.id = OBJ_ACTOR_182; + func_enmy_800654E4(&this->obj); } - if (actor->unk_0B4 == 61) { - Meteo_8018CCF8(actor); + if (this->unk_0B4 == EINFO_61) { + Meteo_8018CCF8(this); } } } } -void func_enmy2_80070BA8(Actor* actor) { - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; - if ((actor->unk_0B4 != 17) || ((actor->unk_0B4 == 17) && (actor->unk_0D2 == 0))) { - actor->timer_0C6 = 10; - func_effect_8007C120(actor->unk_0D8.x, actor->unk_0D8.y, actor->unk_0D8.z, actor->vel.x, actor->vel.y, - actor->vel.z, 0.2f, 10); - actor->health -= actor->damage; - AUDIO_PLAY_SFX(0x29033064, actor->sfxSource, 4); - if (actor->health <= 0) { - BonusText_Display(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->info.bonus); - gHitCount += actor->info.bonus + 1; +void ActorEvent_80070BA8(Actor* this) { + if (this->unk_0D0 != 0) { + this->unk_0D0 = 0; + if ((this->unk_0B4 != EINFO_17) || ((this->unk_0B4 == EINFO_17) && (this->unk_0D2 == 0))) { + this->timer_0C6 = 10; + func_effect_8007C120(this->unk_0D8.x, this->unk_0D8.y, this->unk_0D8.z, this->vel.x, this->vel.y, + this->vel.z, 0.2f, 10); + this->health -= this->damage; + AUDIO_PLAY_SFX(0x29033064, this->sfxSource, 4); + if (this->health <= 0) { + BonusText_Display(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->info.bonus); + gHitCount += this->info.bonus + 1; D_ctx_80177850 = 15; } } else { - AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); + AUDIO_PLAY_SFX(0x29121007, this->sfxSource, 4); } } } -void func_enmy2_80070CEC(Actor* actor) { - if (actor->iwork[3] < 200) { - actor->aiIndex = actor->iwork[3] * 2; - actor->iwork[0] = 0; - actor->iwork[2] = 0; - func_enmy2_8006D36C(actor); +void ActorEvent_80070CEC(Actor* this) { + if (this->iwork[3] < 200) { + this->aiIndex = this->iwork[3] * 2; + this->iwork[0] = 0; + this->iwork[2] = 0; + ActorEvent_ProcessScript(this); } else { - actor->aiType = actor->iwork[3] - 200; - actor->aiIndex = 0; - actor->iwork[0] = 0; - actor->iwork[2] = 0; - func_enmy2_8006D36C(actor); + this->aiType = this->iwork[3] - 200; + this->aiIndex = 0; + this->iwork[0] = 0; + this->iwork[2] = 0; + ActorEvent_ProcessScript(this); } } -void func_enmy2_80070D44(Actor* actor) { +void ActorEvent_ProcessTriggers(Actor* this) { s32 i; s32 var_v1 = 0; s32 var_v1_4; @@ -2291,253 +2280,253 @@ void func_enmy2_80070D44(Actor* actor) { } } - if (actor->iwork[2] >= 100) { - if (fabsf(actor->obj.pos.z - gPlayer[0].unk_138) <= ((actor->iwork[2] - 100) * 100.0f)) { - func_enmy2_80070CEC(actor); + if (this->iwork[2] >= 100) { + if (fabsf(this->obj.pos.z - gPlayer[0].unk_138) <= ((this->iwork[2] - 100) * 100.0f)) { + ActorEvent_80070CEC(this); } return; } - switch (actor->iwork[2]) { - case EVC_0: + switch (this->iwork[2]) { + case EVC_NONE: break; case EVC_1: - if ((gActors[actor->iwork[1]].obj.status != OBJ_ACTIVE) || (gActors[actor->iwork[1]].health <= 0) || - (actor->iwork[10] != gActors[actor->iwork[1]].aiType)) { - func_enmy2_80070CEC(actor); + if ((gActors[this->iwork[1]].obj.status != OBJ_ACTIVE) || (gActors[this->iwork[1]].health <= 0) || + (this->iwork[10] != gActors[this->iwork[1]].aiType)) { + ActorEvent_80070CEC(this); } break; - case EVC_2: + case EVC_TEAM_COUNT_3: if (var_v1 == 3) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_3: + case EVC_TEAM_COUNT_2: if (var_v1 == 2) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_4: + case EVC_TEAM_COUNT_1: if (var_v1 == 1) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_5: + case EVC_TEAM_COUNT_0: if (var_v1 == 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_6: + case EVC_FALCO_ACTIVE: if (gTeamShields[1] > 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_7: + case EVC_PEPPY_ACTIVE: if (gTeamShields[3] > 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_8: + case EVC_SLIPPY_ACTIVE: if (gTeamShields[2] > 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; case EVC_9: - if (((actor->obj.pos.x - gPlayer[0].pos.x) <= 100.0f) && ((actor->obj.pos.x - gPlayer[0].pos.x) >= 0.0f)) { - func_enmy2_80070CEC(actor); + if (((this->obj.pos.x - gPlayer[0].pos.x) <= 100.0f) && ((this->obj.pos.x - gPlayer[0].pos.x) >= 0.0f)) { + ActorEvent_80070CEC(this); } break; case EVC_10: - if (((actor->obj.pos.x - gPlayer[0].pos.x) <= 400.0f) && ((actor->obj.pos.x - gPlayer[0].pos.x) >= 0.0f)) { - func_enmy2_80070CEC(actor); + if (((this->obj.pos.x - gPlayer[0].pos.x) <= 400.0f) && ((this->obj.pos.x - gPlayer[0].pos.x) >= 0.0f)) { + ActorEvent_80070CEC(this); } break; case EVC_11: - if (((actor->obj.pos.x - gPlayer[0].pos.x) <= 700.0f) && ((actor->obj.pos.x - gPlayer[0].pos.x) >= 0.0f)) { - func_enmy2_80070CEC(actor); + if (((this->obj.pos.x - gPlayer[0].pos.x) <= 700.0f) && ((this->obj.pos.x - gPlayer[0].pos.x) >= 0.0f)) { + ActorEvent_80070CEC(this); } break; case EVC_12: - if (((actor->obj.pos.x - gPlayer[0].pos.x) <= 200.0f) && ((actor->obj.pos.x - gPlayer[0].pos.x) >= 0.0f)) { - func_enmy2_80070CEC(actor); + if (((this->obj.pos.x - gPlayer[0].pos.x) <= 200.0f) && ((this->obj.pos.x - gPlayer[0].pos.x) >= 0.0f)) { + ActorEvent_80070CEC(this); } break; case EVC_13: - if (((actor->obj.pos.x - gPlayer[0].pos.x) >= -100.0f) && ((actor->obj.pos.x - gPlayer[0].pos.x) <= 0.0f)) { - func_enmy2_80070CEC(actor); + if (((this->obj.pos.x - gPlayer[0].pos.x) >= -100.0f) && ((this->obj.pos.x - gPlayer[0].pos.x) <= 0.0f)) { + ActorEvent_80070CEC(this); } break; case EVC_14: - if (((actor->obj.pos.x - gPlayer[0].pos.x) >= -400.0f) && ((actor->obj.pos.x - gPlayer[0].pos.x) <= 0.0f)) { - func_enmy2_80070CEC(actor); + if (((this->obj.pos.x - gPlayer[0].pos.x) >= -400.0f) && ((this->obj.pos.x - gPlayer[0].pos.x) <= 0.0f)) { + ActorEvent_80070CEC(this); } break; case EVC_15: - if (((actor->obj.pos.x - gPlayer[0].pos.x) >= -700.0f) && ((actor->obj.pos.x - gPlayer[0].pos.x) <= 0.0f)) { - func_enmy2_80070CEC(actor); + if (((this->obj.pos.x - gPlayer[0].pos.x) >= -700.0f) && ((this->obj.pos.x - gPlayer[0].pos.x) <= 0.0f)) { + ActorEvent_80070CEC(this); } break; case EVC_16: - if (((actor->obj.pos.x - gPlayer[0].pos.x) >= -200.0f) && ((actor->obj.pos.x - gPlayer[0].pos.x) <= 0.0f)) { - func_enmy2_80070CEC(actor); + if (((this->obj.pos.x - gPlayer[0].pos.x) >= -200.0f) && ((this->obj.pos.x - gPlayer[0].pos.x) <= 0.0f)) { + ActorEvent_80070CEC(this); } break; case EVC_17: - if (((actor->obj.pos.y - gPlayer[0].pos.y) <= 100.0f) && ((actor->obj.pos.y - gPlayer[0].pos.y) >= 0.0f)) { - func_enmy2_80070CEC(actor); + if (((this->obj.pos.y - gPlayer[0].pos.y) <= 100.0f) && ((this->obj.pos.y - gPlayer[0].pos.y) >= 0.0f)) { + ActorEvent_80070CEC(this); } break; case EVC_18: - if (((actor->obj.pos.y - gPlayer[0].pos.y) <= 400.0f) && ((actor->obj.pos.y - gPlayer[0].pos.y) >= 0.0f)) { - func_enmy2_80070CEC(actor); + if (((this->obj.pos.y - gPlayer[0].pos.y) <= 400.0f) && ((this->obj.pos.y - gPlayer[0].pos.y) >= 0.0f)) { + ActorEvent_80070CEC(this); } break; case EVC_19: - if (((actor->obj.pos.y - gPlayer[0].pos.y) <= 700.0f) && ((actor->obj.pos.y - gPlayer[0].pos.y) >= 0.0f)) { - func_enmy2_80070CEC(actor); + if (((this->obj.pos.y - gPlayer[0].pos.y) <= 700.0f) && ((this->obj.pos.y - gPlayer[0].pos.y) >= 0.0f)) { + ActorEvent_80070CEC(this); } break; case EVC_20: - if (((actor->obj.pos.y - gPlayer[0].pos.y) <= 200.0f) && ((actor->obj.pos.y - gPlayer[0].pos.y) >= 0.0f)) { - func_enmy2_80070CEC(actor); + if (((this->obj.pos.y - gPlayer[0].pos.y) <= 200.0f) && ((this->obj.pos.y - gPlayer[0].pos.y) >= 0.0f)) { + ActorEvent_80070CEC(this); } break; case EVC_21: - if (((actor->obj.pos.y - gPlayer[0].pos.y) >= -100.0f) && ((actor->obj.pos.y - gPlayer[0].pos.y) <= 0.0f)) { - func_enmy2_80070CEC(actor); + if (((this->obj.pos.y - gPlayer[0].pos.y) >= -100.0f) && ((this->obj.pos.y - gPlayer[0].pos.y) <= 0.0f)) { + ActorEvent_80070CEC(this); } break; case EVC_22: - if (((actor->obj.pos.y - gPlayer[0].pos.y) >= -400.0f) && ((actor->obj.pos.y - gPlayer[0].pos.y) <= 0.0f)) { - func_enmy2_80070CEC(actor); + if (((this->obj.pos.y - gPlayer[0].pos.y) >= -400.0f) && ((this->obj.pos.y - gPlayer[0].pos.y) <= 0.0f)) { + ActorEvent_80070CEC(this); } break; case EVC_23: - if (((actor->obj.pos.y - gPlayer[0].pos.y) >= -700.0f) && ((actor->obj.pos.y - gPlayer[0].pos.y) <= 0.0f)) { - func_enmy2_80070CEC(actor); + if (((this->obj.pos.y - gPlayer[0].pos.y) >= -700.0f) && ((this->obj.pos.y - gPlayer[0].pos.y) <= 0.0f)) { + ActorEvent_80070CEC(this); } break; case EVC_24: - if (((actor->obj.pos.y - gPlayer[0].pos.y) >= -200.0f) && ((actor->obj.pos.y - gPlayer[0].pos.y) <= 0.0f)) { - func_enmy2_80070CEC(actor); + if (((this->obj.pos.y - gPlayer[0].pos.y) >= -200.0f) && ((this->obj.pos.y - gPlayer[0].pos.y) <= 0.0f)) { + ActorEvent_80070CEC(this); } break; - case EVC_25: + case EVC_HEALTH_100p: if (gPlayer[0].shields >= Play_GetMaxShields()) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_26: + case EVC_HEALTH_75p: if (gPlayer[0].shields >= (Play_GetMaxShields() * 3 / 4)) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_27: + case EVC_HEALTH_50p: if (gPlayer[0].shields >= (Play_GetMaxShields() / 2)) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_28: + case EVC_HEALTH_25p: if (gPlayer[0].shields >= (Play_GetMaxShields() / 4)) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_29: + case EVC_HEALTH_0p: if (gPlayer[0].shields == 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; case EVC_30: if (gPlayer[0].unk_270 >= 5) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; case EVC_31: if (gPlayer[0].unk_270 != 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; case EVC_32: if (gPlayer[0].unk_270 == 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; case EVC_33: if (gPlayer[0].unk_250 >= 16.8f) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; case EVC_34: if (gPlayer[0].unk_250 <= 8.4f) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_35: + case EVC_SINGLE_LASER: if (gPlayer[0].wings.unk_14 > -8.0f) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_36: + case EVC_TWIN_LASER: if ((gPlayer[0].wings.unk_14 < -8.0f) && (gLaserStrength[0] == LASERS_TWIN)) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_37: + case EVC_HYPER_LASER: if ((gPlayer[0].wings.unk_14 < -8.0f) && (gLaserStrength[0] == LASERS_HYPER)) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_38: + case EVC_UNK3_LASER: if ((gPlayer[0].wings.unk_14 < -8.0f) && (gLaserStrength[0] == LASERS_UNK_3)) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; case EVC_39: for (i = 0; i < ARRAY_COUNT(gPlayerShots); i++) { if ((gPlayerShots[i].obj.status == 1) && - (fabsf(actor->obj.pos.x - gPlayerShots[i].obj.pos.x) < 150.0f) && - (fabsf(actor->obj.pos.y - gPlayerShots[i].obj.pos.y) < 150.0f) && - (fabsf(actor->obj.pos.z - gPlayerShots[i].obj.pos.z) < 150.0f)) { - func_enmy2_80070CEC(actor); + (fabsf(this->obj.pos.x - gPlayerShots[i].obj.pos.x) < 150.0f) && + (fabsf(this->obj.pos.y - gPlayerShots[i].obj.pos.y) < 150.0f) && + (fabsf(this->obj.pos.z - gPlayerShots[i].obj.pos.z) < 150.0f)) { + ActorEvent_80070CEC(this); break; } } @@ -2546,45 +2535,45 @@ void func_enmy2_80070D44(Actor* actor) { case EVC_40: for (i = 0; i < ARRAY_COUNT(gPlayerShots); i++) { if ((gPlayerShots[i].obj.status == 1) && - (fabsf(actor->obj.pos.x - gPlayerShots[i].obj.pos.x) < 300.0f) && - (fabsf(actor->obj.pos.y - gPlayerShots[i].obj.pos.y) < 300.0f) && - (fabsf(actor->obj.pos.z - gPlayerShots[i].obj.pos.z) < 300.0f)) { - func_enmy2_80070CEC(actor); + (fabsf(this->obj.pos.x - gPlayerShots[i].obj.pos.x) < 300.0f) && + (fabsf(this->obj.pos.y - gPlayerShots[i].obj.pos.y) < 300.0f) && + (fabsf(this->obj.pos.z - gPlayerShots[i].obj.pos.z) < 300.0f)) { + ActorEvent_80070CEC(this); break; } } break; case EVC_41: - if ((gActors[actor->iwork[9]].obj.status != OBJ_ACTIVE) || - ((gActors[actor->iwork[9]].scale < 0.0f) && (actor->health <= 0))) { - func_enmy2_80070CEC(actor); + if ((gActors[this->iwork[9]].obj.status != OBJ_ACTIVE) || + ((gActors[this->iwork[9]].scale < 0.0f) && (this->health <= 0))) { + ActorEvent_80070CEC(this); } break; case EVC_42: for (i = 0; i < ARRAY_COUNT(gActors); i++) { - if ((gActors[i].obj.status == OBJ_ACTIVE) && (gActors[i].obj.id == OBJ_ACTOR_200) && - (gActors[i].iwork[13] != 0) && (i != actor->index) && (actor->index == gActors[i].iwork[9])) { + if ((gActors[i].obj.status == OBJ_ACTIVE) && (gActors[i].obj.id == OBJ_ACTOR_EVENT) && + (gActors[i].iwork[13] != 0) && (i != this->index) && (this->index == gActors[i].iwork[9])) { return; } } - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); break; case EVC_43: for (i = 0; i < ARRAY_COUNT(gActors); i++) { - if ((gActors[i].obj.status == OBJ_ACTIVE) && (gActors[i].obj.id == OBJ_ACTOR_200) && - (gActors[i].iwork[13] != 0) && (i != actor->index) && (actor->index == gActors[i].iwork[9])) { - func_enmy2_80070CEC(actor); + if ((gActors[i].obj.status == OBJ_ACTIVE) && (gActors[i].obj.id == OBJ_ACTOR_EVENT) && + (gActors[i].iwork[13] != 0) && (i != this->index) && (this->index == gActors[i].iwork[9])) { + ActorEvent_80070CEC(this); break; } } break; case EVC_44: - if (actor->unk_0D0 != 0) { - func_enmy2_80070CEC(actor); + if (this->unk_0D0 != 0) { + ActorEvent_80070CEC(this); } break; @@ -2601,146 +2590,146 @@ void func_enmy2_80070D44(Actor* actor) { break; } - if (((gCurrentLevel != LEVEL_CORNERIA) || (gTeamShields[1] > 0)) && (D_ctx_80177E80 >= var_v1_4)) { - func_enmy2_80070CEC(actor); + if (!((gCurrentLevel == LEVEL_CORNERIA) && (gTeamShields[1] <= 0)) && (D_ctx_80177E80 >= var_v1_4)) { + ActorEvent_80070CEC(this); } break; case EVC_46: for (i = 0, otherActor = gActors; i < ARRAY_COUNT(gActors); i++, otherActor++) { if (((otherActor->obj.status == OBJ_DYING) || (otherActor->obj.status == OBJ_FREE)) && - (otherActor->iwork[15] == actor->iwork[15]) && (otherActor->iwork[16] != 0)) { - func_enmy2_80070CEC(actor); + (otherActor->iwork[15] == this->iwork[15]) && (otherActor->iwork[16] != 0)) { + ActorEvent_80070CEC(this); } } break; - case EVC_47: + case EVC_PRESS_CRIGHT: if (gControllerPress[gMainController].button & R_CBUTTONS) { func_8001AF40(0); D_enmy2_800CFF90 = 0; D_enmy2_80161690 = 0; - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_48: + case EVC_WING_BROKEN: if ((gPlayer[0].wings.rightState <= WINGSTATE_BROKEN) || (gPlayer[0].wings.leftState <= WINGSTATE_BROKEN)) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_49: + case EVC_ME_CLEAR: if (D_play_800D3180[LEVEL_METEO] != 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_50: + case EVC_FO_CLEAR: if (D_play_800D3180[LEVEL_FORTUNA] != 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_51: + case EVC_SX_CLEAR: if (D_play_800D3180[LEVEL_SECTOR_X] != 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_52: + case EVC_TI_CLEAR: if (D_play_800D3180[LEVEL_TITANIA] != 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_53: + case EVC_BO_CLEAR: if (D_play_800D3180[LEVEL_BOLSE] != 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_54: + case EVC_SY_CLEAR: if (D_play_800D3180[LEVEL_SECTOR_Y] != 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_55: + case EVC_KA_CLEAR: if (D_play_800D3180[LEVEL_KATINA] != 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_56: + case EVC_SO_CLEAR: if (D_play_800D3180[LEVEL_SOLAR] != 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_57: + case EVC_MA_CLEAR: if (D_play_800D3180[LEVEL_MACBETH] != 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_58: + case EVC_AQ_CLEAR: if (D_play_800D3180[LEVEL_AQUAS] != 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_59: + case EVC_ZO_CLEAR: if (D_play_800D3180[LEVEL_ZONESS] != 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_60: + case EVC_SZ_CLEAR: if (D_play_800D3180[LEVEL_SECTOR_Z] != 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_61: + case EVC_A6_CLEAR: if (D_play_800D3180[LEVEL_AREA_6] != 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; case EVC_62: - if (D_enmy_Timer_80161670[actor->iwork[12]] == 0) { - func_enmy2_80070CEC(actor); + if (D_enmy_Timer_80161670[this->iwork[12]] == 0) { + ActorEvent_80070CEC(this); } break; case EVC_63: - if (D_enmy_Timer_80161670[actor->iwork[12]] != 0) { - func_enmy2_80070CEC(actor); + if (D_enmy_Timer_80161670[this->iwork[12]] != 0) { + ActorEvent_80070CEC(this); } break; case EVC_64: if (D_enmy_80161684 != 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_65: + case EVC_30_HITS: if (gHitCount >= 30) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_66: + case EVC_80_HITS: if (gHitCount >= 80) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_67: + case EVC_EXPERT_MODE: if (gExpertMode) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; } @@ -2787,95 +2776,95 @@ static Vec3f D_800D1194[21] = { { 453.0f, 420.0f, 67.0f }, }; -void func_enmy2_80071DC0(Actor* actor) { +void ActorEvent_80071DC0(Actor* this) { s32 rInd; Vec3f sp38; - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, 0); + Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, 1); - if (actor->unk_0B4 == 30) { + if (this->unk_0B4 == EINFO_30) { rInd = RAND_FLOAT(ARRAY_COUNT(D_800D1074) - 1.1f); // off by 1 error? Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_800D1074[rInd], &sp38); } - if (actor->unk_0B4 == 17) { + if (this->unk_0B4 == EINFO_17) { rInd = RAND_FLOAT(ARRAY_COUNT(D_800D0DD4) - 0.1f); Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_800D0DD4[rInd], &sp38); } - if (actor->unk_0B4 == 31) { + if (this->unk_0B4 == EINFO_31) { rInd = RAND_FLOAT(ARRAY_COUNT(D_800D1194) - 0.1f); Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_800D1194[rInd], &sp38); } if (!(gGameFrameCount & 1)) { - func_effect_8007C120(actor->obj.pos.x + sp38.x, actor->obj.pos.y + sp38.y, actor->obj.pos.z + sp38.z, - actor->vel.x, actor->vel.y, actor->vel.z, 0.3f, 0x14); + func_effect_8007C120(this->obj.pos.x + sp38.x, this->obj.pos.y + sp38.y, this->obj.pos.z + sp38.z, this->vel.x, + this->vel.y, this->vel.z, 0.3f, 20); } if (!(gGameFrameCount & 7)) { - func_effect_8007BFFC(actor->obj.pos.x + sp38.x, actor->obj.pos.y + sp38.y, actor->obj.pos.z + sp38.z, - actor->vel.x, actor->vel.y, actor->vel.z, 10.0f, 9); + func_effect_8007BFFC(this->obj.pos.x + sp38.x, this->obj.pos.y + sp38.y, this->obj.pos.z + sp38.z, this->vel.x, + this->vel.y, this->vel.z, 10.0f, 9); } if (!(gGameFrameCount & 0xF)) { - AUDIO_PLAY_SFX(0x2903B009, actor->sfxSource, 4); + AUDIO_PLAY_SFX(0x2903B009, this->sfxSource, 4); } - actor->vel.y -= 0.1f; - actor->vel.z = 0.0f; - actor->obj.rot.x += 0.2f; - actor->obj.rot.z += 0.3f; + this->vel.y -= 0.1f; + this->vel.z = 0.0f; + this->obj.rot.x += 0.2f; + this->obj.rot.z += 0.3f; if (!(gGameFrameCount & 7) && (Rand_ZeroOne() < 0.5f)) { - actor->timer_0C6 = 4; + this->timer_0C6 = 4; } } -void func_enmy2_800720E8(Actor* actor) { - switch (actor->unk_046) { +void ActorEvent_800720E8(Actor* this) { + switch (this->unk_046) { case 0: - if (actor->unk_0D0 != 0) { - if (actor->unk_0D0 == 2) { - actor->damage = 3; + if (this->unk_0D0 != 0) { + if (this->unk_0D0 == 2) { + this->damage = 3; } - if ((actor->unk_0D4 > 100) && (gActors[actor->unk_0D4 - 101].unk_0B4 == 85)) { - actor->damage = 20; + if ((this->unk_0D4 >= 101) && (gActors[this->unk_0D4 - 101].unk_0B4 == 85)) { + this->damage = 20; } - actor->health -= actor->damage; - actor->fwork[16] += 0.2f; - actor->timer_0BC = 5; + this->health -= this->damage; + this->fwork[16] += 0.2f; + this->timer_0BC = 5; - if (actor->timer_0BE < 20) { - actor->timer_0BE += 5; + if (this->timer_0BE < 20) { + this->timer_0BE += 5; } - if (actor->health <= 0) { - actor->unk_046 = 1; - actor->info.hitbox = SEGMENTED_TO_VIRTUAL(D_SX_6032408); - AUDIO_PLAY_SFX(0x1900000D, actor->sfxSource, 0); + if (this->health <= 0) { + this->unk_046 = 1; + this->info.hitbox = SEGMENTED_TO_VIRTUAL(D_SX_6032408); + AUDIO_PLAY_SFX(0x1900000D, this->sfxSource, 0); } else { - AUDIO_PLAY_SFX(0x2903300E, actor->sfxSource, 0); + AUDIO_PLAY_SFX(0x2903300E, this->sfxSource, 0); } - actor->unk_0D0 = 0; + this->unk_0D0 = 0; } break; case 1: case 2: - Math_SmoothStepToF(&actor->fwork[16], 130.0f, 0.2f, 8.0f, 0.001f); - if (actor->fwork[16] > 45.0f) { - Math_SmoothStepToF(&actor->fwork[15], 90.0f, 0.2f, 10.0f, 0.001f); + Math_SmoothStepToF(&this->fwork[16], 130.0f, 0.2f, 8.0f, 0.001f); + if (this->fwork[16] > 45.0f) { + Math_SmoothStepToF(&this->fwork[15], 90.0f, 0.2f, 10.0f, 0.001f); } break; } } -void func_enmy2_800722EC(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 yRot) { +void ActorEvent_800722EC(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 yRot) { Vec3f sp2C; Vec3f sp20; @@ -2899,51 +2888,51 @@ void func_enmy2_800722EC(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 yRot) Object_SetInfo(&effect->info, effect->obj.id); } -void func_enmy2_8007240C(f32 xPos, f32 yPos, f32 zPos, f32 yRot) { +void ActorEvent_8007240C(f32 xPos, f32 yPos, f32 zPos, f32 yRot) { s32 i; for (i = 0; i < ARRAY_COUNT(gEffects); i++) { if (gEffects[i].obj.status == OBJ_FREE) { - func_enmy2_800722EC(&gEffects[i], xPos, yPos, zPos, yRot); + ActorEvent_800722EC(&gEffects[i], xPos, yPos, zPos, yRot); break; } } } -void func_enmy2_80072474(Actor* actor) { +void ActorEvent_80072474(Actor* this) { f32 var_fv1; - if (actor->unk_048 != 0) { - switch (actor->unk_048) { - case 1: - actor->fwork[16] = 45.0f; + + if (this->unk_048 != EVACT_0) { + switch (this->unk_048) { + case EVACT_1: + this->fwork[16] = 45.0f; break; - case 2: - actor->fwork[16] = 0.0f; + case EVACT_2: + this->fwork[16] = 0.0f; break; - case 3: - actor->iwork[15] = 1; + case EVACT_3: + this->iwork[15] = 1; break; - case 4: - actor->iwork[15] = 0; + case EVACT_4: + this->iwork[15] = 0; break; } - actor->unk_048 = 0; + this->unk_048 = EVACT_0; } - if (actor->iwork[15] != 0) { - var_fv1 = - Math_RadToDeg(Math_Atan2F(gPlayer[0].pos.x - actor->obj.pos.x, gPlayer[0].unk_138 - actor->obj.pos.z)); - } else if (actor->iwork[6] != 0) { - var_fv1 = actor->unk_0F4.y; + if (this->iwork[15] != 0) { + var_fv1 = Math_RadToDeg(Math_Atan2F(gPlayer[0].pos.x - this->obj.pos.x, gPlayer[0].unk_138 - this->obj.pos.z)); + } else if (this->iwork[6] != 0) { + var_fv1 = this->unk_0F4.y; } else { var_fv1 = 0.0f; } - Math_SmoothStepToAngle(&actor->obj.rot.y, var_fv1, 0.2f, 3.0f, 0.0f); - Math_SmoothStepToAngle(&actor->fwork[15], actor->fwork[16], 0.5f, 8.0f, 0.0f); + Math_SmoothStepToAngle(&this->obj.rot.y, var_fv1, 0.2f, 3.0f, 0.0f); + Math_SmoothStepToAngle(&this->fwork[15], this->fwork[16], 0.5f, 8.0f, 0.0f); } static Vec3f D_800D1290 = { 0.0f, 837.00006f, 0.0f }; // could be in-function -void func_enmy2_80072594(Actor* actor) { +void ActorEvent_Update(Actor* this) { s32 spFC; f32 var_fv0; s32 var_s0; @@ -2964,87 +2953,87 @@ void func_enmy2_80072594(Actor* actor) { Vec3f spA0; if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_7) || (D_ctx_8017828C != 0)) { - Object_Kill(&actor->obj, actor->sfxSource); + Object_Kill(&this->obj, this->sfxSource); return; } - if (actor->state == 0x3E8) { - actor->obj.rot.y += actor->fwork[15]; - actor->obj.rot.x += actor->fwork[16]; + if (this->state == EVSTATE_1000) { + this->obj.rot.y += this->fwork[15]; + this->obj.rot.x += this->fwork[16]; if (!(gGameFrameCount & 0xF)) { - func_effect_8007C120(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->vel.x, actor->vel.y, - actor->vel.z, 0.3f, 0xA); + func_effect_8007C120(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->vel.x, this->vel.y, + this->vel.z, 0.3f, 10); } } else { - if (((actor->unk_0B4 == 0x11) || (actor->unk_0B4 == 0x1E) || (actor->unk_0B4 == 0x1F)) && - (actor->health <= 0)) { - func_enmy2_80071DC0(actor); + if (((this->unk_0B4 == EINFO_17) || (this->unk_0B4 == EINFO_30) || (this->unk_0B4 == EINFO_31)) && + (this->health <= 0)) { + ActorEvent_80071DC0(this); return; } - if (actor->unk_0B4 == 300) { - gPlayer[0].unk_1A4 = actor->index; - actor->timer_0C2 = 100; - } else if (actor->unk_0B4 >= 200) { - actor->unk_04E++; - - if (actor->unk_04E >= 100) { - actor->unk_04E = 0; - } - - D_ctx_80176558[actor->unk_046][actor->unk_04E] = actor->obj.pos.x; - D_ctx_80176878[actor->unk_046][actor->unk_04E] = actor->obj.pos.y; - D_ctx_80176B98[actor->unk_046][actor->unk_04E] = actor->obj.pos.z; - D_ctx_80176EB8[actor->unk_046][actor->unk_04E] = actor->obj.rot.x; - D_ctx_801771D8[actor->unk_046][actor->unk_04E] = actor->obj.rot.y; - D_ctx_80177500[actor->unk_046][actor->unk_04E] = actor->obj.rot.z; - - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; - actor->timer_0C6 = 20; - actor->health -= actor->damage; - - AUDIO_PLAY_SFX(0x29034041, actor->sfxSource, 4); - - if (actor->health <= 0) { - actor->timer_0C6 = 200; - actor->obj.status = OBJ_DYING; - func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 8.0f); - actor->obj.status = OBJ_DYING; - actor->timer_0BC = 20; - actor->obj.id = OBJ_ACTOR_194; + if (this->unk_0B4 == EINFO_300) { + gPlayer[0].unk_1A4 = this->index; + this->timer_0C2 = 100; + } else if (this->unk_0B4 >= EINFO_200) { + this->unk_04E++; + + if (this->unk_04E >= 100) { + this->unk_04E = 0; + } + + D_ctx_80176558[this->unk_046][this->unk_04E] = this->obj.pos.x; + D_ctx_80176878[this->unk_046][this->unk_04E] = this->obj.pos.y; + D_ctx_80176B98[this->unk_046][this->unk_04E] = this->obj.pos.z; + D_ctx_80176EB8[this->unk_046][this->unk_04E] = this->obj.rot.x; + D_ctx_801771D8[this->unk_046][this->unk_04E] = this->obj.rot.y; + D_ctx_80177500[this->unk_046][this->unk_04E] = this->obj.rot.z; + + if (this->unk_0D0 != 0) { + this->unk_0D0 = 0; + this->timer_0C6 = 20; + this->health -= this->damage; + + AUDIO_PLAY_SFX(0x29034041, this->sfxSource, 4); + + if (this->health <= 0) { + this->timer_0C6 = 200; + this->obj.status = OBJ_DYING; + func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 8.0f); + this->obj.status = OBJ_DYING; + this->timer_0BC = 20; + this->obj.id = OBJ_ACTOR_194; } } } - if ((actor->unk_0B4 == 27) && (actor->timer_0C2 != 0)) { - actor->state = 0; + if ((this->unk_0B4 == EINFO_27) && (this->timer_0C2 != 0)) { + this->state = EVSTATE_0; } - switch (actor->state) { - case 0: - func_enmy2_8006D36C(actor); + switch (this->state) { + case EVSTATE_0: + ActorEvent_ProcessScript(this); break; - case 1: - if (actor->timer_0BC == 0) { - func_enmy2_8006D36C(actor); + case EVSTATE_1: + if (this->timer_0BC == 0) { + ActorEvent_ProcessScript(this); } break; - case 6: - case 7: - case 14: - case 15: - spF0 = actor->obj.pos.x; - spEC = actor->obj.pos.y; - spE8 = actor->obj.pos.z; + case EVSTATE_6: + case EVSTATE_7: + case EVSTATE_14: + case EVSTATE_15: + spF0 = this->obj.pos.x; + spEC = this->obj.pos.y; + spE8 = this->obj.pos.z; - if ((actor->unk_0B4 == 0x21) || (actor->unk_0B4 == 0x44)) { - Matrix_RotateZ(gCalcMatrix, -(actor->vwork[29].z + actor->unk_0F4.z) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -actor->vwork[29].x * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -actor->vwork[29].y * M_DTOR, 1); + if ((this->unk_0B4 == EINFO_33) || (this->unk_0B4 == EINFO_68)) { + Matrix_RotateZ(gCalcMatrix, -(this->vwork[29].z + this->unk_0F4.z) * M_DTOR, 0); + Matrix_RotateX(gCalcMatrix, -this->vwork[29].x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, -this->vwork[29].y * M_DTOR, 1); - if ((actor->state == 0xE) || (actor->state == 0xF)) { + if ((this->state == EVSTATE_14) || (this->state == EVSTATE_15)) { spB8.x = gPlayer[0].camEye.x - spF0; spB8.y = gPlayer[0].camEye.y - (spEC + 25.0f); spB8.z = (gPlayer[0].camEye.z * 15.0f) - spE8; @@ -3070,23 +3059,23 @@ void func_enmy2_80072594(Actor* actor) { spFC++; } - actor->obj.rot.x = 0.0f; + this->obj.rot.x = 0.0f; - Math_SmoothStepToAngle(&actor->obj.rot.y, spE0, 0.2f, actor->fwork[24], 0.001f); - Math_SmoothStepToAngle(&actor->fwork[15], spE4, 0.2f, actor->fwork[24], 0.001f); + Math_SmoothStepToAngle(&this->obj.rot.y, spE0, 0.2f, this->fwork[24], 0.001f); + Math_SmoothStepToAngle(&this->fwork[15], spE4, 0.2f, this->fwork[24], 0.001f); - if (!(actor->timer_0BC & 0x1F) && (spFC == 0)) { - Matrix_RotateY(gCalcMatrix, actor->vwork[29].y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->vwork[29].x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, (actor->vwork[29].z + actor->unk_0F4.z) * M_DTOR, 1); + if (!(this->timer_0BC & 0x1F) && (spFC == 0)) { + Matrix_RotateY(gCalcMatrix, this->vwork[29].y * M_DTOR, 0); + Matrix_RotateX(gCalcMatrix, this->vwork[29].x * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, (this->vwork[29].z + this->unk_0F4.z) * M_DTOR, 1); spB8.x = 0.0f; spB8.y = 25.0f; spB8.z = 0.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &spB8, &spA0); - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, actor->fwork[15] * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, this->fwork[15] * M_DTOR, 1); spB8.x = 0.0f; spB8.y = 0.0f; @@ -3094,21 +3083,21 @@ void func_enmy2_80072594(Actor* actor) { Matrix_MultVec3fNoTranslate(gCalcMatrix, &spB8, &spAC); - if (actor->unk_0B4 == 0x44) { + if (this->unk_0B4 == EINFO_68) { var_fv0 = 80.0f; } else { var_fv0 = 0.0f; } - func_effect_8007F04C(OBJ_EFFECT_353, actor->obj.pos.x + spAC.x + spA0.x, - actor->obj.pos.y + spAC.y + spA0.y + var_fv0, - actor->obj.pos.z + spAC.z + spA0.z, actor->fwork[15], actor->obj.rot.y, - actor->obj.rot.z, actor->vwork[29].x, actor->vwork[29].y, - actor->vwork[29].z + actor->unk_0F4.z, spAC.x, spAC.y, spAC.z, 1.0f); - actor->fwork[16] = -15.0f; + func_effect_8007F04C(OBJ_EFFECT_353, this->obj.pos.x + spAC.x + spA0.x, + this->obj.pos.y + spAC.y + spA0.y + var_fv0, + this->obj.pos.z + spAC.z + spA0.z, this->fwork[15], this->obj.rot.y, + this->obj.rot.z, this->vwork[29].x, this->vwork[29].y, + this->vwork[29].z + this->unk_0F4.z, spAC.x, spAC.y, spAC.z, 1.0f); + this->fwork[16] = -15.0f; } } else { - if ((actor->state == 0xE) || (actor->state == 0xF)) { + if ((this->state == EVSTATE_14) || (this->state == EVSTATE_15)) { spCC = gPlayer[0].camEye.x; spC8 = gPlayer[0].camEye.y; spC4 = gPlayer[0].camEye.z; @@ -3118,12 +3107,12 @@ void func_enmy2_80072594(Actor* actor) { spC4 = gPlayer[0].pos.z; } - Math_SmoothStepToAngle(&actor->vwork[29].z, 0.0f, 0.1f, 5.0f, 0.0001f); - Math_SmoothStepToAngle(&actor->unk_0F4.z, 0.0f, 0.1f, 5.0f, 0.0001f); + Math_SmoothStepToAngle(&this->vwork[29].z, 0.0f, 0.1f, 5.0f, 0.0001f); + Math_SmoothStepToAngle(&this->unk_0F4.z, 0.0f, 0.1f, 5.0f, 0.0001f); spE0 = Math_RadToDeg(Math_Atan2F(spCC - spF0, spC4 - spE8)); - if ((actor->state == 7) || (actor->state == 0xF)) { + if ((this->state == EVSTATE_7) || (this->state == EVSTATE_15)) { spE0 += 180.0f; if (spE0 > 360.0f) { spE0 -= 360.0f; @@ -3131,418 +3120,418 @@ void func_enmy2_80072594(Actor* actor) { } spE4 = Math_RadToDeg(-Math_Atan2F(spC8 - spEC, sqrtf(SQ(spCC - spF0) + SQ(spC4 - spE8)))); - spEC = Math_SmoothStepToAngle(&actor->unk_0F4.y, spE0, 0.2f, actor->fwork[24], 0.0001f); + spEC = Math_SmoothStepToAngle(&this->unk_0F4.y, spE0, 0.2f, this->fwork[24], 0.0001f); - Math_SmoothStepToAngle(&actor->unk_0F4.x, spE4, 0.2f, actor->fwork[24], 0.0001f); + Math_SmoothStepToAngle(&this->unk_0F4.x, spE4, 0.2f, this->fwork[24], 0.0001f); - if (actor->iwork[6] != 0) { + if (this->iwork[6] != 0) { var_fv0 = 330.0f; if (spEC < 0.0f) { var_fv0 = 30.0f; } - Math_SmoothStepToAngle(&actor->fwork[23], var_fv0, 0.1f, 5.0f, 0.01f); + Math_SmoothStepToAngle(&this->fwork[23], var_fv0, 0.1f, 5.0f, 0.01f); } } - if (actor->timer_0BC == 0) { - func_enmy2_8006D36C(actor); + if (this->timer_0BC == 0) { + ActorEvent_ProcessScript(this); } break; - case 13: - spDC = SIN_DEG((actor->index * 45) + gGameFrameCount) * actor->fwork[17]; - spD8 = COS_DEG((actor->index * 45) + (gGameFrameCount * 2)) * actor->fwork[17]; - pad = actor->iwork[1]; + case EVSTATE_13: + spDC = SIN_DEG((this->index * 45) + gGameFrameCount) * this->fwork[17]; + spD8 = COS_DEG((this->index * 45) + (gGameFrameCount * 2)) * this->fwork[17]; + pad = this->iwork[1]; pad = gActors[pad].iwork[12]; D_enmy_Timer_80161670[pad] = 5; - - case 8: - case 9: - spF0 = actor->obj.pos.x; - spEC = actor->obj.pos.y; - spE8 = actor->obj.pos.z; - - spE0 = Math_RadToDeg(Math_Atan2F(gActors[actor->iwork[1]].obj.pos.x + spDC - spF0, - gActors[actor->iwork[1]].obj.pos.z + spD4 - spE8)); - if (actor->state == 7) { + /* fallthrough */ + case EVSTATE_8: + case EVSTATE_9: + spF0 = this->obj.pos.x; + spEC = this->obj.pos.y; + spE8 = this->obj.pos.z; + + spE0 = Math_RadToDeg(Math_Atan2F(gActors[this->iwork[1]].obj.pos.x + spDC - spF0, + gActors[this->iwork[1]].obj.pos.z + spD4 - spE8)); + if (this->state == EVSTATE_7) { spE0 += 180.0f; if (spE0 > 360.0f) { spE0 -= 360.0f; } } - spE4 = Math_RadToDeg(-Math_Atan2F(gActors[actor->iwork[1]].obj.pos.y + spD8 - spEC, - sqrtf(SQ(gActors[actor->iwork[1]].obj.pos.x + spDC - spF0) + - SQ(gActors[actor->iwork[1]].obj.pos.z + spD4 - spE8)))); - spEC = Math_SmoothStepToAngle(&actor->unk_0F4.y, spE0, 0.2f, actor->fwork[24], 0.0001f); + spE4 = Math_RadToDeg(-Math_Atan2F(gActors[this->iwork[1]].obj.pos.y + spD8 - spEC, + sqrtf(SQ(gActors[this->iwork[1]].obj.pos.x + spDC - spF0) + + SQ(gActors[this->iwork[1]].obj.pos.z + spD4 - spE8)))); + spEC = Math_SmoothStepToAngle(&this->unk_0F4.y, spE0, 0.2f, this->fwork[24], 0.0001f); - Math_SmoothStepToAngle(&actor->unk_0F4.x, spE4, 0.2f, actor->fwork[24], 0.0001f); + Math_SmoothStepToAngle(&this->unk_0F4.x, spE4, 0.2f, this->fwork[24], 0.0001f); - if (actor->iwork[6] != 0) { + if (this->iwork[6] != 0) { var_fv0 = 310.0f; if (spEC < 0.0f) { var_fv0 = 50.0f; } - Math_SmoothStepToAngle(&actor->fwork[23], var_fv0, 0.1f, 5.0f, 0.01f); + Math_SmoothStepToAngle(&this->fwork[23], var_fv0, 0.1f, 5.0f, 0.01f); } - if (actor->timer_0BC == 0) { - func_enmy2_8006D36C(actor); + if (this->timer_0BC == 0) { + ActorEvent_ProcessScript(this); } break; - case 2: - actor->unk_0F4.x += actor->fwork[3]; - actor->fwork[2] -= actor->fwork[3]; - if (actor->fwork[2] <= 0.0f) { - func_enmy2_8006D36C(actor); + case EVSTATE_F4_PLUS_X: + this->unk_0F4.x += this->fwork[3]; + this->fwork[2] -= this->fwork[3]; + if (this->fwork[2] <= 0.0f) { + ActorEvent_ProcessScript(this); } break; - case 3: - actor->unk_0F4.x -= actor->fwork[3]; - actor->fwork[2] -= actor->fwork[3]; - if (actor->fwork[2] <= 0.0f) { - func_enmy2_8006D36C(actor); + case EVSTATE_F4_MINUS_X: + this->unk_0F4.x -= this->fwork[3]; + this->fwork[2] -= this->fwork[3]; + if (this->fwork[2] <= 0.0f) { + ActorEvent_ProcessScript(this); } break; - case 4: - actor->unk_0F4.y += actor->fwork[3]; - actor->fwork[2] -= actor->fwork[3]; - if (actor->fwork[2] <= 0.0f) { - func_enmy2_8006D36C(actor); + case EVSTATE_F4_PLUS_Y: + this->unk_0F4.y += this->fwork[3]; + this->fwork[2] -= this->fwork[3]; + if (this->fwork[2] <= 0.0f) { + ActorEvent_ProcessScript(this); } break; - case 5: - actor->unk_0F4.y -= actor->fwork[3]; - actor->fwork[2] -= actor->fwork[3]; - if (actor->fwork[2] <= 0.0f) { - func_enmy2_8006D36C(actor); + case EVSTATE_F4_MINUS_Y: + this->unk_0F4.y -= this->fwork[3]; + this->fwork[2] -= this->fwork[3]; + if (this->fwork[2] <= 0.0f) { + ActorEvent_ProcessScript(this); } break; - case 10: + case EVSTATE_10: var_s0 = 0; - if (Math_SmoothStepToAngle(&actor->obj.rot.x, 0.0f, 0.3f, 10.0f, 1.0f) == 0.0f) { + if (Math_SmoothStepToAngle(&this->obj.rot.x, 0.0f, 0.3f, 10.0f, 1.0f) == 0.0f) { var_s0++; } - if (Math_SmoothStepToAngle(&actor->obj.rot.y, 0.0f, 0.3f, 10.0f, 1.0f) == 0.0f) { + if (Math_SmoothStepToAngle(&this->obj.rot.y, 0.0f, 0.3f, 10.0f, 1.0f) == 0.0f) { var_s0++; } - if (Math_SmoothStepToF(&actor->fwork[15], 40.0f, 0.3f, 10.0f, 1.0f) == 0.0f) { + if (Math_SmoothStepToF(&this->fwork[15], 40.0f, 0.3f, 10.0f, 1.0f) == 0.0f) { var_s0++; } if (var_s0 == 3) { - actor->info.hitbox = SEGMENTED_TO_VIRTUAL(D_ME_602F638); - func_enmy2_8006D36C(actor); + this->info.hitbox = SEGMENTED_TO_VIRTUAL(D_ME_602F638); + ActorEvent_ProcessScript(this); } break; - case 11: - if (Math_SmoothStepToF(&actor->fwork[15], 0.0f, 0.3f, 10.0f, 1.0f) == 0.0f) { - func_enmy2_8006D36C(actor); + case EVSTATE_11: + if (Math_SmoothStepToF(&this->fwork[15], 0.0f, 0.3f, 10.0f, 1.0f) == 0.0f) { + ActorEvent_ProcessScript(this); } break; - case 12: - Math_SmoothStepToAngle(&actor->unk_0F4.x, 270.0f, 0.1f, 2.0f, 0.0f); - gTeamShields[actor->iwork[12]] = -1; - gTeamDamage[actor->iwork[12]] = 0; + case EVSTATE_TEAM_RETREAT: + Math_SmoothStepToAngle(&this->unk_0F4.x, 270.0f, 0.1f, 2.0f, 0.0f); + gTeamShields[this->iwork[12]] = -1; + gTeamDamage[this->iwork[12]] = 0; break; - case 200: + case EVSTATE_SCRIPT_END: break; } - if (actor->iwork[13] != 0) { - if (gActors[actor->iwork[9]].obj.status != OBJ_ACTIVE) { - actor->iwork[13] = 0; + if (this->iwork[13] != 0) { + if (gActors[this->iwork[9]].obj.status != OBJ_ACTIVE) { + this->iwork[13] = 0; } else { - Matrix_RotateY(gCalcMatrix, gActors[actor->iwork[9]].obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, gActors[actor->iwork[9]].obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, gActors[actor->iwork[9]].obj.rot.z * M_DTOR, 1); - Matrix_MultVec3fNoTranslate(gCalcMatrix, &actor->vwork[28], &spAC); - actor->obj.pos.x = gActors[actor->iwork[9]].obj.pos.x + spAC.x; - actor->obj.pos.y = gActors[actor->iwork[9]].obj.pos.y + spAC.y; - actor->obj.pos.z = gActors[actor->iwork[9]].obj.pos.z + spAC.z; - actor->vwork[29].x = gActors[actor->iwork[9]].obj.rot.x; - actor->vwork[29].y = gActors[actor->iwork[9]].obj.rot.y; - actor->vwork[29].z = gActors[actor->iwork[9]].obj.rot.z; - if (actor->timer_0C0 == 0) { - actor->iwork[13] = 0; + Matrix_RotateY(gCalcMatrix, gActors[this->iwork[9]].obj.rot.y * M_DTOR, 0); + Matrix_RotateX(gCalcMatrix, gActors[this->iwork[9]].obj.rot.x * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, gActors[this->iwork[9]].obj.rot.z * M_DTOR, 1); + Matrix_MultVec3fNoTranslate(gCalcMatrix, &this->vwork[28], &spAC); + this->obj.pos.x = gActors[this->iwork[9]].obj.pos.x + spAC.x; + this->obj.pos.y = gActors[this->iwork[9]].obj.pos.y + spAC.y; + this->obj.pos.z = gActors[this->iwork[9]].obj.pos.z + spAC.z; + this->vwork[29].x = gActors[this->iwork[9]].obj.rot.x; + this->vwork[29].y = gActors[this->iwork[9]].obj.rot.y; + this->vwork[29].z = gActors[this->iwork[9]].obj.rot.z; + if (this->timer_0C0 == 0) { + this->iwork[13] = 0; } } } - Math_SmoothStepToF(&actor->fwork[0], actor->fwork[1], 0.1f, 5.0f, 0.0001f); + Math_SmoothStepToF(&this->fwork[0], this->fwork[1], 0.1f, 5.0f, 0.0001f); - if (actor->unk_0F4.x >= 360.0f) { - actor->unk_0F4.x -= 360.0f; + if (this->unk_0F4.x >= 360.0f) { + this->unk_0F4.x -= 360.0f; } - if (actor->unk_0F4.x < 0.0f) { - actor->unk_0F4.x += 360.0f; + if (this->unk_0F4.x < 0.0f) { + this->unk_0F4.x += 360.0f; } - if (actor->unk_0F4.y >= 360.0f) { - actor->unk_0F4.y -= 360.0f; + if (this->unk_0F4.y >= 360.0f) { + this->unk_0F4.y -= 360.0f; } - if (actor->unk_0F4.y < 0.0f) { - actor->unk_0F4.y += 360.0f; + if (this->unk_0F4.y < 0.0f) { + this->unk_0F4.y += 360.0f; } - if (actor->iwork[6] != 0) { - if ((gLevelMode == LEVELMODE_UNK_2) && (actor->unk_0B4 == 200)) { - Math_SmoothStepToAngle(&actor->obj.rot.x, actor->unk_0F4.x, 0.1f, 10.0f, 0.00001f); - Math_SmoothStepToAngle(&actor->obj.rot.y, actor->unk_0F4.y, 0.1f, 10.0f, 0.00001f); + if (this->iwork[6] != 0) { + if ((gLevelMode == LEVELMODE_UNK_2) && (this->unk_0B4 == EINFO_200)) { + Math_SmoothStepToAngle(&this->obj.rot.x, this->unk_0F4.x, 0.1f, 10.0f, 0.00001f); + Math_SmoothStepToAngle(&this->obj.rot.y, this->unk_0F4.y, 0.1f, 10.0f, 0.00001f); } else { - Math_SmoothStepToAngle(&actor->obj.rot.x, actor->unk_0F4.x, 0.2f, 100.0f, 0.00001f); - Math_SmoothStepToAngle(&actor->obj.rot.y, actor->unk_0F4.y, 0.2f, 100.0f, 0.00001f); + Math_SmoothStepToAngle(&this->obj.rot.x, this->unk_0F4.x, 0.2f, 100.0f, 0.00001f); + Math_SmoothStepToAngle(&this->obj.rot.y, this->unk_0F4.y, 0.2f, 100.0f, 0.00001f); } } - if (actor->fwork[4] > 0.0f) { - actor->fwork[4] -= actor->fwork[5]; - actor->obj.rot.x += actor->fwork[5] * actor->fwork[6]; - if (actor->obj.rot.x >= 360.0f) { - actor->obj.rot.x -= 360.0f; + if (this->fwork[4] > 0.0f) { + this->fwork[4] -= this->fwork[5]; + this->obj.rot.x += this->fwork[5] * this->fwork[6]; + if (this->obj.rot.x >= 360.0f) { + this->obj.rot.x -= 360.0f; } - if (actor->obj.rot.x < 0.0f) { - actor->obj.rot.x += 360.0f; + if (this->obj.rot.x < 0.0f) { + this->obj.rot.x += 360.0f; } } - if (actor->fwork[7] > 0.0f) { - actor->fwork[7] -= actor->fwork[8]; - actor->obj.rot.y += actor->fwork[8] * actor->fwork[9]; - if (actor->obj.rot.y >= 360.0f) { - actor->obj.rot.y = actor->obj.rot.y - 360.0f; + if (this->fwork[7] > 0.0f) { + this->fwork[7] -= this->fwork[8]; + this->obj.rot.y += this->fwork[8] * this->fwork[9]; + if (this->obj.rot.y >= 360.0f) { + this->obj.rot.y = this->obj.rot.y - 360.0f; } - if (actor->obj.rot.y < 0.0f) { - actor->obj.rot.y += 360.0f; + if (this->obj.rot.y < 0.0f) { + this->obj.rot.y += 360.0f; } } - if (actor->fwork[10] > 0.0f) { - if ((actor->unk_0B4 == 0xD) || (actor->unk_0B4 == 0xE) || (actor->unk_0B4 == 0x3D) || - (actor->unk_0B4 == 0x3E) || (actor->unk_0B4 == 0x3F) || (actor->unk_0B4 == 0x40) || - (actor->unk_0B4 == 0x41) || (actor->unk_0B4 == 0x42) || (actor->unk_0B4 == 0x5E) || - (actor->unk_0B4 == 0x5F) || (actor->unk_0B4 == 0x61)) { - actor->obj.rot.y -= actor->fwork[11] * actor->fwork[12]; - actor->obj.rot.x += actor->fwork[11] * actor->fwork[12]; + if (this->fwork[10] > 0.0f) { + if ((this->unk_0B4 == EINFO_13) || (this->unk_0B4 == EINFO_14) || (this->unk_0B4 == EINFO_61) || + (this->unk_0B4 == EINFO_62) || (this->unk_0B4 == EINFO_63) || (this->unk_0B4 == EINFO_64) || + (this->unk_0B4 == EINFO_65) || (this->unk_0B4 == EINFO_66) || (this->unk_0B4 == EINFO_94) || + (this->unk_0B4 == EINFO_95) || (this->unk_0B4 == EINFO_97)) { + this->obj.rot.y -= this->fwork[11] * this->fwork[12]; + this->obj.rot.x += this->fwork[11] * this->fwork[12]; } else { - actor->fwork[10] -= actor->fwork[11]; - actor->fwork[23] += actor->fwork[11] * actor->fwork[12]; + this->fwork[10] -= this->fwork[11]; + this->fwork[23] += this->fwork[11] * this->fwork[12]; } } - if (actor->fwork[23] >= 360.0f) { - actor->fwork[23] -= 360.0f; + if (this->fwork[23] >= 360.0f) { + this->fwork[23] -= 360.0f; } - if (actor->fwork[23] < 0.0f) { - actor->fwork[23] += 360.0f; + if (this->fwork[23] < 0.0f) { + this->fwork[23] += 360.0f; } - Math_SmoothStepToAngle(&actor->obj.rot.z, actor->fwork[23], 0.2f, 100.0f, 0.0001f); - Matrix_RotateZ(gCalcMatrix, (actor->vwork[29].z + actor->unk_0F4.z) * M_DTOR, 0); - Matrix_RotateY(gCalcMatrix, actor->unk_0F4.y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, actor->unk_0F4.x * M_DTOR, 1); + Math_SmoothStepToAngle(&this->obj.rot.z, this->fwork[23], 0.2f, 100.0f, 0.0001f); + Matrix_RotateZ(gCalcMatrix, (this->vwork[29].z + this->unk_0F4.z) * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, this->unk_0F4.y * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, this->unk_0F4.x * M_DTOR, 1); spB8.x = 0.0f; spB8.y = 0.0f; - spB8.z = actor->fwork[0]; + spB8.z = this->fwork[0]; Matrix_MultVec3fNoTranslate(gCalcMatrix, &spB8, &spAC); - actor->vel.x = actor->fwork[13] + spAC.x; - actor->vel.y = actor->fwork[14] + spAC.y; - actor->vel.z = spAC.z; + this->vel.x = this->fwork[13] + spAC.x; + this->vel.y = this->fwork[14] + spAC.y; + this->vel.z = spAC.z; - actor->fwork[13] -= actor->fwork[13] * 0.1f; - actor->fwork[14] -= actor->fwork[14] * 0.1f; + this->fwork[13] -= this->fwork[13] * 0.1f; + this->fwork[14] -= this->fwork[14] * 0.1f; - if (actor->iwork[5] == 0x80) { - actor->vel.z -= actor->fwork[22]; + if (this->iwork[5] == EV_ZMODE(EMZ_RELATIVE)) { + this->vel.z -= this->fwork[22]; if ((gCurrentLevel == LEVEL_SECTOR_Y) && (D_ctx_80177D08 < 0.0f)) { - actor->vel.z -= D_ctx_80177D08; + this->vel.z -= D_ctx_80177D08; } } - if (actor->iwork[5] == 0x100) { - actor->vel.z -= D_ctx_80177D08; + if (this->iwork[5] == EV_ZMODE(EMZ_PLAYER)) { + this->vel.z -= D_ctx_80177D08; } if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_8) { - actor->vel.z = 100.0f; + this->vel.z = 100.0f; } - func_enmy2_80070D44(actor); - func_enmy2_8006F40C(actor); - func_enmy2_8006EA50(actor); + ActorEvent_ProcessTriggers(this); + ActorEvent_ProcessActions(this); + ActorEvent_UpdateTexLines(this); - if (actor->unk_0B4 == 0x26) { - func_enmy2_800720E8(actor); + if (this->unk_0B4 == EINFO_38) { + ActorEvent_800720E8(this); } else { - if (actor->scale <= -1.999f) { - func_enmy2_80070BA8(actor); + if (this->scale <= -1.999f) { + ActorEvent_80070BA8(this); } else { - if ((actor->unk_0D0 == 1) && (actor->scale < 0.5f) && (actor->unk_0B4 != 0x30) && - (actor->unk_0B4 != 0x31) && (actor->unk_0B4 != 0x32)) { - actor->unk_0D0 = 0; + if ((this->unk_0D0 == 1) && (this->scale < 0.5f) && (this->unk_0B4 != EINFO_48) && + (this->unk_0B4 != EINFO_49) && (this->unk_0B4 != EINFO_50)) { + this->unk_0D0 = 0; if (gCurrentLevel == LEVEL_METEO) { - AUDIO_PLAY_SFX(0x2902107D, actor->sfxSource, 4); + AUDIO_PLAY_SFX(0x2902107D, this->sfxSource, 4); } else { - AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); + AUDIO_PLAY_SFX(0x29121007, this->sfxSource, 4); } } - if ((actor->unk_0B4 < 200) && (actor->unk_0B4 != 78) && (actor->scale >= 0.5f)) { - switch (actor->unk_0B4) { - case 71: - func_enmy2_8006FE28(actor); + if ((this->unk_0B4 < EINFO_200) && (this->unk_0B4 != EINFO_78) && (this->scale >= 0.5f)) { + switch (this->unk_0B4) { + case EINFO_71: + ActorEvent_8006FE28(this); break; - case 79: - func_enmy2_8006FEEC(actor); + case EINFO_79: + ActorEvent_8006FEEC(this); break; default: - func_enmy2_800701E0(actor); + ActorEvent_800701E0(this); break; } } } } - switch (actor->unk_0B4) { - case 92: - case 93: - case 94: - case 95: - case 96: + switch (this->unk_0B4) { + case EINFO_92: + case EINFO_93: + case EINFO_94: + case EINFO_95: + case EINFO_96: if (!(gGameFrameCount & 7)) { - actor->fwork[18] = RAND_FLOAT(255.0f); - actor->fwork[19] = RAND_FLOAT(255.0f); - actor->fwork[20] = RAND_FLOAT(255.0f); + this->fwork[18] = RAND_FLOAT(255.0f); + this->fwork[19] = RAND_FLOAT(255.0f); + this->fwork[20] = RAND_FLOAT(255.0f); } - Math_SmoothStepToF(&actor->fwork[15], actor->fwork[18], 1.0f, 10.0f, 0.0f); - Math_SmoothStepToF(&actor->fwork[16], actor->fwork[19], 1.0f, 10.0f, 0.0f); - Math_SmoothStepToF(&actor->fwork[17], actor->fwork[20], 1.0f, 10.0f, 0.0f); + Math_SmoothStepToF(&this->fwork[15], this->fwork[18], 1.0f, 10.0f, 0.0f); + Math_SmoothStepToF(&this->fwork[16], this->fwork[19], 1.0f, 10.0f, 0.0f); + Math_SmoothStepToF(&this->fwork[17], this->fwork[20], 1.0f, 10.0f, 0.0f); break; - case 46: - if (func_play_800A73E4(&spEC, &spFC, actor->obj.pos.x, -100.0f, actor->obj.pos.z)) { + case EINFO_46: + if (func_play_800A73E4(&spEC, &spFC, this->obj.pos.x, -100.0f, this->obj.pos.z)) { spF0 = 10.0f; - if (Math_SmoothStepToF(&actor->obj.pos.y, spEC, 0.5f, 7.0f, 0.0f) >= 0.0f) { + if (Math_SmoothStepToF(&this->obj.pos.y, spEC, 0.5f, 7.0f, 0.0f) >= 0.0f) { spF0 = 350.0f; if (!(gGameFrameCount & 3)) { - func_enmy2_8007240C(actor->obj.pos.x, spEC, actor->obj.pos.z, actor->obj.rot.y); - AUDIO_PLAY_SFX(0x19800017, actor->sfxSource, 4); + ActorEvent_8007240C(this->obj.pos.x, spEC, this->obj.pos.z, this->obj.rot.y); + AUDIO_PLAY_SFX(0x19800017, this->sfxSource, 4); } } - Math_SmoothStepToAngle(&actor->obj.rot.x, spF0, 0.1f, 1.0f, 0.0f); + Math_SmoothStepToAngle(&this->obj.rot.x, spF0, 0.1f, 1.0f, 0.0f); - if ((actor->state == 4) || (actor->state == 5)) { - var_fv0 = actor->fwork[3] * 20.0f; - if (actor->state == 4) { + if ((this->state == EVSTATE_F4_PLUS_Y) || (this->state == EVSTATE_F4_MINUS_Y)) { + var_fv0 = this->fwork[3] * 20.0f; + if (this->state == EVSTATE_F4_PLUS_Y) { var_fv0 *= -1.0f; } - Math_SmoothStepToAngle(&actor->obj.rot.z, var_fv0, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToAngle(&this->obj.rot.z, var_fv0, 0.1f, 3.0f, 0.0f); } } - actor->obj.rot.y = actor->unk_0F4.y; + this->obj.rot.y = this->unk_0F4.y; break; - case 31: - actor->obj.rot.z = gGameFrameCount; + case EINFO_31: + this->obj.rot.z = gGameFrameCount; break; - case 21: - case 22: - actor->obj.rot.z = gGameFrameCount * 3.0f; + case EINFO_21: + case EINFO_22: + this->obj.rot.z = gGameFrameCount * 3.0f; break; - case 3: - actor->unk_0C9 = 1; - actor->obj.rot.y -= 10.0f; + case EINFO_3: + this->unk_0C9 = 1; + this->obj.rot.y -= 10.0f; break; - case 6: - actor->unk_0B6++; + case EINFO_6: + this->unk_0B6++; if (gCurrentLevel == LEVEL_SOLAR) { - if (actor->unk_0B6 >= Animation_GetFrameCount(&D_SO_600636C)) { - actor->unk_0B6 = 0; + if (this->unk_0B6 >= Animation_GetFrameCount(&D_SO_600636C)) { + this->unk_0B6 = 0; } if (((s32) gGameFrameCount % 3) == 0) { - Solar_8019E9F4(actor->obj.pos.x, actor->obj.pos.y - 20, actor->obj.pos.z - 180.0f, 0.0f, + Solar_8019E9F4(this->obj.pos.x, this->obj.pos.y - 20, this->obj.pos.z - 180.0f, 0.0f, RAND_FLOAT(20.0f) * -1.0f, 0.0f, 4.0f, 2); } - } else if (actor->unk_0B6 >= Animation_GetFrameCount(&D_ENMY_PLANET_40057AC)) { - actor->unk_0B6 = 0; + } else if (this->unk_0B6 >= Animation_GetFrameCount(&D_ENMY_PLANET_40057AC)) { + this->unk_0B6 = 0; } break; - case 9: - actor->unk_0B6++; - if (actor->unk_0B6 >= Animation_GetFrameCount(&D_ENMY_PLANET_40001A4)) { - actor->unk_0B6 = 0; + case EINFO_9: + this->unk_0B6++; + if (this->unk_0B6 >= Animation_GetFrameCount(&D_ENMY_PLANET_40001A4)) { + this->unk_0B6 = 0; } - if (actor->iwork[6] == 0) { - actor->obj.rot.y = 0.0f; + if (this->iwork[6] == 0) { + this->obj.rot.y = 0.0f; } break; - case 48: - case 49: - case 50: - SectorY_801A3BD4(actor); + case EINFO_48: + case EINFO_49: + case EINFO_50: + SectorY_Actor204_Update(this); break; - case 52: - func_enmy2_80072474(actor); + case EINFO_52: + ActorEvent_80072474(this); break; - case 78: - func_enmy_8006753C(actor); + case EINFO_78: + ActorSupplies_Update(this); break; - case 79: - if (actor->timer_0C4 == 0) { - actor->unk_0B6 += 1; - if (Animation_GetFrameCount(&D_ZO_600E5EC) < actor->unk_0B6) { - actor->unk_0B6 = 0; + case EINFO_79: + if (this->timer_0C4 == 0) { + this->unk_0B6 += 1; + if (Animation_GetFrameCount(&D_ZO_600E5EC) < this->unk_0B6) { + this->unk_0B6 = 0; } } break; - case 80: { + case EINFO_80: { Effect* effect; Vec3f sp90; Vec3f sp84; Vec3f sp78; s32 sp74; - switch (actor->unk_046) { + switch (this->unk_046) { case 1: break; case 0: - Matrix_RotateZ(gCalcMatrix, actor->unk_0F4.z * M_DTOR, 0); + Matrix_RotateZ(gCalcMatrix, this->unk_0F4.z * M_DTOR, 0); Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_800D1290, &sp90); - if ((actor->obj.pos.y + sp90.y) > -30.0f) { + if ((this->obj.pos.y + sp90.y) > -30.0f) { for (sp74 = 0; sp74 < 7; sp74++) { effect = func_effect_8007783C(OBJ_EFFECT_394); if (effect != NULL) { effect->unk_78 = effect->unk_7A = 12; effect->obj.status = OBJ_ACTIVE; - effect->obj.pos.x = actor->obj.pos.x + sp90.x; - effect->obj.pos.y = actor->obj.pos.y + sp90.y; - effect->obj.pos.z = actor->obj.pos.z; + effect->obj.pos.x = this->obj.pos.x + sp90.x; + effect->obj.pos.y = this->obj.pos.y + sp90.y; + effect->obj.pos.z = this->obj.pos.z; effect->obj.rot.x = RAND_FLOAT(360.0f); effect->obj.rot.y = RAND_FLOAT(360.0f); effect->obj.rot.z = RAND_FLOAT(360.0f); @@ -3561,24 +3550,24 @@ void func_enmy2_80072594(Actor* actor) { effect->unk_60.z = RAND_FLOAT_CENTERED(1.0f) + 5.0f; } } - actor->unk_046++; + this->unk_046++; } break; } - if ((fabsf(actor->fwork[0]) > 10.0f) && !(gGameFrameCount & 1)) { + if ((fabsf(this->fwork[0]) > 10.0f) && !(gGameFrameCount & 1)) { effect = func_effect_8007783C(OBJ_EFFECT_394); if (effect != NULL) { - Matrix_RotateZ(gCalcMatrix, actor->unk_0F4.z * M_DTOR, 0); + Matrix_RotateZ(gCalcMatrix, this->unk_0F4.z * M_DTOR, 0); Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_800D1290, &sp90); effect->unk_78 = effect->unk_7A = 11; effect->obj.status = OBJ_ACTIVE; - effect->obj.pos.x = actor->obj.pos.x + RAND_FLOAT_CENTERED(3.0f) + sp90.x; - effect->obj.pos.y = actor->obj.pos.y + RAND_FLOAT_CENTERED(3.0f) + sp90.y; - effect->obj.pos.z = actor->obj.pos.z + RAND_FLOAT_CENTERED(3.0f) + 180.0f; + effect->obj.pos.x = this->obj.pos.x + RAND_FLOAT_CENTERED(3.0f) + sp90.x; + effect->obj.pos.y = this->obj.pos.y + RAND_FLOAT_CENTERED(3.0f) + sp90.y; + effect->obj.pos.z = this->obj.pos.z + RAND_FLOAT_CENTERED(3.0f) + 180.0f; effect->scale2 = 9.0f; effect->obj.rot.z = RAND_FLOAT(360.0f); @@ -3602,9 +3591,9 @@ void func_enmy2_80072594(Actor* actor) { if (effect != NULL) { effect->unk_78 = effect->unk_7A = 11; effect->obj.status = OBJ_ACTIVE; - effect->obj.pos.x = RAND_FLOAT_CENTERED(3.0f) + actor->obj.pos.x; - effect->obj.pos.y = RAND_FLOAT_CENTERED(5.0f) + actor->obj.pos.y + 50.0f; - effect->obj.pos.z = RAND_FLOAT_CENTERED(3.0f) + actor->obj.pos.z + 200.0f; + effect->obj.pos.x = RAND_FLOAT_CENTERED(3.0f) + this->obj.pos.x; + effect->obj.pos.y = RAND_FLOAT_CENTERED(5.0f) + this->obj.pos.y + 50.0f; + effect->obj.pos.z = RAND_FLOAT_CENTERED(3.0f) + this->obj.pos.z + 200.0f; effect->scale2 = 9.0f; effect->obj.rot.z = RAND_FLOAT(360.0f); effect->vel.x = RAND_FLOAT_CENTERED(5.0f); @@ -3625,119 +3614,118 @@ void func_enmy2_80072594(Actor* actor) { } } break; - case 81: - Math_SmoothStepToF(&actor->fwork[15], 1.0f, 0.1f, 0.1f, 0.001f); + case EINFO_81: + Math_SmoothStepToF(&this->fwork[15], 1.0f, 0.1f, 0.1f, 0.001f); - if (actor->fwork[15] > 0.5f) { - actor->info.hitbox = SEGMENTED_TO_VIRTUAL(D_VE1_601B4C4); + if (this->fwork[15] > 0.5f) { + this->info.hitbox = SEGMENTED_TO_VIRTUAL(D_VE1_601B4C4); } - if (actor->unk_046 == 0) { - actor->fwork[16] += 4.0f; - if (actor->fwork[16] >= 100.0f) { - actor->unk_046 = 1; - actor->fwork[16] = 100.0f; + if (this->unk_046 == 0) { + this->fwork[16] += 4.0f; + if (this->fwork[16] >= 100.0f) { + this->unk_046 = 1; + this->fwork[16] = 100.0f; } } else { - actor->fwork[16] -= 4.0f; - if (actor->fwork[16] <= 0.0f) { - actor->unk_046 = 0; - actor->fwork[16] = 0.0f; + this->fwork[16] -= 4.0f; + if (this->fwork[16] <= 0.0f) { + this->unk_046 = 0; + this->fwork[16] = 0.0f; } } break; - case 83: - if (actor->health <= 0) { - if (actor->unk_0B6 == 0x14) { - spD4 = actor->obj.pos.z; - spD8 = actor->obj.pos.y; - - actor->obj.pos.y += 80.0f; - actor->obj.pos.z += 40.0f; - func_enmy_80066254(actor); - actor->obj.pos.y = spD8; - actor->obj.pos.z = spD4; + case EINFO_83: + if (this->health <= 0) { + if (this->unk_0B6 == 20) { + spD4 = this->obj.pos.z; + spD8 = this->obj.pos.y; + + this->obj.pos.y += 80.0f; + this->obj.pos.z += 40.0f; + func_enmy_80066254(this); + this->obj.pos.y = spD8; + this->obj.pos.z = spD4; } - if ((actor->unk_0B6 >= 0x12) && (actor->unk_0B6 < 0x18)) { - func_effect_8007BC7C(actor->obj.pos.x, actor->obj.pos.y + 80.0f, actor->obj.pos.z + 60.0f, - 20.0f); + if ((this->unk_0B6 >= 18) && (this->unk_0B6 < 24)) { + func_effect_8007BC7C(this->obj.pos.x, this->obj.pos.y + 80.0f, this->obj.pos.z + 60.0f, 20.0f); } - if (actor->unk_0B6 < 49) { - actor->unk_0B6++; - if (actor->unk_0B6 >= 49) { - actor->unk_0B6 = 49; + if (this->unk_0B6 < 49) { + this->unk_0B6++; + if (this->unk_0B6 >= 49) { + this->unk_0B6 = 49; } if (gGameFrameCount & 1) { - Aquas_801AC8A8(RAND_FLOAT_CENTERED(100.0f) + actor->obj.pos.x, - RAND_FLOAT(50.0f) + actor->obj.pos.y, - RAND_FLOAT_CENTERED(100.0f) + actor->obj.pos.z, 1.0f, 0); + Aquas_801AC8A8(RAND_FLOAT_CENTERED(100.0f) + this->obj.pos.x, + RAND_FLOAT(50.0f) + this->obj.pos.y, + RAND_FLOAT_CENTERED(100.0f) + this->obj.pos.z, 1.0f, 0); } } - actor->timer_0C2 = 10000; + this->timer_0C2 = 10000; } break; - case 88: - if (actor->unk_04A == 0) { - actor->unk_046 += 4; - if (actor->unk_046 >= 255) { - actor->unk_046 = 255; - actor->unk_04A = 1; + case EINFO_88: + if (this->unk_04A == 0) { + this->unk_046 += 4; + if (this->unk_046 >= 255) { + this->unk_046 = 255; + this->unk_04A = 1; } } else { - actor->unk_046 -= 4; - if (actor->unk_046 <= 0) { - actor->unk_046 = 0; - actor->unk_04A = 0; + this->unk_046 -= 4; + if (this->unk_046 <= 0) { + this->unk_046 = 0; + this->unk_04A = 0; } } break; - case 103: - case 104: - Andross_80187530(actor); // might be i5 or i2 + case EINFO_103: + case EINFO_104: + Andross_80187530(this); break; - case 106: - actor->unk_0B6 += 1; - if (actor->unk_0B6 >= 6) { - actor->unk_0B6 = 0; + case EINFO_106: + this->unk_0B6++; + if (this->unk_0B6 >= 6) { + this->unk_0B6 = 0; } break; } if (gLevelMode == LEVELMODE_ALL_RANGE) { - D_ctx_80177F20[actor->index + 1] = actor->obj.pos.x; - D_ctx_80178028[actor->index + 1] = actor->obj.pos.z; - D_ctx_80178130[actor->index + 1] = Math_ModF(actor->unk_0F4.y, 360.0f) + 180.0f; - D_ctx_80178238[actor->index + 1] = 1; + D_ctx_80177F20[this->index + 1] = this->obj.pos.x; + D_ctx_80178028[this->index + 1] = this->obj.pos.z; + D_ctx_80178130[this->index + 1] = Math_ModF(this->unk_0F4.y, 360.0f) + 180.0f; + D_ctx_80178238[this->index + 1] = 1; } } } -static UNK_TYPE D_800D129C[0x8C] = { 0 }; // unused +static UNK_TYPE D_800D129C[140] = { 0 }; // unused -bool func_enmy2_80074BFC(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { - Actor* actor = data; +bool ActorEvent_OverrideLimbDraw1(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { + Actor* this = thisx; if (limbIndex == 1) { - pos->x += actor->fwork[16]; + pos->x += this->fwork[16]; } if (limbIndex == 2) { - rot->z -= actor->fwork[15]; + rot->z -= this->fwork[15]; } return false; } -bool func_enmy2_80074C44(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { - Actor* actor = data; +bool ActorEvent_OverrideLimbDraw2(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { + Actor* this = thisx; s32 var_s1; if (limbIndex == 5) { - var_s1 = (s32) (actor->health * 0.6375f); + var_s1 = (s32) (this->health * 0.6375f); if (var_s1 > 255) { var_s1 = 255; } @@ -3763,17 +3751,17 @@ bool func_enmy2_80074C44(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, voi return false; } -void func_enmy2_80074E3C(Actor* actor) { +void ActorEvent_80074E3C(Actor* this) { Vec3f sp30[10]; Animation_GetFrameData(&D_SX_6013820, 0, sp30); - sp30[6].y += actor->fwork[15]; - sp30[5].z += actor->fwork[16] + ((actor->timer_0BE >> 2) & 1); - sp30[4].z -= actor->fwork[16] + ((actor->timer_0BE >> 2) & 1); - Animation_DrawSkeleton(1, D_SX_601390C, sp30, func_enmy2_80074C44, NULL, actor, &gIdentityMatrix); + sp30[6].y += this->fwork[15]; + sp30[5].z += this->fwork[16] + ((this->timer_0BE >> 2) & 1); + sp30[4].z -= this->fwork[16] + ((this->timer_0BE >> 2) & 1); + Animation_DrawSkeleton(1, D_SX_601390C, sp30, ActorEvent_OverrideLimbDraw2, NULL, this, &gIdentityMatrix); } -bool func_enmy2_80074F04(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { +bool ActorEvent_OverrideLimbDraw3(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { gSPClearGeometryMode(gMasterDisp++, G_TEXTURE_GEN); if ((limbIndex == 3) || (limbIndex == 5)) { gSPTexture(gMasterDisp++, 5000, 5000, 0, G_TX_RENDERTILE, G_ON); @@ -3782,31 +3770,32 @@ bool func_enmy2_80074F04(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, voi return false; } -s32 func_enmy2_80074F90(Object_80* obj80) { +s32 Obj111_Draw(Object_80* this) { RCP_SetupDL(&gMasterDisp, 0x3C); gSPDisplayList(gMasterDisp++, D_SY_601AD70); RCP_SetupDL(&gMasterDisp, 0x40); return 0; } -void func_enmy2_80074FF0(Actor* actor) { +void ActorEvent_Draw(Actor* this) { Vec3f sp114[31]; f32 sp40; s16 temp_s0; s32 pad; - if (actor->timer_0C6 && (actor->unk_0B4 != 0x5A) && (actor->unk_0B4 != 0x44) && (actor->unk_0B4 != 0x48)) { - if ((actor->unk_0B4 != 0xD) && (actor->unk_0B4 != 0xE) && (actor->unk_0B4 != 0x3D) && - (actor->unk_0B4 != 0x3E) && (actor->unk_0B4 != 0x53) && (actor->unk_0B4 != 0x62) && (actor->scale > 0.5f) && - (actor->timer_0C6 >= 9) && !(actor->timer_0C6 & 3) && (D_ctx_80177854 != 0x64)) { - func_effect_8007C120(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->vel.x, actor->vel.y, - actor->vel.z, actor->scale * 0.07f, 3); + if (this->timer_0C6 && (this->unk_0B4 != EINFO_90) && (this->unk_0B4 != EINFO_68) && (this->unk_0B4 != EINFO_72)) { + if ((this->unk_0B4 != EINFO_13) && (this->unk_0B4 != EINFO_14) && (this->unk_0B4 != EINFO_61) && + (this->unk_0B4 != EINFO_62) && (this->unk_0B4 != EINFO_83) && (this->unk_0B4 != EINFO_98) && + (this->scale > 0.5f) && (this->timer_0C6 >= 9) && !(this->timer_0C6 & 3) && (D_ctx_80177854 != 100)) { + func_effect_8007C120(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->vel.x, this->vel.y, + this->vel.z, this->scale * 0.07f, 3); } - if ((actor->unk_0B4 != 0x15) && (actor->unk_0B4 != 0x17) && (actor->unk_0B4 != 0x4F) && - (actor->unk_0B4 != 0x53) && (actor->unk_0B4 != 0x1B) && (actor->unk_0B4 != 0x33) && - (actor->unk_0B4 != 0xD) && (actor->unk_0B4 != 0x48) && (actor->unk_0B4 != 0x1C) && (actor->scale > 0.5f)) { - sp40 = SIN_DEG(actor->timer_0C6 * 400.0f) * actor->timer_0C6; + if ((this->unk_0B4 != EINFO_21) && (this->unk_0B4 != EINFO_23) && (this->unk_0B4 != EINFO_79) && + (this->unk_0B4 != EINFO_83) && (this->unk_0B4 != EINFO_27) && (this->unk_0B4 != EINFO_51) && + (this->unk_0B4 != EINFO_13) && (this->unk_0B4 != EINFO_72) && (this->unk_0B4 != EINFO_28) && + (this->scale > 0.5f)) { + sp40 = SIN_DEG(this->timer_0C6 * 400.0f) * this->timer_0C6; Matrix_RotateY(gGfxMatrix, M_DTOR * sp40, 1); Matrix_RotateX(gGfxMatrix, M_DTOR * sp40, 1); Matrix_RotateZ(gGfxMatrix, M_DTOR * sp40, 1); @@ -3814,152 +3803,152 @@ void func_enmy2_80074FF0(Actor* actor) { } } - if ((actor->obj.status == OBJ_DYING) && (actor->timer_0BE != 0)) { + if ((this->obj.status == OBJ_DYING) && (this->timer_0BE != 0)) { RCP_SetupDL_27(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 0, 0, 255); } - if ((actor->unk_0B4 == 0x1D) || (actor->unk_0B4 == 0x3B) || (actor->unk_0B4 == 0x3C)) { + if ((this->unk_0B4 == EINFO_29) || (this->unk_0B4 == EINFO_59) || (this->unk_0B4 == EINFO_60)) { RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); - } else if ((actor->unk_0B4 == 0x52) || (actor->unk_0B4 == 0x5A) || - ((actor->unk_0B4 == 6) && (gCurrentLevel == LEVEL_SOLAR))) { - if (!(actor->timer_0C6 & 1)) { + } else if ((this->unk_0B4 == EINFO_82) || (this->unk_0B4 == EINFO_90) || + ((this->unk_0B4 == EINFO_6) && (gCurrentLevel == LEVEL_SOLAR))) { + if (!(this->timer_0C6 & 1)) { RCP_SetupDL(&gMasterDisp, 0x39); } else { RCP_SetupDL(&gMasterDisp, 0x3D); } } - switch (actor->unk_0B4) { - case 92: - case 93: - case 94: - case 95: - case 96: + switch (this->unk_0B4) { + case EINFO_92: + case EINFO_93: + case EINFO_94: + case EINFO_95: + case EINFO_96: RCP_SetupDL(&gMasterDisp, 0x22); gDPSetTextureFilter(gMasterDisp++, G_TF_POINT); - gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, (s32) actor->fwork[15], (s32) actor->fwork[16], - (s32) actor->fwork[17], 255); - gSPDisplayList(gMasterDisp++, D_800D003C[actor->unk_0B4].dList); + gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, (s32) this->fwork[15], (s32) this->fwork[16], + (s32) this->fwork[17], 255); + gSPDisplayList(gMasterDisp++, D_800D003C[this->unk_0B4].dList); gDPSetTextureFilter(gMasterDisp++, G_TF_BILERP); break; default: - if ((actor->unk_0B4 < 200) && (D_800D003C[actor->unk_0B4].dList != NULL)) { - gSPDisplayList(gMasterDisp++, D_800D003C[actor->unk_0B4].dList); + if ((this->unk_0B4 < EINFO_200) && (D_800D003C[this->unk_0B4].dList != NULL)) { + gSPDisplayList(gMasterDisp++, D_800D003C[this->unk_0B4].dList); } - switch (actor->unk_0B4) { - case 56: + switch (this->unk_0B4) { + case EINFO_56: func_demo_800515C4(); break; - case 0: - actor->iwork[11] = 1; - func_edisplay_8005ADAC(actor); + case EINFO_0: + this->iwork[11] = 1; + func_edisplay_8005ADAC(this); break; - case 2: - actor->fwork[15] -= actor->fwork[15] * 0.1f; - actor->fwork[26] -= actor->fwork[26] * 0.1f; - actor->fwork[16] -= actor->fwork[16] * 0.1f; - actor->fwork[27] -= actor->fwork[27] * 0.1f; + case EINFO_2: + this->fwork[15] -= this->fwork[15] * 0.1f; + this->fwork[26] -= this->fwork[26] * 0.1f; + this->fwork[16] -= this->fwork[16] * 0.1f; + this->fwork[27] -= this->fwork[27] * 0.1f; - if (actor->obj.rot.z > 0.0f) { - actor->fwork[15] += (actor->obj.rot.z * 0.7f - actor->fwork[15]) * 0.2f; - actor->fwork[26] += (-actor->obj.rot.z * 0.7f - actor->fwork[26]) * 0.2f; + if (this->obj.rot.z > 0.0f) { + this->fwork[15] += (this->obj.rot.z * 0.7f - this->fwork[15]) * 0.2f; + this->fwork[26] += (-this->obj.rot.z * 0.7f - this->fwork[26]) * 0.2f; } - if (actor->obj.rot.z < 0.0f) { - actor->fwork[16] += (-actor->obj.rot.z * 0.7f - actor->fwork[16]) * 0.2f; - actor->fwork[27] += (actor->obj.rot.z * 0.7f - actor->fwork[27]) * 0.2f; + if (this->obj.rot.z < 0.0f) { + this->fwork[16] += (-this->obj.rot.z * 0.7f - this->fwork[16]) * 0.2f; + this->fwork[27] += (this->obj.rot.z * 0.7f - this->fwork[27]) * 0.2f; } - func_edisplay_8005B388(actor); + func_edisplay_8005B388(this); break; - case 43: + case EINFO_43: if (gLevelType == LEVELTYPE_PLANET) { gSPDisplayList(gMasterDisp++, D_ENMY_PLANET_40018A0); } else { gSPDisplayList(gMasterDisp++, D_ENMY_SPACE_4007870); } - func_edisplay_8005ADAC(actor); + func_edisplay_8005ADAC(this); break; - case 5: - actor->iwork[11] = 1; - func_edisplay_8005ADAC(actor); + case EINFO_5: + this->iwork[11] = 1; + func_edisplay_8005ADAC(this); break; - case 6: + case EINFO_6: if (gCurrentLevel == LEVEL_SOLAR) { gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); - Animation_GetFrameData(&D_SO_600636C, actor->unk_0B6, sp114); - Animation_DrawSkeleton(1, D_SO_6006558, sp114, NULL, NULL, actor, &gIdentityMatrix); + Animation_GetFrameData(&D_SO_600636C, this->unk_0B6, sp114); + Animation_DrawSkeleton(1, D_SO_6006558, sp114, NULL, NULL, this, &gIdentityMatrix); gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); } else { - Animation_GetFrameData(&D_ENMY_PLANET_40057AC, actor->unk_0B6, sp114); - Animation_DrawSkeleton(1, D_ENMY_PLANET_40058B8, sp114, NULL, NULL, actor, &gIdentityMatrix); + Animation_GetFrameData(&D_ENMY_PLANET_40057AC, this->unk_0B6, sp114); + Animation_DrawSkeleton(1, D_ENMY_PLANET_40058B8, sp114, NULL, NULL, this, &gIdentityMatrix); } break; - case 7: - actor->iwork[11] = 1; - func_edisplay_8005ADAC(actor); + case EINFO_7: + this->iwork[11] = 1; + func_edisplay_8005ADAC(this); break; - case 9: + case EINFO_9: Matrix_Translate(gGfxMatrix, 0.0f, -30.0f, 0.0f, 1); - Animation_GetFrameData(&D_ENMY_PLANET_40001A4, actor->unk_0B6, sp114); - Animation_DrawSkeleton(1, D_ENMY_PLANET_4000270, sp114, NULL, NULL, actor, &gIdentityMatrix); + Animation_GetFrameData(&D_ENMY_PLANET_40001A4, this->unk_0B6, sp114); + Animation_DrawSkeleton(1, D_ENMY_PLANET_4000270, sp114, NULL, NULL, this, &gIdentityMatrix); break; - case 18: - if (actor->fwork[0] > 0.1f) { - actor->iwork[11] = 1; + case EINFO_18: + if (this->fwork[0] > 0.1f) { + this->iwork[11] = 1; Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -30.0f, 1); Matrix_Scale(gGfxMatrix, 2.5f, 2.5f, 2.5f, 1); - func_edisplay_8005B1E8(actor, 2); + func_edisplay_8005B1E8(this, 2); } break; - case 19: - if (actor->fwork[0] > 0.1f) { - actor->iwork[11] = 1; + case EINFO_19: + if (this->fwork[0] > 0.1f) { + this->iwork[11] = 1; Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -30.0f, 1); Matrix_Scale(gGfxMatrix, 2.5f, 2.5f, 2.5f, 1); - func_edisplay_8005B1E8(actor, 2); + func_edisplay_8005B1E8(this, 2); } break; - case 20: + case EINFO_20: RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); gSPDisplayList(gMasterDisp++, D_A6_601A120); break; - case 21: + case EINFO_21: gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); gSPDisplayList(gMasterDisp++, D_A6_6018BF0); gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -30.0f, 1); - actor->iwork[11] = 1; - func_edisplay_8005B1E8(actor, 2); + this->iwork[11] = 1; + func_edisplay_8005B1E8(this, 2); break; - case 22: + case EINFO_22: gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); gSPDisplayList(gMasterDisp++, D_A6_6019730); gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -30.0f, 1); - actor->iwork[11] = 1; - func_edisplay_8005B1E8(actor, 2); + this->iwork[11] = 1; + func_edisplay_8005B1E8(this, 2); break; - case 27: - if (actor->timer_0C2 != 0) { - if (!(actor->timer_0C2 & 3) && (D_ctx_80177854 != 0x64)) { - func_effect_8007D0E0(RAND_FLOAT_CENTERED(200.0f) + actor->obj.pos.x, - RAND_FLOAT_CENTERED(200.0f) + actor->obj.pos.y, - RAND_FLOAT_CENTERED(200.0f) + actor->obj.pos.z, + case EINFO_27: + if (this->timer_0C2 != 0) { + if (!(this->timer_0C2 & 3) && (D_ctx_80177854 != 100)) { + func_effect_8007D0E0(RAND_FLOAT_CENTERED(200.0f) + this->obj.pos.x, + RAND_FLOAT_CENTERED(200.0f) + this->obj.pos.y, + RAND_FLOAT_CENTERED(200.0f) + this->obj.pos.z, RAND_FLOAT(1.5f) + 2.5f); } RCP_SetupDL(&gMasterDisp, 0x39); @@ -3970,157 +3959,157 @@ void func_enmy2_80074FF0(Actor* actor) { } break; - case 31: + case EINFO_31: Matrix_RotateX(gGfxMatrix, M_PI / 2, 1); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_A6_600E0C0); break; - case 33: - Animation_GetFrameData(&D_ENMY_SPACE_400A30C, actor->unk_0B6, sp114); + case EINFO_33: + Animation_GetFrameData(&D_ENMY_SPACE_400A30C, this->unk_0B6, sp114); Matrix_RotateY(gGfxMatrix, M_PI, 1); Matrix_Scale(gGfxMatrix, 1.5f, 1.5f, 1.5f, 1); - Animation_DrawSkeleton(1, D_ENMY_SPACE_400A398, sp114, func_enmy2_80074BFC, NULL, actor, + Animation_DrawSkeleton(1, D_ENMY_SPACE_400A398, sp114, ActorEvent_OverrideLimbDraw1, NULL, this, &gIdentityMatrix); - Math_SmoothStepToF(&actor->fwork[16], 0.0f, 0.3f, 2.0f, 0.0001f); + Math_SmoothStepToF(&this->fwork[16], 0.0f, 0.3f, 2.0f, 0.0001f); break; - case 36: - Animation_GetFrameData(&D_TI1_700CAF4, actor->unk_0B6, sp114); - sp114[2].z += actor->fwork[15]; - Animation_DrawSkeleton(1, D_TI1_700CB60, sp114, NULL, NULL, actor, &gIdentityMatrix); + case EINFO_36: + Animation_GetFrameData(&D_TI1_700CAF4, this->unk_0B6, sp114); + sp114[2].z += this->fwork[15]; + Animation_DrawSkeleton(1, D_TI1_700CB60, sp114, NULL, NULL, this, &gIdentityMatrix); break; - case 38: - func_enmy2_80074E3C(actor); + case EINFO_38: + ActorEvent_80074E3C(this); break; - case 48: - case 49: - case 50: - SectorY_801A4CB0(actor); + case EINFO_48: + case EINFO_49: + case EINFO_50: + SectorY_Actor204_Draw(this); break; - case 52: - Animation_GetFrameData(&D_ZO_601F874, actor->unk_0B6, sp114); - sp114[2].z -= actor->fwork[15]; + case EINFO_52: + Animation_GetFrameData(&D_ZO_601F874, this->unk_0B6, sp114); + sp114[2].z -= this->fwork[15]; gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); Matrix_Scale(gGfxMatrix, 2.6f, 2.6f, 2.6f, 1); - Animation_DrawSkeleton(1, D_ZO_601F920, sp114, NULL, NULL, actor, &gIdentityMatrix); + Animation_DrawSkeleton(1, D_ZO_601F920, sp114, NULL, NULL, this, &gIdentityMatrix); gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); break; - case 64: + case EINFO_64: Matrix_Push(&gGfxMatrix); - Matrix_RotateX(gGfxMatrix, actor->unk_0F4.x * M_DTOR, 1); - Matrix_RotateY(gGfxMatrix, actor->unk_0F4.y * M_DTOR, 1); + Matrix_RotateX(gGfxMatrix, this->unk_0F4.x * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, this->unk_0F4.y * M_DTOR, 1); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, actor->fwork[15], 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, this->fwork[15], 0.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ME_600CAA0); Matrix_Pop(&gGfxMatrix); gSPDisplayList(gMasterDisp++, D_ME_600C130); - Matrix_Translate(gGfxMatrix, 0.0f, -actor->fwork[15], 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -this->fwork[15], 0.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ME_600C740); Matrix_Pop(&gGfxMatrix); break; - case 67: + case EINFO_67: gSPDisplayList(gMasterDisp++, D_ME_6008AA0); RCP_SetupDL(&gMasterDisp, 0x35); gSPDisplayList(gMasterDisp++, D_ME_6009E30); break; - case 78: - func_enmy_80067874(actor); + case EINFO_78: + ActorSupplies_Draw(this); break; - case 79: - temp_s0 = actor->state; - actor->state = 2; - Zoness_80190430(actor); - actor->state = temp_s0; + case EINFO_79: + temp_s0 = this->state; + this->state = 2; // actor 235 state + Zoness_80190430(this); + this->state = temp_s0; break; - case 80: + case EINFO_80: Matrix_Scale(gGfxMatrix, 0.6f, 0.6f, 0.6f, 1); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_VE1_9011200); break; - case 81: - if (actor->fwork[15] > 0.001f) { - Matrix_Scale(gGfxMatrix, actor->fwork[15], actor->fwork[15], actor->fwork[15], 1); + case EINFO_81: + if (this->fwork[15] > 0.001f) { + Matrix_Scale(gGfxMatrix, this->fwork[15], this->fwork[15], this->fwork[15], 1); Matrix_SetGfxMtx(&gMasterDisp); - Texture_BlendRGBA16(actor->fwork[16], 16 * 11, D_VE1_9003890, D_VE1_9003DF0, D_VE1_9003330); + Texture_BlendRGBA16(this->fwork[16], 16 * 11, D_VE1_9003890, D_VE1_9003DF0, D_VE1_9003330); gSPDisplayList(gMasterDisp++, D_VE1_9002CF0); } break; - case 82: + case EINFO_82: gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); gSPDisplayList(gMasterDisp++, D_MA_600DA10); gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); break; - case 83: + case EINFO_83: Matrix_Scale(gGfxMatrix, 3.0f, 3.0f, 3.0f, 1); - Animation_GetFrameData(&D_AQ_602201C, actor->unk_0B6, sp114); - Animation_DrawSkeleton(1, D_AQ_60220E8, sp114, NULL, NULL, actor, &gIdentityMatrix); + Animation_GetFrameData(&D_AQ_602201C, this->unk_0B6, sp114); + Animation_DrawSkeleton(1, D_AQ_60220E8, sp114, NULL, NULL, this, &gIdentityMatrix); break; - case 85: + case EINFO_85: gSPDisplayList(gMasterDisp++, D_D00B880); - func_edisplay_8005ADAC(actor); + func_edisplay_8005ADAC(this); break; - case 86: + case EINFO_86: gSPDisplayList(gMasterDisp++, D_D009A40); - func_edisplay_8005ADAC(actor); + func_edisplay_8005ADAC(this); break; - case 88: + case EINFO_88: RCP_SetupDL(&gMasterDisp, 0x16); - gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, actor->unk_046, actor->unk_046, actor->unk_046, 255); + gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, this->unk_046, this->unk_046, this->unk_046, 255); gSPDisplayList(gMasterDisp++, D_AQ_6008970); break; - case 89: + case EINFO_89: RCP_SetupDL(&gMasterDisp, 0x15); gSPDisplayList(gMasterDisp++, D_AQ_6000E10); break; - case 103: - case 104: - Andross_8018769C(actor); + case EINFO_103: + case EINFO_104: + Andross_8018769C(this); break; - case 105: + case EINFO_105: RCP_SetupDL(&gMasterDisp, 0x23); - gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, 0x8F); + gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, 143); gDPSetEnvColor(gMasterDisp++, 0, 0, 0, 0); gSPDisplayList(gMasterDisp++, D_WZ_7000000); break; - case 106: - Animation_GetFrameData(&D_ENMY_SPACE_4000080, actor->unk_0B6, sp114); - Animation_DrawSkeleton(1, D_ENMY_SPACE_400014C, sp114, NULL, NULL, actor, &gIdentityMatrix); + case EINFO_106: + Animation_GetFrameData(&D_ENMY_SPACE_4000080, this->unk_0B6, sp114); + Animation_DrawSkeleton(1, D_ENMY_SPACE_400014C, sp114, NULL, NULL, this, &gIdentityMatrix); break; case 0xFFF: - actor->timer_0C2 = 10; + this->timer_0C2 = 10; break; } - if ((D_display_80161410 > 0) && ((actor->iwork[12] > 0) && (actor->iwork[12] < 6))) { + if ((D_display_80161410 > 0) && ((this->iwork[12] > 0) && (this->iwork[12] < 6))) { Vec3f sp58 = { 0.0f, 0.0f, 0.0f }; - if ((actor->iwork[12] == 4) || (actor->iwork[12] == 5)) { - Matrix_MultVec3f(gGfxMatrix, &sp58, &D_ctx_80177E98[actor->iwork[12] + 4]); + if ((this->iwork[12] == 4) || (this->iwork[12] == 5)) { + Matrix_MultVec3f(gGfxMatrix, &sp58, &D_ctx_80177E98[this->iwork[12] + 4]); return; } else { - Matrix_MultVec3f(gGfxMatrix, &sp58, &D_ctx_80177E98[actor->iwork[12]]); + Matrix_MultVec3f(gGfxMatrix, &sp58, &D_ctx_80177E98[this->iwork[12]]); } } break; @@ -4135,7 +4124,7 @@ void func_enmy2_800763A4(Actor* actor) { Vec3f sp4C; s32 pad; - if (actor->unk_0B4 == 27) { + if (actor->unk_0B4 == EINFO_27) { actor->obj.pos.y -= actor->vel.y; actor->obj.status = OBJ_ACTIVE; func_effect_8007D0E0(actor->obj.pos.x - actor->vel.x, actor->obj.pos.y + 30.0f, actor->obj.pos.z - actor->vel.z, @@ -4190,7 +4179,7 @@ void func_enmy2_800763A4(Actor* actor) { break; } - if (((actor->timer_0BC & 3) == 1) && (actor->unk_0B4 != 13) && (actor->unk_0B4 != 61)) { + if (((actor->timer_0BC & 3) == 1) && (actor->unk_0B4 != EINFO_13) && (actor->unk_0B4 != EINFO_61)) { func_effect_8007D24C(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 2.2f); } @@ -4223,7 +4212,7 @@ void func_enmy2_800763A4(Actor* actor) { if ((sp60 != 0) || (actor->obj.pos.y < (gGroundLevel + 30.0f))) { if ((Rand_ZeroOne() < 0.5f) && (actor->timer_04C < 3) && (gLevelType == LEVELTYPE_PLANET) && - (sp60 != 999) && (D_80161A88 != 2) && ((actor->vel.z < -20.0f) || (actor->vel.z > 0.0f))) { + (sp60 != 999) && (D_ctx_80161A88 != 2) && ((actor->vel.z < -20.0f) || (actor->vel.z > 0.0f))) { if (gCurrentLevel == LEVEL_FORTUNA) { func_enmy2_8006BF7C(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z - actor->vel.z); func_enmy_80062C38(actor->obj.pos.x, actor->obj.pos.z); @@ -4241,13 +4230,13 @@ void func_enmy2_800763A4(Actor* actor) { func_effect_8007D2C8(actor->obj.pos.x - actor->vel.x, actor->obj.pos.y, actor->obj.pos.z - actor->vel.z, actor->scale * 3.0f); - if ((actor->obj.id == OBJ_ACTOR_197) && (actor->aiType < 8)) { + if ((actor->obj.id == OBJ_ACTOR_ALLRANGE) && (actor->aiType < AI360_KATT)) { func_effect_8007A6F0(&actor->obj.pos, 0x2903B009); } else { func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); } - if ((actor->obj.id == OBJ_ACTOR_200) && (actor->unk_0B4 == 2)) { + if ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == EINFO_2)) { if (actor->fwork[17] < 360.0f) { func_play_800A69F8(1, actor->obj.pos.x + 20.0f, actor->obj.pos.y, actor->obj.pos.z); actor->fwork[17] = 777.0f; @@ -4260,7 +4249,7 @@ void func_enmy2_800763A4(Actor* actor) { } else { if ((actor->obj.pos.y < (gGroundLevel + 30.0f)) && (gLevelType == LEVELTYPE_PLANET)) { actor->vel.z = 0.0f; - if (D_80161A88 == 2) { + if (D_ctx_80161A88 == 2) { func_effect_8007D9DC(actor->obj.pos.x, gGroundLevel + 2.0f, actor->obj.pos.z, 3.0f, 20.0f, 0); func_effect_8007D9DC(actor->obj.pos.x, gGroundLevel + 2.0f, actor->obj.pos.z, 3.0f, 20.0f, @@ -4273,7 +4262,7 @@ void func_enmy2_800763A4(Actor* actor) { actor->obj.pos.z, 0.0f, 0.0f, 90.0f, 6.5f, 0, 0); } func_effect_8007C120(actor->obj.pos.x, 20.0f, actor->obj.pos.z, 0.0f, 0.0f, 0.0f, - actor->scale * 0.05f, 0x1E); + actor->scale * 0.05f, 30); if ((gCurrentLevel == LEVEL_FORTUNA) || (gCurrentLevel == LEVEL_VENOM_2)) { func_effect_8007C688(actor->obj.pos.x, gGroundLevel + 30.0f, actor->obj.pos.z, 3.0f, 60); if (gCurrentLevel == LEVEL_FORTUNA) { @@ -4309,7 +4298,7 @@ void func_enmy2_800763A4(Actor* actor) { actor->timer_0BE = 2; - if ((actor->obj.id == OBJ_ACTOR_197) && (actor->aiType < 8)) { + if ((actor->obj.id == OBJ_ACTOR_ALLRANGE) && (actor->aiType < AI360_KATT)) { func_effect_8007A6F0(&actor->obj.pos, 0x2903B009); } else { func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); @@ -4318,7 +4307,7 @@ void func_enmy2_800763A4(Actor* actor) { } } if ((actor->unk_0D0 != 0) || (actor->timer_0BC == 0) || - ((actor->unk_044 != 0) && (actor->obj.id != OBJ_ACTOR_197))) { + ((actor->itemDrop != DROP_NONE) && (actor->obj.id != OBJ_ACTOR_ALLRANGE))) { if (gLevelMode == LEVELMODE_ALL_RANGE) { for (var_s0 = 0; var_s0 < 4; var_s0++) { if (Rand_ZeroOne() < 0.7f) { @@ -4334,20 +4323,20 @@ void func_enmy2_800763A4(Actor* actor) { actor->vel.z, 5.0f, 15); func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z - actor->vel.z, 8.0f); } else { - if ((actor->unk_0B4 != 0xD) && (actor->unk_0B4 != 61)) { + if ((actor->unk_0B4 != EINFO_13) && (actor->unk_0B4 != EINFO_61)) { func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z - actor->vel.z, actor->scale * 5.0f); } - if (actor->unk_0B4 == 0x24) { + if (actor->unk_0B4 == EINFO_36) { func_effect_8007BFFC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->vel.x, - actor->vel.y, actor->vel.z, 5.0f, 0xF); + actor->vel.y, actor->vel.z, 5.0f, 15); } } actor->timer_0BE = 2; - if ((actor->obj.id == OBJ_ACTOR_197) && (actor->aiType < 8)) { + if ((actor->obj.id == OBJ_ACTOR_ALLRANGE) && (actor->aiType < AI360_KATT)) { func_effect_8007A6F0(&actor->obj.pos, 0x2903B009); } else { func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); @@ -4361,28 +4350,28 @@ void func_enmy2_800763A4(Actor* actor) { D_ctx_80178130[actor->index + 1] = actor->unk_0F4.y + 180.0f; } - if (actor->obj.id == OBJ_ACTOR_197) { + if (actor->obj.id == OBJ_ACTOR_ALLRANGE) { func_360_8002EE64(actor); } } -void func_enmy2_8007717C(Actor* actor) { - if ((actor->unk_0B4 == 0x30) || (actor->unk_0B4 == 0x31) || (actor->unk_0B4 == 0x32)) { - SectorY_801A3BD4(actor); +void ActorEvent_Dying(Actor* actor) { + if ((actor->unk_0B4 == EINFO_48) || (actor->unk_0B4 == EINFO_49) || (actor->unk_0B4 == EINFO_50)) { + SectorY_Actor204_Update(actor); } else { func_enmy2_800763A4(actor); } } -void func_enmy2_800771CC(Actor* actor) { +void Actor234_Update(Actor* this) { Vec3f sp24; - Math_Vec3fFromAngles(&sp24, actor->obj.rot.x, actor->obj.rot.y, 50.0f); - actor->vel.x = sp24.x; - actor->vel.y = sp24.y; - actor->vel.z = sp24.z; + Math_Vec3fFromAngles(&sp24, this->obj.rot.x, this->obj.rot.y, 50.0f); + this->vel.x = sp24.x; + this->vel.y = sp24.y; + this->vel.z = sp24.z; } -void func_enmy2_80077218(Actor* actor) { +void Actor234_Draw(Actor* this) { func_demo_800515C4(); } diff --git a/src/engine/fox_game.c b/src/engine/fox_game.c index de2f1120..a02b7da9 100644 --- a/src/engine/fox_game.c +++ b/src/engine/fox_game.c @@ -21,10 +21,10 @@ f32 D_game_80161A44; s32 D_game_800D2860[4] = { true, true, true, true }; s32 D_game_800D2870 = 0; -static s32 D_game_800D2874[] = { 0, 160, 0, 160 }; -static s32 D_game_800D2884[] = { 159, 319, 159, 319 }; -static s32 D_game_800D2894[] = { 0, 0, 120, 120 }; -static s32 D_game_800D28A4[] = { 119, 119, 239, 239 }; +static s32 sVsCameraULx[] = { 0, SCREEN_WIDTH / 2, 0, SCREEN_WIDTH / 2 }; +static s32 sVsCameraLRx[] = { SCREEN_WIDTH / 2 - 1, SCREEN_WIDTH - 1, SCREEN_WIDTH / 2 - 1, SCREEN_WIDTH - 1 }; +static s32 sVsCameraULy[] = { 0, 0, SCREEN_HEIGHT / 2, SCREEN_HEIGHT / 2 }; +static s32 sVsCameraLRy[] = { SCREEN_HEIGHT / 2 - 1, SCREEN_HEIGHT / 2 - 1, SCREEN_HEIGHT - 1, SCREEN_HEIGHT - 1 }; static s32 sOverlaySetups[] = { /* LEVEL_CORNERIA */ OVL_SETUP_CORNERIA, /* LEVEL_METEO */ OVL_SETUP_METEO, @@ -56,7 +56,7 @@ void Game_Initialize(void) { gGameState = GSTATE_BOOT; D_Timer_8017783C = 0; gBgColor = 0; - gBlurAlpha = 0xFF; + gBlurAlpha = 255; D_game_80161A3C = 45.0f; D_game_80161A40 = 10.0f; D_game_80161A44 = 12800.0f; @@ -150,7 +150,7 @@ void func_game_800A1C14(Gfx** arg0) { gDPFillRectangle((*arg0)++, 8, 8, SCREEN_WIDTH - 8 - 1, SCREEN_HEIGHT - 8 - 1); gDPSetColorImage((*arg0)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, gFrameBuffer); - if (gBlurAlpha < 0xFF) { + if (gBlurAlpha < 255) { gDPPipeSync((*arg0)++); gDPSetCycleType((*arg0)++, G_CYC_1CYCLE); gDPSetCombineMode((*arg0)++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); @@ -518,13 +518,13 @@ void Game_Update(void) { for (i = 0; i < gCamCount; i++) { if (gPlayer[i].timer_224 != 0) { - Graphics_FillRectangle(&gMasterDisp, D_game_800D2874[i], D_game_800D2894[i], D_game_800D2884[i], - D_game_800D28A4[i], D_ctx_80178348, D_ctx_80178350, D_ctx_80178354, + Graphics_FillRectangle(&gMasterDisp, sVsCameraULx[i], sVsCameraULy[i], sVsCameraLRx[i], + sVsCameraLRy[i], D_ctx_80178348, D_ctx_80178350, D_ctx_80178354, D_ctx_80178340); spBB = 1; } else { - Graphics_FillRectangle(&gMasterDisp, D_game_800D2874[i], D_game_800D2894[i], D_game_800D2884[i], - D_game_800D28A4[i], D_ctx_80178390[i], D_ctx_801783A0[i], D_ctx_801783B0[i], + Graphics_FillRectangle(&gMasterDisp, sVsCameraULx[i], sVsCameraULy[i], sVsCameraLRx[i], + sVsCameraLRy[i], D_ctx_80178390[i], D_ctx_801783A0[i], D_ctx_801783B0[i], D_ctx_80178380[i]); } } diff --git a/src/engine/fox_hud.c b/src/engine/fox_hud.c index c6381dc3..2db59f19 100644 --- a/src/engine/fox_hud.c +++ b/src/engine/fox_hud.c @@ -24,7 +24,7 @@ s32 gTotalHits; s32 D_80161718; s32 D_8016171C; f32 D_hud_80161720[3]; -s32 D_hud_8016172C; +s32 gDisplayedHitCount; s32 D_hud_80161730; s32 gShowBossHealth; s32 D_80161738[4]; @@ -229,12 +229,12 @@ void func_hud_80084B94(s32 arg0) { void func_hud_80084E78(Gfx** gfxP, void* arg1, void* arg2, u32 arg3, u32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, f32 arg9, f32 argA) { gDPPipeSync((*gfxP)++); - gDPLoadTLUT((*gfxP)++, 0x100, 0x100, arg2); + gDPLoadTLUT((*gfxP)++, 256, 256, arg2); gDPLoadTextureBlock((*gfxP)++, arg1, G_IM_FMT_CI, G_IM_SIZ_8b, arg3, arg4, 0, G_TX_NOMIRROR, G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSPTextureRectangle((*gfxP)++, (arg5 * 4.0f), (arg6 * 4.0f), ((arg5 + (arg9 * arg7)) * 4.0f), - ((arg6 + (argA * arg8)) * 4.0f), G_TX_RENDERTILE, 0 * 0x20, 0 * 0x20, (s32) (1 / arg7 * 0x400), - (s32) (1 / arg8 * 0x400)); + ((arg6 + (argA * arg8)) * 4.0f), G_TX_RENDERTILE, 0 * 32, 0 * 32, (s32) (1 / arg7 * (32 * 32)), + (s32) (1 / arg8 * (32 * 32))); } void func_hud_800853A4(f32 xPos, f32 yPos, f32 xScale, f32 yScale) { @@ -723,7 +723,7 @@ void func_hud_80086CC8(void) { f32 sp18; f32 temp; - if ((D_ctx_80177854 != 0x64) && (D_ctx_80177838 != 0)) { + if ((D_ctx_80177854 != 100) && (D_ctx_80177838 != 0)) { D_ctx_80177838 -= 1; } @@ -1564,7 +1564,7 @@ void func_hud_80088970(void) { func_8001CA24(0); gPlayer[0].state_1C8 = PLAYERSTATE_1C8_6; - D_play_Timer_80161A60 = 0; + gScreenFlashTimer = 0; gPlayer[0].timer_1F8 = 0; D_ctx_80178340 = D_ctx_80178358 = 255; D_ctx_8017837C = 7; @@ -1962,7 +1962,7 @@ void func_hud_8008A240(void) { continue; } - if (gPlayer[i].state_1C8 != 3) { + if (gPlayer[i].state_1C8 != PLAYERSTATE_1C8_3) { continue; } @@ -2378,7 +2378,7 @@ void func_hud_8008B5B0(f32 x, f32 y) { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); func_hud_800856C0(x + 8.0f, y + 2.0f, D_801617A8, 1.0f, D_801617AC); RCP_SetupDL(&gMasterDisp, 0x4C); - gDPSetPrimColor(gMasterDisp++, 0, 0, D_800D1EB4, D_800D1EB8, D_800D1EBC, 0xFF); + gDPSetPrimColor(gMasterDisp++, 0, 0, D_800D1EB4, D_800D1EB8, D_800D1EBC, 255); func_hud_80085618(x, y, 1.0f, 1.0f); func_hud_800855C4(x + 7.0f + (D_801617A8 * 6.0f * 8.0f), y, 1.0f, 1.0f); func_hud_8008566C(x + 7.0f, y, D_801617A8 * 6.0f, 1.0f); @@ -2458,8 +2458,9 @@ s32 func_hud_8008B774(void) { for (i = 0; i < 60; i++) { if ((gActors[i].obj.status == OBJ_ACTIVE) && (gActors[i].iwork[12] == temp)) { if ((gActors[i].unk_0B4 == 2) || (gActors[i].unk_0B4 == 43) || - ((gActors[i].obj.id == 198) && - ((gActors[i].aiType == 1) || (gActors[i].aiType == 2) || (gActors[i].aiType == 3)))) { + ((gActors[i].obj.id == OBJ_ACTOR_TEAM_BOSS) && + ((gActors[i].aiType == AI360_FALCO) || (gActors[i].aiType == AI360_SLIPPY) || + (gActors[i].aiType == AI360_PEPPY)))) { if (gActors[i].timer_0C6) { ret = 1; } else { @@ -2770,8 +2771,8 @@ void func_hud_8008CA44(void) { s32 i; s32 j; - if ((gPlayer[gPlayerNum].unk_228 != 0) && (gPlayer[gPlayerNum].timer_210 == 0) && (D_ctx_80177854 != 100)) { - j = gPlayer[gPlayerNum].unk_228; + if ((gPlayer[gPlayerNum].flags_228 != 0) && (gPlayer[gPlayerNum].timer_210 == 0) && (D_ctx_80177854 != 100)) { + j = gPlayer[gPlayerNum].flags_228; for (i = 0; i < 12; i++) { if ((j & D_800D2048[i]) != D_800D2048[i]) { @@ -3148,7 +3149,7 @@ void func_hud_8008E2C8(f32 arg0, f32 arg1, s32* arg2, f32 arg3) { if (i & 1) { RCP_SetupDL_78(); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); - TextureRect_4bCI(&gMasterDisp, D_1011E80, D_1011EC0, 0x10, 8, (var_fs0 * arg3) + arg0, arg1, arg3, arg3); + TextureRect_4bCI(&gMasterDisp, D_1011E80, D_1011EC0, 16, 8, (var_fs0 * arg3) + arg0, arg1, arg3, arg3); } else { RCP_SetupDL_76(); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, 255); @@ -3998,7 +3999,7 @@ s32 func_hud_80090E8C(Actor* actor) { } } - if (actor->aiType == 1) { + if (actor->aiType == AI360_FALCO) { var_fv1_2 = 3000.0f; } else { var_fv1_2 = 5000.0f; @@ -4030,7 +4031,7 @@ bool func_hud_800910C0(Actor* actor) { actor->fwork[5] = actor->vwork[28].y; actor->fwork[6] = gBosses[0].obj.pos.z + actor->vwork[28].z; - if (actor->aiType == 1) { + if (actor->aiType == AI360_FALCO) { var_fv1 = 1500.0f; } else { var_fv1 = 3000.0f; @@ -4079,15 +4080,15 @@ bool func_hud_80091368(Actor* actor) { gTeamShields[actor->aiType] = 1; switch (actor->aiType) { - case 1: + case AI360_FALCO: Radio_PlayMessage(gMsg_ID_20220, RCID_FALCO); break; - case 3: + case AI360_PEPPY: Radio_PlayMessage(gMsg_ID_20221, RCID_PEPPY); break; - case 2: + case AI360_SLIPPY: Radio_PlayMessage(gMsg_ID_20222, RCID_SLIPPY); break; } @@ -4178,7 +4179,7 @@ bool func_hud_800915FC(Actor* actor) { } if (actor->obj.pos.y + vec.y < 650.0f) { - ret = 1; + ret = true; } } break; @@ -4191,11 +4192,11 @@ bool func_hud_800915FC(Actor* actor) { boss = &gBosses[0]; y = 650.0f; - if (actor->aiType < 8) { + if (actor->aiType < AI360_KATT) { y = 720.0f; } - if (boss->obj.id == 293) { + if (boss->obj.id == OBJ_BOSS_293) { y = 280.0f; } @@ -4382,13 +4383,13 @@ bool func_hud_80091F00(Actor* actor) { if ((actor->unk_0D0 == 3) && (actor->unk_0D4 == 1)) { switch (actor->aiType) { - case 1: + case AI360_FALCO: Radio_PlayMessage(gMsg_ID_20210, RCID_FALCO); break; - case 3: + case AI360_PEPPY: Radio_PlayMessage(gMsg_ID_20200, RCID_PEPPY); break; - case 2: + case AI360_SLIPPY: Radio_PlayMessage(gMsg_ID_20190, RCID_SLIPPY); break; } @@ -4396,13 +4397,13 @@ bool func_hud_80091F00(Actor* actor) { if ((actor->unk_0D0 != 3) && (actor->unk_0D4 == 1)) { switch (actor->aiType) { - case 1: + case AI360_FALCO: Radio_PlayMessage(gMsg_ID_20060, RCID_FALCO); break; - case 3: + case AI360_PEPPY: Radio_PlayMessage(gMsg_ID_20070, RCID_PEPPY); break; - case 2: + case AI360_SLIPPY: Radio_PlayMessage(gMsg_ID_20080, RCID_SLIPPY); break; } @@ -4410,13 +4411,13 @@ bool func_hud_80091F00(Actor* actor) { if ((actor->unk_0D4 == 2) || (actor->unk_0D4 == 100)) { switch (actor->aiType) { - case 1: + case AI360_FALCO: Radio_PlayMessage(gMsg_ID_20030, RCID_FALCO); break; - case 3: + case AI360_PEPPY: Radio_PlayMessage(gMsg_ID_20040, RCID_PEPPY); break; - case 2: + case AI360_SLIPPY: Radio_PlayMessage(gMsg_ID_20050, RCID_SLIPPY); break; } @@ -4663,7 +4664,7 @@ bool func_hud_800927A0(Actor* actor) { return ret; } -void func_hud_80092D48(Actor* actor) { +void ActorTeamBoss_Init(Actor* actor) { s32 D_800D22A8[] = { 1, 2, 3 }; if (gCurrentLevel != LEVEL_TITANIA) { @@ -4673,7 +4674,7 @@ void func_hud_80092D48(Actor* actor) { D_hud_800D1970++; } else { actor->state = 7; - actor->aiType = 2; + actor->aiType = AI360_SLIPPY; actor->iwork[5] = 0; gTeamShields[2] = 255; } @@ -4687,7 +4688,7 @@ void func_hud_80092D48(Actor* actor) { AUDIO_PLAY_SFX(0x3100000CU, actor->sfxSource, 4U); - if (((D_hud_800D1970 & 3) == 2) && (gCurrentLevel == LEVEL_SECTOR_X)) { + if (((D_hud_800D1970 & 3) == AI360_SLIPPY) && (gCurrentLevel == LEVEL_SECTOR_X)) { Object_Kill(&actor->obj, actor->sfxSource); } @@ -4696,7 +4697,7 @@ void func_hud_80092D48(Actor* actor) { } } -void func_hud_80092EC0(Actor* actor) { +void ActorTeamBoss_Update(Actor* actor) { f32 var_fv1; actor->health = gTeamShields[actor->aiType]; @@ -4866,10 +4867,10 @@ void func_hud_800933D8(f32 x, f32 y, f32 z, f32 arg3) { } if (player->unk_1D0 >= 5) { - effect->unk_4A = 0x60; + effect->unk_4A = 96; effect->unk_46 = 4; } else { - effect->unk_4A = 0x80; + effect->unk_4A = 128; effect->unk_46 = 2; } } @@ -5101,7 +5102,7 @@ void func_hud_800935E8(Player* player) { Aquas_801BDF14(); - AUDIO_PLAY_BGM(SEQ_ID_45); + AUDIO_PLAY_BGM(SEQ_ID_INTRO_45); case 3: D_ctx_8017835C = 16; @@ -5274,7 +5275,7 @@ void func_hud_800935E8(Player* player) { D_ctx_80178488 = 1; SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 50); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50); - AUDIO_PLAY_BGM(SEQ_ID_14); + AUDIO_PLAY_BGM(SEQ_ID_AQUAS); } Aquas_801AC8A8(player->pos.x + RAND_FLOAT_CENTERED(10.0f), player->pos.y + RAND_FLOAT_CENTERED(10.0f), @@ -5410,12 +5411,12 @@ void func_hud_80094D20(f32 x, f32 y) { f32 y1; f32 xScale; - if (gHitCount > D_hud_8016172C) { - temp3 = D_hud_8016172C + 1; - temp4 = D_hud_8016172C; + if (gHitCount > gDisplayedHitCount) { + temp3 = gDisplayedHitCount + 1; + temp4 = gDisplayedHitCount; } else { temp3 = gHitCount; - temp4 = D_hud_8016172C; + temp4 = gDisplayedHitCount; } boolTemp = 0; @@ -5519,13 +5520,13 @@ void func_hud_80094D20(f32 x, f32 y) { TextureRect_8bIA(&gMasterDisp, D_800D24DC[temp3], 16, 15, x1, y1, xScale, 1.0f); } - if ((gHitCount != D_hud_8016172C) && (D_hud_80161720[0] == 0.0f) && (D_hud_80161720[1] == 0.0f) && + if ((gHitCount != gDisplayedHitCount) && (D_hud_80161720[0] == 0.0f) && (D_hud_80161720[1] == 0.0f) && (D_hud_80161720[2] == 0.0f)) { - D_hud_8016172C++; + gDisplayedHitCount++; - if ((D_hud_8016172C == 4) || (D_hud_8016172C == 9) || (D_hud_8016172C == 14) || (D_hud_8016172C == 19) || - (D_hud_8016172C == 24) || (D_hud_8016172C == 29)) { - D_play_80161A62 = D_hud_8016172C; + if ((gDisplayedHitCount == 4) || (gDisplayedHitCount == 9) || (gDisplayedHitCount == 14) || + (gDisplayedHitCount == 19) || (gDisplayedHitCount == 24) || (gDisplayedHitCount == 29)) { + gDropHitCountItem = gDisplayedHitCount; } } } @@ -5889,7 +5890,7 @@ void func_hud_80095604(Player* player) { break; case 400: - AUDIO_PLAY_BGM(SEQ_ID_38); + AUDIO_PLAY_BGM(SEQ_ID_GOOD_END); break; case 440: diff --git a/src/engine/fox_message.c b/src/engine/fox_message.c index 0277cc17..3bb859c3 100644 --- a/src/engine/fox_message.c +++ b/src/engine/fox_message.c @@ -54,8 +54,8 @@ void Message_DisplayChar(Gfx** gfxPtr, u16 msgChar, s32 xpos, s32 ypos) { gDPLoadTextureBlock_4b((*gfxPtr)++, gTextCharTextures[msgChar >> 2], G_IM_FMT_CI, 16, 13, msgChar & 3, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPTextureRectangle((*gfxPtr)++, xpos << 2, ypos << 2, (xpos + 13) << 2, (ypos + 13) << 2, G_TX_RENDERTILE, 0x40, 0, - 0x400, 0x400); + gSPTextureRectangle((*gfxPtr)++, xpos << 2, ypos << 2, (xpos + 13) << 2, (ypos + 13) << 2, G_TX_RENDERTILE, 64, 0, + 1024, 1024); } bool Message_DisplayText(Gfx** gfxPtr, u16* msgPtr, s32 xPos, s32 yPos, s32 len) { @@ -66,7 +66,7 @@ bool Message_DisplayText(Gfx** gfxPtr, u16* msgPtr, s32 xPos, s32 yPos, s32 len) gDPSetPrimColor((*gfxPtr)++, 0x00, 0x00, 255, 255, 255, 255); gDPSetTextureLUT((*gfxPtr)++, G_TT_RGBA16); - gDPLoadTLUT((*gfxPtr)++, 64, 0x100, gTextCharPalettes); + gDPLoadTLUT((*gfxPtr)++, 64, 256, gTextCharPalettes); // bug: if the for loop is skipped, print is never initialized for (i = 0; msgPtr[i] != MSGCHAR_END && i < len; i++) { @@ -117,7 +117,7 @@ void Message_DisplayScrollingText(Gfx** gfxPtr, u16* msgPtr, s32 xPos, s32 yPos, s32 i; gDPSetTextureLUT((*gfxPtr)++, G_TT_RGBA16); - gDPLoadTLUT((*gfxPtr)++, 64, 0x100, gTextCharPalettes); + gDPLoadTLUT((*gfxPtr)++, 64, 256, gTextCharPalettes); for (i = 0; msgPtr[i] != 0 && i < len; i++) { switch (msgPtr[i]) { diff --git a/src/engine/fox_play.c b/src/engine/fox_play.c index ec20f51f..eb9ba85b 100644 --- a/src/engine/fox_play.c +++ b/src/engine/fox_play.c @@ -39,8 +39,8 @@ u8 D_play_80161A50; f32 D_play_80161A54; s32 D_play_80161A58; s32 D_play_80161A5C; -u16 D_play_Timer_80161A60; -u16 D_play_80161A62; +u16 gScreenFlashTimer; +u16 gDropHitCountItem; s32 D_play_80161A64; EnvSettings* sEnvSettings; @@ -191,14 +191,14 @@ void func_play_800A46A0(Player* player) { } } var_v1 = 7; - if (player->shields < 0x40) { - if (player->shields > 0x10) { + if (player->shields < 64) { + if (player->shields > 16) { var_v1 = 0xF; } - if (player->shields > 0x20) { + if (player->shields > 32) { var_v1 = 0x1F; } - if (player->shields > 0x30) { + if (player->shields > 48) { var_v1 = 0x3F; } if ((player->unk_238 == 0) || (gLevelMode == LEVELMODE_ALL_RANGE)) { @@ -232,7 +232,7 @@ void func_play_800A4C40(Player* player) { Vec3f sp3C; Vec3f sp30; - if (D_80161A88 == 2) { + if (D_ctx_80161A88 == 2) { Matrix_Translate(gCalcMatrix, player->pos.x, player->pos.y, player->unk_138, 0); Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, 1); Matrix_RotateX(gCalcMatrix, -((player->unk_0E4 + player->unk_4D8) * M_DTOR), 1); @@ -502,7 +502,7 @@ void func_play_800A594C(void) { } else if (gCurrentLevel == LEVEL_AQUAS) { sEnvSettings = SEGMENTED_TO_VIRTUAL(&D_AQ_602E584); } - D_ctx_80177C90 = sEnvSettings->seqId; + gBgmSeqId = sEnvSettings->seqId; gLevelType = sEnvSettings->type; D_ctx_801784AC = sEnvSettings->unk_04; gBgColor = sEnvSettings->bgColor; @@ -511,9 +511,9 @@ void func_play_800A594C(void) { gFogBlue = sEnvSettings->fogB; gFogNear = sEnvSettings->fogN; gFogFar = sEnvSettings->fogF; - gLight1R = gLight2R = D_80161A70 = sEnvSettings->lightR; - gLight1G = gLight2G = D_80161A74 = sEnvSettings->lightG; - gLight1B = gLight2B = D_80161A78 = sEnvSettings->lightB; + gLight1R = gLight2R = D_ctx_80161A70 = sEnvSettings->lightR; + gLight1G = gLight2G = D_ctx_80161A74 = sEnvSettings->lightG; + gLight1B = gLight2B = D_ctx_80161A78 = sEnvSettings->lightB; gAmbientR = sEnvSettings->ambR; gAmbientG = sEnvSettings->ambG; gAmbientB = sEnvSettings->ambB; @@ -683,9 +683,9 @@ void func_play_800A6590(void) { } D_ctx_8017835C = 16; Math_SmoothStepToF(&D_ctx_8017836C, 0.0f, 1.0f, 0.04f, 0.001f); - if (D_play_Timer_80161A60 != 0) { - D_play_Timer_80161A60--; - if (D_play_Timer_80161A60 & 2) { + if (gScreenFlashTimer != 0) { + gScreenFlashTimer--; + if (gScreenFlashTimer & 2) { D_ctx_80178348 = 255; D_ctx_80178350 = 255; D_ctx_80178354 = 255; @@ -770,7 +770,7 @@ void func_play_800A69F8(s32 state, f32 xPos, f32 yPos, f32 zPos) { } // has to be int. s32 and u32 don't match -int func_play_800A6A74(void) { +bool func_play_800A6A74(void) { return gGoldRingCount[0] && gGoldRingCount[1] && gGoldRingCount[2] && gGoldRingCount[3]; } @@ -1228,7 +1228,7 @@ bool func_play_800A8054(ObjectId objId, f32 arg1, f32 arg2, f32 arg3, f32 arg4, case OBJ_BOSS_309: colId = COL1_7; break; - case OBJ_UNK_1000: + case ACTOR_EVENT_ID: colId = COL1_3; break; case OBJ_BOSS_313: @@ -1595,7 +1595,7 @@ void func_play_800A8BA4(Player* player) { } } else if (player->form == FORM_ARWING) { if ((player->hit1.y < (gGroundLevel + 13.0f)) && (player->state_1C8 != PLAYERSTATE_1C8_4)) { - if (D_80161A88 == 2) { + if (D_ctx_80161A88 == 2) { player->unk_1F4 = 7; player->unk_0E4 = (player->unk_0D0 + player->unk_110) * 0.5f; } else { @@ -1608,7 +1608,7 @@ void func_play_800A8BA4(Player* player) { } } if ((player->hit2.y < (gGroundLevel + 13.0f)) && (player->state_1C8 != PLAYERSTATE_1C8_4)) { - if (D_80161A88 == 2) { + if (D_ctx_80161A88 == 2) { player->unk_1F4 = 7; player->unk_0E4 = (player->unk_0D0 + player->unk_110) * 0.5f; } else { @@ -1903,15 +1903,15 @@ void func_play_800A8BA4(Player* player) { if (temp_v0 != 0) { Player_ApplyDamage(player, temp_v0, actor->info.damage); } - } else if (actor->obj.id == OBJ_ACTOR_200) { + } else if (actor->obj.id == OBJ_ACTOR_EVENT) { if (actor->unk_0B4 == 42) { temp_v0 = - func_play_800A8304(player, OBJ_UNK_1000, actor->obj.pos.x, actor->obj.pos.y, + func_play_800A8304(player, ACTOR_EVENT_ID, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->obj.rot.x, actor->obj.rot.y, actor->obj.rot.z); if (temp_v0 != 0) { Player_ApplyDamage(player, temp_v0, actor->info.damage); } - } else if (actor->unk_0B4 == 63) { + } else if (actor->unk_0B4 == EINFO_63) { spfD4.x = fabsf(actor->obj.pos.x - player->pos.x); spfD4.y = fabsf(actor->obj.pos.y - player->pos.y); spfD4.z = fabsf(actor->obj.pos.z - player->unk_138); @@ -2573,8 +2573,8 @@ void func_play_800ABAB4(void) { } D_ctx_80177E7C = 0; func_play_800A594C(); - D_play_80161A62 = D_ctx_8017796C = D_Timer_80177B44 = D_ctx_80177B4C = D_360_8015F928 = D_360_8015F940 = - gBossActive = gGameFrameCount = D_ctx_80178480 = D_ctx_801782FC = gBossFrameCount = D_enmy2_80161690 = + gDropHitCountItem = D_ctx_8017796C = D_Timer_80177B44 = D_ctx_80177B4C = D_360_8015F928 = D_360_8015F940 = + gBossActive = gGameFrameCount = gCameraShake = D_ctx_801782FC = gBossFrameCount = D_enmy2_80161690 = D_360_8015F900 = D_ctx_80177930 = 0; if (gCurrentLevel == LEVEL_SECTOR_X) { @@ -2587,7 +2587,7 @@ void func_play_800ABAB4(void) { } else { D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = 0; } - D_play_Timer_80161A60 = D_ctx_80178360 = D_ctx_80178364 = D_ctx_80178368 = D_hud_80161704 = D_hud_80161708 = + gScreenFlashTimer = D_ctx_80178360 = D_ctx_80178364 = D_ctx_80178368 = D_hud_80161704 = D_hud_80161708 = D_ctx_80178340 = D_ctx_80177C50 = D_360_8015F93C = D_ctx_80177B6C = 0; gCsFrameCount = 0; @@ -3434,10 +3434,10 @@ void func_play_800AE4A4(Player* player) { } player->pos.z += player->vel.z; if (player->unk_0A0 - 100.0f < player->pos.y) { - player->unk_228 = 8; + player->flags_228 = 8; } if (player->pos.y < -(player->unk_0A0 - 100.0f)) { - player->unk_228 = 4; + player->flags_228 = 4; } func_play_800AE278(player); player->unk_138 = player->pos.z; @@ -3669,16 +3669,16 @@ void func_play_800AF07C(Player* player) { } if (player->pos.x > (player->unk_0AC + (player->unk_09C - 100.0f))) { - player->unk_228 = 1; + player->flags_228 = 1; } if (player->pos.x < (player->unk_0AC - (player->unk_09C - 100.0f))) { - player->unk_228 = 2; + player->flags_228 = 2; } if (player->pos.y > (player->unk_0B0 + (player->unk_0A0 - 100.0f))) { - player->unk_228 = 8; + player->flags_228 = 8; } if (player->pos.y < (player->unk_0B0 - (player->unk_0A0 - 100.0f))) { - player->unk_228 = 4; + player->flags_228 = 4; } player->pos.x += player->vel.x; @@ -3996,7 +3996,7 @@ void func_play_800B0194(Player* player) { sp48 = SEGMENTED_TO_VIRTUAL(D_versus_302E65C); break; } - Math_SmoothStepToVec3fArray(sp48, player->jointTable, 1, 0x18, 0.2f, 10.0f, 0.01f); + Math_SmoothStepToVec3fArray(sp48, player->jointTable, 1, 24, 0.2f, 10.0f, 0.01f); Math_SmoothStepToF(&player->unk_080, -3.0f, 0.1f, 2.0f, 0.1f); Math_SmoothStepToF(&player->unk_164, 0.0f, 0.03f, 1.0f, 0.0001f); Math_SmoothStepToF(&player->unk_168, 0.0f, 0.03f, 1.0f, 0.0001f); @@ -4019,7 +4019,7 @@ void func_play_800B0194(Player* player) { sp48 = SEGMENTED_TO_VIRTUAL(D_versus_302EA4C); break; } - Math_SmoothStepToVec3fArray(sp48, player->jointTable, 1, 0x18, 0.2f, 10.0f, 0.01f); + Math_SmoothStepToVec3fArray(sp48, player->jointTable, 1, 24, 0.2f, 10.0f, 0.01f); } player->unk_0D4 = 2.0f; if ((gInputPress->button & Z_TRIG) && (player->unk_1D4 != 0)) { @@ -4065,14 +4065,14 @@ void func_play_800B0F50(Player* playerx) { Player* player = playerx; // fake? D_ctx_80177BAC = 0; - player->shields = 0xFF; + player->shields = 255; if (gVersusMode) { switch (gHandicap[gPlayerNum]) { case 1: - player->shields = 0xBF; + player->shields = 191; break; case 2: - player->shields = 0x7F; + player->shields = 127; break; } } @@ -4153,9 +4153,9 @@ void func_play_800B0F50(Player* playerx) { break; } if (gCurrentLevel != LEVEL_CORNERIA) { - D_80161A8C = 0; + D_ctx_80161A8C = 0; } - gGoldRingCount[0] = D_80161A94[0]; + gGoldRingCount[0] = D_ctx_80161A94[0]; do { if (gGoldRingCount[0] > 3) { gGoldRingCount[0] -= 3; @@ -4183,11 +4183,11 @@ void func_play_800B0F50(Player* playerx) { D_hud_80161720[0] = 0.0f; D_hud_80161720[1] = 0.0f; D_hud_80161720[2] = 0.0f; - D_hud_8016172C = gHitCount; + gDisplayedHitCount = gHitCount; D_hud_80161730 = 0; D_enmy_80161684 = D_play_80161A50; D_ctx_80177DC8 = D_ctx_80177CA0; - D_80161A88 = D_80161A8C; + D_ctx_80161A88 = D_ctx_80161A8C; D_ctx_80177D20 = player->unk_144 = D_ctx_80177CB0; player->pos.z = player->unk_138 = -player->unk_144; if ((D_ctx_80177CA0 > 0) && (gLevelMode == LEVELMODE_ON_RAILS)) { @@ -4205,8 +4205,7 @@ void func_play_800B0F50(Player* playerx) { player->camEye.y = (player->pos.y * player->unk_148) + 10.0f; player->camEye.x = player->pos.x * player->unk_148; - D_ctx_801779E8.x = D_ctx_801779E8.y = D_ctx_801779E8.z = D_ctx_801779D8.x = D_ctx_801779D8.y = D_ctx_801779D8.z = - 0.0f; + gPlayerCamAt.x = gPlayerCamAt.y = gPlayerCamAt.z = gPlayerCamEye.x = gPlayerCamEye.y = gPlayerCamEye.z = 0.0f; if (gVersusMode) { gLaserStrength[gPlayerNum] = LASERS_SINGLE; @@ -4280,7 +4279,7 @@ void func_play_800B0F50(Player* playerx) { case LEVEL_CORNERIA: player->state_1C8 = PLAYERSTATE_1C8_2; player->unk_204 = 1; - D_80161A88 = D_80161A8C = 2; + D_ctx_80161A88 = D_ctx_80161A8C = 2; func_play_800A3FB0(); break; case LEVEL_BOLSE: @@ -4331,24 +4330,24 @@ void func_play_800B0F50(Player* playerx) { player->unk_234 = 1; switch (gCurrentLevel) { case LEVEL_CORNERIA: - AUDIO_PLAY_BGM(SEQ_ID_37); + AUDIO_PLAY_BGM(SEQ_ID_CO_INTRO); break; case LEVEL_METEO: - AUDIO_PLAY_BGM(SEQ_ID_50); + AUDIO_PLAY_BGM(SEQ_ID_ME_INTRO); break; case LEVEL_FORTUNA: case LEVEL_BOLSE: case LEVEL_VENOM_2: - AUDIO_PLAY_BGM(SEQ_ID_51); + AUDIO_PLAY_BGM(SEQ_ID_INTRO_51); break; case LEVEL_VENOM_1: - AUDIO_PLAY_BGM(SEQ_ID_8 | 0x8000); + AUDIO_PLAY_BGM(SEQ_ID_VENOM_1 | SEQ_FLAG); break; case LEVEL_KATINA: - AUDIO_PLAY_BGM(SEQ_ID_51); + AUDIO_PLAY_BGM(SEQ_ID_INTRO_51); break; case LEVEL_TITANIA: - AUDIO_PLAY_BGM(SEQ_ID_45); + AUDIO_PLAY_BGM(SEQ_ID_INTRO_45); break; case LEVEL_ZONESS: case LEVEL_SECTOR_X: @@ -4356,7 +4355,7 @@ void func_play_800B0F50(Player* playerx) { case LEVEL_TRAINING: case LEVEL_MACBETH: default: - AUDIO_PLAY_BGM(SEQ_ID_44); + AUDIO_PLAY_BGM(SEQ_ID_INTRO_44); break; case LEVEL_AREA_6: case LEVEL_SECTOR_Y: @@ -4365,9 +4364,9 @@ void func_play_800B0F50(Player* playerx) { case LEVEL_SOLAR: break; } - } else if (!gVersusMode && (D_ctx_80177C90 != 0xFFFF) && + } else if (!gVersusMode && (gBgmSeqId != SEQ_ID_NONE) && ((gLevelMode != LEVELMODE_ALL_RANGE) || (D_360_8015F924 == 0))) { - AUDIO_PLAY_BGM(D_ctx_80177C90); + AUDIO_PLAY_BGM(gBgmSeqId); } D_ctx_80177840 = gBossHealthBar = D_ctx_80177850 = 0; @@ -4376,13 +4375,13 @@ void func_play_800B0F50(Player* playerx) { } if (D_ctx_80177824 && !gVersusMode) { for (j = 1; j < 6; j++) { - gTeamShields[j] = gSavedTeamShields[j] = D_ctx_80177C38[j] = D_ctx_801778F0[j] = 0xFF; + gTeamShields[j] = gSavedTeamShields[j] = D_ctx_80177C38[j] = D_ctx_801778F0[j] = 255; } for (j = 0; j < 6; j++) { D_ctx_80177CD0[j] = D_ctx_80177CF0[j] = 1; } gLaserStrength[gPlayerNum] = LASERS_SINGLE; - gGoldRingCount[0] = D_80161A94[0] = gTotalHits = 0; + gGoldRingCount[0] = D_ctx_80161A94[0] = gTotalHits = 0; gLifeCount[gPlayerNum] = 2; gBombCount[gPlayerNum] = 3; gGreatFoxIntact = true; @@ -4390,7 +4389,7 @@ void func_play_800B0F50(Player* playerx) { D_hud_80161720[0] = 0.0f; D_hud_80161720[1] = 0.0f; D_hud_80161720[2] = 0.0f; - D_hud_8016172C = 0; + gDisplayedHitCount = 0; gHitCount = 0; D_ctx_80177824 = 0; } @@ -5066,10 +5065,10 @@ void func_play_800B415C(Player* player) { func_play_800B40AC(player); - if (player->shields < 0x80) { - if (player->shields > 0x50) { + if (player->shields < 128) { + if (player->shields > 80) { var_v0 = 0x3F; - } else if (player->shields > 0x28) { + } else if (player->shields > 40) { var_v0 = 0x1F; } else { var_v0 = 0xF; @@ -5088,7 +5087,7 @@ void func_play_800B41EC(Player* player) { if (!gVersusMode) { SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 1); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 1); - AUDIO_PLAY_BGM(SEQ_ID_39); + AUDIO_PLAY_BGM(SEQ_ID_DEATH); } if (gCurrentLevel == LEVEL_SOLAR) { Audio_KillSfxById(0x4100C023); @@ -5238,7 +5237,7 @@ void func_play_800B46F8(Player* player) { if (D_ctx_8017796C > 960) { D_ctx_8017796C = 0; if (1) {} - if ((player->shields < 0x40) && ((gTeamShields[1] > 0) || (gTeamShields[3] > 0) || (gTeamShields[2] > 0))) { + if ((player->shields < 64) && ((gTeamShields[1] > 0) || (gTeamShields[3] > 0) || (gTeamShields[2] > 0))) { do { do { teamId = RAND_INT(2.9f) + 1; @@ -5306,7 +5305,7 @@ void func_play_800B48BC(Player* player) { if (player->state_1C8 >= PLAYERSTATE_1C8_2) { func_play_800B39E0(player); } - player->unk_228 = 0; + player->flags_228 = 0; if ((player->state_1C8 >= PLAYERSTATE_1C8_2) && (player->form == FORM_ARWING) && !gVersusMode) { switch (player->unk_204) { case 0: @@ -5347,7 +5346,7 @@ void func_play_800B48BC(Player* player) { D_game_80161A2C = 1; func_play_800B46F8(player); player->wings.unk_2C = 0; - D_hud_80161704 = 0xFF; + D_hud_80161704 = 255; if ((!gVersusMode || (D_ctx_80177E7C != 0)) && (player->unk_4DC == 0) && (gInputPress->button & U_CBUTTONS) && ((player->form == FORM_ARWING) || (gVersusMode && (player->form == FORM_LANDMASTER)))) { @@ -5499,16 +5498,16 @@ void func_play_800B48BC(Player* player) { player->timer_1F8 = 200; } else { D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = 0; - D_ctx_80178358 = 0xFF; + D_ctx_80178358 = 255; } - if (D_ctx_80178340 == 0xFF) { + if (D_ctx_80178340 == 255) { func_play_800A6148(); D_ctx_80177D20 = gPlayer[0].unk_144 = 0.0f; D_ctx_80178380[0] = 0; D_360_8015F93C = gRadioState = 0; Audio_ClearVoice(); Audio_SetBaseSfxReverb(0); - D_80161A94[0] = gGoldRingCount[0]; + D_ctx_80161A94[0] = gGoldRingCount[0]; if (gCurrentLevel == LEVEL_VENOM_ANDROSS) { if (1) {} if (1) {} @@ -5533,7 +5532,7 @@ void func_play_800B48BC(Player* player) { } if (gLifeCount[gPlayerNum] < 0) { gNextGameState = GSTATE_GAME_OVER; - D_80161A94[0] = 0; + D_ctx_80161A94[0] = 0; } else { D_ctx_80177854 = 1; } @@ -6250,7 +6249,7 @@ void func_play_800B79B0(void) { } } } - var_a0 = MIN(gPlayer[0].shields, 0xFF); + var_a0 = MIN(gPlayer[0].shields, 255); func_8001D1C8(var_a0, sp3A); if (!(gGameFrameCount & 7) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_7)) { Solar_8019E8B8(RAND_FLOAT_CENTERED(6000.0f), -80.0f, @@ -6319,16 +6318,16 @@ void func_play_800B832C(void) { gPlayer[i].num = gPlayerNum = i; func_play_800B71E4(&gPlayer[i]); } - D_ctx_8017847C = 0.0f; - if (D_ctx_80178480 != 0) { + gCameraShakeY = 0.0f; + if (gCameraShake != 0) { f32 var_fv1; - D_ctx_80178480--; - var_fv1 = D_ctx_80178480; + gCameraShake--; + var_fv1 = gCameraShake; if (var_fv1 > 20.0f) { var_fv1 = 20.0f; } - D_ctx_8017847C = var_fv1 * SIN_DEG(gGameFrameCount * 70.0f); + gCameraShakeY = var_fv1 * SIN_DEG(gGameFrameCount * 70.0f); } func_play_800B79B0(); } diff --git a/src/engine/fox_shapes.c b/src/engine/fox_shapes.c index 9b13a370..f3be1210 100644 --- a/src/engine/fox_shapes.c +++ b/src/engine/fox_shapes.c @@ -120,7 +120,7 @@ Vtx D_Vtx_800D9950[] = { Gfx D_Gfx_800D9990[] = { // unused - gsDPSetPrimColor(0, 0, 0xFF, 0xFF, 0xFF, 0xFF), + gsDPSetPrimColor(0, 0, 255, 255, 255, 255), gsDPSetupTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 8, 0, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 3, 3, G_TX_NOLOD, G_TX_NOLOD), gsDPLoadTileTexture(D_Tex_800D99F8, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 8), diff --git a/src/engine/fox_std_lib.c b/src/engine/fox_std_lib.c index ed556dd7..15d5ff62 100644 --- a/src/engine/fox_std_lib.c +++ b/src/engine/fox_std_lib.c @@ -85,7 +85,7 @@ void Texture_Mottle(u16* dst, u16* src, u8 mode) { for (var_s3 = 0; var_s3 < 32 * 32; var_s3 += 32) { temp_ft3 = 3.0f * __sinf((s32) (((var_s3 / 32) + (gGameFrameCount / 4)) % 32U) * (2 * M_PI / 32)); for (var_v1 = 0; var_v1 < 32; var_v1++) { - dst[var_s3 + (temp_ft3 + var_v1) % 0x20U] = src[var_s3 + var_v1]; + dst[var_s3 + (temp_ft3 + var_v1) % 32U] = src[var_s3 + var_v1]; } } break; @@ -376,7 +376,7 @@ void Animation_GetSkeletonBoundingBox(Limb** skeletonSegment, Animation* animati Matrix_RotateX(gGfxMatrix, (((s32) var_t6 * 360.0f) / 65536.0f) * M_DTOR, 1); vtxFound = false; if (limb->dList != NULL) { - Animation_FindBoundingBox(limb->dList, 0x2000, min, max, &vtxFound, &vtxCount, &vtxList); + Animation_FindBoundingBox(limb->dList, 8192, min, max, &vtxFound, &vtxCount, &vtxList); if (vtxFound) { boundBox[0].x = boundBox[3].x = boundBox[4].x = boundBox[7].x = min->x; boundBox[0].y = boundBox[1].y = boundBox[4].y = boundBox[5].y = max->y; diff --git a/src/engine/fox_tank.c b/src/engine/fox_tank.c index 90acd396..4eb0b069 100644 --- a/src/engine/fox_tank.c +++ b/src/engine/fox_tank.c @@ -97,7 +97,7 @@ void func_tank_80043468(Player* player) { if (0 || (gCurrentLevel == LEVEL_MACBETH) && (D_MA_801BA1E8 == 102)) { sp4C = player->pos.y + 150.0f; } - if (D_MA_801BA1E8 == 0x63) { + if (D_MA_801BA1E8 == 99) { sp4C = player->pos.y + 150.0f; } } @@ -184,7 +184,7 @@ void func_tank_80043B18(Player* player) { } if (!(gGameFrameCount & 3)) { func_effect_8007A900(player->pos.x + sp3C.x, player->pos.y + sp3C.y + 20.0f, player->unk_138 + sp3C.z, - 2.0f, 0xFF, 0xF, 0); + 2.0f, 255, 15, 0); } } } else { @@ -203,7 +203,7 @@ void func_tank_80043B18(Player* player) { } if (!(gGameFrameCount & 3) && (player->unk_0D0 >= 5.0f)) { func_effect_8007A900(player->pos.x + sp3C.x, player->pos.y + sp3C.y + 20.0f, - player->unk_138 + sp3C.z, 2.0f, 0xFF, 0xF, 0); + player->unk_138 + sp3C.z, 2.0f, 255, 15, 0); } } } @@ -221,7 +221,7 @@ void func_tank_80043B18(Player* player) { } if (!(gGameFrameCount & 3) && (player->unk_0D0 >= 5.0f)) { func_effect_8007A900(player->pos.x + sp3C.x, player->pos.y + sp3C.y + 20.0f, - player->unk_138 + sp3C.z, 2.0f, 0xFF, 0xF, 0); + player->unk_138 + sp3C.z, 2.0f, 255, 15, 0); } } } @@ -330,7 +330,7 @@ void func_tank_800444BC(Player* player) { } if (D_ctx_80177BAC != 0) { D_ctx_80177BAC = 0; - AUDIO_PLAY_BGM(SEQ_ID_4 | 0x8000); + AUDIO_PLAY_BGM(SEQ_ID_TITANIA | SEQ_FLAG); func_8001C8B8(0); } @@ -449,10 +449,10 @@ void func_tank_80044868(Player* player) { } player->pos.x += player->vel.x; if ((player->unk_0AC + (player->unk_09C - 100.0f)) < player->pos.x) { - player->unk_228 = 1; + player->flags_228 = 1; } if (player->pos.x < (player->unk_0AC - (player->unk_09C - 100.0f))) { - player->unk_228 = 2; + player->flags_228 = 2; } if (player->unk_09C + player->unk_0AC < player->pos.x) { player->pos.x = player->unk_09C + player->unk_0AC; @@ -486,7 +486,7 @@ void func_tank_80044868(Player* player) { } } if (player->unk_0D0 > 0.0f) { - Texture_Scroll(D_landmaster_3002E80, 0x20, 0x20, 0); + Texture_Scroll(D_landmaster_3002E80, 32, 32, 0); if ((gCurrentLevel == LEVEL_TITANIA) && (gBossActive == 0)) { func_tank_80043280(D_landmaster_3005EA8, D_TI_6009BB8, gGameFrameCount * -55.0f); } @@ -495,7 +495,7 @@ void func_tank_80044868(Player* player) { } } if (player->unk_0D0 > 10.0f) { - Texture_Scroll(D_landmaster_3002E80, 0x20, 0x20, 0); + Texture_Scroll(D_landmaster_3002E80, 32, 32, 0); if ((gCurrentLevel == LEVEL_TITANIA) && (gBossActive == 0)) { func_tank_80043280(D_landmaster_3005EA8, D_TI_6009BB8, gGameFrameCount * -55.0f); } @@ -674,18 +674,18 @@ void func_tank_80045678(Player* player) { } if ((gCamCount == 1) && !(gGameFrameCount & 1)) { func_effect_8007A900(RAND_FLOAT_CENTERED(20.0f) + player->pos.x, player->unk_068 + 10.0f, - player->unk_138 - 10.0f, RAND_FLOAT(2.0f) + 3.5f, 0xFF, 0x10, 1); + player->unk_138 - 10.0f, RAND_FLOAT(2.0f) + 3.5f, 255, 16, 1); } } else { D_800C9F3C = 0; if ((gCamCount == 1) && !(gGameFrameCount & 3) && (player->unk_1DC == 0)) { if ((player->unk_16C > 0.2f) && (player->timer_220 == 0)) { func_effect_8007A900(RAND_FLOAT_CENTERED(10.0f) + (player->pos.x - 57.0f), player->unk_068 + 10.0f, - player->unk_138 - 10.0f, RAND_FLOAT(1.0f) + 1.5f, 0xFF, 0xF, 0); + player->unk_138 - 10.0f, RAND_FLOAT(1.0f) + 1.5f, 255, 15, 0); } if ((player->unk_170 > 0.2f) && (player->timer_220 == 0)) { func_effect_8007A900(RAND_FLOAT_CENTERED(10.0f) + (player->pos.x + 57.0f), player->unk_068 + 10.0f, - player->unk_138 - 10.0f, RAND_FLOAT(1.0f) + 1.5f, 0xFF, 0xF, 0); + player->unk_138 - 10.0f, RAND_FLOAT(1.0f) + 1.5f, 255, 15, 0); } } } @@ -1389,7 +1389,7 @@ void func_tank_800481F4(Player* player) { for (i = 0, actor = gActors; i < ARRAY_COUNT(gActors); i++, actor++) { if ((actor->obj.status == OBJ_ACTIVE) && (actor->timer_0C2 == 0)) { - if (actor->obj.id == OBJ_ACTOR_200) { + if (actor->obj.id == OBJ_ACTOR_EVENT) { temp_v0 = func_play_800A7974(player, actor->info.hitbox, &sp98, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->obj.rot.x, actor->obj.rot.y, actor->obj.rot.z, actor->vwork[29].x, actor->vwork[29].y, diff --git a/src/engine/fox_versus.c b/src/engine/fox_versus.c index a4af5ffe..94e5daee 100644 --- a/src/engine/fox_versus.c +++ b/src/engine/fox_versus.c @@ -75,7 +75,7 @@ void func_versus_800BC760(void) { gRadioState = 0; gVersusMode = 0; D_ctx_80178358 = 0; - D_ctx_80178340 = 0xFF; + D_ctx_80178340 = 255; D_ctx_80177824 = GSTATE_INIT; } @@ -320,7 +320,7 @@ void func_versus_800BDE44(void) { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, 255); for (i = 0; i < 4; i++) { - if ((gPlayer[i].state_1C8 == 3) || (gPlayer[i].state_1C8 == 5)) { + if ((gPlayer[i].state_1C8 == PLAYERSTATE_1C8_3) || (gPlayer[i].state_1C8 == PLAYERSTATE_1C8_5)) { if ((D_ctx_80177C30[i] != D_80178808[i]) || (D_80178810[i])) { D_80178810[i] += 4; if (D_80178810[i] > 15) { @@ -642,7 +642,7 @@ s32 func_versus_800BF17C(void) { for (i = 0, ret = 0; i < 4; i++) { D_80178850[i] = 1; - if (gPlayer[i].state_1C8 != 13) { + if (gPlayer[i].state_1C8 != PLAYERSTATE_1C8_13) { D_80178850[i] = 0; D_801787F8[i] = 150; continue; @@ -766,7 +766,7 @@ void func_versus_800BF750(void) { RCP_SetupDL(&gMasterDisp, 0x4C); for (i = 0; i < 4; i++) { - if (gPlayer[i].state_1C8 != 3) { + if (gPlayer[i].state_1C8 != PLAYERSTATE_1C8_3) { continue; } for (j = 0, temp = 0; j < 4; j++) { @@ -993,7 +993,7 @@ s32 func_versus_800BF9AC(void) { gPlayer[j].unk_288 = i + 1; } - gPlayer[j].state_1C8 = 13; + gPlayer[j].state_1C8 = PLAYERSTATE_1C8_13; } D_ctx_80177E74 = 1; break; @@ -1372,7 +1372,7 @@ void func_versus_800C1368(void) { D_800D4A90 = 0; D_800D4A98 = 0; D_800D4A9C = D_800D4AA0 = 0; - D_ctx_80178340 = 0xFF; + D_ctx_80178340 = 255; D_ctx_8017835C = 0; D_ctx_80178358 = 0; @@ -1495,7 +1495,7 @@ bool func_versus_800C176C(void) { break; } if (func_versus_800C16A0(30)) { - AUDIO_PLAY_BGM(D_ctx_80177C90); + AUDIO_PLAY_BGM(gBgmSeqId); D_versus_80178754 = 2; func_versus_800C1690(); } @@ -1530,7 +1530,7 @@ bool func_versus_800C176C(void) { case 4: if ((D_800D4A9C == 1) && (D_800D4AA0 == 0)) { - AUDIO_PLAY_BGM(SEQ_ID_47 | 0x8000); + AUDIO_PLAY_BGM(SEQ_ID_VS_HURRY | SEQ_FLAG); D_800D4AA0 = 1; } @@ -1567,11 +1567,11 @@ bool func_versus_800C176C(void) { case 2: case 3: - AUDIO_PLAY_BGM(SEQ_ID_38); + AUDIO_PLAY_BGM(SEQ_ID_GOOD_END); break; case 99: - AUDIO_PLAY_BGM(SEQ_ID_49); + AUDIO_PLAY_BGM(SEQ_ID_BAD_END); break; default: @@ -1996,7 +1996,7 @@ void func_versus_800C26C8(void) { actor->obj.pos.x = dest.x; actor->obj.pos.y = dest.y; actor->obj.pos.z = dest.z; - actor->aiType = i + 10; + actor->aiType = i + AI360_10; actor->health = 24; actor->timer_0C2 = 30; |
