diff --git a/include/context.h b/include/context.h index 6a8156cc..690df8cd 100644 --- a/include/context.h +++ b/include/context.h @@ -26,9 +26,9 @@ extern s32 gPrevPlanetSavedTeamShields[6]; extern s32 gTeamDamage[6]; extern u8 gMissionStatus; extern f32 gGroundHeight; -extern f32 D_ctx_80177950; -extern f32 D_ctx_80177968; -extern f32 D_ctx_80177970; +extern f32 D_ctx_80177950; // sign of something to do with camera z rotations +extern f32 gPlayerTurnRate; +extern f32 gPlayerTurnStickMod; extern f32 gCsCamEyeX; extern f32 gCsCamEyeY; extern f32 gCsCamEyeZ; @@ -61,13 +61,13 @@ extern u16 gBgmSeqId; extern u8 gLevelType; extern s32 gSavedObjectLoadIndex; extern UNK_TYPE F_80177CA8; -extern f32 D_ctx_80177CB0; +extern f32 gSavedPathProgress; extern UNK_TYPE F_80177CB8; extern f32 gWaterLevel; -extern f32 D_ctx_80177CC8; -extern f32 D_ctx_80177CE8; -extern f32 D_ctx_80177D08; -extern f32 D_ctx_80177D20; +extern f32 gPathGroundScroll; +extern f32 gPathTexScroll; +extern f32 gPathVelZ; +extern f32 gPathProgress; extern f32 gRadioPortraitScaleY; extern f32 gRadioTextBoxScaleY; extern f32 gRadioMsgRadioId; @@ -226,7 +226,7 @@ extern s32 gHitCount; extern s32 gSavedHitCount; extern s16 gLifeCount[4]; extern LaserStrength gLaserStrength[4]; -extern s32 D_ctx_80161AB8; +extern s32 gCullObjects; extern UNK_TYPE F_80161AC0[16]; extern Scenery gScenery[50]; extern Sprite gSprites[40]; @@ -272,13 +272,13 @@ extern s32 D_ctx_80177990[4]; extern f32 D_ctx_801779A8[4]; extern u8 gPauseEnabled; extern s32 gChargeTimers[4]; -extern f32 D_ctx_801779E4; -extern f32 D_ctx_801779F4; -extern s32 D_Timer_80177A00[4]; -extern s32 D_Timer_80177A38[4]; -extern s32 D_Timer_80177A70[4]; -extern s32 D_Timer_80177A88[4]; -extern f32 D_ctx_80177AA0[4]; +extern f32 gPathVelX; +extern f32 gPathVelY; +extern s32 gUturnDownTimers[4]; +extern s32 gUturnBrakeTimers[4]; +extern s32 gLoopDownTimers[4]; +extern s32 gLoopBoostTimers[4]; +extern f32 gMuzzleFlashScale[4]; extern f32 gShieldAlpha[4]; extern s32 gHasShield[4]; extern s32 gShieldTimer[4]; @@ -289,11 +289,11 @@ extern u8 gCoUturnCount; extern u8 gGreatFoxIntact; extern u8 gTiStartLandmaster; extern u16 gControllerRumbleTimers[4]; -extern u16 D_ctx_80177C30[4]; +extern u16 gPlayerScores[4]; extern s32 D_ctx_80177C50; extern s32 D_ctx_80177C70; -extern s32 D_ctx_80177C78; -extern s32 D_ctx_80177C8C; +extern s32 gTraining360MsgTimer; +extern s32 gTraining360MsgIndex; extern s32 D_ctx_80177C94; extern s32 D_ctx_80177C9C; extern s32 D_ctx_80177CA4; diff --git a/include/functions.h b/include/functions.h index 999d12d4..41deb1c3 100644 --- a/include/functions.h +++ b/include/functions.h @@ -82,8 +82,8 @@ void Cutscene_LevelComplete(Player*); void Cutscene_UTurn(Player*); void Cutscene_KillPlayer(Player* player); void Cutscene_PlayerDown(Player*); -void Actor195_Update(Actor*); -void Actor195_Draw(Actor*); +void ActorCutscene_Update(Actor*); +void ActorCutscene_Draw(Actor*); void Cutscene_DrawGreatFox(void); // fox_display @@ -95,7 +95,7 @@ void Play_Draw(void); // fox_edata void func_edata_800594F0(Scenery*); void func_edata_800595D0(Scenery*); -void func_edisplay_800596C0(void); +void Object_ApplyWaterDistortion(void); void func_edata_800596B0(Actor*); // fox_edisplay @@ -103,9 +103,9 @@ void Graphics_SetScaleMtx(f32); void Sprite168_Draw(Sprite*); void Actor201_Draw(Actor*); void Actor202_Draw(Actor*); -void Obj39_Draw(Scenery*); -void func_edisplay_80059B20(Scenery*); -void Obj42_Draw(Scenery*); +void MeteoTunnel_Draw(Scenery*); +void Scenery_DrawTitaniaBones(Scenery*); +void Scenery42_Draw(Scenery*); void Actor196_Draw(Actor*); void Sprite167_Draw(Sprite*); void FogShadow_Draw(Sprite*); @@ -162,7 +162,7 @@ bool Object_CheckHitboxCollision(Vec3f* pos, f32* hitboxData, Object* obj, f32 x bool Object_CheckSingleHitbox(Vec3f*, f32*, Vec3f*); bool Object_CheckPolyCollision(Vec3f* , Vec3f* , ObjectId , Object* ); s32 Object_CheckCollision(s32 , Vec3f* , Vec3f* , s32 ); -void func_enmy_800652CC(Scenery*); +void Scenery_UpdateTitaniaBones(Scenery*); void func_enmy_800654E4(Object*); void func_enmy_800656D4(Actor*); void func_enmy_800660F0(Actor*); @@ -175,8 +175,8 @@ void func_enmy_80066C00(Scenery*); void func_enmy_80066D5C(Scenery*); void Sprite167_Update(Sprite*); void func_enmy_80066EA8(Scenery*); -void func_enmy_80066EF0(Item*); -void func_enmy_800671D0(Item*); +void Item_CheckBounds(Item*); +void Item_SpinPickup(Item*); void func_enmy_800674B4(f32, f32, f32, f32, f32, f32, f32, f32); void ActorSupplies_Update(Actor*); void ActorSupplies_Draw(Actor*); @@ -213,16 +213,16 @@ void Object_Update(void); //fox_enmy2 void Actor237_Update(Actor*); void Actor237_Draw(Actor*); -void Obj54_Update(Scenery*); +void Scenery54_Update(Scenery*); void Actor201_Update(Actor*); void Actor202_Update(Actor*); void Actor194_Update(Actor*); -void Actor194_Init(Actor*); +void Actor194_Dying(Actor*); void Actor194_Draw(Actor*); -void Obj42_Update(Scenery*); +void Scenery42_Update(Scenery*); void Actor196_Update(Actor*); void Actor189_Update(Actor*); -void Obj39_Update(Scenery*); +void MeteoTunnel_Update(Scenery*); void func_enmy2_8006ECBC(PlayerShotId, PlayerShot*, s32, f32, f32, f32, f32, f32, f32, f32, f32, f32); void func_enmy2_8006EEFC(s32, f32, f32, f32, f32, f32, f32, f32, f32, f32); void func_enmy2_8006EFA0(s32 unk0E4, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 xRot, f32 yRot, @@ -230,7 +230,7 @@ void func_enmy2_8006EFA0(s32 unk0E4, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 void ActorEvent_8006F0D8(f32 xPos, f32 yPos, f32 zPos, f32 scale1); void ActorEvent_8006F254(Actor*); void ActorEvent_Update(Actor*); -s32 Obj111_Draw(Scenery*); +s32 Scenery111_Draw(Scenery*); void ActorEvent_Draw(Actor*); void func_enmy2_800763A4(Actor*); void ActorEvent_Dying(Actor*); @@ -483,7 +483,7 @@ void func_play_800AD7F0(Player* player); void func_play_800ADF58(Player* player); void func_play_800B415C(Player* player); void func_play_800B41E0(Player* player); -void func_play_800B41EC(Player* player); +void Player_Down(Player* player); void func_play_800A46A0(Player* player); void func_play_800A86E4(Player* player); void func_play_800A887C(Player* player); diff --git a/include/sf64object.h b/include/sf64object.h index 9fb29722..53ee4eec 100644 --- a/include/sf64object.h +++ b/include/sf64object.h @@ -42,7 +42,7 @@ typedef struct { typedef enum { /* 0 */ COL1_0, // OBJ_ACTOR_180 - /* 1 */ COL1_1, // OBJ_SCENERY_39 + /* 1 */ COL1_1, // OBJ_SCENERY_ME_TUNNEL /* 2 */ COL1_2, /* 3 */ COL1_3, // ACTOR_EVENT_ID /* 4 */ COL1_4, // OBJ_BOSS_308 @@ -88,29 +88,29 @@ typedef struct { /* 0x00 */ u8 status; /* 0x02 */ u16 type; /* 0x04 */ Vec3f pos; - /* 0x10 */ f32 unk_10; + /* 0x10 */ f32 yRot; /* 0x14 */ char pad14[0x14]; } RadarMark; // size = 0x28 typedef struct { /* 0x00 */ u8 mode; /* 0x02 */ u16 timer; - /* 0x04 */ Vec3f unk_04; - /* 0x10 */ Vec3f unk_10; - /* 0x1C */ f32 unk_1C; - /* 0x20 */ f32 unk_20; - /* 0x24 */ f32 unk_24; - /* 0x28 */ f32 unk_28; - /* 0x2C */ u8 unk_2C; // possibly a color struct - /* 0x2D */ u8 unk_2D; - /* 0x2E */ u8 unk_2E; - /* 0x2F */ u8 unk_2F; + /* 0x04 */ Vec3f posAA; + /* 0x10 */ Vec3f posBB; + /* 0x1C */ f32 xRot; + /* 0x20 */ f32 yRot; + /* 0x24 */ f32 zScale; + /* 0x28 */ f32 xyScale; + /* 0x2C */ u8 red; // possibly a color struct + /* 0x2D */ u8 green; + /* 0x2E */ u8 blue; + /* 0x2F */ u8 alpha; } TexturedLine; // size = 0x30 typedef struct { /* 0x00 */ u8 hits; /* 0x04 */ Vec3f pos; - /* 0x10 */ f32 unk_10; + /* 0x10 */ f32 rise; /* 0x14 */ char pad14[0x4]; /* 0x18 */ u16 timer; } BonusText; // size = 0x1C @@ -143,13 +143,13 @@ typedef struct { /* 0x00 */ u8 drawType; /* 0x08 */ ObjectFunc action; // argument must have object type. /* 0x0C */ f32* hitbox; - /* 0x10 */ f32 unk_10; // z coordinate of something - /* 0x14 */ s16 unk_14; // can be -1, 0, 1 - /* 0x16 */ s16 unk_16; // can be 0, 1, 2 + /* 0x10 */ f32 cullDistance; // z coordinate of something + /* 0x14 */ s16 unk_14; // can be -1, 0, 1. governs camera-related behavior in effects (billboarding?) + /* 0x16 */ s16 unk_16; // can be 0, 1, 2. affects death behavior? /* 0x18 */ u8 damage; - /* 0x19 */ u8 unk_19; // can be 0, 1, 2 - /* 0x1C */ f32 unk_1C; // target lock y offset. 0.0f can't be targeted - /* 0x20 */ u8 bonus; // bonus hits when killed. 0 means no + /* 0x19 */ u8 unk_19; // can be 0, 1, 2. Also camera-related? + /* 0x1C */ f32 targetOffset; // target lock y offset. 0.0f can't be targeted + /* 0x20 */ u8 bonus; // hits when killed. numbers above 1 indicate the hit+ bonus } ObjectInfo; // size = 0x24 typedef struct { @@ -202,7 +202,7 @@ typedef struct { /* 0x54 */ f32 unk_54; /* 0x58 */ f32 unk_58; /* 0x5C */ f32 sfxSource[3]; - /* 0x68 */ f32 scale; + /* 0x68 */ f32 width; } Item; // size 0x6C typedef struct { @@ -264,7 +264,7 @@ typedef struct { #define DMG_BEAM 1 #define DMG_NONE 0 #define DMG_BOMB -1 -#define DMG_UNK_100 100 +#define DMG_zRot_0FC 100 typedef struct { /* 0x000 */ Object obj; @@ -291,9 +291,9 @@ typedef struct { /* 0x0C9 */ u8 unk_0C9; /* 0x0CA */ u8 lockOnTimers[4]; /* 0x0CE */ s16 health; - /* 0x0D0 */ s8 unk_0D0; - /* 0x0D2 */ s16 unk_0D2; - /* 0x0D4 */ s16 unk_0D4; + /* 0x0D0 */ s8 dmgType; + /* 0x0D2 */ s16 dmgPart; + /* 0x0D4 */ s16 dmgSource; /* 0x0D6 */ u16 damage; /* 0x0D8 */ Vec3f hitPos; /* 0x0E4 */ s16 aiType; @@ -338,17 +338,17 @@ typedef enum ObjectId { /* 26 */ OBJ_SCENERY_26, /* 27 */ OBJ_SCENERY_27, /* 28 */ OBJ_SCENERY_28, - /* 29 */ OBJ_SCENERY_29, - /* 30 */ OBJ_SCENERY_30, - /* 31 */ OBJ_SCENERY_31, - /* 32 */ OBJ_SCENERY_32, - /* 33 */ OBJ_SCENERY_33, - /* 34 */ OBJ_SCENERY_34, - /* 35 */ OBJ_SCENERY_35, - /* 36 */ OBJ_SCENERY_36, - /* 37 */ OBJ_SCENERY_37, - /* 38 */ OBJ_SCENERY_38, - /* 39 */ OBJ_SCENERY_39, + /* 29 */ OBJ_SCENERY_TI_SKULL, + /* 30 */ OBJ_SCENERY_TI_RIB_0, + /* 31 */ OBJ_SCENERY_TI_RIB_1, + /* 32 */ OBJ_SCENERY_TI_RIB_2, + /* 33 */ OBJ_SCENERY_TI_RIB_3, + /* 34 */ OBJ_SCENERY_TI_RIB_4, + /* 35 */ OBJ_SCENERY_TI_RIB_5, + /* 36 */ OBJ_SCENERY_TI_RIB_6, + /* 37 */ OBJ_SCENERY_TI_RIB_7, + /* 38 */ OBJ_SCENERY_TI_RIB_8, + /* 39 */ OBJ_SCENERY_ME_TUNNEL, /* 40 */ OBJ_SCENERY_40, /* 41 */ OBJ_SCENERY_41, /* 42 */ OBJ_SCENERY_42, @@ -504,7 +504,7 @@ typedef enum ObjectId { /* 192 */ OBJ_ACTOR_192, /* 193 */ OBJ_ACTOR_193, /* 194 */ OBJ_ACTOR_194, - /* 195 */ OBJ_ACTOR_195, + /* 195 */ OBJ_ACTOR_CUTSCENE, /* 196 */ OBJ_ACTOR_196, /* 197 */ OBJ_ACTOR_ALLRANGE, /* 198 */ OBJ_ACTOR_TEAM_BOSS, @@ -1119,7 +1119,7 @@ typedef Actor Actor191; typedef Actor Actor192; typedef Actor Actor193; typedef Actor Actor194; -typedef Actor Actor195; +typedef Actor ActorCutscene; typedef Actor Actor196; typedef Actor ActorAllRange; typedef Actor ActorTeamBoss; diff --git a/include/sf64player.h b/include/sf64player.h index f2ebffaf..ccd81441 100644 --- a/include/sf64player.h +++ b/include/sf64player.h @@ -97,11 +97,9 @@ typedef struct { /* 0x00 */ Object obj; /* 0x1C */ s32 index; /* 0x20 */ Vec3f vel; - /* 0x2C */ f32 unk_2C; - /* 0x30 */ f32 unk_30; - /* 0x34 */ f32 unk_34; + /* 0x2C */ Vec3f vec_2C; /* 0x38 */ f32 sfxSource[3]; - /* 0x44 */ f32 unk_44; + /* 0x44 */ f32 scale; /* 0x48 */ f32 unk_48; /* 0x4C */ f32 unk_4C; /* 0x50 */ f32 unk_50; @@ -165,55 +163,49 @@ typedef struct Player { /* 0x058 */ f32 camYaw; /* 0x05C */ f32 camPitch; /* 0x05C */ f32 unk_060; - /* 0x064 */ f32 unk_064; - /* 0x068 */ f32 unk_068; - /* 0x06C */ f32 unk_06C; - /* 0x070 */ f32 unk_070; - /* 0x074 */ Vec3f pos; - /* 0x080 */ f32 unk_080; - /* 0x084 */ f32 unk_084; - /* 0x088 */ f32 unk_088; - /* 0x08C */ f32 unk_08C; - /* 0x090 */ Vec3f unk_090; - /* 0x09C */ f32 unk_09C; - /* 0x0A0 */ f32 unk_0A0; - /* 0x0A4 */ f32 unk_0A4; - /* 0x0A8 */ f32 unk_0A8; - /* 0x0AC */ f32 unk_0AC; - /* 0x0B0 */ f32 unk_0B0; - /* 0x0B4 */ f32 unk_0B4; - /* 0x0B8 */ f32 unk_0B8; - /* 0x0BC */ f32 unk_0BC; + /* 0x064 */ Vec3f groundPos; // position on ground directly below player + /* 0x070 */ f32 groundRotY; // y rotation of actor under player when acting as ground + /* 0x074 */ Vec3f pos; // pos.z is position along path. see trueZpos for the actual z position + /* 0x080 */ f32 yBob; + /* 0x084 */ f32 xShake; + /* 0x088 */ f32 bobPhase; + /* 0x08C */ f32 camDist; + /* 0x090 */ Vec3f basePos; // position at start of update + /* 0x09C */ f32 pathWidth; + /* 0x0A0 */ f32 pathHeight; + /* 0x0A4 */ f32 pathFloor; + /* 0x0A8 */ f32 unk_0A8; // set to 3000.0f, not used. May have been z-extent of path? + /* 0x0AC */ f32 xPath; + /* 0x0B0 */ f32 yPath; + /* 0x0B4 */ f32 pathStep; + /* 0x0B8 */ f32 xPathTarget; + /* 0x0BC */ f32 yPathTarget; /* 0x0C0 */ Vec3f vel; - /* 0x0CC */ f32 unk_0CC; + /* 0x0CC */ f32 warpCamSpeed; /* 0x0D0 */ f32 baseSpeed; - /* 0x0D4 */ f32 unk_0D4; - /* 0x0D8 */ Vec3f unk_0D8; - /* 0x0E4 */ f32 unk_0E4; - /* 0x0E8 */ f32 unk_0E8; - /* 0x0EC */ f32 unk_0EC; - /* 0x0F0 */ f32 unk_0F0; - /* 0x0F4 */ f32 unk_0F4; - /* 0x0F8 */ f32 unk_0F8; - /* 0x0FC */ f32 unk_0FC; - /* 0x100 */ f32 unk_100; - /* 0x104 */ f32 unk_104; - /* 0x108 */ f32 unk_108; - /* 0x10C */ f32 unk_10C; + /* 0x0D4 */ f32 gravity; + /* 0x0D8 */ Vec3f knockback; + /* 0x0E4 */ Vec3f rot; + /* 0x0F0 */ f32 rockAngle; + /* 0x0F4 */ f32 rockPhase; + /* 0x0F8 */ f32 bankAngle; + /* 0x0FC */ f32 xRot_0FC; + /* 0x100 */ f32 zRot_0FC; + /* 0x104 */ Vec3f rot_104; /* 0x110 */ f32 boostSpeed; - /* 0x114 */ f32 unk_114; - /* 0x118 */ f32 unk_118; - /* 0x11C */ f32 unk_11C; - /* 0x120 */ f32 unk_120; - /* 0x124 */ f32 unk_124; + /* 0x114 */ f32 yRot_114; + /* 0x118 */ f32 yRot_118; + /* 0x11C */ f32 yRotVel_11C; + /* 0x120 */ f32 xRot_120; + /* 0x124 */ f32 xRot_124; /* 0x128 */ char pad128[4]; - /* 0x12C */ f32 unk_12C; - /* 0x130 */ f32 unk_130; - /* 0x134 */ f32 unk_134; - /* 0x138 */ f32 unk_138; + /* 0x12C */ f32 zRotBank; + /* 0x130 */ f32 zRotBarrelRoll; + /* 0x134 */ f32 damageShake; + /* 0x138 */ f32 trueZpos; // the actual position of the arwing. pos.z is its z position along the path /* 0x13C */ char pad13C[4]; - /* 0x140 */ f32 unk_140; - /* 0x144 */ f32 unk_144; + /* 0x140 */ f32 zPathVel; + /* 0x144 */ f32 zPath; /* 0x148 */ f32 unk_148; /* 0x14C */ f32 unk_14C; /* 0x150 */ f32 unk_150; @@ -247,18 +239,18 @@ typedef struct Player { /* 0x1C4 */ s32 num; /* 0x1C8 */ PlayerState1C8 state_1C8; /* 0x1CC */ PlayerForm form; - /* 0x1D0 */ s32 unk_1D0; - /* 0x1D4 */ s32 unk_1D4; - /* 0x1D8 */ s32 unk_1D8; - /* 0x1DC */ s32 unk_1DC; - /* 0x1E0 */ s32 timer_1E0; - /* 0x1E4 */ s32 timer_1E4; + /* 0x1D0 */ s32 csState; + /* 0x1D4 */ bool grounded; + /* 0x1D8 */ s32 meTargetIndex; + /* 0x1DC */ s32 barrelRoll; + /* 0x1E0 */ s32 barrelInputTimerL; + /* 0x1E4 */ s32 barrelInputTimerR; /* 0x1E8 */ s32 timer_1E8; - /* 0x1EC */ s32 unk_1EC; - /* 0x1F0 */ s32 unk_1F0; - /* 0x1F4 */ s32 unk_1F4; - /* 0x1F8 */ s32 timer_1F8; - /* 0x1FC */ s32 timer_1FC; + /* 0x1EC */ s32 rollRate; + /* 0x1F0 */ s32 baseRollRate; + /* 0x1F4 */ s32 hitTimer; + /* 0x1F8 */ s32 csTimer; + /* 0x1FC */ s32 csEventTimer; /* 0x200 */ s32 unk_200; /* 0x204 */ s32 unk_204; /* 0x208 */ s32 unk_208; @@ -267,7 +259,7 @@ typedef struct Player { /* 0x214 */ s32 timer_214; /* 0x218 */ s32 timer_218; /* 0x21C */ s32 unk_21C; - /* 0x220 */ s32 timer_220; + /* 0x220 */ s32 radioDamageTimer; /* 0x224 */ s32 timer_224; /* 0x228 */ s32 flags_228; /* 0x22C */ s32 whooshTimer; @@ -279,27 +271,27 @@ typedef struct Player { /* 0x244 */ s32 timer_244; /* 0x248 */ f32 unk_248; /* 0x24C */ f32 unk_24C; - /* 0x250 */ f32 unk_250; + /* 0x250 */ f32 unk_250; // checked for by event actors, but unused? /* 0x250 */ char pad254[4]; - /* 0x258 */ f32 unk_258; - /* 0x25C */ f32 unk_25C; + /* 0x258 */ f32 meteoWarpSpinSpeed; + /* 0x25C */ f32 contrailScale; /* 0x260 */ char pad260[4]; /* 0x264 */ s32 shields; /* 0x268 */ s32 damage; /* 0x26C */ s32 heal; - /* 0x270 */ s32 unk_270; + /* 0x270 */ s32 unk_270; // checked for by event actors, but unused? /* 0x274 */ char pad274[4]; /* 0x278 */ s32 timer_278; - /* 0x27C */ s32 timer_27C; - /* 0x280 */ s32 unk_280; + /* 0x27C */ s32 meteoWarpTimer; + /* 0x280 */ s32 barrelRollAlpha; /* 0x284 */ s32 unk_284; /* 0x288 */ s32 unk_288; /* 0x28C */ char pad28C[0x28]; /* 0x2B4 */ bool boostCooldown; /* 0x2B8 */ bool boostActive; /* 0x2BC */ f32 boostMeter; - /* 0x2C0 */ f32 unk_2C0; - /* 0x2C4 */ s32 unk_2C4; + /* 0x2C0 */ f32 unk_2C0; // has to do with starting right tank jet + /* 0x2C4 */ s32 unk_2C4; // counts up during some effects. never used /* 0x2C8 */ Vec3f hit2; /* 0x2D4 */ Vec3f hit1; /* 0x2E0 */ Vec3f hit3; @@ -310,7 +302,7 @@ typedef struct Player { /* 0x478 */ PlayerSfx sfx; /* 0x498 */ s32 timer_498; /* 0x49C */ WingInfo wings; - /* 0x4D8 */ f32 unk_4D8; + /* 0x4D8 */ f32 aerobaticPitch; /* 0x4DC */ s32 somersault; } Player; // size = 0x4E0 diff --git a/include/variables.h b/include/variables.h index e9dbf839..f8ecd58f 100644 --- a/include/variables.h +++ b/include/variables.h @@ -136,7 +136,7 @@ extern s16 gReflectY; extern Matrix D_display_80161418[]; // static, here for reordering extern Vec3f D_display_80161518[]; // static, here for reordering extern Vec3f D_display_80161548[]; // static, here for reordering -extern Vec3f D_display_80161578[]; +extern Vec3f gLockOnTargetViewPos[]; extern f32 D_display_801615A8[]; extern f32 D_display_801615B8[]; diff --git a/linker_scripts/us/symbol_addrs.txt b/linker_scripts/us/symbol_addrs.txt index 2f4d01f7..36afc6f2 100644 --- a/linker_scripts/us/symbol_addrs.txt +++ b/linker_scripts/us/symbol_addrs.txt @@ -59,10 +59,10 @@ D_800C90F0 = 0x800C90F0; D_800C45E0 = 0x800C45E0; D_edisplay_801615D0 = 0x801615D0;//size:0xC -D_edisplay_801615E0 = 0x801615E0;//size:0xC +sViewPos = 0x801615E0;//size:0xC gTeamEventActorIndex = 0x800CFF80;//size:0x10 -D_display_80161578 = 0x80161578;//size:0x30 +gLockOnTargetViewPos = 0x80161578;//size:0x30 D_display_800CA23C = 0x800CA23C;//size:0x18 D_display_800CA26C = 0x800CA26C;//size:0x20 D_800CA260 = 0x800CA260;//size:0xC diff --git a/linker_scripts/us/symbol_addrs_engine.txt b/linker_scripts/us/symbol_addrs_engine.txt index c60e1d9f..b2c1b0e9 100644 --- a/linker_scripts/us/symbol_addrs_engine.txt +++ b/linker_scripts/us/symbol_addrs_engine.txt @@ -165,18 +165,18 @@ gDefaultSave = 0x800D4D10; gSaveFile = 0x80178870; //size:0x200 // fox_edisplay -func_edisplay_800596C0 = 0x800596C0; -func_edisplay_800597C0 = 0x800597C0; +Object_ApplyWaterDistortion = 0x800596C0; +Object_SetCullDirection = 0x800597C0; Graphics_SetScaleMtx = 0x8005980C; Sprite168_Draw = 0x80059850; -func_edisplay_800598DC = 0x800598DC; +Object_dummy_800598DC = 0x800598DC; Actor201_Draw = 0x800598E8; -func_edisplay_800599A4 = 0x800599A4; +Actor202_PostLimbDraw = 0x800599A4; Actor202_Draw = 0x80059A24; -Obj39_Draw = 0x80059AEC; -func_edisplay_80059B20 = 0x80059B20; +MeteoTunnel_Draw = 0x80059AEC; +Scenery_DrawTitaniaBones = 0x80059B20; func_edisplay_80059BB0 = 0x80059BB0; -Obj42_Draw = 0x80059BBC; +Scenery42_Draw = 0x80059BBC; Actor196_Draw = 0x80059BF0; func_edisplay_80059C28 = 0x80059C28; Sprite167_Draw = 0x80059C34; @@ -291,7 +291,7 @@ func_enmy_80063F4C = 0x80063F4C; func_enmy_80063F58 = 0x80063F58; func_enmy_80063F74 = 0x80063F74; Object_Init = 0x80063F90; -func_enmy_800652CC = 0x800652CC; +Scenery_UpdateTitaniaBones = 0x800652CC; func_enmy_80065380 = 0x80065380; func_enmy_8006546C = 0x8006546C; func_enmy_800654E4 = 0x800654E4; @@ -311,8 +311,8 @@ func_enmy_80066E80 = 0x80066E80; Sprite167_Update = 0x80066E8C; func_enmy_80066EA8 = 0x80066EA8; func_enmy_80066EE4 = 0x80066EE4; -func_enmy_80066EF0 = 0x80066EF0; -func_enmy_800671D0 = 0x800671D0; +Item_CheckBounds = 0x80066EF0; +Item_SpinPickup = 0x800671D0; func_enmy_80067348 = 0x80067348; func_enmy_800674B4 = 0x800674B4; ActorSupplies_Update = 0x8006753C; @@ -420,7 +420,7 @@ gHitCount = 0x80161A98; gSavedHitCount = 0x80161A9C; gLifeCount = 0x80161AA0; gLaserStrength = 0x80161AA8;//size:0x10 -D_ctx_80161AB8 = 0x80161AB8; +gCullObjects = 0x80161AB8; gScenery = 0x80161B00; //size:0x1900 gSprites = 0x80163400; //size:0xBE0 gActors = 0x80163FE0; //size:0xB130 @@ -492,15 +492,15 @@ gChargeTimers = 0x801779C8; gPlayerCamEye = 0x801779D8; gPlayerCamAt = 0x801779E8; gExpertMode = 0x801779F8; -D_Timer_80177A00 = 0x80177A00; +gUturnDownTimers = 0x80177A00; D_ctx_80177A10 = 0x80177A10;//size:0x28 -D_Timer_80177A38 = 0x80177A38; +gUturnBrakeTimers = 0x80177A38; D_ctx_80177A48 = 0x80177A48;//size:0x28 -D_Timer_80177A70 = 0x80177A70;//size:0x10 +gLoopDownTimers = 0x80177A70;//size:0x10 gCsFrameCount = 0x80177A80; -D_Timer_80177A88 = 0x80177A88;//size:0x10 +gLoopBoostTimers = 0x80177A88;//size:0x10 D_ctx_80177A98 = 0x80177A98; -D_ctx_80177AA0 = 0x80177AA0; +gMuzzleFlashScale = 0x80177AA0; D_ctx_80177AB0 = 0x80177AB0; gShieldAlpha = 0x80177AB8; gAqDrawMode = 0x80177AC8; @@ -518,7 +518,7 @@ gMissionPlanet = 0x80177B90; gMissionMedal = 0x80177BB0; gControllerRumbleTimers = 0x80177BD0; gPlanetPathStatus = 0x80177BD8; -D_ctx_80177C30 = 0x80177C30; +gPlayerScores = 0x80177C30; D_ctx_80177C50 = 0x80177C50; D_ctx_80177C58 = 0x80177C58; gOptionSoundMode = 0x80177C74; @@ -530,15 +530,15 @@ D_ctx_80177C9C = 0x80177C9C; gSavedObjectLoadIndex = 0x80177CA0; D_ctx_80177CA4 = 0x80177CA4; D_ctx_80177CAC = 0x80177CAC; -D_ctx_80177CB0 = 0x80177CB0; +gSavedPathProgress = 0x80177CB0; D_ctx_80177CB4 = 0x80177CB4; D_ctx_80177CBC = 0x80177CBC; D_ctx_80177CC4 = 0x80177CC4; -D_ctx_80177CC8 = 0x80177CC8; +gPathGroundScroll = 0x80177CC8; gStarWolfTeamAlive = 0x80177CD0; // size:0x18 -D_ctx_80177D08 = 0x80177D08; +gPathVelZ = 0x80177D08; gRightWingHealth = 0x80177D10; -D_ctx_80177D20 = 0x80177D20; +gPathProgress = 0x80177D20; gLeftWingHealth = 0x80177D28; gRadioPortraitScaleY = 0x80177D38; gRightWingFlashTimer = 0x80177D40; @@ -746,7 +746,7 @@ func_play_800B39E0 = 0x800B39E0; Player_UpdateShields = 0x800B40AC; func_play_800B415C = 0x800B415C; func_play_800B41E0 = 0x800B41E0; -func_play_800B41EC = 0x800B41EC; +Player_Down = 0x800B41EC; func_play_800B42B0 = 0x800B42B0; func_play_800B44C4 = 0x800B44C4; func_play_800B46F8 = 0x800B46F8; diff --git a/src/engine/fox_360.c b/src/engine/fox_360.c index 274f2345..cbace701 100644 --- a/src/engine/fox_360.c +++ b/src/engine/fox_360.c @@ -168,12 +168,12 @@ void AllRange_GreatFoxRepair(Player* player) { Vec3f sp60; gCsFrameCount++; - switch (player->unk_1D0) { + switch (player->csState) { case 0: - player->unk_1F4 = player->timer_498 = player->damage = player->unk_280 = player->boostMeter = + player->hitTimer = player->timer_498 = player->damage = player->barrelRollAlpha = player->boostMeter = player->boostCooldown = player->somersault = gCsFrameCount = 0; - player->unk_130 = player->camRoll = player->boostSpeed = player->unk_08C = player->unk_0D8.x = - player->unk_0D8.y = player->unk_0D8.z = player->unk_134 = player->unk_4D8 = 0.0f; + player->zRotBarrelRoll = player->camRoll = player->boostSpeed = player->camDist = player->knockback.x = + player->knockback.y = player->knockback.z = player->damageShake = player->aerobaticPitch = 0.0f; gCsCamEyeX = 1673.0f; gCsCamEyeY = 337.0f; if (player->pos.z < 0.0f) { @@ -181,11 +181,11 @@ void AllRange_GreatFoxRepair(Player* player) { } else { gCsCamEyeZ = 480.0f; } - player->unk_0E8 = 0.0f; + player->rot.y = 0.0f; player->pos.x = 2100.0f; player->baseSpeed = 30.0f; - player->unk_0E4 = -8.0f; - player->unk_114 = 90.0f; + player->rot.x = -8.0f; + player->yRot_114 = 90.0f; gCsCamAtX = 2100.0f; player->pos.y = 450.0f; gCsCamAtY = 450.0f; @@ -193,7 +193,7 @@ void AllRange_GreatFoxRepair(Player* player) { gCsCamAtZ = 0.0f; D_ctx_80177A48[0] = 1.0f; player->wings.modelId = 1; - player->unk_1D0++; + player->csState++; break; case 1: if (gCsFrameCount >= 47) { @@ -202,7 +202,7 @@ void AllRange_GreatFoxRepair(Player* player) { gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0; } if (gCsFrameCount >= 64) { - player->unk_1D0++; + player->csState++; player->baseSpeed = 0.0f; } break; @@ -212,7 +212,7 @@ void AllRange_GreatFoxRepair(Player* player) { player->pos.x = 400.0f; player->pos.y = -420.0f; player->pos.z = 0.0f; - player->unk_0EC = 0.0f; + player->rot.z = 0.0f; gCsCamEyeX = -683.0f; gCsCamEyeY = -346.0f; gCsCamEyeZ = 305.0f; @@ -225,7 +225,7 @@ void AllRange_GreatFoxRepair(Player* player) { gRightWingHealth[0] = gLeftWingHealth[0] = 60; } AUDIO_PLAY_SFX(0x4900200E, gDefaultSfxSource, 4); - player->unk_1D0++; + player->csState++; } break; case 3: @@ -233,9 +233,9 @@ void AllRange_GreatFoxRepair(Player* player) { gCsCamEyeZ -= 1.0f; if (gFillScreenAlpha == 0) { player->unk_190 = player->unk_194 = 5.0f; - player->unk_114 = 90.0f; + player->yRot_114 = 90.0f; player->baseSpeed = gArwingSpeed; - player->unk_1D0++; + player->csState++; AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0); } @@ -243,7 +243,7 @@ void AllRange_GreatFoxRepair(Player* player) { case 4: gCsCamEyeZ -= 1.0f; gCsCamEyeX -= 1.0f; - player->unk_0E4 += 0.4f; + player->rot.x += 0.4f; if (gCsFrameCount >= 130) { player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->wings.modelId = 0; @@ -257,10 +257,10 @@ void AllRange_GreatFoxRepair(Player* player) { gCsCamAtX = player->pos.x; gCsCamAtY = player->pos.y; gCsCamAtZ = player->pos.z; - Math_SmoothStepToF(&player->unk_0EC, 0.0f, 0.1f, 2.0f, 0); - Math_SmoothStepToF(&player->unk_12C, 0.0f, 0.1f, 3.0f, 0); - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); + Math_SmoothStepToF(&player->rot.z, 0.0f, 0.1f, 2.0f, 0); + Math_SmoothStepToF(&player->zRotBank, 0.0f, 0.1f, 3.0f, 0); + Matrix_RotateY(gCalcMatrix, (player->rot.y + player->yRot_114 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(player->rot.x * M_DTOR), MTXF_APPLY); sp6C.x = 0.0f; sp6C.y = 0.0f; sp6C.z = player->baseSpeed; @@ -271,8 +271,8 @@ void AllRange_GreatFoxRepair(Player* player) { player->pos.x += player->vel.x; player->pos.y += player->vel.y; player->pos.z += player->vel.z; - player->unk_138 = player->pos.z; - player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; + player->trueZpos = player->pos.z; + player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll; Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0); Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0); Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0); @@ -284,14 +284,14 @@ void AllRange_GreatFoxRepair(Player* player) { void AllRange_FortunaIntro(Player* player) { Vec3f sp24; - Math_Vec3fFromAngles(&sp24, 0.0f, player->unk_114 + 180.0f, 40.0f); + Math_Vec3fFromAngles(&sp24, 0.0f, player->yRot_114 + 180.0f, 40.0f); player->vel.x = sp24.x; player->vel.z = sp24.z; player->vel.y = sp24.y; player->pos.x += player->vel.x; player->pos.y += player->vel.y; player->pos.z += player->vel.z; - player->unk_138 = player->pos.z; + player->trueZpos = player->pos.z; player->cam.eye.x = -200.0f; player->cam.eye.y = 500.0f; player->cam.eye.z = 7000.0f; @@ -415,7 +415,7 @@ void ActorAllRange_SpawnTeam(void) { if (actor->aiType <= AI360_PEPPY) { AUDIO_PLAY_SFX(0x3100000C, actor->sfxSource, 4); actor->info.hitbox = SEGMENTED_TO_VIRTUAL(gTeamHitbox); - actor->info.unk_1C = 0.0f; + actor->info.targetOffset = 0.0f; actor->info.bonus = 0; } else { AUDIO_PLAY_SFX(0x31000011, actor->sfxSource, 4); @@ -505,15 +505,15 @@ void func_360_8002F69C(Actor* this) { } gPlayer[0].cam.eye.y = 2500.0f; gPlayer[0].cam.eye.z = 5000.0f; - gPlayer[0].cam.at.x = gActors[4].obj.pos.x; - gPlayer[0].cam.at.y = gActors[4].obj.pos.y; - gPlayer[0].cam.at.z = gActors[4].obj.pos.z; + gPlayer[0].cam.at.x = gActors[AI360_WOLF].obj.pos.x; + gPlayer[0].cam.at.y = gActors[AI360_WOLF].obj.pos.y; + gPlayer[0].cam.at.z = gActors[AI360_WOLF].obj.pos.z; } if ((gAllRangeEventTimer > D_360_800C9B4C) && (gStarWolfMsgTimer == 0)) { gAllRangeFrameCount++; - for (i = 1, actor = &gActors[1]; i < 8; i++, actor++) { + for (i = AI360_FALCO, actor = &gActors[AI360_FALCO]; i <= AI360_ANDREW; i++, actor++) { if ((actor->obj.status == OBJ_ACTIVE) && (actor->state == STATE360_2) && (actor->health < 70) && - (actor->timer_0C6 != 0) && (actor->unk_0D4 == 1)) { + (actor->timer_0C6 != 0) && (actor->dmgSource == 1)) { if ((gActors[actor->aiIndex].state == STATE360_3) && (gActors[actor->aiIndex].aiType <= AI360_ANDREW)) { gActors[actor->aiIndex].iwork[2] = AI360_FOX; gActors[actor->aiIndex].state = STATE360_2; @@ -603,7 +603,7 @@ void func_360_8002FC00(Actor* this) { } if (gTeamShields[actor->aiIndex] > 0) { func_360_8002FB4C(&gActors[actor->aiIndex]); - if ((actor->iwork[5] != 0) && (actor->unk_0D4 == 1) && (gActors[actor->aiIndex].iwork[3] == 0)) { + if ((actor->iwork[5] != 0) && (actor->dmgSource == 1) && (gActors[actor->aiIndex].iwork[3] == 0)) { if (gTeamHelpActor == &gActors[actor->aiIndex]) { gTeamHelpActor = NULL; gTeamHelpTimer = 0; @@ -814,40 +814,40 @@ void ActorAllRange_ApplyDamage(Actor* this) { Vec3f sp48; Vec3f sp3C; - if (this->unk_0D0 != 0) { + if (this->dmgType != 0) { if (this->aiType == AI360_GREAT_FOX) { - this->unk_0D0 = 0; + this->dmgType = 0; } - if ((this->unk_0D0 >= 2) && (this->aiType >= AI360_WOLF) && (this->aiType < AI360_KATT)) { + if ((this->dmgType >= 2) && (this->aiType >= AI360_WOLF) && (this->aiType < AI360_KATT)) { this->damage = 10; this->timer_0C2 = 10; } if (((this->aiType <= AI360_PEPPY) || (this->aiType == AI360_BILL) || (this->aiType == AI360_KATT)) && - (this->unk_0D0 == 2)) { - this->unk_0D0 = 0; + (this->dmgType == 2)) { + this->dmgType = 0; } - if ((this->unk_0D0 == 2) && (this->fwork[22] > 0.0f)) { - this->unk_0D0 = 0; + if ((this->dmgType == 2) && (this->fwork[22] > 0.0f)) { + this->dmgType = 0; } if (this->fwork[23] > 1.0f) { - this->unk_0D0 = 0; + this->dmgType = 0; } - if (this->unk_0D0 != 0) { + if (this->dmgType != 0) { var_a1 = false; if ((this->unk_0B6 == 3) || ((gCurrentLevel == LEVEL_BOLSE) && (gBosses[1].obj.status != OBJ_FREE) && (this->aiType >= AI360_WOLF)) || ((gCurrentLevel == LEVEL_VENOM_2) && (this->aiType >= AI360_WOLF) && (this->aiType < AI360_10) && - (this->unk_0D0 == 2))) { + (this->dmgType == 2))) { this->damage = 0; var_a1 = true; if (gCurrentLevel == LEVEL_BOLSE) { - this->unk_0D4 = 0; + this->dmgSource = 0; } } if (this->aiType >= AI360_WOLF) { - if (((this->unk_0D0 != 3) || (this->aiType != AI360_WOLF)) && - ((this->aiType != AI360_MISSILE) || (this->unk_0D0 != 2))) { + if (!((this->dmgType == 3) && (this->aiType == AI360_WOLF)) && + !((this->aiType == AI360_MISSILE) && (this->dmgType == 2))) { this->health -= this->damage; } } else if ((this->aiType <= AI360_PEPPY) && (this->state != STATE360_6)) { @@ -861,7 +861,7 @@ void ActorAllRange_ApplyDamage(Actor* this) { this->health = 0; if (this->aiType == AI360_MISSILE) { SectorZ_80199900(this, 1); - if (this->unk_0D4 == 1) { + if (this->dmgSource == 1) { if (gActors[8].obj.status == OBJ_ACTIVE) { Radio_PlayMessage(gMsg_ID_16140, RCID_KATT); } @@ -869,7 +869,7 @@ void ActorAllRange_ApplyDamage(Actor* this) { gHitCount += 11; D_ctx_80177850 = 15; } else { - switch (this->unk_0D4) { + switch (this->dmgSource) { case 102: Radio_PlayMessage(gMsg_ID_16170, RCID_FALCO); break; @@ -919,13 +919,13 @@ void ActorAllRange_ApplyDamage(Actor* this) { this->timer_0BC = RAND_INT(50.0f); } } - if ((this->aiType >= AI360_WOLF) && (this->aiType < AI360_KATT)) { + if ((this->aiType >= AI360_WOLF) && (this->aiType <= AI360_ANDREW)) { this->timer_0BC = RAND_INT(40.0f) + 60.0f; } if (this->damage >= 20) { this->timer_0BC = 0; } - if ((gCurrentLevel == LEVEL_KATINA) && (this->unk_0B6 == 1) && (this->unk_0D4 == 1)) { + if ((gCurrentLevel == LEVEL_KATINA) && (this->unk_0B6 == 1) && (this->dmgSource == 1)) { if (gKaAllyKillCount < 2) { ActorAllRange_PlayMessage(gMsg_ID_18018, RCID_BILL); } @@ -968,7 +968,7 @@ void ActorAllRange_ApplyDamage(Actor* this) { if ((this->aiType >= AI360_WOLF) && (this->aiType <= AI360_ANDREW)) { sStarWolfKillTimer = 150; } - switch (this->unk_0D4) { + switch (this->dmgSource) { case 1: if (this->aiType >= AI360_10) { switch (this->iwork[2]) { @@ -987,10 +987,10 @@ void ActorAllRange_ApplyDamage(Actor* this) { case 102: case 103: case 104: - if ((this->aiType >= AI360_WOLF) && (this->aiType < AI360_KATT)) { + if ((this->aiType >= AI360_WOLF) && (this->aiType <= AI360_ANDREW)) { if ((gStarWolfTeamAlive[0] + gStarWolfTeamAlive[1] + gStarWolfTeamAlive[2] + gStarWolfTeamAlive[3]) == 0) { - switch (this->unk_0D4) { + switch (this->dmgSource) { case 102: Radio_PlayMessage(gMsg_ID_9438, RCID_FALCO); break; @@ -1002,10 +1002,10 @@ void ActorAllRange_ApplyDamage(Actor* this) { break; } } else { - gActors[this->unk_0D4 - 101].iwork[1] = 80; + gActors[this->dmgSource - 101].iwork[1] = 80; } } else { - gActors[this->unk_0D4 - 101].iwork[1] = 80; + gActors[this->dmgSource - 101].iwork[1] = 80; } break; } @@ -1054,7 +1054,7 @@ void ActorAllRange_ApplyDamage(Actor* this) { this->fwork[12] = sp3C.z; } if ((gRadioState == 0) && (gActors[0].obj.status == OBJ_ACTIVE)) { - if (this->unk_0D0 == 3) { + if (this->dmgType == 3) { switch (this->aiType) { case AI360_FALCO: ActorAllRange_PlayMessage(gMsg_ID_20210, RCID_FALCO); @@ -1069,11 +1069,11 @@ void ActorAllRange_ApplyDamage(Actor* this) { ActorAllRange_PlayMessage(gMsg_ID_20084, RCID_KATT); break; } - } else if (this->unk_0D4 < 105) { + } else if (this->dmgSource <= AI360_PEPPY + 101) { if (this->aiType >= AI360_WOLF) { - if (this->unk_0D4 == 1) { - if ((gCurrentLevel == LEVEL_KATINA) && (this->unk_0B6 == 1) && (gKaKilledAlly == 0)) { - gKaKilledAlly = 1; + if (this->dmgSource == 1) { + if ((gCurrentLevel == LEVEL_KATINA) && (this->unk_0B6 == 1) && !gKaKilledAlly) { + gKaKilledAlly = true; Radio_PlayMessage(gMsg_ID_18015, RCID_BILL); } else if (this->aiType == AI360_KATT) { ActorAllRange_PlayMessage(gMsg_ID_20084, RCID_KATT); @@ -1096,7 +1096,7 @@ void ActorAllRange_ApplyDamage(Actor* this) { } } } - } else if (this->unk_0D4 == 1) { + } else if (this->dmgSource == AI360_FOX + 1) { switch (this->aiType) { case AI360_FALCO: ActorAllRange_PlayMessage(gMsg_ID_20060, RCID_FALCO); @@ -1149,7 +1149,7 @@ void ActorAllRange_ApplyDamage(Actor* this) { } } } - this->unk_0D0 = 0; + this->dmgType = 0; } } } @@ -1158,7 +1158,7 @@ void ActorAllRange_CheckPlayerNearby(Actor* actor) { if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (actor->iwork[24] != 0) && (fabsf(actor->obj.pos.x - gPlayer[0].pos.x) < 1000.0f) && (fabsf(actor->obj.pos.y - gPlayer[0].pos.y) < 1000.0f) && - (fabsf(actor->obj.pos.z - gPlayer[0].unk_138) < 1000.0f)) { + (fabsf(actor->obj.pos.z - gPlayer[0].trueZpos) < 1000.0f)) { actor->iwork[10]++; } else { actor->iwork[10] = 0; @@ -1215,7 +1215,7 @@ void ActorAllRange_Update(Actor* this) { if (this->aiType == AI360_EVENT_HANDLER) { this->timer_0C2 = 10; - this->info.unk_1C = 0.0f; + this->info.targetOffset = 0.0f; ActorAllRange_UpdateEvents(this); return; } @@ -1344,7 +1344,7 @@ void ActorAllRange_Update(Actor* this) { } sp104 = 0; this->iwork[5] = 0; - if ((this->aiType > AI360_FOX) && (this->aiType <= AI360_PEPPY) && (gTeamShields[this->aiType] <= 0) && + if ((this->aiType >= AI360_FALCO) && (this->aiType <= AI360_PEPPY) && (gTeamShields[this->aiType] <= 0) && (this->state != STATE360_6)) { this->state = STATE360_6; if (this->timer_0C2 < 100) { @@ -1489,7 +1489,7 @@ void ActorAllRange_Update(Actor* this) { if (!gPlayer[0].somersault) { this->fwork[4] = gPlayer[0].pos.x + spCC; this->fwork[5] = gPlayer[0].pos.y + spC8; - this->fwork[6] = gPlayer[0].unk_138 + spC4; + this->fwork[6] = gPlayer[0].trueZpos + spC4; this->fwork[1] = gPlayer[0].baseSpeed + 10.0f; } if ((gActors[0].state == STATE360_6) && (this->aiType <= AI360_PEPPY)) { @@ -1546,7 +1546,8 @@ void ActorAllRange_Update(Actor* this) { } else { this->fwork[1] = gPlayer[0].baseSpeed - 5.0f; if ((gCurrentLevel == LEVEL_VENOM_2) && - (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN) && (gPlayer[0].unk_4D8 > 100.0f)) { + (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN) && + (gPlayer[0].aerobaticPitch > 100.0f)) { this->iwork[16] = STATE360_8; } } @@ -2051,7 +2052,7 @@ void ActorAllRange_Update(Actor* this) { radarMark->pos.x = this->obj.pos.x; radarMark->pos.y = this->obj.pos.y; radarMark->pos.z = this->obj.pos.z; - radarMark->unk_10 = this->unk_0F4.y + 180.0f; + radarMark->yRot = this->unk_0F4.y + 180.0f; if (this->iwork[1] != 0) { this->iwork[1]--; if ((this->iwork[1] == 0) && (gActors[0].state == STATE360_2) && (gRadioState == 0)) { @@ -2095,7 +2096,7 @@ void ActorAllRange_Update(Actor* this) { 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; + this->dmgType = 1; this->damage = 10; this->health = 0; ActorAllRange_ApplyDamage(this); @@ -2257,7 +2258,7 @@ void ActorAllRange_Draw(ActorAllRange* this) { case AI360_GREAT_FOX: Display_SetSecondLight(&this->obj.pos); this->unk_0B6 = 1; - Actor195_Draw(this); + ActorCutscene_Draw(this); break; case AI360_MISSILE: Animation_GetFrameData(&D_SZ_6006D64, 0, sp7C); diff --git a/src/engine/fox_beam.c b/src/engine/fox_beam.c index 3dcea5e9..0a2bd790 100644 --- a/src/engine/fox_beam.c +++ b/src/engine/fox_beam.c @@ -52,7 +52,7 @@ void func_beam_80035E78(PlayerShot* shot) { if (shot->unk_5C == 0) { shot->vel.x = shot->vel.y = shot->vel.z = shot->obj.rot.x = shot->obj.rot.y = shot->obj.rot.z = 0.0f; - shot->unk_44 = 1.0f; + shot->scale = 1.0f; shot->unk_5C = 1; shot->unk_64 = 30; shot->unk_58 = 150; @@ -137,7 +137,7 @@ void func_beam_80036318(PlayerShot* shot) { } func_beam_80035E78(shot); } else if (shot->obj.id == PLAYERSHOT_8) { - shot->unk_44 = 7.5f; + shot->scale = 7.5f; for (i = 0; i < ARRAY_COUNT(gActors); i++) { gActors[i].lockOnTimers[shot->playerNum] = 0; } @@ -367,7 +367,7 @@ s32 func_beam_80036F88(PlayerShot* shot, Actor* actor) { if (count != 0) { xySizeMod = 0.0f; if (actor->info.unk_16 == 1) { - xySizeMod = fabsf((actor->obj.pos.z + D_ctx_80177D20) / 50.0f) + 10.0f; + xySizeMod = fabsf((actor->obj.pos.z + gPathProgress) / 50.0f) + 10.0f; if ((shot->playerNum < 4) && ((gLaserStrength[shot->playerNum] != LASERS_SINGLE) || (shot->obj.id == PLAYERSHOT_8))) { xySizeMod += 30.0f; @@ -429,7 +429,7 @@ bool func_beam_80037438(PlayerShot* shot, Actor* actor) { if (((s32) hitboxData[0] != 0) && (sqrtf(SQ(temp_fv1) + SQ(temp_fa0)) <= 500.0f)) { if (shot->playerNum < 4) { temp_fv1 = actor->obj.pos.x - gPlayer[0].cam.eye.x; - temp_fa0 = actor->obj.pos.z + D_ctx_80177D20 - gPlayer[0].cam.eye.z; + temp_fa0 = actor->obj.pos.z + gPathProgress - gPlayer[0].cam.eye.z; var_fa1 = (sqrtf(SQ(temp_fv1) + SQ(temp_fa0)) / 50.0f) + 20.0f + 10.0f; if (var_fa1 > 200.0f) { var_fa1 = 200.0f; @@ -486,7 +486,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 == ACTOR_EVENT_ID) || (objId == OBJ_SCENERY_39)) { + (objId == OBJ_BOSS_313) || (objId == ACTOR_EVENT_ID) || (objId == OBJ_SCENERY_ME_TUNNEL)) { Matrix_RotateY(gCalcMatrix, -obj->rot.y * M_DTOR, MTXF_NEW); sp7C.x = shot->obj.pos.x - obj->pos.x; sp7C.y = shot->obj.pos.y - obj->pos.y; @@ -533,7 +533,7 @@ bool func_beam_8003774C(PlayerShot* shot, ObjectId objId, Object* obj) { case OBJ_BOSS_313: objId = COL1_8; break; - case OBJ_SCENERY_39: + case OBJ_SCENERY_ME_TUNNEL: objId = COL1_1; break; case OBJ_SCENERY_120: @@ -652,8 +652,8 @@ void func_beam_80037CF4(PlayerShot* shot, Actor* actor, s32 hitIndex) { Vec3f sp44 = { 0.0f, 0.0f, -100.0f }; Vec3f sp38; - actor->unk_0D0 = 1; - actor->unk_0D2 = hitIndex - 1; + actor->dmgType = 1; + actor->dmgPart = hitIndex - 1; actor->timer_0C2 = 2; actor->damage = 10; if ((shot->playerNum < 4) && (gPlayer[shot->playerNum].form != FORM_LANDMASTER)) { @@ -677,19 +677,19 @@ void func_beam_80037CF4(PlayerShot* shot, Actor* actor, s32 hitIndex) { if (gCurrentLevel == LEVEL_AQUAS) { actor->damage = 31; } else { - actor->unk_0D0 = 2; + actor->dmgType = 2; actor->damage = 30; actor->lockOnTimers[shot->playerNum] = 0; } } - actor->unk_0D4 = shot->playerNum + 1; + actor->dmgSource = shot->playerNum + 1; actor->hitPos.x = shot->obj.pos.x; actor->hitPos.y = shot->obj.pos.y; actor->hitPos.z = shot->obj.pos.z; - if (((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0D2 == 0) && + if (((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->dmgPart == 0) && ((actor->unk_0B4 == EINFO_48) || (actor->unk_0B4 == EINFO_49) || (actor->unk_0B4 == EINFO_50))) || ((actor->obj.id == OBJ_ACTOR_ALLRANGE) && (actor->fwork[23] > 1.0f)) || - ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0D2 == 0) && (actor->unk_0B4 == EINFO_67)) || + ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->dmgPart == 0) && (actor->unk_0B4 == EINFO_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))) { @@ -760,16 +760,16 @@ void func_beam_80038140(PlayerShot* shot) { switch (actor->obj.id) { case OBJ_ACTOR_180: if (func_beam_8003774C(shot, actor->obj.id, &actor->obj)) { - actor->unk_0D0 = 1; - actor->unk_0D2 = shot->playerNum; + actor->dmgType = 1; + actor->dmgPart = shot->playerNum; return; } break; case OBJ_ACTOR_EVENT: if (actor->unk_0B4 == EINFO_42) { if (func_beam_8003774C(shot, ACTOR_EVENT_ID, &actor->obj)) { - actor->unk_0D0 = 1; - actor->unk_0D2 = shot->playerNum; + actor->dmgType = 1; + actor->dmgPart = shot->playerNum; return; } } else if (actor->unk_0B4 == EINFO_63) { @@ -827,7 +827,7 @@ void func_beam_80038140(PlayerShot* shot) { !((gLaserStrength[shot->playerNum] == LASERS_SINGLE) && (shot->obj.id != PLAYERSHOT_8))) { test.x = 100.0f; } - if (player->unk_280 >= 100) { + if (player->barrelRollAlpha >= 100) { test.x = 150.0f; } if (player->form == FORM_LANDMASTER) { @@ -841,11 +841,11 @@ void func_beam_80038140(PlayerShot* shot) { test.z = test.x; if ((i != shot->playerNum) && ((player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (player->state_1C8 == PLAYERSTATE_1C8_DOWN)) && - (fabsf(player->unk_138 - shot->obj.pos.z) < test.z) && + (fabsf(player->trueZpos - shot->obj.pos.z) < test.z) && (fabsf(player->pos.x - shot->obj.pos.x) < test.x) && (fabsf(player->pos.y - shot->obj.pos.y) < test.y)) { - if (player->unk_280 >= 100) { - shot->obj.rot.y = player->unk_0E8 + player->unk_114 + 180.0f + 90.0f; + if (player->barrelRollAlpha >= 100) { + shot->obj.rot.y = player->rot.y + player->yRot_114 + 180.0f + 90.0f; shot->obj.rot.x = RAND_FLOAT(360.0f); Matrix_RotateY(gCalcMatrix, shot->obj.rot.y * M_DTOR, MTXF_NEW); Matrix_RotateX(gCalcMatrix, shot->obj.rot.x * M_DTOR, MTXF_APPLY); @@ -860,10 +860,10 @@ void func_beam_80038140(PlayerShot* shot) { shot->obj.pos.z += 2.0f * shot->vel.z; shot->unk_64 = 5; AUDIO_PLAY_SFX(0x09007011, player->sfxSource, 0); - func_effect_80078E50(player->pos.x, player->pos.y, player->unk_138, 8.0f); + func_effect_80078E50(player->pos.x, player->pos.y, player->trueZpos, 8.0f); } else { func_beam_80036318(shot); - if (player->unk_1F4 == 0) { + if (player->hitTimer == 0) { if (gPlayer[0].form == 3) { Player_ApplyDamage(player, 0, 60); } else { @@ -873,11 +873,11 @@ void func_beam_80038140(PlayerShot* shot) { if (gCamCount != 1) { player->unk_288 = shot->playerNum + 1; } - player->unk_0D8.x = shot->vel.x * 0.1f; - player->unk_0D8.y = shot->vel.y * 0.1f; - player->unk_0D8.z = shot->vel.z * 0.1f; + player->knockback.x = shot->vel.x * 0.1f; + player->knockback.y = shot->vel.y * 0.1f; + player->knockback.z = shot->vel.z * 0.1f; if (player->form != FORM_ON_FOOT) { - func_effect_8007D1E0(player->pos.x, player->pos.y, player->unk_138, 2.0f); + func_effect_8007D1E0(player->pos.x, player->pos.y, player->trueZpos, 2.0f); } } } @@ -885,7 +885,7 @@ void func_beam_80038140(PlayerShot* shot) { } } } - if ((gGroundType == 4) && Ground_801B6AEC(shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z + D_ctx_80177D20)) { + if ((gGroundType == 4) && Ground_801B6AEC(shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z + gPathProgress)) { func_beam_80036318(shot); if (shot->obj.id != PLAYERSHOT_4) { func_effect_8007A900(shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z, 2.0f, 255, 15, 0); @@ -915,7 +915,7 @@ void func_beam_80038140(PlayerShot* shot) { } else { for (i = 0, scenery = gScenery; i < 50; i++, scenery++) { if (scenery->obj.status == OBJ_ACTIVE) { - if ((scenery->obj.id == OBJ_SCENERY_1) || (scenery->obj.id == OBJ_SCENERY_39) || + if ((scenery->obj.id == OBJ_SCENERY_1) || (scenery->obj.id == OBJ_SCENERY_ME_TUNNEL) || (scenery->obj.id == OBJ_SCENERY_4) || (scenery->obj.id == OBJ_SCENERY_5) || (scenery->obj.id == OBJ_SCENERY_120) || (scenery->obj.id == OBJ_SCENERY_124) || (scenery->obj.id == OBJ_SCENERY_126) || (scenery->obj.id == OBJ_SCENERY_47) || @@ -1035,7 +1035,7 @@ void func_beam_80038F34(PlayerShot* shot) { Vec3f sp4C = { 0.0f, 0.0f, 0.0f }; s32 sp48 = 0; - Matrix_Translate(gGfxMatrix, shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z + D_ctx_80177D20, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z + gPathProgress, MTXF_APPLY); Matrix_MultVec3f(gGfxMatrix, &sp4C, &D_beam_8015F950); if ((D_beam_8015F950.z < 0.0f) && (D_beam_8015F950.z > -10000.0f)) { if (fabsf(D_beam_8015F950.x) < (fabsf(D_beam_8015F950.z * 0.5f) + 500.0f)) { @@ -1217,7 +1217,7 @@ void func_beam_80039A50(PlayerShot* shot) { f32 var_fv1; s32 sp104 = 0; - Matrix_Translate(gGfxMatrix, shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z + D_ctx_80177D20, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z + gPathProgress, MTXF_APPLY); Matrix_MultVec3f(gGfxMatrix, &sp11C, &D_beam_8015F950); if ((D_beam_8015F950.z < 0.0f) && (D_beam_8015F950.z > -10000.0f)) { var_fv1 = fabsf(D_beam_8015F950.x); // probably fake. The use of temps was likely different @@ -1241,9 +1241,9 @@ void func_beam_80039A50(PlayerShot* shot) { Matrix_RotateX(gGfxMatrix, shot->obj.rot.x * M_DTOR, MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, shot->obj.rot.z * M_DTOR, MTXF_APPLY); if ((shot->obj.id == PLAYERSHOT_BOMB) && (shot->unk_5C == 0)) { - Matrix_RotateZ(gGfxMatrix, shot->unk_34 * M_DTOR, MTXF_APPLY); - Matrix_RotateY(gGfxMatrix, shot->unk_30 * M_DTOR, MTXF_APPLY); - Matrix_RotateX(gGfxMatrix, shot->unk_2C * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, shot->vec_2C.z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, shot->vec_2C.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, shot->vec_2C.x * M_DTOR, MTXF_APPLY); } } Matrix_Translate(gGfxMatrix, 0.f, 0.f, D_800C9BD8[shot->obj.id], MTXF_APPLY); @@ -1259,7 +1259,7 @@ void func_beam_80039A50(PlayerShot* shot) { gSPDisplayList(gMasterDisp++, D_10231A0); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z + D_ctx_80177D20, + Matrix_Translate(gGfxMatrix, shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z + gPathProgress, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].camYaw, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].camPitch, MTXF_APPLY); @@ -1292,7 +1292,7 @@ void func_beam_80039A50(PlayerShot* shot) { Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); } else { - Matrix_Scale(gGfxMatrix, shot->unk_44, shot->unk_44, shot->unk_44, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, shot->scale, shot->scale, shot->scale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if (gVersusMode) { RCP_SetupDL_49(); @@ -1371,7 +1371,7 @@ void func_beam_80039A50(PlayerShot* shot) { break; case PLAYERSHOT_6: case PLAYERSHOT_7: - Matrix_Scale(gGfxMatrix, shot->unk_44, shot->unk_44, shot->unk_44, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, shot->scale, shot->scale, shot->scale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL(&gMasterDisp, 0x31); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); @@ -1399,19 +1399,19 @@ void func_beam_80039A50(PlayerShot* shot) { gSPDisplayList(gMasterDisp++, D_AQ_600DB80); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, shot->obj.pos.x, gGroundHeight, shot->obj.pos.z + D_ctx_80177D20, + Matrix_Translate(gGfxMatrix, shot->obj.pos.x, gGroundHeight, shot->obj.pos.z + gPathProgress, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, shot->unk_2C, shot->unk_30, shot->unk_34, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, shot->vec_2C.x, shot->vec_2C.y, shot->vec_2C.z, MTXF_APPLY); RCP_SetupDL(&gMasterDisp, 0x31); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 32, 32, 0, shot->unk_58); gDPSetEnvColor(gMasterDisp++, 32, 16, 16, shot->unk_58); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); } else if (shot->unk_5C == 0) { - if (!(shot->unk_44 > 1.5f)) { + if (!(shot->scale > 1.5f)) { Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z + D_ctx_80177D20, + Matrix_Translate(gGfxMatrix, shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z + gPathProgress, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].camYaw, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].camPitch, MTXF_APPLY); @@ -1457,7 +1457,7 @@ void func_beam_80039A50(PlayerShot* shot) { gSPDisplayList(gMasterDisp++, D_10231A0); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z + D_ctx_80177D20, + Matrix_Translate(gGfxMatrix, shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z + gPathProgress, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].camYaw, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].camPitch, MTXF_APPLY); @@ -1509,10 +1509,10 @@ void func_beam_8003B00C(PlayerShot* shot, Player* player) { Vec3f sp38; switch (shot->unk_5C) { case 0: - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0) * M_DTOR), MTXF_APPLY); - Matrix_Translate(gCalcMatrix, player->unk_084, player->unk_080, 0.0f, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(player->rot.x * M_DTOR), MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -((player->bankAngle + player->rockAngle) * M_DTOR), MTXF_APPLY); + Matrix_Translate(gCalcMatrix, player->xShake, player->yBob, 0.0f, MTXF_APPLY); sp5C.x = 0.0f; sp5C.y = 0.0f; sp5C.z = player->baseSpeed + 200.0f; @@ -1526,19 +1526,19 @@ void func_beam_8003B00C(PlayerShot* shot, Player* player) { Matrix_MultVec3f(gCalcMatrix, &sp5C, &sp44); shot->unk_48 = player->pos.x + sp44.x; shot->unk_4C = player->pos.y + sp44.y; - shot->unk_50 = player->unk_138 + sp44.z; - shot->unk_44 += 200.0f; - if (shot->unk_44 > 5000.0f) { - shot->unk_44 = 5000.0f; + shot->unk_50 = player->trueZpos + sp44.z; + shot->scale += 200.0f; + if (shot->scale > 5000.0f) { + shot->scale = 5000.0f; } - for (sp5C.z = 0.0f; sp5C.z <= shot->unk_44; sp5C.z += 200.0f) { + for (sp5C.z = 0.0f; sp5C.z <= shot->scale; sp5C.z += 200.0f) { Matrix_MultVec3f(gCalcMatrix, &sp5C, &sp38); D_ctx_80178498 = shot->obj.pos.z; D_ctx_801784A0 = shot->obj.pos.y; D_ctx_8017849C = shot->obj.pos.x; shot->obj.pos.x = player->pos.x + sp38.x; shot->obj.pos.y = player->pos.y + sp38.y; - shot->obj.pos.z = player->unk_138 + sp38.z; + shot->obj.pos.z = player->trueZpos + sp38.z; Matrix_Push(&gCalcMatrix); func_beam_80038140(shot); Matrix_Pop(&gCalcMatrix); @@ -1552,7 +1552,7 @@ void func_beam_8003B00C(PlayerShot* shot, Player* player) { } } shot->unk_64 = 30; - shot->obj.rot.y = player->unk_0E8 + player->unk_114; + shot->obj.rot.y = player->rot.y + player->yRot_114; if (!(gControllerHold->button & U_CBUTTONS) && !(gControllerHold->button & A_BUTTON)) { shot->unk_5C = 1; } @@ -1698,9 +1698,9 @@ bool func_beam_8003BB4C(PlayerShot* shot) { var_fa0 = 200.0f; } for (i = 0, actor = gActors; i < 60; i++, actor++) { - if ((actor->obj.status == OBJ_ACTIVE) && (actor->info.unk_1C != 0.0f) && + if ((actor->obj.status == OBJ_ACTIVE) && (actor->info.targetOffset != 0.0f) && ((actor->lockOnTimers[shot->playerNum] == 0) && (fabsf(shot->obj.pos.x - actor->obj.pos.x) <= var_fa0) && - (fabsf(shot->obj.pos.y - (actor->obj.pos.y + actor->info.unk_1C)) <= var_fa0) && + (fabsf(shot->obj.pos.y - (actor->obj.pos.y + actor->info.targetOffset)) <= var_fa0) && (fabsf(shot->obj.pos.z - actor->obj.pos.z) <= var_fa0))) { actor->lockOnTimers[shot->playerNum] = 20; func_enmy_80060F30(gPlayer[shot->playerNum].sfxSource, 0x49008027, shot->playerNum); @@ -1720,7 +1720,7 @@ bool func_beam_8003BB4C(PlayerShot* shot) { (player->form != FORM_ON_FOOT) && (i != shot->playerNum) && (gVsLockOnTimers[i][shot->playerNum] == 0) && (fabsf(shot->obj.pos.x - player->pos.x) <= var_fa0) && (fabsf(shot->obj.pos.y - player->pos.y) <= var_fa0) && - (fabsf(shot->obj.pos.z - player->unk_138) <= var_fa0)) { + (fabsf(shot->obj.pos.z - player->trueZpos) <= var_fa0)) { gVsLockOnTimers[0][shot->playerNum] = gVsLockOnTimers[1][shot->playerNum] = gVsLockOnTimers[2][shot->playerNum] = gVsLockOnTimers[3][shot->playerNum] = 0; gVsLockOnTimers[i][shot->playerNum] = 20; @@ -1771,10 +1771,10 @@ void func_beam_8003C008(PlayerShot* shot) { if ((boss->obj.status == OBJ_ACTIVE) && (boss->timer_05A == 0)) { if (boss->obj.id == OBJ_BOSS_316) { var_s6 = gGameFrameCount % 8U; - var_fs2 = shot->unk_44 * 40.0f; + var_fs2 = shot->scale * 40.0f; } else { var_s6 = gGameFrameCount % 16U; - var_fs2 = shot->unk_44 * 30.0f; + var_fs2 = shot->scale * 30.0f; } hitboxData = boss->info.hitbox; count = *hitboxData++; @@ -1852,7 +1852,7 @@ void func_beam_8003C4D0(PlayerShot* shot, s32 damage) { Scenery* scenery; Effect* effect; Player* player; - f32 temp_fs2 = shot->unk_44 * 60.0f; + f32 temp_fs2 = shot->scale * 60.0f; for (i = 0, scenery = gScenery; i < 50; i++, scenery++) { if ((scenery->obj.status == OBJ_ACTIVE) && (scenery->obj.id == OBJ_SCENERY_56)) { @@ -1900,16 +1900,16 @@ void func_beam_8003C4D0(PlayerShot* shot, s32 damage) { ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == EINFO_78)) || ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == EINFO_38)) || (actor->obj.id == OBJ_ACTOR_196)) { - actor->unk_0D0 = 2; - actor->unk_0D2 = 0; - actor->unk_0D4 = shot->playerNum + 1; + actor->dmgType = 2; + actor->dmgPart = 0; + actor->dmgSource = shot->playerNum + 1; actor->damage = damage; if (actor->info.bonus != 0) { shot->bonus++; } } else if ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->scale >= 0.5f) && (damage > 30)) { - actor->unk_0D4 = shot->playerNum + 1; + actor->dmgSource = shot->playerNum + 1; actor->vel.x = sp68 * 0.03f; actor->vel.y = sp64 * 0.03f; actor->vel.z = sp60 * 0.03f; @@ -1922,9 +1922,9 @@ void func_beam_8003C4D0(PlayerShot* shot, s32 damage) { shot->bonus++; } } else { - actor->unk_0D0 = 2; - actor->unk_0D2 = 0; - actor->unk_0D4 = shot->playerNum + 1; + actor->dmgType = 2; + actor->dmgPart = 0; + actor->dmgSource = shot->playerNum + 1; actor->damage = damage; if (actor->info.bonus != 0) { shot->bonus++; @@ -1969,10 +1969,10 @@ void func_beam_8003C4D0(PlayerShot* shot, s32 damage) { } if (gVersusMode) { for (i = 0, player = gPlayer; i < gCamCount; i++, player++) { - if ((i != shot->playerNum) && (player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (player->unk_1F4 == 0)) { + if ((i != shot->playerNum) && (player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (player->hitTimer == 0)) { sp68 = player->pos.x - shot->obj.pos.x; sp64 = player->pos.y - shot->obj.pos.y; - sp60 = player->unk_138 - shot->obj.pos.z; + sp60 = player->trueZpos - shot->obj.pos.z; if (sqrtf(SQ(sp68) + SQ(sp64) + SQ(sp60)) < temp_fs2) { player->unk_288 = shot->playerNum + 1; switch (player->form) { @@ -2032,13 +2032,13 @@ void func_beam_8003CC08(PlayerShot* shot) { case 1: D_ctx_8017812C = 2; shot->obj.rot.y += 1.0f; - Math_SmoothStepToF(&shot->unk_44, shot->unk_48, 0.05f, 1.5f, 0.001f); + Math_SmoothStepToF(&shot->scale, shot->unk_48, 0.05f, 1.5f, 0.001f); if ((shot->unk_64 > 0) && (shot->unk_64 < 30)) { if (!gVersusMode && ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN))) { test.x = gPlayer[0].pos.x - shot->obj.pos.x; test.y = gPlayer[0].pos.y - shot->obj.pos.y; - test.z = gPlayer[0].unk_138 - shot->obj.pos.z; + test.z = gPlayer[0].trueZpos - shot->obj.pos.z; var_ft5 = VEC3F_MAG(&test) * 0.01f; if (var_ft5 > 60.0f) { var_ft5 = 60.0f; @@ -2090,12 +2090,12 @@ void func_beam_8003CF90(PlayerShot* shot) { var_a3 = 0; if (shot->unk_60 == 0) { for (i = 0, actor = gActors; i < 60; i++, actor++) { - if ((actor->obj.status == OBJ_ACTIVE) && (actor->info.unk_1C != 0.0f) && + if ((actor->obj.status == OBJ_ACTIVE) && (actor->info.targetOffset != 0.0f) && (actor->lockOnTimers[shot->playerNum] != 0)) { var_a3 = 1; actor->lockOnTimers[shot->playerNum] = 2; D_800C9C24 = actor->obj.pos; - D_800C9C24.y += actor->info.unk_1C; + D_800C9C24.y += actor->info.targetOffset; } } for (i = 0, player = gPlayer; i < gCamCount; i++, player++) { @@ -2109,7 +2109,7 @@ void func_beam_8003CF90(PlayerShot* shot) { } else { D_800C9C24.y = player->pos.y + 30.0f; } - D_800C9C24.z = player->unk_138; + D_800C9C24.z = player->trueZpos; } } if (var_a3 != 0) { @@ -2118,20 +2118,20 @@ void func_beam_8003CF90(PlayerShot* shot) { sp64 = shot->obj.pos.z - D_800C9C24.z; sp58 = Math_RadToDeg(Math_Atan2F(sp6C, sp64)); sp5C = Math_RadToDeg(-Math_Atan2F(sp68, sqrtf(SQ(sp6C) + SQ(sp64)))); - if (shot->unk_30 >= 360.0f) { - shot->unk_30 -= 360.0f; + if (shot->vec_2C.y >= 360.0f) { + shot->vec_2C.y -= 360.0f; } - if (shot->unk_30 < 0.0f) { - shot->unk_30 += 360.0f; + if (shot->vec_2C.y < 0.0f) { + shot->vec_2C.y += 360.0f; } - if (shot->unk_2C >= 360.0f) { - shot->unk_2C -= 360.0f; + if (shot->vec_2C.x >= 360.0f) { + shot->vec_2C.x -= 360.0f; } - if (shot->unk_2C < 0.0f) { - shot->unk_2C += 360.0f; + if (shot->vec_2C.x < 0.0f) { + shot->vec_2C.x += 360.0f; } - Math_SmoothStepToAngle(&shot->unk_30, sp58, 1.0f, shot->unk_50, 0.0f); - Math_SmoothStepToAngle(&shot->unk_2C, sp5C, 1.0f, shot->unk_50, 0.0f); + Math_SmoothStepToAngle(&shot->vec_2C.y, sp58, 1.0f, shot->unk_50, 0.0f); + Math_SmoothStepToAngle(&shot->vec_2C.x, sp5C, 1.0f, shot->unk_50, 0.0f); shot->unk_64 = 30; } else { shot->unk_60 = 1; @@ -2147,8 +2147,8 @@ void func_beam_8003CF90(PlayerShot* shot) { Vec3f sp44; Vec3f sp38; - shot->obj.rot.y = shot->unk_30; - shot->obj.rot.x = shot->unk_2C; + shot->obj.rot.y = shot->vec_2C.y; + shot->obj.rot.x = shot->vec_2C.x; Matrix_RotateY(gCalcMatrix, shot->obj.rot.y * M_DTOR, MTXF_NEW); Matrix_RotateX(gCalcMatrix, shot->obj.rot.x * M_DTOR, MTXF_APPLY); sp44.x = sp44.y = 0.0f; @@ -2203,11 +2203,11 @@ void func_beam_8003D54C(PlayerShot* shot, s32 index) { func_beam_8003BACC(shot); break; case PLAYERSHOT_8: - if (shot->unk_44 > 1.5f) { + if (shot->scale > 1.5f) { func_beam_8003C4D0(shot, 30); if (shot->bonus != 0) { if (gVersusMode) { - D_ctx_80177C30[shot->playerNum] += shot->bonus; + gPlayerScores[shot->playerNum] += shot->bonus; } else { bonus = shot->bonus; if (shot->bonus > 10) { diff --git a/src/engine/fox_bg.c b/src/engine/fox_bg.c index 42ad1a40..9f8e5119 100644 --- a/src/engine/fox_bg.c +++ b/src/engine/fox_bg.c @@ -414,7 +414,7 @@ void Background_DrawBackdrop(void) { break; case LEVEL_AQUAS: if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) { - sp13C = ((Math_RadToDeg(gPlayer[gPlayerNum].camYaw) - gPlayer[gPlayerNum].unk_114)); + sp13C = Math_RadToDeg(gPlayer[gPlayerNum].camYaw) - gPlayer[gPlayerNum].yRot_114; sp134 = (gPlayer[gPlayerNum].camPitch * -7000.0f) - (gPlayer[gPlayerNum].cam.eye.y * 0.6f); sp13C = Math_ModF(sp13C * -40.44444f * 2.0f, 7280.0f); // close to 7280.0f / 180.0f RCP_SetupDL_17(); @@ -449,16 +449,16 @@ void Background_DrawBackdrop(void) { case LEVEL_ZONESS: case LEVEL_MACBETH: case LEVEL_TITANIA: - sp12C = Math_RadToDeg(gPlayer[gPlayerNum].camYaw) - gPlayer[gPlayerNum].unk_114; + sp12C = Math_RadToDeg(gPlayer[gPlayerNum].camYaw) - gPlayer[gPlayerNum].yRot_114; sp134 = (gPlayer[gPlayerNum].camPitch * -7000.0f) - (gPlayer[gPlayerNum].cam.eye.y * 0.6f); sp13C = sp12C * -40.44444f * 2.0f; // close to 7280.0f / 180.0f if ((gCurrentLevel == LEVEL_TITANIA) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && - (gPlayer[0].unk_1D0 < 3)) { + (gPlayer[0].csState < 3)) { D_bg_8015F968 += __sinf(gPlayer[0].camYaw) * 20.0f; sp13C += D_bg_8015F968; } if ((gCurrentLevel == LEVEL_SOLAR) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && - (gPlayer[0].unk_1D0 >= 2) && (gPlayer[0].cam.eye.z <= -1900.0f)) { + (gPlayer[0].csState >= 2) && (gPlayer[0].cam.eye.z <= -1900.0f)) { D_bg_8015F968 = __sinf(gPlayer[0].camPitch) * 7000.0f; sp134 -= fabsf(D_bg_8015F968); } @@ -527,7 +527,7 @@ void Background_DrawBackdrop(void) { sp138 = Math_ModF(sp138 - 34.5f, 480.0f); sp134 = Math_ModF(sp134 + 19.0f, 360.0f); } else if (levelId == LEVEL_BOLSE) { - if ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE) || (gPlayer[0].unk_1D0 < 10)) { + if ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE) || (gPlayer[0].csState < 10)) { sp134 = Math_ModF(sp134 + 360.0f - 100.0f, 360.0f); } } else { @@ -565,7 +565,7 @@ void Background_DrawBackdrop(void) { Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ME_600DDF0); - } else if (D_ctx_80177D20 > 185668.0f) { + } else if (gPathProgress > 185668.0f) { Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f) - 130.0f, -290.0f, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 0.4f, 0.4f, 1.0f, MTXF_APPLY); @@ -593,7 +593,7 @@ void Background_DrawBackdrop(void) { break; case LEVEL_AREA_6: case LEVEL_UNK_4: - sp128 = (D_ctx_80177D20 * 0.00004f) + 0.5f; + sp128 = (gPathProgress * 0.00004f) + 0.5f; if (sp128 > 3.5f) { sp128 = 3.5f; } @@ -712,7 +712,7 @@ void Background_DrawSun(void) { if (gCurrentLevel == LEVEL_KATINA) { gSunViewY -= 80.0f; } - if ((gCurrentLevel == LEVEL_ZONESS) && (gPlayer[0].unk_1D0 >= 2) && !gMissedZoSearchlight) { + if ((gCurrentLevel == LEVEL_ZONESS) && (gPlayer[0].csState >= 2) && !gMissedZoSearchlight) { gSunViewY -= 60.0f; gSunViewX -= 480.0f; } @@ -834,7 +834,7 @@ void Background_DrawGround(void) { } if (gGroundType == 7) { sp1D4 = 0.0f; - gPlayer[gPlayerNum].unk_0AC = 0.0f; + gPlayer[gPlayerNum].xPath = 0.0f; } if (gLevelMode == LEVELMODE_ALL_RANGE) { @@ -844,7 +844,7 @@ void Background_DrawGround(void) { f32 temp_fa0; sp1D4 = 0.0f; - gPlayer[gPlayerNum].unk_0AC = 0.0f; + gPlayer[gPlayerNum].xPath = 0.0f; sp1B4.x = 0; sp1B4.y = 0; @@ -854,16 +854,16 @@ void Background_DrawGround(void) { temp_fv1 = gPlayer[gPlayerNum].cam.eye.x + sp1A8.x; temp_fa0 = gPlayer[gPlayerNum].cam.eye.z + sp1A8.z; if (temp_fv1 > 6000.0f) { - gPlayer[gPlayerNum].unk_0AC = 12000.0f; + gPlayer[gPlayerNum].xPath = 12000.0f; } if (temp_fv1 > 18000.0f) { - gPlayer[gPlayerNum].unk_0AC = 24000.0f; + gPlayer[gPlayerNum].xPath = 24000.0f; } if (temp_fv1 < -6000.0f) { - gPlayer[gPlayerNum].unk_0AC = -12000.0f; + gPlayer[gPlayerNum].xPath = -12000.0f; } if (temp_fv1 < -18000.0f) { - gPlayer[gPlayerNum].unk_0AC = -24000.0f; + gPlayer[gPlayerNum].xPath = -24000.0f; } if (temp_fa0 > 6000.0f) { sp1D4 = 12000.0f; @@ -879,7 +879,7 @@ void Background_DrawGround(void) { } } Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, gPlayer[gPlayerNum].unk_0AC, -3.0f + gCameraShakeY, sp1D4, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, gPlayer[gPlayerNum].xPath, -3.0f + gCameraShakeY, sp1D4, MTXF_APPLY); if (D_ctx_80177C70 == 2) { Matrix_Scale(gGfxMatrix, 1.2f, 1.2f, 1.0f, MTXF_APPLY); } @@ -893,8 +893,8 @@ void Background_DrawGround(void) { } if (gLevelMode == LEVELMODE_ON_RAILS) { gDPSetTextureImage(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, SEGMENTED_TO_VIRTUAL(D_CO_601B6C0)); - temp_s0 = fabsf(Math_ModF(2.0f * (D_ctx_80177CE8 * 0.2133333f), 128.0f)); // 0.64f / 3.0f - temp_fv0 = Math_ModF((10000.0f - gPlayer[gPlayerNum].unk_0AC) * 0.32f, 128.0f); + temp_s0 = fabsf(Math_ModF(2.0f * (gPathTexScroll * 0.2133333f), 128.0f)); // 0.64f / 3.0f + temp_fv0 = Math_ModF((10000.0f - gPlayer[gPlayerNum].xPath) * 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 (gGroundSurface) { @@ -955,8 +955,8 @@ void Background_DrawGround(void) { break; } gDPSetTextureImage(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sp1C4); - temp_s0 = fabsf(Math_ModF(2.0f * (D_ctx_80177CE8 * 0.2133333f), 128.0f)); - temp_fv0 = Math_ModF((10000.0f - gPlayer[gPlayerNum].unk_0AC) * 0.32f, 128.0f); + temp_s0 = fabsf(Math_ModF(2.0f * (gPathTexScroll * 0.2133333f), 128.0f)); + temp_fv0 = Math_ModF((10000.0f - gPlayer[gPlayerNum].xPath) * 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); Matrix_Push(&gGfxMatrix); @@ -975,18 +975,18 @@ void Background_DrawGround(void) { case LEVEL_TRAINING: RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); if (gLevelMode == LEVELMODE_ON_RAILS) { - if (D_ctx_80177CE8 > 290.0f) { - D_ctx_80177CE8 -= 290.0f; + if (gPathTexScroll > 290.0f) { + gPathTexScroll -= 290.0f; } Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -3000.0f + D_ctx_80177CE8, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -3000.0f + gPathTexScroll, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_TR_6005880); Matrix_Pop(&gGfxMatrix); if (1) {} Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 3000.0f + D_ctx_80177CE8, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 3000.0f + gPathTexScroll, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_TR_6005880); @@ -1011,8 +1011,8 @@ void Background_DrawGround(void) { gDPLoadTileTexture(gMasterDisp++, SEGMENTED_TO_VIRTUAL(D_AQ_600AB68), G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32); gDPSetTextureImage(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, SEGMENTED_TO_VIRTUAL(D_AQ_600AB68)); - temp_s0 = fabsf(Math_ModF(2.0f * (D_ctx_80177CE8 * 0.2133333f), 128.0f)); - temp_fv0 = Math_ModF((10000.0f - gPlayer[gPlayerNum].unk_0AC) * 0.32f, 128.0f); + temp_s0 = fabsf(Math_ModF(2.0f * (gPathTexScroll * 0.2133333f), 128.0f)); + temp_fv0 = Math_ModF((10000.0f - gPlayer[gPlayerNum].xPath) * 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); @@ -1033,8 +1033,8 @@ void Background_DrawGround(void) { gDPLoadTileTexture(gMasterDisp++, SEGMENTED_TO_VIRTUAL(D_AQ_602ACC0), G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32); gDPSetTextureImage(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, SEGMENTED_TO_VIRTUAL(D_AQ_602ACC0)); - temp_s0 = fabsf(Math_ModF(2.0f * (D_ctx_80177CE8 * 0.2133333f), 128.0f)); - temp_fv0 = Math_ModF((10000.0f - gPlayer[gPlayerNum].unk_0AC) * 0.32f, 128.0f); + temp_s0 = fabsf(Math_ModF(2.0f * (gPathTexScroll * 0.2133333f), 128.0f)); + temp_fv0 = Math_ModF((10000.0f - gPlayer[gPlayerNum].xPath) * 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); if (gAqDrawMode != 0) { @@ -1042,7 +1042,7 @@ void Background_DrawGround(void) { } else { RCP_SetupDL(&gMasterDisp, 0x25); } - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && (gPlayer[0].unk_1D0 < 2)) { + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && (gPlayer[0].csState < 2)) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); } else if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, D_bg_8015F974, D_bg_8015F978, D_bg_8015F97C, diff --git a/src/engine/fox_boss.c b/src/engine/fox_boss.c index 5b8e7a97..6dfc39c3 100644 --- a/src/engine/fox_boss.c +++ b/src/engine/fox_boss.c @@ -96,7 +96,7 @@ void Boss_SpawnActor189(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 ar } void func_boss_80043188(Boss* boss) { - boss->info.unk_10 = 30000.0f; + boss->info.cullDistance = 30000.0f; } void Boss_CompleteLevel(Player* player, f32 xPos, f32 yPos, f32 zPos) { @@ -104,17 +104,17 @@ void Boss_CompleteLevel(Player* player, f32 xPos, f32 yPos, f32 zPos) { SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 80); gCsFrameCount = 0; - D_ctx_80178448 = zPos + D_ctx_80177D20; + D_ctx_80178448 = zPos + gPathProgress; D_ctx_80178440 = xPos; D_ctx_80178444 = yPos; player->state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; - player->unk_1D0 = 10; - player->timer_1F8 = 50; - player->timer_1FC = 50; + player->csState = 10; + player->csTimer = 50; + player->csEventTimer = 50; player->unk_000 = 0.0f; player->unk_004 = 1.0f; - if (player->pos.x < player->unk_0AC) { + if (player->pos.x < player->xPath) { player->unk_004 = -1.0f; } gPlayer[0].vel.x = 0.0f; diff --git a/src/engine/fox_context.c b/src/engine/fox_context.c index 8a587074..d36ff39a 100644 --- a/src/engine/fox_context.c +++ b/src/engine/fox_context.c @@ -25,8 +25,8 @@ s32 gTeamDamage[6]; u8 gMissionStatus; // next planet path f32 gGroundHeight; f32 D_ctx_80177950; -f32 D_ctx_80177968; -f32 D_ctx_80177970; +f32 gPlayerTurnRate; +f32 gPlayerTurnStickMod; f32 gCsCamEyeX; f32 gCsCamEyeY; f32 gCsCamEyeZ; @@ -63,13 +63,13 @@ u16 gBgmSeqId; u8 gLevelType; s32 gSavedObjectLoadIndex; UNK_TYPE F_80177CA8; -f32 D_ctx_80177CB0; +f32 gSavedPathProgress; UNK_TYPE F_80177CB8; f32 gWaterLevel; -f32 D_ctx_80177CC8; -f32 D_ctx_80177CE8; -f32 D_ctx_80177D08; -f32 D_ctx_80177D20; +f32 gPathGroundScroll; +f32 gPathTexScroll; +f32 gPathVelZ; +f32 gPathProgress; f32 gRadioPortraitScaleY; f32 gRadioTextBoxScaleY; f32 gRadioMsgRadioId; @@ -252,7 +252,7 @@ s32 gHitCount; s32 gSavedHitCount; s16 gLifeCount[4]; LaserStrength gLaserStrength[4]; -s32 D_ctx_80161AB8; +s32 gCullObjects; UNK_TYPE F_80161AC0[4]; UNK_TYPE F_80161AD0[4]; UNK_TYPE F_80161AE0[4]; @@ -303,13 +303,13 @@ s32 D_ctx_80177990[4]; // these two are also rumble related f32 D_ctx_801779A8[4]; u8 gPauseEnabled; s32 gChargeTimers[4]; -f32 D_ctx_801779E4; -f32 D_ctx_801779F4; -s32 D_Timer_80177A00[4]; -s32 D_Timer_80177A38[4]; -s32 D_Timer_80177A70[4]; -s32 D_Timer_80177A88[4]; -f32 D_ctx_80177AA0[4]; +f32 gPathVelX; +f32 gPathVelY; +s32 gUturnDownTimers[4]; +s32 gUturnBrakeTimers[4]; +s32 gLoopDownTimers[4]; +s32 gLoopBoostTimers[4]; +f32 gMuzzleFlashScale[4]; f32 gShieldAlpha[4]; s32 gHasShield[4]; s32 gShieldTimer[4]; @@ -320,12 +320,12 @@ u8 gCoUturnCount; u8 gGreatFoxIntact; u8 gTiStartLandmaster; u16 gControllerRumbleTimers[4]; -u16 D_ctx_80177C30[4]; +u16 gPlayerScores[4]; s32 D_ctx_80177C50; -s32 D_ctx_80177C70; -s32 D_ctx_80177C78; -s32 D_ctx_80177C8C; -s32 D_ctx_80177C94; +s32 D_ctx_80177C70; // sets camera field of view Y. initialized to 0 and never changed +s32 gTraining360MsgTimer; +s32 gTraining360MsgIndex; +s32 D_ctx_80177C94; // these save player parameters across the Venom -> Andross transition s32 D_ctx_80177C9C; s32 D_ctx_80177CA4; s32 D_ctx_80177CAC; diff --git a/src/engine/fox_demo.c b/src/engine/fox_demo.c index 383a698e..21467000 100644 --- a/src/engine/fox_demo.c +++ b/src/engine/fox_demo.c @@ -165,10 +165,10 @@ void func_demo_80048AC0(TeamId teamId) { void func_demo_80048CC4(Actor* actor, s32 arg1) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = D_demo_800C9F60[arg1].x + gPlayer[0].pos.x; actor->obj.pos.y = D_demo_800C9F60[arg1].y + gPlayer[0].pos.y; - actor->obj.pos.z = D_demo_800C9F60[arg1].z + gPlayer[0].unk_138; + actor->obj.pos.z = D_demo_800C9F60[arg1].z + gPlayer[0].trueZpos; actor->unk_0F4.y = 0.0f; actor->unk_0F4.z = D_demo_800C9F90[arg1]; Object_SetInfo(&actor->info, actor->obj.id); @@ -192,21 +192,21 @@ void Cutscene_WarpZoneComplete(Player* player) { s32 temp_v1; gBosses[1].obj.status = OBJ_FREE; - Math_SmoothStepToF(&player->unk_130, 0.0f, 0.1f, 15.0f, 0.0f); - Math_SmoothStepToF(&player->unk_12C, 0.0f, 0.1f, 15.0f, 0.0f); - Math_SmoothStepToF(&player->unk_0E4, 0.0f, 0.1f, 3.0f, 0.0f); - Math_SmoothStepToF(&player->unk_0E8, 0.0f, 0.1f, 3.0f, 0.0f); - Math_SmoothStepToF(&player->unk_0EC, 0.0f, 0.1f, 3.0f, 0.0f); - Math_SmoothStepToF(&player->unk_08C, 0.0f, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToF(&player->zRotBarrelRoll, 0.0f, 0.1f, 15.0f, 0.0f); + Math_SmoothStepToF(&player->zRotBank, 0.0f, 0.1f, 15.0f, 0.0f); + Math_SmoothStepToF(&player->rot.x, 0.0f, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToF(&player->rot.y, 0.0f, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToF(&player->rot.z, 0.0f, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToF(&player->camDist, 0.0f, 0.1f, 3.0f, 0.0f); Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 3.0f, 0.0f); - Math_SmoothStepToAngle(&player->unk_4D8, 0.0f, 0.1f, 20.0f, 0.0f); + Math_SmoothStepToAngle(&player->aerobaticPitch, 0.0f, 0.1f, 20.0f, 0.0f); Math_SmoothStepToF(&player->boostSpeed, 0.0f, 0.1f, 3.0f, 0.0f); - switch (player->unk_1D0) { + switch (player->csState) { case 0: player->somersault = false; Audio_StopSfxByBankAndSource(1, player->sfxSource); - player->unk_1D0++; + player->csState++; D_ctx_80177A48[0] = 0.0f; D_ctx_80177A48[1] = 0.0f; D_ctx_80177A48[2] = 0.0f; @@ -226,7 +226,7 @@ void Cutscene_WarpZoneComplete(Player* player) { Matrix_MultVec3f(gCalcMatrix, &sp5C, &sp50); gCsCamAtX = player->pos.x; gCsCamAtY = player->pos.y; - gCsCamAtZ = player->unk_138 + D_ctx_80177D20; + gCsCamAtZ = player->trueZpos + gPathProgress; switch (gCsFrameCount) { case 101: @@ -276,7 +276,7 @@ void Cutscene_WarpZoneComplete(Player* player) { if (gCsFrameCount > 450) { Math_SmoothStepToF(&D_ctx_80177A48[0], 1.0f, 0.1f, 0.004f, 0.0f); player->baseSpeed += 2.0f; - player->unk_0E4 += 0.1f; + player->rot.x += 0.1f; player->unk_190 = 2.0f; if (gCsFrameCount == 530) { @@ -289,7 +289,7 @@ void Cutscene_WarpZoneComplete(Player* player) { gFillScreenAlphaStep = 8; if (gFillScreenAlpha == 255) { player->state_1C8 = PLAYERSTATE_1C8_NEXT; - player->timer_1F8 = 0; + player->csTimer = 0; gFadeoutType = 4; if (gCurrentLevel == LEVEL_METEO) { gLeveLClearStatus[LEVEL_METEO] = Play_CheckMedalStatus(200) + 1; @@ -302,7 +302,7 @@ void Cutscene_WarpZoneComplete(Player* player) { } else { gCsCamEyeX = player->pos.x + sp50.x; gCsCamEyeY = player->pos.y + sp50.y; - gCsCamEyeZ = player->unk_138 + D_ctx_80177D20 + sp50.z; + gCsCamEyeZ = player->trueZpos + gPathProgress + sp50.z; } break; @@ -314,8 +314,8 @@ void Cutscene_WarpZoneComplete(Player* player) { Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0); Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0); Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0); - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -((player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->rot.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->rot.x + player->aerobaticPitch) * M_DTOR), MTXF_APPLY); sp5C.x = 0.0f; sp5C.y = 0.0f; @@ -330,78 +330,78 @@ void Cutscene_WarpZoneComplete(Player* player) { player->pos.y += player->vel.y; player->pos.z += player->vel.z; - player->unk_138 = player->pos.z + player->unk_08C; - player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; - player->unk_088 += 10.0f; - player->unk_080 = (-SIN_DEG(player->unk_088)) * 0.3f; - player->unk_0F4 += 8.0f; - player->unk_0F0 = SIN_DEG(player->unk_0F4); + player->trueZpos = player->pos.z + player->camDist; + player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll; + player->bobPhase += 10.0f; + player->yBob = (-SIN_DEG(player->bobPhase)) * 0.3f; + player->rockPhase += 8.0f; + player->rockAngle = SIN_DEG(player->rockPhase); } -void func_demo_80049630(Actor* actor) { +void func_demo_80049630(ActorCutscene* this) { Vec3f sp3C; Vec3f sp30; - switch (actor->state) { + switch (this->state) { case 0: - actor->vwork[0].x = gPlayer[0].pos.x + D_demo_800C9FA0[actor->index].x; - actor->vwork[0].y = gPlayer[0].pos.y + D_demo_800C9FA0[actor->index].y; - actor->vwork[0].z = gPlayer[0].pos.z + D_demo_800C9FA0[actor->index].z; - Math_SmoothStepToF(&actor->obj.pos.x, actor->vwork[0].x, 0.05f, 50.0f, 0.0001f); - Math_SmoothStepToF(&actor->obj.pos.y, actor->vwork[0].y, 0.05f, 50.0f, 0.0001f); - Math_SmoothStepToF(&actor->obj.pos.z, actor->vwork[0].z, 0.05f, 50.0f, 0.0001f); - Math_SmoothStepToF(&actor->unk_0F4.x, gPlayer[0].unk_0E4, 0.1f, 2.0f, 0.0001f); - Math_SmoothStepToF(&actor->unk_0F4.y, gPlayer[0].unk_0E8, 0.1f, 2.0f, 0.0001f); - Math_SmoothStepToF(&actor->unk_0F4.z, 0.0f, 0.05f, 0.2f, 0.0001f); + this->vwork[0].x = gPlayer[0].pos.x + D_demo_800C9FA0[this->index].x; + this->vwork[0].y = gPlayer[0].pos.y + D_demo_800C9FA0[this->index].y; + this->vwork[0].z = gPlayer[0].pos.z + D_demo_800C9FA0[this->index].z; + Math_SmoothStepToF(&this->obj.pos.x, this->vwork[0].x, 0.05f, 50.0f, 0.0001f); + Math_SmoothStepToF(&this->obj.pos.y, this->vwork[0].y, 0.05f, 50.0f, 0.0001f); + Math_SmoothStepToF(&this->obj.pos.z, this->vwork[0].z, 0.05f, 50.0f, 0.0001f); + Math_SmoothStepToF(&this->unk_0F4.x, gPlayer[0].rot.x, 0.1f, 2.0f, 0.0001f); + Math_SmoothStepToF(&this->unk_0F4.y, gPlayer[0].rot.y, 0.1f, 2.0f, 0.0001f); + Math_SmoothStepToF(&this->unk_0F4.z, 0.0f, 0.05f, 0.2f, 0.0001f); break; case 1: - actor->state = 2; - AUDIO_PLAY_SFX(0x09000002, actor->sfxSource, 0); - actor->timer_0BC = 150; - actor->fwork[29] = 5.0f; + this->state = 2; + AUDIO_PLAY_SFX(0x09000002, this->sfxSource, 0); + this->timer_0BC = 150; + this->fwork[29] = 5.0f; case 2: - actor->iwork[11] = 2; - actor->fwork[0] += 2.0f; - if (actor->timer_0BC == 0) { - Object_Kill(&actor->obj, actor->sfxSource); + this->iwork[11] = 2; + this->fwork[0] += 2.0f; + if (this->timer_0BC == 0) { + Object_Kill(&this->obj, this->sfxSource); } break; } - Matrix_RotateY(gCalcMatrix, (actor->unk_0F4.y + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -(actor->unk_0F4.x * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (this->unk_0F4.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(this->unk_0F4.x * M_DTOR), MTXF_APPLY); sp3C.x = 0.0f; sp3C.y = 0.0f; - sp3C.z = actor->fwork[0]; + sp3C.z = this->fwork[0]; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp3C, &sp30); - actor->vel.x = sp30.x; - actor->vel.y = sp30.y; - actor->vel.z = sp30.z; + this->vel.x = sp30.x; + this->vel.y = sp30.y; + this->vel.z = sp30.z; - actor->obj.rot.x = -actor->unk_0F4.x; - actor->obj.rot.y = actor->unk_0F4.y + 180.0f; - actor->obj.rot.z = -actor->unk_0F4.z; + this->obj.rot.x = -this->unk_0F4.x; + this->obj.rot.y = this->unk_0F4.y + 180.0f; + this->obj.rot.z = -this->unk_0F4.z; } void func_demo_8004990C(Player* player) { if (gGroundType == 0) { - D_ctx_80177CE8 += 60.0f; + gPathTexScroll += 60.0f; } - player->unk_138 = player->pos.z + player->unk_08C; - player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; + player->trueZpos = player->pos.z + player->camDist; + player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll; } void func_demo_80049968(Actor* actor, s32 arg1) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = D_demo_800C9FD0[arg1]; actor->obj.pos.y = D_demo_800C9FE0[arg1]; - actor->obj.pos.z = D_demo_800C9FF0[arg1] + ((void) 0, gPlayer)[0].unk_138; + actor->obj.pos.z = D_demo_800C9FF0[arg1] + ((void) 0, gPlayer)[0].trueZpos; actor->fwork[0] = D_demo_800CA000[arg1]; actor->fwork[1] = D_demo_800CA010[arg1]; actor->unk_0B6 = D_demo_800CA030[arg1]; @@ -438,7 +438,7 @@ void func_demo_80049B44(void) { if (gEffects[i].obj.status == OBJ_FREE) { x = RAND_FLOAT_CENTERED(400.0f); y = RAND_FLOAT_CENTERED(400.0f); - z = -D_ctx_80177D20 - 500.0f - RAND_FLOAT(500.0f); + z = -gPathProgress - 500.0f - RAND_FLOAT(500.0f); func_demo_80049A9C(&gEffects[i], x, y, z); break; } @@ -457,34 +457,34 @@ void Cutscene_EnterWarpZone(Player* player) { func_demo_8004990C(player); - player->unk_140 = -player->vel.z; - player->unk_144 += -player->vel.z; - D_ctx_80177D20 = player->unk_144; + player->zPathVel = -player->vel.z; + player->zPath += -player->vel.z; + gPathProgress = player->zPath; - Math_SmoothStepToF(&player->unk_130, 0.0f, 0.1f, 15.0f, 0.0f); - Math_SmoothStepToF(&player->unk_12C, 0.0f, 0.1f, 15.0f, 0.0f); - Math_SmoothStepToF(&player->unk_0EC, 0.0f, 0.1f, 5.0f, 0.0f); - Math_SmoothStepToF(&player->unk_0E4, 0.0f, 0.1f, 5.0f, 0.0f); - Math_SmoothStepToF(&player->unk_0E8, 0.0f, 0.1f, 5.0f, 0.0f); + Math_SmoothStepToF(&player->zRotBarrelRoll, 0.0f, 0.1f, 15.0f, 0.0f); + Math_SmoothStepToF(&player->zRotBank, 0.0f, 0.1f, 15.0f, 0.0f); + Math_SmoothStepToF(&player->rot.z, 0.0f, 0.1f, 5.0f, 0.0f); + Math_SmoothStepToF(&player->rot.x, 0.0f, 0.1f, 5.0f, 0.0f); + Math_SmoothStepToF(&player->rot.y, 0.0f, 0.1f, 5.0f, 0.0f); Math_SmoothStepToF(&player->pos.x, 0.0f, 0.1f, 50.0f, 0.0f); Math_SmoothStepToF(&player->pos.y, 0.0f, 0.1f, 50.0f, 0.0f); Math_SmoothStepToF(&player->cam.eye.x, 0.0f, 0.1f, 50.0f, 0.0f); Math_SmoothStepToF(&player->cam.eye.y, 0.0f, 0.1f, 50.0f, 0.0f); Math_SmoothStepToF(&player->cam.at.x, 0.0f, 0.1f, 50.0f, 0.0f); Math_SmoothStepToF(&player->cam.at.y, 0.0f, 0.1f, 50.0f, 0.0f); - Math_SmoothStepToAngle(&player->unk_4D8, 0.0f, 0.1f, 20.0f, 0.0f); + Math_SmoothStepToAngle(&player->aerobaticPitch, 0.0f, 0.1f, 20.0f, 0.0f); - switch (player->unk_1D0) { + switch (player->csState) { case 0: player->somersault = false; gStarWarpDistortion = 100.0f; - player->unk_1D0 = 1; + player->csState = 1; gStarCount = 1; gLoadLevelObjects = 0; player->vel.x = 0.0f; player->vel.y = 0.0f; player->vel.z = -500.0f; - player->unk_0CC = -500.0f; + player->warpCamSpeed = -500.0f; if (gTeamShields[TEAM_ID_FALCO] > 0) { func_demo_80049968(&gActors[0], 0); @@ -497,19 +497,19 @@ void Cutscene_EnterWarpZone(Player* player) { } func_demo_80049968(&gActors[3], 3); - player->timer_1F8 = 50; + player->csTimer = 50; break; case 1: Math_SmoothStepToF(&D_ctx_801779A8[player->num], 100.0f, 1.0f, 4.0f, 0.0f); Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 3.0f, 0.0f); gStarWarpDistortion *= 1.05f; - if (player->timer_1F8 == 0) { - player->unk_1D0 = 2; - player->timer_1F8 = 150; + if (player->csTimer == 0) { + player->csState = 2; + player->csTimer = 150; } player->unk_190 = 2.0f; - player->unk_08C -= 2.0f; + player->camDist -= 2.0f; gBlurAlpha = 128; break; @@ -519,71 +519,71 @@ void Cutscene_EnterWarpZone(Player* player) { gStarWarpDistortion *= 1.01f; } - if (player->timer_1F8 <= 100) { - if (player->timer_1F8 == 100) { + if (player->csTimer <= 100) { + if (player->csTimer == 100) { func_play_800A6028(player->sfxSource, 0x0940802A); player->unk_194 = 5.0f; player->unk_190 = 5.0f; } - player->unk_08C += player->unk_0CC; - player->unk_0CC -= 100.0f; + player->camDist += player->warpCamSpeed; + player->warpCamSpeed -= 100.0f; - if (player->unk_08C < -15000.0f) { - player->unk_08C = 0.0f; - player->unk_0CC = 0.0f; + if (player->camDist < -15000.0f) { + player->camDist = 0.0f; + player->warpCamSpeed = 0.0f; player->unk_234 = 0; } } var_v0 = 1; player->unk_190 = 2.0f; - if ((player->timer_1F8 == 95) && (gTeamShields[TEAM_ID_FALCO] > 0)) { + if ((player->csTimer == 95) && (gTeamShields[TEAM_ID_FALCO] > 0)) { gActors[0].state = var_v0; AUDIO_PLAY_SFX(0x0940802A, gActors[0].sfxSource, 0); } - if ((player->timer_1F8 == 90) && (gTeamShields[TEAM_ID_PEPPY] > 0)) { + if ((player->csTimer == 90) && (gTeamShields[TEAM_ID_PEPPY] > 0)) { gActors[2].state = var_v0; AUDIO_PLAY_SFX(0x0940802A, gActors[2].sfxSource, 0); } - if ((player->timer_1F8 == 85) && (gTeamShields[TEAM_ID_SLIPPY] > 0)) { + if ((player->csTimer == 85) && (gTeamShields[TEAM_ID_SLIPPY] > 0)) { gActors[1].state = var_v0; AUDIO_PLAY_SFX(0x0940802A, gActors[1].sfxSource, 0); } - if (player->timer_1F8 == 60) { + if (player->csTimer == 60) { gActors[3].state = var_v0; AUDIO_PLAY_SFX(0x0940802A, gActors[3].sfxSource, 0); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 50); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50); } - if (player->timer_1F8 == 50) { - player->unk_1D0 = 4; - player->timer_1F8 = 0; + if (player->csTimer == 50) { + player->csState = 4; + player->csTimer = 0; } break; case 4: Math_SmoothStepToF(&D_ctx_801779A8[player->num], 100.0f, 1.0f, 3.0f, 0.0f); player->camRoll -= 0.5f; - if (player->timer_1F8 == 0) { + if (player->csTimer == 0) { gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; gFillScreenAlphaTarget = 255; gFillScreenAlphaStep = 8; if (gFillScreenAlpha == 255) { Play_ClearObjectData(); - player->unk_1D0 = 5; - 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->camRoll = player->unk_138 = - player->vel.z = player->unk_144 = D_ctx_80177D20 = player->unk_144 = D_ctx_80177CB0 = - D_ctx_80177D20 = 0.0f; + player->csState = 5; + player->csTimer = 10; + player->camDist = -10000.0f; + player->xPath = player->xPathTarget = player->yPath = player->yPathTarget = player->pos.x = + player->pos.y = player->pos.z = player->zRotBarrelRoll = player->camRoll = player->trueZpos = + player->vel.z = player->zPath = gPathProgress = player->zPath = gSavedPathProgress = + gPathProgress = 0.0f; - player->timer_27C = gSavedHitCount = gObjectLoadIndex = gSavedObjectLoadIndex = 0; + player->meteoWarpTimer = gSavedHitCount = gObjectLoadIndex = gSavedObjectLoadIndex = 0; player->unk_234 = 1; gLevelPhase = 1; @@ -596,31 +596,31 @@ void Cutscene_EnterWarpZone(Player* player) { case 5: Math_SmoothStepToF(&D_ctx_801779A8[player->num], 100.0f, 1.0f, 3.0f, 0.0f); - if (player->timer_1F8 == 0) { + if (player->csTimer == 0) { gFillScreenAlphaTarget = 0; gFillScreenAlphaStep = 8; if (gFillScreenAlpha == 0) { - player->unk_1D0 = 6; - player->timer_1F8 = 50; + player->csState = 6; + player->csTimer = 50; } } break; case 6: Math_SmoothStepToF(&gStarWarpDistortion, 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 < 30) { + Math_SmoothStepToF(&player->camDist, 0.0f, 0.2f, 500.0f, 0.1f); + if (player->csTimer < 30) { for (var_v0 = 0; var_v0 < 3; var_v0++) { func_demo_80049B44(); } } - if (player->timer_1F8 == 30) { + if (player->csTimer == 30) { gStarCount = 300; AUDIO_PLAY_BGM(SEQ_ID_WARP_ZONE | SEQ_FLAG); } - if (player->timer_1F8 == 0) { + if (player->csTimer == 0) { gWarpZoneBgAlpha = 0.0f; gStarWarpDistortion = 0.0f; player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; @@ -724,7 +724,7 @@ void Cutscene_LevelStart(Player* player) { void func_demo_8004A700(Actor* actor, s32 arg1) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = gPlayer[0].pos.x; actor->obj.pos.y = gPlayer[0].pos.y - 1000.0f; actor->obj.pos.z = gPlayer[0].pos.z; @@ -748,8 +748,8 @@ void func_demo_8004A888(Effect* effect) { Vec3f sp2C; Vec3f sp20; - Matrix_RotateY(gCalcMatrix, (gPlayer[0].unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -(gPlayer[0].unk_0E4 * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (gPlayer[0].rot.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(gPlayer[0].rot.x * M_DTOR), MTXF_APPLY); Effect_Initialize(effect); effect->obj.status = OBJ_INIT; @@ -808,7 +808,7 @@ void Cutscene_AllRangeMode(Player* player) { s32 pad2; gCsFrameCount += 1; - Math_SmoothStepToAngle(&player->unk_4D8, 0.0f, 0.1f, 20.0f, 0.0f); + Math_SmoothStepToAngle(&player->aerobaticPitch, 0.0f, 0.1f, 20.0f, 0.0f); if (gCsFrameCount == 37) { gChangeTo360 = true; if (gCurrentLevel == LEVEL_VENOM_ANDROSS) { @@ -828,15 +828,15 @@ void Cutscene_AllRangeMode(Player* player) { player->wings.unk_0C = 0.0f; player->wings.unk_04 = 0.0f; - Math_SmoothStepToF(&player->unk_0E4, 0.0f, 0.1f, 5.0f, 0.0f); - Math_SmoothStepToF(&player->unk_0E8, 0.0f, 0.1f, 5.0f, 0.0f); - Math_SmoothStepToF(&player->unk_0EC, 0.0f, 0.1f, 1.0f, 0.0f); - Math_SmoothStepToF(&player->unk_12C, 0.0f, 0.1f, 5.0f, 0.0f); + Math_SmoothStepToF(&player->rot.x, 0.0f, 0.1f, 5.0f, 0.0f); + Math_SmoothStepToF(&player->rot.y, 0.0f, 0.1f, 5.0f, 0.0f); + Math_SmoothStepToF(&player->rot.z, 0.0f, 0.1f, 1.0f, 0.0f); + Math_SmoothStepToF(&player->zRotBank, 0.0f, 0.1f, 5.0f, 0.0f); Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 3.0f, 0.0f); Math_SmoothStepToF(&player->boostSpeed, 0.0f, 0.1f, 3.0f, 0.0f); - Math_SmoothStepToF(&player->unk_08C, 0.0f, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToF(&player->camDist, 0.0f, 0.1f, 3.0f, 0.0f); - switch (player->unk_1D0) { + switch (player->csState) { case 0: Audio_PlayVoice(0); D_ctx_80177A48[0] = 0.005f; @@ -844,7 +844,7 @@ void Cutscene_AllRangeMode(Player* player) { D_ctx_80177A48[2] = 60.0f; D_ctx_80177A48[3] = 0.0f; player->wings.modelId = 1; - player->unk_1D0++; + player->csState++; gCsFrameCount = 0; /* fallthrough */ case 1: @@ -891,7 +891,7 @@ void Cutscene_AllRangeMode(Player* player) { 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; + actor->obj.pos.z = player->trueZpos - 1000.0f; actor->unk_0F4.y = 180.0f; Object_SetInfo(&actor->info, actor->obj.id); } @@ -913,15 +913,15 @@ void Cutscene_AllRangeMode(Player* player) { Math_SmoothStepToF(&D_ctx_80177A48[0], 0.1f, 1.0f, 0.005f, 0.0f); Math_SmoothStepToF(&player->cam.eye.x, player->pos.x + sp64.x, D_ctx_80177A48[0], 500.0f, 0.0f); Math_SmoothStepToF(&player->cam.eye.y, player->pos.y + sp64.y, D_ctx_80177A48[0], 500.0f, 0.0f); - Math_SmoothStepToF(&player->cam.eye.z, player->unk_138 + D_ctx_80177D20 + sp64.z, D_ctx_80177A48[0], 500.0f, + Math_SmoothStepToF(&player->cam.eye.z, player->trueZpos + gPathProgress + sp64.z, D_ctx_80177A48[0], 500.0f, 0.0f); Math_SmoothStepToF(&player->cam.at.x, player->pos.x, D_ctx_80177A48[0], 500.0f, 0.0f); Math_SmoothStepToF(&player->cam.at.y, player->pos.y, D_ctx_80177A48[0], 500.0f, 0.0f); - Math_SmoothStepToF(&player->cam.at.z, player->unk_138 + D_ctx_80177D20, D_ctx_80177A48[0], 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.z, player->trueZpos + gPathProgress, D_ctx_80177A48[0], 500.0f, 0.0f); break; } - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->rot.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(player->rot.x * M_DTOR), MTXF_APPLY); sp70.x = 0.0f; sp70.y = 0.0f; @@ -935,15 +935,15 @@ void Cutscene_AllRangeMode(Player* player) { player->pos.x += player->vel.x; player->pos.y += player->vel.y; player->pos.z += player->vel.z; - player->unk_138 = player->pos.z + player->unk_08C; + player->trueZpos = player->pos.z + player->camDist; player->cam.at.z += player->vel.z; player->cam.eye.z += player->vel.z; - player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; - player->unk_088 += 10.0f; - player->unk_080 = -SIN_DEG(player->unk_088) * 0.3f; - player->unk_0F4 += 8.0f; - player->unk_0F0 = SIN_DEG(player->unk_0F4); + player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll; + player->bobPhase += 10.0f; + player->yBob = -SIN_DEG(player->bobPhase) * 0.3f; + player->rockPhase += 8.0f; + player->rockAngle = SIN_DEG(player->rockPhase); func_play_800AA800(player); } @@ -961,16 +961,16 @@ void Cutscene_CoComplete2(Player* player) { Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 5.0f, 0.01f); - switch (player->unk_1D0) { + switch (player->csState) { case 10: D_ctx_80177A48[2] = 0.0f; - player->unk_1D0++; + player->csState++; player->wings.unk_04 = 0.0f; player->wings.unk_0C = 0.0f; player->wings.unk_08 = 0.0f; player->wings.unk_10 = 0.0f; - player->unk_130 = 0.0f; - player->unk_12C = 0.0f; + player->zRotBarrelRoll = 0.0f; + player->zRotBank = 0.0f; player->boostSpeed = 0.0f; player->wings.modelId = 1; player->baseSpeed = 40.0f; @@ -978,44 +978,44 @@ void Cutscene_CoComplete2(Player* player) { case 11: D_ctx_80177A48[0] = 0.0f; - Math_SmoothStepToAngle(&player->unk_4D8, 0.0f, 1.0f, 5.0f, 0.0f); + Math_SmoothStepToAngle(&player->aerobaticPitch, 0.0f, 1.0f, 5.0f, 0.0f); player->cam.at.x += (D_ctx_80178440 - player->cam.at.x) * 0.01f; player->cam.at.y += (D_ctx_80178444 - player->cam.at.y) * 0.01f; player->cam.at.z += (D_ctx_80178448 - player->cam.at.z) * 0.01f; - player->cam.eye.x += ((player->cam.at.x + (500.0f * player->unk_004)) - player->cam.eye.x) * 0.01f; - player->cam.eye.y += ((player->cam.at.y + 500.0f) - player->cam.eye.y) * 0.01f; - player->cam.eye.z += ((D_ctx_80178448 + (2000.0f * D_ctx_80177950)) - player->cam.eye.z) * 0.01f; + player->cam.eye.x += (player->cam.at.x + (500.0f * player->unk_004) - player->cam.eye.x) * 0.01f; + player->cam.eye.y += (player->cam.at.y + 500.0f - player->cam.eye.y) * 0.01f; + player->cam.eye.z += (D_ctx_80178448 + (2000.0f * D_ctx_80177950) - player->cam.eye.z) * 0.01f; - if (player->timer_1FC > 25) { + if (player->csEventTimer > 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); + Math_SmoothStepToF(&player->rot.z, player->unk_004 * -450.0f * D_ctx_80177950, 0.2f, 20.0f, 0.1f); } else { D_ctx_80177A48[2] += 0.25f * player->unk_004; - if (player->unk_0EC < (-360.0f)) { - player->unk_0EC += 360.0f; + if (player->rot.z < (-360.0f)) { + player->rot.z += 360.0f; } - if (player->unk_0EC > 360.0f) { - player->unk_0EC -= 360.0f; + if (player->rot.z > 360.0f) { + player->rot.z -= 360.0f; } - Math_SmoothStepToF(&player->unk_0EC, (player->unk_004 * 20.0f) * D_ctx_80177950, 0.1f, 3.0f, 0.1f); + Math_SmoothStepToF(&player->rot.z, player->unk_004 * 20.0f * D_ctx_80177950, 0.1f, 3.0f, 0.1f); } if (D_ctx_80177950 > 0.0f) { - Math_SmoothStepToF(&player->unk_0E8, 0.0f, 0.1f, 3.0f, 0.1f); + Math_SmoothStepToF(&player->rot.y, 0.0f, 0.1f, 3.0f, 0.1f); } else { - Math_SmoothStepToF(&player->unk_0E8, 180.0f, 0.1f, 3.0f, 0.1f); + Math_SmoothStepToF(&player->rot.y, 180.0f, 0.1f, 3.0f, 0.1f); Math_SmoothStepToF(&player->pos.x, player->cam.eye.x, 1.0f, 30.0f, 0.0f); D_ctx_80177A48[2] = 0.0f; } player->pos.x += D_ctx_80177A48[2]; - Math_SmoothStepToF(&player->unk_0E4, 0.0f, 0.1f, 3.0f, 0.1f); + Math_SmoothStepToF(&player->rot.x, 0.0f, 0.1f, 3.0f, 0.1f); Math_SmoothStepToF(&player->pos.y, player->cam.eye.y + 5.0f, 0.1f, 1.0f, 0.0f); - if (player->timer_1F8 == 0) { - player->unk_1D0 = 0; - player->timer_1F8 = 120; - player->timer_1FC = 20; + if (player->csTimer == 0) { + player->csState = 0; + player->csTimer = 120; + player->csEventTimer = 20; D_ctx_80177A48[0] = 0.001f; gCsCamEyeX = player->cam.eye.x; gCsCamEyeY = player->cam.eye.y; @@ -1027,13 +1027,13 @@ void Cutscene_CoComplete2(Player* player) { break; case 0: - if (player->timer_1F8 > 60) { - Math_SmoothStepToF(&player->unk_0EC, (player->unk_004 * 60.0f) * D_ctx_80177950, 0.1f, 4.0f, 0.1f); + if (player->csTimer > 60) { + Math_SmoothStepToF(&player->rot.z, player->unk_004 * 60.0f * D_ctx_80177950, 0.1f, 4.0f, 0.1f); } - if (player->timer_1F8 < 80) { + if (player->csTimer < 80) { gCsCamAtX = player->pos.x; gCsCamAtY = player->pos.y; - gCsCamAtZ = player->unk_138 + D_ctx_80177D20 + 30.0f; + gCsCamAtZ = player->trueZpos + gPathProgress + 30.0f; Math_SmoothStepToF(&D_ctx_80177A48[0], 0.05f, 0.1f, 0.0005f, 0.0f); } @@ -1054,19 +1054,19 @@ void Cutscene_CoComplete2(Player* player) { if ((D_ctx_80177950 < 0.0f) && (player->unk_004 < 0.0f)) { var_fa1 = 360.0f; } - if (player->timer_1FC == 0) { - Math_SmoothStepToF(&player->unk_0E8, var_fa1, 0.1f, 4.0f, 0.0f); + if (player->csEventTimer == 0) { + Math_SmoothStepToF(&player->rot.y, var_fa1, 0.1f, 4.0f, 0.0f); } player->vel.y = 0.0f; Math_SmoothStepToF(&player->pos.y, player->cam.eye.y + 5.0f, 0.1f, 4.0f, 0.0f); - if (player->timer_1F8 < 40) { - Math_SmoothStepToF(&player->unk_0EC, player->unk_004 * 180.0f, 0.1f, 1.5f, 0.0f); + if (player->csTimer < 40) { + Math_SmoothStepToF(&player->rot.z, player->unk_004 * 180.0f, 0.1f, 1.5f, 0.0f); } - if (player->timer_1F8 == 0) { - player->unk_1D0 = 1; - player->timer_1F8 = 150; + if (player->csTimer == 0) { + player->csState = 1; + player->csTimer = 150; player->wings.unk_10 = 0.0f; player->wings.unk_08 = 0.0f; player->wings.unk_0C = 0.0f; @@ -1076,9 +1076,9 @@ void Cutscene_CoComplete2(Player* player) { case 1: Math_SmoothStepToF(&D_ctx_80177A48[0], 1.0f, 0.1f, 0.05f, 0.0f); - player->unk_25C += 0.04f; - if (player->unk_25C > 0.6f) { - player->unk_25C = 0.6f; + player->contrailScale += 0.04f; + if (player->contrailScale > 0.6f) { + player->contrailScale = 0.6f; } player->unk_000 += 0.005f; @@ -1087,25 +1087,25 @@ void Cutscene_CoComplete2(Player* player) { } Math_SmoothStepToF(&gCsCamAtX, player->pos.x, D_ctx_80177A48[0], 50000.0f, 0.0f); Math_SmoothStepToF(&gCsCamAtY, player->pos.y, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&gCsCamAtZ, player->unk_138 + D_ctx_80177D20 + 30.0f, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&gCsCamAtZ, player->trueZpos + gPathProgress + 30.0f, D_ctx_80177A48[0], 50000.0f, 0.0f); Math_SmoothStepToF(&player->pos.y, player->cam.eye.y + 5.0f, 0.1f, 4.0f, 0.0f); - Math_SmoothStepToF(&player->unk_0E4, 20.0f, 0.1f, 0.2f, 0.01f); + Math_SmoothStepToF(&player->rot.x, 20.0f, 0.1f, 0.2f, 0.01f); Math_SmoothStepToF(&player->pos.x, player->cam.eye.x, 0.1f, 2.0f, 0.0f); - if (player->timer_1F8 <= 110) { - Math_SmoothStepToF(&player->unk_0EC, player->unk_004 * 360.0f, 0.1f, 2.5f, 0.0f); + if (player->csTimer <= 110) { + Math_SmoothStepToF(&player->rot.z, 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); + Math_SmoothStepToF(&player->rot.z, player->unk_004 * 180.0f, 0.1f, 2.5f, 0.0f); } - if ((180.0f - fabsf(player->unk_0EC)) <= 3.0f) { + if ((180.0f - fabsf(player->rot.z)) <= 3.0f) { gGroundSurface = SURFACE_ROCK; } - if (player->timer_1F8 == 0) { - player->timer_1F8 = 200; - player->timer_1FC = 500; - player->unk_1D0 = 2; + if (player->csTimer == 0) { + player->csTimer = 200; + player->csEventTimer = 500; + player->csState = 2; player->unk_000 = (player->unk_004 = (player->unk_008 = (D_ctx_80178418 = 0.0f))); player->baseSpeed = 0.0f; D_ctx_80177A48[6] = 0.0f; @@ -1114,9 +1114,9 @@ void Cutscene_CoComplete2(Player* player) { case 2: player->pos.y += 5.0f; - Matrix_RotateY(gCalcMatrix, ((player->unk_0E8 + 180.0f) + D_ctx_80178418) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0) * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, ((player->rot.y + 180.0f) + D_ctx_80178418) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(player->rot.x * M_DTOR), MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -((player->bankAngle + player->rockAngle) * M_DTOR), MTXF_APPLY); sp78.x = 0; sp78.y = 70.0f; @@ -1125,7 +1125,7 @@ void Cutscene_CoComplete2(Player* player) { Matrix_MultVec3f(gCalcMatrix, &sp78, &sp6C); Math_SmoothStepToF(&gCsCamAtX, player->pos.x, D_ctx_80177A48[0], 50000.0f, 0.0f); Math_SmoothStepToF(&gCsCamAtY, player->pos.y - D_ctx_80177A48[6], D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&gCsCamAtZ, player->unk_138 + D_ctx_80177D20 - D_ctx_80177A48[6], D_ctx_80177A48[0], + Math_SmoothStepToF(&gCsCamAtZ, player->trueZpos + gPathProgress - D_ctx_80177A48[6], D_ctx_80177A48[0], 50000.0f, 0.0f); Math_SmoothStepToF(&D_ctx_80177A48[6], 130.0f, 0.1f, 0.25f, 0.0f); player->unk_000 += 0.002f; @@ -1136,13 +1136,13 @@ void Cutscene_CoComplete2(Player* player) { gCsCamEyeX += ((player->pos.x + sp6C.x) - gCsCamEyeX) * player->unk_000; gCsCamEyeY += ((player->pos.y + sp6C.y) - gCsCamEyeY) * player->unk_000; - gCsCamEyeZ += ((player->unk_138 + D_ctx_80177D20 + sp6C.z) - gCsCamEyeZ) * player->unk_000; + gCsCamEyeZ += ((player->trueZpos + gPathProgress + sp6C.z) - gCsCamEyeZ) * player->unk_000; D_ctx_80178430 += 0.2f; D_ctx_8017842C += 0.2f; D_ctx_80178418 += player->unk_008; - Math_SmoothStepToAngle(&player->unk_0EC, 0.0f, 0.1f, 2.0f, 0.0f); + Math_SmoothStepToAngle(&player->rot.z, 0.0f, 0.1f, 2.0f, 0.0f); - if (player->timer_1F8 == 0) { + if (player->csTimer == 0) { player->unk_008 += 0.01f; if (player->unk_008 > 0.63f) { player->unk_008 = 0.63f; @@ -1156,15 +1156,15 @@ void Cutscene_CoComplete2(Player* player) { player->vel.y = 5.0f; - if ((player->timer_1F8 == 50) && (gTeamShields[TEAM_ID_FALCO] > 0)) { + if ((player->csTimer == 50) && (gTeamShields[TEAM_ID_FALCO] > 0)) { func_demo_8004A840(0); } - if ((player->timer_1F8 == 70) && (gTeamShields[TEAM_ID_SLIPPY] > 0)) { + if ((player->csTimer == 70) && (gTeamShields[TEAM_ID_SLIPPY] > 0)) { func_demo_8004A840(1); } - if (player->timer_1F8 == 90) { + if (player->csTimer == 90) { Play_ClearObjectData(); if (gTeamShields[TEAM_ID_PEPPY] > 0) { func_demo_8004A840(2); @@ -1172,9 +1172,9 @@ void Cutscene_CoComplete2(Player* player) { gGroundSurface = SURFACE_GRASS; } - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0) * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->rot.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(player->rot.x * M_DTOR), MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -((player->bankAngle + player->rockAngle) * M_DTOR), MTXF_APPLY); if ((D_ctx_80178418 > 70.0f) && (D_ctx_80178418 < 280.0f)) { func_demo_8004AA84(); @@ -1187,7 +1187,7 @@ void Cutscene_CoComplete2(Player* player) { D_ctx_80178450[0] = player->pos.x + sp6C.x; D_ctx_80178460[0] = player->pos.y + sp6C.y; - D_ctx_80178470[0] = player->unk_138 + sp6C.z; + D_ctx_80178470[0] = player->trueZpos + sp6C.z; sp78.x = gActors[1].fwork[0] * gActors[1].fwork[3]; sp78.y = gActors[1].fwork[1] * gActors[1].fwork[3]; @@ -1197,7 +1197,7 @@ void Cutscene_CoComplete2(Player* player) { D_ctx_80178450[1] = player->pos.x + sp6C.x; D_ctx_80178460[1] = player->pos.y + sp6C.y; - D_ctx_80178470[1] = player->unk_138 + sp6C.z; + D_ctx_80178470[1] = player->trueZpos + sp6C.z; sp78.x = gActors[2].fwork[0] * gActors[2].fwork[3]; sp78.y = gActors[2].fwork[1] * gActors[2].fwork[3]; @@ -1207,7 +1207,7 @@ void Cutscene_CoComplete2(Player* player) { D_ctx_80178450[2] = player->pos.x + sp6C.x; D_ctx_80178460[2] = player->pos.y + sp6C.y; - D_ctx_80178470[2] = player->unk_138 + sp6C.z; + D_ctx_80178470[2] = player->trueZpos + sp6C.z; switch (gCsFrameCount) { case 330: @@ -1247,9 +1247,9 @@ void Cutscene_CoComplete2(Player* player) { case 3: D_ctx_80178430 += 0.2f; D_ctx_8017842C += 0.2f; - if (player->timer_1F8 == 0) { - player->unk_1D0 = 4; - player->timer_1F8 = 30; + if (player->csTimer == 0) { + player->csState = 4; + player->csTimer = 30; player->unk_000 = 0.0f; player->unk_194 = 5.0f; player->unk_190 = 5.0f; @@ -1260,24 +1260,24 @@ void Cutscene_CoComplete2(Player* player) { D_ctx_80178430 += 0.2f; D_ctx_8017842C += 0.2f; player->unk_190 = 2.0f; - player->unk_25C += 0.1f; - if (player->unk_25C > 0.6f) { - player->unk_25C = 0.6f; + player->contrailScale += 0.1f; + if (player->contrailScale > 0.6f) { + player->contrailScale = 0.6f; } player->unk_000 += 1.0f; player->baseSpeed = SQ(player->unk_000); - if (player->timer_1F8 == 0) { + if (player->csTimer == 0) { D_ctx_80177A48[7] = player->vel.x; D_ctx_80177A48[8] = player->vel.y; D_ctx_80177A48[9] = player->vel.z; - player->unk_1D0 = 5; + player->csState = 5; player->baseSpeed = 0.0f; - player->timer_1F8 = 10; - func_effect_80078E50(player->pos.x, player->pos.y, player->unk_138, 30.0f); + player->csTimer = 10; + func_effect_80078E50(player->pos.x, player->pos.y, player->trueZpos, 30.0f); } gCsCamAtX = player->pos.x; gCsCamAtY = player->pos.y - D_ctx_80177A48[6]; - gCsCamAtZ = player->unk_138 + D_ctx_80177D20 - D_ctx_80177A48[6]; + gCsCamAtZ = player->trueZpos + gPathProgress - D_ctx_80177A48[6]; break; case 5: @@ -1285,9 +1285,9 @@ void Cutscene_CoComplete2(Player* player) { gCsCamAtY += D_ctx_80177A48[8]; gCsCamAtZ += D_ctx_80177A48[9]; player->unk_234 = 0; - if (player->timer_1F8 == 0) { + if (player->csTimer == 0) { player->state_1C8 = PLAYERSTATE_1C8_NEXT; - player->timer_1F8 = 0; + player->csTimer = 0; gFadeoutType = 4; Audio_FadeOutAll(10); gLeveLClearStatus[gCurrentLevel] = Play_CheckMedalStatus(150) + 1; @@ -1305,16 +1305,16 @@ void Cutscene_CoComplete2(Player* player) { break; case 1255: - player->unk_1D0 = 3; - player->timer_1F8 = 10; + player->csState = 3; + player->csTimer = 10; func_play_800A6028(player->sfxSource, 0x09000002); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 50); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50); break; } - Matrix_RotateY(gCalcMatrix, ((player->unk_114 + player->unk_0E8) + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4) * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->xRot_120 + player->rot.x) * M_DTOR), MTXF_APPLY); sp60.x = 0.0f; sp60.y = 0.0f; @@ -1330,8 +1330,8 @@ void Cutscene_CoComplete2(Player* player) { player->pos.y += player->vel.y; player->pos.z += player->vel.z; - player->unk_0F8 = player->unk_0EC; - player->unk_138 = player->pos.z; + player->bankAngle = player->rot.z; + player->trueZpos = player->pos.z; Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0); Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0); @@ -1340,10 +1340,10 @@ void Cutscene_CoComplete2(Player* player) { Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0.f); Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0.f); - player->unk_088 += 10.0f; - player->unk_080 = (-SIN_DEG(player->unk_088)) * 0.3f; - player->unk_0F4 += 8.0f; - player->unk_0F0 = SIN_DEG(player->unk_0F4); + player->bobPhase += 10.0f; + player->yBob = (-SIN_DEG(player->bobPhase)) * 0.3f; + player->rockPhase += 8.0f; + player->rockAngle = SIN_DEG(player->rockPhase); } void Cutscene_FortunaComplete(Player* player) { @@ -1445,14 +1445,14 @@ void Cutscene_UTurn(Player* player) { Vec3f sp58; PosRot sp50; - Math_SmoothStepToF(&player->unk_130, 0.0f, 0.1f, 15.0f, 0.0f); - Math_SmoothStepToF(&player->unk_0EC, 0.0f, 0.1f, 5.0f, 0.0f); - Math_SmoothStepToF(&player->unk_0E8, 0.0f, 0.1f, 5.0f, 0.0f); - Math_SmoothStepToF(&player->unk_0E4, 0.0f, 0.1f, 5.0f, 0.0f); + Math_SmoothStepToF(&player->zRotBarrelRoll, 0.0f, 0.1f, 15.0f, 0.0f); + Math_SmoothStepToF(&player->rot.z, 0.0f, 0.1f, 5.0f, 0.0f); + Math_SmoothStepToF(&player->rot.y, 0.0f, 0.1f, 5.0f, 0.0f); + Math_SmoothStepToF(&player->rot.x, 0.0f, 0.1f, 5.0f, 0.0f); Math_SmoothStepToF(&player->cam.eye.y, player->pos.y - 20.0f, 0.2f, 100.0f, 0.0f); sp50.rot.z = player->baseSpeed; - sp58.x = Math_RadToDeg(Math_Atan2F(player->pos.x, player->unk_138)); + sp58.x = Math_RadToDeg(Math_Atan2F(player->pos.x, player->trueZpos)); player->boostCooldown = 1; player->boostMeter += 1.0f; @@ -1461,35 +1461,35 @@ void Cutscene_UTurn(Player* player) { player->boostMeter = 90.0f; } - switch (player->unk_1D0) { + switch (player->csState) { case 0: if (player->unk_19C != 0) { - player->timer_1F8 = 10; + player->csTimer = 10; } else { - player->timer_1F8 = 30; + player->csTimer = 30; } - player->unk_1D0 = 1; - if (player->unk_4D8 > 180.0f) { - player->unk_4D8 -= 360.0f; + player->csState = 1; + if (player->aerobaticPitch > 180.0f) { + player->aerobaticPitch -= 360.0f; } /* fallthrough */ case 1: - if (player->timer_1F8 == 0) { - player->unk_1D0 = 2; + if (player->csTimer == 0) { + player->csState = 2; if (player->unk_19C != 0) { - player->timer_1F8 = 60; + player->csTimer = 60; } else { - player->timer_1F8 = 80; + player->csTimer = 80; } } player->cam.eye.x += player->vel.x * 0.2f; player->cam.eye.z += player->vel.z * 0.2f; - Math_SmoothStepToF(&player->unk_12C, 0.0f, 0.1f, 15.0f, 0.0f); + Math_SmoothStepToF(&player->zRotBank, 0.0f, 0.1f, 15.0f, 0.0f); break; case 2: - if (player->unk_4D8 > 140.0f) { + if (player->aerobaticPitch > 140.0f) { sp58.y = 0.0f; } else { sp58.y = 60.0f; @@ -1499,21 +1499,21 @@ void Cutscene_UTurn(Player* player) { Math_SmoothStepToF(&player->wings.unk_08, sp58.y, 0.3f, 100.0f, 0.0f); Math_SmoothStepToF(&player->wings.unk_0C, sp58.y, 0.3f, 100.0f, 0.0f); Math_SmoothStepToF(&player->wings.unk_10, sp58.y, 0.3f, 100.0f, 0.0f); - Math_SmoothStepToF(&player->unk_12C, 0.0f, 0.1f, 15.0f, 0.0f); - Math_SmoothStepToF(&player->unk_4D8, 190.0f, 0.1f, 6.0f, 0.001f); + Math_SmoothStepToF(&player->zRotBank, 0.0f, 0.1f, 15.0f, 0.0f); + Math_SmoothStepToF(&player->aerobaticPitch, 190.0f, 0.1f, 6.0f, 0.001f); - if (player->unk_4D8 > 180.0f) { - player->unk_114 += 180.0f; - if (player->unk_114 >= 360.0f) { - player->unk_114 -= 360.0f; + if (player->aerobaticPitch > 180.0f) { + player->yRot_114 += 180.0f; + if (player->yRot_114 >= 360.0f) { + player->yRot_114 -= 360.0f; } - player->unk_4D8 = 360.0f - (player->unk_4D8 - 180.0f); - if ((sp58.x - player->unk_114) < 180.0f) { - player->unk_12C = 180.0f; + player->aerobaticPitch = 360.0f - (player->aerobaticPitch - 180.0f); + if ((sp58.x - player->yRot_114) < 180.0f) { + player->zRotBank = 180.0f; } else { - player->unk_12C = -180.0f; + player->zRotBank = -180.0f; } - player->unk_1D0 = 3; + player->csState = 3; func_play_800A5FA0(player->sfxSource, 0x09000002, player->num); player->unk_194 = 7.0f; player->unk_190 = 7.0f; @@ -1522,9 +1522,9 @@ void Cutscene_UTurn(Player* player) { break; case 3: - Math_SmoothStepToF(&player->unk_12C, 0.0f, 0.05f, 5.0f, 0.0f); + Math_SmoothStepToF(&player->zRotBank, 0.0f, 0.05f, 5.0f, 0.0f); - sp58.y = player->unk_12C * 0.3f; + sp58.y = player->zRotBank * 0.3f; Math_SmoothStepToF(&player->wings.unk_04, sp58.y, 0.3f, 100.0f, 0.0f); Math_SmoothStepToF(&player->wings.unk_08, sp58.y, 0.3f, 100.0f, 0.0f); @@ -1544,10 +1544,10 @@ void Cutscene_UTurn(Player* player) { } if (player->unk_19C == 0) { - Math_SmoothStepToAngle(&player->unk_114, sp58.x, 0.1f, 2.0f, 0.0f); + Math_SmoothStepToAngle(&player->yRot_114, sp58.x, 0.1f, 2.0f, 0.0f); } - if (player->pos.y < player->unk_0A0) { + if (player->pos.y < player->pathHeight) { if (player->unk_004 < 0.0f) { player->unk_004 += 0.2f; } @@ -1555,7 +1555,7 @@ void Cutscene_UTurn(Player* player) { player->unk_004 -= 0.2f; } - if (player->timer_1F8 == 0) { + if (player->csTimer == 0) { player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->unk_014 = 0.0f; player->unk_018 = 0.0f; @@ -1564,10 +1564,10 @@ void Cutscene_UTurn(Player* player) { } player->pos.y += player->unk_004; player->cam.at.y += player->unk_004; - player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; + player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll; - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->xRot_120 + player->rot.x + player->aerobaticPitch) * M_DTOR), MTXF_APPLY); sp50.rot.x = 0.0f; sp50.rot.y = 0.0f; @@ -1580,12 +1580,12 @@ void Cutscene_UTurn(Player* player) { player->pos.x += player->vel.x; player->pos.y += player->vel.y; - if (player->pos.y < player->unk_0A4) { - player->pos.y = player->unk_0A4; + if (player->pos.y < player->pathFloor) { + player->pos.y = player->pathFloor; player->vel.y = 0.0f; } player->pos.z += player->vel.z; - player->unk_138 = player->pos.z; + player->trueZpos = player->pos.z; func_play_800B2574(player); func_play_800B2130(player); @@ -1602,7 +1602,7 @@ void Cutscene_DropVsItem(Player* player, ObjectId itemId, Item* item) { item->obj.status = OBJ_INIT; item->obj.pos.x = player->pos.x; item->obj.pos.y = player->pos.y; - item->obj.pos.z = player->unk_138; + item->obj.pos.z = player->trueZpos; item->obj.id = itemId; Object_SetInfo(&item->info, item->obj.id); } @@ -1614,11 +1614,11 @@ void Cutscene_KillPlayer(Player* player) { Audio_KillSfxBySourceAndId(player->sfxSource, 0x0900C010); func_play_800A5FA0(player->sfxSource, 0x0903F004, player->num); player->state_1C8 = PLAYERSTATE_1C8_NEXT; - player->timer_1F8 = 70; + player->csTimer = 70; player->timer_224 = 20; gFadeoutType = 7; - if (player->unk_1D4 != 0) { + if (player->grounded) { player->unk_284 = 0; } @@ -1659,7 +1659,7 @@ void Cutscene_KillPlayer(Player* player) { if (gVsPointsToWin == 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, 1000); + func_effect_8007C688(player->pos.x, player->pos.y, player->trueZpos, 3.0f, 1000); } } } @@ -1676,12 +1676,12 @@ void Cutscene_KillPlayer(Player* player) { 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); + func_effect_8007D0E0(player->pos.x, player->pos.y, player->trueZpos, 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, 80); - func_effect_8007C688(player->pos.x, player->pos.y, player->unk_138, 3.0f, 800); + func_effect_8007BFFC(player->pos.x, player->pos.y, player->trueZpos, 0.0f, 0.0f, 0.0f, 3.0f, 80); + func_effect_8007C688(player->pos.x, player->pos.y, player->trueZpos, 3.0f, 800); } else { - func_effect_8007BFFC(player->pos.x, player->pos.y, player->unk_138, 0.0f, 0.0f, 0.0f, 3.0f, 10); + func_effect_8007BFFC(player->pos.x, player->pos.y, player->trueZpos, 0.0f, 0.0f, 0.0f, 3.0f, 10); } Cutscene_KillPlayer(player); } @@ -1691,49 +1691,49 @@ void func_demo_8004D828(Player* player) { Vec3f src; Vec3f dest; - Math_SmoothStepToF(&player->unk_0E4, 0.0f, 0.1f, 1.0f, 0.01f); + Math_SmoothStepToF(&player->rot.x, 0.0f, 0.1f, 1.0f, 0.01f); player->pos.x += player->vel.x; player->pos.y += player->vel.y; if ((gCurrentLevel != LEVEL_VENOM_1 || gBossActive == 0) && (gLevelType == LEVELTYPE_PLANET || gCurrentLevel == LEVEL_BOLSE)) { player->vel.y -= 0.5f; - player->unk_0E4 -= 2.0f; + player->rot.x -= 2.0f; } player->pos.z += player->vel.z; - player->unk_138 = player->pos.z; - player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; - player->unk_12C += 15.0f; + player->trueZpos = player->pos.z; + player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll; + player->zRotBank += 15.0f; - if (player->unk_1D0 != 0) { - player->unk_0E8 += 11.0f; - player->unk_0E4 += 17.0f; + if (player->csState != 0) { + player->rot.y += 11.0f; + player->rot.x += 17.0f; } if (gCamCount == 1) { if (((gGameFrameCount % 2) == 0)) { func_effect_8007D24C(RAND_FLOAT_CENTERED(20.0) + player->pos.x, RAND_FLOAT_CENTERED(20.0) + player->pos.y, - player->unk_138, 2.2f); + player->trueZpos, 2.2f); } } else if (((gGameFrameCount % 4) == 0)) { func_effect_8007D10C(RAND_FLOAT_CENTERED(10.0f) + player->pos.x, RAND_FLOAT_CENTERED(10.0f) + player->pos.y, - RAND_FLOAT_CENTERED(10.0f) + player->unk_138, 2.2f); + RAND_FLOAT_CENTERED(10.0f) + player->trueZpos, 2.2f); } - if ((player->pos.y < player->unk_0A4) && (player->unk_1D0 == 0)) { - player->pos.y = player->unk_0A4; + if ((player->pos.y < player->pathFloor) && (player->csState == 0)) { + player->pos.y = player->pathFloor; player->unk_284 = 0; - player->timer_220 = 0; + player->radioDamageTimer = 0; player->vel.y = 10.0f; - player->unk_1D0 = 1; + player->csState = 1; func_play_800A6070(player->sfxSource, 0x29000000); if ((gCurrentLevel == LEVEL_CORNERIA) || (gCurrentLevel == LEVEL_FORTUNA)) { func_enmy_80062C38(player->pos.x, player->pos.z); } else { - func_effect_8007D0E0(player->pos.x, player->pos.y, player->unk_138, 3.0f); + func_effect_8007D0E0(player->pos.x, player->pos.y, player->trueZpos, 3.0f); } if (player->wings.rightState == WINGSTATE_INTACT) { @@ -1746,38 +1746,38 @@ void func_demo_8004D828(Player* player) { player->wings.leftState = WINGSTATE_BROKEN; func_effect_8007D0E0(player->hit2.x, player->hit2.y, player->hit2.z, 2.0f); } - } else if (((player->timer_220 > 0) || (player->pos.y < player->unk_0A4) || (player->pos.y < gWaterLevel) || - (player->timer_1FC == 0)) && - (player->timer_1F8 == 0)) { + } else if (((player->radioDamageTimer > 0) || (player->pos.y < player->pathFloor) || + (player->pos.y < gWaterLevel) || (player->csEventTimer == 0)) && + (player->csTimer == 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, 80); + func_effect_8007C688(player->pos.x, player->pos.y, player->trueZpos - (2.0f * player->vel.z), 3.0f, 80); } - if (player->pos.y < player->unk_0A4) { + if (player->pos.y < player->pathFloor) { func_enmy_80062C38(player->pos.x, player->pos.z); } } if (gLevelType == LEVELTYPE_PLANET) { for (i = 0; i < 4; i++) { - func_play_800A69F8(2, player->pos.x, player->pos.y, player->unk_138); + func_play_800A69F8(2, player->pos.x, player->pos.y, player->trueZpos); } for (i = 0; i < 2; i++) { - func_play_800A69F8(3, player->pos.x, player->pos.y, player->unk_138); + func_play_800A69F8(3, player->pos.x, player->pos.y, player->trueZpos); } } - 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, + func_effect_8007D0E0(player->pos.x, player->pos.y, player->trueZpos, 5.0f); + func_effect_8007BFFC(player->pos.x, player->pos.y, player->trueZpos, player->vel.x, 0.0f, player->vel.z, 5.0f, 20); Cutscene_KillPlayer(player); } Math_SmoothStepToF(&player->camRoll, 0.0f, 0.05f, 5.0f, 0.00001f); - Matrix_RotateY(gCalcMatrix, (player->unk_114 + (player->unk_134 * 0.2f)) * M_DTOR, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, (player->yRot_114 + (player->damageShake * 0.2f)) * M_DTOR, MTXF_NEW); Math_SmoothStepToF(&player->unk_000, 700.0f, 0.05f, 10.0f, 0.00001f); src.x = player->unk_004 * (player->unk_000 * 0.7f); src.y = player->unk_000 * 0.5f; - src.z = player->unk_000 + (400.0f - player->unk_08C); + src.z = player->unk_000 + (400.0f - player->camDist); Matrix_MultVec3f(gCalcMatrix, &src, &dest); @@ -1790,7 +1790,7 @@ void func_demo_8004D828(Player* player) { if ((gLevelType == LEVELTYPE_PLANET) || (gCurrentLevel == LEVEL_BOLSE)) { player->cam.eye.y = (player->pos.y * player->unk_148) + dest.y; player->cam.eye.y -= player->unk_02C - 50.0f; - player->cam.at.y = ((player->pos.y * player->unk_14C) + 20.0f) + (player->unk_060 * 5.0f); + player->cam.at.y = (player->pos.y * player->unk_14C) + 20.0f + (player->unk_060 * 5.0f); } else { player->cam.eye.y = player->pos.y + dest.y; player->cam.at.y = player->pos.y; @@ -1804,11 +1804,11 @@ void func_demo_8004D828(Player* player) { void func_demo_8004DEF8(Player* player) { s32 i; - if (player->unk_0E4 < 0.0f) { - player->unk_0E4 += 1.0f; + if (player->rot.x < 0.0f) { + player->rot.x += 1.0f; } - if (player->unk_0E4 > 0.0f) { - player->unk_0E4 -= 1.0f; + if (player->rot.x > 0.0f) { + player->rot.x -= 1.0f; } player->pos.x += player->vel.x; @@ -1819,59 +1819,59 @@ void func_demo_8004DEF8(Player* player) { } player->pos.z += player->vel.z; - player->unk_138 = player->pos.z + player->unk_08C; - player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; - player->unk_12C = player->unk_12C + 15.0f; + player->trueZpos = player->pos.z + player->camDist; + player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll; + player->zRotBank = player->zRotBank + 15.0f; - if (player->unk_1D0 != 0) { - player->unk_0E8 += 14.0f; - player->unk_0E4 += 26.0f; + if (player->csState != 0) { + player->rot.y += 14.0f; + player->rot.x += 26.0f; } if (((gGameFrameCount % 2) == 0)) { func_effect_8007D24C(RAND_FLOAT_CENTERED(20.0) + player->pos.x, RAND_FLOAT_CENTERED(20.0) + player->pos.y, - player->unk_138, 2.2f); + player->trueZpos, 2.2f); } - if ((player->pos.y < player->unk_0A4) && (player->unk_1D0 == 0)) { - player->pos.y = player->unk_0A4; - player->timer_220 = 0; + if ((player->pos.y < player->pathFloor) && (player->csState == 0)) { + player->pos.y = player->pathFloor; + player->radioDamageTimer = 0; player->vel.y = 10.0f; - player->unk_1D0 = 1; + player->csState = 1; func_play_800A6070(player->sfxSource, 0x29000000); if (gCurrentLevel == LEVEL_CORNERIA) { func_enmy_80062C38(player->pos.x, player->pos.z); } - if (player->wings.rightState == 2) { + if (player->wings.rightState == WINGSTATE_INTACT) { func_play_800A69F8(1, player->hit1.x, player->hit1.y, player->hit1.z); - player->wings.rightState = 0; + player->wings.rightState = WINGSTATE_NONE; func_effect_8007D0E0(player->hit1.x, player->hit1.y, player->hit1.z, 2.0f); } - if (player->wings.leftState == 2) { + if (player->wings.leftState == WINGSTATE_INTACT) { func_play_800A69F8(0, player->hit2.x, player->hit2.y, player->hit2.z); - player->wings.leftState = 0; + player->wings.leftState = WINGSTATE_NONE; func_effect_8007D0E0(player->hit2.x, player->hit2.y, player->hit2.z, 2.0f); } - } else if ((((player->timer_220 > 0) || (player->pos.y < player->unk_0A4)) || (player->timer_1FC == 0)) && - (player->timer_1F8 == 0)) { - if (player->pos.y < player->unk_0A4) { - func_effect_8007C688(player->pos.x, gGroundHeight + 20.0f, player->unk_138 - (2.0f * player->vel.z), 3.0f, + } else if (((player->radioDamageTimer > 0) || (player->pos.y < player->pathFloor) || (player->csEventTimer == 0)) && + (player->csTimer == 0)) { + if (player->pos.y < player->pathFloor) { + func_effect_8007C688(player->pos.x, gGroundHeight + 20.0f, player->trueZpos - (2.0f * player->vel.z), 3.0f, 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), + player->trueZpos - (2.0f * player->vel.z), 6.0f); + func_effect_8007BFFC(player->pos.x, player->pos.y - player->vel.y, player->trueZpos - (2.0f * player->vel.z), 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); + func_play_800A69F8(2, player->pos.x, player->pos.y, player->trueZpos); } for (i = 0; i < 4; i++) { - func_play_800A69F8(4, player->pos.x, player->pos.y, player->unk_138); + func_play_800A69F8(4, player->pos.x, player->pos.y, player->trueZpos); } } Cutscene_KillPlayer(player); @@ -1879,19 +1879,19 @@ void func_demo_8004DEF8(Player* player) { player->camRoll -= 3.0f; - if (player->unk_1D0 != 0) { + if (player->csState != 0) { player->camRoll += 10.0f; } - if ((gGroundSurface == SURFACE_WATER) && (player->pos.y <= player->unk_0A4)) { - func_effect_8007D9DC(player->pos.x, gGroundHeight + 2.0f, player->unk_138, 3.0f, 20.0f, 0); - func_effect_8007ADF4(player->pos.x, gGroundHeight, player->unk_138, 0.1f, 2.0f); + if ((gGroundSurface == SURFACE_WATER) && (player->pos.y <= player->pathFloor)) { + func_effect_8007D9DC(player->pos.x, gGroundHeight + 2.0f, player->trueZpos, 3.0f, 20.0f, 0); + func_effect_8007ADF4(player->pos.x, gGroundHeight, player->trueZpos, 0.1f, 2.0f); } } void Cutscene_PlayerDown(Player* player) { player->flags_228 = 0; - player->unk_280 = 0; + player->barrelRollAlpha = 0; if ((gGameFrameCount % 2) != 0) { gControllerRumbleFlags[gPlayerNum] = 1; @@ -1923,237 +1923,237 @@ void Cutscene_PlayerDown(Player* player) { } } -void func_demo_8004E4D4(Actor* actor) { +void func_demo_8004E4D4(ActorCutscene* this) { Vec3f sp54; Vec3f sp48; Vec3f sp3C; Player* sp38 = gPlayer; f32 sp34; - actor->fwork[7] += 3.0f; - actor->unk_0F4.z = SIN_DEG(actor->fwork[7]) * 1.5f; - actor->fwork[8] += 2.0f; - sp34 = SIN_DEG(actor->fwork[8]) * 10.0f; + this->fwork[7] += 3.0f; + this->unk_0F4.z = SIN_DEG(this->fwork[7]) * 1.5f; + this->fwork[8] += 2.0f; + sp34 = SIN_DEG(this->fwork[8]) * 10.0f; - switch (actor->state) { + switch (this->state) { case 0: - Math_SmoothStepToF(&actor->obj.rot.z, 0.0f, 0.05f, 1.0f, 0.0f); - Math_SmoothStepToF(&actor->obj.pos.x, actor->fwork[0] + sp38->pos.x, 0.03f, 10.0f, 0.0f); - Math_SmoothStepToF(&actor->obj.pos.y, actor->fwork[1] + sp38->pos.y + sp34, 0.03f, 10.0f, 0.0f); - Math_SmoothStepToF(&actor->obj.pos.z, actor->fwork[2] + sp38->unk_138, 0.03f, 10.0f, 0.0f); - actor->obj.rot.x = -sp38->unk_0E4; - actor->obj.rot.y = sp38->unk_0E8 + 180.0f; + Math_SmoothStepToF(&this->obj.rot.z, 0.0f, 0.05f, 1.0f, 0.0f); + Math_SmoothStepToF(&this->obj.pos.x, this->fwork[0] + sp38->pos.x, 0.03f, 10.0f, 0.0f); + Math_SmoothStepToF(&this->obj.pos.y, this->fwork[1] + sp38->pos.y + sp34, 0.03f, 10.0f, 0.0f); + Math_SmoothStepToF(&this->obj.pos.z, this->fwork[2] + sp38->trueZpos, 0.03f, 10.0f, 0.0f); + this->obj.rot.x = -sp38->rot.x; + this->obj.rot.y = sp38->rot.y + 180.0f; break; case 1: - actor->state = 2; - actor->timer_0BC = 50; - actor->fwork[9] = 2.0f; - AUDIO_PLAY_SFX(0x09000002, actor->sfxSource, 0); - actor->fwork[29] = 5.0f; + this->state = 2; + this->timer_0BC = 50; + this->fwork[9] = 2.0f; + AUDIO_PLAY_SFX(0x09000002, this->sfxSource, 0); + this->fwork[29] = 5.0f; /* fallthrough */ case 2: if (gLevelType == LEVELTYPE_PLANET) { - actor->fwork[21] += 0.4f; - if (actor->fwork[21] > 0.6f) { - actor->fwork[21] = 0.6f; + this->fwork[21] += 0.4f; + if (this->fwork[21] > 0.6f) { + this->fwork[21] = 0.6f; } } - actor->iwork[11] = 2; - actor->fwork[9] *= 1.2f; - if (actor->timer_0BC == 0) { - Object_Kill(&actor->obj, actor->sfxSource); + this->iwork[11] = 2; + this->fwork[9] *= 1.2f; + if (this->timer_0BC == 0) { + Object_Kill(&this->obj, this->sfxSource); } break; case 10: - actor->state = 11; - actor->timer_0BC = 150; - actor->timer_0BE = 40; - AUDIO_PLAY_SFX(0x09000002, actor->sfxSource, 0); - actor->fwork[29] = 5.0f; + this->state = 11; + this->timer_0BC = 150; + this->timer_0BE = 40; + AUDIO_PLAY_SFX(0x09000002, this->sfxSource, 0); + this->fwork[29] = 5.0f; /* fallthrough */ case 11: - actor->iwork[11] = 2; - actor->fwork[9] += 2.0f; - if (actor->fwork[9] > 50.0f) { - actor->fwork[9] = 50.0f; + this->iwork[11] = 2; + this->fwork[9] += 2.0f; + if (this->fwork[9] > 50.0f) { + this->fwork[9] = 50.0f; } - if (actor->timer_0BE == 0) { - switch (actor->index) { + if (this->timer_0BE == 0) { + switch (this->index) { case 1: - actor->obj.rot.y += 0.3f; - Math_SmoothStepToF(&actor->obj.rot.z, -70.0f, 0.05f, 4.0f, 0.0f); + this->obj.rot.y += 0.3f; + Math_SmoothStepToF(&this->obj.rot.z, -70.0f, 0.05f, 4.0f, 0.0f); break; case 2: - actor->obj.rot.y -= 0.3f; - Math_SmoothStepToF(&actor->obj.rot.z, 70.0f, 0.05f, 4.0f, 0.0f); + this->obj.rot.y -= 0.3f; + Math_SmoothStepToF(&this->obj.rot.z, 70.0f, 0.05f, 4.0f, 0.0f); break; case 3: - actor->obj.rot.x -= 0.4f; - Math_SmoothStepToF(&actor->obj.rot.z, 1000.0f, 0.05f, 6.0f, 0.0f); + this->obj.rot.x -= 0.4f; + Math_SmoothStepToF(&this->obj.rot.z, 1000.0f, 0.05f, 6.0f, 0.0f); break; } } - if (actor->timer_0BC == 0) { - Object_Kill(&actor->obj, actor->sfxSource); + if (this->timer_0BC == 0) { + Object_Kill(&this->obj, this->sfxSource); } break; case 30: - actor->fwork[3] += D_demo_800CA098[actor->index]; + this->fwork[3] += D_demo_800CA098[this->index]; - Matrix_RotateY(gCalcMatrix, actor->fwork[3] * M_DTOR, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, this->fwork[3] * M_DTOR, MTXF_NEW); sp54.x = 0.0f; - sp54.y = D_demo_800CA0A4[actor->index]; - sp54.z = D_demo_800CA0B0[actor->index]; + sp54.y = D_demo_800CA0A4[this->index]; + sp54.z = D_demo_800CA0B0[this->index]; Matrix_MultVec3f(gCalcMatrix, &sp54, &sp3C); - actor->fwork[0] = sp3C.x; - actor->fwork[1] = sp3C.y; - actor->fwork[2] = sp3C.z - 100.0f; + this->fwork[0] = sp3C.x; + this->fwork[1] = sp3C.y; + this->fwork[2] = sp3C.z - 100.0f; - Math_SmoothStepToF(&actor->obj.rot.z, SIN_DEG(actor->fwork[3]) * -30.0f, 0.1f, 2.0f, 0.0f); - Math_SmoothStepToF(&actor->obj.pos.x, actor->fwork[0] + sp38->pos.x, 0.03f, 10.0f, 0.0f); - Math_SmoothStepToF(&actor->obj.pos.y, actor->fwork[1] + sp38->pos.y + sp34, 0.03f, 10.0f, 0.0f); - Math_SmoothStepToF(&actor->obj.pos.z, actor->fwork[2] + sp38->unk_138, 0.03f, 10.0f, 0.0f); + Math_SmoothStepToF(&this->obj.rot.z, SIN_DEG(this->fwork[3]) * -30.0f, 0.1f, 2.0f, 0.0f); + Math_SmoothStepToF(&this->obj.pos.x, this->fwork[0] + sp38->pos.x, 0.03f, 10.0f, 0.0f); + Math_SmoothStepToF(&this->obj.pos.y, this->fwork[1] + sp38->pos.y + sp34, 0.03f, 10.0f, 0.0f); + Math_SmoothStepToF(&this->obj.pos.z, this->fwork[2] + sp38->trueZpos, 0.03f, 10.0f, 0.0f); break; case 31: - AUDIO_PLAY_SFX(0x09000002, actor->sfxSource, 0); - actor->state += 1; - actor->fwork[29] = 5.0f; + AUDIO_PLAY_SFX(0x09000002, this->sfxSource, 0); + this->state += 1; + this->fwork[29] = 5.0f; /* fallthrough */ case 32: - actor->iwork[11] = 2; - Math_SmoothStepToF(&actor->obj.rot.x, -20.0f, 0.1f, 0.5f, 0.0f); - Math_SmoothStepToF(&actor->fwork[9], 25.0f, 0.1f, 2.0f, 0.0f); - Math_SmoothStepToF(&actor->obj.rot.z, 0.0f, 0.1f, 0.5f, 0.0f); + this->iwork[11] = 2; + Math_SmoothStepToF(&this->obj.rot.x, -20.0f, 0.1f, 0.5f, 0.0f); + Math_SmoothStepToF(&this->fwork[9], 25.0f, 0.1f, 2.0f, 0.0f); + Math_SmoothStepToF(&this->obj.rot.z, 0.0f, 0.1f, 0.5f, 0.0f); break; } - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); sp54.x = 0.0f; sp54.y = 0.0f; - sp54.z = actor->fwork[9]; + sp54.z = this->fwork[9]; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp54, &sp48); - actor->vel.x = sp48.x; - actor->vel.y = sp48.y; - actor->vel.z = sp48.z; + this->vel.x = sp48.x; + this->vel.y = sp48.y; + this->vel.z = sp48.z; } -void func_demo_8004EBD0(Actor* actor) { +void func_demo_8004EBD0(ActorCutscene* this) { Vec3f src; Vec3f dest; - if (actor->state < 4) { - actor->fwork[9] = 0.4f; + if (this->state < 4) { + this->fwork[9] = 0.4f; - actor->obj.pos.x += (D_ctx_80178450[actor->index] - actor->obj.pos.x) * 0.4f; - actor->obj.pos.y += (D_ctx_80178460[actor->index] - actor->obj.pos.y) * 0.4f; - actor->obj.pos.z += (D_ctx_80178470[actor->index] - actor->obj.pos.z) * 0.4f; + this->obj.pos.x += (D_ctx_80178450[this->index] - this->obj.pos.x) * 0.4f; + this->obj.pos.y += (D_ctx_80178460[this->index] - this->obj.pos.y) * 0.4f; + this->obj.pos.z += (D_ctx_80178470[this->index] - this->obj.pos.z) * 0.4f; - actor->obj.rot.z *= 0.98f; - actor->obj.rot.x = -gPlayer[0].unk_0E4; - actor->obj.rot.y = gPlayer[0].unk_0E8 + 180.0f; + this->obj.rot.z *= 0.98f; + this->obj.rot.x = -gPlayer[0].rot.x; + this->obj.rot.y = gPlayer[0].rot.y + 180.0f; if (1) {} - actor->fwork[7] += 1.0f; - if ((s32) actor->fwork[7] & 0x40) { - actor->fwork[0] += 0.1f; + this->fwork[7] += 1.0f; + if ((s32) this->fwork[7] & 0x40) { + this->fwork[0] += 0.1f; } else { - actor->fwork[0] -= 0.1f; + this->fwork[0] -= 0.1f; } - actor->fwork[8] += 1.2f; - if ((s32) actor->fwork[8] & 0x40) { - actor->fwork[1] += 0.1f; + this->fwork[8] += 1.2f; + if ((s32) this->fwork[8] & 0x40) { + this->fwork[1] += 0.1f; } else { - actor->fwork[1] -= 0.1f; + this->fwork[1] -= 0.1f; } } - switch (actor->state) { + switch (this->state) { case 0: - actor->fwork[3] *= 0.992f; - if (actor->fwork[3] < 1.2f) { - actor->state += 1; + this->fwork[3] *= 0.992f; + if (this->fwork[3] < 1.2f) { + this->state += 1; } break; case 1: - actor->fwork[3] *= 0.997f; - if (actor->fwork[3] < 1.0f) { - actor->fwork[3] = 1.0f; - actor->state += 1; + this->fwork[3] *= 0.997f; + if (this->fwork[3] < 1.0f) { + this->fwork[3] = 1.0f; + this->state += 1; } - actor->timer_0BC = 560; + this->timer_0BC = 560; break; case 2: - if (actor->timer_0BC == 110) { - gPlayer[0].timer_1F8 = 10000; + if (this->timer_0BC == 110) { + gPlayer[0].csTimer = 10000; } - if (actor->timer_0BC == 260) { - gPlayer[0].timer_1FC = 10000; + if (this->timer_0BC == 260) { + gPlayer[0].csEventTimer = 10000; } - if (actor->timer_0BC == 0) { - actor->state++; - actor->timer_0BC = 10; - func_play_800A6028(actor->sfxSource, 0x09000002); - actor->fwork[29] = 5.0f; + if (this->timer_0BC == 0) { + this->state++; + this->timer_0BC = 10; + func_play_800A6028(this->sfxSource, 0x09000002); + this->fwork[29] = 5.0f; } break; case 3: - actor->iwork[11] = 2; - if (actor->timer_0BC == 0) { - actor->state++; - actor->timer_0BC = 30; + this->iwork[11] = 2; + if (this->timer_0BC == 0) { + this->state++; + this->timer_0BC = 30; } break; case 4: - actor->fwork[21] += 0.4f; - if (actor->fwork[21] > 0.6f) { - actor->fwork[21] = 0.6f; + this->fwork[21] += 0.4f; + if (this->fwork[21] > 0.6f) { + this->fwork[21] = 0.6f; } - actor->fwork[6] += 1.0f; + this->fwork[6] += 1.0f; - Matrix_RotateY(gCalcMatrix, (gPlayer[0].unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -(gPlayer[0].unk_0E4 * M_DTOR), MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, -((gPlayer[0].unk_0F8 + gPlayer[0].unk_0F0) * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (gPlayer[0].rot.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(gPlayer[0].rot.x * M_DTOR), MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -((gPlayer[0].bankAngle + gPlayer[0].rockAngle) * M_DTOR), MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; - src.z = actor->fwork[6] * actor->fwork[6]; + src.z = this->fwork[6] * this->fwork[6]; Matrix_MultVec3f(gCalcMatrix, &src, &dest); - actor->vel.x = dest.x; - actor->vel.y = dest.y; - actor->vel.z = dest.z; + this->vel.x = dest.x; + this->vel.y = dest.y; + this->vel.z = dest.z; - if (actor->timer_0BC == 0) { - func_effect_80078E50(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 30.0f); - Object_Kill(&actor->obj, actor->sfxSource); + if (this->timer_0BC == 0) { + func_effect_80078E50(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 30.0f); + Object_Kill(&this->obj, this->sfxSource); } break; } - actor->obj.pos.y += 5.0f; - actor->fwork[21] -= 0.02f; - if (actor->fwork[21] < 0.0f) { - actor->fwork[21] = 0.0f; + this->obj.pos.y += 5.0f; + this->fwork[21] -= 0.02f; + if (this->fwork[21] < 0.0f) { + this->fwork[21] = 0.0f; } } @@ -2333,17 +2333,17 @@ void func_demo_8004F798(Actor* actor) { case 1: actor->fwork[29] = 10.0f; actor->vel.z -= 100.0f; - if ((actor->obj.pos.z + D_ctx_80177D20) < -15000.0f) { + if ((actor->obj.pos.z + gPathProgress) < -15000.0f) { Object_Kill(&actor->obj, actor->sfxSource); } break; } } -void Actor195_Update(Actor* actor) { +void ActorCutscene_Update(ActorCutscene* this) { if (gCurrentLevel == LEVEL_AQUAS) { - func_hud_80093164(actor); + func_hud_80093164(this); return; } @@ -2351,77 +2351,77 @@ void Actor195_Update(Actor* actor) { case PLAYERSTATE_1C8_LEVEL_COMPLETE: switch (gCurrentLevel) { case LEVEL_SECTOR_Y: - if (gPlayer[0].unk_1D0 >= 3) { - SectorY_8019FF00(actor); + if (gPlayer[0].csState >= 3) { + SectorY_8019FF00(this); } break; case LEVEL_SOLAR: - if (gPlayer[0].unk_1D0 >= 3) { - Solar_801A8BE8(actor); + if (gPlayer[0].csState >= 3) { + Solar_801A8BE8(this); } break; case LEVEL_ZONESS: - if (gPlayer[0].unk_1D0 >= 3) { - Zoness_8019E5F0(actor); + if (gPlayer[0].csState >= 3) { + Zoness_8019E5F0(this); } break; case LEVEL_VENOM_ANDROSS: case LEVEL_VENOM_2: - Andross_80195E44(actor); + Andross_80195E44(this); break; case LEVEL_KATINA: - Katina_80197F10(actor); + Katina_80197F10(this); break; case LEVEL_SECTOR_Z: - SectorZ_8019DD20(actor); + SectorZ_8019DD20(this); break; case LEVEL_AREA_6: - Area6_8018DA58(actor); + Area6_8018DA58(this); break; case LEVEL_METEO: if (gLevelPhase == 0) { - Meteo_8018ED9C(actor); + Meteo_8018ED9C(this); break; } - func_demo_80049630(actor); + func_demo_80049630(this); break; case LEVEL_FORTUNA: - if (actor->unk_0B6 == 11) { - switch (actor->state) { + if (this->unk_0B6 == 11) { + switch (this->state) { case 0: if (gCsFrameCount == 100) { - actor->state = 1; - actor->timer_0BC = 50; - actor->iwork[0] = 255; - AUDIO_PLAY_SFX(0x2902F026, actor->sfxSource, 0); + this->state = 1; + this->timer_0BC = 50; + this->iwork[0] = 255; + AUDIO_PLAY_SFX(0x2902F026, this->sfxSource, 0); } break; case 1: - Math_SmoothStepToF(&actor->scale, 0.5f, 0.03f, 0.01f, 0.0f); + Math_SmoothStepToF(&this->scale, 0.5f, 0.03f, 0.01f, 0.0f); gFillScreenRed = gFillScreenAlpha = gFillScreenGreen = gFillScreenBlue = 0; - if ((actor->timer_0BC == 43) || (actor->timer_0BC == 46) || (actor->timer_0BC == 49)) { + if ((this->timer_0BC == 43) || (this->timer_0BC == 46) || (this->timer_0BC == 49)) { gFillScreenAlpha = 192; gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; } - actor->iwork[0] -= 2; - if (actor->iwork[0] < 0) { - actor->iwork[0] = 0; - actor->scale = 0.0f; + this->iwork[0] -= 2; + if (this->iwork[0] < 0) { + this->iwork[0] = 0; + this->scale = 0.0f; } - gLight3Brightness = actor->iwork[0] / 255.0f; + gLight3Brightness = this->iwork[0] / 255.0f; gLight3x = gActors[0].obj.pos.x + 10.0f; gLight3y = gActors[0].obj.pos.y - 40.0f; gLight3z = gActors[0].obj.pos.z - 70.0f; @@ -2435,51 +2435,51 @@ void Actor195_Update(Actor* actor) { case LEVEL_CORNERIA: if (gLevelMode == LEVELMODE_ALL_RANGE) { - func_demo_8004E4D4(actor); + func_demo_8004E4D4(this); break; } - func_demo_8004EBD0(actor); + func_demo_8004EBD0(this); break; case LEVEL_SECTOR_X: if (gLevelPhase != 0) { - func_demo_80049630(actor); + func_demo_80049630(this); break; } - func_demo_8004E4D4(actor); + func_demo_8004E4D4(this); break; case LEVEL_TITANIA: - func_demo_8004E4D4(actor); + func_demo_8004E4D4(this); break; case LEVEL_MACBETH: - Macbeth_801B28BC(actor); + Macbeth_801B28BC(this); break; case LEVEL_BOLSE: - func_demo_8004F05C(actor); + func_demo_8004F05C(this); break; default: - func_demo_8004EBD0(actor); + func_demo_8004EBD0(this); break; } break; case PLAYERSTATE_1C8_LEVEL_INTRO: - func_demo_8004F05C(actor); + func_demo_8004F05C(this); break; case PLAYERSTATE_1C8_ENTER_WARP_ZONE: - func_demo_8004F798(actor); + func_demo_8004F798(this); break; case PLAYERSTATE_1C8_STANDBY: if (gCurrentLevel == LEVEL_SECTOR_Y) { - SectorY_8019FF00(actor); + SectorY_8019FF00(this); } break; } @@ -2517,7 +2517,7 @@ void func_demo_8004FCB8(Actor* actor, s32 arg1) { } } -void Actor195_Draw(Actor* actor) { +void ActorCutscene_Draw(Actor* actor) { static f32 D_800CA210 = 0.0f; static f32 D_800CA214 = 0.0f; static f32 D_800CA218 = 0.0f; @@ -2798,7 +2798,7 @@ void Actor195_Draw(Actor* actor) { camX = gPlayer[0].cam.eye.x - actor->obj.pos.x; camY = gPlayer[0].cam.eye.y - actor->obj.pos.y; - camZ = gPlayer[0].cam.eye.z - (actor->obj.pos.z + D_ctx_80177D20); + camZ = gPlayer[0].cam.eye.z - (actor->obj.pos.z + gPathProgress); y = -Math_Atan2F(camX, camZ); x = Math_Atan2F(camY, sqrtf(SQ(camZ) + SQ(camX))); @@ -2830,7 +2830,7 @@ void Actor195_Draw(Actor* actor) { camX = gPlayer[0].cam.eye.x - actor->obj.pos.x; camY = gPlayer[0].cam.eye.y - actor->obj.pos.y; - camZ = gPlayer[0].cam.eye.z - (actor->obj.pos.z + D_ctx_80177D20); + camZ = gPlayer[0].cam.eye.z - (actor->obj.pos.z + gPathProgress); y = -Math_Atan2F(camX, camZ); x = Math_Atan2F(camY, sqrtf(SQ(camZ) + SQ(camX))); @@ -2977,12 +2977,12 @@ void Cutscene_DrawGreatFox(void) { Matrix_Pop(&gGfxMatrix); } - if ((gCurrentLevel == LEVEL_METEO) && (gPlayer[0].timer_1FC != 0)) { + if ((gCurrentLevel == LEVEL_METEO) && (gPlayer[0].csEventTimer != 0)) { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 128); gDPSetEnvColor(gMasterDisp++, 255, 255, 32, 128); Matrix_Translate(gGfxMatrix, D_ctx_80177A48[3] * (-74.0f), -232.0f, 1190.0f, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, D_demo_800CA198[gPlayer[0].timer_1FC], D_demo_800CA198[gPlayer[0].timer_1FC], 1.0f, - MTXF_APPLY); + Matrix_Scale(gGfxMatrix, D_demo_800CA198[gPlayer[0].csEventTimer], D_demo_800CA198[gPlayer[0].csEventTimer], + 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, var_fp); } diff --git a/src/engine/fox_display.c b/src/engine/fox_display.c index dfa8e507..911bea25 100644 --- a/src/engine/fox_display.c +++ b/src/engine/fox_display.c @@ -12,7 +12,7 @@ s16 gReflectY; Matrix D_display_80161418[4]; Vec3f D_display_80161518[4]; Vec3f D_display_80161548[4]; -Vec3f D_display_80161578[4]; +Vec3f gLockOnTargetViewPos[4]; f32 D_display_801615A8[4]; f32 D_display_801615B8[4]; @@ -53,7 +53,7 @@ void func_display_80051B30(void) { Matrix_RotateX(gCalcMatrix, gPlayer[0].camPitch, MTXF_APPLY); sp68.x = gTeamHelpActor->obj.pos.x - gPlayer[0].cam.eye.x; sp68.y = gTeamHelpActor->obj.pos.y - gPlayer[0].cam.eye.y; - sp68.z = gTeamHelpActor->obj.pos.z + D_ctx_80177D20 - gPlayer[0].cam.eye.z; + sp68.z = gTeamHelpActor->obj.pos.z + gPathProgress - gPlayer[0].cam.eye.z; Matrix_MultVec3f(gCalcMatrix, &sp68, &sp5C); sp7C = 0; if ((sp5C.z < 0.0f) && (sp5C.z > -12000.0f) && (fabsf(sp5C.x) < fabsf(sp5C.z * 0.4f))) { @@ -233,11 +233,11 @@ void func_display_8005250C(s32 limbIndex, Vec3f* rot, void* data) { void func_display_80052584(Player* player) { Matrix_Push(&gGfxMatrix); Matrix_Copy(gGfxMatrix, &gIdentityMatrix); - if ((player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (player->timer_1F8 != 0)) { + if ((player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (player->csTimer != 0)) { Matrix_Translate(gGfxMatrix, D_display_801613B0[player->num].x, D_display_801613B0[player->num].y, D_display_801613B0[player->num].z, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, D_display_800CA23C[player->timer_1F8 - 1], D_display_800CA23C[player->timer_1F8 - 1], - D_display_800CA23C[player->timer_1F8 - 1], MTXF_APPLY); + Matrix_Scale(gGfxMatrix, D_display_800CA23C[player->csTimer - 1], D_display_800CA23C[player->csTimer - 1], + D_display_800CA23C[player->csTimer - 1], MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL_40(); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); @@ -617,7 +617,7 @@ void func_display_80053C38(Player* player, s32 arg1) { Matrix_MultVec3f(gGfxMatrix, &sp4C, &D_display_801613E0[1]); } if (player->cockpitView && (gLevelMode == LEVELMODE_ON_RAILS) && - (fabsf(player->unk_138 + D_ctx_80177D20 - player->cam.eye.z) < 10.0f)) { + (fabsf(player->trueZpos + gPathProgress - player->cam.eye.z) < 10.0f)) { if (arg1 == 0) { sDrawCockpit = 1; Matrix_Push(&gGfxMatrix); @@ -711,10 +711,10 @@ void func_display_80054300(Player* player) { Math_SmoothStepToF(&sPlayerShadowing, player->shadowing, 1.0f, 10.0f, 0.0f); RCP_SetupDL(&gMasterDisp, 0x42); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, (s32) sPlayerShadowing); - if (player->unk_068 > 30.0f) { + if (player->groundPos.y > 30.0f) { gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); } - if ((gGroundSurface == SURFACE_WATER) && (player->unk_068 < 10.0f)) { + if ((gGroundSurface == SURFACE_WATER) && (player->groundPos.y < 10.0f)) { player->shadowing = 90; } else { player->shadowing = 180; @@ -782,7 +782,7 @@ void func_display_8005478C(Player* player) { RCP_SetupDL_64(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 100); Matrix_Push(&gGfxMatrix); - Matrix_RotateZ(gGfxMatrix, player->unk_0F8 * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, player->bankAngle * M_DTOR, MTXF_APPLY); if (player->form == FORM_LANDMASTER) { if (player->unk_194 <= 0.0f) { Matrix_Pop(&gGfxMatrix); @@ -807,23 +807,26 @@ void func_display_80054914(Player* player) { Vec3f sp40; Vec3f sp34; - if (player->unk_280 != 0) { - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_134 + player->unk_4D8) * M_DTOR), + if (player->barrelRollAlpha != 0) { + Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + player->damageShake + 180.0f) * M_DTOR, + MTXF_NEW); + Matrix_RotateX(gCalcMatrix, + -((player->xRot_120 + player->rot.x + player->damageShake + player->aerobaticPitch) * M_DTOR), MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), MTXF_APPLY); - Matrix_Translate(gCalcMatrix, player->unk_084, player->unk_080, 0.0f, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -((player->bankAngle + player->rockAngle + player->damageShake) * M_DTOR), + MTXF_APPLY); + Matrix_Translate(gCalcMatrix, player->xShake, player->yBob, 0.0f, MTXF_APPLY); sp40.x = 0.0f; sp40.y = 0.0f; sp40.z = -30.0f; Matrix_MultVec3f(gCalcMatrix, &sp40, &sp34); sp4C = 1.0f; - if (player->unk_1F0 < 0) { + if (player->baseRollRate < 0) { sp4C = -1.0f; } Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, player->pos.x + sp34.x, player->pos.y + sp34.y, - player->unk_138 + player->unk_144 + sp34.z, MTXF_APPLY); + player->trueZpos + player->zPath + sp34.z, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].camYaw, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].camPitch, MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 20.0f * sp4C * M_DTOR, MTXF_APPLY); @@ -832,13 +835,13 @@ void func_display_80054914(Player* player) { } else { Matrix_Scale(gGfxMatrix, 1.2f, 1.2f, 1.2f, MTXF_APPLY); } - if (player->unk_1F0 < 0) { + if (player->baseRollRate < 0) { Matrix_RotateX(gGfxMatrix, M_PI, MTXF_APPLY); } Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL(&gMasterDisp, 0x43); - gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, player->unk_280); - gDPSetEnvColor(gMasterDisp++, 0, 0, 160, player->unk_280); + gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, player->barrelRollAlpha); + gDPSetEnvColor(gMasterDisp++, 0, 0, 160, player->barrelRollAlpha); gSPDisplayList(gMasterDisp++, D_101DC10); Matrix_Pop(&gGfxMatrix); } @@ -929,7 +932,7 @@ void func_display_80054E80(Player* player) { gSPDisplayList(gMasterDisp++, D_1024AC0); Matrix_Pop(&gGfxMatrix); } - if (D_ctx_80177AA0[player->num] > 0.1f) { + if (gMuzzleFlashScale[player->num] > 0.1f) { Matrix_Push(&gGfxMatrix); RCP_SetupDL(&gMasterDisp, 0x43); Matrix_Copy(gCalcMatrix, &D_display_80161418[player->num]); @@ -948,7 +951,8 @@ void func_display_80054E80(Player* player) { } Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, sp94.x, sp94.y, sp94.z, MTXF_NEW); - Matrix_Scale(gGfxMatrix, D_ctx_80177AA0[player->num], D_ctx_80177AA0[player->num], 1.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, gMuzzleFlashScale[player->num], gMuzzleFlashScale[player->num], 1.0f, + MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); Matrix_Pop(&gGfxMatrix); @@ -966,13 +970,15 @@ void func_display_80054E80(Player* player) { Matrix_MultVec3f(gCalcMatrix, &spA0, &sp88); Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, sp94.x, sp94.y, sp94.z, MTXF_NEW); - Matrix_Scale(gGfxMatrix, D_ctx_80177AA0[player->num], D_ctx_80177AA0[player->num], 1.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, gMuzzleFlashScale[player->num], gMuzzleFlashScale[player->num], 1.0f, + MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, sp88.x, sp88.y, sp88.z, MTXF_NEW); - Matrix_Scale(gGfxMatrix, D_ctx_80177AA0[player->num], D_ctx_80177AA0[player->num], 1.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, gMuzzleFlashScale[player->num], gMuzzleFlashScale[player->num], 1.0f, + MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); Matrix_Pop(&gGfxMatrix); @@ -1042,14 +1048,15 @@ void func_display_80055B58(Player* player) { if ((player->unk_234 != 0) && (player->state_1C8 != PLAYERSTATE_1C8_DOWN)) { switch (player->form) { case FORM_ARWING: - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134 + 180.0f) * M_DTOR, + Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + player->damageShake + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, - -((player->unk_120 + player->unk_0E4 + player->unk_134 + player->unk_4D8) * M_DTOR), + Matrix_RotateX( + gCalcMatrix, + -((player->xRot_120 + player->rot.x + player->damageShake + player->aerobaticPitch) * M_DTOR), + MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -((player->bankAngle + player->rockAngle + player->damageShake) * M_DTOR), MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), - MTXF_APPLY); - Matrix_Translate(gCalcMatrix, player->unk_084, player->unk_080, 0.0f, MTXF_APPLY); + Matrix_Translate(gCalcMatrix, player->xShake, player->yBob, 0.0f, MTXF_APPLY); var_fv0 = player->unk_194 * 30.0f; if (var_fv0 > 30.0f) { var_fv0 = 30.0f; @@ -1062,7 +1069,7 @@ void func_display_80055B58(Player* player) { Matrix_MultVec3f(gCalcMatrix, &sp4C, &sp40); Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, player->pos.x + sp40.x, player->pos.y + sp40.y, - player->unk_138 + player->unk_144 + sp40.z, MTXF_APPLY); + player->trueZpos + player->zPath + sp40.z, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].camYaw, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].camPitch, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -1102,17 +1109,17 @@ void func_display_80055E98(Player* player) { sp5C = 108.0f; sp58 = -22.0f; } - if (player->unk_25C != 0.0f) { + if (player->contrailScale != 0.0f) { sp54 = 0.0f; if ((gGameFrameCount % 2) != 0) { sp54 = 180.0f; } - var_fs0 = player->unk_0E8; + var_fs0 = player->rot.y; if (var_fs0 > 90.0f) { var_fs0 -= 180.0f; } var_fs0 = var_fs0 * 0.25f; - sp50 = player->unk_0E4 * 0.25f; + sp50 = player->rot.x * 0.25f; if (player->state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) { var_fs0 = 0.0f; sp50 = 0.0f; @@ -1124,7 +1131,7 @@ void func_display_80055E98(Player* player) { Matrix_Translate(gGfxMatrix, sp5C, sp58, -100.0f, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, M_DTOR * sp50, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, -(M_DTOR * var_fs0), MTXF_APPLY); - Matrix_Scale(gGfxMatrix, player->unk_25C, 1.0f, 50.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, player->contrailScale, 1.0f, 50.0f, MTXF_APPLY); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -17.5f, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, M_DTOR * sp54, MTXF_APPLY); @@ -1137,7 +1144,7 @@ void func_display_80055E98(Player* player) { Matrix_Translate(gGfxMatrix, -sp5C, sp58, -100.0f, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, M_DTOR * sp50, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, -(M_DTOR * var_fs0), MTXF_APPLY); - Matrix_Scale(gGfxMatrix, player->unk_25C, 1.0f, 50.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, player->contrailScale, 1.0f, 50.0f, MTXF_APPLY); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -17.5f, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, M_DTOR * sp54, MTXF_APPLY); @@ -1152,11 +1159,12 @@ void func_display_80056230(Player* player) { if ((player->unk_234 != 0) && (player->form == FORM_ARWING) && (gCurrentLevel != LEVEL_VENOM_ANDROSS) && (gCurrentLevel != LEVEL_TRAINING) && (gLevelType == LEVELTYPE_PLANET)) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, player->pos.x, player->pos.y, player->unk_138 + player->unk_144, MTXF_APPLY); - Matrix_RotateY(gGfxMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_APPLY); - Matrix_RotateX(gGfxMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); - Matrix_RotateZ(gGfxMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), MTXF_APPLY); - Matrix_Translate(gGfxMatrix, player->unk_084, player->unk_080, 0.0f, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, player->pos.x, player->pos.y, player->trueZpos + player->zPath, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -((player->xRot_120 + player->rot.x + player->aerobaticPitch) * M_DTOR), MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, -((player->bankAngle + player->rockAngle + player->damageShake) * M_DTOR), + MTXF_APPLY); + Matrix_Translate(gGfxMatrix, player->xShake, player->yBob, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); func_display_80055E98(player); Matrix_Pop(&gGfxMatrix); @@ -1193,19 +1201,19 @@ void func_display_800564C0(Player* player, s32 arg1) { if (player->unk_234 != 0) { Matrix_Push(&gGfxMatrix); if (player->form == FORM_LANDMASTER) { - if (player->unk_1D4 != 0) { + if (player->grounded) { Matrix_Translate(gGfxMatrix, 0.0f, gCameraShakeY, 0.0f, MTXF_APPLY); } Matrix_Translate(gGfxMatrix, player->pos.x, player->pos.y + player->unk_18C + 30.0f, - player->unk_138 + player->unk_144, MTXF_APPLY); + player->trueZpos + player->zPath, MTXF_APPLY); if (gVersusMode) { for (i = 0; i < gCamCount; i++) { if (gVsLockOnTimers[player->num][i] != 0) { - Matrix_MultVec3f(gGfxMatrix, &sp50, &D_display_80161578[i]); + Matrix_MultVec3f(gGfxMatrix, &sp50, &gLockOnTargetViewPos[i]); if ((i == gPlayerNum) && - ((D_display_80161578[i].z > 300.0f) || (D_display_80161578[i].z < -8000.0f) || - (fabsf(D_display_80161578[i].x) > (fabsf(D_display_80161578[i].z * 0.5f) + 100.0f)) || - (fabsf(D_display_80161578[i].y)) > (fabsf(D_display_80161578[i].z * 0.5f) + 100.0f))) { + ((gLockOnTargetViewPos[i].z > 300.0f) || (gLockOnTargetViewPos[i].z < -8000.0f) || + (fabsf(gLockOnTargetViewPos[i].x) > (fabsf(gLockOnTargetViewPos[i].z * 0.5f) + 100.0f)) || + (fabsf(gLockOnTargetViewPos[i].y)) > (fabsf(gLockOnTargetViewPos[i].z * 0.5f) + 100.0f))) { gVsLockOnTimers[player->num][i] = 0; } @@ -1216,18 +1224,18 @@ void func_display_800564C0(Player* player, s32 arg1) { Matrix_Pop(&gGfxMatrix); return; } - Matrix_RotateX(gGfxMatrix, (player->unk_0E4 + player->unk_134) * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gGfxMatrix, (player->unk_0EC + player->unk_0F0 + player->unk_134) * M_DTOR, MTXF_APPLY); - Matrix_RotateY(gGfxMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, (player->rot.x + player->damageShake) * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, (player->rot.z + player->rockAngle + player->damageShake) * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_APPLY); if (gVersusMode) { Matrix_RotateX(gGfxMatrix, player->unk_000 * M_DTOR, MTXF_APPLY); } - Matrix_RotateZ(gGfxMatrix, (-player->unk_12C - player->unk_130) * M_DTOR, MTXF_APPLY); - Matrix_Translate(gGfxMatrix, player->unk_084, player->unk_080 - 30.0f, 0.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, (-player->zRotBank - player->zRotBarrelRoll) * M_DTOR, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, player->xShake, player->yBob - 30.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); } else if (player->form == FORM_ON_FOOT) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, player->pos.x, player->pos.y, player->unk_138 + player->unk_144, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, player->pos.x, player->pos.y, player->trueZpos + player->zPath, MTXF_APPLY); if (!func_display_800563B4(player->num, arg1)) { Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix); @@ -1235,22 +1243,24 @@ void func_display_800564C0(Player* player, s32 arg1) { } Matrix_Pop(&gGfxMatrix); Matrix_Translate(gCalcMatrix, player->pos.x, player->pos.y + gCameraShakeY, - player->unk_138 + player->unk_144, MTXF_NEW); - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134 + 180.0f) * M_DTOR, + player->trueZpos + player->zPath, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + player->damageShake + 180.0f) * M_DTOR, MTXF_APPLY); - Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_134) * M_DTOR), MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), MTXF_APPLY); - Matrix_Translate(gCalcMatrix, player->unk_084, player->unk_080, 0.0f, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, -((player->xRot_120 + player->rot.x + player->damageShake) * M_DTOR), + MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -((player->bankAngle + player->rockAngle + player->damageShake) * M_DTOR), + MTXF_APPLY); + Matrix_Translate(gCalcMatrix, player->xShake, player->yBob, 0.0f, MTXF_APPLY); } else { - Matrix_Translate(gGfxMatrix, player->pos.x, player->pos.y, player->unk_138 + player->unk_144, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, player->pos.x, player->pos.y, player->trueZpos + player->zPath, MTXF_APPLY); if (gVersusMode) { for (i = 0; i < gCamCount; i++) { if (gVsLockOnTimers[player->num][i] != 0) { - Matrix_MultVec3f(gGfxMatrix, &sp50, &D_display_80161578[i]); + Matrix_MultVec3f(gGfxMatrix, &sp50, &gLockOnTargetViewPos[i]); if ((i == gPlayerNum) && - ((D_display_80161578[i].z > 300.0f) || (D_display_80161578[i].z < -8000.0f) || - (fabsf(D_display_80161578[i].x) > (fabsf(D_display_80161578[i].z * 0.5f) + 100.0f)) || - (fabsf(D_display_80161578[i].y) > (fabsf(D_display_80161578[i].z * 0.5f) + 100.0f)))) { + ((gLockOnTargetViewPos[i].z > 300.0f) || (gLockOnTargetViewPos[i].z < -8000.0f) || + (fabsf(gLockOnTargetViewPos[i].x) > (fabsf(gLockOnTargetViewPos[i].z * 0.5f) + 100.0f)) || + (fabsf(gLockOnTargetViewPos[i].y) > (fabsf(gLockOnTargetViewPos[i].z * 0.5f) + 100.0f)))) { gVsLockOnTimers[player->num][i] = 0; } @@ -1261,13 +1271,15 @@ void func_display_800564C0(Player* player, s32 arg1) { Matrix_Pop(&gGfxMatrix); return; } - Matrix_RotateY(gGfxMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134 + 180.0f) * M_DTOR, + Matrix_RotateY(gGfxMatrix, (player->yRot_114 + player->rot.y + player->damageShake + 180.0f) * M_DTOR, MTXF_APPLY); - Matrix_RotateX(gGfxMatrix, - -((player->unk_120 + player->unk_0E4 + player->unk_4D8 + player->unk_134) * M_DTOR), + Matrix_RotateX( + gGfxMatrix, + -((player->xRot_120 + player->rot.x + player->aerobaticPitch + player->damageShake) * M_DTOR), + MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, -((player->bankAngle + player->rockAngle + player->damageShake) * M_DTOR), MTXF_APPLY); - Matrix_RotateZ(gGfxMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), MTXF_APPLY); - Matrix_Translate(gGfxMatrix, player->unk_084, player->unk_080, 0.0f, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, player->xShake, player->yBob, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); } switch (player->unk_200) { @@ -1293,7 +1305,7 @@ void func_display_800564C0(Player* player, s32 arg1) { break; } if (arg1 != 0) { - func_edisplay_800596C0(); + Object_ApplyWaterDistortion(); } else { Matrix_Copy(&D_display_80161418[player->num], gGfxMatrix); } @@ -1322,41 +1334,45 @@ void func_display_80056E2C(Player* player) { if ((player->unk_234 != 0) && (player->unk_240 == 0)) { sp34 = D_display_800CA334[gGameFrameCount % 8U]; sp30 = D_display_800CA334[(gGameFrameCount + 4) % 8U]; - if (player->unk_1D4 != 0) { + if (player->grounded) { sp34 = sp30 = 0.0f; } Matrix_Push(&gGfxMatrix); if (gLevelMode == LEVELMODE_ALL_RANGE) { if (player->form == FORM_ON_FOOT) { - Matrix_Translate(gGfxMatrix, player->unk_064, player->unk_068 + 2.0f, player->unk_06C, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, player->groundPos.x, player->groundPos.y + 2.0f, player->groundPos.z, + MTXF_APPLY); } else { - Matrix_Translate(gGfxMatrix, player->unk_064, player->unk_068 + 2.0f, player->unk_06C, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, player->groundPos.x, player->groundPos.y + 2.0f, player->groundPos.z, + MTXF_APPLY); } } else { - Matrix_Translate(gGfxMatrix, player->unk_064, player->unk_068 + 2.0f, player->unk_06C + player->unk_144, - MTXF_APPLY); + Matrix_Translate(gGfxMatrix, player->groundPos.x, player->groundPos.y + 2.0f, + player->groundPos.z + player->zPath, MTXF_APPLY); } - Matrix_RotateY(gGfxMatrix, player->unk_070, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, player->groundRotY, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, player->unk_248, MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, player->unk_24C, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 0.8f + sp34, 0.0f, 0.8f + sp30, MTXF_APPLY); if ((player->form == FORM_ARWING) || (player->form == FORM_BLUE_MARINE) || (player->form == FORM_ON_FOOT)) { - sp2C = player->unk_0F8 + player->unk_0F0 + player->unk_134; + sp2C = player->bankAngle + player->rockAngle + player->damageShake; if (((sp2C > 70.0f) && (sp2C < 110.0f)) || ((sp2C < -70.0f) && (sp2C > -110.0f))) { sp2C = 70.0f; } - Matrix_RotateY(gGfxMatrix, -player->unk_070, MTXF_APPLY); - Matrix_RotateY(gGfxMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134) * M_DTOR, MTXF_APPLY); - Matrix_RotateX(gGfxMatrix, - -((player->unk_120 + player->unk_0E4 + player->unk_4D8 + player->unk_134) * M_DTOR), - MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, -player->groundRotY, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, (player->yRot_114 + player->rot.y + player->damageShake) * M_DTOR, MTXF_APPLY); + Matrix_RotateX( + gGfxMatrix, + -((player->xRot_120 + player->rot.x + player->aerobaticPitch + player->damageShake) * M_DTOR), + MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, M_DTOR * sp2C, MTXF_APPLY); } else { - Matrix_RotateY(gGfxMatrix, player->unk_114 * M_DTOR, MTXF_APPLY); - Matrix_RotateX(gGfxMatrix, (player->unk_0E4 + player->unk_4D8 + player->unk_134) * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gGfxMatrix, (player->unk_0EC + player->unk_0F0 + player->unk_134) * M_DTOR, MTXF_APPLY); - Matrix_RotateY(gGfxMatrix, player->unk_0E8 * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gGfxMatrix, (-player->unk_12C - player->unk_130) * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, player->yRot_114 * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, (player->rot.x + player->aerobaticPitch + player->damageShake) * M_DTOR, + MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, (player->rot.z + player->rockAngle + player->damageShake) * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, player->rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, (-player->zRotBank - player->zRotBarrelRoll) * M_DTOR, MTXF_APPLY); } func_display_80054300(player); Matrix_Pop(&gGfxMatrix); @@ -1407,8 +1423,8 @@ void func_display_80057504(void) { f32 var_fs0; for (i = 0; i < gCamCount; i++) { - if (D_display_80161578[i].z < 0.0f) { - var_fs0 = (VEC3F_MAG(&D_display_80161578[i])); + if (gLockOnTargetViewPos[i].z < 0.0f) { + var_fs0 = (VEC3F_MAG(&gLockOnTargetViewPos[i])); if (var_fs0 < 20000.0f) { var_fs0 *= 0.0015f; if (var_fs0 > 100.0f) { @@ -1418,8 +1434,8 @@ void func_display_80057504(void) { var_fs0 = 1.2f; } Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, D_display_80161578[i].x, D_display_80161578[i].y, D_display_80161578[i].z, - MTXF_APPLY); + Matrix_Translate(gGfxMatrix, gLockOnTargetViewPos[i].x, gLockOnTargetViewPos[i].y, + gLockOnTargetViewPos[i].z, MTXF_APPLY); if ((gPlayState != PLAY_PAUSE) && (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); @@ -1438,8 +1454,8 @@ void func_display_80057504(void) { } for (j = 0; j < gCamCount; j++) { - D_display_80161578[j].x = D_display_80161578[j].y = 0.f; - D_display_80161578[j].z = 100.0f; + gLockOnTargetViewPos[j].x = gLockOnTargetViewPos[j].y = 0.f; + gLockOnTargetViewPos[j].z = 100.0f; } } @@ -1449,7 +1465,7 @@ void func_display_80057814(Player* player) { sp20.x = player->pos.x; sp20.y = player->pos.y; - sp20.z = player->unk_138; + sp20.z = player->trueZpos; sp2C.x = player->sfxSource[0]; sp2C.y = player->sfxSource[1]; sp2C.z = player->sfxSource[2]; @@ -1460,7 +1476,7 @@ void func_display_80057814(Player* player) { player->sfx.srcVel = player->sfxVel; player->sfx.srcPos = player->sfxSource; player->sfx.yVel = player->vel.y; - player->sfx.zRot = player->unk_0F8; + player->sfx.zRot = player->bankAngle; } void func_display_800578C4(Player* player) { @@ -1483,14 +1499,14 @@ void func_display_800578C4(Player* player) { case 1: case 2: case 3: - sp38 = Math_RadToDeg(player->camPitch) + player->unk_0E4; + sp38 = Math_RadToDeg(player->camPitch) + player->rot.x; if (sp38 > 360.0f) { sp38 -= 360.0f; } if (sp38 < 0.0f) { sp38 += 360.0f; } - sp3C = (Math_RadToDeg(player->camYaw) + 180.0f) - player->unk_0E8; + sp3C = (Math_RadToDeg(player->camYaw) + 180.0f) - player->rot.y; if (sp3C > 360.0f) { sp3C -= 360.0f; } @@ -1504,15 +1520,15 @@ void func_display_800578C4(Player* player) { Math_SmoothStepToF(&D_display_800CA384, gControllerPress->stick_x * 3.0f, 0.1f, 5.0f, 0.0f); Math_SmoothStepToF(&D_display_800CA388, D_display_800CA38C[D_display_800CA220], 0.1f, 10.0f, 0.0f); sp4C.z = D_display_800CA388; - Matrix_RotateX(gCalcMatrix, (player->unk_0E8 + D_display_800CA380) * M_DTOR, MTXF_NEW); - Matrix_RotateY(gCalcMatrix, (player->unk_0E4 + D_display_800CA384) * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, (player->rot.y + D_display_800CA380) * M_DTOR, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, (player->rot.x + D_display_800CA384) * M_DTOR, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &sp4C, &sp40); gPlayerCamEye.x = player->pos.x + sp40.x; gPlayerCamEye.y = player->pos.y + sp40.y + 20.0f; - gPlayerCamEye.z = player->unk_138 + sp40.z; + gPlayerCamEye.z = player->trueZpos + 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; + gPlayerCamAt.z = (SIN_DEG(gGameFrameCount * 3.5f) * 3.0f) + player->trueZpos; break; } } @@ -1546,24 +1562,24 @@ void Play_Draw(void) { Lights_SetOneLight(&gMasterDisp, gLight1x, gLight1y, gLight1z, gLight1R, gLight1G, gLight1B, gAmbientR, gAmbientG, gAmbientB); if (gLevelMode == LEVELMODE_ON_RAILS) { - Matrix_RotateY(gCalcMatrix, player->unk_114 * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, player->unk_120 * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, player->yRot_114 * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, player->xRot_120 * M_DTOR, MTXF_APPLY); tempVec.x = player->cam.eye.x - player->pos.x; tempVec.y = player->cam.eye.y - player->pos.y; - tempVec.z = player->cam.eye.z - (player->unk_138 + player->unk_144); + tempVec.z = player->cam.eye.z - (player->trueZpos + player->zPath); Matrix_MultVec3f(gCalcMatrix, &tempVec, &gPlayerCamEye); gPlayerCamEye.x += player->pos.x; gPlayerCamEye.y += player->pos.y; - gPlayerCamEye.z += player->unk_138 + player->unk_144; + gPlayerCamEye.z += player->trueZpos + player->zPath; tempVec.x = player->cam.at.x - player->pos.x; tempVec.y = player->cam.at.y - player->pos.y; - tempVec.z = player->cam.at.z - (player->unk_138 + player->unk_144); + tempVec.z = player->cam.at.z - (player->trueZpos + player->zPath); Matrix_MultVec3f(gCalcMatrix, &tempVec, &gPlayerCamAt); gPlayerCamAt.x += player->pos.x; gPlayerCamAt.y += player->pos.y; - gPlayerCamAt.z += player->unk_138 + player->unk_144; + gPlayerCamAt.z += player->trueZpos + player->zPath; if (player->cockpitView && (player->boostSpeed > 5.0f)) { gPlayerCamAt.x += SIN_DEG(gGameFrameCount * 150.0f) * player->boostSpeed * 0.2f; @@ -1605,8 +1621,8 @@ void Play_Draw(void) { Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, 0.0f, gCameraShakeY, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); - Ground_801B58AC(&gMasterDisp, D_ctx_80177CC8); - D_ctx_80177CC8 = 0.0f; + Ground_801B58AC(&gMasterDisp, gPathGroundScroll); + gPathGroundScroll = 0.0f; Matrix_Pop(&gGfxMatrix); } else if (gGroundSurface != SURFACE_WATER) { D_bg_8015F964 = false; @@ -1618,7 +1634,7 @@ void Play_Draw(void) { for (i = 0, opponent = gPlayer; i < gCamCount; i++, opponent++) { opponentPos.x = opponent->pos.x; opponentPos.y = opponent->pos.y; - opponentPos.z = opponent->unk_138; + opponentPos.z = opponent->trueZpos; Display_SetSecondLight(&opponentPos); func_display_800564C0(opponent, 0); func_display_80057814(opponent); @@ -1631,7 +1647,7 @@ void Play_Draw(void) { for (i = 0, opponent = gPlayer; i < gCamCount; i++, opponent++) { opponentPos.x = opponent->pos.x; opponentPos.y = opponent->pos.y; - opponentPos.z = opponent->unk_138; + opponentPos.z = opponent->trueZpos; func_display_800564C0(opponent, 1); } Matrix_Pop(&gGfxMatrix); diff --git a/src/engine/fox_edata_info.c b/src/engine/fox_edata_info.c index 0b3c7522..19a34307 100644 --- a/src/engine/fox_edata_info.c +++ b/src/engine/fox_edata_info.c @@ -122,20 +122,20 @@ ObjectInfo D_edata_800CC124[0x190] = { /* OBJ_SCENERY_26, */ {(void*) D_CO_6010A50, 0, (ObjectFunc) NULL, D_CO_603EA74, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_SCENERY_27, */ {(void*) D_CO_60143E0, 0, (ObjectFunc) NULL, D_CO_603EAE0, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_SCENERY_28, */ {(void*) D_CO_6014A20, 0, (ObjectFunc) NULL, D_CO_603EB0C, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_29, */ {(void*) func_edisplay_80059B20, 1, (ObjectFunc) func_enmy_800652CC, D_TI_60064FC, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_30, */ {(void*) func_edisplay_80059B20, 1, (ObjectFunc) func_enmy_800652CC, D_TI_6006518, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_31, */ {(void*) func_edisplay_80059B20, 1, (ObjectFunc) func_enmy_800652CC, D_TI_6006564, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_32, */ {(void*) func_edisplay_80059B20, 1, (ObjectFunc) func_enmy_800652CC, D_TI_60065B0, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_33, */ {(void*) func_edisplay_80059B20, 1, (ObjectFunc) func_enmy_800652CC, D_TI_60065FC, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_34, */ {(void*) func_edisplay_80059B20, 1, (ObjectFunc) func_enmy_800652CC, D_TI_6006648, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_35, */ {(void*) func_edisplay_80059B20, 1, (ObjectFunc) func_enmy_800652CC, D_TI_6006694, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_36, */ {(void*) func_edisplay_80059B20, 1, (ObjectFunc) func_enmy_800652CC, D_TI_60066E0, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_37, */ {(void*) func_edisplay_80059B20, 1, (ObjectFunc) func_enmy_800652CC, D_TI_600672C, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_38, */ {(void*) func_edisplay_80059B20, 1, (ObjectFunc) func_enmy_800652CC, D_TI_6006778, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_39, */ {(void*) Obj39_Draw, 1, (ObjectFunc) Obj39_Update, gNoHitbox, 6000.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_TI_SKULL, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, D_TI_60064FC, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_TI_RIB_0, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, D_TI_6006518, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_TI_RIB_1, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, D_TI_6006564, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_TI_RIB_2, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, D_TI_60065B0, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_TI_RIB_3, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, D_TI_60065FC, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_TI_RIB_4, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, D_TI_6006648, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_TI_RIB_5, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, D_TI_6006694, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_TI_RIB_6, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, D_TI_60066E0, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_TI_RIB_7, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, D_TI_600672C, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_TI_RIB_8, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, D_TI_6006778, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_ME_TUNNEL, */ {(void*) MeteoTunnel_Draw, 1, (ObjectFunc) MeteoTunnel_Update, gNoHitbox, 6000.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_SCENERY_40, */ {(void*) func_edisplay_80059F68, 1, (ObjectFunc) func_enmy_80066D5C, D_CO_603E4A4, 1000.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_SCENERY_41, */ {(void*) func_edisplay_80059FDC, 1, (ObjectFunc) func_enmy_80066EA8, D_CO_603E4DC, 300.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_42, */ {(void*) Obj42_Draw, 1, (ObjectFunc) Obj42_Update, D_CO_603E514, 1000.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_42, */ {(void*) Scenery42_Draw, 1, (ObjectFunc) Scenery42_Update, D_CO_603E514, 1000.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_SCENERY_43, */ {(void*) D_ZO_6024AC0, 0, (ObjectFunc) NULL, D_ZO_602B9EC, 200.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_SCENERY_44, */ {(void*) D_ZO_600F560, 0, (ObjectFunc) NULL, D_ZO_602BA20, 1500.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_SCENERY_45, */ {(void*) D_ZO_600EC90, 0, (ObjectFunc) NULL, D_ZO_602BAE4, 1500.0f, 0, 0, 40, 0, 0.0f, 0 }, @@ -147,7 +147,7 @@ ObjectInfo D_edata_800CC124[0x190] = { /* OBJ_SCENERY_51, */ {(void*) D_VE1_6006F50, 0, (ObjectFunc) NULL, D_VE1_601B584, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_SCENERY_52, */ {(void*) D_VE1_6005780, 0, (ObjectFunc) Venom1_80193540, D_VE1_601B5F4, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_SCENERY_53, */ {(void*) D_VE1_6003610, 0, (ObjectFunc) NULL, D_VE1_601B644, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_54, */ {(void*) D_CO_6000E00, 0, (ObjectFunc) Obj54_Update, D_CO_603E0EC, 1000.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_54, */ {(void*) D_CO_6000E00, 0, (ObjectFunc) Scenery54_Update, D_CO_603E0EC, 1000.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_SCENERY_55, */ {(void*) D_CO_6013B50, 0, (ObjectFunc) NULL, D_CO_603E88C, 1000.0f, 0, 0, 41, 0, 0.0f, 0 }, /* OBJ_SCENERY_56, */ {(void*) Corneria_8018F31C, 2, (ObjectFunc) Corneria_8018F044, D_CO_603E8A8, 1000.0f, 0, 0, 39, 0, 0.0f, 0 }, /* OBJ_SCENERY_57, */ {(void*) Titania_8018F8B8, 1, (ObjectFunc) Titania_8018F4D8, D_TI_6006BF0, 800.0f, 0, 0, 40, 0, 0.0f, 0 }, @@ -204,7 +204,7 @@ ObjectInfo D_edata_800CC124[0x190] = { /* OBJ_SCENERY_108 */ {(void*) D_SY_60102C0, 0, (ObjectFunc) NULL, D_SY_6034588, 4000.0f, 0, 0, 41, 0, 0.0f, 0 }, /* OBJ_SCENERY_109 */ {(void*) D_SY_60036A0, 0, (ObjectFunc) SectorY_801A4E44, D_SY_6034664, 4000.0f, 0, 0, 41, 0, 0.0f, 0 }, /* OBJ_SCENERY_110 */ {(void*) D_SY_6005360, 0, (ObjectFunc) NULL, D_SY_6034770, 4000.0f, 0, 0, 41, 0, 0.0f, 0 }, - /* OBJ_SCENERY_111 */ {(void*) Obj111_Draw, 1, (ObjectFunc) NULL, gNoHitbox, 2000.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_SCENERY_111 */ {(void*) Scenery111_Draw, 1, (ObjectFunc) NULL, gNoHitbox, 2000.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJ_SCENERY_112 */ {(void*) D_SY_600F6C0, 0, (ObjectFunc) SectorY_801A52B8, D_SY_60347F0, 4000.0f, 0, 0, 41, 0, 0.0f, 0 }, /* OBJ_SCENERY_113 */ {(void*) D_SY_601B610, 0, (ObjectFunc) NULL, gNoHitbox, 2000.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_SCENERY_114 */ {(void*) D_SY_601C6A0, 0, (ObjectFunc) NULL, gNoHitbox, 2000.0f, 0, 0, 40, 0, 0.0f, 0 }, @@ -288,7 +288,7 @@ ObjectInfo D_edata_800CC124[0x190] = { /* 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*) Actor194_Draw, 1, (ObjectFunc) Actor194_Update, gActor194Hitbox, 200.0f, 0, 1, 39, 0, 0.0f, 1 }, - /* OBJ_ACTOR_195 */ {(void*) Actor195_Draw, 1, (ObjectFunc) Actor195_Update, gNoHitbox, 20000.0f, 0, 1, 39, 0, 0.0f, 0 }, + /* OBJ_ACTOR_CUTSCENE */ {(void*) ActorCutscene_Draw, 1, (ObjectFunc) ActorCutscene_Update, gNoHitbox, 20000.0f, 0, 1, 39, 0, 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, gActorAllRangeHItbox, 20000.0f, 0, 1, 39, 1, 1.0f, 1 }, /* OBJ_ACTOR_TEAM_BOSS */ {(void*) ActorAllRange_Draw, 1, (ObjectFunc) ActorTeamBoss_Update, gTeamHitbox, 20000.0f, 0, 0, 39, 1, 0.0f, 0 }, diff --git a/src/engine/fox_edisplay.c b/src/engine/fox_edisplay.c index c92174f1..52da7fef 100644 --- a/src/engine/fox_edisplay.c +++ b/src/engine/fox_edisplay.c @@ -23,14 +23,14 @@ #include "assets/ast_zoness.h" Vec3f D_edisplay_801615D0; -Vec3f D_edisplay_801615E0; -s32 D_edisplay_801615EC; +Vec3f sViewPos; +s32 sDrewActor; Matrix D_edisplay_801615F0; WingInfo D_edisplay_80161630; char D_edisplay_800CF970[] = "$Id: fox_edisplay.c,v 1.196 1997/05/08 08:31:50 morita Exp $"; -void func_edisplay_800596C0(void) { +void Object_ApplyWaterDistortion(void) { Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 13.0f * M_DTOR, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 1.02f, 0.98f, 1.0f, MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, -(f32) gGameFrameCount * 13.0f * M_DTOR, MTXF_APPLY); @@ -38,7 +38,7 @@ void func_edisplay_800596C0(void) { Matrix_SetGfxMtx(&gMasterDisp); } -void func_edisplay_800597C0(s32 arg0) { +void Object_SetCullDirection(s32 arg0) { if (arg0 < 0) { gSPSetGeometryMode(gMasterDisp++, G_CULL_FRONT); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); @@ -56,7 +56,7 @@ void Sprite168_Draw(Sprite168* this) { RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } -void func_edisplay_800598DC(s32 arg0) { +void Object_dummy_800598DC(s32 arg0) { } void Actor201_Draw(Actor201* this) { @@ -65,7 +65,7 @@ void Actor201_Draw(Actor201* this) { RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } -void func_edisplay_800599A4(s32 limbIndex, Vec3f* rot, void* index) { +void Actor202_PostLimbDraw(s32 limbIndex, Vec3f* rot, void* index) { Vec3f sp24; Vec3f sp18; @@ -95,18 +95,18 @@ void Actor202_Draw(Actor202* this) { Matrix_Translate(gGfxMatrix, 0.f, -temp, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); Animation_GetFrameData(&D_ME_601E8C4, this->unk_0B6, sp30); - Animation_DrawSkeleton(1, D_ME_601E9D0, sp30, NULL, func_edisplay_800599A4, &this->index, &gIdentityMatrix); + Animation_DrawSkeleton(1, D_ME_601E9D0, sp30, NULL, Actor202_PostLimbDraw, &this->index, &gIdentityMatrix); } -void Obj39_Draw(Scenery_39* this) { +void MeteoTunnel_Draw(Scenery_39* this) { gSPDisplayList(gMasterDisp++, D_ME_601AE40); } -void func_edisplay_80059B20(Scenery* scenery) { - if (scenery->obj.id == OBJ_SCENERY_29) { +void Scenery_DrawTitaniaBones(Scenery* scenery) { + if (scenery->obj.id == OBJ_SCENERY_TI_SKULL) { gSPDisplayList(gMasterDisp++, D_TI1_7007350); } else { - Graphics_SetScaleMtx(D_edisplay_800CF9B0[scenery->obj.id + 2]); + Graphics_SetScaleMtx(D_edisplay_800CFA2C[scenery->obj.id - 29]); gSPDisplayList(gMasterDisp++, D_TI1_700BB10); } } @@ -114,7 +114,7 @@ void func_edisplay_80059B20(Scenery* scenery) { void func_edisplay_80059BB0(void* arg0) { } -void Obj42_Draw(Scenery_42* this) { +void Scenery42_Draw(Scenery_42* this) { gSPDisplayList(gMasterDisp++, D_CO_6023AC0); } @@ -515,10 +515,10 @@ void func_edisplay_8005B388(Actor* actor) { (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_STANDBY) || (gCurrentLevel == LEVEL_VENOM_ANDROSS) || (gCurrentLevel == LEVEL_VENOM_2) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE)) && (gCurrentLevel != LEVEL_MACBETH) && (gCurrentLevel != LEVEL_TITANIA)) { - if (actor->obj.id == OBJ_ACTOR_195) { + if (actor->obj.id == OBJ_ACTOR_CUTSCENE) { if (((gCurrentLevel == LEVEL_VENOM_2) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) && (actor->index == 10)) || - ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) && (gPlayer[0].unk_1D0 >= 100) && + ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) && (gPlayer[0].csState >= 100) && (gCurrentLevel == LEVEL_KATINA) && (actor->index == 1)) || ((gCurrentLevel == LEVEL_SECTOR_Y) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_STANDBY) && (actor->state == 5))) { @@ -634,7 +634,7 @@ void func_edisplay_8005BAB4(ObjectId objId, s32 index) { } RCP_SetupDL(&gMasterDisp, 0x40); break; - case OBJ_ACTOR_195: + case OBJ_ACTOR_CUTSCENE: case OBJ_ACTOR_TEAM_BOSS: case OBJ_ACTOR_EVENT: switch (gActors[index].unk_0B4) { @@ -782,7 +782,7 @@ void ItemCheckpoint_Draw(ItemCheckpoint* this) { for (i = 0; i < 8; i++) { Matrix_Push(&gGfxMatrix); Matrix_RotateZ(gGfxMatrix, i * 45.0f * M_DTOR, MTXF_APPLY); - Matrix_Translate(gGfxMatrix, 2.0f * this->scale, 0.0f, 0.0f, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 2.0f * this->width, 0.0f, 0.0f, MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, (gGameFrameCount + (i * 110.0f)) * M_DTOR * 7.2f * this->unk_54, MTXF_APPLY); Graphics_SetScaleMtx(2.0f * this->unk_50); gSPDisplayList(gMasterDisp++, D_101CAE0); @@ -795,7 +795,7 @@ void ItemSilverRing_Draw(ItemSilverRing* this) { RCP_SetupDL(&gMasterDisp, 0x1D); gSPTexture(gMasterDisp++, 3000, 0, 0, G_TX_RENDERTILE, G_ON); gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR); - Graphics_SetScaleMtx(this->scale); + Graphics_SetScaleMtx(this->width); gSPDisplayList(gMasterDisp++, D_101A570); gSPClearGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR); } @@ -804,7 +804,7 @@ void ItemSilverStar_Draw(ItemSilverStar* this) { RCP_SetupDL(&gMasterDisp, 0x1D); gSPTexture(gMasterDisp++, 3000, 0, 0, G_TX_RENDERTILE, G_ON); gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR); - Graphics_SetScaleMtx(this->scale); + Graphics_SetScaleMtx(this->width); gSPDisplayList(gMasterDisp++, D_1019CA0); gSPClearGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR); } @@ -813,17 +813,17 @@ void ItemGoldRing_Draw(ItemGoldRing* this) { RCP_SetupDL(&gMasterDisp, 0x1D); gSPTexture(gMasterDisp++, 1900, 1700, 0, G_TX_RENDERTILE, G_ON); gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR); - Graphics_SetScaleMtx(this->scale); + Graphics_SetScaleMtx(this->width); gSPDisplayList(gMasterDisp++, D_1016870); gSPClearGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR); } void ItemBomb_Draw(ItemBomb* this) { if (gCurrentLevel == LEVEL_AQUAS) { - Graphics_SetScaleMtx(this->scale); + Graphics_SetScaleMtx(this->width); gSPDisplayList(gMasterDisp++, D_blue_marine_3005980); } else { - Graphics_SetScaleMtx(this->scale * 0.1f); + Graphics_SetScaleMtx(this->width * 0.1f); RCP_SetupDL(&gMasterDisp, 0x1D); gSPTexture(gMasterDisp++, 2000, 2000, 0, G_TX_RENDERTILE, G_ON); gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN); @@ -836,7 +836,7 @@ void ItemBomb_Draw(ItemBomb* this) { } void ItemLasers_Draw(ItemLasers* this) { - Graphics_SetScaleMtx(this->scale * 0.1f); + Graphics_SetScaleMtx(this->width * 0.1f); RCP_SetupDL(&gMasterDisp, 0x1D); gSPTexture(gMasterDisp++, 2000, 2000, 0, G_TX_RENDERTILE, G_ON); gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN); @@ -851,7 +851,7 @@ void ItemMeteoWarp_Draw(ItemMeteoWarp* this) { s32 i; this->obj.rot.y = (Math_Atan2F(gPlayer[gPlayerNum].cam.eye.x - this->obj.pos.x, - gPlayer[gPlayerNum].cam.eye.z - (this->obj.pos.z + D_ctx_80177D20)) * + gPlayer[gPlayerNum].cam.eye.z - (this->obj.pos.z + gPathProgress)) * 180.0f) / M_PI; if (this->state != 0) { @@ -864,7 +864,7 @@ void ItemMeteoWarp_Draw(ItemMeteoWarp* this) { for (i = 0; i < 7; i++) { Matrix_Push(&gGfxMatrix); Matrix_RotateZ(gGfxMatrix, (i * 360.0f / 7.0f) * M_DTOR, MTXF_APPLY); - Matrix_Translate(gGfxMatrix, 0.0f, this->scale, 0.0f, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, this->width, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_102FE80); Matrix_Pop(&gGfxMatrix); @@ -874,7 +874,7 @@ void ItemMeteoWarp_Draw(ItemMeteoWarp* this) { void func_edisplay_8005D008(Object* obj, s32 drawType) { if (drawType == 2) { - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, D_ctx_80177D20, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, gPathProgress, MTXF_APPLY); Matrix_Translate(gCalcMatrix, obj->pos.x, obj->pos.y, obj->pos.z, MTXF_NEW); Matrix_Push(&gGfxMatrix); Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); @@ -884,7 +884,7 @@ void func_edisplay_8005D008(Object* obj, s32 drawType) { Matrix_RotateX(gCalcMatrix, obj->rot.x * M_DTOR, MTXF_APPLY); Matrix_RotateZ(gCalcMatrix, obj->rot.z * M_DTOR, MTXF_APPLY); } else { - Matrix_Translate(gGfxMatrix, obj->pos.x, obj->pos.y, obj->pos.z + D_ctx_80177D20, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, obj->pos.x, obj->pos.y, obj->pos.z + gPathProgress, MTXF_APPLY); Matrix_Copy(&D_edisplay_801615F0, gGfxMatrix); Matrix_RotateY(gGfxMatrix, obj->rot.y * M_DTOR, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, obj->rot.x * M_DTOR, MTXF_APPLY); @@ -895,7 +895,7 @@ void func_edisplay_8005D008(Object* obj, s32 drawType) { void func_edisplay_8005D1F0(Object* obj, s32 drawType) { if (drawType == 2) { - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, D_ctx_80177D20, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, gPathProgress, MTXF_APPLY); Matrix_Translate(gCalcMatrix, obj->pos.x, obj->pos.y, obj->pos.z, MTXF_NEW); Matrix_Push(&gGfxMatrix); Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); @@ -905,7 +905,7 @@ void func_edisplay_8005D1F0(Object* obj, s32 drawType) { Matrix_RotateX(gCalcMatrix, obj->rot.x * M_DTOR, MTXF_APPLY); Matrix_RotateZ(gCalcMatrix, obj->rot.z * M_DTOR, MTXF_APPLY); } else { - Matrix_Translate(gGfxMatrix, obj->pos.x, obj->pos.y, obj->pos.z + D_ctx_80177D20, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, obj->pos.x, obj->pos.y, obj->pos.z + gPathProgress, MTXF_APPLY); Matrix_Copy(&D_edisplay_801615F0, gGfxMatrix); Matrix_RotateY(gGfxMatrix, obj->rot.y * M_DTOR, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, obj->rot.x * M_DTOR, MTXF_APPLY); @@ -915,7 +915,7 @@ void func_edisplay_8005D1F0(Object* obj, s32 drawType) { void func_edisplay_8005D3CC(Object* obj, f32 xRot, f32 yRot, f32 zRot, s32 drawType) { if (drawType == 2) { - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, D_ctx_80177D20, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, gPathProgress, MTXF_APPLY); Matrix_Translate(gCalcMatrix, obj->pos.x, obj->pos.y, obj->pos.z, MTXF_NEW); Matrix_Push(&gGfxMatrix); Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); @@ -928,7 +928,7 @@ void func_edisplay_8005D3CC(Object* obj, f32 xRot, f32 yRot, f32 zRot, s32 drawT Matrix_RotateX(gCalcMatrix, obj->rot.x * M_DTOR, MTXF_APPLY); Matrix_RotateZ(gCalcMatrix, obj->rot.z * M_DTOR, MTXF_APPLY); } else { - Matrix_Translate(gGfxMatrix, obj->pos.x, obj->pos.y, obj->pos.z + D_ctx_80177D20, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, obj->pos.x, obj->pos.y, obj->pos.z + gPathProgress, MTXF_APPLY); Matrix_Copy(&D_edisplay_801615F0, gGfxMatrix); Matrix_RotateY(gGfxMatrix, M_DTOR * yRot, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, M_DTOR * xRot, MTXF_APPLY); @@ -950,7 +950,7 @@ void Scenery_Draw(Scenery* this, s32 arg1) { RCP_SetupDL_57(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); if (arg1 < 0) { - func_edisplay_800596C0(); + Object_ApplyWaterDistortion(); } gSPDisplayList(gMasterDisp++, this->info.dList); RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); @@ -961,9 +961,9 @@ void Scenery_Draw(Scenery* this, s32 arg1) { } RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } - func_edisplay_800597C0(arg1); + Object_SetCullDirection(arg1); if (arg1 < 0) { - func_edisplay_800596C0(); + Object_ApplyWaterDistortion(); } gSPDisplayList(gMasterDisp++, this->info.dList); if (this->obj.id == OBJ_SCENERY_8) { @@ -971,7 +971,7 @@ void Scenery_Draw(Scenery* this, s32 arg1) { } } } else if (this->info.draw != NULL) { - func_edisplay_800597C0(arg1); + Object_SetCullDirection(arg1); this->info.draw(&this->obj); } } @@ -1027,9 +1027,9 @@ void Actor_DrawOnRails(Actor* this) { } } if ((this->lockOnTimers[TEAM_ID_FOX] != 0) && (gReflectY > 0)) { - sp34.y += this->info.unk_1C; - Matrix_MultVec3f(gGfxMatrix, &sp34, &D_display_80161578[0]); - if (D_display_80161578[0].z > -200.0f) { + sp34.y += this->info.targetOffset; + Matrix_MultVec3f(gGfxMatrix, &sp34, &gLockOnTargetViewPos[TEAM_ID_FOX]); + if (gLockOnTargetViewPos[TEAM_ID_FOX].z > -200.0f) { this->lockOnTimers[TEAM_ID_FOX] = 0; } } @@ -1038,20 +1038,20 @@ void Actor_DrawOnRails(Actor* this) { } void Actor_DrawAllRange(Actor* this) { - s32 var_v1; + s32 playerNum; Vec3f sp50 = { 0.0f, 0.0f, 0.0f }; f32 var_fa1; f32 var_ft5; f32 var_fv0; f32 var_fv1; - D_edisplay_801615EC = 0; + sDrewActor = false; if (this->info.drawType == 2) { - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, D_ctx_80177D20, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, gPathProgress, MTXF_APPLY); Matrix_Translate(gCalcMatrix, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, MTXF_NEW); Matrix_Push(&gGfxMatrix); Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); - Matrix_MultVec3f(gGfxMatrix, &sp50, &D_edisplay_801615E0); + Matrix_MultVec3f(gGfxMatrix, &sp50, &sViewPos); Matrix_Pop(&gGfxMatrix); var_fv0 = 0.0f; var_fv1 = -12000.0f; @@ -1059,28 +1059,28 @@ void Actor_DrawAllRange(Actor* this) { var_fv0 = 1000.0f; var_fv1 = -25000.0f; } - if ((var_fv0 > D_edisplay_801615E0.z) && (D_edisplay_801615E0.z > var_fv1)) { - if (fabsf(D_edisplay_801615E0.x) < (fabsf(D_edisplay_801615E0.z * 0.5f) + 500.0f)) { - if (fabsf(D_edisplay_801615E0.y) < (fabsf(D_edisplay_801615E0.z * 0.5f) + 500.0f)) { + if ((var_fv0 > sViewPos.z) && (sViewPos.z > var_fv1)) { + if (fabsf(sViewPos.x) < (fabsf(sViewPos.z * 0.5f) + 500.0f)) { + if (fabsf(sViewPos.y) < (fabsf(sViewPos.z * 0.5f) + 500.0f)) { Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_APPLY); Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY); this->info.draw(&this->obj); - D_edisplay_801615EC = 1; + sDrewActor = true; if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (this->obj.id == OBJ_ACTOR_ALLRANGE) && (this->aiType == AI360_MISSILE)) { - gTeamArrowsViewPos[0] = D_edisplay_801615E0; + gTeamArrowsViewPos[0] = sViewPos; } } } } } else { Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, MTXF_APPLY); - Matrix_MultVec3f(gGfxMatrix, &sp50, &D_edisplay_801615E0); + Matrix_MultVec3f(gGfxMatrix, &sp50, &sViewPos); if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_STANDBY) || ((this->obj.id == OBJ_ACTOR_ALLRANGE) && (this->aiType >= AI360_GREAT_FOX)) || - ((this->obj.id == OBJ_ACTOR_195) && (this->info.bonus != 0))) { + ((this->obj.id == OBJ_ACTOR_CUTSCENE) && (this->info.bonus != 0))) { var_ft5 = var_fv0 = 3000.0f; var_fv1 = -29000.0f; var_fa1 = 0.7f; @@ -1090,45 +1090,45 @@ void Actor_DrawAllRange(Actor* this) { var_fv1 = -20000.0f; var_fa1 = 0.5f; } - if ((var_fv0 > D_edisplay_801615E0.z) && (D_edisplay_801615E0.z > var_fv1)) { - if (fabsf(D_edisplay_801615E0.x) < (fabsf(D_edisplay_801615E0.z * var_fa1) + var_ft5)) { - if (fabsf(D_edisplay_801615E0.y) < (fabsf(D_edisplay_801615E0.z * var_fa1) + var_ft5)) { + if ((var_fv0 > sViewPos.z) && (sViewPos.z > var_fv1)) { + if (fabsf(sViewPos.x) < (fabsf(sViewPos.z * var_fa1) + var_ft5)) { + if (fabsf(sViewPos.y) < (fabsf(sViewPos.z * var_fa1) + var_ft5)) { if (this->info.draw != NULL) { Matrix_RotateY(gGfxMatrix, this->obj.rot.y * M_DTOR, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); this->info.draw(&this->obj); - D_edisplay_801615EC = 1; + sDrewActor = true; if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (((this->obj.id == OBJ_ACTOR_ALLRANGE) && ((this->aiType <= AI360_PEPPY) || (this->aiType == AI360_KATT) || (this->aiType == AI360_BILL))) || (this->obj.id == OBJ_ACTOR_TEAM_BOSS))) { - gTeamArrowsViewPos[this->aiType] = D_edisplay_801615E0; + gTeamArrowsViewPos[this->aiType] = sViewPos; } } } } } } - if (D_edisplay_801615EC == 0) { + if (!sDrewActor) { this->lockOnTimers[gPlayerNum] = 0; if ((this->obj.id == OBJ_ACTOR_189) || (this->obj.id == OBJ_ACTOR_286)) { Object_Kill(&this->obj, this->sfxSource); } } - for (var_v1 = 0; var_v1 < gCamCount; var_v1++) { - if (this->lockOnTimers[var_v1] != 0) { - D_display_80161578[var_v1] = D_edisplay_801615E0; - D_display_80161578[var_v1].y += this->info.unk_1C; - if ((var_v1 == gPlayerNum) && (D_display_80161578[var_v1].z > -300.0f)) { - this->lockOnTimers[var_v1] = 0; + for (playerNum = 0; playerNum < gCamCount; playerNum++) { + if (this->lockOnTimers[playerNum] != 0) { + gLockOnTargetViewPos[playerNum] = sViewPos; + gLockOnTargetViewPos[playerNum].y += this->info.targetOffset; + if ((playerNum == gPlayerNum) && (gLockOnTargetViewPos[playerNum].z > -300.0f)) { + this->lockOnTimers[playerNum] = 0; } } } - func_edisplay_8005F290(this->sfxSource, &D_edisplay_801615E0); - this->iwork[24] = D_edisplay_801615EC; + func_edisplay_8005F290(this->sfxSource, &sViewPos); + this->iwork[24] = sDrewActor; } void Boss_Draw(Boss* this, s32 arg1) { @@ -1177,7 +1177,7 @@ void Boss_Draw(Boss* this, s32 arg1) { Matrix_SetGfxMtx(&gMasterDisp); } if (arg1 < 0) { - func_edisplay_800596C0(); + Object_ApplyWaterDistortion(); } this->info.draw(&this->obj); } @@ -1214,22 +1214,22 @@ void Effect_DrawOnRails(Effect* this, s32 arg1) { void Effect_DrawAllRange(Effect* this) { Vec3f sp4C = { 0.0f, 0.0f, 0.0f }; Vec3f sp40; - f32 var_fv0; - u8 sp3B = 0; + f32 minZ; + u8 drawn = false; if (this->info.unk_14 == -1) { - Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y + gCameraShakeY, this->obj.pos.z + D_ctx_80177D20, + Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y + gCameraShakeY, this->obj.pos.z + gPathProgress, MTXF_APPLY); } else { - Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + D_ctx_80177D20, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + gPathProgress, MTXF_APPLY); } Matrix_MultVec3f(gGfxMatrix, &sp4C, &sp40); if ((gCurrentLevel == LEVEL_SECTOR_Z) || (gCurrentLevel == LEVEL_BOLSE)) { - var_fv0 = -20000.0f; + minZ = -20000.0f; } else { - var_fv0 = -10000.0f; + minZ = -10000.0f; } - if ((sp40.z < 0.0f) && (var_fv0 < sp40.z)) { + if ((0.0f > sp40.z) && (sp40.z > minZ)) { if (fabsf(sp40.x) < (fabsf(sp40.z * 0.5f) + 500.0f)) { if (fabsf(sp40.y) < (fabsf(sp40.z * 0.5f) + 500.0f)) { if (this->info.draw != NULL) { @@ -1239,12 +1239,12 @@ void Effect_DrawAllRange(Effect* this) { Matrix_SetGfxMtx(&gMasterDisp); this->info.draw(&this->obj); } - sp3B = 1; + drawn = true; } } } func_edisplay_8005F290(this->sfxSource, &sp40); - if ((sp3B == 0) && (this->obj.id != OBJ_EFFECT_352) && (this->obj.id != OBJ_EFFECT_373) && (!gVersusMode)) { + if (!drawn && (this->obj.id != OBJ_EFFECT_352) && (this->obj.id != OBJ_EFFECT_373) && (!gVersusMode)) { Object_Kill(&this->obj, this->sfxSource); } } @@ -1252,12 +1252,12 @@ void Effect_DrawAllRange(Effect* this) { void Item_Draw(Item* this, s32 arg1) { Vec3f sp44 = { 0.0f, 0.0f, 0.0f }; Vec3f sp38; - u8 var_v0; + u8 drawn; - Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + D_ctx_80177D20, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + gPathProgress, MTXF_APPLY); Matrix_MultVec3f(gGfxMatrix, &sp44, &sp38); - var_v0 = 0; - if ((sp38.z < 0.0f) && (sp38.z > -12000.0f)) { + drawn = false; + if ((0.0f > sp38.z) && (sp38.z > -12000.0f)) { if (fabsf(sp38.x) < (fabsf(sp38.z * 0.5f) + 500.0f)) { if (fabsf(sp38.y) < (fabsf(sp38.z * 0.5f) + 500.0f)) { if (this->info.draw != NULL) { @@ -1271,12 +1271,12 @@ void Item_Draw(Item* this, s32 arg1) { this->info.draw(&this->obj); } } - var_v0 = 1; + drawn = true; } } } func_edisplay_8005F290(this->sfxSource, &sp38); - if ((var_v0 == 0) && (gLevelMode == LEVELMODE_ALL_RANGE) && (gCamCount == 1) && (this->obj.id < 336) && + if (!drawn && (gLevelMode == LEVELMODE_ALL_RANGE) && (gCamCount == 1) && (this->obj.id < OBJ_ITEM_GOLD_RING) && (gCurrentLevel != LEVEL_VENOM_ANDROSS)) { Object_Kill(&this->obj, this->sfxSource); } @@ -1322,21 +1322,21 @@ void Object_DrawShadow(s32 index, Object* obj) { switch (obj->id) { case OBJ_ACTOR_230: Matrix_Translate(gGfxMatrix, obj->pos.x, gGroundHeight + 2.0f + gActors[index].fwork[1], - obj->pos.z + D_ctx_80177D20, MTXF_APPLY); + obj->pos.z + gPathProgress, MTXF_APPLY); break; case OBJ_ACTOR_229: case OBJ_ACTOR_231: Matrix_Translate(gGfxMatrix, obj->pos.x, gGroundHeight + 2.0f + gActors[index].fwork[0], - obj->pos.z + D_ctx_80177D20, MTXF_APPLY); + obj->pos.z + gPathProgress, MTXF_APPLY); break; case OBJ_BOSS_316: Matrix_Translate(gGfxMatrix, obj->pos.x, gGroundHeight + 2.0f + gCameraShakeY, obj->pos.z, MTXF_APPLY); break; default: - Matrix_Translate(gGfxMatrix, obj->pos.x, gGroundHeight + 2.0f, obj->pos.z + D_ctx_80177D20, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, obj->pos.x, gGroundHeight + 2.0f, obj->pos.z + gPathProgress, MTXF_APPLY); break; } - if ((gGroundType != 4) || (obj->id == OBJ_ACTOR_EVENT) || (obj->id == OBJ_ACTOR_195) || + if ((gGroundType != 4) || (obj->id == OBJ_ACTOR_EVENT) || (obj->id == OBJ_ACTOR_CUTSCENE) || (obj->id == OBJ_ACTOR_TEAM_BOSS)) { Matrix_Scale(gGfxMatrix, 1.0f, 0.0f, 1.0f, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, obj->rot.y * M_DTOR, MTXF_APPLY); @@ -1383,7 +1383,7 @@ void func_edisplay_8005F0E8(f32* sfxSrc, Vec3f* pos) { Matrix_RotateX(gCalcMatrix, gPlayer[0].camPitch, MTXF_APPLY); sp2C.x = pos->x - gPlayerCamEye.x; sp2C.y = pos->y - gPlayerCamEye.y; - sp2C.z = pos->z + D_ctx_80177D20 - gPlayerCamEye.z; + sp2C.z = pos->z + gPathProgress - gPlayerCamEye.z; Matrix_MultVec3f(gCalcMatrix, &sp2C, &sp20); sfxSrc[0] = sp20.x; sfxSrc[1] = sp20.y; @@ -1472,11 +1472,11 @@ void Display_SetSecondLight(Vec3f* pos) { Vec3f sp9C; f32 sp98; f32 sp94; - f32 temp_fv0; + f32 lightDist; Vec3f sp84; f32 temp1; f32 temp2; - f32 var_fs0; + f32 lightFade; Vec3f sp6C; f32 temp3; f32 pad; @@ -1485,17 +1485,17 @@ void Display_SetSecondLight(Vec3f* pos) { sp9C.x = pos->x - gLight3x; sp9C.y = pos->y - gLight3y; sp9C.z = pos->z - gLight3z; - temp_fv0 = VEC3F_MAG(&sp9C); + lightDist = VEC3F_MAG(&sp9C); if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) { - var_fs0 = 700.0f / temp_fv0; + lightFade = 700.0f / lightDist; } else { - var_fs0 = 200.0f / temp_fv0; + lightFade = 200.0f / lightDist; } - if (var_fs0 > 1.0f) { - var_fs0 = 1.0f; + if (lightFade > 1.0f) { + lightFade = 1.0f; } if (D_ctx_8017812C == 2) { - var_fs0 = 1.0f; + lightFade = 1.0f; } sp94 = Math_Atan2F(sp9C.x, sp9C.z); sp98 = -Math_Atan2F(sp9C.y, sqrtf(SQ(sp9C.x) + SQ(sp9C.z))); @@ -1509,9 +1509,9 @@ void Display_SetSecondLight(Vec3f* pos) { sp6C.z = -100.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp6C, &sp84); Matrix_Pop(&gCalcMatrix); - temp1 = gLight3R * gLight3Brightness * var_fs0; - temp2 = gLight3G * gLight3Brightness * var_fs0; - temp3 = gLight3B * gLight3Brightness * var_fs0; + temp1 = gLight3R * gLight3Brightness * lightFade; + temp2 = gLight3G * gLight3Brightness * lightFade; + temp3 = gLight3B * gLight3Brightness * lightFade; Lights_SetTwoLights(&gMasterDisp, gLight1x, gLight1y, gLight1z, sp84.x, sp84.y, sp84.z, gLight1R, gLight1G, gLight1B, temp1, temp2, temp3, gAmbientR, gAmbientG, gAmbientB); } @@ -1589,7 +1589,7 @@ void Object_DrawAll(s32 arg0) { RCP_SetupDL_27(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 64, 64, 255, 255); } - func_edisplay_800597C0(arg0); + Object_SetCullDirection(arg0); Matrix_Push(&gGfxMatrix); Boss_Draw(boss, arg0); Matrix_Pop(&gGfxMatrix); @@ -1638,7 +1638,7 @@ void Object_DrawAll(s32 arg0) { (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) || (gCurrentLevel == LEVEL_AQUAS)) { Display_SetSecondLight(&actor->obj.pos); } - func_edisplay_800597C0(arg0); + Object_SetCullDirection(arg0); Actor_DrawOnRails(actor); Matrix_Pop(&gGfxMatrix); if (actor->unk_0C9 != 0) { @@ -1651,8 +1651,8 @@ void Object_DrawAll(s32 arg0) { Matrix_Push(&gGfxMatrix); Actor_DrawAllRange(actor); Matrix_Pop(&gGfxMatrix); - if ((actor->unk_0C9 != 0) && (D_edisplay_801615EC != 0) && - ((D_edisplay_801615E0.z > -4000.0f) || (gCurrentLevel != LEVEL_KATINA))) { + if ((actor->unk_0C9 != 0) && (sDrewActor != 0) && + ((sViewPos.z > -4000.0f) || (gCurrentLevel != LEVEL_KATINA))) { Matrix_Push(&gGfxMatrix); Object_DrawShadow(i, &actor->obj); Matrix_Pop(&gGfxMatrix); @@ -1668,7 +1668,7 @@ void Object_DrawAll(s32 arg0) { if (item->obj.status >= OBJ_ACTIVE) { Matrix_Push(&gGfxMatrix); RCP_SetupDL(&gMasterDisp, 0x1D); - func_edisplay_800597C0(arg0); + Object_SetCullDirection(arg0); Item_Draw(item, arg0); Matrix_Pop(&gGfxMatrix); } @@ -1779,12 +1779,12 @@ void TexturedLine_Draw(void) { if (gTexturedLines[i].mode != 0) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, texLine->unk_04.x, texLine->unk_04.y, texLine->unk_04.z + D_ctx_80177D20, + Matrix_Translate(gGfxMatrix, texLine->posAA.x, texLine->posAA.y, texLine->posAA.z + gPathProgress, MTXF_APPLY); - Matrix_RotateY(gGfxMatrix, texLine->unk_20, MTXF_APPLY); - Matrix_RotateX(gGfxMatrix, texLine->unk_1C, MTXF_APPLY); - Matrix_RotateZ(gGfxMatrix, texLine->unk_20, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, texLine->unk_28, texLine->unk_28, texLine->unk_24, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, texLine->yRot, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, texLine->xRot, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, texLine->yRot, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, texLine->xyScale, texLine->xyScale, texLine->zScale, MTXF_APPLY); if ((gCurrentLevel == LEVEL_AQUAS) || (gCurrentLevel == LEVEL_VENOM_ANDROSS)) { s32 alpha = ((gGameFrameCount % 2) != 0) ? 180 : 50; @@ -1808,8 +1808,8 @@ void TexturedLine_Draw(void) { if (gCurrentLevel == LEVEL_MACBETH) { gSPDisplayList(gMasterDisp++, D_MA_6012C00); } else { - gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, texLine->unk_2C, texLine->unk_2D, texLine->unk_2E, - texLine->unk_2F); + gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, texLine->red, texLine->green, texLine->blue, + texLine->alpha); gSPDisplayList(gMasterDisp++, D_edisplay_800CFD80); } } @@ -1821,18 +1821,18 @@ void TexturedLine_Draw(void) { void TexturedLine_DrawPath(s32 index) { TexturedLine* texLine = &gTexturedLines[index]; - if (texLine->unk_2F == 255) { + if (texLine->alpha == 255) { RCP_SetupDL(&gMasterDisp, 5); } else { RCP_SetupDL(&gMasterDisp, 0xE); } - gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, texLine->unk_2C, texLine->unk_2D, texLine->unk_2E, texLine->unk_2F); + gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, texLine->red, texLine->green, texLine->blue, texLine->alpha); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, texLine->unk_04.x, texLine->unk_04.y, texLine->unk_04.z, MTXF_APPLY); - Matrix_RotateY(gGfxMatrix, texLine->unk_20, MTXF_APPLY); - Matrix_RotateX(gGfxMatrix, texLine->unk_1C, MTXF_APPLY); - Matrix_RotateZ(gGfxMatrix, texLine->unk_1C, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, texLine->unk_28, 1.0f, texLine->unk_24, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, texLine->posAA.x, texLine->posAA.y, texLine->posAA.z, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, texLine->yRot, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, texLine->xRot, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, texLine->xRot, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, texLine->xyScale, 1.0f, texLine->zScale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); gSPDisplayList(gMasterDisp++, D_edisplay_800CFD80); diff --git a/src/engine/fox_effect.c b/src/engine/fox_effect.c index c5c9e163..0a721e0b 100644 --- a/src/engine/fox_effect.c +++ b/src/engine/fox_effect.c @@ -31,7 +31,7 @@ s32 BonusText_Display(f32 xPos, f32 yPos, f32 zPos, s32 hits) { gBonusText[i].pos.x = xPos; gBonusText[i].pos.y = yPos; gBonusText[i].pos.z = zPos; - gBonusText[i].unk_10 = 0.0f; + gBonusText[i].rise = 0.0f; gBonusText[i].timer = 65; break; } @@ -52,14 +52,14 @@ void BonusText_Update(void) { } if (gLevelMode == LEVELMODE_ON_RAILS) { - bonus->pos.z -= D_ctx_80177D08; + bonus->pos.z -= gPathVelZ; } else if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) { bonus->pos.x += gPlayer[0].vel.x; bonus->pos.z += gPlayer[0].vel.z; } if (bonus->timer < 45) { - Math_SmoothStepToF(&bonus->unk_10, 300.0f, 0.1f, 20.0f, 0.0f); + Math_SmoothStepToF(&bonus->rise, 300.0f, 0.1f, 20.0f, 0.0f); } } } @@ -83,7 +83,7 @@ void BonusText_Draw(BonusText* bonus) { f32 sp50; if (bonus->timer <= 45) { - Matrix_Translate(gGfxMatrix, bonus->pos.x, bonus->pos.y, bonus->pos.z + D_ctx_80177D20, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, bonus->pos.x, bonus->pos.y, bonus->pos.z + gPathProgress, MTXF_APPLY); Matrix_MultVec3f(gGfxMatrix, &sp60, &sp54); if ((fabsf(sp54.x) < 20000.0f) && (fabsf(sp54.y) < 20000.0f)) { @@ -92,7 +92,7 @@ void BonusText_Draw(BonusText* bonus) { Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].camYaw, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].camPitch, MTXF_APPLY); Matrix_Scale(gGfxMatrix, sp50, sp50, 1.0f, MTXF_APPLY); - Matrix_Translate(gGfxMatrix, 0.0f, bonus->unk_10, 0.0f, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, bonus->rise, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if (bonus->hits <= 10) { @@ -980,7 +980,7 @@ void func_effect_8007A748(Effect* effect) { } bool func_effect_8007A774(Player* player, Effect* effect, f32 arg2) { - if ((fabsf(player->unk_138 - effect->obj.pos.z) < arg2) && (fabsf(player->pos.x - effect->obj.pos.x) < arg2) && + if ((fabsf(player->trueZpos - effect->obj.pos.z) < arg2) && (fabsf(player->pos.x - effect->obj.pos.x) < arg2) && (fabsf(player->pos.y - effect->obj.pos.y) < arg2) && (player->timer_498 == 0)) { Player_ApplyDamage(player, 0, effect->info.damage); return true; @@ -1145,7 +1145,7 @@ void func_effect_8007AF30(Effect* effect, f32 xPos, f32 zPos, f32 xVel, f32 zVel effect->obj.pos.z = zPos; effect->vel.x = xVel; - effect->vel.z = zVel - D_ctx_80177D08; + effect->vel.z = zVel - gPathVelZ; effect->scale1 = scale1; effect->timer_50 = 100; Object_SetInfo(&effect->info, effect->obj.id); @@ -2207,7 +2207,7 @@ void func_effect_8007DB70(Effect* effect) { } } effect->obj.rot.y = 180.0f - effect->obj.rot.y; - if ((fabsf(gPlayer[0].unk_138 - effect->obj.pos.z) < 40.0f) && + if ((fabsf(gPlayer[0].trueZpos - effect->obj.pos.z) < 40.0f) && (fabsf(gPlayer[0].pos.x - effect->obj.pos.x) < 80.0f)) { if ((effect->obj.pos.y < gPlayer[0].pos.y) && ((gPlayer[0].pos.y - effect->obj.pos.y) < (effect->scale2 * 35.0f)) && @@ -2246,7 +2246,7 @@ void func_effect_8007E014(Effect* effect) { f32 y; if (gGroundType == 4) { - Ground_801B6E20(effect->obj.pos.x, effect->obj.pos.z + D_ctx_80177D20, &x, &y, &z); + Ground_801B6E20(effect->obj.pos.x, effect->obj.pos.z + gPathProgress, &x, &y, &z); effect->obj.pos.y = y + 3.0f; effect->obj.rot.x = RAD_TO_DEG(x); effect->obj.rot.z = RAD_TO_DEG(z); @@ -2377,8 +2377,8 @@ void func_effect_8007E6B8(Effect* effect, u32 objId, f32 xPos, f32 yPos, f32 zPo effect->obj.pos.z = zPos; 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)); + sp50 = Math_Atan2F(gPlayer[0].pos.x - xPos, gPlayer[0].trueZpos - zPos); + temp_ft4 = sqrtf(SQ(gPlayer[0].pos.x - xPos) + SQ(gPlayer[0].trueZpos - zPos)); sp54 = -Math_Atan2F(gPlayer[0].pos.y - yPos, temp_ft4); Matrix_RotateY(gCalcMatrix, sp50, MTXF_NEW); @@ -2390,9 +2390,9 @@ void func_effect_8007E6B8(Effect* effect, u32 objId, f32 xPos, f32 yPos, f32 zPo Matrix_MultVec3f(gCalcMatrix, &sp40, &sp34); - effect->vel.x = sp34.x + D_ctx_801779E4; - effect->vel.y = sp34.y + D_ctx_801779F4; - effect->vel.z = sp34.z - D_ctx_80177D08; + effect->vel.x = sp34.x + gPathVelX; + effect->vel.y = sp34.y + gPathVelY; + effect->vel.z = sp34.z - gPathVelZ; if ((objId == OBJ_EFFECT_353) || (objId == OBJ_EFFECT_354)) { effect->obj.rot.x = RAD_TO_DEG(sp54); @@ -2447,9 +2447,9 @@ void func_effect_8007E93C(Effect* effect, u32 objId, f32 xPos, f32 yPos, f32 zPo Matrix_MultVec3f(gCalcMatrix, &sp40, &sp34); - effect->vel.x = sp34.x + D_ctx_801779E4; - effect->vel.y = sp34.y + D_ctx_801779F4; - effect->vel.z = sp34.z - D_ctx_80177D08; + effect->vel.x = sp34.x + gPathVelX; + effect->vel.y = sp34.y + gPathVelY; + effect->vel.z = sp34.z - gPathVelZ; if (objId == OBJ_EFFECT_353) { effect->obj.rot.x = RAD_TO_DEG(sp54); @@ -2559,8 +2559,8 @@ void func_effect_8007EE68(ObjectId objId, Vec3f* pos, Vec3f* rot, Vec3f* arg3, V for (i = ARRAY_COUNT(gEffects) - 1; i >= 0; i--) { if (gEffects[i].obj.status == OBJ_FREE) { func_effect_8007ED54(&gEffects[i], objId, pos->x + sp68.x, pos->y + sp68.y, pos->z + sp68.z, rot->x, rot->y, - rot->z, arg3->x, arg3->y, arg3->z, sp68.x + D_ctx_801779E4, sp68.y + D_ctx_801779F4, - sp68.z - D_ctx_80177D08, scale2); + rot->z, arg3->x, arg3->y, arg3->z, sp68.x + gPathVelX, sp68.y + gPathVelY, + sp68.z - gPathVelZ, scale2); break; } } @@ -2582,7 +2582,7 @@ void func_effect_8007F04C(ObjectId objId, f32 xPos, f32 yPos, f32 zPos, f32 xRot void func_effect_8007F11C(ObjectId objId, f32 xPos, f32 yPos, f32 zPos, f32 speed) { s32 i; - if ((fabsf(zPos - gPlayer[0].unk_138) > 300.0f) || (fabsf(xPos - gPlayer[0].pos.x) > 300.0f)) { + if ((fabsf(zPos - gPlayer[0].trueZpos) > 300.0f) || (fabsf(xPos - gPlayer[0].pos.x) > 300.0f)) { for (i = ARRAY_COUNT(gEffects) - 1; i >= 0; i--) { if (gEffects[i].obj.status == OBJ_FREE) { Matrix_Push(&gCalcMatrix); @@ -2653,7 +2653,7 @@ void func_effect_8007F438(Effect* effect) { effect->unk_46--; } - if (D_ctx_80177D08 < 0.0f) { + if (gPathVelZ < 0.0f) { effect->vel.z = -10.0f; } @@ -2723,7 +2723,7 @@ void func_effect_8007F6B0(Effect* effect) { yPos = gGroundHeight + 40.0f; if (gGroundType == 4) { - Ground_801B6E20(effect->obj.pos.x + sin, effect->obj.pos.z + cos + D_ctx_80177D20, &x, &y, &z); + Ground_801B6E20(effect->obj.pos.x + sin, effect->obj.pos.z + cos + gPathProgress, &x, &y, &z); yPos = y + 30.0f; } @@ -2770,7 +2770,7 @@ void func_effect_8007F958(Effect* effect) { yPos = gGroundHeight + 10.0f; if (gGroundType == 4) { - Ground_801B6E20(effect->obj.pos.x + sin, effect->obj.pos.z + cos + D_ctx_80177D20, &x, &y, &z); + Ground_801B6E20(effect->obj.pos.x + sin, effect->obj.pos.z + cos + gPathProgress, &x, &y, &z); yPos = y + 10.0f; } @@ -2825,13 +2825,13 @@ bool func_effect_8007FD84(Effect* effect) { (fabsf(actor->obj.pos.z - effect->obj.pos.z) < 100.0f) && (fabsf(actor->obj.pos.x - effect->obj.pos.x) < 100.0f) && (fabsf(actor->obj.pos.y - effect->obj.pos.y) < 100.0f)) { - actor->unk_0D0 = 1; - actor->unk_0D2 = 0; + actor->dmgType = 1; + actor->dmgPart = 0; actor->damage = 10; if (effect->obj.id == OBJ_EFFECT_354) { actor->damage = 30; } - actor->unk_0D4 = 100; + actor->dmgSource = 100; return true; } } @@ -2855,14 +2855,14 @@ void func_effect_8007FE88(Effect* effect) { return; } - if (gPlayer[0].unk_280 != 0) { + if (gPlayer[0].barrelRollAlpha != 0) { var_fa0 = 100.0f; } - if (fabsf(gPlayer[0].unk_138 - effect->obj.pos.z) < (50.0f + var_fa0)) { + if (fabsf(gPlayer[0].trueZpos - effect->obj.pos.z) < (50.0f + var_fa0)) { if ((fabsf(gPlayer[0].pos.x - effect->obj.pos.x) < (30.0f + var_fa0)) && (fabsf(gPlayer[0].pos.y - effect->obj.pos.y) < (30.0f + var_fa0))) { - if ((gPlayer[0].unk_280 != 0) || (gPlayer[0].timer_27C != 0)) { + if ((gPlayer[0].barrelRollAlpha != 0) || (gPlayer[0].meteoWarpTimer != 0)) { effect->obj.rot.y = 90.0f; effect->obj.rot.x = RAND_FLOAT(360.0f); Matrix_RotateY(gCalcMatrix, effect->obj.rot.y * M_DTOR, MTXF_NEW); @@ -2878,16 +2878,16 @@ void func_effect_8007FE88(Effect* effect) { AUDIO_PLAY_SFX(0x09007011, effect->sfxSource, 0); } - if ((gPlayer[0].unk_280 == 0) && (gPlayer[0].timer_498 == 0)) { + if ((gPlayer[0].barrelRollAlpha == 0) && (gPlayer[0].timer_498 == 0)) { Player_ApplyDamage(gPlayer, 0, effect->info.damage); - gPlayer[0].unk_0D8.x = 20.0f; + gPlayer[0].knockback.x = 20.0f; if (effect->vel.x < 0.0f) { - gPlayer[0].unk_0D8.x *= -1.0f; + gPlayer[0].knockback.x *= -1.0f; } if (gCurrentLevel != LEVEL_MACBETH) { - gPlayer[0].unk_0D8.y = 20.0f; + gPlayer[0].knockback.y = 20.0f; if (effect->vel.y < 0.0f) { - gPlayer[0].unk_0D8.y *= -1.0f; + gPlayer[0].knockback.y *= -1.0f; } } Object_Kill(&effect->obj, effect->sfxSource); @@ -2896,7 +2896,7 @@ void func_effect_8007FE88(Effect* effect) { } if (gGroundType == 4) { - if (Ground_801B6AEC(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z + D_ctx_80177D20) != 0) { + if (Ground_801B6AEC(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z + gPathProgress) != 0) { Object_Kill(&effect->obj, effect->sfxSource); } } else if (effect->obj.pos.y < gGroundHeight) { @@ -2961,8 +2961,8 @@ void func_effect_8008040C(Effect* effect) { switch (effect->state) { case 0: - yRot = Math_Atan2F(gPlayer[0].pos.x - effect->obj.pos.x, gPlayer[0].unk_138 - effect->obj.pos.z); - temp = sqrtf(SQ(gPlayer[0].pos.x - effect->obj.pos.x) + SQ(gPlayer[0].unk_138 - effect->obj.pos.z)); + yRot = Math_Atan2F(gPlayer[0].pos.x - effect->obj.pos.x, gPlayer[0].trueZpos - effect->obj.pos.z); + temp = sqrtf(SQ(gPlayer[0].pos.x - effect->obj.pos.x) + SQ(gPlayer[0].trueZpos - effect->obj.pos.z)); xRot = -Math_Atan2F(gPlayer[0].pos.y - effect->obj.pos.y, temp); Matrix_RotateY(gCalcMatrix, yRot, MTXF_NEW); Matrix_RotateX(gCalcMatrix, xRot, MTXF_APPLY); @@ -2970,9 +2970,9 @@ void func_effect_8008040C(Effect* effect) { srcVelocity.x = 0.0f; srcVelocity.z = 100.0f; Matrix_MultVec3f(gCalcMatrix, &srcVelocity, &destVelocity); - effect->vel.x = destVelocity.x + D_ctx_801779E4; - effect->vel.y = destVelocity.y + D_ctx_801779F4; - effect->vel.z = destVelocity.z - D_ctx_80177D08; + effect->vel.x = destVelocity.x + gPathVelX; + effect->vel.y = destVelocity.y + gPathVelY; + effect->vel.z = destVelocity.z - gPathVelZ; effect->state++; break; @@ -2988,14 +2988,14 @@ void func_effect_8008040C(Effect* effect) { return; } - if (gPlayer[0].unk_280 != 0) { + if (gPlayer[0].barrelRollAlpha != 0) { var_fa0 = 100.0f; } - if (fabsf(gPlayer[0].unk_138 - effect->obj.pos.z) < (50.0f + var_fa0)) { + if (fabsf(gPlayer[0].trueZpos - effect->obj.pos.z) < (50.0f + var_fa0)) { if ((fabsf(gPlayer[0].pos.x - effect->obj.pos.x) < (30.0f + var_fa0)) && (fabsf(gPlayer[0].pos.y - effect->obj.pos.y) < (30.0f + var_fa0))) { - if ((gPlayer[0].unk_280 != 0) || (gPlayer[0].timer_27C != 0)) { + if ((gPlayer[0].barrelRollAlpha != 0) || (gPlayer[0].meteoWarpTimer != 0)) { effect->obj.rot.y = 90.0f; effect->obj.rot.x = RAND_FLOAT(360.0f); Matrix_RotateY(gCalcMatrix, effect->obj.rot.y * M_DTOR, MTXF_NEW); @@ -3011,23 +3011,22 @@ void func_effect_8008040C(Effect* effect) { AUDIO_PLAY_SFX(0x09007011, effect->sfxSource, 0); } - if ((gPlayer[0].unk_280 == 0) && (gPlayer[0].timer_498 == 0)) { + if ((gPlayer[0].barrelRollAlpha == 0) && (gPlayer[0].timer_498 == 0)) { Player_ApplyDamage(gPlayer, 0, effect->info.damage); - gPlayer[0].unk_0D8.x = 20.0f; + gPlayer[0].knockback.x = 20.0f; if (effect->vel.x < 0.0f) { - gPlayer[0].unk_0D8.x *= -1.0f; + gPlayer[0].knockback.x *= -1.0f; } - gPlayer[0].unk_0D8.y = 20.0f; + gPlayer[0].knockback.y = 20.0f; if (effect->vel.y < 0.0f) { - gPlayer[0].unk_0D8.y *= -1.0f; + gPlayer[0].knockback.y *= -1.0f; } Object_Kill(&effect->obj, effect->sfxSource); } } if (gGroundType == 4) { - if (Ground_801B6AEC(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z + D_ctx_80177D20) != - 0) { + if (Ground_801B6AEC(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z + gPathProgress) != 0) { Object_Kill(&effect->obj, effect->sfxSource); } } else if (effect->obj.pos.y < gGroundHeight) { @@ -3576,7 +3575,7 @@ void func_effect_80081C5C(Effect* effect) { if (effect->unk_44 != 0) { 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) { + } else if (fabsf(gPlayer[0].trueZpos - effect->obj.pos.z) < 1000.0f) { ActorEvent_8006F0D8(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 15.0f); Object_Kill(&effect->obj, effect->sfxSource); } @@ -3766,11 +3765,11 @@ void func_effect_80081C5C(Effect* effect) { if ((((gGameFrameCount % 16) == 0)) && (effect->timer_50 == 0)) { D_800D18EC = RAD_TO_DEG(Math_Atan2F(gPlayer[0].cam.eye.x - gBosses[0].obj.pos.x, - gPlayer[0].cam.eye.z - (gBosses[0].obj.pos.z + D_ctx_80177D20))); + gPlayer[0].cam.eye.z - (gBosses[0].obj.pos.z + gPathProgress))); D_800D18E8 = RAD_TO_DEG( -Math_Atan2F(gPlayer[0].cam.eye.y - gBosses[0].obj.pos.y, - sqrtf(SQ(gPlayer[0].cam.eye.z - (gBosses[0].obj.pos.z + D_ctx_80177D20)) + + sqrtf(SQ(gPlayer[0].cam.eye.z - (gBosses[0].obj.pos.z + gPathProgress)) + SQ(gPlayer[0].cam.eye.x - gBosses[0].obj.pos.x)))); } if (gBosses[0].timer_050 == 0) { @@ -3812,7 +3811,7 @@ void func_effect_80081C5C(Effect* effect) { } velocity.x = velocity.y = 0.0f; - velocity.z = fabsf(gPlayer[0].unk_138 - effect->obj.pos.z); + velocity.z = fabsf(gPlayer[0].trueZpos - effect->obj.pos.z); Matrix_MultVec3fNoTranslate(gCalcMatrix, &velocity, &velocityDest); @@ -4052,7 +4051,7 @@ void func_effect_800837EC(Effect* effect) { } effect->obj.rot.y = RAD_TO_DEG(Math_Atan2F(gPlayer[0].cam.eye.x - effect->obj.pos.x, - gPlayer[0].cam.eye.z - (effect->obj.pos.z + D_ctx_80177D20))); + gPlayer[0].cam.eye.z - (effect->obj.pos.z + gPathProgress))); } void func_effect_80083B8C(Effect* effect) { @@ -4116,7 +4115,7 @@ void func_effect_80083D2C(f32 xPos, f32 yPos, f32 zPos, f32 srcZ) { x = gPlayer[0].pos.x + xSway - xPos; y = gPlayer[0].pos.y - yPos; - z = gPlayer[0].unk_138 - zPos; + z = gPlayer[0].trueZpos - zPos; yRot = Math_Atan2F(x, z); xRot = -Math_Atan2F(y, sqrtf(SQ(x) + SQ(z))); @@ -4129,7 +4128,7 @@ void func_effect_80083D2C(f32 xPos, f32 yPos, f32 zPos, f32 srcZ) { Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); - dest.z -= D_ctx_80177D08; + dest.z -= gPathVelZ; for (i = 0; i < 6; i++) { for (j = 0; j < ARRAY_COUNT(gEffects); j++) { diff --git a/src/engine/fox_enmy.c b/src/engine/fox_enmy.c index d41c6725..1a9e13a8 100644 --- a/src/engine/fox_enmy.c +++ b/src/engine/fox_enmy.c @@ -135,7 +135,7 @@ void Object_SetInfo(ObjectInfo* info, u32 objId) { *info = D_edata_800CC124[objId]; info->hitbox = SEGMENTED_TO_VIRTUAL(D_edata_800CC124[objId].hitbox); if (gLevelMode == LEVELMODE_UNK_2) { - info->unk_10 += 200.0f; + info->cullDistance += 200.0f; } } @@ -263,7 +263,7 @@ void Item_Load(Item* item, ObjectInit* objInit) { item->obj.rot.x = objInit->rot.x; item->obj.rot.z = objInit->rot.z; item->obj.id = objInit->id; - item->scale = 1.0f; + item->width = 1.0f; Object_SetInfo(&item->info, item->obj.id); } @@ -284,7 +284,7 @@ void func_enmy_80061958(Effect* effect, f32 xPos, f32 yPos, f32 zPos) { effect->obj.rot.z = RAND_FLOAT(360.0f); Object_SetInfo(&effect->info, effect->obj.id); if (gLevelType == LEVELTYPE_PLANET) { - effect->info.unk_10 = 100.0f; + effect->info.cullDistance = 100.0f; } } @@ -298,9 +298,9 @@ void func_enmy_80061A4C(void) { if (gEffects[i].obj.status == OBJ_FREE) { x = gPlayer[0].pos.x + RAND_FLOAT_CENTERED(400.0f) + (5.0f * gPlayer[0].vel.x); y = gPlayer[0].pos.y + RAND_FLOAT_CENTERED(400.0f) + (5.0f * gPlayer[0].vel.y); - z = -D_ctx_80177D20 - 500.0f; - if (D_ctx_80177D08 < 0.0f) { - z = -D_ctx_80177D20 + 500.0f; + z = -gPathProgress - 500.0f; + if (gPathVelZ < 0.0f) { + z = -gPathProgress + 500.0f; } func_enmy_80061958(&gEffects[i], x, y, z); break; @@ -322,9 +322,9 @@ void func_enmy_80061B68(void) { while (y <= gGroundHeight) { y = gPlayer[0].pos.y + RAND_FLOAT_CENTERED(2000.0f) + (5.0f * gPlayer[0].vel.y); } - z = -D_ctx_80177D20 - 3000.0f; - if (D_ctx_80177D08 < 0.0f) { - z = -D_ctx_80177D20 + 1000.0f; + z = -gPathProgress - 3000.0f; + if (gPathVelZ < 0.0f) { + z = -gPathProgress + 1000.0f; } func_enmy_80061958(&gEffects[i], x, y, z); break; @@ -342,9 +342,9 @@ void func_enmy_80061CD0(void) { if (gEffects[i].obj.status == OBJ_FREE) { x = gPlayer[gPlayerNum].pos.x + RAND_FLOAT_CENTERED(3000.0f) + (5.0f * gPlayer[gPlayerNum].vel.x); y = gPlayer[gPlayerNum].pos.y + 1000.0f + RAND_FLOAT_CENTERED(500.0f) + (5.0f * gPlayer[gPlayerNum].vel.y); - z = -D_ctx_80177D20 - RAND_FLOAT(2000.0f); - if (D_ctx_80177D08 < 0.0f) { - z = -D_ctx_80177D20 + 1000.0f; + z = -gPathProgress - RAND_FLOAT(2000.0f); + if (gPathVelZ < 0.0f) { + z = -gPathProgress + 1000.0f; } func_enmy_80061958(&gEffects[i], x, y, z); break; @@ -388,7 +388,7 @@ void ActorEvent_Load(Actor* actor, ObjectInit* objInit, s32 index) { actor->aiType = objInit->id - ACTOR_EVENT_ID; Object_SetInfo(&actor->info, actor->obj.id); - actor->info.unk_10 = 3000.0f; + actor->info.cullDistance = 3000.0f; actor->fwork[25] = 20000.0f; actor->iwork[1] = gPrevEventActorIndex; actor->iwork[10] = gActors[gPrevEventActorIndex].aiType; @@ -408,8 +408,8 @@ void ActorEvent_Load(Actor* actor, ObjectInit* objInit, s32 index) { void Object_Load(ObjectInit* objInit, f32 xMax, f32 xMin, f32 yMax, f32 yMin) { s32 i; - if ((xMax > objInit->xPos - gPlayer[0].unk_0AC) && (objInit->xPos - gPlayer[0].unk_0AC > xMin) && - (yMax > objInit->yPos - gPlayer[0].unk_0B0) && (objInit->yPos - gPlayer[0].unk_0B0 > yMin)) { + if ((xMax > objInit->xPos - gPlayer[0].xPath) && (objInit->xPos - gPlayer[0].xPath > xMin) && + (yMax > objInit->yPos - gPlayer[0].yPath) && (objInit->yPos - gPlayer[0].yPath > yMin)) { if (objInit->id < OBJ_SPRITE_CO_POLE) { for (i = 0; i < ARRAY_COUNT(gScenery); i++) { if (gScenery[i].obj.status == OBJ_FREE) { @@ -560,20 +560,20 @@ void Object_LoadLevelObjects(void) { yMin = xMin = -4000.0f; } - if ((gPlayer[0].timer_210 != 0) && (gPlayer[0].unk_118 < 0.0f)) { + if ((gPlayer[0].timer_210 != 0) && (gPlayer[0].yRot_118 < 0.0f)) { xMax = 10000.0f; } - if ((gPlayer[0].timer_210 != 0) && (gPlayer[0].unk_118 > 0.0f)) { + if ((gPlayer[0].timer_210 != 0) && (gPlayer[0].yRot_118 > 0.0f)) { xMin = -10000.0f; } gLastPathChange = 0; for (i = 0, objInit = &gLevelObjects[gObjectLoadIndex]; i < 10000; i++, gObjectLoadIndex++, objInit++) { - if ((objInit->id > OBJ_INVALID) && D_ctx_80177D20 <= objInit->zPos1 && - objInit->zPos1 <= D_ctx_80177D20 + 200.0f) { + if ((objInit->id > OBJ_INVALID) && gPathProgress <= objInit->zPos1 && + objInit->zPos1 <= gPathProgress + 200.0f) { 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))) { + if (((objInit->rot.y < 180.0f) && (objInit->xPos < gPlayer[0].xPath)) || + ((objInit->rot.y > 180.0f) && (gPlayer[0].xPath < objInit->xPos))) { Object_Load(objInit, xMax, xMin, yMax, yMin); } } else { @@ -747,12 +747,12 @@ bool Object_CheckPolyCollision(Vec3f* pos, Vec3f* vel, ObjectId objId, Object* o objPos.z = obj->pos.z; if ((objId == OBJ_ACTOR_180) || (objId == OBJ_SCENERY_149) || (objId == OBJ_SCENERY_150) || (objId == OBJ_BOSS_308) || (objId == OBJ_BOSS_313) || (objId == OBJ_BOSS_312) || (objId == OBJ_BOSS_309) || - (objId == OBJ_SCENERY_39)) { + (objId == OBJ_SCENERY_ME_TUNNEL)) { colId = COL1_0; if (objId == OBJ_BOSS_312) { colId = COL1_9; } - if (objId == OBJ_SCENERY_39) { + if (objId == OBJ_SCENERY_ME_TUNNEL) { colId = COL1_1; } else if (objId == OBJ_BOSS_308) { colId = COL1_4; @@ -829,7 +829,7 @@ s32 Object_CheckCollision(s32 index, Vec3f* pos, Vec3f* vel, s32 mode) { if (scenery->obj.status == OBJ_ACTIVE) { if ((scenery->obj.id == OBJ_SCENERY_1) || (scenery->obj.id == OBJ_SCENERY_4) || (scenery->obj.id == OBJ_SCENERY_5) || (scenery->obj.id == OBJ_SCENERY_2) || - (scenery->obj.id == OBJ_SCENERY_39) || (scenery->obj.id == OBJ_SCENERY_3)) { + (scenery->obj.id == OBJ_SCENERY_ME_TUNNEL) || (scenery->obj.id == OBJ_SCENERY_3)) { if (Object_CheckPolyCollision(pos, vel, scenery->obj.id, &scenery->obj)) { return 2; } @@ -902,9 +902,9 @@ s32 Object_CheckCollision(s32 index, Vec3f* pos, Vec3f* vel, s32 mode) { } else if (actor->scale < 0.0f) { if (Object_CheckHitboxCollision(pos, actor->info.hitbox, &actor->obj, actor->vwork[29].x, actor->vwork[29].y, actor->vwork[29].z + actor->unk_0F4.z)) { - actor->unk_0D0 = 1; + actor->dmgType = 1; actor->damage = 10; - actor->unk_0D2 = -1; + actor->dmgPart = -1; actor->hitPos.x = pos->x; actor->hitPos.y = pos->y; actor->hitPos.z = pos->z; @@ -912,9 +912,9 @@ s32 Object_CheckCollision(s32 index, Vec3f* pos, Vec3f* vel, s32 mode) { } } else if ((mode != 2) && (mode != 3)) { if (Object_CheckSingleHitbox(pos, actor->info.hitbox, &actor->obj.pos)) { - actor->unk_0D0 = 1; + actor->dmgType = 1; actor->damage = 10; - actor->unk_0D2 = -1; + actor->dmgPart = -1; 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))))) { @@ -1001,11 +1001,11 @@ void func_enmy_80063F4C(s32 arg0) { } void func_enmy_80063F58(Item* item) { - item->scale = item->obj.rot.z * 100.0f; + item->width = item->obj.rot.z * 100.0f; } void func_enmy_80063F74(Item* item) { - item->scale = item->obj.rot.z * 100.0f; + item->width = item->obj.rot.z * 100.0f; } void Object_Init(s32 index, ObjectId objId) { @@ -1037,7 +1037,7 @@ void Object_Init(s32 index, ObjectId objId) { break; case OBJ_EFFECT_368: if (gCurrentLevel == LEVEL_TITANIA) { - Ground_801B6E20(gEffects[index].obj.pos.x, gEffects[index].obj.pos.z + D_ctx_80177D20, &sp54, &sp4C, + Ground_801B6E20(gEffects[index].obj.pos.x, gEffects[index].obj.pos.z + gPathProgress, &sp54, &sp4C, &sp50); gEffects[index].obj.pos.y = sp4C + 3.0f; gEffects[index].obj.rot.x = RAD_TO_DEG(sp54); @@ -1046,31 +1046,31 @@ void Object_Init(s32 index, ObjectId objId) { gEffects[index].obj.status = OBJ_FREE; } break; - case OBJ_SCENERY_30: + case OBJ_SCENERY_TI_RIB_0: func_enmy_80063E5C(&gScenery[index], D_TI_6006940); break; - case OBJ_SCENERY_31: + case OBJ_SCENERY_TI_RIB_1: func_enmy_80063E5C(&gScenery[index], D_TI_600695C); break; - case OBJ_SCENERY_32: + case OBJ_SCENERY_TI_RIB_2: func_enmy_80063E5C(&gScenery[index], D_TI_6006978); break; - case OBJ_SCENERY_33: + case OBJ_SCENERY_TI_RIB_3: func_enmy_80063E5C(&gScenery[index], D_TI_6006994); break; - case OBJ_SCENERY_34: + case OBJ_SCENERY_TI_RIB_4: func_enmy_80063E5C(&gScenery[index], D_TI_60069B0); break; - case OBJ_SCENERY_35: + case OBJ_SCENERY_TI_RIB_5: func_enmy_80063E5C(&gScenery[index], D_TI_60069CC); break; - case OBJ_SCENERY_36: + case OBJ_SCENERY_TI_RIB_6: func_enmy_80063E5C(&gScenery[index], D_TI_60069E8); break; - case OBJ_SCENERY_37: + case OBJ_SCENERY_TI_RIB_7: func_enmy_80063E5C(&gScenery[index], D_TI_6006A04); break; - case OBJ_SCENERY_38: + case OBJ_SCENERY_TI_RIB_8: func_enmy_80063E5C(&gScenery[index], D_TI_6006A20); break; case OBJ_SCENERY_23: @@ -1342,13 +1342,13 @@ void Object_Init(s32 index, ObjectId objId) { } } -void func_enmy_800652CC(Scenery* scenery) { +void Scenery_UpdateTitaniaBones(Scenery* scenery) { f32 sp2C; f32 sp28; f32 sp24; if ((gGroundType == 4) && (scenery->state == 0)) { - Ground_801B6E20(scenery->obj.pos.x, scenery->obj.pos.z + D_ctx_80177D20, &sp2C, &sp24, &sp28); + Ground_801B6E20(scenery->obj.pos.x, scenery->obj.pos.z + gPathProgress, &sp2C, &sp24, &sp28); scenery->obj.pos.y = sp24 + 3.0f; scenery->obj.rot.x = RAD_TO_DEG(sp2C); scenery->obj.rot.z = RAD_TO_DEG(sp28); @@ -1513,7 +1513,7 @@ void func_enmy_800656D4(Actor* actor) { } } else { - actor->fwork[29] = gPlayer[0].unk_138; + actor->fwork[29] = gPlayer[0].trueZpos; actor->fwork[28] = gPlayer[0].pos.y; actor->fwork[27] = gPlayer[0].pos.x; } @@ -1547,9 +1547,9 @@ void func_enmy_800656D4(Actor* actor) { if ((fabsf(actor->fwork[27] - actor->obj.pos.x) < 60.0f) && (fabsf(actor->fwork[28] - actor->obj.pos.y) < 60.0f) && (fabsf(actor->fwork[29] - actor->obj.pos.z) < 60.0f) && ((spC4 == 2) || (spC4 == 3) || (spC4 == 4))) { - gActors[spC4].unk_0D0 = 1; + gActors[spC4].dmgType = 1; gActors[spC4].damage = 20; - gActors[spC4].unk_0D4 = 2; + gActors[spC4].dmgSource = 2; func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 5.0f); Object_Kill(&actor->obj, actor->sfxSource); @@ -1558,7 +1558,7 @@ void func_enmy_800656D4(Actor* actor) { Math_Vec3fFromAngles(&sp98, actor->obj.rot.x, actor->obj.rot.y, actor->fwork[5]); actor->vel.x = sp98.x; actor->vel.y = sp98.y; - actor->vel.z = sp98.z - D_ctx_80177D08; + actor->vel.z = sp98.z - gPathVelZ; if (actor->unk_0B4 == 0) { actor->obj.rot.z += 5.0f; } @@ -1576,18 +1576,18 @@ void func_enmy_800656D4(Actor* actor) { } Math_SmoothStepToAngle(&actor->obj.rot.z, var_fv0, 0.1f, 3.0f, 0.01f); } - if ((gGroundType == 4) && Ground_801B6AEC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + D_ctx_80177D20)) { + if ((gGroundType == 4) && Ground_801B6AEC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + gPathProgress)) { func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 5.0f); Object_Kill(&actor->obj, actor->sfxSource); } sp8C.x = actor->vel.x; sp8C.y = actor->vel.y; sp8C.z = actor->vel.z; - if ((Object_CheckCollision(actor->index, &actor->obj.pos, &sp8C, 1) != 0) || (actor->unk_0D0 != 0) || + if ((Object_CheckCollision(actor->index, &actor->obj.pos, &sp8C, 1) != 0) || (actor->dmgType != 0) || (actor->obj.pos.y < (gGroundHeight + 10.0f)) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE)) { 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) { + if (actor->dmgType != 0) { actor->itemDrop = DROP_SILVER_RING_50p; if ((gCurrentLevel == LEVEL_CORNERIA)) { if (gLevelMode == LEVELMODE_ALL_RANGE) { @@ -1604,10 +1604,10 @@ void func_enmy_800656D4(Actor* actor) { func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); } if (gLevelMode == LEVELMODE_ON_RAILS) { - if (fabsf(actor->obj.pos.z - gPlayer[0].unk_138) < 100.0f) { + if (fabsf(actor->obj.pos.z - gPlayer[0].trueZpos) < 100.0f) { actor->iwork[10] = 1; } - if (gPlayer[0].cam.eye.z < (actor->obj.pos.z + D_ctx_80177D20)) { + if (gPlayer[0].cam.eye.z < (actor->obj.pos.z + gPathProgress)) { Object_Kill(&actor->obj, actor->sfxSource); } } @@ -1649,12 +1649,12 @@ void Actor_Despawn(Actor* actor) { s32 i; if (gVersusMode) { - if ((actor->unk_0D4 > 0) && (actor->unk_0D4 < 5) && + if ((actor->dmgSource > 0) && (actor->dmgSource < 5) && !((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; + gPlayerScores[actor->dmgSource - 1] += actor->info.bonus; } - } else if ((actor->obj.id != OBJ_ACTOR_ALLRANGE) || (actor->unk_0B6 != 1)) { - if ((actor->unk_0D4 == 1) && (actor->info.bonus != 0)) { + } else if (!((actor->obj.id == OBJ_ACTOR_ALLRANGE) && (actor->unk_0B6 == 1))) { + if ((actor->dmgSource == 1) && (actor->info.bonus != 0)) { gHitCount += actor->info.bonus; D_ctx_80177850 = 15; if ((gLevelMode == LEVELMODE_ALL_RANGE) && (gDropHitCountItem != 0)) { @@ -1751,10 +1751,10 @@ void func_enmy_8006654C(Actor* actor) { break; } actor->scale = 0.8f; - if (actor->unk_0D0 != 0) { + if (actor->dmgType != 0) { actor->obj.status = OBJ_DYING; actor->vel.y = RAND_FLOAT(5.0f) + 6.0f; - if (actor->unk_0D0 == 2) { + if (actor->dmgType == 2) { actor->vel.y = -2.0f; } actor->vel.z = -15.0f; @@ -1798,7 +1798,7 @@ void func_enmy_800669A0(Actor* actor) { } } else { actor->obj.rot.y += 5.0f; - if (actor->unk_0D0 != 0) { + if (actor->dmgType != 0) { func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y + 130.0f, actor->obj.pos.z, 8.0f); func_effect_8007BFFC(actor->obj.pos.x, actor->obj.pos.y + 130.0f, actor->obj.pos.z, 0.0f, 0.0f, 0.0f, 4.0f, 5); @@ -1892,42 +1892,42 @@ void func_enmy_80066EA8(Scenery* scenery) { void func_enmy_80066EE4(Sprite* sprite) { } -void func_enmy_80066EF0(Item* item) { +void Item_CheckBounds(Item* this) { f32 var_fa1; if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_STANDBY)) { - Object_Kill(&item->obj, item->sfxSource); + Object_Kill(&this->obj, this->sfxSource); } if ((gLevelMode == LEVELMODE_ON_RAILS) && (gLastPathChange == 0)) { var_fa1 = 900.0f; if (gPlayer[0].form != FORM_ARWING) { var_fa1 = 600.0f; } - if (item->obj.pos.x > gPlayer[0].unk_0AC + var_fa1) { - Math_SmoothStepToF(&item->obj.pos.x, gPlayer[0].unk_0AC + var_fa1, 0.1f, 10.0f, 0.01f); + if (this->obj.pos.x > gPlayer[0].xPath + var_fa1) { + Math_SmoothStepToF(&this->obj.pos.x, gPlayer[0].xPath + var_fa1, 0.1f, 10.0f, 0.01f); } - if (item->obj.pos.x < gPlayer[0].unk_0AC - var_fa1) { - Math_SmoothStepToF(&item->obj.pos.x, gPlayer[0].unk_0AC - var_fa1, 0.1f, 10.0f, 0.01f); + if (this->obj.pos.x < gPlayer[0].xPath - var_fa1) { + Math_SmoothStepToF(&this->obj.pos.x, gPlayer[0].xPath - var_fa1, 0.1f, 10.0f, 0.01f); } } - if (item->obj.pos.y > 650.0f) { - Math_SmoothStepToF(&item->obj.pos.y, 650.0f, 0.1f, 10.0f, 0.01f); + if (this->obj.pos.y > 650.0f) { + Math_SmoothStepToF(&this->obj.pos.y, 650.0f, 0.1f, 10.0f, 0.01f); } if (gLevelType == LEVELTYPE_PLANET) { - if (item->obj.pos.y < gGroundHeight + 70.0f) { - Math_SmoothStepToF(&item->obj.pos.y, gGroundHeight + 70.0f, 0.1f, 5.0f, 0.01f); + if (this->obj.pos.y < gGroundHeight + 70.0f) { + Math_SmoothStepToF(&this->obj.pos.y, gGroundHeight + 70.0f, 0.1f, 5.0f, 0.01f); } if ((gCurrentLevel == LEVEL_AQUAS) && (gBossActive != 0)) { - item->obj.pos.z += 20.0f; + this->obj.pos.z += 20.0f; } - } else if (item->obj.pos.y < -500.0f) { - Math_SmoothStepToF(&item->obj.pos.y, -500.0f, 0.1f, 5.0f, 0.01f); + } else if (this->obj.pos.y < -500.0f) { + Math_SmoothStepToF(&this->obj.pos.y, -500.0f, 0.1f, 5.0f, 0.01f); } - if (gVersusMode && (item->index == 0) && (gItems[1].obj.status == OBJ_ACTIVE)) { - if (fabsf(item->obj.pos.x - gItems[1].obj.pos.x) < 200.0f) { - if (fabsf(item->obj.pos.z - gItems[1].obj.pos.z) < 200.0f) { - item->obj.pos.x = item->obj.pos.x - 5.0f; - item->obj.pos.z = item->obj.pos.z - 5.0f; + if (gVersusMode && (this->index == 0) && (gItems[1].obj.status == OBJ_ACTIVE)) { + if (fabsf(this->obj.pos.x - gItems[1].obj.pos.x) < 200.0f) { + if (fabsf(this->obj.pos.z - gItems[1].obj.pos.z) < 200.0f) { + this->obj.pos.x = this->obj.pos.x - 5.0f; + this->obj.pos.z = this->obj.pos.z - 5.0f; gItems[1].obj.pos.x += 5.0f; gItems[1].obj.pos.z += 5.0f; } @@ -1935,29 +1935,29 @@ void func_enmy_80066EF0(Item* item) { } } -void func_enmy_800671D0(Item* item) { - s32 var_v0; +void Item_SpinPickup(Item* this) { + s32 sparkleMask; Vec3f sp40; Vec3f sp34; - Math_SmoothStepToF(&item->unk_50, 10.0f, 1.0f, 2.0f, 0.0f); - if (item->unk_50 > 30.0f) { - var_v0 = 0; - } else if (item->unk_50 > 20.0f) { - var_v0 = 1; + Math_SmoothStepToF(&this->unk_50, 10.0f, 1.0f, 2.0f, 0.0f); + if (this->unk_50 > 30.0f) { + sparkleMask = 1 - 1; + } else if (this->unk_50 > 20.0f) { + sparkleMask = 2 - 1; } else { - var_v0 = 7; + sparkleMask = 8 - 1; } - if (!(var_v0 & gGameFrameCount)) { + if (!(sparkleMask & gGameFrameCount)) { Matrix_RotateY(gCalcMatrix, gGameFrameCount * 23.0f * M_DTOR, MTXF_NEW); sp40.x = 50.0f; sp40.y = RAND_FLOAT_CENTERED(120.0f); sp40.z = 0.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp40, &sp34); - func_effect_80078E50(item->obj.pos.x + sp34.x, item->obj.pos.y + sp34.y, item->obj.pos.z + sp34.z, 3.0f); + func_effect_80078E50(this->obj.pos.x + sp34.x, this->obj.pos.y + sp34.y, this->obj.pos.z + sp34.z, 3.0f); } - item->obj.rot.y += item->unk_50; - item->obj.rot.y = Math_ModF(item->obj.rot.y, 360.0f); + this->obj.rot.y += this->unk_50; + this->obj.rot.y = Math_ModF(this->obj.rot.y, 360.0f); } void func_enmy_80067348(Actor* actor, f32 xPos, f32 yPos, f32 zPos, f32 xRot, f32 yRot, f32 arg6, f32 arg7, f32 arg8) { @@ -2003,8 +2003,8 @@ void ActorSupplies_Update(ActorSupplies* this) { Math_SmoothStepToF(&this->obj.pos.y, 300.0f, 0.05f, 50.0f, 0.01f); } } - if (this->unk_0D0 != 0) { - this->unk_0D0 = 0; + if (this->dmgType != 0) { + this->dmgType = 0; this->health -= this->damage; if (this->health <= 0) { func_effect_8007A6F0(&this->obj.pos, 0x2903A008); @@ -2035,7 +2035,7 @@ void ActorSupplies_Update(ActorSupplies* this) { gRadarMarks[63].pos.x = this->obj.pos.x; gRadarMarks[63].pos.y = this->obj.pos.y; gRadarMarks[63].pos.z = this->obj.pos.z; - gRadarMarks[63].unk_10 = 0.0f; + gRadarMarks[63].yRot = 0.0f; } void ActorSupplies_Draw(Actor* actor) { @@ -2073,8 +2073,8 @@ void func_enmy_80067A40(void) { } void Item1up_Update(Item1UP* this) { - func_enmy_80066EF0(this); - func_enmy_800671D0(this); + Item_CheckBounds(this); + Item_SpinPickup(this); if (this->collected) { Object_Kill(&this->obj, this->sfxSource); func_enmy_80060F30(gPlayer[this->playerNum].sfxSource, 0x4900C024, this->playerNum); @@ -2088,12 +2088,12 @@ void Item1up_Update(Item1UP* this) { } void ItemPickup_Update(Item* this) { - func_enmy_80066EF0(this); - func_enmy_800671D0(this); + Item_CheckBounds(this); + Item_SpinPickup(this); if (this->state == 0) { switch (this->obj.id) { case OBJ_ITEM_BOMB: - this->scale = 18.0f; + this->width = 18.0f; if (this->collected) { this->timer_4A = 50; this->state = 1; @@ -2105,7 +2105,7 @@ void ItemPickup_Update(Item* this) { } break; case OBJ_ITEM_LASERS: - this->scale = 18.0f; + this->width = 18.0f; if (this->collected) { this->timer_4A = 50; this->state = 1; @@ -2127,14 +2127,14 @@ void ItemPickup_Update(Item* this) { break; } } else { - Math_SmoothStepToF(&this->scale, 2.5f, 1.0f, 0.5f, 0.0f); + Math_SmoothStepToF(&this->width, 2.5f, 1.0f, 0.5f, 0.0f); this->obj.pos.x += (gPlayer[this->playerNum].pos.x - this->obj.pos.x) * 0.5f; if (gPlayer[this->playerNum].form == FORM_LANDMASTER) { this->obj.pos.y += ((gPlayer[this->playerNum].pos.y + 50.0f) - this->obj.pos.y) * 0.5f; } else { this->obj.pos.y += (gPlayer[this->playerNum].pos.y - this->obj.pos.y) * 0.5f; } - this->obj.pos.z += (gPlayer[this->playerNum].unk_138 - this->obj.pos.z) * 0.5f; + this->obj.pos.z += (gPlayer[this->playerNum].trueZpos - this->obj.pos.z) * 0.5f; if (this->timer_48 == 0) { Object_Kill(&this->obj, this->sfxSource); } @@ -2159,9 +2159,9 @@ void ItemSupplyRing_Update(Item* this) { switch (this->state) { case 0: - Math_SmoothStepToF(&this->scale, 0.4f, 1.0f, 0.05f, 0.0f); - func_enmy_80066EF0(this); - func_enmy_800671D0(this); + Math_SmoothStepToF(&this->width, 0.4f, 1.0f, 0.05f, 0.0f); + Item_CheckBounds(this); + Item_SpinPickup(this); if (this->collected) { this->state = 1; this->timer_48 = 50; @@ -2179,7 +2179,7 @@ void ItemSupplyRing_Update(Item* this) { } gPlayer[this->playerNum].heal += 32; BonusText_Display(gPlayer[this->playerNum].pos.x, gPlayer[this->playerNum].pos.y, - gPlayer[this->playerNum].unk_138, BONUS_TEXT_1UP); + gPlayer[this->playerNum].trueZpos, BONUS_TEXT_1UP); } else { gPlayer[this->playerNum].heal += 32; func_enmy_80060F30(gPlayer[this->playerNum].sfxSource, 0x49003013, this->playerNum); @@ -2195,9 +2195,9 @@ void ItemSupplyRing_Update(Item* this) { break; case 1: if (this->timer_48 > 30) { - Math_SmoothStepToF(&this->scale, 1.0f, 1.0f, 0.06f, 0.0f); + Math_SmoothStepToF(&this->width, 1.0f, 1.0f, 0.06f, 0.0f); } else { - Math_SmoothStepToF(&this->scale, 0.0f, 1.0f, 0.06f, 0.0f); + Math_SmoothStepToF(&this->width, 0.0f, 1.0f, 0.06f, 0.0f); } this->obj.pos.x += (gPlayer[this->playerNum].pos.x - this->obj.pos.x) * 0.5f; if (gPlayer[this->playerNum].form == FORM_LANDMASTER) { @@ -2206,9 +2206,9 @@ void ItemSupplyRing_Update(Item* this) { this->obj.pos.y += (gPlayer[this->playerNum].pos.y - this->obj.pos.y) * 0.5f; } if (gPlayer[0].cockpitView && (gLevelMode == LEVELMODE_ON_RAILS)) { - this->obj.pos.z += (gPlayer[this->playerNum].unk_138 - 300.0f - this->obj.pos.z) * 0.3f; + this->obj.pos.z += (gPlayer[this->playerNum].trueZpos - 300.0f - this->obj.pos.z) * 0.3f; } else { - this->obj.pos.z += (gPlayer[this->playerNum].unk_138 - this->obj.pos.z) * 0.5f; + this->obj.pos.z += (gPlayer[this->playerNum].trueZpos - this->obj.pos.z) * 0.5f; } this->obj.rot.z += 22.0f; Math_SmoothStepToAngle(&this->obj.rot.y, Math_RadToDeg(-gPlayer[this->playerNum].camYaw), 0.2f, 10.0f, @@ -2216,11 +2216,11 @@ void ItemSupplyRing_Update(Item* this) { if (this->timer_48 == 0) { Object_Kill(&this->obj, this->sfxSource); } - if (this->scale > 0.3f) { + if (this->width > 0.3f) { Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); Matrix_RotateZ(gCalcMatrix, gGameFrameCount * 37.0f * M_DTOR, MTXF_APPLY); sp4C.x = 0.0f; - sp4C.y = this->scale * 100.0f; + sp4C.y = this->width * 100.0f; sp4C.z = 0.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp4C, &sp40); func_effect_80078E50(this->obj.pos.x + sp40.x, this->obj.pos.y + sp40.y, this->obj.pos.z + sp40.z, @@ -2239,8 +2239,8 @@ void ItemGoldRing_Update(ItemGoldRing* this) { } void ItemWingRepair_Update(ItemWingRepair* this) { - func_enmy_80066EF0(this); - func_enmy_800671D0(this); + Item_CheckBounds(this); + Item_SpinPickup(this); if (this->collected) { func_enmy_80067A40(); Object_Kill(&this->obj, this->sfxSource); @@ -2251,16 +2251,16 @@ void ItemWingRepair_Update(ItemWingRepair* this) { } void ItemMeteoWarp_Update(ItemMeteoWarp* this) { - func_enmy_80066EF0(this); + Item_CheckBounds(this); if (this->state > 0) { if (this->state == 1) { this->obj.rot.z -= 10.0f; this->obj.pos.x += (gPlayer[this->playerNum].pos.x - this->obj.pos.x) * 0.3f; this->obj.pos.y += (gPlayer[this->playerNum].pos.y - this->obj.pos.y) * 0.3f; - this->obj.pos.z += (gPlayer[this->playerNum].unk_138 - this->obj.pos.z) * 0.3f; - this->scale -= 5.0f; - if (this->scale < 0.0f) { - this->scale = 0.0f; + this->obj.pos.z += (gPlayer[this->playerNum].trueZpos - this->obj.pos.z) * 0.3f; + this->width -= 5.0f; + if (this->width < 0.0f) { + this->width = 0.0f; } } this->unk_44 -= 10; @@ -2268,14 +2268,14 @@ void ItemMeteoWarp_Update(ItemMeteoWarp* this) { Object_Kill(&this->obj, this->sfxSource); } } else { - this->scale = 100.0f; + this->width = 100.0f; if (gRingPassCount < 0) { this->state = 2; this->unk_44 = 255; } else if (this->collected) { this->state = 1; this->unk_44 = 255; - gPlayer[this->playerNum].timer_27C = 100; + gPlayer[this->playerNum].meteoWarpTimer = 100; AUDIO_PLAY_SFX(gWarpRingSfx[gRingPassCount], gPlayer[0].sfxSource, 0); if (gRingPassCount == 0) { gPlayer[0].boostSpeed = 0.0f; @@ -2283,7 +2283,7 @@ void ItemMeteoWarp_Update(ItemMeteoWarp* this) { gRingPassCount++; if (gRingPassCount >= 7) { gPlayer[0].state_1C8 = PLAYERSTATE_1C8_ENTER_WARP_ZONE; - gPlayer[0].unk_1D0 = 0; + gPlayer[0].csState = 0; AUDIO_PLAY_SFX(0x1900602A, gDefaultSfxSource, 0); gMissionStatus = MISSION_WARP; gLeveLClearStatus[gCurrentLevel] = 1; @@ -2295,7 +2295,7 @@ void ItemMeteoWarp_Update(ItemMeteoWarp* this) { void ItemCheckpoint_Update(ItemCheckpoint* this) { s32 i; - func_enmy_80066EF0(this); + Item_CheckBounds(this); this->unk_58 -= this->unk_44; if (this->state > 0) { this->unk_44++; @@ -2306,30 +2306,30 @@ void ItemCheckpoint_Update(ItemCheckpoint* this) { this->obj.pos.y += (gPlayer[this->playerNum].pos.y - this->obj.pos.y) * 0.3f; } if (gPlayer[0].cockpitView) { - this->obj.pos.z += (gPlayer[this->playerNum].unk_138 - 200.0f - this->obj.pos.z) * 0.3f; + this->obj.pos.z += (gPlayer[this->playerNum].trueZpos - 200.0f - this->obj.pos.z) * 0.3f; } else { - this->obj.pos.z += (gPlayer[this->playerNum].unk_138 - 100.0f - this->obj.pos.z) * 0.3f; + this->obj.pos.z += (gPlayer[this->playerNum].trueZpos - 100.0f - this->obj.pos.z) * 0.3f; } if (this->timer_48 == 0) { - Math_SmoothStepToF(&this->scale, 5.0f, 0.2f, 15.0f, 0.01f); + Math_SmoothStepToF(&this->width, 5.0f, 0.2f, 15.0f, 0.01f); Math_SmoothStepToF(&this->unk_50, 0.0f, 0.1f, 0.03f, 0.0f); Math_SmoothStepToF(&this->unk_54, 4.0f, 0.1f, 0.2f, 0.01f); } - if (this->scale <= 6.5f) { + if (this->width <= 6.5f) { Object_Kill(&this->obj, this->sfxSource); } } else { this->unk_44 = 2; this->unk_50 = 1.0f; this->unk_54 = 1.0f; - this->scale = 100.0f; + this->width = 100.0f; if (this->collected) { gPlayer[this->playerNum].heal = 128; this->state++; this->timer_48 = 15; gSavedGroundSurface = gGroundSurface; - D_ctx_80177CB0 = -this->obj.pos.z; - D_ctx_80177CB0 -= 250.0f; + gSavedPathProgress = -this->obj.pos.z; + gSavedPathProgress -= 250.0f; gSavedObjectLoadIndex = gObjectLoadIndex; gSavedZoSearchlightStatus = gMissedZoSearchlight; gSavedHitCount = gHitCount; @@ -2341,9 +2341,9 @@ void ItemCheckpoint_Update(ItemCheckpoint* this) { } } -void ItemRingCheck_Update(Item* item) { - if (item->collected) { - Object_Kill(&item->obj, item->sfxSource); +void ItemRingCheck_Update(Item* this) { + if (this->collected) { + Object_Kill(&this->obj, this->sfxSource); gRingPassCount++; } } @@ -2354,14 +2354,14 @@ void ItemPathChange_Update(Item* this) { Object_Kill(&this->obj, this->sfxSource); } else if (((gCurrentLevel == LEVEL_METEO) || (gCurrentLevel == LEVEL_SECTOR_X)) && (gLevelPhase == 1)) { gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; - gPlayer[0].unk_1D0 = 0; + gPlayer[0].csState = 0; Object_Kill(&this->obj, this->sfxSource); } else if (gCurrentLevel == LEVEL_TRAINING) { gPlayer[0].state_1C8 = PLAYERSTATE_1C8_START_360; - gPlayer[0].unk_1D0 = 0; + gPlayer[0].csState = 0; Object_Kill(&this->obj, this->sfxSource); } else if (this->state == 0) { - if (((this->obj.pos.z + D_ctx_80177D20) > -2700.0f) && (fabsf(this->obj.pos.x - gPlayer[0].pos.x) < 1000.0f)) { + if (((this->obj.pos.z + gPathProgress) > -2700.0f) && (fabsf(this->obj.pos.x - gPlayer[0].pos.x) < 1000.0f)) { switch (this->obj.id) { case OBJ_ITEM_PATH_SPLIT_Y: case OBJ_ITEM_PATH_TURN_UP: @@ -2380,42 +2380,42 @@ void ItemPathChange_Update(Item* this) { } if (this->collected) { Object_Kill(&this->obj, this->sfxSource); - gPlayer[0].unk_0B4 = 0.0f; - gPlayer[0].timer_210 = this->scale * 0.05f; + gPlayer[0].pathStep = 0.0f; + gPlayer[0].timer_210 = this->width * 0.05f; switch (this->obj.id) { case OBJ_ITEM_PATH_SPLIT_X: if (this->obj.pos.x < gPlayer[0].pos.x) { - gPlayer[0].unk_118 = -30.0f; - gPlayer[0].unk_0B8 = gPlayer[0].unk_0AC + this->scale; + gPlayer[0].yRot_118 = -30.0f; + gPlayer[0].xPathTarget = gPlayer[0].xPath + this->width; } else { - gPlayer[0].unk_118 = 30.0f; - gPlayer[0].unk_0B8 = gPlayer[0].unk_0AC - this->scale; + gPlayer[0].yRot_118 = 30.0f; + gPlayer[0].xPathTarget = gPlayer[0].xPath - this->width; } break; case OBJ_ITEM_PATH_TURN_LEFT: - gPlayer[0].unk_118 = 30.0f; - gPlayer[0].unk_0B8 = gPlayer[0].unk_0AC - this->scale; + gPlayer[0].yRot_118 = 30.0f; + gPlayer[0].xPathTarget = gPlayer[0].xPath - this->width; break; case OBJ_ITEM_PATH_TURN_RIGHT: - gPlayer[0].unk_118 = -30.0f; - gPlayer[0].unk_0B8 = gPlayer[0].unk_0AC + this->scale; + gPlayer[0].yRot_118 = -30.0f; + gPlayer[0].xPathTarget = gPlayer[0].xPath + this->width; break; case OBJ_ITEM_PATH_SPLIT_Y: if (this->obj.pos.y < gPlayer[0].pos.y) { - gPlayer[0].unk_124 = 30.0f; - gPlayer[0].unk_0BC = gPlayer[0].unk_0B0 + this->scale; + gPlayer[0].xRot_124 = 30.0f; + gPlayer[0].yPathTarget = gPlayer[0].yPath + this->width; } else { - gPlayer[0].unk_124 = -30.0f; - gPlayer[0].unk_0BC = gPlayer[0].unk_0B0 - this->scale; + gPlayer[0].xRot_124 = -30.0f; + gPlayer[0].yPathTarget = gPlayer[0].yPath - this->width; } break; case OBJ_ITEM_PATH_TURN_UP: - gPlayer[0].unk_124 = 30.0f; - gPlayer[0].unk_0BC = gPlayer[0].unk_0B0 + this->scale; + gPlayer[0].xRot_124 = 30.0f; + gPlayer[0].yPathTarget = gPlayer[0].yPath + this->width; break; case OBJ_ITEM_PATH_TURN_DOWN: - gPlayer[0].unk_124 = -30.0f; - gPlayer[0].unk_0BC = gPlayer[0].unk_0B0 - this->scale; + gPlayer[0].xRot_124 = -30.0f; + gPlayer[0].yPathTarget = gPlayer[0].yPath - this->width; break; } } @@ -2423,10 +2423,10 @@ void ItemPathChange_Update(Item* this) { } void Sprite_UpdateDoodad(Sprite* this) { - this->obj.rot.y = (Math_Atan2F(gPlayer[0].cam.eye.x - this->obj.pos.x, - gPlayer[0].cam.eye.z - (this->obj.pos.z + D_ctx_80177D20)) * - 180.0f) / - M_PI; + this->obj.rot.y = + (Math_Atan2F(gPlayer[0].cam.eye.x - this->obj.pos.x, gPlayer[0].cam.eye.z - (this->obj.pos.z + gPathProgress)) * + 180.0f) / + M_PI; if (this->unk_46 != 0) { this->obj.status = OBJ_FREE; func_effect_8007A6F0(&this->obj.pos, 0x1903400F); @@ -2458,7 +2458,7 @@ void Object_Dying(s32 index, ObjectId objId) { func_enmy2_800763A4(&gActors[index]); break; case OBJ_ACTOR_194: - Actor194_Init(&gActors[index]); + Actor194_Dying(&gActors[index]); break; case OBJ_ACTOR_186: Meteo_80187B08(&gActors[index]); @@ -2488,48 +2488,50 @@ void Object_Dying(s32 index, ObjectId objId) { } void Actor_Move(Actor* actor) { + f32 var_fv0; + actor->obj.pos.x += actor->vel.x; actor->obj.pos.z += actor->vel.z; actor->obj.pos.y += actor->vel.y; actor->vel.y -= actor->gravity; - 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 (!gCullObjects || (actor->obj.id == OBJ_ACTOR_TEAM_BOSS) || + ((gCurrentLevel == LEVEL_MACBETH) && (actor->obj.id != OBJ_ACTOR_EVENT))) { + return; + } + var_fv0 = 4000.0f; - if ((actor->obj.id == OBJ_ACTOR_236) || (gCurrentLevel == LEVEL_MACBETH) || - ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == EINFO_56))) { - var_fv0 = 8000.0f; - } else if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ENTER_WARP_ZONE) { - var_fv0 = 100000.0f; - } - if (((gPlayer[0].cam.eye.z + actor->info.unk_10) < (actor->obj.pos.z + D_ctx_80177D20)) || - ((actor->obj.pos.z + D_ctx_80177D20) < -15000.0f) || (actor->obj.pos.y < (gPlayer[0].unk_0B0 - var_fv0)) || - ((gPlayer[0].unk_0B0 + var_fv0) < actor->obj.pos.y) || - ((gPlayer[0].unk_0AC + var_fv0) < actor->obj.pos.x) || - (actor->obj.pos.x < (gPlayer[0].unk_0AC - var_fv0))) { - Object_Kill(&actor->obj, actor->sfxSource); - switch (actor->obj.id) { - case OBJ_ACTOR_236: - D_ctx_801784A4 = 0; - break; - case OBJ_ACTOR_229: - Titania_8018E3B0(actor); - break; - case OBJ_ACTOR_194: + if ((actor->obj.id == OBJ_ACTOR_236) || (gCurrentLevel == LEVEL_MACBETH) || + ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == EINFO_56))) { + var_fv0 = 8000.0f; + } else if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ENTER_WARP_ZONE) { + var_fv0 = 100000.0f; + } + if (((gPlayer[0].cam.eye.z + actor->info.cullDistance) < (actor->obj.pos.z + gPathProgress)) || + ((actor->obj.pos.z + gPathProgress) < -15000.0f) || (actor->obj.pos.y < (gPlayer[0].yPath - var_fv0)) || + ((gPlayer[0].yPath + var_fv0) < actor->obj.pos.y) || ((gPlayer[0].xPath + var_fv0) < actor->obj.pos.x) || + (actor->obj.pos.x < (gPlayer[0].xPath - var_fv0))) { + Object_Kill(&actor->obj, actor->sfxSource); + switch (actor->obj.id) { + case OBJ_ACTOR_236: + D_ctx_801784A4 = 0; + break; + case OBJ_ACTOR_229: + Titania_8018E3B0(actor); + break; + case OBJ_ACTOR_194: + gActor194Status[actor->unk_046] = 0; + break; + case OBJ_ACTOR_EVENT: + if ((actor->unk_0B4 >= EINFO_200) && (actor->unk_0B4 < EINFO_300)) { gActor194Status[actor->unk_046] = 0; - break; - case OBJ_ACTOR_EVENT: - if ((actor->unk_0B4 >= EINFO_200) && (actor->unk_0B4 < EINFO_300)) { - gActor194Status[actor->unk_046] = 0; - } else if ((actor->unk_0B4 == EINFO_38) && (actor->unk_046 != 2)) { - gRingPassCount = -1; - } - break; - case OBJ_ACTOR_252: - gMissedZoSearchlight = true; - break; - } + } else if ((actor->unk_0B4 == EINFO_38) && (actor->unk_046 != 2)) { + gRingPassCount = -1; + } + break; + case OBJ_ACTOR_252: + gMissedZoSearchlight = true; + break; } } } @@ -2539,7 +2541,7 @@ void Boss_Move(Boss* boss) { boss->obj.pos.y += boss->vel.y; boss->obj.pos.z += boss->vel.z; boss->vel.y -= boss->gravity; - if ((D_ctx_80161AB8 != 0) && ((boss->obj.pos.z + D_ctx_80177D20) > (boss->info.unk_10 - gPlayer[0].cam.eye.z))) { + if (gCullObjects && ((boss->obj.pos.z + gPathProgress) > (boss->info.cullDistance - gPlayer[0].cam.eye.z))) { if (gPlayer[0].cam.eye.z) {} // fake Object_Kill(&boss->obj, boss->sfxSource); } @@ -2548,7 +2550,7 @@ void Boss_Move(Boss* boss) { void Scenery_Move(Scenery* scenery) { if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) { scenery->obj.pos.z += scenery->unk_60; - if (scenery->info.unk_10 < scenery->obj.pos.z) { + if (scenery->info.cullDistance < scenery->obj.pos.z) { Object_Kill(&scenery->obj, scenery->sfxSource); } } else if ((gLevelMode == LEVELMODE_ON_RAILS) && (gBossActive != 2)) { @@ -2559,18 +2561,18 @@ void Scenery_Move(Scenery* scenery) { var_fa0 = 1000.0f; } temp_fv0 = ((temp_fv0 - var_fa0) < 0.0f) ? 0.0f : (temp_fv0 - var_fa0) * 1.7f; - if ((fabsf(gPlayer[0].unk_114) > 1.0f) || (gCurrentLevel == LEVEL_MACBETH)) { + if ((fabsf(gPlayer[0].yRot_114) > 1.0f) || (gCurrentLevel == LEVEL_MACBETH)) { temp_fv0 = 0.0f; } temp_fv0 -= gPlayer[0].cam.eye.z; - if ((scenery->info.unk_10 - temp_fv0) < (scenery->obj.pos.z + D_ctx_80177D20)) { + if ((scenery->info.cullDistance - temp_fv0) < (scenery->obj.pos.z + gPathProgress)) { Object_Kill(&scenery->obj, scenery->sfxSource); } } } void Sprite_Move(Sprite* sprite) { - if (D_ctx_80161AB8 != 0) { + if (gCullObjects) { f32 temp_fv0 = fabsf(sprite->obj.pos.x - gPlayer[0].cam.eye.x); f32 var_fa0 = 500.0f; @@ -2581,7 +2583,7 @@ void Sprite_Move(Sprite* sprite) { } temp_fv0 = ((temp_fv0 - var_fa0) < 0.0f) ? 0.0f * 1.7f : (temp_fv0 - var_fa0) * 1.7f; temp_fv0 -= gPlayer[0].cam.eye.z; - if ((sprite->info.unk_10 - temp_fv0) < (sprite->obj.pos.z + D_ctx_80177D20)) { + if ((sprite->info.cullDistance - temp_fv0) < (sprite->obj.pos.z + gPathProgress)) { sprite->obj.status = OBJ_FREE; } } @@ -2591,8 +2593,8 @@ void Effect_Move(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_ctx_80161AB8 != 0) { - if ((gPlayer[0].cam.eye.z + effect->info.unk_10) < (effect->obj.pos.z + D_ctx_80177D20)) { + if (gCullObjects) { + if ((gPlayer[0].cam.eye.z + effect->info.cullDistance) < (effect->obj.pos.z + gPathProgress)) { Object_Kill(&effect->obj, effect->sfxSource); } else if ((fabsf(effect->obj.pos.y - gPlayer[0].cam.eye.y) > 25000.0f) || (fabsf(effect->obj.pos.x - gPlayer[0].cam.eye.x) > 25000.0f)) { @@ -2602,10 +2604,10 @@ void Effect_Move(Effect* effect) { } void Item_Move(Item* item) { - if (D_ctx_80161AB8 != 0) { + if (gCullObjects) { f32 temp = (0.0f - gPlayer[0].cam.eye.z); - if ((item->info.unk_10 - temp) < (item->obj.pos.z + D_ctx_80177D20)) { + if ((item->info.cullDistance - temp) < (item->obj.pos.z + gPathProgress)) { Object_Kill(&item->obj, item->sfxSource); if ((item->obj.id == OBJ_ITEM_METEO_WARP) && (item->state == 0)) { gRingPassCount = -1; @@ -2798,36 +2800,36 @@ void Effect_Update(Effect* this) { void TexturedLine_Update(TexturedLine* this) { Vec3f sp44; Vec3f sp38; - f32 sp34; - f32 sp30; - f32 sp2C; + f32 dx; + f32 dy; + f32 dz; if (this->timer != 0) { this->timer--; } - sp34 = this->unk_04.x - this->unk_10.x; - sp30 = this->unk_04.y - this->unk_10.y; - sp2C = this->unk_04.z - this->unk_10.z; - this->unk_20 = Math_Atan2F(sp34, sp2C); - this->unk_1C = -Math_Atan2F(sp30, sqrtf(SQ(sp34) + SQ(sp2C))); + dx = this->posAA.x - this->posBB.x; + dy = this->posAA.y - this->posBB.y; + dz = this->posAA.z - this->posBB.z; + this->yRot = Math_Atan2F(dx, dz); + this->xRot = -Math_Atan2F(dy, sqrtf(SQ(dx) + SQ(dz))); if (this->mode != 4) { - this->unk_24 = sqrtf(SQ(sp34) + SQ(sp30) + SQ(sp2C)); + this->zScale = sqrtf(SQ(dx) + SQ(dy) + SQ(dz)); } if (gGameState == GSTATE_PLAY) { if (((this->mode == 1) || (this->mode == 101) || (this->mode == 50)) && - (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (gPlayer[0].unk_1F4 == 0)) { - Matrix_RotateX(gCalcMatrix, -this->unk_1C, MTXF_NEW); - Matrix_RotateY(gCalcMatrix, -this->unk_20, MTXF_APPLY); - sp44.x = gPlayer[gPlayerNum].pos.x - this->unk_04.x; - sp44.y = gPlayer[gPlayerNum].pos.y - this->unk_04.y; - sp44.z = gPlayer[gPlayerNum].unk_138 - this->unk_04.z; + (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (gPlayer[0].hitTimer == 0)) { + Matrix_RotateX(gCalcMatrix, -this->xRot, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, -this->yRot, MTXF_APPLY); + sp44.x = gPlayer[gPlayerNum].pos.x - this->posAA.x; + sp44.y = gPlayer[gPlayerNum].pos.y - this->posAA.y; + sp44.z = gPlayer[gPlayerNum].trueZpos - this->posAA.z; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp38); - sp38.x += this->unk_04.x; - sp38.y += this->unk_04.y; - sp38.z += this->unk_04.z; - if ((fabsf(sp38.x - this->unk_04.x) < 30.0f) && (fabsf(sp38.y - this->unk_04.y) < 30.0f) && - (sp38.z < this->unk_04.z) && ((this->unk_04.z - this->unk_24) < sp38.z)) { + sp38.x += this->posAA.x; + sp38.y += this->posAA.y; + sp38.z += this->posAA.z; + if ((fabsf(sp38.x - this->posAA.x) < 30.0f) && (fabsf(sp38.y - this->posAA.y) < 30.0f) && + (sp38.z < this->posAA.z) && ((this->posAA.z - this->zScale) < sp38.z)) { if (gCurrentLevel == LEVEL_AQUAS) { Player_ApplyDamage(&gPlayer[0], 0, 30); } else { @@ -2838,7 +2840,7 @@ void TexturedLine_Update(TexturedLine* this) { } } } - if (((this->unk_04.z + D_ctx_80177D20) > 1000.0f) && (gLevelMode != LEVELMODE_ALL_RANGE)) { + if (((this->posAA.z + gPathProgress) > 1000.0f) && (gLevelMode != LEVELMODE_ALL_RANGE)) { this->mode = 0; } if (((this->mode == 3) || (this->mode == 50)) && (this->timer == 0)) { @@ -2869,12 +2871,12 @@ void Object_Update(void) { Item* item; Effect* effect; - D_ctx_80161AB8 = 0; + gCullObjects = false; if ((gLevelMode == LEVELMODE_ON_RAILS) && ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_INIT) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_DOWN) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ENTER_WARP_ZONE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_START_360) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_NEXT))) { - D_ctx_80161AB8 = 1; + gCullObjects = true; } if (gLevelMode != LEVELMODE_ALL_RANGE) { if ((gLoadLevelObjects != 0) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO)) { diff --git a/src/engine/fox_enmy2.c b/src/engine/fox_enmy2.c index 64ff8b25..6b8b44c8 100644 --- a/src/engine/fox_enmy2.c +++ b/src/engine/fox_enmy2.c @@ -103,7 +103,7 @@ void Obj54_8006AA3C(f32 xPos, f32 yPos, f32 zPos) { } } -void Obj54_Update(Scenery_54* this) { +void Scenery54_Update(Scenery_54* this) { Vec3f sp24; Vec3f sp18; @@ -134,7 +134,7 @@ void Actor201_Update(Actor201* this) { func_effect_8007F11C(OBJ_EFFECT_353, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, gEnemyShotSpeed); this->timer_0BC = 20; } - sp2C = this->obj.pos.z + D_ctx_80177D20; + sp2C = this->obj.pos.z + gPathProgress; this->obj.rot.y = Math_RadToDeg(Math_Atan2F(gPlayer[0].cam.eye.x - this->obj.pos.x, gPlayer[0].cam.eye.z - sp2C)); this->obj.rot.x = -Math_RadToDeg( Math_Atan2F(gPlayer[0].cam.eye.y - this->obj.pos.y, @@ -147,7 +147,7 @@ void Actor202_Update(Actor202* this) { this->gravity = 1.5f; sp34 = false; this->obj.rot.y = Math_RadToDeg( - Math_Atan2F(gPlayer[gPlayerNum].pos.x - this->obj.pos.x, gPlayer[gPlayerNum].unk_138 - this->obj.pos.z)); + Math_Atan2F(gPlayer[gPlayerNum].pos.x - this->obj.pos.x, gPlayer[gPlayerNum].trueZpos - this->obj.pos.z)); if (this->obj.pos.y < -500.0f) { this->obj.pos.y = -500.0f; this->vel.y = 0.0f; @@ -209,9 +209,9 @@ void Actor202_Update(Actor202* this) { break; } - if (this->unk_0D0 != 0) { + if (this->dmgType != 0) { this->health -= 10; - if ((this->health <= 0) || (this->unk_0D0 >= 2)) { + if ((this->health <= 0) || (this->dmgType >= 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); @@ -220,7 +220,7 @@ void Actor202_Update(Actor202* this) { gHitCount += this->info.bonus; D_ctx_80177850 = 15; } else { - this->unk_0D0 = 0; + this->dmgType = 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); @@ -240,7 +240,7 @@ static f32 D_800CFFC4[16] = { }; static Gfx* D_800D0004[3] = { D_ENMY_SPACE_4000170, D_ENMY_SPACE_40084D0, D_ENMY_SPACE_400A630 }; -void Actor194_Init(Actor194* this) { +void Actor194_Dying(Actor194* this) { Vec3f sp34; s32 temp_hi; @@ -294,7 +294,7 @@ void Actor194_8006B46C(Actor194* this, f32 xTrans, f32 yTrans, f32 zTrans, f32 x Vec3f sp34 = { 0.0f, 0.0f, 0.0f }; Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, xTrans, yTrans, zTrans + D_ctx_80177D20, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, xTrans, yTrans, zTrans + gPathProgress, MTXF_APPLY); if (arg7 != 1) { Matrix_RotateY(gGfxMatrix, M_DTOR * yRot, MTXF_APPLY); @@ -308,9 +308,9 @@ void Actor194_8006B46C(Actor194* this, f32 xTrans, f32 yTrans, f32 zTrans, f32 x if (arg7 != 1) { RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); if ((arg7 == 0) && (this->lockOnTimers[TEAM_ID_FOX] != 0)) { - sp34.y += this->info.unk_1C; - Matrix_MultVec3f(gGfxMatrix, &sp34, D_display_80161578); - if (D_display_80161578->z > -500.0f) { + sp34.y += this->info.targetOffset; + Matrix_MultVec3f(gGfxMatrix, &sp34, &gLockOnTargetViewPos[TEAM_ID_FOX]); + if (gLockOnTargetViewPos[TEAM_ID_FOX].z > -500.0f) { this->lockOnTimers[TEAM_ID_FOX] = 0; } } @@ -341,7 +341,7 @@ void Actor194_Draw(Actor194* this) { } } -void Obj42_Update(Scenery_42* this) { +void Scenery42_Update(Scenery_42* this) { this->obj.pos.x += this->vel.x; this->obj.pos.y += this->vel.y; this->obj.pos.z += this->vel.z; @@ -424,7 +424,7 @@ void Actor196_Update(Actor196* this) { 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) { + if (fabsf((this->obj.pos.z + this->fwork[10]) - gPlayer[0].trueZpos) < 3000.0f) { this->state = 2; this->timer_0BC = 20; this->vel.z = 0.0f; @@ -478,13 +478,13 @@ void Actor196_Update(Actor196* this) { RAND_FLOAT_CENTERED(50.0f) + this->obj.pos.z, 0.5f); } - if ((this->unk_0D0 != 0) && (this->unk_0B6 != 0)) { + if ((this->dmgType != 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; Actor_Despawn(this); } - this->unk_0D0 = 0; + this->dmgType = 0; } static f32 D_800D001C[5] = { 0.0f, 30.0f, 60.0f, -60.0f, -30.0f }; // could be in-function @@ -507,7 +507,7 @@ void Actor189_Update(Actor189* this) { case 40: 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]; + this->obj.pos.z = gPlayer[0].trueZpos + this->fwork[4]; } this->obj.rot.x += this->fwork[0]; @@ -566,7 +566,7 @@ void Actor189_Update(Actor189* this) { 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); + Ground_801B6E20(this->obj.pos.x, this->obj.pos.z + gPathProgress, &sp4C, &sp48, &sp4C); if (this->obj.pos.y < sp48) { this->obj.pos.y = sp48; @@ -586,7 +586,7 @@ void Actor189_Update(Actor189* this) { break; case 47: - Ground_801B6E20(this->obj.pos.x, this->obj.pos.z + D_ctx_80177D20, &sp4C, &sp48, &sp4C); + Ground_801B6E20(this->obj.pos.x, this->obj.pos.z + gPathProgress, &sp4C, &sp48, &sp4C); if (this->obj.pos.y < this->fwork[3] + (-100.0f + sp48)) { this->obj.pos.y = this->fwork[3] + sp48; @@ -837,7 +837,7 @@ void func_enmy2_8006D0F4(Actor* this) { D_ctx_80178544 = 40; for (i = 0; i < ARRAY_COUNT(gScenery); i++) { - if ((gScenery[i].obj.status == OBJ_ACTIVE) && ((gPlayer[0].unk_138 - 3000.0f) < gScenery[i].obj.pos.z)) { + if ((gScenery[i].obj.status == OBJ_ACTIVE) && ((gPlayer[0].trueZpos - 3000.0f) < gScenery[i].obj.pos.z)) { hitboxData = D_edata_800CF964[gScenery[i].obj.id]; count = *hitboxData; if (count != 0) { @@ -870,7 +870,7 @@ void func_enmy2_8006D0F4(Actor* this) { } } -void Obj39_Update(Scenery_39* this) { +void MeteoTunnel_Update(Scenery_39* this) { this->obj.rot.z += 1.0f; } @@ -878,13 +878,13 @@ typedef struct { /* 0x00 */ Gfx* dList; /* 0x04 */ f32* hitbox; /* 0x08 */ f32 scale; - /* 0x0C */ f32 info_unk_10; + /* 0x0C */ f32 cullDistance; /* 0x10 */ f32 unk_10; /* 0x14 */ u8 info_unk_16; /* 0x15 */ u8 info_unk_14; /* 0x16 */ u8 sfx; /* 0x17 */ u8 info_unk_19; - /* 0x18 */ f32 info_unk_1C; + /* 0x18 */ f32 targetOffset; /* 0x1C */ u8 bonus; } UnkStruct_D003C; // size = 0x20 @@ -1064,8 +1064,8 @@ void ActorEvent_ProcessScript(ActorEvent* this) { 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; + if (this->info.cullDistance > 10000.0f) { + this->info.cullDistance = 100.0f; } break; @@ -1094,7 +1094,7 @@ void ActorEvent_ProcessScript(ActorEvent* this) { if ((this->unk_0B4 >= EINFO_200) && (this->unk_0B4 < EINFO_300)) { this->unk_046 = 100; this->info.hitbox = gCubeHitbox200; - this->info.unk_1C = 1.0f; + this->info.targetOffset = 1.0f; for (i = 0; i < 2; i++) { if (gActor194Status[i] == 0) { @@ -1148,14 +1148,14 @@ void ActorEvent_ProcessScript(ActorEvent* this) { 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.targetOffset = D_800D003C[this->unk_0B4].targetOffset; this->info.bonus = D_800D003C[this->unk_0B4].bonus; if (this->unk_0B4 == EINFO_78) { this->info.damage = 0; } - this->info.unk_10 = D_800D003C[this->unk_0B4].info_unk_10; + this->info.cullDistance = D_800D003C[this->unk_0B4].cullDistance; this->fwork[25] = D_800D003C[this->unk_0B4].unk_10; switch (D_800D003C[this->unk_0B4].sfx) { @@ -1185,8 +1185,8 @@ void ActorEvent_ProcessScript(ActorEvent* this) { break; } - if (gPlayer[0].unk_138 < this->obj.pos.z) { - this->info.unk_10 = 3000.0f; + if (gPlayer[0].trueZpos < this->obj.pos.z) { + this->info.cullDistance = 3000.0f; } if (this->info.unk_16 == 0) { @@ -1323,9 +1323,9 @@ void ActorEvent_ProcessScript(ActorEvent* this) { case EV_OPC(EVOP_DAMAGE_TEAM): if (this->iwork[12] == actorScript[this->aiIndex + 1]) { - this->unk_0D0 = 1; + this->dmgType = 1; this->damage = actorScript[this->aiIndex] & 0x1FF; - this->unk_0D4 = 100; + this->dmgSource = 100; } else { gTeamDamage[actorScript[this->aiIndex + 1]] = actorScript[this->aiIndex] & 0x1FF; } @@ -1338,14 +1338,14 @@ void ActorEvent_ProcessScript(ActorEvent* this) { 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 = 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]; + gTexturedLines[i].xyScale = 3.0f; + gTexturedLines[i].posAA.x = this->obj.pos.x - this->vel.x; + gTexturedLines[i].posAA.y = this->obj.pos.y - this->vel.y; + gTexturedLines[i].posAA.z = this->obj.pos.z - this->vel.z; + gTexturedLines[i].red = D_800D0DBC[actorScript[this->aiIndex + 1]][0]; + gTexturedLines[i].green = D_800D0DBC[actorScript[this->aiIndex + 1]][1]; + gTexturedLines[i].blue = D_800D0DBC[actorScript[this->aiIndex + 1]][2]; + gTexturedLines[i].alpha = D_800D0DBC[actorScript[this->aiIndex + 1]][3]; this->iwork[8] = i; break; } @@ -1573,9 +1573,9 @@ void ActorEvent_ProcessScript(ActorEvent* this) { void ActorEvent_UpdateTexLines(ActorEvent* 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; + gTexturedLines[this->iwork[8]].posBB.x = this->obj.pos.x; + gTexturedLines[this->iwork[8]].posBB.y = this->obj.pos.y; + gTexturedLines[this->iwork[8]].posBB.z = this->obj.pos.z; } } @@ -1794,7 +1794,7 @@ void ActorEvent_ProcessActions(ActorEvent* this) { break; case EVACT_2: - if (this->obj.pos.z < (gPlayer[0].unk_138 - 600.0f)) { + if (this->obj.pos.z < (gPlayer[0].trueZpos - 600.0f)) { func_effect_8007F11C(OBJ_EFFECT_353, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, gEnemyShotSpeed); } @@ -1844,7 +1844,7 @@ void ActorEvent_ProcessActions(ActorEvent* this) { break; case EVACT_6: - if (this->obj.pos.z < (gPlayer[0].unk_138 - 600.0f)) { + if (this->obj.pos.z < (gPlayer[0].trueZpos - 600.0f)) { func_effect_8007F11C(OBJ_EFFECT_355, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, gEnemyShotSpeed); } @@ -1852,7 +1852,7 @@ void ActorEvent_ProcessActions(ActorEvent* this) { break; case EVACT_7: - if (this->obj.pos.z < (gPlayer[0].unk_138 - 600.0f)) { + if (this->obj.pos.z < (gPlayer[0].trueZpos - 600.0f)) { func_effect_8007F11C(OBJ_EFFECT_356, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 60.0f); } this->unk_048 = EVACT_NONE; @@ -1975,7 +1975,7 @@ void ActorEvent_ProcessActions(ActorEvent* this) { void ActorEvent_8006FE28(ActorEvent* 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)) { + (fabsf(this->obj.pos.z - gPlayer[0].trueZpos) < 50.0f)) { func_enmy_80067A40(); Audio_KillSfxBySourceAndId(this->sfxSource, 0x1900302B); Object_Kill(&this->obj, this->sfxSource); @@ -1985,8 +1985,8 @@ void ActorEvent_8006FE28(ActorEvent* this) { void ActorEvent_8006FEEC(ActorEvent* this) { s32 i; - if ((this->unk_0D0 != 0) && (this->health != 0)) { - this->unk_0D0 = 0; + if ((this->dmgType != 0) && (this->health != 0)) { + this->dmgType = 0; this->timer_0C6 = 15; this->health -= this->damage; @@ -2029,7 +2029,7 @@ bool ActorEvent_800700A4(ActorEvent* this) { gTeamShields[this->iwork[12]] = -1; gTeamDamage[this->iwork[12]] = 0; this->timer_0C2 = 5000; - this->unk_0D0 = 0; + this->dmgType = 0; return true; } return false; @@ -2037,22 +2037,22 @@ bool ActorEvent_800700A4(ActorEvent* this) { void ActorEvent_800701E0(ActorEvent* this) { Vec3f sp3C; - f32 var_fv1; + f32 chance; f32 temp_fv1; if (ActorEvent_800700A4(this)) { return; } - if ((this->unk_0D0 != 0) && (this->unk_0B4 == EINFO_67) && (this->unk_0D2 == 0)) { - this->unk_0D0 = 0; + if ((this->dmgType != 0) && (this->unk_0B4 == EINFO_67) && (this->dmgPart == 0)) { + this->dmgType = 0; } - if ((this->unk_0D0 != 0) && (this->unk_0B4 == EINFO_83) && (this->timer_0C2 >= 2)) { - this->unk_0D0 = 0; + if ((this->dmgType != 0) && (this->unk_0B4 == EINFO_83) && (this->timer_0C2 >= 2)) { + this->dmgType = 0; } - if ((this->unk_0D0 != 0) && - (((this->unk_0B4 == EINFO_64) && (this->unk_0D2 == 2)) || (this->unk_0B4 != EINFO_64))) { + if ((this->dmgType != 0) && + (((this->unk_0B4 == EINFO_64) && (this->dmgPart == 2)) || (this->unk_0B4 != EINFO_64))) { if (this->iwork[12] >= TEAM_ID_KATT) { this->damage = 0; } @@ -2081,18 +2081,18 @@ void ActorEvent_800701E0(ActorEvent* this) { } this->obj.status = OBJ_DYING; - var_fv1 = 0.7f; + chance = 0.7f; if (gLevelType == LEVELTYPE_SPACE) { - var_fv1 = 0.3f; + chance = 0.3f; } - if (((Rand_ZeroOne() < var_fv1) || (this->iwork[12] != 0)) && (this->info.unk_14 == 0) && + if (((Rand_ZeroOne() < chance) || (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; + this->dmgType = 0; } this->timer_0C2 = 10; @@ -2123,7 +2123,7 @@ void ActorEvent_800701E0(ActorEvent* this) { } else { this->vel.z = this->vel.z * 0.3f; } - if (((this->obj.pos.z + D_ctx_80177D20) > -3000.0f) && (this->vel.z > 0.0f)) { + if (((this->obj.pos.z + gPathProgress) > -3000.0f) && (this->vel.z > 0.0f)) { this->vel.z = RAND_FLOAT(-10.0f); } } @@ -2146,9 +2146,9 @@ void ActorEvent_800701E0(ActorEvent* this) { 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->dmgType = 0; this->timer_0C2 = 10000; - this->info.unk_1C = 0.0f; + this->info.targetOffset = 0.0f; gHitCount += this->info.bonus; D_ctx_80177850 = 15; break; @@ -2166,7 +2166,7 @@ void ActorEvent_800701E0(ActorEvent* this) { if (this->unk_0B4 == EINFO_82) { AUDIO_PLAY_SFX(0x11000055, this->sfxSource, 0); - this->unk_0D0 = 1; + this->dmgType = 1; func_effect_8007C688(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 3.0f, 60); } } else { @@ -2191,10 +2191,10 @@ void ActorEvent_800701E0(ActorEvent* this) { } } - if (this->unk_0D4 == 1) { + if (this->dmgSource == 1) { switch (this->iwork[12]) { case TEAM_ID_FALCO: - if (this->unk_0D0 == 3) { + if (this->dmgType == 3) { ActorEvent_SetMessage(gMsg_ID_20210, RCID_FALCO); } else { ActorEvent_SetMessage(gMsg_ID_20060, RCID_FALCO); @@ -2202,7 +2202,7 @@ void ActorEvent_800701E0(ActorEvent* this) { break; case TEAM_ID_PEPPY: - if (this->unk_0D0 == 3) { + if (this->dmgType == 3) { ActorEvent_SetMessage(gMsg_ID_20200, RCID_PEPPY); } else { ActorEvent_SetMessage(gMsg_ID_20070, RCID_PEPPY); @@ -2210,7 +2210,7 @@ void ActorEvent_800701E0(ActorEvent* this) { break; case TEAM_ID_SLIPPY: - if (this->unk_0D0 == 3) { + if (this->dmgType == 3) { ActorEvent_SetMessage(gMsg_ID_20190, RCID_SLIPPY); } else { ActorEvent_SetMessage(gMsg_ID_20080, RCID_SLIPPY); @@ -2226,7 +2226,7 @@ void ActorEvent_800701E0(ActorEvent* this) { break; } } - this->unk_0D0 = 0; + this->dmgType = 0; } } if ((this->iwork[12] == 0) && (this->iwork[13] == 0) && (this->info.unk_16 != 2) && @@ -2239,7 +2239,7 @@ void ActorEvent_800701E0(ActorEvent* this) { (this->obj.pos.y < (gGroundHeight + 20.0f))) { this->obj.status = OBJ_DYING; this->obj.pos.z -= this->vel.z; - this->unk_0D0 = 1; + this->dmgType = 1; if (this->unk_0B4 == EINFO_13) { this->obj.id = OBJ_ACTOR_182; func_enmy_800654E4(&this->obj); @@ -2253,9 +2253,9 @@ void ActorEvent_800701E0(ActorEvent* this) { } void ActorEvent_80070BA8(ActorEvent* 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))) { + if (this->dmgType != 0) { + this->dmgType = 0; + if ((this->unk_0B4 != EINFO_17) || ((this->unk_0B4 == EINFO_17) && (this->dmgPart == 0))) { this->timer_0C6 = 10; func_effect_8007C120(this->hitPos.x, this->hitPos.y, this->hitPos.z, this->vel.x, this->vel.y, this->vel.z, 0.2f, 10); @@ -2300,7 +2300,7 @@ void ActorEvent_ProcessTriggers(ActorEvent* this) { } if (this->iwork[2] >= EVC_CLOSE_Z) { - if (fabsf(this->obj.pos.z - gPlayer[0].unk_138) <= ((this->iwork[2] - EVC_CLOSE_Z) * 100.0f)) { + if (fabsf(this->obj.pos.z - gPlayer[0].trueZpos) <= ((this->iwork[2] - EVC_CLOSE_Z) * 100.0f)) { ActorEvent_TriggerBranch(this); } return; @@ -2591,7 +2591,7 @@ void ActorEvent_ProcessTriggers(ActorEvent* this) { break; case EVC_TOOK_DAMAGE: - if (this->unk_0D0 != 0) { + if (this->dmgType != 0) { ActorEvent_TriggerBranch(this); } break; @@ -2846,12 +2846,12 @@ void ActorEvent_80071DC0(ActorEvent* this) { void ActorEvent_800720E8(ActorEvent* this) { switch (this->unk_046) { case 0: - if (this->unk_0D0 != 0) { - if (this->unk_0D0 == 2) { + if (this->dmgType != 0) { + if (this->dmgType == 2) { this->damage = 3; } - if ((this->unk_0D4 >= 101) && (gActors[this->unk_0D4 - 101].unk_0B4 == 85)) { + if ((this->dmgSource >= 101) && (gActors[this->dmgSource - 101].unk_0B4 == EINFO_85)) { this->damage = 20; } @@ -2870,7 +2870,7 @@ void ActorEvent_800720E8(ActorEvent* this) { } else { AUDIO_PLAY_SFX(0x2903300E, this->sfxSource, 0); } - this->unk_0D0 = 0; + this->dmgType = 0; } break; @@ -2941,7 +2941,7 @@ void ActorEvent_80072474(ActorEvent* this) { } 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)); + var_fv1 = Math_RadToDeg(Math_Atan2F(gPlayer[0].pos.x - this->obj.pos.x, gPlayer[0].trueZpos - this->obj.pos.z)); } else if (this->iwork[6] != 0) { var_fv1 = this->unk_0F4.y; } else { @@ -3008,8 +3008,8 @@ void ActorEvent_Update(ActorEvent* this) { gActor194yRot[this->unk_046][this->unk_04E] = this->obj.rot.y; gActor194zRot[this->unk_046][this->unk_04E] = this->obj.rot.z; - if (this->unk_0D0 != 0) { - this->unk_0D0 = 0; + if (this->dmgType != 0) { + this->dmgType = 0; this->timer_0C6 = 20; this->health -= this->damage; @@ -3377,13 +3377,13 @@ void ActorEvent_Update(ActorEvent* this) { if (this->iwork[5] == EV_ZMODE(EMZ_RELATIVE)) { this->vel.z -= this->fwork[22]; - if ((gCurrentLevel == LEVEL_SECTOR_Y) && (D_ctx_80177D08 < 0.0f)) { - this->vel.z -= D_ctx_80177D08; + if ((gCurrentLevel == LEVEL_SECTOR_Y) && (gPathVelZ < 0.0f)) { + this->vel.z -= gPathVelZ; } } if (this->iwork[5] == EV_ZMODE(EMZ_PLAYER)) { - this->vel.z -= D_ctx_80177D08; + this->vel.z -= gPathVelZ; } if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ENTER_WARP_ZONE) { @@ -3400,9 +3400,9 @@ void ActorEvent_Update(ActorEvent* this) { if (this->scale <= -1.999f) { ActorEvent_80070BA8(this); } else { - if ((this->unk_0D0 == 1) && (this->scale < 0.5f) && (this->unk_0B4 != EINFO_48) && + if ((this->dmgType == 1) && (this->scale < 0.5f) && (this->unk_0B4 != EINFO_48) && (this->unk_0B4 != EINFO_49) && (this->unk_0B4 != EINFO_50)) { - this->unk_0D0 = 0; + this->dmgType = 0; if (gCurrentLevel == LEVEL_METEO) { AUDIO_PLAY_SFX(0x2902107D, this->sfxSource, 4); } else { @@ -3790,7 +3790,7 @@ bool ActorEvent_OverrideLimbDraw3(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* return false; } -s32 Obj111_Draw(Scenery_111* this) { +s32 Scenery111_Draw(Scenery_111* this) { RCP_SetupDL(&gMasterDisp, 0x3C); gSPDisplayList(gMasterDisp++, D_SY_601AD70); RCP_SetupDL(&gMasterDisp, 0x40); @@ -4214,7 +4214,7 @@ void func_enmy2_800763A4(Actor* actor) { } if (gGroundType == 4) { - if (Ground_801B6AEC(actor->obj.pos.x, actor->obj.pos.y - 10.0f, actor->obj.pos.z + D_ctx_80177D20) != 0) { + if (Ground_801B6AEC(actor->obj.pos.x, actor->obj.pos.y - 10.0f, actor->obj.pos.z + gPathProgress) != 0) { func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y + 20.0f, actor->obj.pos.z, actor->scale * 6.0f); func_effect_8007BFFC(actor->obj.pos.x - actor->vel.x, actor->obj.pos.y + 30.0f, actor->obj.pos.z - actor->vel.z, 0.0f, 0.0f, 0.0f, actor->scale * 4.0f, 20); @@ -4327,7 +4327,7 @@ void func_enmy2_800763A4(Actor* actor) { } } } - if ((actor->unk_0D0 != 0) || (actor->timer_0BC == 0) || + if ((actor->dmgType != 0) || (actor->timer_0BC == 0) || ((actor->itemDrop != DROP_NONE) && (actor->obj.id != OBJ_ACTOR_ALLRANGE))) { if (gLevelMode == LEVELMODE_ALL_RANGE) { for (var_s0 = 0; var_s0 < 4; var_s0++) { diff --git a/src/engine/fox_game.c b/src/engine/fox_game.c index 3eb3a689..0475088f 100644 --- a/src/engine/fox_game.c +++ b/src/engine/fox_game.c @@ -100,7 +100,7 @@ void Game_SetGameState(void) { gNextGameState = GSTATE_NONE; gSceneSetup = 0; gFillScreenColor = gBgColor = 0; - D_ctx_80177D20 = 0.0f; + gPathProgress = 0.0f; if ((gCurrentLevel == LEVEL_VENOM_2) && (gLevelPhase == 2)) { gFillScreenColor = gBgColor = 0xFFFF; // 248, 248, 248 gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; @@ -389,7 +389,7 @@ void Game_Update(void) { Play_ClearObjectData(); gCamCount = 1; gLifeCount[0] = 2; - D_ctx_80177D20 = 0.0f; + gPathProgress = 0.0f; D_hud_8016170C = gCsFrameCount = gShowLevelClearStatusScreen = gLevelStartStatusScreenTimer = gLevelClearScreenTimer = gVsMatchState = gVersusMode = gTitleState = gStarCount = gMapState = gPlayState = gOptionMenuStatus = gDrawMode = gShowBossHealth = gShowHud = gBgColor = diff --git a/src/engine/fox_hud.c b/src/engine/fox_hud.c index 04c24dde..417b1146 100644 --- a/src/engine/fox_hud.c +++ b/src/engine/fox_hud.c @@ -1559,7 +1559,7 @@ void func_hud_80088970(void) { D_ctx_80177CA4 = D_play_80161A5C; } - D_ctx_80177CB0 = 0.0f; + gSavedPathProgress = 0.0f; gAllRangeCheckpoint = 0; gSavedZoSearchlightStatus = false; @@ -1568,7 +1568,7 @@ void func_hud_80088970(void) { Audio_StopPlayerNoise(0); gPlayer[0].state_1C8 = PLAYERSTATE_1C8_NEXT; gScreenFlashTimer = 0; - gPlayer[0].timer_1F8 = 0; + gPlayer[0].csTimer = 0; gFillScreenAlpha = gFillScreenAlphaTarget = 255; gFadeoutType = 7; @@ -1953,8 +1953,8 @@ void func_hud_8008A240(void) { } gRadarMarks[i].status = 1; gRadarMarks[i].type = i; - gRadarMarks[i].unk_10 = gPlayer[i].unk_114 + gPlayer[i].unk_0E8; - gRadarMarks[i].pos.z = gPlayer[i].unk_138; + gRadarMarks[i].yRot = gPlayer[i].yRot_114 + gPlayer[i].rot.y; + gRadarMarks[i].pos.z = gPlayer[i].trueZpos; gRadarMarks[i].pos.x = gPlayer[i].pos.x; if (gPlayerNum == i) { @@ -1986,7 +1986,7 @@ void func_hud_8008A240(void) { gRadarMarks[item->index + 50].pos.x = item->obj.pos.x; gRadarMarks[item->index + 50].pos.y = item->obj.pos.y; gRadarMarks[item->index + 50].pos.z = item->obj.pos.z; - gRadarMarks[item->index + 50].unk_10 = 0.0f; + gRadarMarks[item->index + 50].yRot = 0.0f; } } } @@ -2142,10 +2142,10 @@ s32 func_hud_8008A4DC(void) { Matrix_Translate(gGfxMatrix, gRadarMarks[i].pos.x * 0.008f, -gRadarMarks[i].pos.z * 0.008f, 0.0f, MTXF_APPLY); if (gRadarMarks[i].type == 103) { - gRadarMarks[i].unk_10 = 45.0f; + gRadarMarks[i].yRot = 45.0f; } - Matrix_RotateZ(gGfxMatrix, M_DTOR * gRadarMarks[i].unk_10, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, M_DTOR * gRadarMarks[i].yRot, MTXF_APPLY); Matrix_Scale(gGfxMatrix, scale, scale, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -2460,7 +2460,7 @@ s32 func_hud_8008B774(void) { (gCurrentLevel == LEVEL_SECTOR_Y))) { 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) || + if ((gActors[i].unk_0B4 == EINFO_2) || (gActors[i].unk_0B4 == EINFO_43) || ((gActors[i].obj.id == OBJ_ACTOR_TEAM_BOSS) && ((gActors[i].aiType == AI360_FALCO) || (gActors[i].aiType == AI360_SLIPPY) || (gActors[i].aiType == AI360_PEPPY)))) { @@ -2478,7 +2478,7 @@ s32 func_hud_8008B774(void) { switch (i) { case 0: - if (gPlayer[0].timer_220) { + if (gPlayer[0].radioDamageTimer) { ret = 1; } break; @@ -3913,11 +3913,11 @@ bool func_hud_80090A00(Actor* actor) { break; case 4: - actor->fwork[6] = gPlayer[0].unk_138; + actor->fwork[6] = gPlayer[0].trueZpos; actor->fwork[5] = 100.0f; actor->fwork[4] = gPlayer[0].pos.x; if ((fabsf(actor->obj.pos.x - gPlayer[0].pos.x) < 300.0f) && - (fabsf(actor->obj.pos.z - gPlayer[0].unk_138) < 300.0f)) { + (fabsf(actor->obj.pos.z - gPlayer[0].trueZpos) < 300.0f)) { actor->iwork[5] = 5; actor->iwork[3] = 20; actor->iwork[2] = 0; @@ -3925,7 +3925,7 @@ bool func_hud_80090A00(Actor* actor) { break; case 5: - actor->fwork[6] = gPlayer[0].unk_138 + 1000.0f; + actor->fwork[6] = gPlayer[0].trueZpos + 1000.0f; actor->fwork[5] = 1000.0f; actor->fwork[4] = gPlayer[0].pos.x - 1000.0f; actor->iwork[2]++; @@ -4068,7 +4068,7 @@ bool func_hud_80091298(Actor* actor) { actor->fwork[3] = 3.6f; actor->fwork[4] = gPlayer[0].pos.x + ((f32) (actor->aiType - 2) * 700.0f); actor->fwork[5] = gPlayer[0].pos.y; - actor->fwork[6] = gPlayer[0].unk_138; + actor->fwork[6] = gPlayer[0].trueZpos; if ((fabsf(actor->obj.pos.x - actor->fwork[4]) < 700.0f) || (fabsf(actor->obj.pos.z - actor->fwork[6]) < 700.0f)) { actor->fwork[1] = gPlayer[0].baseSpeed - 10.0f; @@ -4293,7 +4293,7 @@ bool func_hud_80091B90(Actor* actor) { actor->obj.pos.y = gGroundHeight + 40.0f; actor->vel.y = 0.0f; } - actor->vel.z -= D_ctx_80177D08; + actor->vel.z -= gPathVelZ; return false; } @@ -4335,11 +4335,11 @@ bool func_hud_80091DF4(Actor* actor) { } bool func_hud_80091F00(Actor* actor) { - u8 temp_v0 = actor->unk_0D0; + u8 temp_v0 = actor->dmgType; Vec3f sp40; Vec3f sp34; - actor->unk_0D0 = 0; + actor->dmgType = 0; if ((actor->state == 3) || (temp_v0 == 2)) { return false; @@ -4376,7 +4376,7 @@ bool func_hud_80091F00(Actor* actor) { return false; } - if ((actor->unk_0D0 == 3) && (actor->unk_0D4 == 1)) { + if ((actor->dmgType == 3) && (actor->dmgSource == 1)) { switch (actor->aiType) { case AI360_FALCO: Radio_PlayMessage(gMsg_ID_20210, RCID_FALCO); @@ -4390,7 +4390,7 @@ bool func_hud_80091F00(Actor* actor) { } } - if ((actor->unk_0D0 != 3) && (actor->unk_0D4 == 1)) { + if ((actor->dmgType != 3) && (actor->dmgSource == 1)) { switch (actor->aiType) { case AI360_FALCO: Radio_PlayMessage(gMsg_ID_20060, RCID_FALCO); @@ -4404,7 +4404,7 @@ bool func_hud_80091F00(Actor* actor) { } } - if ((actor->unk_0D4 == 2) || (actor->unk_0D4 == 100)) { + if ((actor->dmgSource == 2) || (actor->dmgSource == 100)) { switch (actor->aiType) { case AI360_FALCO: Radio_PlayMessage(gMsg_ID_20030, RCID_FALCO); @@ -4428,7 +4428,7 @@ void func_hud_80092244(Actor* actor) { gRadarMarks[actor->index].pos.x = actor->obj.pos.x; gRadarMarks[actor->index].pos.y = actor->obj.pos.y; gRadarMarks[actor->index].pos.z = actor->obj.pos.z; - gRadarMarks[actor->index].unk_10 = actor->unk_0F4.y + 180.0f; + gRadarMarks[actor->index].yRot = actor->unk_0F4.y + 180.0f; } void func_hud_800922F4(Actor* actor) { @@ -4620,7 +4620,7 @@ bool func_hud_800927A0(Actor* actor) { Math_SmoothStepToAngle(&actor->unk_0F4.y, sp50, 0.1f, 2.0f, 0.0f); } - if (actor->obj.pos.y < gPlayer[0].unk_0A0) { + if (actor->obj.pos.y < gPlayer[0].pathHeight) { if (actor->fwork[28] < 0.0f) { actor->fwork[28] = actor->fwork[28] + 0.2f; } @@ -4705,7 +4705,7 @@ void ActorTeamBoss_Update(ActorTeamBoss* this) { func_hud_80091B90(this); func_hud_80091DF4(this); - if (this->unk_0D0 != 0) { + if (this->dmgType != 0) { func_hud_80091F00(this); } @@ -4826,7 +4826,7 @@ void func_hud_80093310(void) { this->obj.pos.z -= 5000.0f; gActors[0].unk_0B6 = 1; if (1) {} - this->obj.id = OBJ_ACTOR_195; + this->obj.id = OBJ_ACTOR_CUTSCENE; Object_SetInfo(&this->info, this->obj.id); AUDIO_PLAY_SFX(0x11030010, this->sfxSource, 0); } @@ -4846,7 +4846,7 @@ void func_hud_800933D8(f32 x, f32 y, f32 z, f32 arg3) { effect->obj.pos.z = z; if ((player->state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && (gCurrentLevel == LEVEL_AQUAS) && - (player->unk_1D0 < 2)) { + (player->csState < 2)) { effect->scale1 = 0.4f; effect->unk_44 = 0; effect->unk_46 = 24; @@ -4863,7 +4863,7 @@ void func_hud_800933D8(f32 x, f32 y, f32 z, f32 arg3) { effect->unk_48 = -effect->unk_48; } - if (player->unk_1D0 >= 5) { + if (player->csState >= 5) { effect->unk_4A = 96; effect->unk_46 = 4; } else { @@ -4920,7 +4920,7 @@ void HUD_AquasStart(Player* player) { actor = &gActors[0]; - switch (player->unk_1D0) { + switch (player->csState) { case 0: func_hud_80093310(); @@ -4928,7 +4928,7 @@ void HUD_AquasStart(Player* player) { D_ctx_80177AB0 = 1; gAqDrawMode = 1; player->unk_234 = 0; - player->unk_1D0 = 1; + player->csState = 1; player->unk_208 = 0; player->baseSpeed = 0.0f; @@ -5051,7 +5051,7 @@ void HUD_AquasStart(Player* player) { if (gCsFrameCount >= 50) { // clang-format off - if (gFillScreenAlpha == 255) { player->unk_1D0 = 2; } + if (gFillScreenAlpha == 255) { player->csState = 2; } // clang-format on gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; gFillScreenAlphaTarget = 255; @@ -5082,14 +5082,14 @@ void HUD_AquasStart(Player* player) { D_ctx_80177A48[3] = -1600.0f; D_ctx_80177A48[4] = 520.0f; - player->unk_1D0 = 3; + player->csState = 3; D_ctx_80177AB0 = 0; player->camRoll = 60.0f; - player->timer_1F8 = 1000; + player->csTimer = 1000; - player->unk_0E8 = 30.0f; + player->rot.y = 30.0f; player->pos.z = -5100.0f; player->pos.x = -50.0f; @@ -5104,7 +5104,7 @@ void HUD_AquasStart(Player* player) { case 3: gFillScreenAlphaStep = 16; - if (player->timer_1F8 >= 775) { + if (player->csTimer > 774) { if (D_ctx_80177A48[4] >= 200.0f) { Math_SmoothStepToF(&D_ctx_80177A48[4], -200.0f, 1.00f, 4.0f, 4.0f); } else { @@ -5132,12 +5132,12 @@ void HUD_AquasStart(Player* player) { player->cam.eye.z = gCsCamEyeZ; } - if (player->timer_1F8 == 774) { + if (player->csTimer == 774) { AUDIO_PLAY_SFX(0x01038026, player->sfxSource, 0); D_ctx_80177A10[9] = 40; } - if (player->timer_1F8 < 775) { + if (player->csTimer <= 774) { D_ctx_80177A48[0] = 0.0f; temp2 = 0.0f; @@ -5167,7 +5167,7 @@ void HUD_AquasStart(Player* player) { player->pos.y = dest.y; player->pos.z = dest.z; - if (((player->timer_1F8 % 8) == 0) && (player->timer_1F8 > 740)) { + if (((player->csTimer % 8) == 0) && (player->csTimer > 740)) { func_effect_8007D9DC(player->cam.eye.x, 1600.0f, player->cam.eye.z, 10.0f, 100.0f, 0); } @@ -5181,7 +5181,7 @@ void HUD_AquasStart(Player* player) { D_ctx_80177A10[8]++; } - if (((gGameFrameCount % 3) == 0) && (player->timer_1F8 <= 740)) { + if (((gGameFrameCount % 3) == 0) && (player->csTimer <= 740)) { for (i = 0; i < 8; i++) { Aquas_801AC8A8(player->cam.eye.x + RAND_FLOAT_CENTERED(D_800D22C4), player->cam.eye.y + 260.0f + RAND_FLOAT_CENTERED(D_800D22C8), @@ -5190,8 +5190,8 @@ void HUD_AquasStart(Player* player) { } } - if (player->timer_1F8 < 736) { - player->unk_1D0 = 4; + if (player->csTimer < 736) { + player->csState = 4; gAqDrawMode = 1; gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; gFillScreenAlphaTarget = 255; @@ -5200,7 +5200,7 @@ void HUD_AquasStart(Player* player) { case 4: if (gFillScreenAlpha == 255) { - player->unk_1D0 = 5; + player->csState = 5; } break; @@ -5209,12 +5209,12 @@ void HUD_AquasStart(Player* player) { player->pos.y = 350.0f; player->pos.z = 0.0f; - player->cam.eye.x = player->pos.x * (600.0f / player->unk_09C); - player->cam.eye.y = player->pos.y * (1040.0f / player->unk_0A0); + player->cam.eye.x = player->pos.x * (600.0f / player->pathWidth); + player->cam.eye.y = player->pos.y * (1040.0f / player->pathHeight); player->cam.eye.y -= 50.0f; - player->cam.at.x = player->pos.x * (600.0f / player->unk_09C); - player->cam.at.y = player->pos.y * (1050.0f / player->unk_0A0); + player->cam.at.x = player->pos.x * (600.0f / player->pathWidth); + player->cam.at.y = player->pos.y * (1050.0f / player->pathHeight); player->cam.at.y += player->unk_060 * 10.0f; player->pos.z += 1000.0f; @@ -5222,12 +5222,12 @@ void HUD_AquasStart(Player* player) { D_ctx_80177A48[0] = 0.1f; - player->unk_0E8 = 0.0f; + player->rot.y = 0.0f; player->baseSpeed = 20.0f; player->unk_234 = 1; - player->unk_1D0 = 6; + player->csState = 6; - player->timer_1F8 = 1000; + player->csTimer = 1000; gAqDrawMode = 0; gFillScreenAlphaTarget = 0; @@ -5238,36 +5238,36 @@ void HUD_AquasStart(Player* player) { player->cam.at.z = gCsCamAtZ = 0.0f; case 6: - player->unk_060 = SIN_DEG(player->unk_0F4 * 0.7f) * 0.5f; - player->unk_088 += 10.0f; - player->unk_0F4 += 8.0f; - player->unk_080 = -SIN_DEG(player->unk_088) * 0.5f; - player->unk_0F0 = SIN_DEG(player->unk_0F4) * 1.5f; + player->unk_060 = SIN_DEG(player->rockPhase * 0.7f) * 0.5f; + player->bobPhase += 10.0f; + player->rockPhase += 8.0f; + player->yBob = -SIN_DEG(player->bobPhase) * 0.5f; + player->rockAngle = SIN_DEG(player->rockPhase) * 1.5f; - gCsCamEyeX = player->pos.x * (600.0f / player->unk_09C); - gCsCamEyeY = player->pos.y * (740.0f / player->unk_0A0); + gCsCamEyeX = player->pos.x * (600.0f / player->pathWidth); + gCsCamEyeY = player->pos.y * (740.0f / player->pathHeight); gCsCamEyeY -= -50.0f; - gCsCamAtX = player->pos.x * (600.0f / player->unk_09C); - gCsCamAtY = player->pos.y * (750.0f / player->unk_0A0); + gCsCamAtX = player->pos.x * (600.0f / player->pathWidth); + gCsCamAtY = player->pos.y * (750.0f / player->pathHeight); gCsCamAtY += player->unk_060 * 10.0f; Math_SmoothStepToF(&player->pos.z, 0.0f, 0.1f, 40.0f, 0.1f); D_ctx_80177A48[0] = 0.03f; gCsCamEyeZ = 240.0f; - gCsCamAtZ = player->pos.z + (D_ctx_80177D20 - 1.0f); + gCsCamAtZ = player->pos.z + (gPathProgress - 1.0f); - if (((player->timer_1F8 % 2) == 0) && (player->timer_1F8 > 962)) { + if (((player->csTimer % 2) == 0) && (player->csTimer > 962)) { func_hud_800933D8(player->pos.x, player->pos.y, player->pos.z + 50.0f, 20.0f); } - if (player->timer_1F8 <= 900) { + if (player->csTimer <= 900) { gLevelStartStatusScreenTimer = 50; player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; - player->unk_1D0 = 0; - player->timer_1F8 = 0; + player->csState = 0; + player->csTimer = 0; gLoadLevelObjects = 1; SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 50); @@ -5283,8 +5283,8 @@ void HUD_AquasStart(Player* player) { break; } - Matrix_RotateY(gCalcMatrix, M_DTOR * (player->unk_0E8 + player->unk_114 + 180.0f), MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -(M_DTOR * player->unk_0E4), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, M_DTOR * (player->rot.y + player->yRot_114 + 180.0f), MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(M_DTOR * player->rot.x), MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; @@ -5298,9 +5298,9 @@ void HUD_AquasStart(Player* player) { player->pos.x += player->vel.x; player->pos.y += player->vel.y; - D_ctx_80177CE8 -= player->vel.z; + gPathTexScroll -= player->vel.z; - player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; + player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll; Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0.0f); Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0.0f); @@ -5320,7 +5320,7 @@ f32 D_800D24CC = 0.02f; void func_hud_80094954(Effect* effect) { Player* player = &gPlayer[0]; - if ((player->state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && (gCurrentLevel == LEVEL_AQUAS) && (player->unk_1D0 < 2)) { + if ((player->state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && (gCurrentLevel == LEVEL_AQUAS) && (player->csState < 2)) { switch (effect->state) { case 0: effect->unk_44 += effect->unk_46; @@ -5358,7 +5358,7 @@ void func_hud_80094954(Effect* effect) { if (player->state_1C8 == PLAYERSTATE_1C8_NEXT) { effect->unk_46 = 2; - if (player->unk_1D0 >= 4) { + if (player->csState >= 4) { effect->vel.y -= 0.13f; } } @@ -5367,7 +5367,7 @@ void func_hud_80094954(Effect* effect) { effect->unk_4A -= effect->unk_46; if ((effect->unk_4A < 0) || ((player->state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && - (gCurrentLevel == LEVEL_AQUAS) && (player->unk_1D0 == 5))) { + (gCurrentLevel == LEVEL_AQUAS) && (player->csState == 5))) { Object_Kill(&effect->obj, effect->sfxSource); } effect->obj.rot.z += effect->unk_48; @@ -5376,7 +5376,7 @@ void func_hud_80094954(Effect* effect) { void func_hud_80094BBC(Effect* effect) { if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && (gCurrentLevel == LEVEL_AQUAS) && - (gPlayer[0].unk_1D0 < 2)) { + (gPlayer[0].csState < 2)) { RCP_SetupDL(&gMasterDisp, 0x44); gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 21, 34, effect->unk_4A); gDPSetEnvColor(gMasterDisp++, 255, 255, 251, 0); @@ -5532,7 +5532,7 @@ void func_hud_80094D20(f32 x, f32 y) { void func_hud_80095350(Actor* actor) { Actor_Initialize(actor); actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->unk_0B6 = 9999; Object_SetInfo(&actor->info, actor->obj.id); } @@ -5547,9 +5547,9 @@ void func_hud_800953A0(Actor* actor, s32 arg1) { Actor_Initialize(actor); actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos = D_800D2510[arg1]; - actor->obj.pos.z -= D_ctx_80177D20; + actor->obj.pos.z -= gPathProgress; actor->unk_0B6 = 45; Object_SetInfo(&actor->info, actor->obj.id); } @@ -5562,9 +5562,9 @@ void func_hud_8009546C(Actor* actor, s32 arg1) { Actor_Initialize(actor); actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos = D_800D2540[arg1]; - actor->obj.pos.z -= D_ctx_80177D20; + actor->obj.pos.z -= gPathProgress; actor->unk_0B6 = 46; Object_SetInfo(&actor->info, actor->obj.id); } @@ -5577,9 +5577,9 @@ void func_hud_80095538(Actor* actor, s32 arg1) { Actor_Initialize(actor); actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos = D_800D257C[arg1]; - actor->obj.pos.z -= D_ctx_80177D20; + actor->obj.pos.z -= gPathProgress; actor->unk_0B6 = 47; Object_SetInfo(&actor->info, actor->obj.id); } @@ -5600,11 +5600,11 @@ void HUD_AquasComplete(Player* player) { actor = &gActors[0]; - switch (player->unk_1D0) { + switch (player->csState) { case 0: gCsFrameCount = 0; - player->unk_280 = 0; - player->unk_1D0 = 1; + player->barrelRollAlpha = 0; + player->csState = 1; D_ctx_80177A48[1] = gBosses[0].obj.pos.x; D_ctx_80177A48[2] = gBosses[0].obj.pos.y; @@ -5624,7 +5624,7 @@ void HUD_AquasComplete(Player* player) { gFillScreenAlphaTarget = 255; gFillScreenAlphaStep = 16; if (gCsFrameCount == 280) { - player->unk_1D0 = 10; + player->csState = 10; } } @@ -5653,13 +5653,13 @@ void HUD_AquasComplete(Player* player) { if (gCsFrameCount >= 90) { dest.x = player->cam.eye.x; dest.y = player->cam.eye.y; - dest.z = player->cam.eye.z + 200.0f - D_ctx_80177D20; + dest.z = player->cam.eye.z + 200.0f - gPathProgress; } - Math_SmoothStepToAngle(&player->unk_130, 0.0f, 0.05f, 1.2f, 0.0001f); - Math_SmoothStepToAngle(&player->unk_12C, 0.0f, 0.05f, 1.2f, 0.0001f); + Math_SmoothStepToAngle(&player->zRotBarrelRoll, 0.0f, 0.05f, 1.2f, 0.0001f); + Math_SmoothStepToAngle(&player->zRotBank, 0.0f, 0.05f, 1.2f, 0.0001f); Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 3.0f, 0.0f); - Math_SmoothStepToAngle(&player->unk_4D8, 0.0f, 0.1f, 20.0f, 0.0f); + Math_SmoothStepToAngle(&player->aerobaticPitch, 0.0f, 0.1f, 20.0f, 0.0f); x = player->pos.x - dest.x; y = player->pos.y - dest.y; @@ -5676,9 +5676,9 @@ void HUD_AquasComplete(Player* player) { x1 = 0.0f; } - z1 = Math_SmoothStepToAngle(&player->unk_0E8, y1, 0.5f, 2.0f, 0.0001f) * 30.0f; - Math_SmoothStepToAngle(&player->unk_0E4, x1, 0.5f, 2.0f, 0.0001f); - Math_SmoothStepToAngle(&player->unk_0EC, z1, 0.1f, 5.0f, 0.0001f); + z1 = Math_SmoothStepToAngle(&player->rot.y, y1, 0.5f, 2.0f, 0.0001f) * 30.0f; + Math_SmoothStepToAngle(&player->rot.x, x1, 0.5f, 2.0f, 0.0001f); + Math_SmoothStepToAngle(&player->rot.z, z1, 0.1f, 5.0f, 0.0001f); Math_SmoothStepToAngle(&D_ctx_80177A48[4], 30.0f, 0.05f, 1.0f, 0.001f); Math_SmoothStepToF(&D_ctx_80177A48[8], 600.0f, 0.05f, 1000.0f, 0.001f); @@ -5689,7 +5689,7 @@ void HUD_AquasComplete(Player* player) { src.z = D_ctx_80177A48[9]; Matrix_Translate(gCalcMatrix, gBosses[0].obj.pos.x, gBosses[0].obj.pos.y, - gBosses[0].obj.pos.z + D_ctx_80177D20, MTXF_NEW); + gBosses[0].obj.pos.z + gPathProgress, MTXF_NEW); Matrix_RotateY(gCalcMatrix, -(M_DTOR * D_ctx_80177A48[4]), MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &src, &dest); @@ -5704,11 +5704,11 @@ void HUD_AquasComplete(Player* player) { if (gCsFrameCount < 200) { Math_SmoothStepToF(&gCsCamAtX, gBosses[0].obj.pos.x, 0.03f, 100.0f, 0.001f); Math_SmoothStepToF(&gCsCamAtY, gBosses[0].obj.pos.y, 0.03f, 100.0f, 0.001f); - Math_SmoothStepToF(&gCsCamAtZ, gBosses[0].obj.pos.z + 600.0f + D_ctx_80177D20, 0.03f, 100.0f, 0.001f); + Math_SmoothStepToF(&gCsCamAtZ, gBosses[0].obj.pos.z + 600.0f + gPathProgress, 0.03f, 100.0f, 0.001f); } else { Math_SmoothStepToF(&gCsCamAtX, player->pos.x, D_ctx_80177A48[6], 1000.0f, 0.001f); Math_SmoothStepToF(&gCsCamAtY, player->pos.y, D_ctx_80177A48[6], 1000.0f, 0.001f); - Math_SmoothStepToF(&gCsCamAtZ, player->pos.z + D_ctx_80177D20, D_ctx_80177A48[6], 1000.0f, 0.001f); + Math_SmoothStepToF(&gCsCamAtZ, player->pos.z + gPathProgress, D_ctx_80177A48[6], 1000.0f, 0.001f); if (gCsFrameCount > 180) { D_ctx_80177A48[6] += 0.005f; } else { @@ -5726,17 +5726,17 @@ void HUD_AquasComplete(Player* player) { case 10: player->unk_234 = 1; gAqDrawMode = 2; - player->unk_1D0 = 11; + player->csState = 11; - player->unk_0F8 = player->unk_0EC = player->unk_12C = player->unk_130 = 0.0f; + player->bankAngle = player->rot.z = player->zRotBank = player->zRotBarrelRoll = 0.0f; player->vel.x = player->vel.y = player->vel.z = 0.0f; - player->unk_0E4 = player->unk_0E8 = player->unk_0EC = 0.0f; - player->boostSpeed = player->unk_114 = 0.0f; + player->rot.x = player->rot.y = player->rot.z = 0.0f; + player->boostSpeed = player->yRot_114 = 0.0f; player->baseSpeed = 3.6f; - player->unk_138 = player->pos.z = 0.0f; + player->trueZpos = player->pos.z = 0.0f; player->pos.y = 100.0f; player->pos.x = -100.0f; - player->unk_280 = 0; + player->barrelRollAlpha = 0; player->unk_17C = player->unk_180 = 0.0f; D_bg_8015F974 = D_bg_8015F978 = D_bg_8015F97C = 255; @@ -5752,7 +5752,7 @@ void HUD_AquasComplete(Player* player) { Play_ClearObjectData(); - player->unk_144 = D_ctx_80177D20 = 0; + player->zPath = gPathProgress = 0; j = 0; func_hud_80095350(actor); @@ -5770,8 +5770,8 @@ void HUD_AquasComplete(Player* player) { func_hud_800953A0(&gActors[j], i); } - player->pos.z -= D_ctx_80177D20; - player->unk_138 = player->pos.z; + player->pos.z -= gPathProgress; + player->trueZpos = player->pos.z; actor->fwork[1] = 0.0f; actor->fwork[2] = 600.0f; @@ -5784,13 +5784,13 @@ void HUD_AquasComplete(Player* player) { src.y = actor->fwork[2]; src.z = actor->fwork[3]; - Matrix_Translate(gCalcMatrix, player->pos.x, player->pos.y, player->unk_138 + D_ctx_80177D20, MTXF_NEW); + Matrix_Translate(gCalcMatrix, player->pos.x, player->pos.y, player->trueZpos + gPathProgress, MTXF_NEW); Matrix_RotateY(gCalcMatrix, -(M_DTOR * actor->unk_0F4.y), MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &src, &dest); player->cam.at.x = gCsCamAtX = player->pos.x; player->cam.at.y = gCsCamAtY = player->pos.y; - player->cam.at.z = gCsCamAtZ = player->pos.z - 50.0f + D_ctx_80177D20; + player->cam.at.z = gCsCamAtZ = player->pos.z - 50.0f + gPathProgress; player->cam.eye.x = gCsCamEyeX = dest.x; player->cam.eye.y = gCsCamEyeY = dest.y; @@ -5804,7 +5804,7 @@ void HUD_AquasComplete(Player* player) { gFillScreenAlphaStep = 8; if (gFillScreenAlpha == 0) { - player->unk_1D0 = 12; + player->csState = 12; } case 12: @@ -5824,17 +5824,17 @@ void HUD_AquasComplete(Player* player) { } else { actor->fwork[4] = player->pos.x; actor->fwork[5] = player->pos.y; - actor->fwork[6] = player->unk_138 + D_ctx_80177D20; + actor->fwork[6] = player->trueZpos + gPathProgress; } if (gCsFrameCount < 1200) { gCsCamAtX = player->pos.x; gCsCamAtY = player->pos.y; - gCsCamAtZ = player->pos.z - 50.0f + D_ctx_80177D20; + gCsCamAtZ = player->pos.z - 50.0f + gPathProgress; } else { gCsCamAtX = player->pos.x; gCsCamAtY = player->pos.y + 10.0f; - gCsCamAtZ = player->pos.z - 50.0f + D_ctx_80177D20; + gCsCamAtZ = player->pos.z - 50.0f + gPathProgress; } D_ctx_80177A48[0] = 0.05f; @@ -5866,7 +5866,7 @@ void HUD_AquasComplete(Player* player) { if (gFillScreenAlpha == 255) { gLeveLClearStatus[LEVEL_AQUAS] = Play_CheckMedalStatus(150) + 1; player->state_1C8 = PLAYERSTATE_1C8_NEXT; - player->timer_1F8 = 0; + player->csTimer = 0; Audio_FadeOutAll(10); gFadeoutType = 4; } @@ -5936,8 +5936,8 @@ void HUD_AquasComplete(Player* player) { break; } - Matrix_RotateY(gCalcMatrix, M_DTOR * (player->unk_0E8 + player->unk_114 + 180.0f), MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -(M_DTOR * player->unk_0E4), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, M_DTOR * (player->rot.y + player->yRot_114 + 180.0f), MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(M_DTOR * player->rot.x), MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; @@ -5953,15 +5953,15 @@ void HUD_AquasComplete(Player* player) { player->pos.y += player->vel.y; player->pos.z += player->vel.z; - player->unk_138 = player->pos.z; + player->trueZpos = player->pos.z; - player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; + player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll; - player->unk_060 = SIN_DEG(player->unk_0F4 * 0.7f) * 0.5f; - player->unk_088 += 10.0f; - player->unk_0F4 += 8.0f; - player->unk_080 = -SIN_DEG(player->unk_088) * 0.5f; - player->unk_0F0 = SIN_DEG(player->unk_0F4) * 1.5f; + player->unk_060 = SIN_DEG(player->rockPhase * 0.7f) * 0.5f; + player->bobPhase += 10.0f; + player->rockPhase += 8.0f; + player->yBob = -SIN_DEG(player->bobPhase) * 0.5f; + player->rockAngle = SIN_DEG(player->rockPhase) * 1.5f; if (player->unk_234) { src.x = 0.0f; @@ -5987,17 +5987,17 @@ void func_hud_80096A74(Player* player) { Vec3f src, dest; s32 button; - switch (player->unk_1D0) { + switch (player->csState) { case 0: player->pos.y += 3400.0f; - player->unk_0E4 = 270.0f; + player->rot.x = 270.0f; gPlayer[0].baseSpeed = 0.0f; D_ctx_80177A48[1] = 100.0f; D_ctx_80177A48[2] = 0.0f; D_ctx_80177A48[0] = 0.2f; gCsFrameCount = 0; - player->unk_1D0 = 1; + player->csState = 1; gFillScreenAlpha = gFillScreenAlphaTarget = 255; player->cam.eye.x = gCsCamEyeX = 0.0f; @@ -6053,7 +6053,7 @@ void func_hud_80096A74(Player* player) { if (gCsFrameCount == 270) { player->unk_190 = player->unk_194 = 10.0f; - player->unk_1D0 = 2; + player->csState = 2; D_ctx_80177A48[1] = 400.0f; AUDIO_PLAY_SFX(0x09004002, player->sfxSource, 0); } @@ -6070,7 +6070,7 @@ void func_hud_80096A74(Player* player) { button = gControllerHold[player->num].button; gControllerHold[player->num].button = gBoostButton[player->num]; player->boostMeter = 1; - player->timer_1F8 = 60; + player->csTimer = 60; func_play_800B2574(player); @@ -6086,12 +6086,12 @@ void func_hud_80096A74(Player* player) { gCsCamAtZ = player->pos.z; if (gCsFrameCount == 300) { - D_ctx_80177CE8 = 0; + gPathTexScroll = 0; gLevelStartStatusScreenTimer = 50; player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->baseSpeed = gArwingSpeed; - player->unk_1D0 = 0; - player->timer_1F8 = 0; + player->csState = 0; + player->csTimer = 0; player->unk_014 = 0.0f; player->unk_018 = 0.0f; player->camRoll = 0.0f; @@ -6104,29 +6104,29 @@ void func_hud_80096A74(Player* player) { Math_SmoothStepToF(&player->baseSpeed, 30.0f, 0.05f, 1000.0f, 0.001f); if (gCsFrameCount < 110) { - player->unk_0EC += (D_ctx_80177A48[4] * 2.0f); - if (player->unk_0EC >= 360.0f) { - player->unk_0EC -= 360.0f; + player->rot.z += (D_ctx_80177A48[4] * 2.0f); + if (player->rot.z >= 360.0f) { + player->rot.z -= 360.0f; } - if (player->unk_0EC < 0.0f) { - player->unk_0EC += 360.0f; + if (player->rot.z < 0.0f) { + player->rot.z += 360.0f; } } else { - Math_SmoothStepToAngle(&player->unk_0EC, 0.0f, 0.4f, (D_ctx_80177A48[4] * 2.0f), 1.0f); - if (player->unk_0EC == 0.0f) { - if (player->unk_0E4 != 0.0f) { - Math_SmoothStepToAngle(&player->unk_0E4, 0.0f, 0.1f, 2.4f, 0.001f); + Math_SmoothStepToAngle(&player->rot.z, 0.0f, 0.4f, (D_ctx_80177A48[4] * 2.0f), 1.0f); + if (player->rot.z == 0.0f) { + if (player->rot.x != 0.0f) { + Math_SmoothStepToAngle(&player->rot.x, 0.0f, 0.1f, 2.4f, 0.001f); } else { - player->unk_088 += 10.0f; - player->unk_080 = -SIN_DEG(player->unk_088) * 0.5f; - player->unk_0F4 += 3.0f; - player->unk_0F0 = SIN_DEG(player->unk_0F4) * 1.5f; + player->bobPhase += 10.0f; + player->yBob = -SIN_DEG(player->bobPhase) * 0.5f; + player->rockPhase += 3.0f; + player->rockAngle = SIN_DEG(player->rockPhase) * 1.5f; } } } - Matrix_RotateY(gCalcMatrix, M_DTOR * (player->unk_0E8 + player->unk_114 + 180.0f), MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -(M_DTOR * (player->unk_0E4)), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, M_DTOR * (player->rot.y + player->yRot_114 + 180.0f), MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(M_DTOR * (player->rot.x)), MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; @@ -6140,9 +6140,9 @@ void func_hud_80096A74(Player* player) { player->pos.x += player->vel.x; player->pos.y += player->vel.y; - D_ctx_80177CE8 += player->vel.z; + gPathTexScroll += player->vel.z; - player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; + player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll; } Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0.0f); diff --git a/src/engine/fox_play.c b/src/engine/fox_play.c index 55d34158..eb6545c7 100644 --- a/src/engine/fox_play.c +++ b/src/engine/fox_play.c @@ -144,21 +144,21 @@ void func_play_800A3FEC(void) { void func_play_800A4460(Player* player) { if ((gCurrentLevel == LEVEL_VENOM_ANDROSS) && (gBosses[0].obj.status == OBJ_ACTIVE) && (gBosses[0].state == 17)) { - player->unk_060 = SIN_DEG(player->unk_0F4 * 0.7f) * 0.5f; - player->unk_088 += 13.0f; - player->unk_0F4 += 20.0f; - player->unk_080 = -SIN_DEG(player->unk_088) * 5.0f; - player->unk_0F0 = SIN_DEG(player->unk_0F4) * 10.0f; + player->unk_060 = SIN_DEG(player->rockPhase * 0.7f) * 0.5f; + player->bobPhase += 13.0f; + player->rockPhase += 20.0f; + player->yBob = -SIN_DEG(player->bobPhase) * 5.0f; + player->rockAngle = SIN_DEG(player->rockPhase) * 10.0f; } else { - player->unk_060 = SIN_DEG(player->unk_0F4 * 0.7f) * 0.5f; - player->unk_088 += 10.0f; - player->unk_0F4 += 8.0f; + player->unk_060 = SIN_DEG(player->rockPhase * 0.7f) * 0.5f; + player->bobPhase += 10.0f; + player->rockPhase += 8.0f; if ((gLevelType == LEVELTYPE_PLANET) || ((player->cockpitView == true) && (gLevelMode == LEVELMODE_ON_RAILS))) { - player->unk_080 = -SIN_DEG(player->unk_088) * 0.5f; + player->yBob = -SIN_DEG(player->bobPhase) * 0.5f; if ((player->wings.rightState <= WINGSTATE_BROKEN) || (player->wings.leftState <= WINGSTATE_BROKEN)) { - player->unk_0F0 = SIN_DEG(player->unk_0F4) * 5.0f; + player->rockAngle = SIN_DEG(player->rockPhase) * 5.0f; } else { - player->unk_0F0 = SIN_DEG(player->unk_0F4) * 1.5f; + player->rockAngle = SIN_DEG(player->rockPhase) * 1.5f; } } } @@ -211,12 +211,12 @@ void func_play_800A46A0(Player* player) { if ((gGameFrameCount & var_v1) == 0) { func_effect_8007D10C(player->pos.x + RAND_FLOAT_CENTERED(10.0f), player->pos.y + sp40 + RAND_FLOAT(10.0f), - player->unk_138 + RAND_FLOAT_CENTERED(10.0f), 2.2f); + player->trueZpos + RAND_FLOAT_CENTERED(10.0f), 2.2f); } if (((gGameFrameCount & (var_v1 >> 2)) == 0) && (Rand_ZeroOne() < 0.5f)) { func_effect_8007C484(player->pos.x + RAND_FLOAT_CENTERED(30.0f), player->pos.y + sp40 + RAND_FLOAT(10.0f), - player->unk_138 + RAND_FLOAT_CENTERED(30.0f), player->vel.x, player->vel.y, + player->trueZpos + RAND_FLOAT_CENTERED(30.0f), player->vel.x, player->vel.y, player->vel.z, 0.04f + RAND_FLOAT(0.03f), player->num + 1); if (player->timer_224 == 0) { player->timer_224 = 2; @@ -235,21 +235,21 @@ void func_play_800A4C40(Player* player) { Vec3f sp30; if (gGroundSurface == SURFACE_WATER) { - Matrix_Translate(gCalcMatrix, player->pos.x, player->pos.y, player->unk_138, MTXF_NEW); - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_APPLY); - Matrix_RotateX(gCalcMatrix, -((player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, -(player->unk_0F8 * M_DTOR), MTXF_APPLY); + Matrix_Translate(gCalcMatrix, player->pos.x, player->pos.y, player->trueZpos, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, -((player->rot.x + player->aerobaticPitch) * M_DTOR), MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -(player->bankAngle * M_DTOR), MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &sp54, &sp3C); Matrix_MultVec3f(gCalcMatrix, &sp48, &sp30); if (player->pos.y < (gGroundHeight + 100.0f)) { if ((sp3C.y < gGroundHeight + 80.0f) && ((gGameFrameCount % 2) == 0)) { if (D_play_80161A64) {} func_effect_8007ACE0(sp3C.x, gGroundHeight, sp3C.z, 0.1f, 2.0f, - player->unk_0E8 + player->unk_114 + 20.0f); + player->rot.y + player->yRot_114 + 20.0f); } if ((sp30.y < gGroundHeight + 80.0f) && ((gGameFrameCount % 2) == 0)) { func_effect_8007ACE0(sp30.x, gGroundHeight, sp30.z, 0.1f, 2.0f, - player->unk_0E8 + player->unk_114 - 20.0f); + player->rot.y + player->yRot_114 - 20.0f); } } if ((sp30.y < gGroundHeight + 80.0f) || (sp3C.y < gGroundHeight + 80.0f)) { @@ -456,7 +456,7 @@ void Play_Setup(void) { gSavedZoSearchlightStatus = false; gSceneSetup = 0; gAllRangeCheckpoint = gSavedObjectLoadIndex = 0; - D_ctx_80177CB0 = 0.0f; + gSavedPathProgress = 0.0f; gSavedHitCount = gCsFrameCount = gLevelStartStatusScreenTimer = gLevelClearScreenTimer = gRadioState = 0; D_ctx_8017782C = 1; if (((gCurrentLevel == LEVEL_VENOM_2) && (gNextLevelPhase == 2)) || (gCurrentLevel == LEVEL_VENOM_ANDROSS)) { @@ -495,7 +495,7 @@ void func_play_800A594C(void) { } else { sEnvironment = SEGMENTED_TO_VIRTUAL(D_800D2F98[gCurrentLevel]); } - if (D_ctx_8017782C == 0) { + if (!D_ctx_8017782C) { if (gCurrentLevel == LEVEL_SOLAR) { Audio_SetHeatAlarmParams(255, 1); AUDIO_PLAY_SFX(0x4100C023, gDefaultSfxSource, 4); @@ -828,10 +828,10 @@ void Player_ApplyDamage(Player* player, s32 direction, s32 damage) { player->damage = damage; } if (player->damage != 0) { - player->timer_220 = 4; + player->radioDamageTimer = 4; } player->unk_284 = 0; - player->unk_1F4 = 20; + player->hitTimer = 20; if (player->unk_1A4 > 40) { sp34 = (player->boostSpeed * 0.3f) + 20.0f; player->timer_498 = 5; @@ -861,24 +861,24 @@ void Player_ApplyDamage(Player* player, s32 direction, s32 damage) { func_play_800A5FA0(player->sfxSource, 0x0903A00F, player->num); } } - Matrix_RotateY(gCalcMatrix, player->unk_114 * M_DTOR, MTXF_NEW); - Matrix_RotateZ(gCalcMatrix, player->unk_0F8 * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, player->yRot_114 * M_DTOR, MTXF_NEW); + Matrix_RotateZ(gCalcMatrix, player->bankAngle * M_DTOR, MTXF_APPLY); sp44.z = 0.0f; switch (player->unk_21C) { case 0: player->timer_224 = 20; - player->unk_0D8.x = 0.f; - player->unk_0D8.y = 0.f; - player->unk_0D8.z = 0.f; + player->knockback.x = 0.f; + player->knockback.y = 0.f; + player->knockback.z = 0.f; break; case 1: sp44.x = -sp34; sp44.y = 0.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp38); - player->unk_0D8.x = sp38.x; - player->unk_0D8.y = sp38.y; - player->unk_0D8.z = sp38.z; + player->knockback.x = sp38.x; + player->knockback.y = sp38.y; + player->knockback.z = sp38.z; func_play_800A668C(player->hit1.x - player->vel.x, player->hit1.y, player->hit1.z - player->vel.z); Player_DamageWings(player, 1, 20); break; @@ -887,9 +887,9 @@ void Player_ApplyDamage(Player* player, s32 direction, s32 damage) { sp44.y = 0.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp38); - player->unk_0D8.x = sp38.x; - player->unk_0D8.y = sp38.y; - player->unk_0D8.z = sp38.z; + player->knockback.x = sp38.x; + player->knockback.y = sp38.y; + player->knockback.z = sp38.z; func_play_800A668C(player->hit2.x - player->vel.x, player->hit2.y, player->hit2.z - player->vel.z); Player_DamageWings(player, 2, 20); break; @@ -900,9 +900,9 @@ void Player_ApplyDamage(Player* player, s32 direction, s32 damage) { sp44.x = 0.0f; sp44.y = -sp34; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp38); - player->unk_0D8.x = sp38.x; - player->unk_0D8.y = sp38.y; - player->unk_0D8.z = sp38.z; + player->knockback.x = sp38.x; + player->knockback.y = sp38.y; + player->knockback.z = sp38.z; } if (Rand_ZeroOne() < 0.5f) { Player_DamageWings(player, 1, 15); @@ -916,9 +916,9 @@ void Player_ApplyDamage(Player* player, s32 direction, s32 damage) { sp44.x = 0.0f; sp44.y = sp34; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp38); - player->unk_0D8.x = sp38.x; - player->unk_0D8.y = sp38.y; - player->unk_0D8.z = sp38.z; + player->knockback.x = sp38.x; + player->knockback.y = sp38.y; + player->knockback.z = sp38.z; if (Rand_ZeroOne() < 0.5f) { Player_DamageWings(player, 1, 15); } else { @@ -928,9 +928,9 @@ void Player_ApplyDamage(Player* player, s32 direction, s32 damage) { } if ((gCurrentLevel == LEVEL_VENOM_1) && (player->unk_1A4 == 42)) { if (player->pos.x > 0.0f) { - player->unk_0D8.x = -30.0f; + player->knockback.x = -30.0f; } else { - player->unk_0D8.x = 30.0f; + player->knockback.x = 30.0f; } player->timer_498 = 10; } @@ -945,8 +945,8 @@ void func_play_800A729C(Player* player, u32 arg1, f32 arg2, f32 arg3) { switch (arg1) { case 1: case 2: - player->pos.x = player->unk_090.x; - player->unk_0D8.x = 0.0f; + player->pos.x = player->basePos.x; + player->knockback.x = 0.0f; player->pos.x += D_800D2FEC[player->unk_21C]; if (player->form == FORM_LANDMASTER) { player->pos.x -= D_800D2FEC[player->unk_21C]; @@ -955,13 +955,13 @@ void func_play_800A729C(Player* player, u32 arg1, f32 arg2, f32 arg3) { break; case 3: case 4: - player->pos.z = player->unk_090.z; - player->unk_0D8.z = 0.0f; + player->pos.z = player->basePos.z; + player->knockback.z = 0.0f; player->pos.z += D_800D2FEC[player->unk_21C]; if (player->form == FORM_LANDMASTER) { player->pos.z += D_800D2FEC[player->unk_21C]; } - player->unk_138 = player->pos.z; + player->trueZpos = player->pos.z; Math_SmoothStepToF(&player->baseSpeed, 2.0f, 1.0f, 2.0f, 0.00001f); break; case 0: @@ -1013,12 +1013,12 @@ bool func_play_800A73E4(f32* arg0, s32* arg1, f32 xPos, f32 yPos, f32 zPos) { } sp9C = (s32) ((xPos + 2400.0f) / 300.0f); - sp98 = (s32) ((zPos + D_ctx_80177D20 + 1500.0f + 2400.0f) / 300.0f); + sp98 = (s32) ((zPos + gPathProgress + 1500.0f + 2400.0f) / 300.0f); if ((sp9C < 0) || (sp9C >= 16) || (sp98 < 0) || (sp98 >= 16)) { return false; } sp90 = Math_ModF(xPos + 2400.0f, 300.0f); - sp94 = Math_ModF(zPos + D_ctx_80177D20 + 1500.0f + 2400.0f, 300.0f); + sp94 = Math_ModF(zPos + gPathProgress + 1500.0f + 2400.0f, 300.0f); sp8C = (sp98 * 17) + sp9C; x0 = spA4[spA0[sp8C]].n.ob[0] * 3.0f; y0 = spA4[spA0[sp8C]].n.ob[1] * 2.0f; @@ -1051,7 +1051,7 @@ bool func_play_800A73E4(f32* arg0, s32* arg1, f32 xPos, f32 yPos, f32 zPos) { crz = (dx10 * dy21) - (dy10 * dx21); temp1 = -crx * x0 - cry * y0 - crz * z0; - sp48 = (-temp1 - crx * xPos - crz * (zPos + D_ctx_80177D20 + 1500.0f)) / cry; + sp48 = (-temp1 - crx * xPos - crz * (zPos + gPathProgress + 1500.0f)) / cry; if (yPos < sp48) { *arg0 = sp48; *arg1 = sp8C; @@ -1235,7 +1235,7 @@ bool func_play_800A8054(ObjectId objId, f32 arg1, f32 arg2, f32 arg3, f32 arg4, case OBJ_BOSS_313: colId = COL1_8; break; - case OBJ_SCENERY_39: + case OBJ_SCENERY_ME_TUNNEL: colId = COL1_1; break; case OBJ_SCENERY_120: @@ -1392,18 +1392,18 @@ s32 func_play_800A8304(Player* player, ObjectId objId, f32 arg2, f32 arg3, f32 a if ((player->form == FORM_LANDMASTER) || (player->form == FORM_ON_FOOT)) { sp78.x = player->pos.x - sp84.x; sp78.y = player->pos.y - sp84.y; - sp78.z = player->unk_138 - sp84.z; + sp78.z = player->trueZpos - sp84.z; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp78, &sp6C); if (func_play_800A8054(objId, sp84.x, sp84.y, sp84.z, sp6C.x + sp84.x, sp6C.y + sp84.y, sp6C.z + sp84.z, &sp60, &sp54)) { player->pos.y = sp60.y; - player->unk_104 = Math_RadToDeg(sp60.x); - player->unk_10C = Math_RadToDeg(sp60.z); + player->rot_104.x = Math_RadToDeg(sp60.x); + player->rot_104.z = Math_RadToDeg(sp60.z); player->vel.y = 0.0f; if (player->form == FORM_ON_FOOT) { player->vel.y = -5.0f; } - player->unk_1D4 = 1; + player->grounded = true; return 5; } return 0; @@ -1494,10 +1494,10 @@ void func_play_800A8804(Player* playerA, Player* playerB) { void func_play_800A887C(Player* player) { Vec3f sp3C; - Matrix_Translate(gCalcMatrix, player->pos.x, player->pos.y, player->unk_138, MTXF_NEW); + Matrix_Translate(gCalcMatrix, player->pos.x, player->pos.y, player->trueZpos, MTXF_NEW); if (player->form == FORM_LANDMASTER) { - player->unk_10C = 0.0f; - player->unk_104 = 0.0f; + player->rot_104.z = 0.0f; + player->rot_104.x = 0.0f; sp3C.x = -40.0f; sp3C.y = 40.0f; @@ -1525,8 +1525,8 @@ void func_play_800A887C(Player* player) { Matrix_MultVec3f(gCalcMatrix, &sp3C, &player->hit4); } if ((player->form == FORM_ARWING) || (player->form == FORM_BLUE_MARINE)) { - Matrix_RotateY(gCalcMatrix, (player->unk_114 + 180.0f) * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, -(player->unk_0F8 * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->yRot_114 + 180.0f) * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -(player->bankAngle * M_DTOR), MTXF_APPLY); sp3C.y = 0.0f; sp3C.z = 0.0f; if (player->wings.leftState == WINGSTATE_INTACT) { @@ -1588,8 +1588,8 @@ void func_play_800A8BA4(Player* player) { func_tank_800444BC(player); break; case FORM_BLUE_MARINE: // This should probably be FORM_ON_FOOT - if (Ground_801B6AEC(player->pos.x, player->pos.y - 12.0f, player->unk_138 + player->unk_144)) { - Ground_801B6E20(player->pos.x, player->unk_138 + player->unk_144, &spE8, &spE0, &spE4); + if (Ground_801B6AEC(player->pos.x, player->pos.y - 12.0f, player->trueZpos + player->zPath)) { + Ground_801B6E20(player->pos.x, player->trueZpos + player->zPath, &spE8, &spE0, &spE4); player->pos.y = spE0 + 10.0f; } break; @@ -1597,8 +1597,8 @@ void func_play_800A8BA4(Player* player) { } else if (player->form == FORM_ARWING) { if ((player->hit1.y < (gGroundHeight + 13.0f)) && (player->state_1C8 != PLAYERSTATE_1C8_DOWN)) { if (gGroundSurface == SURFACE_WATER) { - player->unk_1F4 = 7; - player->unk_0E4 = (player->baseSpeed + player->boostSpeed) * 0.5f; + player->hitTimer = 7; + player->rot.x = (player->baseSpeed + player->boostSpeed) * 0.5f; } else { Player_ApplyDamage(player, 1, 21); } @@ -1610,8 +1610,8 @@ void func_play_800A8BA4(Player* player) { } if ((player->hit2.y < (gGroundHeight + 13.0f)) && (player->state_1C8 != PLAYERSTATE_1C8_DOWN)) { if (gGroundSurface == SURFACE_WATER) { - player->unk_1F4 = 7; - player->unk_0E4 = (player->baseSpeed + player->boostSpeed) * 0.5f; + player->hitTimer = 7; + player->rot.x = (player->baseSpeed + player->boostSpeed) * 0.5f; } else { Player_ApplyDamage(player, 2, 21); } @@ -1636,7 +1636,7 @@ void func_play_800A8BA4(Player* player) { for (i = 0, scenery360 = gScenery360; i < 200; i++, scenery360++) { if (scenery360->obj.status == OBJ_ACTIVE) { spC8.x = scenery360->obj.pos.x - player->pos.x; - spC8.z = scenery360->obj.pos.z - player->unk_138; + spC8.z = scenery360->obj.pos.z - player->trueZpos; if (sqrtf(SQ(spC8.x) + SQ(spC8.z)) < sp8C) { if ((scenery360->obj.id == OBJ_SCENERY_117) || (scenery360->obj.id == OBJ_SCENERY_143) || (scenery360->obj.id == OBJ_SCENERY_141) || (scenery360->obj.id == OBJ_SCENERY_149) || @@ -1691,15 +1691,15 @@ void func_play_800A8BA4(Player* player) { Matrix_RotateY(gCalcMatrix, (scenery360->obj.rot.y + 180.0f) * M_DTOR, MTXF_NEW); Matrix_MultVec3f(gCalcMatrix, &D_800D3040[sp98 - 1], &spBC); - player->unk_0D8.x = spBC.x; - player->unk_0D8.y = spBC.y; - player->unk_0D8.z = spBC.z; + player->knockback.x = spBC.x; + player->knockback.y = spBC.y; + player->knockback.z = spBC.z; - player->unk_0E8 = player->unk_0E4 = 0.0f; - player->pos.x = player->unk_090.x; - player->pos.y = player->unk_090.y; - player->pos.z = player->unk_090.z; - player->unk_114 = scenery360->obj.rot.y + 180.0f; + player->rot.y = player->rot.x = 0.0f; + player->pos.x = player->basePos.x; + player->pos.y = player->basePos.y; + player->pos.z = player->basePos.z; + player->yRot_114 = scenery360->obj.rot.y + 180.0f; player->timer_498 = 5; } if ((scenery360->obj.id == OBJ_SCENERY_135) || @@ -1712,18 +1712,18 @@ void func_play_800A8BA4(Player* player) { Matrix_RotateY(gCalcMatrix, scenery360->obj.rot.y * M_DTOR, MTXF_NEW); Matrix_MultVec3f(gCalcMatrix, &D_800D30B8[sp98 - 1], &spBC); } - player->unk_0D8.x = spBC.x; - player->unk_0D8.y = spBC.y; - player->unk_0D8.z = spBC.z; - player->unk_0E8 = 0.0f; - player->unk_0E4 = 0.0f; - player->pos.x = player->unk_090.x; - player->pos.y = player->unk_090.y; - player->pos.z = player->unk_090.z; + player->knockback.x = spBC.x; + player->knockback.y = spBC.y; + player->knockback.z = spBC.z; + player->rot.y = 0.0f; + player->rot.x = 0.0f; + player->pos.x = player->basePos.x; + player->pos.y = player->basePos.y; + player->pos.z = player->basePos.z; if (scenery360->obj.id == OBJ_SCENERY_135) { - player->unk_114 = scenery360->obj.rot.y + 180.0f; + player->yRot_114 = scenery360->obj.rot.y + 180.0f; } else { - player->unk_114 = scenery360->obj.rot.y; + player->yRot_114 = scenery360->obj.rot.y; } player->timer_498 = 5; } @@ -1742,14 +1742,14 @@ void func_play_800A8BA4(Player* player) { (scenery->obj.id != OBJ_SCENERY_70) && (scenery->obj.id != OBJ_SCENERY_72) && (scenery->obj.id != OBJ_SCENERY_71) && (scenery->obj.id != OBJ_SCENERY_73) && (scenery->obj.id != OBJ_SCENERY_74) && (scenery->obj.id != OBJ_SCENERY_69) && - ((player->unk_138 - 2000.0f) < scenery->obj.pos.z)) { + ((player->trueZpos - 2000.0f) < scenery->obj.pos.z)) { if ((scenery->obj.id == OBJ_SCENERY_1) || (scenery->obj.id == OBJ_SCENERY_4) || (scenery->obj.id == OBJ_SCENERY_5) || (scenery->obj.id == OBJ_SCENERY_47) || (scenery->obj.id == OBJ_SCENERY_117) || (scenery->obj.id == OBJ_SCENERY_120) || (scenery->obj.id == OBJ_SCENERY_124) || (scenery->obj.id == OBJ_SCENERY_126) || (scenery->obj.id == OBJ_SCENERY_2) || (scenery->obj.id == OBJ_SCENERY_3)) { spC8.x = scenery->obj.pos.x - player->pos.x; - spC8.z = scenery->obj.pos.z - player->unk_138; + spC8.z = scenery->obj.pos.z - player->trueZpos; if (sqrtf(SQ(spC8.x) + SQ(spC8.z)) < 1100.0f) { temp_v0 = func_play_800A8304(player, scenery->obj.id, scenery->obj.pos.x, scenery->obj.pos.y, scenery->obj.pos.z, scenery->obj.rot.x, @@ -1800,32 +1800,32 @@ void func_play_800A8BA4(Player* player) { spC8.z = 0.0f; Matrix_MultVec3f(gCalcMatrix, &spC8, &spBC); - player->unk_0D8.x = spBC.x; - player->unk_0D8.y = spBC.y; - player->pos.x = player->unk_090.x; + player->knockback.x = spBC.x; + player->knockback.y = spBC.y; + player->pos.x = player->basePos.x; player->timer_498 = 5; } else if (scenery->obj.id == OBJ_SCENERY_50) { if (player->pos.x < scenery->obj.pos.x) { - player->unk_0D8.x = -30.0f; - player->unk_0E8 = 45.0f; + player->knockback.x = -30.0f; + player->rot.y = 45.0f; } else { - player->unk_0D8.x = 30.0f; - player->unk_0E8 = -45.0f; + player->knockback.x = 30.0f; + player->rot.y = -45.0f; } - player->unk_0D8.y = 0.0f; - player->pos.x = player->unk_090.x; + player->knockback.y = 0.0f; + player->pos.x = player->basePos.x; player->timer_498 = 5; } else if (scenery->obj.id == OBJ_SCENERY_131) { Matrix_RotateY(gCalcMatrix, (scenery->obj.rot.y + 180.0f) * M_DTOR, MTXF_NEW); Matrix_RotateZ(gCalcMatrix, -scenery->obj.rot.z * M_DTOR, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &D_800D3040[sp98 - 1], &spBC); - player->unk_0D8.x = spBC.x; - player->unk_0D8.y = spBC.y; - player->unk_0E8 = 0.0f; - player->unk_0E4 = 0.0f; + player->knockback.x = spBC.x; + player->knockback.y = spBC.y; + player->rot.y = 0.0f; + player->rot.x = 0.0f; player->timer_498 = 5; - player->pos.x = player->unk_090.x; - player->pos.y = player->unk_090.y; + player->pos.x = player->basePos.x; + player->pos.y = player->basePos.y; } } } @@ -1847,20 +1847,20 @@ void func_play_800A8BA4(Player* player) { if (boss->obj.id == OBJ_BOSS_310) { spfD4.x = fabsf(boss->obj.pos.x - player->pos.x) * .8333333f; spfD4.y = fabsf(boss->obj.pos.y - player->pos.y) * 2; - spfD4.z = fabsf(boss->obj.pos.z - player->unk_138) * 0.8333333f; + spfD4.z = fabsf(boss->obj.pos.z - player->trueZpos) * 0.8333333f; if ((VEC3F_MAG(&spfD4)) < 1500.0f) { Player_ApplyDamage(player, 0, boss->info.damage); player->boostSpeed = 0.0f; player->timer_498 = 5; - player->unk_0D8.y = 30.0f; + player->knockback.y = 30.0f; boss->dmgType = DMG_BEAM; func_effect_8007BFFC(player->pos.x + RAND_FLOAT_CENTERED(10.0f), player->pos.y + RAND_FLOAT(10.0f), - player->unk_138 + RAND_FLOAT_CENTERED(10.0f), 0.0f, 15.0f, 0.0f, 2.0f, 5); + player->trueZpos + RAND_FLOAT_CENTERED(10.0f), 0.0f, 15.0f, 0.0f, 2.0f, 5); for (j = 0; j < 10; j++) { func_effect_8007C484( player->pos.x + RAND_FLOAT_CENTERED(30.0f), player->pos.y + RAND_FLOAT(10.0f), - player->unk_138 + RAND_FLOAT_CENTERED(30.0f), player->vel.x, 20.0f + player->vel.y, + player->trueZpos + RAND_FLOAT_CENTERED(30.0f), player->vel.x, 20.0f + player->vel.y, player->vel.z, RAND_FLOAT(0.1f) + 0.1f, player->num + 11); } break; @@ -1869,7 +1869,7 @@ void func_play_800A8BA4(Player* player) { if (boss->obj.id == OBJ_BOSS_316) { spfD4.x = fabsf(boss->obj.pos.x - player->pos.x); spfD4.y = fabsf(boss->obj.pos.y - 300.0f - player->pos.y) * 7.42f; - spfD4.z = fabsf(boss->obj.pos.z - player->unk_138); + spfD4.z = fabsf(boss->obj.pos.z - player->trueZpos); if ((VEC3F_MAG(&spfD4)) < 2700.0f) { Player_ApplyDamage(player, 3, boss->info.damage); } @@ -1893,11 +1893,11 @@ void func_play_800A8BA4(Player* player) { Player_ApplyDamage(player, temp_v0, boss->info.damage); if ((boss->obj.id == OBJ_BOSS_303) && ((boss->state == 2) || (boss->state == 3)) && (sp98 >= 9)) { - player->unk_0D8.y = -100.0f; + player->knockback.y = -100.0f; } if ((boss->obj.id == OBJ_BOSS_320) && (sp98 < 5)) { - player->unk_0D8.x = boss->fwork[14]; - player->unk_0D8.y = boss->fwork[15]; + player->knockback.x = boss->fwork[14]; + player->knockback.y = boss->fwork[15]; } } } @@ -1924,10 +1924,10 @@ void func_play_800A8BA4(Player* player) { } 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); + spfD4.z = fabsf(actor->obj.pos.z - player->trueZpos); if ((VEC3F_MAG(&spfD4)) < 900.0f) { Player_ApplyDamage(player, 0, actor->info.damage); - actor->unk_0D0 = 3; + actor->dmgType = 3; } } else { temp_v0 = func_play_800A7974(player, actor->info.hitbox, &sp98, actor->obj.pos.x, @@ -1956,8 +1956,8 @@ void func_play_800A8BA4(Player* player) { } } else { Player_ApplyDamage(player, temp_v0, actor->info.damage); - actor->unk_0D0 = 3; - actor->unk_0D4 = player->num + 1; + actor->dmgType = 3; + actor->dmgSource = player->num + 1; } } } @@ -1967,11 +1967,11 @@ void func_play_800A8BA4(Player* player) { actor->fwork[8] + actor->obj.pos.y + 25.0f, actor->obj.pos.z, actor->fwork[29], actor->fwork[26], actor->obj.rot.z, 0.0f, 0.0f, 0.0f); if (temp_v0 != 0) { - actor->unk_0D0 = 3; + actor->dmgType = 3; if (actor->info.damage) { Player_ApplyDamage(player, temp_v0, actor->info.damage); } else { - actor->unk_0D0 = -1; + actor->dmgType = -1; } } } else { @@ -1988,17 +1988,17 @@ void func_play_800A8BA4(Player* player) { player->whooshTimer = 4; } } else { - actor->unk_0D0 = 3; + actor->dmgType = 3; if (actor->obj.id == OBJ_ACTOR_190) { - actor->unk_0D0 = -1; + actor->dmgType = -1; } if (actor->info.damage) { Player_ApplyDamage(player, temp_v0, actor->info.damage); if (actor->obj.id == OBJ_ACTOR_225) { - player->unk_0D8.y = 0.0f; + player->knockback.y = 0.0f; } } else { - actor->unk_0D0 = -1; + actor->dmgType = -1; } } } @@ -2007,7 +2007,7 @@ void func_play_800A8BA4(Player* player) { } for (i = 0, sprite = gSprites; i < ARRAY_COUNT(gSprites); i++, sprite++) { if (sprite->obj.status == OBJ_ACTIVE) { - if ((player->unk_138 - 200.0f) < sprite->obj.pos.z) { + if ((player->trueZpos - 200.0f) < sprite->obj.pos.z) { temp_v0 = func_play_800A7974(player, sprite->info.hitbox, &sp98, sprite->obj.pos.x, sprite->obj.pos.y, sprite->obj.pos.z, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); @@ -2015,7 +2015,7 @@ void func_play_800A8BA4(Player* player) { if ((sprite->obj.id == OBJ_SPRITE_FO_POLE) || (sprite->obj.id == OBJ_SPRITE_CO_POLE) || (sprite->obj.id == OBJ_SPRITE_TI_CACTUS) || (sprite->obj.id == OBJ_SPRITE_CO_TREE)) { sprite->unk_46 = 1; - player->unk_1F4 = 6; + player->hitTimer = 6; player->unk_21C = 0; } else { Player_ApplyDamage(player, temp_v0, sprite->info.damage); @@ -2047,20 +2047,20 @@ void func_play_800A8BA4(Player* player) { spC8.y = 7.0f; } spBC.y = spC8.x + spC8.y; - if ((fabsf(opponent->unk_138 - player->unk_138) <= spBC.z) && + if ((fabsf(opponent->trueZpos - player->trueZpos) <= spBC.z) && (fabsf(opponent->pos.y - player->pos.y) <= spBC.y) && (fabsf(opponent->pos.x - player->pos.x) <= spBC.x)) { if ((player->form == FORM_ON_FOOT) && (opponent->form == FORM_ON_FOOT)) { - player->pos.x = player->unk_090.x; - player->pos.y = player->unk_090.y; - player->pos.z = player->unk_138 = player->unk_090.z; - opponent->pos.x = opponent->unk_090.x; - opponent->pos.y = opponent->unk_090.y; - opponent->pos.z = opponent->unk_138 = opponent->unk_090.z; - player->unk_0D8.x = (player->pos.x - opponent->unk_090.x) * 0.5f; - player->unk_0D8.z = (player->unk_138 - opponent->unk_138) * 0.5f; - opponent->unk_0D8.x = -player->unk_0D8.x; - opponent->unk_0D8.z = -player->unk_0D8.z; + player->pos.x = player->basePos.x; + player->pos.y = player->basePos.y; + player->pos.z = player->trueZpos = player->basePos.z; + opponent->pos.x = opponent->basePos.x; + opponent->pos.y = opponent->basePos.y; + opponent->pos.z = opponent->trueZpos = opponent->basePos.z; + player->knockback.x = (player->pos.x - opponent->basePos.x) * 0.5f; + player->knockback.z = (player->trueZpos - opponent->trueZpos) * 0.5f; + opponent->knockback.x = -player->knockback.x; + opponent->knockback.z = -player->knockback.z; opponent->baseSpeed = player->baseSpeed = 2.0f; } else { func_play_800A8804(player, opponent); @@ -2073,20 +2073,20 @@ void func_play_800A8BA4(Player* player) { if (D_ctx_80178294 != 0) { if (func_play_800A73E4(&sp94, &sp90, player->hit4.x, player->hit4.y, player->hit4.z)) { if (gCurrentLevel == LEVEL_ZONESS) { - player->unk_0E4 = (player->baseSpeed + player->boostSpeed) * 0.8f; - player->unk_1F4 = 15; + player->rot.x = (player->baseSpeed + player->boostSpeed) * 0.8f; + player->hitTimer = 15; func_effect_8007B228(player->hit4.x, sp94, player->hit4.z, 1.0f); } else { - if (player->unk_1F4 == 0) { + if (player->hitTimer == 0) { Player_ApplyDamage(player, 4, 10); } - player->unk_0D8.y = 30.0f; - player->unk_0E4 = (player->baseSpeed + player->boostSpeed) * 0.8f; + player->knockback.y = 30.0f; + player->rot.x = (player->baseSpeed + player->boostSpeed) * 0.8f; } if (player->state_1C8 == PLAYERSTATE_1C8_DOWN) { - player->timer_220 = 2; - func_effect_8007AFD0(player->pos.x, player->unk_138, 30.0f, 0.0f, 5.0f); - func_effect_8007AFD0(player->pos.x, player->unk_138, -30.0f, 0.0f, 5.0f); + player->radioDamageTimer = 2; + func_effect_8007AFD0(player->pos.x, player->trueZpos, 30.0f, 0.0f, 5.0f); + func_effect_8007AFD0(player->pos.x, player->trueZpos, -30.0f, 0.0f, 5.0f); } } if (func_play_800A73E4(&sp94, &sp90, player->pos.x + ((player->hit1.x - player->pos.x) * 1.5f), @@ -2095,10 +2095,10 @@ void func_play_800A8BA4(Player* player) { func_effect_8007B228(player->pos.x + (player->hit1.x - player->pos.x) * 1.5f, sp94, player->hit1.z, 1.0f); } else { - if (player->unk_1F4 == 0) { + if (player->hitTimer == 0) { Player_ApplyDamage(player, 1, 10); } - player->unk_0D8.y = 30.0f; + player->knockback.y = 30.0f; } } if (func_play_800A73E4(&sp94, &sp90, player->pos.x + ((player->hit2.x - player->pos.x) * 1.5f), @@ -2107,10 +2107,10 @@ void func_play_800A8BA4(Player* player) { func_effect_8007B228(player->pos.x + (player->hit2.x - player->pos.x) * 1.5f, sp94, player->hit2.z, 1.0f); } else { - if (player->unk_1F4 == 0) { + if (player->hitTimer == 0) { Player_ApplyDamage(player, 2, 40); } - player->unk_0D8.y = 30.0f; + player->knockback.y = 30.0f; } } } @@ -2150,18 +2150,18 @@ void func_play_800AA800(Player* player) { s32 pad4; if (player->unk_240 == 0) { - player->unk_064 = player->pos.x; - player->unk_06C = player->unk_138 - player->pos.y; + player->groundPos.x = player->pos.x; + player->groundPos.z = player->trueZpos - player->pos.y; if (gGroundType != 4) { if (gCamCount == 1) { - player->unk_068 = gGroundHeight + 3.0f; + player->groundPos.y = gGroundHeight + 3.0f; } else { - player->unk_068 = gGroundHeight; + player->groundPos.y = gGroundHeight; if (player->form == FORM_ON_FOOT) { - player->unk_06C = player->unk_138; + player->groundPos.z = player->trueZpos; } } - player->unk_248 = player->unk_24C = player->unk_070 = 0.0f; + player->unk_248 = player->unk_24C = player->groundRotY = 0.0f; } sp100 = 0.0f; spFC = 0.0f; @@ -2174,13 +2174,13 @@ void func_play_800AA800(Player* player) { ((scenery360->obj.id == OBJ_SCENERY_143) || (scenery360->obj.id == OBJ_SCENERY_140) || (scenery360->obj.id == OBJ_SCENERY_141)) && (fabsf(scenery360->obj.pos.x - player->pos.x) < 2000.0f) && - (fabsf(scenery360->obj.pos.z - player->unk_138) < 2000.0f)) { + (fabsf(scenery360->obj.pos.z - player->trueZpos) < 2000.0f)) { spC8.x = scenery360->obj.pos.x; spC8.y = scenery360->obj.pos.y; spC8.z = scenery360->obj.pos.z; spD4.x = player->pos.x; spD4.y = gGroundHeight; - spD4.z = player->unk_138; + spD4.z = player->trueZpos; colId = COL2_4; if (scenery360->obj.id == OBJ_SCENERY_141) { colId = COL2_6; @@ -2188,7 +2188,7 @@ void func_play_800AA800(Player* player) { colId = COL2_17; } if (func_col2_800A3690(&spD4, &spC8, colId, &spBC)) { - player->unk_068 = spBC.y + 1.0f; + player->groundPos.y = spBC.y + 1.0f; player->unk_248 = spBC.x; player->unk_24C = spBC.z; break; @@ -2198,15 +2198,15 @@ void func_play_800AA800(Player* player) { } } else { if ((gLevelMode == LEVELMODE_ALL_RANGE) && (gLevelType == LEVELTYPE_PLANET)) { - player->unk_064 = player->pos.x; - player->unk_06C = player->unk_138; + player->groundPos.x = player->pos.x; + player->groundPos.z = player->trueZpos; for (sp144 = 0, scenery360 = gScenery360; sp144 < 200; sp144++, scenery360++) { if ((scenery360->obj.status == OBJ_ACTIVE) && ((scenery360->obj.id == OBJ_SCENERY_150) || (scenery360->obj.id == OBJ_SCENERY_149) || (scenery360->obj.id == OBJ_SCENERY_148) || (scenery360->obj.id == OBJ_SCENERY_1) || (scenery360->obj.id == OBJ_SCENERY_3)) && (fabsf(scenery360->obj.pos.x - player->pos.x) < 2500.0f) && - (fabsf(scenery360->obj.pos.z - player->unk_138) < 2500.0f)) { + (fabsf(scenery360->obj.pos.z - player->trueZpos) < 2500.0f)) { tempx = scenery360->obj.pos.x; tempy = scenery360->obj.pos.y; tempz = scenery360->obj.pos.z; @@ -2214,7 +2214,7 @@ void func_play_800AA800(Player* player) { Matrix_RotateY(gCalcMatrix, -sp120 * M_DTOR, MTXF_NEW); spEC.x = player->pos.x - tempx; spEC.y = 0.0f; - spEC.z = player->unk_138 - tempz; + spEC.z = player->trueZpos - tempz; Matrix_MultVec3fNoTranslate(gCalcMatrix, &spEC, &spE0); spD4.x = spE0.x + tempx; spD4.y = spE0.y + tempy; @@ -2230,10 +2230,10 @@ void func_play_800AA800(Player* player) { colId = COL1_6; } if (func_col1_800998FC(&spD4, &spC8, &sp9C, colId, &spB0, spA8) > 0) { - player->unk_068 = spB0.y; + player->groundPos.y = spB0.y; player->unk_248 = spA8[0]; player->unk_24C = spA8[1]; - player->unk_070 = DEG_TO_RAD(sp120); + player->groundRotY = DEG_TO_RAD(sp120); } } else { colId = COL2_0; @@ -2241,10 +2241,10 @@ void func_play_800AA800(Player* player) { colId = COL2_3; } if (func_col2_800A3690(&spD4, &spC8, colId, &spBC)) { - player->unk_068 = spBC.y; + player->groundPos.y = spBC.y; player->unk_248 = spBC.x; player->unk_24C = spBC.z; - player->unk_070 = DEG_TO_RAD(sp120); + player->groundRotY = DEG_TO_RAD(sp120); } } } @@ -2253,7 +2253,7 @@ void func_play_800AA800(Player* player) { for (sp144 = 0, scenery = gScenery; (sp144 < 50) && (gLevelMode == LEVELMODE_ON_RAILS) && (gCurrentLevel != LEVEL_VENOM_1); sp144++, scenery++) { - if ((scenery->obj.status == OBJ_ACTIVE) && ((player->unk_138 - 3000.0f) < scenery->obj.pos.z) && + if ((scenery->obj.status == OBJ_ACTIVE) && ((player->trueZpos - 3000.0f) < scenery->obj.pos.z) && (scenery->obj.id != OBJ_SCENERY_0) && (scenery->obj.id != OBJ_SCENERY_8)) { tempx = scenery->obj.pos.x; tempy = scenery->obj.pos.y; @@ -2266,7 +2266,7 @@ void func_play_800AA800(Player* player) { for (var_fs1 = var_fs0 = -50.0f; var_fs0 > -500.0f; var_fs0 -= 5.0f, var_fs1 -= 5.0f) { spEC.x = player->pos.x - tempx; spEC.y = player->pos.y + var_fs0 - tempy; - spEC.z = player->unk_138 + var_fs1 - tempz; + spEC.z = player->trueZpos + var_fs1 - tempz; Matrix_MultVec3fNoTranslate(gCalcMatrix, &spEC, &spE0); if ((player->pos.y + var_fs0) <= gGroundHeight) { break; @@ -2291,11 +2291,11 @@ void func_play_800AA800(Player* player) { colId = COL2_1; } if (func_col2_800A3690(&spD4, &spC8, colId, &spBC)) { - player->unk_068 = spBC.y; - player->unk_06C = player->unk_138 + var_fs1; + player->groundPos.y = spBC.y; + player->groundPos.z = player->trueZpos + var_fs1; player->unk_248 = spBC.x; player->unk_24C = spBC.z; - player->unk_070 = DEG_TO_RAD(sp120); + player->groundRotY = DEG_TO_RAD(sp120); break; } } @@ -2328,7 +2328,7 @@ void func_play_800AA800(Player* player) { for (var_fs0 = var_fs1 = -50.0f; var_fs0 > -500.0f; var_fs0 -= 5.0f, var_fs1 -= 5.0f) { spEC.x = player->pos.x - tempx; spEC.y = player->pos.y + var_fs0 - tempy; - spEC.z = player->unk_138 + var_fs1 - tempz; + spEC.z = player->trueZpos + var_fs1 - tempz; Matrix_MultVec3fNoTranslate(gCalcMatrix, &spEC, &spE0); tempx2 = spE0.x + tempx; tempy2 = spE0.y + tempy; @@ -2338,11 +2338,11 @@ void func_play_800AA800(Player* player) { } if (func_play_800A78C4(hitbox, tempx, tempy, tempz, tempx2, tempy2, tempz2)) { - if (gGroundHeight < player->unk_068) { - player->unk_068 = spEC.y + 15.0f + tempy; - player->unk_06C = spEC.z + 10.0f + tempz; + if (gGroundHeight < player->groundPos.y) { + player->groundPos.y = spEC.y + 15.0f + tempy; + player->groundPos.z = spEC.z + 10.0f + tempz; player->unk_248 = DEG_TO_RAD(sp100); - player->unk_070 = DEG_TO_RAD(sp120); + player->groundRotY = DEG_TO_RAD(sp120); } break; } @@ -2561,7 +2561,7 @@ void Play_Init(void) { Audio_KillSfxById(0x11403076); Audio_KillSfxById(0x49000014); Memory_FreeAll(); - D_ctx_80177C78 = D_ctx_80177C8C = gShowBossHealth = gStarWolfMsgTimer = gAllRangeWingRepairTimer = + gTraining360MsgTimer = gTraining360MsgIndex = gShowBossHealth = gStarWolfMsgTimer = gAllRangeWingRepairTimer = gAllRangeSuppliesSent = 0; D_display_800CA220 = 0; gShowLevelClearStatusScreen = 0; @@ -2573,7 +2573,7 @@ void Play_Init(void) { gAqDrawMode = D_800D2F54 = 0; D_display_800CA230 = D_800D2F58 = 0.0f; gLevelMode = LEVELMODE_ON_RAILS; - D_ctx_80177CE8 = D_bg_8015F968 = 0.0f; + gPathTexScroll = D_bg_8015F968 = 0.0f; D_hud_800D1970 = gVersusMode = gHideRadio = gChangeTo360 = false; if (gCurrentLevel >= LEVEL_FORTUNA) { gLevelMode = LEVELMODE_ALL_RANGE; @@ -2647,7 +2647,7 @@ void Play_Init(void) { gPlayer[i].state_1C8 = PLAYERSTATE_1C8_INIT; gPlayerGlareAlphas[i] = D_ctx_801783C0[i] = 0; gControllerRumbleTimers[i] = 0; - D_ctx_80177C30[i] = 0; + gPlayerScores[i] = 0; } if (gLevelMode == LEVELMODE_ALL_RANGE) { MEM_ARRAY_ALLOCATE(gScenery360, 200); @@ -2656,7 +2656,7 @@ void Play_Init(void) { } switch (gCurrentLevel) { case LEVEL_SECTOR_Z: - if (D_ctx_8017782C == 0) { + if (!D_ctx_8017782C) { SectorZ_8019EA68(); ActorAllRange_SpawnTeam(); } @@ -2667,12 +2667,12 @@ void Play_Init(void) { break; case LEVEL_KATINA: Katina_80198930(); - if (D_ctx_8017782C == 0) { + if (!D_ctx_8017782C) { ActorAllRange_SpawnTeam(); } break; case LEVEL_BOLSE: - if (D_ctx_8017782C == 0) { + if (!D_ctx_8017782C) { Bolse_80191ED8(); ActorAllRange_SpawnTeam(); } @@ -2707,10 +2707,10 @@ void func_play_800AC290(Player* player, PlayerShot* shot, f32 arg2, f32 arg3, Pl Vec3f sp2C; PlayerShot_Initialize(shot); - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0) * M_DTOR), MTXF_APPLY); - Matrix_Translate(gCalcMatrix, player->unk_084, player->unk_080, 0.0f, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->xRot_120 + player->rot.x + player->aerobaticPitch) * M_DTOR), MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -((player->bankAngle + player->rockAngle) * M_DTOR), MTXF_APPLY); + Matrix_Translate(gCalcMatrix, player->xShake, player->yBob, 0.0f, MTXF_APPLY); if (gVersusMode && (shotId <= PLAYERSHOT_1)) { speed *= 0.5f; } @@ -2737,27 +2737,27 @@ void func_play_800AC290(Player* player, PlayerShot* shot, f32 arg2, f32 arg3, Pl if (shot->obj.id == PLAYERSHOT_4) { shot->obj.pos.x = player->pos.x + sp2C.x; shot->obj.pos.y = player->pos.y + sp2C.y; - shot->obj.pos.z = player->unk_138 + sp2C.z; + shot->obj.pos.z = player->trueZpos + sp2C.z; shot->unk_64 = 38; } else { shot->obj.pos.x = player->pos.x + sp2C.x + (sp38.x * 1.2); shot->obj.pos.y = player->pos.y + sp2C.y + (sp38.y * 1.2); - shot->obj.pos.z = player->unk_138 + sp2C.z + (sp38.z * 1.2f); + shot->obj.pos.z = player->trueZpos + sp2C.z + (sp38.z * 1.2f); } - shot->obj.rot.x = player->unk_120 + player->unk_0E4 + player->unk_4D8; - shot->obj.rot.y = player->unk_0E8 + player->unk_114; - shot->obj.rot.z = player->unk_0F8; + shot->obj.rot.x = player->xRot_120 + player->rot.x + player->aerobaticPitch; + shot->obj.rot.y = player->rot.y + player->yRot_114; + shot->obj.rot.z = player->bankAngle; if (shotId == PLAYERSHOT_8) { if (gCurrentLevel == LEVEL_AQUAS) { shot->unk_58 = RAND_INT(360.0f); shot->unk_60 = RAND_INT(360.0f); - shot->unk_2C = player->unk_0E4 + player->unk_4D8; - shot->unk_30 = player->unk_0E8; - shot->unk_34 = player->unk_0F8; + shot->vec_2C.x = player->rot.x + player->aerobaticPitch; + shot->vec_2C.y = player->rot.y; + shot->vec_2C.z = player->bankAngle; shot->unk_5C = D_ctx_80178494; } else { - shot->unk_30 = player->unk_0E8 + player->unk_114; - shot->unk_2C = player->unk_0E4 + player->unk_4D8; + shot->vec_2C.y = player->rot.y + player->yRot_114; + shot->vec_2C.x = player->rot.x + player->aerobaticPitch; if (speed <= 65.0f) { shot->unk_5C = 1; } @@ -2773,11 +2773,11 @@ void func_play_800AC650(Player* player, PlayerShot* shot, PlayerShotId shotId, f Vec3f sp3C; PlayerShot_Initialize(shot); - Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, MTXF_NEW); - Matrix_RotateZ(gCalcMatrix, (player->unk_0EC + player->unk_0F0) * M_DTOR, MTXF_APPLY); - Matrix_RotateY(gCalcMatrix, player->unk_114 * M_DTOR, MTXF_APPLY); - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, (-player->unk_12C - player->unk_130) * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, player->rot.x * M_DTOR, MTXF_NEW); + Matrix_RotateZ(gCalcMatrix, (player->rot.z + player->rockAngle) * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, player->yRot_114 * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->rot.y + 180.0f) * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, (-player->zRotBank - player->zRotBarrelRoll) * M_DTOR, MTXF_APPLY); Matrix_RotateY(gCalcMatrix, -player->unk_180 * M_DTOR, MTXF_APPLY); Matrix_RotateX(gCalcMatrix, player->unk_17C * M_DTOR, MTXF_APPLY); sp54.x = 0; @@ -2785,13 +2785,13 @@ void func_play_800AC650(Player* player, PlayerShot* shot, PlayerShotId shotId, f sp54.z = speed; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp54, &sp48); Matrix_Translate(gCalcMatrix, 0.0f, player->unk_18C + 30.0f, 0, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, (player->unk_0EC + player->unk_0F0) * M_DTOR, MTXF_APPLY); - Matrix_RotateY(gCalcMatrix, player->unk_114 * M_DTOR, MTXF_APPLY); - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, (-player->unk_12C - player->unk_130) * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, player->rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, (player->rot.z + player->rockAngle) * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, player->yRot_114 * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->rot.y + 180.0f) * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, (-player->zRotBank - player->zRotBarrelRoll) * M_DTOR, MTXF_APPLY); Matrix_Translate(gCalcMatrix, 0.0f, -30.0f, 0, MTXF_APPLY); - Matrix_Translate(gCalcMatrix, player->unk_084, player->unk_080, 0.0f, MTXF_APPLY); + Matrix_Translate(gCalcMatrix, player->xShake, player->yBob, 0.0f, MTXF_APPLY); Matrix_Translate(gCalcMatrix, 0.0f, 51.0f, -4.0f, MTXF_APPLY); Matrix_RotateY(gCalcMatrix, -player->unk_180 * M_DTOR, MTXF_APPLY); Matrix_RotateX(gCalcMatrix, player->unk_17C * M_DTOR, MTXF_APPLY); @@ -2804,14 +2804,14 @@ void func_play_800AC650(Player* player, PlayerShot* shot, PlayerShotId shotId, f shot->vel.z = sp48.z; shot->obj.pos.x = player->pos.x + sp3C.x; shot->obj.pos.y = player->pos.y + sp3C.y; - shot->obj.pos.z = player->unk_138 + sp3C.z; + shot->obj.pos.z = player->trueZpos + sp3C.z; shot->obj.status = 1; - shot->unk_2C = -player->unk_17C; - shot->unk_30 = -player->unk_180; - shot->unk_34 = player->unk_12C; - shot->obj.rot.x = player->unk_0E4 + player->unk_120; - shot->obj.rot.y = player->unk_0E8 + player->unk_114; - shot->obj.rot.z = player->unk_0EC; + shot->vec_2C.x = -player->unk_17C; + shot->vec_2C.y = -player->unk_180; + shot->vec_2C.z = player->zRotBank; + shot->obj.rot.x = player->rot.x + player->xRot_120; + shot->obj.rot.y = player->rot.y + player->yRot_114; + shot->obj.rot.z = player->rot.z; shot->unk_64 = 40; shot->obj.id = shotId; @@ -2821,7 +2821,7 @@ void func_play_800AC650(Player* player, PlayerShot* shot, PlayerShotId shotId, f shot->unk_5C = 1; } shot->unk_64 = 30; - shot->unk_30 = player->unk_0E8 + player->unk_114; + shot->vec_2C.y = player->rot.y + player->yRot_114; } } @@ -2851,7 +2851,7 @@ void func_play_800ACABC(Player* player) { if (gPlayerShots[i].obj.status == 0) { func_play_800AC290(player, &gPlayerShots[i], 0.0f, 0.0f, PLAYERSHOT_0, 400.0f / 3.0f); func_play_800A5FA0(player->sfxSource, 0x09400000, player->num); - D_ctx_80177AA0[player->num] = 0.5f; + gMuzzleFlashScale[player->num] = 0.5f; break; } } @@ -2863,10 +2863,10 @@ void func_play_800ACABC(Player* player) { func_play_800AC290(player, &gPlayerShots[i], 0.0f, -10.0f, PLAYERSHOT_1, 400.0f / 3.0f); if (laser == LASERS_TWIN) { func_play_800A5FA0(player->sfxSource, 0x0940800C, player->num); - D_ctx_80177AA0[player->num] = 0.5f; + gMuzzleFlashScale[player->num] = 0.5f; } else { func_play_800A5FA0(player->sfxSource, 0x0940802B, player->num); - D_ctx_80177AA0[player->num] = 0.75f; + gMuzzleFlashScale[player->num] = 0.75f; } break; } @@ -2904,9 +2904,9 @@ void func_play_800ACDC0(Player* player, PlayerShot* shot, PlayerShotId shotId) { Vec3f sp44; PlayerShot_Initialize(shot); - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -((player->unk_0E4 + player->unk_134) * M_DTOR), MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + player->damageShake + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->rot.x + player->damageShake) * M_DTOR), MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -((player->bankAngle + player->rockAngle + player->damageShake) * M_DTOR), MTXF_APPLY); Matrix_RotateX(gCalcMatrix, player->unk_154 * M_DTOR, MTXF_APPLY); sp5C.x = 0.0f; sp5C.y = 0.0f; @@ -2916,10 +2916,10 @@ void func_play_800ACDC0(Player* player, PlayerShot* shot, PlayerShotId shotId) { sp5C.z = 150.0f; } Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp5C, &sp50); - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -((player->unk_0E4 + player->unk_134) * M_DTOR), MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), MTXF_APPLY); - Matrix_Translate(gCalcMatrix, 0.0f, player->unk_080, 0, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + player->damageShake + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->rot.x + player->damageShake) * M_DTOR), MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -((player->bankAngle + player->rockAngle + player->damageShake) * M_DTOR), MTXF_APPLY); + Matrix_Translate(gCalcMatrix, 0.0f, player->yBob, 0, MTXF_APPLY); Matrix_Translate(gCalcMatrix, -10.0f, 25.0f, 0.0f, MTXF_APPLY); Matrix_RotateX(gCalcMatrix, player->unk_154 * M_DTOR, MTXF_APPLY); sp5C.x = 0.0f; @@ -2931,9 +2931,9 @@ void func_play_800ACDC0(Player* player, PlayerShot* shot, PlayerShotId shotId) { shot->vel.z = sp50.z; shot->obj.pos.x = player->pos.x + sp44.x; shot->obj.pos.y = player->pos.y + sp44.y; - shot->obj.pos.z = player->unk_138 + sp44.z; + shot->obj.pos.z = player->trueZpos + sp44.z; - shot->unk_44 = 1.0f; + shot->scale = 1.0f; shot->obj.status = 1; shot->obj.id = shotId; @@ -2950,7 +2950,7 @@ void func_play_800AD094(Player* player) { if (gPlayerShots[i].obj.status == 0) { func_play_800ACDC0(player, &gPlayerShots[i], PLAYERSHOT_6); func_play_800A5FA0(player->sfxSource, 0x09000014, player->num); - player->timer_1F8 = 2; + player->csTimer = 2; player->unk_180 = 10.0f; break; } @@ -3035,7 +3035,7 @@ bool func_play_800AD1F4(Player* player) { if ((gPlayerShots[14 - player->num].obj.status == 0) || (gPlayerShots[14 - player->num].obj.id != PLAYERSHOT_8) || ((gPlayerShots[14 - player->num].obj.id == PLAYERSHOT_8) && - (gPlayerShots[14 - player->num].unk_44 > 1.0f))) { + (gPlayerShots[14 - player->num].scale > 1.0f))) { if (player->form == FORM_ARWING) { func_play_800AC290(player, &gPlayerShots[14 - player->num], 0.0f, 0.0f, PLAYERSHOT_8, 70.0f); } else { @@ -3148,7 +3148,7 @@ void func_play_800ADA28(Player* player) { if ((gInputHold->button & Z_TRIG) && !(gInputHold->button & R_TRIG)) { sp3C = 90.0f; sp38 = 0.2f; - if (player->unk_12C < 70.0f) { + if (player->zRotBank < 70.0f) { Math_SmoothStepToF(&player->wings.unk_04, -70.0f, 0.3f, 100.0f, 0.0f); Math_SmoothStepToF(&player->wings.unk_08, -70.0f, 0.3f, 100.0f, 0.f); Math_SmoothStepToF(&player->wings.unk_0C, 70.0f, 0.3f, 100.0f, 0.f); @@ -3162,7 +3162,7 @@ void func_play_800ADA28(Player* player) { if ((gInputHold->button & R_TRIG) && !(gInputHold->button & Z_TRIG)) { sp3C = -90.0f; sp38 = 0.2f; - if (player->unk_12C > -70.0f) { + if (player->zRotBank > -70.0f) { Math_SmoothStepToF(&player->wings.unk_04, 70.0f, 0.3f, 100.0f, 0.0f); Math_SmoothStepToF(&player->wings.unk_08, 70.0f, 0.3f, 100.0f, 0.0f); Math_SmoothStepToF(&player->wings.unk_0C, -70.0f, 0.3f, 100.0f, 0.0f); @@ -3172,27 +3172,27 @@ void func_play_800ADA28(Player* player) { } } } - Math_SmoothStepToF(&player->unk_12C, sp3C, sp38, 10.0f, 0.f); + Math_SmoothStepToF(&player->zRotBank, sp3C, sp38, 10.0f, 0.f); if (gInputPress->button & Z_TRIG) { player->sfx.bank = 1; - if (player->timer_1E0 != 0) { - player->unk_1DC = 1; + if (player->barrelInputTimerL != 0) { + player->barrelRoll = 1; player->timer_1E8 = 10; - player->unk_1EC = player->unk_1F0 = 30; + player->rollRate = player->baseRollRate = 30; player->sfx.roll = 1; } else { - player->timer_1E0 = 10; + player->barrelInputTimerL = 10; } } if (gInputPress->button & R_TRIG) { player->sfx.bank = 1; - if (player->timer_1E4 != 0) { - player->unk_1DC = 1; + if (player->barrelInputTimerR != 0) { + player->barrelRoll = 1; player->timer_1E8 = 10; - player->unk_1EC = player->unk_1F0 = -30; + player->rollRate = player->baseRollRate = -30; player->sfx.roll = 1; } else { - player->timer_1E4 = 10; + player->barrelInputTimerR = 10; } } } @@ -3201,25 +3201,25 @@ void func_play_800ADD98(Player* player) { Math_SmoothStepToF(&player->unk_170, 0.0f, 1.0f, 0.2f, 0.0f); Math_SmoothStepToF(&player->unk_16C, 0.0f, 1.0f, 0.2f, 0.0f); if (gInputPress->button & Z_TRIG) { - if ((player->timer_1E0 != 0) && (player->unk_12C > 0.0f) && (player->boostMeter < 10.0f)) { - player->unk_1DC = 1; + if ((player->barrelInputTimerL != 0) && (player->zRotBank > 0.0f) && (player->boostMeter < 10.0f)) { + player->barrelRoll = 1; player->timer_1E8 = 15; - player->unk_1EC = player->unk_1F0 = 20; + player->rollRate = player->baseRollRate = 20; } else { - player->timer_1E0 = 10; + player->barrelInputTimerL = 10; } } if (gInputPress->button & R_TRIG) { - if ((player->timer_1E4 != 0) && (player->unk_12C < 0.0f) && (player->boostMeter < 10.0f)) { - player->unk_1DC = 1; + if ((player->barrelInputTimerR != 0) && (player->zRotBank < 0.0f) && (player->boostMeter < 10.0f)) { + player->barrelRoll = 1; player->timer_1E8 = 15; - player->unk_1EC = player->unk_1F0 = -20; + player->rollRate = player->baseRollRate = -20; } else { - player->timer_1E4 = 10; + player->barrelInputTimerR = 10; } } - player->unk_18C = fabsf(SIN_DEG(player->unk_12C) * 25.0f); - player->unk_18C += fabsf(SIN_DEG(player->unk_130) * 20.0f); + player->unk_18C = fabsf(SIN_DEG(player->zRotBank) * 25.0f); + player->unk_18C += fabsf(SIN_DEG(player->zRotBarrelRoll) * 20.0f); } void func_play_800ADF58(Player* player) { @@ -3227,53 +3227,53 @@ void func_play_800ADF58(Player* player) { f32 temp_fv0_2; s32 temp_v0; - player->unk_140 = -player->vel.z; - player->unk_144 += -player->vel.z; - D_ctx_80177D08 = -player->vel.z; - D_ctx_80177D20 = player->unk_144; - D_ctx_80177CE8 += player->unk_140; + player->zPathVel = -player->vel.z; + player->zPath += -player->vel.z; + gPathVelZ = -player->vel.z; + gPathProgress = player->zPath; + gPathTexScroll += player->zPathVel; if (gGroundType == 4) { - D_ctx_80177CC8 = player->unk_140; + gPathGroundScroll = player->zPathVel; } - if ((gBossActive == 0) && (player->unk_144 > 500000.0f)) { - player->unk_144 = 0.0f; + if ((gBossActive == 0) && (player->zPath > 500000.0f)) { + player->zPath = 0.0f; player->pos.z = 0.0f; gObjectLoadIndex = 0; Play_ClearObjectData(); } - player->unk_138 = player->pos.z + player->unk_08C; - player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; + player->trueZpos = player->pos.z + player->camDist; + player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll; while (1) { - if (player->unk_0F8 > 360.0f) { - player->unk_0F8 -= 360.0f; + if (player->bankAngle > 360.0f) { + player->bankAngle -= 360.0f; } else { break; } } while (1) { - if (player->unk_0F8 < -360.0f) { - player->unk_0F8 += 360.0f; + if (player->bankAngle < -360.0f) { + player->bankAngle += 360.0f; } else { break; } } if (gCurrentLevel == LEVEL_UNK_15) { - Math_SmoothStepToF(&player->unk_0B4, 10.0f, 0.1f, 0.5f, 0.0001f); - player->pos.x += Math_SmoothStepToF(&player->unk_0AC, player->unk_0B8, 0.1f, player->unk_0B4, 0.0001f); - player->pos.y += Math_SmoothStepToF(&player->unk_0B0, player->unk_0BC, 0.1f, player->unk_0B4, 0.0001f); + Math_SmoothStepToF(&player->pathStep, 10.0f, 0.1f, 0.5f, 0.0001f); + player->pos.x += Math_SmoothStepToF(&player->xPath, player->xPathTarget, 0.1f, player->pathStep, 0.0001f); + player->pos.y += Math_SmoothStepToF(&player->yPath, player->yPathTarget, 0.1f, player->pathStep, 0.0001f); } else { - Math_SmoothStepToF(&player->unk_0B4, D_ctx_80177D08 * 0.54f, 0.1f, 2.0f, 0.0001f); - D_ctx_801779E4 = Math_SmoothStepToF(&player->unk_0AC, player->unk_0B8, 0.1f, player->unk_0B4, 0.0001f); - D_ctx_801779F4 = Math_SmoothStepToF(&player->unk_0B0, player->unk_0BC, 0.1f, player->unk_0B4, 0.0001f); + Math_SmoothStepToF(&player->pathStep, gPathVelZ * 0.54f, 0.1f, 2.0f, 0.0001f); + gPathVelX = Math_SmoothStepToF(&player->xPath, player->xPathTarget, 0.1f, player->pathStep, 0.0001f); + gPathVelY = Math_SmoothStepToF(&player->yPath, player->yPathTarget, 0.1f, player->pathStep, 0.0001f); } if (player->timer_210 != 0) { player->timer_210--; - Math_SmoothStepToF(&player->unk_114, player->unk_118, 0.03f, 0.5f, 0.0001f); - Math_SmoothStepToF(&player->unk_120, player->unk_124, 0.03f, 0.5f, 0.0001f); + Math_SmoothStepToF(&player->yRot_114, player->yRot_118, 0.03f, 0.5f, 0.0001f); + Math_SmoothStepToF(&player->xRot_120, player->xRot_124, 0.03f, 0.5f, 0.0001f); } else { - Math_SmoothStepToF(&player->unk_114, 0.0f, 0.03f, 0.5f, 0.0001f); - Math_SmoothStepToF(&player->unk_120, 0.0f, 0.03f, 0.5f, 0.0001f); + Math_SmoothStepToF(&player->yRot_114, 0.0f, 0.03f, 0.5f, 0.0001f); + Math_SmoothStepToF(&player->xRot_120, 0.0f, 0.03f, 0.5f, 0.0001f); } } @@ -3325,7 +3325,7 @@ void func_play_800AE278(Player* player) { if ((var_fv1 < fabsf(player->pos.x)) || (var_fv1 < fabsf(player->pos.z))) { player->state_1C8 = PLAYERSTATE_1C8_U_TURN; player->unk_19C = 0; - player->unk_1D0 = 0; + player->csState = 0; player->unk_000 = 0.0f; player->unk_004 = 0.0f; } @@ -3335,7 +3335,7 @@ void func_play_800AE278(Player* player) { void func_play_800AE4A4(Player* player) { f32 sp7C; f32 sp78; - f32 var_fa0; + f32 scale; f32 var_fa1; f32 var_fv0; f32 var_fv1; @@ -3346,12 +3346,12 @@ void func_play_800AE4A4(Player* player) { Vec3f sp4C; Vec3f sp40; - D_ctx_80177968 = 2.3f; - D_ctx_80177970 = 0.68f; + gPlayerTurnRate = 2.3f; + gPlayerTurnStickMod = 0.68f; sp7C = -gInputPress->stick_x; sp78 = gInputPress->stick_y; - Math_SmoothStepToAngle(&player->unk_4D8, 0.0f, 0.1f, 5.0f, 0.01f); - Matrix_RotateZ(gCalcMatrix, -player->unk_12C * M_DTOR, MTXF_NEW); + Math_SmoothStepToAngle(&player->aerobaticPitch, 0.0f, 0.1f, 5.0f, 0.01f); + Matrix_RotateZ(gCalcMatrix, -player->zRotBank * M_DTOR, MTXF_NEW); sp4C.x = sp7C * 0.75f; sp4C.y = sp78 * 0.75f; sp4C.z = 0.0f; @@ -3370,40 +3370,40 @@ void func_play_800AE4A4(Player* player) { Math_SmoothStepToF(&player->wings.unk_08, -sp60 - sp5C, 0.1f, 100.0f, 0.0f); Math_SmoothStepToF(&player->wings.unk_0C, -sp60 + sp58, 0.1f, 100.0f, 0.0f); Math_SmoothStepToF(&player->wings.unk_10, -sp60 - sp58, 0.1f, 100.0f, 0.0f); - var_fa0 = 0.1f; - if ((player->unk_12C > 10.0f) && (sp7C > 0)) { - D_ctx_80177968 *= 2.0f; - var_fa0 = 0.2f; + scale = 0.1f; + if ((player->zRotBank > 10.0f) && (sp7C > 0)) { + gPlayerTurnRate *= 2.0f; + scale = 0.2f; } - if ((player->unk_12C < -10.0f) && (sp7C < 0)) { - D_ctx_80177968 *= 2.0f; - var_fa0 = 0.2f; + if ((player->zRotBank < -10.0f) && (sp7C < 0)) { + gPlayerTurnRate *= 2.0f; + scale = 0.2f; } - Math_SmoothStepToF(&player->unk_0E8, sp7C * D_ctx_80177970, var_fa0, D_ctx_80177968, 0.03f); - var_fa0 = 0.03f; - if ((player->unk_12C > 10.0f) && (sp7C > 0)) { - var_fa0 = 0.05f; + Math_SmoothStepToF(&player->rot.y, sp7C * gPlayerTurnStickMod, scale, gPlayerTurnRate, 0.03f); + scale = 0.03f; + if ((player->zRotBank > 10.0f) && (sp7C > 0)) { + scale = 0.05f; } - if ((player->unk_12C < -10.0f) && (sp7C < 0)) { - var_fa0 = 0.05f; + if ((player->zRotBank < -10.0f) && (sp7C < 0)) { + scale = 0.05f; } - Math_SmoothStepToF(&player->unk_11C, player->unk_0E8 * var_fa0, 0.1f, 0.8f, 0.05f); - player->unk_114 += player->unk_11C; - if (player->unk_114 >= 360.0f) { - player->unk_114 -= 360.0f; + Math_SmoothStepToF(&player->yRotVel_11C, player->rot.y * scale, 0.1f, 0.8f, 0.05f); + player->yRot_114 += player->yRotVel_11C; + if (player->yRot_114 >= 360.0f) { + player->yRot_114 -= 360.0f; } - if (player->unk_114 < 0.0f) { - player->unk_114 += 360.0f; + if (player->yRot_114 < 0.0f) { + player->yRot_114 += 360.0f; } - D_ctx_80177968 = 2.3f; + gPlayerTurnRate = 2.3f; var_fa1 = 0.1f; - temp = -sp78 * D_ctx_80177970; + temp = -sp78 * gPlayerTurnStickMod; if ((temp <= 0.0f) && (player->pos.y < (gGroundHeight + 50.0f))) { - D_ctx_80177968 *= 2.0f; + gPlayerTurnRate *= 2.0f; temp = 0.0f; var_fa1 = 0.2f; } - Math_SmoothStepToF(&player->unk_0E4, temp, var_fa1, D_ctx_80177968, 0.03f); + Math_SmoothStepToF(&player->rot.x, temp, var_fa1, gPlayerTurnRate, 0.03f); var_fv1 = 1.5f; if (player->pos.y < (gGroundHeight + 70.0f)) { var_fv1 = 0.8f; @@ -3416,10 +3416,10 @@ void func_play_800AE4A4(Player* player) { if (sp7C == 0) { var_fv0 = 1.0f; } - Math_SmoothStepToF(&player->unk_0EC, sp7C * 0.6f * var_fv1, 0.1f, var_fv0, 0.03f); - player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); + Math_SmoothStepToF(&player->rot.z, sp7C * 0.6f * var_fv1, 0.1f, var_fv0, 0.03f); + player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll; + Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->xRot_120 + player->rot.x + player->aerobaticPitch) * M_DTOR), MTXF_APPLY); sp4C.x = 0.0f; sp4C.y = 0.0f; if (player->wings.rightState <= WINGSTATE_BROKEN) { @@ -3437,25 +3437,25 @@ void func_play_800AE4A4(Player* player) { player->vel.y = sp40.y; player->pos.x += player->vel.x; player->pos.y += player->vel.y; - if ((player->unk_0A0 < player->pos.y) && (player->vel.y >= 0.0f)) { - Math_SmoothStepToF(&player->pos.y, player->unk_0A0, 0.1f, fabsf(player->vel.y * 1.5f) + 5.0f, 0.0f); + if ((player->pathHeight < player->pos.y) && (player->vel.y >= 0.0f)) { + Math_SmoothStepToF(&player->pos.y, player->pathHeight, 0.1f, fabsf(player->vel.y * 1.5f) + 5.0f, 0.0f); } - if ((player->pos.y < player->unk_0A4) && (player->vel.y <= 0.0f)) { - if (player->unk_0A4 >= 0.0f) { - player->pos.y = player->unk_0A4; + if ((player->pos.y < player->pathFloor) && (player->vel.y <= 0.0f)) { + if (player->pathFloor >= 0.0f) { + player->pos.y = player->pathFloor; } else { - Math_SmoothStepToF(&player->pos.y, player->unk_0A4, 0.1f, fabsf(player->vel.y * 1.5f) + 5.0f, 0.0f); + Math_SmoothStepToF(&player->pos.y, player->pathFloor, 0.1f, fabsf(player->vel.y * 1.5f) + 5.0f, 0.0f); } } player->pos.z += player->vel.z; - if (player->unk_0A0 - 100.0f < player->pos.y) { + if (player->pathHeight - 100.0f < player->pos.y) { player->flags_228 = PFLAG_228_3; } - if (player->pos.y < -(player->unk_0A0 - 100.0f)) { + if (player->pos.y < -(player->pathHeight - 100.0f)) { player->flags_228 = PFLAG_228_2; } func_play_800AE278(player); - player->unk_138 = player->pos.z; + player->trueZpos = player->pos.z; func_play_800A4460(player); func_play_800A46A0(player); } @@ -3471,14 +3471,14 @@ void func_play_800AECAC(Player* player) { gVsLockOnTimers[player->num][0] = gVsLockOnTimers[player->num][1] = gVsLockOnTimers[player->num][2] = gVsLockOnTimers[player->num][3] = 0; } - if (player->unk_4D8 > 240.0f) { + if (player->aerobaticPitch > 240.0f) { sp58 = -50.0f; } Math_SmoothStepToF(&player->wings.unk_04, sp58, 0.3f, 100.0f, 0.0f); Math_SmoothStepToF(&player->wings.unk_08, sp58, 0.3f, 100.0f, 0.0f); Math_SmoothStepToF(&player->wings.unk_0C, sp58, 0.3f, 100.0f, 0.0f); Math_SmoothStepToF(&player->wings.unk_10, sp58, 0.3f, 100.0f, 0.0f); - if (player->unk_4D8 < 180.0f) { + if (player->aerobaticPitch < 180.0f) { player->pos.y += 2.0f; } player->boostCooldown = true; @@ -3491,8 +3491,8 @@ void func_play_800AECAC(Player* player) { player->boostMeter = 90.0f; } player->unk_190 = 2; - Math_SmoothStepToF(&player->unk_4D8, 360.0f, 0.1f, 5.0f, 0.001f); - if (player->unk_4D8 > 350.0f) { + Math_SmoothStepToF(&player->aerobaticPitch, 360.0f, 0.1f, 5.0f, 0.001f); + if (player->aerobaticPitch > 350.0f) { player->somersault = false; if (gLevelMode != LEVELMODE_ON_RAILS) { player->unk_018 = 0.05f; @@ -3504,13 +3504,13 @@ void func_play_800AECAC(Player* player) { } } } - Math_SmoothStepToF(&player->unk_0EC, 0.0f, 0.1f, 5.0f, 0.0f); - Math_SmoothStepToF(&player->unk_0E4, 0.0f, 0.1f, 5.0f, 0.0f); + Math_SmoothStepToF(&player->rot.z, 0.0f, 0.1f, 5.0f, 0.0f); + Math_SmoothStepToF(&player->rot.x, 0.0f, 0.1f, 5.0f, 0.0f); temp = -gInputPress->stick_x * 0.68f; - Math_SmoothStepToF(&player->unk_0E8, temp, 0.1f, 2.0f, 0.0f); - player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); + Math_SmoothStepToF(&player->rot.y, temp, 0.1f, 2.0f, 0.0f); + player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll; + Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->xRot_120 + player->rot.x + player->aerobaticPitch) * M_DTOR), MTXF_APPLY); sp4C.x = 0.0f; sp4C.y = 0.0f; sp4C.z = player->baseSpeed; @@ -3520,12 +3520,12 @@ void func_play_800AECAC(Player* player) { player->vel.y = sp40.y; player->pos.x += player->vel.x; player->pos.y += player->vel.y; - if (player->pos.y < player->unk_0A4 + player->unk_0B0) { - player->pos.y = player->unk_0A4 + player->unk_0B0; + if (player->pos.y < player->pathFloor + player->yPath) { + player->pos.y = player->pathFloor + player->yPath; player->vel.y = 0.0f; } player->pos.z += player->vel.z; - player->unk_138 = player->pos.z; + player->trueZpos = player->pos.z; func_play_800A46A0(player); } @@ -3546,20 +3546,20 @@ void func_play_800AF07C(Player* player) { Vec3f sp50; Vec3f sp44; - D_ctx_80177968 = 2.3f; - D_ctx_80177970 = 0.68f; + gPlayerTurnRate = 2.3f; + gPlayerTurnStickMod = 0.68f; if ((gInputPress->stick_x != 0) || (gInputPress->stick_y != 0)) { - D_ctx_80177970 = 0.68f; //! FAKE ? + gPlayerTurnStickMod = 0.68f; //! FAKE ? } stickX = -gInputPress->stick_x; stickY = +gInputPress->stick_y; - Math_SmoothStepToAngle(&player->unk_4D8, 0.0f, 0.1f, 5.0f, 0.01f); + Math_SmoothStepToAngle(&player->aerobaticPitch, 0.0f, 0.1f, 5.0f, 0.01f); if (player->cockpitView) { - Matrix_RotateZ(gCalcMatrix, player->unk_12C * M_DTOR, MTXF_NEW); + Matrix_RotateZ(gCalcMatrix, player->zRotBank * M_DTOR, MTXF_NEW); sp68.z = 0.0f; sp68.x = stickX; @@ -3570,7 +3570,7 @@ void func_play_800AF07C(Player* player) { stickX = sp5C.x; stickY = sp5C.y; } else { - Matrix_RotateZ(gCalcMatrix, (-player->unk_12C) * M_DTOR, MTXF_NEW); + Matrix_RotateZ(gCalcMatrix, (-player->zRotBank) * M_DTOR, MTXF_NEW); sp68.z = 0.0f; sp68.x = stickX * 0.75f; @@ -3596,32 +3596,32 @@ void func_play_800AF07C(Player* player) { sp84 = 0.1f; - if ((player->unk_12C > 10.0f) && (stickX > 0)) { + if ((player->zRotBank > 10.0f) && (stickX > 0)) { sp84 = 0.2f; - D_ctx_80177968 *= 2.0f; + gPlayerTurnRate *= 2.0f; } - if ((player->unk_12C < (-10.0f)) && (stickX < 0)) { + if ((player->zRotBank < (-10.0f)) && (stickX < 0)) { sp84 = 0.2f; - D_ctx_80177968 *= 2.0f; + gPlayerTurnRate *= 2.0f; } - if (player->unk_1DC != 0) { + if (player->barrelRoll != 0) { sp84 = 0.2f; - D_ctx_80177968 = 6.8999996f; + gPlayerTurnRate = 6.8999996f; } - Math_SmoothStepToF(&player->unk_0E8, stickX * D_ctx_80177970, sp84, D_ctx_80177968, 0.03f); + Math_SmoothStepToF(&player->rot.y, stickX * gPlayerTurnStickMod, sp84, gPlayerTurnRate, 0.03f); - D_ctx_80177968 = 2.3f; + gPlayerTurnRate = 2.3f; sp84 = 0.1f; - var_fa1 = -stickY * D_ctx_80177970; + var_fa1 = -stickY * gPlayerTurnStickMod; if ((var_fa1 <= 0.0f) && (player->pos.y < (gGroundHeight + 50.0f))) { var_fa1 = 0.0f; sp84 = 0.2f; - D_ctx_80177968 *= 2.0f; + gPlayerTurnRate *= 2.0f; } - Math_SmoothStepToF(&player->unk_0E4, var_fa1, sp84, D_ctx_80177968, 0.03f); + Math_SmoothStepToF(&player->rot.x, var_fa1, sp84, gPlayerTurnRate, 0.03f); var_fv1 = 1.0f; if (player->pos.y < (gGroundHeight + 70.0f)) { @@ -3638,9 +3638,9 @@ void func_play_800AF07C(Player* player) { var_fv0 = 1.0f; } - Math_SmoothStepToF(&player->unk_0EC, (stickX * 0.6f) * var_fv1, 0.1f, var_fv0, 0.03f); - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -((player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); + Math_SmoothStepToF(&player->rot.z, (stickX * 0.6f) * var_fv1, 0.1f, var_fv0, 0.03f); + Matrix_RotateY(gCalcMatrix, (player->rot.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->rot.x + player->aerobaticPitch) * M_DTOR), MTXF_APPLY); sp68.x = 0.0f; sp68.y = 0.0f; @@ -3651,8 +3651,8 @@ void func_play_800AF07C(Player* player) { sp44.x *= 1.4f; sp44.y *= 1.4f; - Matrix_RotateY(gCalcMatrix, player->unk_114 * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, player->unk_120 * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, player->yRot_114 * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, player->xRot_120 * M_DTOR, MTXF_APPLY); Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp5C); sp68.x = 0.0f; @@ -3683,43 +3683,43 @@ void func_play_800AF07C(Player* player) { player->vel.y -= 2.5f; } - if (player->pos.x > (player->unk_0AC + (player->unk_09C - 100.0f))) { + if (player->pos.x > (player->xPath + (player->pathWidth - 100.0f))) { player->flags_228 = PFLAG_228_0; } - if (player->pos.x < (player->unk_0AC - (player->unk_09C - 100.0f))) { + if (player->pos.x < (player->xPath - (player->pathWidth - 100.0f))) { player->flags_228 = PFLAG_228_1; } - if (player->pos.y > (player->unk_0B0 + (player->unk_0A0 - 100.0f))) { + if (player->pos.y > (player->yPath + (player->pathHeight - 100.0f))) { player->flags_228 = PFLAG_228_3; } - if (player->pos.y < (player->unk_0B0 - (player->unk_0A0 - 100.0f))) { + if (player->pos.y < (player->yPath - (player->pathHeight - 100.0f))) { player->flags_228 = PFLAG_228_2; } player->pos.x += player->vel.x; - if (player->pos.x > (player->unk_09C + player->unk_0AC)) { - player->pos.x = player->unk_09C + player->unk_0AC; + if (player->pos.x > (player->pathWidth + player->xPath)) { + player->pos.x = player->pathWidth + player->xPath; player->vel.x = 0.0f; - player->unk_0D8.x = 0.0f; + player->knockback.x = 0.0f; } - if (player->pos.x < (player->unk_0AC - player->unk_09C)) { - player->pos.x = player->unk_0AC - player->unk_09C; + if (player->pos.x < (player->xPath - player->pathWidth)) { + player->pos.x = player->xPath - player->pathWidth; player->vel.x = 0.0f; - player->unk_0D8.x = 0.0f; + player->knockback.x = 0.0f; } player->pos.y += player->vel.y; - if (player->pos.y > (player->unk_0A0 + player->unk_0B0)) { - player->pos.y = player->unk_0A0 + player->unk_0B0; + if (player->pos.y > (player->pathHeight + player->yPath)) { + player->pos.y = player->pathHeight + player->yPath; player->vel.y = 0.0f; - player->unk_0D8.y = 0.0f; + player->knockback.y = 0.0f; } - if (player->pos.y < (player->unk_0A4 + player->unk_0B0)) { - player->pos.y = player->unk_0A4 + player->unk_0B0; + if (player->pos.y < (player->pathFloor + player->yPath)) { + player->pos.y = player->pathFloor + player->yPath; player->vel.y = 0.0f; - player->unk_0D8.y = 0.0f; + player->knockback.y = 0.0f; } player->pos.z += player->vel.z; @@ -3754,41 +3754,41 @@ void func_play_800AF928(Player* player) { if (player->unk_180 > 0) { player->unk_180 -= 3.0f; } - D_ctx_80177968 = 3.0f; - D_ctx_80177970 = 0.6666f; + gPlayerTurnRate = 3.0f; + gPlayerTurnStickMod = 0.6666f; sp5C = gInputPress->stick_x; if (sp5C == 0) { - Math_SmoothStepToF(&player->unk_0E8, -sp5C * D_ctx_80177970, 0.1f, D_ctx_80177968 * 0.5f, 0.1f); + Math_SmoothStepToF(&player->rot.y, -sp5C * gPlayerTurnStickMod, 0.1f, gPlayerTurnRate * 0.5f, 0.1f); } else { - Math_SmoothStepToF(&player->unk_0E8, -sp5C * D_ctx_80177970, 0.1f, D_ctx_80177968, 0.1f); + Math_SmoothStepToF(&player->rot.y, -sp5C * gPlayerTurnStickMod, 0.1f, gPlayerTurnRate, 0.1f); } - player->unk_108 = player->unk_0E8; + player->rot_104.y = player->rot.y; var_fa0 = 0.03f; var_fa1 = 1.5f; - if ((player->unk_12C > 10.0f) && (sp5C < 0.0f)) { + if ((player->zRotBank > 10.0f) && (sp5C < 0.0f)) { var_fa0 = 0.1f; var_fa1 = 4.0f; } - if ((player->unk_12C < -10.0f) && (sp5C > 0.0f)) { + if ((player->zRotBank < -10.0f) && (sp5C > 0.0f)) { var_fa0 = 0.1f; var_fa1 = 4.0f; } - if (player->unk_1DC != 0) { - if ((player->unk_1EC > 0) && (sp5C < 0.0f)) { + if (player->barrelRoll != 0) { + if ((player->rollRate > 0) && (sp5C < 0.0f)) { var_fa0 = 0.2f; var_fa1 = 20.0f; } - if ((player->unk_1EC < 0) && (sp5C > 0.0f)) { + if ((player->rollRate < 0) && (sp5C > 0.0f)) { var_fa0 = 0.2f; var_fa1 = 20.0f; } } - Math_SmoothStepToF(&player->unk_11C, player->unk_0E8 * var_fa0, 0.1f, var_fa1, 0.05f); - player->unk_114 += player->unk_11C; - player->unk_114 = Math_ModF(player->unk_114, 360.0f); - Matrix_RotateX(gCalcMatrix, player->unk_104 * M_DTOR, MTXF_NEW); - Matrix_RotateZ(gCalcMatrix, player->unk_10C * M_DTOR, MTXF_APPLY); - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_APPLY); + Math_SmoothStepToF(&player->yRotVel_11C, player->rot.y * var_fa0, 0.1f, var_fa1, 0.05f); + player->yRot_114 += player->yRotVel_11C; + player->yRot_114 = Math_ModF(player->yRot_114, 360.0f); + Matrix_RotateX(gCalcMatrix, player->rot_104.x * M_DTOR, MTXF_NEW); + Matrix_RotateZ(gCalcMatrix, player->rot_104.z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_APPLY); sp44.x = 0.0f; sp44.y = 0.0f; sp44.z = player->baseSpeed; @@ -3803,14 +3803,14 @@ void func_play_800AF928(Player* player) { if (player->unk_170 > 0.2f) { Math_SmoothStepToF(&player->unk_184, -player->baseSpeed * 0.5f, 1.0f, 1.0f, 0); } - if (!(player->unk_170 > 0.2f) && !(player->unk_16C > 0.2f) && (player->unk_1D4 != 0)) { + if (!(player->unk_170 > 0.2f) && !(player->unk_16C > 0.2f) && player->grounded) { Math_SmoothStepToF(&player->unk_184, 0.0f, 1.0f, 0.75f, 0.0f); } - if (player->unk_1DC != 0) { - if (player->unk_1EC < 0) { + if (player->barrelRoll != 0) { + if (player->rollRate < 0) { player->unk_184 = 15.0f; } - if (player->unk_1EC > 0) { + if (player->rollRate > 0) { player->unk_184 = -15.0f; } } @@ -3821,21 +3821,21 @@ void func_play_800AF928(Player* player) { player->pos.x += sp38.x; player->pos.z += sp38.z; player->pos.x += player->vel.x; - player->vel.y -= player->unk_0D4; + player->vel.y -= player->gravity; player->pos.y += player->vel.y; - if (player->unk_1D4 != 0) { - Math_SmoothStepToAngle(&player->unk_0E4, player->unk_104, 0.2f, 5.0f, 0.005f); - Math_SmoothStepToAngle(&player->unk_0EC, player->unk_10C, 0.2f, 5.0f, 0.005f); + if (player->grounded) { + Math_SmoothStepToAngle(&player->rot.x, player->rot_104.x, 0.2f, 5.0f, 0.005f); + Math_SmoothStepToAngle(&player->rot.z, player->rot_104.z, 0.2f, 5.0f, 0.005f); Math_SmoothStepToF(&player->unk_000, 0.0f, 0.1f, 5.0f, 0.00001f); } - player->unk_1D4 = 0; + player->grounded = false; if (player->pos.y <= gGroundHeight - 5.0f) { player->pos.y = gGroundHeight - 5.0f; if (player->vel.y < -20.0f) { - player->unk_1F4 = 20; + player->hitTimer = 20; } player->vel.y = 0.0f; - player->unk_1D4 = 1; + player->grounded = true; } if (player->vel.y < -80.0f) { player->vel.y = -80.0f; @@ -3845,11 +3845,11 @@ void func_play_800AF928(Player* player) { } player->pos.z += player->vel.z; func_play_800AE278(player); - player->unk_138 = player->pos.z; - player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; - if (player->unk_1D4 != 0) { - player->unk_0F4 += player->baseSpeed * 5.0f; - player->unk_0F0 = SIN_DEG(player->unk_0F4) * 0.7f; + player->trueZpos = player->pos.z; + player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll; + if (player->grounded) { + player->rockPhase += player->baseSpeed * 5.0f; + player->rockAngle = SIN_DEG(player->rockPhase) * 0.7f; } func_play_800A46A0(player); } @@ -3902,15 +3902,16 @@ void func_play_800B0194(Player* player) { Math_SmoothStepToF(&player->unk_154, sp74, 0.1f, 3.0f, 0.00001f); Math_SmoothStepToF(&player->unk_180, 0.0f, 0.15f, 5.0f, 0.00001f); Math_SmoothStepToF(&player->unk_158, sp74, 0.2f, 5.0f, 0.00001f); - D_ctx_80177968 = 3.0f; - D_ctx_80177970 = 0.666f; + gPlayerTurnRate = 3.0f; + gPlayerTurnStickMod = 0.666f; sp74 = gInputPress->stick_x; sp70 = gInputPress->stick_y; - Math_SmoothStepToF(&player->unk_0E8, -sp74 * D_ctx_80177970 * 0.6f, 0.5f, D_ctx_80177968, 0.001f); - Math_SmoothStepToF(&player->unk_0EC, -sp74 * D_ctx_80177970 * 0.2f * player->baseSpeed / 15.0f, 0.2f, 5.0f, 0.001f); - player->unk_0F8 = player->unk_0EC; + Math_SmoothStepToF(&player->rot.y, -sp74 * gPlayerTurnStickMod * 0.6f, 0.5f, gPlayerTurnRate, 0.001f); + Math_SmoothStepToF(&player->rot.z, -sp74 * gPlayerTurnStickMod * 0.2f * player->baseSpeed / 15.0f, 0.2f, 5.0f, + 0.001f); + player->bankAngle = player->rot.z; if ((sp74 != 0.0f) || (sp70 != 0.0f)) { - Math_SmoothStepToF(&player->unk_15C, sp74 * D_ctx_80177970, 0.9f, 2.0f * D_ctx_80177968, 0.1f); + Math_SmoothStepToF(&player->unk_15C, sp74 * gPlayerTurnStickMod, 0.9f, 2.0f * gPlayerTurnRate, 0.1f); Math_SmoothStepToF(&player->unk_164, sp74 * 0.3f, 0.1f, 10.0f, 0.00001f); Math_SmoothStepToF(&player->unk_168, -sp74 * 0.3f, 0.1f, 10.0f, 0.00001f); } else { @@ -3927,7 +3928,7 @@ void func_play_800B0194(Player* player) { Math_SmoothStepToF(&player->unk_164, player->unk_174, 0.1f, 10.0f, 0.00001f); Math_SmoothStepToF(&player->unk_168, player->unk_178, 0.1f, 10.0f, 0.00001f); } - player->unk_108 = player->unk_0E8; + player->rot_104.y = player->rot.y; if (player->baseSpeed < 1.5f) { var_fv0 = 0.12f; var_fa0 = 3.0f; @@ -3935,12 +3936,12 @@ void func_play_800B0194(Player* player) { var_fv0 = 0.08f; var_fa0 = 1.5f; } - Math_SmoothStepToF(&player->unk_11C, -sp74 * D_ctx_80177970 * var_fv0, 0.2f, var_fa0, 0.0f); - player->unk_114 += player->unk_11C; - player->unk_114 = Math_ModF(player->unk_114, 360.0f); - Matrix_RotateX(gCalcMatrix, player->unk_104 * M_DTOR, MTXF_NEW); - Matrix_RotateZ(gCalcMatrix, player->unk_10C * M_DTOR, MTXF_APPLY); - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_APPLY); + Math_SmoothStepToF(&player->yRotVel_11C, -sp74 * gPlayerTurnStickMod * var_fv0, 0.2f, var_fa0, 0.0f); + player->yRot_114 += player->yRotVel_11C; + player->yRot_114 = Math_ModF(player->yRot_114, 360.0f); + Matrix_RotateX(gCalcMatrix, player->rot_104.x * M_DTOR, MTXF_NEW); + Matrix_RotateZ(gCalcMatrix, player->rot_104.z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_APPLY); sp58.x = 0.0f; sp58.y = 0.0f; sp58.z = player->baseSpeed; @@ -3949,22 +3950,22 @@ void func_play_800B0194(Player* player) { player->vel.z = sp4C.z; player->pos.x += player->vel.x; if ((player->pos.y < 40.0f) || (player->pos.y > 670.0f)) { - player->unk_10C = 0.0f; - player->unk_104 = 0.0f; + player->rot_104.z = 0.0f; + player->rot_104.x = 0.0f; } - Math_SmoothStepToAngle(&player->unk_0FC, player->unk_104, 0.15f, 15.0f, 0.005f); - Math_SmoothStepToAngle(&player->unk_100, player->unk_10C, 0.15f, 15.0f, 0.005f); - if (player->unk_1D4 != 0) { + Math_SmoothStepToAngle(&player->xRot_0FC, player->rot_104.x, 0.15f, 15.0f, 0.005f); + Math_SmoothStepToAngle(&player->zRot_0FC, player->rot_104.z, 0.15f, 15.0f, 0.005f); + if (player->grounded) { if (player->baseSpeed > 1.0f) { player->unk_00C += player->unk_008; if ((s32) player->unk_00C >= Animation_GetFrameCount(&D_versus_301CFEC)) { player->unk_00C = 0.0f; } - player->unk_080 = 2.0f * SIN_DEG((player->unk_20C + 7) * 24.0f); - if (player->unk_080 < -0.5f) { - player->unk_080 = -0.5f; + player->yBob = 2.0f * SIN_DEG((player->unk_20C + 7) * 24.0f); + if (player->yBob < -0.5f) { + player->yBob = -0.5f; } - player->unk_080 -= 3.0f; + player->yBob -= 3.0f; player->unk_20C = player->unk_00C; switch (gPlayerNum) { case 0: @@ -4012,14 +4013,14 @@ void func_play_800B0194(Player* player) { break; } 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->yBob, -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); player->unk_20C = 0; player->unk_00C = 0.0f; } } - if (player->unk_1D4 == 0) { + if (!player->grounded) { switch (gPlayerNum) { case 0: sp48 = SEGMENTED_TO_VIRTUAL(D_versus_302E95C); @@ -4036,21 +4037,21 @@ void func_play_800B0194(Player* player) { } 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)) { + player->gravity = 2.0f; + if ((gInputPress->button & Z_TRIG) && player->grounded) { player->vel.y = 12.0f; } if ((gInputHold->button & Z_TRIG) && (player->vel.y > 0.0f)) { - player->unk_0D4 = 1.5f; + player->gravity = 1.5f; } - player->unk_1D4 = 0; - player->vel.y -= player->unk_0D4; + player->grounded = false; + player->vel.y -= player->gravity; player->pos.y += player->vel.y; if (player->pos.y <= gGroundHeight) { - player->unk_1D4 = 1; + player->grounded = true; player->pos.y = 0.0f; player->vel.y = 0.0f; - player->unk_0E4 += (player->pos.y - player->unk_0E4) * 0.05f; + player->rot.x += (player->pos.y - player->rot.x) * 0.05f; } if (player->vel.y < -50.0f) { player->vel.y = -50.0f; @@ -4060,7 +4061,7 @@ void func_play_800B0194(Player* player) { } player->pos.z += player->vel.z; func_play_800AE278(player); - player->unk_138 = player->pos.z; + player->trueZpos = player->pos.z; } f32 D_800D3114[4] = { 10000.0f, -10000.0f, 10000.0f, -10000.0f }; @@ -4100,13 +4101,13 @@ void func_play_800B0F50(Player* playerx) { gLeftWingHealth[gPlayerNum] = 60; gRightWingHealth[gPlayerNum] = 60; } - D_Timer_80177A00[gPlayerNum] = D_Timer_80177A38[gPlayerNum] = D_Timer_80177A70[gPlayerNum] = - D_Timer_80177A88[gPlayerNum] = gShieldTimer[gPlayerNum] = gHasShield[gPlayerNum] = gChargeTimers[gPlayerNum] = + gUturnDownTimers[gPlayerNum] = gUturnBrakeTimers[gPlayerNum] = gLoopDownTimers[gPlayerNum] = + gLoopBoostTimers[gPlayerNum] = gShieldTimer[gPlayerNum] = gHasShield[gPlayerNum] = gChargeTimers[gPlayerNum] = gVsLockOnTimers[gPlayerNum][0] = gVsLockOnTimers[gPlayerNum][1] = gVsLockOnTimers[gPlayerNum][2] = gVsLockOnTimers[gPlayerNum][3] = 0; gRightWingFlashTimer[gPlayerNum] = gLeftWingFlashTimer[gPlayerNum] = gRightWingDebrisTimer[gPlayerNum] = gLeftWingDebrisTimer[gPlayerNum] = D_ctx_80177990[gPlayerNum] = D_ctx_801779A8[gPlayerNum] = - D_ctx_80177AA0[gPlayerNum] = 0.0f; + gMuzzleFlashScale[gPlayerNum] = 0.0f; gShieldAlpha[gPlayerNum] = 0.0f; player->unk_190 = 1.0f; player->unk_194 = 1.0f; @@ -4116,23 +4117,23 @@ void func_play_800B0F50(Player* playerx) { player->unk_148 = 0.77699995f; player->unk_14C = 0.77699995f; player->unk_01C = 1.0f; - player->unk_068 = -1000.0f; + player->groundPos.y = -1000.0f; player->cam.at.z = player->cam.eye.z - 1000.0f; D_ctx_80177950 = 1.0f; if ((gLevelType == LEVELTYPE_SPACE) && (gCurrentLevel != LEVEL_BOLSE)) { player->unk_240 = 1; player->unk_0A8 = 3000.0f; - player->unk_09C = 700.0f; - player->unk_0A0 = 612.0f; - player->unk_0A4 = -544.0f; + player->pathWidth = 700.0f; + player->pathHeight = 612.0f; + player->pathFloor = -544.0f; if (gCurrentLevel == LEVEL_UNK_15) { - player->unk_0A0 = 3000.0f; - player->unk_0A4 = -3000.0f; + player->pathHeight = 3000.0f; + player->pathFloor = -3000.0f; } } else { - player->unk_09C = 700.0f; - player->unk_0A0 = 680.0f; - player->unk_0A4 = gGroundHeight + 40.0f; + player->pathWidth = 700.0f; + player->pathHeight = 680.0f; + player->pathFloor = gGroundHeight + 40.0f; player->unk_0A8 = 3000.0f; } player->baseSpeed = gArwingSpeed; @@ -4145,10 +4146,10 @@ void func_play_800B0F50(Player* playerx) { player->unk_14C = 0.67f; player->unk_148 = 0.67f; player->baseSpeed = 15.0f; - player->unk_0D4 = 3.0f; - player->unk_09C = 500.0f; - player->unk_0A0 = 500.0f; - player->unk_0A4 = -500.0f; + player->gravity = 3.0f; + player->pathWidth = 500.0f; + player->pathHeight = 500.0f; + player->pathFloor = -500.0f; if (gCurrentLevel == LEVEL_TITANIA) { player->pos.y = 150.0f; } else { @@ -4157,15 +4158,15 @@ void func_play_800B0F50(Player* playerx) { break; case LEVEL_AQUAS: player->form = FORM_BLUE_MARINE; - player->unk_0D4 = 0.0f; - player->unk_09C = 700.0f; + player->gravity = 0.0f; + player->pathWidth = 700.0f; player->baseSpeed = 20.0f; - player->unk_0A0 = 720.0f; - player->unk_0A4 = gGroundHeight + 30.0f; + player->pathHeight = 720.0f; + player->pathFloor = gGroundHeight + 30.0f; break; case LEVEL_SOLAR: case LEVEL_ZONESS: - player->unk_0A4 = -450.0f; + player->pathFloor = -450.0f; break; } if (gCurrentLevel != LEVEL_CORNERIA) { @@ -4204,8 +4205,8 @@ void func_play_800B0F50(Player* playerx) { gMissedZoSearchlight = gSavedZoSearchlightStatus; gObjectLoadIndex = gSavedObjectLoadIndex; gGroundSurface = gSavedGroundSurface; - D_ctx_80177D20 = player->unk_144 = D_ctx_80177CB0; - player->pos.z = player->unk_138 = -player->unk_144; + gPathProgress = player->zPath = gSavedPathProgress; + player->pos.z = player->trueZpos = -player->zPath; if ((gSavedObjectLoadIndex > 0) && (gLevelMode == LEVELMODE_ON_RAILS)) { if (gCurrentLevel == LEVEL_MACBETH) { sp2E = gObjectLoadIndex; @@ -4216,7 +4217,7 @@ void func_play_800B0F50(Player* playerx) { } if (player->form == FORM_LANDMASTER) { player->pos.z -= 200.0f; - player->unk_138 -= 200.0f; + player->trueZpos -= 200.0f; } player->cam.eye.y = (player->pos.y * player->unk_148) + 10.0f; player->cam.eye.x = player->pos.x * player->unk_148; @@ -4228,7 +4229,7 @@ void func_play_800B0F50(Player* playerx) { player->pos.y = 500.0f; player->pos.x = D_800D3114[gPlayerNum]; player->pos.z = D_800D3124[gPlayerNum]; - player->unk_114 = D_800D3154[gPlayerNum]; + player->yRot_114 = D_800D3154[gPlayerNum]; player->form = gPlayerForms[gPlayerNum]; switch (player->form) { case FORM_ARWING: @@ -4236,12 +4237,12 @@ void func_play_800B0F50(Player* playerx) { case FORM_LANDMASTER: player->pos.y = 0.0f; player->baseSpeed = 15.0f; - player->unk_0D4 = 3.0f; + player->gravity = 3.0f; break; case FORM_ON_FOOT: player->pos.y = 0.0f; player->baseSpeed = 15.0f; - player->unk_068 = 0; + player->groundPos.y = 0; switch (gPlayerNum) { case 0: sp38 = SEGMENTED_TO_VIRTUAL(D_versus_302E56C); @@ -4268,14 +4269,14 @@ void func_play_800B0F50(Player* playerx) { if ((gLevelMode == LEVELMODE_ALL_RANGE) && !gVersusMode) { player->pos.z = 8000.0f; player->pos.y = 670.0f; - player->unk_0A0 = 730.0f; + player->pathHeight = 730.0f; player->unk_204 = 2; if ((gCurrentLevel == LEVEL_VENOM_ANDROSS) && (gLevelPhase == 1)) { player->pos.x = -7910.0f; player->pos.y = 300.0f; player->pos.z = -11808.0f; - player->unk_114 = 188.0f; + player->yRot_114 = 188.0f; player->unk_240 = 1; } func_play_800B63BC(player, 1); @@ -4283,7 +4284,7 @@ void func_play_800B0F50(Player* playerx) { player->unk_014 = 1.0f; player->unk_018 = 1.0f; } - if ((D_ctx_8017782C != 0) && (gSavedObjectLoadIndex == 0)) { + if (D_ctx_8017782C && (gSavedObjectLoadIndex == 0)) { gLeveLClearStatus[gCurrentLevel] = 0; for (j = 0; j < 10; j++) { D_ctx_80177A10[j] = 0; @@ -4332,7 +4333,7 @@ void func_play_800B0F50(Player* playerx) { if ((gCurrentLevel == LEVEL_MACBETH) && (gSavedObjectLoadIndex == 0)) { player->pos.z = -4115.0f; - D_ctx_80177D20 = player->unk_144 = 3932.0f; + gPathProgress = player->zPath = 3932.0f; gObjectLoadIndex = 40; gLevelObjects = SEGMENTED_TO_VIRTUAL(gLevelObjectInits[gCurrentLevel]); @@ -4454,22 +4455,22 @@ void func_play_800B2130(Player* player) { s32 var_v0; Math_SmoothStepToF(&player->unk_150, 1.0f, 0.05f, 10.0f, 0.0001f); - player->unk_130 = Math_ModF(player->unk_130, 360.0f); - if (player->unk_280 > 0) { - player->unk_280 -= 30; - if (player->unk_280 <= 0) { - player->unk_280 = 0; + player->zRotBarrelRoll = Math_ModF(player->zRotBarrelRoll, 360.0f); + if (player->barrelRollAlpha > 0) { + player->barrelRollAlpha -= 30; + if (player->barrelRollAlpha <= 0) { + player->barrelRollAlpha = 0; } } - if (player->timer_27C == 0) { - if (player->unk_1DC == 0) { - Math_SmoothStepToF(&player->unk_130, 0.0f, 0.1f, 10.0f, 0.00001f); + if (player->meteoWarpTimer == 0) { + if (player->barrelRoll == 0) { + Math_SmoothStepToF(&player->zRotBarrelRoll, 0.0f, 0.1f, 10.0f, 0.00001f); } - if (player->timer_1E0 != 0) { - player->timer_1E0--; + if (player->barrelInputTimerL != 0) { + player->barrelInputTimerL--; } - if (player->timer_1E4 != 0) { - player->timer_1E4--; + if (player->barrelInputTimerR != 0) { + player->barrelInputTimerR--; } if (player->timer_214 != 0) { player->timer_214--; @@ -4480,25 +4481,25 @@ void func_play_800B2130(Player* player) { if (player->timer_1E8 != 0) { player->timer_1E8--; } - if (player->unk_1DC != 0) { - player->timer_1E4 = 0; - player->timer_1E0 = 0; + if (player->barrelRoll != 0) { + player->barrelInputTimerR = 0; + player->barrelInputTimerL = 0; player->unk_150 = 1.5f; - player->unk_130 += player->unk_1EC; + player->zRotBarrelRoll += player->rollRate; if (player->timer_1E8 == 0) { - if (player->unk_1EC > 0) { - player->unk_1EC -= 5; + if (player->rollRate > 0) { + player->rollRate -= 5; } - if (player->unk_1EC < 0) { - player->unk_1EC += 5; + if (player->rollRate < 0) { + player->rollRate += 5; } - if (player->unk_1EC == 0) { - player->unk_1DC = 0; + if (player->rollRate == 0) { + player->barrelRoll = 0; } - } else if (player->unk_280 < 180) { - player->unk_280 += 100; - if (player->unk_280 > 180) { - player->unk_280 = 180; + } else if (player->barrelRollAlpha < 180) { + player->barrelRollAlpha += 100; + if (player->barrelRollAlpha > 180) { + player->barrelRollAlpha = 180; } } } @@ -4517,66 +4518,66 @@ void func_play_800B22C0(Player* player) { s32 temp_v0_4; s32 var_v0; - player->unk_130 = Math_ModF(player->unk_130, 360.0f); - if (player->unk_1DC == 0) { - temp_fv0 = player->unk_130; - if (player->unk_130 > 0.0f) { - player->unk_130 -= (player->unk_130 * 0.1f); - if (player->unk_130 < 0.1f) { - player->unk_130 = 0.0f; + player->zRotBarrelRoll = Math_ModF(player->zRotBarrelRoll, 360.0f); + if (player->barrelRoll == 0) { + temp_fv0 = player->zRotBarrelRoll; + if (player->zRotBarrelRoll > 0.0f) { + player->zRotBarrelRoll -= (player->zRotBarrelRoll * 0.1f); + if (player->zRotBarrelRoll < 0.1f) { + player->zRotBarrelRoll = 0.0f; } } - if (player->unk_130 < 0.0f) { - player->unk_130 -= player->unk_130 * 0.1f; - if (player->unk_130 > -0.1f) { - player->unk_130 = 0.0f; + if (player->zRotBarrelRoll < 0.0f) { + player->zRotBarrelRoll -= player->zRotBarrelRoll * 0.1f; + if (player->zRotBarrelRoll > -0.1f) { + player->zRotBarrelRoll = 0.0f; } } } - temp_v0 = player->timer_1E0; - if (player->timer_1E0 != 0) { - player->timer_1E0--; + temp_v0 = player->barrelInputTimerL; + if (player->barrelInputTimerL != 0) { + player->barrelInputTimerL--; } - if (player->timer_1E4 != 0) { - player->timer_1E4--; + if (player->barrelInputTimerR != 0) { + player->barrelInputTimerR--; } if (player->timer_1E8 != 0) { player->timer_1E8--; } - if (player->unk_1DC != 0) { - player->timer_1E4 = 0; - player->timer_1E0 = 0; - player->unk_130 += player->unk_1EC; - if (player->unk_12C > 0.0f) { - player->unk_12C -= 8.0f; - if (player->unk_12C < 0.0f) { - player->unk_12C = 0.0f; + if (player->barrelRoll != 0) { + player->barrelInputTimerR = 0; + player->barrelInputTimerL = 0; + player->zRotBarrelRoll += player->rollRate; + if (player->zRotBank > 0.0f) { + player->zRotBank -= 8.0f; + if (player->zRotBank < 0.0f) { + player->zRotBank = 0.0f; } } - if (player->unk_12C < 0.0f) { - player->unk_12C += 8.0f; - if (player->unk_12C > 0.0f) { - player->unk_12C = 0.0f; + if (player->zRotBank < 0.0f) { + player->zRotBank += 8.0f; + if (player->zRotBank > 0.0f) { + player->zRotBank = 0.0f; } } if (player->timer_1E8 == 0) { - if (player->unk_1EC > 0) { - player->unk_1EC -= 2; + if (player->rollRate > 0) { + player->rollRate -= 2; } - if (player->unk_1EC < 0) { - player->unk_1EC += 2; + if (player->rollRate < 0) { + player->rollRate += 2; } - if (player->unk_1EC == 0) { - player->unk_1DC = 0; + if (player->rollRate == 0) { + player->barrelRoll = 0; } } else { Math_SmoothStepToF(&D_ctx_801779A8[player->num], 30.0f, 1.0f, 30.0f, 0.0f); } if ((player->timer_1E8 >= 5) && (player->timer_498 == 0)) { - if (player->unk_1EC > 0) { + if (player->rollRate > 0) { player->unk_170 = 1.3f; } - if (player->unk_1EC < 0) { + if (player->rollRate < 0) { player->unk_16C = 1.3f; } } @@ -4606,50 +4607,50 @@ void func_play_800B2574(Player* player) { } player->sfx.boost = 0; var = gInputPress->stick_y; // fake? - if (D_Timer_80177A70[gPlayerNum] != 0) { - D_Timer_80177A70[gPlayerNum]--; + if (gLoopDownTimers[gPlayerNum] != 0) { + gLoopDownTimers[gPlayerNum]--; } - if (D_Timer_80177A88[gPlayerNum] != 0) { - D_Timer_80177A88[gPlayerNum]--; + if (gLoopBoostTimers[gPlayerNum] != 0) { + gLoopBoostTimers[gPlayerNum]--; } if (!player->somersault && (D_ctx_80177AB0 < 5)) { if (var >= -50) { - D_Timer_80177A70[gPlayerNum] = 5; + gLoopDownTimers[gPlayerNum] = 5; } - if ((D_Timer_80177A70[gPlayerNum] > 0) && (D_Timer_80177A70[gPlayerNum] < 5) && - (D_Timer_80177A88[gPlayerNum] != 0)) { + if ((gLoopDownTimers[gPlayerNum] > 0) && (gLoopDownTimers[gPlayerNum] < 5) && + (gLoopBoostTimers[gPlayerNum] != 0)) { player->somersault = true; if (gLevelMode == LEVELMODE_ON_RAILS) { player->savedCockpitView = player->cockpitView; player->cockpitView = false; } player->unk_014 = player->unk_018 = 0.0f; - if (player->unk_4D8 > 340.0f) { - player->unk_4D8 -= 360.0f; + if (player->aerobaticPitch > 340.0f) { + player->aerobaticPitch -= 360.0f; } return; } } - if (player->timer_27C != 0) { - player->timer_27C--; + if (player->meteoWarpTimer != 0) { + player->meteoWarpTimer--; player->boostCooldown = true; if (gRingPassCount > 0) { Math_SmoothStepToF(&D_ctx_801779A8[player->num], gRingPassCount * 10.0f, 1.0f, 5.0f, 0.0f); } player->boostSpeed += 0.3f; - Math_SmoothStepToF(&player->unk_08C, -130.0f, 0.2f, 10.0f, 0.0f); - player->unk_130 -= player->unk_258; - player->unk_258 = player->unk_258 + 0.2f; - if (player->unk_258 > 50.0f) { - player->unk_258 = 50.0f; + Math_SmoothStepToF(&player->camDist, -130.0f, 0.2f, 10.0f, 0.0f); + player->zRotBarrelRoll -= player->meteoWarpSpinSpeed; + player->meteoWarpSpinSpeed = player->meteoWarpSpinSpeed + 0.2f; + if (player->meteoWarpSpinSpeed > 50.0f) { + player->meteoWarpSpinSpeed = 50.0f; } if (((gGameFrameCount % 2) == 0) && (gBlurAlpha > 64)) { if (1) {} gBlurAlpha--; } } else { - player->unk_258 = 0.0f; + player->meteoWarpSpinSpeed = 0.0f; if (gBlurAlpha < 255) { gBlurAlpha += 4; if (gBlurAlpha >= 252) { @@ -4669,7 +4670,7 @@ void func_play_800B2574(Player* player) { player->unk_194 = 5.0f; player->unk_190 = 5.0f; if (gBoostButton[player->num] & gInputPress->button) { - D_Timer_80177A88[gPlayerNum] = 5; + gLoopBoostTimers[gPlayerNum] = 5; } } if (gLevelType == LEVELTYPE_PLANET) { @@ -4684,16 +4685,16 @@ void func_play_800B2574(Player* player) { player->boostMeter = 90.0f; player->boostCooldown = true; } - player->unk_25C += 0.04f; - if (player->unk_25C > 0.6f) { - player->unk_25C = 0.6f; + player->contrailScale += 0.04f; + if (player->contrailScale > 0.6f) { + player->contrailScale = 0.6f; } player->unk_190 = 2.0f; player->boostSpeed += 2.0f; if (player->boostSpeed > 30.0f) { player->boostSpeed = 30.0f; } - Math_SmoothStepToF(&player->unk_08C, -400.0f, 0.1f, 30.0f, 0.0f); + Math_SmoothStepToF(&player->camDist, -400.0f, 0.1f, 30.0f, 0.0f); player->sfx.boost = 1; Math_SmoothStepToF(&D_ctx_801779A8[player->num], 50.0f, 1.0f, 10.0f, 0.0f); } else { @@ -4732,21 +4733,21 @@ void func_play_800B2C00(Player* player) { } player->sfx.brake = 0; var = gInputPress->stick_y; // fake? - if (D_Timer_80177A00[gPlayerNum] != 0) { - D_Timer_80177A00[gPlayerNum]--; + if (gUturnDownTimers[gPlayerNum] != 0) { + gUturnDownTimers[gPlayerNum]--; } - if (D_Timer_80177A38[gPlayerNum] != 0) { - D_Timer_80177A38[gPlayerNum]--; + if (gUturnBrakeTimers[gPlayerNum] != 0) { + gUturnBrakeTimers[gPlayerNum]--; } if (var >= -50) { - D_Timer_80177A00[gPlayerNum] = 5; + gUturnDownTimers[gPlayerNum] = 5; } - if ((D_Timer_80177A00[gPlayerNum] > 0) && (D_Timer_80177A00[gPlayerNum] < 5) && (D_ctx_80177AB0 < 5) && - (D_Timer_80177A38[gPlayerNum] != 0)) { - D_Timer_80177A00[gPlayerNum] = 0; - D_Timer_80177A38[gPlayerNum] = 0; + if ((gUturnDownTimers[gPlayerNum] > 0) && (gUturnDownTimers[gPlayerNum] < 5) && (D_ctx_80177AB0 < 5) && + (gUturnBrakeTimers[gPlayerNum] != 0)) { + gUturnDownTimers[gPlayerNum] = 0; + gUturnBrakeTimers[gPlayerNum] = 0; player->state_1C8 = PLAYERSTATE_1C8_U_TURN; - player->unk_1D0 = 0; + player->csState = 0; player->unk_19C = 1; player->unk_000 = 0.0f; player->unk_004 = 0.0f; @@ -4761,7 +4762,7 @@ void func_play_800B2C00(Player* player) { if (player->boostMeter == 0.0f) { func_play_800A5FA0(player->sfxSource, 0x09000003, player->num); if ((gLevelMode == LEVELMODE_ALL_RANGE) && (gInputPress->button & gBrakeButton[player->num])) { - D_Timer_80177A38[gPlayerNum] = 5; + gUturnBrakeTimers[gPlayerNum] = 5; } } if (gLevelType == LEVELTYPE_PLANET) { @@ -4780,7 +4781,7 @@ void func_play_800B2C00(Player* player) { if (player->boostSpeed < -20.0f) { player->boostSpeed = -20.0f; } - Math_SmoothStepToF(&player->unk_08C, 180.0f, 0.1f, 10.0f, 0.0f); + Math_SmoothStepToF(&player->camDist, 180.0f, 0.1f, 10.0f, 0.0f); player->sfx.brake = 1; Math_SmoothStepToF(&D_ctx_801779A8[player->num], 25.0f, 1.0f, 5.0f, 0.0f); } else if (player->boostMeter > 0.0f) { @@ -4796,7 +4797,7 @@ void func_play_800B2C00(Player* player) { } } } - Math_SmoothStepToF(&player->unk_08C, 0.0f, 0.1f, 5.0f, 0.0f); + Math_SmoothStepToF(&player->camDist, 0.0f, 0.1f, 5.0f, 0.0f); } void func_play_800B3010(Player* player) { @@ -4847,15 +4848,15 @@ void func_play_800B3314(Player* player) { f32 temp; f32 temp2; - player->unk_0D4 = 3.0f; + player->gravity = 3.0f; if ((gInputHold->button & Z_TRIG) && !player->boostCooldown) { if (player->boostMeter == 0.0f) { func_play_800A5FA0(player->sfxSource, 0x09000002, player->num); } player->unk_188 = 0.0f; - player->unk_12C += 4.0f; - if (player->unk_12C > 50.0f) { - player->unk_12C = 50.0f; + player->zRotBank += 4.0f; + if (player->zRotBank > 50.0f) { + player->zRotBank = 50.0f; } Math_SmoothStepToF(&player->unk_170, 1.0f, 1.0f, 0.4f, 0.0f); player->boostActive = true; @@ -4864,14 +4865,14 @@ void func_play_800B3314(Player* player) { player->boostCooldown = true; } } else { - if (player->unk_12C > 0.0f) { + if (player->zRotBank > 0.0f) { player->unk_188 += 1.5f; - player->unk_12C -= player->unk_188; - if (player->unk_12C <= 0.0f) { - player->unk_12C = 0.0f; + player->zRotBank -= player->unk_188; + if (player->zRotBank <= 0.0f) { + player->zRotBank = 0.0f; if (player->unk_188 > 3.0f) { player->unk_188 *= -0.4f; - player->unk_12C -= player->unk_188; + player->zRotBank -= player->unk_188; } } } @@ -4881,9 +4882,9 @@ void func_play_800B3314(Player* player) { func_play_800A5FA0(player->sfxSource, 0x09000002, player->num); } player->unk_188 = 0.0f; - player->unk_12C -= 4.0f; - if (player->unk_12C < -50.0f) { - player->unk_12C = -50.0f; + player->zRotBank -= 4.0f; + if (player->zRotBank < -50.0f) { + player->zRotBank = -50.0f; } Math_SmoothStepToF(&player->unk_16C, 1.0f, 1.0f, 0.4f, 0.0f); player->boostActive = true; @@ -4891,38 +4892,38 @@ void func_play_800B3314(Player* player) { if (player->boostMeter >= 90.0f) { player->boostCooldown = true; } - } else if (player->unk_12C < 0.0f) { + } else if (player->zRotBank < 0.0f) { player->unk_188 += 1.5f; - player->unk_12C += player->unk_188; - if (player->unk_12C >= 0.0f) { - player->unk_12C = 0.0f; + player->zRotBank += player->unk_188; + if (player->zRotBank >= 0.0f) { + player->zRotBank = 0.0f; if (player->unk_188 > 3.0f) { player->unk_188 *= -0.4f; - player->unk_12C += player->unk_188; + player->zRotBank += player->unk_188; } } } - if ((player->unk_16C > 0.2f) && (player->unk_170 > 0.2f) && (player->timer_220 == 0)) { - player->unk_12C += (((__cosf(gGameFrameCount * M_DTOR * 8.0f) * 10.0f) - player->unk_12C) * 0.1f); - Math_SmoothStepToAngle(&player->unk_0E4, 0.0f, 0.05f, 5.0f, 0.00001f); - Math_SmoothStepToAngle(&player->unk_0EC, 0.0f, 0.05f, 5.0f, 0.00001f); + if ((player->unk_16C > 0.2f) && (player->unk_170 > 0.2f) && (player->radioDamageTimer == 0)) { + player->zRotBank += (((__cosf(gGameFrameCount * M_DTOR * 8.0f) * 10.0f) - player->zRotBank) * 0.1f); + Math_SmoothStepToAngle(&player->rot.x, 0.0f, 0.05f, 5.0f, 0.00001f); + Math_SmoothStepToAngle(&player->rot.z, 0.0f, 0.05f, 5.0f, 0.00001f); temp = gInputPress->stick_y; Math_SmoothStepToF(&player->unk_000, temp * 0.5f, 0.05f, 5.0f, 0.00001f); Math_SmoothStepToF(&player->boostSpeed, 30.0f, 0.5f, 5.0f, 0.0f); - player->unk_0D4 = -0.4f; + player->gravity = -0.4f; Math_SmoothStepToF(&D_ctx_801779A8[player->num], 30.0f, 1.0f, 10.0f, 0.0f); if ((gCamCount == 1) && ((gGameFrameCount % 2) == 0)) { - func_effect_8007BC7C(RAND_FLOAT_CENTERED(20.0f) + player->pos.x, player->unk_068 + 10.0f, - player->unk_138 - 10.0f, RAND_FLOAT(2.0f) + 4.0f); + func_effect_8007BC7C(RAND_FLOAT_CENTERED(20.0f) + player->pos.x, player->groundPos.y + 10.0f, + player->trueZpos - 10.0f, RAND_FLOAT(2.0f) + 4.0f); } - } else if ((gCamCount == 1) && ((gGameFrameCount % 4) == 0) && (player->unk_1DC == 0)) { - if ((player->unk_16C > 0.2f) && (player->timer_220 == 0)) { - func_effect_8007BC7C(RAND_FLOAT_CENTERED(10.0f) + (player->pos.x - 57.0f), player->unk_068 + 10.0f, - player->unk_138 - 10.0f, RAND_FLOAT(2.0f) + 3.0f); + } else if ((gCamCount == 1) && ((gGameFrameCount % 4) == 0) && (player->barrelRoll == 0)) { + if ((player->unk_16C > 0.2f) && (player->radioDamageTimer == 0)) { + func_effect_8007BC7C(RAND_FLOAT_CENTERED(10.0f) + (player->pos.x - 57.0f), player->groundPos.y + 10.0f, + player->trueZpos - 10.0f, RAND_FLOAT(2.0f) + 3.0f); } - if ((player->unk_170 > 0.2f) && (player->timer_220 == 0)) { - func_effect_8007BC7C(RAND_FLOAT_CENTERED(10.0f) + (player->pos.x + 57.0f), player->unk_068 + 10.0f, - player->unk_138 - 10.0f, RAND_FLOAT(2.0f) + 3.0f); + if ((player->unk_170 > 0.2f) && (player->radioDamageTimer == 0)) { + func_effect_8007BC7C(RAND_FLOAT_CENTERED(10.0f) + (player->pos.x + 57.0f), player->groundPos.y + 10.0f, + player->trueZpos - 10.0f, RAND_FLOAT(2.0f) + 3.0f); } } } @@ -4934,18 +4935,18 @@ s32 D_800D3164[6] = { void func_play_800B39E0(Player* player) { s32 i; - player->unk_084 = 0.0f; - player->unk_090.x = player->pos.x; - player->unk_090.y = player->pos.y; - player->unk_090.z = player->pos.z; - if (player->timer_1F8 != 0) { - player->timer_1F8--; + player->xShake = 0.0f; + player->basePos.x = player->pos.x; + player->basePos.y = player->pos.y; + player->basePos.z = player->pos.z; + if (player->csTimer != 0) { + player->csTimer--; } - if (player->timer_1FC != 0) { - player->timer_1FC--; + if (player->csEventTimer != 0) { + player->csEventTimer--; } - if (player->timer_220 != 0) { - player->timer_220--; + if (player->radioDamageTimer != 0) { + player->radioDamageTimer--; } if (player->timer_498 != 0) { player->timer_498--; @@ -4984,7 +4985,7 @@ void func_play_800B39E0(Player* player) { } else { Math_SmoothStepToF(&gShieldAlpha[player->num], 0.0f, 1.0f, 10.0f, 0.01f); } - Math_SmoothStepToF(&D_ctx_80177AA0[player->num], 0.0f, 1.0f, 0.4f, 0.01f); + Math_SmoothStepToF(&gMuzzleFlashScale[player->num], 0.0f, 1.0f, 0.4f, 0.01f); if ((player->form == FORM_LANDMASTER) && (player->unk_1A0 != 0)) { player->unk_1A0--; } @@ -5007,45 +5008,45 @@ void func_play_800B39E0(Player* player) { } player->timer_278--; } - if (player->unk_1F4 > 0) { - if (player->unk_1F4 > 3) { + if (player->hitTimer > 0) { + if (player->hitTimer > 3) { *gControllerRumble = 1; } - player->unk_1F4--; + player->hitTimer--; if (player->form == FORM_ARWING) { - player->unk_134 = (SIN_DEG(player->unk_1F4 * 400.0f) * player->unk_1F4) * D_800D3164[player->unk_21C]; + player->damageShake = (SIN_DEG(player->hitTimer * 400.0f) * player->hitTimer) * D_800D3164[player->unk_21C]; if (player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) { - player->unk_084 = - (SIN_DEG(player->unk_1F4 * 400.0f) * player->unk_1F4) * D_800D3164[player->unk_21C] * 0.8f; + player->xShake = + (SIN_DEG(player->hitTimer * 400.0f) * player->hitTimer) * D_800D3164[player->unk_21C] * 0.8f; } } else { - player->unk_134 = - (SIN_DEG(player->unk_1F4 * 400.0f) * player->unk_1F4) * D_800D3164[player->unk_21C] * 1.5f; - player->unk_084 = 0.0f; + player->damageShake = + (SIN_DEG(player->hitTimer * 400.0f) * player->hitTimer) * D_800D3164[player->unk_21C] * 1.5f; + player->xShake = 0.0f; } if ((gLevelMode != LEVELMODE_UNK_2) && - ((player->unk_0D8.x != 0.f) || (player->unk_0D8.y != 0.f) || (player->unk_0D8.z != 0.f)) && + ((player->knockback.x != 0.f) || (player->knockback.y != 0.f) || (player->knockback.z != 0.f)) && ((player->unk_1A4 >= 40) || (player->unk_1A4 == 21))) { player->boostCooldown = true; - player->unk_0E4 = 0; - player->unk_0E8 = 0; + player->rot.x = 0; + player->rot.y = 0; Math_SmoothStepToF(&player->boostSpeed, 0, 1.0f, 5.0f, 0); } - if (player->unk_1F4 == 0) { - player->unk_134 = 0; + if (player->hitTimer == 0) { + player->damageShake = 0; } } - player->pos.x += player->unk_0D8.x; - player->pos.y += player->unk_0D8.y; + player->pos.x += player->knockback.x; + player->pos.y += player->knockback.y; if (gLevelMode == LEVELMODE_ALL_RANGE) { - player->pos.z += player->unk_0D8.z; - Math_SmoothStepToF(&player->unk_0D8.z, 0, 0.1f, 1.0f, 0.5f); + player->pos.z += player->knockback.z; + Math_SmoothStepToF(&player->knockback.z, 0, 0.1f, 1.0f, 0.5f); } - Math_SmoothStepToF(&player->unk_0D8.x, 0, 0.1f, 1.0f, 0.5f); - Math_SmoothStepToF(&player->unk_0D8.y, 0, 0.1f, 1.0f, 0.5f); - player->unk_25C -= 0.02f; - if (player->unk_25C < 0.0f) { - player->unk_25C = 0.0f; + Math_SmoothStepToF(&player->knockback.x, 0, 0.1f, 1.0f, 0.5f); + Math_SmoothStepToF(&player->knockback.y, 0, 0.1f, 1.0f, 0.5f); + player->contrailScale -= 0.02f; + if (player->contrailScale < 0.0f) { + player->contrailScale = 0.0f; } } @@ -5098,7 +5099,7 @@ void func_play_800B415C(Player* player) { void func_play_800B41E0(Player* player) { } -void func_play_800B41EC(Player* player) { +void Player_Down(Player* player) { player->state_1C8 = PLAYERSTATE_1C8_DOWN; if (!gVersusMode) { SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 1); @@ -5111,17 +5112,17 @@ void func_play_800B41EC(Player* player) { Audio_StopPlayerNoise(player->num); func_play_800A5FA0(player->sfxSource, 0x0900C010, player->num); player->shields = 0; - player->unk_1D0 = 0; - player->unk_1F4 = 0; - player->timer_220 = 0; - player->unk_134 = 0.0f; + player->csState = 0; + player->hitTimer = 0; + player->radioDamageTimer = 0; + player->damageShake = 0.0f; gShowHud = 0; } void func_play_800B42B0(Player* player) { switch (player->form) { case FORM_ARWING: - if (player->timer_1F8 != 0) { + if (player->csTimer != 0) { gInputPress->stick_x = 0; gInputPress->stick_y = 0; gInputPress->button = 0; @@ -5145,17 +5146,17 @@ void func_play_800B42B0(Player* player) { func_play_800A4C40(player); func_play_800AA800(player); func_play_800B415C(player); - if ((player->shields <= 0) && (player->timer_220 != 0)) { - func_play_800B41EC(player); + if ((player->shields <= 0) && (player->radioDamageTimer != 0)) { + Player_Down(player); player->vel.x *= 0.2f; player->vel.y = 5.0f; - player->unk_0E4 = player->unk_0E8 = 0.0f; + player->rot.x = player->rot.y = 0.0f; player->cockpitView = 0; - player->timer_1F8 = 20; + player->csTimer = 20; if (gLevelType == LEVELTYPE_SPACE) { - player->timer_1F8 = 40; + player->csTimer = 40; } - player->timer_1FC = 120; + player->csEventTimer = 120; } break; case FORM_LANDMASTER: @@ -5171,8 +5172,8 @@ void func_play_800B42B0(Player* player) { func_play_800A8BA4(player); func_play_800AA800(player); func_play_800B415C(player); - if ((player->shields <= 0) && (player->timer_220 != 0)) { - func_play_800B41EC(player); + if ((player->shields <= 0) && (player->radioDamageTimer != 0)) { + Player_Down(player); } break; } @@ -5196,21 +5197,21 @@ void func_play_800B44C4(Player* player) { func_play_800A4C40(player); func_play_800AA800(player); func_play_800B415C(player); - if ((player->shields <= 0) && (player->timer_220 != 0)) { - func_play_800B41EC(player); + if ((player->shields <= 0) && (player->radioDamageTimer != 0)) { + Player_Down(player); player->vel.y = 5.0f; if (gLevelType == LEVELTYPE_SPACE) { player->vel.y = 0.0f; } - player->timer_1F8 = 20; - player->timer_1FC = 120; + player->csTimer = 20; + player->csEventTimer = 120; player->unk_000 = 0.0f; player->unk_004 = 1.0f; - if (player->unk_0E8 < 0.0f) { + if (player->rot.y < 0.0f) { player->unk_004 = -1.0f; } - player->unk_0E4 = 0.0f; - player->unk_4D8 = 0.0f; + player->rot.x = 0.0f; + player->aerobaticPitch = 0.0f; } break; case FORM_LANDMASTER: @@ -5224,8 +5225,8 @@ void func_play_800B44C4(Player* player) { func_play_800A8BA4(player); func_play_800AA800(player); func_play_800B415C(player); - if ((player->shields <= 0) && (player->timer_220 != 0)) { - func_play_800B41EC(player); + if ((player->shields <= 0) && (player->radioDamageTimer != 0)) { + Player_Down(player); } break; case FORM_BLUE_MARINE: @@ -5238,8 +5239,8 @@ void func_play_800B44C4(Player* player) { func_play_800A8BA4(player); func_play_800AA800(player); func_play_800B415C(player); - if ((player->shields <= 0) && (player->timer_220 != 0)) { - func_play_800B41EC(player); + if ((player->shields <= 0) && (player->radioDamageTimer != 0)) { + Player_Down(player); } break; } @@ -5393,7 +5394,7 @@ void Player_Update(Player* player) { } while (gPlayerInactive[sp1C4]); player->unk_288 = sp1C4 + 1; player->state_1C8 = PLAYERSTATE_1C8_VS_STANDBY; - player->unk_1D0 = 0; + player->csState = 0; func_play_800B5FBC(player, player->unk_288 - 1, 1); } else { if (D_ctx_80177E7C == 1) { @@ -5477,8 +5478,8 @@ void Player_Update(Player* player) { player->unk_234 = 0; if (gPlayerInactive[player->num] == true) { func_play_800B5FBC(player, player->unk_288 - 1, 0); - } else if ((D_ctx_80177E74 == 0) && (player->unk_1D0 != 0)) { - player->unk_1D0 = 0; + } else if ((D_ctx_80177E74 == 0) && (player->csState != 0)) { + player->csState = 0; Player_Initialize(player); func_play_800B0F50(player); func_play_800B44C4(player); @@ -5498,7 +5499,7 @@ void Player_Update(Player* player) { gPauseEnabled = 0; } player->unk_234 = 0; - player->vel.z = player->vel.x = player->vel.y = player->unk_0D8.x = player->unk_0D8.y = 0.0f; + player->vel.z = player->vel.x = player->vel.y = player->knockback.x = player->knockback.y = 0.0f; if ((gLevelMode == LEVELMODE_ALL_RANGE) && (gFadeoutType == 7)) { player->cam.eye.x += 1.0f; @@ -5506,19 +5507,19 @@ void Player_Update(Player* player) { } if ((gCurrentLevel == LEVEL_ZONESS) || (gCurrentLevel == LEVEL_SOLAR)) { Math_SmoothStepToF(&player->cam.eye.y, 500.0f, 0.05f, 10.0f, 0.0f); - Math_SmoothStepToF(&player->cam.eye.z, player->unk_138 + D_ctx_80177D20 + 500.0f, 0.05f, 20.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.z, player->trueZpos + gPathProgress + 500.0f, 0.05f, 20.0f, 0.0f); } - if (player->timer_1F8 == 0) { + if (player->csTimer == 0) { if (gCamCount == 4) { player->state_1C8 = PLAYERSTATE_1C8_VS_STANDBY; - player->timer_1F8 = 200; + player->csTimer = 200; } else { gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0; gFillScreenAlphaTarget = 255; } if (gFillScreenAlpha == 255) { Play_ClearObjectData(); - D_ctx_80177D20 = gPlayer[0].unk_144 = 0.0f; + gPathProgress = gPlayer[0].zPath = 0.0f; gPlayerGlareAlphas[0] = 0; gShowAllRangeCountdown = gRadioState = 0; Audio_ClearVoice(); @@ -5580,7 +5581,7 @@ void Player_Update(Player* player) { } Math_SmoothStepToF(&player->unk_148, sp1CC, 1.0f, 0.05f, 0.0f); Math_SmoothStepToF(&player->unk_14C, sp1CC, 1.0f, 0.05f, 0.0f); - Math_SmoothStepToF(&player->unk_09C, sp1C8, 1.0f, 10.0f, 0.0f); + Math_SmoothStepToF(&player->pathWidth, sp1C8, 1.0f, 10.0f, 0.0f); if (player->form == FORM_ARWING) { Math_SmoothStepToF(&player->unk_194, player->unk_190, 0.5f, 5.0f, 0.0f); if (player->boostCooldown && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE)) { @@ -5600,10 +5601,10 @@ void func_play_800B56BC(Player* player) { f32 var_fv0; f32 temp; - gCsCamEyeX = (player->pos.x - player->unk_0AC) * player->unk_148; + gCsCamEyeX = (player->pos.x - player->xPath) * player->unk_148; if (((player->form == FORM_ARWING) && (player->state_1C8 == PLAYERSTATE_1C8_ACTIVE)) || (player->state_1C8 == PLAYERSTATE_1C8_U_TURN)) { - gCsCamEyeY = (player->pos.y - player->unk_0B0) * player->unk_148; + gCsCamEyeY = (player->pos.y - player->yPath) * player->unk_148; } var_fv1 = gInputPress->stick_x; var_fv0 = -gInputPress->stick_y; @@ -5622,10 +5623,10 @@ void func_play_800B56BC(Player* player) { } gCsCamEyeX -= player->unk_030 * 1.5f; gCsCamEyeY -= player->unk_02C - 50.0f; - gCsCamAtX = (player->pos.x - player->unk_0AC) * player->unk_14C; - gCsCamAtX += player->unk_084 * -2.0f; + gCsCamAtX = (player->pos.x - player->xPath) * player->unk_14C; + gCsCamAtX += player->xShake * -2.0f; gCsCamAtX -= player->unk_030 * 0.5f; - gCsCamAtY = ((player->pos.y - player->unk_0B0) * player->unk_14C) + 20.0f; + gCsCamAtY = ((player->pos.y - player->yPath) * player->unk_14C) + 20.0f; gCsCamAtY += player->unk_060 * 5.0f; gCsCamAtY -= player->unk_02C * 0.25f; switch (D_800D2F54) { @@ -5636,31 +5637,31 @@ void func_play_800B56BC(Player* player) { Math_SmoothStepToF(&D_800D2F58, 200.0f, 0.4f, 10.0f, 0); break; } - gCsCamEyeX += player->unk_0AC; - gCsCamAtX += player->unk_0AC; - gCsCamEyeY += player->unk_0B0 + D_800D2F58; - gCsCamAtZ = (player->unk_138 + D_ctx_80177D20) - 1.0f; + gCsCamEyeX += player->xPath; + gCsCamAtX += player->xPath; + gCsCamEyeY += player->yPath + D_800D2F58; + gCsCamAtZ = (player->trueZpos + gPathProgress) - 1.0f; gCsCamEyeZ = 400.0f + D_800D2F58; if (D_ctx_80177C70 == 2) { gCsCamEyeZ -= 50.0f; } if (player->somersault) { gCsCamEyeZ += 200.0f; - gCsCamAtY = (player->pos.y - player->unk_0B0) * 0.9f; + gCsCamAtY = (player->pos.y - player->yPath) * 0.9f; Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, 0.1f, 8.0f, 0.0f); Math_SmoothStepToF(&player->unk_018, 0.2f, 1.0f, 0.05f, 0.0f); } else { Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, 0.2f, 20.0f, 0.0f); Math_SmoothStepToF(&player->unk_018, 1.0f, 1.0f, 0.05f, 0.0f); } - gCsCamAtY += player->unk_0B0 + (D_800D2F58 * 0.5f); + gCsCamAtY += player->yPath + (D_800D2F58 * 0.5f); Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, player->unk_014, 1000.0f, 0.0f); Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, player->unk_018, 1000.0f, 0.0f); Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, player->unk_014, 1000.0f, 0.0f); Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, player->unk_018, 1000.0f, 0.0f); Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, player->unk_014, 1000.0f, 0.0f); Math_SmoothStepToF(&player->unk_014, 1.0f, 1.0f, 0.05f, 0.0f); - temp = -player->unk_0EC; + temp = -player->rot.z; if (gLevelType == LEVELTYPE_PLANET) { Math_SmoothStepToF(&player->camRoll, temp * 0.3f, 0.1f, 1.5f, 0.0f); } else if (gLevelType == LEVELTYPE_SPACE) { @@ -5675,18 +5676,18 @@ void func_play_800B5D30(Player* player, s32 arg1) { s32 pad2; s32 pad3; - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_134) * M_DTOR * 0.75f, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, (player->unk_0E4 + player->unk_134) * M_DTOR * 0.75f, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->rot.y + player->damageShake) * M_DTOR * 0.75f, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, (player->rot.x + player->damageShake) * M_DTOR * 0.75f, MTXF_APPLY); sp4C.x = 0; sp4C.y = 0; sp4C.z = -1000.0f; Matrix_MultVec3f(gCalcMatrix, &sp4C, &sp40); gCsCamEyeX = player->pos.x; - gCsCamEyeY = player->pos.y + player->unk_080; - gCsCamEyeZ = player->unk_138 + D_ctx_80177D20; + gCsCamEyeY = player->pos.y + player->yBob; + gCsCamEyeZ = player->trueZpos + gPathProgress; gCsCamAtX = player->pos.x + sp40.x; - gCsCamAtY = player->pos.y + player->unk_080 + sp40.y; - gCsCamAtZ = player->unk_138 + D_ctx_80177D20 + sp40.z; + gCsCamAtY = player->pos.y + player->yBob + sp40.y; + gCsCamAtZ = player->trueZpos + gPathProgress + sp40.z; Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, player->unk_014, 100.0f, 0.0f); Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, player->unk_014, 100.0f, 0.0f); Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, player->unk_014, 50.0f, 0.0f); @@ -5694,7 +5695,7 @@ void func_play_800B5D30(Player* player, s32 arg1) { Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, player->unk_014, 100.0f, 0.0f); Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, player->unk_014, 100.0f, 0.0f); Math_SmoothStepToF(&player->unk_014, 1.0f, 1.0f, 0.05f, 0); - player->camRoll = -(player->unk_0F8 + player->unk_0F0); + player->camRoll = -(player->bankAngle + player->rockAngle); if (arg1 != 0) { player->cam.eye.x = gCsCamEyeX; player->cam.eye.y = gCsCamEyeY; @@ -5726,7 +5727,7 @@ void func_play_800B5FBC(Player* player, s32 playerNum, bool arg2) { playerNum = 0; } player->unk_288 = playerNum + 1; - Matrix_RotateY(gCalcMatrix, gPlayer[playerNum].unk_114 * M_DTOR, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, gPlayer[playerNum].yRot_114 * M_DTOR, MTXF_NEW); switch (gPlayer[playerNum].form) { case FORM_ARWING: sp58.x = 300.0f; @@ -5748,11 +5749,11 @@ void func_play_800B5FBC(Player* player, s32 playerNum, bool arg2) { Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp58, &sp4C); player->cam.eye.x = gPlayer[playerNum].pos.x + sp4C.x; player->cam.eye.y = gPlayer[playerNum].pos.y + 50.0f; - player->cam.eye.z = gPlayer[playerNum].unk_138 + sp4C.z; + player->cam.eye.z = gPlayer[playerNum].trueZpos + sp4C.z; } player->cam.at.x = gPlayer[playerNum].pos.x; player->cam.at.y = gPlayer[playerNum].pos.y; - player->cam.at.z = gPlayer[playerNum].unk_138; + player->cam.at.z = gPlayer[playerNum].trueZpos; switch (gPlayer[playerNum].form) { case FORM_ARWING: player->cam.eye.x += gPlayer[playerNum].vel.x * 0.5f; @@ -5765,8 +5766,8 @@ void func_play_800B5FBC(Player* player, s32 playerNum, bool arg2) { case FORM_ON_FOOT: player->cam.eye.x += gPlayer[playerNum].vel.x * 0.7f; player->cam.eye.z += gPlayer[playerNum].vel.z * 0.7f; - player->cam.eye.y = gPlayer[playerNum].unk_068 + 20.0f; - player->cam.at.y = gPlayer[playerNum].unk_068 + 20.0f; + player->cam.eye.y = gPlayer[playerNum].groundPos.y + 20.0f; + player->cam.at.y = gPlayer[playerNum].groundPos.y + 20.0f; break; } Math_SmoothStepToF(&player->camRoll, 0.0f, 0.05f, 5.0f, 0.00001f); @@ -5786,14 +5787,14 @@ void func_play_800B63BC(Player* player, s32 arg1) { f32 atY; f32 atZ; - Matrix_RotateY(gCalcMatrix, (player->unk_114 + (player->unk_134 * 0.2f)) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, player->unk_134 * 0.2f * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->yRot_114 + (player->damageShake * 0.2f)) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, player->damageShake * 0.2f * M_DTOR, MTXF_APPLY); sp74.x = 0.0f; sp74.y = 0.0f; if (player->cockpitView) { - sp74.z = 1000.0f - player->unk_08C; + sp74.z = 1000.0f - player->camDist; } else { - sp74.z = 300.0f - player->unk_08C; + sp74.z = 300.0f - player->camDist; } if (player->somersault) { sp74.z += 500.0f; @@ -5810,16 +5811,16 @@ void func_play_800B63BC(Player* player, s32 arg1) { eyeY -= (player->unk_02C * 1.5f); eyeZ = player->pos.z + sp68.z; - atX = player->pos.x + player->unk_134; + atX = player->pos.x + player->damageShake; var_fv0 = (player->somersault) ? 1.0f : 0.79f; - atY = (player->pos.y * (var_fv0)) + player->unk_134 + (player->unk_060 * 5.0f); + atY = (player->pos.y * (var_fv0)) + player->damageShake + (player->unk_060 * 5.0f); atY += (player->unk_02C * 0.5f); if (player->state_1C8 == PLAYERSTATE_1C8_U_TURN) { atY = player->pos.y; } atZ = player->pos.z; - Math_SmoothStepToF(&player->unk_028, 2.0f * player->unk_0E8, 0.05f, 2.0f, 0.02f); + Math_SmoothStepToF(&player->unk_028, 2.0f * player->rot.y, 0.05f, 2.0f, 0.02f); sp74.x = -player->unk_028; sp74.y = 0.0f; sp74.z = 0.f; @@ -5832,7 +5833,7 @@ void func_play_800B63BC(Player* player, s32 arg1) { Math_SmoothStepToF(&player->cam.eye.x, eyeX, player->unk_014, 30000.0f, 0); Math_SmoothStepToF(&player->cam.eye.y, eyeY, player->unk_014, 30000.0f, 0); Math_SmoothStepToF(&player->cam.eye.z, eyeZ, player->unk_014, 30000.0f, 0); - Math_SmoothStepToF(&player->camRoll, player->unk_0E8 * -0.3f, 0.1f, 1.0f, 0); + Math_SmoothStepToF(&player->camRoll, player->rot.y * -0.3f, 0.1f, 1.0f, 0); Math_SmoothStepToF(&player->unk_014, 0.2f, 0.1f, 0.005f, 0.0f); } Math_SmoothStepToF(&player->cam.at.x, atX, player->unk_01C, 30000.0f, 0); @@ -5857,17 +5858,17 @@ void func_play_800B6848(Player* player, s32 arg1) { f32 sp40; f32 sp3C; - Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, MTXF_NEW); - Matrix_RotateZ(gCalcMatrix, player->unk_0EC * M_DTOR, MTXF_APPLY); - Matrix_RotateY(gCalcMatrix, (player->unk_114 + (player->unk_134 * 0.2f)) * M_DTOR, MTXF_APPLY); - Matrix_RotateX(gCalcMatrix, player->unk_134 * 0.2f * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, player->rot.x * M_DTOR, MTXF_NEW); + Matrix_RotateZ(gCalcMatrix, player->rot.z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->yRot_114 + (player->damageShake * 0.2f)) * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, player->damageShake * 0.2f * M_DTOR, MTXF_APPLY); sp54.x = 0.0f; if (player->cockpitView) { sp54.y = 150.0f; - sp54.z = 500.0f - player->unk_08C; + sp54.z = 500.0f - player->camDist; } else { sp54.y = 100.0f; - sp54.z = 250.0f - player->unk_08C; + sp54.z = 250.0f - player->camDist; } Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp54, &sp48); if (player->cockpitView) { @@ -5879,10 +5880,10 @@ void func_play_800B6848(Player* player, s32 arg1) { sp40 = player->pos.y + sp48.y - (player->unk_02C * 0.6f); sp3C = player->pos.z + sp48.z; - player->cam.at.x = player->pos.x + player->unk_134; - player->cam.at.y = player->pos.y + 60.0f + player->unk_02C + player->unk_134; + player->cam.at.x = player->pos.x + player->damageShake; + player->cam.at.y = player->pos.y + 60.0f + player->unk_02C + player->damageShake; player->cam.at.z = player->pos.z; - Math_SmoothStepToF(&player->unk_028, 2.0f * player->unk_0E8, 0.05f, 2.0f, 0.02f); + Math_SmoothStepToF(&player->unk_028, 2.0f * player->rot.y, 0.05f, 2.0f, 0.02f); sp54.x = -player->unk_028; sp54.y = 0.0f; sp54.z = 0.0f; @@ -5894,7 +5895,7 @@ void func_play_800B6848(Player* player, s32 arg1) { Math_SmoothStepToF(&player->cam.eye.x, sp44, 0.1f, 200.0f, 0.001f); Math_SmoothStepToF(&player->cam.eye.y, sp40, 0.1f, 200.0f, 0.001f); Math_SmoothStepToF(&player->cam.eye.z, sp3C, 0.1f, 200.0f, 0.001f); - Math_SmoothStepToF(&player->camRoll, player->unk_12C * -0.1f, 0.1f, 1.0f, 0.01f); + Math_SmoothStepToF(&player->camRoll, player->zRotBank * -0.1f, 0.1f, 1.0f, 0.01f); if (arg1 != 0) { player->cam.eye.x = sp44; player->cam.eye.y = sp40; @@ -5907,26 +5908,26 @@ void func_play_800B6BFC(Player* player, s32 arg1) { Vec3f sp58; Vec3f sp4C; - Matrix_RotateX(gCalcMatrix, player->unk_0FC * M_DTOR, MTXF_NEW); - Matrix_RotateZ(gCalcMatrix, player->unk_100 * M_DTOR, MTXF_APPLY); - Matrix_RotateY(gCalcMatrix, (player->unk_114 + (player->unk_134 * 0.02f)) * M_DTOR, MTXF_APPLY); - Matrix_RotateX(gCalcMatrix, player->unk_134 * 0.02f * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, player->xRot_0FC * M_DTOR, MTXF_NEW); + Matrix_RotateZ(gCalcMatrix, player->zRot_0FC * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->yRot_114 + (player->damageShake * 0.02f)) * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, player->damageShake * 0.02f * M_DTOR, MTXF_APPLY); sp64.x = 0.0f; sp64.y = 20.0f; - sp64.z = 60.0f - player->unk_08C; + sp64.z = 60.0f - player->camDist; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp64, &sp58); Math_SmoothStepToF(&player->unk_02C, -player->unk_158 * 0.5f, 0.07f, 3.0f, 0.001f); sp4C.x = player->pos.x + sp58.x; - sp4C.y = (player->unk_068 + 10.0f + sp58.y) - (player->unk_02C * 0.8f); + sp4C.y = player->groundPos.y + 10.0f + sp58.y - (player->unk_02C * 0.8f); sp4C.z = player->pos.z + sp58.z; - player->cam.at.x = player->pos.x + player->unk_134 * 0.1f; - player->cam.at.y = player->unk_068 + (player->pos.y - player->unk_068) * 0.4f + 18.0f + player->unk_02C * 1.5f + - player->unk_134 * 0.1f; + player->cam.at.x = player->pos.x + player->damageShake * 0.1f; + player->cam.at.y = player->groundPos.y + (player->pos.y - player->groundPos.y) * 0.4f + 18.0f + + player->unk_02C * 1.5f + player->damageShake * 0.1f; player->cam.at.z = player->pos.z; - Math_SmoothStepToF(&player->unk_028, player->unk_0E8 * (player->baseSpeed + 5.0f) * 0.04f, 0.05f, 2.0f, 0.02f); + Math_SmoothStepToF(&player->unk_028, player->rot.y * (player->baseSpeed + 5.0f) * 0.04f, 0.05f, 2.0f, 0.02f); sp64.x = -player->unk_028; sp64.y = 0.0f; sp64.z = 0.0f; @@ -5939,7 +5940,7 @@ void func_play_800B6BFC(Player* player, s32 arg1) { Math_SmoothStepToF(&player->cam.eye.x, sp4C.x, 0.3f, 65.0f, 0.001f); Math_SmoothStepToF(&player->cam.eye.y, sp4C.y, 0.3f, 65.0f, 0.001f); Math_SmoothStepToF(&player->cam.eye.z, sp4C.z, 0.3f, 65.0f, 0.001f); - Math_SmoothStepToF(&player->camRoll, player->unk_12C * -0.1f, 0.1f, 1.0f, 0.01f); + Math_SmoothStepToF(&player->camRoll, player->zRotBank * -0.1f, 0.1f, 1.0f, 0.01f); if (arg1 != 0) { player->cam.eye.x = sp4C.x; player->cam.eye.y = sp4C.y; @@ -6032,12 +6033,12 @@ void Player_UpdateCamera(Player* player) { player->cam.eye.x += (player->pos.x - player->cam.eye.x) * 0.1f; player->cam.eye.y += (player->pos.y - player->cam.eye.y) * 0.1f; player->cam.eye.z -= player->vel.z * 0.2f; - if (player->unk_1D0 != 0) { + if (player->csState != 0) { player->cam.eye.z -= player->vel.z * 0.2f; } player->cam.at.x += (player->pos.x - player->cam.at.x) * 0.1f; player->cam.at.y += (player->pos.y - player->cam.at.y) * 0.1f; - player->cam.at.z = player->unk_138 + D_ctx_80177D20 - 1.0f; + player->cam.at.z = player->trueZpos + gPathProgress - 1.0f; } break; case PLAYERSTATE_1C8_NEXT: @@ -6165,7 +6166,7 @@ void Play_UpdateLevel(void) { case LEVEL_VENOM_2: if ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE) && (gLevelPhase == 2)) { gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; - gPlayer[0].unk_1D0 = 0; + gPlayer[0].csState = 0; gPlayer[0].unk_234 = 1; gPlayer[0].pos.z = 15000.0f; func_play_800B7184(gPlayer, 1); @@ -6179,8 +6180,8 @@ void Play_UpdateLevel(void) { case LEVEL_VENOM_ANDROSS: Andross_8018BDD8(); gGroundHeight = -25000.0f; - gPlayer[0].unk_0A0 = 612.0f; - gPlayer[0].unk_0A4 = -544.0f; + gPlayer[0].pathHeight = 612.0f; + gPlayer[0].pathFloor = -544.0f; if (gStartAndrossFightTimer != 0) { gStartAndrossFightTimer--; if (gStartAndrossFightTimer == 0) { @@ -6203,7 +6204,7 @@ void Play_UpdateLevel(void) { if ((gCurrentLevel == LEVEL_SECTOR_X) && (gLevelPhase == 0) && (gRingPassCount == 4)) { gRingPassCount++; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_ENTER_WARP_ZONE; - gPlayer[0].unk_1D0 = 0; + gPlayer[0].csState = 0; gSceneSetup = 1; AUDIO_PLAY_SFX(0x1900602A, gDefaultSfxSource, 0); gMissionStatus = MISSION_WARP; @@ -6222,7 +6223,7 @@ void Play_UpdateLevel(void) { case LEVEL_SOLAR: func_play_800A3FEC(); - for (D_ctx_80177CE8; D_ctx_80177CE8 >= 10.0f; D_ctx_80177CE8 -= 10.0f) { + for (gPathTexScroll; gPathTexScroll >= 10.0f; gPathTexScroll -= 10.0f) { Texture_Scroll(D_SO_6005710, 32, 32, 1); } if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_NEXT) { @@ -6272,7 +6273,7 @@ void Play_UpdateLevel(void) { Audio_SetHeatAlarmParams(shields, heightParam); if (((gGameFrameCount % 8) == 0) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE)) { Solar_8019E8B8(RAND_FLOAT_CENTERED(6000.0f), -80.0f, - gPlayer[0].unk_138 + (RAND_FLOAT(2000.0f) + -6000.0f), + gPlayer[0].trueZpos + (RAND_FLOAT(2000.0f) + -6000.0f), RAND_FLOAT(10.0f) + 20.0f); // check } func_hud_8008C104(D_SO_60229A4, D_SO_6010198); @@ -6282,7 +6283,7 @@ void Play_UpdateLevel(void) { break; case LEVEL_ZONESS: func_play_800A3FEC(); - for (D_ctx_80177CE8; D_ctx_80177CE8 >= 20.0f; D_ctx_80177CE8 -= 20.0f) { + for (gPathTexScroll; gPathTexScroll >= 20.0f; gPathTexScroll -= 20.0f) { Texture_Scroll(D_ZO_602C2CC, 32, 32, 1); } if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_NEXT) { @@ -6290,7 +6291,7 @@ void Play_UpdateLevel(void) { } func_hud_8008C104(D_ZO_602C2CC, D_ZO_600D990); if (func_play_800A73E4(&sp3C, &sp40, gPlayer[0].cam.eye.x, gPlayer[0].cam.eye.y, - gPlayer[0].cam.eye.z - D_ctx_80177D20)) { + gPlayer[0].cam.eye.z - gPathProgress)) { gLight1R = 0; gLight1G = 7; gLight1B = 10; @@ -6373,7 +6374,7 @@ void Play_SpawnVsItem(ObjectId objId, Item* item) { } void func_play_800B86A4(f32* arg0) { - *arg0 += D_ctx_80177D20 + 15000.0f; + *arg0 += gPathProgress + 15000.0f; } void Play_Main(void) { @@ -6415,10 +6416,10 @@ void Play_Main(void) { Training_80198C50(); } func_play_800B86A4(&gPlayer[0].pos.z); - func_play_800B86A4(&gPlayer[0].unk_138); + func_play_800B86A4(&gPlayer[0].trueZpos); gPlayer[0].cam.eye.z += 15000.0f; gPlayer[0].cam.at.z += 15000.0f; - gPlayer[0].unk_144 = gPlayer[0].unk_140 = D_ctx_80177D08 = D_ctx_80177D20 = 0.0f; + gPlayer[0].zPath = gPlayer[0].zPathVel = gPathVelZ = gPathProgress = 0.0f; } if (gPlayState != PLAY_PAUSE) { (void) "play_time = %d\n"; diff --git a/src/engine/fox_tank.c b/src/engine/fox_tank.c index 46555e77..24c247f7 100644 --- a/src/engine/fox_tank.c +++ b/src/engine/fox_tank.c @@ -63,31 +63,31 @@ void func_tank_80043468(Player* player) { f32 sp40; s32 pad3C; - sp54 = ((player->pos.x - player->unk_0AC) * player->unk_148) + (player->unk_0E8 * 0.5f); - sp48 = sp54 + (player->unk_0E8 * -5.0f); + sp54 = ((player->pos.x - player->xPath) * player->unk_148) + (player->rot.y * 0.5f); + sp48 = sp54 + (player->rot.y * -5.0f); sp40 = player->cam.eye.z - 1000.0f; - sp54 += player->unk_0AC; - sp48 += player->unk_0AC; - if (player->unk_1D4 != 0) { - sp50 = player->pos.y + 100.0f + (-player->unk_0E4 * 5.0f); - sp4C = player->pos.y + player->unk_0E4 * 10.0f; + sp54 += player->xPath; + sp48 += player->xPath; + if (player->grounded) { + sp50 = player->pos.y + 100.0f + (-player->rot.x * 5.0f); + sp4C = player->pos.y + player->rot.x * 10.0f; sp50 += player->unk_17C * 0.5f; sp4C += player->unk_17C * -5.0f; if (0 || (gCurrentLevel == LEVEL_MACBETH) && (D_MA_801BA1E8 == 102)) { - sp50 = player->pos.y + 45.0f + (-player->unk_0E4 * 5.0f); - sp4C = player->pos.y + 200.0f + (player->unk_0E4 * 10.0f); + sp50 = player->pos.y + 45.0f + (-player->rot.x * 5.0f); + sp4C = player->pos.y + 200.0f + (player->rot.x * 10.0f); sp50 += player->unk_17C * 0.2f; sp4C += player->unk_17C * -3.0f; } if (D_MA_801BA1E8 == 99) { - sp50 = player->pos.y + 40.0f + (-player->unk_0E4 * 5.0f); - sp4C = player->pos.y + 200.0f + (player->unk_0E4 * 10.0f); + sp50 = player->pos.y + 40.0f + (-player->rot.x * 5.0f); + sp4C = player->pos.y + 200.0f + (player->rot.x * 10.0f); sp50 += player->unk_17C * 0.2f; sp4C += player->unk_17C * -3.0f; } else if (D_MA_801BA1E8 == 98) { sp50 = player->pos.y + 100.0f; - sp4C = player->pos.y + (player->unk_0E4 * 10.0f); + sp4C = player->pos.y + (player->rot.x * 10.0f); sp4C += player->unk_17C * -3.0f; } } else { @@ -110,7 +110,7 @@ void func_tank_80043468(Player* player) { Math_SmoothStepToF(&player->cam.at.x, sp48, 0.1f, player->unk_014 * 20.0f, 0.00001f); Math_SmoothStepToF(&player->cam.eye.z, 200.0f, 0.1f, player->unk_014 * 10.0f, 0.0f); Math_SmoothStepToF(&player->cam.at.z, sp40, 1.0f, player->unk_014 * 10.0f, 0.0f); - Math_SmoothStepToF(&player->camRoll, player->unk_0EC * -0.4f, 0.1f, 1.0f, 0.01f); + Math_SmoothStepToF(&player->camRoll, player->rot.z * -0.4f, 0.1f, 1.0f, 0.01f); Math_SmoothStepToF(&player->unk_014, 1.0f, 1.0f, 0.1f, 0.0f); } @@ -156,72 +156,72 @@ void func_tank_80043B18(Player* player) { f32 sp38; Matrix_Translate(gCalcMatrix, 0.0f, player->unk_18C + 30.0f, 0, MTXF_NEW); - Matrix_RotateY(gCalcMatrix, player->unk_114 * M_DTOR, MTXF_APPLY); - Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, (player->unk_0EC + player->unk_0F0) * M_DTOR, MTXF_APPLY); - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, -player->unk_12C * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, player->yRot_114 * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, player->rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, (player->rot.z + player->rockAngle) * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->rot.y + 180.0f) * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -player->zRotBank * M_DTOR, MTXF_APPLY); Matrix_Translate(gCalcMatrix, 0.0f, -30.0f, 0, MTXF_APPLY); sp48.y = 0.0f; sp48.z = -20.0f; - sp38 = player->unk_114; - if (player->unk_1DC != 0) { + sp38 = player->yRot_114; + if (player->barrelRoll != 0) { sp48.x = 0.0f; sp48.z = RAND_FLOAT_CENTERED(50.0f) + -20.0f; - if (player->unk_1EC < 0) { + if (player->rollRate < 0) { sp38 -= 65.0f; } else { sp38 += 65.0f; } Matrix_MultVec3f(gCalcMatrix, &sp48, &sp3C); if (gCurrentLevel == LEVEL_MACBETH) { - func_tank_80043AA0(player->pos.x + sp3C.x, player->pos.y + sp3C.y, player->unk_138 + sp3C.z, 0.2f); + func_tank_80043AA0(player->pos.x + sp3C.x, player->pos.y + sp3C.y, player->trueZpos + sp3C.z, 0.2f); } else { if (((gGameFrameCount % 2) == 0)) { - Titania_80189120(player->pos.x + sp3C.x, player->pos.y + sp3C.y, player->unk_138 + sp3C.z, - player->unk_0E8 + sp38, 1.3f); + Titania_80189120(player->pos.x + sp3C.x, player->pos.y + sp3C.y, player->trueZpos + sp3C.z, + player->rot.y + sp38, 1.3f); } if (((gGameFrameCount % 4) == 0)) { - func_effect_8007A900(player->pos.x + sp3C.x, player->pos.y + sp3C.y + 20.0f, player->unk_138 + sp3C.z, + func_effect_8007A900(player->pos.x + sp3C.x, player->pos.y + sp3C.y + 20.0f, player->trueZpos + sp3C.z, 2.0f, 255, 15, 0); } } } else { - sp38 += player->unk_12C; - if (player->unk_12C > -5.0f) { + sp38 += player->zRotBank; + if (player->zRotBank > -5.0f) { sp48.x = 36.0f; Matrix_MultVec3f(gCalcMatrix, &sp48, &sp3C); if (gCurrentLevel == LEVEL_MACBETH) { if ((gGameFrameCount % 2) != 0) { - func_tank_80043AA0(player->pos.x + sp3C.x, player->pos.y + sp3C.y, player->unk_138 + sp3C.z, 0.2f); + func_tank_80043AA0(player->pos.x + sp3C.x, player->pos.y + sp3C.y, player->trueZpos + sp3C.z, 0.2f); } } else { if (((gGameFrameCount % 2) == 0)) { - Titania_80189120(player->pos.x + sp3C.x, player->pos.y + sp3C.y, player->unk_138 + sp3C.z, - player->unk_0E8 + sp38, 1.0f); + Titania_80189120(player->pos.x + sp3C.x, player->pos.y + sp3C.y, player->trueZpos + sp3C.z, + player->rot.y + sp38, 1.0f); } if (((gGameFrameCount % 4) == 0) && (player->baseSpeed >= 5.0f)) { func_effect_8007A900(player->pos.x + sp3C.x, player->pos.y + sp3C.y + 20.0f, - player->unk_138 + sp3C.z, 2.0f, 255, 15, 0); + player->trueZpos + sp3C.z, 2.0f, 255, 15, 0); } } } - if (player->unk_12C < 5.0f) { + if (player->zRotBank < 5.0f) { sp48.x = -36.0f; Matrix_MultVec3f(gCalcMatrix, &sp48, &sp3C); if (gCurrentLevel == LEVEL_MACBETH) { if (((gGameFrameCount % 2) == 0)) { - func_tank_80043AA0(player->pos.x + sp3C.x, player->pos.y + sp3C.y, player->unk_138 + sp3C.z, 0.2f); + func_tank_80043AA0(player->pos.x + sp3C.x, player->pos.y + sp3C.y, player->trueZpos + sp3C.z, 0.2f); } } else { if (((gGameFrameCount % 2) == 0)) { - Titania_80189120(player->pos.x + sp3C.x, player->pos.y + sp3C.y, player->unk_138 + sp3C.z, - player->unk_0E8 + sp38, 1.0f); + Titania_80189120(player->pos.x + sp3C.x, player->pos.y + sp3C.y, player->trueZpos + sp3C.z, + player->rot.y + sp38, 1.0f); } if (((gGameFrameCount % 4) == 0) && (player->baseSpeed >= 5.0f)) { func_effect_8007A900(player->pos.x + sp3C.x, player->pos.y + sp3C.y + 20.0f, - player->unk_138 + sp3C.z, 2.0f, 255, 15, 0); + player->trueZpos + sp3C.z, 2.0f, 255, 15, 0); } } } @@ -256,21 +256,21 @@ void func_tank_800441C8(Player* player, f32* hitboxData, f32 xPos, f32 yPos, f32 if (player->vel.y <= 0.0f) { x = player->pos.x; y = player->pos.y - 10.0f; - z = player->unk_138; + z = player->trueZpos; if (func_tank_80044120(hitbox, x, y, z, xPos, yPos, zPos)) { - player->unk_1D4 = 1; + player->grounded = true; if (player->vel.y < -20.0f) { - player->unk_1F4 = 20; + player->hitTimer = 20; } player->vel.y = 0.0f; player->pos.y = yPos + 20.0f; - Math_SmoothStepToF(&player->unk_0E4, 0.0f, 0.3f, 5.0f, 0.0f); - Math_SmoothStepToF(&player->unk_0EC, 0.0f, 0.3f, 5.0f, 0.0f); + Math_SmoothStepToF(&player->rot.x, 0.0f, 0.3f, 5.0f, 0.0f); + Math_SmoothStepToF(&player->rot.z, 0.0f, 0.3f, 5.0f, 0.0f); } } else { x = player->pos.x; y = player->pos.y + 30.0f; - z = player->unk_138; + z = player->trueZpos; if (func_tank_80044120(hitbox, x, y, z, xPos, yPos, zPos)) { player->vel.y = 0.0f; player->pos.y = yPos - 75.0f; @@ -286,7 +286,7 @@ void func_tank_800443DC(Player* player) { for (i = 0, scenery = gScenery; i < ARRAY_COUNT(gScenery); i++, scenery++) { if ((scenery->obj.status == OBJ_ACTIVE) && (scenery->obj.id == OBJ_SCENERY_58) && - ((player->unk_138 - 2000.0f) < scenery->obj.pos.z)) { + ((player->trueZpos - 2000.0f) < scenery->obj.pos.z)) { func_tank_800441C8(player, scenery->info.hitbox, scenery->obj.pos.x, scenery->obj.pos.y, scenery->obj.pos.z, scenery->obj.rot.x, scenery->obj.rot.y, scenery->obj.rot.z); } @@ -302,14 +302,14 @@ void func_tank_800444BC(Player* player) { f32 sp30; sp30 = 5.0f; - player->unk_1D4 = 0; - if (player->unk_0D4 < 0.0f) { + player->grounded = false; + if (player->gravity < 0.0f) { sp30 = 0.0f; } sp40 = sp3C = 0.0f; sp38 = gGroundHeight; if (gGroundType == 4) { - Ground_801B6E20(player->pos.x, player->unk_138 + player->unk_144, &sp40, &sp38, &sp3C); + Ground_801B6E20(player->pos.x, player->trueZpos + player->zPath, &sp40, &sp38, &sp3C); } if (gCurrentLevel == LEVEL_MACBETH) { D_MA_801BE250[27] = gGroundHeight; @@ -324,9 +324,9 @@ void func_tank_800444BC(Player* player) { if (player->vel.y < -10.0f) { AUDIO_PLAY_SFX(0x09008015, player->sfxSource, 0); } - player->unk_1D4 = 1; + player->grounded = true; if (player->vel.y < -20.0f) { - player->unk_1F4 = 20; + player->hitTimer = 20; } if (gTiStartLandmaster != 0) { gTiStartLandmaster = 0; @@ -338,36 +338,36 @@ void func_tank_800444BC(Player* player) { sp34 = (player->baseSpeed * 0.2f) + 0.2f; player->vel.y = -3.0f; - if ((player->unk_104 > 0.0f) && (sp40 <= 0.0f)) { - player->vel.y = player->unk_104 * 0.5f * player->baseSpeed * 0.035f; - player->unk_0E4 = player->unk_104; + if ((player->rot_104.x > 0.0f) && (sp40 <= 0.0f)) { + player->vel.y = player->rot_104.x * 0.5f * player->baseSpeed * 0.035f; + player->rot.x = player->rot_104.x; } - if (player->unk_0D4 < 0.0f) { + if (player->gravity < 0.0f) { player->vel.y = 2.0f; if (player->vel.y) {} // fake? player->pos.y += 7.0f; } - player->unk_104 = RAD_TO_DEG(sp40); - player->unk_10C = RAD_TO_DEG(sp3C); + player->rot_104.x = RAD_TO_DEG(sp40); + player->rot_104.z = RAD_TO_DEG(sp3C); if (gCurrentLevel == LEVEL_MACBETH) { - if (player->unk_104 > 90.0f) { - player->unk_104 = -(180 - player->unk_104); + if (player->rot_104.x > 90.0f) { + player->rot_104.x = -(180 - player->rot_104.x); } - if (player->unk_10C > 90.0f) { - player->unk_10C = -(180 - player->unk_10C); + if (player->rot_104.z > 90.0f) { + player->rot_104.z = -(180 - player->rot_104.z); } } - if (player->unk_0E4 < player->unk_104) { - player->unk_0E4 += sp34; + if (player->rot.x < player->rot_104.x) { + player->rot.x += sp34; } - if (player->unk_0E4 > player->unk_104) { - player->unk_0E4 -= sp34; + if (player->rot.x > player->rot_104.x) { + player->rot.x -= sp34; } - if (player->unk_0EC < player->unk_10C) { - player->unk_0EC += sp34; + if (player->rot.z < player->rot_104.z) { + player->rot.z += sp34; } - if (player->unk_0EC > player->unk_10C) { - player->unk_0EC -= sp34; + if (player->rot.z > player->rot_104.z) { + player->rot.z -= sp34; } } if (gCurrentLevel == LEVEL_TITANIA) { @@ -377,20 +377,20 @@ void func_tank_800444BC(Player* player) { void func_tank_80044868(Player* player) { f32 pad; - f32 var_fv1; + f32 stickTilt; f32 sp2C; - var_fv1 = (gInputPress->stick_y * 0.7f) - 8.0f; - if (var_fv1 < -40.0f) { - var_fv1 = -40.0f; + stickTilt = (gInputPress->stick_y * 0.7f) - 8.0f; + if (stickTilt < -40.0f) { + stickTilt = -40.0f; } - if (var_fv1 > 0.0f) { - var_fv1 = 0.0f; + if (stickTilt > 0.0f) { + stickTilt = 0.0f; } - if (player->unk_17C < var_fv1) { + if (player->unk_17C < stickTilt) { player->unk_17C += 3.0f; } - if (var_fv1 < player->unk_17C) { + if (stickTilt < player->unk_17C) { player->unk_17C -= 3.0f; } if (player->unk_180 < 0.0f) { @@ -399,15 +399,15 @@ void func_tank_80044868(Player* player) { if (player->unk_180 > 0.0f) { player->unk_180 -= 3.0f; } - D_ctx_80177968 = 3.0f; - D_ctx_80177970 = 0.66f; - var_fv1 = gInputPress->stick_x; - if (var_fv1 == 0.0f) { - Math_SmoothStepToF(&player->unk_0E8, -var_fv1 * D_ctx_80177970, 0.1f, D_ctx_80177968 * 0.5f, 0.1f); + gPlayerTurnRate = 3.0f; + gPlayerTurnStickMod = 0.66f; + stickTilt = gInputPress->stick_x; + if (stickTilt == 0.0f) { + Math_SmoothStepToF(&player->rot.y, -stickTilt * gPlayerTurnStickMod, 0.1f, gPlayerTurnRate * 0.5f, 0.1f); } else { - Math_SmoothStepToF(&player->unk_0E8, -var_fv1 * D_ctx_80177970, 0.1f, D_ctx_80177968, 0.1f); + Math_SmoothStepToF(&player->rot.y, -stickTilt * gPlayerTurnStickMod, 0.1f, gPlayerTurnRate, 0.1f); } - player->unk_108 = player->unk_0E8; + player->rot_104.y = player->rot.y; sp2C = player->baseSpeed; if ((gCurrentLevel == LEVEL_MACBETH) && (sp2C < 3.0f)) { @@ -419,51 +419,51 @@ void func_tank_80044868(Player* player) { if (player->unk_170 > 0.2f) { Math_SmoothStepToF(&player->unk_184, -player->baseSpeed * 0.5f, 1.0f, 1.0f, 0.0f); } - if (!(player->unk_170 > 0.2f) && !(player->unk_16C > 0.2f) && (player->unk_1D4 != 0)) { + if (!(player->unk_170 > 0.2f) && !(player->unk_16C > 0.2f) && player->grounded) { Math_SmoothStepToF(&player->unk_184, 0.0f, 1.0f, 0.75f, 0.0f); } - if (player->unk_1DC != 0) { - if (player->unk_1EC < 0) { + if (player->barrelRoll != 0) { + if (player->rollRate < 0) { player->unk_184 = 15.0f; } - if (player->unk_1EC > 0) { + if (player->rollRate > 0) { player->unk_184 = -15.0f; } } - player->vel.z = -(COS_DEG(player->unk_108) * COS_DEG(player->unk_104) * sp2C); - if ((player->vel.x < 20.0f) && (player->unk_10C < -30.0f)) { - Math_SmoothStepToF(&player->vel.x, -player->unk_10C * 0.5f, 0.2f, 3.0f, 0.0f); + player->vel.z = -(COS_DEG(player->rot_104.y) * COS_DEG(player->rot_104.x) * sp2C); + if ((player->vel.x < 20.0f) && (player->rot_104.z < -30.0f)) { + Math_SmoothStepToF(&player->vel.x, -player->rot_104.z * 0.5f, 0.2f, 3.0f, 0.0f); player->unk_184 = 0.0f; - } else if ((player->vel.x > -20.0f) && (player->unk_10C > 30.0f)) { - Math_SmoothStepToF(&player->vel.x, -player->unk_10C * 0.5f, 0.2f, 3.0f, 0.0f); + } else if ((player->vel.x > -20.0f) && (player->rot_104.z > 30.0f)) { + Math_SmoothStepToF(&player->vel.x, -player->rot_104.z * 0.5f, 0.2f, 3.0f, 0.0f); player->unk_184 = 0.0f; } else { - Math_SmoothStepToF(&player->vel.x, player->unk_184 - (SIN_DEG(player->unk_108) * sp2C), 0.5f, 5.0f, 0.0f); + Math_SmoothStepToF(&player->vel.x, player->unk_184 - (SIN_DEG(player->rot_104.y) * sp2C), 0.5f, 5.0f, 0.0f); } player->vel.z += fabsf((player->unk_184 * 0.4f * player->baseSpeed) / 15.0f); if (player->unk_000 == 0) { - player->vel.z += SIN_DEG(player->unk_0E4) * player->boostSpeed; + player->vel.z += SIN_DEG(player->rot.x) * player->boostSpeed; } if (D_800C9F00 != 0) { player->vel.z = 2.0f * D_800C9F00; } player->pos.x += player->vel.x; - if ((player->unk_0AC + (player->unk_09C - 100.0f)) < player->pos.x) { + if ((player->xPath + (player->pathWidth - 100.0f)) < player->pos.x) { player->flags_228 = PFLAG_228_0; } - if (player->pos.x < (player->unk_0AC - (player->unk_09C - 100.0f))) { + if (player->pos.x < (player->xPath - (player->pathWidth - 100.0f))) { player->flags_228 = PFLAG_228_1; } - if (player->unk_09C + player->unk_0AC < player->pos.x) { - player->pos.x = player->unk_09C + player->unk_0AC; + if (player->pathWidth + player->xPath < player->pos.x) { + player->pos.x = player->pathWidth + player->xPath; player->vel.x = 0.0f; } - if (player->pos.x < player->unk_0AC - player->unk_09C) { - player->pos.x = player->unk_0AC - player->unk_09C; + if (player->pos.x < player->xPath - player->pathWidth) { + player->pos.x = player->xPath - player->pathWidth; player->vel.x = 0.0f; } player->pos.y += player->vel.y; - player->vel.y -= player->unk_0D4; + player->vel.y -= player->gravity; if (player->vel.y < -50.0f) { player->vel.y = -50.0f; @@ -472,15 +472,15 @@ void func_tank_80044868(Player* player) { player->vel.y = 20.0f; } player->pos.z += player->vel.z; - if (player->unk_1D4 != 0) { - player->unk_0A0 = 0.0f; - player->unk_0F4 += player->baseSpeed * 5.0f; - player->unk_0F0 = SIN_DEG(player->unk_0F4) * 0.7f; + if (player->grounded) { + player->pathHeight = 0.0f; + player->rockPhase += player->baseSpeed * 5.0f; + player->rockAngle = SIN_DEG(player->rockPhase) * 0.7f; if (D_800C9F04 == 0) { if (player->baseSpeed != 0.0f) { func_tank_80043B18(player); } - if (player->unk_1DC != 0.0f) { + if (player->barrelRoll != 0.0f) { func_tank_80043B18(player); } } @@ -508,32 +508,32 @@ void func_tank_80045130(Player* player) { Math_SmoothStepToF(&player->unk_16C, 0.0f, 1.0f, 0.2f, 0.0f); if (gInputPress->button & Z_TRIG) { player->sfx.bank = 1; - if ((player->timer_1E0 != 0) && (player->unk_12C > 0.0f) && (player->boostMeter < 10.0f)) { - player->unk_1DC = 1; + if ((player->barrelInputTimerL != 0) && (player->zRotBank > 0.0f) && (player->boostMeter < 10.0f)) { + player->barrelRoll = 1; player->timer_1E8 = 15; - player->unk_1F0 = 20; - player->unk_1EC = 20; + player->baseRollRate = 20; + player->rollRate = 20; player->sfx.roll = 1; AUDIO_PLAY_SFX(0x1100000A, player->sfxSource, 0); } else { - player->timer_1E0 = 10; + player->barrelInputTimerL = 10; } } if (gInputPress->button & R_TRIG) { player->sfx.bank = 1; - if ((player->timer_1E4 != 0) && (player->unk_12C < 0.0f) && (player->boostMeter < 10.0f)) { - player->unk_1DC = 1; + if ((player->barrelInputTimerR != 0) && (player->zRotBank < 0.0f) && (player->boostMeter < 10.0f)) { + player->barrelRoll = 1; player->timer_1E8 = 15; - player->unk_1F0 = -20; - player->unk_1EC = -20; + player->baseRollRate = -20; + player->rollRate = -20; player->sfx.roll = 1; AUDIO_PLAY_SFX(0x1100000A, player->sfxSource, 0); } else { - player->timer_1E4 = 10; + player->barrelInputTimerR = 10; } } - player->unk_18C = fabsf(SIN_DEG(player->unk_12C) * 25.0f); - player->unk_18C += fabsf(SIN_DEG(player->unk_130) * 20.0f); + player->unk_18C = fabsf(SIN_DEG(player->zRotBank) * 25.0f); + player->unk_18C += fabsf(SIN_DEG(player->zRotBarrelRoll) * 20.0f); } void func_tank_80045348(Player* player) { @@ -580,7 +580,7 @@ void func_tank_80045348(Player* player) { D_800C9F28 = 0.0f; } Math_SmoothStepToF(&player->baseSpeed, sp44, sp3C, sp38, 0.001f); - Math_SmoothStepToF(&player->unk_08C, sp40, sp3C, sp38, 0.001f); + Math_SmoothStepToF(&player->camDist, sp40, sp3C, sp38, 0.001f); } else if (player->unk_19C == -1) { Math_SmoothStepToF(&player->baseSpeed, player->unk_000, 0.1f, 2.0f, 0.01f); } @@ -591,7 +591,7 @@ void func_tank_80045678(Player* player) { f32 temp; f32 pad; - player->unk_0D4 = 3.0f; + player->gravity = 3.0f; if (!(gInputHold->button & Z_TRIG)) { Audio_KillSfxBySourceAndId(player->sfxSource, 0x01008016); Audio_KillSfxBySourceAndId(player->sfxSource, 0x1100000A); @@ -602,21 +602,21 @@ void func_tank_80045678(Player* player) { AUDIO_PLAY_SFX(0x01004024, player->sfxSource, 0); } player->unk_188 = 0.0f; - player->unk_12C += 4.0f; - if (player->unk_12C > 50.0f) { - player->unk_12C = 50.0f; + player->zRotBank += 4.0f; + if (player->zRotBank > 50.0f) { + player->zRotBank = 50.0f; } Math_SmoothStepToF(&player->unk_170, 1.0f, 1.0f, 0.4f, 0.0f); D_800C9F20 += 1.0f; } else { - if (player->unk_12C > 0) { + if (player->zRotBank > 0) { player->unk_188 += 1.5f; - player->unk_12C -= player->unk_188; - if (player->unk_12C <= 0.0f) { - player->unk_12C = 0.0f; + player->zRotBank -= player->unk_188; + if (player->zRotBank <= 0.0f) { + player->zRotBank = 0.0f; if (player->unk_188 > 3.0f) { player->unk_188 *= -0.4f; - player->unk_12C -= player->unk_188; + player->zRotBank -= player->unk_188; } } } @@ -632,124 +632,124 @@ void func_tank_80045678(Player* player) { AUDIO_PLAY_SFX(0x01004024, player->sfxSource, 0); } player->unk_188 = 0.0f; - player->unk_12C -= 4.0f; - if (player->unk_12C < -50.0f) { - player->unk_12C = -50.0f; + player->zRotBank -= 4.0f; + if (player->zRotBank < -50.0f) { + player->zRotBank = -50.0f; } Math_SmoothStepToF(&player->unk_16C, 1.0f, 1.0f, 0.4f, 0.0f); player->unk_2C0 += 1.0f; } else { - if (player->unk_12C < 0.0f) { + if (player->zRotBank < 0.0f) { player->unk_188 += 1.5f; - player->unk_12C += player->unk_188; - if (player->unk_12C >= 0.0f) { - player->unk_12C = 0.0f; + player->zRotBank += player->unk_188; + if (player->zRotBank >= 0.0f) { + player->zRotBank = 0.0f; if (player->unk_188 > 3.0f) { player->unk_188 *= -0.4f; - player->unk_12C += player->unk_188; + player->zRotBank += player->unk_188; } } } player->unk_2C0 = 0.0f; } Math_SmoothStepToF(&player->boostSpeed, 0.0f, 0.1f, 1.0f, 0); - if ((player->unk_16C > 0.2f) && (player->unk_170 > 0.2f) && (player->timer_220 == 0)) { + if ((player->unk_16C > 0.2f) && (player->unk_170 > 0.2f) && (player->radioDamageTimer == 0)) { if (D_800C9F3C == 0) { D_800C9F3C = 1; Audio_KillSfxBySourceAndId(player->sfxSource, 0x1100000A); Audio_KillSfxBySourceAndId(player->sfxSource, 0x01004024); AUDIO_PLAY_SFX(0x01008016, player->sfxSource, 0); } - player->unk_12C += ((__cosf(gGameFrameCount * M_DTOR * 8.0f) * 10.0f) - player->unk_12C) * 0.1f; + player->zRotBank += ((__cosf(gGameFrameCount * M_DTOR * 8.0f) * 10.0f) - player->zRotBank) * 0.1f; temp = -gInputPress->stick_y; - Math_SmoothStepToF(&player->unk_0E4, temp * 0.3f, 0.05f, 5.0f, 0.00001f); + Math_SmoothStepToF(&player->rot.x, temp * 0.3f, 0.05f, 5.0f, 0.00001f); Math_SmoothStepToF(&player->boostSpeed, 15.0f, 0.5f, 5.0f, 0.0f); - Math_SmoothStepToF(&player->unk_0EC, 0.0f, 0.1f, 5.0f, 0.00001f); - player->unk_0D4 = -0.4f; - player->unk_0A0 += player->vel.y; + Math_SmoothStepToF(&player->rot.z, 0.0f, 0.1f, 5.0f, 0.00001f); + player->gravity = -0.4f; + player->pathHeight += player->vel.y; - if (player->unk_0A0 > 300.0f) { - player->unk_0D4 = 0.0f; + if (player->pathHeight > 300.0f) { + player->gravity = 0.0f; Math_SmoothStepToF(&player->vel.y, 0.0f, 0.1f, 2.0f, 0); } if ((gCamCount == 1) && ((gGameFrameCount % 2) == 0)) { - 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, 255, 16, 1); + func_effect_8007A900(RAND_FLOAT_CENTERED(20.0f) + player->pos.x, player->groundPos.y + 10.0f, + player->trueZpos - 10.0f, RAND_FLOAT(2.0f) + 3.5f, 255, 16, 1); } } else { D_800C9F3C = 0; - if ((gCamCount == 1) && ((gGameFrameCount % 4) == 0) && (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, 255, 15, 0); + if ((gCamCount == 1) && ((gGameFrameCount % 4) == 0) && (player->barrelRoll == 0)) { + if ((player->unk_16C > 0.2f) && (player->radioDamageTimer == 0)) { + func_effect_8007A900(RAND_FLOAT_CENTERED(10.0f) + (player->pos.x - 57.0f), player->groundPos.y + 10.0f, + player->trueZpos - 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, 255, 15, 0); + if ((player->unk_170 > 0.2f) && (player->radioDamageTimer == 0)) { + func_effect_8007A900(RAND_FLOAT_CENTERED(10.0f) + (player->pos.x + 57.0f), player->groundPos.y + 10.0f, + player->trueZpos - 10.0f, RAND_FLOAT(1.0f) + 1.5f, 255, 15, 0); } } } } void func_tank_80045E7C(Player* player) { - player->unk_130 = Math_ModF(player->unk_130, 360.0f); - if (player->unk_1DC == 0) { - if (player->unk_130 > 0.0f) { - player->unk_130 -= player->unk_130 * 0.1f; - if (player->unk_130 < 0.1f) { - player->unk_130 = 0.0f; + player->zRotBarrelRoll = Math_ModF(player->zRotBarrelRoll, 360.0f); + if (player->barrelRoll == 0) { + if (player->zRotBarrelRoll > 0.0f) { + player->zRotBarrelRoll -= player->zRotBarrelRoll * 0.1f; + if (player->zRotBarrelRoll < 0.1f) { + player->zRotBarrelRoll = 0.0f; } } - if (player->unk_130 < 0.0f) { - player->unk_130 -= player->unk_130 * 0.1f; - if (player->unk_130 > -0.1f) { - player->unk_130 = 0.0f; + if (player->zRotBarrelRoll < 0.0f) { + player->zRotBarrelRoll -= player->zRotBarrelRoll * 0.1f; + if (player->zRotBarrelRoll > -0.1f) { + player->zRotBarrelRoll = 0.0f; } } } - if (player->timer_1E0 != 0) { - player->timer_1E0--; + if (player->barrelInputTimerL != 0) { + player->barrelInputTimerL--; } - if (player->timer_1E4 != 0) { - player->timer_1E4--; + if (player->barrelInputTimerR != 0) { + player->barrelInputTimerR--; } if (player->timer_1E8 != 0) { player->timer_1E8--; } - if (player->unk_1DC != 0) { - player->timer_1E4 = 0; - player->timer_1E0 = 0; - player->unk_130 += player->unk_1EC; - if (player->unk_12C > 0.0f) { - player->unk_12C -= 8.0f; - if (player->unk_12C < 0.0f) { - player->unk_12C = 0.0f; + if (player->barrelRoll != 0) { + player->barrelInputTimerR = 0; + player->barrelInputTimerL = 0; + player->zRotBarrelRoll += player->rollRate; + if (player->zRotBank > 0.0f) { + player->zRotBank -= 8.0f; + if (player->zRotBank < 0.0f) { + player->zRotBank = 0.0f; } } - if (player->unk_12C < 0.0f) { - player->unk_12C += 8.0f; - if (player->unk_12C > 0.0f) { - player->unk_12C = 0.0f; + if (player->zRotBank < 0.0f) { + player->zRotBank += 8.0f; + if (player->zRotBank > 0.0f) { + player->zRotBank = 0.0f; } } if (player->timer_1E8 == 0) { D_ctx_801779A8[player->num] = 25.0f; - if (player->unk_1EC > 0) { - player->unk_1EC -= 2; + if (player->rollRate > 0) { + player->rollRate -= 2; } - if (player->unk_1EC < 0) { - player->unk_1EC += 2; + if (player->rollRate < 0) { + player->rollRate += 2; } - if (player->unk_1EC == 0) { - player->unk_1DC = 0; + if (player->rollRate == 0) { + player->barrelRoll = 0; Audio_KillSfxBySourceAndId(player->sfxSource, 0x1100000A); } } - if ((player->timer_1E8 >= 5) && (player->unk_1F4 == 0) && (player->unk_1DC != 9)) { - if (player->unk_1EC > 0) { + if ((player->timer_1E8 >= 5) && (player->hitTimer == 0) && (player->barrelRoll != 9)) { + if (player->rollRate > 0) { player->unk_170 = 1.3f; } - if (player->unk_1EC < 0) { + if (player->rollRate < 0) { player->unk_16C = 1.3f; } } @@ -771,14 +771,14 @@ void func_tank_800460E0(Player* player, f32* hitboxData, f32 arg2, f32 arg3, f32 spf94.x = player->pos.x; spf94.y = arg3; - spf94.z = player->unk_138; + spf94.z = player->trueZpos; sp88.x = spf94.x - arg2; sp88.y = spf94.y - arg3; sp88.z = spf94.z - arg4; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp88, &sp7C); if (func_play_800A78C4(hitbox, arg2, arg3, arg4, sp7C.x + arg2, sp7C.y + arg3, sp7C.z + arg4)) { - player->unk_068 = arg3 + 20.0f + 3.0f; + player->groundPos.y = arg3 + 20.0f + 3.0f; } } } @@ -790,7 +790,7 @@ void func_tank_80046260(Player* player) { for (i = 0, scenery = gScenery; i < ARRAY_COUNT(gScenery); i++, scenery++) { if ((scenery->obj.status == OBJ_ACTIVE) && (scenery->obj.id == OBJ_SCENERY_58) && - ((player->unk_138 - 2000.0f) < scenery->obj.pos.z) && (scenery->obj.pos.y < player->pos.y)) { + ((player->trueZpos - 2000.0f) < scenery->obj.pos.z) && (scenery->obj.pos.y < player->pos.y)) { func_tank_800460E0(player, scenery->info.hitbox, scenery->obj.pos.x, scenery->obj.pos.y, scenery->obj.pos.z, scenery->obj.rot.x, scenery->obj.rot.y, scenery->obj.rot.z); } @@ -806,14 +806,14 @@ void func_tank_80046358(Player* player) { s32 pad1; s32 pad2; - player->unk_064 = player->pos.x; - player->unk_06C = player->unk_138 + -20.0f; - player->unk_068 = gGroundHeight + 3.0f; + player->groundPos.x = player->pos.x; + player->groundPos.z = player->trueZpos + -20.0f; + player->groundPos.y = gGroundHeight + 3.0f; player->unk_248 = 0.0f; player->unk_24C = 0.0f; - player->unk_070 = 0.0f; - Ground_801B6E20(player->unk_064, player->unk_06C + player->unk_144, &spD4, &spD0, &spCC); - player->unk_068 = spD0 + 2.0f; + player->groundRotY = 0.0f; + Ground_801B6E20(player->groundPos.x, player->groundPos.z + player->zPath, &spD4, &spD0, &spCC); + player->groundPos.y = spD0 + 2.0f; player->unk_248 = spD4; player->unk_24C = spCC; } @@ -836,7 +836,7 @@ void func_tank_8004641C(Player* player, s32 arg1, f32 arg2, f32 arg3, f32 arg4, Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp70, &sp4C); sp70.x = player->pos.x - arg2; sp70.y = player->pos.y - arg3; - sp70.z = player->unk_138 - arg4; + sp70.z = player->trueZpos - arg4; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp70, &sp64); sp84 = sp64.x + arg2; sp80 = sp64.y + arg3; @@ -845,7 +845,7 @@ void func_tank_8004641C(Player* player, s32 arg1, f32 arg2, f32 arg3, f32 arg4, if (D_MA_801BE250[27] < arg3 + sp58.y) { D_MA_801BE250[27] = arg3 + sp58.y; if (arg1 == OBJ_SCENERY_67) { - player->unk_1DC = 0; + player->barrelRoll = 0; D_800C9F04 = 1; } } @@ -853,18 +853,18 @@ void func_tank_8004641C(Player* player, s32 arg1, f32 arg2, f32 arg3, f32 arg4, D_MA_801BE250[29] = sp58.z; } else if ((arg1 == OBJ_SCENERY_67) && (D_MA_801BE250[27] == 0.0f) && func_play_800A8054(arg1, arg2 + 20.0f, arg3, arg4, sp84, sp80, sp7C, &sp58, &sp4C)) { - player->unk_1DC = 9; + player->barrelRoll = 9; player->timer_1E8 = 15; if ((arg6 > 90.0f) && (arg6 < 270.0f)) { - player->unk_1EC = player->unk_1F0 = 20; + player->rollRate = player->baseRollRate = 20; } else { - player->unk_1EC = player->unk_1F0 = -20; + player->rollRate = player->baseRollRate = -20; } } if (func_play_800A8054(arg1, arg2, arg3, arg4, sp84, arg3, sp7C, &sp58, &sp4C) && (D_800C9F10 <= arg3 + sp58.y)) { D_800C9F10 = arg3 + sp58.y; - player->unk_064 = player->pos.x; - player->unk_068 = D_800C9F10 - 2.0f; + player->groundPos.x = player->pos.x; + player->groundPos.y = D_800C9F10 - 2.0f; player->unk_248 = sp58.x; player->unk_24C = sp58.z; } @@ -884,12 +884,12 @@ void func_tank_80046704(Player* player) { } if (1) {} for (i = 0, scenery = gScenery; i < ARRAY_COUNT(gScenery); i++, scenery++) { - if ((scenery->obj.status == OBJ_ACTIVE) && ((player->unk_138 - 2000.0f) < scenery->obj.pos.z)) { + if ((scenery->obj.status == OBJ_ACTIVE) && ((player->trueZpos - 2000.0f) < scenery->obj.pos.z)) { if ((scenery->obj.id == OBJ_SCENERY_69) || (scenery->obj.id == OBJ_SCENERY_70) || (scenery->obj.id == OBJ_SCENERY_71) || (scenery->obj.id == OBJ_SCENERY_72) || (scenery->obj.id == OBJ_SCENERY_73) || (scenery->obj.id == OBJ_SCENERY_67)) { temp1 = scenery->obj.pos.x - player->pos.x; - temp2 = scenery->obj.pos.z - player->unk_138; + temp2 = scenery->obj.pos.z - player->trueZpos; if (sqrtf(SQ(temp1) + SQ(temp2)) < 2000.0f) { func_tank_8004641C(player, scenery->obj.id, scenery->obj.pos.x, scenery->obj.pos.y, @@ -899,11 +899,11 @@ void func_tank_80046704(Player* player) { if (((player->pos.x - 820.0f) <= scenery->obj.pos.x) && (scenery->obj.pos.x <= (player->pos.x + 820.0f)) && ((player->pos.y - 50.0f) <= scenery->obj.pos.y) && - (scenery->obj.pos.y <= (player->pos.y + 50.0f)) && (player->unk_138 <= scenery->obj.pos.z) && - (scenery->obj.pos.z <= (player->unk_138 + 960.0f))) { + (scenery->obj.pos.y <= (player->pos.y + 50.0f)) && (player->trueZpos <= scenery->obj.pos.z) && + (scenery->obj.pos.z <= (player->trueZpos + 960.0f))) { D_MA_801BE250[27] = scenery->obj.pos.y; - player->unk_064 = player->pos.x; - player->unk_068 = D_MA_801BE250[27] - 3.0f; + player->groundPos.x = player->pos.x; + player->groundPos.y = D_MA_801BE250[27] - 3.0f; } } if ((scenery->obj.id == OBJ_SCENERY_59) || (scenery->obj.id == OBJ_SCENERY_60) || @@ -922,14 +922,14 @@ void func_tank_80046704(Player* player) { case 1: case 2: Math_SmoothStepToF(&player->baseSpeed, 15.0f, 0.3f, 3.5f, 0.001f); - Math_SmoothStepToF(&player->unk_08C, 0, 0.3f, 3.5f, 0.001f); + Math_SmoothStepToF(&player->camDist, 0, 0.3f, 3.5f, 0.001f); if (temp_v0 == 1) { player->vel.x = -10.0f; } else { player->vel.x = 10.0f; } - player->pos.x = player->unk_090.x; - player->unk_0D8.x = 2.0f * D_800C9F4C[temp_v0]; + player->pos.x = player->basePos.x; + player->knockback.x = 2.0f * D_800C9F4C[temp_v0]; player->pos.x += (D_800C9F4C[temp_v0] * 5.0f); break; case 3: @@ -949,35 +949,35 @@ void func_tank_80046704(Player* player) { (scenery->obj.pos.x <= (player->pos.x + 230.0f)) && ((80.0f <= player->pos.y - scenery->obj.pos.y)) && ((player->pos.y - scenery->obj.pos.y) < 210.0f) && - ((player->unk_138 - 220.0f) <= scenery->obj.pos.z) && - (scenery->obj.pos.z <= (player->unk_138 + 220.0f))) { + ((player->trueZpos - 220.0f) <= scenery->obj.pos.z) && + (scenery->obj.pos.z <= (player->trueZpos + 220.0f))) { if (!(((player->pos.x - 210.0f) <= scenery->obj.pos.x) && (scenery->obj.pos.x <= (player->pos.x + 210.0f))) && (D_MA_801BE250[27] == 0.f) && (player->vel.y < 0.f)) { - player->unk_1DC = 9; + player->barrelRoll = 9; player->timer_1E8 = 15; if ((player->pos.x - 200.0f) <= scenery->obj.pos.x) { - player->unk_1EC = player->unk_1F0 = 20; + player->rollRate = player->baseRollRate = 20; } else { - player->unk_1EC = player->unk_1F0 = -20; + player->rollRate = player->baseRollRate = -20; } } else { D_800C9F04 = 1; D_MA_801BE250[27] = scenery->obj.pos.y + 206.0f; - player->unk_1DC = 0; + player->barrelRoll = 0; } } if (((player->pos.x - 220.0f) <= scenery->obj.pos.x) && (scenery->obj.pos.x <= (player->pos.x + 220.0f)) && - ((player->unk_138 - 220.0f) <= scenery->obj.pos.z) && - (scenery->obj.pos.z <= (player->unk_138 + 220.0f)) && (player->pos.y >= 200.0f)) { - player->unk_068 = scenery->obj.pos.y + 204.0f; + ((player->trueZpos - 220.0f) <= scenery->obj.pos.z) && + (scenery->obj.pos.z <= (player->trueZpos + 220.0f)) && (player->pos.y >= 200.0f)) { + player->groundPos.y = scenery->obj.pos.y + 204.0f; } - } else if ((scenery->obj.id == OBJ_SCENERY_105) && Macbeth_801A3C20(player->unk_138)) { + } else if ((scenery->obj.id == OBJ_SCENERY_105) && Macbeth_801A3C20(player->trueZpos)) { if (((player->pos.x - 200.0f) < D_MA_801BE250[21]) && (D_MA_801BE250[21] < (player->pos.x + 200.0f))) { - player->unk_068 = D_MA_801BE250[22] - 1.0f; + player->groundPos.y = D_MA_801BE250[22] - 1.0f; } } } @@ -1146,12 +1146,12 @@ void func_tank_80047504(Player* player) { if (gCurrentLevel != LEVEL_MACBETH) { func_play_800A8BA4(player); } else { - player->unk_064 = player->pos.x; - player->unk_06C = player->unk_138 + -10.0f; - player->unk_068 = gGroundHeight - 4.0f; + player->groundPos.x = player->pos.x; + player->groundPos.z = player->trueZpos + -10.0f; + player->groundPos.y = gGroundHeight - 4.0f; player->unk_248 = 0.0f; player->unk_24C = 0.0f; - player->unk_070 = 0.0f; + player->groundRotY = 0.0f; func_tank_800481F4(player); } if (gCurrentLevel == LEVEL_TITANIA) { @@ -1159,8 +1159,8 @@ void func_tank_80047504(Player* player) { func_tank_80046260(player); } func_play_800B415C(player); - if ((player->shields <= 0) && (player->timer_220 != 0)) { - func_play_800B41EC(player); + if ((player->shields <= 0) && (player->radioDamageTimer != 0)) { + Player_Down(player); } } @@ -1168,12 +1168,12 @@ void func_tank_80047504(Player* player) { void func_tank_80047754(Player* player) { u8 sp2F = false; - if ((D_MA_801BE2F0[5] == 0) && (Macbeth_801A3300(player, player->unk_138, player->unk_0E8) == 0)) { + if ((D_MA_801BE2F0[5] == 0) && (Macbeth_801A3300(player, player->trueZpos, player->rot.y) == 0)) { if (((player->pos.x - 110.0f) < D_MA_801BE250[9]) && (D_MA_801BE250[9] < (player->pos.x + 110.0f)) && ((player->pos.y - 60.0f) < (D_MA_801BE250[2] + 30.0f)) && ((D_MA_801BE250[2] + 30.0f) < (player->pos.y + 60.f))) { func_tank_80047D38(player, D_MA_801BE250[2] + 29.0f); - player->unk_0E4 = D_MA_801BE250[3]; + player->rot.x = D_MA_801BE250[3]; func_tank_80047FBC(player); sp2F = true; } else { @@ -1185,27 +1185,27 @@ void func_tank_80047754(Player* player) { if (1) {} } } - if (Macbeth_801A3C20(player->unk_138)) { - player->unk_0E4 = D_MA_801BE250[23]; + if (Macbeth_801A3C20(player->trueZpos)) { + player->rot.x = D_MA_801BE250[23]; if (((player->pos.x - 200.0f) < D_MA_801BE250[21]) && (D_MA_801BE250[21] < (player->pos.x + 200.0f))) { if (((player->pos.y - 60.0f) < D_MA_801BE250[22]) && (D_MA_801BE250[22] < (player->pos.y + 60.0f))) { func_tank_80047D38(player, D_MA_801BE250[22]); } else { if ((100.0f < (D_MA_801BE250[22] - player->pos.y)) && ((D_MA_801BE250[22] - player->pos.y) < 130.0f)) { - player->unk_0A0 = 999.0f; - player->pos.y = player->unk_090.y - 1.0f; + player->pathHeight = 999.0f; + player->pos.y = player->basePos.y - 1.0f; } goto label_29; } if (!(((player->pos.x - 65.0f) < D_MA_801BE250[21]) && (D_MA_801BE250[21] < (player->pos.x + 65.0f)))) { if (!(((player->pos.x - 100.0f) < D_MA_801BE250[21]) && (D_MA_801BE250[21] < (player->pos.x + 100.0f)))) { - player->unk_1D4 = 9; + player->grounded = 9; Math_SmoothStepToF(&player->pos.y, D_MA_801BE250[22] + 100.0f, 0.5f, 20.0f, 0); player->vel.y = 2.0f; - Math_SmoothStepToF(&player->unk_0E8, 0.0f, 0.5f, 20.0f, 0); + Math_SmoothStepToF(&player->rot.y, 0.0f, 0.5f, 20.0f, 0); Math_SmoothStepToF(&player->pos.x, D_MA_801BE250[21], 0.02f, 30.0f, 0); - Math_SmoothStepToF(&player->unk_12C, -30.0f, 1.0f, 10.0f, 0); + Math_SmoothStepToF(&player->zRotBank, -30.0f, 1.0f, 10.0f, 0); D_MA_801BE250[13] += 0; // fake? } player->unk_188 = 0; @@ -1221,15 +1221,15 @@ void func_tank_80047754(Player* player) { } label_29: - if (((D_MA_801BE2F0[5] == 1) || (player->unk_138 < -116467.875f)) && - (Macbeth_801A3790(player, player->unk_138, player->unk_0E8) == 0)) { + if (((D_MA_801BE2F0[5] == 1) || (player->trueZpos < -116467.875f)) && + (Macbeth_801A3790(player, player->trueZpos, player->rot.y) == 0)) { if (((player->pos.x - 110.0f) < D_MA_801BE250[19]) && (D_MA_801BE250[19] < (player->pos.x + 110.0f)) && ((player->pos.y - 60.0f) < (D_MA_801BE250[12] + 30.0f)) && ((D_MA_801BE250[12] + 30.0f) < (player->pos.y + 60.0f))) { sp2F = true; func_tank_80047D38(player, D_MA_801BE250[12] + 29.0f); - player->unk_0E4 = D_MA_801BE250[13]; // not fake, but weird - player->unk_0E4 = D_MA_801BE250[13]; + player->rot.x = D_MA_801BE250[13]; // not fake, but weird + player->rot.x = D_MA_801BE250[13]; func_tank_80047FBC(player); } else { if (((player->pos.x - 150.0f) < D_MA_801BE250[19]) && (D_MA_801BE250[19] < (player->pos.x + 150.0f)) && @@ -1247,18 +1247,19 @@ label_29: } void func_tank_80047D38(Player* player, f32 arg1) { - if ((player->unk_16C > 0.2f) && (player->unk_170 > 0.2f) && (player->timer_220 == 0) && (player->vel.y >= 0.0f)) { + if ((player->unk_16C > 0.2f) && (player->unk_170 > 0.2f) && (player->radioDamageTimer == 0) && + (player->vel.y >= 0.0f)) { return; } if ((player->pos.y - 5.0f) < arg1) { if (player->vel.y < -10.0f) { AUDIO_PLAY_SFX(0x09008015, player->sfxSource, 0); - player->unk_1F4 = 10; + player->hitTimer = 10; } D_800C9F04 = 1; - player->unk_1D4 = 1; + player->grounded = true; Math_SmoothStepToF(&player->pos.y, arg1, 0.5f, 30.0f, 0.02f); - player->unk_068 = arg1 - 1.0f; + player->groundPos.y = arg1 - 1.0f; D_800C9F00 = 0; player->vel.y = 0.0f; } @@ -1267,25 +1268,25 @@ void func_tank_80047D38(Player* player, f32 arg1) { void func_tank_80047E7C(Player* player, f32 arg1, f32 arg2) { player->unk_188 = 0.0f; if (player->pos.x < arg1) { - if (player->unk_12C >= -10.0f) { - Math_SmoothStepToF(&player->unk_12C, 30.0f, 0.5f, 20.0f, 0); + if (player->zRotBank >= -10.0f) { + Math_SmoothStepToF(&player->zRotBank, 30.0f, 0.5f, 20.0f, 0); } else { Math_SmoothStepToF(&player->pos.y, arg2, 0.5f, 30.0f, 0); - if (player->unk_1DC == 0) { - player->unk_1DC = 9; + if (player->barrelRoll == 0) { + player->barrelRoll = 9; player->timer_1E8 = 15; - player->unk_1EC = player->unk_1F0 = -20; + player->rollRate = player->baseRollRate = -20; } } } else { - if (player->unk_12C <= 10.0f) { - Math_SmoothStepToF(&player->unk_12C, -30.0f, 0.5f, 20.0f, 0); + if (player->zRotBank <= 10.0f) { + Math_SmoothStepToF(&player->zRotBank, -30.0f, 0.5f, 20.0f, 0); } else { Math_SmoothStepToF(&player->pos.y, arg2, 0.5f, 30.0f, 0); - if (player->unk_1DC == 0) { - player->unk_1DC = 9; + if (player->barrelRoll == 0) { + player->barrelRoll = 9; player->timer_1E8 = 15; - player->unk_1EC = player->unk_1F0 = 20; + player->rollRate = player->baseRollRate = 20; } } } @@ -1296,16 +1297,16 @@ void func_tank_80047FBC(Player* player) { f32 temp_fv0_2; if (!(D_800C9F08 & 1)) { - Math_SmoothStepToF(&player->unk_0EC, -((player->vel.z / 5.0f) * 4.0f), 0.4f, 8.0f, 0.01f); - if (player->unk_0EC >= 3.0f) { + Math_SmoothStepToF(&player->rot.z, -((player->vel.z / 5.0f) * 4.0f), 0.4f, 8.0f, 0.01f); + if (player->rot.z >= 3.0f) { if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE) { AUDIO_PLAY_SFX(0x19000065, player->sfxSource, 0); } D_800C9F08 |= 1; } } else { - Math_SmoothStepToF(&player->unk_0EC, (player->vel.z / 5.0f) * 4.0f, 0.4f, 8.0f, 0.01f); - if (player->unk_0EC <= -3.0f) { + Math_SmoothStepToF(&player->rot.z, (player->vel.z / 5.0f) * 4.0f, 0.4f, 8.0f, 0.01f); + if (player->rot.z <= -3.0f) { D_800C9F08 &= (u8) ~1; } } @@ -1349,7 +1350,7 @@ void func_tank_800481F4(Player* player) { (scenery->obj.id != OBJ_SCENERY_68) && (scenery->obj.id != OBJ_SCENERY_70) && (scenery->obj.id != OBJ_SCENERY_72) && (scenery->obj.id != OBJ_SCENERY_71) && (scenery->obj.id != OBJ_SCENERY_73) && (scenery->obj.id != OBJ_SCENERY_74) && - (scenery->obj.id != OBJ_SCENERY_69) && ((player->unk_138 - 2000.0f) < scenery->obj.pos.z)) { + (scenery->obj.id != OBJ_SCENERY_69) && ((player->trueZpos - 2000.0f) < scenery->obj.pos.z)) { var_fv1 = scenery->obj.rot.y; if (scenery->info.action == (ObjectFunc) func_enmy_80066EA8) { var_fv1 = 0.0f; @@ -1402,30 +1403,30 @@ void func_tank_800481F4(Player* player) { actor->vwork[29].z + actor->unk_0F4.z); if (temp_v0 != 0) { Player_ApplyDamage(player, temp_v0, actor->info.damage); - actor->unk_0D0 = 3; - actor->unk_0D4 = player->num + 1; + actor->dmgType = 3; + actor->dmgSource = player->num + 1; } } else if (actor->obj.id == OBJ_ACTOR_207) { if (func_tank_80046E40(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, 0.0f, 0.0f, 0.0f) != 0) { if (player->pos.x < actor->obj.pos.x) { - player->unk_0D8.x = (actor->vel.z > 5.0f) ? -5.0f : -1.5f; - player->unk_1DC = 8; + player->knockback.x = (actor->vel.z > 5.0f) ? -5.0f : -1.5f; + player->barrelRoll = 8; player->timer_1E8 = 15; - player->unk_1EC = player->unk_1F0 = 20; + player->rollRate = player->baseRollRate = 20; } else { - player->unk_0D8.x = (actor->vel.z > 5.0f) ? 5.0f : 1.5f; - player->unk_1DC = 8; + player->knockback.x = (actor->vel.z > 5.0f) ? 5.0f : 1.5f; + player->barrelRoll = 8; player->timer_1E8 = 15; - player->unk_1EC = player->unk_1F0 = -20; + player->rollRate = player->baseRollRate = -20; } Math_SmoothStepToF(&player->baseSpeed, 15.0f, 0.3f, 3.5f, 0.001f); - Math_SmoothStepToF(&player->unk_08C, 0, 0.3f, 3.5f, 0.001f); + Math_SmoothStepToF(&player->camDist, 0, 0.3f, 3.5f, 0.001f); player->vel.x = 0.0f; player->vel.y = 30.0f; - player->pos.x = player->unk_090.x; - actor->unk_0D0 = 3; + player->pos.x = player->basePos.x; + actor->dmgType = 3; Player_ApplyDamage(player, 0, 5); player->timer_498 = 1; } @@ -1435,26 +1436,26 @@ void func_tank_800481F4(Player* player) { actor->fwork[29], actor->fwork[26], actor->obj.rot.z, 0.0f, 0.0f, 0.0f) != 0) { Math_SmoothStepToF(&player->baseSpeed, 15.0f, 0.3f, 3.5f, 0.001f); - Math_SmoothStepToF(&player->unk_08C, 0, 0.3f, 3.5f, 0.001f); + Math_SmoothStepToF(&player->camDist, 0, 0.3f, 3.5f, 0.001f); if (player->pos.x < (actor->fwork[23] + actor->obj.pos.x)) { - player->unk_0D8.x = (actor->vel.z > 5.0f) ? -5.0f : -1.5f; - player->unk_1DC = 8; + player->knockback.x = (actor->vel.z > 5.0f) ? -5.0f : -1.5f; + player->barrelRoll = 8; player->timer_1E8 = 15; - player->unk_1EC = player->unk_1F0 = 20; + player->rollRate = player->baseRollRate = 20; } else { - player->unk_0D8.x = (actor->vel.z > 5.0f) ? 5.0f : 1.5f; - player->unk_1DC = 8; + player->knockback.x = (actor->vel.z > 5.0f) ? 5.0f : 1.5f; + player->barrelRoll = 8; player->timer_1E8 = 15; - player->unk_1EC = player->unk_1F0 = -20; + player->rollRate = player->baseRollRate = -20; } player->vel.x = 0.0f; player->vel.y = 30.0f; - player->pos.x = player->unk_090.x; - actor->unk_0D0 = 3; + player->pos.x = player->basePos.x; + actor->dmgType = 3; if (actor->info.damage != 0) { Player_ApplyDamage(player, 0, 20); } else { - actor->unk_0D0 = -1; + actor->dmgType = -1; } } } else { @@ -1462,17 +1463,17 @@ void func_tank_800481F4(Player* player) { actor->obj.pos.z, actor->obj.rot.x, actor->obj.rot.y, actor->obj.rot.z, 0.0f, 0.0f, 0.0f); if (temp_v0 != 0) { - actor->unk_0D0 = 3; + actor->dmgType = 3; if ((actor->obj.id == OBJ_ACTOR_225) || (actor->obj.id == OBJ_ACTOR_190)) { - actor->unk_0D0 = -1; + actor->dmgType = -1; } if (actor->info.damage) { Player_ApplyDamage(player, temp_v0, actor->info.damage); if (actor->obj.id == OBJ_ACTOR_225) { - player->unk_0D8.y = 0.0f; + player->knockback.y = 0.0f; } } else { - actor->unk_0D0 = -1; + actor->dmgType = -1; } } } @@ -1480,7 +1481,7 @@ void func_tank_800481F4(Player* player) { } for (i = 0, sprite = gSprites; i < ARRAY_COUNT(gSprites); i++, sprite++) { if (sprite->obj.status == OBJ_ACTIVE) { - if ((player->unk_138 - 200.0f) < sprite->obj.pos.z) { + if ((player->trueZpos - 200.0f) < sprite->obj.pos.z) { temp_v0 = func_play_800A7974(player, sprite->info.hitbox, &sp98, sprite->obj.pos.x, sprite->obj.pos.y, sprite->obj.pos.z, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); @@ -1488,7 +1489,7 @@ void func_tank_800481F4(Player* player) { if ((sprite->obj.id == OBJ_SPRITE_FO_POLE) || (sprite->obj.id == OBJ_SPRITE_CO_POLE) || (sprite->obj.id == OBJ_SPRITE_CO_TREE)) { sprite->unk_46 = 1; - player->unk_1F4 = 6; + player->hitTimer = 6; player->unk_21C = 0; } else if (sprite->obj.id == OBJ_SPRITE_TI_CACTUS) { sprite->unk_46 = 1; diff --git a/src/engine/fox_versus.c b/src/engine/fox_versus.c index dd38ec75..ffd9e655 100644 --- a/src/engine/fox_versus.c +++ b/src/engine/fox_versus.c @@ -322,16 +322,16 @@ void func_versus_800BDE44(void) { for (i = 0; i < 4; i++) { if ((gPlayer[i].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[i].state_1C8 == PLAYERSTATE_1C8_U_TURN)) { - if ((D_ctx_80177C30[i] != D_80178808[i]) || (D_80178810[i])) { + if ((gPlayerScores[i] != D_80178808[i]) || (D_80178810[i] != 0)) { D_80178810[i] += 4; if (D_80178810[i] > 15) { - if (D_ctx_80177C30[i] > D_80178808[i]) { + if (gPlayerScores[i] > D_80178808[i]) { D_80178808[i] += 1; } else { D_80178808[i] -= 1; } - if (D_ctx_80177C30[i] != D_80178808[i]) { + if (gPlayerScores[i] != D_80178808[i]) { D_80178810[i] -= 15; } else { D_80178810[i] = 0; @@ -340,7 +340,7 @@ void func_versus_800BDE44(void) { } } - if (D_ctx_80177C30[i] >= D_80178808[i]) { + if (gPlayerScores[i] >= D_80178808[i]) { func_versus_800BDAA0(D_800D4B70[i], D_800D4B80[i], D_80178808[i] + 1, D_80178808[i], D_80178810[i]); } else { func_versus_800BDAA0(D_800D4B70[i], D_800D4B80[i], D_80178808[i] - 1, D_80178808[i], D_80178810[i]); @@ -660,10 +660,10 @@ s32 func_versus_800BF17C(void) { D_801787E8[i] = 32.0f; } } - gPlayer[i].unk_1D0 = 0; + gPlayer[i].csState = 0; } else { D_80178780[i] = 0; - gPlayer[i].unk_1D0 = 0; + gPlayer[i].csState = 0; if ((D_80178780[i] == 0) && (D_801787F8[i] == 0)) { if (sUnlockLandmaster && sUnlockOnFoot) { D_80178780[i] = RAND_INT(3.0f) + 1; @@ -718,9 +718,9 @@ s32 func_versus_800BF17C(void) { D_80178820[i]++; if (gVsMatchType == 2) { - D_ctx_80177C30[i] = D_80178838[i] = D_80178808[i] = D_80178810[i] = 0; + gPlayerScores[i] = D_80178838[i] = D_80178808[i] = D_80178810[i] = 0; } - gPlayer[i].unk_1D0 = 1; + gPlayer[i].csState = 1; } } } @@ -883,7 +883,7 @@ s32 Versus_CheckForWinner(void) { for (i = 0; i < 4; i++) { if ((gPlayer[i].state_1C8 == PLAYERSTATE_1C8_DOWN) || (gPlayer[i].state_1C8 == PLAYERSTATE_1C8_VS_STANDBY)) { - D_ctx_80177C30[i] = D_80178838[i] = D_80178808[i] = D_80178810[i] = 0; + gPlayerScores[i] = D_80178838[i] = D_80178808[i] = D_80178810[i] = 0; D_80178820[i] += 1; } } @@ -906,11 +906,11 @@ s32 Versus_CheckForWinner(void) { } if (i != j) { - if (D_ctx_80177C30[i] < D_ctx_80177C30[j]) { + if (gPlayerScores[i] < gPlayerScores[j]) { temp2[i] = 1; break; } - if (D_ctx_80177C30[i] == D_ctx_80177C30[j]) { + if (gPlayerScores[i] == gPlayerScores[j]) { temp = 1; } } @@ -1249,7 +1249,7 @@ bool func_versus_800C0D10(void) { cont = 0; for (i = 0; i < 4; i++) { - if (D_ctx_80177C30[i] == D_80178838[i]) { + if (gPlayerScores[i] == D_80178838[i]) { cont++; continue; } @@ -1379,7 +1379,7 @@ void func_versus_800C1368(void) { gFillScreenAlphaTarget = 0; for (i = 0; i < 4; i++) { - D_ctx_80177C30[i] = 0; + gPlayerScores[i] = 0; D_80178808[i] = 0; D_80178810[i] = 0; D_80178820[i] = 0; diff --git a/src/mods/object_ram.c b/src/mods/object_ram.c index fca77f6d..b590bfeb 100644 --- a/src/mods/object_ram.c +++ b/src/mods/object_ram.c @@ -12,7 +12,7 @@ typedef struct RamEntry { static RamEntry oRamEntries[8] = { { 1, 0, offsetof(Player, pos.x), 2, 3, 0, 0 }, { 1, 0, offsetof(Player, pos.y), 2, 3, 0, 0 }, - { 1, 0, offsetof(Player, pos.z), 2, 3, 0, 0 }, { 0, 0, offsetof(Player, unk_144), 2, 3, 0, 0 }, + { 1, 0, offsetof(Player, pos.z), 2, 3, 0, 0 }, { 0, 0, offsetof(Player, zPath), 2, 3, 0, 0 }, { 0, 0, offsetof(Player, vel.x), 2, 3, 0, 0 }, { 0, 0, offsetof(Player, vel.y), 2, 3, 0, 0 }, { 0, 0, offsetof(Player, vel.z), 2, 3, 0, 0 }, }; diff --git a/src/overlays/ovl_ending/fox_end1.c b/src/overlays/ovl_ending/fox_end1.c index b61e5059..32e39d34 100644 --- a/src/overlays/ovl_ending/fox_end1.c +++ b/src/overlays/ovl_ending/fox_end1.c @@ -1383,7 +1383,7 @@ void Ending_8018B3D8(void) { void Ending_8018B3E0(void) { } -void Ending_8018B3E8(Actor* arg0, s32 arg1) { +void Ending_8018B3E8(Actor* actor, s32 arg1) { Vec3f sp38[2] = { { 2880.0f, 860.0f, -1440.0f }, { -6000.0f, 3400.0f, 3600.0f }, @@ -1393,24 +1393,24 @@ void Ending_8018B3E8(Actor* arg0, s32 arg1) { { 0.0f, 290.0f, 0.0f }, }; - Actor_Initialize(arg0); - arg0->obj.status = OBJ_ACTIVE; - arg0->obj.id = 0; - arg0->state = arg1; - arg0->unk_0F4.x = sp20[arg1].x; - arg0->unk_0F4.y = sp20[arg1].y; - arg0->unk_0F4.z = sp20[arg1].z; - arg0->obj.pos = sp38[arg1]; + Actor_Initialize(actor); + actor->obj.status = OBJ_ACTIVE; + actor->obj.id = 0; + actor->state = arg1; + actor->unk_0F4.x = sp20[arg1].x; + actor->unk_0F4.y = sp20[arg1].y; + actor->unk_0F4.z = sp20[arg1].z; + actor->obj.pos = sp38[arg1]; if (arg1 == 0) { - arg0->obj.pos.x -= 600.0f; - arg0->obj.pos.y += 150.0f; - arg0->fwork[0] = 6.0f; + actor->obj.pos.x -= 600.0f; + actor->obj.pos.y += 150.0f; + actor->fwork[0] = 6.0f; } - arg0->scale = 1.0f; + actor->scale = 1.0f; } -void Ending_8018B52C(Actor* arg0, s32 arg1) { +void Ending_8018B52C(Actor* actor, s32 arg1) { Vec3f sp44[3] = { { -230.0f, -750.0f, -1300.0f }, { 230.0f, -240.0f, -1150.0f }, @@ -1422,31 +1422,31 @@ void Ending_8018B52C(Actor* arg0, s32 arg1) { { 180.0f, 0.0f, 0.0f }, }; - Actor_Initialize(arg0); - arg0->obj.status = OBJ_ACTIVE; - arg0->obj.id = 1; - arg0->obj.pos = sp44[arg1]; - arg0->unk_0F4.x = sp20[arg1].x; - arg0->unk_0F4.y = sp20[arg1].y; - arg0->unk_0F4.z = sp20[arg1].z; - arg0->scale = 1.0f; + Actor_Initialize(actor); + actor->obj.status = OBJ_ACTIVE; + actor->obj.id = 1; + actor->obj.pos = sp44[arg1]; + actor->unk_0F4.x = sp20[arg1].x; + actor->unk_0F4.y = sp20[arg1].y; + actor->unk_0F4.z = sp20[arg1].z; + actor->scale = 1.0f; } -void Ending_8018B624(Actor* arg0) { +void Ending_8018B624(Actor* actor) { Vec3f sp24 = { -40.0f, -560.0f, 400.0f }; Vec3f sp18 = { 0.0f, 290.0f, 0.0f }; - Actor_Initialize(arg0); - arg0->obj.status = 2; - arg0->obj.id = 2; - arg0->obj.pos = sp24; - arg0->unk_0F4.x = sp18.x; - arg0->unk_0F4.y = sp18.y; - arg0->unk_0F4.z = sp18.z; - arg0->scale = 1.0f; + Actor_Initialize(actor); + actor->obj.status = 2; + actor->obj.id = 2; + actor->obj.pos = sp24; + actor->unk_0F4.x = sp18.x; + actor->unk_0F4.y = sp18.y; + actor->unk_0F4.z = sp18.z; + actor->scale = 1.0f; } -void Ending_8018B6D8(Actor* arg0, s32 arg1) { +void Ending_8018B6D8(Actor* actor, s32 arg1) { Vec3f sp80[6] = { { -400.0f, 500.0f, -1200.0f }, { -160.0f, 500.0f, -1400.0f }, { 80.0f, 500.0f, -1600.0f }, { 320.0f, 500.0f, -1800.0f }, { 560.0f, 500.0f, -2000.0f }, { 800.0f, 500.0f, -2200.0f }, @@ -1457,21 +1457,21 @@ void Ending_8018B6D8(Actor* arg0, s32 arg1) { }; s32 sp20[6] = { 150, 157, 164, 171, 178, 185 }; - Actor_Initialize(arg0); - arg0->obj.status = OBJ_ACTIVE; - arg0->obj.id = 3; - arg0->obj.pos = sp80[arg1]; - arg0->unk_0F4.x = sp38[arg1].x; - arg0->unk_0F4.y = sp38[arg1].y; - arg0->unk_0F4.z = sp38[arg1].z; - arg0->obj.pos.x += 3200.0f; - arg0->obj.pos.z -= 200.0f; - arg0->scale = 1.0f; - arg0->fwork[1] = 1.0f; - arg0->iwork[1] = 100; - arg0->fwork[0] = 30.0f; - arg0->iwork[0] = sp20[arg1]; - arg0->unk_046 = arg1; + Actor_Initialize(actor); + actor->obj.status = OBJ_ACTIVE; + actor->obj.id = 3; + actor->obj.pos = sp80[arg1]; + actor->unk_0F4.x = sp38[arg1].x; + actor->unk_0F4.y = sp38[arg1].y; + actor->unk_0F4.z = sp38[arg1].z; + actor->obj.pos.x += 3200.0f; + actor->obj.pos.z -= 200.0f; + actor->scale = 1.0f; + actor->fwork[1] = 1.0f; + actor->iwork[1] = 100; + actor->fwork[0] = 30.0f; + actor->iwork[0] = sp20[arg1]; + actor->unk_046 = arg1; } void Ending_8018B860(void) { diff --git a/src/overlays/ovl_ending/fox_end2.c b/src/overlays/ovl_ending/fox_end2.c index 86c404d5..963ab123 100644 --- a/src/overlays/ovl_ending/fox_end2.c +++ b/src/overlays/ovl_ending/fox_end2.c @@ -1079,7 +1079,7 @@ void Ending_801926D4(void) { if (D_ctx_80177824 == 0) { D_ending_80198590 = gPlayer[0].wings; } else { - D_ending_80198590.rightState = D_ending_80198590.leftState = 2; + D_ending_80198590.rightState = D_ending_80198590.leftState = WINGSTATE_INTACT; } AUDIO_PLAY_BGM(SEQ_ID_ENDING); } diff --git a/src/overlays/ovl_i1/fox_co.c b/src/overlays/ovl_i1/fox_co.c index b6bbad73..fe6f3912 100644 --- a/src/overlays/ovl_i1/fox_co.c +++ b/src/overlays/ovl_i1/fox_co.c @@ -102,7 +102,7 @@ void Corneria_Boss292_Init(Boss292* this) { if (gLevelMode == LEVELMODE_ON_RAILS) { if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) { gPlayer[0].state_1C8 = PLAYERSTATE_1C8_START_360; - gPlayer[0].unk_1D0 = 0; + gPlayer[0].csState = 0; SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 50); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50); } @@ -174,15 +174,15 @@ void Corneria_80187AC8(Boss* boss) { if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) { gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; - gPlayer[0].unk_1D0 = gPlayer[0].timer_1F8 = 0; - gPlayer[0].unk_0E8 += gPlayer[0].unk_114; - if (gPlayer[0].unk_0E8 > 360.0f) { - gPlayer[0].unk_0E8 -= 360.0f; + gPlayer[0].csState = gPlayer[0].csTimer = 0; + gPlayer[0].rot.y += gPlayer[0].yRot_114; + if (gPlayer[0].rot.y > 360.0f) { + gPlayer[0].rot.y -= 360.0f; } - if (gPlayer[0].unk_0E8 < 0.0f) { - gPlayer[0].unk_0E8 += 360.0f; + if (gPlayer[0].rot.y < 0.0f) { + gPlayer[0].rot.y += 360.0f; } - gPlayer[0].unk_114 = 0.0f; + gPlayer[0].yRot_114 = 0.0f; } Radio_PlayMessage(gMsg_ID_2280, RCID_BOSS_CORNERIA); Boss_AwardBonus(boss); @@ -387,14 +387,14 @@ void Corneria_801887AC(Boss* boss) { if (boss->swork[3] != 1000) { sp3C.x = gPlayer[0].pos.x; sp3C.y = gPlayer[0].pos.y; - sp3C.z = gPlayer[0].unk_138; + sp3C.z = gPlayer[0].trueZpos; gPlayer[0].pos.x += RAND_FLOAT_CENTERED(300.0f); gPlayer[0].pos.y += RAND_FLOAT_CENTERED(300.0f); - gPlayer[0].unk_138 += RAND_FLOAT_CENTERED(300.0f); + gPlayer[0].trueZpos += RAND_FLOAT_CENTERED(300.0f); func_effect_8007F11C(OBJ_EFFECT_376, D_i1_8019B6D8[12], D_i1_8019B6D8[13], D_i1_8019B6D8[14], 60.0f); gPlayer[0].pos.x = sp3C.x; gPlayer[0].pos.y = sp3C.y; - gPlayer[0].unk_138 = sp3C.z; + gPlayer[0].trueZpos = sp3C.z; } boss->swork[30] = 0; break; @@ -475,7 +475,7 @@ void Corneria_80188D50(Boss* boss) { s32 temp_ft3; if (boss->swork[36] == 0) { - if (gPlayer[0].unk_1F4 != 0) { + if (gPlayer[0].hitTimer != 0) { D_i1_801997E0 = 80; } @@ -483,7 +483,7 @@ void Corneria_80188D50(Boss* boss) { D_i1_801997E0--; } else if ((gPlayer[0].pos.y < 200.0f) && (boss->state < 5) && (fabsf(boss->obj.pos.x - gPlayer[0].pos.x) < 200.0f) && - (fabsf(boss->obj.pos.z - gPlayer[0].unk_138) < 200.0f) && (gPlayer[0].unk_4D8 > 180.0f)) { + (fabsf(boss->obj.pos.z - gPlayer[0].trueZpos) < 200.0f) && (gPlayer[0].aerobaticPitch > 180.0f)) { boss->swork[36]++; D_i1_801997E0 = 20; AUDIO_PLAY_SFX(0x49008025, gDefaultSfxSource, 4); @@ -507,7 +507,7 @@ void Corneria_80188D50(Boss* boss) { break; } } - Matrix_RotateY(gCalcMatrix, (gPlayer[0].unk_114 + gPlayer[0].unk_0E8) * M_DTOR, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, (gPlayer[0].yRot_114 + gPlayer[0].rot.y) * M_DTOR, MTXF_NEW); sp48.x = 0.0f; sp48.y = 0.0f; sp48.z = -2500.0f; @@ -519,7 +519,7 @@ void Corneria_80188D50(Boss* boss) { gItems[i].obj.id = OBJ_ITEM_1UP; gItems[i].obj.pos.x = gPlayer[0].pos.x + sp3C.x; gItems[i].obj.pos.y = gPlayer[0].pos.y + 100.0f; - gItems[i].obj.pos.z = gPlayer[0].unk_138 + sp3C.z; + gItems[i].obj.pos.z = gPlayer[0].trueZpos + sp3C.z; gItems[i].timer_4A = 8; Object_SetInfo(&gItems[i].info, gItems[i].obj.id); func_effect_8007B344(gItems[i].obj.pos.x, gItems[i].obj.pos.y, gItems[i].obj.pos.z, 5.0f, 0); @@ -581,7 +581,7 @@ void Corneria_80189058(Boss* boss) { gRadarMarks[59].pos.y = boss->obj.pos.y; gRadarMarks[59].pos.z = boss->obj.pos.z; - gRadarMarks[59].unk_10 = boss->obj.rot.y + 180.0f; + gRadarMarks[59].yRot = boss->obj.rot.y + 180.0f; Corneria_80188D50(boss); if (D_edisplay_801615D0.z > 0.0f) { if (D_edisplay_801615D0.x > 0.0f) { @@ -683,7 +683,7 @@ void Corneria_80189058(Boss* boss) { boss->unk_04C = 0; D_i1_8019B6D8[17] = gPlayer[0].pos.x; D_i1_8019B6D8[18] = gPlayer[0].pos.y; - D_i1_8019B6D8[19] = gPlayer[0].unk_138; + D_i1_8019B6D8[19] = gPlayer[0].trueZpos; if (boss->timer_050 == 0) { switch (boss->swork[31]) { case 1: @@ -722,7 +722,7 @@ void Corneria_80189058(Boss* boss) { case 1: D_i1_8019B6D8[17] = D_i1_8019B6D8[66] = gPlayer[0].pos.x; D_i1_8019B6D8[18] = gPlayer[0].pos.y; - D_i1_8019B6D8[19] = D_i1_8019B6D8[67] = gPlayer[0].unk_138; + D_i1_8019B6D8[19] = D_i1_8019B6D8[67] = gPlayer[0].trueZpos; boss->unk_04C += 2; if (boss->unk_04C >= Animation_GetFrameCount(&D_CO_602BC18)) { @@ -739,7 +739,7 @@ void Corneria_80189058(Boss* boss) { case 2: D_i1_8019B6D8[17] = D_i1_8019B6D8[66] = gPlayer[0].pos.x; D_i1_8019B6D8[18] = gPlayer[0].pos.y; - D_i1_8019B6D8[19] = D_i1_8019B6D8[67] = gPlayer[0].unk_138; + D_i1_8019B6D8[19] = D_i1_8019B6D8[67] = gPlayer[0].trueZpos; boss->unk_04C -= 4; if (boss->unk_04C < 0) { @@ -760,7 +760,7 @@ void Corneria_80189058(Boss* boss) { case 3: D_i1_8019B6D8[17] = D_i1_8019B6D8[66] = gPlayer[0].pos.x; D_i1_8019B6D8[18] = gPlayer[0].pos.y; - D_i1_8019B6D8[19] = D_i1_8019B6D8[67] = gPlayer[0].unk_138; + D_i1_8019B6D8[19] = D_i1_8019B6D8[67] = gPlayer[0].trueZpos; boss->unk_04C += 4; if (boss->unk_04C > 100) { @@ -781,7 +781,7 @@ void Corneria_80189058(Boss* boss) { case 4: D_i1_8019B6D8[17] = gPlayer[0].pos.x; D_i1_8019B6D8[18] = gPlayer[0].pos.y; - D_i1_8019B6D8[19] = gPlayer[0].unk_138; + D_i1_8019B6D8[19] = gPlayer[0].trueZpos; boss->unk_04C += 4; if (boss->unk_04C > 100) { @@ -798,7 +798,7 @@ void Corneria_80189058(Boss* boss) { if (((gGameFrameCount % 8) == 0)) { D_i1_8019B6D8[17] = gPlayer[0].pos.x + RAND_FLOAT_CENTERED(2000.0f); D_i1_8019B6D8[18] = gPlayer[0].pos.y; - D_i1_8019B6D8[19] = gPlayer[0].unk_138 + RAND_FLOAT_CENTERED(2000.0f); + D_i1_8019B6D8[19] = gPlayer[0].trueZpos + RAND_FLOAT_CENTERED(2000.0f); } boss->fwork[12] += 0.05f; if (boss->state == 6) { @@ -1127,9 +1127,9 @@ s32 Corneria_8018AB64(Actor* actor) { void Corneria_8018ACE0(Actor* actor) { - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; - if (actor->unk_0D2 == 0) { + if (actor->dmgType != 0) { + actor->dmgType = 0; + if (actor->dmgPart == 0) { AUDIO_PLAY_SFX(0x29034003, actor->sfxSource, 4); func_effect_8007C120(actor->obj.pos.x, actor->obj.pos.y + 200.0f, actor->obj.pos.z, actor->vel.x, actor->vel.y, actor->vel.z, 0.1f, 20); @@ -1365,7 +1365,7 @@ void Corneria_8018B58C(Actor* actor) { RAND_FLOAT_CENTERED(20.0f), 3.0f, i + 24, RAND_INT(30.0f) + 60.0f); } - if ((fabsf(actor->obj.pos.z - gPlayer[0].unk_138) < 500.0f) && + if ((fabsf(actor->obj.pos.z - gPlayer[0].trueZpos) < 500.0f) && (fabsf(actor->obj.pos.x - gPlayer[0].pos.x) < 200.0f) && (fabsf(actor->obj.pos.y - gPlayer[0].pos.y) < 200.0f)) { *gControllerRumbleTimers = 25; @@ -1483,16 +1483,16 @@ void Corneria_Boss293_Init(Boss293* this) { this->timer_050 = 354; this->health = 601; this->fwork[18] = -gArwingSpeed - 10.0f; - if (fabsf(gPlayer[0].unk_0AC) < 1.0f) { + if (fabsf(gPlayer[0].xPath) < 1.0f) { this->timer_05A = 30000; - this->obj.pos.z = (gPlayer[0].cam.eye.z - D_ctx_80177D20) - 2000.0f; + this->obj.pos.z = (gPlayer[0].cam.eye.z - gPathProgress) - 2000.0f; AUDIO_PLAY_SFX(0x31038018, this->sfxSource, 4); D_i1_8019B6D0 = 0; } else { D_i1_8019B6D0 = 1; this->obj.rot.y = 180.0f; this->fwork[6] = 800.0f; - this->obj.pos.z = gPlayer[0].unk_138 + 2000.0f; + this->obj.pos.z = gPlayer[0].trueZpos + 2000.0f; this->fwork[7] = this->obj.pos.x; this->fwork[5] = 30.0f; AUDIO_PLAY_SFX(0x31038018, this->sfxSource, 4); @@ -1587,7 +1587,7 @@ void Corneria_8018C19C(Boss* boss) { Matrix_MultVec3f(gCalcMatrix, &sp78, &sp6C); boss->vel.x = sp6C.x; boss->vel.y = sp6C.y; - boss->vel.z = sp6C.z - D_ctx_80177D08; + boss->vel.z = sp6C.z - gPathVelZ; boss->fwork[16] = 4.0f; if (((gGameFrameCount % 2) == 0)) { Matrix_MultVec3f(gCalcMatrix, &D_i1_80199914[0], &sp84[6]); @@ -1651,7 +1651,7 @@ void Corneria_8018C19C(Boss* boss) { } boss->vel.z = boss->fwork[18]; if (boss->state > 0) { - boss->fwork[3] = (gPlayer[0].cam.eye.z - D_ctx_80177D20) - 2500.0f; + boss->fwork[3] = (gPlayer[0].cam.eye.z - gPathProgress) - 2500.0f; } if (boss->state != 7) { Math_SmoothStepToF(&boss->fwork[4], boss->fwork[5], 0.1f, 2.0f, 0.00001f); @@ -1712,7 +1712,7 @@ void Corneria_8018C19C(Boss* boss) { switch (boss->state) { case 0: - boss->fwork[3] = gPlayer[0].unk_138 + 1500.0f; + boss->fwork[3] = gPlayer[0].trueZpos + 1500.0f; if (boss->timer_050 == 350) { SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 40); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 40); @@ -1728,7 +1728,7 @@ void Corneria_8018C19C(Boss* boss) { boss->fwork[13] = 180.0f; boss->fwork[12] = 1.5f; boss->fwork[6] = 800.0f; - boss->fwork[3] = gPlayer[0].cam.eye.z - D_ctx_80177D20 - 2500.0f; + boss->fwork[3] = gPlayer[0].cam.eye.z - gPathProgress - 2500.0f; boss->fwork[18] = -gArwingSpeed; AUDIO_PLAY_BGM(SEQ_ID_CO_BOSS_2 | SEQ_FLAG); boss->timer_050 = 40; @@ -1836,7 +1836,7 @@ void Corneria_8018C19C(Boss* boss) { } break; case 7: - boss->fwork[3] = (gPlayer[0].cam.eye.z - D_ctx_80177D20) - 4000.0f; + boss->fwork[3] = (gPlayer[0].cam.eye.z - gPathProgress) - 4000.0f; Math_SmoothStepToF(&boss->obj.pos.z, boss->fwork[3], 0.1f, 15.0f, 0.00001f); if (boss->timer_058 == 0) { @@ -1865,7 +1865,7 @@ void Corneria_8018C19C(Boss* boss) { boss->swork[6] &= 1; } if (((gGameFrameCount % 8) == 0)) { - if (fabsf(boss->obj.pos.z - gPlayer[0].unk_138) > 700.0f) { + if (fabsf(boss->obj.pos.z - gPlayer[0].trueZpos) > 700.0f) { Matrix_MultVec3f(gCalcMatrix, &D_i1_801998F0[0], &sp84[3]); effect = gEffects; @@ -1923,7 +1923,7 @@ void Corneria_8018C19C(Boss* boss) { Matrix_MultVec3f(gCalcMatrix, &sp78, &sp6C); boss->vel.x = sp6C.x; boss->vel.y = sp6C.y; - boss->vel.z = sp6C.z - D_ctx_80177D08; + boss->vel.z = sp6C.z - gPathVelZ; } break; case 8: @@ -1967,7 +1967,7 @@ void Corneria_8018C19C(Boss* boss) { Matrix_MultVec3f(gCalcMatrix, &sp78, &sp6C); boss->vel.x = sp6C.x; boss->vel.y = sp6C.y; - boss->vel.z = sp6C.z - D_ctx_80177D08; + boss->vel.z = sp6C.z - gPathVelZ; if (boss->timer_056 == 60) { Radio_PlayMessage(gMsg_ID_2295, RCID_FOX); } @@ -2075,7 +2075,7 @@ void Corneria_8018DDAC(Boss* boss) { } else { Radio_PlayMessage(gMsg_ID_7085, RCID_FALCO); } - boss->info.unk_10 = 300.0f; + boss->info.cullDistance = 300.0f; gBosses[0].fwork[14] = 25.0f; gBosses[0].fwork[15] = 0.0f; AUDIO_PLAY_SFX(0x2940C027, boss->sfxSource, 4); @@ -2168,7 +2168,7 @@ void Corneria_8018E290(Boss* boss) { } else { Radio_PlayMessage(gMsg_ID_7085, RCID_FALCO); } - boss->info.unk_10 = 300.0f; + boss->info.cullDistance = 300.0f; gBosses[0].fwork[15] = 0.0f; gBosses[0].fwork[14] = 335.0f; boss->health = 0; @@ -2260,7 +2260,7 @@ void Corneria_8018E76C(Boss* boss) { } else { Radio_PlayMessage(gMsg_ID_7085, RCID_FALCO); } - boss->info.unk_10 = 300.0f; + boss->info.cullDistance = 300.0f; gBosses[0].fwork[15] = 0.0f; gBosses[0].fwork[14] = 335.0f; boss->health = 0; @@ -2467,13 +2467,13 @@ void Corneria_8018F3BC(Scenery* scenery, f32 arg1) { scenery->unk_60 = 60.0f; Object_SetInfo(&scenery->info, scenery->obj.id); scenery->obj.pos.z = -2000.0f; - scenery->info.unk_10 = 15000.0f; + scenery->info.cullDistance = 15000.0f; } void Corneria_8018F4A4(void) { s32 i; - if (((gGameFrameCount % 16) == 0) && !(gPlayer[0].unk_1D0 < 4)) { + if (((gGameFrameCount % 16) == 0) && !(gPlayer[0].csState < 4)) { for (i = 0; i < 50; i++) { if (gScenery[i].obj.status == OBJ_FREE) { Corneria_8018F3BC(&gScenery[i], 4000.0f); @@ -2533,13 +2533,13 @@ static f32 D_i1_80199AD8[3] = { -60.0f, 60.0f, -45.0f }; void Corneria_8018F6F8(Actor* actor, s32 arg1) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = (D_i1_80199AB4[arg1] * 4.0f) + gPlayer[0].pos.x; actor->obj.pos.y = (D_i1_80199AC0[arg1] * 2.0f) + gPlayer[0].pos.y; - actor->obj.pos.z = (D_i1_80199ACC[arg1] * 3.0f) + gPlayer[0].unk_138; + actor->obj.pos.z = (D_i1_80199ACC[arg1] * 3.0f) + gPlayer[0].trueZpos; actor->vwork[20].x = D_i1_80199AB4[arg1] + gPlayer[0].pos.x; actor->vwork[20].y = gPlayer[0].pos.y; - actor->vwork[20].z = D_i1_80199ACC[arg1] + gPlayer[0].unk_138; + actor->vwork[20].z = D_i1_80199ACC[arg1] + gPlayer[0].trueZpos; actor->obj.rot.z = D_i1_80199AD8[arg1]; actor->state = 100; actor->obj.rot.y = 180.0f; @@ -2547,7 +2547,7 @@ void Corneria_8018F6F8(Actor* actor, s32 arg1) { Object_SetInfo(&actor->info, actor->obj.id); actor->unk_0C9 = 1; actor->iwork[11] = 1; - actor->info.unk_10 = 200.0f; + actor->info.cullDistance = 200.0f; AUDIO_PLAY_SFX(0x3100000C, actor->sfxSource, 4); } @@ -2567,7 +2567,7 @@ void Corneria_LevelStart(Player* player) { if (gCsFrameCount < 815) { sp3C = player->pos.x; sp38 = player->pos.y + 15.0f; - sp34 = player->unk_138 - 20.0f; + sp34 = player->trueZpos - 20.0f; } else { if (gCsFrameCount < 1009) { sp3C = actor0->obj.pos.x; @@ -2637,19 +2637,19 @@ void Corneria_LevelStart(Player* player) { } player->vel.z = 0.0f; player->pos.z = player->pos.z; - player->unk_138 = player->pos.z + player->unk_08C; - player->unk_088 += 10.0f; - player->unk_080 = -SIN_DEG(player->unk_088) * 0.5f; - player->unk_0F4 += 3.0f; - player->unk_0F0 = SIN_DEG(player->unk_0F4) * 1.5f; + player->trueZpos = player->pos.z + player->camDist; + player->bobPhase += 10.0f; + player->yBob = -SIN_DEG(player->bobPhase) * 0.5f; + player->rockPhase += 3.0f; + player->rockAngle = SIN_DEG(player->rockPhase) * 1.5f; Corneria_8018F678(); player->wings.unk_30 = 0; - switch (player->unk_1D0) { + switch (player->csState) { case 0: gCsFrameCount = 0; - player->unk_1D0 = 1; - player->timer_1F8 = 600; + player->csState = 1; + player->csTimer = 600; player->pos.y = 6000.0f; player->pos.x = 0.1f; Corneria_8018F6F8(&gActors[0], 0); @@ -2660,10 +2660,10 @@ void Corneria_LevelStart(Player* player) { actor2->iwork[14] = 4; player->cam.eye.x = gCsCamEyeX = player->pos.x - 400.0f; gPlayer[0].cam.eye.y = gCsCamEyeY = player->pos.y + 600.0f; - player->cam.eye.z = gCsCamEyeZ = player->unk_138 + 2000.0f; + player->cam.eye.z = gCsCamEyeZ = player->trueZpos + 2000.0f; player->cam.at.x = gCsCamAtX = player->pos.x; player->cam.at.y = gCsCamAtY = player->pos.y; - player->cam.at.z = gCsCamAtZ = player->unk_138 + 300.0f; + player->cam.at.z = gCsCamAtZ = player->trueZpos + 300.0f; D_ctx_80177A48[0] = 0; D_ctx_80177A48[1] = D_ctx_80177A48[2] = 0; gFillScreenAlphaTarget = 255; @@ -2671,46 +2671,46 @@ void Corneria_LevelStart(Player* player) { gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; break; case 1: - if (player->timer_1F8 < 550) { + if (player->csTimer < 550) { gFillScreenAlphaTarget = 0; gFillScreenAlphaStep = 3; Math_SmoothStepToF(&D_ctx_80177A48[0], 0.01f, 1.0f, 0.0005f, 0.0f); } gCsCamEyeX = player->pos.x - 150.0f; gCsCamEyeY = player->pos.y - 70.0f; - gCsCamEyeZ = player->unk_138 + 150.0f; + gCsCamEyeZ = player->trueZpos + 150.0f; gCsCamAtX = player->pos.x; gCsCamAtY = player->pos.y; - gCsCamAtZ = player->unk_138; - if (player->timer_1F8 == 0) { - player->unk_1D0 = 2; - player->timer_1F8 = 130; + gCsCamAtZ = player->trueZpos; + if (player->csTimer == 0) { + player->csState = 2; + player->csTimer = 130; D_ctx_80177A48[0] = 0.0f; } - if (player->timer_1F8 == 315) { + if (player->csTimer == 315) { player->pos.x = 0.0f; } - if (player->timer_1F8 == 270) { + if (player->csTimer == 270) { gHideRadio = false; Radio_PlayMessage(gMsg_ID_2005, RCID_FOX); } - if (player->timer_1F8 == 180) { + if (player->csTimer == 180) { AUDIO_PLAY_SFX(0x09000007, player->sfxSource, 0); } - if (player->timer_1F8 == 120) { + if (player->csTimer == 120) { AUDIO_PLAY_SFX(0x09000013, player->sfxSource, 0); } - if ((player->timer_1F8 < 190) && (player->timer_1F8 > 150)) { + if ((player->csTimer < 190) && (player->csTimer > 150)) { Math_SmoothStepToF(&player->wings.unk_24, 2.0f, 0.2f, 0.5f, 0.0f); } - if (player->timer_1F8 < 150) { + if (player->csTimer < 150) { player->unk_204 = 0; } - if ((player->timer_1F8 < 120) && ((player->timer_1F8 % 16) == 0)) { + if ((player->csTimer < 120) && ((player->csTimer % 16) == 0)) { D_ctx_80177A48[1] = RAND_FLOAT_CENTERED(60.0f); D_ctx_80177A48[2] = RAND_FLOAT_CENTERED(60.0f); } - if (player->timer_1F8 == 0) { + if (player->csTimer == 0) { D_ctx_80177A48[1] = 0.0f; D_ctx_80177A48[2] = D_ctx_80177A48[1]; } @@ -2719,16 +2719,16 @@ void Corneria_LevelStart(Player* player) { Math_SmoothStepToF(&D_ctx_80177A48[0], 0.1f, 1.0f, 0.001f, 0.0f); gCsCamEyeX = player->pos.x - 50.0f; gCsCamEyeY = player->pos.y + 10.0f; - gCsCamEyeZ = player->unk_138 - 10.0f; + gCsCamEyeZ = player->trueZpos - 10.0f; gCsCamAtX = player->pos.x; gCsCamAtY = player->pos.y + 10.0f; - gCsCamAtZ = player->unk_138 + 10.0f; - if (player->timer_1F8 == 20) { + gCsCamAtZ = player->trueZpos + 10.0f; + if (player->csTimer == 20) { Radio_PlayMessage(gMsg_ID_2010, RCID_FOX); } - if (player->timer_1F8 == 0) { - player->unk_1D0 = 3; - player->timer_1F8 = 180; + if (player->csTimer == 0) { + player->csState = 3; + player->csTimer = 180; player->unk_004 = 0.0f; actor0->state = 0; actor2->state = 0; @@ -2742,9 +2742,9 @@ void Corneria_LevelStart(Player* player) { break; case 3: if (fabsf(Math_SmoothStepToF(&actor0->obj.pos.z, player->pos.z + 100.0f, 0.05f, 5.0f, 0.0f)) < 1.0f) { - player->unk_1D0 = 4; + player->csState = 4; D_ctx_80177A48[0] = 0.0f; - player->timer_1F8 = 190; + player->csTimer = 190; } if (gMsgCharIsPrinting && (gGameFrameCount & 2)) { player->wings.unk_30 = 5.0f; @@ -2763,14 +2763,14 @@ void Corneria_LevelStart(Player* player) { gCsCamAtX = actor0->obj.pos.x; gCsCamAtY = actor0->obj.pos.y + 10.0f; gCsCamAtZ = actor0->obj.pos.z + 10.0f; - if (player->timer_1F8 == 0) { - player->unk_1D0 = 5; - player->timer_1F8 = 5; + if (player->csTimer == 0) { + player->csState = 5; + player->csTimer = 5; } - if (player->timer_1F8 == 80) { + if (player->csTimer == 80) { Radio_PlayMessage(gMsg_ID_2020, RCID_FALCO); } - if (player->timer_1F8 < 100) { + if (player->csTimer < 100) { Math_SmoothStepToF(&actor0->fwork[19], 50.0f, 0.1f, 3.0f, 0.01f); } actor0->fwork[20] = 0.0f; @@ -2780,10 +2780,10 @@ void Corneria_LevelStart(Player* player) { break; case 5: Math_SmoothStepToF(&actor0->fwork[19], 0, 0.1f, 3.0f, 0.01f); - if (player->timer_1F8 == 0) { - player->unk_1D0 = 6; + if (player->csTimer == 0) { + player->csState = 6; D_ctx_80177A48[0] = 0.0f; - player->timer_1F8 = 190; + player->csTimer = 190; } gCsCamEyeY = actor0->obj.pos.y + 10.0f; @@ -2803,14 +2803,14 @@ void Corneria_LevelStart(Player* player) { gCsCamAtY = actor2->obj.pos.y + 10.0f; gCsCamAtZ = actor2->obj.pos.z + 10.0f; - if (player->timer_1F8 == 0) { - player->unk_1D0 = 7; - player->timer_1F8 = 190; + if (player->csTimer == 0) { + player->csState = 7; + player->csTimer = 190; D_ctx_80177A48[0] = 0.0f; actor0->obj.pos.y = player->pos.y; - actor0->obj.pos.z = player->unk_138 + 240.0f; + actor0->obj.pos.z = player->trueZpos + 240.0f; } - if (player->timer_1F8 == 80) { + if (player->csTimer == 80) { Radio_PlayMessage(gMsg_ID_2030, RCID_PEPPY); } actor2->fwork[20] = 0.0f; @@ -2826,18 +2826,18 @@ void Corneria_LevelStart(Player* player) { gCsCamAtX = actor1->obj.pos.x + 10.0f; gCsCamAtY = actor1->obj.pos.y + 10.0f; gCsCamAtZ = actor1->obj.pos.z + 10.0f; - if (player->timer_1F8 == 0) { - player->unk_1D0 = 8; + if (player->csTimer == 0) { + player->csState = 8; D_ctx_80177A48[0] = 0.0f; - player->timer_1F8 = 300; + player->csTimer = 300; D_ctx_80177A48[8] = 50.0f; D_ctx_80177A48[3] = 0.0f; } - if (player->timer_1F8 == 80) { + if (player->csTimer == 80) { Radio_PlayMessage(gMsg_ID_2040, RCID_SLIPPY); player->pos.x = 0.1f; } - if (player->timer_1F8 < 100) { + if (player->csTimer < 100) { Math_SmoothStepToF(&actor1->fwork[19], -20.0f, 0.1f, 3.0f, 0.01f); } actor1->fwork[20] = 0.0f; @@ -2847,60 +2847,60 @@ void Corneria_LevelStart(Player* player) { break; case 8: Math_SmoothStepToF(&D_ctx_80177A48[0], 0.1f, 1.0f, 0.001f, 0.0f); - if (player->timer_1F8 < 150) { + if (player->csTimer < 150) { D_ctx_80177A48[3] += player->unk_004; Math_SmoothStepToF(&player->unk_004, 2.0f, 1.0f, 0.2f, 0.0f); } gCsCamEyeX = player->pos.x; - gCsCamEyeZ = (player->unk_138 - 600.0f) + D_ctx_80177A48[3]; + gCsCamEyeZ = (player->trueZpos - 600.0f) + D_ctx_80177A48[3]; gCsCamEyeY = player->pos.y + D_ctx_80177A48[8]; gCsCamAtX = player->pos.x; gCsCamAtY = player->pos.y + 20.0f; - gCsCamAtZ = player->unk_138 + 100.0f; - if (player->timer_1F8 < 100) { + gCsCamAtZ = player->trueZpos + 100.0f; + if (player->csTimer < 100) { Math_SmoothStepToF(&D_ctx_80177A48[8], 10.0f, 0.1f, 0.7f, 0.0f); } - if (player->timer_1F8 == 200) { + if (player->csTimer == 200) { Radio_PlayMessage(gMsg_ID_2050, RCID_FOX); } player->wings.unk_30 = 0.0f; if (gMsgCharIsPrinting && (gGameFrameCount & 2)) { player->wings.unk_30 = 5.0f; } - if (player->timer_1F8 == 80) { + if (player->csTimer == 80) { actor0->fwork[29] = 5.0f; } - if (player->timer_1F8 == 60) { + if (player->csTimer == 60) { actor1->fwork[29] = 5.0f; } - if (player->timer_1F8 == 40) { + if (player->csTimer == 40) { actor2->fwork[29] = 5.0f; } - if ((player->timer_1F8 > 70) && (player->timer_1F8 < 80)) { + if ((player->csTimer > 70) && (player->csTimer < 80)) { actor0->iwork[11] = 2; } - if ((player->timer_1F8 > 50) && (player->timer_1F8 < 60)) { + if ((player->csTimer > 50) && (player->csTimer < 60)) { actor1->iwork[11] = 2; } - if ((player->timer_1F8 > 30) && (player->timer_1F8 < 40)) { + if ((player->csTimer > 30) && (player->csTimer < 40)) { actor2->iwork[11] = 2; } - if (player->timer_1F8 == 70) { + if (player->csTimer == 70) { actor0->state = 1; func_play_800A6028(player->sfxSource, 0x09000002); } - if (player->timer_1F8 == 50) { + if (player->csTimer == 50) { actor1->state = 2; func_play_800A6028(player->sfxSource, 0x09000002); } - if (player->timer_1F8 == 30) { + if (player->csTimer == 30) { actor2->state = 3; func_play_800A6028(player->sfxSource, 0x09000002); } - if (player->timer_1F8 == 0) { - player->unk_1D0 = 9; + if (player->csTimer == 0) { + player->csState = 9; func_play_800A6028(player->sfxSource, 0x09000002); - player->timer_1F8 = 3; + player->csTimer = 3; player->unk_194 = 5.0f; player->unk_190 = 5.0f; } @@ -2908,13 +2908,13 @@ void Corneria_LevelStart(Player* player) { case 9: gCsCamEyeX = player->pos.x; gCsCamEyeY = player->pos.y; - gCsCamEyeZ = player->unk_138 + 1000.0f; + gCsCamEyeZ = player->trueZpos + 1000.0f; gCsCamAtX = player->pos.x; gCsCamAtY = player->pos.y; - gCsCamAtZ = player->unk_138 + 1100.0f; + gCsCamAtZ = player->trueZpos + 1100.0f; D_ctx_80177A48[0] = 0.03f; player->unk_190 = 2.0f; - if (player->timer_1F8 == 0) { + if (player->csTimer == 0) { gFillScreenAlphaTarget = 255; gFillScreenAlphaStep = 48; gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; @@ -2931,25 +2931,25 @@ void Corneria_LevelStart(Player* player) { player->cam.eye.y = (player->pos.y * player->unk_148) + 50.0f; player->cam.eye.z = 30.0f; player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; - player->unk_1D0 = 0; + player->csState = 0; player->cam.at.x = player->pos.x; player->cam.at.y = (player->pos.y * player->unk_148) + 20.0f; - player->cam.at.z = player->unk_138; + player->cam.at.z = player->trueZpos; D_ctx_80177950 = 1.0f; gPlayerGlareAlphas[0] = gPlayerGlareAlphas[1] = gPlayerGlareAlphas[2] = gPlayerGlareAlphas[3] = 0; gLoadLevelObjects = 1; gFillScreenAlphaTarget = 0; - player->timer_1F8 = 15; + player->csTimer = 15; } break; case 10: break; } Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 20000.0f, 0.0f); - Math_SmoothStepToF(&player->cam.eye.y, player->unk_080 + gCsCamEyeY, D_ctx_80177A48[0], 20000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.y, player->yBob + gCsCamEyeY, D_ctx_80177A48[0], 20000.0f, 0.0f); Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 20000.0f, 0.0f); Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 20000.0f, 0.0f); - Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY - player->unk_080, D_ctx_80177A48[0], 20000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY - player->yBob, D_ctx_80177A48[0], 20000.0f, 0.0f); Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 20000.0f, 0.0f); Math_SmoothStepToF(&player->wings.unk_04, D_ctx_80177A48[1], 0.2f, 1.0f, 0.0f); Math_SmoothStepToF(&player->wings.unk_0C, D_ctx_80177A48[2], 0.2f, 1.0f, 0.0f); @@ -2987,7 +2987,7 @@ void Corneria_80190F74(Actor* actor, s32 arg1) { Vec3f sp38; Player* player = &gPlayer[0]; - Matrix_RotateY(gCalcMatrix, player->unk_0E8 * M_DTOR, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, player->rot.y * M_DTOR, MTXF_NEW); sp5C.x = D_i1_80199AE4[arg1]; sp5C.y = D_i1_80199AF0[arg1]; sp5C.z = D_i1_80199AFC[arg1]; @@ -3009,7 +3009,7 @@ void Corneria_80190F74(Actor* actor, s32 arg1) { actor->vel.y = player->vel.y; actor->vel.z = player->vel.z; actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.rot.z = D_i1_80199B2C[arg1]; Object_SetInfo(&actor->info, actor->obj.id); actor->iwork[11] = 1; @@ -3027,12 +3027,12 @@ void Corneria_LevelComplete1(Player* player) { f32 temp_deg; player->wings.unk_04 = player->wings.unk_0C = player->wings.unk_08 = player->wings.unk_10 = 0.0f; - Math_SmoothStepToF(&player->unk_130, 0.0f, 0.1f, 15.0f, 0.0f); - Math_SmoothStepToF(&player->unk_12C, 0.0f, 0.1f, 15.0f, 0.0f); + Math_SmoothStepToF(&player->zRotBarrelRoll, 0.0f, 0.1f, 15.0f, 0.0f); + Math_SmoothStepToF(&player->zRotBank, 0.0f, 0.1f, 15.0f, 0.0f); Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 3.0f, 0.0f); - Math_SmoothStepToAngle(&player->unk_4D8, 0.0f, 0.1f, 20.0f, 0.0f); + Math_SmoothStepToAngle(&player->aerobaticPitch, 0.0f, 0.1f, 20.0f, 0.0f); Math_SmoothStepToF(&player->boostSpeed, 0.0f, 0.1f, 3.0f, 0.0f); - if (player->unk_1D0 >= 3) { + if (player->csState >= 3) { player->cam.eye.y += 3.0f; player->cam.at.y += 3.0f; player->pos.y += 3.0f; @@ -3043,7 +3043,7 @@ void Corneria_LevelComplete1(Player* player) { gBgColor = 0x845; // 8, 8, 32 - switch (player->unk_1D0) { + switch (player->csState) { case 0: Audio_StopSfxByBankAndSource(1, player->sfxSource); sp54 = player->cam.eye.x - D_i1_8019B6D8[62]; @@ -3051,16 +3051,16 @@ void Corneria_LevelComplete1(Player* player) { D_ctx_80177A48[0] = Math_RadToDeg(Math_Atan2F(sp54, sp4C)); D_ctx_80177A48[1] = sqrtf(SQ(sp54) + SQ(sp4C)); - player->unk_1D0++; + player->csState++; D_ctx_80177A48[5] = 0.0f; D_ctx_80177A48[4] = D_ctx_80177A48[5]; D_ctx_80177A48[2] = D_ctx_80177A48[5]; /* fallthrough */ case 1: - Math_SmoothStepToF(&player->unk_0E4, 0.0f, 0.1f, 5.0f, 0.0f); + Math_SmoothStepToF(&player->rot.x, 0.0f, 0.1f, 5.0f, 0.0f); Math_SmoothStepToF(&player->pos.y, 400.0f, 0.05f, 3.0f, 0.0f); Math_SmoothStepToF(&D_ctx_80177A48[1], 1300.0f, 0.05f, 1000.0f, 0.0f); - if (player->unk_0E8 > 180.0f) { + if (player->rot.y > 180.0f) { D_ctx_80177A48[0] += 0.5f; } else { D_ctx_80177A48[0] -= 0.5f; @@ -3080,25 +3080,25 @@ void Corneria_LevelComplete1(Player* player) { temp_fa1 = player->pos.z - D_i1_8019B6D8[64]; if (gCsFrameCount < 30) { temp_deg = Math_RadToDeg(-Math_Atan2F(temp_fa0, temp_fa1)); - var_fv1 = Math_SmoothStepToAngle(&player->unk_0E8, temp_deg, 0.5f, 4.0f, 0.0001f) * 20.0f; + var_fv1 = Math_SmoothStepToAngle(&player->rot.y, temp_deg, 0.5f, 4.0f, 0.0001f) * 20.0f; } else { temp_deg = Math_RadToDeg(Math_Atan2F(temp_fa0, temp_fa1)); - var_fv1 = Math_SmoothStepToAngle(&player->unk_0E8, temp_deg, 0.5f, 2.0f, 0.0001f) * 30.0f; + var_fv1 = Math_SmoothStepToAngle(&player->rot.y, temp_deg, 0.5f, 2.0f, 0.0001f) * 30.0f; } - Math_SmoothStepToAngle(&player->unk_0EC, var_fv1, 0.1f, 5.0f, 0.0001f); + Math_SmoothStepToAngle(&player->rot.z, var_fv1, 0.1f, 5.0f, 0.0001f); if (gCsFrameCount == 220) { - player->unk_1D0++; + player->csState++; } break; case 2: - Math_SmoothStepToAngle(&player->unk_0E4, 20.0f, 0.1f, 0.5f, 0.0001f); - Math_SmoothStepToAngle(&player->unk_0EC, 0.0f, 0.1f, 1.0f, 0.0001f); + Math_SmoothStepToAngle(&player->rot.x, 20.0f, 0.1f, 0.5f, 0.0001f); + Math_SmoothStepToAngle(&player->rot.z, 0.0f, 0.1f, 1.0f, 0.0001f); Math_SmoothStepToF(&D_ctx_80177A48[2], 0.05f, 1.0f, 0.005f, 0.0001f); Math_SmoothStepToF(&player->cam.at.x, player->pos.x, D_ctx_80177A48[2], 500.0f, 0.0f); Math_SmoothStepToF(&player->cam.at.y, player->pos.y, D_ctx_80177A48[2], 500.0f, 0.0f); Math_SmoothStepToF(&player->cam.at.z, player->pos.z, D_ctx_80177A48[2], 500.0f, 0.0f); if (gCsFrameCount == 350) { - player->unk_1D0++; + player->csState++; D_ctx_80177A48[2] = 0.0f; D_ctx_80177A48[3] = 0.05f; } @@ -3107,12 +3107,12 @@ void Corneria_LevelComplete1(Player* player) { if ((gCsFrameCount > 700) && (gCsFrameCount < 1000)) { func_demo_8004AA84(); } - Math_SmoothStepToAngle(&player->unk_0E4, 20.0f, 0.1f, 0.5f, 0); - Math_SmoothStepToAngle(&player->unk_0EC, 0.0f, 0.1f, 1.0f, 0); + Math_SmoothStepToAngle(&player->rot.x, 20.0f, 0.1f, 0.5f, 0); + Math_SmoothStepToAngle(&player->rot.z, 0.0f, 0.1f, 1.0f, 0); Math_SmoothStepToF(&player->baseSpeed, 0.0f, 0.1f, 2.0f, 0.0f); Math_SmoothStepToF(&D_ctx_80177A48[2], 0.1f, 1.0f, 0.002f, 0); Math_SmoothStepToF(&D_ctx_80177A48[3], 0.1f, 1.0f, 0.002f, 0); - Matrix_RotateY(gCalcMatrix, player->unk_0E8 * M_DTOR, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, player->rot.y * M_DTOR, MTXF_NEW); Matrix_Push(&gCalcMatrix); Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[5] * M_DTOR, MTXF_APPLY); sp64.x = 0.0f; @@ -3142,7 +3142,7 @@ void Corneria_LevelComplete1(Player* player) { SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 50); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50); AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0); - player->unk_1D0++; + player->csState++; player->baseSpeed = 2.0f; player->unk_194 = 5.0f; player->unk_190 = 5.0f; @@ -3151,9 +3151,9 @@ void Corneria_LevelComplete1(Player* player) { case 4: if (gCsFrameCount >= 1270) { player->baseSpeed *= 1.2f; - player->unk_25C += 0.04f; - if (player->unk_25C > 0.6f) { - player->unk_25C = 0.6f; + player->contrailScale += 0.04f; + if (player->contrailScale > 0.6f) { + player->contrailScale = 0.6f; } player->unk_190 = 2.0f; } @@ -3166,7 +3166,7 @@ void Corneria_LevelComplete1(Player* player) { gFillScreenAlphaStep = 8; if (gFillScreenAlpha == 255) { player->state_1C8 = PLAYERSTATE_1C8_NEXT; - player->timer_1F8 = 0; + player->csTimer = 0; gFadeoutType = 4; gLeveLClearStatus[gCurrentLevel] = Play_CheckMedalStatus(150) + 1; } @@ -3251,8 +3251,8 @@ void Corneria_LevelComplete1(Player* player) { } break; } - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -((player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->rot.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->rot.x + player->aerobaticPitch) * M_DTOR), MTXF_APPLY); sp64.x = 0.0f; sp64.y = 0.0f; sp64.z = player->baseSpeed + player->boostSpeed; @@ -3263,10 +3263,10 @@ void Corneria_LevelComplete1(Player* player) { player->pos.x += player->vel.x; player->pos.y += player->vel.y; player->pos.z += player->vel.z; - player->unk_138 = player->pos.z; - player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; - player->unk_088 += 10.0f; - player->unk_080 = -SIN_DEG(player->unk_088) * 0.3f; - player->unk_0F4 += 8.0f; - player->unk_0F0 = SIN_DEG(player->unk_0F4); + player->trueZpos = player->pos.z; + player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll; + player->bobPhase += 10.0f; + player->yBob = -SIN_DEG(player->bobPhase) * 0.3f; + player->rockPhase += 8.0f; + player->rockAngle = SIN_DEG(player->rockPhase); } diff --git a/src/overlays/ovl_i1/fox_tr.c b/src/overlays/ovl_i1/fox_tr.c index 1b186852..a7973567 100644 --- a/src/overlays/ovl_i1/fox_tr.c +++ b/src/overlays/ovl_i1/fox_tr.c @@ -21,14 +21,14 @@ void Training_ItemRing_Update(ItemTrainingRing* this) { switch (this->state) { case 0: this->obj.rot.z += 1.0f; - Math_SmoothStepToF(&this->scale, 1.0f, 1.0f, 0.05f, 0.0f); + Math_SmoothStepToF(&this->width, 1.0f, 1.0f, 0.05f, 0.0f); if ((this->unk_44 == 0) && !gPlayer[0].somersault) { if (this->obj.rot.y == 0.0f) { var_fv0 = 550.0f; } else { var_fv0 = 1000.0f; } - if (this->obj.pos.z > (gPlayer[0].unk_138 + var_fv0)) { + if (this->obj.pos.z > (gPlayer[0].trueZpos + var_fv0)) { this->unk_44 = 1; PRINTF("♪:リング未通過音\n"); // Ring not passed sound AUDIO_PLAY_SFX(0x4900402F, gDefaultSfxSource, 4); @@ -38,7 +38,7 @@ void Training_ItemRing_Update(ItemTrainingRing* this) { if (this->collected) { this->state = 1; this->timer_48 = 50; - this->info.unk_10 = 10000.0f; + this->info.cullDistance = 10000.0f; PRINTF("♪:リング通過音\n"); // Ring passing sound AUDIO_PLAY_SFX(0x49008025, gDefaultSfxSource, 4); gRingPassCount++; @@ -51,9 +51,9 @@ void Training_ItemRing_Update(ItemTrainingRing* this) { this->obj.pos.x += ((gPlayer[this->playerNum].pos.x - this->obj.pos.x) * 0.05f); this->obj.pos.y += ((gPlayer[this->playerNum].pos.y - this->obj.pos.y) * 0.05f); if (gPlayer[0].cockpitView) { - this->obj.pos.z += (gPlayer[this->playerNum].unk_138 - 300.0f - this->obj.pos.z) * 0.05f; + this->obj.pos.z += (gPlayer[this->playerNum].trueZpos - 300.0f - this->obj.pos.z) * 0.05f; } else { - this->obj.pos.z += ((gPlayer[this->playerNum].unk_138 - this->obj.pos.z) * 0.05f); + this->obj.pos.z += ((gPlayer[this->playerNum].trueZpos - this->obj.pos.z) * 0.05f); } this->obj.rot.z += 22.0f; Math_SmoothStepToAngle(&this->obj.rot.y, Math_RadToDeg(-gPlayer[this->playerNum].camYaw), 0.2f, 10.0f, diff --git a/src/overlays/ovl_i1/fox_tr360.c b/src/overlays/ovl_i1/fox_tr360.c index 8dcedd49..b9cabfc7 100644 --- a/src/overlays/ovl_i1/fox_tr360.c +++ b/src/overlays/ovl_i1/fox_tr360.c @@ -154,7 +154,7 @@ void Training_80199024(Actor* actor) { radarMark->pos.x = actor->obj.pos.x; radarMark->pos.y = actor->obj.pos.y; radarMark->pos.z = actor->obj.pos.z; - radarMark->unk_10 = actor->unk_0F4.y + 180.0f; + radarMark->yRot = actor->unk_0F4.y + 180.0f; if (actor->iwork[8] != 0) { actor->iwork[8]--; } @@ -217,22 +217,22 @@ void Training_8019949C(void) { } } - if (D_ctx_80177C78 != 0) { - D_ctx_80177C78--; + if (gTraining360MsgTimer != 0) { + gTraining360MsgTimer--; } - if (D_ctx_80177C78 == 0) { - if (D_i1_8019AE50[D_ctx_80177C8C].msg == 0) { - D_ctx_80177C8C = 1; + if (gTraining360MsgTimer == 0) { + if (D_i1_8019AE50[gTraining360MsgIndex].msg == 0) { + gTraining360MsgIndex = 1; } - if (D_i1_8019AE50[D_ctx_80177C8C].unk != 0) { - Radio_PlayMessage(D_i1_8019AE50[D_ctx_80177C8C].msg, RCID_TR); - D_ctx_80177C78 = D_i1_8019AE50[D_ctx_80177C8C].unk; + if (D_i1_8019AE50[gTraining360MsgIndex].unk != 0) { + Radio_PlayMessage(D_i1_8019AE50[gTraining360MsgIndex].msg, RCID_TR); + gTraining360MsgTimer = D_i1_8019AE50[gTraining360MsgIndex].unk; } else { gCallTimer = 80; - D_ctx_80177C78 = 320; + gTraining360MsgTimer = 320; } - D_ctx_80177C8C++; + gTraining360MsgIndex++; } if ((gCallTimer != 0) && (gControllerPress[gMainController].button & R_CBUTTONS)) { diff --git a/src/overlays/ovl_i1/fox_ve1.c b/src/overlays/ovl_i1/fox_ve1.c index 79d882dc..5da5e486 100644 --- a/src/overlays/ovl_i1/fox_ve1.c +++ b/src/overlays/ovl_i1/fox_ve1.c @@ -339,8 +339,8 @@ void Venom1_80192518(Actor* actor) { f32 temp_fv1_2; Effect* effect; - if (actor->unk_0D0 == 1) { - actor->unk_0D0 = 0; + if (actor->dmgType == 1) { + actor->dmgType = 0; func_effect_8007A6F0(&actor->obj.pos, 0x29121007); } @@ -621,8 +621,8 @@ void Venom1_80192CB0(Actor* actor) { } void Venom1_80192CD4(Actor* actor) { - if (actor->unk_0D0 == 1) { - actor->unk_0D0 = 0; + if (actor->dmgType == 1) { + actor->dmgType = 0; func_effect_8007A6F0(&actor->obj.pos, 0x29121007); } @@ -763,8 +763,8 @@ void Venom1_80192EB0(Actor* actor) { } break; } - if (actor->unk_0D0 == 1) { - actor->unk_0D0 = 0; + if (actor->dmgType == 1) { + actor->dmgType = 0; func_effect_8007A6F0(&actor->obj.pos, 0x29121007); } actor->iwork[0]++; @@ -778,8 +778,8 @@ void Venom1_801933B4(Actor* actor) { void Venom1_801933DC(Actor* actor) { f32* hitboxData; - if (actor->unk_0D0 == 1) { - actor->unk_0D0 = 0; + if (actor->dmgType == 1) { + actor->dmgType = 0; AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 0); } @@ -804,7 +804,7 @@ void Venom1_801934D0(Actor* actor) { } void Venom1_80193540(Scenery* scenery) { - if (((gPlayer[0].unk_138 - scenery->obj.pos.z) <= 3500.0f) && ((gGameFrameCount % 4) == 0)) { + if (((gPlayer[0].trueZpos - scenery->obj.pos.z) <= 3500.0f) && ((gGameFrameCount % 4) == 0)) { func_effect_8007C120(scenery->obj.pos.x, scenery->obj.pos.y, scenery->obj.pos.z, 0.0f, 0.0f, 0.0f, 0.2f, 10); } } @@ -1672,10 +1672,10 @@ void Venom1_80194398(Boss* boss) { } switch (boss->swork[6]) { case 0: - temp_fs0 = gPlayer[0].unk_138 + boss->fwork[2]; + temp_fs0 = gPlayer[0].trueZpos + boss->fwork[2]; if (boss->swork[15] == 0) { if (boss->obj.pos.z >= temp_fs0) { - if (boss->obj.pos.z > (gPlayer[0].unk_138 - 200.0f)) { + if (boss->obj.pos.z > (gPlayer[0].trueZpos - 200.0f)) { var_fv0 = Math_SmoothStepToF(&boss->obj.pos.z, temp_fs0, 0.5f, 35.0f, 0.01f); } else { var_fv0 = Math_SmoothStepToF(&boss->obj.pos.z, temp_fs0, 0.4f, 10.0f, 0.01f); @@ -1742,7 +1742,7 @@ void Venom1_80194398(Boss* boss) { boss->fwork[11] = 0.8f; } } - temp_fs0 = gPlayer[0].unk_138 + boss->fwork[2] - boss->obj.pos.z; + temp_fs0 = gPlayer[0].trueZpos + boss->fwork[2] - boss->obj.pos.z; if ((fabsf(temp_fs0) <= 70.0f) && (boss->state == 3)) { boss->swork[5] = D_i1_8019AD2C[4].unk_0[0].unk_0; boss->swork[4] = boss->swork[4]; @@ -2221,7 +2221,7 @@ void Venom1_80194398(Boss* boss) { if (actor->obj.status == OBJ_FREE) { while ((is3 <= boss->swork[22]) && - ((temp_fs0 + D_i1_80199CD0[is4][is3].z) >= (var_fv0 + gPlayer[0].unk_138))) { + ((temp_fs0 + D_i1_80199CD0[is4][is3].z) >= (var_fv0 + gPlayer[0].trueZpos))) { is3++; } if (is3 <= boss->swork[22]) { @@ -2368,7 +2368,7 @@ void Venom1_801985E4(Boss* boss) { boss->state = boss->swork[9]; } -void Venom1_8019864C(PlayerShot* playerShot) { +void Venom1_8019864C(PlayerShot* shot) { s32 i; s32 j; s32 count; @@ -2382,7 +2382,7 @@ void Venom1_8019864C(PlayerShot* playerShot) { boss = gBosses; for (i = 0; i < 4; i++, boss++) { if ((boss->obj.id == OBJ_BOSS_319) && (boss->obj.status == OBJ_ACTIVE) && (boss->timer_05A == 0)) { - temp_fs1 = playerShot->unk_44 * 30.0f; + temp_fs1 = shot->scale * 30.0f; hitboxData = boss->info.hitbox; count = *hitboxData++; if (count != 0) { @@ -2392,9 +2392,9 @@ void Venom1_8019864C(PlayerShot* playerShot) { Matrix_RotateX(gCalcMatrix, -boss->obj.rot.x * M_DTOR, MTXF_APPLY); Matrix_RotateY(gCalcMatrix, -boss->obj.rot.y * M_DTOR, MTXF_APPLY); - sp88.x = playerShot->obj.pos.x - boss->obj.pos.x; - sp88.y = playerShot->obj.pos.y - boss->obj.pos.y; - sp88.z = playerShot->obj.pos.z - boss->obj.pos.z; + sp88.x = shot->obj.pos.x - boss->obj.pos.x; + sp88.y = shot->obj.pos.y - boss->obj.pos.y; + sp88.z = shot->obj.pos.z - boss->obj.pos.z; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp88, &sp78); diff --git a/src/overlays/ovl_i2/fox_me.c b/src/overlays/ovl_i2/fox_me.c index aa1f4bbe..30d3b236 100644 --- a/src/overlays/ovl_i2/fox_me.c +++ b/src/overlays/ovl_i2/fox_me.c @@ -44,8 +44,8 @@ Vec3f D_i2_80195610[] = { }; void Meteo_80187530(Actor* actor) { - if (actor->unk_0D0 == 1) { - actor->unk_0D0 = 0; + if (actor->dmgType == 1) { + actor->dmgType = 0; func_effect_8007A6F0(&actor->obj.pos, 0x2902107D); } } @@ -53,8 +53,8 @@ void Meteo_80187530(Actor* actor) { void Meteo_8018756C(Actor* actor) { Vec3f vec; - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; + if (actor->dmgType != 0) { + actor->dmgType = 0; actor->health -= actor->damage; if (actor->health <= 0) { actor->obj.status = OBJ_DYING; @@ -95,7 +95,7 @@ void Meteo_80187650(Actor* actor) { func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 6.0f); } - if (actor->unk_0D0 != 0) { + if (actor->dmgType != 0) { func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 10.0f); Object_Kill(&actor->obj, actor->sfxSource); @@ -132,7 +132,7 @@ void Meteo_801877C4(Actor* actor) { actor->obj.pos.x = actor->fwork[0] + sp44.x; actor->obj.pos.y = actor->fwork[1] + sp44.y; - if (actor->unk_0D0 != 0) { + if (actor->dmgType != 0) { Actor_Despawn(actor); func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); Object_Kill(&actor->obj, actor->sfxSource); @@ -142,7 +142,7 @@ void Meteo_801877C4(Actor* actor) { if (actor->timer_0BC == 0) { actor->timer_0BC = 40; - if (actor->obj.pos.z < (gPlayer[0].unk_138 - 1000.0f)) { + if (actor->obj.pos.z < (gPlayer[0].trueZpos - 1000.0f)) { func_effect_8007F11C(OBJ_EFFECT_353, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 120.0f); } } @@ -155,7 +155,7 @@ void Meteo_8018795C(Actor* actor) { actor->obj.rot.y += 7.0f; actor->obj.rot.x += 3.3f; - if (actor->unk_0D0 != 0) { + if (actor->dmgType != 0) { Actor_Despawn(actor); func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); Object_Kill(&actor->obj, actor->sfxSource); @@ -191,7 +191,7 @@ void Meteo_80187B08(Actor* actor) { func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 6.0f); } - if ((actor->unk_0D0 != 0) || (actor->timer_0BC == 0)) { + if ((actor->dmgType != 0) || (actor->timer_0BC == 0)) { func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); Object_Kill(&actor->obj, actor->sfxSource); func_effect_8007D0E0(actor->obj.pos.x - actor->vel.x, actor->obj.pos.y, actor->obj.pos.z - actor->vel.z, 8.0f); @@ -444,7 +444,7 @@ void Meteo_80188344(Boss* boss) { 20.0f, 30); boss->state = 5; - boss->info.unk_10 = 1000.0f; + boss->info.cullDistance = 1000.0f; Audio_KillSfxBySourceAndId(boss->sfxSource, 0x3103605B); AUDIO_PLAY_SFX(0x3102405D, boss->sfxSource, 4); @@ -933,7 +933,7 @@ void Meteo_8018978C(Boss* boss) { if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) { gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; - gPlayer[0].unk_1D0 = 0; + gPlayer[0].csState = 0; gCsFrameCount = 0; } @@ -947,7 +947,7 @@ void Meteo_8018978C(Boss* boss) { } } - sp7C = boss->obj.pos.z + D_ctx_80177D20; + sp7C = boss->obj.pos.z + gPathProgress; if (boss->state >= 3) { if (boss->state < 20) { @@ -1085,7 +1085,7 @@ void Meteo_8018978C(Boss* boss) { boss->swork[1] = 10; boss->obj.pos.y += ((0.0f - boss->obj.pos.y) * boss->fwork[1]); - boss->vel.z = boss->fwork[0] - D_ctx_80177D08; + boss->vel.z = boss->fwork[0] - gPathVelZ; if (sp7C < boss->fwork[9]) { boss->state = 1; @@ -1101,7 +1101,7 @@ void Meteo_8018978C(Boss* boss) { case 1: boss->obj.pos.y += ((0.0f - boss->obj.pos.y) * boss->fwork[1]); - boss->vel.z = boss->fwork[0] - D_ctx_80177D08; + boss->vel.z = boss->fwork[0] - gPathVelZ; if (boss->fwork[0] < 0.0f) { boss->fwork[0] += 0.5f; @@ -1119,7 +1119,7 @@ void Meteo_8018978C(Boss* boss) { case 2: boss->obj.pos.y += ((0.0f - boss->obj.pos.y) * boss->fwork[1]); - boss->vel.z = boss->fwork[0] - D_ctx_80177D08; + boss->vel.z = boss->fwork[0] - gPathVelZ; if (boss->fwork[1] < 0.05f) { boss->fwork[1] = boss->fwork[1] + 0.0004f; @@ -1775,16 +1775,16 @@ void Meteo_8018BACC(Boss* boss) { void Meteo_8018C77C(Actor* actor, s32 arg1) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = D_i2_80195584[arg1] + gPlayer[0].pos.x; actor->obj.pos.y = D_i2_80195594[arg1] + gPlayer[0].pos.y; - actor->obj.pos.z = D_i2_801955A4[arg1] + gPlayer[0].unk_138; + actor->obj.pos.z = D_i2_801955A4[arg1] + gPlayer[0].trueZpos; actor->unk_0B6 = D_i2_801955B4[arg1]; actor->obj.rot.y = 180.0f; Object_SetInfo(&actor->info, actor->obj.id); - actor->info.unk_10 = 200.0f; + actor->info.cullDistance = 200.0f; if (actor->unk_0B6 == 0) { actor->iwork[11] = 1; @@ -1839,7 +1839,7 @@ void Meteo_8018CAD8(void) { actor->obj.pos.y = 0.0f; actor->obj.pos.z = 9000.0f; actor->unk_0B6 = 10; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; Object_SetInfo(&actor->info, actor->obj.id); } @@ -1897,7 +1897,7 @@ void Meteo_LevelStart(Player* player) { PRINTF("Demo_Time %d\n"); - switch (player->unk_1D0) { + switch (player->csState) { case 0: gCsFrameCount = 0; @@ -1924,13 +1924,13 @@ void Meteo_LevelStart(Player* player) { player->cam.eye.x = gCsCamEyeX = player->pos.x + 100.0f; player->cam.eye.y = gCsCamEyeY = player->pos.y; - player->cam.eye.z = gCsCamEyeZ = D_ctx_80177A48[1] + player->unk_138; + player->cam.eye.z = gCsCamEyeZ = D_ctx_80177A48[1] + player->trueZpos; player->cam.at.x = gCsCamAtX = D_ctx_80177A48[2] + player->pos.x; player->cam.at.y = gCsCamAtY = player->pos.y; - player->cam.at.z = gCsCamAtZ = D_ctx_80177A48[4] + player->unk_138; + player->cam.at.z = gCsCamAtZ = D_ctx_80177A48[4] + player->trueZpos; - player->unk_1D0 = 1; + player->csState = 1; D_ctx_80177A48[3] = 1.0f; @@ -1938,14 +1938,14 @@ void Meteo_LevelStart(Player* player) { actor3->vel.z = 4.0f; gCsCamEyeX = player->pos.x + 100.0f; gCsCamEyeY = player->pos.y; - gCsCamEyeZ = D_ctx_80177A48[1] + player->unk_138; + gCsCamEyeZ = D_ctx_80177A48[1] + player->trueZpos; gCsCamAtX = D_ctx_80177A48[2] + player->pos.x; gCsCamAtY = player->pos.y + 20.0f; - gCsCamAtZ = D_ctx_80177A48[4] + player->unk_138; + gCsCamAtZ = D_ctx_80177A48[4] + player->trueZpos; Math_SmoothStepToF(&D_ctx_80177A48[1], 8000.0f, 0.05f, 20.0f, 0); Math_SmoothStepToF(&D_ctx_80177A48[2], 0.0f, 0.05f, 25.0f, 0); Math_SmoothStepToF(&D_ctx_80177A48[4], 0.0f, 0.05f, 200.0f, 0); - Math_SmoothStepToF(&player->unk_0EC, 0.0f, 0.05f, 0.3f, 0); + Math_SmoothStepToF(&player->rot.z, 0.0f, 0.05f, 0.3f, 0); D_ctx_80177A48[0] = 0.1f; if (gCsFrameCount == 680) { @@ -1961,29 +1961,29 @@ void Meteo_LevelStart(Player* player) { actor1->state = 13; } if (gCsFrameCount > 810) { - player->unk_1D0 = 2; + player->csState = 2; D_ctx_80177A48[0] = 0.0f; - player->timer_1F8 = 40; + player->csTimer = 40; } sp8F = false; if (gCsFrameCount == 190) { - player->timer_1FC = 5; - player->unk_1D8 = 10; + player->csEventTimer = 5; + player->meTargetIndex = 10; sp8F = true; } if (gCsFrameCount == 230) { - player->timer_1FC = 3; - player->unk_1D8 = 6; + player->csEventTimer = 3; + player->meTargetIndex = 6; sp8F = true; } if (gCsFrameCount == 240) { - player->timer_1FC = 3; - player->unk_1D8 = 11; + player->csEventTimer = 3; + player->meTargetIndex = 11; sp8F = true; } if (gCsFrameCount == 270) { - player->timer_1FC = 2; - player->unk_1D8 = 12; + player->csEventTimer = 2; + player->meTargetIndex = 12; sp8F = true; } if (gCsFrameCount == 600) { @@ -2022,16 +2022,16 @@ void Meteo_LevelStart(Player* player) { Meteo_8018CCF8(&gActors[8]); } - if (player->timer_1FC != 0) { + if (player->csEventTimer != 0) { if (sp8F != 0) { sp58 = D_i2_801955C4; D_ctx_80177A48[3] *= -1.0f; - x = gActors[player->unk_1D8].obj.pos.x - (actor3->obj.pos.x + (D_ctx_80177A48[3] * 74.0f)); - y = gActors[player->unk_1D8].obj.pos.y - (actor3->obj.pos.y - 232.0f); - z = gActors[player->unk_1D8].obj.pos.z - (actor3->obj.pos.z - 1190.0f); + x = gActors[player->meTargetIndex].obj.pos.x - (actor3->obj.pos.x + (D_ctx_80177A48[3] * 74.0f)); + y = gActors[player->meTargetIndex].obj.pos.y - (actor3->obj.pos.y - 232.0f); + z = gActors[player->meTargetIndex].obj.pos.z - (actor3->obj.pos.z - 1190.0f); sp64 = Math_RadToDeg(Math_Atan2F(x, z)); - x = sqrtf((x * x) + (z * z)); + x = sqrtf(SQ(x) + SQ(z)); sp68 = Math_RadToDeg(-Math_Atan2F(y, x)); Matrix_RotateY(gCalcMatrix, M_DTOR * sp64, MTXF_NEW); @@ -2043,11 +2043,12 @@ void Meteo_LevelStart(Player* player) { actor3->obj.pos.z - 1190.0f + (sp4C.z * 0.8f), sp4C.x, sp4C.y, sp4C.z, sp68, sp64, 0.0f); } - if (player->timer_1FC == 1) { - func_effect_8007D2C8(gActors[player->unk_1D8].obj.pos.x, gActors[player->unk_1D8].obj.pos.y, - gActors[player->unk_1D8].obj.pos.z, 10.0f); - gActors[player->unk_1D8].obj.status = OBJ_FREE; - Meteo_8018CCF8(&gActors[player->unk_1D8]); + if (player->csEventTimer == 1) { + func_effect_8007D2C8(gActors[player->meTargetIndex].obj.pos.x, + gActors[player->meTargetIndex].obj.pos.y, + gActors[player->meTargetIndex].obj.pos.z, 10.0f); + gActors[player->meTargetIndex].obj.status = OBJ_FREE; + Meteo_8018CCF8(&gActors[player->meTargetIndex]); Object_Kill(&gPlayerShots[0].obj, gPlayerShots[0].sfxSource); } } @@ -2059,23 +2060,23 @@ void Meteo_LevelStart(Player* player) { gCsCamEyeZ = 400.0f; gCsCamAtX = player->pos.x; gCsCamAtY = (player->pos.y * player->unk_148) + 20.0f; - gCsCamAtZ = player->unk_138; + gCsCamAtZ = player->trueZpos; Math_SmoothStepToF(D_ctx_80177A48, 1.0f, 1.0f, 0.01f, 0.0f); - if (player->timer_1F8 == 0) { + if (player->csTimer == 0) { AUDIO_PLAY_BGM(gBgmSeqId); gLevelStartStatusScreenTimer = 80; player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; - player->unk_1D0 = 0; - player->timer_1F8 = 0; - player->timer_1FC = 0; + player->csState = 0; + player->csTimer = 0; + player->csEventTimer = 0; player->cam.eye.x = player->pos.x; player->cam.eye.y = (player->pos.y * player->unk_148) + 50.0f; player->cam.eye.z = 400.0f; player->cam.at.x = player->pos.x; player->cam.at.y = (player->pos.y * player->unk_148) + 20.0f; - player->cam.at.z = player->unk_138; + player->cam.at.z = player->trueZpos; for (i = 0; i < 4; i++) { Object_Kill(&gActors[i].obj, gActors[i].sfxSource); @@ -2184,11 +2185,11 @@ void Meteo_8018DE14(Effect* effect) { void Meteo_8018DF08(Actor* actor, s32 idx) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = D_i2_801955D0[idx].x + gPlayer[0].pos.x; actor->obj.pos.y = D_i2_801955D0[idx].y + gPlayer[0].pos.y; - actor->obj.pos.z = D_i2_801955D0[idx].z + gPlayer[0].unk_138; + actor->obj.pos.z = D_i2_801955D0[idx].z + gPlayer[0].trueZpos; actor->unk_0F4.y = 0.0f; actor->unk_0F4.z = D_i2_80195600[idx]; @@ -2212,19 +2213,19 @@ void Meteo_LevelComplete(Player* player) { gBosses[1].obj.status = OBJ_FREE; - Math_SmoothStepToF(&player->unk_130, 0.0f, 0.1f, 15.0f, 0.0f); - Math_SmoothStepToF(&player->unk_12C, 0.0f, 0.1f, 15.0f, 0.0f); - Math_SmoothStepToF(&player->unk_0E8, 0.0f, 0.1f, 3.0f, 0.0f); - Math_SmoothStepToF(&player->unk_0EC, 0.0f, 0.1f, 3.0f, 0.0f); - Math_SmoothStepToF(&player->unk_08C, 0.0f, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToF(&player->zRotBarrelRoll, 0.0f, 0.1f, 15.0f, 0.0f); + Math_SmoothStepToF(&player->zRotBank, 0.0f, 0.1f, 15.0f, 0.0f); + Math_SmoothStepToF(&player->rot.y, 0.0f, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToF(&player->rot.z, 0.0f, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToF(&player->camDist, 0.0f, 0.1f, 3.0f, 0.0f); Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 3.0f, 0.0f); - Math_SmoothStepToAngle(&player->unk_4D8, 0.0f, 0.1f, 20.0f, 0.0f); + Math_SmoothStepToAngle(&player->aerobaticPitch, 0.0f, 0.1f, 20.0f, 0.0f); Math_SmoothStepToF(&player->boostSpeed, 0.0f, 0.1f, 3.0f, 0.0f); - switch (player->unk_1D0) { + switch (player->csState) { case 0: Audio_StopSfxByBankAndSource(1, player->sfxSource); - player->unk_1D0++; + player->csState++; D_ctx_80177A48[0] = 0.0f; D_ctx_80177A48[1] = 0.0f; @@ -2245,34 +2246,34 @@ void Meteo_LevelComplete(Player* player) { gCsCamEyeX = gBosses[0].obj.pos.x + dest.x; gCsCamEyeY = gBosses[0].obj.pos.y + dest.y; - gCsCamEyeZ = gBosses[0].obj.pos.z + D_ctx_80177D20 + dest.z; + gCsCamEyeZ = gBosses[0].obj.pos.z + gPathProgress + dest.z; gCsCamAtX = gBosses[0].obj.pos.x; gCsCamAtY = gBosses[0].obj.pos.y; - gCsCamAtZ = gBosses[0].obj.pos.z + D_ctx_80177D20; + gCsCamAtZ = gBosses[0].obj.pos.z + gPathProgress; Math_SmoothStepToF(&D_ctx_80177A48[1], 180.0f, 0.05f, 1.0f, 0.0f); Math_SmoothStepToF(&D_ctx_80177A48[2], 1500.0f, 0.1f, 10.0f, 0.0f); Math_SmoothStepToF(&D_ctx_80177A48[0], 0.1f, 0.1f, 0.001f, 0.0f); Math_SmoothStepToF(&player->baseSpeed, 0.0f, 1.0f, 0.5f, 0.0f); Math_SmoothStepToF(&gBosses[0].vel.z, 0.0f, 1.0f, 0.5f, 0.0f); - Math_SmoothStepToF(&player->unk_0E4, 0.0f, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToF(&player->rot.x, 0.0f, 0.1f, 3.0f, 0.0f); if (gCsFrameCount == 320) { gCsFrameCount = 200; D_ctx_80177A48[0] = 0.0f; D_ctx_80177A48[3] = 0.0f; D_ctx_80177A48[4] = 0.0f; - player->unk_1D0++; - player->timer_1F8 = 100; + player->csState++; + player->csTimer = 100; } break; case 2: - if (player->timer_1F8 == 0) { + if (player->csTimer == 0) { Math_SmoothStepToF(&D_ctx_80177A48[3], 1.0f, 1.0f, 0.01f, 0.0f); } - if (player->timer_1F8 == 50) { + if (player->csTimer == 50) { AUDIO_PLAY_BGM(SEQ_ID_GOOD_END); } @@ -2311,11 +2312,11 @@ void Meteo_LevelComplete(Player* player) { gCsCamAtX = player->pos.x; gCsCamAtY = player->pos.y; - gCsCamAtZ = player->unk_138 + D_ctx_80177D20 + 150.0f; + gCsCamAtZ = player->trueZpos + gPathProgress + 150.0f; if (gCsFrameCount > 1390) { player->baseSpeed += 2.0f; - player->unk_0E4 += 0.1f; + player->rot.x += 0.1f; player->unk_190 = 2.0f; if (gCsFrameCount == 1465) { @@ -2328,7 +2329,7 @@ void Meteo_LevelComplete(Player* player) { gFillScreenAlphaStep = 8; if (gFillScreenAlpha == 255) { player->state_1C8 = PLAYERSTATE_1C8_NEXT; - player->timer_1F8 = 0; + player->csTimer = 0; gFadeoutType = 4; gLeveLClearStatus[LEVEL_METEO] = Play_CheckMedalStatus(200) + 1; } @@ -2336,7 +2337,7 @@ void Meteo_LevelComplete(Player* player) { } else { gCsCamEyeX = player->pos.x + dest.x; gCsCamEyeY = player->pos.y + dest.y; - gCsCamEyeZ = player->unk_138 + D_ctx_80177D20 + 150.0f + dest.z; + gCsCamEyeZ = player->trueZpos + gPathProgress + 150.0f + dest.z; } break; } @@ -2439,7 +2440,7 @@ void Meteo_LevelComplete(Player* player) { gActors[3].state = 1; gActors[3].obj.pos.x = player->cam.eye.x - 700.0f; gActors[3].obj.pos.y = player->cam.eye.y; - gActors[3].obj.pos.z = player->cam.eye.z - D_ctx_80177D20 + 1000.0f; + gActors[3].obj.pos.z = player->cam.eye.z - gPathProgress + 1000.0f; break; } @@ -2450,8 +2451,8 @@ void Meteo_LevelComplete(Player* player) { Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0); Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0); - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -((player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->rot.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->rot.x + player->aerobaticPitch) * M_DTOR), MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; @@ -2467,12 +2468,12 @@ void Meteo_LevelComplete(Player* player) { player->pos.y += player->vel.y; player->pos.z += player->vel.z; - player->unk_138 = player->pos.z + player->unk_08C; - player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; - player->unk_088 += 10.0f; - player->unk_080 = -SIN_DEG(player->unk_088) * 0.3f; - player->unk_0F4 += 8.0f; - player->unk_0F0 = SIN_DEG(player->unk_0F4); + player->trueZpos = player->pos.z + player->camDist; + player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll; + player->bobPhase += 10.0f; + player->yBob = -SIN_DEG(player->bobPhase) * 0.3f; + player->rockPhase += 8.0f; + player->rockAngle = SIN_DEG(player->rockPhase); } void Meteo_8018ED9C(Actor* actor) { diff --git a/src/overlays/ovl_i2/fox_sx.c b/src/overlays/ovl_i2/fox_sx.c index deb8d41d..1f058636 100644 --- a/src/overlays/ovl_i2/fox_sx.c +++ b/src/overlays/ovl_i2/fox_sx.c @@ -28,7 +28,7 @@ void SectorX_8018F030(void) { actor->obj.rot.y = 180.0f; actor->obj.pos.x = gPlayer[0].cam.eye.x - 300.0f; actor->obj.pos.y = gPlayer[0].cam.eye.y + 200.0f; - actor->obj.pos.z = gPlayer[0].cam.eye.z - D_ctx_80177D20 + 300.0f; + actor->obj.pos.z = gPlayer[0].cam.eye.z - gPathProgress + 300.0f; actor->iwork[11] = 1; actor->aiType = AI360_SLIPPY; Object_SetInfo(&actor->info, actor->obj.id); @@ -49,7 +49,7 @@ void SectorX_8018F124(void) { actor->obj.pos.y = gPlayer[0].cam.eye.y - 3000.0f; actor->obj.pos.z = gPlayer[0].pos.z + 30000.0f; Object_SetInfo(&actor->info, actor->obj.id); - actor->info.unk_10 = 100000.0f; + actor->info.cullDistance = 100000.0f; } void SectorX_8018F1DC(Actor* actor) { @@ -128,7 +128,7 @@ void SectorX_8018F330(Actor* actor) { Math_SmoothStepToF(&actor->fwork[1], 0.1f, 1.0f, 0.01f, 0); Math_SmoothStepToF(&gPlayer[0].cam.at.x, actor->obj.pos.x, actor->fwork[0], 100.0f, 0.0f); Math_SmoothStepToF(&gPlayer[0].cam.at.y, actor->obj.pos.y, actor->fwork[0], 100.0f, 0.0f); - Math_SmoothStepToF(&gPlayer[0].cam.at.z, actor->obj.pos.z + D_ctx_80177D20, actor->fwork[0], 100.0f, 0.0f); + Math_SmoothStepToF(&gPlayer[0].cam.at.z, actor->obj.pos.z + gPathProgress, actor->fwork[0], 100.0f, 0.0f); Math_SmoothStepToF(&gPlayer[0].cam.eye.x, actor->obj.pos.x - 30.0f, actor->fwork[1], 20.0f, 0.0f); Math_SmoothStepToF(&gPlayer[0].cam.eye.y, actor->obj.pos.y, actor->fwork[1], 20.0f, 0.0f); if (actor->timer_0BC == 0) { @@ -197,8 +197,8 @@ void SectorX_8018FA04(f32 x, f32 y, f32 z) { actor->obj.pos.z = z; Object_SetInfo(&actor->info, actor->obj.id); actor->info.hitbox = SEGMENTED_TO_VIRTUAL(D_SX_60328CC); - xRot = Math_Atan2F(gPlayer[0].pos.x - x, gPlayer[0].unk_138 - z); - pad = sqrtf(SQ(gPlayer[0].pos.x - x) + SQ(gPlayer[0].unk_138 - z)); + xRot = Math_Atan2F(gPlayer[0].pos.x - x, gPlayer[0].trueZpos - z); + pad = sqrtf(SQ(gPlayer[0].pos.x - x) + SQ(gPlayer[0].trueZpos - z)); yRot = -Math_Atan2F(gPlayer[0].pos.y - y, pad); Matrix_RotateY(gCalcMatrix, xRot, MTXF_NEW); Matrix_RotateX(gCalcMatrix, yRot, MTXF_APPLY); @@ -208,7 +208,7 @@ void SectorX_8018FA04(f32 x, f32 y, f32 z) { Matrix_MultVec3f(gCalcMatrix, &src, &dest); actor->vel.x = dest.x; actor->vel.y = dest.y; - actor->vel.z = dest.z - D_ctx_80177D08; + actor->vel.z = dest.z - gPathVelZ; break; } } @@ -360,7 +360,7 @@ void SectorX_80190078(Boss* boss) { } sp68 = gPlayer[0].pos.x - boss->obj.pos.x; - sp64 = gPlayer[0].unk_138 - (boss->obj.pos.z + (-237.0f)); + sp64 = gPlayer[0].trueZpos - (boss->obj.pos.z + (-237.0f)); if (boss->swork[7] != 0) { sp70 = Math_RadToDeg(Math_Atan2F(sp68, sp64)); @@ -498,7 +498,7 @@ void SectorX_80190078(Boss* boss) { switch (boss->state) { case 0: boss->swork[7] = 1; - boss->obj.pos.x = gPlayer[0].unk_0AC; + boss->obj.pos.x = gPlayer[0].xPath; boss->swork[0] = 0; Animation_GetFrameData(&D_SX_60206DC, boss->unk_04C, boss->vwork); boss->fwork[1] = -2000.0f; @@ -1072,7 +1072,7 @@ void SectorX_80190078(Boss* boss) { if (boss->timer_050 == 120) { if ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_NEXT) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_DOWN)) { gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; - gPlayer[0].unk_1D0 = 0; + gPlayer[0].csState = 0; gPlayer[0].unk_234 = 1; } Object_Kill(&boss->obj, boss->sfxSource); @@ -1412,7 +1412,7 @@ void SectorX_80193800(Actor* actor, s32 arg1) { Actor_Initialize(actor); actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = D_i2_801956B0[arg1].x; actor->obj.pos.y = D_i2_801956B0[arg1].y; actor->obj.pos.z = D_i2_801956B0[arg1].z; @@ -1428,7 +1428,7 @@ void SectorX_80193800(Actor* actor, s32 arg1) { void SectorX_801938D8(Actor* actor, s32 arg1) { Actor_Initialize(actor); actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = gPlayer[0].cam.eye.x + D_i2_801956EC[arg1].x; actor->obj.pos.y = gPlayer[0].cam.eye.y + D_i2_801956EC[arg1].y; actor->obj.pos.z = gPlayer[0].cam.eye.z + D_i2_801956EC[arg1].z; @@ -1456,13 +1456,13 @@ void SectorX_LevelStart(Player* player) { f32 xzDeg; f32 xyzDeg; - switch (player->unk_1D0) { + switch (player->csState) { case 0: gCsFrameCount = 0; for (i = 0; i < 5; i++) { SectorX_80193800(&gActors[5 + i], i); } - player->unk_1D0 = 1; + player->csState = 1; player->cam.eye.x = gCsCamEyeX = 100.0f; player->cam.eye.y = gCsCamEyeY = 0.0f; player->cam.eye.z = gCsCamEyeZ = -200.0f; @@ -1506,7 +1506,7 @@ void SectorX_LevelStart(Player* player) { func_effect_80079618(gActors[5].obj.pos.x, gActors[5].obj.pos.y, gActors[5].obj.pos.z, 0.5f); } func_effect_8007A6F0(&gActors[5].obj.pos, 0x2903B009); - player->unk_1D0 += 1; + player->csState += 1; D_ctx_80177A48[0] = 0.1f; } break; @@ -1515,13 +1515,13 @@ void SectorX_LevelStart(Player* player) { if (gCsFrameCount == 170) { player->pos.x = 0.0f; player->pos.y = player->cam.eye.y + 50.0f; - player->unk_1D0 += 1; + player->csState += 1; player->pos.z = player->cam.eye.z + 20.0f; player->unk_194 = 10.0f; player->unk_190 = 10.0f; player->baseSpeed = 30.0f; - player->unk_0EC = -80.0f; - player->unk_0E4 = -20.0f; + player->rot.z = -80.0f; + player->rot.x = -20.0f; AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0); for (i = 6; i < 10; i++) { Object_Kill(&gActors[i].obj, gActors[i].sfxSource); @@ -1539,8 +1539,8 @@ void SectorX_LevelStart(Player* player) { } Math_SmoothStepToF(&player->camRoll, 0.0f, 0.5f, 0.07f, 0); - Math_SmoothStepToF(&player->unk_0EC, 0.0f, 0.2f, 2.0f, 0); - Math_SmoothStepToF(&player->unk_0E4, 20.0f, 0.1f, 1.0f, 0); + Math_SmoothStepToF(&player->rot.z, 0.0f, 0.2f, 2.0f, 0); + Math_SmoothStepToF(&player->rot.x, 20.0f, 0.1f, 1.0f, 0); switch (gCsFrameCount) { case 195: @@ -1561,8 +1561,8 @@ void SectorX_LevelStart(Player* player) { } if (gCsFrameCount > 300) { - player->unk_1D0 += 1; - player->timer_1F8 = 40; + player->csState += 1; + player->csTimer = 40; D_ctx_80177A48[0] = 0.0f; gActors[0].obj.pos.z -= player->pos.z; gActors[1].obj.pos.z -= player->pos.z; @@ -1579,25 +1579,25 @@ void SectorX_LevelStart(Player* player) { case 4: Math_SmoothStepToF(&player->camRoll, 0.0f, 0.2f, 0.5f, 0); Math_SmoothStepToF(&player->pos.y, 350.0f, 0.1f, 15.0f, 0); - Math_SmoothStepToF(&player->unk_0E4, 0.0f, 0.1f, 2.0f, 0); + Math_SmoothStepToF(&player->rot.x, 0.0f, 0.1f, 2.0f, 0); gCsCamEyeX = player->pos.x; gCsCamEyeY = (player->pos.y * player->unk_148) + 50.0f; gCsCamEyeZ = 400.0f; gCsCamAtX = player->pos.x; gCsCamAtY = (player->pos.y * player->unk_148) + 20.0f; - gCsCamAtZ = player->unk_138; + gCsCamAtZ = player->trueZpos; Math_SmoothStepToF(D_ctx_80177A48, 1.0f, 1.0f, 0.01f, 0); - if (player->timer_1F8 == 0) { + if (player->csTimer == 0) { player->baseSpeed = gArwingSpeed; AUDIO_PLAY_BGM(gBgmSeqId); gLevelStartStatusScreenTimer = 80; player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; - player->unk_1D0 = player->timer_1F8 = player->timer_1FC = 0; + player->csState = player->csTimer = player->csEventTimer = 0; player->cam.eye.y = player->pos.y * player->unk_148 + 50.0f; player->cam.eye.z = 400.0f; player->cam.at.y = player->pos.y * player->unk_148 + 20.0f; - player->cam.at.z = player->unk_138; + player->cam.at.z = player->trueZpos; player->cam.at.x = player->cam.eye.x = player->pos.x; gLoadLevelObjects = 1; for (i = 0; i < 3; i++) { @@ -1612,8 +1612,8 @@ void SectorX_LevelStart(Player* player) { Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 20000.0f, 0); Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 20000.0f, 0); Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 20000.0f, 0); - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->rot.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(player->rot.x * M_DTOR), MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; src.z = player->baseSpeed; @@ -1624,7 +1624,7 @@ void SectorX_LevelStart(Player* player) { player->pos.x += player->vel.x; player->pos.y += player->vel.y; player->pos.z += player->vel.z; - player->unk_138 = player->pos.z + player->unk_08C; + player->trueZpos = player->pos.z + player->camDist; } void SectorX_801944D4(Actor* actor, s32 arg1) { @@ -1634,7 +1634,7 @@ void SectorX_801944D4(Actor* actor, s32 arg1) { Vec3f destB; Player* player = &gPlayer[0]; - Matrix_RotateY(gCalcMatrix, player->unk_0E8 * M_DTOR, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, player->rot.y * M_DTOR, MTXF_NEW); srcA.x = D_i2_80195710[arg1]; srcA.y = D_i2_80195720[arg1]; srcA.z = D_i2_80195730[arg1]; @@ -1647,7 +1647,7 @@ void SectorX_801944D4(Actor* actor, s32 arg1) { Actor_Initialize(actor); actor->obj.pos.x = player->pos.x + destA.x; actor->obj.pos.y = player->pos.y + destA.y; - actor->obj.pos.z = player->unk_138 + destA.z; + actor->obj.pos.z = player->trueZpos + destA.z; actor->fwork[0] = destB.x; actor->fwork[1] = destB.y; actor->fwork[2] = destB.z; @@ -1657,13 +1657,13 @@ void SectorX_801944D4(Actor* actor, s32 arg1) { actor->vel.y = player->vel.y; actor->vel.z = player->vel.z; actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; Object_SetInfo(&actor->info, actor->obj.id); if (arg1 == 3) { actor->unk_0B6 = 1; actor->state = 20; - actor->obj.rot.x = -player->unk_0E4 - 10.0f; - actor->obj.rot.y = (player->unk_0E8 + 180.0f) - 10.0f; + actor->obj.rot.x = -player->rot.x - 10.0f; + actor->obj.rot.y = (player->rot.y + 180.0f) - 10.0f; actor->fwork[9] = 10.0f; } else { actor->obj.rot.z = D_i2_80195770[arg1]; @@ -1678,23 +1678,23 @@ void SectorX_LevelComplete(Player* player) { Vec3f sp48; s32 pad[5]; - Math_SmoothStepToF(&player->unk_130, 0.0f, 0.1f, 15.0f, 0.0f); - Math_SmoothStepToF(&player->unk_12C, 0.0f, 0.1f, 15.0f, 0.0f); - Math_SmoothStepToF(&player->unk_0E4, 0.0f, 0.1f, 3.0f, 0.0f); - Math_SmoothStepToF(&player->unk_0E8, 0.0f, 0.1f, 3.0f, 0.0f); - Math_SmoothStepToF(&player->unk_0EC, 0.0f, 0.1f, 3.0f, 0.0f); - Math_SmoothStepToF(&player->unk_08C, 0.0f, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToF(&player->zRotBarrelRoll, 0.0f, 0.1f, 15.0f, 0.0f); + Math_SmoothStepToF(&player->zRotBank, 0.0f, 0.1f, 15.0f, 0.0f); + Math_SmoothStepToF(&player->rot.x, 0.0f, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToF(&player->rot.y, 0.0f, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToF(&player->rot.z, 0.0f, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToF(&player->camDist, 0.0f, 0.1f, 3.0f, 0.0f); Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 3.0f, 0.0f); - Math_SmoothStepToAngle(&player->unk_4D8, 0.0f, 0.1f, 20.0f, 0.0f); + Math_SmoothStepToAngle(&player->aerobaticPitch, 0.0f, 0.1f, 20.0f, 0.0f); Math_SmoothStepToF(&player->boostSpeed, 0.0f, 0.1f, 3.0f, 0.0f); D_ctx_80178430 += 0.2f; D_ctx_8017842C -= 0.2f; - switch (player->unk_1D0) { + switch (player->csState) { case 0: Audio_StopSfxByBankAndSource(1, player->sfxSource); - player->unk_1D0 += 1; + player->csState += 1; D_ctx_80177A48[1] = 0.05f; D_ctx_80177A48[0] = 0.02f; D_ctx_80177A48[2] = 0.0f; @@ -1718,8 +1718,8 @@ void SectorX_LevelComplete(Player* player) { Math_SmoothStepToF(&player->baseSpeed, 0.0f, 0.1f, 2.0f, 0.0f); Math_SmoothStepToF(D_ctx_80177A48, 0.1f, 1.0f, 0.002f, 0.0f); Math_SmoothStepToF(D_ctx_80177A48 + 1, 0.1f, 1.0f, 0.002f, 0.0f); - Matrix_RotateY(gCalcMatrix, player->unk_0E8 * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, player->rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, player->rot.x * M_DTOR, MTXF_APPLY); Matrix_Push(&gCalcMatrix); Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[2] * M_DTOR, MTXF_APPLY); sp54.x = 0.0f; @@ -1728,7 +1728,7 @@ void SectorX_LevelComplete(Player* player) { Matrix_MultVec3f(gCalcMatrix, &sp54, &sp48); Math_SmoothStepToF(&player->cam.eye.x, player->pos.x + sp48.x, D_ctx_80177A48[0], 500.0f, 0.0f); Math_SmoothStepToF(&player->cam.eye.y, player->pos.y + sp48.y, D_ctx_80177A48[0], 500.0f, 0.0f); - Math_SmoothStepToF(&player->cam.eye.z, player->unk_138 + D_ctx_80177D20 + sp48.z, D_ctx_80177A48[0], 500.0f, + Math_SmoothStepToF(&player->cam.eye.z, player->trueZpos + gPathProgress + sp48.z, D_ctx_80177A48[0], 500.0f, 0.0f); Matrix_Pop(&gCalcMatrix); sp54.x = 0.0f; @@ -1737,14 +1737,14 @@ void SectorX_LevelComplete(Player* player) { Matrix_MultVec3f(gCalcMatrix, &sp54, &sp48); Math_SmoothStepToF(&player->cam.at.x, player->pos.x + sp48.x, D_ctx_80177A48[1], 500.0f, 0.0f); Math_SmoothStepToF(&player->cam.at.y, player->pos.y + sp48.y, D_ctx_80177A48[1], 500.0f, 0.0f); - Math_SmoothStepToF(&player->cam.at.z, player->unk_138 + D_ctx_80177D20 + sp48.z, D_ctx_80177A48[1], 500.0f, + Math_SmoothStepToF(&player->cam.at.z, player->trueZpos + gPathProgress + sp48.z, D_ctx_80177A48[1], 500.0f, 0.0f); break; case 2: player->baseSpeed += 2.0f; - if (player->timer_1F8 == 0) { - Math_SmoothStepToAngle(&player->unk_0E4, 20.0f, 0.1f, 0.5f, 0.0f); + if (player->csTimer == 0) { + Math_SmoothStepToAngle(&player->rot.x, 20.0f, 0.1f, 0.5f, 0.0f); } if (gCsFrameCount == 1195) { @@ -1757,7 +1757,7 @@ void SectorX_LevelComplete(Player* player) { if (gFillScreenAlpha == 255) { player->state_1C8 = PLAYERSTATE_1C8_NEXT; gFadeoutType = 4; - player->timer_1F8 = 0; + player->csTimer = 0; Play_ClearObjectData(); gLeveLClearStatus[LEVEL_SECTOR_X] = Play_CheckMedalStatus(150) + 1; } @@ -1820,8 +1820,8 @@ void SectorX_LevelComplete(Player* player) { SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 50); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50); AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0); - player->unk_1D0 = 2; - player->timer_1F8 = 40; + player->csState = 2; + player->csTimer = 40; player->unk_194 = 5.0f; player->unk_190 = 5.0f; break; @@ -1925,8 +1925,8 @@ void SectorX_LevelComplete(Player* player) { break; } } - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -((player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->rot.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->rot.x + player->aerobaticPitch) * M_DTOR), MTXF_APPLY); sp54.x = 0.0f; sp54.y = 0.0f; sp54.z = player->baseSpeed + player->boostSpeed; @@ -1937,10 +1937,10 @@ void SectorX_LevelComplete(Player* player) { player->pos.x += player->vel.x; player->pos.y += player->vel.y; player->pos.z += player->vel.z; - player->unk_138 = player->pos.z + player->unk_08C; - player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; - player->unk_088 += 10.0f; - player->unk_080 = -SIN_DEG(player->unk_088) * 0.3f; - player->unk_0F4 += 8.0f; - player->unk_0F0 = SIN_DEG(player->unk_0F4); + player->trueZpos = player->pos.z + player->camDist; + player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll; + player->bobPhase += 10.0f; + player->yBob = -SIN_DEG(player->bobPhase) * 0.3f; + player->rockPhase += 8.0f; + player->rockAngle = SIN_DEG(player->rockPhase); } diff --git a/src/overlays/ovl_i3/fox_a6.c b/src/overlays/ovl_i3/fox_a6.c index 0e4b3090..d893f686 100644 --- a/src/overlays/ovl_i3/fox_a6.c +++ b/src/overlays/ovl_i3/fox_a6.c @@ -552,10 +552,10 @@ void Area6_80187944(Boss* bossA6) { if ((bossA6->state < 6) || ((bossA6->state >= 8) && (bossA6->state < 12))) { bossA6->obj.rot.y = RAD_TO_DEG(Math_Atan2F(gPlayer[0].cam.eye.x - bossA6->obj.pos.x, - gPlayer[0].cam.eye.z - (bossA6->obj.pos.z + D_ctx_80177D20))); + gPlayer[0].cam.eye.z - (bossA6->obj.pos.z + gPathProgress))); bossA6->obj.rot.x = RAD_TO_DEG(-Math_Atan2F(gPlayer[0].cam.eye.y - bossA6->obj.pos.y, - sqrtf(SQ(gPlayer[0].cam.eye.z - (bossA6->obj.pos.z + D_ctx_80177D20)) + + sqrtf(SQ(gPlayer[0].cam.eye.z - (bossA6->obj.pos.z + gPathProgress)) + SQ(gPlayer[0].cam.eye.x - bossA6->obj.pos.x)))); } @@ -583,7 +583,7 @@ void Area6_80187944(Boss* bossA6) { gTeamLowHealthMsgTimer = -1; - D_bg_8015F984 = (D_ctx_80177D20 * 0.00004f) + 0.5f; + D_bg_8015F984 = (gPathProgress * 0.00004f) + 0.5f; AUDIO_PLAY_SFX(0x2940D09A, bossA6->sfxSource, 4); @@ -688,7 +688,7 @@ void Area6_80187944(Boss* bossA6) { if (bossA6->state != 0) { Math_SmoothStepToF(&bossA6->fwork[A6_FWK_4], bossA6->fwork[A6_FWK_5], 0.1f, 2.0f, 0.00001f); - Math_SmoothStepToF(&bossA6->obj.pos.z, gPlayer[0].cam.eye.z - D_ctx_80177D20 + bossA6->fwork[A6_FWK_3], 0.1f, + Math_SmoothStepToF(&bossA6->obj.pos.z, gPlayer[0].cam.eye.z - gPathProgress + bossA6->fwork[A6_FWK_3], 0.1f, bossA6->fwork[A6_FWK_4], 0.00001f); if (bossA6->state < 5) { sp120 = 2.0f; @@ -785,7 +785,7 @@ void Area6_80187944(Boss* bossA6) { if ((bossA6->timer_050 != 0) && (bossA6->timer_050 < 200)) { dx_11C = gPlayer[0].cam.eye.x - bossA6->obj.pos.x; dy_118 = gPlayer[0].cam.eye.y - bossA6->obj.pos.y; - dz_114 = gPlayer[0].cam.eye.z - D_ctx_80177D20 + bossA6->fwork[A6_FWK_3] - bossA6->obj.pos.z; + dz_114 = gPlayer[0].cam.eye.z - gPathProgress + bossA6->fwork[A6_FWK_3] - bossA6->obj.pos.z; sp104 = 100.0f; } @@ -823,7 +823,7 @@ void Area6_80187944(Boss* bossA6) { Audio_KillSfxBySource(bossA6->sfxSource); AUDIO_PLAY_SFX(0x19004051, bossA6->sfxSource, 4); bossA6->timer_050 = 20; - bossA6->obj.pos.z = gPlayer[0].cam.eye.z - D_ctx_80177D20 + bossA6->fwork[A6_FWK_3]; + bossA6->obj.pos.z = gPlayer[0].cam.eye.z - gPathProgress + bossA6->fwork[A6_FWK_3]; bossA6->fwork[A6_FWK_6] = bossA6->obj.pos.x = gPlayer[0].cam.eye.x; bossA6->fwork[A6_FWK_7] = bossA6->obj.pos.y = gPlayer[0].cam.eye.y; bossA6->state = 2; @@ -871,7 +871,7 @@ void Area6_80187944(Boss* bossA6) { if ((bossA6->swork[A6_SWK_25] != 1) && (D_i3_801C2250[A6_BSS_0] != 2)) { bossA6->fwork[A6_FWK_3] = RAND_FLOAT_CENTERED(1000.0f) + -3700.0f; } - bossA6->obj.pos.z = gPlayer[0].cam.eye.z - D_ctx_80177D20 + bossA6->fwork[A6_FWK_3]; + bossA6->obj.pos.z = gPlayer[0].cam.eye.z - gPathProgress + bossA6->fwork[A6_FWK_3]; bossA6->fwork[A6_FWK_6] = bossA6->obj.pos.x = gPlayer[0].cam.eye.x; bossA6->fwork[A6_FWK_7] = bossA6->obj.pos.y = gPlayer[0].cam.eye.y; } @@ -1229,7 +1229,7 @@ void Area6_80187944(Boss* bossA6) { if ((bossA6->timer_052 == 160) && ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN))) { gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; - gPlayer[0].unk_1D0 = 0; + gPlayer[0].csState = 0; } if (bossA6->timer_052 < 50) { D_ctx_801779A8[0] = 50.0f; @@ -2115,7 +2115,7 @@ void Area6_8018D5C8(void) { gActors[i].unk_0B6 = 1; gActors[i].state = 90; gActors[i].fwork[0] = 0.0f; - gActors[i].obj.id = OBJ_ACTOR_195; + gActors[i].obj.id = OBJ_ACTOR_CUTSCENE; Object_SetInfo(&gActors[i].info, gActors[i].obj.id); AUDIO_PLAY_SFX(0x11030010, gActors[i].sfxSource, 0); } @@ -2128,7 +2128,7 @@ void Area6_8018D694(Actor* actor, s32 arg1) { Actor_Initialize(actor); actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = sp2C[arg1].x + 100.0f; actor->obj.pos.y = sp2C[arg1].y + 350.0f; actor->obj.pos.z = sp2C[arg1].z + 1000.0f; @@ -2154,7 +2154,7 @@ void Area6_8018D804(Actor* actor, s32 arg1) { Actor_Initialize(actor); actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = sp2C[arg1].x + player->pos.x; actor->obj.pos.y = sp2C[arg1].y + player->pos.y; actor->obj.pos.z = sp2C[arg1].z + player->pos.z; @@ -2282,10 +2282,10 @@ void Area6_LevelStart(Player* player) { f32 temp3; // 50 f32 temp4; // 4C - switch (player->unk_1D0) { + switch (player->csState) { case 0: gCsFrameCount = 0; - player->unk_1D0 = 1; + player->csState = 1; Rand_SetSeed(1, 29000, 9876); Area6_8018D694(&gActors[1], 0); Area6_8018D694(&gActors[2], 1); @@ -2378,8 +2378,8 @@ void Area6_LevelStart(Player* player) { player->pos.z = 0.0f; player->pos.y = 350.0f; player->baseSpeed = gArwingSpeed; - player->unk_1D0 = 0; - player->timer_1F8 = 0; + player->csState = 0; + player->csTimer = 0; AUDIO_PLAY_BGM(SEQ_ID_AREA_6 | SEQ_FLAG); player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; @@ -2448,8 +2448,8 @@ void Area6_LevelStart(Player* player) { Play_ClearObjectData(); break; } - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->rot.y + player->yRot_114 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(player->rot.x * M_DTOR), MTXF_APPLY); if (player->state_1C8 != PLAYERSTATE_1C8_ACTIVE) { sp74.x = 0.0f; sp74.y = 0.0f; @@ -2461,9 +2461,9 @@ void Area6_LevelStart(Player* player) { player->pos.x += player->vel.x; player->pos.y += player->vel.y; player->pos.z += player->vel.z; - player->unk_138 = player->pos.z; + player->trueZpos = player->pos.z; } - player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; + player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll; Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0.001f); Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0.001f); Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0.001f); @@ -2475,7 +2475,7 @@ void Area6_LevelStart(Player* player) { void Area6_8018EA88(Actor* actor) { Actor_Initialize(actor); actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = 0.0f; actor->obj.pos.y = 0.0f; actor->obj.pos.z = gBosses[0].obj.pos.z + 500.0f; @@ -2499,7 +2499,7 @@ void Area6_8018EB3C(Actor* actor) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = player->pos.x; actor->obj.pos.y = player->pos.y + 600.0f; actor->obj.pos.z = player->pos.z + 2800.0f; @@ -2522,7 +2522,7 @@ void Area6_8018EC38(Actor* actor, s32 arg1) { if (gTeamShields[arg1 + 1] > 0) { Actor_Initialize(actor); actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = sp2C[arg1].x + player->pos.x; actor->obj.pos.y = sp2C[arg1].y + player->pos.y; actor->obj.pos.z = sp2C[arg1].z + player->pos.z; @@ -2548,10 +2548,10 @@ void Area6_LevelComplete(Player* player) { Actor* actor4 = &gActors[4]; s32 pad; - switch (player->unk_1D0) { + switch (player->csState) { case 0: gCsFrameCount = 0; - player->unk_1D0 = 1; + player->csState = 1; player->wings.modelId = 1; player->unk_194 = 5.0f; player->unk_190 = 2.0f; @@ -2560,10 +2560,10 @@ void Area6_LevelComplete(Player* player) { D_ctx_80177A48[3] = 0.0f; /* fallthrough */ case 1: - Math_SmoothStepToAngle(&player->unk_130, 0.0f, 0.05f, 1.2f, 0.0001f); - Math_SmoothStepToAngle(&player->unk_12C, 0.0f, 0.05f, 1.2f, 0.0001f); + Math_SmoothStepToAngle(&player->zRotBarrelRoll, 0.0f, 0.05f, 1.2f, 0.0001f); + Math_SmoothStepToAngle(&player->zRotBank, 0.0f, 0.05f, 1.2f, 0.0001f); Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 3.0f, 0.0f); - Math_SmoothStepToAngle(&player->unk_4D8, 0.0f, 0.1f, 20.0f, 0.0f); + Math_SmoothStepToAngle(&player->aerobaticPitch, 0.0f, 0.1f, 20.0f, 0.0f); if (gCsFrameCount < 60) { spf90.x = -100.0f; spf90.y = -100.0f; @@ -2577,9 +2577,9 @@ void Area6_LevelComplete(Player* player) { if (sp88 > 180.0f) { sp88 = 0.0f; } - sp84 = Math_SmoothStepToAngle(&player->unk_0E8, sp8C, 0.5f, 2.0f, 0.0001f) * 30.0f; - Math_SmoothStepToAngle(&player->unk_0E4, sp88, 0.1f, 5.0f, 0.0001f); - Math_SmoothStepToAngle(&player->unk_0EC, sp84, 0.1f, 5.0f, 0.0001f); + sp84 = Math_SmoothStepToAngle(&player->rot.y, sp8C, 0.5f, 2.0f, 0.0001f) * 30.0f; + Math_SmoothStepToAngle(&player->rot.x, sp88, 0.1f, 5.0f, 0.0001f); + Math_SmoothStepToAngle(&player->rot.z, sp84, 0.1f, 5.0f, 0.0001f); } if (gCsFrameCount == 60) { player->unk_234 = 0; @@ -2587,14 +2587,14 @@ void Area6_LevelComplete(Player* player) { } Math_SmoothStepToF(&gCsCamEyeX, gBosses[0].obj.pos.x, 0.05f, 1000.0f, 0.001f); Math_SmoothStepToF(&gCsCamEyeY, gBosses[0].obj.pos.y, 0.05f, 1000.0f, 0.001f); - Math_SmoothStepToF(&gCsCamEyeZ, gBosses[0].obj.pos.z + D_ctx_80177D20, 0.05f, 10.0f, 0.0001f); + Math_SmoothStepToF(&gCsCamEyeZ, gBosses[0].obj.pos.z + gPathProgress, 0.05f, 10.0f, 0.0001f); player->cam.eye.x = gCsCamEyeX; player->cam.eye.y = gCsCamEyeY; player->cam.eye.z = gCsCamEyeZ; gCsCamAtX = gBosses[0].obj.pos.x; gCsCamAtY = gBosses[0].obj.pos.y; - gCsCamAtZ = gBosses[0].obj.pos.z + D_ctx_80177D20; + gCsCamAtZ = gBosses[0].obj.pos.z + gPathProgress; D_ctx_80177A48[0] = 0.04f; if (gCsFrameCount == 140) { Area6_8018EA88(actor4); @@ -2604,7 +2604,7 @@ void Area6_LevelComplete(Player* player) { } if (gCsFrameCount >= 200) { if (gFillScreenAlpha == 255) { - player->unk_1D0 = 2; + player->csState = 2; Play_ClearObjectData(); } else { gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; @@ -2653,10 +2653,11 @@ void Area6_LevelComplete(Player* player) { player->pos.x = 0.0f; player->pos.y = 200.0f; player->pos.z = 1000.0f; - player->unk_08C = player->unk_0EC = player->unk_0E8 = player->unk_0E4 = player->baseSpeed = - player->boostSpeed = player->camRoll = player->unk_12C = player->unk_130 = player->unk_4D8 = 0.0f; + player->camDist = player->rot.z = player->rot.y = player->rot.x = player->baseSpeed = + player->boostSpeed = player->camRoll = player->zRotBank = player->zRotBarrelRoll = + player->aerobaticPitch = 0.0f; - D_bg_8015F984 = (D_ctx_80177D20 * 0.00004f) + 0.5f; + D_bg_8015F984 = (gPathProgress * 0.00004f) + 0.5f; Area6_8018EC38(&gActors[1], 0); Area6_8018EC38(&gActors[2], 1); Area6_8018EC38(&gActors[3], 2); @@ -2666,13 +2667,13 @@ void Area6_LevelComplete(Player* player) { D_ctx_80177A48[9] = 50.0f; player->cam.at.x = gCsCamAtX = player->pos.x; player->cam.at.y = gCsCamAtY = 0.0f; - player->cam.at.z = gCsCamAtZ = player->pos.z + 50.0f + D_ctx_80177D20; + player->cam.at.z = gCsCamAtZ = player->pos.z + 50.0f + gPathProgress; } if (gFillScreenAlpha != 0) { gFillScreenAlphaTarget = 0; gFillScreenAlphaStep = 4; } else { - player->unk_1D0 = 3; + player->csState = 3; } case 3: Math_SmoothStepToF(&player->pos.y, 0.0f, 0.01f, 10.0f, 0.001f); @@ -2697,7 +2698,7 @@ void Area6_LevelComplete(Player* player) { } gCsCamAtX = player->pos.x; gCsCamAtY = 0.0f; - gCsCamAtZ = D_ctx_80177A48[9] + player->pos.z + D_ctx_80177D20; + gCsCamAtZ = D_ctx_80177A48[9] + player->pos.z + gPathProgress; D_ctx_80177A48[0] = 0.008f; } else { Math_SmoothStepToAngle(&D_ctx_80177A48[4], 0.0f, 0.1f, 10.0f, 0.001f); @@ -2706,12 +2707,12 @@ void Area6_LevelComplete(Player* player) { gCsCamAtX += 2.0f; player->cam.at.x = gCsCamAtX = player->pos.x; player->cam.at.y = gCsCamAtY = 0.0f; - player->cam.at.z = gCsCamAtZ = D_ctx_80177A48[9] + player->pos.z + D_ctx_80177D20; + player->cam.at.z = gCsCamAtZ = D_ctx_80177A48[9] + player->pos.z + gPathProgress; } sp78.x = 0.0f; sp78.y = 0.0f; sp78.z = D_ctx_80177A48[5]; - Matrix_Translate(gCalcMatrix, D_ctx_80177A48[1], 0.0f, D_ctx_80177A48[3] + D_ctx_80177D20, MTXF_NEW); + Matrix_Translate(gCalcMatrix, D_ctx_80177A48[1], 0.0f, D_ctx_80177A48[3] + gPathProgress, MTXF_NEW); Matrix_RotateY(gCalcMatrix, -(D_ctx_80177A48[4] * M_DTOR), MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &sp78, &sp6C); player->cam.eye.x = gCsCamEyeX = sp6C.x; @@ -2796,8 +2797,8 @@ void Area6_LevelComplete(Player* player) { if (gCsFrameCount >= 1076) { Math_SmoothStepToF(&player->baseSpeed, 50.0f, 0.1f, 1000.0f, 0.001f); } - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->rot.y + player->yRot_114 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(player->rot.x * M_DTOR), MTXF_APPLY); sp78.x = 0.0f; sp78.y = 0.0f; sp78.z = player->baseSpeed; @@ -2808,8 +2809,8 @@ void Area6_LevelComplete(Player* player) { player->pos.x += player->vel.x; player->pos.y += player->vel.y; player->pos.z += player->vel.z; - player->unk_138 = player->pos.z; - player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; + player->trueZpos = player->pos.z; + player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll; Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0.0001f); Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0.0001f); Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0.0001f); diff --git a/src/overlays/ovl_i3/fox_aq.c b/src/overlays/ovl_i3/fox_aq.c index 36ad1664..e4e38616 100644 --- a/src/overlays/ovl_i3/fox_aq.c +++ b/src/overlays/ovl_i3/fox_aq.c @@ -323,15 +323,15 @@ void Aquas_801A8E30(void) { void Aquas_801A92EC(Actor* actor, f32 xUnk, f32 yUnk, f32 zUnk, s32 index, s32 mode) { gTexturedLines[index].mode = mode; - gTexturedLines[index].unk_28 = 10.0f; - gTexturedLines[index].unk_04.x = actor->obj.pos.x; - gTexturedLines[index].unk_04.y = actor->obj.pos.y; - gTexturedLines[index].unk_04.z = actor->obj.pos.z; - gTexturedLines[index].unk_10.x = xUnk; - gTexturedLines[index].unk_10.y = yUnk; - gTexturedLines[index].unk_10.z = zUnk; - gTexturedLines[index].unk_2C = gTexturedLines[index].unk_2D = gTexturedLines[index].unk_2E = - gTexturedLines[index].unk_2F = 255; + gTexturedLines[index].xyScale = 10.0f; + gTexturedLines[index].posAA.x = actor->obj.pos.x; + gTexturedLines[index].posAA.y = actor->obj.pos.y; + gTexturedLines[index].posAA.z = actor->obj.pos.z; + gTexturedLines[index].posBB.x = xUnk; + gTexturedLines[index].posBB.y = yUnk; + gTexturedLines[index].posBB.z = zUnk; + gTexturedLines[index].red = gTexturedLines[index].green = gTexturedLines[index].blue = gTexturedLines[index].alpha = + 255; gTexturedLines[index].timer = 3; } @@ -471,7 +471,7 @@ void Aquas_801A9824(void) { } void Aquas_801A99D4(Player* player) { - s32 sp24 = fabsf(player->unk_138 / 1000.0f); + s32 sp24 = fabsf(player->trueZpos / 1000.0f); Math_SmoothStepToF(&D_bg_8015F970, D_i3_801C41B8[25], 1.0f, 10.0f, 0.00001f); Math_SmoothStepToF(&D_AQ_801C4188, D_i3_801C41B8[26], 0.1f, 10.0f, 0.00001f); @@ -531,8 +531,8 @@ void Aquas_801A9C98(Player* player) { i = D_i3_801C4190[0] - 1; actor = &gActors[i]; - if ((actor->obj.status != OBJ_ACTIVE) || ((player->unk_138 - 300.0f) <= actor->obj.pos.z) || - (actor->obj.pos.z <= (player->unk_138 - 7000.0f)) || (actor->obj.id != D_i3_801C4190[1]) || + if ((actor->obj.status != OBJ_ACTIVE) || ((player->trueZpos - 300.0f) <= actor->obj.pos.z) || + (actor->obj.pos.z <= (player->trueZpos - 7000.0f)) || (actor->obj.id != D_i3_801C4190[1]) || (actor->health == 0)) { D_i3_801C4190[0] = D_i3_801C4190[3] = D_i3_801C4190[5] = D_i3_801C4190[1] = 0; } else { @@ -577,8 +577,8 @@ void Aquas_801A9ED0(Player* player) { Vec3f sp64; f32* tempy; - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, player->rot.x * M_DTOR, MTXF_APPLY); sp70.x = 0.0f; sp70.y = 0.0f; @@ -604,9 +604,9 @@ void Aquas_801A9ED0(Player* player) { (temp_fa0 <= (player->pos.y + sp64.y)) && ((player->pos.x + sp64.x) <= temp_fv1) && (temp_fa1 <= (player->pos.x + sp64.x))) { if (D_i3_801C41B8[11] >= - fabsf(player->unk_138 - gBosses[0].obj.pos.z - gBosses[0].info.hitbox[j])) { + fabsf(player->trueZpos - gBosses[0].obj.pos.z - gBosses[0].info.hitbox[j])) { D_i3_801C41B8[11] = - fabsf(player->unk_138 - gBosses[0].obj.pos.z - gBosses[0].info.hitbox[j]); + fabsf(player->trueZpos - gBosses[0].obj.pos.z - gBosses[0].info.hitbox[j]); D_i3_801C4190[0] = 777; D_i3_801C4190[4] = i; D_i3_801C4190[1] = OBJ_BOSS_AQ; @@ -648,7 +648,7 @@ void Aquas_801AA20C(void) { } Matrix_Translate(gGfxMatrix, D_i3_801C41B8[0] + var_fs1, D_i3_801C41B8[1] + var_fs2, - D_i3_801C41B8[2] + gPlayer[0].unk_144, MTXF_APPLY); + D_i3_801C41B8[2] + gPlayer[0].zPath, MTXF_APPLY); Matrix_Scale(gGfxMatrix, D_i3_801C41B8[5], D_i3_801C41B8[5], D_i3_801C41B8[5], MTXF_APPLY); for (i = 0; i < 4; i++) { @@ -661,7 +661,7 @@ void Aquas_801AA20C(void) { } } else { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 0, 0, 255); - Matrix_Translate(gGfxMatrix, D_i3_801C41B8[0], D_i3_801C41B8[1], D_i3_801C41B8[2] + gPlayer[0].unk_144, + Matrix_Translate(gGfxMatrix, D_i3_801C41B8[0], D_i3_801C41B8[1], D_i3_801C41B8[2] + gPlayer[0].zPath, MTXF_APPLY); Matrix_Scale(gGfxMatrix, D_i3_801C41B8[5], D_i3_801C41B8[5], D_i3_801C41B8[5], MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -681,7 +681,7 @@ void Aquas_801AA4BC(Player* player) { if ((gInputHold->button & Z_TRIG) && !(gInputHold->button & R_TRIG)) { sp3C = 90.0f; sp38 = 0.2f; - if (player->unk_12C < 70.0f) { + if (player->zRotBank < 70.0f) { Math_SmoothStepToF(&player->wings.unk_04, -70.0f, 0.3f, 100.0f, 0); Math_SmoothStepToF(&player->wings.unk_08, -70.0f, 0.3f, 100.0f, 0); Math_SmoothStepToF(&player->wings.unk_0C, 70.0f, 0.3f, 100.0f, 0); @@ -692,7 +692,7 @@ void Aquas_801AA4BC(Player* player) { if ((gInputHold->button & R_TRIG) && !(gInputHold->button & Z_TRIG)) { sp3C = -90.0f; sp38 = 0.2f; - if (player->unk_12C > -70.0f) { + if (player->zRotBank > -70.0f) { Math_SmoothStepToF(&player->wings.unk_04, 70.0f, 0.3f, 100.0f, 0); Math_SmoothStepToF(&player->wings.unk_08, 70.0f, 0.3f, 100.0f, 0); Math_SmoothStepToF(&player->wings.unk_0C, -70.0f, 0.3f, 100.0f, 0); @@ -700,53 +700,53 @@ void Aquas_801AA4BC(Player* player) { } } - Math_SmoothStepToF(&player->unk_12C, sp3C, sp38, 10.0f, 0); + Math_SmoothStepToF(&player->zRotBank, sp3C, sp38, 10.0f, 0); } if ((gInputPress->button & Z_TRIG) && (player->unk_230 == 0)) { player->sfx.bank = 1; - if (player->timer_1E0 != 0) { - player->unk_1DC = 1; + if (player->barrelInputTimerL != 0) { + player->barrelRoll = 1; player->timer_1E8 = 10; - player->unk_1EC = player->unk_1F0 = 30; + player->rollRate = player->baseRollRate = 30; player->sfx.roll = 1; } else { - player->timer_1E0 = 10; + player->barrelInputTimerL = 10; } } if ((gInputPress->button & R_TRIG) && (player->unk_230 == 0)) { player->sfx.bank = 1; - if (player->timer_1E4 != 0) { - player->unk_1DC = 1; + if (player->barrelInputTimerR != 0) { + player->barrelRoll = 1; player->timer_1E8 = 10; - player->unk_1EC = player->unk_1F0 = -30; + player->rollRate = player->baseRollRate = -30; player->sfx.roll = 1; } else { - player->timer_1E4 = 10; + player->barrelInputTimerR = 10; } } Math_SmoothStepToF(&player->unk_150, 1.0f, 0.05f, 10.0f, 0.0001f); - player->unk_130 = Math_ModF(player->unk_130, 360.0f); + player->zRotBarrelRoll = Math_ModF(player->zRotBarrelRoll, 360.0f); - if (player->unk_280 > 0) { - player->unk_280 -= 30; - if (player->unk_280 <= 0) { - player->unk_280 = 0; + if (player->barrelRollAlpha > 0) { + player->barrelRollAlpha -= 30; + if (player->barrelRollAlpha <= 0) { + player->barrelRollAlpha = 0; } } - if (player->unk_1DC == 0) { - Math_SmoothStepToF(&player->unk_130, 0.0f, 0.1f, 10.0f, 0.00001f); + if (player->barrelRoll == 0) { + Math_SmoothStepToF(&player->zRotBarrelRoll, 0.0f, 0.1f, 10.0f, 0.00001f); } - if (player->timer_1E0 != 0) { - player->timer_1E0--; + if (player->barrelInputTimerL != 0) { + player->barrelInputTimerL--; } - if (player->timer_1E4 != 0) { - player->timer_1E4--; + if (player->barrelInputTimerR != 0) { + player->barrelInputTimerR--; } if (player->timer_214 != 0) { player->timer_214--; @@ -758,25 +758,25 @@ void Aquas_801AA4BC(Player* player) { player->timer_1E8--; } - if (player->unk_1DC != 0) { - player->timer_1E0 = player->timer_1E4 = 0; + if (player->barrelRoll != 0) { + player->barrelInputTimerL = player->barrelInputTimerR = 0; player->unk_150 = 1.5f; - player->unk_130 += player->unk_1EC; + player->zRotBarrelRoll += player->rollRate; if (player->timer_1E8 == 0) { - if (player->unk_1EC > 0) { - player->unk_1EC -= 5; + if (player->rollRate > 0) { + player->rollRate -= 5; } - if (player->unk_1EC < 0) { - player->unk_1EC += 5; + if (player->rollRate < 0) { + player->rollRate += 5; } - if (player->unk_1EC == 0) { - player->unk_1DC = 0; + if (player->rollRate == 0) { + player->barrelRoll = 0; } } else { - if (player->unk_280 < 180) { - player->unk_280 += 60; - if (player->unk_280 > 180) { - player->unk_280 = 180; + if (player->barrelRollAlpha < 180) { + player->barrelRollAlpha += 60; + if (player->barrelRollAlpha > 180) { + player->barrelRollAlpha = 180; } } } @@ -800,27 +800,27 @@ void Aquas_801AA8E8(Player* player) { Math_SmoothStepToF(&player->unk_02C, var_fv1, 0.05f, 2.0f, 0.05f); } - gCsCamEyeX = (player->pos.x - player->unk_0AC) * (600.0f / player->unk_09C); + gCsCamEyeX = (player->pos.x - player->xPath) * (600.0f / player->pathWidth); gCsCamEyeX -= player->unk_030 * 1.5f; - gCsCamEyeX += player->unk_0AC + D_i3_801C41B8[9]; - gCsCamEyeY = player->pos.y * (740.0f / player->unk_0A0); + gCsCamEyeX += player->xPath + D_i3_801C41B8[9]; + gCsCamEyeY = player->pos.y * (740.0f / player->pathHeight); gCsCamEyeY -= player->unk_02C - 50.0f; - gCsCamEyeY += player->unk_0B0; - gCsCamAtX = (player->pos.x - player->unk_0AC - D_i3_801C41B8[9]) * (600.0f / player->unk_09C); - gCsCamAtX += player->unk_084 * -2.0f; + gCsCamEyeY += player->yPath; + gCsCamAtX = (player->pos.x - player->xPath - D_i3_801C41B8[9]) * (600.0f / player->pathWidth); + gCsCamAtX += player->xShake * -2.0f; gCsCamAtX -= player->unk_030 * 0.5f; - gCsCamAtX += player->unk_0AC; - gCsCamAtY = (player->pos.y - player->unk_0B0) * (750.0f / player->unk_0A0); + gCsCamAtX += player->xPath; + gCsCamAtY = (player->pos.y - player->yPath) * (750.0f / player->pathHeight); gCsCamAtY += player->unk_060 * 10.0f; gCsCamAtY -= player->unk_02C * -0.55f; - gCsCamAtY += player->unk_0B0 + D_i3_801C41B8[10]; + gCsCamAtY += player->yPath + D_i3_801C41B8[10]; if (gCsCamAtY < 20.0f) { gCsCamAtY = 20.0f; } gCsCamEyeZ = 240.0f; - gCsCamAtZ = player->unk_138 + (D_ctx_80177D20 - 1.0f); + gCsCamAtZ = player->trueZpos + (gPathProgress - 1.0f); Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, player->unk_014, 1000.0f, 0); Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, player->unk_014, 1000.0f, 0); @@ -832,7 +832,7 @@ void Aquas_801AA8E8(Player* player) { Math_SmoothStepToF(&player->unk_014, 1.0f, 1.0f, 0.05f, 0.0f); - temp = -player->unk_0EC; + temp = -player->rot.z; Math_SmoothStepToF(&player->camRoll, temp * 0.3f, 0.1f, 1.5f, 0.0f); } @@ -858,9 +858,9 @@ void Aquas_801AACF8(Player* player) { sp64 = -gInputPress->stick_x; sp5C = gInputPress->stick_y; - D_ctx_80177970 = 0.68f; + gPlayerTurnStickMod = 0.68f; - Math_SmoothStepToF(&player->unk_180, sp64 * D_ctx_80177970, 1.0f, 10.0f, 0.0001f); + Math_SmoothStepToF(&player->unk_180, sp64 * gPlayerTurnStickMod, 1.0f, 10.0f, 0.0001f); var_fa0 = fabsf(player->unk_180 * 0.5f); if (var_fa0 > 2.0f) { @@ -880,24 +880,24 @@ void Aquas_801AACF8(Player* player) { Math_SmoothStepToF(&D_i3_801C41B8[3], player->unk_180, 0.1f, 2.0f, 0.00001f); sp60 = D_i3_801C41B8[3]; - D_ctx_80177968 = 7.0f; + gPlayerTurnRate = 7.0f; - if ((player->pos.x < (-player->unk_09C + player->unk_0AC + 10.0f)) && (sp60 >= 20.0f)) { - D_ctx_80177968 = 2.0f; + if ((player->pos.x < (-player->pathWidth + player->xPath + 10.0f)) && (sp60 >= 20.0f)) { + gPlayerTurnRate = 2.0f; Math_SmoothStepToF(&D_i3_801C41B8[9], 30.0f, 0.1f, 10.0f, 0.0001f); } - if ((player->pos.x > (player->unk_09C + player->unk_0AC - 10.0f)) && (sp60 <= -20.0f)) { - D_ctx_80177968 = 2.0f; + if ((player->pos.x > (player->pathWidth + player->xPath - 10.0f)) && (sp60 <= -20.0f)) { + gPlayerTurnRate = 2.0f; Math_SmoothStepToF(&D_i3_801C41B8[9], -30.0f, 0.1f, 10.0f, 0.0001f); } - Math_SmoothStepToF(&player->unk_0E8, sp60, 0.3f, D_ctx_80177968, 0.00001f); + Math_SmoothStepToF(&player->rot.y, sp60, 0.3f, gPlayerTurnRate, 0.00001f); - if (D_ctx_80177968 != 2.0f) { + if (gPlayerTurnRate != 2.0f) { Math_SmoothStepToF(&D_i3_801C41B8[9], 0.0f, 0.1f, 20.0f, 0.0001f); } - Math_SmoothStepToF(&player->unk_17C, sp5C * D_ctx_80177970, 1.0f, 7.0f, 0.0001f); + Math_SmoothStepToF(&player->unk_17C, sp5C * gPlayerTurnStickMod, 1.0f, 7.0f, 0.0001f); var_fa1 = fabsf(player->unk_17C * 0.05f); if (var_fa1 > 2.0f) { @@ -917,12 +917,12 @@ void Aquas_801AACF8(Player* player) { Math_SmoothStepToF(&D_i3_801C41B8[4], player->unk_17C * -1.0f, 0.1f, 3.0f, 0.00001f); sp58 = D_i3_801C41B8[4] * 0.8f; - D_ctx_80177968 = 10.0f; + gPlayerTurnRate = 10.0f; if (player->pos.y < (gGroundHeight + 50.0f)) { if (sp58 <= 0.0f) { sp58 = 0.0f; - D_ctx_80177968 = 2.0f; + gPlayerTurnRate = 2.0f; if (D_i3_801C4190[7] == 0) { AUDIO_PLAY_SFX(0x09404028, player->sfxSource, 0); D_i3_801C4190[7] = 1; @@ -932,7 +932,7 @@ void Aquas_801AACF8(Player* player) { D_i3_801C4190[7] = 0; } - if ((player->unk_0A0 - 50.0f) <= player->pos.y) { + if ((player->pathHeight - 50.0f) <= player->pos.y) { if (sp58 >= 0.0f) { Math_SmoothStepToF(&D_i3_801C41B8[10], 30.0f, 1.0f, 1.0f, 0.00001f); } @@ -940,19 +940,19 @@ void Aquas_801AACF8(Player* player) { Math_SmoothStepToF(&D_i3_801C41B8[10], 0.0f, 0.1f, 1.0f, 0.00001f); } - Math_SmoothStepToF(&player->unk_0E4, sp58, 1.0f, D_ctx_80177968, 0.00001f); + Math_SmoothStepToF(&player->rot.x, sp58, 1.0f, gPlayerTurnRate, 0.00001f); var_fv1_2 = 2.0f; if (sp64 == 0.0f) { var_fv1_2 = 1.0f; } - Math_SmoothStepToF(&player->unk_0EC, player->unk_180 * 0.7f, 0.08f, var_fv1_2, 0.0001f); + Math_SmoothStepToF(&player->rot.z, player->unk_180 * 0.7f, 0.08f, var_fv1_2, 0.0001f); - player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; + player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll; - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->xRot_120 + player->rot.x + player->aerobaticPitch) * M_DTOR), MTXF_APPLY); sp8C.x = sp8C.y = 0.0f; sp8C.z = player->baseSpeed; @@ -962,8 +962,8 @@ void Aquas_801AACF8(Player* player) { sp68.x *= 1.4f; sp68.y *= 1.4f; - Matrix_RotateY(gCalcMatrix, player->unk_114 * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, player->unk_120 * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, player->yRot_114 * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, player->xRot_120 * M_DTOR, MTXF_APPLY); Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp68, &sp80); @@ -978,33 +978,33 @@ void Aquas_801AACF8(Player* player) { player->pos.x += player->vel.x; - if (player->pos.x > player->unk_09C + player->unk_0AC) { - player->pos.x = player->unk_09C + player->unk_0AC; + if (player->pos.x > player->pathWidth + player->xPath) { + player->pos.x = player->pathWidth + player->xPath; player->vel.x = 0.0f; } - if (player->pos.x < player->unk_0AC - player->unk_09C) { - player->pos.x = player->unk_0AC - player->unk_09C; + if (player->pos.x < player->xPath - player->pathWidth) { + player->pos.x = player->xPath - player->pathWidth; player->vel.x = 0.0f; } player->pos.y += player->vel.y; - if (player->pos.y > player->unk_0A0) { - player->pos.y = player->unk_0A0; + if (player->pos.y > player->pathHeight) { + player->pos.y = player->pathHeight; player->vel.y = 0.0f; } - if (player->pos.y < player->unk_0A4) { - player->pos.y = player->unk_0A4; + if (player->pos.y < player->pathFloor) { + player->pos.y = player->pathFloor; player->vel.y = 0.0f; } - if (player->pos.x > (player->unk_0AC + (player->unk_09C - 100.0f))) { + if (player->pos.x > (player->xPath + (player->pathWidth - 100.0f))) { player->flags_228 = PFLAG_228_0; } - if (player->pos.x < (player->unk_0AC - (player->unk_09C - 100.0f))) { + if (player->pos.x < (player->xPath - (player->pathWidth - 100.0f))) { player->flags_228 = PFLAG_228_1; } - if (player->pos.y > (player->unk_0B0 + (player->unk_0A0 - 100.0f))) { + if (player->pos.y > (player->yPath + (player->pathHeight - 100.0f))) { player->flags_228 = PFLAG_228_3; } if (player->pos.y <= (gGroundHeight + 100)) { @@ -1021,16 +1021,16 @@ void Aquas_801AACF8(Player* player) { } player->pos.z += player->vel.z; - player->unk_138 = player->pos.z; - player->unk_060 = SIN_DEG(player->unk_0F4 * 0.7f) * 0.5f; - player->unk_088 += 10.0f; - player->unk_0F4 += 8.0f + D_i3_801C41B8[24]; - player->unk_080 = -SIN_DEG(player->unk_088) * 0.5f; - player->unk_0F0 = SIN_DEG(player->unk_0F4) * 1.5f; + player->trueZpos = player->pos.z; + player->unk_060 = SIN_DEG(player->rockPhase * 0.7f) * 0.5f; + player->bobPhase += 10.0f; + player->rockPhase += 8.0f + D_i3_801C41B8[24]; + player->yBob = -SIN_DEG(player->bobPhase) * 0.5f; + player->rockAngle = SIN_DEG(player->rockPhase) * 1.5f; if (player->pos.y < (gWaterLevel + 50.0f)) { - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->rot.y + player->yRot_114) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, player->rot.x * M_DTOR, MTXF_APPLY); sp8C.x = sp8C.y = 0.0f; sp8C.z = 70.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp8C, &sp80); @@ -1038,22 +1038,22 @@ void Aquas_801AACF8(Player* player) { player->unk_178 -= 30.0f; Aquas_801AC8A8(player->pos.x + RAND_FLOAT_CENTERED(10.0f) + sp80.x, player->pos.y + RAND_FLOAT_CENTERED(10.0f) + sp80.y, - player->unk_138 + RAND_FLOAT_CENTERED(10.0f) + (sp80.z * -1.0f), 0.4f, 1); + player->trueZpos + RAND_FLOAT_CENTERED(10.0f) + (sp80.z * -1.0f), 0.4f, 1); } else { player->unk_178 -= 10.0f; if (((gGameFrameCount % 8) == 0)) { Aquas_801AC8A8(player->pos.x + RAND_FLOAT_CENTERED(10.0f) + sp80.x, player->pos.y + RAND_FLOAT_CENTERED(10.0f) + sp80.y, - player->unk_138 + RAND_FLOAT_CENTERED(20.0f) + sp80.z, 0.4f, 0); + player->trueZpos + RAND_FLOAT_CENTERED(20.0f) + sp80.z, 0.4f, 0); } } } } void Aquas_801AB9B0(Player* player) { - func_effect_8007D0E0(player->pos.x, player->pos.y, player->unk_138, 6.0f); - func_effect_8007B344(player->pos.x, player->pos.y, player->unk_138, 3.0f, 5); - func_effect_8007BFFC(player->pos.x, player->pos.y, player->unk_138, 0.0f, 0.0f, 0.0f, 3.0f, 80); + func_effect_8007D0E0(player->pos.x, player->pos.y, player->trueZpos, 6.0f); + func_effect_8007B344(player->pos.x, player->pos.y, player->trueZpos, 3.0f, 5); + func_effect_8007BFFC(player->pos.x, player->pos.y, player->trueZpos, 0.0f, 0.0f, 0.0f, 3.0f, 80); Cutscene_KillPlayer(player); } @@ -1070,7 +1070,7 @@ void Aquas_801ABA40(PlayerShot* shot) { D_i3_801C41B8[22] = shot->obj.pos.y; D_i3_801C41B8[23] = shot->obj.pos.z; - if ((fabsf(shot->obj.pos.z - (gPlayer[0].cam.eye.z - D_ctx_80177D20)) > 10000.0f) || + if ((fabsf(shot->obj.pos.z - (gPlayer[0].cam.eye.z - gPathProgress)) > 10000.0f) || (fabsf(shot->obj.pos.y - gPlayer[0].cam.eye.y) > 1500.0f) || ((fabsf(shot->obj.pos.x - gPlayer[0].cam.eye.x) > 4000.0f) && (shot->unk_5C != 0))) { shot->unk_64 = 0; @@ -1097,9 +1097,9 @@ void Aquas_801ABA40(PlayerShot* shot) { func_beam_80038140(shot); - shot->unk_2C = (shot->obj.pos.y * 0.01f) + 1.2f; - shot->unk_30 = (shot->obj.pos.y * 0.003f) + 0.6f; - shot->unk_34 = (shot->obj.pos.y * 0.001f) + 0.6f; + shot->vec_2C.x = (shot->obj.pos.y * 0.01f) + 1.2f; + shot->vec_2C.y = (shot->obj.pos.y * 0.003f) + 0.6f; + shot->vec_2C.z = (shot->obj.pos.y * 0.001f) + 0.6f; shot->unk_58 = (shot->obj.pos.y * -0.24f) + 150.0f; if (shot->unk_58 < 30) { shot->unk_58 = 30; @@ -1108,8 +1108,8 @@ void Aquas_801ABA40(PlayerShot* shot) { switch (shot->unk_5C) { case 0: shot->unk_64 = 50; - shot->obj.rot.y = gPlayer[0].unk_0E8; - shot->obj.rot.x = gPlayer[0].unk_0E4; + shot->obj.rot.y = gPlayer[0].rot.y; + shot->obj.rot.x = gPlayer[0].rot.x; shot->unk_5C++; break; @@ -1221,8 +1221,8 @@ void Aquas_801AC274(Player* player) { D_i3_801C4190[5] = D_i3_801C4190[3] = 0; } - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->rot.y + player->yRot_114) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, player->rot.x * M_DTOR, MTXF_APPLY); sp68.x = 0.0f; sp68.y = 0.0f; @@ -1232,13 +1232,13 @@ void Aquas_801AC274(Player* player) { D_i3_801C41B8[6] = player->pos.x + sp5C.x; D_i3_801C41B8[7] = player->pos.y + sp5C.y; - D_i3_801C41B8[8] = player->unk_138 + sp5C.z; + D_i3_801C41B8[8] = player->trueZpos + sp5C.z; if (D_i3_801C4190[3] == 0) { if (D_i3_801C4190[0] == 0) { D_i3_801C41B8[0] = player->pos.x + sp5C.x; D_i3_801C41B8[1] = player->pos.y + sp5C.y; - D_i3_801C41B8[2] = player->unk_138 + sp5C.z; + D_i3_801C41B8[2] = player->trueZpos + sp5C.z; D_i3_801C41B8[5] = 3.0f; } @@ -1257,12 +1257,13 @@ void Aquas_801AC274(Player* player) { tempx1 = actor->obj.pos.x + actor->info.hitbox[var_v1 + 4] + actor->info.hitbox[var_v1 + 5] + 200.0f; tempx2 = actor->obj.pos.x + actor->info.hitbox[var_v1 + 4] - actor->info.hitbox[var_v1 + 5] - 200.0f; - if ((actor->health > 0) && (actor->timer_0C2 < 5) && (actor->obj.pos.z <= (player->unk_138 - 300.0f)) && - ((player->unk_138 - 7000.0f) <= actor->obj.pos.z) && (player->pos.y + sp5C.y <= tempy1) && + if ((actor->health > 0) && (actor->timer_0C2 < 5) && + (actor->obj.pos.z <= (player->trueZpos - 300.0f)) && + ((player->trueZpos - 7000.0f) <= actor->obj.pos.z) && (player->pos.y + sp5C.y <= tempy1) && (tempy2 <= player->pos.y + sp5C.y) && (player->pos.x + sp5C.x <= tempx1) && (tempx2 <= player->pos.x + sp5C.x) && - (fabsf(player->unk_138 - actor->obj.pos.z - actor->info.hitbox[var_v1 + 0]) < D_i3_801C41B8[11])) { - D_i3_801C41B8[11] = fabsf(player->unk_138 - actor->obj.pos.z - actor->info.hitbox[var_v1 + 0]); + (fabsf(player->trueZpos - actor->obj.pos.z - actor->info.hitbox[var_v1 + 0]) < D_i3_801C41B8[11])) { + D_i3_801C41B8[11] = fabsf(player->trueZpos - actor->obj.pos.z - actor->info.hitbox[var_v1 + 0]); D_i3_801C4190[0] = actor->index + 1; D_i3_801C4190[1] = actor->obj.id; } @@ -1298,7 +1299,7 @@ void Aquas_801AC274(Player* player) { if (D_i3_801C4190[5] == 0) { gLight3x = player->pos.x; gLight3y = player->pos.y - 5.0f; - gLight3z = player->unk_138 - 60.0f; + gLight3z = player->trueZpos - 60.0f; gLight3R += 4; gLight3G += 3; @@ -1328,7 +1329,7 @@ void Aquas_801AC7C8(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scale2, s3 effect->unk_4A = 40; effect->scale2 = scale2 * 0.2f; effect->unk_46 = 50; - effect->unk_60.y = gPlayer[0].unk_0E8 + gPlayer[0].unk_114; + effect->unk_60.y = gPlayer[0].rot.y + gPlayer[0].yRot_114; if (effect->state == 2) { effect->unk_46 = 100; } @@ -1435,11 +1436,11 @@ void Aquas_801ACE50(Player* player) { player->sfx.boost = 0; - if (player->timer_27C != 0) { - player->timer_27C--; + if (player->meteoWarpTimer != 0) { + player->meteoWarpTimer--; player->boostSpeed += 0.3f; - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->rot.y + player->yRot_114) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, player->rot.x * M_DTOR, MTXF_APPLY); sp54.x = sp54.y = 0.0f; sp54.z = 70.0f; @@ -1447,19 +1448,19 @@ void Aquas_801ACE50(Player* player) { Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp54, &sp48); Aquas_801AC8A8(player->pos.x + RAND_FLOAT_CENTERED(10.0f) + sp48.x, player->pos.y + RAND_FLOAT_CENTERED(10.0f) + sp48.y, - player->unk_138 + RAND_FLOAT_CENTERED(10.0f) + (sp48.z * -1.0f), 0.4f, 1); - Math_SmoothStepToF(&player->unk_08C, -130.0f, 0.1f, 10.0f, 0.00001f); + player->trueZpos + RAND_FLOAT_CENTERED(10.0f) + (sp48.z * -1.0f), 0.4f, 1); + Math_SmoothStepToF(&player->camDist, -130.0f, 0.1f, 10.0f, 0.00001f); - player->unk_130 -= player->unk_258; - player->unk_258 += 0.2f; - if (player->unk_258 > 50.0f) { - player->unk_258 = 50.0f; + player->zRotBarrelRoll -= player->meteoWarpSpinSpeed; + player->meteoWarpSpinSpeed += 0.2f; + if (player->meteoWarpSpinSpeed > 50.0f) { + player->meteoWarpSpinSpeed = 50.0f; } if (((gGameFrameCount % 2) == 0) && (gBlurAlpha > 64)) { gBlurAlpha -= 1; } } else { - player->unk_258 = 0.0f; + player->meteoWarpSpinSpeed = 0.0f; if (gBlurAlpha < 255) { gBlurAlpha += 4; if (gBlurAlpha >= 252) { @@ -1489,7 +1490,7 @@ void Aquas_801ACE50(Player* player) { player->boostSpeed = 10.0f; } Math_SmoothStepToF(&D_i3_801C41B8[27], 10.0f, 0.1f, 2.0f, 0.00001f); - Math_SmoothStepToF(&player->unk_08C, -200.0f, 0.1f, D_i3_801C41B8[27], 0.00001f); + Math_SmoothStepToF(&player->camDist, -200.0f, 0.1f, D_i3_801C41B8[27], 0.00001f); player->sfx.boost = 1; Math_SmoothStepToF(&D_ctx_801779A8[0], 50.0f, 1.0f, 10.0f, 0.0f); } else { @@ -1509,7 +1510,7 @@ void Aquas_801ACE50(Player* player) { } } } - Math_SmoothStepToF(&player->unk_08C, 0.0f, 0.1f, 2.0f, 0.0f); + Math_SmoothStepToF(&player->camDist, 0.0f, 0.1f, 2.0f, 0.0f); } void Aquas_801AD328(Player* player) { @@ -1529,7 +1530,7 @@ void Aquas_801AD328(Player* player) { player->boostSpeed = -20.0f; } Math_SmoothStepToF(&D_i3_801C41B8[28], 10.0f, 1.0f, 2.0f, 0.00001f); - Math_SmoothStepToF(&player->unk_08C, 180.0f, 0.1f, D_i3_801C41B8[28], 0.0f); + Math_SmoothStepToF(&player->camDist, 180.0f, 0.1f, D_i3_801C41B8[28], 0.0f); player->sfx.brake = 1; Math_SmoothStepToF(&D_ctx_801779A8[0], 25.0f, 1.0f, 5.0f, 0.0f); } else { @@ -1551,7 +1552,7 @@ void Aquas_801AD328(Player* player) { } } } - Math_SmoothStepToF(&player->unk_08C, 0.0f, 0.1f, 2.0f, 0.0f); + Math_SmoothStepToF(&player->camDist, 0.0f, 0.1f, 2.0f, 0.0f); } void Aquas_801AD598(Actor* actor) { @@ -1600,7 +1601,7 @@ void Aquas_801AD6C0(Actor* actor) { actor->vel.z = 0.0f; } - if ((gPlayer[0].unk_138 + 500.0f) <= actor->obj.pos.z) { + if ((gPlayer[0].trueZpos + 500.0f) <= actor->obj.pos.z) { Object_Kill(&actor->obj, actor->sfxSource); } @@ -1624,9 +1625,9 @@ void Aquas_801AD6C0(Actor* actor) { break; case 1: - if (actor->unk_0D0 != 0) { + if (actor->dmgType != 0) { if (actor->health > 0) { - actor->unk_0D0 = 0; + actor->dmgType = 0; actor->timer_0C6 = 15; actor->health -= actor->damage; AUDIO_PLAY_SFX(0x29034045, actor->sfxSource, 4); @@ -1641,10 +1642,10 @@ void Aquas_801AD6C0(Actor* actor) { } } - if (actor->obj.pos.z <= (gPlayer[0].unk_138 - 200.0f)) { + if (actor->obj.pos.z <= (gPlayer[0].trueZpos - 200.0f)) { actor->fwork[7] = sp80 = gPlayer[0].pos.x + RAND_FLOAT_CENTERED(100.0f) - actor->obj.pos.x; actor->fwork[8] = sp7C = gPlayer[0].pos.y - 30.0f - actor->obj.pos.y; - actor->fwork[9] = sp78 = gPlayer[0].unk_138 - actor->obj.pos.z; + actor->fwork[9] = sp78 = gPlayer[0].trueZpos - actor->obj.pos.z; } else { sp80 = actor->fwork[7]; sp7C = actor->fwork[8]; @@ -1679,10 +1680,10 @@ void Aquas_801AD6C0(Actor* actor) { } sp68 = Math_RadToDeg(Math_Atan2F(gPlayer[0].pos.x + sp80 + RAND_FLOAT_CENTERED(200.0f) - actor->obj.pos.x, - gPlayer[0].unk_138 + sp78 - actor->obj.pos.z)); + gPlayer[0].trueZpos + sp78 - actor->obj.pos.z)); sp6C = Math_RadToDeg(-Math_Atan2F(gPlayer[0].pos.y - 30.0f + sp7C - actor->obj.pos.y, sp70)); - if (gPlayer[0].unk_138 <= actor->obj.pos.z) { + if (gPlayer[0].trueZpos <= actor->obj.pos.z) { sp68 = actor->unk_0F4.y; sp6C = actor->unk_0F4.x; } @@ -1721,7 +1722,7 @@ void Aquas_801AD6C0(Actor* actor) { actor->iwork[1]--; if (actor->iwork[1] <= 0) { actor->itemDrop = DROP_NONE; - actor->unk_0D4 = 2; + actor->dmgSource = 2; Actor_Despawn(actor); Object_Kill(&actor->obj, actor->sfxSource); } @@ -1743,7 +1744,7 @@ void Aquas_801AD6C0(Actor* actor) { void Aquas_801ADF7C(f32 xPos, f32 yPos, f32 zPos, f32 xRot, f32 yRot, f32 zRot, u8 type, s32 flag, f32 scale, s32 index) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, xPos, yPos, zPos + D_ctx_80177D20, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, xPos, yPos, zPos + gPathProgress, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, M_DTOR * yRot, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, M_DTOR * xRot, MTXF_APPLY); @@ -1802,9 +1803,9 @@ void Aquas_801AE168(Actor* actor) { if (i >= 2) { yRot = RAD_TO_DEG(Math_Atan2F(gPlayer[0].cam.eye.x - D_i3_801C27C0->pos.x, - gPlayer[0].cam.eye.z - (D_i3_801C27C0->pos.z + D_ctx_80177D20))); - xz = sqrtf(((gPlayer[0].cam.eye.z - (D_i3_801C27C0->pos.z + D_ctx_80177D20)) * - (gPlayer[0].cam.eye.z - (D_i3_801C27C0->pos.z + D_ctx_80177D20))) + + gPlayer[0].cam.eye.z - (D_i3_801C27C0->pos.z + gPathProgress))); + xz = sqrtf(((gPlayer[0].cam.eye.z - (D_i3_801C27C0->pos.z + gPathProgress)) * + (gPlayer[0].cam.eye.z - (D_i3_801C27C0->pos.z + gPathProgress))) + ((gPlayer[0].cam.eye.x - D_i3_801C27C0->pos.x) * (gPlayer[0].cam.eye.x - D_i3_801C27C0->pos.x))); xRot = RAD_TO_DEG(-Math_Atan2F(gPlayer[0].cam.eye.y - D_i3_801C27C0->pos.y, xz)); } @@ -1849,8 +1850,8 @@ void Aquas_801AE3D8(Actor* actor) { } } - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; + if (actor->dmgType != 0) { + actor->dmgType = 0; if ((fabsf(D_i3_801C4308[10]) >= 6.0f) && (gBosses[0].state >= 10) && (gBosses[0].swork[AQ_SWK_0] < 2)) { actor->timer_0C6 = 30; @@ -2118,8 +2119,8 @@ void Aquas_801AFA5C(Actor* actor) { actor->obj.rot.y = D_i3_801BFBC8[i]; actor->obj.rot.z = D_i3_801BFBD4[i]; } - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; + if (actor->dmgType != 0) { + actor->dmgType = 0; if ((gBosses[0].state >= 10) && (actor->health != 0) && (actor->damage == 31)) { actor->timer_0BE = 70; actor->health -= actor->damage; @@ -2343,7 +2344,7 @@ void Aquas_801B0B60(Actor* actor) { Vec3f sp44; Vec3f sp38; - if ((actor->unk_0D0 != 0) || (gBosses[0].state >= 16)) { + if ((actor->dmgType != 0) || (gBosses[0].state >= 16)) { actor->state = 3; } @@ -2395,7 +2396,7 @@ void Aquas_801B0B60(Actor* actor) { case 3: if (Rand_ZeroOne() < 0.1) { actor->itemDrop = DROP_SILVER_RING_10p; - actor->unk_0D4 = 2; + actor->dmgSource = 2; Actor_Despawn(actor); } Object_Kill(&actor->obj, actor->sfxSource); @@ -2551,7 +2552,7 @@ void Aquas_801B134C(Boss* bossAQ) { SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 40); Radio_PlayMessage(gMsg_ID_15100, RCID_FOX); } - if (fabsf(bossAQ->obj.pos.z - gPlayer[0].unk_138) <= 3000.0f) { + if (fabsf(bossAQ->obj.pos.z - gPlayer[0].trueZpos) <= 3000.0f) { D_i3_801C4190[6] = 1; bossAQ->timer_056 = 20; Audio_PlaySequence(SEQ_PLAYER_BGM, SEQ_ID_AQ_BOSS | SEQ_FLAG, 0, 1); @@ -2827,13 +2828,13 @@ void Aquas_801B134C(Boss* bossAQ) { if (bossAQ->timer_058 != 0) { gPlayer[0].boostCooldown = 1; Math_SmoothStepToF(&D_i3_801C41B8[24], 20.0f, 0.1f, 1.0f, 0.0f); - Math_SmoothStepToF(&gPlayer[0].unk_08C, 180.0f, 0.4f, 20.0f, 0.0f); + Math_SmoothStepToF(&gPlayer[0].camDist, 180.0f, 0.4f, 20.0f, 0.0f); } else { Math_SmoothStepToF(&D_i3_801C41B8[24], 0.0f, 0.01f, 0.1f, 0.0f); - Math_SmoothStepToF(&gPlayer[0].unk_08C, 0.0f, 0.1f, 2.0f, 0.0f); - if (gPlayer[0].unk_08C < 0.1f) { + Math_SmoothStepToF(&gPlayer[0].camDist, 0.0f, 0.1f, 2.0f, 0.0f); + if (gPlayer[0].camDist < 0.1f) { gPlayer[0].boostCooldown = 0; - gPlayer[0].unk_08C = D_i3_801C41B8[24] = 0.0f; + gPlayer[0].camDist = D_i3_801C41B8[24] = 0.0f; bossAQ->swork[AQ_SWK_0] = 0; } } @@ -2943,7 +2944,7 @@ void Aquas_801B134C(Boss* bossAQ) { if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) { gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; - gPlayer[0].unk_1D0 = 0; + gPlayer[0].csState = 0; } D_i3_801C4190[1] = 0; D_i3_801C4190[5] = 0; @@ -3027,7 +3028,7 @@ void Aquas_801B134C(Boss* bossAQ) { if ((bossAQ->state >= 4) && (bossAQ->state < 16)) { sp104 = gPlayer[0].pos.x - bossAQ->obj.pos.x; sp100 = gPlayer[0].pos.y - bossAQ->obj.pos.y; - spFC = gPlayer[0].unk_138 - bossAQ->obj.pos.z; + spFC = gPlayer[0].trueZpos - bossAQ->obj.pos.z; spE8 = Math_RadToDeg(Math_Atan2F(sp104, spFC)); // spEC = sqrtf(SQ(sp104) + SQ(spFC)); spE4 = Math_RadToDeg(-Math_Atan2F(sp100, sqrtf(SQ(sp104) + SQ(spFC)))); @@ -3062,10 +3063,10 @@ void Aquas_801B134C(Boss* bossAQ) { spF4 = gPlayer[0].pos.y - D_i3_801C4308[77]; spF8 = gPlayer[0].pos.x - D_i3_801C4308[76]; - spF0 = gPlayer[0].unk_138 - D_i3_801C4308[78]; + spF0 = gPlayer[0].trueZpos - D_i3_801C4308[78]; sp104 = gPlayer[0].pos.x - D_i3_801C4308[73]; sp100 = gPlayer[0].pos.y - D_i3_801C4308[74]; - spFC = gPlayer[0].unk_138 - D_i3_801C4308[75]; + spFC = gPlayer[0].trueZpos - D_i3_801C4308[75]; spE8 = Math_RadToDeg(Math_Atan2F(sp104, spFC)); spE0 = Math_RadToDeg(Math_Atan2F(spF8, spF0)); @@ -3692,8 +3693,8 @@ void Aquas_801B50E8(Actor* actor) { break; case 2: - Math_SmoothStepToF(&actor->obj.pos.z, gPlayer[0].unk_138, 1.0f, 10.0f, 0); - if (fabsf(actor->obj.pos.z - gPlayer[0].unk_138) < actor->fwork[4]) { + Math_SmoothStepToF(&actor->obj.pos.z, gPlayer[0].trueZpos, 1.0f, 10.0f, 0); + if (fabsf(actor->obj.pos.z - gPlayer[0].trueZpos) < actor->fwork[4]) { Aquas_801A9728(actor, 50.0f, 10.0f, 8); actor->state = 3; actor->vel.y = 30.0f; @@ -3714,7 +3715,7 @@ void Aquas_801B50E8(Actor* actor) { case 4: Math_SmoothStepToF(&actor->vel.y, 0.0f, 1.0f, 4.0f, 0.0001f); actor->vel.z = gPlayer[0].vel.z; - Math_SmoothStepToF(&actor->obj.pos.z, gPlayer[0].unk_138 - actor->fwork[4], 0.1f, 100.0f, 0); + Math_SmoothStepToF(&actor->obj.pos.z, gPlayer[0].trueZpos - actor->fwork[4], 0.1f, 100.0f, 0); Math_SmoothStepToF(&actor->obj.pos.y, actor->fwork[0], 1.0f, D_i3_801C0224[actor->iwork[1]], 0); actor->fwork[1] += 10.0f; actor->vel.x = COS_DEG(actor->fwork[1]) * actor->iwork[1] * 0.1f; @@ -3730,7 +3731,7 @@ void Aquas_801B50E8(Actor* actor) { case 5: actor->vel.z = gPlayer[0].vel.z; - Math_SmoothStepToF(&actor->obj.pos.z, gPlayer[0].unk_138 - 1000.0f, 0.1f, 100.0f, 0); + Math_SmoothStepToF(&actor->obj.pos.z, gPlayer[0].trueZpos - 1000.0f, 0.1f, 100.0f, 0); Math_SmoothStepToF(&actor->vel.x, 0.0f, 1.0f, 2.0f, 0.001f); Math_SmoothStepToAngle(&actor->obj.rot.x, D_i3_801C025C[actor->iwork[0]], 1.0f, 20.0f, 0); if (actor->obj.rot.x == D_i3_801C025C[actor->iwork[0]]) { @@ -3738,7 +3739,7 @@ void Aquas_801B50E8(Actor* actor) { if (actor->iwork[0] >= 2) { sp88.x = gPlayer[0].pos.x - actor->obj.pos.x; sp88.y = gPlayer[0].pos.y - actor->obj.pos.y; - sp88.z = gPlayer[0].unk_138 - actor->obj.pos.z; + sp88.z = gPlayer[0].trueZpos - actor->obj.pos.z; actor->fwork[2] = Math_RadToDeg(Math_Atan2F(sp88.x, sp88.z)); actor->fwork[3] = Math_RadToDeg(-Math_Atan2F(sp88.y, sqrtf(SQ(sp88.x) + SQ(sp88.z)))); Matrix_RotateY(gCalcMatrix, actor->fwork[2] * M_DTOR, MTXF_NEW); @@ -3789,8 +3790,8 @@ void Aquas_801B50E8(Actor* actor) { } } - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; + if (actor->dmgType != 0) { + actor->dmgType = 0; if (actor->health != 0) { if (actor->damage == 31) { actor->info.bonus = 1; @@ -4048,7 +4049,7 @@ void Aquas_801B638C(Actor* actor) { actor->iwork[15] = 1; } if (actor->iwork[15] != 0) { - if ((gPlayer[0].unk_138 + 300.0f) < actor->obj.pos.z) { + if ((gPlayer[0].trueZpos + 300.0f) < actor->obj.pos.z) { Object_Kill(&actor->obj, actor->sfxSource); } } else { @@ -4106,7 +4107,7 @@ void Aquas_801B638C(Actor* actor) { actor->vel.x = actor->vel.y = actor->vel.z = 0.0f; } - if ((actor->iwork[14] != 0) && (actor->obj.pos.z < (gPlayer[0].unk_138 - 2000.0f))) { + if ((actor->iwork[14] != 0) && (actor->obj.pos.z < (gPlayer[0].trueZpos - 2000.0f))) { actor->iwork[14] = 0; actor->timer_0BC = 500; } @@ -4114,9 +4115,9 @@ void Aquas_801B638C(Actor* actor) { break; } - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; - if ((actor->health != 0) && (actor->unk_0D2 == 0)) { + if (actor->dmgType != 0) { + actor->dmgType = 0; + if ((actor->health != 0) && (actor->dmgPart == 0)) { actor->health -= actor->damage; actor->timer_0C6 = 30; AUDIO_PLAY_SFX(0x2903408F, actor->sfxSource, 4); @@ -4181,7 +4182,7 @@ void Aquas_801B6FF8(Actor* actor) { actor->timer_0BC = 200; actor->fwork[1] = gPlayer[0].pos.x + RAND_FLOAT_CENTERED(800.0f); actor->fwork[2] = gPlayer[0].pos.y + 50.0f + RAND_FLOAT(100.0f); - actor->fwork[3] = gPlayer[0].unk_138 - 1500.0f; + actor->fwork[3] = gPlayer[0].trueZpos - 1500.0f; if (actor->fwork[1] > 700.0f) { actor->fwork[1] = 700.0f; } @@ -4189,7 +4190,7 @@ void Aquas_801B6FF8(Actor* actor) { actor->fwork[1] = -700.0f; } if (Rand_ZeroOne() < 0.2f) { - actor->fwork[3] = gPlayer[0].unk_138 - 800.0f; + actor->fwork[3] = gPlayer[0].trueZpos - 800.0f; actor->fwork[1] = gPlayer[0].pos.x; actor->fwork[2] = gPlayer[0].pos.y + 50.0f; } @@ -4244,8 +4245,8 @@ void Aquas_801B6FF8(Actor* actor) { actor->unk_0B6 = 0; } - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; + if (actor->dmgType != 0) { + actor->dmgType = 0; if (actor->health > -100) { actor->timer_0C6 = 15; actor->health -= actor->damage; @@ -4424,7 +4425,7 @@ void Aquas_801B7C78(Actor* actor) { if (actor->state != 6) { spAC = gPlayer[0].pos.x - actor->obj.pos.x; Math_SmoothStepToAngle(&actor->obj.rot.y, - Math_RadToDeg(Math_Atan2F(spAC, gPlayer[0].unk_138 - actor->obj.pos.z)), 1.0f, 5.0f, + Math_RadToDeg(Math_Atan2F(spAC, gPlayer[0].trueZpos - actor->obj.pos.z)), 1.0f, 5.0f, 0.001f); } @@ -4444,8 +4445,8 @@ void Aquas_801B7C78(Actor* actor) { } Math_SmoothStepToF(&actor->fwork[1], actor->fwork[2], 0.1f, 2.0f, 0.00001f); - Math_SmoothStepToF(&actor->obj.pos.z, gPlayer[0].cam.eye.z - D_ctx_80177D20 + actor->fwork[3], 0.1f, - actor->fwork[1], 0.00001); + Math_SmoothStepToF(&actor->obj.pos.z, gPlayer[0].cam.eye.z - gPathProgress + actor->fwork[3], 0.1f, actor->fwork[1], + 0.00001); if ((actor->state == 1) && (fabsf(actor->fwork[7] - actor->obj.pos.z) >= 10000.0f)) { actor->timer_0C0 = 20; @@ -4531,7 +4532,7 @@ void Aquas_801B7C78(Actor* actor) { if (actor->unk_0B6 == 20) { spAC = gPlayer[0].pos.x - effect->obj.pos.x; temp_dy = gPlayer[0].pos.y - effect->obj.pos.y; - temp_dz = gPlayer[0].unk_138 - 50.0f - effect->obj.pos.z; + temp_dz = gPlayer[0].trueZpos - 50.0f - effect->obj.pos.z; temp_fs2 = Math_RadToDeg(Math_Atan2F(spAC, temp_dz)); temp1 = Math_RadToDeg(-Math_Atan2F(temp_dy, sqrtf(SQ(spAC) + SQ(temp_dz)))); @@ -4565,7 +4566,7 @@ void Aquas_801B7C78(Actor* actor) { if (actor->unk_0B6 == 57) { spAC = gPlayer[0].pos.x - effect->obj.pos.x; temp_dy = gPlayer[0].pos.y - effect->obj.pos.y; - temp_dz = gPlayer[0].unk_138 - 50.0f - effect->obj.pos.z; + temp_dz = gPlayer[0].trueZpos - 50.0f - effect->obj.pos.z; temp_fs2 = Math_RadToDeg(Math_Atan2F(spAC, temp_dz)); temp1 = Math_RadToDeg(-Math_Atan2F(temp_dy, sqrtf(SQ(spAC) + SQ(temp_dz)))); @@ -4603,7 +4604,7 @@ void Aquas_801B7C78(Actor* actor) { if (actor->timer_0C0 == 0) { temp_dy = gPlayer[0].pos.y - 50.0f - actor->obj.pos.y; - temp_dz = gPlayer[0].unk_138 - actor->obj.pos.z; + temp_dz = gPlayer[0].trueZpos - actor->obj.pos.z; temp1 = Math_RadToDeg(-Math_Atan2F(temp_dy, sqrtf(SQ(spAC) + SQ(temp_dz)))); Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); Matrix_RotateX(gCalcMatrix, M_DTOR * temp1, MTXF_APPLY); @@ -4648,8 +4649,8 @@ void Aquas_801B7C78(Actor* actor) { actor->health = 0; } - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; + if (actor->dmgType != 0) { + actor->dmgType = 0; if (actor->health != 0) { actor->info.bonus = 0; if (actor->damage == 31) { @@ -4902,10 +4903,10 @@ void Aquas_801B91A4(Actor* actor) { } } - if ((actor->unk_0B6 > 36) && (i != 0) && (fabsf(gPlayer[0].unk_138 - actor->obj.pos.z) > 1000.0f)) { + if ((actor->unk_0B6 > 36) && (i != 0) && (fabsf(gPlayer[0].trueZpos - actor->obj.pos.z) > 1000.0f)) { spfA4 = gPlayer[0].pos.x + RAND_FLOAT_CENTERED(200.0f) - actor->vwork[26].x; spA0 = gPlayer[0].pos.y + RAND_FLOAT_CENTERED(200.0f) - actor->vwork[26].y; - spf9C = gPlayer[0].unk_138 + RAND_FLOAT_CENTERED(200.0f) - actor->vwork[26].z; + spf9C = gPlayer[0].trueZpos + RAND_FLOAT_CENTERED(200.0f) - actor->vwork[26].z; sp94 = Math_RadToDeg(Math_Atan2F(spfA4, spf9C)); spf98 = Math_RadToDeg(-Math_Atan2F(spA0, sqrtf(SQ(spfA4) + SQ(spf9C)))); Matrix_RotateY(gCalcMatrix, M_DTOR * sp94, MTXF_NEW); @@ -4957,8 +4958,8 @@ void Aquas_801B91A4(Actor* actor) { break; } - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; + if (actor->dmgType != 0) { + actor->dmgType = 0; if ((actor->health != 0) && (actor->state != 0)) { actor->timer_0C6 = 15; actor->health -= actor->damage; @@ -5099,7 +5100,7 @@ void Aquas_801BA26C(Actor* actor) { if ((fabsf(actor->obj.pos.x - gPlayer[0].pos.x) < 150.0f) && (fabsf(actor->obj.pos.y - gPlayer[0].pos.y) < 500.0f) && - (fabsf(actor->obj.pos.z - gPlayer[0].unk_138) < 700.0f)) { + (fabsf(actor->obj.pos.z - gPlayer[0].trueZpos) < 700.0f)) { actor->state = 2; actor->fwork[0] = 0.0f; } @@ -5113,7 +5114,7 @@ void Aquas_801BA26C(Actor* actor) { sp3E = Animation_GetFrameData(&D_AQ_601DE50, actor->unk_0B6, sp40); if ((fabsf(actor->obj.pos.x - gPlayer[0].pos.x) > 150.0f) || (fabsf(actor->obj.pos.y - gPlayer[0].pos.y) > 500.0f) || - (fabsf(actor->obj.pos.z - gPlayer[0].unk_138) > 700.0f)) { + (fabsf(actor->obj.pos.z - gPlayer[0].trueZpos) > 700.0f)) { actor->state = 1; actor->fwork[0] = 0.0f; } @@ -5207,8 +5208,8 @@ void Aquas_801BA6A4(Actor* actor) { break; } - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; + if (actor->dmgType != 0) { + actor->dmgType = 0; actor->health -= actor->damage; if (actor->health <= 0) { actor->health = actor->itemDrop = 0; @@ -5274,10 +5275,10 @@ void Aquas_801BADF8(Actor* actor) { break; case 1: - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; + if (actor->dmgType != 0) { + actor->dmgType = 0; if (actor->damage == 0) { - gPlayer[0].unk_1F4 = 6; + gPlayer[0].hitTimer = 6; gPlayer[0].unk_21C = 0; } actor->state++; @@ -5737,8 +5738,8 @@ void Aquas_801BB79C(Actor* actor) { actor->iwork[9] = actor->iwork[12] = 0; } - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; + if (actor->dmgType != 0) { + actor->dmgType = 0; AUDIO_PLAY_SFX(0x2903408F, actor->sfxSource, 4); if (actor->damage != 31) { actor->timer_0C0 = actor->timer_0C6 = 40; @@ -5881,8 +5882,8 @@ void Aquas_801BC9A0(Actor* actor) { break; case 1: - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; + if (actor->dmgType != 0) { + actor->dmgType = 0; if ((actor->health != 0) && (actor->iwork[3] == 0) && (actor->damage == 31)) { actor->health -= actor->damage; AUDIO_PLAY_SFX(0x2903B009, actor->sfxSource, 4); @@ -6142,7 +6143,7 @@ void Aquas_801BD54C(Actor* actor) { actor->timer_0BC = 0; } else { Math_SmoothStepToF(&actor->fwork[3], D_i3_801C04F4[actor->iwork[1]], 0.1f, 30.0f, 0.0001f); - Math_SmoothStepToF(&actor->obj.pos.z, gPlayer[0].cam.eye.z - D_ctx_80177D20 - actor->fwork[3], 0.1f, + Math_SmoothStepToF(&actor->obj.pos.z, gPlayer[0].cam.eye.z - gPathProgress - actor->fwork[3], 0.1f, 30.0f, 0.00001f); } @@ -6159,7 +6160,7 @@ void Aquas_801BD54C(Actor* actor) { sp5C = gPlayer[0].pos.x - actor->obj.pos.x; sp58 = gPlayer[0].pos.y - actor->obj.pos.y; - sp54 = gPlayer[0].unk_138 - actor->obj.pos.z; + sp54 = gPlayer[0].trueZpos - actor->obj.pos.z; if (actor->timer_0BE == 0) { actor->iwork[2] = 0; @@ -6167,7 +6168,7 @@ void Aquas_801BD54C(Actor* actor) { if (D_i3_801C4190[5] == 0) { sp5C = gPlayer[0].pos.x + actor->fwork[1] - actor->obj.pos.x; sp58 = gPlayer[0].pos.y - 100.0f + actor->fwork[2] - actor->obj.pos.y; - sp54 = gPlayer[0].unk_138 - actor->fwork[3] - actor->obj.pos.z; + sp54 = gPlayer[0].trueZpos - actor->fwork[3] - actor->obj.pos.z; } else if ((D_i3_801C41B8[21] != 0) && (D_i3_801C41B8[22] != 0) && (D_i3_801C41B8[23] != 0)) { sp5C = D_i3_801C41B8[21] - actor->obj.pos.x; sp58 = D_i3_801C41B8[22] - actor->obj.pos.y; @@ -6185,7 +6186,7 @@ void Aquas_801BD54C(Actor* actor) { actor->iwork[0]--; sp5C = gPlayer[0].pos.x + actor->fwork[1] - actor->obj.pos.x; sp58 = gPlayer[0].pos.y + actor->fwork[2] - actor->obj.pos.y; - sp54 = gPlayer[0].unk_138 - actor->fwork[3] - actor->obj.pos.z; + sp54 = gPlayer[0].trueZpos - actor->fwork[3] - actor->obj.pos.z; if (actor->iwork[0] < 0) { actor->iwork[0] = 0; } @@ -6218,13 +6219,13 @@ void Aquas_801BD54C(Actor* actor) { case 3: sp5C = gPlayer[0].pos.x + actor->fwork[1] - actor->obj.pos.x; sp58 = gPlayer[0].pos.y + actor->fwork[2] - actor->obj.pos.y; - sp54 = gPlayer[0].unk_138 + 10000.0f - actor->fwork[3] - actor->obj.pos.z; + sp54 = gPlayer[0].trueZpos + 10000.0f - actor->fwork[3] - actor->obj.pos.z; actor->iwork[2] = 1; Aquas_801BD3B0(actor, sp5C, sp58, sp54); - if ((gPlayer[0].unk_138 + 1000.0f) < actor->obj.pos.z) { + if ((gPlayer[0].trueZpos + 1000.0f) < actor->obj.pos.z) { Object_Kill(&actor->obj, actor->sfxSource); } break; @@ -6293,7 +6294,7 @@ void Aquas_801BDF14(void) { for (i = 0; i < 50; i++, actor++) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = D_i3_801C0504[i].x; actor->obj.pos.y = D_i3_801C0504[i].y; actor->obj.pos.z = D_i3_801C0504[i].z; @@ -6321,7 +6322,7 @@ void Aquas_801BE034(Actor* actor) { actor->iwork[0] = 0; } - if (gPlayer[0].unk_1D0 >= 5) { + if (gPlayer[0].csState >= 5) { Object_Kill(&actor->obj, actor->sfxSource); } } @@ -6410,11 +6411,11 @@ void Aquas_801BE3F8(Actor* actor) { if ((actor->unk_0B6 == 18) && (actor->health != 0)) { actor->unk_0B6 = 17; - if ((fabsf(actor->obj.pos.z - gPlayer[0].unk_138) > 1000.0f) && (actor->timer_0BC < 20) && + if ((fabsf(actor->obj.pos.z - gPlayer[0].trueZpos) > 1000.0f) && (actor->timer_0BC < 20) && ((actor->timer_0BC & 3) == 0)) { sp68 = gPlayer[0].pos.x + RAND_FLOAT_CENTERED(200.0f) - actor->obj.pos.x; sp64 = gPlayer[0].pos.y + RAND_FLOAT_CENTERED(200.0f) - actor->obj.pos.y; - sp60 = gPlayer[0].unk_138 - actor->obj.pos.z; + sp60 = gPlayer[0].trueZpos - actor->obj.pos.z; sp58 = Math_RadToDeg(Math_Atan2F(sp68, sp60)); sp5C = Math_RadToDeg(-Math_Atan2F(sp64, sqrtf(SQ(sp68) + SQ(sp60)))); Aquas_801BE274(actor, sp58, sp5C); @@ -6435,8 +6436,8 @@ void Aquas_801BE3F8(Actor* actor) { break; } - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; + if (actor->dmgType != 0) { + actor->dmgType = 0; if (actor->health != 0) { if (actor->state == 2) { actor->health -= actor->damage; diff --git a/src/overlays/ovl_i3/fox_so.c b/src/overlays/ovl_i3/fox_so.c index be76e90f..3b9fb96f 100644 --- a/src/overlays/ovl_i3/fox_so.c +++ b/src/overlays/ovl_i3/fox_so.c @@ -240,10 +240,10 @@ void Solar_8019EA7C(Actor* actor) { s32 sp30; if (actor->state == 0) { - actor->vel.z = 20.0f - D_ctx_80177D08; + actor->vel.z = 20.0f - gPathVelZ; actor->fwork[0] = 12.0f; } else { - actor->vel.z = actor->fwork[1] - D_ctx_80177D08; + actor->vel.z = actor->fwork[1] - gPathVelZ; if (actor->state == 2) { Math_SmoothStepToF(&actor->obj.pos.x, gPlayer[0].pos.x, 1.0f, 100.0f, 10.0f); } else { @@ -293,7 +293,7 @@ void Solar_8019EA7C(Actor* actor) { D_ctx_801782EC[sp30 - 12] = actor->fwork[0] * 0.1f; } } - switch (actor->unk_0D0) { + switch (actor->dmgType) { case 3: Solar_801A8DB8(&actor->obj.pos, 0x11002052, actor->vel.z); /* fallthrough */ @@ -436,7 +436,7 @@ void Solar_8019F20C(Actor* actor) { Solar_8019E9F4(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 0.0f, 0.0f, 0.0f, actor->scale * 6.5f, 2); } - if ((actor->unk_0D0 != 0) || ((actor->obj.id == OBJ_ACTOR_277) && (actor->vel.y < 0.0f))) { + if ((actor->dmgType != 0) || ((actor->obj.id == OBJ_ACTOR_277) && (actor->vel.y < 0.0f))) { func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->scale * 4.0f); Object_Kill(&actor->obj, actor->sfxSource); if (actor->obj.id == OBJ_ACTOR_277) { @@ -938,7 +938,7 @@ void Solar_801A0FD4(Actor* actor, s32 index) { if (gTeamShields[3 - index] > 0) { Actor_Initialize(actor); actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = D_i3_801BF95C[index].x + gPlayer[0].pos.x; actor->obj.pos.y = D_i3_801BF95C[index].y + gPlayer[0].pos.y; actor->obj.pos.z = D_i3_801BF95C[index].z + gPlayer[0].pos.z; @@ -964,11 +964,11 @@ void Solar_LevelStart(Player* player) { if (D_ctx_80177A10[1] != 0) { D_ctx_80177A10[1]--; } - switch (player->unk_1D0) { + switch (player->csState) { case 0: gCsFrameCount = 0; Rand_SetSeed(1, 29100, 9786); - player->unk_1D0 = 1; + player->csState = 1; player->cam.eye.x = -2000.0f; gCsCamEyeX = -2800.0f; player->cam.eye.y = gCsCamEyeY = 120.0f; @@ -991,7 +991,7 @@ void Solar_LevelStart(Player* player) { AUDIO_PLAY_SFX(0x3140807E, player->sfxSource, 0); break; case 1: - D_ctx_80177CE8 += 30.0f; + gPathTexScroll += 30.0f; if (gCsFrameCount == 140) { Solar_801A0DF8(-400.0f, -2000.0f, 45.0f, 3, 1.0f); } @@ -1019,7 +1019,7 @@ void Solar_LevelStart(Player* player) { } if (((gGameFrameCount % 8) == 0)) { Solar_8019E8B8(RAND_FLOAT_CENTERED(6000.0f), RAND_FLOAT_CENTERED(5.0f) - 90.0f, - RAND_FLOAT(2000.0f) - 6000.0f + D_ctx_80177D20, RAND_FLOAT(20.0f) + 20.0f); + RAND_FLOAT(2000.0f) - 6000.0f + gPathProgress, RAND_FLOAT(20.0f) + 20.0f); } if (gCsFrameCount == 380) { for (i = 0; i < 100; i++) { @@ -1028,7 +1028,7 @@ void Solar_LevelStart(Player* player) { Solar_801A0DF8(400.0f, -2800.0f, 340.0f, 1, 1.0f); } if (gCsFrameCount == 410) { - player->unk_1D0++; + player->csState++; player->cam.eye.x = 200.0f; gCsCamEyeX = 800.0f; player->cam.eye.y = 140.0f; @@ -1056,7 +1056,7 @@ void Solar_LevelStart(Player* player) { } break; case 2: - D_ctx_80177CE8 += 60.0f; + gPathTexScroll += 60.0f; gFillScreenAlphaTarget = 0; gFillScreenAlphaStep = 8; Math_SmoothStepToF(D_ctx_80177A48, 0.02f, 1.0f, 0.0000003f, 0.0f); @@ -1068,7 +1068,7 @@ void Solar_LevelStart(Player* player) { Solar_801A0DF8(30.0f, -1500.0f, 160.0f, 3, 2.0f); } if (player->cam.eye.z <= -2465.0f) { - player->unk_1D0++; + player->csState++; gCsCamEyeY = player->pos.y + 180.0f; gCsCamAtX = 0.0f; gCsCamEyeX = 0.0f; @@ -1077,10 +1077,10 @@ void Solar_LevelStart(Player* player) { } break; case 3: - D_ctx_80177CE8 += 60.0f; + gPathTexScroll += 60.0f; if (((gGameFrameCount % 4) == 0)) { Solar_8019E8B8(RAND_FLOAT_CENTERED(6000.0f), -400.0f - ((player->cam.eye.y - 1380.0f) * 0.3f), - RAND_FLOAT_CENTERED(2000.0f) + 500.0f + D_ctx_80177D20, RAND_FLOAT(20.0f) + 20.0f); + RAND_FLOAT_CENTERED(2000.0f) + 500.0f + gPathProgress, RAND_FLOAT(20.0f) + 20.0f); } if (gCsFrameCount == 615) { func_play_800A6028(player->sfxSource, 0x09000002); @@ -1088,23 +1088,23 @@ void Solar_LevelStart(Player* player) { gActors[0].state = 3; gActors[1].state = 2; gActors[2].state = 1; - player->timer_1F8 = 3; + player->csTimer = 3; player->unk_190 = 5.0f; - player->unk_1D0++; + player->csState++; player->unk_194 = 5.0f; } break; case 4: gCsCamEyeX = player->pos.x; gCsCamEyeY = player->pos.y; - gCsCamEyeZ = player->unk_138 + 1000.0f; + gCsCamEyeZ = player->trueZpos + 1000.0f; gCsCamAtX = player->pos.x; gCsCamAtY = player->pos.y; - gCsCamAtZ = player->unk_138 + 1100.0f; + gCsCamAtZ = player->trueZpos + 1100.0f; D_ctx_80177A48[0] = 0.03f; D_ctx_801779A8[gMainController] = 60.0f; player->unk_190 = 2.0f; - if (player->timer_1F8 == 0) { + if (player->csTimer == 0) { gFillScreenAlphaTarget = 255; gFillScreenAlphaStep = 24; gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; @@ -1116,7 +1116,7 @@ void Solar_LevelStart(Player* player) { Play_ClearObjectData(); gLevelStartStatusScreenTimer = 50; player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; - player->unk_1D0 = 0; + player->csState = 0; player->pos.y = 350.0f; player->cam.eye.x = player->pos.x; @@ -1125,19 +1125,19 @@ void Solar_LevelStart(Player* player) { player->cam.at.x = player->pos.x; player->cam.at.y = 20.0f + player->pos.y * player->unk_148; - player->cam.at.z = player->unk_138; + player->cam.at.z = player->trueZpos; D_ctx_80177950 = 1.0f; Audio_SetHeatAlarmParams(255, 3); AUDIO_PLAY_SFX(0x4100C023, gDefaultSfxSource, 4); gLoadLevelObjects = 1; gFillScreenAlphaTarget = 0; - player->timer_1F8 = 15; + player->csTimer = 15; gPlayer[0].shields = 255; } break; case 10: - D_ctx_80177CE8 += 60.0f; + gPathTexScroll += 60.0f; break; } Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 20000.0f, 0); @@ -1146,8 +1146,8 @@ void Solar_LevelStart(Player* player) { Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 20000.0f, 0); Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 20000.0f, 0); Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 20000.0f, 0); - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->rot.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(player->rot.x * M_DTOR), MTXF_APPLY); sp50.x = 0.f; sp50.y = 0.0f; sp50.z = player->baseSpeed; @@ -1158,7 +1158,7 @@ void Solar_LevelStart(Player* player) { player->pos.x += player->vel.x; player->pos.y += player->vel.y; player->pos.z += player->vel.z; - player->unk_138 = player->pos.z + player->unk_08C; + player->trueZpos = player->pos.z + player->camDist; } void Solar_801A1CD8(Actor* actor, f32 xPos, f32 yPos, f32 zPos, f32 xRot, f32 yRot, f32 zRot, f32 xVel, f32 yVel, @@ -1262,7 +1262,7 @@ void Solar_801A1F80(Boss* bossSO) { Math_SmoothStepToF(&D_ctx_801779A8[gMainController], 120.0f, 1.0f, 3.5f, 0.0f); } if (gBossFrameCount == 60) { - gActors[10].unk_0D0 = 3; + gActors[10].dmgType = 3; AUDIO_PLAY_SFX(0x19036053, bossSO->sfxSource, 4); } if (bossSO->timer_050 == 100) { @@ -1493,7 +1493,7 @@ void Solar_801A2C98(Boss* bossSO) { } } if (bossSO->unk_04C == 20) { - gActors[10].unk_0D0 = 3; + gActors[10].dmgType = 3; AUDIO_PLAY_SFX(0x19036054, bossSO->sfxSource, 4); } if (bossSO->unk_04C == 0) { @@ -1501,7 +1501,7 @@ void Solar_801A2C98(Boss* bossSO) { bossSO->swork[SO_SWK_11] = 100; bossSO->obj.pos.y = -500.0f; bossSO->fwork[SO_FWK_3] = 4800.0f; - bossSO->obj.pos.z = gPlayer[0].unk_138 - bossSO->fwork[SO_FWK_3]; + bossSO->obj.pos.z = gPlayer[0].trueZpos - bossSO->fwork[SO_FWK_3]; bossSO->obj.rot.y = -bossSO->obj.rot.y; } } else { @@ -1527,7 +1527,7 @@ void Solar_801A2C98(Boss* bossSO) { Solar_801A3468(bossSO); } if (bossSO->swork[SO_SWK_11] == 50) { - gActors[9].unk_0D0 = 3; + gActors[9].dmgType = 3; AUDIO_PLAY_SFX(0x19036053, bossSO->sfxSource, 4); } } @@ -1554,7 +1554,7 @@ void Solar_801A3128(Boss* bossSO) { Solar_801A0CEC(&gActors[10], bossSO->obj.pos.x, bossSO->obj.pos.z + 2000.0f, 10.0f, 1); } if (bossSO->unk_04C == 40) { - gActors[10].unk_0D0 = 3; + gActors[10].dmgType = 3; AUDIO_PLAY_SFX(0x19036054, bossSO->sfxSource, 4); } if (bossSO->unk_04C == 0) { @@ -1562,7 +1562,7 @@ void Solar_801A3128(Boss* bossSO) { bossSO->swork[SO_SWK_11] = 100; bossSO->obj.pos.y = -500.0f; bossSO->fwork[SO_FWK_3] = 2400.0f; - bossSO->obj.pos.z = gPlayer[0].unk_138 - 2100.0f; + bossSO->obj.pos.z = gPlayer[0].trueZpos - 2100.0f; } } else { bossSO->unk_04C = Animation_GetFrameCount(&D_SO_601388C) - 2; @@ -1604,7 +1604,7 @@ void Solar_801A3128(Boss* bossSO) { } } if (bossSO->swork[SO_SWK_11] == 50) { - gActors[9].unk_0D0 = 3; + gActors[9].dmgType = 3; AUDIO_PLAY_SFX(0x19036053, bossSO->sfxSource, 4); } } @@ -1817,16 +1817,16 @@ void Solar_801A3C4C(Boss* bossSO) { AUDIO_PLAY_SFX(0x2940D09A, bossSO->sfxSource, 4); if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) { gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; - gPlayer[0].timer_1F8 = 0; - gPlayer[0].unk_1D0 = gPlayer[0].timer_1F8; - gPlayer[0].unk_0E8 += gPlayer[0].unk_114; - if (gPlayer[0].unk_0E8 > 360.0f) { - gPlayer[0].unk_0E8 -= 360.0f; + gPlayer[0].csTimer = 0; + gPlayer[0].csState = gPlayer[0].csTimer; + gPlayer[0].rot.y += gPlayer[0].yRot_114; + if (gPlayer[0].rot.y > 360.0f) { + gPlayer[0].rot.y -= 360.0f; } - if (gPlayer[0].unk_0E8 < 0.0f) { - gPlayer[0].unk_0E8 += 360.0f; + if (gPlayer[0].rot.y < 0.0f) { + gPlayer[0].rot.y += 360.0f; } - gPlayer[0].unk_114 = 0.0f; + gPlayer[0].yRot_114 = 0.0f; } bossSO->fwork[SO_FWK_31] = 0.0f; bossSO->fwork[SO_FWK_3] = 2400.0f; @@ -1976,7 +1976,7 @@ void Solar_801A48B8(Boss* bossSO) { if ((bossSO->swork[SO_SWK_0] == 4) && (bossSO->unk_04C >= 60) && (bossSO->unk_04C < 67)) { for (i = 4; i < 60; i++) { if (gActors[i].obj.id == OBJ_ACTOR_278) { - gActors[i].unk_0D0 = 2; + gActors[i].dmgType = 2; break; } } @@ -2098,14 +2098,14 @@ void Solar_801A4EF8(Boss* bossSO) { } } if (bossSO->swork[SO_SWK_11] == 16) { - gActors[10].unk_0D0 = 2; + gActors[10].dmgType = 2; } if (bossSO->obj.pos.y <= -900.0f) { bossSO->state++; bossSO->swork[SO_SWK_11] = 500; bossSO->obj.pos.y = -1500.0f; bossSO->fwork[SO_FWK_3] = 4800.0f; - bossSO->obj.pos.z = gPlayer[0].unk_138 - bossSO->fwork[SO_FWK_3]; + bossSO->obj.pos.z = gPlayer[0].trueZpos - bossSO->fwork[SO_FWK_3]; bossSO->swork[SO_SWK_1] = 0; bossSO->unk_078.y = bossSO->obj.rot.y = 0.0f; bossSO->vel.y = 0.0f; @@ -2129,7 +2129,7 @@ void Solar_801A4EF8(Boss* bossSO) { if (bossSO->swork[SO_SWK_11] == 170) { AUDIO_PLAY_SFX(0x29432073, bossSO->sfxSource, 4); bossSO->obj.pos.y = -500.0f; - gActors[9].unk_0D0 = 2; + gActors[9].dmgType = 2; } if (bossSO->swork[SO_SWK_11] <= 170) { bossSO->vel.y = COS_DEG(bossSO->obj.rot.x) * 80.0f; @@ -2149,7 +2149,7 @@ void Solar_801A4EF8(Boss* bossSO) { bossSO->swork[SO_SWK_11] = 100; bossSO->obj.pos.y = -500.0f; bossSO->fwork[SO_FWK_3] = 4800.0f; - bossSO->obj.pos.z = gPlayer[0].unk_138 - bossSO->fwork[SO_FWK_3]; + bossSO->obj.pos.z = gPlayer[0].trueZpos - bossSO->fwork[SO_FWK_3]; bossSO->unk_04C = 0; bossSO->obj.rot.x = 0.0f; bossSO->fwork[SO_FWK_31] = bossSO->vel.y = bossSO->vel.z = 0.0f; @@ -2177,7 +2177,7 @@ void Solar_801A4EF8(Boss* bossSO) { bossSO->fwork[SO_FWK_0] = 0.01f; } if (bossSO->swork[SO_SWK_11] == 50) { - gActors[9].unk_0D0 = 2; + gActors[9].dmgType = 2; } break; } @@ -2307,9 +2307,9 @@ void Solar_801A5B3C(Boss* bossSO) { Radio_PlayMessage(gMsg_ID_10320, RCID_PEPPY); } if (bossSO->health != 0) { - Math_SmoothStepToF(&bossSO->obj.pos.z, gPlayer[0].unk_138 - bossSO->fwork[SO_FWK_3], 1.0f, 60.0f, 1.0f); + Math_SmoothStepToF(&bossSO->obj.pos.z, gPlayer[0].trueZpos - bossSO->fwork[SO_FWK_3], 1.0f, 60.0f, 1.0f); } else { - Math_SmoothStepToF(&bossSO->obj.pos.z, -(D_ctx_80177D20 + 2600.0f), 1.0f, 40.0f, 1.0f); + Math_SmoothStepToF(&bossSO->obj.pos.z, -(gPathProgress + 2600.0f), 1.0f, 40.0f, 1.0f); } if (bossSO->swork[SO_SWK_2] != 0) { bossSO->info.hitbox[7] = bossSO->fwork[SO_FWK_12] - bossSO->obj.pos.z; @@ -2714,7 +2714,7 @@ void Solar_801A71B8(Boss* bossSO) { gDPSetEnvColor(gMasterDisp++, 255, 192, 0, 255); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, bossSO->obj.pos.x, bossSO->obj.pos.y, bossSO->obj.pos.z - 500.0f + D_ctx_80177D20, + Matrix_Translate(gGfxMatrix, bossSO->obj.pos.x, bossSO->obj.pos.y, bossSO->obj.pos.z - 500.0f + gPathProgress, MTXF_APPLY); Matrix_Scale(gGfxMatrix, D_i3_801C2768[3], D_i3_801C2768[2], 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -2723,7 +2723,7 @@ void Solar_801A71B8(Boss* bossSO) { Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, bossSO->obj.pos.x + spE8[i].x, bossSO->obj.pos.y + spE8[i].y, - bossSO->obj.pos.z + D_ctx_80177D20 + spE8[i].z, MTXF_APPLY); + bossSO->obj.pos.z + gPathProgress + spE8[i].z, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, spC4[i] * M_DTOR, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, spA0[i] * M_DTOR, MTXF_APPLY); Matrix_Scale(gGfxMatrix, D_i3_801C2768[4 + i], 100.0f, 1.0f, MTXF_APPLY); @@ -2735,7 +2735,7 @@ void Solar_801A71B8(Boss* bossSO) { Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, bossSO->obj.pos.x, bossSO->obj.pos.y + 230.0f, - bossSO->obj.pos.z - 300.0f + D_ctx_80177D20, MTXF_APPLY); + bossSO->obj.pos.z - 300.0f + gPathProgress, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, M_DTOR * 5.0f, MTXF_APPLY); Matrix_Scale(gGfxMatrix, D_i3_801C2768[13], 1.0f, D_i3_801C2768[13], MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -2746,7 +2746,7 @@ void Solar_801A71B8(Boss* bossSO) { Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, bossSO->obj.pos.x, bossSO->obj.pos.y + 270.0f, - (bossSO->obj.pos.z - 300.0f) + D_ctx_80177D20, MTXF_APPLY); + (bossSO->obj.pos.z - 300.0f) + gPathProgress, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, -3.0f * M_DTOR, MTXF_APPLY); Matrix_Scale(gGfxMatrix, D_i3_801C2768[13], 1.0f, D_i3_801C2768[13], MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -2788,7 +2788,7 @@ void Solar_801A7750(void) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = D_i3_801BFB30[i].x / 2.0f + gPlayer[0].pos.x; actor->obj.pos.y = D_i3_801BFB30[i].y + gPlayer[0].pos.y; @@ -2810,14 +2810,14 @@ void Solar_LevelComplete(Player* player) { Vec3f sp54; Boss* bossSO = &gBosses[0]; - switch (player->unk_1D0) { + switch (player->csState) { case 0: gCsFrameCount = 0; - player->camRoll = player->unk_4D8 = 0.0f; + player->camRoll = player->aerobaticPitch = 0.0f; player->baseSpeed = 40.0f; player->wings.unk_04 = player->wings.unk_0C = player->wings.unk_08 = player->wings.unk_10 = - player->unk_130 = player->unk_12C = player->boostSpeed = 0.0f; + player->zRotBarrelRoll = player->zRotBank = player->boostSpeed = 0.0f; player->unk_234 = 1; gCsCamEyeX = player->cam.eye.x; gCsCamEyeY = player->cam.eye.y; @@ -2833,7 +2833,7 @@ void Solar_LevelComplete(Player* player) { Object_Kill(&gActors[2].obj, gActors[2].sfxSource); Object_Kill(&gActors[3].obj, gActors[3].sfxSource); Object_Kill(&gActors[4].obj, gActors[4].sfxSource); - player->unk_1D0 = 1; + player->csState = 1; D_ctx_80177A48[0] = 0.1f; if (Rand_ZeroOne() > 0.5f) { D_ctx_80177A48[9] = -1.0f; @@ -2842,28 +2842,28 @@ void Solar_LevelComplete(Player* player) { } break; case 1: - D_ctx_80177CE8 += 30.0f; - Math_SmoothStepToF(&player->unk_0E4, 0.0f, 0.1f, 5.0f, 0.0f); + gPathTexScroll += 30.0f; + Math_SmoothStepToF(&player->rot.x, 0.0f, 0.1f, 5.0f, 0.0f); Math_SmoothStepToF(&player->pos.y, 200.0f, 0.05f, 10.0f, 0.0f); dx = player->pos.x - bossSO->obj.pos.x; dz = (player->pos.z - bossSO->obj.pos.z) * 0.05f; sp78 = Math_RadToDeg(-Math_Atan2F(dx, dz)); Math_SmoothStepToF(&gCsCamEyeY, 300.0f, 1.0f, 20.0f, 0.0f); Math_SmoothStepToF(&gCsCamAtY, 290.0f, 1.0f, 20.0f, 0.0f); - sp74 = Math_SmoothStepToAngle(&player->unk_0E8, sp78, 0.5f, 2.0f, 0.0001f) * 30.0f; + sp74 = Math_SmoothStepToAngle(&player->rot.y, sp78, 0.5f, 2.0f, 0.0001f) * 30.0f; if (gCsFrameCount >= 14) { - Math_SmoothStepToAngle(&player->unk_0EC, sp74, 0.1f, 5.0f, 0.0001f); + Math_SmoothStepToAngle(&player->rot.z, sp74, 0.1f, 5.0f, 0.0001f); gCsCamAtX = 0.0f; gCsCamEyeX = 0.0f; } else if (sp74 < 0.0f) { - player->unk_0EC -= 30.0f; + player->rot.z -= 30.0f; } else { - player->unk_0EC += 30.0f; + player->rot.z += 30.0f; } if (gCsFrameCount >= 200) { - player->unk_0E4 += 1.0f; - player->unk_0E8 += 1.0f; - player->unk_0EC += 1.0f; + player->rot.x += 1.0f; + player->rot.y += 1.0f; + player->rot.z += 1.0f; } if (gCsFrameCount >= 230) { gFillScreenAlphaTarget = 255; @@ -2874,25 +2874,25 @@ void Solar_LevelComplete(Player* player) { SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50); } if (gCsFrameCount == 400) { - player->unk_1D0++; + player->csState++; Play_ClearObjectData(); Audio_StopPlayerNoise(0); Audio_KillSfxBySource(player->sfxSource); gFillScreenAlpha = 250; - player->timer_1F8 = 20; + player->csTimer = 20; player->baseSpeed = 0.0f; - player->unk_0E4 = 0.0f; - player->unk_0E8 = 0.0f; - player->unk_0EC = 0.0f; + player->rot.x = 0.0f; + player->rot.y = 0.0f; + player->rot.z = 0.0f; } break; case 2: - D_ctx_80177CE8 += 60.0f; - if (player->timer_1F8 == 0) { + gPathTexScroll += 60.0f; + if (player->csTimer == 0) { player->pos.x = 0.0f; player->pos.y = 200.0f; - player->pos.z = -(D_ctx_80177D20 - 500.0f); - player->unk_1D0++; + player->pos.z = -(gPathProgress - 500.0f); + player->csState++; player->wings.modelId = 1; Audio_StartPlayerNoise(0); AUDIO_PLAY_BGM(SEQ_ID_GOOD_END); @@ -2902,18 +2902,18 @@ void Solar_LevelComplete(Player* player) { D_ctx_80177A48[2] = 0.0f; player->cam.eye.x = 0.0f; player->cam.eye.y = player->pos.y + 80.0f; - player->cam.eye.z = player->pos.z + D_ctx_80177D20 - 4000.0f; - gCsCamEyeZ = player->pos.z + D_ctx_80177D20 - 4900.0f; + player->cam.eye.z = player->pos.z + gPathProgress - 4000.0f; + gCsCamEyeZ = player->pos.z + gPathProgress - 4900.0f; player->cam.at.x = gCsCamAtX = 0.0f; player->cam.at.y = gCsCamAtY = 200.0f; - player->cam.at.z = gCsCamAtZ = player->pos.z + D_ctx_80177D20; + player->cam.at.z = gCsCamAtZ = player->pos.z + gPathProgress; D_ctx_80177A48[0] = 0.0f; Object_Kill(&gActors[4].obj, gActors[4].sfxSource); Object_Kill(&gActors[5].obj, gActors[5].sfxSource); } break; case 3: - D_ctx_80177CE8 += 60.0f; + gPathTexScroll += 60.0f; gFillScreenAlphaTarget = 0; gFillScreenAlphaStep = 4; if (gMsgCharIsPrinting) { @@ -2921,10 +2921,10 @@ void Solar_LevelComplete(Player* player) { } switch (gCsFrameCount) { case 450: - Solar_801A0DF8(-1200.0f, -(D_ctx_80177D20 + 2500.0f), 90.0f, 2, 1.0f); + Solar_801A0DF8(-1200.0f, -(gPathProgress + 2500.0f), 90.0f, 2, 1.0f); break; case 545: - Solar_801A0DF8(1400.0f, -(D_ctx_80177D20 + 3250.0f), -90.0f, 3, 1.0f); + Solar_801A0DF8(1400.0f, -(gPathProgress + 3250.0f), -90.0f, 3, 1.0f); break; case 550: Object_Kill(&gActors[4].obj, gActors[4].sfxSource); @@ -2933,7 +2933,7 @@ void Solar_LevelComplete(Player* player) { Object_Kill(&gActors[5].obj, gActors[5].sfxSource); break; case 700: - player->unk_1D0++; + player->csState++; Solar_801A7750(); D_i3_801C2768[3] = 1000.0f; break; @@ -2942,19 +2942,19 @@ void Solar_LevelComplete(Player* player) { Math_SmoothStepToF(&player->pos.x, 400.0f, 0.1f, 10.0f, 0.1f); } if ((gCsFrameCount >= 520) && (gCsFrameCount < 570)) { - Math_SmoothStepToAngle(&player->unk_0EC, -30.0f, 0.1f, 5.0f, 0.1f); + Math_SmoothStepToAngle(&player->rot.z, -30.0f, 0.1f, 5.0f, 0.1f); } if ((gCsFrameCount >= 570) && (gCsFrameCount < 605)) { - Math_SmoothStepToAngle(&player->unk_0EC, 0.0f, 0.1f, 5.0f, 0.1f); + Math_SmoothStepToAngle(&player->rot.z, 0.0f, 0.1f, 5.0f, 0.1f); } if ((gCsFrameCount >= 605) && (gCsFrameCount < 620)) { - player->unk_0EC += 30.0f; + player->rot.z += 30.0f; } if ((gCsFrameCount >= 620) && (gCsFrameCount < 640)) { - Math_SmoothStepToAngle(&player->unk_0EC, 45.0f, 0.1f, 5.0f, 0.0f); + Math_SmoothStepToAngle(&player->rot.z, 45.0f, 0.1f, 5.0f, 0.0f); } if (gCsFrameCount >= 640) { - Math_SmoothStepToAngle(&player->unk_0EC, 0.0f, 0.3f, 7.0f, 0.0f); + Math_SmoothStepToAngle(&player->rot.z, 0.0f, 0.3f, 7.0f, 0.0f); } if (gCsFrameCount >= 585) { Math_SmoothStepToF(&player->pos.x, 0.0f, 0.2f, 9.0f, 0); @@ -2962,18 +2962,18 @@ void Solar_LevelComplete(Player* player) { if (gCsFrameCount >= 600) { Math_SmoothStepToF(&player->pos.y, 950.0f, 0.1f, 10.0f, 0.0001f); } - Math_SmoothStepToF(&player->pos.z, -(D_ctx_80177D20 + 4350.0f), 1.0f, 20.0f, 0.0001f); + Math_SmoothStepToF(&player->pos.z, -(gPathProgress + 4350.0f), 1.0f, 20.0f, 0.0001f); if (gCsFrameCount >= 620) { Math_SmoothStepToF(&player->cam.eye.x, 0.0f, 1.0f, 10.0f, 0); Math_SmoothStepToF(&player->cam.eye.y, player->pos.y + 52.0f, 1.0f, 16.0f, 0.0f); - Math_SmoothStepToF(&player->cam.eye.z, (player->pos.z + D_ctx_80177D20) - 50.0f, 1.0f, 21.5f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.z, (player->pos.z + gPathProgress) - 50.0f, 1.0f, 21.5f, 0.0f); } player->cam.at.x = gCsCamAtX = player->pos.x; player->cam.at.y = gCsCamAtY = player->pos.y; - player->cam.at.z = gCsCamAtZ = player->pos.z + D_ctx_80177D20; + player->cam.at.z = gCsCamAtZ = player->pos.z + gPathProgress; break; case 4: - D_ctx_80177CE8 += 60.0f; + gPathTexScroll += 60.0f; gFillScreenAlphaTarget = 0; gFillScreenAlphaStep = 4; D_ctx_80177A48[1] += D_ctx_80177A48[2] * 0.8f; @@ -2985,11 +2985,11 @@ void Solar_LevelComplete(Player* player) { if (gCsFrameCount < 1440) { gCsCamEyeX = sp54.x; gCsCamEyeY = D_i3_801C2768[3] + sp54.y; - gCsCamEyeZ = player->pos.z + D_ctx_80177D20 + sp54.z; + gCsCamEyeZ = player->pos.z + gPathProgress + sp54.z; gCsCamAtX = 0.0f; gCsCamAtY = player->pos.y + 75.0f; Math_SmoothStepToF(&D_i3_801C2768[3], 500.0f, 0.1f, 1.0f, 0.0001f); - gCsCamAtZ = player->pos.z + D_ctx_80177D20 + 200.0f; + gCsCamAtZ = player->pos.z + gPathProgress + 200.0f; if (gCsFrameCount >= 1400) { gCsCamAtZ -= (gCsFrameCount * 8) - 11200; } @@ -2997,11 +2997,11 @@ void Solar_LevelComplete(Player* player) { Math_SmoothStepToF(&gCsCamEyeX, 0.0f, 0.1f, 1.0f, 0.0001f); gCsCamAtX = 0.0f; gCsCamAtY = player->pos.y + 75.0f; - gCsCamAtZ = player->pos.z + D_ctx_80177D20 + 200.0f - ((gCsFrameCount * 8) - 11200); + gCsCamAtZ = player->pos.z + gPathProgress + 200.0f - ((gCsFrameCount * 8) - 11200); } if (gCsFrameCount > 1460) { player->baseSpeed += 2.0f; - player->unk_0E4 += 0.2f; + player->rot.x += 0.2f; Math_SmoothStepToF(&D_ctx_80177A48[2], 0.0f, 1.0f, 0.001f, 0); player->unk_190 = 2.0f; } else { @@ -3019,7 +3019,7 @@ void Solar_LevelComplete(Player* player) { Audio_StopPlayerNoise(0); Audio_FadeOutAll(10); player->state_1C8 = PLAYERSTATE_1C8_NEXT; - player->timer_1F8 = 0; + player->csTimer = 0; gFadeoutType = 4; gLeveLClearStatus[LEVEL_SOLAR] = Play_CheckMedalStatus(100) + 1; } @@ -3102,8 +3102,8 @@ void Solar_LevelComplete(Player* player) { } break; } - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4) * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->xRot_120 + player->rot.x) * M_DTOR), MTXF_APPLY); sp60.x = 0.0f; sp60.y = 0.0f; sp60.z = player->baseSpeed; @@ -3116,18 +3116,18 @@ void Solar_LevelComplete(Player* player) { player->pos.y += player->vel.y; player->pos.z += player->vel.z; - player->unk_138 = player->pos.z; - player->unk_0F8 = player->unk_0EC; + player->trueZpos = player->pos.z; + player->bankAngle = player->rot.z; Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0.0f); Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0.0f); Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0.0f); Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0.0f); Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0.0f); Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0.0f); - player->unk_088 += 10.0f; - player->unk_080 = -SIN_DEG(player->unk_088) * 0.3f; - player->unk_0F4 += 8.0f; - player->unk_0F0 = SIN_DEG(player->unk_0F4); + player->bobPhase += 10.0f; + player->yBob = -SIN_DEG(player->bobPhase) * 0.3f; + player->rockPhase += 8.0f; + player->rockAngle = SIN_DEG(player->rockPhase); } void Solar_801A8BE8(Actor* actor) { diff --git a/src/overlays/ovl_i3/fox_zo.c b/src/overlays/ovl_i3/fox_zo.c index e05946dd..11c31548 100644 --- a/src/overlays/ovl_i3/fox_zo.c +++ b/src/overlays/ovl_i3/fox_zo.c @@ -92,9 +92,9 @@ void Zoness_8019962C(Boss* bossZO, f32 arg1); // /* 232 */ char padE8[8]; // /* 240 */ Vec3f unk_F0; // /* 252 */ char padFC[8]; -// /* 260 */ Vec3f unk_104; +// /* 260 */ Vec3f rot_104.x; // /* 272 */ Vec3f boostSpeed; -// /* 284 */ Vec3f unk_11C; +// /* 284 */ Vec3f yRotVel_11C; // /* 296 */ char pad128[76]; // /* 372 */ Vec3f unk_174; // /* 384 */ Vec3f unk_180; @@ -539,8 +539,8 @@ void Zoness_8018FF50(Actor* actor) { (void) " Enm->hitNO %d\n"; // Unclear where this goes. hitNO can't be info.bonus. Damage related? actor->obj.rot.y = RAD_TO_DEG(Math_Atan2F(gPlayer[0].cam.eye.x - actor->obj.pos.x, - gPlayer[0].cam.eye.z - (actor->obj.pos.z + D_ctx_80177D20))); - temp = sqrtf(SQ(gPlayer[0].cam.eye.z - (actor->obj.pos.z + D_ctx_80177D20)) + + gPlayer[0].cam.eye.z - (actor->obj.pos.z + gPathProgress))); + temp = sqrtf(SQ(gPlayer[0].cam.eye.z - (actor->obj.pos.z + gPathProgress)) + SQ(gPlayer[0].cam.eye.x - actor->obj.pos.x)); actor->obj.rot.x = RAD_TO_DEG(-Math_Atan2F(gPlayer[0].cam.eye.y - actor->obj.pos.y, temp)); } @@ -680,8 +680,8 @@ void Zoness_801904CC(Actor* actor) { if (Animation_GetFrameCount(&D_ZO_600E5EC) < actor->unk_0B6) { actor->unk_0B6 = 0; } - if ((actor->unk_0D0 != 0) && (actor->health != 0)) { - actor->unk_0D0 = 0; + if ((actor->dmgType != 0) && (actor->health != 0)) { + actor->dmgType = 0; if (actor->state > 0) { actor->timer_0C6 = 15; actor->health -= actor->damage; @@ -757,8 +757,8 @@ void Zoness_80190A00(Actor* actor) { actor->timer_0C0 = 30; } Zoness_80190790(actor); - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; + if (actor->dmgType != 0) { + actor->dmgType = 0; AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); } } @@ -773,7 +773,7 @@ Gfx* D_i3_801BF5A8[3] = { D_ZO_60012A0, D_ZO_60239E0, D_ZO_6023730 }; void Zoness_80190B4C(f32 xPos, f32 yPos, f32 zPos, f32 xRot, f32 yRot, f32 zRot, u8 arg6, s32 arg7) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, xPos, yPos, zPos + D_ctx_80177D20, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, xPos, yPos, zPos + gPathProgress, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, M_DTOR * yRot, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, M_DTOR * xRot, MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, M_DTOR * zRot, MTXF_APPLY); @@ -919,8 +919,8 @@ void Zoness_80191010(Actor* actor) { func_effect_8007A6F0(&actor->obj.pos, 0x29018036); break; } - if ((actor->unk_0D0 != 0) && (actor->health != 0)) { - actor->unk_0D0 = 0; + if ((actor->dmgType != 0) && (actor->health != 0)) { + actor->dmgType = 0; actor->timer_0C6 = 15; actor->health -= actor->damage; if (actor->health <= 0) { @@ -978,8 +978,8 @@ void Zoness_80191680(Actor* actor) { if (actor->obj.pos.z < actor->fwork[0]) { actor->state = 1; } - if ((actor->unk_0D0 != 0) && (actor->health != 0)) { - actor->unk_0D0 = 0; + if ((actor->dmgType != 0) && (actor->health != 0)) { + actor->dmgType = 0; actor->timer_0C6 = 15; actor->health -= actor->damage; AUDIO_PLAY_SFX(0x29033037, actor->sfxSource, 4); @@ -998,7 +998,7 @@ void Zoness_80191680(Actor* actor) { actor->timer_0BC = 30; actor->fwork[1] = gPlayer[0].pos.x + RAND_FLOAT_CENTERED(1000.0f); actor->fwork[2] = gPlayer[0].pos.y + 50.0f + RAND_FLOAT(200.0f); - actor->fwork[3] = gPlayer[0].unk_138 - 1500.0f; + actor->fwork[3] = gPlayer[0].trueZpos - 1500.0f; } actor->fwork[3] += gPlayer[0].vel.z; sp64 = actor->fwork[1] - actor->obj.pos.x; @@ -1008,7 +1008,7 @@ void Zoness_80191680(Actor* actor) { otherActor = &gActors[actor->iwork[0]]; if ((actor->state != 0) || (otherActor->obj.status == OBJ_FREE)) { actor->lockOnTimers[TEAM_ID_FOX] = 0; - actor->info.unk_1C = 0.0f; + actor->info.targetOffset = 0.0f; sp54 += 180.0f; if (sp54 > 360.0f) { sp54 -= 360.0f; @@ -1151,7 +1151,7 @@ void Zoness_80192094(Actor* actor) { temp_fs0 = gPlayer[0].pos.x - actor->obj.pos.x; spB0 = gPlayer[0].pos.y - actor->obj.pos.y; - temp_fs1 = gPlayer[0].unk_138 - actor->obj.pos.z; + temp_fs1 = gPlayer[0].trueZpos - actor->obj.pos.z; spA4 = Math_RadToDeg(Math_Atan2F(temp_fs0, temp_fs1)); temp_fs0_2 = sqrtf(SQ(temp_fs0) + SQ(temp_fs1)); temp_fs0_2 = Math_RadToDeg(-Math_Atan2F(spB0, temp_fs0_2)); @@ -1245,14 +1245,14 @@ void Zoness_80192094(Actor* actor) { func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 10.0f); break; } - if ((actor->unk_0D0 != 0) && (actor->state < 3)) { - if (actor->unk_0D0 != 1) { + if ((actor->dmgType != 0) && (actor->state < 3)) { + if (actor->dmgType != 1) { BonusText_Display(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + 200.0f, 5); gHitCount += 6; D_ctx_80177850 = 15; actor->state = 4; } - actor->unk_0D0 = 0; + actor->dmgType = 0; } } @@ -1326,8 +1326,8 @@ void Zoness_80192834(Actor* actor) { } actor->obj.rot.x += 20.0f; actor->obj.rot.x = Math_ModF(actor->obj.rot.x, 360.0f); - if ((actor->unk_0D0 != 0) && (actor->health != 0)) { - actor->unk_0D0 = 0; + if ((actor->dmgType != 0) && (actor->health != 0)) { + actor->dmgType = 0; actor->health -= actor->damage; if (actor->health <= 0) { actor->health = 0; @@ -1463,8 +1463,8 @@ void Zoness_80192E64(Actor* actor) { func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 10.0f); break; } - if (actor->unk_0D0 != 0) { - if (actor->unk_0D0 != 1) { + if (actor->dmgType != 0) { + if (actor->dmgType != 1) { if ((actor->state != 0) && (actor->state != 3)) { BonusText_Display(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + 200.0f, 2); gHitCount += 3; @@ -1474,7 +1474,7 @@ void Zoness_80192E64(Actor* actor) { } else { AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); } - actor->unk_0D0 = 0; + actor->dmgType = 0; } if (func_play_800A73E4(&sp70, &sp6C, actor->obj.pos.x, actor->obj.pos.y - 1000.0f, actor->obj.pos.z)) { Math_SmoothStepToF(&actor->obj.pos.y, sp70 + 300.0f, 0.1f, 20.0f, 0); @@ -2035,7 +2035,7 @@ void Zoness_80194A84(Boss* bossZO) { } if (sZoSwork[ZO_BSS_24] == 0) { Math_SmoothStepToF(&sZoFwork[ZO_BSF_27], sZoFwork[ZO_BSF_26], 0.1f, 2.0f, 0.00001f); - Math_SmoothStepToF(&bossZO->obj.pos.z, gPlayer[0].cam.eye.z - D_ctx_80177D20 + sZoFwork[ZO_BSF_28], 0.1f, + Math_SmoothStepToF(&bossZO->obj.pos.z, gPlayer[0].cam.eye.z - gPathProgress + sZoFwork[ZO_BSF_28], 0.1f, sZoFwork[ZO_BSF_27], 0.00001f); } if ((gGameFrameCount % 4U) == 0) { @@ -2067,7 +2067,7 @@ void Zoness_80194A84(Boss* bossZO) { sZoSwork[ZO_BSS_43] = 255; } } - if (((bossZO->state == 2) || (bossZO->state == 3) || (bossZO->state == 8)) && (gPlayer[0].timer_220 == 2)) { + if (((bossZO->state == 2) || (bossZO->state == 3) || (bossZO->state == 8)) && (gPlayer[0].radioDamageTimer == 2)) { if (bossZO->swork[ZO_SWK_8] == 0) { Radio_PlayMessage(gMsg_ID_6068, RCID_BOSS_ZONESS); } @@ -2272,7 +2272,7 @@ void Zoness_80194A84(Boss* bossZO) { bossZO->fwork[ZO_FWK_5] += 4.0f; bossZO->vel.x = COS_DEG(bossZO->fwork[ZO_FWK_5]) * 40.0f; padF4 = Math_Atan2F(bossZO->fwork[ZO_FWK_6] - bossZO->obj.pos.x, - gPlayer[0].cam.eye.z - D_ctx_80177D20 + D_i3_801BF6BC[bossZO->swork[ZO_SWK_1]] - + gPlayer[0].cam.eye.z - gPathProgress + D_i3_801BF6BC[bossZO->swork[ZO_SWK_1]] - bossZO->obj.pos.z); padF4 = Math_RadToDeg(padF4); Math_SmoothStepToAngle(&bossZO->fwork[ZO_FWK_7], padF4, 0.1f, 100.0f, 0.001f); @@ -2281,7 +2281,7 @@ void Zoness_80194A84(Boss* bossZO) { spE4.z = 20.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &spE4, &spCC); var_s0 = 0; - bossZO->vel.z = spCC.z - D_ctx_80177D08; + bossZO->vel.z = spCC.z - gPathVelZ; if (bossZO->vel.x > 0.0f) { var_s0 = 1; } @@ -2298,7 +2298,7 @@ void Zoness_80194A84(Boss* bossZO) { Matrix_RotateY(gCalcMatrix, -bossZO->obj.rot.y * M_DTOR, MTXF_APPLY); spE4.x = gPlayer[0].pos.x - sZoFwork[ZO_BSF_93_X]; spE4.y = gPlayer[0].pos.y - sZoFwork[ZO_BSF_93_Y]; - spE4.z = gPlayer[0].unk_138 - sZoFwork[ZO_BSF_93_Z]; + spE4.z = gPlayer[0].trueZpos - sZoFwork[ZO_BSF_93_Z]; Matrix_MultVec3f(gCalcMatrix, &spE4, &spC0); sp10C = Math_Atan2F(spC0.x, spC0.z); sp10C = Math_RadToDeg(sp10C); @@ -2318,7 +2318,7 @@ void Zoness_80194A84(Boss* bossZO) { } spE4.x = gPlayer[0].pos.x - sZoFwork[ZO_BSF_96_X]; spE4.y = gPlayer[0].pos.y - sZoFwork[ZO_BSF_96_Y]; - spE4.z = gPlayer[0].unk_138 - sZoFwork[ZO_BSF_96_Z]; + spE4.z = gPlayer[0].trueZpos - sZoFwork[ZO_BSF_96_Z]; Matrix_MultVec3f(gCalcMatrix, &spE4, &spB4); sp104 = Math_Atan2F(spB4.x, spB4.z); sp104 = Math_RadToDeg(sp104); @@ -2496,15 +2496,15 @@ void Zoness_80194A84(Boss* bossZO) { (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) { gCsFrameCount = 0; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; - gPlayer[0].unk_1D0 = gPlayer[0].timer_1F8 = 0; - gPlayer[0].unk_0E8 += gPlayer[0].unk_114; - if (gPlayer[0].unk_0E8 > 360.0f) { - gPlayer[0].unk_0E8 -= 360.0f; + gPlayer[0].csState = gPlayer[0].csTimer = 0; + gPlayer[0].rot.y += gPlayer[0].yRot_114; + if (gPlayer[0].rot.y > 360.0f) { + gPlayer[0].rot.y -= 360.0f; } - if (gPlayer[0].unk_0E8 < 0.0f) { - gPlayer[0].unk_0E8 += 360.0f; + if (gPlayer[0].rot.y < 0.0f) { + gPlayer[0].rot.y += 360.0f; } - gPlayer[0].unk_114 = 0.0f; + gPlayer[0].yRot_114 = 0.0f; Boss_CompleteLevel(&gPlayer[0], bossZO->obj.pos.x, 0.0f, bossZO->obj.pos.z); } bossZO->timer_050 = 70; @@ -2596,7 +2596,7 @@ void Zoness_80194A84(Boss* bossZO) { } sZoFwork[ZO_BSF_2] += 20.0f; spE4.x = gPlayer[0].pos.x - bossZO->obj.pos.x; - spE4.z = gPlayer[0].unk_138 - bossZO->obj.pos.z; + spE4.z = gPlayer[0].trueZpos - bossZO->obj.pos.z; Math_SmoothStepToAngle(&sZoFwork[ZO_BSF_14], Math_RadToDeg(Math_Atan2F(spE4.x, spE4.z)), 0.5f, 100.0f, 0.001f); Math_SmoothStepToAngle(&sZoFwork[ZO_BSF_0], sZoFwork[ZO_BSF_76], 0.2f, 4.0f, 0.0001f); if ((((gGameFrameCount % 64) == 0) || (sZoSwork[ZO_BSS_22] != 0)) && @@ -2612,7 +2612,7 @@ void Zoness_80194A84(Boss* bossZO) { } } spE4.x = gPlayer[0].pos.x - sZoFwork[ZO_BSF_65_X]; - spE4.z = gPlayer[0].unk_138 - sZoFwork[ZO_BSF_65_Z]; + spE4.z = gPlayer[0].trueZpos - sZoFwork[ZO_BSF_65_Z]; Math_SmoothStepToAngle(&sZoFwork[ZO_BSF_19], Math_RadToDeg(Math_Atan2F(spE4.x, spE4.z)), 0.1f, 5.0f, 0.0f); if ((bossZO->state >= 3) && (bossZO->state < 6)) { Matrix_RotateY(gCalcMatrix, bossZO->obj.rot.y * M_DTOR, MTXF_NEW); @@ -2625,7 +2625,7 @@ void Zoness_80194A84(Boss* bossZO) { Matrix_RotateY(gCalcMatrix, -bossZO->obj.rot.y * M_DTOR, MTXF_APPLY); spE4.x = gPlayer[0].pos.x - (bossZO->obj.pos.x + spD8.x); spE4.y = gPlayer[0].pos.y - (bossZO->obj.pos.y + spD8.y); - spE4.z = gPlayer[0].unk_138 - (bossZO->obj.pos.z + spD8.z); + spE4.z = gPlayer[0].trueZpos - (bossZO->obj.pos.z + spD8.z); Matrix_MultVec3f(gCalcMatrix, &spE4, &spD8); sp11C = Math_Atan2F(spD8.x, spD8.z); sp11C = Math_RadToDeg(sp11C); @@ -2633,7 +2633,7 @@ void Zoness_80194A84(Boss* bossZO) { sp120 = Math_RadToDeg(-sp120); spE4.x = gPlayer[0].pos.x - (bossZO->obj.pos.x + spCC.x); spE4.y = gPlayer[0].pos.y - (bossZO->obj.pos.y + spCC.y); - spE4.z = gPlayer[0].unk_138 - (bossZO->obj.pos.z + spCC.z); + spE4.z = gPlayer[0].trueZpos - (bossZO->obj.pos.z + spCC.z); Matrix_MultVec3f(gCalcMatrix, &spE4, &spCC); sp114 = Math_Atan2F(spCC.x, spCC.z); sp114 = Math_RadToDeg(sp114); @@ -3184,7 +3184,7 @@ void Zoness_80198BE8(Boss* bossZO, s32 arg1) { Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp3C, &sp30); effect->vel.x = sp30.x; effect->vel.y = sp30.y; - effect->vel.z = sp30.z - D_ctx_80177D08; + effect->vel.z = sp30.z - gPathVelZ; Object_SetInfo(&effect->info, effect->obj.id); break; } @@ -3336,7 +3336,7 @@ void Zoness_8019962C(Boss* bossZO, f32 arg1) { void Zoness_8019969C(Actor* actor) { s32 i; - if ((actor->unk_0D0 != 0) && (actor->health != 0)) { + if ((actor->dmgType != 0) && (actor->health != 0)) { actor->health -= actor->damage; if (actor->health <= 0) { actor->health = 0; @@ -3347,13 +3347,13 @@ void Zoness_8019969C(Actor* actor) { } func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + 200.0f, 5.0f); actor->itemDrop = DROP_BOMB; - actor->unk_0D4 = 2; + actor->dmgSource = 2; actor->obj.pos.z -= 100.0f; Actor_Despawn(actor); Object_Kill(&actor->obj, actor->sfxSource); func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); } - actor->unk_0D0 = 0; + actor->dmgType = 0; } actor->fwork[0] += 10.0f; Zoness_8018FF50(actor); @@ -3444,17 +3444,17 @@ void Zoness_80199A28(Actor* actor) { } Math_SmoothStepToAngle(&actor->obj.rot.z, sp38, 0.1f, 1.0f, 0); } - if ((actor->unk_0D0 != 0) && (actor->health != 0)) { - actor->unk_0D0 = 0; + if ((actor->dmgType != 0) && (actor->health != 0)) { + actor->dmgType = 0; actor->itemDrop = DROP_SILVER_RING_50p; func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y + 100.0f, actor->obj.pos.z, 7.0f); - actor->unk_0D4 = 2; + actor->dmgSource = 2; actor->obj.pos.y += 200.0f; Actor_Despawn(actor); Object_Kill(&actor->obj, actor->sfxSource); func_effect_8007A6F0(&actor->obj.pos, 0x1903400F); } else { - if ((fabsf(actor->obj.pos.z - gPlayer[0].unk_138) < 800.0f) || (actor->unk_0D0 != 0)) { + if ((fabsf(actor->obj.pos.z - gPlayer[0].trueZpos) < 800.0f) || (actor->dmgType != 0)) { Zoness_801999CC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z); Object_Kill(&actor->obj, actor->sfxSource); func_effect_8007A6F0(&actor->obj.pos, 0x2903B009); @@ -3465,7 +3465,7 @@ void Zoness_80199A28(Actor* actor) { if ((actor->timer_0BC == 0) && (actor->iwork[0] == 0)) { func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y + 100.0f, actor->obj.pos.z, 7.0f); actor->itemDrop = DROP_SILVER_RING_50p; - actor->unk_0D4 = 2; + actor->dmgSource = 2; actor->obj.pos.y += 200.0f; Actor_Despawn(actor); Object_Kill(&actor->obj, actor->sfxSource); @@ -3540,11 +3540,11 @@ void Zoness_80199F10(Actor* actor) { } break; } - if (actor->unk_0D0 != 0) { - if (actor->unk_0D0 == 1) { + if (actor->dmgType != 0) { + if (actor->dmgType == 1) { AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); } - actor->unk_0D0 = 0; + actor->dmgType = 0; } } @@ -3635,7 +3635,7 @@ void Zoness_8019A5D4(Actor* actor) { var_fa0 = 100.0f; } Zoness_8019A4E0(actor, gPlayer[0].pos.x + var_fv1, gPlayer[0].pos.y + var_fa0, gPlayer[0].pos.z, 80.0f); - actor->vel.z -= D_ctx_80177D08; + actor->vel.z -= gPathVelZ; Zoness_80193C5C(sZoFwork[ZO_BSF_65_X], sZoFwork[ZO_BSF_65_Y], sZoFwork[ZO_BSF_65_Z], 30.0f); Zoness_80193C5C(sZoFwork[ZO_BSF_65_X], sZoFwork[ZO_BSF_65_Y], sZoFwork[ZO_BSF_65_Z], 30.0f); Zoness_80193C5C(sZoFwork[ZO_BSF_65_X], sZoFwork[ZO_BSF_65_Y], sZoFwork[ZO_BSF_65_Z], 30.0f); @@ -3653,7 +3653,7 @@ void Zoness_8019A5D4(Actor* actor) { actor->iwork[0] = 0; if (actor->timer_0BC == 0) { actor->vel.x = 0.0f; - actor->vel.z = -D_ctx_80177D08; + actor->vel.z = -gPathVelZ; actor->gravity = 5.0f; actor->fwork[5] = actor->vel.y * -3.0f; if (actor->obj.pos.y < -150.0f) { @@ -3677,7 +3677,7 @@ void Zoness_8019A5D4(Actor* actor) { var_fa0 = sqrtf(SQ(sp4C) + SQ(sp48)) * 0.5f; Zoness_8019A4E0(actor, sZoFwork[ZO_BSF_65_X], sZoFwork[ZO_BSF_65_Y] - var_fa0, sZoFwork[ZO_BSF_65_Z], 30.0f); - actor->vel.z -= D_ctx_80177D08; + actor->vel.z -= gPathVelZ; } if (Object_CheckHitboxCollision(&actor->obj.pos, gBosses[0].info.hitbox, &gBosses[0].obj, 0.0f, 0.0f, 0.0f) != 0) { @@ -3702,11 +3702,11 @@ void Zoness_8019A5D4(Actor* actor) { break; } Zoness_8018FF50(actor); - if (actor->unk_0D0 != 0) { - if (actor->unk_0D0 == 1) { + if (actor->dmgType != 0) { + if (actor->dmgType == 1) { AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); } - actor->unk_0D0 = 0; + actor->dmgType = 0; } if (((gGameFrameCount % 8) == 0) && (actor->state != 0) && (actor->iwork[0] < 8) && (func_play_800A73E4(&sp44, &sp40, actor->obj.pos.x, actor->obj.pos.y - 100.0f, actor->obj.pos.z) != 0)) { @@ -3755,7 +3755,7 @@ void Zoness_8019ACCC(Actor* actor) { if (var_s4 < 0) { var_s4 = 0; } - Matrix_Translate(gGfxMatrix, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + D_ctx_80177D20, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + gPathProgress, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, temp_fs4, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, temp_fs0_2, MTXF_APPLY); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 0.0f, MTXF_APPLY); @@ -3780,7 +3780,7 @@ void Zoness_8019ACCC(Actor* actor) { } Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + D_ctx_80177D20, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + gPathProgress, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, actor->obj.rot.y * M_DTOR, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 2.6f, 2.6f, 2.6f, MTXF_APPLY); @@ -3913,7 +3913,7 @@ void Zoness_8019B548(Actor* actor) { } break; } - if ((fabsf(actor->obj.pos.z - gPlayer[0].unk_138) < 1000.0f) && + if ((fabsf(actor->obj.pos.z - gPlayer[0].trueZpos) < 1000.0f) && func_play_800A73E4(&sp6C, &sp68, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z)) { Math_SmoothStepToF(&actor->obj.pos.y, sp6C, 0.1f, 4.0f, 0.0f); } @@ -3945,8 +3945,8 @@ void Zoness_8019B854(Actor* actor) { Vec3f spA8 = { 0.0f, 0.0f, 0.0f }; Vec3f sp9C; - if ((actor->unk_0D0 != 0) && (actor->health != 0)) { - actor->unk_0D0 = 0; + if ((actor->dmgType != 0) && (actor->health != 0)) { + actor->dmgType = 0; actor->timer_0C6 = 15; actor->health -= actor->damage; AUDIO_PLAY_SFX(0x2903300E, actor->sfxSource, 4); @@ -4078,8 +4078,8 @@ void Zoness_8019BE48(Actor* actor) { actor->state++; break; case 1: - if ((actor->unk_0D0 != 0) && (actor->health != 0)) { - actor->unk_0D0 = 0; + if ((actor->dmgType != 0) && (actor->health != 0)) { + actor->dmgType = 0; actor->timer_0C6 = 15; actor->health -= actor->damage; if (actor->health <= 0) { @@ -4179,7 +4179,7 @@ void Zoness_8019C454(Actor* actor) { Vec3f sp34; Actor* otherActor; - if ((actor->fwork[0] == 30.0f) && (fabsf(actor->obj.pos.z - gPlayer[0].unk_138) < 2500.0f)) { + if ((actor->fwork[0] == 30.0f) && (fabsf(actor->obj.pos.z - gPlayer[0].trueZpos) < 2500.0f)) { Math_SmoothStepToAngle(&actor->fwork[6], 10.0f, 0.1f, 1.0f, 0.01f); Math_SmoothStepToAngle(&actor->obj.rot.y, actor->fwork[5], 1.0f, actor->fwork[6], 0.01f); if (actor->fwork[5] != actor->obj.rot.y) { @@ -4206,7 +4206,7 @@ void Zoness_8019C454(Actor* actor) { switch (actor->iwork[4]) { case 1: if ((actor->fwork[5] == actor->obj.rot.y) && - (fabsf(actor->obj.pos.z - gPlayer[0].unk_138) < 1000.0f)) { + (fabsf(actor->obj.pos.z - gPlayer[0].trueZpos) < 1000.0f)) { if (otherActor->obj.id == OBJ_ACTOR_251) { otherActor->gravity = 1.0f; } @@ -4408,9 +4408,9 @@ void Zoness_8019D15C(Actor* actor) { Actor* otherActor; if (actor->state == 0) { - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; - if (actor->unk_0D2 < 2) { + if (actor->dmgType != 0) { + actor->dmgType = 0; + if (actor->dmgPart < 2) { AUDIO_PLAY_SFX(0x1903001E, actor->sfxSource, 4); if ((actor->obj.pos.y + 268.0f) < actor->hitPos.y) { actor->fwork[1] = 20.0f; @@ -4469,11 +4469,11 @@ void Zoness_8019D3C4(Actor* actor) { void Zoness_LevelStart(Player* player) { s32 sp2C; - player->unk_088 += 10.0f; - player->unk_080 = -SIN_DEG(player->unk_088) * 0.5f; - player->unk_0F4 += 3.0f; - player->unk_0F0 = SIN_DEG(player->unk_0F4) * 1.5f; - switch (player->unk_1D0) { /* irregular */ + player->bobPhase += 10.0f; + player->yBob = -SIN_DEG(player->bobPhase) * 0.5f; + player->rockPhase += 3.0f; + player->rockAngle = SIN_DEG(player->rockPhase) * 1.5f; + switch (player->csState) { case 0: gCsFrameCount = 0; player->pos.z += 10000.0f; @@ -4483,17 +4483,17 @@ void Zoness_LevelStart(Player* player) { player->cam.at.x = gCsCamAtX = player->pos.x; player->cam.at.y = gCsCamAtY = (player->pos.y * player->unk_148) + 20.0f - 230.0f; player->cam.at.z = gCsCamAtZ = 0.0f; - player->unk_1D0 = 1; + player->csState = 1; /* fallthrough */ case 1: Math_SmoothStepToF(&player->pos.z, 0.0f, 0.1f, 48.0f, 0); Math_SmoothStepToF(&player->cam.at.y, (player->pos.y * player->unk_148) + 20.0f, 0.1f, 1.0f, 0.0f); if (gCsFrameCount >= 230) { - Math_SmoothStepToF(&player->cam.at.z, player->unk_138, 0.2f, 20000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.z, player->trueZpos, 0.2f, 20000.0f, 0.0f); } sp2C = gControllerHold[gMainController].button; gControllerHold[gMainController].button = gBoostButton[gMainController]; - player->timer_1F8 = 60; + player->csTimer = 60; player->boostMeter = 1.0f; func_play_800B2574(player); if (gCsFrameCount > 195) { @@ -4506,14 +4506,14 @@ void Zoness_LevelStart(Player* player) { AUDIO_PLAY_BGM(SEQ_ID_ZONESS | SEQ_FLAG); gLevelStartStatusScreenTimer = 80; player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; - player->unk_1D0 = 0; - player->timer_1F8 = 0; - player->timer_1FC = 0; + player->csState = 0; + player->csTimer = 0; + player->csEventTimer = 0; gLoadLevelObjects = 1; } break; } - D_ctx_80177CE8 += 40.0f; + gPathTexScroll += 40.0f; } void Zoness_LevelComplete(Player* player) { @@ -4526,16 +4526,16 @@ void Zoness_LevelComplete(Player* player) { Vec3f sp4C; Boss* boss = &gBosses[0]; - switch (player->unk_1D0) { + switch (player->csState) { case 0: case 10: gCsFrameCount = 0; - player->unk_4D8 = 0.0f; + player->aerobaticPitch = 0.0f; player->camRoll = 0.0f; player->baseSpeed = 40.0f; player->unk_234 = 1; player->wings.unk_04 = player->wings.unk_0C = player->wings.unk_08 = player->wings.unk_10 = - player->unk_130 = player->unk_12C = player->boostSpeed = 0.0f; + player->zRotBarrelRoll = player->zRotBank = player->boostSpeed = 0.0f; gCsCamEyeX = player->cam.eye.x; gCsCamEyeY = player->cam.eye.y; gCsCamEyeZ = player->cam.eye.z; @@ -4550,7 +4550,7 @@ void Zoness_LevelComplete(Player* player) { Object_Kill(&gActors[2].obj, gActors[2].sfxSource); Object_Kill(&gActors[3].obj, gActors[3].sfxSource); Object_Kill(&gActors[4].obj, gActors[4].sfxSource); - player->unk_1D0 = 1; + player->csState = 1; D_ctx_80177A48[0] = 0.05f; if (Rand_ZeroOne() > 0.5f) { D_ctx_80177A48[9] = -1.0f; @@ -4559,47 +4559,47 @@ void Zoness_LevelComplete(Player* player) { } break; case 1: - D_ctx_80177CE8 += 30.0f; - Math_SmoothStepToF(&player->unk_0E4, 0.0f, 0.1f, 5.0f, 0.0f); + gPathTexScroll += 30.0f; + Math_SmoothStepToF(&player->rot.x, 0.0f, 0.1f, 5.0f, 0.0f); Math_SmoothStepToF(&player->pos.y, 200.0f, 0.05f, 10.0f, 0.0f); Math_SmoothStepToF(&gCsCamEyeY, 250.0f, 1.0f, 20.0f, 0.0f); Math_SmoothStepToF(&gCsCamAtY, 240.0f, 1.0f, 20.0f, 0.0f); dx = player->pos.x - boss->obj.pos.x; dz = (player->pos.z - boss->obj.pos.z) * 0.05f; temp_ft5 = Math_RadToDeg(-Math_Atan2F(dx, dz)); - temp_fa0 = Math_SmoothStepToAngle(&player->unk_0E8, temp_ft5, 0.5f, 2.0f, 0.0001f) * 30.0f; + temp_fa0 = Math_SmoothStepToAngle(&player->rot.y, temp_ft5, 0.5f, 2.0f, 0.0001f) * 30.0f; if (gCsFrameCount >= 14) { - Math_SmoothStepToAngle(&player->unk_0EC, temp_fa0, 0.1f, 5.0f, 0.0001f); + Math_SmoothStepToAngle(&player->rot.z, temp_fa0, 0.1f, 5.0f, 0.0001f); } else if (temp_fa0 < 0.0f) { - player->unk_0EC -= 30.0f; + player->rot.z -= 30.0f; } else { - player->unk_0EC += 30.0f; + player->rot.z += 30.0f; } if (gCsFrameCount >= 140) { gFillScreenAlphaTarget = 255; gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; } if (gCsFrameCount == 160) { - player->unk_1D0++; + player->csState++; Play_ClearObjectData(); Audio_StopPlayerNoise(0); Audio_KillSfxBySource(player->sfxSource); gFillScreenAlpha = 250; - player->timer_1F8 = 20; + player->csTimer = 20; player->wings.modelId = 1; player->baseSpeed = 0.0f; - player->unk_0E4 = 0.0f; - player->unk_0E8 = 0.0f; - player->unk_0EC = 0.0f; + player->rot.x = 0.0f; + player->rot.y = 0.0f; + player->rot.z = 0.0f; } break; case 2: - D_ctx_80177CE8 += 60.0f; - if (player->timer_1F8 == 0) { + gPathTexScroll += 60.0f; + if (player->csTimer == 0) { player->pos.x = 0.0f; player->pos.y = 200.0f; - player->pos.z = -(D_ctx_80177D20 + 1500.0f); - player->unk_1D0++; + player->pos.z = -(gPathProgress + 1500.0f); + player->csState++; Audio_StartPlayerNoise(0); AUDIO_PLAY_BGM(SEQ_ID_GOOD_END); D_ctx_80177A98 = 1; @@ -4614,23 +4614,23 @@ void Zoness_LevelComplete(Player* player) { D_ctx_80177A48[3] = 800.0f; D_ctx_80177A48[4] = -0.15f; D_ctx_80177A48[5] = -250.0f; - player->cam.eye.z = player->pos.z + D_ctx_80177D20 - 1780.0f; + player->cam.eye.z = player->pos.z + gPathProgress - 1780.0f; } else { player->cam.eye.x = -1500.0f; player->cam.at.x = gCsCamAtX = -1500.0f; D_ctx_80177A48[3] = -800.0f; D_ctx_80177A48[4] = 0.2f; D_ctx_80177A48[5] = 250.0f; - player->cam.eye.z = player->pos.z + D_ctx_80177D20 - 2000.0f; + player->cam.eye.z = player->pos.z + gPathProgress - 2000.0f; } player->cam.eye.y = 200.0f; player->cam.at.y = gCsCamAtY = player->pos.y; - player->cam.at.z = gCsCamAtZ = player->pos.z + D_ctx_80177D20; + player->cam.at.z = gCsCamAtZ = player->pos.z + gPathProgress; D_ctx_80177A48[0] = 0.0f; } break; case 3: - D_ctx_80177CE8 += 60.0f; + gPathTexScroll += 60.0f; gFillScreenAlphaTarget = 0; gFillScreenAlphaStep = 4; D_ctx_80177A48[1] += D_ctx_80177A48[2]; @@ -4642,19 +4642,19 @@ void Zoness_LevelComplete(Player* player) { if (gCsFrameCount < 1180) { gCsCamEyeX = sp4C.x; gCsCamEyeY = 200.0f + sp4C.y; - gCsCamEyeZ = player->pos.z + D_ctx_80177D20 + sp4C.z; + gCsCamEyeZ = player->pos.z + gPathProgress + sp4C.z; gCsCamAtX = 0.0f; gCsCamAtY = player->pos.y; - gCsCamAtZ = D_ctx_80177A48[5] + (player->pos.z + D_ctx_80177D20); + gCsCamAtZ = D_ctx_80177A48[5] + (player->pos.z + gPathProgress); Math_SmoothStepToF(&D_ctx_80177A48[5], 250.0f, 1.0f, 1.0f, 0.0f); } else { gCsCamAtX = 0.0f; gCsCamAtY = player->pos.y; - gCsCamAtZ = player->pos.z + D_ctx_80177D20; + gCsCamAtZ = player->pos.z + gPathProgress; } if (gCsFrameCount > 1180) { player->baseSpeed += 2.0f; - player->unk_0E4 += 0.1f; + player->rot.x += 0.1f; Math_SmoothStepToF(&D_ctx_80177A48[2], 0.0f, 1.0f, 0.001f, 0); player->unk_190 = 2.0f; if (!gMissedZoSearchlight) { @@ -4675,7 +4675,7 @@ void Zoness_LevelComplete(Player* player) { Audio_StopPlayerNoise(0); Audio_FadeOutAll(10); player->state_1C8 = PLAYERSTATE_1C8_NEXT; - player->timer_1F8 = 0; + player->csTimer = 0; gFadeoutType = 4; gLeveLClearStatus[LEVEL_ZONESS] = Play_CheckMedalStatus(250) + 1; } @@ -4767,13 +4767,13 @@ void Zoness_LevelComplete(Player* player) { break; } if (gCsFrameCount >= 1180) { - player->unk_25C += 0.02f; - if (player->unk_25C > 0.6f) { - player->unk_25C = 0.6f; + player->contrailScale += 0.02f; + if (player->contrailScale > 0.6f) { + player->contrailScale = 0.6f; } } - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4) * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->xRot_120 + player->rot.x) * M_DTOR), MTXF_APPLY); sp58.x = 0.0f; sp58.y = 0.0f; sp58.z = player->baseSpeed; @@ -4783,18 +4783,18 @@ void Zoness_LevelComplete(Player* player) { player->vel.y = sp4C.y; player->pos.x += player->vel.x; player->pos.y += player->vel.y; - player->unk_138 = player->pos.z += player->vel.z; - player->unk_0F8 = player->unk_0EC; + player->trueZpos = player->pos.z += player->vel.z; + player->bankAngle = player->rot.z; Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0.0f); Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0.0f); Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0.0f); Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0.0f); Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0.0f); Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0.0f); - player->unk_088 += 10.0f; - player->unk_080 = -SIN_DEG(player->unk_088) * 0.3f; - player->unk_0F4 += 8.0f; - player->unk_0F0 = SIN_DEG(player->unk_0F4); + player->bobPhase += 10.0f; + player->yBob = -SIN_DEG(player->bobPhase) * 0.3f; + player->rockPhase += 8.0f; + player->rockAngle = SIN_DEG(player->rockPhase); } void Zoness_8019E5F0(Actor* actor) { diff --git a/src/overlays/ovl_i4/fox_bo.c b/src/overlays/ovl_i4/fox_bo.c index 3f096169..424840f2 100644 --- a/src/overlays/ovl_i4/fox_bo.c +++ b/src/overlays/ovl_i4/fox_bo.c @@ -125,70 +125,70 @@ void Bolse_8018BD60(Actor* this) { f32 D_i4_8019EEE4[] = { -200.0f, -100.0f, -0.0f, 100.0f, 200.0f }; -void Bolse_8018BEF8(Actor* actor, s32 arg1) { +void Bolse_SpawnEnemies(Actor* this, s32 count) { s32 i; - Actor* actorPtr; + Actor* enemy; - for (i = 10, actorPtr = &gActors[10]; i < arg1 + 10; i++, actorPtr++) { - if (actorPtr->obj.status == OBJ_FREE) { - Actor_Initialize(actorPtr); - actorPtr->obj.status = OBJ_ACTIVE; - actorPtr->obj.id = OBJ_ACTOR_ALLRANGE; - actorPtr->obj.pos.z = 0.0f; + for (i = AI360_10, enemy = &gActors[AI360_10]; i < count + AI360_10; i++, enemy++) { + if (enemy->obj.status == OBJ_FREE) { + Actor_Initialize(enemy); + enemy->obj.status = OBJ_ACTIVE; + enemy->obj.id = OBJ_ACTOR_ALLRANGE; + enemy->obj.pos.z = 0.0f; if (D_i4_801A0530 > 1000) { - actorPtr->obj.pos.x = 10000.0f; - actorPtr->obj.pos.y = 3000.0f; + enemy->obj.pos.x = 10000.0f; + enemy->obj.pos.y = 3000.0f; } else { - actorPtr->obj.pos.x = D_i4_8019EEE4[actor->unk_04E]; - actorPtr->obj.pos.y = 50.0f; - AUDIO_PLAY_SFX(0x2903305F, actorPtr->sfxSource, 4); - actorPtr->timer_0BC = 5; - actorPtr->timer_0C2 = 100; - actorPtr->unk_0F4.x = 90.0f; + enemy->obj.pos.x = D_i4_8019EEE4[this->unk_04E]; + enemy->obj.pos.y = 50.0f; + AUDIO_PLAY_SFX(0x2903305F, enemy->sfxSource, 4); + enemy->timer_0BC = 5; + enemy->timer_0C2 = 100; + enemy->unk_0F4.x = 90.0f; } - actorPtr->state = 1; - actorPtr->timer_0C4 = 300; - actorPtr->aiType = i; - actorPtr->aiIndex = -1; + enemy->state = 1; + enemy->timer_0C4 = 300; + enemy->aiType = i; + enemy->aiIndex = -1; - if (i < 13) { - actorPtr->aiIndex = AI360_SLIPPY; + if (i < AI360_10 + 3) { + enemy->aiIndex = AI360_SLIPPY; gActors[AI360_SLIPPY].aiIndex = -1; } - if ((i == 17) || (i == 18)) { - actorPtr->aiIndex = AI360_FOX; + if ((i == AI360_10 + 7) || (i == AI360_10 + 8)) { + enemy->aiIndex = AI360_FOX; } - if ((i == 20) || (i == 21)) { - actorPtr->aiIndex = AI360_PEPPY; + if ((i == AI360_10 + 10) || (i == AI360_10 + 11)) { + enemy->aiIndex = AI360_PEPPY; gActors[AI360_PEPPY].aiIndex = -1; } - if (i == 22) { - actorPtr->aiIndex = AI360_FALCO; + if (i == AI360_10 + 12) { + enemy->aiIndex = AI360_FALCO; gActors[AI360_FALCO].aiIndex = -1; } - if ((D_i4_801A0530 > 16000) && ((i == 23) || (i == 24))) { - actorPtr->aiIndex = AI360_FOX; + if ((D_i4_801A0530 > 16000) && ((i == AI360_10 + 13) || (i == AI360_10 + 14))) { + enemy->aiIndex = AI360_FOX; } - actorPtr->health = 24; - actorPtr->iwork[11] = 1; + enemy->health = 24; + enemy->iwork[11] = 1; if (D_i4_801A0530 < 16000) { - actorPtr->itemDrop = DROP_SILVER_RING_50p; + enemy->itemDrop = DROP_SILVER_RING_50p; } - Object_SetInfo(&actorPtr->info, actorPtr->obj.id); - AUDIO_PLAY_SFX(0x3100000C, actorPtr->sfxSource, 4); + Object_SetInfo(&enemy->info, enemy->obj.id); + AUDIO_PLAY_SFX(0x3100000C, enemy->sfxSource, 4); - actor->unk_04E++; - if (actor->unk_04E >= 5) { - actor->unk_04E = 0; + this->unk_04E++; + if (this->unk_04E >= 5) { + this->unk_04E = 0; } break; } @@ -254,7 +254,7 @@ void Bolse_UpdateEventHandler(Actor* this) { } if ((D_i4_801A0530 < 9600) && (D_i4_801A0530 & 0x400)) { - Bolse_8018BEF8(this, 8); + Bolse_SpawnEnemies(this, 8); } if (gBosses[2].state == 10) { @@ -263,8 +263,8 @@ void Bolse_UpdateEventHandler(Actor* this) { if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) { gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; - gPlayer[0].timer_1F8 = 30; - gPlayer[0].unk_1D0 = 0; + gPlayer[0].csTimer = 30; + gPlayer[0].csState = 0; gPlayer[0].unk_000 = 0.0f; } AllRange_ClearRadio(); @@ -377,7 +377,7 @@ void Bolse_UpdateEventHandler(Actor* this) { } if ((this->timer_0BC % 8) == 0) { - Bolse_8018BEF8(this, 15); + Bolse_SpawnEnemies(this, 15); } if (!this->timer_0BC) { @@ -605,11 +605,11 @@ void Bolse_8018D124(Actor* actor) { bool Bolse_8018D278(Actor* actor) { s32 i; - if (actor->unk_0D0 == 0) { + if (actor->dmgType == 0) { return false; } - actor->unk_0D0 = 0; + actor->dmgType = 0; actor->obj.pos.y += 150.0f; func_effect_8007BFFC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 0.0f, 0.0f, 0.0f, 8.0f, 15); @@ -629,7 +629,7 @@ bool Bolse_8018D278(Actor* actor) { actor->info.bonus = 0; actor->lockOnTimers[TEAM_ID_FOX] = 0; - actor->info.unk_1C = 0.0f; + actor->info.targetOffset = 0.0f; return true; } @@ -691,13 +691,13 @@ s32 Bolse_8018D4F0(Actor* actor) { bool Bolse_8018D584(Actor* actor) { s32 i; - if (actor->unk_0D0 == 0) { + if (actor->dmgType == 0) { return false; } - if ((actor->unk_0D2 < 2) && (actor->state == 0)) { + if ((actor->dmgPart < 2) && (actor->state == 0)) { actor->timer_0C6 = 20; - actor->unk_0D0 = 0; + actor->dmgType = 0; AUDIO_PLAY_SFX(0x29024003, actor->sfxSource, 0); actor->health += actor->damage; @@ -745,7 +745,7 @@ void Bolse_8018D7F0(Actor* actor) { } else { actor->lockOnTimers[TEAM_ID_FOX] = 0; actor->info.bonus = 0; - actor->info.unk_1C = 0.0f; + actor->info.targetOffset = 0.0f; } actor->scale = -1.0f; } @@ -850,30 +850,30 @@ s32 Bolse_8018E05C(Boss* boss, s32 index) { src.x = gPlayer[0].pos.x - (boss->obj.pos.x + temp_fs2); src.y = gPlayer[0].pos.y - (boss->obj.pos.y + 580.0f); - src.z = gPlayer[0].unk_138 - (boss->obj.pos.z + temp_fs3); + src.z = gPlayer[0].trueZpos - (boss->obj.pos.z + temp_fs3); Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); if ((fabsf(dest.x) < 100.0f) && (fabsf(dest.y) < 200.0f)) { - if ((dest.z >= 0.0f) && (dest.z < temp_fs4) && (gPlayer[0].unk_1F4 == 0)) { + if ((dest.z >= 0.0f) && (dest.z < temp_fs4) && (gPlayer[0].hitTimer == 0)) { Player_ApplyDamage(gPlayer, 0, 40); if (dest.y > 0.0f) { - gPlayer[0].unk_0D8.y = 20.0f; + gPlayer[0].knockback.y = 20.0f; } else { - gPlayer[0].unk_0D8.y = -20.0f; + gPlayer[0].knockback.y = -20.0f; } for (i = 0; i < 5; i++) { func_effect_8007C484(gPlayer[0].pos.x + RAND_FLOAT_CENTERED(30.0f), gPlayer[0].pos.y + RAND_FLOAT(10.0f), - gPlayer[0].unk_138 + RAND_FLOAT_CENTERED(30.0f), gPlayer[0].vel.x, - gPlayer[0].vel.y + gPlayer[0].unk_0D8.y, gPlayer[0].vel.z, RAND_FLOAT(0.1f) + 0.1f, - gPlayer[0].num + 11); + gPlayer[0].trueZpos + RAND_FLOAT_CENTERED(30.0f), gPlayer[0].vel.x, + gPlayer[0].vel.y + gPlayer[0].knockback.y, gPlayer[0].vel.z, + RAND_FLOAT(0.1f) + 0.1f, gPlayer[0].num + 11); } func_effect_8007BFFC(gPlayer[0].pos.x + RAND_FLOAT_CENTERED(10.0f), gPlayer[0].pos.y + RAND_FLOAT(10.0f), - gPlayer[0].unk_138 + RAND_FLOAT_CENTERED(10.0f), 0.0f, 15.0f, 0.0f, 2.0f, 5); + gPlayer[0].trueZpos + RAND_FLOAT_CENTERED(10.0f), 0.0f, 15.0f, 0.0f, 2.0f, 5); } ret = true; } @@ -1028,7 +1028,7 @@ f32 D_i4_8019F018[] = { 3.0f, -4.0f, 5.0f, 700.0f, 300.0f, 1000.0f }; void Bolse_8018EAEC(Actor* actor, s32 index) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = D_i4_8019EFDC[index] + gPlayer[0].pos.x; actor->obj.pos.y = D_i4_8019EFE8[index] + gPlayer[0].pos.y; actor->obj.pos.z = D_i4_8019EFF4[index] + gPlayer[0].pos.z; @@ -1052,7 +1052,7 @@ void Bolse_8018EC1C(void) { actor->obj.pos.z = -9000.0f; actor->unk_0B6 = 30; actor->fwork[20] = 1.0f; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; Object_SetInfo(&actor->info, actor->obj.id); actor->info.bonus = 1; } @@ -1079,7 +1079,7 @@ void Bolse_8018ED44(void) { if (actor->obj.status == OBJ_FREE) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = RAND_FLOAT_CENTERED(500.0f); actor->obj.pos.y = gActors[50].obj.pos.y + RAND_FLOAT(100.0f); actor->obj.pos.z = -9000.0f; @@ -1101,7 +1101,7 @@ void Bolse_8018EE4C(f32 x, f32 y) { if (actor->obj.status == OBJ_FREE) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = x; actor->obj.pos.y = gActors[50].obj.pos.y + y; actor->obj.pos.z = -9000.0f; @@ -1139,7 +1139,7 @@ void Bolse_LevelStart(Player* player) { Actor* actor; s32 pad[4]; - switch (player->unk_1D0) { + switch (player->csState) { case 0: gLight1R = 100; gLight1G = 100; @@ -1184,7 +1184,7 @@ void Bolse_LevelStart(Player* player) { gCsCamAtY = player->pos.y; gCsCamAtZ = player->pos.z; - player->unk_1D0 = 1; + player->csState = 1; player->unk_204 = 1; D_ctx_80177A48[0] = 1.0f; @@ -1198,7 +1198,7 @@ void Bolse_LevelStart(Player* player) { gCsCamAtZ = player->pos.z; D_ctx_80177A48[2] += 4.5f; sp60 = SIN_DEG(D_ctx_80177A48[2]) * 10.0f; - player->unk_0EC = SIN_DEG(D_ctx_80177A48[2]) * -60.0f; + player->rot.z = SIN_DEG(D_ctx_80177A48[2]) * -60.0f; if (((gCsFrameCount % 8) == 0) && (Rand_ZeroOne() < 0.5f)) { Bolse_8018ED44(); @@ -1245,13 +1245,13 @@ void Bolse_LevelStart(Player* player) { Bolse_80191ED8(); ActorAllRange_SpawnTeam(); - player->unk_1D0 = 2; + player->csState = 2; player->pos.x = 0.0f; player->pos.y = 1400.0f; player->pos.z = 14000.0f; - player->unk_0E4 = -8.0f; + player->rot.x = -8.0f; for (i = 0, actor = &gActors[1]; i < 3; i++, actor++) { actor->obj.pos.x = D_i4_8019F030[i - 1].x + player->pos.x; @@ -1289,7 +1289,7 @@ void Bolse_LevelStart(Player* player) { gCsCamAtY = player->pos.y; gCsCamAtZ = player->pos.z; - Math_SmoothStepToF(&player->unk_0EC, 0.0f, 0.1f, 1.0f, 0.0f); + Math_SmoothStepToF(&player->rot.z, 0.0f, 0.1f, 1.0f, 0.0f); if (gCsFrameCount == 200) { player->unk_204 = 2; @@ -1313,8 +1313,8 @@ void Bolse_LevelStart(Player* player) { break; } - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->rot.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(player->rot.x * M_DTOR), MTXF_APPLY); sp54.x = 0.0f; sp54.y = 0; @@ -1330,8 +1330,8 @@ void Bolse_LevelStart(Player* player) { player->pos.y += player->vel.y; player->pos.z += player->vel.z; - player->unk_138 = player->pos.z; - player->unk_0F8 = (player->unk_0EC + player->unk_12C) + player->unk_130; + player->trueZpos = player->pos.z; + player->bankAngle = (player->rot.z + player->zRotBank) + player->zRotBarrelRoll; Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0); Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0); @@ -1344,7 +1344,7 @@ void Bolse_LevelStart(Player* player) { void Bolse_8018F83C(Actor* actor, s32 arg1) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = D_i4_8019F06C[arg1] + gPlayer[0].pos.x; actor->obj.pos.y = D_i4_8019F078[arg1] + gPlayer[0].pos.y; actor->obj.pos.z = D_i4_8019F084[arg1] + gPlayer[0].pos.z; @@ -1370,7 +1370,7 @@ void Bolse_LevelComplete(Player* player) { sp8C = 100.0f; sp88 = 100.0f; - switch (player->unk_1D0) { + switch (player->csState) { case 0: Audio_StopSfxByBankAndSource(1, player->sfxSource); gCsFrameCount = 0; @@ -1378,13 +1378,13 @@ void Bolse_LevelComplete(Player* player) { D_i4_801A03D4 = 100.0f; D_i4_801A03D8 = 80.0f; - Math_SmoothStepToF(&player->unk_0E8, -40.0f, 0.1f, 2.5f, 0.0f); - Math_SmoothStepToF(&player->unk_0EC, -60.0f, 0.2f, 5.0f, 0.0f); - Math_SmoothStepToF(&player->unk_0E4, 0.0f, 0.1f, 2.5f, 0.0f); + Math_SmoothStepToF(&player->rot.y, -40.0f, 0.1f, 2.5f, 0.0f); + Math_SmoothStepToF(&player->rot.z, -60.0f, 0.2f, 5.0f, 0.0f); + Math_SmoothStepToF(&player->rot.x, 0.0f, 0.1f, 2.5f, 0.0f); - if (player->timer_1F8 == 0) { - player->unk_1D0 = 1; - player->timer_1F8 = 200; + if (player->csTimer == 0) { + player->csState = 1; + player->csTimer = 200; AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0); player->unk_194 = 5.0f; player->unk_190 = 5.0f; @@ -1395,18 +1395,18 @@ void Bolse_LevelComplete(Player* player) { case 1: player->unk_190 = 2.0f; - Math_SmoothStepToF(&player->unk_0E4, 15.0f, 0.1f, 0.4f, 0.0f); - Math_SmoothStepToF(&player->unk_0EC, 40.0f, 0.2f, 5.0f, 0.0f); - Math_SmoothStepToF(&player->unk_0E8, 120.0f, 0.1f, 2.0f, 0.0f); + Math_SmoothStepToF(&player->rot.x, 15.0f, 0.1f, 0.4f, 0.0f); + Math_SmoothStepToF(&player->rot.z, 40.0f, 0.2f, 5.0f, 0.0f); + Math_SmoothStepToF(&player->rot.y, 120.0f, 0.1f, 2.0f, 0.0f); player->baseSpeed += 1.0f; if (player->baseSpeed >= 70.0f) { player->baseSpeed = 70.0f; } - if (player->timer_1F8 == 0) { - player->unk_1D0 = 5; - player->timer_1F8 = 1000; + if (player->csTimer == 0) { + player->csState = 5; + player->csTimer = 1000; Audio_StopPlayerNoise(0); Audio_KillSfxBySource(player->sfxSource); Play_ClearObjectData(); @@ -1421,10 +1421,10 @@ void Bolse_LevelComplete(Player* player) { player->pos.y = actor50->obj.pos.y; player->pos.z = actor50->obj.pos.z - 1000.0f; - player->unk_0E4 = 0.0f; - player->unk_0EC = 0.0f; - player->unk_0E8 = 0.0f; - player->unk_114 = 0.0f; + player->rot.x = 0.0f; + player->rot.z = 0.0f; + player->rot.y = 0.0f; + player->yRot_114 = 0.0f; player->baseSpeed = 40.0f; if (gTeamShields[TEAM_ID_FALCO] > 0) { @@ -1460,7 +1460,7 @@ void Bolse_LevelComplete(Player* player) { case 5: gFillScreenAlpha = gFillScreenAlphaTarget = 0; - player->unk_1D0 = 10; + player->csState = 10; case 10: gCsCamAtX = gPlayer[0].pos.x; @@ -1537,7 +1537,7 @@ void Bolse_LevelComplete(Player* player) { break; case 240: - player->unk_1D0++; + player->csState++; D_ctx_80177A48[0] = 0; D_ctx_80177A48[5] = 20.0f; D_ctx_80177A48[6] = 0.0f; @@ -1601,8 +1601,8 @@ void Bolse_LevelComplete(Player* player) { break; case 800: - player->unk_1D0 += 1; - player->timer_1F8 = 50; + player->csState += 1; + player->csTimer = 50; player->unk_194 = 5.0f; player->unk_190 = 5.0f; AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0); @@ -1618,11 +1618,11 @@ void Bolse_LevelComplete(Player* player) { player->unk_190 = 2.0f; player->baseSpeed += 5; - if (player->timer_1F8 == 30) { + if (player->csTimer == 30) { Audio_FadeOutAll(30); } - if (player->timer_1F8 == 0) { + if (player->csTimer == 0) { gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0; gFillScreenAlphaTarget = 255; if (gFillScreenAlpha == 255) { @@ -1686,8 +1686,8 @@ void Bolse_LevelComplete(Player* player) { gLight1G = D_i4_801A03D4; gLight1B = D_i4_801A03D8; - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->xRot_120 + player->rot.x + player->aerobaticPitch) * M_DTOR), MTXF_APPLY); sp74.x = 0.0f; sp74.y = 0.0f; @@ -1703,15 +1703,15 @@ void Bolse_LevelComplete(Player* player) { player->pos.y += player->vel.y; player->pos.z += player->vel.z; - player->unk_138 = player->pos.z; - player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; + player->trueZpos = player->pos.z; + player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll; - if (player->unk_1D0 < 10) { - Math_SmoothStepToF(&player->unk_130, 0.0f, 0.1f, 15.0f, 0.0f); - Math_SmoothStepToF(&player->unk_12C, 0.0f, 0.1f, 15.0f, 0.0f); + if (player->csState < 10) { + Math_SmoothStepToF(&player->zRotBarrelRoll, 0.0f, 0.1f, 15.0f, 0.0f); + Math_SmoothStepToF(&player->zRotBank, 0.0f, 0.1f, 15.0f, 0.0f); Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 3.0f, 0.0f); - Math_SmoothStepToAngle(&player->unk_4D8, 0.0f, 0.1f, 20.0f, 0.0f); + Math_SmoothStepToAngle(&player->aerobaticPitch, 0.0f, 0.1f, 20.0f, 0.0f); if (player->pos.y < 700.0f) { Math_SmoothStepToF(&player->pos.y, 700.0f, 0.1f, 10.0f, 0.0f); @@ -1730,10 +1730,10 @@ void Bolse_LevelComplete(Player* player) { Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 50000, 0); Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000, 0); } - player->unk_088 += 10.0f; - player->unk_080 = -SIN_DEG(player->unk_088) * 0.3f; - player->unk_0F4 += 8.0f; - player->unk_0F0 = SIN_DEG(player->unk_0F4); + player->bobPhase += 10.0f; + player->yBob = -SIN_DEG(player->bobPhase) * 0.3f; + player->rockPhase += 8.0f; + player->rockAngle = SIN_DEG(player->rockPhase); } void Bolse_80190D98(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 xRot, f32 yRot) { @@ -1802,7 +1802,7 @@ void Bolse_80190FE8(f32 x, f32 y, f32 z, f32 scale) { void Bolse_80191054(Effect* effect) { switch (effect->state) { case 0: - if (gPlayer[0].unk_280 == 0) { + if (gPlayer[0].barrelRollAlpha == 0) { func_effect_8007A774(gPlayer, effect, 150.0f); } diff --git a/src/overlays/ovl_i4/fox_fo.c b/src/overlays/ovl_i4/fox_fo.c index a9cb10be..d9f75a78 100644 --- a/src/overlays/ovl_i4/fox_fo.c +++ b/src/overlays/ovl_i4/fox_fo.c @@ -191,7 +191,7 @@ void Fortuna_UpdateEvents(Actor* actor) { actor->iwork[0] = 0; actor->state = 6; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; - gPlayer[0].unk_1D0 = 0; + gPlayer[0].csState = 0; gPlayer[0].unk_000 = 0.0f; AllRange_ClearRadio(); @@ -204,7 +204,7 @@ void Fortuna_UpdateEvents(Actor* actor) { (gStarWolfTeamAlive[3] == 0)) { Radio_PlayMessage(gMsg_ID_9411, RCID_FOX); gMissionStatus = MISSION_ACCOMPLISHED; - gPlayer[0].timer_1F8 = 50; + gPlayer[0].csTimer = 50; player->unk_190 = 5.0f; player->unk_194 = 5.0f; AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0); @@ -212,7 +212,7 @@ void Fortuna_UpdateEvents(Actor* actor) { SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 30); } else { gMissionStatus = MISSION_COMPLETE; - gPlayer[0].timer_1F8 = 30; + gPlayer[0].csTimer = 30; } } @@ -240,7 +240,7 @@ void Fortuna_UpdateEvents(Actor* actor) { player->pos.x = 0.0f; player->pos.z = 15000.0f; player->pos.y = 670.0f; - player->unk_114 = 0.0f; + player->yRot_114 = 0.0f; for (actorPtr = &gActors[1], i = 0; i < 3; i++, actorPtr++) { actorPtr->obj.pos.x = D_i4_8019EDF8[i - 1].x; @@ -374,15 +374,15 @@ void Fortuna_UpdateEvents(Actor* actor) { Vec3f sp50 = { 0.0f, 0.0f, -10000 }; Actor_Initialize(actor19); - Matrix_Translate(gCalcMatrix, player->pos.x, player->pos.y, player->unk_138, MTXF_NEW); - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114) * M_DTOR, MTXF_APPLY); - Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, MTXF_APPLY); + Matrix_Translate(gCalcMatrix, player->pos.x, player->pos.y, player->trueZpos, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, (player->rot.y + player->yRot_114) * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, player->rot.x * M_DTOR, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &sp50, &actor19->obj.pos); actor19->obj.status = OBJ_ACTIVE; actor19->obj.id = OBJ_ACTOR_ALLRANGE; actor19->state = 4; - actor19->unk_0F4.y = player->unk_0E8 + player->unk_114 + 180.0f; + actor19->unk_0F4.y = player->rot.y + player->yRot_114 + 180.0f; actor19->unk_0F4.x = 15.0f; actor19->aiType = AI360_GREAT_FOX; actor19->fwork[1] = 90.0f; @@ -489,11 +489,11 @@ void Fortuna_80188AD0(Actor* actor) { actor->obj.pos.y -= 230.0f; } - if ((actor->unk_0D0 != 0) && (actor->state == 0)) { - actor->unk_0D0 = 0; + if ((actor->dmgType != 0) && (actor->state == 0)) { + actor->dmgType = 0; actor->state = 1; actor->info.hitbox = SEGMENTED_TO_VIRTUAL(D_FO_600FF64); - actor->info.unk_1C = 0.0f; + actor->info.targetOffset = 0.0f; actor->lockOnTimers[TEAM_ID_FOX] = 0; actor->info.bonus = 0; AUDIO_PLAY_SFX(0x2903B009, actor->sfxSource, 4); @@ -586,7 +586,7 @@ void Fortuna_8018906C(void) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = 0.0f; actor->obj.pos.y = 0.0f; actor->obj.pos.z = -9000.0f; @@ -609,10 +609,10 @@ Matrix D_BO_8019EE80 = { { void Fortuna_801890EC(Actor* actor, s32 arg1) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = D_i4_8019EE4C[arg1] + gPlayer[0].pos.x; actor->obj.pos.y = D_i4_8019EE5C[arg1] + gPlayer[0].pos.y; - actor->obj.pos.z = D_i4_8019EE6C[arg1] + gPlayer[0].unk_138; + actor->obj.pos.z = D_i4_8019EE6C[arg1] + gPlayer[0].trueZpos; actor->vel.z = gPlayer[0].baseSpeed; Object_SetInfo(&actor->info, actor->obj.id); @@ -640,11 +640,11 @@ void Fortuna_LevelComplete(Player* player) { Actor* actor3 = &gActors[3]; s32 pad[3]; - if ((player->unk_1D0 < 10) && (player->unk_1D0 >= 0)) { - Math_SmoothStepToF(&player->unk_130, 0.0f, 0.1f, 15.0f, 0.0f); - Math_SmoothStepToF(&player->unk_12C, 0.0f, 0.1f, 15.0f, 0.0f); + if ((player->csState < 10) && (player->csState >= 0)) { + Math_SmoothStepToF(&player->zRotBarrelRoll, 0.0f, 0.1f, 15.0f, 0.0f); + Math_SmoothStepToF(&player->zRotBank, 0.0f, 0.1f, 15.0f, 0.0f); Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 3.0f, 0.0f); - Math_SmoothStepToAngle(&player->unk_4D8, 0.0f, 0.1f, 20.0f, 0.0f); + Math_SmoothStepToAngle(&player->aerobaticPitch, 0.0f, 0.1f, 20.0f, 0.0f); if (gMissionStatus == MISSION_COMPLETE) { if (player->pos.y < 700.0f) { Math_SmoothStepToF(&player->pos.y, 700.0f, 0.1f, 10.0f, 0.0f); @@ -665,64 +665,64 @@ void Fortuna_LevelComplete(Player* player) { Math_SmoothStepToF(&player->boostSpeed, 0.0f, 0.1f, 1.5f, 0.0f); - switch (player->unk_1D0) { + switch (player->csState) { case -1: player->wings.modelId = 1; - player->unk_0E8 = 0.0f; + player->rot.y = 0.0f; player->baseSpeed = 30.0f; - player->unk_114 = 180.0f; - player->unk_0E4 = -7.0f; - Math_SmoothStepToF(&player->unk_0EC, 0.0f, 0.05f, 1.0f, 0.0f); - player->unk_12C = 0.0f; - player->unk_130 = 0.0f; - player->unk_4D8 = 0.0f; + player->yRot_114 = 180.0f; + player->rot.x = -7.0f; + Math_SmoothStepToF(&player->rot.z, 0.0f, 0.05f, 1.0f, 0.0f); + player->zRotBank = 0.0f; + player->zRotBarrelRoll = 0.0f; + player->aerobaticPitch = 0.0f; player->cam.eye.x = -200.0f; player->cam.eye.y = 100.0f; player->cam.eye.z = -1500.0f; player->cam.at.x = player->pos.x; player->cam.at.y = player->pos.y; - player->cam.at.z = player->unk_138; + player->cam.at.z = player->trueZpos; - if (player->timer_1F8 < 80) { + if (player->csTimer < 80) { gFillScreenAlphaTarget = 255; gFillScreenAlphaStep = 10; gFillScreenGreen = gFillScreenRed = gFillScreenBlue = 0; - if (player->timer_1F8 == 0) { - player->timer_1F8 = 0; - player->unk_1D0 = 1; + if (player->csTimer == 0) { + player->csTimer = 0; + player->csState = 1; } } break; case 0: if (gMissionStatus == MISSION_COMPLETE) { - Math_SmoothStepToF(&player->unk_0E8, 40.0f, 0.1f, 2.5f, 0.0f); - Math_SmoothStepToF(&player->unk_0EC, 60.0f, 0.2f, 5.0f, 0.0f); - Math_SmoothStepToF(&player->unk_0E4, 0.0f, 0.1f, 2.5f, 0.0f); + Math_SmoothStepToF(&player->rot.y, 40.0f, 0.1f, 2.5f, 0.0f); + Math_SmoothStepToF(&player->rot.z, 60.0f, 0.2f, 5.0f, 0.0f); + Math_SmoothStepToF(&player->rot.x, 0.0f, 0.1f, 2.5f, 0.0f); } else { player->unk_190 = 2.0f; player->cam.eye.y += 3.0f; - Math_SmoothStepToF(&player->unk_0EC, - Math_SmoothStepToF(&player->unk_114, - Math_RadToDeg(Math_Atan2F(player->pos.x, player->unk_138)), 0.1f, + Math_SmoothStepToF(&player->rot.z, + Math_SmoothStepToF(&player->yRot_114, + Math_RadToDeg(Math_Atan2F(player->pos.x, player->trueZpos)), 0.1f, 4.0f, 0.0f) * 20.0f, 0.2f, 5.0f, 0.0f); - Math_SmoothStepToF(&player->unk_0E4, 0.0f, 0.1f, 2.5f, 0.0f); + Math_SmoothStepToF(&player->rot.x, 0.0f, 0.1f, 2.5f, 0.0f); } - if (player->timer_1F8 == 0) { + if (player->csTimer == 0) { if (gMissionStatus != MISSION_COMPLETE) { - player->timer_1F8 = 150; - player->unk_1D0 = -1; + player->csTimer = 150; + player->csState = -1; player->pos.x = 0.0f; player->boostSpeed = 0.0f; player->baseSpeed = 0.0f; player->pos.y = 350.0f; player->pos.z = -2800.0f; } else { - player->timer_1F8 = 280; - player->unk_1D0 = 1; + player->csTimer = 280; + player->csState = 1; } player->unk_194 = 5.0f; player->unk_190 = 5.0f; @@ -732,20 +732,20 @@ void Fortuna_LevelComplete(Player* player) { case 1: player->unk_190 = 2.0f; - Math_SmoothStepToF(&player->unk_0E4, 15.0f, 0.1f, 0.4f, 0.0f); - Math_SmoothStepToF(&player->unk_0EC, -40.0f, 0.2f, 5.0f, 0.0f); - Math_SmoothStepToF(&player->unk_0E8, -120.0f, 0.1f, 2.0f, 0.0f); + Math_SmoothStepToF(&player->rot.x, 15.0f, 0.1f, 0.4f, 0.0f); + Math_SmoothStepToF(&player->rot.z, -40.0f, 0.2f, 5.0f, 0.0f); + Math_SmoothStepToF(&player->rot.y, -120.0f, 0.1f, 2.0f, 0.0f); player->baseSpeed += 1.0f; if (player->baseSpeed >= 70.0f) { player->baseSpeed = 70.0f; - player->unk_25C += 0.04f; - if (player->unk_25C > 0.6f) { - player->unk_25C = 0.6f; + player->contrailScale += 0.04f; + if (player->contrailScale > 0.6f) { + player->contrailScale = 0.6f; } } - if (player->timer_1F8 == 0) { - player->unk_1D0 = 2; - player->timer_1F8 = 1000; + if (player->csTimer == 0) { + player->csState = 2; + player->csTimer = 1000; for (i = 0; i < ARRAY_COUNT(gActors); i++) { Object_Kill(&gActors[i].obj, gActors[i].sfxSource); } @@ -763,14 +763,14 @@ void Fortuna_LevelComplete(Player* player) { break; case 2: - if (!(gMissionStatus) && (player->timer_1F8) > 830) { + if (!(gMissionStatus) && (player->csTimer) > 830) { gFillScreenAlphaTarget = 0; gFillScreenAlphaStep = 8; } - if (player->timer_1F8 == 810) { + if (player->csTimer == 810) { Audio_KillSfxBySource(gBosses[0].sfxSource); } - if (player->timer_1F8 == 830) { + if (player->csTimer == 830) { gFillScreenAlphaTarget = 255; gFillScreenAlphaStep = 2; gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; @@ -781,9 +781,9 @@ void Fortuna_LevelComplete(Player* player) { if ((func_hud_80090200(&gBosses[0]) == 2) || (gMissionStatus != MISSION_COMPLETE)) { Play_ClearObjectData(); if (gMissionStatus == MISSION_COMPLETE) { - player->unk_1D0 = 10; + player->csState = 10; } else { - player->unk_1D0 = 20; + player->csState = 20; } for (i = 0; i < 200; i++) { @@ -806,21 +806,21 @@ void Fortuna_LevelComplete(Player* player) { if (gMissionStatus == MISSION_COMPLETE) { player->pos.x = 0.0f; player->pos.y = 0.0f; - player->unk_0E4 = 0.0f; - player->unk_0EC = 0.0f; + player->rot.x = 0.0f; + player->rot.z = 0.0f; player->baseSpeed = 0.0f; - player->unk_114 = 0.0f; - player->unk_0E8 = 180.0f; + player->yRot_114 = 0.0f; + player->rot.y = 180.0f; Fortuna_8018906C(); } else { player->pos.x = 0.0f; - player->unk_0E4 = 0.0f; - player->unk_0EC = 0.0f; - player->unk_114 = 0.0f; + player->rot.x = 0.0f; + player->rot.z = 0.0f; + player->yRot_114 = 0.0f; player->baseSpeed = 0.0f; player->cam.at.y = 16.0f; player->pos.y = -100.0f; - player->unk_0E8 = 180.0f; + player->rot.y = 180.0f; } player->pos.z = -10000.0f; gCsFrameCount = 0; @@ -860,7 +860,7 @@ void Fortuna_LevelComplete(Player* player) { } if (gCsFrameCount == 496) { - player->unk_1D0 = 11; + player->csState = 11; D_ctx_80177A48[0] = 0.01f; D_ctx_80177A48[1] = 0.0f; D_ctx_80177A48[2] = -400.0f; @@ -1016,8 +1016,8 @@ void Fortuna_LevelComplete(Player* player) { D_ctx_8017842C += 0.3f; Math_SmoothStepToF(&D_ctx_80177A48[3], 0.0f, 1.0f, 0.02f, 0); if (gCsFrameCount == 1216) { - player->unk_1D0 = 12; - player->timer_1F8 = 1000; + player->csState = 12; + player->csTimer = 1000; D_ctx_80177A48[4] = 1.0f; actor2->vel.y = 0.1f; actor1->vel.y = 0.1f; @@ -1040,12 +1040,12 @@ void Fortuna_LevelComplete(Player* player) { player->unk_190 = 2.0f; if (gTeamShields[TEAM_ID_FALCO] > 0) { - if (player->timer_1F8 == 980) { + if (player->csTimer == 980) { AUDIO_PLAY_SFX(0x09000002, actor3->sfxSource, 0); actor3->vel.y = 1.0f; actor3->fwork[29] = 5.0f; } - if (player->timer_1F8 < 980) { + if (player->csTimer < 980) { actor3->vel.z += 1.0f; actor3->vel.z *= 1.15f; actor3->vel.y *= 1.19f; @@ -1053,13 +1053,13 @@ void Fortuna_LevelComplete(Player* player) { } } - if ((gTeamShields[TEAM_ID_PEPPY] > 0) && (player->timer_1F8 == 960)) { + if ((gTeamShields[TEAM_ID_PEPPY] > 0) && (player->csTimer == 960)) { AUDIO_PLAY_SFX(0x09000002, actor2->sfxSource, 0); actor2->vel.y = 1.0f; actor2->fwork[29] = 5.0f; } - if (player->timer_1F8 < 960) { + if (player->csTimer < 960) { actor2->vel.z += 1.0f; actor2->vel.z *= 1.15f; actor2->vel.y *= 1.19f; @@ -1067,13 +1067,13 @@ void Fortuna_LevelComplete(Player* player) { } if (gTeamShields[TEAM_ID_SLIPPY] > 0) { - if (player->timer_1F8 == 940) { + if (player->csTimer == 940) { AUDIO_PLAY_SFX(0x09000002, actor1->sfxSource, 0); actor1->vel.y = 1.0f; actor1->fwork[29] = 5.0f; } - if (player->timer_1F8 < 940) { + if (player->csTimer < 940) { actor1->vel.z += 1.0f; actor1->vel.z *= 1.15f; actor1->vel.y *= 1.19f; @@ -1081,12 +1081,12 @@ void Fortuna_LevelComplete(Player* player) { } } - if (player->timer_1F8 == 910) { + if (player->csTimer == 910) { actor0->vel.y = 1.0f; actor0->obj.rot.x = -2.0f; } - if (player->timer_1F8 < 910) { + if (player->csTimer < 910) { actor0->vel.z += 1.0f; actor0->vel.z *= 1.02f; actor0->vel.y *= 1.06f; @@ -1095,7 +1095,7 @@ void Fortuna_LevelComplete(Player* player) { if (gCsFrameCount == 1382) { player->state_1C8 = PLAYERSTATE_1C8_NEXT; - player->timer_1F8 = 0; + player->csTimer = 0; gFadeoutType = 4; Audio_FadeOutAll(10); for (i = 0; i < 6; i++) { @@ -1110,21 +1110,21 @@ void Fortuna_LevelComplete(Player* player) { Fortuna_801890EC(actor3, 0); actor3->obj.pos.x = (player->pos.x - 100.0f) - 400.0f; actor3->obj.pos.y = player->pos.y + 400.0f; - actor3->obj.pos.z = player->unk_138 - 150.0f; + actor3->obj.pos.z = player->trueZpos - 150.0f; actor3->obj.rot.z = 90.0f; } if (gTeamShields[TEAM_ID_SLIPPY] > 0) { Fortuna_801890EC(actor1, 1); actor1->obj.pos.x = player->pos.x + 100.0f + 400.0f; actor1->obj.pos.y = player->pos.y + 400.0f; - actor1->obj.pos.z = player->unk_138 - 150.0f; + actor1->obj.pos.z = player->trueZpos - 150.0f; actor1->obj.rot.z = -90.0f; } if (gTeamShields[TEAM_ID_PEPPY] > 0) { Fortuna_801890EC(actor2, 2); actor2->obj.pos.x = player->pos.x; actor2->obj.pos.y = player->pos.y + 100.0f + 400.0f; - actor2->obj.pos.z = player->unk_138 - 250.0f; + actor2->obj.pos.z = player->trueZpos - 250.0f; } Fortuna_801890EC(actor0, 3); @@ -1132,7 +1132,7 @@ void Fortuna_LevelComplete(Player* player) { actor0->vel.z = 0.0f; actor0->info.bonus = 1; gCsFrameCount = 0; - player->unk_1D0 = 21; + player->csState = 21; player->unk_234 = 1; for (i = 0; i < 9; i++) { @@ -1187,7 +1187,7 @@ void Fortuna_LevelComplete(Player* player) { actor1->obj.pos.x = 100.0f; actor1->obj.pos.y = 40.0f; actor2->obj.pos.y = 90.0f; - player->unk_1D0 = 22; + player->csState = 22; } switch (gCsFrameCount) { @@ -1201,7 +1201,7 @@ void Fortuna_LevelComplete(Player* player) { src.x = 0.0f; src.y = D_ctx_80177A48[7]; src.z = D_ctx_80177A48[5]; - Matrix_Translate(gCalcMatrix, player->pos.x, 0.0f, player->pos.z + D_ctx_80177D20, MTXF_NEW); + Matrix_Translate(gCalcMatrix, player->pos.x, 0.0f, player->pos.z + gPathProgress, MTXF_NEW); Matrix_RotateY(gCalcMatrix, -(D_ctx_80177A48[4] * M_DTOR), MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &src, &dest); player->cam.eye.x = gCsCamEyeX = dest.x; @@ -1210,7 +1210,7 @@ void Fortuna_LevelComplete(Player* player) { Math_SmoothStepToF(&gCsCamAtY, 0.0f, 0.005f, 1000.0f, 0.0001f); player->cam.at.x = player->pos.x; player->cam.at.y = gCsCamAtY; - player->cam.at.z = player->pos.z + D_ctx_80177D20; + player->cam.at.z = player->pos.z + gPathProgress; break; case 22: @@ -1318,7 +1318,7 @@ void Fortuna_LevelComplete(Player* player) { gFillScreenAlphaStep = 16; if (gFillScreenAlpha == 255) { player->state_1C8 = PLAYERSTATE_1C8_NEXT; - player->timer_1F8 = 0; + player->csTimer = 0; gFadeoutType = 4; Audio_FadeOutAll(10); @@ -1374,7 +1374,7 @@ void Fortuna_LevelComplete(Player* player) { src.x = 0.0f; src.y = D_ctx_80177A48[7]; src.z = D_ctx_80177A48[5]; - Matrix_Translate(gCalcMatrix, player->pos.x, 0.0f, player->pos.z + D_ctx_80177D20, MTXF_NEW); + Matrix_Translate(gCalcMatrix, player->pos.x, 0.0f, player->pos.z + gPathProgress, MTXF_NEW); Matrix_RotateY(gCalcMatrix, -(D_ctx_80177A48[4] * M_DTOR), MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &src, &dest); player->cam.eye.x = gCsCamEyeX = dest.x; @@ -1399,11 +1399,11 @@ void Fortuna_LevelComplete(Player* player) { player->cam.at.x = gCsCamAtX = player->pos.x; player->cam.at.y = gCsCamAtY; - player->cam.at.z = gCsCamAtZ = player->pos.z - D_ctx_80177A48[6] + D_ctx_80177D20; + player->cam.at.z = gCsCamAtZ = player->pos.z - D_ctx_80177A48[6] + gPathProgress; break; } - if (player->unk_1D0 < 20) { + if (player->csState < 20) { switch (gCsFrameCount) { case 1020: gShowLevelClearStatusScreen = 1; @@ -1414,8 +1414,8 @@ void Fortuna_LevelComplete(Player* player) { } } - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->xRot_120 + player->rot.x + player->aerobaticPitch) * M_DTOR), MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; @@ -1429,8 +1429,8 @@ void Fortuna_LevelComplete(Player* player) { player->pos.x += player->vel.x; player->pos.y += player->vel.y; player->pos.z += player->vel.z; - player->unk_138 = player->pos.z; - player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; + player->trueZpos = player->pos.z; + player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll; } void Fortuna_8018BA2C(void) { diff --git a/src/overlays/ovl_i4/fox_ka.c b/src/overlays/ovl_i4/fox_ka.c index 85d6c1e8..bdae64bc 100644 --- a/src/overlays/ovl_i4/fox_ka.c +++ b/src/overlays/ovl_i4/fox_ka.c @@ -171,7 +171,7 @@ void Katina_80192C8C(void) { if (actor->obj.status == OBJ_FREE) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_i4_8019F0F0[i], &actor->obj.pos); actor->obj.rot = D_i4_8019F138[i]; Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_i4_8019F114[i], &dest); @@ -196,11 +196,11 @@ void Katina_LevelStart(Player* player) { gAllRangeEventTimer = 0; - if (player->unk_1D0 != 0) { + if (player->csState != 0) { Katina_801981F8(&gActors[4]); } - switch (player->unk_1D0) { + switch (player->csState) { case 1: case 2: case 3: @@ -222,7 +222,7 @@ void Katina_LevelStart(Player* player) { gCsCamAtX = gActors[4].obj.pos.x; gCsCamAtY = gActors[4].obj.pos.y; gCsCamAtZ = gActors[4].obj.pos.z; - player->unk_1D0 = 11; + player->csState = 11; D_ctx_80177A48[0] = 1.0f; break; @@ -235,7 +235,7 @@ void Katina_LevelStart(Player* player) { gActors[6].obj.rot.z += 0.7f; if (gCsFrameCount == 100) { gCsFrameCount = 80; - player->unk_1D0 = 12; + player->csState = 12; } break; @@ -245,11 +245,11 @@ void Katina_LevelStart(Player* player) { gActors[4].obj.rot.z -= 1.0f; if (gCsFrameCount == 120) { ActorAllRange_SpawnTeam(); - player->unk_1D0 = 13; + player->csState = 13; player->pos.x = 0.0f; player->pos.y = 1300.0f; player->pos.z = 10000.0f; - player->unk_0E4 = -10.0f; + player->rot.x = -10.0f; for (i = 1, actor = &gActors[1]; i < 4; i++, actor++) { actor->obj.pos.x = D_i4_8019F168[i - 1].x + player->pos.x; actor->obj.pos.y = D_i4_8019F168[i - 1].y + player->pos.y; @@ -328,8 +328,8 @@ void Katina_LevelStart(Player* player) { Object_Kill(&gActors[5].obj, gActors[5].sfxSource); break; } - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->rot.y + player->yRot_114 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(player->rot.x * M_DTOR), MTXF_APPLY); src.x = 0; src.y = 0.0f; src.z = player->baseSpeed; @@ -340,8 +340,8 @@ void Katina_LevelStart(Player* player) { player->pos.x += player->vel.x; player->pos.y += player->vel.y; player->pos.z += player->vel.z; - player->unk_138 = player->pos.z; - player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; + player->trueZpos = player->pos.z; + player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll; Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0.0f); Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0.0f); Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0.0f); @@ -912,7 +912,7 @@ void Katina_801946C4(Boss* boss) { if (boss->timer_050 == 500) { gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; - gPlayer[0].unk_1D0 = 100; + gPlayer[0].csState = 100; gPlayer[0].unk_234 = 0; gCsFrameCount = 5000; } @@ -1039,17 +1039,16 @@ void Katina_801946C4(Boss* boss) { gFillScreenBlue = 255; if (gFillScreenAlpha == 255) { gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; - gPlayer[0].unk_1D0 = 2; + gPlayer[0].csState = 2; gPlayer[0].unk_234 = 1; gCsFrameCount = 200; Audio_StopPlayerNoise(0); Audio_KillSfxBySource(&gPlayer[0].sfxSource[0]); - gPlayer[0].timer_1F8 = 50; + gPlayer[0].csTimer = 50; gPlayer[0].baseSpeed = 0.0f; - gPlayer[0].unk_114 = 0.0f; + gPlayer[0].yRot_114 = 0.0f; - gPlayer[0].unk_0EC = gPlayer[0].unk_0E8 = gPlayer[0].unk_0E4 = gPlayer[0].unk_120 = - gPlayer[0].unk_114; + gPlayer[0].rot.z = gPlayer[0].rot.y = gPlayer[0].rot.x = gPlayer[0].xRot_120 = gPlayer[0].yRot_114; Play_ClearObjectData(); gEnvLightyRot = 60.0f; gLight1R = 100; @@ -1065,7 +1064,7 @@ void Katina_801946C4(Boss* boss) { if ((boss->timer_050 == 0) && ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN))) { gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; - gPlayer[0].unk_1D0 = 0; + gPlayer[0].csState = 0; gMissionStatus = MISSION_ACCOMPLISHED; boss->obj.pos.z = 0.0f; boss->health = -1; @@ -1147,7 +1146,7 @@ void Katina_801946C4(Boss* boss) { gRadarMarks[64].pos.x = boss->obj.pos.x; gRadarMarks[64].pos.y = boss->obj.pos.y; gRadarMarks[64].pos.z = boss->obj.pos.z; - gRadarMarks[64].unk_10 = boss->unk_078.y + 180.0f; + gRadarMarks[64].yRot = boss->unk_078.y + 180.0f; if (boss->state < 6) { Math_SmoothStepToF(&boss->obj.pos.x, boss->vwork[0].x, 0.01f, boss->fwork[10], 0); Math_SmoothStepToF(&boss->obj.pos.y, boss->vwork[0].y, 0.01f, boss->fwork[10], 0); @@ -1328,7 +1327,7 @@ void Katina_80196E30(Actor* actor, s32 idx) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = D_i4_8019F260[idx + 1] + gPlayer[0].pos.x; actor->obj.pos.y = D_i4_8019F26C[idx + 1] + gPlayer[0].pos.y; actor->obj.pos.z = D_i4_8019F278[idx + 1] + gPlayer[0].pos.z; @@ -1346,7 +1345,7 @@ void Katina_80196F40(Actor* actor, s32 idx) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = D_i4_8019F29C[idx + 1]; actor->obj.pos.y = D_i4_8019F2AC[idx + 1]; actor->obj.pos.z = D_i4_8019F2BC[idx + 1]; @@ -1377,7 +1376,7 @@ void Katina_80197024(void) { if ((D_i4_8019F2F0[i] >= gKaAllyKillCount) && ((i >= 3) || (gTeamShields[i + 1] > 0))) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = ((D_i4_8019F340[i].x * 0.5f) + gPlayer[0].pos.x) + RAND_FLOAT_CENTERED_SEEDED(2000.0f); actor->obj.pos.y = (D_i4_8019F340[i].y + gPlayer[0].pos.y) - RAND_FLOAT_SEEDED(1000.0f); actor->obj.pos.z = (D_i4_8019F340[i].z + gPlayer[0].pos.z) + RAND_FLOAT_SEEDED(1000.0f); @@ -1407,9 +1406,9 @@ void Katina_LevelComplete(Player* player) { player->wings.unk_0C = 0.0f; player->wings.unk_08 = 0.0f; player->wings.unk_04 = 0.0f; - player->unk_4D8 = 0.0f; + player->aerobaticPitch = 0.0f; D_ctx_80177A48[0] = 1.0f; - switch (player->unk_1D0) { + switch (player->csState) { case 0: Audio_StopSfxByBankAndSource(1, &player->sfxSource[0]); gCsFrameCount = 0; @@ -1417,8 +1416,8 @@ void Katina_LevelComplete(Player* player) { player->pos.x = boss->obj.pos.x; player->pos.y = 800.0f; player->pos.z = boss->obj.pos.z; - player->unk_114 = player->unk_120 = player->unk_0E4 = player->camRoll = player->unk_4D8 = 0.0f; - player->unk_0E8 = 120.0f; + player->yRot_114 = player->xRot_120 = player->rot.x = player->camRoll = player->aerobaticPitch = 0.0f; + player->rot.y = 120.0f; player->baseSpeed = 40.0f; gCsCamEyeX = boss->obj.pos.x + 5000.0f; gCsCamEyeY = 750.0f; @@ -1431,7 +1430,7 @@ void Katina_LevelComplete(Player* player) { Object_Kill(&gActors[i].obj, gActors[i].sfxSource); } } - player->unk_1D0 += 1; + player->csState += 1; if (gTeamShields[TEAM_ID_FALCO] > 0) { Katina_80196E30(&gActors[1], 0); } @@ -1450,18 +1449,17 @@ void Katina_LevelComplete(Player* player) { gCsCamAtX = boss->obj.pos.x; gCsCamAtY = 1000.0f; gCsCamAtZ = boss->obj.pos.z; - Math_SmoothStepToF(&player->unk_0EC, - Math_SmoothStepToAngle(&player->unk_0E8, 283.0f, 0.1f, 3.0f, 0.0f) * 20.0f, 0.1f, 1.0f, - 0.0f); + Math_SmoothStepToF(&player->rot.z, Math_SmoothStepToAngle(&player->rot.y, 283.0f, 0.1f, 3.0f, 0.0f) * 20.0f, + 0.1f, 1.0f, 0.0f); for (i = 1; i < 4; i++) { angle = Math_SmoothStepToAngle(&gActors[i].unk_0F4.y, gActors[i].fwork[1], 0.1f, 3.0f, 0.0f); Math_SmoothStepToF(&gActors[i].unk_0F4.z, angle * 20.0f, 0.1f, 1.0f, 0.0f); } if (gCsFrameCount >= 200) { - player->unk_0E4 += 1.0f; - player->unk_0E8 += 1.0f; - player->unk_0EC += 1.0f; + player->rot.x += 1.0f; + player->rot.y += 1.0f; + player->rot.z += 1.0f; } if (gCsFrameCount >= 225) { @@ -1479,25 +1477,25 @@ void Katina_LevelComplete(Player* player) { } if (gCsFrameCount == 250) { - player->unk_1D0 = 2; + player->csState = 2; Play_ClearObjectData(); Audio_StopPlayerNoise(0); Audio_KillSfxBySource(&player->sfxSource[0]); - player->timer_1F8 = 50; + player->csTimer = 50; player->baseSpeed = 0.0f; - player->unk_0E4 = 0.0f; - player->unk_0E8 = 0.0f; - player->unk_0EC = 0.0f; + player->rot.x = 0.0f; + player->rot.y = 0.0f; + player->rot.z = 0.0f; } break; case 2: - if (player->timer_1F8 == 0) { + if (player->csTimer == 0) { player->unk_240 = 1; player->pos.x = 0.0f; player->pos.y = 3500.0f; player->pos.z = 150.0f; - player->unk_1D0 = 3; + player->csState = 3; Audio_StartPlayerNoise(0); if (gMissionStatus != MISSION_COMPLETE) { AUDIO_PLAY_BGM(SEQ_ID_GOOD_END); @@ -1530,12 +1528,12 @@ void Katina_LevelComplete(Player* player) { gCsCamAtZ = player->pos.z + 500; if (gCsFrameCount > 1010) { player->baseSpeed += 2.0f; - player->unk_0E4 += 0.1f; + player->rot.x += 0.1f; Math_SmoothStepToF(&D_ctx_80177A48[2], 0.0f, 1.0f, 0.001f, 0); player->unk_190 = 2.0f; - player->unk_25C += 0.04f; - if (player->unk_25C > 0.6f) { - player->unk_25C = 0.6f; + player->contrailScale += 0.04f; + if (player->contrailScale > 0.6f) { + player->contrailScale = 0.6f; } } else { Math_SmoothStepToF(&D_ctx_80177A48[2], 0.2f, 1.0f, 0.005f, 0); @@ -1551,7 +1549,7 @@ void Katina_LevelComplete(Player* player) { gFillScreenAlphaStep = 8; if (gFillScreenAlpha == 255) { player->state_1C8 = PLAYERSTATE_1C8_NEXT; - player->timer_1F8 = 0; + player->csTimer = 0; gFadeoutType = 4; gLeveLClearStatus[LEVEL_KATINA] = Play_CheckMedalStatus(150) + 1; } @@ -1625,7 +1623,7 @@ void Katina_LevelComplete(Player* player) { if (gTeamShields[TEAM_ID_PEPPY] > 0) { Katina_80196F40(&gActors[4], 3); } - player->unk_1D0 += 1; + player->csState += 1; break; case 101: @@ -1639,8 +1637,8 @@ void Katina_LevelComplete(Player* player) { gActors[4].unk_0F4.x += 0.08f; break; } - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4) * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->xRot_120 + player->rot.x) * M_DTOR), MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; src.z = player->baseSpeed; @@ -1651,9 +1649,9 @@ void Katina_LevelComplete(Player* player) { player->pos.x += player->vel.x; player->pos.y += player->vel.y; player->pos.z += player->vel.z; - player->unk_0F8 = player->unk_0EC; - player->unk_138 = player->pos.z; - if (player->unk_1D0 < 100) { + player->bankAngle = player->rot.z; + player->trueZpos = player->pos.z; + if (player->csState < 100) { Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0); Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0); Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0); @@ -1661,10 +1659,10 @@ void Katina_LevelComplete(Player* player) { Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0); Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0); } - player->unk_088 += 10.0f; - player->unk_080 = -SIN_DEG(player->unk_088) * 0.3f; - player->unk_0F4 += 8.0f; - player->unk_0F0 = SIN_DEG(player->unk_0F4); + player->bobPhase += 10.0f; + player->yBob = -SIN_DEG(player->bobPhase) * 0.3f; + player->rockPhase += 8.0f; + player->rockAngle = SIN_DEG(player->rockPhase); } void Katina_80197F10(Actor* actor) { @@ -1764,7 +1762,7 @@ void Katina_801981F8(Actor* actor) { actor_it->timer_0C2 = 30; Object_SetInfo(&actor_it->info, actor_it->obj.id); if (actor_it->unk_0B6 == 1) { - actor_it->info.unk_1C = 0.0f; + actor_it->info.targetOffset = 0.0f; actor_it->info.bonus = 0; AUDIO_PLAY_SFX(0x3100000C, actor_it->sfxSource, 4); } @@ -1795,7 +1793,7 @@ void Katina_8019848C(void) { actor->timer_0C2 = 30; actor->obj.id = OBJ_ACTOR_ALLRANGE; Object_SetInfo(&actor->info, actor->obj.id); - actor->info.unk_1C = 0.0f; + actor->info.targetOffset = 0.0f; actor->info.bonus = 0; AUDIO_PLAY_SFX(0x3100000C, actor->sfxSource, 4); } @@ -2118,7 +2116,7 @@ void Katina_80198AA0(Actor* actor) { radarMark->pos.x = actor->obj.pos.x; radarMark->pos.y = actor->obj.pos.y; radarMark->pos.z = actor->obj.pos.z; - radarMark->unk_10 = actor->unk_0F4.y + 180.0f; + radarMark->yRot = actor->unk_0F4.y + 180.0f; if (actor->iwork[8] != 0) { actor->iwork[8]--; } diff --git a/src/overlays/ovl_i4/fox_sz.c b/src/overlays/ovl_i4/fox_sz.c index cfefb810..e087d5a5 100644 --- a/src/overlays/ovl_i4/fox_sz.c +++ b/src/overlays/ovl_i4/fox_sz.c @@ -49,9 +49,9 @@ void SectorZ_80199900(Actor* actor, s32 arg1) { ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN))) { gCsFrameCount = 0; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; - gPlayer[0].unk_1D0 = 1000; + gPlayer[0].csState = 1000; gActors[0].state = 6; - gPlayer[0].timer_1F8 = 30; + gPlayer[0].csTimer = 30; AUDIO_PLAY_SFX(0x11030010, gActors[0].sfxSource, 0); AUDIO_PLAY_SFX(0x31024059, gActors[0].sfxSource, 0); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 1); @@ -156,10 +156,10 @@ void SectorZ_Missile_Update(Actor* this) { (fabsf(this->fwork[MISSILE_TARGET_Z] - this->obj.pos.z) < 800.0f)) { SectorZ_80199900(this, 0); gCameraShake = 25; - gBosses[0].dmgType = DMG_UNK_100; + gBosses[0].dmgType = DMG_zRot_0FC; if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) { gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; - gPlayer[0].unk_1D0 = 0; + gPlayer[0].csState = 0; gActors[0].state = -31072; return; } @@ -171,7 +171,7 @@ void SectorZ_Missile_Update(Actor* this) { (((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_GFOX_REPAIR)) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN))) { gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; - gPlayer[0].unk_1D0 = 100; + gPlayer[0].csState = 100; gActors[0].state = -31072; } } @@ -245,7 +245,7 @@ void SectorZ_8019A1D0(void) { Object_SetInfo(&actor->info, actor->obj.id); - actor->info.unk_1C = 0.0f; + actor->info.targetOffset = 0.0f; AUDIO_PLAY_SFX(0x31000011, actor->sfxSource, 4); } @@ -453,10 +453,10 @@ void SectorZ_8019A3E8(Actor* actor) { bool SectorZ_8019AA9C(Player* player) { if (player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) { - if ((player->unk_114 > 30.0f) && (player->unk_114 < 150.0f) && (fabsf(player->pos.x - 1270.0f) < 450.0f) && - (fabsf(player->pos.y - 265.0f) < 100.0f) && (fabsf(player->unk_138) < 172.0f)) { + if ((player->yRot_114 > 30.0f) && (player->yRot_114 < 150.0f) && (fabsf(player->pos.x - 1270.0f) < 450.0f) && + (fabsf(player->pos.y - 265.0f) < 100.0f) && (fabsf(player->trueZpos) < 172.0f)) { player->state_1C8 = PLAYERSTATE_1C8_GFOX_REPAIR; - player->unk_1D0 = 0; + player->csState = 0; gActors[0].state = 20; gAllRangeEventTimer--; return true; @@ -662,7 +662,7 @@ void SectorZ_8019B48C(void) { for (i = 0; i < ARRAY_COUNT(D_i4_8019F528); i++, actor++) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->unk_0B6 = 25; actor->obj.pos.x = D_i4_8019F528[i].x; actor->obj.pos.y = D_i4_8019F528[i].y; @@ -678,7 +678,7 @@ void SectorZ_8019B568(void) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = 5000.0f; actor->obj.pos.y = 0.0f; @@ -699,7 +699,7 @@ f32 D_i4_8019F5AC[] = { -30.0f, 20.0f, 30.0f, -40.0f }; void SectorZ_8019B630(Actor* actor, s32 index) { Actor_Initialize(actor); actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = gPlayer[0].cam.eye.x + D_i4_8019F57C[index].x; actor->obj.pos.y = gPlayer[0].cam.eye.y + D_i4_8019F57C[index].y; @@ -727,7 +727,7 @@ void SectorZ_8019B75C(Actor* actor, s32 arg1) { Actor_Initialize(actor); actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = D_i4_8019F5BC[arg1].x + newActor->obj.pos.x; actor->obj.pos.y = newActor->obj.pos.y - 500.0f; @@ -771,7 +771,7 @@ void SectorZ_8019B888(void) { AUDIO_PLAY_SFX(0x3100000C, actor->sfxSource, 4); actor->info.hitbox = SEGMENTED_TO_VIRTUAL(gTeamHitbox); actor->info.unk_16 = 0; - actor->info.unk_1C = 0.0f; + actor->info.targetOffset = 0.0f; } } } @@ -786,11 +786,11 @@ void SectorZ_LevelStart(Player* player) { gAllRangeEventTimer = 0; - switch (player->unk_1D0) { + switch (player->csState) { case 0: gCsFrameCount = 0; - player->unk_1D0++; + player->csState++; SectorZ_8019B568(); SectorZ_8019B48C(); @@ -819,7 +819,7 @@ void SectorZ_LevelStart(Player* player) { if (gCsFrameCount == 320) { actor = &actor[0]; - player->unk_1D0 = 2; + player->csState = 2; actor->vel.x = -10.0f; actor->obj.pos.x = 1000.0f; gCsCamEyeX = 0.0f; @@ -846,7 +846,7 @@ void SectorZ_LevelStart(Player* player) { if (gCsFrameCount == 500) { gCsFrameCount = 520; - player->unk_1D0++; + player->csState++; actor->vel.x = 0.0f; @@ -910,7 +910,7 @@ void SectorZ_LevelStart(Player* player) { gActors[32].vel.y += 0.4f; if (gCsFrameCount > 760) { - player->unk_0E4 += 0.25f; + player->rot.x += 0.25f; } if (gCsFrameCount > 765) { @@ -991,15 +991,15 @@ void SectorZ_LevelStart(Player* player) { case 760: player->unk_194 = 5.0f; player->unk_190 = 5.0f; - player->unk_114 = 90.0f; + player->yRot_114 = 90.0f; player->baseSpeed = gArwingSpeed; player->unk_234 = 1; AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0); break; } - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->rot.y + player->yRot_114 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(player->rot.x * M_DTOR), MTXF_APPLY); sp74.x = 0.0f; sp74.y = 0.0f; @@ -1015,8 +1015,8 @@ void SectorZ_LevelStart(Player* player) { player->pos.y += player->vel.y; player->pos.z += player->vel.z; - player->unk_138 = player->pos.z; - player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; + player->trueZpos = player->pos.z; + player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll; Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0); Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0); @@ -1041,14 +1041,14 @@ void SectorZ_8019C574(Actor* actor, s32 index) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = D_i4_8019F61C[index] * var_fv0; actor->obj.pos.y = D_i4_8019F62C[index]; actor->obj.pos.z = D_i4_8019F63C[index]; actor->fwork[0] = gPlayer[0].baseSpeed; - actor->unk_0F4.y = gPlayer[0].unk_0E8; + actor->unk_0F4.y = gPlayer[0].rot.y; Object_SetInfo(&actor->info, actor->obj.id); @@ -1069,7 +1069,7 @@ void SectorZ_8019C70C(void) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = gBosses[0].obj.pos.x + 700.0f; actor->obj.pos.y = gBosses[0].obj.pos.y - 1000.0f; @@ -1110,14 +1110,14 @@ void SectorZ_LevelComplete(Player* player) { Math_SmoothStepToF(&player->boostSpeed, 0.0f, 0.1f, 1.5f, 0.0f); - switch (player->unk_1D0) { + switch (player->csState) { case 1000: - Math_SmoothStepToF(&player->unk_0E8, -40.0f, 0.1f, 2.5f, 0); - Math_SmoothStepToF(&player->unk_0EC, -60.0f, 0.2f, 5.0f, 0); - Math_SmoothStepToF(&player->unk_0E4, 0, 0.1f, 2.5f, 0); - if (player->timer_1F8 == 0) { - player->unk_1D0 = 1001; - player->timer_1F8 = 100; + Math_SmoothStepToF(&player->rot.y, -40.0f, 0.1f, 2.5f, 0); + Math_SmoothStepToF(&player->rot.z, -60.0f, 0.2f, 5.0f, 0); + Math_SmoothStepToF(&player->rot.x, 0, 0.1f, 2.5f, 0); + if (player->csTimer == 0) { + player->csState = 1001; + player->csTimer = 100; AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0); player->unk_194 = 5.0f; player->unk_190 = 5.0f; @@ -1128,17 +1128,17 @@ void SectorZ_LevelComplete(Player* player) { case 1001: player->unk_190 = 2.0f; - Math_SmoothStepToF(&player->unk_0E4, 15.0f, 0.1f, 0.4f, 0); - Math_SmoothStepToF(&player->unk_0EC, 40.0f, 0.2f, 5.0f, 0); - Math_SmoothStepToF(&player->unk_0E8, 120.0f, 0.1f, 2.0f, 0); + Math_SmoothStepToF(&player->rot.x, 15.0f, 0.1f, 0.4f, 0); + Math_SmoothStepToF(&player->rot.z, 40.0f, 0.2f, 5.0f, 0); + Math_SmoothStepToF(&player->rot.y, 120.0f, 0.1f, 2.0f, 0); player->baseSpeed += 1.0f; if (player->baseSpeed >= 70.0f) { player->baseSpeed = 70.0f; } - if (player->timer_1F8 == 0) { - gPlayer[0].unk_1D0 = 0; + if (player->csTimer == 0) { + gPlayer[0].csState = 0; } break; @@ -1159,7 +1159,7 @@ void SectorZ_LevelComplete(Player* player) { player->camRoll = 0.0f; if (boss0->state != 0) { - player->unk_1D0 = 0; + player->csState = 0; } break; @@ -1174,11 +1174,11 @@ void SectorZ_LevelComplete(Player* player) { D_ctx_80177A48[0] = 1.0f; - player->unk_1D0 = 1; + player->csState = 1; gProjectFar = 30000.0f; - player->timer_1F8 = 550; + player->csTimer = 550; player->baseSpeed = 0.0f; player->camRoll = 0.0f; @@ -1220,8 +1220,8 @@ void SectorZ_LevelComplete(Player* player) { gCsCamAtY = boss0->obj.pos.y + (2.0f * gCameraShakeY); gCsCamAtZ = boss0->obj.pos.z; - if (player->timer_1F8 == 0) { - player->unk_1D0 = 2; + if (player->csTimer == 0) { + player->csState = 2; } break; @@ -1229,7 +1229,7 @@ void SectorZ_LevelComplete(Player* player) { gFillScreenAlphaTarget = 0; gFillScreenAlpha = 0; - if (player->timer_1F8 == 0) { + if (player->csTimer == 0) { if (!gGreatFoxIntact) { SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 50); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50); @@ -1237,8 +1237,8 @@ void SectorZ_LevelComplete(Player* player) { gCsFrameCount = 1280; - player->unk_1D0 = 10; - player->timer_1F8 = 1000; + player->csState = 10; + player->csTimer = 1000; Audio_StopPlayerNoise(0U); Audio_KillSfxBySource(player->sfxSource); @@ -1248,12 +1248,12 @@ void SectorZ_LevelComplete(Player* player) { player->pos.y = 0.0f; player->pos.z = 0.0f; - player->unk_0E4 = 0.0f; + player->rot.x = 0.0f; player->unk_234 = 1; - player->unk_0E8 = 180.0f; - player->unk_0EC = 0.0f; - player->unk_114 = 0.0f; - player->unk_4D8 = 0.0f; + player->rot.y = 180.0f; + player->rot.z = 0.0f; + player->yRot_114 = 0.0f; + player->aerobaticPitch = 0.0f; player->baseSpeed = 40.0f; gCsCamEyeX = 0.0f - (200.0f * var_fv1); @@ -1284,7 +1284,7 @@ void SectorZ_LevelComplete(Player* player) { gCsCamAtZ = player->pos.z; if (gCsFrameCount == 1620) { - player->unk_1D0 += 1; + player->csState += 1; D_ctx_80177A48[0] = 0.0f; D_ctx_80177A48[1] = 0.0f; D_ctx_80177A48[2] = 0.0f; @@ -1325,7 +1325,7 @@ void SectorZ_LevelComplete(Player* player) { if (gCsFrameCount > 2510) { player->baseSpeed += 2.0f; - player->unk_0E4 += 0.1f; + player->rot.x += 0.1f; player->unk_190 = 2.0f; } @@ -1351,7 +1351,7 @@ void SectorZ_LevelComplete(Player* player) { gFillScreenAlphaStep = 8; if (gFillScreenAlpha == 255) { player->state_1C8 = PLAYERSTATE_1C8_NEXT; - player->timer_1F8 = 0; + player->csTimer = 0; gFadeoutType = 4; gLeveLClearStatus[LEVEL_SECTOR_Z] = Play_CheckMedalStatus(100) + 1; } @@ -1524,8 +1524,8 @@ void SectorZ_LevelComplete(Player* player) { break; } - Matrix_RotateY(gCalcMatrix, ((player->unk_114 + player->unk_0E8) + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -(((player->unk_120 + player->unk_0E4) + player->unk_4D8) * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, ((player->yRot_114 + player->rot.y) + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(((player->xRot_120 + player->rot.x) + player->aerobaticPitch) * M_DTOR), MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; @@ -1541,15 +1541,15 @@ void SectorZ_LevelComplete(Player* player) { player->pos.y += player->vel.y; player->pos.z += player->vel.z; - player->unk_138 = player->pos.z; - player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; + player->trueZpos = player->pos.z; + player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll; - Math_SmoothStepToF(&player->unk_130, 0.0f, 0.1f, 15.0f, 0.0f); - Math_SmoothStepToF(&player->unk_12C, 0.0f, 0.1f, 15.0f, 0.0f); + Math_SmoothStepToF(&player->zRotBarrelRoll, 0.0f, 0.1f, 15.0f, 0.0f); + Math_SmoothStepToF(&player->zRotBank, 0.0f, 0.1f, 15.0f, 0.0f); Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 3.0f, 0.0f); - Math_SmoothStepToAngle(&player->unk_4D8, 0.0f, 0.1f, 20.0f, 0.0f); + Math_SmoothStepToAngle(&player->aerobaticPitch, 0.0f, 0.1f, 20.0f, 0.0f); - if (player->unk_1D0 >= 1000) { + if (player->csState >= 1000) { if (player->pos.y < 700.0f) { Math_SmoothStepToF(&player->pos.y, 700.0f, 0.1f, 10.0f, 0.0f); } @@ -1566,10 +1566,10 @@ void SectorZ_LevelComplete(Player* player) { Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0.0f); } - player->unk_088 += 10.0f; - player->unk_080 = -SIN_DEG(player->unk_088) * 0.3f; - player->unk_0F4 += 8.0f; - player->unk_0F0 = SIN_DEG(player->unk_0F4); + player->bobPhase += 10.0f; + player->yBob = -SIN_DEG(player->bobPhase) * 0.3f; + player->rockPhase += 8.0f; + player->rockAngle = SIN_DEG(player->rockPhase); } void SectorZ_8019DD20(Actor* actor) { @@ -1677,9 +1677,9 @@ void SectorZ_8019E234(Actor* actor) { actor->obj.rot.x += actor->unk_0F4.x; actor->obj.rot.y += actor->unk_0F4.y; - if (actor->unk_0D0 != 0) { + if (actor->dmgType != 0) { actor->timer_0C6 = 20; - actor->unk_0D0 = 0; + actor->dmgType = 0; actor->health -= actor->damage; AUDIO_PLAY_SFX(0x2903300E, actor->sfxSource, 4); if (actor->health <= 0) { @@ -1719,7 +1719,7 @@ void SectorZ_8019E454(Boss* boss) { Vec3f src; Vec3f dest; - if (boss->dmgType == DMG_UNK_100) { + if (boss->dmgType == DMG_zRot_0FC) { boss->dmgType = 0; boss->timer_050 = 10; boss->timer_052 = 60; diff --git a/src/overlays/ovl_i5/fox_ma.c b/src/overlays/ovl_i5/fox_ma.c index 25cbc935..5f482ee0 100644 --- a/src/overlays/ovl_i5/fox_ma.c +++ b/src/overlays/ovl_i5/fox_ma.c @@ -471,7 +471,7 @@ void Macbeth_8019A2F4(Actor* actor) { s32 var_a0; for (var_v0 = D_MA_801BE2F0[0]; D_i5_801BA1EC[var_v0].unk_00 != -1.0f; var_v0++) { - if (D_i5_801BA1EC[var_v0].unk_00 < gPlayer[0].unk_138) { + if (D_i5_801BA1EC[var_v0].unk_00 < gPlayer[0].trueZpos) { var_a0 = var_v0; if (var_v0 == 0) { var_a0 = 1; @@ -515,19 +515,19 @@ void Macbeth_8019A2F4(Actor* actor) { } } if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE) { - if (var_fa1 < (gPlayer[0].unk_138 - actor->obj.pos.z - (D_i5_801BA1E4 * 1416 - 1416))) { + if (var_fa1 < (gPlayer[0].trueZpos - actor->obj.pos.z - (D_i5_801BA1E4 * 1416 - 1416))) { Math_SmoothStepToF(&D_i5_801BA1DC, -6.0f, 0.1f, 0.2f, 0.01f); } - if ((gPlayer[0].unk_138 - actor->obj.pos.z - (D_i5_801BA1E4 * 1416 - 1416)) < var_ft4) { + if ((gPlayer[0].trueZpos - actor->obj.pos.z - (D_i5_801BA1E4 * 1416 - 1416)) < var_ft4) { Math_SmoothStepToF(&D_i5_801BA1DC, -30.0f, 0.1f, 0.2f, 0.01f); } - if ((D_i5_801BA1E4 < 5) && (gPlayer[0].unk_138 - actor->obj.pos.z > 4000.0f)) { + if ((D_i5_801BA1E4 < 5) && (gPlayer[0].trueZpos - actor->obj.pos.z > 4000.0f)) { Math_SmoothStepToF(&D_i5_801BA1DC, 0.0f, 0.1f, 1.0f, 0.01f); } - if (gPlayer[0].unk_138 - actor->obj.pos.z > 25000.0f) { + if (gPlayer[0].trueZpos - actor->obj.pos.z > 25000.0f) { D_i5_801BA1DC = 0.0f; } - if (gPlayer[0].unk_138 - actor->obj.pos.z < -8000.0f) { + if (gPlayer[0].trueZpos - actor->obj.pos.z < -8000.0f) { D_i5_801BA1DC = -200.0f; } } @@ -558,13 +558,13 @@ void Macbeth_8019A728(Actor* actor) { } void Macbeth_8019A830(Actor* actor) { - if ((gPlayer[0].unk_138 - actor->obj.pos.z) < -20000.0f) { + if ((gPlayer[0].trueZpos - actor->obj.pos.z) < -20000.0f) { Object_Kill(&actor->obj, actor->sfxSource); } } void Macbeth_8019A87C(Actor* actor) { - if ((gPlayer[0].unk_138 - actor->obj.pos.z) < -2000.0f) { + if ((gPlayer[0].trueZpos - actor->obj.pos.z) < -2000.0f) { Object_Kill(&actor->obj, actor->sfxSource); } } @@ -730,11 +730,11 @@ void Macbeth_8019BE50(Actor* actor) { } bool Macbeth_8019C4EC(Actor* actor) { - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; - if (actor->unk_0D2 == 1) { + if (actor->dmgType != 0) { + actor->dmgType = 0; + if (actor->dmgPart == 1) { AUDIO_PLAY_SFX(0x29034003, actor->sfxSource, 4); - actor->unk_0D0 = 0; + actor->dmgType = 0; actor->iwork[7] = 15; D_i5_801BE320[22] = 0; D_i5_801BE320[4] = 120; @@ -889,7 +889,7 @@ void Macbeth_8019C778(Actor* actor) { Object_Kill(&actor->obj, actor->sfxSource); if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) { gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; - gPlayer[0].unk_1D0 = 0; + gPlayer[0].csState = 0; gMissionStatus = MISSION_COMPLETE; } actor->state++; @@ -899,8 +899,8 @@ void Macbeth_8019C778(Actor* actor) { break; } - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; + if (actor->dmgType != 0) { + actor->dmgType = 0; AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); } @@ -961,8 +961,8 @@ void Macbeth_8019CE88(Actor* actor) { Math_SmoothStepToF(&actor->vel.z, 0.0f, 0.02f, 10.0f, 0.01f); Macbeth_801A015C(actor); Macbeth_8019A87C(actor); - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; + if (actor->dmgType != 0) { + actor->dmgType = 0; actor->timer_0BC = 20; Macbeth_8019BE50(actor); actor->state = 3; @@ -1098,8 +1098,8 @@ void Macbeth_8019D700(Actor* actor) { Math_SmoothStepToF(&actor->vel.z, 0.0f, 0.02f, 10.0f, 0); Macbeth_801A015C(actor); Macbeth_8019A830(actor); - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; + if (actor->dmgType != 0) { + actor->dmgType = 0; actor->timer_0BC = 20; Macbeth_8019BE50(actor); actor->state = 3; @@ -1121,11 +1121,11 @@ void Macbeth_8019D910(Actor* actor, s32* arg1, s32* arg2, s32 arg3, f32 arg4, f3 switch (*arg1) { case 0: - if (((actor->unk_0D0 != 0) && (arg3 == actor->unk_0D2)) || + if (((actor->dmgType != 0) && (arg3 == actor->dmgPart)) || ((D_MA_801BE2F0[1] - 1 == actor->iwork[5]) && (actor->iwork[5] < D_MA_801BE2F0[3])) || (((D_MA_801BE2F0[1] + 1) == actor->iwork[5]) && (D_MA_801BE2F0[3] < actor->iwork[5]))) { AUDIO_PLAY_SFX(0x29034003, actor->sfxSource, 4); - actor->unk_0D0 = 0; + actor->dmgType = 0; func_effect_8007C120(actor->obj.pos.x + arg4, actor->obj.pos.y + 200.0f, actor->obj.pos.z + arg5, actor->vel.x, actor->vel.y, actor->vel.z, 0.15f, 20); actor->iwork[arg3 + 6] = 15; @@ -1135,8 +1135,8 @@ void Macbeth_8019D910(Actor* actor, s32* arg1, s32* arg2, s32 arg3, f32 arg4, f3 (((D_MA_801BE2F0[1] + 1) == actor->iwork[5]) && (D_MA_801BE2F0[3] < actor->iwork[5]))) { (*arg1)++; } - } else if ((actor->unk_0D0 != 0) && (actor->unk_0D2 == 0)) { - actor->unk_0D0 = 0; + } else if ((actor->dmgType != 0) && (actor->dmgPart == 0)) { + actor->dmgType = 0; AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); } break; @@ -1158,12 +1158,12 @@ void Macbeth_8019D910(Actor* actor, s32* arg1, s32* arg2, s32 arg3, f32 arg4, f3 (*arg1)++; break; case 2: - if (((actor->unk_0D0 != 0) && (arg3 == actor->unk_0D2)) || + if (((actor->dmgType != 0) && (arg3 == actor->dmgPart)) || ((D_MA_801BE2F0[1] - 1 == actor->iwork[5]) && (actor->iwork[5] < D_MA_801BE2F0[3])) || (((D_MA_801BE2F0[1] + 1) == actor->iwork[5]) && (D_MA_801BE2F0[3] < actor->iwork[5])) || ((actor->obj.id == OBJ_ACTOR_209) && (arg3 == 2))) { AUDIO_PLAY_SFX(0x29034003, actor->sfxSource, 4); - actor->unk_0D0 = 0; + actor->dmgType = 0; func_effect_8007C120(actor->obj.pos.x + arg4, actor->obj.pos.y + 200.0f, actor->obj.pos.z + arg5, actor->vel.x, actor->vel.y, actor->vel.z, 0.15f, 20); actor->iwork[arg3 + 6] = 20; @@ -1175,8 +1175,8 @@ void Macbeth_8019D910(Actor* actor, s32* arg1, s32* arg2, s32 arg3, f32 arg4, f3 gHitCount++; (*arg1)++; } - } else if ((actor->unk_0D0 != 0) && (actor->unk_0D2 == 0)) { - actor->unk_0D0 = 0; + } else if ((actor->dmgType != 0) && (actor->dmgPart == 0)) { + actor->dmgType = 0; AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); } break; @@ -1264,8 +1264,8 @@ void Macbeth_8019E410(Actor* actor) { Math_SmoothStepToF(&actor->vel.z, 0.0f, 0.02f, 10.0f, 0.01f); Macbeth_801A015C(actor); Macbeth_8019A87C(actor); - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; + if (actor->dmgType != 0) { + actor->dmgType = 0; actor->timer_0BC = 20; Macbeth_8019BE50(actor); actor->state = 3; @@ -1287,11 +1287,11 @@ f32 D_i5_801BE24C; void Macbeth_8019E624(Actor* actor, s32* arg1, s32* arg2, s32 arg3, f32 arg4, f32 arg5, s32* arg6) { switch (*arg1) { case 0: - if (((actor->unk_0D0 != 0) && (arg3 == actor->unk_0D2)) || + if (((actor->dmgType != 0) && (arg3 == actor->dmgPart)) || ((D_MA_801BE2F0[1] - 1 == actor->iwork[5]) && (actor->iwork[5] < D_MA_801BE2F0[3])) || (((D_MA_801BE2F0[1] + 1) == actor->iwork[5]) && (D_MA_801BE2F0[3] < actor->iwork[5]))) { AUDIO_PLAY_SFX(0x29034003, actor->sfxSource, 4); - actor->unk_0D0 = 0; + actor->dmgType = 0; func_effect_8007C120(actor->obj.pos.x + arg4, actor->obj.pos.y + 200.0f, actor->obj.pos.z + arg5, actor->vel.x, actor->vel.y, actor->vel.z, 0.15f, 10); actor->iwork[7] = 15; @@ -1301,8 +1301,8 @@ void Macbeth_8019E624(Actor* actor, s32* arg1, s32* arg2, s32 arg3, f32 arg4, f3 (((D_MA_801BE2F0[1] + 1) == actor->iwork[5]) && (D_MA_801BE2F0[3] < actor->iwork[5]))) { (*arg1)++; } - } else if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; + } else if (actor->dmgType != 0) { + actor->dmgType = 0; AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); } Macbeth_8019B580(actor, arg2); @@ -1314,11 +1314,11 @@ void Macbeth_8019E624(Actor* actor, s32* arg1, s32* arg2, s32 arg3, f32 arg4, f3 (*arg1)++; break; case 2: - if (((actor->unk_0D0 != 0) && (arg3 == actor->unk_0D2)) || + if (((actor->dmgType != 0) && (arg3 == actor->dmgPart)) || ((D_MA_801BE2F0[1] - 1 == actor->iwork[5]) && (actor->iwork[5] < D_MA_801BE2F0[3])) || (((D_MA_801BE2F0[1] + 1) == actor->iwork[5]) && (D_MA_801BE2F0[3] < actor->iwork[5]))) { AUDIO_PLAY_SFX(0x29034003, actor->sfxSource, 4); - actor->unk_0D0 = 0; + actor->dmgType = 0; func_effect_8007C120(actor->obj.pos.x + arg4, actor->obj.pos.y + 200.0f, actor->obj.pos.z + arg5, actor->vel.x, actor->vel.y, actor->vel.z, 0.2f, 10); actor->iwork[7] = 15; @@ -1330,8 +1330,8 @@ void Macbeth_8019E624(Actor* actor, s32* arg1, s32* arg2, s32 arg3, f32 arg4, f3 (*arg1)++; } } else { - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; + if (actor->dmgType != 0) { + actor->dmgType = 0; AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); } } @@ -1372,8 +1372,8 @@ void Macbeth_8019EA60(Actor* actor) { Math_SmoothStepToF(&actor->vel.z, 0.0f, 0.02f, 10.0f, 0.01f); Macbeth_801A015C(actor); Macbeth_8019A87C(actor); - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; + if (actor->dmgType != 0) { + actor->dmgType = 0; actor->timer_0BC = 20; Macbeth_8019BE50(actor); actor->state = 3; @@ -1393,11 +1393,11 @@ void Macbeth_8019EA60(Actor* actor) { void Macbeth_8019EBF8(Actor* actor, s32* arg1, s32* arg2, s32 arg3, f32 arg4, f32 arg5, s32* arg6) { switch (*arg1) { case 0: - if (((actor->unk_0D0 != 0) && (arg3 == actor->unk_0D2)) || + if (((actor->dmgType != 0) && (arg3 == actor->dmgPart)) || ((D_MA_801BE2F0[1] - 1 == actor->iwork[5]) && (actor->iwork[5] < D_MA_801BE2F0[3])) || (((D_MA_801BE2F0[1] + 1) == actor->iwork[5]) && (D_MA_801BE2F0[3] < actor->iwork[5]))) { AUDIO_PLAY_SFX(0x29034003, actor->sfxSource, 4); - actor->unk_0D0 = 0; + actor->dmgType = 0; func_effect_8007C120(actor->obj.pos.x + arg4, actor->obj.pos.y + 200.0f, actor->obj.pos.z + arg5, actor->vel.x, actor->vel.y, actor->vel.z, 0.15f, 10); actor->iwork[7] = 15; @@ -1408,8 +1408,8 @@ void Macbeth_8019EBF8(Actor* actor, s32* arg1, s32* arg2, s32 arg3, f32 arg4, f3 gHitCount++; (*arg1)++; } - } else if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; + } else if (actor->dmgType != 0) { + actor->dmgType = 0; AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); } Macbeth_8019B580(actor, arg2); @@ -1440,9 +1440,10 @@ void Macbeth_8019EE68(Actor* actor) { } gFillScreenRed = gFillScreenGreen = gFillScreenBlue = gFillScreenAlpha = 255; gCameraShake = 35; - if ((gPlayer[0].unk_138 - actor->obj.pos.z > -200.0f) && (gPlayer[0].unk_138 - actor->obj.pos.z < 200.0f) && - (gPlayer[0].pos.y - actor->obj.pos.y > -300.0f) && (gPlayer[0].pos.y - actor->obj.pos.y < 300.0f) && - (gPlayer[0].pos.x - actor->obj.pos.x > -800.0f) && (gPlayer[0].pos.x - actor->obj.pos.x < 800.0f)) { + if ((gPlayer[0].trueZpos - actor->obj.pos.z > -200.0f) && + (gPlayer[0].trueZpos - actor->obj.pos.z < 200.0f) && (gPlayer[0].pos.y - actor->obj.pos.y > -300.0f) && + (gPlayer[0].pos.y - actor->obj.pos.y < 300.0f) && (gPlayer[0].pos.x - actor->obj.pos.x > -800.0f) && + (gPlayer[0].pos.x - actor->obj.pos.x < 800.0f)) { gFillScreenRed = gFillScreenAlpha = 255; gFillScreenGreen = gFillScreenBlue = 0; Player_ApplyDamage(&gPlayer[0], 0, 60); @@ -1464,7 +1465,7 @@ void Macbeth_8019EE68(Actor* actor) { Macbeth_801A015C(actor); Macbeth_8019A87C(actor); if (gCameraShake == 20) { - actor->unk_0D0 = 0; + actor->dmgType = 0; actor->timer_0BC = 20; Macbeth_8019BE50(actor); actor->state = 3; @@ -1495,7 +1496,7 @@ void Macbeth_8019F164(Actor* actor) { sp44 = 0; sp6C.x = gPlayer[0].pos.x - actor->obj.pos.x + actor->fwork[25]; sp6C.y = gPlayer[0].pos.y - 25.0f - actor->obj.pos.y + actor->fwork[8] + 25.0f; - sp6C.z = gPlayer[0].unk_138 - 500.0f - actor->obj.pos.z; + sp6C.z = gPlayer[0].trueZpos - 500.0f - actor->obj.pos.z; for (i = 0; i < 60; i++) { if ((gActors[i].obj.id == OBJ_ACTOR_219) && (gActors[i].obj.status == OBJ_ACTIVE)) { @@ -1562,8 +1563,8 @@ void Macbeth_8019F164(Actor* actor) { (gPlayer[0].pos.x - actor->obj.pos.x < 3000.0f)) || ((gPlayer[0].pos.x - actor->obj.pos.x < -300.0f) && (gPlayer[0].pos.x - actor->obj.pos.x > -3000.0f))) { - if ((gPlayer[0].unk_138 - actor->obj.pos.z < 5000.0f) && - (gPlayer[0].unk_138 - actor->obj.pos.z > 200.0f) && (actor->timer_0BC == 0) && + if ((gPlayer[0].trueZpos - actor->obj.pos.z < 5000.0f) && + (gPlayer[0].trueZpos - actor->obj.pos.z > 200.0f) && (actor->timer_0BC == 0) && (actor->health != 0)) { sp60.x -= 60.0f; func_effect_8007EE68(OBJ_EFFECT_378, &sp60, &sp54, &sp48, &D_i5_801BA714, 1.0f); @@ -1640,11 +1641,11 @@ void Macbeth_8019F164(Actor* actor) { void Macbeth_8019FC54(Actor* actor, s32* arg1, s32* arg2, s32 arg3, s32 arg4, f32 arg5, f32 arg6, s32* arg7) { switch (*arg1) { case 0: - if (((actor->unk_0D0 != 0) && (actor->unk_0D2 >= arg3) && (arg4 >= actor->unk_0D2)) || + if (((actor->dmgType != 0) && (actor->dmgPart >= arg3) && (arg4 >= actor->dmgPart)) || ((D_MA_801BE2F0[1] - 1 == actor->iwork[5]) && (actor->iwork[5] < D_MA_801BE2F0[3])) || (((D_MA_801BE2F0[1] + 1) == actor->iwork[5]) && (D_MA_801BE2F0[3] < actor->iwork[5]))) { AUDIO_PLAY_SFX(0x29034003, actor->sfxSource, 4); - actor->unk_0D0 = 0; + actor->dmgType = 0; func_effect_8007C120(actor->obj.pos.x + arg5, actor->obj.pos.y + 200.0f, actor->obj.pos.z + arg6, actor->vel.x, actor->vel.y, actor->vel.z, 0.15f, 10); actor->iwork[7] = 15; @@ -1658,8 +1659,8 @@ void Macbeth_8019FC54(Actor* actor, s32* arg1, s32* arg2, s32 arg3, s32 arg4, f3 } (*arg1)++; } - } else if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; + } else if (actor->dmgType != 0) { + actor->dmgType = 0; AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); } Macbeth_8019B580(actor, arg2); @@ -1711,8 +1712,8 @@ void Macbeth_8019FF9C(Actor* actor) { Math_SmoothStepToF(&actor->vel.z, 0.0f, 0.02f, 10.0f, 0.01f); Macbeth_801A015C(actor); Macbeth_8019A87C(actor); - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; + if (actor->dmgType != 0) { + actor->dmgType = 0; actor->timer_0BC = 20; Macbeth_8019BE50(actor); actor->state = 3; @@ -2051,13 +2052,13 @@ void Macbeth_801A12C4(Actor* actor) { s32 id; if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) { - if (((gPlayer[0].unk_138 - actor->obj.pos.z) > 7000.0f) || - ((gPlayer[0].unk_138 - actor->obj.pos.z) < -1000.0f)) { + if (((gPlayer[0].trueZpos - actor->obj.pos.z) > 7000.0f) || + ((gPlayer[0].trueZpos - actor->obj.pos.z) < -1000.0f)) { return; } } else { - if (((gPlayer[0].unk_138 - actor->obj.pos.z) > 7000.0f) || - ((gPlayer[0].unk_138 - actor->obj.pos.z) < -5000.0f)) { + if (((gPlayer[0].trueZpos - actor->obj.pos.z) > 7000.0f) || + ((gPlayer[0].trueZpos - actor->obj.pos.z) < -5000.0f)) { return; } } @@ -2069,7 +2070,7 @@ void Macbeth_801A12C4(Actor* actor) { Matrix_SetGfxMtx(&gMasterDisp); if ((actor->obj.id != OBJ_ACTOR_206) && (actor->obj.id != OBJ_ACTOR_205)) { - if (((gPlayer[0].unk_138 - actor->obj.pos.z) > 3000.0f) && (D_i5_801BE310 != actor->iwork[5])) { + if (((gPlayer[0].trueZpos - actor->obj.pos.z) > 3000.0f) && (D_i5_801BE310 != actor->iwork[5])) { gSPDisplayList(gMasterDisp++, D_MA_6027BF0); gSPDisplayList(gMasterDisp++, D_MA_601BE90); } else { @@ -2216,7 +2217,7 @@ void Macbeth_801A12C4(Actor* actor) { Matrix_RotateX(gGfxMatrix, actor->fwork[27] * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); Matrix_Scale(gGfxMatrix, actor->scale, actor->scale, actor->scale, MTXF_APPLY); - if ((gPlayer[0].unk_138 - actor->obj.pos.z) > 3000.0f) { + if ((gPlayer[0].trueZpos - actor->obj.pos.z) > 3000.0f) { gSPDisplayList(gMasterDisp++, D_MA_6027D40); } else if (actor->vel.z > -2.0f) { gSPDisplayList(gMasterDisp++, D_MA_60227F0); @@ -2231,7 +2232,7 @@ void Macbeth_801A12C4(Actor* actor) { Matrix_Scale(gGfxMatrix, actor->scale, actor->scale, actor->scale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL(&gMasterDisp, 0x1D); - if ((gPlayer[0].unk_138 - actor->obj.pos.z) > 3000.0f) { + if ((gPlayer[0].trueZpos - actor->obj.pos.z) > 3000.0f) { gSPDisplayList(gMasterDisp++, D_MA_6027D40); } else if (actor->vel.z > -2.0f) { gSPDisplayList(gMasterDisp++, D_MA_60227F0); @@ -2302,7 +2303,7 @@ void Macbeth_801A23AC(Scenery* scenery) { case OBJ_SCENERY_94: case OBJ_SCENERY_97: if ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE) && - ((gPlayer[0].unk_138 - scenery->obj.pos.z) < -2500.0f)) { + ((gPlayer[0].trueZpos - scenery->obj.pos.z) < -2500.0f)) { Object_Kill(&scenery->obj, scenery->sfxSource); } gSPDisplayList(gMasterDisp++, D_MA_6026860); @@ -2310,7 +2311,7 @@ void Macbeth_801A23AC(Scenery* scenery) { case OBJ_SCENERY_95: case OBJ_SCENERY_98: if ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE) && - ((gPlayer[0].unk_138 - scenery->obj.pos.z) < -2500.0f)) { + ((gPlayer[0].trueZpos - scenery->obj.pos.z) < -2500.0f)) { Object_Kill(&scenery->obj, scenery->sfxSource); } gSPDisplayList(gMasterDisp++, D_MA_602FBF0); @@ -2776,14 +2777,14 @@ void Macbeth_801A3E70(Actor* actor) { } void Macbeth_801A3E98(Actor* actor) { - if ((gPlayer[0].unk_138 - actor->obj.pos.z) < -500.0f) { + if ((gPlayer[0].trueZpos - actor->obj.pos.z) < -500.0f) { Object_Kill(&actor->obj, actor->sfxSource); } switch (actor->state) { case 0: - if ((actor->unk_0D0 != 0) && (actor->unk_0D0 != 3)) { - actor->unk_0D0 = 0; + if ((actor->dmgType != 0) && (actor->dmgType != 3)) { + actor->dmgType = 0; AUDIO_PLAY_SFX(0x1903205F, actor->sfxSource, 0); actor->state = 1; } @@ -2811,9 +2812,9 @@ void Macbeth_801A3E98(Actor* actor) { case 3: break; } - if (actor->unk_0D0 != 0) { + if (actor->dmgType != 0) { AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); - actor->unk_0D0 = 0; + actor->dmgType = 0; } Math_SmoothStepToF(&actor->fwork[0], 30.0f, 0.4f, 10.0f, 0.0f); Math_SmoothStepToF(&actor->fwork[4], 30.0f, 0.4f, 10.0f, 0.0f); @@ -2884,7 +2885,7 @@ void Macbeth_801A4660(Actor* actor) { } void Macbeth_801A46A0(Actor* actor) { - if ((gPlayer[0].unk_138 - actor->obj.pos.z) < -500.0f) { + if ((gPlayer[0].trueZpos - actor->obj.pos.z) < -500.0f) { Object_Kill(&actor->obj, actor->sfxSource); } @@ -2945,7 +2946,7 @@ void Macbeth_801A46A0(Actor* actor) { } void Macbeth_801A49B8(Actor* actor) { - if (actor->unk_0D0 != 0) { + if (actor->dmgType != 0) { AUDIO_PLAY_SFX(0x29024003, actor->sfxSource, 0); actor->timer_0C6 = 15; actor->health -= actor->damage; @@ -2954,7 +2955,7 @@ void Macbeth_801A49B8(Actor* actor) { gHitCount++; actor->state = 2; } - actor->unk_0D0 = 0; + actor->dmgType = 0; } } @@ -2982,7 +2983,7 @@ void Macbeth_801A4B24(Actor* actor) { u8 j; var_s0 = 0; - if ((gPlayer[0].unk_138 - actor->obj.pos.z) < -700.0f) { + if ((gPlayer[0].trueZpos - actor->obj.pos.z) < -700.0f) { if (D_MA_801BE2F0[5] == 0) { Radio_PlayMessage(gMsg_ID_17170, RCID_PEPPY); } @@ -3003,7 +3004,7 @@ void Macbeth_801A4B24(Actor* actor) { } break; case 1: - if ((gPlayer[0].unk_138 - actor->obj.pos.z) < 2000.0f) { + if ((gPlayer[0].trueZpos - actor->obj.pos.z) < 2000.0f) { actor->info.hitbox = SEGMENTED_TO_VIRTUAL(D_MA_6036520); actor->state = 2; } @@ -3030,8 +3031,8 @@ void Macbeth_801A4B24(Actor* actor) { } break; case 5: - if ((actor->unk_0D0 != 0) && (actor->unk_0D2 == 3)) { - actor->unk_0D0 = 0; + if ((actor->dmgType != 0) && (actor->dmgPart == 3)) { + actor->dmgType = 0; D_MA_801BE2F0[5] = 1; gLevelObjects = SEGMENTED_TO_VIRTUAL(gLevelObjectInits[gCurrentLevel]); @@ -3042,7 +3043,7 @@ void Macbeth_801A4B24(Actor* actor) { gObjectLoadIndex = i; gTeamLowHealthMsgTimer = -1; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; - gPlayer[0].unk_1D0 = 0; + gPlayer[0].csState = 0; gMissionStatus = MISSION_ACCOMPLISHED; actor->timer_0BC = 5; actor->state = 6; @@ -3069,8 +3070,8 @@ void Macbeth_801A4B24(Actor* actor) { default: break; } - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; + if (actor->dmgType != 0) { + actor->dmgType = 0; AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); } Math_SmoothStepToF(&actor->fwork[0], 30, 0.4f, actor->fwork[1], 0.0f); @@ -3152,8 +3153,8 @@ s32 Macbeth_801A55D4(s32 arg0, Vec3f* arg1, Vec3f* arg2, s32 arg3) { if ((actor->obj.status >= OBJ_ACTIVE) && (fabsf(arg1->x - actor->obj.pos.x) < 1000.0f) && (fabsf(arg1->z - actor->obj.pos.z) < 1500.0f) && (arg0 != i) && (actor->info.unk_16 != 2) && (actor->timer_0C2 == 0) && (Object_CheckSingleHitbox(arg1, actor->info.hitbox, &actor->obj.pos) != 0)) { - actor->unk_0D0 = 1; - actor->unk_0D2 = -1; + actor->dmgType = 1; + actor->dmgPart = -1; actor->hitPos.x = arg1->x; actor->hitPos.y = arg1->y; actor->hitPos.z = arg1->z; @@ -3169,7 +3170,7 @@ void Macbeth_801A57D0(Effect* effect) { Vec3f sp44; Vec3f sp38; - if ((gPlayer[0].unk_138 - effect->obj.pos.z) < -2000.0f) { + if ((gPlayer[0].trueZpos - effect->obj.pos.z) < -2000.0f) { Object_Kill(&effect->obj, effect->sfxSource); } effect->obj.rot.x = 0.0f; @@ -3180,10 +3181,10 @@ void Macbeth_801A57D0(Effect* effect) { func_effect_8007BC7C(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 6.0f); } } - if ((fabsf(gPlayer[0].unk_138 - effect->obj.pos.z) < 50.0f) && + if ((fabsf(gPlayer[0].trueZpos - effect->obj.pos.z) < 50.0f) && (fabsf(gPlayer[0].pos.x - effect->obj.pos.x) < 30.0f) && (fabsf(gPlayer[0].pos.y - effect->obj.pos.y) < 30.0f)) { - if ((gPlayer[0].unk_280 != 0) || (gPlayer[0].timer_27C != 0)) { + if ((gPlayer[0].barrelRollAlpha != 0) || (gPlayer[0].meteoWarpTimer != 0)) { sp50.x = 0.0f; sp50.y = 0.0f; sp50.z = 100.0f; @@ -3193,11 +3194,11 @@ void Macbeth_801A57D0(Effect* effect) { effect->vel.z = sp44.z; AUDIO_PLAY_SFX(0x09007011, effect->sfxSource, 4); } - if ((gPlayer[0].unk_280 == 0) && (gPlayer[0].timer_498 == 0)) { + if ((gPlayer[0].barrelRollAlpha == 0) && (gPlayer[0].timer_498 == 0)) { Player_ApplyDamage(&gPlayer[0], 0, effect->info.damage); - gPlayer[0].unk_0D8.x = 20.0f; + gPlayer[0].knockback.x = 20.0f; if (effect->vel.x < 0.0f) { - gPlayer[0].unk_0D8.x *= -1.0f; + gPlayer[0].knockback.x *= -1.0f; } Object_Kill(&effect->obj, effect->sfxSource); } @@ -3226,7 +3227,7 @@ void Macbeth_801A5AF0(Effect* effect) { } void Macbeth_801A5B4C(Effect* effect) { - if ((gPlayer[0].unk_138 - effect->obj.pos.z) < -2000.0f) { + if ((gPlayer[0].trueZpos - effect->obj.pos.z) < -2000.0f) { Object_Kill(&effect->obj, effect->sfxSource); } effect->obj.rot.x = 20.0f; @@ -3236,17 +3237,17 @@ void Macbeth_801A5B4C(Effect* effect) { effect->obj.rot.y = 0.0f; } effect->obj.rot.z = 0.0f; - if ((fabsf(gPlayer[0].unk_138 - effect->obj.pos.z) < 100.0f) && + if ((fabsf(gPlayer[0].trueZpos - effect->obj.pos.z) < 100.0f) && (fabsf(gPlayer[0].pos.x - effect->obj.pos.x) < 100.0f) && (fabsf(gPlayer[0].pos.y - effect->obj.pos.y) < 30.0f) && (gPlayer[0].timer_498 == 0)) { Player_ApplyDamage(gPlayer, 0, effect->info.damage); - gPlayer[0].unk_0D8.x = 20.0f; + gPlayer[0].knockback.x = 20.0f; if (effect->vel.x < 0.0f) { - gPlayer[0].unk_0D8.x *= -1.0f; + gPlayer[0].knockback.x *= -1.0f; } - gPlayer[0].unk_0D8.y = 20.0f; + gPlayer[0].knockback.y = 20.0f; if (effect->vel.y < 0.0f) { - gPlayer[0].unk_0D8.y *= -1.0f; + gPlayer[0].knockback.y *= -1.0f; } Object_Kill(&effect->obj, effect->sfxSource); } @@ -3276,7 +3277,7 @@ void Macbeth_801A5E2C(Actor* actor) { } void Macbeth_801A5E54(Actor* actor) { - if ((gPlayer[0].unk_138 - actor->obj.pos.z) < -500.0f) { + if ((gPlayer[0].trueZpos - actor->obj.pos.z) < -500.0f) { Object_Kill(&actor->obj, actor->sfxSource); } if ((D_i5_801BA1E0 - actor->obj.pos.z) < -800.0f) { @@ -3286,8 +3287,8 @@ void Macbeth_801A5E54(Actor* actor) { } Math_SmoothStepToF(&actor->obj.pos.x, actor->fwork[0] + (actor->fwork[2] * 400.0f), 0.1f, 4.0f, 0.01f); } - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; + if (actor->dmgType != 0) { + actor->dmgType = 0; AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); } } @@ -3300,18 +3301,18 @@ void Macbeth_801A5FC4(s32 arg0) { } void Macbeth_801A5FD0(Actor* actor) { - if (gPlayer[0].unk_138 - actor->obj.pos.z < -500.0f) { + if (gPlayer[0].trueZpos - actor->obj.pos.z < -500.0f) { Object_Kill(&actor->obj, actor->sfxSource); } - if (gPlayer[0].unk_138 - actor->obj.pos.z < actor->fwork[2]) { + if (gPlayer[0].trueZpos - actor->obj.pos.z < actor->fwork[2]) { if (actor->iwork[0] == 0) { AUDIO_PLAY_SFX(0x19001062, actor->sfxSource, 0); actor->iwork[0] += 1; } Math_SmoothStepToF(&actor->obj.pos.y, actor->fwork[1] + 356.0f, 0.4f, 20.0f, 0.01f); } - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; + if (actor->dmgType != 0) { + actor->dmgType = 0; AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); } } @@ -3327,19 +3328,19 @@ void Macbeth_801A6134(Actor* actor) { void Macbeth_801A6144(Actor* actor) { s16 i; - if ((gPlayer[0].unk_138 - actor->obj.pos.z) < -500.0f) { + if ((gPlayer[0].trueZpos - actor->obj.pos.z) < -500.0f) { Object_Kill(&actor->obj, actor->sfxSource); } switch (actor->state) { case 0: - if (actor->unk_0D0 != 0) { + if (actor->dmgType != 0) { func_effect_8007C120(actor->obj.pos.x, actor->obj.pos.y + 100.0f, actor->obj.pos.z, actor->vel.x, actor->vel.y, actor->vel.z, 0.15f, 20); AUDIO_PLAY_SFX(0x2903300E, actor->sfxSource, 4); actor->health -= actor->damage; actor->timer_0C6 = 15; - if ((gPlayer[0].unk_138 - 20.0f) < actor->obj.pos.z) { + if ((gPlayer[0].trueZpos - 20.0f) < actor->obj.pos.z) { actor->health = 0; } if (actor->health <= 0) { @@ -3357,7 +3358,7 @@ void Macbeth_801A6144(Actor* actor) { actor->timer_0BC = 20; actor->state = 1; } - actor->unk_0D0 = 0; + actor->dmgType = 0; } break; case 1: @@ -3387,7 +3388,7 @@ void Macbeth_801A65E0(Scenery* scenery) { } void Macbeth_801A6608(Scenery* scenery) { - if ((gPlayer[0].unk_138 - scenery->obj.pos.z) < scenery->vel.z) { + if ((gPlayer[0].trueZpos - scenery->obj.pos.z) < scenery->vel.z) { if (gPlayState != PLAY_PAUSE) { Math_SmoothStepToF(&scenery->vel.x, 30, 0.5f, 30.0f, 0.0f); if (scenery->vel.x < 31.0f) { @@ -3406,11 +3407,11 @@ void Macbeth_801A67BC(s32 arg0) { } void Macbeth_801A67C8(Actor* actor) { - if ((gPlayer[0].unk_138 - actor->obj.pos.z) < -300.0f) { + if ((gPlayer[0].trueZpos - actor->obj.pos.z) < -300.0f) { Object_Kill(&actor->obj, actor->sfxSource); } - if ((actor->unk_0D0 != 0) && (actor->unk_0D2 == -1)) { - actor->unk_0D0 = 0; + if ((actor->dmgType != 0) && (actor->dmgPart == -1)) { + actor->dmgType = 0; if (actor->obj.pos.x <= gPlayer[0].pos.x) { actor->iwork[4] = 1; } else { @@ -3428,16 +3429,16 @@ void Macbeth_801A68EC(Actor* actor) { void Macbeth_801A68F8(Actor* actor, s16 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7) { gTexturedLines[arg1].mode = 3; - gTexturedLines[arg1].unk_04.x = arg2; - gTexturedLines[arg1].unk_04.y = arg3; - gTexturedLines[arg1].unk_28 = 5.0f; - gTexturedLines[arg1].unk_2C = gTexturedLines[arg1].unk_2D = gTexturedLines[arg1].unk_2E = - gTexturedLines[arg1].unk_2F = 255; + gTexturedLines[arg1].posAA.x = arg2; + gTexturedLines[arg1].posAA.y = arg3; + gTexturedLines[arg1].xyScale = 5.0f; + gTexturedLines[arg1].red = gTexturedLines[arg1].green = gTexturedLines[arg1].blue = gTexturedLines[arg1].alpha = + 255; gTexturedLines[arg1].timer = 3; - gTexturedLines[arg1].unk_04.z = arg4; - gTexturedLines[arg1].unk_10.x = arg5; - gTexturedLines[arg1].unk_10.y = arg6; - gTexturedLines[arg1].unk_10.z = arg7; + gTexturedLines[arg1].posAA.z = arg4; + gTexturedLines[arg1].posBB.x = arg5; + gTexturedLines[arg1].posBB.y = arg6; + gTexturedLines[arg1].posBB.z = arg7; } void Macbeth_801A6984(Actor* actor) { @@ -3461,7 +3462,7 @@ void Macbeth_801A6984(Actor* actor) { f32 sp80; var_s3 = 0; - if ((gPlayer[0].unk_138 - actor->obj.pos.z) > 7000.0f) { + if ((gPlayer[0].trueZpos - actor->obj.pos.z) > 7000.0f) { return; } test.x = actor->obj.pos.x - D_i5_801BE368[4]; @@ -3528,7 +3529,7 @@ void Macbeth_801A6C78(Actor* actor) { D_i5_801BE320[7] = 0; Math_SmoothStepToF(&D_i5_801BE368[2], 15.0f, 0.2f, 2.0f, 0.01f); D_i5_801BE368[3] += D_i5_801BE368[2]; - if ((((gPlayer[0].unk_138 - actor->obj.pos.z) * 0.25f) < D_i5_801BE368[3]) || + if ((((gPlayer[0].trueZpos - actor->obj.pos.z) * 0.25f) < D_i5_801BE368[3]) || (D_i5_801BE368[3] > 8000.0f)) { D_i5_801BE320[1] = 1; } @@ -3576,7 +3577,7 @@ void Macbeth_801A6FB4(Actor* actor) { D_i5_801BE320[8] = 1; Math_SmoothStepToF(&D_i5_801BE368[2], 15.0f, 0.2f, 2.0f, 0.01f); D_i5_801BE368[3] += D_i5_801BE368[2]; - if ((((gPlayer[0].unk_138 - actor->obj.pos.z) * 0.25f) < D_i5_801BE368[3]) || + if ((((gPlayer[0].trueZpos - actor->obj.pos.z) * 0.25f) < D_i5_801BE368[3]) || (D_i5_801BE368[3] > 8000.0f)) { D_i5_801BE320[1] = 1; } @@ -3643,7 +3644,7 @@ void Macbeth_801A74C4(Actor* actor) { D_i5_801BE320[7] = 1; Math_SmoothStepToF(&D_i5_801BE368[2], 10.0f, 0.4f, 10.0f, 0.01f); D_i5_801BE368[3] += D_i5_801BE368[2]; - if ((((gPlayer[0].unk_138 - actor->obj.pos.z) * 0.25f) < D_i5_801BE368[3]) || + if ((((gPlayer[0].trueZpos - actor->obj.pos.z) * 0.25f) < D_i5_801BE368[3]) || (D_i5_801BE368[3] > 8000.0f)) { D_i5_801BE320[1] = 1; } @@ -3756,7 +3757,7 @@ void Macbeth_801A7CAC(Actor* actor) { f32 sp2C; temp_fa0 = gPlayer[0].pos.x - actor->obj.pos.x; - temp_fa1 = (gPlayer[0].unk_138 - 130.0f) - actor->obj.pos.z; + temp_fa1 = (gPlayer[0].trueZpos - 130.0f) - actor->obj.pos.z; sp2C = sqrtf(SQ(temp_fa0) + SQ(temp_fa1)); sp30 = Math_Atan2F(temp_fa0, temp_fa1); sp34 = -Math_Atan2F(gPlayer[0].pos.y - actor->obj.pos.y, sp2C); @@ -3959,12 +3960,12 @@ void Macbeth_801A7E7C(Actor* actor) { Macbeth_8019A198(actor); Macbeth_801A0308(actor, actor->obj.pos.z, actor->obj.rot.y, 0); Math_SmoothStepToF(&actor->obj.pos.x, gPlayer[0].pos.x, 0.1f, 10.0f, 0.01f); - Math_SmoothStepToF(&actor->obj.pos.z, gPlayer[0].unk_138 - 1500.0f, 0.1f, 20.0f, 0.01f); + Math_SmoothStepToF(&actor->obj.pos.z, gPlayer[0].trueZpos - 1500.0f, 0.1f, 20.0f, 0.01f); Math_SmoothStepToF(&actor->obj.pos.y, - (actor->fwork[5] + 600.0f + (gPlayer[0].unk_138 - actor->obj.pos.z) * 0.25f) + 10.0f, + (actor->fwork[5] + 600.0f + (gPlayer[0].trueZpos - actor->obj.pos.z) * 0.25f) + 10.0f, 0.1f, 10.0f, 0.01f); - if (((actor->fwork[5] + 600.0f + (gPlayer[0].unk_138 - actor->obj.pos.z) * 0.25f) <= actor->obj.pos.y) && - (actor->obj.pos.z < (gPlayer[0].unk_138 - 1300.0f))) { + if (((actor->fwork[5] + 600.0f + (gPlayer[0].trueZpos - actor->obj.pos.z) * 0.25f) <= actor->obj.pos.y) && + (actor->obj.pos.z < (gPlayer[0].trueZpos - 1300.0f))) { actor->timer_0BC = 0; actor->state = 6; } @@ -3981,7 +3982,7 @@ void Macbeth_801A7E7C(Actor* actor) { Macbeth_801A6984(actor); break; case 7: - if ((gPlayer[0].unk_138 - actor->obj.pos.z) < 1200.0f) { + if ((gPlayer[0].trueZpos - actor->obj.pos.z) < 1200.0f) { if (D_i5_801BE320[3] < (Animation_GetFrameCount(&D_MA_601D188) - 1)) { D_i5_801BE320[3] = (s16) (D_i5_801BE320[3] + 1); if ((D_i5_801BE320[3] == 26) && (D_i5_801BE320[10] > 0)) { @@ -4017,7 +4018,7 @@ void Macbeth_801A7E7C(Actor* actor) { var_fv0 = 100.0f; break; } - if (var_fv0 < (gPlayer[0].unk_138 - actor->obj.pos.z)) { + if (var_fv0 < (gPlayer[0].trueZpos - actor->obj.pos.z)) { Macbeth_801A7CAC(actor); D_i5_801BE368[9] = gPlayer[0].pos.x; } @@ -4027,7 +4028,7 @@ void Macbeth_801A7E7C(Actor* actor) { } else { Math_SmoothStepToF(&actor->obj.pos.y, gPlayer[0].pos.y + 1210.0f, 0.1f, 20.0f, 0.01f); } - Math_SmoothStepToF(&actor->obj.pos.z, gPlayer[0].unk_138 - 100.0f, 0.3f, 60.0f, 0.01f); + Math_SmoothStepToF(&actor->obj.pos.z, gPlayer[0].trueZpos - 100.0f, 0.3f, 60.0f, 0.01f); Math_SmoothStepToF(&actor->obj.rot.x, 0.0f, 0.2f, 20.0f, 0.01f); Macbeth_801A6984(actor); break; @@ -4057,8 +4058,8 @@ void Macbeth_801A7E7C(Actor* actor) { actor->state = 4; break; } - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; + if (actor->dmgType != 0) { + actor->dmgType = 0; actor->iwork[9] = 15; D_i5_801BE320[29] -= actor->damage; if (D_i5_801BE320[29] <= 0) { @@ -4323,7 +4324,7 @@ void Macbeth_801A7E7C(Actor* actor) { Math_SmoothStepToAngle(&actor->obj.rot.y, 0.0f, 0.1f, 20.0f, 0.01f); Math_SmoothStepToAngle(&actor->obj.rot.x, 0.0f, 0.1f, 20.0f, 0.01f); Math_SmoothStepToAngle(&actor->obj.rot.z, 0.0f, 0.1f, 20.0f, 0.01f); - Math_SmoothStepToF(&actor->obj.pos.z, gPlayer[0].unk_138 - 700.0f, 0.2f, 15.0f, 0.01f); + Math_SmoothStepToF(&actor->obj.pos.z, gPlayer[0].trueZpos - 700.0f, 0.2f, 15.0f, 0.01f); Math_SmoothStepToF(&actor->obj.pos.y, gPlayer[0].pos.y + 400.0f, 0.2f, 10.0f, 0.01f); Math_SmoothStepToF(&actor->obj.pos.x, gPlayer[0].pos.x, 0.1f, 10.0f, 0.01f); if (D_i5_801BE320[3] < 15) { @@ -4372,7 +4373,7 @@ void Macbeth_801A7E7C(Actor* actor) { Math_SmoothStepToAngle(&actor->obj.rot.y, 0.0f, 0.1f, 20.0f, 0.01f); Math_SmoothStepToAngle(&actor->obj.rot.x, 0.0f, 0.1f, 20.0f, 0.01f); Math_SmoothStepToAngle(&actor->obj.rot.z, 0.0f, 0.1f, 20.0f, 0.01f); - Math_SmoothStepToF(&actor->obj.pos.z, gPlayer[0].unk_138 - 250.0f, 0.1f, 15.0f, 0.01f); + Math_SmoothStepToF(&actor->obj.pos.z, gPlayer[0].trueZpos - 250.0f, 0.1f, 15.0f, 0.01f); Math_SmoothStepToF(&actor->obj.pos.y, 250.0f, 0.1f, 10.0f, 0.01f); if (D_i5_801BE320[3] < (Animation_GetFrameCount(&D_MA_6015C24) - 1)) { D_i5_801BE320[3]++; @@ -4391,10 +4392,10 @@ void Macbeth_801A7E7C(Actor* actor) { if (((gGameFrameCount % 2) == 0) && (D_i5_801BE320[15] == 0)) { actor->vwork[6].x = actor->vwork[2].x + 80.0f; actor->vwork[6].y = 0.0f; - actor->vwork[6].z = gPlayer[0].unk_138 + 50.0f; + actor->vwork[6].z = gPlayer[0].trueZpos + 50.0f; actor->vwork[7].x = actor->vwork[4].x - 80.0f; actor->vwork[7].y = 0.0f; - actor->vwork[7].z = gPlayer[0].unk_138 + 50.0f; + actor->vwork[7].z = gPlayer[0].trueZpos + 50.0f; actor->vwork[6].z += actor->vel.z; actor->vwork[7].z += actor->vel.z; sp348.x = actor->vwork[6].x - actor->vwork[2].x; @@ -4464,9 +4465,9 @@ void Macbeth_801A7E7C(Actor* actor) { Macbeth_8019A198(actor); Macbeth_801A0308(actor, actor->obj.pos.z, actor->obj.rot.y, 0); Math_SmoothStepToF(&actor->obj.pos.x, gPlayer[0].pos.x, 0.1f, 10.0f, 0.01f); - Math_SmoothStepToF(&actor->obj.pos.z, gPlayer[0].unk_138 - 1200.0f, 0.1f, 35.0f, 0.01f); + Math_SmoothStepToF(&actor->obj.pos.z, gPlayer[0].trueZpos - 1200.0f, 0.1f, 35.0f, 0.01f); Math_SmoothStepToF(&actor->obj.pos.y, actor->fwork[5] + 600.0f + D_i5_801BE368[3], 0.1f, 20.0f, 10.0f); - if (D_i5_801BE368[3] < ((gPlayer[0].unk_138 - actor->obj.pos.z) / 5.0f)) { + if (D_i5_801BE368[3] < ((gPlayer[0].trueZpos - actor->obj.pos.z) / 5.0f)) { Math_SmoothStepToF(&D_i5_801BE368[2], 15.0f, 0.2f, 2.0f, 0.01f); D_i5_801BE368[3] += D_i5_801BE368[2]; } else if (((actor->fwork[5] + 600.0f) + D_i5_801BE368[3]) <= actor->obj.pos.y) { @@ -4488,7 +4489,7 @@ void Macbeth_801A7E7C(Actor* actor) { Math_SmoothStepToF(&D_i5_801BE368[32], actor->obj.pos.x + RAND_FLOAT(500.0f), 0.2f, 20.0f, 0.01f); Math_SmoothStepToF(&D_i5_801BE368[33], actor->obj.pos.y + RAND_FLOAT(100.0f), 0.2f, 10.0f, 0.01f); Math_SmoothStepToF(&D_i5_801BE368[34], actor->obj.pos.y + RAND_FLOAT(500.0f), 0.2f, 20.0f, 0.01f); - if (actor->unk_0D0 != 0) { + if (actor->dmgType != 0) { gPlayer[0].shields = 0; } if (((gGameFrameCount % 16) == 0)) { @@ -4497,7 +4498,7 @@ void Macbeth_801A7E7C(Actor* actor) { D_i5_801BE368[9] = gPlayer[0].pos.x; Math_SmoothStepToF(&actor->obj.pos.x, D_i5_801BE368[9], 0.2f, 35.0f, 0.01f); Math_SmoothStepToF(&actor->obj.pos.y, gPlayer[0].pos.y, 0.3f, 15.0f, 0.01f); - Math_SmoothStepToF(&actor->obj.pos.z, gPlayer[0].unk_138, 0.3f, 20.0f, 0.01f); + Math_SmoothStepToF(&actor->obj.pos.z, gPlayer[0].trueZpos, 0.3f, 20.0f, 0.01f); Math_SmoothStepToF(&actor->obj.rot.x, 60.0f, 0.2f, 20.0f, 0.01f); Macbeth_801A6984(actor); break; @@ -4534,9 +4535,9 @@ void Macbeth_801A7E7C(Actor* actor) { default: break; } - if ((actor->unk_0D0 != 0) && (actor->state >= 2)) { - actor->unk_0D0 = 0; - if ((actor->unk_0D2 == 0) && (D_i5_801BE320[9] > 0) && ((gPlayer[0].unk_138 - actor->obj.pos.z) > 200.0f)) { + if ((actor->dmgType != 0) && (actor->state >= 2)) { + actor->dmgType = 0; + if ((actor->dmgPart == 0) && (D_i5_801BE320[9] > 0) && ((gPlayer[0].trueZpos - actor->obj.pos.z) > 200.0f)) { AUDIO_PLAY_SFX(0x2903300E, actor->sfxSource, 4); actor->iwork[7] = 15; D_i5_801BE320[9] -= actor->damage; @@ -4561,8 +4562,8 @@ void Macbeth_801A7E7C(Actor* actor) { RAND_FLOAT_CENTERED(10.0f), RAND_FLOAT_CENTERED(10.0f), (s32) (RAND_FLOAT(50.0f) + 70.0f), 8, 1.0f); } - } else if ((actor->unk_0D2 == 1) && (D_i5_801BE320[10] > 0) && - ((gPlayer[0].unk_138 - actor->obj.pos.z) > 200.0f)) { + } else if ((actor->dmgPart == 1) && (D_i5_801BE320[10] > 0) && + ((gPlayer[0].trueZpos - actor->obj.pos.z) > 200.0f)) { AUDIO_PLAY_SFX(0x2903300E, actor->sfxSource, 4); actor->iwork[8] = 16; D_i5_801BE320[10] -= actor->damage; @@ -4838,13 +4839,13 @@ void Macbeth_801AC1C0(s32 limbIndex, Vec3f* rot, void* data) { void Macbeth_801AC294(Actor* actor) { if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) { - if (((gPlayer[0].unk_138 - actor->obj.pos.z) > 7000.0f) || - ((gPlayer[0].unk_138 - actor->obj.pos.z) < -1000.0f)) { + if (((gPlayer[0].trueZpos - actor->obj.pos.z) > 7000.0f) || + ((gPlayer[0].trueZpos - actor->obj.pos.z) < -1000.0f)) { return; } } else { - if (((gPlayer[0].unk_138 - actor->obj.pos.z) > 7000.0f) || - ((gPlayer[0].unk_138 - actor->obj.pos.z) < -5000.0f)) { + if (((gPlayer[0].trueZpos - actor->obj.pos.z) > 7000.0f) || + ((gPlayer[0].trueZpos - actor->obj.pos.z) < -5000.0f)) { return; } } @@ -4882,8 +4883,8 @@ void Macbeth_801AC438(Actor* actor) { Macbeth_8019A830(actor); break; } - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; + if (actor->dmgType != 0) { + actor->dmgType = 0; AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); } } @@ -4906,7 +4907,7 @@ bool Macbeth_801AC5AC(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* void Macbeth_801AC6B4(Actor* actor) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = 0.0f; actor->obj.pos.y = 3000.0f; actor->obj.pos.z = 0.0f; @@ -4931,7 +4932,7 @@ void Macbeth_LevelStart(Player* player) { sp44 = 0.0f; func_play_800ADF58(player); - switch (player->unk_1D0) { + switch (player->csState) { case 0: objInit = gLevelObjects = SEGMENTED_TO_VIRTUAL(D_MA_6035678); @@ -4947,14 +4948,14 @@ void Macbeth_LevelStart(Player* player) { } gFillScreenRed = gFillScreenGreen = gFillScreenBlue = gFillScreenAlpha = 255; - player->unk_144 -= 800.0f; - player->unk_1D0 = 1; + player->zPath -= 800.0f; + player->csState = 1; D_i5_801BE24C = 8.0f; D_i5_801BA768 = 0.0f; break; case 1: gCsFrameCount = 0; - player->unk_0D4 = 0.0f; + player->gravity = 0.0f; player->pos.x = 0.0f; player->pos.y = -3.0f; player->vel.z = -15.0f; @@ -4965,7 +4966,7 @@ void Macbeth_LevelStart(Player* player) { player->cam.at.y = gCsCamAtY = 42.0f; player->cam.at.z = gCsCamAtZ = -800.0f; player->unk_240 = 1; - player->unk_1D0 = 2; + player->csState = 2; gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; gFillScreenAlpha = 255; Macbeth_801ACF6C(); @@ -5003,8 +5004,8 @@ void Macbeth_LevelStart(Player* player) { sp44 = 30.0f; } if (gCsFrameCount == 260) { - player->unk_1D0 = 3; - player->timer_1F8 = 10; + player->csState = 3; + player->csTimer = 10; } } break; @@ -5012,35 +5013,35 @@ void Macbeth_LevelStart(Player* player) { AUDIO_PLAY_BGM(SEQ_ID_MACBETH | SEQ_FLAG); gLevelStartStatusScreenTimer = 50; player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; - player->unk_1D0 = player->timer_1F8 = player->timer_1FC = player->unk_240 = 0; - player->unk_0D4 = 3.0f; + player->csState = player->csTimer = player->csEventTimer = player->unk_240 = 0; + player->gravity = 3.0f; player->unk_014 = 0.0f; D_ctx_8017782C = 1; func_play_800A594C(); D_ctx_8017782C = 0; gObjectLoadIndex = 40; - player->unk_1D0 = 4; + player->csState = 4; break; case 4: default: break; } - player->unk_138 = player->pos.z += player->vel.z; + player->trueZpos = player->pos.z += player->vel.z; Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], sp4C, 0); Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[1], sp48, 0); Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[2], sp44, 0); Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], sp4C, 0); Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[1], sp48, 0); Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[2], sp44, 0); - player->unk_0A0 = 0.0f; - player->unk_0F4 += player->vel.z * 5.0f; - player->unk_0F0 = SIN_DEG(player->unk_0F4) * 0.7f; + player->pathHeight = 0.0f; + player->rockPhase += player->vel.z * 5.0f; + player->rockAngle = SIN_DEG(player->rockPhase) * 0.7f; Texture_Scroll(D_landmaster_3002E80, 32, 32, 0); - if ((gCsFrameCount > 150) && ((-player->unk_138 - player->unk_144) > 200.0f)) { + if ((gCsFrameCount > 150) && ((-player->trueZpos - player->zPath) > 200.0f)) { if (D_i5_801BA768 < 11.5f) { D_i5_801BA768 += 0.2f; } - player->unk_144 += D_i5_801BA768; + player->zPath += D_i5_801BA768; } } @@ -5049,7 +5050,7 @@ void Macbeth_801ACE40(Effect* effect) { effect->obj.status = OBJ_INIT; effect->obj.pos.x = gPlayer[0].cam.eye.x + RAND_FLOAT_CENTERED(600.0f); effect->obj.pos.y = gPlayer[0].cam.eye.y - 1000.0f; - effect->obj.pos.z = gPlayer[0].unk_138 - 2000.0f; + effect->obj.pos.z = gPlayer[0].trueZpos - 2000.0f; effect->obj.id = OBJ_EFFECT_352; effect->timer_50 = 80; effect->unk_46 = 144; @@ -5090,7 +5091,7 @@ void Macbeth_801AD080(void) { } } -void Macbeth_801AD144(PlayerShot* playerShot) { +void Macbeth_801AD144(PlayerShot* shot) { s32 i; s32 j; Actor* actor; @@ -5102,7 +5103,7 @@ void Macbeth_801AD144(PlayerShot* playerShot) { s32 temp_ft3; s32 temp_s6; - temp_fs2 = playerShot->unk_44 * 40.0f; + temp_fs2 = shot->scale * 40.0f; actor = &gActors[0]; for (i = 0; i < 60; i++, actor++) { @@ -5128,9 +5129,9 @@ void Macbeth_801AD144(PlayerShot* playerShot) { Matrix_RotateY(gCalcMatrix, -actor->obj.rot.y * M_DTOR, MTXF_APPLY); } if ((j == temp_s6) && (var_s1[1] > -100.0f) && (var_s1[3] > -100.0f)) { - sp8C.x = playerShot->obj.pos.x - actor->obj.pos.x; - sp8C.y = playerShot->obj.pos.y - actor->obj.pos.y; - sp8C.z = playerShot->obj.pos.z - actor->obj.pos.z; + sp8C.x = shot->obj.pos.x - actor->obj.pos.x; + sp8C.y = shot->obj.pos.y - actor->obj.pos.y; + sp8C.z = shot->obj.pos.z - actor->obj.pos.z; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp8C, &sp80); test.x = (var_s1[4] + actor->obj.pos.x) - (actor->obj.pos.x + sp80.x); test.y = (var_s1[2] + actor->obj.pos.y) - (actor->obj.pos.y + sp80.y); @@ -5139,9 +5140,9 @@ void Macbeth_801AD144(PlayerShot* playerShot) { test.z *= 0.6f; } if (VEC3F_MAG(&test) < temp_fs2) { - actor->unk_0D2 = j; - actor->unk_0D0 = -1; - if ((gPlayer[0].unk_138 - actor->obj.pos.z) < 5000.0f) { + actor->dmgPart = j; + actor->dmgType = -1; + if ((gPlayer[0].trueZpos - actor->obj.pos.z) < 5000.0f) { actor->damage = 20; } else { actor->damage = 1; @@ -5198,7 +5199,7 @@ void Macbeth_801AD6E8(void) { void Macbeth_801AD6F0(Actor* actor) { Vec3f sp4C = { 0.0f, -10.0f, 0.0f }; - if ((gPlayer[0].unk_138 - actor->obj.pos.z) < -500.0f) { + if ((gPlayer[0].trueZpos - actor->obj.pos.z) < -500.0f) { Object_Kill(&actor->obj, actor->sfxSource); } @@ -5240,7 +5241,7 @@ void Macbeth_801AD6F0(Actor* actor) { } } actor->obj.rot.y = 180.0f - actor->obj.rot.y; - if ((fabsf(gPlayer[0].unk_138 - actor->obj.pos.z) < 40.0f) && + if ((fabsf(gPlayer[0].trueZpos - actor->obj.pos.z) < 40.0f) && (fabsf(gPlayer[0].pos.x - actor->obj.pos.x) < 80.0f)) { if ((gPlayer[0].pos.y - actor->obj.pos.y > -5.0f) && (gPlayer[0].pos.y - actor->obj.pos.y < (actor->scale * 35.0f)) && (gPlayer[0].timer_498 == 0)) { @@ -5306,7 +5307,7 @@ void Macbeth_801ADD68(Actor* actor) { Vec3f sp3C = { 0.0f, -10.0f, 0.0f }; s32 var_v0; - if ((gPlayer[0].unk_138 - actor->obj.pos.z) < -500.0f) { + if ((gPlayer[0].trueZpos - actor->obj.pos.z) < -500.0f) { Object_Kill(&actor->obj, actor->sfxSource); } @@ -5335,7 +5336,7 @@ void Macbeth_801ADD68(Actor* actor) { gPlayer[0].pos.x + D_i5_801BA570[actor->iwork[2]][actor->iwork[1]] / var_v0, 0.2f, 30.0f, 0.01f); Math_SmoothStepToF(&actor->obj.pos.z, - gPlayer[0].unk_138 - D_i5_801BA638[actor->iwork[2]][actor->iwork[1]] / var_v0, + gPlayer[0].trueZpos - D_i5_801BA638[actor->iwork[2]][actor->iwork[1]] / var_v0, 0.2f, 40.0f, 0.01f); Math_SmoothStepToF(&actor->obj.rot.z, RAND_FLOAT_CENTERED(15.0f), 0.1f, 10.0f, 0.01f); @@ -5371,8 +5372,8 @@ void Macbeth_801ADD68(Actor* actor) { } else if (actor->iwork[0] > 0) { actor->iwork[0] -= 1; } - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; + if (actor->dmgType != 0) { + actor->dmgType = 0; actor->iwork[7] = 15; actor->health -= actor->damage; @@ -5393,7 +5394,7 @@ void Macbeth_801ADD68(Actor* actor) { } break; } - actor->unk_0D0 = 0; + actor->dmgType = 0; } static Vec3f D_i5_801BA784[8] = { @@ -5568,7 +5569,7 @@ void Macbeth_801AEAA0(Effect* effect) { } void Macbeth_801AEC04(Actor* actor) { - if ((gPlayer[0].unk_138 - actor->obj.pos.z) < -300.0f) { + if ((gPlayer[0].trueZpos - actor->obj.pos.z) < -300.0f) { Object_Kill(&actor->obj, actor->sfxSource); } @@ -5612,9 +5613,9 @@ void Macbeth_801AEC04(Actor* actor) { } else { actor->fwork[1] = 32.0f; } - if ((actor->unk_0D0 != 0) && (actor->unk_0D2 == 0)) { + if ((actor->dmgType != 0) && (actor->dmgPart == 0)) { AUDIO_PLAY_SFX(0x2903300E, actor->sfxSource, 4); - actor->unk_0D0 = 0; + actor->dmgType = 0; actor->health -= actor->damage; actor->timer_0C6 = 15; if (actor->health <= 0) { @@ -5688,7 +5689,7 @@ void Macbeth_801AF27C(Actor* actor, s32 arg1) { actor->vel.y = player->vel.y; actor->vel.z = player->vel.z; actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.rot.y = 180.0f; Object_SetInfo(&actor->info, actor->obj.id); if (arg1 < 3) { @@ -5711,7 +5712,7 @@ void Macbeth_801AF44C(void) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = gPlayer[0].pos.x + D_i5_801BA7E4[4]; actor->obj.pos.y = gPlayer[0].pos.y + D_i5_801BA7F8[4]; actor->obj.pos.z = gPlayer[0].pos.z + D_i5_801BA80C[4]; @@ -5746,10 +5747,10 @@ static f32 D_i5_801BA84C[2] = { 0.0f, 60.0f }; void Macbeth_801AF628(Actor* actor, s32 arg1) { Actor_Initialize(actor); actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_195; - actor->obj.pos.x = gPlayer[0].unk_0AC + D_i5_801BA834[arg1].x; + actor->obj.id = OBJ_ACTOR_CUTSCENE; + actor->obj.pos.x = gPlayer[0].xPath + D_i5_801BA834[arg1].x; actor->obj.pos.y = D_i5_801BA834[arg1].y; - actor->obj.pos.z = D_i5_801BA834[arg1].z - D_ctx_80177D20; + actor->obj.pos.z = D_i5_801BA834[arg1].z - gPathProgress; actor->unk_0B6 = 37; actor->obj.rot.y = D_i5_801BA84C[arg1]; actor->iwork[4] = actor->iwork[5] = 192; @@ -5815,38 +5816,38 @@ void Macbeth_LevelComplete2(Player* player) { Vec3f spD8; f32 zeroVar = 0.0f; - switch (player->unk_1D0) { + switch (player->csState) { case 0: gCsFrameCount = 0; gLoadLevelObjects = 1; player->unk_234 = 0; SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 30); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 30); - player->unk_1D0 = 1; + player->csState = 1; D_ctx_80177A48[0] = 0.0f; D_ctx_80177A48[4] = -60.0f; D_ctx_80177A48[5] = 240.0f; - player->unk_0D4 = 3.0f; + player->gravity = 3.0f; gCameraShakeY = player->vel.x = player->vel.y = player->vel.z = player->baseSpeed = 0.0f; if (player->shields <= 0) { player->shields = 1; } player->cam.eye.x = gCsCamEyeX = gActors[D_i5_801BE318].obj.pos.x - 250.0f; player->cam.eye.y = gCsCamEyeY = gActors[D_i5_801BE318].obj.pos.y + 150.0f; - player->cam.eye.z = gCsCamEyeZ = gActors[D_i5_801BE318].obj.pos.z + D_ctx_80177D20 + 500.0f; + player->cam.eye.z = gCsCamEyeZ = gActors[D_i5_801BE318].obj.pos.z + gPathProgress + 500.0f; player->cam.at.x = gCsCamAtX = gActors[D_i5_801BE318].obj.pos.x; player->cam.at.y = gCsCamAtY = gActors[D_i5_801BE318].obj.pos.y + 200.0f; - player->cam.at.z = gCsCamAtZ = gActors[D_i5_801BE318].obj.pos.z + D_ctx_80177D20; + player->cam.at.z = gCsCamAtZ = gActors[D_i5_801BE318].obj.pos.z + gPathProgress; player->pos.x = 500.0f; player->pos.y = -3.0f; D_i5_801BA1DC = 0.0f; - player->unk_4D8 = 0.0f; + player->aerobaticPitch = 0.0f; player->camRoll = 0.0f; player->boostSpeed = 0.0f; - player->wings.unk_0C = player->wings.unk_08 = player->wings.unk_10 = player->unk_130 = player->unk_12C = - 0.0f; - player->unk_080 = 0.0f; - player->unk_0F0 = 0.0f; + player->wings.unk_0C = player->wings.unk_08 = player->wings.unk_10 = player->zRotBarrelRoll = + player->zRotBank = 0.0f; + player->yBob = 0.0f; + player->rockAngle = 0.0f; player->unk_16C = 0.0f; player->unk_170 = 0.0f; player->wings.unk_04 = 0.0f; @@ -5863,7 +5864,7 @@ void Macbeth_LevelComplete2(Player* player) { } } - player->unk_1D0++; + player->csState++; gCsCamEyeX = -100.0f; gCsCamEyeY = 250.0f; gCsCamEyeZ = 2090.0f; @@ -5879,8 +5880,8 @@ void Macbeth_LevelComplete2(Player* player) { D_i5_801BE312 = 1; player->pos.x = 500.0f; player->pos.y = -3.0f; - player->pos.z = player->unk_138 = -111130.0f; - player->unk_144 = D_ctx_80177D20 = 115930.0f; + player->pos.z = player->trueZpos = -111130.0f; + player->zPath = gPathProgress = 115930.0f; player->flags_228 = PFLAG_228_4; gLastPathChange = OBJ_ITEM_PATH_TURN_RIGHT; D_i5_801BA1DC = 0.0f; @@ -5913,7 +5914,7 @@ void Macbeth_LevelComplete2(Player* player) { } else { D_ctx_80177A48[0] = 0.0f; D_i5_801BA1DC = -40.0f; - player->unk_1D0++; + player->csState++; } /* fallthrough */ case 3: @@ -5921,30 +5922,30 @@ void Macbeth_LevelComplete2(Player* player) { if (gCsFrameCount == 252) { gCsCamEyeY = 570.0f; player->timer_210 = 1000; - player->unk_0B8 = 20000.0f; - player->unk_118 = -23.0f; - player->unk_0B4 = 0.0f; + player->xPathTarget = 20000.0f; + player->yRot_118 = -23.0f; + player->pathStep = 0.0f; } if (gCsFrameCount >= 252) { player->pos.x = gActors[D_i5_801BE314].obj.pos.x + 500.0f; - player->unk_140 = -gActors[D_i5_801BE314].vel.z; - player->unk_144 += player->unk_140; - D_ctx_80177D08 = player->unk_140; - D_ctx_80177D20 = player->unk_144; - D_ctx_80177CE8 += player->unk_140; - player->pos.z = player->unk_138 = -(D_ctx_80177D20 + 210.0f); + player->zPathVel = -gActors[D_i5_801BE314].vel.z; + player->zPath += player->zPathVel; + gPathVelZ = player->zPathVel; + gPathProgress = player->zPath; + gPathTexScroll += player->zPathVel; + player->pos.z = player->trueZpos = -(gPathProgress + 210.0f); Math_SmoothStepToF(&D_ctx_80177A48[0], 1.0f, 0.1f, 0.00025f, 0.0f); gCsCamAtX = gActors[D_i5_801BE314].obj.pos.x + 2500.0f; - gCsCamAtZ = (gActors[D_i5_801BE314].obj.pos.z + D_ctx_80177D20) - 2000.0f; + gCsCamAtZ = gActors[D_i5_801BE314].obj.pos.z + gPathProgress - 2000.0f; gCsCamEyeX = gCsCamAtX - 2340.0f; gCsCamEyeZ = gCsCamAtZ + 1410.0f; } if (gCsFrameCount == 389) { - player->unk_1D0++; + player->csState++; player->vel.z = 0.0f; - player->unk_140 = 0.0f; - D_ctx_801779E4 = 0.0f; - D_ctx_801779F4 = 0.0f; + player->zPathVel = 0.0f; + gPathVelX = 0.0f; + gPathVelY = 0.0f; player->timer_210 = 0; player->cam.eye.x = gCsCamEyeX = 2750.0f; player->cam.eye.y = gCsCamEyeY = 50.0f; @@ -5952,7 +5953,7 @@ void Macbeth_LevelComplete2(Player* player) { player->cam.at.x = gCsCamAtX = -650.0f; player->cam.at.y = gCsCamAtY = 30.0f; player->cam.at.z = gCsCamAtZ = 1900.0f; - player->unk_114 = 0.0f; + player->yRot_114 = 0.0f; D_i5_801BA1DC = -100.0f; Audio_KillSfxById(0x31078085); AUDIO_PLAY_SFX(0x31408095, gActors[D_i5_801BE314].sfxSource, 4); @@ -5966,26 +5967,26 @@ void Macbeth_LevelComplete2(Player* player) { gFillScreenAlphaStep = 20; } if (gCsFrameCount == 416) { - player->unk_1D0++; + player->csState++; D_ctx_80177A48[0] = 1.0f; - player->unk_114 = 30.0f; - player->unk_0AC = 4600.0f; + player->yRot_114 = 30.0f; + player->xPath = 4600.0f; D_i5_801BA1DC = -80.0f; - player->unk_144 = D_ctx_80177D20 += 300.0f; + player->zPath = gPathProgress += 300.0f; D_ctx_80177A48[5] = 0.0f; D_ctx_80177A48[6] = 0.5f; D_ctx_80177A48[7] = 1560.0f; D_ctx_80177A48[8] = 2400.0f; player->cam.at.x = gCsCamAtX = gActors[D_i5_801BE314].obj.pos.x; - player->cam.at.z = gCsCamAtZ = (gActors[D_i5_801BE314].obj.pos.z + D_ctx_80177D20) - 2000.0f; + player->cam.at.z = gCsCamAtZ = (gActors[D_i5_801BE314].obj.pos.z + gPathProgress) - 2000.0f; player->cam.eye.y = gCsCamEyeY = 50.0f; player->cam.at.y = gCsCamAtY = 10.0f; player->cam.eye.x = gCsCamEyeX = D_ctx_80177A48[7] + gCsCamAtX; player->cam.eye.z = gCsCamEyeZ = D_ctx_80177A48[8] + gCsCamAtZ; - player->unk_118 = -30.0f; - player->unk_0B8 = 10014.0f; + player->yRot_118 = -30.0f; + player->xPathTarget = 10014.0f; player->timer_210 = 1000; - player->unk_0B4 = 0.0f; + player->pathStep = 0.0f; gFillScreenAlphaTarget = 0; gFillScreenAlphaStep = 127; } @@ -6001,12 +6002,12 @@ void Macbeth_LevelComplete2(Player* player) { Math_SmoothStepToF(&gCsCamEyeY, 1300.0f, 0.1f, 17.0f, 0.0f); } if (gCsFrameCount <= 505) { - gCsCamAtZ = gActors[D_i5_801BE314].obj.pos.z + D_ctx_80177D20 - 2000.0f; + gCsCamAtZ = gActors[D_i5_801BE314].obj.pos.z + gPathProgress - 2000.0f; gCsCamAtX = gActors[D_i5_801BE314].obj.pos.x; player->vel.z = gActors[D_i5_801BE314].vel.z; player->pos.x = gActors[D_i5_801BE314].obj.pos.x + 500.0f; - player->pos.z = player->unk_138 = -(D_ctx_80177D20 + 210.0f); - player->unk_140 = -gActors[D_i5_801BE314].vel.z; + player->pos.z = player->trueZpos = -(gPathProgress + 210.0f); + player->zPathVel = -gActors[D_i5_801BE314].vel.z; gCsCamEyeX = D_ctx_80177A48[7] + gCsCamAtX; gCsCamEyeZ = D_ctx_80177A48[8] + gCsCamAtZ; func_effect_8007C120(gActors[D_i5_801BE314].obj.pos.x + 480.0f, @@ -6020,16 +6021,16 @@ void Macbeth_LevelComplete2(Player* player) { gFogGreen -= 1; gFogBlue -= 2; } - Math_SmoothStepToF(&player->unk_140, 0.0f, 1.0f, 0.6f, 0.0f); + Math_SmoothStepToF(&player->zPathVel, 0.0f, 1.0f, 0.6f, 0.0f); Math_SmoothStepToF(&gCsCamAtX, 11700.0f, 0.1f, 50.0f, 0.0f); Math_SmoothStepToF(&D_ctx_80177A48[5], 30.0f, 0.1f, 0.05f, 0.0f); Math_SmoothStepToF(&gCsCamAtY, 1600.0f, 0.1f, D_ctx_80177A48[5], 0.0f); - if (player->unk_140 >= 2.5f) { + if (player->zPathVel >= 2.5f) { player->pos.x = gActors[D_i5_801BE314].obj.pos.x + 500.0f; - player->pos.z = player->unk_138 = -(D_ctx_80177D20 + 210.0f); + player->pos.z = player->trueZpos = -(gPathProgress + 210.0f); } else { - player->unk_0B8 = player->unk_0AC; - D_ctx_801779E4 = 0.0f; + player->xPathTarget = player->xPath; + gPathVelX = 0.0f; } func_effect_8007BC7C(gActors[D_i5_801BE314].obj.pos.x + 190.0f, @@ -6045,19 +6046,19 @@ void Macbeth_LevelComplete2(Player* player) { gActors[D_i5_801BE314].obj.pos.y + 30.0f, gActors[D_i5_801BE314].obj.pos.z - 120.0f, 6.0f); } - player->unk_144 += player->unk_140; - D_ctx_80177D08 = player->unk_140; - D_ctx_80177D20 = player->unk_144; - D_ctx_80177CE8 += player->unk_140; + player->zPath += player->zPathVel; + gPathVelZ = player->zPathVel; + gPathProgress = player->zPath; + gPathTexScroll += player->zPathVel; if (gCsFrameCount == 630) { Audio_KillSfxBySourceAndId(gActors[D_i5_801BE314].sfxSource, 0x31408095); AUDIO_PLAY_SFX(0x2940C00A, gActors[D_i5_801BE314].sfxSource, 4); - player->unk_1D0++; + player->csState++; player->vel.z = 0.0f; - player->unk_140 = 0.0f; - D_ctx_80177D08 = 0.0f; - D_ctx_801779E4 = 0.0f; - D_ctx_801779F4 = 0.0f; + player->zPathVel = 0.0f; + gPathVelZ = 0.0f; + gPathVelX = 0.0f; + gPathVelY = 0.0f; player->timer_210 = 10000; D_ctx_80177A48[0] = 1.0f; D_i5_801BA1DC = 0.0f; @@ -6206,10 +6207,10 @@ void Macbeth_LevelComplete2(Player* player) { gBossActive = gLoadLevelObjects = 0; } if (gCsFrameCount == 940) { - player->unk_1D0++; + player->csState++; Play_ClearObjectData(); - player->pos.z = player->unk_138 = -(D_ctx_80177D20 + 210.0f); - player->pos.x = player->unk_0AC; + player->pos.z = player->trueZpos = -(gPathProgress + 210.0f); + player->pos.x = player->xPath; func_effect_8007A568(player->pos.x - 1800.0f, -50.0f, player->pos.z + 5000.0f, 40.0f); gFillScreenRed = gFillScreenGreen = gFillScreenBlue = gFillScreenAlpha = 255; gFillScreenAlphaTarget = 0; @@ -6219,24 +6220,24 @@ void Macbeth_LevelComplete2(Player* player) { player->cam.at.x = gCsCamAtX = player->cam.eye.x = gCsCamEyeX = player->pos.x; player->cam.at.y = gCsCamAtY = player->pos.y + 70.0f; player->cam.eye.y = gCsCamEyeY = player->pos.y + 30.0f; - player->cam.eye.z = gCsCamEyeZ = (player->unk_138 + D_ctx_80177D20) - 300.0f; - player->cam.at.z = gCsCamAtZ = player->unk_138 + D_ctx_80177D20; + player->cam.eye.z = gCsCamEyeZ = (player->trueZpos + gPathProgress) - 300.0f; + player->cam.at.z = gCsCamAtZ = player->trueZpos + gPathProgress; player->savedCockpitView = player->timer_210 = 0; - player->unk_190 = player->unk_194 = player->unk_188 = player->unk_18C = player->unk_118 = - player->unk_114 = player->unk_4D8 = player->camRoll = player->unk_174 = player->unk_178 = + player->unk_190 = player->unk_194 = player->unk_188 = player->unk_18C = player->yRot_118 = + player->yRot_114 = player->aerobaticPitch = player->camRoll = player->unk_174 = player->unk_178 = player->unk_17C = player->unk_180 = player->unk_184 = player->wings.unk_04 = player->unk_170 = - player->unk_16C = player->unk_0F0 = player->unk_080 = player->wings.unk_0C = - player->wings.unk_08 = player->wings.unk_10 = player->unk_130 = player->unk_12C = - player->boostSpeed = 0.0f; + player->unk_16C = player->rockAngle = player->yBob = player->wings.unk_0C = + player->wings.unk_08 = player->wings.unk_10 = player->zRotBarrelRoll = + player->zRotBank = player->boostSpeed = 0.0f; player->baseSpeed = 5.0f; D_ctx_80177A48[3] = D_ctx_80177A48[6] = D_ctx_80177A48[7] = D_ctx_80177A48[8] = 0.0f; - player->unk_1D4 = 1; - player->unk_1F4 = 0; + player->grounded = true; + player->hitTimer = 0; player->pos.y = gGroundHeight - 3.0f; player->vel.y = -3.0f; - player->unk_1DC = player->boostCooldown = player->boostMeter = player->unk_184 = player->unk_108 = - player->unk_10C = player->unk_0E8 = player->unk_0E4 = player->unk_104 = 0.0f; - player->timer_1E0 = player->sfx.bank = 0; + player->barrelRoll = player->boostCooldown = player->boostMeter = player->unk_184 = player->rot_104.y = + player->rot_104.z = player->rot.y = player->rot.x = player->rot_104.x = 0.0f; + player->barrelInputTimerL = player->sfx.bank = 0; } break; case 7: @@ -6256,7 +6257,7 @@ void Macbeth_LevelComplete2(Player* player) { spE4.z = -300.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &spE4, &spD8); gCsCamEyeX = player->pos.x + spD8.x; - gCsCamEyeZ = player->pos.z + D_ctx_80177D20 + spD8.z; + gCsCamEyeZ = player->pos.z + gPathProgress + spD8.z; } if (gCsFrameCount >= 2120) { Math_SmoothStepToF(&D_ctx_80177A48[0], 1.0f, 1.0f, 0.001f, 0.0f); @@ -6276,22 +6277,22 @@ void Macbeth_LevelComplete2(Player* player) { Math_SmoothStepToF(&player->unk_16C, 2.0f, 1.0f, 0.3f, 0.0f); if ((gCsFrameCount >= 2165) && (gCsFrameCount <= 2180)) { func_effect_8007BC7C(player->pos.x + RAND_FLOAT_CENTERED(30.0f), 0.0f, - RAND_FLOAT_CENTERED(30.0f) + player->unk_138, RAND_FLOAT(2.0f) + 3.5f); + RAND_FLOAT_CENTERED(30.0f) + player->trueZpos, RAND_FLOAT(2.0f) + 3.5f); func_effect_8007BC7C(player->pos.x - RAND_FLOAT_CENTERED(30.0f), 0.0f, - RAND_FLOAT_CENTERED(30.0f) + player->unk_138, RAND_FLOAT(2.0f) + 3.5f); + RAND_FLOAT_CENTERED(30.0f) + player->trueZpos, RAND_FLOAT(2.0f) + 3.5f); } Math_SmoothStepToF(&D_ctx_80177A48[7], 4.5f, 0.1f, 0.3f, 0.0f); - player->unk_138 = player->pos.z; + player->trueZpos = player->pos.z; } func_tank_80045130(player); func_tank_80044868(player); func_tank_800444BC(player); func_play_800ADF58(player); if (gCsFrameCount >= 2175) { - Math_SmoothStepToF(&gCsCamAtZ, gActors[3].obj.pos.z + D_ctx_80177D20 - 300.0f, 0.1f, 20.0f, 0.0f); + Math_SmoothStepToF(&gCsCamAtZ, gActors[3].obj.pos.z + gPathProgress - 300.0f, 0.1f, 20.0f, 0.0f); Math_SmoothStepToF(&gCsCamAtY, gActors[3].obj.pos.y + 100.0f, 0.1f, 10.0f, 0.0f); } else { - player->cam.at.z = gCsCamAtZ = player->unk_138 + D_ctx_80177D20; + player->cam.at.z = gCsCamAtZ = player->trueZpos + gPathProgress; } Math_SmoothStepToF(&player->pos.y, 260.0f, 0.1f, D_ctx_80177A48[7], 0.0f); break; @@ -6436,12 +6437,12 @@ void Macbeth_LevelComplete2(Player* player) { if (player->timer_210 != 0) { player->timer_210--; - Math_SmoothStepToF(&player->unk_114, -player->unk_118, 0.03f, 0.5f, 0.0001f); - Math_SmoothStepToF(&player->unk_0B4, D_ctx_80177D08 * .3f, 0.1f, 2.0f, 0.0001f); - D_ctx_801779E4 = Math_SmoothStepToF(&player->unk_0AC, player->unk_0B8, 0.1f, player->unk_0B4, 0.0001f); - D_ctx_801779F4 = Math_SmoothStepToF(&player->unk_0B0, player->unk_0BC, 0.1f, player->unk_0B4, 0.0001f); + Math_SmoothStepToF(&player->yRot_114, -player->yRot_118, 0.03f, 0.5f, 0.0001f); + Math_SmoothStepToF(&player->pathStep, gPathVelZ * .3f, 0.1f, 2.0f, 0.0001f); + gPathVelX = Math_SmoothStepToF(&player->xPath, player->xPathTarget, 0.1f, player->pathStep, 0.0001f); + gPathVelY = Math_SmoothStepToF(&player->yPath, player->yPathTarget, 0.1f, player->pathStep, 0.0001f); } else { - Math_SmoothStepToF(&player->unk_114, 0.0f, 0.03f, 0.5f, 0.0001f); + Math_SmoothStepToF(&player->yRot_114, 0.0f, 0.03f, 0.5f, 0.0001f); } Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 20000.0f, 0); Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 20000.0f, 0); @@ -6450,7 +6451,7 @@ void Macbeth_LevelComplete2(Player* player) { Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 20000.0f, 0); Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 20000.0f, 0); player->cam.at.y += zeroVar; - if (player->unk_1D0 >= 6) { + if (player->csState >= 6) { player->cam.eye.y += gCameraShakeY * 10.0f; } if (gCsFrameCount > 2500) { @@ -6494,7 +6495,7 @@ void Macbeth_801B28BC(Actor* actor) { Math_SmoothStepToF(&actor->obj.rot.z, SIN_DEG(actor->fwork[3]) * -30.0f, 0.1f, 2.0f, 0.0f); Math_SmoothStepToF(&actor->obj.pos.x, actor->fwork[0] + player->pos.x, 0.03f, 10.0f, 0.0f); Math_SmoothStepToF(&actor->obj.pos.y, actor->fwork[1] + player->pos.y + sp3C, 0.03f, 10.0f, 0.0f); - Math_SmoothStepToF(&actor->obj.pos.z, actor->fwork[2] + player->unk_138, 0.03f, 10.0f, 0.0f); + Math_SmoothStepToF(&actor->obj.pos.z, actor->fwork[2] + player->trueZpos, 0.03f, 10.0f, 0.0f); break; case 11: AUDIO_PLAY_SFX(0x09000002, actor->sfxSource, 0); @@ -6603,7 +6604,7 @@ void Macbeth_801B28BC(Actor* actor) { Math_SmoothStepToF(&actor->obj.rot.z, SIN_DEG(actor->fwork[3]) * -30.0f, 0.1f, 2.0f, 0.0f); Math_SmoothStepToF(&actor->obj.pos.x, actor->fwork[0] + player->pos.x, 0.03f, 10.0f, 0.0f); Math_SmoothStepToF(&actor->obj.pos.y, actor->fwork[1] + player->pos.y + sp3C, 0.03f, 10.0f, 0.0f); - Math_SmoothStepToF(&actor->obj.pos.z, actor->fwork[2] + player->unk_138, 0.03f, 10.0f, 0.0f); + Math_SmoothStepToF(&actor->obj.pos.z, actor->fwork[2] + player->trueZpos, 0.03f, 10.0f, 0.0f); break; case 31: AUDIO_PLAY_SFX(0x09000002, actor->sfxSource, 0); @@ -6655,7 +6656,7 @@ void Macbeth_801B3554(Actor* actor, s32 arg1) { actor->vel.y = player->vel.y; actor->vel.z = player->vel.z; actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.rot.y = 180.0f; Object_SetInfo(&actor->info, actor->obj.id); if (arg1 < 3) { @@ -6679,7 +6680,7 @@ void Macbeth_801B3718(void) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = gPlayer[0].pos.x + D_i5_801BA8B4[4]; actor->obj.pos.y = gPlayer[0].pos.y + D_i5_801BA8C8[4]; actor->obj.pos.z = gPlayer[0].pos.z + D_i5_801BA8DC[4]; @@ -6773,8 +6774,8 @@ void Macbeth_LevelComplete1(Player* player) { gCsCamEyeX = player->pos.x; gCsCamEyeY = player->pos.y; - gCsCamEyeZ = player->pos.z + player->unk_144 + 50.0f; - switch (player->unk_1D0) { + gCsCamEyeZ = player->pos.z + player->zPath + 50.0f; + switch (player->csState) { case 0: gCsFrameCount = gBossActive = gLoadLevelObjects = 1; D_i5_801BA894[4] = 80.0f; @@ -6787,7 +6788,7 @@ void Macbeth_LevelComplete1(Player* player) { gFillScreenBlue = 255; gFillScreenAlpha = gFillScreenAlphaTarget = D_ctx_80177A10[9] = 0; D_ctx_80177A48[0] = 0.0f; - player->unk_1D0++; + player->csState++; /* fallthrough */ case 1: D_i5_801BE240 = 2000.0f; @@ -6795,16 +6796,16 @@ void Macbeth_LevelComplete1(Player* player) { D_i5_801BE248 = 2000.0f; Math_SmoothStepToF(D_ctx_80177A48, 0.1f, 1.0f, 0.01f, 0.0f); Math_SmoothStepToF(&player->baseSpeed, 4.9f, 0.1f, 1.0f, 0.0f); - Math_SmoothStepToF(&player->unk_08C, 0.0f, 0.1f, 1.0f, 0.0f); + Math_SmoothStepToF(&player->camDist, 0.0f, 0.1f, 1.0f, 0.0f); gCsCamEyeX = player->pos.x; gCsCamEyeY = player->pos.y; - gCsCamEyeZ = player->pos.z + player->unk_144 + 50.0f; + gCsCamEyeZ = player->pos.z + player->zPath + 50.0f; if (gCsCamEyeY < 5.0f) { gCsCamEyeY = 5.0f; } gCsCamAtX = player->pos.x; gCsCamAtY = player->pos.y + 30.0f; - gCsCamAtZ = player->pos.z + player->unk_144; + gCsCamAtZ = player->pos.z + player->zPath; gFillScreenRed = 255; gFillScreenGreen = 255; gFillScreenBlue = 255; @@ -6822,10 +6823,10 @@ void Macbeth_LevelComplete1(Player* player) { player->cam.at.x = gCsCamAtX = 0.0f; player->cam.at.y = gCsCamAtY = 22.873417f; player->cam.at.z = gCsCamAtZ = -283.55914f; - player->unk_1D0++; + player->csState++; player->pos.x = 0.0f; player->pos.y = -3.0f; - player->unk_08C = 0.0f; + player->camDist = 0.0f; Macbeth_801B38E0(); } func_tank_80045130(player); @@ -6850,7 +6851,7 @@ void Macbeth_LevelComplete1(Player* player) { D_ctx_80177A10[9] -= 10; if (D_ctx_80177A10[9] < 11) { gFillScreenAlphaTarget = gFillScreenAlpha = 0; - player->unk_1D0 = 10; + player->csState = 10; } } func_tank_80045130(player); @@ -6861,8 +6862,8 @@ void Macbeth_LevelComplete1(Player* player) { func_play_800ADF58(player); break; case 10: - player->unk_1D0 = 11; - player->unk_0D4 = 3.0f; + player->csState = 11; + player->gravity = 3.0f; D_i5_801BE240 = 0.2f; /* fallthrough */ case 11: @@ -6889,7 +6890,7 @@ void Macbeth_LevelComplete1(Player* player) { Math_SmoothStepToF(&D_i5_801BE248, 2.0f, 0.1f, 0.1f, 0.01f); } Math_SmoothStepToF(&player->baseSpeed, 4.9f, 0.1f, 1.0f, 0.0f); - Math_SmoothStepToF(&player->unk_08C, 0.0f, 0.1f, 1.0f, 0.0f); + Math_SmoothStepToF(&player->camDist, 0.0f, 0.1f, 1.0f, 0.0f); func_tank_80045130(player); func_tank_80044868(player); func_tank_80045678(player); diff --git a/src/overlays/ovl_i5/fox_ti.c b/src/overlays/ovl_i5/fox_ti.c index 95ac3de3..d10f7275 100644 --- a/src/overlays/ovl_i5/fox_ti.c +++ b/src/overlays/ovl_i5/fox_ti.c @@ -144,7 +144,7 @@ void Titania_801891F4(Actor* actor) { f32 temp2; temp_fs0 = gPlayer[0].pos.x - actor->obj.pos.x; - temp_fs1 = (gPlayer[0].unk_138 + gPlayer[0].unk_08C) - actor->obj.pos.z; + temp_fs1 = (gPlayer[0].trueZpos + gPlayer[0].camDist) - actor->obj.pos.z; var_fv1 = Math_RadToDeg(Math_Atan2F(temp_fs0, temp_fs1)); @@ -158,7 +158,7 @@ void Titania_801891F4(Actor* actor) { Math_SmoothStepToAngle(&actor->obj.rot.y, var_fv1, 0.2f, 6.0f, 0.01f); temp_fs0 = (actor->obj.pos.x + actor->fwork[0]) - gPlayer[0].pos.x; temp2 = (actor->obj.pos.y + actor->fwork[1]) - (gPlayer[0].pos.y + 30.0f); - temp_fs1 = ((actor->obj.pos.z + actor->fwork[2]) - gPlayer[0].unk_138) + gPlayer[0].unk_08C; + temp_fs1 = ((actor->obj.pos.z + actor->fwork[2]) - gPlayer[0].trueZpos) + gPlayer[0].camDist; temp = sqrtf(SQ(temp_fs0) + SQ(temp_fs1)); Math_SmoothStepToAngle(&actor->fwork[5], Math_RadToDeg(Math_Atan2F(temp2, temp)), 0.2f, 5.0f, 0.01f); } @@ -236,7 +236,7 @@ void Titania_801895B8(Actor* actor) { /* fallthrough */ case 1: actor->fwork[7] = 20.0f; - if (fabsf(actor->obj.pos.z - gPlayer[0].unk_138) < 3000.0f) { + if (fabsf(actor->obj.pos.z - gPlayer[0].trueZpos) < 3000.0f) { actor->state = 2; actor->timer_0BC = 30; } @@ -245,7 +245,7 @@ void Titania_801895B8(Actor* actor) { case 2: if (actor->iwork[0] == 1) { actor->fwork[7] = 5.0f; - if (fabsf(actor->obj.pos.z - gPlayer[0].unk_138) < 200.0f) { + if (fabsf(actor->obj.pos.z - gPlayer[0].trueZpos) < 200.0f) { actor->fwork[7] = 0.0f; } Titania_801891F4(actor); @@ -253,14 +253,14 @@ void Titania_801895B8(Actor* actor) { if (actor->timer_0BC == 0) { actor->timer_0BC = 40; Titania_80189380(actor); - if ((fabsf(actor->obj.pos.z - gPlayer[0].unk_138) > 200.0f) && (actor->iwork[0] == 1)) { + if ((fabsf(actor->obj.pos.z - gPlayer[0].trueZpos) > 200.0f) && (actor->iwork[0] == 1)) { actor->fwork[6] = -10.0f; } } break; } - Ground_801B6E20(actor->obj.pos.x, actor->obj.pos.z + D_ctx_80177D20, &sp44, &sp3C, &sp40); + Ground_801B6E20(actor->obj.pos.x, actor->obj.pos.z + gPathProgress, &sp44, &sp3C, &sp40); actor->obj.pos.y = sp3C; if (actor->obj.rot.x < sp44 * M_RTOD) { @@ -280,7 +280,7 @@ void Titania_801895B8(Actor* actor) { Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); Matrix_Push(&gCalcMatrix); - if (((actor->iwork[2] % 2) == 0) && ((actor->obj.pos.z + D_ctx_80177D20) > -3800.0f)) { + if (((actor->iwork[2] % 2) == 0) && ((actor->obj.pos.z + gPathProgress) > -3800.0f)) { Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, MTXF_APPLY); Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_i5_801B752C, &sp48); @@ -304,7 +304,7 @@ void Titania_801895B8(Actor* actor) { actor->vel.y = sp48.y; actor->vel.z = sp48.z; - if (actor->unk_0D0 > 0) { + if (actor->dmgType > 0) { if (Rand_ZeroOne() <= 0.25f) { actor->itemDrop = DROP_SILVER_RING_50p; } else { @@ -331,7 +331,7 @@ static Vec3f D_i5_801B7544 = { 0.0f, -50.0f, 178.0f }; void Titania_80189B80(Actor* actor) { f32 sp2C; - Ground_801B6E20(actor->obj.pos.x, actor->obj.pos.z + D_ctx_80177D20, &sp2C, &actor->obj.pos.y, &sp2C); + Ground_801B6E20(actor->obj.pos.x, actor->obj.pos.z + gPathProgress, &sp2C, &actor->obj.pos.y, &sp2C); actor->health = 10; actor->info.hitbox = SEGMENTED_TO_VIRTUAL(D_TI_60068F0); Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); @@ -353,15 +353,15 @@ void Titania_80189CC8(Actor* actor) { f32 temp; if (actor->health > 0) { - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; + if (actor->dmgType != 0) { + actor->dmgType = 0; actor->timer_0C6 = 15; actor->health -= actor->damage; if (actor->health <= 0) { actor->health = 0; AUDIO_PLAY_SFX(0x2903A008, actor->sfxSource, 4); actor->lockOnTimers[TEAM_ID_FOX] = actor->itemDrop = 0; - actor->info.unk_1C = 0.0f; + actor->info.targetOffset = 0.0f; Actor_Despawn(actor); actor->info.bonus = 0; actor->info.hitbox = SEGMENTED_TO_VIRTUAL(D_TI_6006924); @@ -493,12 +493,12 @@ void Titania_8018A544(Actor* actor) { actor->unk_0C9 = 1; - if ((actor->scale != 1.0f) && (actor->unk_0D0 == 3)) { + if ((actor->scale != 1.0f) && (actor->dmgType == 3)) { Object_Kill(&actor->obj, actor->sfxSource); } - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; + if (actor->dmgType != 0) { + actor->dmgType = 0; actor->timer_0C6 = 15; actor->health += actor->damage; if (actor->scale == 1.0f) { @@ -530,7 +530,7 @@ void Titania_8018A544(Actor* actor) { if (actor->unk_046 == 2) { actor->gravity = 0.0f; - Ground_801B6E20(actor->obj.pos.x, actor->obj.pos.z + D_ctx_80177D20, &sp4C, &sp44, &sp48); + Ground_801B6E20(actor->obj.pos.x, actor->obj.pos.z + gPathProgress, &sp4C, &sp44, &sp48); actor->fwork[0] = sp4C; actor->fwork[1] = sp44; actor->fwork[2] = sp48; @@ -538,7 +538,7 @@ void Titania_8018A544(Actor* actor) { } actor->gravity = 3.0f; - Ground_801B6E20(actor->obj.pos.x, actor->obj.pos.z + D_ctx_80177D20, &sp4C, &sp44, &sp48); + Ground_801B6E20(actor->obj.pos.x, actor->obj.pos.z + gPathProgress, &sp4C, &sp44, &sp48); actor->fwork[0] = sp4C; actor->fwork[1] = sp44; actor->fwork[2] = sp48; @@ -608,7 +608,7 @@ void Titania_8018AB44(Actor* actor) { switch (actor->state) { case 0: actor->gravity = 1.0f; - Ground_801B6E20(actor->obj.pos.x, actor->obj.pos.z + D_ctx_80177D20, &sp3C, &sp34, &sp38); + Ground_801B6E20(actor->obj.pos.x, actor->obj.pos.z + gPathProgress, &sp3C, &sp34, &sp38); if (actor->obj.pos.y <= (sp34 + 3.0f)) { AUDIO_PLAY_SFX(0x19000024, actor->sfxSource, 4); actor->obj.pos.y = sp34 + 3.0f; @@ -624,7 +624,7 @@ void Titania_8018AB44(Actor* actor) { break; } - switch (actor->unk_0D0) { + switch (actor->dmgType) { case 1: AUDIO_PLAY_SFX(0x29022086, actor->sfxSource, 4); break; @@ -643,16 +643,16 @@ void Titania_8018AB44(Actor* actor) { func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y + 50.0f, actor->obj.pos.z, (10.0f / 3.0f)); gPlayer[0].vel.y = 20.0f; gPlayer[0].pos.y += 15.0f; - gPlayer[0].unk_1DC = 1; + gPlayer[0].barrelRoll = 1; gPlayer[0].timer_1E8 = 15; - gPlayer[0].unk_1EC = 20; + gPlayer[0].rollRate = 20; if (actor->obj.pos.x < gPlayer[0].pos.x) { - gPlayer[0].unk_1EC = -20; + gPlayer[0].rollRate = -20; } Object_Kill(&actor->obj, actor->sfxSource); break; } - actor->unk_0D0 = 0; + actor->dmgType = 0; } static Vec3f D_i5_801B75AC = { -70.0f, 50.0f, 212.0f }; @@ -672,7 +672,7 @@ void Titania_8018ADC4(Actor* actor) { actor->obj.rot.z = 0.0f; actor->obj.rot.x = 0.0f; - Ground_801B6E20(actor->obj.pos.x, actor->obj.pos.z + D_ctx_80177D20, &sp54, &sp58, &sp54); + Ground_801B6E20(actor->obj.pos.x, actor->obj.pos.z + gPathProgress, &sp54, &sp58, &sp54); actor->obj.pos.y = sp58; @@ -774,8 +774,8 @@ void Titania_8018B268(Actor* actor) { Actor* sp3C = actor->iwork[0]; Actor* sp38 = actor->iwork[1]; - if (actor->unk_0D0 > 0) { - actor->unk_0D0 = 0; + if (actor->dmgType > 0) { + actor->dmgType = 0; if (actor->health > 0) { actor->health -= actor->damage; if (actor->health <= 0) { @@ -867,7 +867,7 @@ void Titania_8018B268(Actor* actor) { &gIdentityMatrix); func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 10.0f); actor->lockOnTimers[TEAM_ID_FOX] = 0; - actor->info.unk_1C = 0.0f; + actor->info.targetOffset = 0.0f; } } @@ -928,7 +928,7 @@ void Titania_8018B720(Actor* actor) { void Titania_Actor231_Init(Actor* actor) { f32 sp24; - Ground_801B6E20(actor->obj.pos.x, actor->obj.pos.z + D_ctx_80177D20, &sp24, &actor->obj.pos.y, &sp24); + Ground_801B6E20(actor->obj.pos.x, actor->obj.pos.z + gPathProgress, &sp24, &actor->obj.pos.y, &sp24); actor->obj.rot.x = actor->obj.rot.y = actor->obj.rot.z = 0.0f; actor->obj.pos.y -= 20.0f; } @@ -978,17 +978,17 @@ void Titania_8018B9D0(Actor* actor) { Player_ApplyDamage(gPlayer, 0, 60); gPlayer[0].vel.y = 20.0f; gPlayer[0].pos.y += 15.0f; - gPlayer[0].unk_1DC = 1; + gPlayer[0].barrelRoll = 1; gPlayer[0].timer_1E8 = 15; - gPlayer[0].unk_1EC = 20; + gPlayer[0].rollRate = 20; if (actor->obj.pos.x < gPlayer[0].pos.x) { - gPlayer[0].unk_1EC = -20; + gPlayer[0].rollRate = -20; } } break; case 1: - Ground_801B6E20(actor->obj.pos.x, actor->obj.pos.z + D_ctx_80177D20, &sp4C, &sp50, &sp48); + Ground_801B6E20(actor->obj.pos.x, actor->obj.pos.z + gPathProgress, &sp4C, &sp50, &sp48); actor->fwork[0] = sp50; actor->fwork[1] = sp4C; actor->fwork[2] = sp48; @@ -1018,11 +1018,11 @@ void Titania_8018B9D0(Actor* actor) { actor->obj.rot.x = (var_fa0 / 130.0f) * 90.0f; - if (actor->unk_0D0 == 1) { + if (actor->dmgType == 1) { AUDIO_PLAY_SFX(0x19020008, actor->sfxSource, 4); sp44 = actor->obj.pos.x - actor->hitPos.x; sp40 = fabsf(sp44); - actor->unk_0D0 = 0; + actor->dmgType = 0; actor->state = 1; actor->timer_0BC = 0; actor->timer_0BE = 0; @@ -1282,11 +1282,11 @@ void Titania_8018C8A8(Actor* actor) { s32 pad; actor->iwork[7]++; - sp88 = gPlayer[0].unk_138 - actor->obj.pos.z; + sp88 = gPlayer[0].trueZpos - actor->obj.pos.z; if (actor->iwork[4] > 0) { actor->iwork[4]--; - } else if ((gPlayer[0].unk_1D4 != 0) && (actor->iwork[3] > 0)) { + } else if ((gPlayer[0].grounded != 0) && (actor->iwork[3] > 0)) { gControllerRumbleFlags[0] = 1; actor->iwork[3]--; } @@ -1299,8 +1299,8 @@ void Titania_8018C8A8(Actor* actor) { actor->iwork[6]--; } - if ((actor->health > 0) && (actor->unk_0D0 > 0) && (actor->unk_0D0 != 3) && (actor->state >= 3)) { - if ((actor->health > 0) && (actor->unk_0D2 >= 0) && (actor->unk_0D2 < 3)) { + if ((actor->health > 0) && (actor->dmgType > 0) && (actor->dmgType != 3) && (actor->state >= 3)) { + if ((actor->health > 0) && (actor->dmgPart >= 0) && (actor->dmgPart < 3)) { actor->iwork[5] = 10; if (actor->state == 4) { Audio_KillSfxBySourceAndId(actor->sfxSource, 0x31030043); @@ -1321,10 +1321,10 @@ void Titania_8018C8A8(Actor* actor) { } else { AUDIO_PLAY_SFX(0x29034041, actor->sfxSource, 4); } - } else if (actor->unk_0D0 == 1) { + } else if (actor->dmgType == 1) { func_effect_8007A6F0(&actor->obj.pos, 0x29121007); } - actor->unk_0D0 = 0; + actor->dmgType = 0; } switch (actor->state) { @@ -1344,7 +1344,7 @@ void Titania_8018C8A8(Actor* actor) { break; case 1: - Ground_801B6E20(actor->obj.pos.x, actor->obj.pos.z + gPlayer->unk_144, &spA0, &sp9C, &sp98); + Ground_801B6E20(actor->obj.pos.x, actor->obj.pos.z + gPlayer->zPath, &spA0, &sp9C, &sp98); actor->fwork[0] = sp9C; actor->fwork[1] = spA0; actor->fwork[2] = sp98; @@ -1445,7 +1445,7 @@ void Titania_8018C8A8(Actor* actor) { break; case 4: - Ground_801B6E20(actor->obj.pos.x, actor->obj.pos.z + D_ctx_80177D20, &spA0, &sp9C, &sp98); + Ground_801B6E20(actor->obj.pos.x, actor->obj.pos.z + gPathProgress, &spA0, &sp9C, &sp98); actor->fwork[0] = sp9C; actor->fwork[1] = spA0; actor->fwork[2] = sp98; @@ -1677,12 +1677,12 @@ void Titania_8018C8A8(Actor* actor) { } if (actor->health > 0) { - actor->info.unk_1C = actor->fwork[27]; + actor->info.targetOffset = actor->fwork[27]; } else { actor->lockOnTimers[TEAM_ID_FOX] = 0; - actor->info.unk_1C = 0.0f; + actor->info.targetOffset = 0.0f; } - actor->unk_0D0 = 0; + actor->dmgType = 0; } void Titania_8018E2D8(Actor* actor) { @@ -1712,7 +1712,7 @@ void Titania_8018E3CC(Actor* actor) { Vec3f sp34; s32 i; - Ground_801B6E20(actor->obj.pos.x, actor->obj.pos.z + D_ctx_80177D20, &sp40, &actor->obj.pos.y, &sp40); + Ground_801B6E20(actor->obj.pos.x, actor->obj.pos.z + gPathProgress, &sp40, &actor->obj.pos.y, &sp40); actor->obj.pos.y -= 20.0f; actorPtr = gActors; @@ -1785,7 +1785,7 @@ void Titania_8018E5F8(Actor* actor) { sp9C = gPlayer[0].pos.x - actor->obj.pos.x; spA0 = (gPlayer[0].pos.y - actor->obj.pos.y) - 30.0f; - spA4 = gPlayer[0].unk_138 - actor->obj.pos.z; + spA4 = gPlayer[0].trueZpos - actor->obj.pos.z; switch (actor->state) { case 0: @@ -1834,7 +1834,7 @@ void Titania_8018E5F8(Actor* actor) { func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 10.0f); actor->timer_0BE = 10; } - Ground_801B6E20(actor->obj.pos.x, actor->obj.pos.z + D_ctx_80177D20, &sp80, &sp7C, &sp80); + Ground_801B6E20(actor->obj.pos.x, actor->obj.pos.z + gPathProgress, &sp80, &sp7C, &sp80); if (actor->obj.pos.y < (94.0f + sp7C)) { spA4 = fabsf(spA4); if (spA4 < 5000.0f) { @@ -1851,7 +1851,7 @@ void Titania_8018E5F8(Actor* actor) { case 4: if (actor->iwork[7] > 0) { actor->iwork[7]--; - } else if ((gPlayer[0].unk_1D4 != 0) && (actor->iwork[8] > 0)) { + } else if ((gPlayer[0].grounded != 0) && (actor->iwork[8] > 0)) { gControllerRumbleFlags[0] = 1; actor->iwork[8]--; } @@ -1874,8 +1874,8 @@ void Titania_8018E5F8(Actor* actor) { actor->fwork[3] = sp84.x; actor->fwork[4] = sp84.y; actor->fwork[5] = sp84.z; - if (actor->unk_0D0 > 0) { - actor->unk_0D0 = 0; + if (actor->dmgType > 0) { + actor->dmgType = 0; actor->timer_0C6 = 10; if (actor->health > 0) { actor->health -= actor->damage; @@ -1883,7 +1883,7 @@ void Titania_8018E5F8(Actor* actor) { BonusText_Display(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + actor->fwork[27], 2); gHitCount += 2; actor->lockOnTimers[TEAM_ID_FOX] = actor->health = actor->itemDrop = 0; - actor->info.unk_1C = 0.0f; + actor->info.targetOffset = 0.0f; Actor_Despawn(actor); actor->info.bonus = 0; ((Actor*) actor->iwork[4])->iwork[0] = 0; @@ -1913,7 +1913,7 @@ void Titania_8018E5F8(Actor* actor) { for (i = 0; i <= 3000; i += 50) { sp5C = (sp68 * i) + sp40; sp54 = (sp60 * i) + sp48; - Ground_801B6E20(sp5C, sp54 + D_ctx_80177D20, &sp74, &sp70, &sp6C); + Ground_801B6E20(sp5C, sp54 + gPathProgress, &sp74, &sp70, &sp6C); if ((sp64 * i) + sp44 < sp70) { break; } @@ -1922,25 +1922,25 @@ void Titania_8018E5F8(Actor* actor) { if (actor->iwork[2] == 0) { index = actor->iwork[3] - 1; gTexturedLines[index].mode = 101; - gTexturedLines[index].unk_04.x = actor->obj.pos.x + actor->fwork[0]; - gTexturedLines[index].unk_04.y = actor->obj.pos.y + actor->fwork[1]; - gTexturedLines[index].unk_04.z = actor->obj.pos.z + actor->fwork[2]; - gTexturedLines[index].unk_2C = 255; - gTexturedLines[index].unk_2D = 255; - gTexturedLines[index].unk_2E = 0; - gTexturedLines[index].unk_2F = 255; - gTexturedLines[index].unk_10.x = sp5C; - gTexturedLines[index].unk_10.y = sp70; - gTexturedLines[index].unk_10.z = sp54; - gTexturedLines[index].unk_28 = 3.0f; + gTexturedLines[index].posAA.x = actor->obj.pos.x + actor->fwork[0]; + gTexturedLines[index].posAA.y = actor->obj.pos.y + actor->fwork[1]; + gTexturedLines[index].posAA.z = actor->obj.pos.z + actor->fwork[2]; + gTexturedLines[index].red = 255; + gTexturedLines[index].green = 255; + gTexturedLines[index].blue = 0; + gTexturedLines[index].alpha = 255; + gTexturedLines[index].posBB.x = sp5C; + gTexturedLines[index].posBB.y = sp70; + gTexturedLines[index].posBB.z = sp54; + gTexturedLines[index].xyScale = 3.0f; if (actor->timer_0C0 == 0) { - gTexturedLines[index].unk_2C = 255; - gTexturedLines[index].unk_2D = 255; - gTexturedLines[index].unk_2E = 64; + gTexturedLines[index].red = 255; + gTexturedLines[index].green = 255; + gTexturedLines[index].blue = 64; } else { - gTexturedLines[index].unk_2C = 255; - gTexturedLines[index].unk_2D = 100; - gTexturedLines[index].unk_2E = 0; + gTexturedLines[index].red = 255; + gTexturedLines[index].green = 100; + gTexturedLines[index].blue = 0; } if (i <= 3000) { if (actor->timer_0C0 == 0) { @@ -1990,13 +1990,13 @@ void Titania_8018EFF0(Sprite* sprite) { f32 sp24; f32 sp20; - Ground_801B6E20(sprite->obj.pos.x, sprite->obj.pos.z + D_ctx_80177D20, &sp20, &sp24, &sp20); + Ground_801B6E20(sprite->obj.pos.x, sprite->obj.pos.z + gPathProgress, &sp20, &sp24, &sp20); sprite->obj.pos.y = sp24; } void Titania_Cactus_Update(Sprite* sprite) { sprite->obj.rot.y = Math_Atan2F(gPlayer[0].cam.eye.x - sprite->obj.pos.x, - gPlayer[0].cam.eye.z - (sprite->obj.pos.z + D_ctx_80177D20)) * + gPlayer[0].cam.eye.z - (sprite->obj.pos.z + gPathProgress)) * M_RTOD; if (sprite->unk_46 != 0) { func_effect_8007D074(sprite->obj.pos.x, sprite->obj.pos.y + 96.0f, sprite->obj.pos.z, 4.0f); @@ -2762,7 +2762,7 @@ bool Titania_80190A08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* if ((limbIndex == 71) && (boss->fwork[0x2E] != 0.0f)) { sp70.x = (gPlayer[0].pos.x - (boss->obj.pos.x + sp7C.x)) * boss->fwork[0x2E]; sp70.y = (gPlayer[0].pos.y + 50.0f) - (boss->obj.pos.y + sp7C.y); - sp70.z = (gPlayer[0].unk_138 - (boss->obj.pos.z + sp7C.z)) * boss->fwork[0x2E]; + sp70.z = (gPlayer[0].trueZpos - (boss->obj.pos.z + sp7C.z)) * boss->fwork[0x2E]; sp5C.y = Math_Atan2F(sp70.x, sp70.z) * M_RTOD; sp5C.x = -Math_Atan2F(sp70.y, sqrtf(SQ(sp70.x) + SQ(sp70.z))) * M_RTOD; @@ -2770,7 +2770,7 @@ bool Titania_80190A08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* } else { sp70.x = gPlayer[0].pos.x - (boss->obj.pos.x + sp7C.x); sp70.y = (gPlayer[0].pos.y + 30.0f) - (boss->obj.pos.y + sp7C.y); - sp70.z = gPlayer[0].unk_138 - (boss->obj.pos.z + sp7C.z); + sp70.z = gPlayer[0].trueZpos - (boss->obj.pos.z + sp7C.z); sp5C.y = Math_Atan2F(sp70.x, sp70.z) * M_RTOD; sp5C.x = -Math_Atan2F(sp70.y, sqrtf(SQ(sp70.x) + SQ(sp70.z))) * M_RTOD; @@ -3118,7 +3118,7 @@ void Titania_80192118(Boss* boss) { Animation_GetFrameData(&D_TI_A0002BC, 0, &D_i5_801BCDC8[8]); Animation_GetFrameData(&D_TI_A000934, 0, &D_i5_801BC978[16]); Animation_GetFrameData(&D_TI_A000934, 0, &D_i5_801BCDC8[16]); - if ((gPlayer[0].unk_138 - boss->obj.pos.z) <= 450.0f) { + if ((gPlayer[0].trueZpos - boss->obj.pos.z) <= 450.0f) { gPlayer[0].unk_19C = -1; gPlayer[0].unk_000 = 0.0f; boss->swork[1] = 2; @@ -3253,7 +3253,7 @@ void Titania_80192118(Boss* boss) { } Math_SmoothStepToF(&boss->vel.z, gPlayer[0].vel.z, 0.7f, 1.0f, 0.01f); Math_SmoothStepToF(&boss->obj.pos.x, gPlayer[0].pos.x, 0.1f, 6.0f, 0.01f); - Math_SmoothStepToF(&boss->obj.pos.z, gPlayer[0].unk_138 - 450.0f, 0.1f, 1.0f, 0.01f); + Math_SmoothStepToF(&boss->obj.pos.z, gPlayer[0].trueZpos - 450.0f, 0.1f, 1.0f, 0.01f); Animation_GetFrameData(&D_TI_A000D50, D_i5_801BBEF0[24] >> 1, &D_i5_801BC978[16]); switch (D_i5_801BBEF0[39]) { @@ -4032,7 +4032,7 @@ void Titania_80193DF0(Boss* boss) { actor->obj.pos.x = 0.0f; actor->obj.pos.y = 0.0f; actor->obj.pos.z = boss->obj.pos.z + 2000.0f; - actor->info.unk_10 = 5000.0f; + actor->info.cullDistance = 5000.0f; actor->unk_046 = D_i5_801B7770[D_i5_801B8198[i].unk_00][5]; actor->unk_048 = D_i5_801B7770[D_i5_801B8198[i].unk_00][1]; D_i5_801B8198[i].unk_0C = D_i5_801B8198[i].unk_04; @@ -4167,7 +4167,7 @@ void Titania_80193DF0(Boss* boss) { D_i5_801BBEF0[1] = 25; D_i5_801BBEF4[0] = 0.25f; boss->obj.pos.x = gPlayer[0].pos.x; - boss->obj.pos.z = gPlayer[0].unk_138 - 1070.0f; + boss->obj.pos.z = gPlayer[0].trueZpos - 1070.0f; boss->vel.z = 0.0f; Animation_GetFrameData(&D_TI_900FC4C, 0, D_i5_801BCDC8); D_i5_801BBEF4[8] = 48.0f; @@ -4191,7 +4191,7 @@ void Titania_80193DF0(Boss* boss) { if ((boss->unk_04C == 0) || (boss->unk_04C == 68) || (boss->unk_04C == 96) || (boss->unk_04C == 149)) { AUDIO_PLAY_SFX(0x2900502A, boss->sfxSource, 4); } - temp_f = gPlayer[0].unk_138 - boss->obj.pos.z - 530.0f; + temp_f = gPlayer[0].trueZpos - boss->obj.pos.z - 530.0f; if (temp_f < 0.0f) { boss->obj.pos.z += temp_f; } @@ -4667,7 +4667,7 @@ void Titania_80193DF0(Boss* boss) { effect->obj.pos.z = boss->obj.pos.z + spC8.z; effect->obj.rot.y = boss->fwork[49] + -44.0f; effect->unk_44 = 53; - effect->info.unk_10 = 400.0f; + effect->info.cullDistance = 400.0f; effect->info.unk_14 = -1; effect->unk_74 = D_TI2_7009A80; } @@ -4684,7 +4684,7 @@ void Titania_80193DF0(Boss* boss) { effect->obj.pos.z = boss->obj.pos.z + spC8.z; effect->obj.rot.y = boss->fwork[49] + 44.0f; effect->unk_44 = 53; - effect->info.unk_10 = 400.0f; + effect->info.cullDistance = 400.0f; effect->info.unk_14 = -1; effect->unk_74 = D_TI2_7009A80; } @@ -4734,7 +4734,7 @@ void Titania_80197A94(Boss* boss) { AUDIO_PLAY_SFX(0x29121007, boss->sfxSource, 4); boss->dmgType = DMG_NONE; } - if ((gPlayer[0].unk_1D4 != 0) && (boss->swork[39] > 0)) { + if ((gPlayer[0].grounded != 0) && (boss->swork[39] > 0)) { gControllerRumbleFlags[0] = 1; boss->swork[39]--; } @@ -5134,22 +5134,22 @@ void Titania_801982A8(Boss* boss) { spF4.y = D_i5_801B8E24[i][1] * boss->fwork[41]; spF4.z = boss->fwork[42]; Matrix_MultVec3f(gCalcMatrix, &spF4, &spE8); - gTexturedLines[temp_v1_28].unk_04.x = temp_fs0; - gTexturedLines[temp_v1_28].unk_04.y = temp_fs1; - gTexturedLines[temp_v1_28].unk_04.z = temp_fs2; - gTexturedLines[temp_v1_28].unk_10.x = temp_fs0 + spE8.x; - gTexturedLines[temp_v1_28].unk_10.y = temp_fs1 + spE8.y; - gTexturedLines[temp_v1_28].unk_10.z = temp_fs2 + spE8.z; + gTexturedLines[temp_v1_28].posAA.x = temp_fs0; + gTexturedLines[temp_v1_28].posAA.y = temp_fs1; + gTexturedLines[temp_v1_28].posAA.z = temp_fs2; + gTexturedLines[temp_v1_28].posBB.x = temp_fs0 + spE8.x; + gTexturedLines[temp_v1_28].posBB.y = temp_fs1 + spE8.y; + gTexturedLines[temp_v1_28].posBB.z = temp_fs2 + spE8.z; if (boss->swork[32] == 0) { gTexturedLines[temp_v1_28].mode = 0; } else { gTexturedLines[temp_v1_28].mode = 1; } - gTexturedLines[temp_v1_28].unk_2C = 0; - gTexturedLines[temp_v1_28].unk_2E = 0; - gTexturedLines[temp_v1_28].unk_2D = 0; - gTexturedLines[temp_v1_28].unk_2F = 0; - gTexturedLines[temp_v1_28].unk_28 = 1; + gTexturedLines[temp_v1_28].red = 0; + gTexturedLines[temp_v1_28].blue = 0; + gTexturedLines[temp_v1_28].green = 0; + gTexturedLines[temp_v1_28].alpha = 0; + gTexturedLines[temp_v1_28].xyScale = 1; } } } @@ -5234,7 +5234,7 @@ void Titania_801990DC(Boss* boss) { actor->fwork[4] = -200.0f; actor->obj.pos.x = gPlayer[0].pos.x; actor->obj.pos.y = 500.0f; - actor->obj.pos.z = gPlayer[0].unk_138 + actor->fwork[4]; + actor->obj.pos.z = gPlayer[0].trueZpos + actor->fwork[4]; actor->obj.rot.y = (RAND_FLOAT(5.0f) + 90.0f) - 2.5f; actor->obj.rot.z = (RAND_FLOAT(5.0f) + 180.0f) - 2.5f; actor->vel.y = -10.0f; @@ -5256,7 +5256,7 @@ void Titania_801990DC(Boss* boss) { actor->fwork[5] = 200.0f; actor->obj.pos.x = gPlayer[0].pos.x + actor->fwork[3]; actor->obj.pos.y = 500.0f; - actor->obj.pos.z = gPlayer[0].unk_138 + actor->fwork[4]; + actor->obj.pos.z = gPlayer[0].trueZpos + actor->fwork[4]; actor->obj.rot.z = 90.0f; actor->vel.y = -10.0f; actor->gravity = 0.8f; @@ -5277,7 +5277,7 @@ void Titania_801990DC(Boss* boss) { actor->fwork[5] = 200.0f; actor->obj.pos.x = gPlayer[0].pos.x + actor->fwork[3]; actor->obj.pos.y = 500.0f; - actor->obj.pos.z = gPlayer[0].unk_138 + actor->fwork[4]; + actor->obj.pos.z = gPlayer[0].trueZpos + actor->fwork[4]; actor->obj.rot.z = 90.0f; actor->vel.y = -10.0f; actor->gravity = 0.8f; @@ -5287,6 +5287,6 @@ void Titania_801990DC(Boss* boss) { if ((boss->timer_050 == 0) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE)) { Object_Kill(&boss->obj, boss->sfxSource); gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; - gPlayer[0].unk_1D0 = 0; + gPlayer[0].csState = 0; } } diff --git a/src/overlays/ovl_i5/fox_ti_cs.c b/src/overlays/ovl_i5/fox_ti_cs.c index bcc4c6ba..417f1964 100644 --- a/src/overlays/ovl_i5/fox_ti_cs.c +++ b/src/overlays/ovl_i5/fox_ti_cs.c @@ -11,7 +11,7 @@ f32 D_i5_801B7348[] = { 90.0f, -90.0f, 0.0f }; void Titania_80187530(Actor* actor) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = 0.0f; actor->obj.pos.y = 3000.0f; @@ -26,7 +26,7 @@ void Titania_80187530(Actor* actor) { void Titania_801875D0(Actor* actor, s32 arg1) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = D_i5_801B72A0[arg1].x; actor->obj.pos.y = D_i5_801B72A0[arg1].y + 3000.0f; @@ -46,11 +46,11 @@ void Titania_LevelStart(Player* player) { sp64 = 20000.0f; - switch (player->unk_1D0) { + switch (player->csState) { case 0: gCsFrameCount = 0; gTiStartLandmaster = 1; - player->unk_0D4 = 0.0f; + player->gravity = 0.0f; Titania_80187530(&gActors[3]); @@ -75,7 +75,7 @@ void Titania_LevelStart(Player* player) { player->cam.at.z = gCsCamAtZ = player->pos.z; player->unk_240 = 1; - player->unk_1D0 = 1; + player->csState = 1; gFogFar = 1006; gPlayer[0].unk_19C = 0; gBgColor = 0x78C1; // 120, 24, 0 @@ -92,8 +92,8 @@ void Titania_LevelStart(Player* player) { } if (gCsFrameCount == 430) { - player->unk_1D0 = 2; - player->timer_1F8 = 10; + player->csState = 2; + player->csTimer = 10; AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0); } gCsCamAtX = player->pos.x; @@ -107,14 +107,14 @@ void Titania_LevelStart(Player* player) { gCsCamAtY = player->pos.y; gCsCamAtZ = player->pos.z; - if (player->timer_1F8 == 1) { - player->unk_0D4 = 1.0f; + if (player->csTimer == 1) { + player->gravity = 1.0f; D_ctx_80177A48[0] = 0.05f; } - if (player->timer_1F8 == 0) { - if (player->unk_0D4 > -0.3f) { - player->unk_0D4 = player->unk_0D4 - 0.05f; + if (player->csTimer == 0) { + if (player->gravity > -0.3f) { + player->gravity = player->gravity - 0.05f; } } @@ -129,14 +129,14 @@ void Titania_LevelStart(Player* player) { if (gCsFrameCount == 500) { gCsFrameCount = 480; - player->unk_1D0 = 3; - player->unk_144 = 200.0f; + player->csState = 3; + player->zPath = 200.0f; - D_ctx_80177D20 = 200.0f; - D_ctx_80177CC8 = D_ctx_80177D20; + gPathProgress = 200.0f; + gPathGroundScroll = gPathProgress; - player->pos.z = -(D_ctx_80177D20) -200.0f; - player->unk_0D4 = 0.0f; + player->pos.z = -(gPathProgress) -200.0f; + player->gravity = 0.0f; player->vel.y = 0.0f; player->pos.y = 2000.0f; player->vel.z = 0.0f; @@ -173,7 +173,7 @@ void Titania_LevelStart(Player* player) { gCsCamEyeY = sp48.y; player->cam.eye.y = sp48.y; - player->cam.eye.z = gCsCamEyeZ = player->pos.z + player->unk_144 + sp48.z; + player->cam.eye.z = gCsCamEyeZ = player->pos.z + player->zPath + sp48.z; } break; @@ -189,12 +189,12 @@ void Titania_LevelStart(Player* player) { gCsCamEyeX = sp48.x; gCsCamEyeY = sp48.y; - gCsCamEyeZ = player->pos.z + player->unk_144 + sp48.z; + gCsCamEyeZ = player->pos.z + player->zPath + sp48.z; gCsCamAtX = player->pos.x; player->cam.at.x = gCsCamAtX; player->cam.at.y = gCsCamAtY = player->pos.y; - player->cam.at.z = gCsCamAtZ = player->pos.z + player->unk_144; + player->cam.at.z = gCsCamAtZ = player->pos.z + player->zPath; Math_SmoothStepToF(&player->pos.y, D_ctx_80177A48[1], 0.1f, 50.0f, 0.0f); @@ -212,17 +212,18 @@ void Titania_LevelStart(Player* player) { if (player->pos.y < 100.0f) { func_effect_8007A900(RAND_FLOAT_CENTERED(30.0f) + player->pos.x, 30.0f, - RAND_FLOAT_CENTERED(30.0f) + player->unk_138, RAND_FLOAT(2.0f) + 3.5f, 255, 12, 1); + RAND_FLOAT_CENTERED(30.0f) + player->trueZpos, RAND_FLOAT(2.0f) + 3.5f, 255, 12, + 1); Object_Kill(&gActors[3].obj, gActors[3].sfxSource); } - Math_SmoothStepToF(&player->unk_0F0, SIN_DEG(gGameFrameCount * 5.0f) * 10.0f, 0.1f, 100.0f, 0.0f); + Math_SmoothStepToF(&player->rockAngle, SIN_DEG(gGameFrameCount * 5.0f) * 10.0f, 0.1f, 100.0f, 0.0f); if (gCsFrameCount == 580) { gLevelStartStatusScreenTimer = 50; player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; - player->unk_1D0 = player->timer_1F8 = player->timer_1FC = player->unk_240 = 0; - player->unk_0D4 = 3.0f; + player->csState = player->csTimer = player->csEventTimer = player->unk_240 = 0; + player->gravity = 3.0f; player->unk_014 = 0.0f; D_ctx_8017782C = 1; func_play_800A594C(); @@ -235,9 +236,9 @@ void Titania_LevelStart(Player* player) { } player->pos.y += player->vel.y; - player->vel.y -= player->unk_0D4; + player->vel.y -= player->gravity; player->pos.z += player->vel.z; - player->unk_138 = player->pos.z; + player->trueZpos = player->pos.z; Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], sp64, 0.00f); Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], sp64, 0.00f); @@ -263,7 +264,7 @@ void Titania_80188108(Actor* actor, s32 arg1) { actor->vel.z = player->vel.z; actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.rot.y = 180.0f; Object_SetInfo(&actor->info, actor->obj.id); @@ -289,20 +290,20 @@ void Titania_LevelComplete(Player* player) { Vec3f dest; s32 i; - switch (player->unk_1D0) { + switch (player->csState) { case 0: gCsFrameCount = gBossActive = gLoadLevelObjects = 0; Play_ClearObjectData(); - player->unk_1D0 = 1; + player->csState = 1; D_ctx_80177A48[0] = 0.0f; D_ctx_80177A48[1] = 0.0f; D_ctx_80177A48[2] = 0.0f; D_ctx_80177A48[3] = 250.0f; - player->unk_0D4 = 3.0f; + player->gravity = 3.0f; Titania_80188108(&gActors[0], 0); @@ -318,7 +319,7 @@ void Titania_LevelComplete(Player* player) { case 1: Math_SmoothStepToF(D_ctx_80177A48, 0.1f, 1.0f, 0.01f, 0.0f); Math_SmoothStepToF(&player->baseSpeed, 4.9f, 0.1f, 1.0f, 0.0f); - Math_SmoothStepToF(&player->unk_08C, 0.0f, 0.1f, 1.0f, 0.0f); + Math_SmoothStepToF(&player->camDist, 0.0f, 0.1f, 1.0f, 0.0f); if (gCsFrameCount < 1120) { Math_SmoothStepToF(&D_ctx_80177A48[1], 0.65f, 0.1f, 0.01f, 0.0f); @@ -339,7 +340,7 @@ void Titania_LevelComplete(Player* player) { gCsCamEyeX = player->pos.x + dest.x; gCsCamEyeY = player->pos.y + dest.y; - gCsCamEyeZ = player->pos.z + player->unk_144 + dest.z + 50.0f; + gCsCamEyeZ = player->pos.z + player->zPath + dest.z + 50.0f; if (gCsCamEyeY < 5.0f) { gCsCamEyeY = 5.0f; @@ -347,7 +348,7 @@ void Titania_LevelComplete(Player* player) { gCsCamAtX = player->pos.x; gCsCamAtY = player->pos.y + 30.0f; - gCsCamAtZ = player->pos.z + player->unk_144; + gCsCamAtZ = player->pos.z + player->zPath; func_tank_80045130(player); func_tank_80044868(player); @@ -366,7 +367,7 @@ void Titania_LevelComplete(Player* player) { y = D_i5_801B72B8[i].y + RAND_FLOAT_CENTERED(10.0f); z = D_i5_801B72B8[i].z; - func_effect_8007A900(player->pos.x + x, player->pos.y + y, player->unk_138 + z, + func_effect_8007A900(player->pos.x + x, player->pos.y + y, player->trueZpos + z, RAND_FLOAT(0.5f) + 0.5f, 255, 21, 0); } } @@ -379,7 +380,7 @@ void Titania_LevelComplete(Player* player) { gCsCamAtX = player->pos.x; gCsCamAtY = player->pos.y + 30.0f; - gCsCamAtZ = player->pos.z + player->unk_144; + gCsCamAtZ = player->pos.z + player->zPath; if (player->pos.y < 100.0f) { camAtY = SIN_DEG(gGameFrameCount * 130.0f) * 3.0f; @@ -390,13 +391,14 @@ void Titania_LevelComplete(Player* player) { if (gCsFrameCount < 1470) { func_effect_8007A900(RAND_FLOAT_CENTERED(30.0f) + (player->pos.x + 30.0f), 30.0f, - RAND_FLOAT_CENTERED(30.0f) + player->unk_138, RAND_FLOAT(2.0f) + 3.5f, 255, 12, 1); + RAND_FLOAT_CENTERED(30.0f) + player->trueZpos, RAND_FLOAT(2.0f) + 3.5f, 255, 12, + 1); } func_effect_8007A900(RAND_FLOAT_CENTERED(30.0f) + (player->pos.x - 30.0f), 30.0f, - RAND_FLOAT_CENTERED(30.0f) + player->unk_138, RAND_FLOAT(2.0f) + 3.5f, 255, 12, 1); - Math_SmoothStepToF(&player->unk_0F0, SIN_DEG(gGameFrameCount * 6.0f) * 18.0f, 0.1f, 100.0f, 0.0f); - Math_SmoothStepToF(&player->unk_080, SIN_DEG(gGameFrameCount * 3.0f) * 5.0f, 0.1f, 100.0f, 0.0f); + RAND_FLOAT_CENTERED(30.0f) + player->trueZpos, RAND_FLOAT(2.0f) + 3.5f, 255, 12, 1); + Math_SmoothStepToF(&player->rockAngle, SIN_DEG(gGameFrameCount * 6.0f) * 18.0f, 0.1f, 100.0f, 0.0f); + Math_SmoothStepToF(&player->yBob, SIN_DEG(gGameFrameCount * 3.0f) * 5.0f, 0.1f, 100.0f, 0.0f); x = SIN_DEG(gGameFrameCount * 4.0f) * -1.5f; @@ -408,7 +410,7 @@ void Titania_LevelComplete(Player* player) { player->pos.y += player->vel.y; player->pos.z += player->vel.z; - player->unk_138 = player->pos.z; + player->trueZpos = player->pos.z; break; } @@ -491,7 +493,7 @@ void Titania_LevelComplete(Player* player) { break; case 1300: - player->unk_1D0++; + player->csState++; D_ctx_80177A48[0] = 0.0f; player->vel.z = 0.0f; player->vel.y = 0.0f; diff --git a/src/overlays/ovl_i6/fox_andross.c b/src/overlays/ovl_i6/fox_andross.c index b4e1f500..e077dd5b 100644 --- a/src/overlays/ovl_i6/fox_andross.c +++ b/src/overlays/ovl_i6/fox_andross.c @@ -269,7 +269,7 @@ void Andross_801880E4(Actor* actor) { actor->fwork[1] = 47.0f; if ((fabsf(actor->obj.pos.x - gPlayer[0].pos.x) < 1000.0f) && (fabsf(actor->obj.pos.y - gPlayer[0].pos.y) < 500.0f) && - (fabsf(actor->obj.pos.z - gPlayer[0].unk_138) < 1000.0f)) { + (fabsf(actor->obj.pos.z - gPlayer[0].trueZpos) < 1000.0f)) { actor->iwork[11] = 2; actor->fwork[1] = 65.0f; } @@ -324,7 +324,7 @@ void Andross_80188528(Actor* actor) { Math_SmoothStepToF(&actor->vel.x, 0.0f, 0.2f, 0.5f, 0.0f); Math_SmoothStepToF(&actor->vel.y, 0.0f, 0.2f, 0.5f, 0.0f); Math_SmoothStepToF(&actor->vel.z, 0.0f, 0.2f, 0.5f, 0.0f); - if (actor->unk_0D0 != 0) { + if (actor->dmgType != 0) { func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); Object_Kill(&actor->obj, actor->sfxSource); func_effect_8007B344(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 3.0f, 5); @@ -385,7 +385,7 @@ void Andross_801888F4(Actor* actor) { if ((actor->timer_0BC % 2U) == 1) { func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 5.0f); } - if ((actor->timer_0BC == 0) || (actor->unk_0D0 != 0)) { + if ((actor->timer_0BC == 0) || (actor->dmgType != 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, 7.0f, 20); func_effect_8007B344(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 10.0f, 5); @@ -449,7 +449,7 @@ void Andross_80188A4C(Boss* boss) { boss->state = 12; boss->timer_050 = 50; boss->fwork[3] = gPlayer[0].pos.x; - boss->fwork[5] = gPlayer[0].unk_138; + boss->fwork[5] = gPlayer[0].trueZpos; AUDIO_PLAY_SFX(0x2940B096, boss->sfxSource, 4); } } @@ -517,14 +517,14 @@ void Andross_80188CB8(Boss* boss) { for (i = 10; i < 12; i++) { if ((gActors[i].obj.status == OBJ_ACTIVE) && (gActors[i].obj.id == OBJ_ACTOR_ALLRANGE)) { gTexturedLines[i].mode = 50; - gTexturedLines[i].unk_28 = 1.0f; - gTexturedLines[i].unk_04.x = boss->obj.pos.x; - gTexturedLines[i].unk_04.y = boss->obj.pos.y - 200.0f; - gTexturedLines[i].unk_04.z = boss->obj.pos.z; + gTexturedLines[i].xyScale = 1.0f; + gTexturedLines[i].posAA.x = boss->obj.pos.x; + gTexturedLines[i].posAA.y = boss->obj.pos.y - 200.0f; + gTexturedLines[i].posAA.z = boss->obj.pos.z; gTexturedLines[i].timer = 3; - gTexturedLines[i].unk_10.x = gActors[i].obj.pos.x; - gTexturedLines[i].unk_10.y = gActors[i].obj.pos.y; - gTexturedLines[i].unk_10.z = gActors[i].obj.pos.z; + gTexturedLines[i].posBB.x = gActors[i].obj.pos.x; + gTexturedLines[i].posBB.y = gActors[i].obj.pos.y; + gTexturedLines[i].posBB.z = gActors[i].obj.pos.z; boss->swork[4] = 1; } } @@ -586,17 +586,17 @@ void Andross_80189214(void) { PRINTF("FO_Game_Sw %d\n"); player->cam.at.x = 0.0f; player->cam.at.y = 0.0f; - player->unk_114 = 0.0f; - player->unk_144 = 0.0f; - D_ctx_80177D20 = 0.0f; + player->yRot_114 = 0.0f; + player->zPath = 0.0f; + gPathProgress = 0.0f; player->unk_018 = player->unk_014 = 1.0f; - player->pos.z = player->unk_138 = -player->unk_144; + player->pos.z = player->trueZpos = -player->zPath; func_play_800B56BC(player); } void Andross_8018933C(Actor* actor) { if ((fabsf(actor->obj.pos.x - gPlayer[0].pos.x) < 1000.0f) && - (fabsf(actor->obj.pos.z - gPlayer[0].unk_138) < 1000.0f)) { + (fabsf(actor->obj.pos.z - gPlayer[0].trueZpos) < 1000.0f)) { gStartAndrossFightTimer = 50; Object_Kill(&actor->obj, actor->sfxSource); } @@ -629,7 +629,7 @@ void Andross_80189470(Actor* actor) { if ((D_ctx_80177AB0 != 7) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (fabsf(actor->obj.pos.x - gPlayer[0].pos.x) < 9000.0f) && - (fabsf(actor->obj.pos.z - gPlayer[0].unk_138) < 9000.0f)) { + (fabsf(actor->obj.pos.z - gPlayer[0].trueZpos) < 9000.0f)) { D_ctx_80177AB0 = 7; Radio_PlayMessage(gMsg_ID_19370, RCID_JAMES); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 20); @@ -637,15 +637,15 @@ void Andross_80189470(Actor* actor) { } if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (fabsf(actor->obj.pos.x - gPlayer[0].pos.x) < 500.0f) && - (fabsf(actor->obj.pos.z - gPlayer[0].unk_138) < 500.0f)) { + (fabsf(actor->obj.pos.z - gPlayer[0].trueZpos) < 500.0f)) { Audio_KillSfxById(0x11403076); Audio_SetEnvSfxReverb(0); gCurrentLevel = LEVEL_VENOM_2; gLevelPhase = 1; gVenomHardClear = 1; player->state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; - player->unk_1D0 = 3; - player->unk_144 = D_ctx_80177D20 = 0.0f; + player->csState = 3; + player->zPath = gPathProgress = 0.0f; D_ctx_80177AB0 = D_ctx_80177A98 = 1; player->cam.eye.x = 1200.0f; player->cam.eye.z = 1200.0f; @@ -667,7 +667,7 @@ void Andross_80189470(Actor* actor) { func_play_800A594C(); gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0; gFillScreenAlpha = gFillScreenAlphaTarget = 255; - player->timer_1F8 = 2; + player->csTimer = 2; gCsFrameCount = 0; D_ctx_80177A48[1] = 0.0f; } @@ -680,7 +680,7 @@ void Andross_80189724(Actor* actor) { Vec3f vel; if ((fabsf(actor->obj.pos.x - gPlayer[0].pos.x) < 2000.0f) && - (fabsf(actor->obj.pos.z - gPlayer[0].unk_138) < 2000.0f)) { + (fabsf(actor->obj.pos.z - gPlayer[0].trueZpos) < 2000.0f)) { Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); vec.x = 0.0f; vec.y = 0.0f; @@ -701,14 +701,14 @@ void Andross_80189724(Actor* actor) { } } if ((fabsf(actor->obj.pos.x - gPlayer[0].pos.x) < 500.0f) && - (fabsf(actor->obj.pos.z - gPlayer[0].unk_138) < 500.0f)) { + (fabsf(actor->obj.pos.z - gPlayer[0].trueZpos) < 500.0f)) { if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE || gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) { gPlayer[0].shields = 0; gRightWingHealth[0] = gLeftWingHealth[0] = 0; Player_ApplyDamage(&gPlayer[0], 1, 60); Player_ApplyDamage(&gPlayer[0], 2, 60); actor->timer_0BC = 10; - gPlayer[0].timer_220 = 200; + gPlayer[0].radioDamageTimer = 200; } } if (actor->timer_0BC == 1) { @@ -772,7 +772,7 @@ void Andross_80189B70(Boss* boss) { } if ((fabsf(boss->obj.pos.x - gPlayer[0].pos.x) < 300.0f) && (fabsf(boss->obj.pos.y - 300.0f - gPlayer[0].pos.y) < 300.0f) && - (fabsf(boss->obj.pos.z - gPlayer[0].unk_138) < 300.0f) && (boss->state < 11) && (boss->timer_05A == 0)) { + (fabsf(boss->obj.pos.z - gPlayer[0].trueZpos) < 300.0f) && (boss->state < 11) && (boss->timer_05A == 0)) { boss->state = 11; boss->timer_050 = 150; AUDIO_PLAY_SFX(0x31408097, boss->sfxSource, 4); @@ -807,7 +807,7 @@ void Andross_80189B70(Boss* boss) { boss->swork[5] = 100; if (boss->timer_050 == 0) { gPlayer[0].state_1C8 = PLAYERSTATE_1C8_START_360; - gPlayer[0].unk_1D0 = 0; + gPlayer[0].csState = 0; boss->state = 1; gPlayer[0].unk_240 = 1; } @@ -840,7 +840,7 @@ void Andross_80189B70(Boss* boss) { gFillScreenAlphaTarget = 80; gFillScreenAlphaStep = 1; gPlayer[0].timer_224 = gGameFrameCount % 8U; - gPlayer[0].timer_220 = 3; + gPlayer[0].radioDamageTimer = 3; Math_SmoothStepToF(&D_ctx_801779A8[gMainController], 40.0f, 1.0f, 3.0f, 0.0f); if (((gGameFrameCount % 32) == 0) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE)) { Player_ApplyDamage(&gPlayer[0], 3, 10); @@ -880,7 +880,7 @@ void Andross_80189B70(Boss* boss) { boss->fwork[2] = 1.3f; boss->fwork[3] = gPlayer[0].pos.x; boss->fwork[4] = gPlayer[0].pos.y; - boss->fwork[5] = gPlayer[0].unk_138; + boss->fwork[5] = gPlayer[0].trueZpos; break; case 12: boss->info.hitbox = SEGMENTED_TO_VIRTUAL(&gNoHitbox); @@ -981,7 +981,7 @@ void Andross_80189B70(Boss* boss) { case 30: gRadioState = 0; Radio_PlayMessage(gMsg_ID_20318, RCID_FOX); - gPlayer[0].timer_220 = 200; + gPlayer[0].radioDamageTimer = 200; break; case 350: Radio_PlayMessage(gMsg_ID_19468, RCID_JAMES); @@ -1003,15 +1003,15 @@ void Andross_80189B70(Boss* boss) { gPlayer[0].pos.x = -25995.0f; gPlayer[0].pos.y = 300.0f; gPlayer[0].pos.z = -11140.0f; - gPlayer[0].unk_08C = 0.0f; - gPlayer[0].unk_114 = 271.0f; - gPlayer[0].boostSpeed = gPlayer[0].unk_4D8 = gPlayer[0].unk_0E8 = gPlayer[0].unk_0E4 = - gPlayer[0].unk_0EC = 0.0f; - gPlayer[0].unk_12C = 150.0f; + gPlayer[0].camDist = 0.0f; + gPlayer[0].yRot_114 = 271.0f; + gPlayer[0].boostSpeed = gPlayer[0].aerobaticPitch = gPlayer[0].rot.y = gPlayer[0].rot.x = + gPlayer[0].rot.z = 0.0f; + gPlayer[0].zRotBank = 150.0f; gPlayer[0].camRoll = -90.0f; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; - gPlayer[0].unk_1D0 = 100; - gPlayer[0].timer_1F8 = 240; + gPlayer[0].csState = 100; + gPlayer[0].csTimer = 240; gPlayer[0].unk_234 = 1; D_ctx_80177A48[5] = -1200.0f; @@ -1044,12 +1044,12 @@ void Andross_80189B70(Boss* boss) { boss->obj.pos.y = 10000.0f; if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && ((gGameFrameCount % 4) == 0)) { - Matrix_RotateY(gCalcMatrix, (gPlayer[0].unk_114 + gPlayer[0].unk_0E8) * M_DTOR, 0U); + Matrix_RotateY(gCalcMatrix, (gPlayer[0].yRot_114 + gPlayer[0].rot.y) * M_DTOR, 0U); vec.x = RAND_FLOAT_CENTERED(800.0f); vec.y = 600.0f; vec.z = RAND_FLOAT(1000.0f) + -3000.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &vec, &sp64); - Andross_80189B00(gPlayer[0].pos.x + sp64.x, sp64.y, gPlayer[0].unk_138 + sp64.z, 1.2f); + Andross_80189B00(gPlayer[0].pos.x + sp64.x, sp64.y, gPlayer[0].trueZpos + sp64.z, 1.2f); } if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_STANDBY) { Matrix_RotateY(gCalcMatrix, -gPlayer[0].camYaw, MTXF_NEW); @@ -1104,17 +1104,17 @@ void Andross_80189B70(Boss* boss) { Matrix_MultVec3fNoTranslate(gCalcMatrix, &vec, &sp64); boss->vel.x = sp64.x; boss->vel.y = sp64.y; - boss->vel.z = sp64.z - D_ctx_80177D08; + boss->vel.z = sp64.z - gPathVelZ; if (boss->state < 20) { gRadarMarks[59].status = 1; gRadarMarks[59].type = 102; gRadarMarks[59].pos.x = boss->obj.pos.x; gRadarMarks[59].pos.y = boss->obj.pos.y; gRadarMarks[59].pos.z = boss->obj.pos.z; - gRadarMarks[59].unk_10 = boss->unk_078.y + 180.0f; + gRadarMarks[59].yRot = boss->unk_078.y + 180.0f; } - gActors[10].info.unk_1C = 1.0f; - gActors[11].info.unk_1C = 1.0f; + gActors[10].info.targetOffset = 1.0f; + gActors[11].info.targetOffset = 1.0f; if (boss->swork[5] != 0) { boss->swork[5]--; if (boss->swork[5] == 0) { @@ -1128,13 +1128,13 @@ void Andross_80189B70(Boss* boss) { gActors[10].obj.pos.z = boss->obj.pos.z + 200.0f; gActors[10].state = 0; gActors[10].timer_0C2 = 20; - gActors[10].info.unk_1C = 0.0f; + gActors[10].info.targetOffset = 0.0f; gActors[11].obj.pos.x = boss->obj.pos.x - 200.0f; gActors[11].obj.pos.y = boss->obj.pos.y - 200.0f; gActors[11].obj.pos.z = boss->obj.pos.z + 200.0f; gActors[11].state = 0; gActors[11].timer_0C2 = 20; - gActors[11].info.unk_1C = 0.0f; + gActors[11].info.targetOffset = 0.0f; } Math_SmoothStepToF(&boss->fwork[21], boss->fwork[22], 1.0f, 6.0f, 0); Math_SmoothStepToF(&boss->fwork[23], boss->fwork[24], 0.3f, 0.01f, 0); @@ -1291,8 +1291,8 @@ void Andross_8018BDD8(void) { void Andross_8018C390(Player* player) { player->boostCooldown = 1; - player->unk_280 = 0; - switch (player->unk_1D0) { + player->barrelRollAlpha = 0; + switch (player->csState) { case 2: case 3: break; @@ -1300,7 +1300,7 @@ void Andross_8018C390(Player* player) { Math_SmoothStepToF(&player->pos.x, gBosses[0].obj.pos.x, 0.5f, 30.0f, 0); Math_SmoothStepToF(&player->pos.y, gBosses[0].obj.pos.y - 150.0f, 0.5f, 30.0f, 0); Math_SmoothStepToF(&player->pos.z, gBosses[0].obj.pos.z - 100.0f, 0.5f, 60.0f, 0); - D_ctx_80177D20 = player->unk_144 = -player->pos.z; + gPathProgress = player->zPath = -player->pos.z; Math_SmoothStepToF(&player->cam.eye.z, 2000.0f, 0.05f, 20.0f, 0); Math_SmoothStepToF(&player->cam.eye.x, 0.0f, 0.05f, 10.0f, 0); Math_SmoothStepToF(&player->cam.eye.y, 0.0f, 0.05f, 10.0f, 0); @@ -1309,29 +1309,29 @@ void Andross_8018C390(Player* player) { Math_SmoothStepToF(&player->cam.at.z, 100.0f, 0.05f, 10.0f, 0.0f); break; case 1: - player->unk_0E4 += 15.0f; + player->rot.x += 15.0f; - if (player->unk_0E4 > 180.0f) { - player->unk_0E4 -= 360.0f; + if (player->rot.x > 180.0f) { + player->rot.x -= 360.0f; } - player->unk_0E8 += 9.0f; - if (player->unk_0E8 > 180.0f) { - player->unk_0E8 -= 360.0f; + player->rot.y += 9.0f; + if (player->rot.y > 180.0f) { + player->rot.y -= 360.0f; } Math_SmoothStepToF(&player->cam.eye.z, 400.0f, 0.05f, 20.0f, 0.0f); - if (player->timer_1F8 != 0) { + if (player->csTimer != 0) { if (gControllerPress[gMainController].button != 0) { - player->timer_1F8--; + player->csTimer--; } } - if (player->timer_1F8 == 0) { + if (player->csTimer == 0) { player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->unk_014 = 0.0f; player->unk_018 = 0.0f; } break; } - player->unk_138 = player->pos.z + player->unk_08C; + player->trueZpos = player->pos.z + player->camDist; func_play_800A46A0(player); } @@ -1380,7 +1380,7 @@ void Andross_8018C7A0(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f3 effect->unk_60.x = RAND_FLOAT(10.0f) + 10.0f; effect->unk_60.y = RAND_FLOAT(10.0f) + 10.0f; Object_SetInfo(&effect->info, effect->obj.id); - effect->info.unk_10 = 100.0f; + effect->info.cullDistance = 100.0f; } void Andross_8018C8D4(f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, s32 arg6) { @@ -1412,7 +1412,7 @@ void Andross_8018C958(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f3 effect->unk_60.z = RAND_FLOAT_CENTERED(20.0f); Object_SetInfo(&effect->info, effect->obj.id); effect->info.unk_14 = 1; - effect->info.unk_10 = 100.0f; + effect->info.cullDistance = 100.0f; } void Andross_8018CA50(f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 scale) { @@ -1465,13 +1465,13 @@ void Andross_8018CAD4(Effect* effect) { Matrix_MultVec3f(gCalcMatrix, &vec, &vel); effect->vel.x = vel.x; effect->vel.y = vel.y; - effect->vel.z = vel.z - D_ctx_80177D08; + effect->vel.z = vel.z - gPathVelZ; if ((fabsf(effect->obj.pos.x - gBosses[0].obj.pos.x) <= 100.0f) && (fabsf(effect->obj.pos.z - (gBosses[0].obj.pos.z - 100.0f)) <= 100.0f)) { Object_Kill(&effect->obj, effect->sfxSource); } } else { - effect->info.unk_10 = 100.0f; + effect->info.cullDistance = 100.0f; Math_SmoothStepToF(&effect->vel.x, 0.0f, 0.05f, 1.0f, 0); Math_SmoothStepToF(&effect->vel.y, 0.0f, 0.05f, 1.0f, 0); Math_SmoothStepToF(&effect->vel.z, 70.0f, 0.05f, 2.0f, 0); @@ -1602,7 +1602,7 @@ void Andross_8018D2B0(Boss* boss) { boss->state = 31; boss->timer_050 = 200; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; - gPlayer[0].unk_1D0 = 0; + gPlayer[0].csState = 0; } else if (boss->health < 50) { AUDIO_PLAY_SFX(0x2943500F, boss->sfxSource, 4); } else { @@ -1840,7 +1840,7 @@ void Andross_8018DBF0(Boss* boss) { if (player->unk_234 != 0) { xDisplacement = gPlayer[0].pos.x - boss->vwork[2].x; yDisplacement = gPlayer[0].pos.y - boss->vwork[2].y; - zDisplacement = gPlayer[0].unk_138 - boss->vwork[2].z; + zDisplacement = gPlayer[0].trueZpos - boss->vwork[2].z; yaw = Math_RadToDeg(Math_Atan2F(xDisplacement, zDisplacement)); pitch = Math_RadToDeg(Math_Atan2F(yDisplacement, sqrtf(SQ(xDisplacement) + SQ(zDisplacement)))); @@ -1865,7 +1865,7 @@ void Andross_8018DBF0(Boss* boss) { if (player->unk_234 != 0) { xDisplacement = gPlayer[0].pos.x - boss->vwork[3].x; yDisplacement = gPlayer[0].pos.y - boss->vwork[3].y; - zDisplacement = gPlayer[0].unk_138 - boss->vwork[3].z; + zDisplacement = gPlayer[0].trueZpos - boss->vwork[3].z; yaw = Math_RadToDeg(Math_Atan2F(xDisplacement, zDisplacement)); pitch = Math_RadToDeg(Math_Atan2F(yDisplacement, sqrtf(SQ(xDisplacement) + SQ(zDisplacement)))); if ((yaw > 30.0f) && (yaw < 180.0f)) { @@ -2332,8 +2332,8 @@ void Andross_8018DBF0(Boss* boss) { } if ((boss->unk_04C == 13) && (player->state_1C8 == PLAYERSTATE_1C8_ANDROSS_MOUTH)) { player->unk_234 = 1; - player->unk_1D0 = 1; - player->timer_1F8 = 60; + player->csState = 1; + player->csTimer = 60; player->timer_498 = 50; boss->swork[8] = 0; gControllerRumbleTimers[0] = 30; @@ -2371,7 +2371,7 @@ void Andross_8018DBF0(Boss* boss) { if ((boss->timer_050 > 70) && (boss->timer_050 < 1000) && ((gGameFrameCount % 4) == 0)) { Andross_8018C734(gPlayer[0].cam.eye.x + RAND_FLOAT_CENTERED(3000.0f), gPlayer[0].cam.eye.y + RAND_FLOAT_CENTERED(3000.0f), - gPlayer[0].cam.eye.z - D_ctx_80177D20, RAND_INT(7.9)); + gPlayer[0].cam.eye.z - gPathProgress, RAND_INT(7.9)); } if (boss->timer_050 > 0) { playerShot = gPlayerShots; @@ -2412,14 +2412,14 @@ void Andross_8018DBF0(Boss* boss) { Math_SmoothStepToF(&player->pos.x, boss->obj.pos.x, 0.1f, boss->fwork[16], 0); Math_SmoothStepToF(&player->pos.y, boss->obj.pos.y - 150.0f, 0.1f, boss->fwork[16], 0); Math_SmoothStepToF(&boss->fwork[16], 35.0f, 1.0f, 0.5f, 0); - if (fabsf(player->unk_138 - boss->obj.pos.z) < 200.0f) { + if (fabsf(player->trueZpos - boss->obj.pos.z) < 200.0f) { boss->state = 15; boss->swork[8] = 1; boss->fwork[9] = 0.2f; boss->unk_04C = 0; if (player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) { player->state_1C8 = PLAYERSTATE_1C8_ANDROSS_MOUTH; - player->unk_1D0 = 0; + player->csState = 0; } break; } @@ -3139,7 +3139,7 @@ void Andross_801928C8(Boss* boss) { Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); if (boss->fwork[20] > 0.05f) { - Matrix_Translate(gGfxMatrix, boss->vwork[10].x, boss->vwork[10].y, boss->vwork[10].z + D_ctx_80177D20, + Matrix_Translate(gGfxMatrix, boss->vwork[10].x, boss->vwork[10].y, boss->vwork[10].z + gPathProgress, MTXF_APPLY); if (boss->fwork[21] > 0.05f) { Matrix_Push(&gGfxMatrix); @@ -3221,13 +3221,13 @@ void Andross_80192E94(Actor* actor) { actor->timer_0BC = 5; otherActor->timer_0BC = 5; gTexturedLines[actor->index].mode = 50; - gTexturedLines[actor->index].unk_28 = 1.0f; - gTexturedLines[actor->index].unk_04.x = actor->obj.pos.x; - gTexturedLines[actor->index].unk_04.y = actor->obj.pos.y; - gTexturedLines[actor->index].unk_04.z = actor->obj.pos.z; - gTexturedLines[actor->index].unk_10.x = otherActor->obj.pos.x; - gTexturedLines[actor->index].unk_10.y = otherActor->obj.pos.y; - gTexturedLines[actor->index].unk_10.z = otherActor->obj.pos.z; + gTexturedLines[actor->index].xyScale = 1.0f; + gTexturedLines[actor->index].posAA.x = actor->obj.pos.x; + gTexturedLines[actor->index].posAA.y = actor->obj.pos.y; + gTexturedLines[actor->index].posAA.z = actor->obj.pos.z; + gTexturedLines[actor->index].posBB.x = otherActor->obj.pos.x; + gTexturedLines[actor->index].posBB.y = otherActor->obj.pos.y; + gTexturedLines[actor->index].posBB.z = otherActor->obj.pos.z; gTexturedLines[actor->index].timer = 3; break; } @@ -3241,8 +3241,8 @@ void Andross_80192E94(Actor* actor) { break; } - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; + if (actor->dmgType != 0) { + actor->dmgType = 0; actor->health -= actor->damage; if (actor->health <= 0) { func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 5.0f); @@ -3284,7 +3284,7 @@ void Andross_80193380(Scenery* scenery) { switch (scenery->state) { case 0: - if (fabsf(scenery->obj.pos.z - gPlayer[0].unk_138) < 1800.0f) { + if (fabsf(scenery->obj.pos.z - gPlayer[0].trueZpos) < 1800.0f) { scenery->state = 1; scenery->info.hitbox = SEGMENTED_TO_VIRTUAL(D_ANDROSS_C038AC4); } @@ -3351,7 +3351,7 @@ void Andross_80193668(Scenery* scenery, f32 xPos, f32 yPos, f32 zPos, s32 arg4) scenery->unk_60 = -40.0f; Object_SetInfo(&scenery->info, scenery->obj.id); scenery->timer_4C = (arg4 * 50) + 100; - scenery->info.unk_10 = 100000.0f; + scenery->info.cullDistance = 100000.0f; } void Andross_80193710(void) { @@ -3410,7 +3410,7 @@ void Andross_801939A0(s32 actorIndex) { Actor_Initialize(actor); actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = 0.0f; actor->obj.pos.y = gPlayer[0].cam.at.y; actor->obj.pos.z = 0.0f; @@ -3443,7 +3443,7 @@ void Andross_80193AE4(s32 actorIndex) { Actor_Initialize(actor); actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = D_i6_801A6878[actorIndex].x; actor->obj.pos.y = D_i6_801A6878[actorIndex].y; actor->obj.pos.z = D_i6_801A6878[actorIndex].z; @@ -3486,33 +3486,33 @@ void Andross_80193C4C(Player* player) { Math_SmoothStepToF(D_ctx_80177A48, 1.0f, 1.0f, 0.01f, 0.0f); player->wings.unk_04 = player->wings.unk_08 = player->wings.unk_0C = player->wings.unk_10 = 0.0f; - switch (player->unk_1D0) { + switch (player->csState) { case 0: gCsFrameCount = 0; player->wings.modelId = 1; D_ctx_80177A48[0] = 0.0f; - if (player->unk_4D8 > 180.0f) { - player->unk_4D8 -= 360.0f; + if (player->aerobaticPitch > 180.0f) { + player->aerobaticPitch -= 360.0f; } - player->unk_1D0++; - player->timer_1F8 = 50; + player->csState++; + player->csTimer = 50; player->vel.z = -40.0f; /* fallthrough */ case 1: - Math_SmoothStepToF(&player->unk_12C, 0.0f, 0.1f, 15.0f, 0.0f); + Math_SmoothStepToF(&player->zRotBank, 0.0f, 0.1f, 15.0f, 0.0f); Math_SmoothStepToF(&boss->vel.z, -40.0f, 1.0f, 1.0f, 0.0f); - Math_SmoothStepToF(&player->unk_0E8, 0.0f, 0.1f, 10.0f, 0.0f); + Math_SmoothStepToF(&player->rot.y, 0.0f, 0.1f, 10.0f, 0.0f); Math_SmoothStepToF(&player->vel.x, 0.0f, 1.0f, 3.0f, 0.0f); Math_SmoothStepToF(&player->vel.y, 0.0f, 1.0f, 3.0f, 0.0f); Math_SmoothStepToF(&player->cam.eye.x, player->pos.x, 0.1f, 15.0f, 0.0f); Math_SmoothStepToF(&player->cam.eye.y, player->pos.y + 30.0f, 0.1f, 15.0f, 0.0f); - if (player->timer_1F8 == 0) { - player->pos.y += SIN_DEG(player->unk_0E4) * 15.0f; - Math_SmoothStepToF(&player->unk_0E4, 180.0f, 0.1f, 5.0f, 0.0f); + if (player->csTimer == 0) { + player->pos.y += SIN_DEG(player->rot.x) * 15.0f; + Math_SmoothStepToF(&player->rot.x, 180.0f, 0.1f, 5.0f, 0.0f); Math_SmoothStepToF(&player->vel.z, 40.0f, 1.0f, 2.0f, 0.0f); } else { - Math_SmoothStepToF(&player->unk_08C, 0.0f, 1.0f, 5.0f, 0.0f); - Math_SmoothStepToF(&player->unk_0E4, 0.0f, 0.1f, 10.0f, 0.0f); + Math_SmoothStepToF(&player->camDist, 0.0f, 1.0f, 5.0f, 0.0f); + Math_SmoothStepToF(&player->rot.x, 0.0f, 0.1f, 10.0f, 0.0f); } player->cam.eye.z += player->vel.z * 0.5f; switch (gCsFrameCount) { @@ -3529,7 +3529,7 @@ void Andross_80193C4C(Player* player) { D_ctx_80177AB0 = 0; break; case 111: - player->unk_1D0 = 2; + player->csState = 2; AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0); player->unk_190 = player->unk_194 = 7.0f; D_ctx_80177A48[0] = 0.0f; @@ -3543,7 +3543,7 @@ void Andross_80193C4C(Player* player) { } gCsCamAtX = gBosses[0].obj.pos.x; gCsCamAtY = gBosses[0].obj.pos.y; - gCsCamAtZ = gBosses[0].obj.pos.z + D_ctx_80177D20; + gCsCamAtZ = gBosses[0].obj.pos.z + gPathProgress; Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 3.0f, 0.0f); break; case 2: @@ -3583,7 +3583,7 @@ void Andross_80193C4C(Player* player) { Math_SmoothStepToF(&D_ctx_80177A48[5], 3.0f, 1.0f, 0.05f, 0.0f); player->cam.eye.z += player->vel.z * D_ctx_80177A48[2]; if (gCsFrameCount > 230) { - player->unk_08C -= 7.0f; + player->camDist -= 7.0f; } if (gCsFrameCount > 230) { Math_SmoothStepToF(&D_ctx_80177A48[7], 3.0f, 1.0f, 0.1f, 0.0f); @@ -3598,15 +3598,15 @@ void Andross_80193C4C(Player* player) { Math_SmoothStepToF(&player->cam.eye.x, D_ctx_80177A48[1] + player->pos.x, 0.1f, 15.0f, 0.0f); Math_SmoothStepToF(&player->cam.eye.y, player->pos.y + 30.0f, 0.1f, 15.0f, 0.0f); - Math_SmoothStepToF(&player->unk_0EC, -180.0f, 0.02f, D_ctx_80177A48[6], 0.0f); + Math_SmoothStepToF(&player->rot.z, -180.0f, 0.02f, D_ctx_80177A48[6], 0.0f); Math_SmoothStepToF(&D_ctx_80177A48[6], 3.0f, 1.0f, 0.05f, 0.0f); gCsCamAtX = player->pos.x; gCsCamAtY = player->pos.y; - gCsCamAtZ = player->unk_138 + D_ctx_80177D20; + gCsCamAtZ = player->trueZpos + gPathProgress; if (gCsFrameCount > 200) { - player->unk_25C += 0.03f; - if (player->unk_25C > 0.6f) { - player->unk_25C = 0.6f; + player->contrailScale += 0.03f; + if (player->contrailScale > 0.6f) { + player->contrailScale = 0.6f; } Math_SmoothStepToF(&player->camRoll, 3.0f, 0.5f, 0.1f, 0.0f); Math_SmoothStepToF(D_ctx_801779A8, 70.0f, 1.0f, 2.0f, 0.0f); @@ -3624,7 +3624,7 @@ void Andross_80193C4C(Player* player) { case 25: for (i = 0; i < 12; i++) { Andross_80193668(&gScenery[i], player->pos.x, player->pos.y, - (player->cam.eye.z - D_ctx_80177D20) + (2195.0f * i), i); + (player->cam.eye.z - gPathProgress) + (2195.0f * i), i); } break; case 150: @@ -3638,8 +3638,8 @@ void Andross_80193C4C(Player* player) { gCurrentLevel = LEVEL_VENOM_2; gLevelPhase = 1; gLevelMode = LEVELMODE_ALL_RANGE; - player->unk_1D0 = 3; - player->unk_144 = D_ctx_80177D20 = 0.0f; + player->csState = 3; + player->zPath = gPathProgress = 0.0f; D_ctx_80177AB0 = D_ctx_80177A98 = 1; player->cam.eye.x = 1200.0f; player->cam.eye.z = 1200.0f; @@ -3660,14 +3660,14 @@ void Andross_80193C4C(Player* player) { func_play_800A594C(); gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0; gFillScreenAlpha = gFillScreenAlphaTarget = 255; - player->timer_1F8 = 2; + player->csTimer = 2; gCsFrameCount = 0; D_ctx_80177A48[1] = 0.0f; break; } break; case 3: - if (player->timer_1F8 == 0) { + if (player->csTimer == 0) { gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0; gFillScreenAlpha = gFillScreenAlphaTarget = 0; } else { @@ -3704,7 +3704,7 @@ void Andross_80193C4C(Player* player) { AUDIO_PLAY_BGM(SEQ_ID_VE_CLEAR | SEQ_FLAG); } if (gCsFrameCount == 150) { - player->unk_1D0++; + player->csState++; D_ctx_80177A48[0] = 1.0f; D_ctx_80177A48[1] = 1000.0f; D_ctx_80177A48[2] = 0; @@ -3784,7 +3784,7 @@ void Andross_80193C4C(Player* player) { } if (gCsFrameCount == 360) { gCsFrameCount = 340; - player->unk_1D0++; + player->csState++; D_ctx_80177A48[0] = 1.0f; D_ctx_80177A48[1] = 0.0f; D_ctx_80177A48[2] = 0.0f; @@ -3804,7 +3804,7 @@ void Andross_80193C4C(Player* player) { gActors[10].unk_0F4.x = gActors[10].unk_0F4.y = 0.0f; gFillScreenAlpha = gFillScreenAlphaTarget = 255; gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0; - player->timer_1F8 = 3; + player->csTimer = 3; gStarCount = 500; } if (gCsFrameCount == 250) { @@ -3812,7 +3812,7 @@ void Andross_80193C4C(Player* player) { } break; case 5: - if (player->timer_1F8 == 1) { + if (player->csTimer == 1) { gFillScreenAlpha = gFillScreenAlphaTarget = 0; } if (gVenomHardClear != 0) { @@ -3825,9 +3825,9 @@ void Andross_80193C4C(Player* player) { } if ((gCsFrameCount >= 920) && (gTeamShields[TEAM_ID_PEPPY] > 0)) { if (gCsFrameCount == 920) { - player->timer_1F8 = 25; + player->csTimer = 25; } - gActors[10].fwork[19] = SIN_DEG(player->timer_1F8 * 40.0f) * 5.0f; + gActors[10].fwork[19] = SIN_DEG(player->csTimer * 40.0f) * 5.0f; } else { if (gCsFrameCount < 850) { switch (gCsFrameCount) { @@ -3956,8 +3956,9 @@ void Andross_80193C4C(Player* player) { if (gPlayerGlareAlphas[0] > 255) { gPlayerGlareAlphas[0] = 0; } - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->xRot_120 + player->rot.x + player->aerobaticPitch) * M_DTOR), + MTXF_APPLY); sp74.x = 0.0f; sp74.y = 0.0f; sp74.z = player->baseSpeed; @@ -3965,7 +3966,7 @@ void Andross_80193C4C(Player* player) { player->vel.x = sp68.x; player->vel.z = sp68.z; player->vel.y = sp68.y; - if (player->timer_1F8 == 0) { + if (player->csTimer == 0) { player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->unk_014 = 0.2f; player->unk_018 = 0.0f; @@ -3988,17 +3989,17 @@ void Andross_80193C4C(Player* player) { Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0); Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0); Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->unk_12C, 0.0f, 0.1f, 0.7f, 0.0f); + Math_SmoothStepToF(&player->zRotBank, 0.0f, 0.1f, 0.7f, 0.0f); Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 0.4f, 0.0f); break; } player->pos.x += player->vel.x; player->pos.y += player->vel.y; player->pos.z += player->vel.z; - player->unk_138 = player->pos.z + player->unk_08C; - player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; - Math_SmoothStepToF(&player->unk_130, 0.0f, 0.1f, 15.0f, 0.0f); - Math_SmoothStepToAngle(&player->unk_4D8, 0.0f, 0.1f, 20.0f, 0.0f); + player->trueZpos = player->pos.z + player->camDist; + player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll; + Math_SmoothStepToF(&player->zRotBarrelRoll, 0.0f, 0.1f, 15.0f, 0.0f); + Math_SmoothStepToAngle(&player->aerobaticPitch, 0.0f, 0.1f, 20.0f, 0.0f); Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0); Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0); Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0); diff --git a/src/overlays/ovl_i6/fox_sy.c b/src/overlays/ovl_i6/fox_sy.c index 65882a27..06903226 100644 --- a/src/overlays/ovl_i6/fox_sy.c +++ b/src/overlays/ovl_i6/fox_sy.c @@ -26,7 +26,7 @@ f32 D_i6_801A8440[3]; void SectorY_80197B30(Actor* actor, s32 timer) { Actor_Initialize(actor); actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = gPlayer[0].pos.x; actor->obj.pos.y = gPlayer[0].pos.y; actor->obj.pos.z = gPlayer[0].pos.z; @@ -34,9 +34,9 @@ void SectorY_80197B30(Actor* actor, s32 timer) { actor->vel.x = gPlayer[0].vel.x; actor->vel.y = gPlayer[0].vel.y; actor->vel.z = gPlayer[0].vel.z; - actor->obj.rot.x = gPlayer[0].unk_120 + gPlayer[0].unk_0E4 + gPlayer[0].unk_4D8; - actor->obj.rot.y = gPlayer[0].unk_114 + gPlayer[0].unk_0E8 + 180.0f; - actor->obj.rot.z = gPlayer[0].unk_0EC; + actor->obj.rot.x = gPlayer[0].xRot_120 + gPlayer[0].rot.x + gPlayer[0].aerobaticPitch; + actor->obj.rot.y = gPlayer[0].yRot_114 + gPlayer[0].rot.y + 180.0f; + actor->obj.rot.z = gPlayer[0].rot.z; actor->state = 5; actor->timer_04C = timer; actor->iwork[11] = 1; @@ -98,7 +98,7 @@ void SectorY_Boss314_Init(Boss314* this) { if (gLevelMode == LEVELMODE_ON_RAILS) { if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) { gPlayer[0].state_1C8 = PLAYERSTATE_1C8_START_360; - gPlayer[0].unk_1D0 = 0; + gPlayer[0].csState = 0; SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 50); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50); } @@ -232,7 +232,7 @@ void SectorY_801983E4(Boss* boss) { SectorY_8019C194(boss, zSpeed, xSpeed); if (boss->swork[22] == 1) { - yAngle = gPlayer[0].unk_114 - 180.0f; + yAngle = gPlayer[0].yRot_114 - 180.0f; if (yAngle < 0.0f) { yAngle += 360.0f; } @@ -425,16 +425,16 @@ void SectorY_80198F5C(Boss* boss) { if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) { gCsFrameCount = 0; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; - gPlayer[0].timer_1F8 = 0; - gPlayer[0].unk_1D0 = gPlayer[0].timer_1F8; - gPlayer[0].unk_0E8 += gPlayer[0].unk_114; - if (gPlayer[0].unk_0E8 > 360.0f) { - gPlayer[0].unk_0E8 -= 360.0f; + gPlayer[0].csTimer = 0; + gPlayer[0].csState = gPlayer[0].csTimer; + gPlayer[0].rot.y += gPlayer[0].yRot_114; + if (gPlayer[0].rot.y > 360.0f) { + gPlayer[0].rot.y -= 360.0f; } - if (gPlayer[0].unk_0E8 < 0.0f) { - gPlayer[0].unk_0E8 += 360.0f; + if (gPlayer[0].rot.y < 0.0f) { + gPlayer[0].rot.y += 360.0f; } - gPlayer[0].unk_114 = 0.0f; + gPlayer[0].yRot_114 = 0.0f; } AUDIO_PLAY_SFX(0x2940D09A, boss->sfxSource, 4); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 30); @@ -714,7 +714,7 @@ void SectorY_80199DAC(Boss* boss) { } else { Math_SmoothStepToF(&boss->vel.x, boss->fwork[11], 0.1f, 0.5f, 0.1f); Math_SmoothStepToF(&boss->vel.z, boss->fwork[13], 0.1f, 0.5f, 0.1f); - yAngle = gPlayer[0].unk_114 - 180.0f; + yAngle = gPlayer[0].yRot_114 - 180.0f; if (yAngle < 0.0f) { yAngle += 360.0f; } @@ -1247,13 +1247,13 @@ void SectorY_8019BC14(Boss* boss) { gPlayer[0].pos.x = boss->fwork[0x12]; gPlayer[0].pos.y = boss->fwork[0x13]; - gPlayer[0].unk_138 = gPlayer[0].pos.z = boss->fwork[0x14]; + gPlayer[0].trueZpos = gPlayer[0].pos.z = boss->fwork[0x14]; func_effect_8007F11C(OBJ_EFFECT_354, boss->fwork[1], boss->fwork[2], boss->fwork[3], 100.0f); gPlayer[0].pos.x = sp4C; gPlayer[0].pos.y = sp48; - gPlayer[0].unk_138 = gPlayer[0].pos.z = sp44; + gPlayer[0].trueZpos = gPlayer[0].pos.z = sp44; if (boss->index == 0) { AUDIO_PLAY_SFX(0x2901306E, boss->sfxSource, 4); @@ -1632,7 +1632,7 @@ void SectorY_8019C888(Boss* boss) { radarMark->pos.x = boss->obj.pos.x; radarMark->pos.y = boss->obj.pos.y; radarMark->pos.z = boss->obj.pos.z; - radarMark->unk_10 = boss->unk_078.y + 180.0f; + radarMark->yRot = boss->unk_078.y + 180.0f; } else { radarMark = &gRadarMarks[boss->index + 4]; radarMark->status = 1; @@ -1640,7 +1640,7 @@ void SectorY_8019C888(Boss* boss) { radarMark->pos.x = boss->obj.pos.x; radarMark->pos.y = boss->obj.pos.y; radarMark->pos.z = boss->obj.pos.z; - radarMark->unk_10 = boss->unk_078.y + 180.0f; + radarMark->yRot = boss->unk_078.y + 180.0f; } if (gBossFrameCount == 250) { @@ -1902,7 +1902,7 @@ void SectorY_8019E2C4(Boss* boss) { Matrix_RotateZ(gGfxMatrix, -boss->obj.rot.z * M_DTOR, MTXF_APPLY); sp98 = gPlayer[0].cam.eye.x - boss->obj.pos.x; sp94 = gPlayer[0].cam.eye.y - boss->obj.pos.y; - sp90 = gPlayer[0].cam.eye.z - (boss->obj.pos.z + D_ctx_80177D20); + sp90 = gPlayer[0].cam.eye.z - (boss->obj.pos.z + gPathProgress); sp8C = -Math_Atan2F(sp98, sp90); sp9C = sqrtf(SQ(sp90) + SQ(sp98)); sp88 = Math_Atan2F(sp94, sp9C); @@ -2003,7 +2003,7 @@ void SectorY_8019EB80(void) { } Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = (D_i6_801A69FC[i].x * 0.5f) + gPlayer[0].pos.x + RAND_FLOAT_CENTERED_SEEDED(2000.0f); actor->obj.pos.y = D_i6_801A69FC[i].y + gPlayer[0].pos.y + RAND_FLOAT_SEEDED(1000.0f); actor->obj.pos.z = D_i6_801A69FC[i].z + gPlayer[0].pos.z + RAND_FLOAT_SEEDED(1000.0f); @@ -2037,15 +2037,15 @@ void SectorY_LevelComplete(Player* player) { Boss* boss = &gBosses[0]; f32 temp_ft1; - switch (player->unk_1D0) { + switch (player->csState) { case 0: gCsFrameCount = 0; - player->unk_4D8 = 0.0f; + player->aerobaticPitch = 0.0f; player->camRoll = 0.0f; player->baseSpeed = 40.0f; player->boostSpeed = 0.0f; player->wings.unk_04 = player->wings.unk_0C = player->wings.unk_08 = player->wings.unk_10 = - player->unk_130 = player->unk_12C = 0.0f; + player->zRotBarrelRoll = player->zRotBank = 0.0f; player->unk_234 = 1; D_ctx_80177A48[8] = Math_RadToDeg( Math_Atan2F(gPlayer[0].cam.eye.x - boss->obj.pos.x, gPlayer[0].cam.eye.z - boss->obj.pos.z)); @@ -2071,7 +2071,7 @@ void SectorY_LevelComplete(Player* player) { Object_Kill(&gActors[3].obj, gActors[3].sfxSource); Object_Kill(&gActors[4].obj, gActors[4].sfxSource); - player->unk_1D0++; + player->csState++; D_ctx_80177A48[0] = 0.05f; if (Rand_ZeroOne() > 0.5f) { @@ -2082,13 +2082,13 @@ void SectorY_LevelComplete(Player* player) { break; case 1: - Math_SmoothStepToF(&player->unk_0E4, 0, 0.1f, 5.0f, 0); + Math_SmoothStepToF(&player->rot.x, 0, 0.1f, 5.0f, 0); Math_SmoothStepToF(&player->pos.y, 400.0f, 0.05f, 3.0f, 0); temp1 = player->pos.x - boss->obj.pos.x; temp2 = player->pos.z - boss->obj.pos.z; temp_ft1 = Math_RadToDeg(Math_Atan2F(temp1, temp2)); - temp_ft1 = Math_SmoothStepToAngle(&player->unk_0E8, temp_ft1, 0.5f, 2.0f, 0.0001f) * 30.0f; - Math_SmoothStepToAngle(&player->unk_0EC, -temp_ft1, 0.1f, 5.0f, 0.0001f); + temp_ft1 = Math_SmoothStepToAngle(&player->rot.y, temp_ft1, 0.5f, 2.0f, 0.0001f) * 30.0f; + Math_SmoothStepToAngle(&player->rot.z, -temp_ft1, 0.1f, 5.0f, 0.0001f); if (gCsFrameCount < 180) { D_ctx_80177A48[8] += D_ctx_80177A48[9]; @@ -2100,8 +2100,8 @@ void SectorY_LevelComplete(Player* player) { gCsCamEyeX = boss->obj.pos.x + sp54.x; gCsCamEyeZ = boss->obj.pos.z + sp54.z; } - temp_ft1 = Math_SmoothStepToAngle(&player->unk_0E8, 283.0f, 0.1f, 3.0f, 0.0f); - Math_SmoothStepToF(&player->unk_0EC, temp_ft1 * 20.0f, 0.1f, 1.0f, 0); + temp_ft1 = Math_SmoothStepToAngle(&player->rot.y, 283.0f, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToF(&player->rot.z, temp_ft1 * 20.0f, 0.1f, 1.0f, 0); for (i = 1; i < 4; i++) { temp_ft1 = Math_SmoothStepToAngle(&gActors[i].unk_0F4.y, gActors[i].fwork[1], 0.1f, 3.0f, 0.0f); @@ -2114,26 +2114,26 @@ void SectorY_LevelComplete(Player* player) { } if (gCsFrameCount == 230) { D_ctx_80177A48[0] = 1.0f; - player->unk_1D0++; + player->csState++; Play_ClearObjectData(); Audio_StopPlayerNoise(0); Audio_KillSfxBySource(player->sfxSource); gFillScreenAlpha = 250; - player->timer_1F8 = 50; + player->csTimer = 50; player->baseSpeed = 0.0f; - player->unk_0E4 = 0.0f; - player->unk_0E8 = 0.0f; - player->unk_0EC = 0.0f; + player->rot.x = 0.0f; + player->rot.y = 0.0f; + player->rot.z = 0.0f; } break; case 2: - if (player->timer_1F8 == 0) { + if (player->csTimer == 0) { player->unk_240 = 1; player->pos.x = 0.0f; player->pos.y = 3500.0f; player->pos.z = 0.0f; - player->unk_1D0++; + player->csState++; Audio_StartPlayerNoise(0); AUDIO_PLAY_BGM(SEQ_ID_GOOD_END); D_ctx_80177A98 = 0; @@ -2203,7 +2203,7 @@ void SectorY_LevelComplete(Player* player) { if (gCsFrameCount > 1440) { player->baseSpeed += 2.0f; - player->unk_0E4 += 0.1f; + player->rot.x += 0.1f; Math_SmoothStepToF(&D_ctx_80177A48[2], 0.0f, 1.0f, 0.001f, 0); player->unk_190 = 2.0f; } else if (D_ctx_80177A48[1] >= 92.0f) { @@ -2219,7 +2219,7 @@ void SectorY_LevelComplete(Player* player) { if (gFillScreenAlpha == 255) { Audio_FadeOutAll(10); player->state_1C8 = PLAYERSTATE_1C8_NEXT; - player->timer_1F8 = 0; + player->csTimer = 0; gFadeoutType = 4; gLeveLClearStatus[LEVEL_SECTOR_Y] = Play_CheckMedalStatus(150) + 1; } @@ -2338,8 +2338,8 @@ void SectorY_LevelComplete(Player* player) { break; } - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4) * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->xRot_120 + player->rot.x) * M_DTOR), MTXF_APPLY); sp60.x = 0.0f; sp60.y = 0.0f; sp60.z = player->baseSpeed; @@ -2350,18 +2350,18 @@ void SectorY_LevelComplete(Player* player) { player->pos.x += player->vel.x; player->pos.y += player->vel.y; player->pos.z += player->vel.z; - player->unk_138 = player->pos.z; - player->unk_0F8 = player->unk_0EC; + player->trueZpos = player->pos.z; + player->bankAngle = player->rot.z; Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0.0f); Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0.0f); Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0.0f); Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0.0f); Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0.0f); Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0.0f); - player->unk_088 += 10.0f; - player->unk_080 = -SIN_DEG(player->unk_088) * 0.3f; - player->unk_0F4 += 8.0f; - player->unk_0F0 = SIN_DEG(player->unk_0F4); + player->bobPhase += 10.0f; + player->yBob = -SIN_DEG(player->bobPhase) * 0.3f; + player->rockPhase += 8.0f; + player->rockAngle = SIN_DEG(player->rockPhase); } void SectorY_8019FF00(Actor* actor) { @@ -2404,10 +2404,10 @@ void SectorY_8019FF00(Actor* actor) { break; case 7: - actor->unk_0F4.y = gPlayer[0].unk_0E8; - actor->unk_0F4.z = gPlayer[0].unk_0EC; + actor->unk_0F4.y = gPlayer[0].rot.y; + actor->unk_0F4.z = gPlayer[0].rot.z; Math_SmoothStepToF(&actor->obj.pos.y, 50.0f, 0.1f, 1.0f, 0.0f); - if (gPlayer[0].unk_0E8 == 0.0f) { + if (gPlayer[0].rot.y == 0.0f) { Math_SmoothStepToF(&actor->obj.pos.x, 1300.0f, 1.0f, 2.0f, 0.0f); } else { if (gCsFrameCount == 540) { @@ -2428,8 +2428,8 @@ void SectorY_8019FF00(Actor* actor) { Math_SmoothStepToF(&actor->obj.pos.x, -1000.0f, 1.0f, 20.0f, 0.0f); Math_SmoothStepToAngle(&actor->unk_0F4.z, 45.0f, 1.0f, 4.0f, 0.0f); } else { - actor->unk_0F4.y = gPlayer[0].unk_0E8; - actor->unk_0F4.z = gPlayer[0].unk_0EC; + actor->unk_0F4.y = gPlayer[0].rot.y; + actor->unk_0F4.z = gPlayer[0].rot.z; Math_SmoothStepToF(&actor->obj.pos.x, -230.0f, 1.0f, 13.0f, 0.0f); } break; @@ -2444,8 +2444,8 @@ void SectorY_8019FF00(Actor* actor) { Math_SmoothStepToF(&actor->obj.pos.x, 1500.0f, 1.0f, 20.0f, 0.0f); Math_SmoothStepToAngle(&actor->unk_0F4.z, 315.0f, 1.0f, 2.0f, 0.0f); } else { - actor->unk_0F4.y = gPlayer[0].unk_0E8; - actor->unk_0F4.z = gPlayer[0].unk_0EC; + actor->unk_0F4.y = gPlayer[0].rot.y; + actor->unk_0F4.z = gPlayer[0].rot.z; Math_SmoothStepToF(&actor->obj.pos.x, 150.0f, 1.0f, 13.0f, 0.0f); } break; @@ -2477,7 +2477,7 @@ void SectorY_801A0510(Actor* actor, s32 arg1) { Actor_Initialize(actor); actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = D_i6_801A6A74[arg1].x; actor->obj.pos.y = D_i6_801A6A74[arg1].y; actor->obj.pos.z = D_i6_801A6A74[arg1].z; @@ -2540,13 +2540,13 @@ void SectorY_801A06A4(Actor* actor, s32 arg1) { if (gTeamShields[1 + arg1] > 0) { Actor_Initialize(actor); actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos.x = gPlayer[0].pos.x + D_i6_801A6AEC[arg1].x; actor->obj.pos.y = gPlayer[0].pos.y + D_i6_801A6AEC[arg1].y; actor->obj.pos.z = gPlayer[0].pos.z + D_i6_801A6AEC[arg1].z; actor->fwork[0] = gPlayer[0].baseSpeed; - actor->unk_0F4.y = gPlayer[0].unk_0E8; - actor->unk_0F4.z = gPlayer[0].unk_0EC; + actor->unk_0F4.y = gPlayer[0].rot.y; + actor->unk_0F4.z = gPlayer[0].rot.z; actor->state = arg1 + 7; actor->iwork[11] = 1; Object_SetInfo(&actor->info, actor->obj.id); @@ -2561,7 +2561,7 @@ void SectorY_801A07FC(Actor* actor0, Actor* actor1) { Actor_Initialize(actor1); actor1->obj.status = OBJ_ACTIVE; - actor1->obj.id = OBJ_ACTOR_195; + actor1->obj.id = OBJ_ACTOR_CUTSCENE; actor0->fwork[6] = 1.8f; sp3C.x = -40.0f; sp3C.y = 0.0f; @@ -2593,7 +2593,7 @@ void SectorY_801A07FC(Actor* actor0, Actor* actor1) { void SectorY_801A0A08(Actor* actor, f32 xPos, f32 yPos, f32 zPos, f32 arg4) { Actor_Initialize(actor); actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_195; + actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->fwork[0] = arg4; actor->obj.pos.x = xPos; actor->obj.pos.y = yPos; @@ -2617,13 +2617,13 @@ void SectorY_801A0AC0(Player* player) { f32 sp84; f32 sp80; - switch (player->unk_1D0) { + switch (player->csState) { case 0: gCsFrameCount = 0; for (i = 0; i < 5; i++) { SectorY_801A0510(&gActors[i + 5], i); } - player->unk_1D0 = 1; + player->csState = 1; player->cam.eye.x = gCsCamEyeX = -2000.0f; player->cam.eye.y = gCsCamEyeY = 0.0f; player->cam.eye.z = gCsCamEyeZ = -1700.0f; @@ -2868,7 +2868,7 @@ void SectorY_801A0AC0(Player* player) { gFillScreenAlpha = 255; gFillScreenAlphaTarget = 0; Object_Kill(&gActors[8].obj, gActors[8].sfxSource); - player->unk_1D0++; + player->csState++; player->cam.eye.x = gCsCamEyeX = 0.0f; player->cam.eye.y = gCsCamEyeY = 0.0f; player->cam.eye.z = gCsCamEyeZ = 0.0f; @@ -3051,7 +3051,7 @@ void SectorY_801A0AC0(Player* player) { gActors[7].iwork[4] = 4; gActors[7].iwork[5] = 0; gActors[7].vel.x = -1.5f; - player->unk_1D0++; + player->csState++; break; } break; @@ -3122,16 +3122,16 @@ void SectorY_801A0AC0(Player* player) { Math_SmoothStepToAngle(&gActors[5].obj.rot.y, 30.0f, 1.0f, 0.75f, 0.0f); } - if ((gCsFrameCount > 440) && (player->unk_0E8 != 0.0f)) { + if ((gCsFrameCount > 440) && (player->rot.y != 0.0f)) { Math_SmoothStepToF(&gPlayer[0].pos.y, 0.0f, 0.1f, 5.0f, 0.0f); - Math_SmoothStepToAngle(&player->unk_0EC, - Math_SmoothStepToAngle(&player->unk_0E8, 0.0f, 1.0f, 0.7f, 0.0f) * 30.0f, 0.1f, + Math_SmoothStepToAngle(&player->rot.z, + Math_SmoothStepToAngle(&player->rot.y, 0.0f, 1.0f, 0.7f, 0.0f) * 30.0f, 0.1f, 5.0f, 0); Math_SmoothStepToF(&gPlayer[0].pos.x, 0.0f, 1.0f, 13.0f, 0.0f); } - if (player->unk_0E8 == 0.0f) { - Math_SmoothStepToAngle(&player->unk_0EC, 0.0f, 1.0f, 0.5f, 0); + if (player->rot.y == 0.0f) { + Math_SmoothStepToAngle(&player->rot.z, 0.0f, 1.0f, 0.5f, 0); Math_SmoothStepToF(&gPlayer[0].pos.x, 0.0f, 1.0f, 2.0f, 0.0f); } @@ -3207,8 +3207,8 @@ void SectorY_801A0AC0(Player* player) { player->pos.y = 300.0f; player->pos.z = 4000.0f; player->baseSpeed = 40.0f; - player->unk_0E8 = 80.0f; - player->unk_0EC = 240.0f; + player->rot.y = 80.0f; + player->rot.z = 240.0f; for (i = 0; i < 3; i++) { SectorY_801A06A4(&gActors[i], i); @@ -3272,13 +3272,13 @@ void SectorY_801A0AC0(Player* player) { gActors[7].obj.rot.y = 140.0f; gActors[5].fwork[0] = 2.8f; AUDIO_PLAY_SFX(0x2902306C, gActors[5].sfxSource, 4); - player->unk_1D0++; + player->csState++; break; } break; case 4: - Math_SmoothStepToAngle(&player->unk_0EC, 0.0f, 1.0f, 0.5f, 0); + Math_SmoothStepToAngle(&player->rot.z, 0.0f, 1.0f, 0.5f, 0); Math_SmoothStepToF(&gPlayer[0].pos.x, 0.0f, 1.0f, 1.0f, 0.0f); Math_SmoothStepToF(D_ctx_80177A48, 1.0f, 0.1f, 0.05f, 0.0f); @@ -3286,7 +3286,7 @@ void SectorY_801A0AC0(Player* player) { Math_SmoothStepToF(&gActors[5].obj.pos.z, -12000.0f, 1.0f, 100.0f, 1.0f); Math_SmoothStepToF(&gActors[5].obj.pos.x, 0.0f, 1.0f, 40.0f, 1.0f); Math_SmoothStepToF(&gActors[5].obj.pos.y, 13000.0f, 1.0f, 30.0f, 1.0f); - Math_SmoothStepToAngle(&player->unk_0E8, 0.0f, 1.0f, 0.5f, 0.0f); + Math_SmoothStepToAngle(&player->rot.y, 0.0f, 1.0f, 0.5f, 0.0f); Math_SmoothStepToF(&player->pos.x, 0.0f, 1.0f, 1.0f, 0.0f); } else { Math_SmoothStepToF(&gActors[5].obj.pos.z, -12000.0f, 1.0f, 100.0f, 1.0f); @@ -3346,20 +3346,20 @@ void SectorY_801A0AC0(Player* player) { gActors[8].obj.pos.z = -8100.0f; gActors[9].obj.pos.z = -7100.0f; D_ctx_80177A48[0] = 1.0f; - player->pos.z = player->unk_138 = 0.0f; + player->pos.z = player->trueZpos = 0.0f; player->baseSpeed = gArwingSpeed; AUDIO_PLAY_BGM(SEQ_ID_SECTOR_Y | SEQ_FLAG); gLevelStartStatusScreenTimer = 100; player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; - player->unk_1D0 = 0; - player->timer_1F8 = 0; - player->timer_1FC = 0; + player->csState = 0; + player->csTimer = 0; + player->csEventTimer = 0; gCsCamEyeX = player->pos.x; gCsCamEyeY = (player->pos.y * player->unk_148) + 50.0f; gCsCamEyeZ = 400.0f; gCsCamAtX = player->pos.x; gCsCamAtY = (player->pos.y * player->unk_148) + 20.0f; - gCsCamAtZ = player->unk_138; + gCsCamAtZ = player->trueZpos; player->cam.eye.x = player->pos.x; player->cam.eye.y = player->pos.y * player->unk_148; player->cam.eye.y += 50.0f; @@ -3367,7 +3367,7 @@ void SectorY_801A0AC0(Player* player) { player->cam.at.x = player->pos.x; player->cam.at.y = player->pos.y * player->unk_148; player->cam.at.y += 20.0f; - player->cam.at.z = player->unk_138 - 41.0f; + player->cam.at.z = player->trueZpos - 41.0f; for (i = 0; i < 11; i++) { Object_Kill(&gActors[i].obj, gActors[i].sfxSource); @@ -3381,8 +3381,8 @@ void SectorY_801A0AC0(Player* player) { Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 20000.0f, 0); Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 20000.0f, 0); Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 20000.0f, 0); - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->rot.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(player->rot.x * M_DTOR), MTXF_APPLY); spA4.x = 0.0f; spA4.y = 0.0f; spA4.z = player->baseSpeed; @@ -3393,7 +3393,7 @@ void SectorY_801A0AC0(Player* player) { player->pos.x += player->vel.x; player->pos.y += player->vel.y; player->pos.z += player->vel.z; - player->unk_138 = player->pos.z + player->unk_08C; + player->trueZpos = player->pos.z + player->camDist; } void SectorY_801A39FC(Actor* actor, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, s32 arg7) { @@ -3716,13 +3716,13 @@ void SectorY_Actor204_Update(Actor204* this) { this->info.hitbox = SEGMENTED_TO_VIRTUAL(D_SY_60340C0); } - if ((this->unk_0D0 != 0) && (this->unk_046 != 3)) { + if ((this->dmgType != 0) && (this->unk_046 != 3)) { - if (this->unk_0D0 == 2) { - this->unk_0D2 = 1; + if (this->dmgType == 2) { + this->dmgPart = 1; } - this->unk_0D0 = 0; - if (this->unk_0D2 == 0) { + this->dmgType = 0; + if (this->dmgPart == 0) { this->iwork[18] = 15; AUDIO_PLAY_SFX(0x29121007, this->sfxSource, 4); @@ -3815,7 +3815,7 @@ void SectorY_Actor204_Draw(Actor204* this) { gDPSetEnvColor(gMasterDisp++, 255, 48, 0, 255); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, this->fwork[16], this->fwork[17], this->fwork[18] + D_ctx_80177D20, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, this->fwork[16], this->fwork[17], this->fwork[18] + gPathProgress, MTXF_APPLY); Matrix_Scale(gGfxMatrix, scale, scale, scale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); diff --git a/src/overlays/ovl_i6/fox_turret.c b/src/overlays/ovl_i6/fox_turret.c index e517ea3d..e70a9689 100644 --- a/src/overlays/ovl_i6/fox_turret.c +++ b/src/overlays/ovl_i6/fox_turret.c @@ -8,7 +8,7 @@ void Turret_801A5560(Player* player, PlayerShot* shot, f32 xOffset, f32 yOffset, PlayerShot_Initialize(shot); Matrix_RotateY(gCalcMatrix, player->unk_000 * M_DTOR, MTXF_NEW); Matrix_RotateX(gCalcMatrix, player->unk_004 * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, player->unk_0EC * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, player->rot.z * M_DTOR, MTXF_APPLY); Matrix_RotateY(gCalcMatrix, player->unk_180 * M_DTOR, MTXF_APPLY); Matrix_RotateX(gCalcMatrix, player->unk_17C * M_DTOR, MTXF_APPLY); sp4C.x = xOffset; @@ -17,11 +17,11 @@ void Turret_801A5560(Player* player, PlayerShot* shot, f32 xOffset, f32 yOffset, Matrix_MultVec3f(gCalcMatrix, &sp4C, &sp34); Matrix_RotateY(gCalcMatrix, player->unk_000 * M_DTOR, MTXF_NEW); Matrix_RotateX(gCalcMatrix, player->unk_004 * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, player->unk_0EC * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, player->rot.z * M_DTOR, MTXF_APPLY); Matrix_RotateY(gCalcMatrix, player->unk_180 * M_DTOR, MTXF_APPLY); Matrix_RotateX(gCalcMatrix, player->unk_17C * M_DTOR, MTXF_APPLY); - Matrix_RotateY(gCalcMatrix, player->unk_0E8 * M_DTOR, MTXF_APPLY); - Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, player->rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, player->rot.x * M_DTOR, MTXF_APPLY); sp4C.x = sp4C.y = 0.0f; sp4C.z = speed; Matrix_MultVec3f(gCalcMatrix, &sp4C, &sp40); @@ -45,11 +45,11 @@ void Turret_801A5560(Player* player, PlayerShot* shot, f32 xOffset, f32 yOffset, shot->unk_50 = player->unk_004; shot->unk_54 = player->unk_000; - shot->obj.rot.z = player->unk_0EC; + shot->obj.rot.z = player->rot.z; shot->unk_60 = 0; shot->obj.id = shotId; shot->unk_64 = 40; - shot->unk_44 = 1.5f; + shot->scale = 1.5f; shot->playerNum = player->num; } @@ -97,22 +97,22 @@ void Turret_801A58A8(Player* player) { for (i = 0; i < player->unk_1C0; i++) { if ((gActors[i].obj.status == OBJ_ACTIVE) && (gActors[i].obj.id == OBJ_ACTOR_EVENT)) { gTexturedLines[i].mode = 3; - gTexturedLines[i].unk_24 = 1.0f; + gTexturedLines[i].zScale = 1.0f; - gTexturedLines[i].unk_04.x = player->pos.x; - gTexturedLines[i].unk_04.y = player->pos.y; - gTexturedLines[i].unk_04.z = player->pos.z - 100.0f; + gTexturedLines[i].posAA.x = player->pos.x; + gTexturedLines[i].posAA.y = player->pos.y; + gTexturedLines[i].posAA.z = player->pos.z - 100.0f; gTexturedLines[i].timer = 2; - gTexturedLines[i].unk_2C = 255; - gTexturedLines[i].unk_2D = 255; - gTexturedLines[i].unk_2E = 255; - gTexturedLines[i].unk_2F = 255; + gTexturedLines[i].red = 255; + gTexturedLines[i].green = 255; + gTexturedLines[i].blue = 255; + gTexturedLines[i].alpha = 255; - gTexturedLines[i].unk_10.x = gActors[i].obj.pos.x; - gTexturedLines[i].unk_10.y = gActors[i].obj.pos.y; - gTexturedLines[i].unk_10.z = gActors[i].obj.pos.z; + gTexturedLines[i].posBB.x = gActors[i].obj.pos.x; + gTexturedLines[i].posBB.y = gActors[i].obj.pos.y; + gTexturedLines[i].posBB.z = gActors[i].obj.pos.z; } } if (gControllerHold[player->num].button & R_TRIG) { @@ -136,7 +136,7 @@ void Turret_801A5AD4(Player* player) { player->pos.z = gActors[player->unk_1B4].obj.pos.z; player->unk_000 = gActors[player->unk_1B4].obj.rot.y; player->unk_004 = gActors[player->unk_1B4].obj.rot.x; - player->unk_0EC = gActors[player->unk_1B4].obj.rot.z; + player->rot.z = gActors[player->unk_1B4].obj.rot.z; if (player->unk_1B0 < 2) { if (player->unk_1B0 == 0) { player->unk_1BC = 200; @@ -151,14 +151,14 @@ void Turret_801A5AD4(Player* player) { } sp2C = (f32) gControllerPress[player->num].stick_x; sp28 = -(f32) gControllerPress[player->num].stick_y; - Math_SmoothStepToF(&player->unk_0E8, -sp2C * 0.35000002f, 0.5f, 2.0f, 0.00001f); - Math_SmoothStepToF(&player->unk_0E4, -sp28 * 0.3f, 0.5f, 2.0f, 0.00001f); - player->unk_138 = player->pos.z; - player->unk_140 = -gActors[player->unk_1B4].vel.z; - player->unk_144 += player->unk_140; + Math_SmoothStepToF(&player->rot.y, -sp2C * 0.35000002f, 0.5f, 2.0f, 0.00001f); + Math_SmoothStepToF(&player->rot.x, -sp28 * 0.3f, 0.5f, 2.0f, 0.00001f); + player->trueZpos = player->pos.z; + player->zPathVel = -gActors[player->unk_1B4].vel.z; + player->zPath += player->zPathVel; - D_ctx_80177D08 = player->unk_140; - D_ctx_80177D20 = player->unk_144; + gPathVelZ = player->zPathVel; + gPathProgress = player->zPath; if (!(gControllerHold[player->num].button & Z_TRIG) && (sqrtf((sp2C * sp2C) + (sp28 * sp28)) > 55.0f)) { if ((gControllerHold[player->num].button & R_CBUTTONS) || (sp2C > 40.0f)) { @@ -215,9 +215,9 @@ void Turret_801A5FC0(Player* player) { sp3C.x = 0.0f; sp3C.y = 0.0f; sp3C.z = 100.0f; - Matrix_RotateY(gCalcMatrix, (player->unk_000 + (player->unk_134 * 0.3f)) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, (player->unk_004 + (player->unk_134 * 0.3f)) * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, player->unk_0EC * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->unk_000 + (player->damageShake * 0.3f)) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, (player->unk_004 + (player->damageShake * 0.3f)) * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, player->rot.z * M_DTOR, MTXF_APPLY); Matrix_RotateY(gCalcMatrix, player->unk_180 * M_DTOR, MTXF_APPLY); Matrix_RotateX(gCalcMatrix, player->unk_17C * M_DTOR, MTXF_APPLY); // unclear what values are being multiplied by 0.0f @@ -226,10 +226,10 @@ void Turret_801A5FC0(Player* player) { Matrix_MultVec3f(gCalcMatrix, &sp3C, &sp30); player->cam.at.x = player->pos.x + sp30.x; player->cam.at.y = player->pos.y + sp30.y; - player->cam.at.z = player->pos.z + D_ctx_80177D20 + sp30.z; + player->cam.at.z = player->pos.z + gPathProgress + sp30.z; player->cam.eye.x = player->pos.x; player->cam.eye.y = player->pos.y; - player->cam.eye.z = player->pos.z + D_ctx_80177D20; + player->cam.eye.z = player->pos.z + gPathProgress; } void Turret_801A6164(Player* player) { @@ -245,8 +245,8 @@ void Turret_801A6164(Player* player) { Matrix_Push(&gGfxMatrix); RCP_SetupDL_36(); Matrix_Translate(gGfxMatrix, 0.0f, -100.0f, 0.0f, MTXF_APPLY); - Matrix_RotateY(gGfxMatrix, player->unk_0E8 * M_DTOR, MTXF_APPLY); - Matrix_RotateX(gGfxMatrix, -player->unk_0E4 * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, player->rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -player->rot.x * M_DTOR, MTXF_APPLY); if (player->unk_1B0 < 2) { Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -5000.0f + (player->unk_1BC * 25), MTXF_APPLY); } else { @@ -263,15 +263,15 @@ void Turret_801A6164(Player* player) { } Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, -100.0f, -100.0f, -200.0f + player->unk_1BC, MTXF_APPLY); - Matrix_RotateY(gGfxMatrix, player->unk_0E8 * M_DTOR, MTXF_APPLY); - Matrix_RotateX(gGfxMatrix, -player->unk_0E4 * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, player->rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -player->rot.x * M_DTOR, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, 100.0f, -100.0f, -200.0f + player->unk_1BC, MTXF_APPLY); - Matrix_RotateY(gGfxMatrix, player->unk_0E8 * M_DTOR, MTXF_APPLY); - Matrix_RotateX(gGfxMatrix, -player->unk_0E4 * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, player->rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -player->rot.x * M_DTOR, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); Matrix_Pop(&gGfxMatrix); @@ -280,16 +280,16 @@ void Turret_801A6164(Player* player) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 128); Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, -100.0f, -100.0f, -200.0f + player->unk_1BC, MTXF_APPLY); - Matrix_RotateY(gGfxMatrix, player->unk_0E8 * M_DTOR, MTXF_APPLY); - Matrix_RotateX(gGfxMatrix, -player->unk_0E4 * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, player->rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -player->rot.x * M_DTOR, MTXF_APPLY); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -188.0f, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, 100.0f, -100.0f, -200.0f + player->unk_1BC, MTXF_APPLY); - Matrix_RotateY(gGfxMatrix, player->unk_0E8 * M_DTOR, MTXF_APPLY); - Matrix_RotateX(gGfxMatrix, -player->unk_0E4 * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, player->rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -player->rot.x * M_DTOR, MTXF_APPLY); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -188.0f, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); diff --git a/src/overlays/ovl_i6/fox_ve2.c b/src/overlays/ovl_i6/fox_ve2.c index cac2d03d..2fc75bbf 100644 --- a/src/overlays/ovl_i6/fox_ve2.c +++ b/src/overlays/ovl_i6/fox_ve2.c @@ -61,8 +61,8 @@ void Venom2_UpdateEvents(Actor* this) { player->pos.x = 0.0f; player->pos.z = 16000.0f; player->pos.y = 4350.0f; - player->unk_0E4 = -20.0f; - player->unk_114 = 0.0f; + player->rot.x = -20.0f; + player->yRot_114 = 0.0f; this->timer_0BC = 210; for (team = &gActors[1], i = 1; i < 4; i++, team++) { team->obj.pos.x = D_i6_801A68B0[i - 1].x; @@ -108,7 +108,7 @@ void Venom2_UpdateEvents(Actor* this) { } player->state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; - player->unk_1D0 = 0; + player->csState = 0; gLeveLClearStatus[gCurrentLevel] = 2; D_ctx_80177C94 = gGoldRingCount[0]; D_ctx_80177C9C = player->shields + 1; @@ -226,8 +226,8 @@ void Venom2_LevelStart(Player* player) { gFillScreenAlphaStep = 3; gFillScreenAlphaTarget = 0; } - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->xRot_120 + player->rot.x + player->aerobaticPitch) * M_DTOR), MTXF_APPLY); vec.x = 0.0f; vec.y = 0.0f; vec.z = player->baseSpeed + player->boostSpeed; @@ -239,8 +239,8 @@ void Venom2_LevelStart(Player* player) { player->pos.y += player->vel.y; player->pos.z += player->vel.z; - player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; - player->unk_138 = player->pos.z; + player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll; + player->trueZpos = player->pos.z; player->cam.eye.x = 50.0f; player->cam.eye.y = 1800.0f; player->cam.eye.z = 9000.0f; @@ -267,11 +267,11 @@ void Venom2_LevelComplete(Player* player) { s32 pad2; Math_SmoothStepToF(&player->boostSpeed, 0.0f, 0.1f, 1.5f, 0.0f); - Math_SmoothStepToF(&player->unk_0E8, 0.0f, 0.1f, 1.5f, 0.0f); - Math_SmoothStepToF(&player->unk_0E4, 0.0f, 0.1f, 1.5f, 0.0f); + Math_SmoothStepToF(&player->rot.y, 0.0f, 0.1f, 1.5f, 0.0f); + Math_SmoothStepToF(&player->rot.x, 0.0f, 0.1f, 1.5f, 0.0f); - var_fa0 = -player->unk_120; - temp_fv1 = player->unk_0EC; + var_fa0 = -player->xRot_120; + temp_fv1 = player->rot.z; if (var_fa0 < -90.0f) { var_fa0 = 0.0f; @@ -295,30 +295,30 @@ void Venom2_LevelComplete(Player* player) { sp90 = player->pos.y - (gBosses[0].obj.pos.y + 700.0f); sp8C = player->pos.z - gBosses[0].obj.pos.z; - switch (player->unk_1D0) { + switch (player->csState) { case 0: - player->unk_1D0++; + player->csState++; player->wings.unk_04 = player->wings.unk_0C = player->wings.unk_08 = player->wings.unk_10 = 0.0f; player->wings.modelId = 1; D_ctx_80177A48[0] = 0.0f; D_ctx_80177A48[1] = 0.1f; D_ctx_80177A48[3] = 0.0f; D_ctx_80177A48[4] = 0.0f; - player->timer_1F8 = 0; + player->csTimer = 0; if ((fabsf(sp94) < 4000.0f) && (fabsf(sp8C) < 4000.0f)) { - player->timer_1F8 = 250; + player->csTimer = 250; sp64.x = 0.0f; sp64.y = 0.0f; sp64.z = 5000.0f; - Matrix_RotateY(gCalcMatrix, player->unk_114, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, player->yRot_114, MTXF_NEW); Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp64, &sp58); D_ctx_80177A48[5] = sp58.x; D_ctx_80177A48[6] = sp58.z; } if (gLevelPhase == 2) { - player->timer_1FC = 240; + player->csEventTimer = 240; } else { - player->timer_1FC = 180; + player->csEventTimer = 180; } SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 60); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 60); @@ -330,11 +330,11 @@ void Venom2_LevelComplete(Player* player) { gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; } Math_SmoothStepToF(&D_ctx_80177A48[1], 0.8f, 1.0f, 0.05f, 0.0f); - Math_SmoothStepToF(&player->unk_12C, 0.0f, 0.1f, 15.0f, 0.0f); - if (player->timer_1F8 == 1) { + Math_SmoothStepToF(&player->zRotBank, 0.0f, 0.1f, 15.0f, 0.0f); + if (player->csTimer == 1) { D_ctx_80177A48[4] = 0.0f; } - if (player->timer_1F8 != 0) { + if (player->csTimer != 0) { sp94 = player->pos.x - (gBosses[0].obj.pos.x + D_ctx_80177A48[5]); sp90 = player->pos.y - (gBosses[0].obj.pos.y + 700.0f); sp8C = player->pos.z - (gBosses[0].obj.pos.z + D_ctx_80177A48[6]); @@ -342,12 +342,12 @@ void Venom2_LevelComplete(Player* player) { sp84 = Math_RadToDeg(Math_Atan2F(sp94, sp8C)); sp8C = sqrtf(SQ(sp94) + SQ(sp8C)); pad88 = Math_RadToDeg(-Math_Atan2F(sp90, sp8C)); - Math_SmoothStepToAngle(&player->unk_120, pad88, 0.1f, D_ctx_80177A48[4], 0.0f); - pad80 = Math_SmoothStepToAngle(&player->unk_114, sp84, 0.1f, D_ctx_80177A48[4], 0.0f) * 20.0f; - Math_SmoothStepToF(&player->unk_0EC, pad80, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToAngle(&player->xRot_120, pad88, 0.1f, D_ctx_80177A48[4], 0.0f); + pad80 = Math_SmoothStepToAngle(&player->yRot_114, sp84, 0.1f, D_ctx_80177A48[4], 0.0f) * 20.0f; + Math_SmoothStepToF(&player->rot.z, pad80, 0.1f, 3.0f, 0.0f); Math_SmoothStepToF(&D_ctx_80177A48[4], 3.0f, 1.0f, 0.1f, 0.0f); Matrix_RotateX(gCalcMatrix, -(D_PI / 9), MTXF_NEW); - Matrix_RotateY(gCalcMatrix, (D_ctx_80177A48[3] + player->unk_114) * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (D_ctx_80177A48[3] + player->yRot_114) * M_DTOR, MTXF_APPLY); D_ctx_80177A48[3] += 1.0f; sp64.x = 0.0f; sp64.y = 0.0f; @@ -358,14 +358,14 @@ void Venom2_LevelComplete(Player* player) { gCsCamEyeZ = player->pos.z + sp58.z; Math_SmoothStepToF(D_ctx_80177A48, 0.5f, 1.0f, 0.01f, 0.0f); Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 3.0f, 0.0f); - if ((player->timer_1F8 == 0) && (fabsf(sp94) < 50.0f) && (fabsf(sp8C) < 50.0f)) { - player->unk_1D0++; + if ((player->csTimer == 0) && (fabsf(sp94) < 50.0f) && (fabsf(sp8C) < 50.0f)) { + player->csState++; D_ctx_80177A48[2] = 0.75f; D_ctx_80177A48[3] = 0.0f; D_ctx_80177A48[4] = 0.0f; - if (player->unk_120 >= 180.0f) { - player->unk_120 -= 360.0f; + if (player->xRot_120 >= 180.0f) { + player->xRot_120 -= 360.0f; } AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0); player->unk_194 = 5.0f; @@ -376,17 +376,17 @@ void Venom2_LevelComplete(Player* player) { break; case 2: player->unk_190 = 2.0f; - Math_SmoothStepToF(&player->unk_120, 270.0f, 0.1f, D_ctx_80177A48[2], 0.0f); + Math_SmoothStepToF(&player->xRot_120, 270.0f, 0.1f, D_ctx_80177A48[2], 0.0f); Math_SmoothStepToF(&D_ctx_80177A48[2], 4.0f, 1.0f, 0.05f, 0.0f); - if (player->unk_120 > 80.0f) { - Math_SmoothStepToF(&player->unk_12C, 10000.0f, 0.1f, 8.0f, 0.0f); + if (player->xRot_120 > 80.0f) { + Math_SmoothStepToF(&player->zRotBank, 10000.0f, 0.1f, 8.0f, 0.0f); } - if (player->unk_120 > 250.0f) { + if (player->xRot_120 > 250.0f) { Math_SmoothStepToF(&player->pos.x, 0.0f, 0.3f, D_ctx_80177A48[3], 0.0f); Math_SmoothStepToF(&player->pos.z, 0.0f, 0.3f, D_ctx_80177A48[3], 0.0f); Math_SmoothStepToF(&D_ctx_80177A48[3], 30.0f, 1.0f, 1.0f, 0.0f); } - if (player->unk_120 > 200.0f) { + if (player->xRot_120 > 200.0f) { Math_SmoothStepToF(&D_ctx_80177A48[4], 20.0f, 1.0f, 1.0f, 0.0f); Math_SmoothStepToF(&gCsCamEyeX, player->pos.x, 0.1f, D_ctx_80177A48[4], 0.0f); Math_SmoothStepToF(&gCsCamEyeY, player->pos.y + 200.0f, 0.1f, D_ctx_80177A48[4], 0.0f); @@ -430,11 +430,11 @@ void Venom2_LevelComplete(Player* player) { } break; } - if (player->timer_1FC == 150) { + if (player->csEventTimer == 150) { Radio_PlayMessage(gMsg_ID_8215, RCID_FOX); AUDIO_PLAY_BGM(SEQ_ID_TO_ANDROSS | SEQ_FLAG); } - if (player->timer_1FC == 1) { + if (player->csEventTimer == 1) { if ((gTeamShields[TEAM_ID_SLIPPY] > 0) || (gTeamShields[TEAM_ID_FALCO] > 0) || (gTeamShields[TEAM_ID_PEPPY] > 0)) { Radio_PlayMessage(gMsg_ID_8230, RCID_FALCO); @@ -446,9 +446,9 @@ void Venom2_LevelComplete(Player* player) { } gCsCamAtX = player->pos.x; gCsCamAtY = player->pos.y; - gCsCamAtZ = player->unk_138; - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); + gCsCamAtZ = player->trueZpos; + Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->xRot_120 + player->rot.x + player->aerobaticPitch) * M_DTOR), MTXF_APPLY); sp64.x = 0.0f; sp64.y = 0.0f; sp64.z = player->baseSpeed + player->boostSpeed; @@ -459,18 +459,18 @@ void Venom2_LevelComplete(Player* player) { player->pos.x += player->vel.x; player->pos.y += player->vel.y; player->pos.z += player->vel.z; - player->unk_138 = player->pos.z; - player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; - Math_SmoothStepToF(&player->unk_130, 0.0f, 0.1f, 15.0f, 0.0f); - Math_SmoothStepToAngle(&player->unk_4D8, 0.0f, 0.1f, 5.0f, 0.0f); + player->trueZpos = player->pos.z; + player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll; + Math_SmoothStepToF(&player->zRotBarrelRoll, 0.0f, 0.1f, 15.0f, 0.0f); + Math_SmoothStepToAngle(&player->aerobaticPitch, 0.0f, 0.1f, 5.0f, 0.0f); Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 100.0f, 0); Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 100.0f, 0); Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 100.0f, 0); Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[1], 100.0f, 0); Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[1], 100.0f, 0); Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[1], 100.0f, 0); - player->unk_088 += 10.0f; - player->unk_080 = -SIN_DEG(player->unk_088) * 0.3f; - player->unk_0F4 += 8.0f; - player->unk_0F0 = SIN_DEG(player->unk_0F4); + player->bobPhase += 10.0f; + player->yBob = -SIN_DEG(player->bobPhase) * 0.3f; + player->rockPhase += 8.0f; + player->rockAngle = SIN_DEG(player->rockPhase); } diff --git a/src/overlays/ovl_menu/fox_map.c b/src/overlays/ovl_menu/fox_map.c index 35c81a42..86951da7 100644 --- a/src/overlays/ovl_menu/fox_map.c +++ b/src/overlays/ovl_menu/fox_map.c @@ -1340,7 +1340,7 @@ void Map_8019E99C(void) { gFillScreenRed = 0; gFillScreenGreen = 0; gFillScreenBlue = 0; - D_ctx_80177D20 = 0.0f; + gPathProgress = 0.0f; D_menu_801CF018 = 0; @@ -1588,7 +1588,7 @@ void Map_8019F600(void) { //! @bug gPlanetPathStatus is 2 shorter than sPaths for (i = 0; i < ARRAY_COUNT(sPaths); i++) { gPlanetPathStatus[i] = 0; - gTexturedLines[i].unk_24 = 0.0f; + gTexturedLines[i].zScale = 0.0f; } for (i = 0; i < ARRAY_COUNT(gMissionMedal); i++) { @@ -1639,7 +1639,7 @@ void Map_8019F83C(void) { } sPaths[i].alpha = 0; - gTexturedLines[i].unk_24 = 0.0f; + gTexturedLines[i].zScale = 0.0f; } } @@ -4282,7 +4282,7 @@ void Map_801A6628(void) { Play_Setup(); gSavedObjectLoadIndex = 0; - D_ctx_80177CB0 = 0.0f; + gSavedPathProgress = 0.0f; D_ctx_8017782C = 1; } @@ -6113,9 +6113,9 @@ void Map_801AC200(s32 index) { f32 r2; Vec3f vec; - v.x = gTexturedLines[index].unk_10.x - gTexturedLines[index].unk_04.x; - v.y = gTexturedLines[index].unk_10.y - gTexturedLines[index].unk_04.y; - v.z = gTexturedLines[index].unk_10.z - gTexturedLines[index].unk_04.z; + v.x = gTexturedLines[index].posBB.x - gTexturedLines[index].posAA.x; + v.y = gTexturedLines[index].posBB.y - gTexturedLines[index].posAA.y; + v.z = gTexturedLines[index].posBB.z - gTexturedLines[index].posAA.z; r = VEC3F_MAG(&v); @@ -6128,9 +6128,9 @@ void Map_801AC200(s32 index) { vec.y = (v.y / r) * (r / (sPaths[index].length - 1)); vec.z = (v.z / r) * (r / (sPaths[index].length - 1)); - D_menu_801CEEB0.x = gTexturedLines[index].unk_04.x + (vec.x * D_menu_801CEEA0); - D_menu_801CEEB0.y = gTexturedLines[index].unk_04.y + (vec.y * D_menu_801CEEA0); - D_menu_801CEEB0.z = gTexturedLines[index].unk_04.z + (vec.z * D_menu_801CEEA0); + D_menu_801CEEB0.x = gTexturedLines[index].posAA.x + (vec.x * D_menu_801CEEA0); + D_menu_801CEEB0.y = gTexturedLines[index].posAA.y + (vec.y * D_menu_801CEEA0); + D_menu_801CEEB0.z = gTexturedLines[index].posAA.z + (vec.z * D_menu_801CEEA0); switch (D_menu_801CEEA4) { case 0: @@ -6167,17 +6167,17 @@ void Map_801AC200(s32 index) { return; } } else { - vec.x = (v.x / r) * gTexturedLines[index].unk_24; - vec.y = (v.y / r) * gTexturedLines[index].unk_24; - vec.z = (v.z / r) * gTexturedLines[index].unk_24; + vec.x = (v.x / r) * gTexturedLines[index].zScale; + vec.y = (v.y / r) * gTexturedLines[index].zScale; + vec.z = (v.z / r) * gTexturedLines[index].zScale; - D_menu_801CEEB0.x = gTexturedLines[index].unk_04.x + vec.x; - D_menu_801CEEB0.y = gTexturedLines[index].unk_04.y + vec.y; - D_menu_801CEEB0.z = gTexturedLines[index].unk_04.z + vec.z; + D_menu_801CEEB0.x = gTexturedLines[index].posAA.x + vec.x; + D_menu_801CEEB0.y = gTexturedLines[index].posAA.y + vec.y; + D_menu_801CEEB0.z = gTexturedLines[index].posAA.z + vec.z; - v.x = D_menu_801CEEB0.x - gTexturedLines[index].unk_04.x; - v.y = D_menu_801CEEB0.y - gTexturedLines[index].unk_04.y; - v.z = D_menu_801CEEB0.z - gTexturedLines[index].unk_04.z; + v.x = D_menu_801CEEB0.x - gTexturedLines[index].posAA.x; + v.y = D_menu_801CEEB0.y - gTexturedLines[index].posAA.y; + v.z = D_menu_801CEEB0.z - gTexturedLines[index].posAA.z; r2 = VEC3F_MAG(&v); if (((r / 9.0f) * 8.0f) < r2) { @@ -6222,9 +6222,9 @@ void Map_801AC530(s32 index) { Matrix_Translate(gGfxMatrix, D_menu_801CEEB0.x, D_menu_801CEEB0.y, D_menu_801CEEB0.z, MTXF_APPLY); - Matrix_RotateY(gGfxMatrix, gTexturedLines[index].unk_20, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, gTexturedLines[index].yRot, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, M_DTOR * -90.0f, MTXF_APPLY); - Matrix_RotateX(gGfxMatrix, gTexturedLines[index].unk_1C, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, gTexturedLines[index].xRot, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 0.8f, 0.8f, 0.8f, MTXF_APPLY); @@ -6346,16 +6346,16 @@ void Map_801AC9A0(s32 index) { gTexturedLines[index].mode = 4; - gTexturedLines[index].unk_04.x = srcPos.x; - gTexturedLines[index].unk_04.y = srcPos.y; - gTexturedLines[index].unk_04.z = srcPos.z; + gTexturedLines[index].posAA.x = srcPos.x; + gTexturedLines[index].posAA.y = srcPos.y; + gTexturedLines[index].posAA.z = srcPos.z; - gTexturedLines[index].unk_10.x = destPos.x; - gTexturedLines[index].unk_10.y = destPos.y; - gTexturedLines[index].unk_10.z = destPos.z; + gTexturedLines[index].posBB.x = destPos.x; + gTexturedLines[index].posBB.y = destPos.y; + gTexturedLines[index].posBB.z = destPos.z; - gTexturedLines[index].unk_20 = Math_Atan2F(x, z); - gTexturedLines[index].unk_1C = -Math_Atan2F(y, sqrtf(SQ(x) + SQ(z))); + gTexturedLines[index].yRot = Math_Atan2F(x, z); + gTexturedLines[index].xRot = -Math_Atan2F(y, sqrtf(SQ(x) + SQ(z))); switch (gPlanetPathStatus[index]) { case 1: @@ -6364,9 +6364,9 @@ void Map_801AC9A0(s32 index) { break; case 11: - Math_SmoothStepToF(&gTexturedLines[index].unk_24, target, 0.1f, 100.0f, 4.0f); - gTexturedLines[index].unk_2F = 255; - if (gTexturedLines[index].unk_24 == target) { + Math_SmoothStepToF(&gTexturedLines[index].zScale, target, 0.1f, 100.0f, 4.0f); + gTexturedLines[index].alpha = 255; + if (gTexturedLines[index].zScale == target) { Audio_KillSfxById(0x1900404D); gPlanetPathStatus[index] = 4; } @@ -6374,9 +6374,9 @@ void Map_801AC9A0(s32 index) { case 5: case 6: - Math_SmoothStepToF(&gTexturedLines[index].unk_24, target, 0.1f, 100.0f, 1.0f); - if (gTexturedLines[index].unk_24 == target) { - gTexturedLines[index].unk_24 = 0.0f; + Math_SmoothStepToF(&gTexturedLines[index].zScale, target, 0.1f, 100.0f, 1.0f); + if (gTexturedLines[index].zScale == target) { + gTexturedLines[index].zScale = 0.0f; gPlanetPathStatus[index] = 6; D_menu_801CEEAC = 255; } @@ -6387,55 +6387,55 @@ void Map_801AC9A0(s32 index) { if (D_menu_801CD944 == 7) { temp = 0.25f; } - Math_SmoothStepToF(&gTexturedLines[index].unk_24, target, temp, 100.0f, 4.0f); - gTexturedLines[index].unk_2F = 255; - if (gTexturedLines[index].unk_24 == target) { + Math_SmoothStepToF(&gTexturedLines[index].zScale, target, temp, 100.0f, 4.0f); + gTexturedLines[index].alpha = 255; + if (gTexturedLines[index].zScale == target) { gPlanetPathStatus[index] = 3; } break; case 3: case 4: - gTexturedLines[index].unk_24 = target; - gTexturedLines[index].unk_2F = sPaths[index].alpha; + gTexturedLines[index].zScale = target; + gTexturedLines[index].alpha = sPaths[index].alpha; break; } if ((gPlanetPathStatus[index] == 1) || (gPlanetPathStatus[index] == 11) || (gPlanetPathStatus[index] == 4)) { - gTexturedLines[index].unk_2C = 32; - gTexturedLines[index].unk_2D = 32; - gTexturedLines[index].unk_2E = 32; - gTexturedLines[index].unk_28 = 4.0f; + gTexturedLines[index].red = 32; + gTexturedLines[index].green = 32; + gTexturedLines[index].blue = 32; + gTexturedLines[index].xyScale = 4.0f; } else { switch (sPaths[index].type) { case PL_PATH_BLU: - gTexturedLines[index].unk_2C = 16; - gTexturedLines[index].unk_2D = 64; - gTexturedLines[index].unk_2E = 255; - gTexturedLines[index].unk_28 = 8.0f; + gTexturedLines[index].red = 16; + gTexturedLines[index].green = 64; + gTexturedLines[index].blue = 255; + gTexturedLines[index].xyScale = 8.0f; break; case PL_PATH_YLW: - gTexturedLines[index].unk_2C = 255; - gTexturedLines[index].unk_2D = 175; - gTexturedLines[index].unk_2E = 0; - gTexturedLines[index].unk_28 = 8.0f; + gTexturedLines[index].red = 255; + gTexturedLines[index].green = 175; + gTexturedLines[index].blue = 0; + gTexturedLines[index].xyScale = 8.0f; break; case PL_PATH_RED: - gTexturedLines[index].unk_2C = 255; - gTexturedLines[index].unk_2D = 0; - gTexturedLines[index].unk_2E = 0; - gTexturedLines[index].unk_28 = 8.0f; + gTexturedLines[index].red = 255; + gTexturedLines[index].green = 0; + gTexturedLines[index].blue = 0; + gTexturedLines[index].xyScale = 8.0f; break; case PL_WARP_YLW: case PL_WARP_RED: - gTexturedLines[index].unk_2C = 0; - gTexturedLines[index].unk_2D = 0; - gTexturedLines[index].unk_2E = 0; - gTexturedLines[index].unk_2F = 0; - gTexturedLines[index].unk_28 = 0.1f; + gTexturedLines[index].red = 0; + gTexturedLines[index].green = 0; + gTexturedLines[index].blue = 0; + gTexturedLines[index].alpha = 0; + gTexturedLines[index].xyScale = 0.1f; break; } } diff --git a/src/overlays/ovl_menu/fox_option.c b/src/overlays/ovl_menu/fox_option.c index 9bbc8ea3..4086b924 100644 --- a/src/overlays/ovl_menu/fox_option.c +++ b/src/overlays/ovl_menu/fox_option.c @@ -804,7 +804,7 @@ void Option_TrainingUpdate(void) { gDrawMode = DRAW_NONE; Play_Setup(); gSavedObjectLoadIndex = 0; - D_ctx_80177CB0 = 0.0f; + gSavedPathProgress = 0.0f; D_ctx_8017782C = 1; gControllerLock = 3; AUDIO_SET_SPEC(SFXCHAN_0, AUDIOSPEC_28);