More docs (#226)

* docs

* more docs

* forgot timers
This commit is contained in:
petrie911 2024-05-02 15:46:51 -05:00 committed by GitHub
parent 926677aa6c
commit c9df6fda72
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
50 changed files with 4628 additions and 4611 deletions

View File

@ -26,9 +26,9 @@ extern s32 gPrevPlanetSavedTeamShields[6];
extern s32 gTeamDamage[6]; extern s32 gTeamDamage[6];
extern u8 gMissionStatus; extern u8 gMissionStatus;
extern f32 gGroundHeight; extern f32 gGroundHeight;
extern f32 D_ctx_80177950; extern f32 D_ctx_80177950; // sign of something to do with camera z rotations
extern f32 D_ctx_80177968; extern f32 gPlayerTurnRate;
extern f32 D_ctx_80177970; extern f32 gPlayerTurnStickMod;
extern f32 gCsCamEyeX; extern f32 gCsCamEyeX;
extern f32 gCsCamEyeY; extern f32 gCsCamEyeY;
extern f32 gCsCamEyeZ; extern f32 gCsCamEyeZ;
@ -61,13 +61,13 @@ extern u16 gBgmSeqId;
extern u8 gLevelType; extern u8 gLevelType;
extern s32 gSavedObjectLoadIndex; extern s32 gSavedObjectLoadIndex;
extern UNK_TYPE F_80177CA8; extern UNK_TYPE F_80177CA8;
extern f32 D_ctx_80177CB0; extern f32 gSavedPathProgress;
extern UNK_TYPE F_80177CB8; extern UNK_TYPE F_80177CB8;
extern f32 gWaterLevel; extern f32 gWaterLevel;
extern f32 D_ctx_80177CC8; extern f32 gPathGroundScroll;
extern f32 D_ctx_80177CE8; extern f32 gPathTexScroll;
extern f32 D_ctx_80177D08; extern f32 gPathVelZ;
extern f32 D_ctx_80177D20; extern f32 gPathProgress;
extern f32 gRadioPortraitScaleY; extern f32 gRadioPortraitScaleY;
extern f32 gRadioTextBoxScaleY; extern f32 gRadioTextBoxScaleY;
extern f32 gRadioMsgRadioId; extern f32 gRadioMsgRadioId;
@ -226,7 +226,7 @@ extern s32 gHitCount;
extern s32 gSavedHitCount; extern s32 gSavedHitCount;
extern s16 gLifeCount[4]; extern s16 gLifeCount[4];
extern LaserStrength gLaserStrength[4]; extern LaserStrength gLaserStrength[4];
extern s32 D_ctx_80161AB8; extern s32 gCullObjects;
extern UNK_TYPE F_80161AC0[16]; extern UNK_TYPE F_80161AC0[16];
extern Scenery gScenery[50]; extern Scenery gScenery[50];
extern Sprite gSprites[40]; extern Sprite gSprites[40];
@ -272,13 +272,13 @@ extern s32 D_ctx_80177990[4];
extern f32 D_ctx_801779A8[4]; extern f32 D_ctx_801779A8[4];
extern u8 gPauseEnabled; extern u8 gPauseEnabled;
extern s32 gChargeTimers[4]; extern s32 gChargeTimers[4];
extern f32 D_ctx_801779E4; extern f32 gPathVelX;
extern f32 D_ctx_801779F4; extern f32 gPathVelY;
extern s32 D_Timer_80177A00[4]; extern s32 gUturnDownTimers[4];
extern s32 D_Timer_80177A38[4]; extern s32 gUturnBrakeTimers[4];
extern s32 D_Timer_80177A70[4]; extern s32 gLoopDownTimers[4];
extern s32 D_Timer_80177A88[4]; extern s32 gLoopBoostTimers[4];
extern f32 D_ctx_80177AA0[4]; extern f32 gMuzzleFlashScale[4];
extern f32 gShieldAlpha[4]; extern f32 gShieldAlpha[4];
extern s32 gHasShield[4]; extern s32 gHasShield[4];
extern s32 gShieldTimer[4]; extern s32 gShieldTimer[4];
@ -289,11 +289,11 @@ extern u8 gCoUturnCount;
extern u8 gGreatFoxIntact; extern u8 gGreatFoxIntact;
extern u8 gTiStartLandmaster; extern u8 gTiStartLandmaster;
extern u16 gControllerRumbleTimers[4]; extern u16 gControllerRumbleTimers[4];
extern u16 D_ctx_80177C30[4]; extern u16 gPlayerScores[4];
extern s32 D_ctx_80177C50; extern s32 D_ctx_80177C50;
extern s32 D_ctx_80177C70; extern s32 D_ctx_80177C70;
extern s32 D_ctx_80177C78; extern s32 gTraining360MsgTimer;
extern s32 D_ctx_80177C8C; extern s32 gTraining360MsgIndex;
extern s32 D_ctx_80177C94; extern s32 D_ctx_80177C94;
extern s32 D_ctx_80177C9C; extern s32 D_ctx_80177C9C;
extern s32 D_ctx_80177CA4; extern s32 D_ctx_80177CA4;

View File

@ -82,8 +82,8 @@ void Cutscene_LevelComplete(Player*);
void Cutscene_UTurn(Player*); void Cutscene_UTurn(Player*);
void Cutscene_KillPlayer(Player* player); void Cutscene_KillPlayer(Player* player);
void Cutscene_PlayerDown(Player*); void Cutscene_PlayerDown(Player*);
void Actor195_Update(Actor*); void ActorCutscene_Update(Actor*);
void Actor195_Draw(Actor*); void ActorCutscene_Draw(Actor*);
void Cutscene_DrawGreatFox(void); void Cutscene_DrawGreatFox(void);
// fox_display // fox_display
@ -95,7 +95,7 @@ void Play_Draw(void);
// fox_edata // fox_edata
void func_edata_800594F0(Scenery*); void func_edata_800594F0(Scenery*);
void func_edata_800595D0(Scenery*); void func_edata_800595D0(Scenery*);
void func_edisplay_800596C0(void); void Object_ApplyWaterDistortion(void);
void func_edata_800596B0(Actor*); void func_edata_800596B0(Actor*);
// fox_edisplay // fox_edisplay
@ -103,9 +103,9 @@ void Graphics_SetScaleMtx(f32);
void Sprite168_Draw(Sprite*); void Sprite168_Draw(Sprite*);
void Actor201_Draw(Actor*); void Actor201_Draw(Actor*);
void Actor202_Draw(Actor*); void Actor202_Draw(Actor*);
void Obj39_Draw(Scenery*); void MeteoTunnel_Draw(Scenery*);
void func_edisplay_80059B20(Scenery*); void Scenery_DrawTitaniaBones(Scenery*);
void Obj42_Draw(Scenery*); void Scenery42_Draw(Scenery*);
void Actor196_Draw(Actor*); void Actor196_Draw(Actor*);
void Sprite167_Draw(Sprite*); void Sprite167_Draw(Sprite*);
void FogShadow_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_CheckSingleHitbox(Vec3f*, f32*, Vec3f*);
bool Object_CheckPolyCollision(Vec3f* , Vec3f* , ObjectId , Object* ); bool Object_CheckPolyCollision(Vec3f* , Vec3f* , ObjectId , Object* );
s32 Object_CheckCollision(s32 , Vec3f* , Vec3f* , s32 ); s32 Object_CheckCollision(s32 , Vec3f* , Vec3f* , s32 );
void func_enmy_800652CC(Scenery*); void Scenery_UpdateTitaniaBones(Scenery*);
void func_enmy_800654E4(Object*); void func_enmy_800654E4(Object*);
void func_enmy_800656D4(Actor*); void func_enmy_800656D4(Actor*);
void func_enmy_800660F0(Actor*); void func_enmy_800660F0(Actor*);
@ -175,8 +175,8 @@ void func_enmy_80066C00(Scenery*);
void func_enmy_80066D5C(Scenery*); void func_enmy_80066D5C(Scenery*);
void Sprite167_Update(Sprite*); void Sprite167_Update(Sprite*);
void func_enmy_80066EA8(Scenery*); void func_enmy_80066EA8(Scenery*);
void func_enmy_80066EF0(Item*); void Item_CheckBounds(Item*);
void func_enmy_800671D0(Item*); void Item_SpinPickup(Item*);
void func_enmy_800674B4(f32, f32, f32, f32, f32, f32, f32, f32); void func_enmy_800674B4(f32, f32, f32, f32, f32, f32, f32, f32);
void ActorSupplies_Update(Actor*); void ActorSupplies_Update(Actor*);
void ActorSupplies_Draw(Actor*); void ActorSupplies_Draw(Actor*);
@ -213,16 +213,16 @@ void Object_Update(void);
//fox_enmy2 //fox_enmy2
void Actor237_Update(Actor*); void Actor237_Update(Actor*);
void Actor237_Draw(Actor*); void Actor237_Draw(Actor*);
void Obj54_Update(Scenery*); void Scenery54_Update(Scenery*);
void Actor201_Update(Actor*); void Actor201_Update(Actor*);
void Actor202_Update(Actor*); void Actor202_Update(Actor*);
void Actor194_Update(Actor*); void Actor194_Update(Actor*);
void Actor194_Init(Actor*); void Actor194_Dying(Actor*);
void Actor194_Draw(Actor*); void Actor194_Draw(Actor*);
void Obj42_Update(Scenery*); void Scenery42_Update(Scenery*);
void Actor196_Update(Actor*); void Actor196_Update(Actor*);
void Actor189_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_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_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, 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_8006F0D8(f32 xPos, f32 yPos, f32 zPos, f32 scale1);
void ActorEvent_8006F254(Actor*); void ActorEvent_8006F254(Actor*);
void ActorEvent_Update(Actor*); void ActorEvent_Update(Actor*);
s32 Obj111_Draw(Scenery*); s32 Scenery111_Draw(Scenery*);
void ActorEvent_Draw(Actor*); void ActorEvent_Draw(Actor*);
void func_enmy2_800763A4(Actor*); void func_enmy2_800763A4(Actor*);
void ActorEvent_Dying(Actor*); void ActorEvent_Dying(Actor*);
@ -483,7 +483,7 @@ void func_play_800AD7F0(Player* player);
void func_play_800ADF58(Player* player); void func_play_800ADF58(Player* player);
void func_play_800B415C(Player* player); void func_play_800B415C(Player* player);
void func_play_800B41E0(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_800A46A0(Player* player);
void func_play_800A86E4(Player* player); void func_play_800A86E4(Player* player);
void func_play_800A887C(Player* player); void func_play_800A887C(Player* player);

View File

@ -42,7 +42,7 @@ typedef struct {
typedef enum { typedef enum {
/* 0 */ COL1_0, // OBJ_ACTOR_180 /* 0 */ COL1_0, // OBJ_ACTOR_180
/* 1 */ COL1_1, // OBJ_SCENERY_39 /* 1 */ COL1_1, // OBJ_SCENERY_ME_TUNNEL
/* 2 */ COL1_2, /* 2 */ COL1_2,
/* 3 */ COL1_3, // ACTOR_EVENT_ID /* 3 */ COL1_3, // ACTOR_EVENT_ID
/* 4 */ COL1_4, // OBJ_BOSS_308 /* 4 */ COL1_4, // OBJ_BOSS_308
@ -88,29 +88,29 @@ typedef struct {
/* 0x00 */ u8 status; /* 0x00 */ u8 status;
/* 0x02 */ u16 type; /* 0x02 */ u16 type;
/* 0x04 */ Vec3f pos; /* 0x04 */ Vec3f pos;
/* 0x10 */ f32 unk_10; /* 0x10 */ f32 yRot;
/* 0x14 */ char pad14[0x14]; /* 0x14 */ char pad14[0x14];
} RadarMark; // size = 0x28 } RadarMark; // size = 0x28
typedef struct { typedef struct {
/* 0x00 */ u8 mode; /* 0x00 */ u8 mode;
/* 0x02 */ u16 timer; /* 0x02 */ u16 timer;
/* 0x04 */ Vec3f unk_04; /* 0x04 */ Vec3f posAA;
/* 0x10 */ Vec3f unk_10; /* 0x10 */ Vec3f posBB;
/* 0x1C */ f32 unk_1C; /* 0x1C */ f32 xRot;
/* 0x20 */ f32 unk_20; /* 0x20 */ f32 yRot;
/* 0x24 */ f32 unk_24; /* 0x24 */ f32 zScale;
/* 0x28 */ f32 unk_28; /* 0x28 */ f32 xyScale;
/* 0x2C */ u8 unk_2C; // possibly a color struct /* 0x2C */ u8 red; // possibly a color struct
/* 0x2D */ u8 unk_2D; /* 0x2D */ u8 green;
/* 0x2E */ u8 unk_2E; /* 0x2E */ u8 blue;
/* 0x2F */ u8 unk_2F; /* 0x2F */ u8 alpha;
} TexturedLine; // size = 0x30 } TexturedLine; // size = 0x30
typedef struct { typedef struct {
/* 0x00 */ u8 hits; /* 0x00 */ u8 hits;
/* 0x04 */ Vec3f pos; /* 0x04 */ Vec3f pos;
/* 0x10 */ f32 unk_10; /* 0x10 */ f32 rise;
/* 0x14 */ char pad14[0x4]; /* 0x14 */ char pad14[0x4];
/* 0x18 */ u16 timer; /* 0x18 */ u16 timer;
} BonusText; // size = 0x1C } BonusText; // size = 0x1C
@ -143,13 +143,13 @@ typedef struct {
/* 0x00 */ u8 drawType; /* 0x00 */ u8 drawType;
/* 0x08 */ ObjectFunc action; // argument must have object type. /* 0x08 */ ObjectFunc action; // argument must have object type.
/* 0x0C */ f32* hitbox; /* 0x0C */ f32* hitbox;
/* 0x10 */ f32 unk_10; // z coordinate of something /* 0x10 */ f32 cullDistance; // z coordinate of something
/* 0x14 */ s16 unk_14; // can be -1, 0, 1 /* 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 /* 0x16 */ s16 unk_16; // can be 0, 1, 2. affects death behavior?
/* 0x18 */ u8 damage; /* 0x18 */ u8 damage;
/* 0x19 */ u8 unk_19; // can be 0, 1, 2 /* 0x19 */ u8 unk_19; // can be 0, 1, 2. Also camera-related?
/* 0x1C */ f32 unk_1C; // target lock y offset. 0.0f can't be targeted /* 0x1C */ f32 targetOffset; // target lock y offset. 0.0f can't be targeted
/* 0x20 */ u8 bonus; // bonus hits when killed. 0 means no /* 0x20 */ u8 bonus; // hits when killed. numbers above 1 indicate the hit+ bonus
} ObjectInfo; // size = 0x24 } ObjectInfo; // size = 0x24
typedef struct { typedef struct {
@ -202,7 +202,7 @@ typedef struct {
/* 0x54 */ f32 unk_54; /* 0x54 */ f32 unk_54;
/* 0x58 */ f32 unk_58; /* 0x58 */ f32 unk_58;
/* 0x5C */ f32 sfxSource[3]; /* 0x5C */ f32 sfxSource[3];
/* 0x68 */ f32 scale; /* 0x68 */ f32 width;
} Item; // size 0x6C } Item; // size 0x6C
typedef struct { typedef struct {
@ -264,7 +264,7 @@ typedef struct {
#define DMG_BEAM 1 #define DMG_BEAM 1
#define DMG_NONE 0 #define DMG_NONE 0
#define DMG_BOMB -1 #define DMG_BOMB -1
#define DMG_UNK_100 100 #define DMG_zRot_0FC 100
typedef struct { typedef struct {
/* 0x000 */ Object obj; /* 0x000 */ Object obj;
@ -291,9 +291,9 @@ typedef struct {
/* 0x0C9 */ u8 unk_0C9; /* 0x0C9 */ u8 unk_0C9;
/* 0x0CA */ u8 lockOnTimers[4]; /* 0x0CA */ u8 lockOnTimers[4];
/* 0x0CE */ s16 health; /* 0x0CE */ s16 health;
/* 0x0D0 */ s8 unk_0D0; /* 0x0D0 */ s8 dmgType;
/* 0x0D2 */ s16 unk_0D2; /* 0x0D2 */ s16 dmgPart;
/* 0x0D4 */ s16 unk_0D4; /* 0x0D4 */ s16 dmgSource;
/* 0x0D6 */ u16 damage; /* 0x0D6 */ u16 damage;
/* 0x0D8 */ Vec3f hitPos; /* 0x0D8 */ Vec3f hitPos;
/* 0x0E4 */ s16 aiType; /* 0x0E4 */ s16 aiType;
@ -338,17 +338,17 @@ typedef enum ObjectId {
/* 26 */ OBJ_SCENERY_26, /* 26 */ OBJ_SCENERY_26,
/* 27 */ OBJ_SCENERY_27, /* 27 */ OBJ_SCENERY_27,
/* 28 */ OBJ_SCENERY_28, /* 28 */ OBJ_SCENERY_28,
/* 29 */ OBJ_SCENERY_29, /* 29 */ OBJ_SCENERY_TI_SKULL,
/* 30 */ OBJ_SCENERY_30, /* 30 */ OBJ_SCENERY_TI_RIB_0,
/* 31 */ OBJ_SCENERY_31, /* 31 */ OBJ_SCENERY_TI_RIB_1,
/* 32 */ OBJ_SCENERY_32, /* 32 */ OBJ_SCENERY_TI_RIB_2,
/* 33 */ OBJ_SCENERY_33, /* 33 */ OBJ_SCENERY_TI_RIB_3,
/* 34 */ OBJ_SCENERY_34, /* 34 */ OBJ_SCENERY_TI_RIB_4,
/* 35 */ OBJ_SCENERY_35, /* 35 */ OBJ_SCENERY_TI_RIB_5,
/* 36 */ OBJ_SCENERY_36, /* 36 */ OBJ_SCENERY_TI_RIB_6,
/* 37 */ OBJ_SCENERY_37, /* 37 */ OBJ_SCENERY_TI_RIB_7,
/* 38 */ OBJ_SCENERY_38, /* 38 */ OBJ_SCENERY_TI_RIB_8,
/* 39 */ OBJ_SCENERY_39, /* 39 */ OBJ_SCENERY_ME_TUNNEL,
/* 40 */ OBJ_SCENERY_40, /* 40 */ OBJ_SCENERY_40,
/* 41 */ OBJ_SCENERY_41, /* 41 */ OBJ_SCENERY_41,
/* 42 */ OBJ_SCENERY_42, /* 42 */ OBJ_SCENERY_42,
@ -504,7 +504,7 @@ typedef enum ObjectId {
/* 192 */ OBJ_ACTOR_192, /* 192 */ OBJ_ACTOR_192,
/* 193 */ OBJ_ACTOR_193, /* 193 */ OBJ_ACTOR_193,
/* 194 */ OBJ_ACTOR_194, /* 194 */ OBJ_ACTOR_194,
/* 195 */ OBJ_ACTOR_195, /* 195 */ OBJ_ACTOR_CUTSCENE,
/* 196 */ OBJ_ACTOR_196, /* 196 */ OBJ_ACTOR_196,
/* 197 */ OBJ_ACTOR_ALLRANGE, /* 197 */ OBJ_ACTOR_ALLRANGE,
/* 198 */ OBJ_ACTOR_TEAM_BOSS, /* 198 */ OBJ_ACTOR_TEAM_BOSS,
@ -1119,7 +1119,7 @@ typedef Actor Actor191;
typedef Actor Actor192; typedef Actor Actor192;
typedef Actor Actor193; typedef Actor Actor193;
typedef Actor Actor194; typedef Actor Actor194;
typedef Actor Actor195; typedef Actor ActorCutscene;
typedef Actor Actor196; typedef Actor Actor196;
typedef Actor ActorAllRange; typedef Actor ActorAllRange;
typedef Actor ActorTeamBoss; typedef Actor ActorTeamBoss;

View File

@ -97,11 +97,9 @@ typedef struct {
/* 0x00 */ Object obj; /* 0x00 */ Object obj;
/* 0x1C */ s32 index; /* 0x1C */ s32 index;
/* 0x20 */ Vec3f vel; /* 0x20 */ Vec3f vel;
/* 0x2C */ f32 unk_2C; /* 0x2C */ Vec3f vec_2C;
/* 0x30 */ f32 unk_30;
/* 0x34 */ f32 unk_34;
/* 0x38 */ f32 sfxSource[3]; /* 0x38 */ f32 sfxSource[3];
/* 0x44 */ f32 unk_44; /* 0x44 */ f32 scale;
/* 0x48 */ f32 unk_48; /* 0x48 */ f32 unk_48;
/* 0x4C */ f32 unk_4C; /* 0x4C */ f32 unk_4C;
/* 0x50 */ f32 unk_50; /* 0x50 */ f32 unk_50;
@ -165,55 +163,49 @@ typedef struct Player {
/* 0x058 */ f32 camYaw; /* 0x058 */ f32 camYaw;
/* 0x05C */ f32 camPitch; /* 0x05C */ f32 camPitch;
/* 0x05C */ f32 unk_060; /* 0x05C */ f32 unk_060;
/* 0x064 */ f32 unk_064; /* 0x064 */ Vec3f groundPos; // position on ground directly below player
/* 0x068 */ f32 unk_068; /* 0x070 */ f32 groundRotY; // y rotation of actor under player when acting as ground
/* 0x06C */ f32 unk_06C; /* 0x074 */ Vec3f pos; // pos.z is position along path. see trueZpos for the actual z position
/* 0x070 */ f32 unk_070; /* 0x080 */ f32 yBob;
/* 0x074 */ Vec3f pos; /* 0x084 */ f32 xShake;
/* 0x080 */ f32 unk_080; /* 0x088 */ f32 bobPhase;
/* 0x084 */ f32 unk_084; /* 0x08C */ f32 camDist;
/* 0x088 */ f32 unk_088; /* 0x090 */ Vec3f basePos; // position at start of update
/* 0x08C */ f32 unk_08C; /* 0x09C */ f32 pathWidth;
/* 0x090 */ Vec3f unk_090; /* 0x0A0 */ f32 pathHeight;
/* 0x09C */ f32 unk_09C; /* 0x0A4 */ f32 pathFloor;
/* 0x0A0 */ f32 unk_0A0; /* 0x0A8 */ f32 unk_0A8; // set to 3000.0f, not used. May have been z-extent of path?
/* 0x0A4 */ f32 unk_0A4; /* 0x0AC */ f32 xPath;
/* 0x0A8 */ f32 unk_0A8; /* 0x0B0 */ f32 yPath;
/* 0x0AC */ f32 unk_0AC; /* 0x0B4 */ f32 pathStep;
/* 0x0B0 */ f32 unk_0B0; /* 0x0B8 */ f32 xPathTarget;
/* 0x0B4 */ f32 unk_0B4; /* 0x0BC */ f32 yPathTarget;
/* 0x0B8 */ f32 unk_0B8;
/* 0x0BC */ f32 unk_0BC;
/* 0x0C0 */ Vec3f vel; /* 0x0C0 */ Vec3f vel;
/* 0x0CC */ f32 unk_0CC; /* 0x0CC */ f32 warpCamSpeed;
/* 0x0D0 */ f32 baseSpeed; /* 0x0D0 */ f32 baseSpeed;
/* 0x0D4 */ f32 unk_0D4; /* 0x0D4 */ f32 gravity;
/* 0x0D8 */ Vec3f unk_0D8; /* 0x0D8 */ Vec3f knockback;
/* 0x0E4 */ f32 unk_0E4; /* 0x0E4 */ Vec3f rot;
/* 0x0E8 */ f32 unk_0E8; /* 0x0F0 */ f32 rockAngle;
/* 0x0EC */ f32 unk_0EC; /* 0x0F4 */ f32 rockPhase;
/* 0x0F0 */ f32 unk_0F0; /* 0x0F8 */ f32 bankAngle;
/* 0x0F4 */ f32 unk_0F4; /* 0x0FC */ f32 xRot_0FC;
/* 0x0F8 */ f32 unk_0F8; /* 0x100 */ f32 zRot_0FC;
/* 0x0FC */ f32 unk_0FC; /* 0x104 */ Vec3f rot_104;
/* 0x100 */ f32 unk_100;
/* 0x104 */ f32 unk_104;
/* 0x108 */ f32 unk_108;
/* 0x10C */ f32 unk_10C;
/* 0x110 */ f32 boostSpeed; /* 0x110 */ f32 boostSpeed;
/* 0x114 */ f32 unk_114; /* 0x114 */ f32 yRot_114;
/* 0x118 */ f32 unk_118; /* 0x118 */ f32 yRot_118;
/* 0x11C */ f32 unk_11C; /* 0x11C */ f32 yRotVel_11C;
/* 0x120 */ f32 unk_120; /* 0x120 */ f32 xRot_120;
/* 0x124 */ f32 unk_124; /* 0x124 */ f32 xRot_124;
/* 0x128 */ char pad128[4]; /* 0x128 */ char pad128[4];
/* 0x12C */ f32 unk_12C; /* 0x12C */ f32 zRotBank;
/* 0x130 */ f32 unk_130; /* 0x130 */ f32 zRotBarrelRoll;
/* 0x134 */ f32 unk_134; /* 0x134 */ f32 damageShake;
/* 0x138 */ f32 unk_138; /* 0x138 */ f32 trueZpos; // the actual position of the arwing. pos.z is its z position along the path
/* 0x13C */ char pad13C[4]; /* 0x13C */ char pad13C[4];
/* 0x140 */ f32 unk_140; /* 0x140 */ f32 zPathVel;
/* 0x144 */ f32 unk_144; /* 0x144 */ f32 zPath;
/* 0x148 */ f32 unk_148; /* 0x148 */ f32 unk_148;
/* 0x14C */ f32 unk_14C; /* 0x14C */ f32 unk_14C;
/* 0x150 */ f32 unk_150; /* 0x150 */ f32 unk_150;
@ -247,18 +239,18 @@ typedef struct Player {
/* 0x1C4 */ s32 num; /* 0x1C4 */ s32 num;
/* 0x1C8 */ PlayerState1C8 state_1C8; /* 0x1C8 */ PlayerState1C8 state_1C8;
/* 0x1CC */ PlayerForm form; /* 0x1CC */ PlayerForm form;
/* 0x1D0 */ s32 unk_1D0; /* 0x1D0 */ s32 csState;
/* 0x1D4 */ s32 unk_1D4; /* 0x1D4 */ bool grounded;
/* 0x1D8 */ s32 unk_1D8; /* 0x1D8 */ s32 meTargetIndex;
/* 0x1DC */ s32 unk_1DC; /* 0x1DC */ s32 barrelRoll;
/* 0x1E0 */ s32 timer_1E0; /* 0x1E0 */ s32 barrelInputTimerL;
/* 0x1E4 */ s32 timer_1E4; /* 0x1E4 */ s32 barrelInputTimerR;
/* 0x1E8 */ s32 timer_1E8; /* 0x1E8 */ s32 timer_1E8;
/* 0x1EC */ s32 unk_1EC; /* 0x1EC */ s32 rollRate;
/* 0x1F0 */ s32 unk_1F0; /* 0x1F0 */ s32 baseRollRate;
/* 0x1F4 */ s32 unk_1F4; /* 0x1F4 */ s32 hitTimer;
/* 0x1F8 */ s32 timer_1F8; /* 0x1F8 */ s32 csTimer;
/* 0x1FC */ s32 timer_1FC; /* 0x1FC */ s32 csEventTimer;
/* 0x200 */ s32 unk_200; /* 0x200 */ s32 unk_200;
/* 0x204 */ s32 unk_204; /* 0x204 */ s32 unk_204;
/* 0x208 */ s32 unk_208; /* 0x208 */ s32 unk_208;
@ -267,7 +259,7 @@ typedef struct Player {
/* 0x214 */ s32 timer_214; /* 0x214 */ s32 timer_214;
/* 0x218 */ s32 timer_218; /* 0x218 */ s32 timer_218;
/* 0x21C */ s32 unk_21C; /* 0x21C */ s32 unk_21C;
/* 0x220 */ s32 timer_220; /* 0x220 */ s32 radioDamageTimer;
/* 0x224 */ s32 timer_224; /* 0x224 */ s32 timer_224;
/* 0x228 */ s32 flags_228; /* 0x228 */ s32 flags_228;
/* 0x22C */ s32 whooshTimer; /* 0x22C */ s32 whooshTimer;
@ -279,27 +271,27 @@ typedef struct Player {
/* 0x244 */ s32 timer_244; /* 0x244 */ s32 timer_244;
/* 0x248 */ f32 unk_248; /* 0x248 */ f32 unk_248;
/* 0x24C */ f32 unk_24C; /* 0x24C */ f32 unk_24C;
/* 0x250 */ f32 unk_250; /* 0x250 */ f32 unk_250; // checked for by event actors, but unused?
/* 0x250 */ char pad254[4]; /* 0x250 */ char pad254[4];
/* 0x258 */ f32 unk_258; /* 0x258 */ f32 meteoWarpSpinSpeed;
/* 0x25C */ f32 unk_25C; /* 0x25C */ f32 contrailScale;
/* 0x260 */ char pad260[4]; /* 0x260 */ char pad260[4];
/* 0x264 */ s32 shields; /* 0x264 */ s32 shields;
/* 0x268 */ s32 damage; /* 0x268 */ s32 damage;
/* 0x26C */ s32 heal; /* 0x26C */ s32 heal;
/* 0x270 */ s32 unk_270; /* 0x270 */ s32 unk_270; // checked for by event actors, but unused?
/* 0x274 */ char pad274[4]; /* 0x274 */ char pad274[4];
/* 0x278 */ s32 timer_278; /* 0x278 */ s32 timer_278;
/* 0x27C */ s32 timer_27C; /* 0x27C */ s32 meteoWarpTimer;
/* 0x280 */ s32 unk_280; /* 0x280 */ s32 barrelRollAlpha;
/* 0x284 */ s32 unk_284; /* 0x284 */ s32 unk_284;
/* 0x288 */ s32 unk_288; /* 0x288 */ s32 unk_288;
/* 0x28C */ char pad28C[0x28]; /* 0x28C */ char pad28C[0x28];
/* 0x2B4 */ bool boostCooldown; /* 0x2B4 */ bool boostCooldown;
/* 0x2B8 */ bool boostActive; /* 0x2B8 */ bool boostActive;
/* 0x2BC */ f32 boostMeter; /* 0x2BC */ f32 boostMeter;
/* 0x2C0 */ f32 unk_2C0; /* 0x2C0 */ f32 unk_2C0; // has to do with starting right tank jet
/* 0x2C4 */ s32 unk_2C4; /* 0x2C4 */ s32 unk_2C4; // counts up during some effects. never used
/* 0x2C8 */ Vec3f hit2; /* 0x2C8 */ Vec3f hit2;
/* 0x2D4 */ Vec3f hit1; /* 0x2D4 */ Vec3f hit1;
/* 0x2E0 */ Vec3f hit3; /* 0x2E0 */ Vec3f hit3;
@ -310,7 +302,7 @@ typedef struct Player {
/* 0x478 */ PlayerSfx sfx; /* 0x478 */ PlayerSfx sfx;
/* 0x498 */ s32 timer_498; /* 0x498 */ s32 timer_498;
/* 0x49C */ WingInfo wings; /* 0x49C */ WingInfo wings;
/* 0x4D8 */ f32 unk_4D8; /* 0x4D8 */ f32 aerobaticPitch;
/* 0x4DC */ s32 somersault; /* 0x4DC */ s32 somersault;
} Player; // size = 0x4E0 } Player; // size = 0x4E0

View File

@ -136,7 +136,7 @@ extern s16 gReflectY;
extern Matrix D_display_80161418[]; // static, here for reordering extern Matrix D_display_80161418[]; // static, here for reordering
extern Vec3f D_display_80161518[]; // 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_80161548[]; // static, here for reordering
extern Vec3f D_display_80161578[]; extern Vec3f gLockOnTargetViewPos[];
extern f32 D_display_801615A8[]; extern f32 D_display_801615A8[];
extern f32 D_display_801615B8[]; extern f32 D_display_801615B8[];

View File

@ -59,10 +59,10 @@ D_800C90F0 = 0x800C90F0;
D_800C45E0 = 0x800C45E0; D_800C45E0 = 0x800C45E0;
D_edisplay_801615D0 = 0x801615D0;//size:0xC D_edisplay_801615D0 = 0x801615D0;//size:0xC
D_edisplay_801615E0 = 0x801615E0;//size:0xC sViewPos = 0x801615E0;//size:0xC
gTeamEventActorIndex = 0x800CFF80;//size:0x10 gTeamEventActorIndex = 0x800CFF80;//size:0x10
D_display_80161578 = 0x80161578;//size:0x30 gLockOnTargetViewPos = 0x80161578;//size:0x30
D_display_800CA23C = 0x800CA23C;//size:0x18 D_display_800CA23C = 0x800CA23C;//size:0x18
D_display_800CA26C = 0x800CA26C;//size:0x20 D_display_800CA26C = 0x800CA26C;//size:0x20
D_800CA260 = 0x800CA260;//size:0xC D_800CA260 = 0x800CA260;//size:0xC

View File

@ -165,18 +165,18 @@ gDefaultSave = 0x800D4D10;
gSaveFile = 0x80178870; //size:0x200 gSaveFile = 0x80178870; //size:0x200
// fox_edisplay // fox_edisplay
func_edisplay_800596C0 = 0x800596C0; Object_ApplyWaterDistortion = 0x800596C0;
func_edisplay_800597C0 = 0x800597C0; Object_SetCullDirection = 0x800597C0;
Graphics_SetScaleMtx = 0x8005980C; Graphics_SetScaleMtx = 0x8005980C;
Sprite168_Draw = 0x80059850; Sprite168_Draw = 0x80059850;
func_edisplay_800598DC = 0x800598DC; Object_dummy_800598DC = 0x800598DC;
Actor201_Draw = 0x800598E8; Actor201_Draw = 0x800598E8;
func_edisplay_800599A4 = 0x800599A4; Actor202_PostLimbDraw = 0x800599A4;
Actor202_Draw = 0x80059A24; Actor202_Draw = 0x80059A24;
Obj39_Draw = 0x80059AEC; MeteoTunnel_Draw = 0x80059AEC;
func_edisplay_80059B20 = 0x80059B20; Scenery_DrawTitaniaBones = 0x80059B20;
func_edisplay_80059BB0 = 0x80059BB0; func_edisplay_80059BB0 = 0x80059BB0;
Obj42_Draw = 0x80059BBC; Scenery42_Draw = 0x80059BBC;
Actor196_Draw = 0x80059BF0; Actor196_Draw = 0x80059BF0;
func_edisplay_80059C28 = 0x80059C28; func_edisplay_80059C28 = 0x80059C28;
Sprite167_Draw = 0x80059C34; Sprite167_Draw = 0x80059C34;
@ -291,7 +291,7 @@ func_enmy_80063F4C = 0x80063F4C;
func_enmy_80063F58 = 0x80063F58; func_enmy_80063F58 = 0x80063F58;
func_enmy_80063F74 = 0x80063F74; func_enmy_80063F74 = 0x80063F74;
Object_Init = 0x80063F90; Object_Init = 0x80063F90;
func_enmy_800652CC = 0x800652CC; Scenery_UpdateTitaniaBones = 0x800652CC;
func_enmy_80065380 = 0x80065380; func_enmy_80065380 = 0x80065380;
func_enmy_8006546C = 0x8006546C; func_enmy_8006546C = 0x8006546C;
func_enmy_800654E4 = 0x800654E4; func_enmy_800654E4 = 0x800654E4;
@ -311,8 +311,8 @@ func_enmy_80066E80 = 0x80066E80;
Sprite167_Update = 0x80066E8C; Sprite167_Update = 0x80066E8C;
func_enmy_80066EA8 = 0x80066EA8; func_enmy_80066EA8 = 0x80066EA8;
func_enmy_80066EE4 = 0x80066EE4; func_enmy_80066EE4 = 0x80066EE4;
func_enmy_80066EF0 = 0x80066EF0; Item_CheckBounds = 0x80066EF0;
func_enmy_800671D0 = 0x800671D0; Item_SpinPickup = 0x800671D0;
func_enmy_80067348 = 0x80067348; func_enmy_80067348 = 0x80067348;
func_enmy_800674B4 = 0x800674B4; func_enmy_800674B4 = 0x800674B4;
ActorSupplies_Update = 0x8006753C; ActorSupplies_Update = 0x8006753C;
@ -420,7 +420,7 @@ gHitCount = 0x80161A98;
gSavedHitCount = 0x80161A9C; gSavedHitCount = 0x80161A9C;
gLifeCount = 0x80161AA0; gLifeCount = 0x80161AA0;
gLaserStrength = 0x80161AA8;//size:0x10 gLaserStrength = 0x80161AA8;//size:0x10
D_ctx_80161AB8 = 0x80161AB8; gCullObjects = 0x80161AB8;
gScenery = 0x80161B00; //size:0x1900 gScenery = 0x80161B00; //size:0x1900
gSprites = 0x80163400; //size:0xBE0 gSprites = 0x80163400; //size:0xBE0
gActors = 0x80163FE0; //size:0xB130 gActors = 0x80163FE0; //size:0xB130
@ -492,15 +492,15 @@ gChargeTimers = 0x801779C8;
gPlayerCamEye = 0x801779D8; gPlayerCamEye = 0x801779D8;
gPlayerCamAt = 0x801779E8; gPlayerCamAt = 0x801779E8;
gExpertMode = 0x801779F8; gExpertMode = 0x801779F8;
D_Timer_80177A00 = 0x80177A00; gUturnDownTimers = 0x80177A00;
D_ctx_80177A10 = 0x80177A10;//size:0x28 D_ctx_80177A10 = 0x80177A10;//size:0x28
D_Timer_80177A38 = 0x80177A38; gUturnBrakeTimers = 0x80177A38;
D_ctx_80177A48 = 0x80177A48;//size:0x28 D_ctx_80177A48 = 0x80177A48;//size:0x28
D_Timer_80177A70 = 0x80177A70;//size:0x10 gLoopDownTimers = 0x80177A70;//size:0x10
gCsFrameCount = 0x80177A80; gCsFrameCount = 0x80177A80;
D_Timer_80177A88 = 0x80177A88;//size:0x10 gLoopBoostTimers = 0x80177A88;//size:0x10
D_ctx_80177A98 = 0x80177A98; D_ctx_80177A98 = 0x80177A98;
D_ctx_80177AA0 = 0x80177AA0; gMuzzleFlashScale = 0x80177AA0;
D_ctx_80177AB0 = 0x80177AB0; D_ctx_80177AB0 = 0x80177AB0;
gShieldAlpha = 0x80177AB8; gShieldAlpha = 0x80177AB8;
gAqDrawMode = 0x80177AC8; gAqDrawMode = 0x80177AC8;
@ -518,7 +518,7 @@ gMissionPlanet = 0x80177B90;
gMissionMedal = 0x80177BB0; gMissionMedal = 0x80177BB0;
gControllerRumbleTimers = 0x80177BD0; gControllerRumbleTimers = 0x80177BD0;
gPlanetPathStatus = 0x80177BD8; gPlanetPathStatus = 0x80177BD8;
D_ctx_80177C30 = 0x80177C30; gPlayerScores = 0x80177C30;
D_ctx_80177C50 = 0x80177C50; D_ctx_80177C50 = 0x80177C50;
D_ctx_80177C58 = 0x80177C58; D_ctx_80177C58 = 0x80177C58;
gOptionSoundMode = 0x80177C74; gOptionSoundMode = 0x80177C74;
@ -530,15 +530,15 @@ D_ctx_80177C9C = 0x80177C9C;
gSavedObjectLoadIndex = 0x80177CA0; gSavedObjectLoadIndex = 0x80177CA0;
D_ctx_80177CA4 = 0x80177CA4; D_ctx_80177CA4 = 0x80177CA4;
D_ctx_80177CAC = 0x80177CAC; D_ctx_80177CAC = 0x80177CAC;
D_ctx_80177CB0 = 0x80177CB0; gSavedPathProgress = 0x80177CB0;
D_ctx_80177CB4 = 0x80177CB4; D_ctx_80177CB4 = 0x80177CB4;
D_ctx_80177CBC = 0x80177CBC; D_ctx_80177CBC = 0x80177CBC;
D_ctx_80177CC4 = 0x80177CC4; D_ctx_80177CC4 = 0x80177CC4;
D_ctx_80177CC8 = 0x80177CC8; gPathGroundScroll = 0x80177CC8;
gStarWolfTeamAlive = 0x80177CD0; // size:0x18 gStarWolfTeamAlive = 0x80177CD0; // size:0x18
D_ctx_80177D08 = 0x80177D08; gPathVelZ = 0x80177D08;
gRightWingHealth = 0x80177D10; gRightWingHealth = 0x80177D10;
D_ctx_80177D20 = 0x80177D20; gPathProgress = 0x80177D20;
gLeftWingHealth = 0x80177D28; gLeftWingHealth = 0x80177D28;
gRadioPortraitScaleY = 0x80177D38; gRadioPortraitScaleY = 0x80177D38;
gRightWingFlashTimer = 0x80177D40; gRightWingFlashTimer = 0x80177D40;
@ -746,7 +746,7 @@ func_play_800B39E0 = 0x800B39E0;
Player_UpdateShields = 0x800B40AC; Player_UpdateShields = 0x800B40AC;
func_play_800B415C = 0x800B415C; func_play_800B415C = 0x800B415C;
func_play_800B41E0 = 0x800B41E0; func_play_800B41E0 = 0x800B41E0;
func_play_800B41EC = 0x800B41EC; Player_Down = 0x800B41EC;
func_play_800B42B0 = 0x800B42B0; func_play_800B42B0 = 0x800B42B0;
func_play_800B44C4 = 0x800B44C4; func_play_800B44C4 = 0x800B44C4;
func_play_800B46F8 = 0x800B46F8; func_play_800B46F8 = 0x800B46F8;

View File

@ -168,12 +168,12 @@ void AllRange_GreatFoxRepair(Player* player) {
Vec3f sp60; Vec3f sp60;
gCsFrameCount++; gCsFrameCount++;
switch (player->unk_1D0) { switch (player->csState) {
case 0: 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->boostCooldown = player->somersault = gCsFrameCount = 0;
player->unk_130 = player->camRoll = player->boostSpeed = player->unk_08C = player->unk_0D8.x = player->zRotBarrelRoll = player->camRoll = player->boostSpeed = player->camDist = player->knockback.x =
player->unk_0D8.y = player->unk_0D8.z = player->unk_134 = player->unk_4D8 = 0.0f; player->knockback.y = player->knockback.z = player->damageShake = player->aerobaticPitch = 0.0f;
gCsCamEyeX = 1673.0f; gCsCamEyeX = 1673.0f;
gCsCamEyeY = 337.0f; gCsCamEyeY = 337.0f;
if (player->pos.z < 0.0f) { if (player->pos.z < 0.0f) {
@ -181,11 +181,11 @@ void AllRange_GreatFoxRepair(Player* player) {
} else { } else {
gCsCamEyeZ = 480.0f; gCsCamEyeZ = 480.0f;
} }
player->unk_0E8 = 0.0f; player->rot.y = 0.0f;
player->pos.x = 2100.0f; player->pos.x = 2100.0f;
player->baseSpeed = 30.0f; player->baseSpeed = 30.0f;
player->unk_0E4 = -8.0f; player->rot.x = -8.0f;
player->unk_114 = 90.0f; player->yRot_114 = 90.0f;
gCsCamAtX = 2100.0f; gCsCamAtX = 2100.0f;
player->pos.y = 450.0f; player->pos.y = 450.0f;
gCsCamAtY = 450.0f; gCsCamAtY = 450.0f;
@ -193,7 +193,7 @@ void AllRange_GreatFoxRepair(Player* player) {
gCsCamAtZ = 0.0f; gCsCamAtZ = 0.0f;
D_ctx_80177A48[0] = 1.0f; D_ctx_80177A48[0] = 1.0f;
player->wings.modelId = 1; player->wings.modelId = 1;
player->unk_1D0++; player->csState++;
break; break;
case 1: case 1:
if (gCsFrameCount >= 47) { if (gCsFrameCount >= 47) {
@ -202,7 +202,7 @@ void AllRange_GreatFoxRepair(Player* player) {
gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0; gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0;
} }
if (gCsFrameCount >= 64) { if (gCsFrameCount >= 64) {
player->unk_1D0++; player->csState++;
player->baseSpeed = 0.0f; player->baseSpeed = 0.0f;
} }
break; break;
@ -212,7 +212,7 @@ void AllRange_GreatFoxRepair(Player* player) {
player->pos.x = 400.0f; player->pos.x = 400.0f;
player->pos.y = -420.0f; player->pos.y = -420.0f;
player->pos.z = 0.0f; player->pos.z = 0.0f;
player->unk_0EC = 0.0f; player->rot.z = 0.0f;
gCsCamEyeX = -683.0f; gCsCamEyeX = -683.0f;
gCsCamEyeY = -346.0f; gCsCamEyeY = -346.0f;
gCsCamEyeZ = 305.0f; gCsCamEyeZ = 305.0f;
@ -225,7 +225,7 @@ void AllRange_GreatFoxRepair(Player* player) {
gRightWingHealth[0] = gLeftWingHealth[0] = 60; gRightWingHealth[0] = gLeftWingHealth[0] = 60;
} }
AUDIO_PLAY_SFX(0x4900200E, gDefaultSfxSource, 4); AUDIO_PLAY_SFX(0x4900200E, gDefaultSfxSource, 4);
player->unk_1D0++; player->csState++;
} }
break; break;
case 3: case 3:
@ -233,9 +233,9 @@ void AllRange_GreatFoxRepair(Player* player) {
gCsCamEyeZ -= 1.0f; gCsCamEyeZ -= 1.0f;
if (gFillScreenAlpha == 0) { if (gFillScreenAlpha == 0) {
player->unk_190 = player->unk_194 = 5.0f; player->unk_190 = player->unk_194 = 5.0f;
player->unk_114 = 90.0f; player->yRot_114 = 90.0f;
player->baseSpeed = gArwingSpeed; player->baseSpeed = gArwingSpeed;
player->unk_1D0++; player->csState++;
AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0); AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0);
} }
@ -243,7 +243,7 @@ void AllRange_GreatFoxRepair(Player* player) {
case 4: case 4:
gCsCamEyeZ -= 1.0f; gCsCamEyeZ -= 1.0f;
gCsCamEyeX -= 1.0f; gCsCamEyeX -= 1.0f;
player->unk_0E4 += 0.4f; player->rot.x += 0.4f;
if (gCsFrameCount >= 130) { if (gCsFrameCount >= 130) {
player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->state_1C8 = PLAYERSTATE_1C8_ACTIVE;
player->wings.modelId = 0; player->wings.modelId = 0;
@ -257,10 +257,10 @@ void AllRange_GreatFoxRepair(Player* player) {
gCsCamAtX = player->pos.x; gCsCamAtX = player->pos.x;
gCsCamAtY = player->pos.y; gCsCamAtY = player->pos.y;
gCsCamAtZ = player->pos.z; gCsCamAtZ = player->pos.z;
Math_SmoothStepToF(&player->unk_0EC, 0.0f, 0.1f, 2.0f, 0); Math_SmoothStepToF(&player->rot.z, 0.0f, 0.1f, 2.0f, 0);
Math_SmoothStepToF(&player->unk_12C, 0.0f, 0.1f, 3.0f, 0); Math_SmoothStepToF(&player->zRotBank, 0.0f, 0.1f, 3.0f, 0);
Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114 + 180.0f) * M_DTOR, MTXF_NEW); Matrix_RotateY(gCalcMatrix, (player->rot.y + player->yRot_114 + 180.0f) * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); Matrix_RotateX(gCalcMatrix, -(player->rot.x * M_DTOR), MTXF_APPLY);
sp6C.x = 0.0f; sp6C.x = 0.0f;
sp6C.y = 0.0f; sp6C.y = 0.0f;
sp6C.z = player->baseSpeed; sp6C.z = player->baseSpeed;
@ -271,8 +271,8 @@ void AllRange_GreatFoxRepair(Player* player) {
player->pos.x += player->vel.x; player->pos.x += player->vel.x;
player->pos.y += player->vel.y; player->pos.y += player->vel.y;
player->pos.z += player->vel.z; 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); 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.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->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) { void AllRange_FortunaIntro(Player* player) {
Vec3f sp24; 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.x = sp24.x;
player->vel.z = sp24.z; player->vel.z = sp24.z;
player->vel.y = sp24.y; player->vel.y = sp24.y;
player->pos.x += player->vel.x; player->pos.x += player->vel.x;
player->pos.y += player->vel.y; player->pos.y += player->vel.y;
player->pos.z += player->vel.z; 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.x = -200.0f;
player->cam.eye.y = 500.0f; player->cam.eye.y = 500.0f;
player->cam.eye.z = 7000.0f; player->cam.eye.z = 7000.0f;
@ -415,7 +415,7 @@ void ActorAllRange_SpawnTeam(void) {
if (actor->aiType <= AI360_PEPPY) { if (actor->aiType <= AI360_PEPPY) {
AUDIO_PLAY_SFX(0x3100000C, actor->sfxSource, 4); AUDIO_PLAY_SFX(0x3100000C, actor->sfxSource, 4);
actor->info.hitbox = SEGMENTED_TO_VIRTUAL(gTeamHitbox); actor->info.hitbox = SEGMENTED_TO_VIRTUAL(gTeamHitbox);
actor->info.unk_1C = 0.0f; actor->info.targetOffset = 0.0f;
actor->info.bonus = 0; actor->info.bonus = 0;
} else { } else {
AUDIO_PLAY_SFX(0x31000011, actor->sfxSource, 4); 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.y = 2500.0f;
gPlayer[0].cam.eye.z = 5000.0f; gPlayer[0].cam.eye.z = 5000.0f;
gPlayer[0].cam.at.x = gActors[4].obj.pos.x; gPlayer[0].cam.at.x = gActors[AI360_WOLF].obj.pos.x;
gPlayer[0].cam.at.y = gActors[4].obj.pos.y; gPlayer[0].cam.at.y = gActors[AI360_WOLF].obj.pos.y;
gPlayer[0].cam.at.z = gActors[4].obj.pos.z; gPlayer[0].cam.at.z = gActors[AI360_WOLF].obj.pos.z;
} }
if ((gAllRangeEventTimer > D_360_800C9B4C) && (gStarWolfMsgTimer == 0)) { if ((gAllRangeEventTimer > D_360_800C9B4C) && (gStarWolfMsgTimer == 0)) {
gAllRangeFrameCount++; 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) && 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)) { if ((gActors[actor->aiIndex].state == STATE360_3) && (gActors[actor->aiIndex].aiType <= AI360_ANDREW)) {
gActors[actor->aiIndex].iwork[2] = AI360_FOX; gActors[actor->aiIndex].iwork[2] = AI360_FOX;
gActors[actor->aiIndex].state = STATE360_2; gActors[actor->aiIndex].state = STATE360_2;
@ -603,7 +603,7 @@ void func_360_8002FC00(Actor* this) {
} }
if (gTeamShields[actor->aiIndex] > 0) { if (gTeamShields[actor->aiIndex] > 0) {
func_360_8002FB4C(&gActors[actor->aiIndex]); 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]) { if (gTeamHelpActor == &gActors[actor->aiIndex]) {
gTeamHelpActor = NULL; gTeamHelpActor = NULL;
gTeamHelpTimer = 0; gTeamHelpTimer = 0;
@ -814,40 +814,40 @@ void ActorAllRange_ApplyDamage(Actor* this) {
Vec3f sp48; Vec3f sp48;
Vec3f sp3C; Vec3f sp3C;
if (this->unk_0D0 != 0) { if (this->dmgType != 0) {
if (this->aiType == AI360_GREAT_FOX) { 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->damage = 10;
this->timer_0C2 = 10; this->timer_0C2 = 10;
} }
if (((this->aiType <= AI360_PEPPY) || (this->aiType == AI360_BILL) || (this->aiType == AI360_KATT)) && if (((this->aiType <= AI360_PEPPY) || (this->aiType == AI360_BILL) || (this->aiType == AI360_KATT)) &&
(this->unk_0D0 == 2)) { (this->dmgType == 2)) {
this->unk_0D0 = 0; this->dmgType = 0;
} }
if ((this->unk_0D0 == 2) && (this->fwork[22] > 0.0f)) { if ((this->dmgType == 2) && (this->fwork[22] > 0.0f)) {
this->unk_0D0 = 0; this->dmgType = 0;
} }
if (this->fwork[23] > 1.0f) { 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; var_a1 = false;
if ((this->unk_0B6 == 3) || if ((this->unk_0B6 == 3) ||
((gCurrentLevel == LEVEL_BOLSE) && (gBosses[1].obj.status != OBJ_FREE) && ((gCurrentLevel == LEVEL_BOLSE) && (gBosses[1].obj.status != OBJ_FREE) &&
(this->aiType >= AI360_WOLF)) || (this->aiType >= AI360_WOLF)) ||
((gCurrentLevel == LEVEL_VENOM_2) && (this->aiType >= AI360_WOLF) && (this->aiType < AI360_10) && ((gCurrentLevel == LEVEL_VENOM_2) && (this->aiType >= AI360_WOLF) && (this->aiType < AI360_10) &&
(this->unk_0D0 == 2))) { (this->dmgType == 2))) {
this->damage = 0; this->damage = 0;
var_a1 = true; var_a1 = true;
if (gCurrentLevel == LEVEL_BOLSE) { if (gCurrentLevel == LEVEL_BOLSE) {
this->unk_0D4 = 0; this->dmgSource = 0;
} }
} }
if (this->aiType >= AI360_WOLF) { if (this->aiType >= AI360_WOLF) {
if (((this->unk_0D0 != 3) || (this->aiType != AI360_WOLF)) && if (!((this->dmgType == 3) && (this->aiType == AI360_WOLF)) &&
((this->aiType != AI360_MISSILE) || (this->unk_0D0 != 2))) { !((this->aiType == AI360_MISSILE) && (this->dmgType == 2))) {
this->health -= this->damage; this->health -= this->damage;
} }
} else if ((this->aiType <= AI360_PEPPY) && (this->state != STATE360_6)) { } else if ((this->aiType <= AI360_PEPPY) && (this->state != STATE360_6)) {
@ -861,7 +861,7 @@ void ActorAllRange_ApplyDamage(Actor* this) {
this->health = 0; this->health = 0;
if (this->aiType == AI360_MISSILE) { if (this->aiType == AI360_MISSILE) {
SectorZ_80199900(this, 1); SectorZ_80199900(this, 1);
if (this->unk_0D4 == 1) { if (this->dmgSource == 1) {
if (gActors[8].obj.status == OBJ_ACTIVE) { if (gActors[8].obj.status == OBJ_ACTIVE) {
Radio_PlayMessage(gMsg_ID_16140, RCID_KATT); Radio_PlayMessage(gMsg_ID_16140, RCID_KATT);
} }
@ -869,7 +869,7 @@ void ActorAllRange_ApplyDamage(Actor* this) {
gHitCount += 11; gHitCount += 11;
D_ctx_80177850 = 15; D_ctx_80177850 = 15;
} else { } else {
switch (this->unk_0D4) { switch (this->dmgSource) {
case 102: case 102:
Radio_PlayMessage(gMsg_ID_16170, RCID_FALCO); Radio_PlayMessage(gMsg_ID_16170, RCID_FALCO);
break; break;
@ -919,13 +919,13 @@ void ActorAllRange_ApplyDamage(Actor* this) {
this->timer_0BC = RAND_INT(50.0f); 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; this->timer_0BC = RAND_INT(40.0f) + 60.0f;
} }
if (this->damage >= 20) { if (this->damage >= 20) {
this->timer_0BC = 0; 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) { if (gKaAllyKillCount < 2) {
ActorAllRange_PlayMessage(gMsg_ID_18018, RCID_BILL); 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)) { if ((this->aiType >= AI360_WOLF) && (this->aiType <= AI360_ANDREW)) {
sStarWolfKillTimer = 150; sStarWolfKillTimer = 150;
} }
switch (this->unk_0D4) { switch (this->dmgSource) {
case 1: case 1:
if (this->aiType >= AI360_10) { if (this->aiType >= AI360_10) {
switch (this->iwork[2]) { switch (this->iwork[2]) {
@ -987,10 +987,10 @@ void ActorAllRange_ApplyDamage(Actor* this) {
case 102: case 102:
case 103: case 103:
case 104: 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] + if ((gStarWolfTeamAlive[0] + gStarWolfTeamAlive[1] + gStarWolfTeamAlive[2] +
gStarWolfTeamAlive[3]) == 0) { gStarWolfTeamAlive[3]) == 0) {
switch (this->unk_0D4) { switch (this->dmgSource) {
case 102: case 102:
Radio_PlayMessage(gMsg_ID_9438, RCID_FALCO); Radio_PlayMessage(gMsg_ID_9438, RCID_FALCO);
break; break;
@ -1002,10 +1002,10 @@ void ActorAllRange_ApplyDamage(Actor* this) {
break; break;
} }
} else { } else {
gActors[this->unk_0D4 - 101].iwork[1] = 80; gActors[this->dmgSource - 101].iwork[1] = 80;
} }
} else { } else {
gActors[this->unk_0D4 - 101].iwork[1] = 80; gActors[this->dmgSource - 101].iwork[1] = 80;
} }
break; break;
} }
@ -1054,7 +1054,7 @@ void ActorAllRange_ApplyDamage(Actor* this) {
this->fwork[12] = sp3C.z; this->fwork[12] = sp3C.z;
} }
if ((gRadioState == 0) && (gActors[0].obj.status == OBJ_ACTIVE)) { if ((gRadioState == 0) && (gActors[0].obj.status == OBJ_ACTIVE)) {
if (this->unk_0D0 == 3) { if (this->dmgType == 3) {
switch (this->aiType) { switch (this->aiType) {
case AI360_FALCO: case AI360_FALCO:
ActorAllRange_PlayMessage(gMsg_ID_20210, RCID_FALCO); ActorAllRange_PlayMessage(gMsg_ID_20210, RCID_FALCO);
@ -1069,11 +1069,11 @@ void ActorAllRange_ApplyDamage(Actor* this) {
ActorAllRange_PlayMessage(gMsg_ID_20084, RCID_KATT); ActorAllRange_PlayMessage(gMsg_ID_20084, RCID_KATT);
break; break;
} }
} else if (this->unk_0D4 < 105) { } else if (this->dmgSource <= AI360_PEPPY + 101) {
if (this->aiType >= AI360_WOLF) { if (this->aiType >= AI360_WOLF) {
if (this->unk_0D4 == 1) { if (this->dmgSource == 1) {
if ((gCurrentLevel == LEVEL_KATINA) && (this->unk_0B6 == 1) && (gKaKilledAlly == 0)) { if ((gCurrentLevel == LEVEL_KATINA) && (this->unk_0B6 == 1) && !gKaKilledAlly) {
gKaKilledAlly = 1; gKaKilledAlly = true;
Radio_PlayMessage(gMsg_ID_18015, RCID_BILL); Radio_PlayMessage(gMsg_ID_18015, RCID_BILL);
} else if (this->aiType == AI360_KATT) { } else if (this->aiType == AI360_KATT) {
ActorAllRange_PlayMessage(gMsg_ID_20084, RCID_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) { switch (this->aiType) {
case AI360_FALCO: case AI360_FALCO:
ActorAllRange_PlayMessage(gMsg_ID_20060, RCID_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) && 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.x - gPlayer[0].pos.x) < 1000.0f) &&
(fabsf(actor->obj.pos.y - gPlayer[0].pos.y) < 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]++; actor->iwork[10]++;
} else { } else {
actor->iwork[10] = 0; actor->iwork[10] = 0;
@ -1215,7 +1215,7 @@ void ActorAllRange_Update(Actor* this) {
if (this->aiType == AI360_EVENT_HANDLER) { if (this->aiType == AI360_EVENT_HANDLER) {
this->timer_0C2 = 10; this->timer_0C2 = 10;
this->info.unk_1C = 0.0f; this->info.targetOffset = 0.0f;
ActorAllRange_UpdateEvents(this); ActorAllRange_UpdateEvents(this);
return; return;
} }
@ -1344,7 +1344,7 @@ void ActorAllRange_Update(Actor* this) {
} }
sp104 = 0; sp104 = 0;
this->iwork[5] = 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)) {
this->state = STATE360_6; this->state = STATE360_6;
if (this->timer_0C2 < 100) { if (this->timer_0C2 < 100) {
@ -1489,7 +1489,7 @@ void ActorAllRange_Update(Actor* this) {
if (!gPlayer[0].somersault) { if (!gPlayer[0].somersault) {
this->fwork[4] = gPlayer[0].pos.x + spCC; this->fwork[4] = gPlayer[0].pos.x + spCC;
this->fwork[5] = gPlayer[0].pos.y + spC8; 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; this->fwork[1] = gPlayer[0].baseSpeed + 10.0f;
} }
if ((gActors[0].state == STATE360_6) && (this->aiType <= AI360_PEPPY)) { if ((gActors[0].state == STATE360_6) && (this->aiType <= AI360_PEPPY)) {
@ -1546,7 +1546,8 @@ void ActorAllRange_Update(Actor* this) {
} else { } else {
this->fwork[1] = gPlayer[0].baseSpeed - 5.0f; this->fwork[1] = gPlayer[0].baseSpeed - 5.0f;
if ((gCurrentLevel == LEVEL_VENOM_2) && 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; this->iwork[16] = STATE360_8;
} }
} }
@ -2051,7 +2052,7 @@ void ActorAllRange_Update(Actor* this) {
radarMark->pos.x = this->obj.pos.x; radarMark->pos.x = this->obj.pos.x;
radarMark->pos.y = this->obj.pos.y; radarMark->pos.y = this->obj.pos.y;
radarMark->pos.z = this->obj.pos.z; 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) { if (this->iwork[1] != 0) {
this->iwork[1]--; this->iwork[1]--;
if ((this->iwork[1] == 0) && (gActors[0].state == STATE360_2) && (gRadioState == 0)) { 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_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); func_effect_8007A6F0(&this->obj.pos, 0x2903A008);
} else { } else {
this->unk_0D0 = 1; this->dmgType = 1;
this->damage = 10; this->damage = 10;
this->health = 0; this->health = 0;
ActorAllRange_ApplyDamage(this); ActorAllRange_ApplyDamage(this);
@ -2257,7 +2258,7 @@ void ActorAllRange_Draw(ActorAllRange* this) {
case AI360_GREAT_FOX: case AI360_GREAT_FOX:
Display_SetSecondLight(&this->obj.pos); Display_SetSecondLight(&this->obj.pos);
this->unk_0B6 = 1; this->unk_0B6 = 1;
Actor195_Draw(this); ActorCutscene_Draw(this);
break; break;
case AI360_MISSILE: case AI360_MISSILE:
Animation_GetFrameData(&D_SZ_6006D64, 0, sp7C); Animation_GetFrameData(&D_SZ_6006D64, 0, sp7C);

View File

@ -52,7 +52,7 @@ void func_beam_80035E78(PlayerShot* shot) {
if (shot->unk_5C == 0) { 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->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_5C = 1;
shot->unk_64 = 30; shot->unk_64 = 30;
shot->unk_58 = 150; shot->unk_58 = 150;
@ -137,7 +137,7 @@ void func_beam_80036318(PlayerShot* shot) {
} }
func_beam_80035E78(shot); func_beam_80035E78(shot);
} else if (shot->obj.id == PLAYERSHOT_8) { } else if (shot->obj.id == PLAYERSHOT_8) {
shot->unk_44 = 7.5f; shot->scale = 7.5f;
for (i = 0; i < ARRAY_COUNT(gActors); i++) { for (i = 0; i < ARRAY_COUNT(gActors); i++) {
gActors[i].lockOnTimers[shot->playerNum] = 0; gActors[i].lockOnTimers[shot->playerNum] = 0;
} }
@ -367,7 +367,7 @@ s32 func_beam_80036F88(PlayerShot* shot, Actor* actor) {
if (count != 0) { if (count != 0) {
xySizeMod = 0.0f; xySizeMod = 0.0f;
if (actor->info.unk_16 == 1) { 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) && if ((shot->playerNum < 4) &&
((gLaserStrength[shot->playerNum] != LASERS_SINGLE) || (shot->obj.id == PLAYERSHOT_8))) { ((gLaserStrength[shot->playerNum] != LASERS_SINGLE) || (shot->obj.id == PLAYERSHOT_8))) {
xySizeMod += 30.0f; 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 (((s32) hitboxData[0] != 0) && (sqrtf(SQ(temp_fv1) + SQ(temp_fa0)) <= 500.0f)) {
if (shot->playerNum < 4) { if (shot->playerNum < 4) {
temp_fv1 = actor->obj.pos.x - gPlayer[0].cam.eye.x; 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; var_fa1 = (sqrtf(SQ(temp_fv1) + SQ(temp_fa0)) / 50.0f) + 20.0f + 10.0f;
if (var_fa1 > 200.0f) { if (var_fa1 > 200.0f) {
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; sp7C.z = obj->pos.z - shot->obj.pos.z;
// undefined behavior: if this check fails, the function returns no value // 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)) || 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); Matrix_RotateY(gCalcMatrix, -obj->rot.y * M_DTOR, MTXF_NEW);
sp7C.x = shot->obj.pos.x - obj->pos.x; sp7C.x = shot->obj.pos.x - obj->pos.x;
sp7C.y = shot->obj.pos.y - obj->pos.y; 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: case OBJ_BOSS_313:
objId = COL1_8; objId = COL1_8;
break; break;
case OBJ_SCENERY_39: case OBJ_SCENERY_ME_TUNNEL:
objId = COL1_1; objId = COL1_1;
break; break;
case OBJ_SCENERY_120: 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 sp44 = { 0.0f, 0.0f, -100.0f };
Vec3f sp38; Vec3f sp38;
actor->unk_0D0 = 1; actor->dmgType = 1;
actor->unk_0D2 = hitIndex - 1; actor->dmgPart = hitIndex - 1;
actor->timer_0C2 = 2; actor->timer_0C2 = 2;
actor->damage = 10; actor->damage = 10;
if ((shot->playerNum < 4) && (gPlayer[shot->playerNum].form != FORM_LANDMASTER)) { 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) { if (gCurrentLevel == LEVEL_AQUAS) {
actor->damage = 31; actor->damage = 31;
} else { } else {
actor->unk_0D0 = 2; actor->dmgType = 2;
actor->damage = 30; actor->damage = 30;
actor->lockOnTimers[shot->playerNum] = 0; 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.x = shot->obj.pos.x;
actor->hitPos.y = shot->obj.pos.y; actor->hitPos.y = shot->obj.pos.y;
actor->hitPos.z = shot->obj.pos.z; 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->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_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->obj.id == OBJ_ACTOR_261) && (shot->obj.id != PLAYERSHOT_8) &&
((actor->state < 3) || (actor->state >= 5))) || ((actor->state < 3) || (actor->state >= 5))) ||
((actor->obj.id == OBJ_ACTOR_260) && (shot->obj.id != PLAYERSHOT_8) && (actor->timer_0BC != 0))) { ((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) { switch (actor->obj.id) {
case OBJ_ACTOR_180: case OBJ_ACTOR_180:
if (func_beam_8003774C(shot, actor->obj.id, &actor->obj)) { if (func_beam_8003774C(shot, actor->obj.id, &actor->obj)) {
actor->unk_0D0 = 1; actor->dmgType = 1;
actor->unk_0D2 = shot->playerNum; actor->dmgPart = shot->playerNum;
return; return;
} }
break; break;
case OBJ_ACTOR_EVENT: case OBJ_ACTOR_EVENT:
if (actor->unk_0B4 == EINFO_42) { if (actor->unk_0B4 == EINFO_42) {
if (func_beam_8003774C(shot, ACTOR_EVENT_ID, &actor->obj)) { if (func_beam_8003774C(shot, ACTOR_EVENT_ID, &actor->obj)) {
actor->unk_0D0 = 1; actor->dmgType = 1;
actor->unk_0D2 = shot->playerNum; actor->dmgPart = shot->playerNum;
return; return;
} }
} else if (actor->unk_0B4 == EINFO_63) { } 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))) { !((gLaserStrength[shot->playerNum] == LASERS_SINGLE) && (shot->obj.id != PLAYERSHOT_8))) {
test.x = 100.0f; test.x = 100.0f;
} }
if (player->unk_280 >= 100) { if (player->barrelRollAlpha >= 100) {
test.x = 150.0f; test.x = 150.0f;
} }
if (player->form == FORM_LANDMASTER) { if (player->form == FORM_LANDMASTER) {
@ -841,11 +841,11 @@ void func_beam_80038140(PlayerShot* shot) {
test.z = test.x; test.z = test.x;
if ((i != shot->playerNum) && if ((i != shot->playerNum) &&
((player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (player->state_1C8 == PLAYERSTATE_1C8_DOWN)) && ((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.x - shot->obj.pos.x) < test.x) &&
(fabsf(player->pos.y - shot->obj.pos.y) < test.y)) { (fabsf(player->pos.y - shot->obj.pos.y) < test.y)) {
if (player->unk_280 >= 100) { if (player->barrelRollAlpha >= 100) {
shot->obj.rot.y = player->unk_0E8 + player->unk_114 + 180.0f + 90.0f; shot->obj.rot.y = player->rot.y + player->yRot_114 + 180.0f + 90.0f;
shot->obj.rot.x = RAND_FLOAT(360.0f); shot->obj.rot.x = RAND_FLOAT(360.0f);
Matrix_RotateY(gCalcMatrix, shot->obj.rot.y * M_DTOR, MTXF_NEW); Matrix_RotateY(gCalcMatrix, shot->obj.rot.y * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, shot->obj.rot.x * M_DTOR, MTXF_APPLY); 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->obj.pos.z += 2.0f * shot->vel.z;
shot->unk_64 = 5; shot->unk_64 = 5;
AUDIO_PLAY_SFX(0x09007011, player->sfxSource, 0); 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 { } else {
func_beam_80036318(shot); func_beam_80036318(shot);
if (player->unk_1F4 == 0) { if (player->hitTimer == 0) {
if (gPlayer[0].form == 3) { if (gPlayer[0].form == 3) {
Player_ApplyDamage(player, 0, 60); Player_ApplyDamage(player, 0, 60);
} else { } else {
@ -873,11 +873,11 @@ void func_beam_80038140(PlayerShot* shot) {
if (gCamCount != 1) { if (gCamCount != 1) {
player->unk_288 = shot->playerNum + 1; player->unk_288 = shot->playerNum + 1;
} }
player->unk_0D8.x = shot->vel.x * 0.1f; player->knockback.x = shot->vel.x * 0.1f;
player->unk_0D8.y = shot->vel.y * 0.1f; player->knockback.y = shot->vel.y * 0.1f;
player->unk_0D8.z = shot->vel.z * 0.1f; player->knockback.z = shot->vel.z * 0.1f;
if (player->form != FORM_ON_FOOT) { 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); func_beam_80036318(shot);
if (shot->obj.id != PLAYERSHOT_4) { 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); 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 { } else {
for (i = 0, scenery = gScenery; i < 50; i++, scenery++) { for (i = 0, scenery = gScenery; i < 50; i++, scenery++) {
if (scenery->obj.status == OBJ_ACTIVE) { 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_4) || (scenery->obj.id == OBJ_SCENERY_5) ||
(scenery->obj.id == OBJ_SCENERY_120) || (scenery->obj.id == OBJ_SCENERY_124) || (scenery->obj.id == OBJ_SCENERY_120) || (scenery->obj.id == OBJ_SCENERY_124) ||
(scenery->obj.id == OBJ_SCENERY_126) || (scenery->obj.id == OBJ_SCENERY_47) || (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 }; Vec3f sp4C = { 0.0f, 0.0f, 0.0f };
s32 sp48 = 0; 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); Matrix_MultVec3f(gGfxMatrix, &sp4C, &D_beam_8015F950);
if ((D_beam_8015F950.z < 0.0f) && (D_beam_8015F950.z > -10000.0f)) { 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)) { 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; f32 var_fv1;
s32 sp104 = 0; 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); Matrix_MultVec3f(gGfxMatrix, &sp11C, &D_beam_8015F950);
if ((D_beam_8015F950.z < 0.0f) && (D_beam_8015F950.z > -10000.0f)) { 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 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_RotateX(gGfxMatrix, shot->obj.rot.x * M_DTOR, MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, shot->obj.rot.z * 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)) { if ((shot->obj.id == PLAYERSHOT_BOMB) && (shot->unk_5C == 0)) {
Matrix_RotateZ(gGfxMatrix, shot->unk_34 * M_DTOR, MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, shot->vec_2C.z * M_DTOR, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, shot->unk_30 * M_DTOR, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, shot->vec_2C.y * M_DTOR, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, shot->unk_2C * 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); 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); gSPDisplayList(gMasterDisp++, D_10231A0);
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
Matrix_Push(&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); MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].camYaw, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].camYaw, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].camPitch, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].camPitch, MTXF_APPLY);
@ -1292,7 +1292,7 @@ void func_beam_80039A50(PlayerShot* shot) {
Matrix_SetGfxMtx(&gMasterDisp); Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_1024AC0); gSPDisplayList(gMasterDisp++, D_1024AC0);
} else { } 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); Matrix_SetGfxMtx(&gMasterDisp);
if (gVersusMode) { if (gVersusMode) {
RCP_SetupDL_49(); RCP_SetupDL_49();
@ -1371,7 +1371,7 @@ void func_beam_80039A50(PlayerShot* shot) {
break; break;
case PLAYERSHOT_6: case PLAYERSHOT_6:
case PLAYERSHOT_7: 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); Matrix_SetGfxMtx(&gMasterDisp);
RCP_SetupDL(&gMasterDisp, 0x31); RCP_SetupDL(&gMasterDisp, 0x31);
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255);
@ -1399,19 +1399,19 @@ void func_beam_80039A50(PlayerShot* shot) {
gSPDisplayList(gMasterDisp++, D_AQ_600DB80); gSPDisplayList(gMasterDisp++, D_AQ_600DB80);
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
Matrix_Push(&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); 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); RCP_SetupDL(&gMasterDisp, 0x31);
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 32, 32, 0, shot->unk_58); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 32, 32, 0, shot->unk_58);
gDPSetEnvColor(gMasterDisp++, 32, 16, 16, shot->unk_58); gDPSetEnvColor(gMasterDisp++, 32, 16, 16, shot->unk_58);
Matrix_SetGfxMtx(&gMasterDisp); Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_1024AC0); gSPDisplayList(gMasterDisp++, D_1024AC0);
} else if (shot->unk_5C == 0) { } else if (shot->unk_5C == 0) {
if (!(shot->unk_44 > 1.5f)) { if (!(shot->scale > 1.5f)) {
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
Matrix_Push(&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); MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].camYaw, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].camYaw, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].camPitch, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].camPitch, MTXF_APPLY);
@ -1457,7 +1457,7 @@ void func_beam_80039A50(PlayerShot* shot) {
gSPDisplayList(gMasterDisp++, D_10231A0); gSPDisplayList(gMasterDisp++, D_10231A0);
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
Matrix_Push(&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); MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].camYaw, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].camYaw, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].camPitch, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].camPitch, MTXF_APPLY);
@ -1509,10 +1509,10 @@ void func_beam_8003B00C(PlayerShot* shot, Player* player) {
Vec3f sp38; Vec3f sp38;
switch (shot->unk_5C) { switch (shot->unk_5C) {
case 0: case 0:
Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); Matrix_RotateX(gCalcMatrix, -(player->rot.x * M_DTOR), MTXF_APPLY);
Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0) * M_DTOR), MTXF_APPLY); Matrix_RotateZ(gCalcMatrix, -((player->bankAngle + player->rockAngle) * 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);
sp5C.x = 0.0f; sp5C.x = 0.0f;
sp5C.y = 0.0f; sp5C.y = 0.0f;
sp5C.z = player->baseSpeed + 200.0f; sp5C.z = player->baseSpeed + 200.0f;
@ -1526,19 +1526,19 @@ void func_beam_8003B00C(PlayerShot* shot, Player* player) {
Matrix_MultVec3f(gCalcMatrix, &sp5C, &sp44); Matrix_MultVec3f(gCalcMatrix, &sp5C, &sp44);
shot->unk_48 = player->pos.x + sp44.x; shot->unk_48 = player->pos.x + sp44.x;
shot->unk_4C = player->pos.y + sp44.y; shot->unk_4C = player->pos.y + sp44.y;
shot->unk_50 = player->unk_138 + sp44.z; shot->unk_50 = player->trueZpos + sp44.z;
shot->unk_44 += 200.0f; shot->scale += 200.0f;
if (shot->unk_44 > 5000.0f) { if (shot->scale > 5000.0f) {
shot->unk_44 = 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); Matrix_MultVec3f(gCalcMatrix, &sp5C, &sp38);
D_ctx_80178498 = shot->obj.pos.z; D_ctx_80178498 = shot->obj.pos.z;
D_ctx_801784A0 = shot->obj.pos.y; D_ctx_801784A0 = shot->obj.pos.y;
D_ctx_8017849C = shot->obj.pos.x; D_ctx_8017849C = shot->obj.pos.x;
shot->obj.pos.x = player->pos.x + sp38.x; shot->obj.pos.x = player->pos.x + sp38.x;
shot->obj.pos.y = player->pos.y + sp38.y; 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); Matrix_Push(&gCalcMatrix);
func_beam_80038140(shot); func_beam_80038140(shot);
Matrix_Pop(&gCalcMatrix); Matrix_Pop(&gCalcMatrix);
@ -1552,7 +1552,7 @@ void func_beam_8003B00C(PlayerShot* shot, Player* player) {
} }
} }
shot->unk_64 = 30; 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)) { if (!(gControllerHold->button & U_CBUTTONS) && !(gControllerHold->button & A_BUTTON)) {
shot->unk_5C = 1; shot->unk_5C = 1;
} }
@ -1698,9 +1698,9 @@ bool func_beam_8003BB4C(PlayerShot* shot) {
var_fa0 = 200.0f; var_fa0 = 200.0f;
} }
for (i = 0, actor = gActors; i < 60; i++, actor++) { 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) && ((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))) { (fabsf(shot->obj.pos.z - actor->obj.pos.z) <= var_fa0))) {
actor->lockOnTimers[shot->playerNum] = 20; actor->lockOnTimers[shot->playerNum] = 20;
func_enmy_80060F30(gPlayer[shot->playerNum].sfxSource, 0x49008027, shot->playerNum); 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) && (player->form != FORM_ON_FOOT) && (i != shot->playerNum) &&
(gVsLockOnTimers[i][shot->playerNum] == 0) && (fabsf(shot->obj.pos.x - player->pos.x) <= var_fa0) && (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.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[0][shot->playerNum] = gVsLockOnTimers[1][shot->playerNum] =
gVsLockOnTimers[2][shot->playerNum] = gVsLockOnTimers[3][shot->playerNum] = 0; gVsLockOnTimers[2][shot->playerNum] = gVsLockOnTimers[3][shot->playerNum] = 0;
gVsLockOnTimers[i][shot->playerNum] = 20; 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.status == OBJ_ACTIVE) && (boss->timer_05A == 0)) {
if (boss->obj.id == OBJ_BOSS_316) { if (boss->obj.id == OBJ_BOSS_316) {
var_s6 = gGameFrameCount % 8U; var_s6 = gGameFrameCount % 8U;
var_fs2 = shot->unk_44 * 40.0f; var_fs2 = shot->scale * 40.0f;
} else { } else {
var_s6 = gGameFrameCount % 16U; var_s6 = gGameFrameCount % 16U;
var_fs2 = shot->unk_44 * 30.0f; var_fs2 = shot->scale * 30.0f;
} }
hitboxData = boss->info.hitbox; hitboxData = boss->info.hitbox;
count = *hitboxData++; count = *hitboxData++;
@ -1852,7 +1852,7 @@ void func_beam_8003C4D0(PlayerShot* shot, s32 damage) {
Scenery* scenery; Scenery* scenery;
Effect* effect; Effect* effect;
Player* player; 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++) { for (i = 0, scenery = gScenery; i < 50; i++, scenery++) {
if ((scenery->obj.status == OBJ_ACTIVE) && (scenery->obj.id == OBJ_SCENERY_56)) { 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_78)) ||
((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == EINFO_38)) || ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == EINFO_38)) ||
(actor->obj.id == OBJ_ACTOR_196)) { (actor->obj.id == OBJ_ACTOR_196)) {
actor->unk_0D0 = 2; actor->dmgType = 2;
actor->unk_0D2 = 0; actor->dmgPart = 0;
actor->unk_0D4 = shot->playerNum + 1; actor->dmgSource = shot->playerNum + 1;
actor->damage = damage; actor->damage = damage;
if (actor->info.bonus != 0) { if (actor->info.bonus != 0) {
shot->bonus++; shot->bonus++;
} }
} else if ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->scale >= 0.5f) && (damage > 30)) { } 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.x = sp68 * 0.03f;
actor->vel.y = sp64 * 0.03f; actor->vel.y = sp64 * 0.03f;
actor->vel.z = sp60 * 0.03f; actor->vel.z = sp60 * 0.03f;
@ -1922,9 +1922,9 @@ void func_beam_8003C4D0(PlayerShot* shot, s32 damage) {
shot->bonus++; shot->bonus++;
} }
} else { } else {
actor->unk_0D0 = 2; actor->dmgType = 2;
actor->unk_0D2 = 0; actor->dmgPart = 0;
actor->unk_0D4 = shot->playerNum + 1; actor->dmgSource = shot->playerNum + 1;
actor->damage = damage; actor->damage = damage;
if (actor->info.bonus != 0) { if (actor->info.bonus != 0) {
shot->bonus++; shot->bonus++;
@ -1969,10 +1969,10 @@ void func_beam_8003C4D0(PlayerShot* shot, s32 damage) {
} }
if (gVersusMode) { if (gVersusMode) {
for (i = 0, player = gPlayer; i < gCamCount; i++, player++) { 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; sp68 = player->pos.x - shot->obj.pos.x;
sp64 = player->pos.y - shot->obj.pos.y; 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) { if (sqrtf(SQ(sp68) + SQ(sp64) + SQ(sp60)) < temp_fs2) {
player->unk_288 = shot->playerNum + 1; player->unk_288 = shot->playerNum + 1;
switch (player->form) { switch (player->form) {
@ -2032,13 +2032,13 @@ void func_beam_8003CC08(PlayerShot* shot) {
case 1: case 1:
D_ctx_8017812C = 2; D_ctx_8017812C = 2;
shot->obj.rot.y += 1.0f; 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 ((shot->unk_64 > 0) && (shot->unk_64 < 30)) {
if (!gVersusMode && ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || if (!gVersusMode && ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) ||
(gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN))) { (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN))) {
test.x = gPlayer[0].pos.x - shot->obj.pos.x; test.x = gPlayer[0].pos.x - shot->obj.pos.x;
test.y = gPlayer[0].pos.y - shot->obj.pos.y; 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; var_ft5 = VEC3F_MAG(&test) * 0.01f;
if (var_ft5 > 60.0f) { if (var_ft5 > 60.0f) {
var_ft5 = 60.0f; var_ft5 = 60.0f;
@ -2090,12 +2090,12 @@ void func_beam_8003CF90(PlayerShot* shot) {
var_a3 = 0; var_a3 = 0;
if (shot->unk_60 == 0) { if (shot->unk_60 == 0) {
for (i = 0, actor = gActors; i < 60; i++, actor++) { 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)) { (actor->lockOnTimers[shot->playerNum] != 0)) {
var_a3 = 1; var_a3 = 1;
actor->lockOnTimers[shot->playerNum] = 2; actor->lockOnTimers[shot->playerNum] = 2;
D_800C9C24 = actor->obj.pos; 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++) { for (i = 0, player = gPlayer; i < gCamCount; i++, player++) {
@ -2109,7 +2109,7 @@ void func_beam_8003CF90(PlayerShot* shot) {
} else { } else {
D_800C9C24.y = player->pos.y + 30.0f; D_800C9C24.y = player->pos.y + 30.0f;
} }
D_800C9C24.z = player->unk_138; D_800C9C24.z = player->trueZpos;
} }
} }
if (var_a3 != 0) { if (var_a3 != 0) {
@ -2118,20 +2118,20 @@ void func_beam_8003CF90(PlayerShot* shot) {
sp64 = shot->obj.pos.z - D_800C9C24.z; sp64 = shot->obj.pos.z - D_800C9C24.z;
sp58 = Math_RadToDeg(Math_Atan2F(sp6C, sp64)); sp58 = Math_RadToDeg(Math_Atan2F(sp6C, sp64));
sp5C = Math_RadToDeg(-Math_Atan2F(sp68, sqrtf(SQ(sp6C) + SQ(sp64)))); sp5C = Math_RadToDeg(-Math_Atan2F(sp68, sqrtf(SQ(sp6C) + SQ(sp64))));
if (shot->unk_30 >= 360.0f) { if (shot->vec_2C.y >= 360.0f) {
shot->unk_30 -= 360.0f; shot->vec_2C.y -= 360.0f;
} }
if (shot->unk_30 < 0.0f) { if (shot->vec_2C.y < 0.0f) {
shot->unk_30 += 360.0f; shot->vec_2C.y += 360.0f;
} }
if (shot->unk_2C >= 360.0f) { if (shot->vec_2C.x >= 360.0f) {
shot->unk_2C -= 360.0f; shot->vec_2C.x -= 360.0f;
} }
if (shot->unk_2C < 0.0f) { if (shot->vec_2C.x < 0.0f) {
shot->unk_2C += 360.0f; shot->vec_2C.x += 360.0f;
} }
Math_SmoothStepToAngle(&shot->unk_30, sp58, 1.0f, shot->unk_50, 0.0f); Math_SmoothStepToAngle(&shot->vec_2C.y, 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.x, sp5C, 1.0f, shot->unk_50, 0.0f);
shot->unk_64 = 30; shot->unk_64 = 30;
} else { } else {
shot->unk_60 = 1; shot->unk_60 = 1;
@ -2147,8 +2147,8 @@ void func_beam_8003CF90(PlayerShot* shot) {
Vec3f sp44; Vec3f sp44;
Vec3f sp38; Vec3f sp38;
shot->obj.rot.y = shot->unk_30; shot->obj.rot.y = shot->vec_2C.y;
shot->obj.rot.x = shot->unk_2C; shot->obj.rot.x = shot->vec_2C.x;
Matrix_RotateY(gCalcMatrix, shot->obj.rot.y * M_DTOR, MTXF_NEW); Matrix_RotateY(gCalcMatrix, shot->obj.rot.y * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, shot->obj.rot.x * M_DTOR, MTXF_APPLY); Matrix_RotateX(gCalcMatrix, shot->obj.rot.x * M_DTOR, MTXF_APPLY);
sp44.x = sp44.y = 0.0f; sp44.x = sp44.y = 0.0f;
@ -2203,11 +2203,11 @@ void func_beam_8003D54C(PlayerShot* shot, s32 index) {
func_beam_8003BACC(shot); func_beam_8003BACC(shot);
break; break;
case PLAYERSHOT_8: case PLAYERSHOT_8:
if (shot->unk_44 > 1.5f) { if (shot->scale > 1.5f) {
func_beam_8003C4D0(shot, 30); func_beam_8003C4D0(shot, 30);
if (shot->bonus != 0) { if (shot->bonus != 0) {
if (gVersusMode) { if (gVersusMode) {
D_ctx_80177C30[shot->playerNum] += shot->bonus; gPlayerScores[shot->playerNum] += shot->bonus;
} else { } else {
bonus = shot->bonus; bonus = shot->bonus;
if (shot->bonus > 10) { if (shot->bonus > 10) {

View File

@ -414,7 +414,7 @@ void Background_DrawBackdrop(void) {
break; break;
case LEVEL_AQUAS: case LEVEL_AQUAS:
if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) { 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); 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 sp13C = Math_ModF(sp13C * -40.44444f * 2.0f, 7280.0f); // close to 7280.0f / 180.0f
RCP_SetupDL_17(); RCP_SetupDL_17();
@ -449,16 +449,16 @@ void Background_DrawBackdrop(void) {
case LEVEL_ZONESS: case LEVEL_ZONESS:
case LEVEL_MACBETH: case LEVEL_MACBETH:
case LEVEL_TITANIA: 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); 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 sp13C = sp12C * -40.44444f * 2.0f; // close to 7280.0f / 180.0f
if ((gCurrentLevel == LEVEL_TITANIA) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && 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; D_bg_8015F968 += __sinf(gPlayer[0].camYaw) * 20.0f;
sp13C += D_bg_8015F968; sp13C += D_bg_8015F968;
} }
if ((gCurrentLevel == LEVEL_SOLAR) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && 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; D_bg_8015F968 = __sinf(gPlayer[0].camPitch) * 7000.0f;
sp134 -= fabsf(D_bg_8015F968); sp134 -= fabsf(D_bg_8015F968);
} }
@ -527,7 +527,7 @@ void Background_DrawBackdrop(void) {
sp138 = Math_ModF(sp138 - 34.5f, 480.0f); sp138 = Math_ModF(sp138 - 34.5f, 480.0f);
sp134 = Math_ModF(sp134 + 19.0f, 360.0f); sp134 = Math_ModF(sp134 + 19.0f, 360.0f);
} else if (levelId == LEVEL_BOLSE) { } 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); sp134 = Math_ModF(sp134 + 360.0f - 100.0f, 360.0f);
} }
} else { } else {
@ -565,7 +565,7 @@ void Background_DrawBackdrop(void) {
Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 1.0f, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 1.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp); Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_ME_600DDF0); 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, Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f) - 130.0f, -290.0f,
MTXF_APPLY); MTXF_APPLY);
Matrix_Scale(gGfxMatrix, 0.4f, 0.4f, 1.0f, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 0.4f, 0.4f, 1.0f, MTXF_APPLY);
@ -593,7 +593,7 @@ void Background_DrawBackdrop(void) {
break; break;
case LEVEL_AREA_6: case LEVEL_AREA_6:
case LEVEL_UNK_4: case LEVEL_UNK_4:
sp128 = (D_ctx_80177D20 * 0.00004f) + 0.5f; sp128 = (gPathProgress * 0.00004f) + 0.5f;
if (sp128 > 3.5f) { if (sp128 > 3.5f) {
sp128 = 3.5f; sp128 = 3.5f;
} }
@ -712,7 +712,7 @@ void Background_DrawSun(void) {
if (gCurrentLevel == LEVEL_KATINA) { if (gCurrentLevel == LEVEL_KATINA) {
gSunViewY -= 80.0f; 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; gSunViewY -= 60.0f;
gSunViewX -= 480.0f; gSunViewX -= 480.0f;
} }
@ -834,7 +834,7 @@ void Background_DrawGround(void) {
} }
if (gGroundType == 7) { if (gGroundType == 7) {
sp1D4 = 0.0f; sp1D4 = 0.0f;
gPlayer[gPlayerNum].unk_0AC = 0.0f; gPlayer[gPlayerNum].xPath = 0.0f;
} }
if (gLevelMode == LEVELMODE_ALL_RANGE) { if (gLevelMode == LEVELMODE_ALL_RANGE) {
@ -844,7 +844,7 @@ void Background_DrawGround(void) {
f32 temp_fa0; f32 temp_fa0;
sp1D4 = 0.0f; sp1D4 = 0.0f;
gPlayer[gPlayerNum].unk_0AC = 0.0f; gPlayer[gPlayerNum].xPath = 0.0f;
sp1B4.x = 0; sp1B4.x = 0;
sp1B4.y = 0; sp1B4.y = 0;
@ -854,16 +854,16 @@ void Background_DrawGround(void) {
temp_fv1 = gPlayer[gPlayerNum].cam.eye.x + sp1A8.x; temp_fv1 = gPlayer[gPlayerNum].cam.eye.x + sp1A8.x;
temp_fa0 = gPlayer[gPlayerNum].cam.eye.z + sp1A8.z; temp_fa0 = gPlayer[gPlayerNum].cam.eye.z + sp1A8.z;
if (temp_fv1 > 6000.0f) { if (temp_fv1 > 6000.0f) {
gPlayer[gPlayerNum].unk_0AC = 12000.0f; gPlayer[gPlayerNum].xPath = 12000.0f;
} }
if (temp_fv1 > 18000.0f) { if (temp_fv1 > 18000.0f) {
gPlayer[gPlayerNum].unk_0AC = 24000.0f; gPlayer[gPlayerNum].xPath = 24000.0f;
} }
if (temp_fv1 < -6000.0f) { if (temp_fv1 < -6000.0f) {
gPlayer[gPlayerNum].unk_0AC = -12000.0f; gPlayer[gPlayerNum].xPath = -12000.0f;
} }
if (temp_fv1 < -18000.0f) { if (temp_fv1 < -18000.0f) {
gPlayer[gPlayerNum].unk_0AC = -24000.0f; gPlayer[gPlayerNum].xPath = -24000.0f;
} }
if (temp_fa0 > 6000.0f) { if (temp_fa0 > 6000.0f) {
sp1D4 = 12000.0f; sp1D4 = 12000.0f;
@ -879,7 +879,7 @@ void Background_DrawGround(void) {
} }
} }
Matrix_Push(&gGfxMatrix); 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) { if (D_ctx_80177C70 == 2) {
Matrix_Scale(gGfxMatrix, 1.2f, 1.2f, 1.0f, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 1.2f, 1.2f, 1.0f, MTXF_APPLY);
} }
@ -893,8 +893,8 @@ void Background_DrawGround(void) {
} }
if (gLevelMode == LEVELMODE_ON_RAILS) { if (gLevelMode == LEVELMODE_ON_RAILS) {
gDPSetTextureImage(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, SEGMENTED_TO_VIRTUAL(D_CO_601B6C0)); 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_s0 = fabsf(Math_ModF(2.0f * (gPathTexScroll * 0.2133333f), 128.0f)); // 0.64f / 3.0f
temp_fv0 = Math_ModF((10000.0f - gPlayer[gPlayerNum].unk_0AC) * 0.32f, 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, 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); G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD);
switch (gGroundSurface) { switch (gGroundSurface) {
@ -955,8 +955,8 @@ void Background_DrawGround(void) {
break; break;
} }
gDPSetTextureImage(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sp1C4); 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_s0 = fabsf(Math_ModF(2.0f * (gPathTexScroll * 0.2133333f), 128.0f));
temp_fv0 = Math_ModF((10000.0f - gPlayer[gPlayerNum].unk_0AC) * 0.32f, 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, 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); G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD);
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
@ -975,18 +975,18 @@ void Background_DrawGround(void) {
case LEVEL_TRAINING: case LEVEL_TRAINING:
RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar);
if (gLevelMode == LEVELMODE_ON_RAILS) { if (gLevelMode == LEVELMODE_ON_RAILS) {
if (D_ctx_80177CE8 > 290.0f) { if (gPathTexScroll > 290.0f) {
D_ctx_80177CE8 -= 290.0f; gPathTexScroll -= 290.0f;
} }
Matrix_Push(&gGfxMatrix); 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_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp); Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_TR_6005880); gSPDisplayList(gMasterDisp++, D_TR_6005880);
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
if (1) {} if (1) {}
Matrix_Push(&gGfxMatrix); 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_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp); Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_TR_6005880); 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, gDPLoadTileTexture(gMasterDisp++, SEGMENTED_TO_VIRTUAL(D_AQ_600AB68), G_IM_FMT_RGBA, G_IM_SIZ_16b, 32,
32); 32);
gDPSetTextureImage(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, SEGMENTED_TO_VIRTUAL(D_AQ_600AB68)); 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_s0 = fabsf(Math_ModF(2.0f * (gPathTexScroll * 0.2133333f), 128.0f));
temp_fv0 = Math_ModF((10000.0f - gPlayer[gPlayerNum].unk_0AC) * 0.32f, 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, 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); 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, gDPLoadTileTexture(gMasterDisp++, SEGMENTED_TO_VIRTUAL(D_AQ_602ACC0), G_IM_FMT_RGBA, G_IM_SIZ_16b, 32,
32); 32);
gDPSetTextureImage(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, SEGMENTED_TO_VIRTUAL(D_AQ_602ACC0)); 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_s0 = fabsf(Math_ModF(2.0f * (gPathTexScroll * 0.2133333f), 128.0f));
temp_fv0 = Math_ModF((10000.0f - gPlayer[gPlayerNum].unk_0AC) * 0.32f, 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, 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); G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD);
if (gAqDrawMode != 0) { if (gAqDrawMode != 0) {
@ -1042,7 +1042,7 @@ void Background_DrawGround(void) {
} else { } else {
RCP_SetupDL(&gMasterDisp, 0x25); 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); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255);
} else if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) { } else if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) {
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, D_bg_8015F974, D_bg_8015F978, D_bg_8015F97C, gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, D_bg_8015F974, D_bg_8015F978, D_bg_8015F97C,

View File

@ -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) { 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) { 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); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 80);
gCsFrameCount = 0; gCsFrameCount = 0;
D_ctx_80178448 = zPos + D_ctx_80177D20; D_ctx_80178448 = zPos + gPathProgress;
D_ctx_80178440 = xPos; D_ctx_80178440 = xPos;
D_ctx_80178444 = yPos; D_ctx_80178444 = yPos;
player->state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; player->state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE;
player->unk_1D0 = 10; player->csState = 10;
player->timer_1F8 = 50; player->csTimer = 50;
player->timer_1FC = 50; player->csEventTimer = 50;
player->unk_000 = 0.0f; player->unk_000 = 0.0f;
player->unk_004 = 1.0f; player->unk_004 = 1.0f;
if (player->pos.x < player->unk_0AC) { if (player->pos.x < player->xPath) {
player->unk_004 = -1.0f; player->unk_004 = -1.0f;
} }
gPlayer[0].vel.x = 0.0f; gPlayer[0].vel.x = 0.0f;

View File

@ -25,8 +25,8 @@ s32 gTeamDamage[6];
u8 gMissionStatus; // next planet path u8 gMissionStatus; // next planet path
f32 gGroundHeight; f32 gGroundHeight;
f32 D_ctx_80177950; f32 D_ctx_80177950;
f32 D_ctx_80177968; f32 gPlayerTurnRate;
f32 D_ctx_80177970; f32 gPlayerTurnStickMod;
f32 gCsCamEyeX; f32 gCsCamEyeX;
f32 gCsCamEyeY; f32 gCsCamEyeY;
f32 gCsCamEyeZ; f32 gCsCamEyeZ;
@ -63,13 +63,13 @@ u16 gBgmSeqId;
u8 gLevelType; u8 gLevelType;
s32 gSavedObjectLoadIndex; s32 gSavedObjectLoadIndex;
UNK_TYPE F_80177CA8; UNK_TYPE F_80177CA8;
f32 D_ctx_80177CB0; f32 gSavedPathProgress;
UNK_TYPE F_80177CB8; UNK_TYPE F_80177CB8;
f32 gWaterLevel; f32 gWaterLevel;
f32 D_ctx_80177CC8; f32 gPathGroundScroll;
f32 D_ctx_80177CE8; f32 gPathTexScroll;
f32 D_ctx_80177D08; f32 gPathVelZ;
f32 D_ctx_80177D20; f32 gPathProgress;
f32 gRadioPortraitScaleY; f32 gRadioPortraitScaleY;
f32 gRadioTextBoxScaleY; f32 gRadioTextBoxScaleY;
f32 gRadioMsgRadioId; f32 gRadioMsgRadioId;
@ -252,7 +252,7 @@ s32 gHitCount;
s32 gSavedHitCount; s32 gSavedHitCount;
s16 gLifeCount[4]; s16 gLifeCount[4];
LaserStrength gLaserStrength[4]; LaserStrength gLaserStrength[4];
s32 D_ctx_80161AB8; s32 gCullObjects;
UNK_TYPE F_80161AC0[4]; UNK_TYPE F_80161AC0[4];
UNK_TYPE F_80161AD0[4]; UNK_TYPE F_80161AD0[4];
UNK_TYPE F_80161AE0[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]; f32 D_ctx_801779A8[4];
u8 gPauseEnabled; u8 gPauseEnabled;
s32 gChargeTimers[4]; s32 gChargeTimers[4];
f32 D_ctx_801779E4; f32 gPathVelX;
f32 D_ctx_801779F4; f32 gPathVelY;
s32 D_Timer_80177A00[4]; s32 gUturnDownTimers[4];
s32 D_Timer_80177A38[4]; s32 gUturnBrakeTimers[4];
s32 D_Timer_80177A70[4]; s32 gLoopDownTimers[4];
s32 D_Timer_80177A88[4]; s32 gLoopBoostTimers[4];
f32 D_ctx_80177AA0[4]; f32 gMuzzleFlashScale[4];
f32 gShieldAlpha[4]; f32 gShieldAlpha[4];
s32 gHasShield[4]; s32 gHasShield[4];
s32 gShieldTimer[4]; s32 gShieldTimer[4];
@ -320,12 +320,12 @@ u8 gCoUturnCount;
u8 gGreatFoxIntact; u8 gGreatFoxIntact;
u8 gTiStartLandmaster; u8 gTiStartLandmaster;
u16 gControllerRumbleTimers[4]; u16 gControllerRumbleTimers[4];
u16 D_ctx_80177C30[4]; u16 gPlayerScores[4];
s32 D_ctx_80177C50; s32 D_ctx_80177C50;
s32 D_ctx_80177C70; s32 D_ctx_80177C70; // sets camera field of view Y. initialized to 0 and never changed
s32 D_ctx_80177C78; s32 gTraining360MsgTimer;
s32 D_ctx_80177C8C; s32 gTraining360MsgIndex;
s32 D_ctx_80177C94; s32 D_ctx_80177C94; // these save player parameters across the Venom -> Andross transition
s32 D_ctx_80177C9C; s32 D_ctx_80177C9C;
s32 D_ctx_80177CA4; s32 D_ctx_80177CA4;
s32 D_ctx_80177CAC; s32 D_ctx_80177CAC;

File diff suppressed because it is too large Load Diff

View File

@ -12,7 +12,7 @@ s16 gReflectY;
Matrix D_display_80161418[4]; Matrix D_display_80161418[4];
Vec3f D_display_80161518[4]; Vec3f D_display_80161518[4];
Vec3f D_display_80161548[4]; Vec3f D_display_80161548[4];
Vec3f D_display_80161578[4]; Vec3f gLockOnTargetViewPos[4];
f32 D_display_801615A8[4]; f32 D_display_801615A8[4];
f32 D_display_801615B8[4]; f32 D_display_801615B8[4];
@ -53,7 +53,7 @@ void func_display_80051B30(void) {
Matrix_RotateX(gCalcMatrix, gPlayer[0].camPitch, MTXF_APPLY); Matrix_RotateX(gCalcMatrix, gPlayer[0].camPitch, MTXF_APPLY);
sp68.x = gTeamHelpActor->obj.pos.x - gPlayer[0].cam.eye.x; sp68.x = gTeamHelpActor->obj.pos.x - gPlayer[0].cam.eye.x;
sp68.y = gTeamHelpActor->obj.pos.y - gPlayer[0].cam.eye.y; 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); Matrix_MultVec3f(gCalcMatrix, &sp68, &sp5C);
sp7C = 0; sp7C = 0;
if ((sp5C.z < 0.0f) && (sp5C.z > -12000.0f) && (fabsf(sp5C.x) < fabsf(sp5C.z * 0.4f))) { 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) { void func_display_80052584(Player* player) {
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
Matrix_Copy(gGfxMatrix, &gIdentityMatrix); 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, Matrix_Translate(gGfxMatrix, D_display_801613B0[player->num].x, D_display_801613B0[player->num].y,
D_display_801613B0[player->num].z, MTXF_APPLY); 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], Matrix_Scale(gGfxMatrix, D_display_800CA23C[player->csTimer - 1], D_display_800CA23C[player->csTimer - 1],
D_display_800CA23C[player->timer_1F8 - 1], MTXF_APPLY); D_display_800CA23C[player->csTimer - 1], MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp); Matrix_SetGfxMtx(&gMasterDisp);
RCP_SetupDL_40(); RCP_SetupDL_40();
gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); 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]); Matrix_MultVec3f(gGfxMatrix, &sp4C, &D_display_801613E0[1]);
} }
if (player->cockpitView && (gLevelMode == LEVELMODE_ON_RAILS) && 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) { if (arg1 == 0) {
sDrawCockpit = 1; sDrawCockpit = 1;
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
@ -711,10 +711,10 @@ void func_display_80054300(Player* player) {
Math_SmoothStepToF(&sPlayerShadowing, player->shadowing, 1.0f, 10.0f, 0.0f); Math_SmoothStepToF(&sPlayerShadowing, player->shadowing, 1.0f, 10.0f, 0.0f);
RCP_SetupDL(&gMasterDisp, 0x42); RCP_SetupDL(&gMasterDisp, 0x42);
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, (s32) sPlayerShadowing); 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); 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; player->shadowing = 90;
} else { } else {
player->shadowing = 180; player->shadowing = 180;
@ -782,7 +782,7 @@ void func_display_8005478C(Player* player) {
RCP_SetupDL_64(); RCP_SetupDL_64();
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 100); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 100);
Matrix_Push(&gGfxMatrix); 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->form == FORM_LANDMASTER) {
if (player->unk_194 <= 0.0f) { if (player->unk_194 <= 0.0f) {
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
@ -807,23 +807,26 @@ void func_display_80054914(Player* player) {
Vec3f sp40; Vec3f sp40;
Vec3f sp34; Vec3f sp34;
if (player->unk_280 != 0) { if (player->barrelRollAlpha != 0) {
Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134 + 180.0f) * M_DTOR, MTXF_NEW); Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + player->damageShake + 180.0f) * M_DTOR,
Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_134 + player->unk_4D8) * M_DTOR), MTXF_NEW);
Matrix_RotateX(gCalcMatrix,
-((player->xRot_120 + player->rot.x + player->damageShake + player->aerobaticPitch) * M_DTOR),
MTXF_APPLY); MTXF_APPLY);
Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), MTXF_APPLY); Matrix_RotateZ(gCalcMatrix, -((player->bankAngle + player->rockAngle + player->damageShake) * M_DTOR),
Matrix_Translate(gCalcMatrix, player->unk_084, player->unk_080, 0.0f, MTXF_APPLY); MTXF_APPLY);
Matrix_Translate(gCalcMatrix, player->xShake, player->yBob, 0.0f, MTXF_APPLY);
sp40.x = 0.0f; sp40.x = 0.0f;
sp40.y = 0.0f; sp40.y = 0.0f;
sp40.z = -30.0f; sp40.z = -30.0f;
Matrix_MultVec3f(gCalcMatrix, &sp40, &sp34); Matrix_MultVec3f(gCalcMatrix, &sp40, &sp34);
sp4C = 1.0f; sp4C = 1.0f;
if (player->unk_1F0 < 0) { if (player->baseRollRate < 0) {
sp4C = -1.0f; sp4C = -1.0f;
} }
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, player->pos.x + sp34.x, player->pos.y + sp34.y, 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_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].camYaw, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].camPitch, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].camPitch, MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 20.0f * sp4C * M_DTOR, MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 20.0f * sp4C * M_DTOR, MTXF_APPLY);
@ -832,13 +835,13 @@ void func_display_80054914(Player* player) {
} else { } else {
Matrix_Scale(gGfxMatrix, 1.2f, 1.2f, 1.2f, MTXF_APPLY); 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_RotateX(gGfxMatrix, M_PI, MTXF_APPLY);
} }
Matrix_SetGfxMtx(&gMasterDisp); Matrix_SetGfxMtx(&gMasterDisp);
RCP_SetupDL(&gMasterDisp, 0x43); RCP_SetupDL(&gMasterDisp, 0x43);
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, player->unk_280); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, player->barrelRollAlpha);
gDPSetEnvColor(gMasterDisp++, 0, 0, 160, player->unk_280); gDPSetEnvColor(gMasterDisp++, 0, 0, 160, player->barrelRollAlpha);
gSPDisplayList(gMasterDisp++, D_101DC10); gSPDisplayList(gMasterDisp++, D_101DC10);
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
} }
@ -929,7 +932,7 @@ void func_display_80054E80(Player* player) {
gSPDisplayList(gMasterDisp++, D_1024AC0); gSPDisplayList(gMasterDisp++, D_1024AC0);
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
} }
if (D_ctx_80177AA0[player->num] > 0.1f) { if (gMuzzleFlashScale[player->num] > 0.1f) {
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
RCP_SetupDL(&gMasterDisp, 0x43); RCP_SetupDL(&gMasterDisp, 0x43);
Matrix_Copy(gCalcMatrix, &D_display_80161418[player->num]); Matrix_Copy(gCalcMatrix, &D_display_80161418[player->num]);
@ -948,7 +951,8 @@ void func_display_80054E80(Player* player) {
} }
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, sp94.x, sp94.y, sp94.z, MTXF_NEW); 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); Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_1024AC0); gSPDisplayList(gMasterDisp++, D_1024AC0);
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
@ -966,13 +970,15 @@ void func_display_80054E80(Player* player) {
Matrix_MultVec3f(gCalcMatrix, &spA0, &sp88); Matrix_MultVec3f(gCalcMatrix, &spA0, &sp88);
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, sp94.x, sp94.y, sp94.z, MTXF_NEW); 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); Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_1024AC0); gSPDisplayList(gMasterDisp++, D_1024AC0);
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, sp88.x, sp88.y, sp88.z, MTXF_NEW); 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); Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_1024AC0); gSPDisplayList(gMasterDisp++, D_1024AC0);
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
@ -1042,14 +1048,15 @@ void func_display_80055B58(Player* player) {
if ((player->unk_234 != 0) && (player->state_1C8 != PLAYERSTATE_1C8_DOWN)) { if ((player->unk_234 != 0) && (player->state_1C8 != PLAYERSTATE_1C8_DOWN)) {
switch (player->form) { switch (player->form) {
case FORM_ARWING: 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); MTXF_NEW);
Matrix_RotateX(gCalcMatrix, Matrix_RotateX(
-((player->unk_120 + player->unk_0E4 + player->unk_134 + player->unk_4D8) * M_DTOR), 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); MTXF_APPLY);
Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), Matrix_Translate(gCalcMatrix, player->xShake, player->yBob, 0.0f, MTXF_APPLY);
MTXF_APPLY);
Matrix_Translate(gCalcMatrix, player->unk_084, player->unk_080, 0.0f, MTXF_APPLY);
var_fv0 = player->unk_194 * 30.0f; var_fv0 = player->unk_194 * 30.0f;
if (var_fv0 > 30.0f) { if (var_fv0 > 30.0f) {
var_fv0 = 30.0f; var_fv0 = 30.0f;
@ -1062,7 +1069,7 @@ void func_display_80055B58(Player* player) {
Matrix_MultVec3f(gCalcMatrix, &sp4C, &sp40); Matrix_MultVec3f(gCalcMatrix, &sp4C, &sp40);
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, player->pos.x + sp40.x, player->pos.y + sp40.y, 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_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].camYaw, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].camPitch, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].camPitch, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp); Matrix_SetGfxMtx(&gMasterDisp);
@ -1102,17 +1109,17 @@ void func_display_80055E98(Player* player) {
sp5C = 108.0f; sp5C = 108.0f;
sp58 = -22.0f; sp58 = -22.0f;
} }
if (player->unk_25C != 0.0f) { if (player->contrailScale != 0.0f) {
sp54 = 0.0f; sp54 = 0.0f;
if ((gGameFrameCount % 2) != 0) { if ((gGameFrameCount % 2) != 0) {
sp54 = 180.0f; sp54 = 180.0f;
} }
var_fs0 = player->unk_0E8; var_fs0 = player->rot.y;
if (var_fs0 > 90.0f) { if (var_fs0 > 90.0f) {
var_fs0 -= 180.0f; var_fs0 -= 180.0f;
} }
var_fs0 = var_fs0 * 0.25f; 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) { if (player->state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) {
var_fs0 = 0.0f; var_fs0 = 0.0f;
sp50 = 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_Translate(gGfxMatrix, sp5C, sp58, -100.0f, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, M_DTOR * sp50, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, M_DTOR * sp50, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, -(M_DTOR * var_fs0), 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_Translate(gGfxMatrix, 0.0f, 0.0f, -17.5f, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, M_DTOR * sp54, 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_Translate(gGfxMatrix, -sp5C, sp58, -100.0f, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, M_DTOR * sp50, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, M_DTOR * sp50, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, -(M_DTOR * var_fs0), 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_Translate(gGfxMatrix, 0.0f, 0.0f, -17.5f, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, M_DTOR * sp54, 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) && if ((player->unk_234 != 0) && (player->form == FORM_ARWING) && (gCurrentLevel != LEVEL_VENOM_ANDROSS) &&
(gCurrentLevel != LEVEL_TRAINING) && (gLevelType == LEVELTYPE_PLANET)) { (gCurrentLevel != LEVEL_TRAINING) && (gLevelType == LEVELTYPE_PLANET)) {
Matrix_Push(&gGfxMatrix); 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);
Matrix_RotateY(gGfxMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); Matrix_RotateX(gGfxMatrix, -((player->xRot_120 + player->rot.x + player->aerobaticPitch) * M_DTOR), MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, -((player->bankAngle + player->rockAngle + player->damageShake) * M_DTOR),
Matrix_Translate(gGfxMatrix, player->unk_084, player->unk_080, 0.0f, MTXF_APPLY); MTXF_APPLY);
Matrix_Translate(gGfxMatrix, player->xShake, player->yBob, 0.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp); Matrix_SetGfxMtx(&gMasterDisp);
func_display_80055E98(player); func_display_80055E98(player);
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
@ -1193,19 +1201,19 @@ void func_display_800564C0(Player* player, s32 arg1) {
if (player->unk_234 != 0) { if (player->unk_234 != 0) {
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
if (player->form == FORM_LANDMASTER) { 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, 0.0f, gCameraShakeY, 0.0f, MTXF_APPLY);
} }
Matrix_Translate(gGfxMatrix, player->pos.x, player->pos.y + player->unk_18C + 30.0f, 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) { if (gVersusMode) {
for (i = 0; i < gCamCount; i++) { for (i = 0; i < gCamCount; i++) {
if (gVsLockOnTimers[player->num][i] != 0) { if (gVsLockOnTimers[player->num][i] != 0) {
Matrix_MultVec3f(gGfxMatrix, &sp50, &D_display_80161578[i]); Matrix_MultVec3f(gGfxMatrix, &sp50, &gLockOnTargetViewPos[i]);
if ((i == gPlayerNum) && if ((i == gPlayerNum) &&
((D_display_80161578[i].z > 300.0f) || (D_display_80161578[i].z < -8000.0f) || ((gLockOnTargetViewPos[i].z > 300.0f) || (gLockOnTargetViewPos[i].z < -8000.0f) ||
(fabsf(D_display_80161578[i].x) > (fabsf(D_display_80161578[i].z * 0.5f) + 100.0f)) || (fabsf(gLockOnTargetViewPos[i].x) > (fabsf(gLockOnTargetViewPos[i].z * 0.5f) + 100.0f)) ||
(fabsf(D_display_80161578[i].y)) > (fabsf(D_display_80161578[i].z * 0.5f) + 100.0f))) { (fabsf(gLockOnTargetViewPos[i].y)) > (fabsf(gLockOnTargetViewPos[i].z * 0.5f) + 100.0f))) {
gVsLockOnTimers[player->num][i] = 0; gVsLockOnTimers[player->num][i] = 0;
} }
@ -1216,18 +1224,18 @@ void func_display_800564C0(Player* player, s32 arg1) {
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
return; return;
} }
Matrix_RotateX(gGfxMatrix, (player->unk_0E4 + player->unk_134) * M_DTOR, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, (player->rot.x + player->damageShake) * M_DTOR, MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, (player->unk_0EC + player->unk_0F0 + player->unk_134) * M_DTOR, MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, (player->rot.z + player->rockAngle + player->damageShake) * M_DTOR, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_APPLY);
if (gVersusMode) { if (gVersusMode) {
Matrix_RotateX(gGfxMatrix, player->unk_000 * M_DTOR, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, player->unk_000 * M_DTOR, MTXF_APPLY);
} }
Matrix_RotateZ(gGfxMatrix, (-player->unk_12C - player->unk_130) * M_DTOR, MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, (-player->zRotBank - player->zRotBarrelRoll) * M_DTOR, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, player->unk_084, player->unk_080 - 30.0f, 0.0f, MTXF_APPLY); Matrix_Translate(gGfxMatrix, player->xShake, player->yBob - 30.0f, 0.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp); Matrix_SetGfxMtx(&gMasterDisp);
} else if (player->form == FORM_ON_FOOT) { } else if (player->form == FORM_ON_FOOT) {
Matrix_Push(&gGfxMatrix); 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)) { if (!func_display_800563B4(player->num, arg1)) {
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
@ -1235,22 +1243,24 @@ void func_display_800564C0(Player* player, s32 arg1) {
} }
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
Matrix_Translate(gCalcMatrix, player->pos.x, player->pos.y + gCameraShakeY, Matrix_Translate(gCalcMatrix, player->pos.x, player->pos.y + gCameraShakeY,
player->unk_138 + player->unk_144, MTXF_NEW); player->trueZpos + player->zPath, MTXF_NEW);
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_APPLY); MTXF_APPLY);
Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_134) * M_DTOR), MTXF_APPLY); Matrix_RotateX(gCalcMatrix, -((player->xRot_120 + player->rot.x + player->damageShake) * M_DTOR),
Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), MTXF_APPLY); 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);
} else { } 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) { if (gVersusMode) {
for (i = 0; i < gCamCount; i++) { for (i = 0; i < gCamCount; i++) {
if (gVsLockOnTimers[player->num][i] != 0) { if (gVsLockOnTimers[player->num][i] != 0) {
Matrix_MultVec3f(gGfxMatrix, &sp50, &D_display_80161578[i]); Matrix_MultVec3f(gGfxMatrix, &sp50, &gLockOnTargetViewPos[i]);
if ((i == gPlayerNum) && if ((i == gPlayerNum) &&
((D_display_80161578[i].z > 300.0f) || (D_display_80161578[i].z < -8000.0f) || ((gLockOnTargetViewPos[i].z > 300.0f) || (gLockOnTargetViewPos[i].z < -8000.0f) ||
(fabsf(D_display_80161578[i].x) > (fabsf(D_display_80161578[i].z * 0.5f) + 100.0f)) || (fabsf(gLockOnTargetViewPos[i].x) > (fabsf(gLockOnTargetViewPos[i].z * 0.5f) + 100.0f)) ||
(fabsf(D_display_80161578[i].y) > (fabsf(D_display_80161578[i].z * 0.5f) + 100.0f)))) { (fabsf(gLockOnTargetViewPos[i].y) > (fabsf(gLockOnTargetViewPos[i].z * 0.5f) + 100.0f)))) {
gVsLockOnTimers[player->num][i] = 0; gVsLockOnTimers[player->num][i] = 0;
} }
@ -1261,13 +1271,15 @@ void func_display_800564C0(Player* player, s32 arg1) {
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
return; 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); MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, Matrix_RotateX(
-((player->unk_120 + player->unk_0E4 + player->unk_4D8 + player->unk_134) * M_DTOR), 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); MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), MTXF_APPLY); Matrix_Translate(gGfxMatrix, player->xShake, player->yBob, 0.0f, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, player->unk_084, player->unk_080, 0.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp); Matrix_SetGfxMtx(&gMasterDisp);
} }
switch (player->unk_200) { switch (player->unk_200) {
@ -1293,7 +1305,7 @@ void func_display_800564C0(Player* player, s32 arg1) {
break; break;
} }
if (arg1 != 0) { if (arg1 != 0) {
func_edisplay_800596C0(); Object_ApplyWaterDistortion();
} else { } else {
Matrix_Copy(&D_display_80161418[player->num], gGfxMatrix); 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)) { if ((player->unk_234 != 0) && (player->unk_240 == 0)) {
sp34 = D_display_800CA334[gGameFrameCount % 8U]; sp34 = D_display_800CA334[gGameFrameCount % 8U];
sp30 = D_display_800CA334[(gGameFrameCount + 4) % 8U]; sp30 = D_display_800CA334[(gGameFrameCount + 4) % 8U];
if (player->unk_1D4 != 0) { if (player->grounded) {
sp34 = sp30 = 0.0f; sp34 = sp30 = 0.0f;
} }
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
if (gLevelMode == LEVELMODE_ALL_RANGE) { if (gLevelMode == LEVELMODE_ALL_RANGE) {
if (player->form == FORM_ON_FOOT) { 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 { } 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 { } else {
Matrix_Translate(gGfxMatrix, player->unk_064, player->unk_068 + 2.0f, player->unk_06C + player->unk_144, Matrix_Translate(gGfxMatrix, player->groundPos.x, player->groundPos.y + 2.0f,
MTXF_APPLY); 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_RotateX(gGfxMatrix, player->unk_248, MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, player->unk_24C, MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, player->unk_24C, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, 0.8f + sp34, 0.0f, 0.8f + sp30, 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)) { 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))) { if (((sp2C > 70.0f) && (sp2C < 110.0f)) || ((sp2C < -70.0f) && (sp2C > -110.0f))) {
sp2C = 70.0f; sp2C = 70.0f;
} }
Matrix_RotateY(gGfxMatrix, -player->unk_070, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, -player->groundRotY, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134) * M_DTOR, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, (player->yRot_114 + player->rot.y + player->damageShake) * M_DTOR, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, Matrix_RotateX(
-((player->unk_120 + player->unk_0E4 + player->unk_4D8 + player->unk_134) * M_DTOR), gGfxMatrix,
MTXF_APPLY); -((player->xRot_120 + player->rot.x + player->aerobaticPitch + player->damageShake) * M_DTOR),
MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, M_DTOR * sp2C, MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, M_DTOR * sp2C, MTXF_APPLY);
} else { } else {
Matrix_RotateY(gGfxMatrix, player->unk_114 * M_DTOR, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, player->yRot_114 * M_DTOR, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, (player->unk_0E4 + player->unk_4D8 + player->unk_134) * M_DTOR, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, (player->rot.x + player->aerobaticPitch + player->damageShake) * M_DTOR,
Matrix_RotateZ(gGfxMatrix, (player->unk_0EC + player->unk_0F0 + player->unk_134) * M_DTOR, MTXF_APPLY); MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, player->unk_0E8 * M_DTOR, MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, (player->rot.z + player->rockAngle + player->damageShake) * M_DTOR, MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, (-player->unk_12C - player->unk_130) * 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); func_display_80054300(player);
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
@ -1407,8 +1423,8 @@ void func_display_80057504(void) {
f32 var_fs0; f32 var_fs0;
for (i = 0; i < gCamCount; i++) { for (i = 0; i < gCamCount; i++) {
if (D_display_80161578[i].z < 0.0f) { if (gLockOnTargetViewPos[i].z < 0.0f) {
var_fs0 = (VEC3F_MAG(&D_display_80161578[i])); var_fs0 = (VEC3F_MAG(&gLockOnTargetViewPos[i]));
if (var_fs0 < 20000.0f) { if (var_fs0 < 20000.0f) {
var_fs0 *= 0.0015f; var_fs0 *= 0.0015f;
if (var_fs0 > 100.0f) { if (var_fs0 > 100.0f) {
@ -1418,8 +1434,8 @@ void func_display_80057504(void) {
var_fs0 = 1.2f; var_fs0 = 1.2f;
} }
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, D_display_80161578[i].x, D_display_80161578[i].y, D_display_80161578[i].z, Matrix_Translate(gGfxMatrix, gLockOnTargetViewPos[i].x, gLockOnTargetViewPos[i].y,
MTXF_APPLY); gLockOnTargetViewPos[i].z, MTXF_APPLY);
if ((gPlayState != PLAY_PAUSE) && (i == gPlayerNum)) { if ((gPlayState != PLAY_PAUSE) && (i == gPlayerNum)) {
Math_SmoothStepToF(&D_display_801615A8[i], 0.0f, 0.5f, 20.0f, 0); 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); 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++) { for (j = 0; j < gCamCount; j++) {
D_display_80161578[j].x = D_display_80161578[j].y = 0.f; gLockOnTargetViewPos[j].x = gLockOnTargetViewPos[j].y = 0.f;
D_display_80161578[j].z = 100.0f; gLockOnTargetViewPos[j].z = 100.0f;
} }
} }
@ -1449,7 +1465,7 @@ void func_display_80057814(Player* player) {
sp20.x = player->pos.x; sp20.x = player->pos.x;
sp20.y = player->pos.y; sp20.y = player->pos.y;
sp20.z = player->unk_138; sp20.z = player->trueZpos;
sp2C.x = player->sfxSource[0]; sp2C.x = player->sfxSource[0];
sp2C.y = player->sfxSource[1]; sp2C.y = player->sfxSource[1];
sp2C.z = player->sfxSource[2]; sp2C.z = player->sfxSource[2];
@ -1460,7 +1476,7 @@ void func_display_80057814(Player* player) {
player->sfx.srcVel = player->sfxVel; player->sfx.srcVel = player->sfxVel;
player->sfx.srcPos = player->sfxSource; player->sfx.srcPos = player->sfxSource;
player->sfx.yVel = player->vel.y; player->sfx.yVel = player->vel.y;
player->sfx.zRot = player->unk_0F8; player->sfx.zRot = player->bankAngle;
} }
void func_display_800578C4(Player* player) { void func_display_800578C4(Player* player) {
@ -1483,14 +1499,14 @@ void func_display_800578C4(Player* player) {
case 1: case 1:
case 2: case 2:
case 3: case 3:
sp38 = Math_RadToDeg(player->camPitch) + player->unk_0E4; sp38 = Math_RadToDeg(player->camPitch) + player->rot.x;
if (sp38 > 360.0f) { if (sp38 > 360.0f) {
sp38 -= 360.0f; sp38 -= 360.0f;
} }
if (sp38 < 0.0f) { if (sp38 < 0.0f) {
sp38 += 360.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) { if (sp3C > 360.0f) {
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_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); Math_SmoothStepToF(&D_display_800CA388, D_display_800CA38C[D_display_800CA220], 0.1f, 10.0f, 0.0f);
sp4C.z = D_display_800CA388; sp4C.z = D_display_800CA388;
Matrix_RotateX(gCalcMatrix, (player->unk_0E8 + D_display_800CA380) * M_DTOR, MTXF_NEW); Matrix_RotateX(gCalcMatrix, (player->rot.y + D_display_800CA380) * M_DTOR, MTXF_NEW);
Matrix_RotateY(gCalcMatrix, (player->unk_0E4 + D_display_800CA384) * M_DTOR, MTXF_APPLY); Matrix_RotateY(gCalcMatrix, (player->rot.x + D_display_800CA384) * M_DTOR, MTXF_APPLY);
Matrix_MultVec3f(gCalcMatrix, &sp4C, &sp40); Matrix_MultVec3f(gCalcMatrix, &sp4C, &sp40);
gPlayerCamEye.x = player->pos.x + sp40.x; gPlayerCamEye.x = player->pos.x + sp40.x;
gPlayerCamEye.y = player->pos.y + sp40.y + 20.0f; 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.x = (SIN_DEG(gGameFrameCount * 3.0f) * 3.0f) + player->pos.x;
gPlayerCamAt.y = (COS_DEG(gGameFrameCount * 4.0f) * 3.0f) + player->pos.y; 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; break;
} }
} }
@ -1546,24 +1562,24 @@ void Play_Draw(void) {
Lights_SetOneLight(&gMasterDisp, gLight1x, gLight1y, gLight1z, gLight1R, gLight1G, gLight1B, gAmbientR, gAmbientG, Lights_SetOneLight(&gMasterDisp, gLight1x, gLight1y, gLight1z, gLight1R, gLight1G, gLight1B, gAmbientR, gAmbientG,
gAmbientB); gAmbientB);
if (gLevelMode == LEVELMODE_ON_RAILS) { if (gLevelMode == LEVELMODE_ON_RAILS) {
Matrix_RotateY(gCalcMatrix, player->unk_114 * M_DTOR, MTXF_NEW); Matrix_RotateY(gCalcMatrix, player->yRot_114 * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, player->unk_120 * M_DTOR, MTXF_APPLY); Matrix_RotateX(gCalcMatrix, player->xRot_120 * M_DTOR, MTXF_APPLY);
tempVec.x = player->cam.eye.x - player->pos.x; tempVec.x = player->cam.eye.x - player->pos.x;
tempVec.y = player->cam.eye.y - player->pos.y; 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); Matrix_MultVec3f(gCalcMatrix, &tempVec, &gPlayerCamEye);
gPlayerCamEye.x += player->pos.x; gPlayerCamEye.x += player->pos.x;
gPlayerCamEye.y += player->pos.y; 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.x = player->cam.at.x - player->pos.x;
tempVec.y = player->cam.at.y - player->pos.y; 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); Matrix_MultVec3f(gCalcMatrix, &tempVec, &gPlayerCamAt);
gPlayerCamAt.x += player->pos.x; gPlayerCamAt.x += player->pos.x;
gPlayerCamAt.y += player->pos.y; 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)) { if (player->cockpitView && (player->boostSpeed > 5.0f)) {
gPlayerCamAt.x += SIN_DEG(gGameFrameCount * 150.0f) * player->boostSpeed * 0.2f; gPlayerCamAt.x += SIN_DEG(gGameFrameCount * 150.0f) * player->boostSpeed * 0.2f;
@ -1605,8 +1621,8 @@ void Play_Draw(void) {
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, 0.0f, gCameraShakeY, 0.0f, MTXF_APPLY); Matrix_Translate(gGfxMatrix, 0.0f, gCameraShakeY, 0.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp); Matrix_SetGfxMtx(&gMasterDisp);
Ground_801B58AC(&gMasterDisp, D_ctx_80177CC8); Ground_801B58AC(&gMasterDisp, gPathGroundScroll);
D_ctx_80177CC8 = 0.0f; gPathGroundScroll = 0.0f;
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
} else if (gGroundSurface != SURFACE_WATER) { } else if (gGroundSurface != SURFACE_WATER) {
D_bg_8015F964 = false; D_bg_8015F964 = false;
@ -1618,7 +1634,7 @@ void Play_Draw(void) {
for (i = 0, opponent = gPlayer; i < gCamCount; i++, opponent++) { for (i = 0, opponent = gPlayer; i < gCamCount; i++, opponent++) {
opponentPos.x = opponent->pos.x; opponentPos.x = opponent->pos.x;
opponentPos.y = opponent->pos.y; opponentPos.y = opponent->pos.y;
opponentPos.z = opponent->unk_138; opponentPos.z = opponent->trueZpos;
Display_SetSecondLight(&opponentPos); Display_SetSecondLight(&opponentPos);
func_display_800564C0(opponent, 0); func_display_800564C0(opponent, 0);
func_display_80057814(opponent); func_display_80057814(opponent);
@ -1631,7 +1647,7 @@ void Play_Draw(void) {
for (i = 0, opponent = gPlayer; i < gCamCount; i++, opponent++) { for (i = 0, opponent = gPlayer; i < gCamCount; i++, opponent++) {
opponentPos.x = opponent->pos.x; opponentPos.x = opponent->pos.x;
opponentPos.y = opponent->pos.y; opponentPos.y = opponent->pos.y;
opponentPos.z = opponent->unk_138; opponentPos.z = opponent->trueZpos;
func_display_800564C0(opponent, 1); func_display_800564C0(opponent, 1);
} }
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);

View File

@ -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_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_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_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_TI_SKULL, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, 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_TI_RIB_0, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, 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_TI_RIB_1, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, 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_TI_RIB_2, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, 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_TI_RIB_3, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, 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_TI_RIB_4, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, 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_TI_RIB_5, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, 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_TI_RIB_6, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, 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_TI_RIB_7, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, 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_TI_RIB_8, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, 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_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_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_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_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_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 }, /* 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_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_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_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_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_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 }, /* 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_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_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_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_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_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 }, /* 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_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_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_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_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_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 }, /* OBJ_ACTOR_TEAM_BOSS */ {(void*) ActorAllRange_Draw, 1, (ObjectFunc) ActorTeamBoss_Update, gTeamHitbox, 20000.0f, 0, 0, 39, 1, 0.0f, 0 },

View File

@ -23,14 +23,14 @@
#include "assets/ast_zoness.h" #include "assets/ast_zoness.h"
Vec3f D_edisplay_801615D0; Vec3f D_edisplay_801615D0;
Vec3f D_edisplay_801615E0; Vec3f sViewPos;
s32 D_edisplay_801615EC; s32 sDrewActor;
Matrix D_edisplay_801615F0; Matrix D_edisplay_801615F0;
WingInfo D_edisplay_80161630; WingInfo D_edisplay_80161630;
char D_edisplay_800CF970[] = "$Id: fox_edisplay.c,v 1.196 1997/05/08 08:31:50 morita Exp $"; 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_RotateZ(gGfxMatrix, gGameFrameCount * 13.0f * M_DTOR, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, 1.02f, 0.98f, 1.0f, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 1.02f, 0.98f, 1.0f, MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, -(f32) gGameFrameCount * 13.0f * M_DTOR, 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); Matrix_SetGfxMtx(&gMasterDisp);
} }
void func_edisplay_800597C0(s32 arg0) { void Object_SetCullDirection(s32 arg0) {
if (arg0 < 0) { if (arg0 < 0) {
gSPSetGeometryMode(gMasterDisp++, G_CULL_FRONT); gSPSetGeometryMode(gMasterDisp++, G_CULL_FRONT);
gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK);
@ -56,7 +56,7 @@ void Sprite168_Draw(Sprite168* this) {
RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); 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) { void Actor201_Draw(Actor201* this) {
@ -65,7 +65,7 @@ void Actor201_Draw(Actor201* this) {
RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); 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 sp24;
Vec3f sp18; Vec3f sp18;
@ -95,18 +95,18 @@ void Actor202_Draw(Actor202* this) {
Matrix_Translate(gGfxMatrix, 0.f, -temp, 0.0f, MTXF_APPLY); Matrix_Translate(gGfxMatrix, 0.f, -temp, 0.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp); Matrix_SetGfxMtx(&gMasterDisp);
Animation_GetFrameData(&D_ME_601E8C4, this->unk_0B6, sp30); 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); gSPDisplayList(gMasterDisp++, D_ME_601AE40);
} }
void func_edisplay_80059B20(Scenery* scenery) { void Scenery_DrawTitaniaBones(Scenery* scenery) {
if (scenery->obj.id == OBJ_SCENERY_29) { if (scenery->obj.id == OBJ_SCENERY_TI_SKULL) {
gSPDisplayList(gMasterDisp++, D_TI1_7007350); gSPDisplayList(gMasterDisp++, D_TI1_7007350);
} else { } else {
Graphics_SetScaleMtx(D_edisplay_800CF9B0[scenery->obj.id + 2]); Graphics_SetScaleMtx(D_edisplay_800CFA2C[scenery->obj.id - 29]);
gSPDisplayList(gMasterDisp++, D_TI1_700BB10); gSPDisplayList(gMasterDisp++, D_TI1_700BB10);
} }
} }
@ -114,7 +114,7 @@ void func_edisplay_80059B20(Scenery* scenery) {
void func_edisplay_80059BB0(void* arg0) { void func_edisplay_80059BB0(void* arg0) {
} }
void Obj42_Draw(Scenery_42* this) { void Scenery42_Draw(Scenery_42* this) {
gSPDisplayList(gMasterDisp++, D_CO_6023AC0); 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) || (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_VENOM_2) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE)) &&
(gCurrentLevel != LEVEL_MACBETH) && (gCurrentLevel != LEVEL_TITANIA)) { (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) && if (((gCurrentLevel == LEVEL_VENOM_2) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) &&
(actor->index == 10)) || (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_KATINA) && (actor->index == 1)) ||
((gCurrentLevel == LEVEL_SECTOR_Y) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_STANDBY) && ((gCurrentLevel == LEVEL_SECTOR_Y) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_STANDBY) &&
(actor->state == 5))) { (actor->state == 5))) {
@ -634,7 +634,7 @@ void func_edisplay_8005BAB4(ObjectId objId, s32 index) {
} }
RCP_SetupDL(&gMasterDisp, 0x40); RCP_SetupDL(&gMasterDisp, 0x40);
break; break;
case OBJ_ACTOR_195: case OBJ_ACTOR_CUTSCENE:
case OBJ_ACTOR_TEAM_BOSS: case OBJ_ACTOR_TEAM_BOSS:
case OBJ_ACTOR_EVENT: case OBJ_ACTOR_EVENT:
switch (gActors[index].unk_0B4) { switch (gActors[index].unk_0B4) {
@ -782,7 +782,7 @@ void ItemCheckpoint_Draw(ItemCheckpoint* this) {
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
Matrix_RotateZ(gGfxMatrix, i * 45.0f * M_DTOR, MTXF_APPLY); 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); Matrix_RotateZ(gGfxMatrix, (gGameFrameCount + (i * 110.0f)) * M_DTOR * 7.2f * this->unk_54, MTXF_APPLY);
Graphics_SetScaleMtx(2.0f * this->unk_50); Graphics_SetScaleMtx(2.0f * this->unk_50);
gSPDisplayList(gMasterDisp++, D_101CAE0); gSPDisplayList(gMasterDisp++, D_101CAE0);
@ -795,7 +795,7 @@ void ItemSilverRing_Draw(ItemSilverRing* this) {
RCP_SetupDL(&gMasterDisp, 0x1D); RCP_SetupDL(&gMasterDisp, 0x1D);
gSPTexture(gMasterDisp++, 3000, 0, 0, G_TX_RENDERTILE, G_ON); gSPTexture(gMasterDisp++, 3000, 0, 0, G_TX_RENDERTILE, G_ON);
gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR); gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR);
Graphics_SetScaleMtx(this->scale); Graphics_SetScaleMtx(this->width);
gSPDisplayList(gMasterDisp++, D_101A570); gSPDisplayList(gMasterDisp++, D_101A570);
gSPClearGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR); gSPClearGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR);
} }
@ -804,7 +804,7 @@ void ItemSilverStar_Draw(ItemSilverStar* this) {
RCP_SetupDL(&gMasterDisp, 0x1D); RCP_SetupDL(&gMasterDisp, 0x1D);
gSPTexture(gMasterDisp++, 3000, 0, 0, G_TX_RENDERTILE, G_ON); gSPTexture(gMasterDisp++, 3000, 0, 0, G_TX_RENDERTILE, G_ON);
gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR); gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR);
Graphics_SetScaleMtx(this->scale); Graphics_SetScaleMtx(this->width);
gSPDisplayList(gMasterDisp++, D_1019CA0); gSPDisplayList(gMasterDisp++, D_1019CA0);
gSPClearGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR); gSPClearGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR);
} }
@ -813,17 +813,17 @@ void ItemGoldRing_Draw(ItemGoldRing* this) {
RCP_SetupDL(&gMasterDisp, 0x1D); RCP_SetupDL(&gMasterDisp, 0x1D);
gSPTexture(gMasterDisp++, 1900, 1700, 0, G_TX_RENDERTILE, G_ON); gSPTexture(gMasterDisp++, 1900, 1700, 0, G_TX_RENDERTILE, G_ON);
gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR); gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR);
Graphics_SetScaleMtx(this->scale); Graphics_SetScaleMtx(this->width);
gSPDisplayList(gMasterDisp++, D_1016870); gSPDisplayList(gMasterDisp++, D_1016870);
gSPClearGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR); gSPClearGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR);
} }
void ItemBomb_Draw(ItemBomb* this) { void ItemBomb_Draw(ItemBomb* this) {
if (gCurrentLevel == LEVEL_AQUAS) { if (gCurrentLevel == LEVEL_AQUAS) {
Graphics_SetScaleMtx(this->scale); Graphics_SetScaleMtx(this->width);
gSPDisplayList(gMasterDisp++, D_blue_marine_3005980); gSPDisplayList(gMasterDisp++, D_blue_marine_3005980);
} else { } else {
Graphics_SetScaleMtx(this->scale * 0.1f); Graphics_SetScaleMtx(this->width * 0.1f);
RCP_SetupDL(&gMasterDisp, 0x1D); RCP_SetupDL(&gMasterDisp, 0x1D);
gSPTexture(gMasterDisp++, 2000, 2000, 0, G_TX_RENDERTILE, G_ON); gSPTexture(gMasterDisp++, 2000, 2000, 0, G_TX_RENDERTILE, G_ON);
gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN); gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN);
@ -836,7 +836,7 @@ void ItemBomb_Draw(ItemBomb* this) {
} }
void ItemLasers_Draw(ItemLasers* this) { void ItemLasers_Draw(ItemLasers* this) {
Graphics_SetScaleMtx(this->scale * 0.1f); Graphics_SetScaleMtx(this->width * 0.1f);
RCP_SetupDL(&gMasterDisp, 0x1D); RCP_SetupDL(&gMasterDisp, 0x1D);
gSPTexture(gMasterDisp++, 2000, 2000, 0, G_TX_RENDERTILE, G_ON); gSPTexture(gMasterDisp++, 2000, 2000, 0, G_TX_RENDERTILE, G_ON);
gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN); gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN);
@ -851,7 +851,7 @@ void ItemMeteoWarp_Draw(ItemMeteoWarp* this) {
s32 i; s32 i;
this->obj.rot.y = (Math_Atan2F(gPlayer[gPlayerNum].cam.eye.x - this->obj.pos.x, 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) / 180.0f) /
M_PI; M_PI;
if (this->state != 0) { if (this->state != 0) {
@ -864,7 +864,7 @@ void ItemMeteoWarp_Draw(ItemMeteoWarp* this) {
for (i = 0; i < 7; i++) { for (i = 0; i < 7; i++) {
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
Matrix_RotateZ(gGfxMatrix, (i * 360.0f / 7.0f) * M_DTOR, MTXF_APPLY); 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); Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_102FE80); gSPDisplayList(gMasterDisp++, D_102FE80);
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
@ -874,7 +874,7 @@ void ItemMeteoWarp_Draw(ItemMeteoWarp* this) {
void func_edisplay_8005D008(Object* obj, s32 drawType) { void func_edisplay_8005D008(Object* obj, s32 drawType) {
if (drawType == 2) { 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_Translate(gCalcMatrix, obj->pos.x, obj->pos.y, obj->pos.z, MTXF_NEW);
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); 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_RotateX(gCalcMatrix, obj->rot.x * M_DTOR, MTXF_APPLY);
Matrix_RotateZ(gCalcMatrix, obj->rot.z * M_DTOR, MTXF_APPLY); Matrix_RotateZ(gCalcMatrix, obj->rot.z * M_DTOR, MTXF_APPLY);
} else { } 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_Copy(&D_edisplay_801615F0, gGfxMatrix);
Matrix_RotateY(gGfxMatrix, obj->rot.y * M_DTOR, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, obj->rot.y * M_DTOR, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, obj->rot.x * 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) { void func_edisplay_8005D1F0(Object* obj, s32 drawType) {
if (drawType == 2) { 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_Translate(gCalcMatrix, obj->pos.x, obj->pos.y, obj->pos.z, MTXF_NEW);
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); 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_RotateX(gCalcMatrix, obj->rot.x * M_DTOR, MTXF_APPLY);
Matrix_RotateZ(gCalcMatrix, obj->rot.z * M_DTOR, MTXF_APPLY); Matrix_RotateZ(gCalcMatrix, obj->rot.z * M_DTOR, MTXF_APPLY);
} else { } 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_Copy(&D_edisplay_801615F0, gGfxMatrix);
Matrix_RotateY(gGfxMatrix, obj->rot.y * M_DTOR, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, obj->rot.y * M_DTOR, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, obj->rot.x * 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) { void func_edisplay_8005D3CC(Object* obj, f32 xRot, f32 yRot, f32 zRot, s32 drawType) {
if (drawType == 2) { 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_Translate(gCalcMatrix, obj->pos.x, obj->pos.y, obj->pos.z, MTXF_NEW);
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); 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_RotateX(gCalcMatrix, obj->rot.x * M_DTOR, MTXF_APPLY);
Matrix_RotateZ(gCalcMatrix, obj->rot.z * M_DTOR, MTXF_APPLY); Matrix_RotateZ(gCalcMatrix, obj->rot.z * M_DTOR, MTXF_APPLY);
} else { } 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_Copy(&D_edisplay_801615F0, gGfxMatrix);
Matrix_RotateY(gGfxMatrix, M_DTOR * yRot, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, M_DTOR * yRot, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, M_DTOR * xRot, 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); RCP_SetupDL_57(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar);
gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK);
if (arg1 < 0) { if (arg1 < 0) {
func_edisplay_800596C0(); Object_ApplyWaterDistortion();
} }
gSPDisplayList(gMasterDisp++, this->info.dList); gSPDisplayList(gMasterDisp++, this->info.dList);
RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); 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); RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar);
} }
func_edisplay_800597C0(arg1); Object_SetCullDirection(arg1);
if (arg1 < 0) { if (arg1 < 0) {
func_edisplay_800596C0(); Object_ApplyWaterDistortion();
} }
gSPDisplayList(gMasterDisp++, this->info.dList); gSPDisplayList(gMasterDisp++, this->info.dList);
if (this->obj.id == OBJ_SCENERY_8) { if (this->obj.id == OBJ_SCENERY_8) {
@ -971,7 +971,7 @@ void Scenery_Draw(Scenery* this, s32 arg1) {
} }
} }
} else if (this->info.draw != NULL) { } else if (this->info.draw != NULL) {
func_edisplay_800597C0(arg1); Object_SetCullDirection(arg1);
this->info.draw(&this->obj); this->info.draw(&this->obj);
} }
} }
@ -1027,9 +1027,9 @@ void Actor_DrawOnRails(Actor* this) {
} }
} }
if ((this->lockOnTimers[TEAM_ID_FOX] != 0) && (gReflectY > 0)) { if ((this->lockOnTimers[TEAM_ID_FOX] != 0) && (gReflectY > 0)) {
sp34.y += this->info.unk_1C; sp34.y += this->info.targetOffset;
Matrix_MultVec3f(gGfxMatrix, &sp34, &D_display_80161578[0]); Matrix_MultVec3f(gGfxMatrix, &sp34, &gLockOnTargetViewPos[TEAM_ID_FOX]);
if (D_display_80161578[0].z > -200.0f) { if (gLockOnTargetViewPos[TEAM_ID_FOX].z > -200.0f) {
this->lockOnTimers[TEAM_ID_FOX] = 0; this->lockOnTimers[TEAM_ID_FOX] = 0;
} }
} }
@ -1038,20 +1038,20 @@ void Actor_DrawOnRails(Actor* this) {
} }
void Actor_DrawAllRange(Actor* this) { void Actor_DrawAllRange(Actor* this) {
s32 var_v1; s32 playerNum;
Vec3f sp50 = { 0.0f, 0.0f, 0.0f }; Vec3f sp50 = { 0.0f, 0.0f, 0.0f };
f32 var_fa1; f32 var_fa1;
f32 var_ft5; f32 var_ft5;
f32 var_fv0; f32 var_fv0;
f32 var_fv1; f32 var_fv1;
D_edisplay_801615EC = 0; sDrewActor = false;
if (this->info.drawType == 2) { 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_Translate(gCalcMatrix, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, MTXF_NEW);
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY);
Matrix_MultVec3f(gGfxMatrix, &sp50, &D_edisplay_801615E0); Matrix_MultVec3f(gGfxMatrix, &sp50, &sViewPos);
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
var_fv0 = 0.0f; var_fv0 = 0.0f;
var_fv1 = -12000.0f; var_fv1 = -12000.0f;
@ -1059,28 +1059,28 @@ void Actor_DrawAllRange(Actor* this) {
var_fv0 = 1000.0f; var_fv0 = 1000.0f;
var_fv1 = -25000.0f; var_fv1 = -25000.0f;
} }
if ((var_fv0 > D_edisplay_801615E0.z) && (D_edisplay_801615E0.z > var_fv1)) { if ((var_fv0 > sViewPos.z) && (sViewPos.z > var_fv1)) {
if (fabsf(D_edisplay_801615E0.x) < (fabsf(D_edisplay_801615E0.z * 0.5f) + 500.0f)) { if (fabsf(sViewPos.x) < (fabsf(sViewPos.z * 0.5f) + 500.0f)) {
if (fabsf(D_edisplay_801615E0.y) < (fabsf(D_edisplay_801615E0.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_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_APPLY);
Matrix_RotateX(gCalcMatrix, this->obj.rot.x * 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); Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY);
this->info.draw(&this->obj); 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) && if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (this->obj.id == OBJ_ACTOR_ALLRANGE) &&
(this->aiType == AI360_MISSILE)) { (this->aiType == AI360_MISSILE)) {
gTeamArrowsViewPos[0] = D_edisplay_801615E0; gTeamArrowsViewPos[0] = sViewPos;
} }
} }
} }
} }
} else { } else {
Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, MTXF_APPLY); 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) || if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) ||
(gPlayer[0].state_1C8 == PLAYERSTATE_1C8_STANDBY) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_STANDBY) ||
((this->obj.id == OBJ_ACTOR_ALLRANGE) && (this->aiType >= AI360_GREAT_FOX)) || ((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_ft5 = var_fv0 = 3000.0f;
var_fv1 = -29000.0f; var_fv1 = -29000.0f;
var_fa1 = 0.7f; var_fa1 = 0.7f;
@ -1090,45 +1090,45 @@ void Actor_DrawAllRange(Actor* this) {
var_fv1 = -20000.0f; var_fv1 = -20000.0f;
var_fa1 = 0.5f; var_fa1 = 0.5f;
} }
if ((var_fv0 > D_edisplay_801615E0.z) && (D_edisplay_801615E0.z > var_fv1)) { if ((var_fv0 > sViewPos.z) && (sViewPos.z > var_fv1)) {
if (fabsf(D_edisplay_801615E0.x) < (fabsf(D_edisplay_801615E0.z * var_fa1) + var_ft5)) { if (fabsf(sViewPos.x) < (fabsf(sViewPos.z * var_fa1) + var_ft5)) {
if (fabsf(D_edisplay_801615E0.y) < (fabsf(D_edisplay_801615E0.z * var_fa1) + var_ft5)) { if (fabsf(sViewPos.y) < (fabsf(sViewPos.z * var_fa1) + var_ft5)) {
if (this->info.draw != NULL) { if (this->info.draw != NULL) {
Matrix_RotateY(gGfxMatrix, this->obj.rot.y * M_DTOR, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, this->obj.rot.y * M_DTOR, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, this->obj.rot.x * 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_RotateZ(gGfxMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp); Matrix_SetGfxMtx(&gMasterDisp);
this->info.draw(&this->obj); this->info.draw(&this->obj);
D_edisplay_801615EC = 1; sDrewActor = true;
if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) &&
(((this->obj.id == OBJ_ACTOR_ALLRANGE) && (((this->obj.id == OBJ_ACTOR_ALLRANGE) &&
((this->aiType <= AI360_PEPPY) || (this->aiType == AI360_KATT) || ((this->aiType <= AI360_PEPPY) || (this->aiType == AI360_KATT) ||
(this->aiType == AI360_BILL))) || (this->aiType == AI360_BILL))) ||
(this->obj.id == OBJ_ACTOR_TEAM_BOSS))) { (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; this->lockOnTimers[gPlayerNum] = 0;
if ((this->obj.id == OBJ_ACTOR_189) || (this->obj.id == OBJ_ACTOR_286)) { if ((this->obj.id == OBJ_ACTOR_189) || (this->obj.id == OBJ_ACTOR_286)) {
Object_Kill(&this->obj, this->sfxSource); Object_Kill(&this->obj, this->sfxSource);
} }
} }
for (var_v1 = 0; var_v1 < gCamCount; var_v1++) { for (playerNum = 0; playerNum < gCamCount; playerNum++) {
if (this->lockOnTimers[var_v1] != 0) { if (this->lockOnTimers[playerNum] != 0) {
D_display_80161578[var_v1] = D_edisplay_801615E0; gLockOnTargetViewPos[playerNum] = sViewPos;
D_display_80161578[var_v1].y += this->info.unk_1C; gLockOnTargetViewPos[playerNum].y += this->info.targetOffset;
if ((var_v1 == gPlayerNum) && (D_display_80161578[var_v1].z > -300.0f)) { if ((playerNum == gPlayerNum) && (gLockOnTargetViewPos[playerNum].z > -300.0f)) {
this->lockOnTimers[var_v1] = 0; this->lockOnTimers[playerNum] = 0;
} }
} }
} }
func_edisplay_8005F290(this->sfxSource, &D_edisplay_801615E0); func_edisplay_8005F290(this->sfxSource, &sViewPos);
this->iwork[24] = D_edisplay_801615EC; this->iwork[24] = sDrewActor;
} }
void Boss_Draw(Boss* this, s32 arg1) { void Boss_Draw(Boss* this, s32 arg1) {
@ -1177,7 +1177,7 @@ void Boss_Draw(Boss* this, s32 arg1) {
Matrix_SetGfxMtx(&gMasterDisp); Matrix_SetGfxMtx(&gMasterDisp);
} }
if (arg1 < 0) { if (arg1 < 0) {
func_edisplay_800596C0(); Object_ApplyWaterDistortion();
} }
this->info.draw(&this->obj); this->info.draw(&this->obj);
} }
@ -1214,22 +1214,22 @@ void Effect_DrawOnRails(Effect* this, s32 arg1) {
void Effect_DrawAllRange(Effect* this) { void Effect_DrawAllRange(Effect* this) {
Vec3f sp4C = { 0.0f, 0.0f, 0.0f }; Vec3f sp4C = { 0.0f, 0.0f, 0.0f };
Vec3f sp40; Vec3f sp40;
f32 var_fv0; f32 minZ;
u8 sp3B = 0; u8 drawn = false;
if (this->info.unk_14 == -1) { 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); MTXF_APPLY);
} else { } 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); Matrix_MultVec3f(gGfxMatrix, &sp4C, &sp40);
if ((gCurrentLevel == LEVEL_SECTOR_Z) || (gCurrentLevel == LEVEL_BOLSE)) { if ((gCurrentLevel == LEVEL_SECTOR_Z) || (gCurrentLevel == LEVEL_BOLSE)) {
var_fv0 = -20000.0f; minZ = -20000.0f;
} else { } 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.x) < (fabsf(sp40.z * 0.5f) + 500.0f)) {
if (fabsf(sp40.y) < (fabsf(sp40.z * 0.5f) + 500.0f)) { if (fabsf(sp40.y) < (fabsf(sp40.z * 0.5f) + 500.0f)) {
if (this->info.draw != NULL) { if (this->info.draw != NULL) {
@ -1239,12 +1239,12 @@ void Effect_DrawAllRange(Effect* this) {
Matrix_SetGfxMtx(&gMasterDisp); Matrix_SetGfxMtx(&gMasterDisp);
this->info.draw(&this->obj); this->info.draw(&this->obj);
} }
sp3B = 1; drawn = true;
} }
} }
} }
func_edisplay_8005F290(this->sfxSource, &sp40); 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); Object_Kill(&this->obj, this->sfxSource);
} }
} }
@ -1252,12 +1252,12 @@ void Effect_DrawAllRange(Effect* this) {
void Item_Draw(Item* this, s32 arg1) { void Item_Draw(Item* this, s32 arg1) {
Vec3f sp44 = { 0.0f, 0.0f, 0.0f }; Vec3f sp44 = { 0.0f, 0.0f, 0.0f };
Vec3f sp38; 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); Matrix_MultVec3f(gGfxMatrix, &sp44, &sp38);
var_v0 = 0; drawn = false;
if ((sp38.z < 0.0f) && (sp38.z > -12000.0f)) { if ((0.0f > sp38.z) && (sp38.z > -12000.0f)) {
if (fabsf(sp38.x) < (fabsf(sp38.z * 0.5f) + 500.0f)) { if (fabsf(sp38.x) < (fabsf(sp38.z * 0.5f) + 500.0f)) {
if (fabsf(sp38.y) < (fabsf(sp38.z * 0.5f) + 500.0f)) { if (fabsf(sp38.y) < (fabsf(sp38.z * 0.5f) + 500.0f)) {
if (this->info.draw != NULL) { if (this->info.draw != NULL) {
@ -1271,12 +1271,12 @@ void Item_Draw(Item* this, s32 arg1) {
this->info.draw(&this->obj); this->info.draw(&this->obj);
} }
} }
var_v0 = 1; drawn = true;
} }
} }
} }
func_edisplay_8005F290(this->sfxSource, &sp38); 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)) { (gCurrentLevel != LEVEL_VENOM_ANDROSS)) {
Object_Kill(&this->obj, this->sfxSource); Object_Kill(&this->obj, this->sfxSource);
} }
@ -1322,21 +1322,21 @@ void Object_DrawShadow(s32 index, Object* obj) {
switch (obj->id) { switch (obj->id) {
case OBJ_ACTOR_230: case OBJ_ACTOR_230:
Matrix_Translate(gGfxMatrix, obj->pos.x, gGroundHeight + 2.0f + gActors[index].fwork[1], 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; break;
case OBJ_ACTOR_229: case OBJ_ACTOR_229:
case OBJ_ACTOR_231: case OBJ_ACTOR_231:
Matrix_Translate(gGfxMatrix, obj->pos.x, gGroundHeight + 2.0f + gActors[index].fwork[0], 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; break;
case OBJ_BOSS_316: case OBJ_BOSS_316:
Matrix_Translate(gGfxMatrix, obj->pos.x, gGroundHeight + 2.0f + gCameraShakeY, obj->pos.z, MTXF_APPLY); Matrix_Translate(gGfxMatrix, obj->pos.x, gGroundHeight + 2.0f + gCameraShakeY, obj->pos.z, MTXF_APPLY);
break; break;
default: 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; 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)) { (obj->id == OBJ_ACTOR_TEAM_BOSS)) {
Matrix_Scale(gGfxMatrix, 1.0f, 0.0f, 1.0f, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 1.0f, 0.0f, 1.0f, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, obj->rot.y * M_DTOR, 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); Matrix_RotateX(gCalcMatrix, gPlayer[0].camPitch, MTXF_APPLY);
sp2C.x = pos->x - gPlayerCamEye.x; sp2C.x = pos->x - gPlayerCamEye.x;
sp2C.y = pos->y - gPlayerCamEye.y; 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); Matrix_MultVec3f(gCalcMatrix, &sp2C, &sp20);
sfxSrc[0] = sp20.x; sfxSrc[0] = sp20.x;
sfxSrc[1] = sp20.y; sfxSrc[1] = sp20.y;
@ -1472,11 +1472,11 @@ void Display_SetSecondLight(Vec3f* pos) {
Vec3f sp9C; Vec3f sp9C;
f32 sp98; f32 sp98;
f32 sp94; f32 sp94;
f32 temp_fv0; f32 lightDist;
Vec3f sp84; Vec3f sp84;
f32 temp1; f32 temp1;
f32 temp2; f32 temp2;
f32 var_fs0; f32 lightFade;
Vec3f sp6C; Vec3f sp6C;
f32 temp3; f32 temp3;
f32 pad; f32 pad;
@ -1485,17 +1485,17 @@ void Display_SetSecondLight(Vec3f* pos) {
sp9C.x = pos->x - gLight3x; sp9C.x = pos->x - gLight3x;
sp9C.y = pos->y - gLight3y; sp9C.y = pos->y - gLight3y;
sp9C.z = pos->z - gLight3z; sp9C.z = pos->z - gLight3z;
temp_fv0 = VEC3F_MAG(&sp9C); lightDist = VEC3F_MAG(&sp9C);
if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) { if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) {
var_fs0 = 700.0f / temp_fv0; lightFade = 700.0f / lightDist;
} else { } else {
var_fs0 = 200.0f / temp_fv0; lightFade = 200.0f / lightDist;
} }
if (var_fs0 > 1.0f) { if (lightFade > 1.0f) {
var_fs0 = 1.0f; lightFade = 1.0f;
} }
if (D_ctx_8017812C == 2) { if (D_ctx_8017812C == 2) {
var_fs0 = 1.0f; lightFade = 1.0f;
} }
sp94 = Math_Atan2F(sp9C.x, sp9C.z); sp94 = Math_Atan2F(sp9C.x, sp9C.z);
sp98 = -Math_Atan2F(sp9C.y, sqrtf(SQ(sp9C.x) + SQ(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; sp6C.z = -100.0f;
Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp6C, &sp84); Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp6C, &sp84);
Matrix_Pop(&gCalcMatrix); Matrix_Pop(&gCalcMatrix);
temp1 = gLight3R * gLight3Brightness * var_fs0; temp1 = gLight3R * gLight3Brightness * lightFade;
temp2 = gLight3G * gLight3Brightness * var_fs0; temp2 = gLight3G * gLight3Brightness * lightFade;
temp3 = gLight3B * gLight3Brightness * var_fs0; temp3 = gLight3B * gLight3Brightness * lightFade;
Lights_SetTwoLights(&gMasterDisp, gLight1x, gLight1y, gLight1z, sp84.x, sp84.y, sp84.z, gLight1R, gLight1G, Lights_SetTwoLights(&gMasterDisp, gLight1x, gLight1y, gLight1z, sp84.x, sp84.y, sp84.z, gLight1R, gLight1G,
gLight1B, temp1, temp2, temp3, gAmbientR, gAmbientG, gAmbientB); gLight1B, temp1, temp2, temp3, gAmbientR, gAmbientG, gAmbientB);
} }
@ -1589,7 +1589,7 @@ void Object_DrawAll(s32 arg0) {
RCP_SetupDL_27(); RCP_SetupDL_27();
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 64, 64, 255, 255); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 64, 64, 255, 255);
} }
func_edisplay_800597C0(arg0); Object_SetCullDirection(arg0);
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
Boss_Draw(boss, arg0); Boss_Draw(boss, arg0);
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
@ -1638,7 +1638,7 @@ void Object_DrawAll(s32 arg0) {
(gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) || (gCurrentLevel == LEVEL_AQUAS)) { (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) || (gCurrentLevel == LEVEL_AQUAS)) {
Display_SetSecondLight(&actor->obj.pos); Display_SetSecondLight(&actor->obj.pos);
} }
func_edisplay_800597C0(arg0); Object_SetCullDirection(arg0);
Actor_DrawOnRails(actor); Actor_DrawOnRails(actor);
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
if (actor->unk_0C9 != 0) { if (actor->unk_0C9 != 0) {
@ -1651,8 +1651,8 @@ void Object_DrawAll(s32 arg0) {
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
Actor_DrawAllRange(actor); Actor_DrawAllRange(actor);
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
if ((actor->unk_0C9 != 0) && (D_edisplay_801615EC != 0) && if ((actor->unk_0C9 != 0) && (sDrewActor != 0) &&
((D_edisplay_801615E0.z > -4000.0f) || (gCurrentLevel != LEVEL_KATINA))) { ((sViewPos.z > -4000.0f) || (gCurrentLevel != LEVEL_KATINA))) {
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
Object_DrawShadow(i, &actor->obj); Object_DrawShadow(i, &actor->obj);
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
@ -1668,7 +1668,7 @@ void Object_DrawAll(s32 arg0) {
if (item->obj.status >= OBJ_ACTIVE) { if (item->obj.status >= OBJ_ACTIVE) {
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
RCP_SetupDL(&gMasterDisp, 0x1D); RCP_SetupDL(&gMasterDisp, 0x1D);
func_edisplay_800597C0(arg0); Object_SetCullDirection(arg0);
Item_Draw(item, arg0); Item_Draw(item, arg0);
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
} }
@ -1779,12 +1779,12 @@ void TexturedLine_Draw(void) {
if (gTexturedLines[i].mode != 0) { if (gTexturedLines[i].mode != 0) {
Matrix_Push(&gGfxMatrix); 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); MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, texLine->unk_20, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, texLine->yRot, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, texLine->unk_1C, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, texLine->xRot, MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, texLine->unk_20, MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, texLine->yRot, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, texLine->unk_28, texLine->unk_28, texLine->unk_24, MTXF_APPLY); Matrix_Scale(gGfxMatrix, texLine->xyScale, texLine->xyScale, texLine->zScale, MTXF_APPLY);
if ((gCurrentLevel == LEVEL_AQUAS) || (gCurrentLevel == LEVEL_VENOM_ANDROSS)) { if ((gCurrentLevel == LEVEL_AQUAS) || (gCurrentLevel == LEVEL_VENOM_ANDROSS)) {
s32 alpha = ((gGameFrameCount % 2) != 0) ? 180 : 50; s32 alpha = ((gGameFrameCount % 2) != 0) ? 180 : 50;
@ -1808,8 +1808,8 @@ void TexturedLine_Draw(void) {
if (gCurrentLevel == LEVEL_MACBETH) { if (gCurrentLevel == LEVEL_MACBETH) {
gSPDisplayList(gMasterDisp++, D_MA_6012C00); gSPDisplayList(gMasterDisp++, D_MA_6012C00);
} else { } else {
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, texLine->unk_2C, texLine->unk_2D, texLine->unk_2E, gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, texLine->red, texLine->green, texLine->blue,
texLine->unk_2F); texLine->alpha);
gSPDisplayList(gMasterDisp++, D_edisplay_800CFD80); gSPDisplayList(gMasterDisp++, D_edisplay_800CFD80);
} }
} }
@ -1821,18 +1821,18 @@ void TexturedLine_Draw(void) {
void TexturedLine_DrawPath(s32 index) { void TexturedLine_DrawPath(s32 index) {
TexturedLine* texLine = &gTexturedLines[index]; TexturedLine* texLine = &gTexturedLines[index];
if (texLine->unk_2F == 255) { if (texLine->alpha == 255) {
RCP_SetupDL(&gMasterDisp, 5); RCP_SetupDL(&gMasterDisp, 5);
} else { } else {
RCP_SetupDL(&gMasterDisp, 0xE); 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_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, texLine->unk_04.x, texLine->unk_04.y, texLine->unk_04.z, MTXF_APPLY); Matrix_Translate(gGfxMatrix, texLine->posAA.x, texLine->posAA.y, texLine->posAA.z, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, texLine->unk_20, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, texLine->yRot, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, texLine->unk_1C, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, texLine->xRot, MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, texLine->unk_1C, MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, texLine->xRot, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, texLine->unk_28, 1.0f, texLine->unk_24, MTXF_APPLY); Matrix_Scale(gGfxMatrix, texLine->xyScale, 1.0f, texLine->zScale, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp); Matrix_SetGfxMtx(&gMasterDisp);
gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK);
gSPDisplayList(gMasterDisp++, D_edisplay_800CFD80); gSPDisplayList(gMasterDisp++, D_edisplay_800CFD80);

View File

@ -31,7 +31,7 @@ s32 BonusText_Display(f32 xPos, f32 yPos, f32 zPos, s32 hits) {
gBonusText[i].pos.x = xPos; gBonusText[i].pos.x = xPos;
gBonusText[i].pos.y = yPos; gBonusText[i].pos.y = yPos;
gBonusText[i].pos.z = zPos; gBonusText[i].pos.z = zPos;
gBonusText[i].unk_10 = 0.0f; gBonusText[i].rise = 0.0f;
gBonusText[i].timer = 65; gBonusText[i].timer = 65;
break; break;
} }
@ -52,14 +52,14 @@ void BonusText_Update(void) {
} }
if (gLevelMode == LEVELMODE_ON_RAILS) { if (gLevelMode == LEVELMODE_ON_RAILS) {
bonus->pos.z -= D_ctx_80177D08; bonus->pos.z -= gPathVelZ;
} else if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) { } else if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) {
bonus->pos.x += gPlayer[0].vel.x; bonus->pos.x += gPlayer[0].vel.x;
bonus->pos.z += gPlayer[0].vel.z; bonus->pos.z += gPlayer[0].vel.z;
} }
if (bonus->timer < 45) { 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; f32 sp50;
if (bonus->timer <= 45) { 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); Matrix_MultVec3f(gGfxMatrix, &sp60, &sp54);
if ((fabsf(sp54.x) < 20000.0f) && (fabsf(sp54.y) < 20000.0f)) { 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_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].camYaw, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].camPitch, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].camPitch, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, sp50, sp50, 1.0f, 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); Matrix_SetGfxMtx(&gMasterDisp);
if (bonus->hits <= 10) { if (bonus->hits <= 10) {
@ -980,7 +980,7 @@ void func_effect_8007A748(Effect* effect) {
} }
bool func_effect_8007A774(Player* player, Effect* effect, f32 arg2) { 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)) { (fabsf(player->pos.y - effect->obj.pos.y) < arg2) && (player->timer_498 == 0)) {
Player_ApplyDamage(player, 0, effect->info.damage); Player_ApplyDamage(player, 0, effect->info.damage);
return true; 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->obj.pos.z = zPos;
effect->vel.x = xVel; effect->vel.x = xVel;
effect->vel.z = zVel - D_ctx_80177D08; effect->vel.z = zVel - gPathVelZ;
effect->scale1 = scale1; effect->scale1 = scale1;
effect->timer_50 = 100; effect->timer_50 = 100;
Object_SetInfo(&effect->info, effect->obj.id); 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; 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)) { (fabsf(gPlayer[0].pos.x - effect->obj.pos.x) < 80.0f)) {
if ((effect->obj.pos.y < gPlayer[0].pos.y) && if ((effect->obj.pos.y < gPlayer[0].pos.y) &&
((gPlayer[0].pos.y - effect->obj.pos.y) < (effect->scale2 * 35.0f)) && ((gPlayer[0].pos.y - effect->obj.pos.y) < (effect->scale2 * 35.0f)) &&
@ -2246,7 +2246,7 @@ void func_effect_8007E014(Effect* effect) {
f32 y; f32 y;
if (gGroundType == 4) { 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.pos.y = y + 3.0f;
effect->obj.rot.x = RAD_TO_DEG(x); effect->obj.rot.x = RAD_TO_DEG(x);
effect->obj.rot.z = RAD_TO_DEG(z); 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; effect->obj.pos.z = zPos;
Object_SetInfo(&effect->info, effect->obj.id); Object_SetInfo(&effect->info, effect->obj.id);
sp50 = Math_Atan2F(gPlayer[0].pos.x - xPos, 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].unk_138 - 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); sp54 = -Math_Atan2F(gPlayer[0].pos.y - yPos, temp_ft4);
Matrix_RotateY(gCalcMatrix, sp50, MTXF_NEW); 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); Matrix_MultVec3f(gCalcMatrix, &sp40, &sp34);
effect->vel.x = sp34.x + D_ctx_801779E4; effect->vel.x = sp34.x + gPathVelX;
effect->vel.y = sp34.y + D_ctx_801779F4; effect->vel.y = sp34.y + gPathVelY;
effect->vel.z = sp34.z - D_ctx_80177D08; effect->vel.z = sp34.z - gPathVelZ;
if ((objId == OBJ_EFFECT_353) || (objId == OBJ_EFFECT_354)) { if ((objId == OBJ_EFFECT_353) || (objId == OBJ_EFFECT_354)) {
effect->obj.rot.x = RAD_TO_DEG(sp54); 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); Matrix_MultVec3f(gCalcMatrix, &sp40, &sp34);
effect->vel.x = sp34.x + D_ctx_801779E4; effect->vel.x = sp34.x + gPathVelX;
effect->vel.y = sp34.y + D_ctx_801779F4; effect->vel.y = sp34.y + gPathVelY;
effect->vel.z = sp34.z - D_ctx_80177D08; effect->vel.z = sp34.z - gPathVelZ;
if (objId == OBJ_EFFECT_353) { if (objId == OBJ_EFFECT_353) {
effect->obj.rot.x = RAD_TO_DEG(sp54); 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--) { for (i = ARRAY_COUNT(gEffects) - 1; i >= 0; i--) {
if (gEffects[i].obj.status == OBJ_FREE) { 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, 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, rot->z, arg3->x, arg3->y, arg3->z, sp68.x + gPathVelX, sp68.y + gPathVelY,
sp68.z - D_ctx_80177D08, scale2); sp68.z - gPathVelZ, scale2);
break; 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) { void func_effect_8007F11C(ObjectId objId, f32 xPos, f32 yPos, f32 zPos, f32 speed) {
s32 i; 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--) { for (i = ARRAY_COUNT(gEffects) - 1; i >= 0; i--) {
if (gEffects[i].obj.status == OBJ_FREE) { if (gEffects[i].obj.status == OBJ_FREE) {
Matrix_Push(&gCalcMatrix); Matrix_Push(&gCalcMatrix);
@ -2653,7 +2653,7 @@ void func_effect_8007F438(Effect* effect) {
effect->unk_46--; effect->unk_46--;
} }
if (D_ctx_80177D08 < 0.0f) { if (gPathVelZ < 0.0f) {
effect->vel.z = -10.0f; effect->vel.z = -10.0f;
} }
@ -2723,7 +2723,7 @@ void func_effect_8007F6B0(Effect* effect) {
yPos = gGroundHeight + 40.0f; yPos = gGroundHeight + 40.0f;
if (gGroundType == 4) { 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; yPos = y + 30.0f;
} }
@ -2770,7 +2770,7 @@ void func_effect_8007F958(Effect* effect) {
yPos = gGroundHeight + 10.0f; yPos = gGroundHeight + 10.0f;
if (gGroundType == 4) { 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; 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.z - effect->obj.pos.z) < 100.0f) &&
(fabsf(actor->obj.pos.x - effect->obj.pos.x) < 100.0f) && (fabsf(actor->obj.pos.x - effect->obj.pos.x) < 100.0f) &&
(fabsf(actor->obj.pos.y - effect->obj.pos.y) < 100.0f)) { (fabsf(actor->obj.pos.y - effect->obj.pos.y) < 100.0f)) {
actor->unk_0D0 = 1; actor->dmgType = 1;
actor->unk_0D2 = 0; actor->dmgPart = 0;
actor->damage = 10; actor->damage = 10;
if (effect->obj.id == OBJ_EFFECT_354) { if (effect->obj.id == OBJ_EFFECT_354) {
actor->damage = 30; actor->damage = 30;
} }
actor->unk_0D4 = 100; actor->dmgSource = 100;
return true; return true;
} }
} }
@ -2855,14 +2855,14 @@ void func_effect_8007FE88(Effect* effect) {
return; return;
} }
if (gPlayer[0].unk_280 != 0) { if (gPlayer[0].barrelRollAlpha != 0) {
var_fa0 = 100.0f; 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)) && 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))) { (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.y = 90.0f;
effect->obj.rot.x = RAND_FLOAT(360.0f); effect->obj.rot.x = RAND_FLOAT(360.0f);
Matrix_RotateY(gCalcMatrix, effect->obj.rot.y * M_DTOR, MTXF_NEW); 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); 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); 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) { if (effect->vel.x < 0.0f) {
gPlayer[0].unk_0D8.x *= -1.0f; gPlayer[0].knockback.x *= -1.0f;
} }
if (gCurrentLevel != LEVEL_MACBETH) { if (gCurrentLevel != LEVEL_MACBETH) {
gPlayer[0].unk_0D8.y = 20.0f; gPlayer[0].knockback.y = 20.0f;
if (effect->vel.y < 0.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); Object_Kill(&effect->obj, effect->sfxSource);
@ -2896,7 +2896,7 @@ void func_effect_8007FE88(Effect* effect) {
} }
if (gGroundType == 4) { 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); Object_Kill(&effect->obj, effect->sfxSource);
} }
} else if (effect->obj.pos.y < gGroundHeight) { } else if (effect->obj.pos.y < gGroundHeight) {
@ -2961,8 +2961,8 @@ void func_effect_8008040C(Effect* effect) {
switch (effect->state) { switch (effect->state) {
case 0: case 0:
yRot = Math_Atan2F(gPlayer[0].pos.x - effect->obj.pos.x, 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].unk_138 - 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); xRot = -Math_Atan2F(gPlayer[0].pos.y - effect->obj.pos.y, temp);
Matrix_RotateY(gCalcMatrix, yRot, MTXF_NEW); Matrix_RotateY(gCalcMatrix, yRot, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, xRot, MTXF_APPLY); Matrix_RotateX(gCalcMatrix, xRot, MTXF_APPLY);
@ -2970,9 +2970,9 @@ void func_effect_8008040C(Effect* effect) {
srcVelocity.x = 0.0f; srcVelocity.x = 0.0f;
srcVelocity.z = 100.0f; srcVelocity.z = 100.0f;
Matrix_MultVec3f(gCalcMatrix, &srcVelocity, &destVelocity); Matrix_MultVec3f(gCalcMatrix, &srcVelocity, &destVelocity);
effect->vel.x = destVelocity.x + D_ctx_801779E4; effect->vel.x = destVelocity.x + gPathVelX;
effect->vel.y = destVelocity.y + D_ctx_801779F4; effect->vel.y = destVelocity.y + gPathVelY;
effect->vel.z = destVelocity.z - D_ctx_80177D08; effect->vel.z = destVelocity.z - gPathVelZ;
effect->state++; effect->state++;
break; break;
@ -2988,14 +2988,14 @@ void func_effect_8008040C(Effect* effect) {
return; return;
} }
if (gPlayer[0].unk_280 != 0) { if (gPlayer[0].barrelRollAlpha != 0) {
var_fa0 = 100.0f; 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)) && 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))) { (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.y = 90.0f;
effect->obj.rot.x = RAND_FLOAT(360.0f); effect->obj.rot.x = RAND_FLOAT(360.0f);
Matrix_RotateY(gCalcMatrix, effect->obj.rot.y * M_DTOR, MTXF_NEW); 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); 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); 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) { 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) { 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); Object_Kill(&effect->obj, effect->sfxSource);
} }
} }
if (gGroundType == 4) { if (gGroundType == 4) {
if (Ground_801B6AEC(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z + D_ctx_80177D20) != if (Ground_801B6AEC(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z + gPathProgress) != 0) {
0) {
Object_Kill(&effect->obj, effect->sfxSource); Object_Kill(&effect->obj, effect->sfxSource);
} }
} else if (effect->obj.pos.y < gGroundHeight) { } else if (effect->obj.pos.y < gGroundHeight) {
@ -3576,7 +3575,7 @@ void func_effect_80081C5C(Effect* effect) {
if (effect->unk_44 != 0) { if (effect->unk_44 != 0) {
Object_Kill(&effect->obj, effect->sfxSource); Object_Kill(&effect->obj, effect->sfxSource);
func_effect_8007D0E0(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 5.0f); 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); ActorEvent_8006F0D8(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 15.0f);
Object_Kill(&effect->obj, effect->sfxSource); Object_Kill(&effect->obj, effect->sfxSource);
} }
@ -3766,11 +3765,11 @@ void func_effect_80081C5C(Effect* effect) {
if ((((gGameFrameCount % 16) == 0)) && (effect->timer_50 == 0)) { if ((((gGameFrameCount % 16) == 0)) && (effect->timer_50 == 0)) {
D_800D18EC = D_800D18EC =
RAD_TO_DEG(Math_Atan2F(gPlayer[0].cam.eye.x - gBosses[0].obj.pos.x, 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( D_800D18E8 = RAD_TO_DEG(
-Math_Atan2F(gPlayer[0].cam.eye.y - gBosses[0].obj.pos.y, -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)))); SQ(gPlayer[0].cam.eye.x - gBosses[0].obj.pos.x))));
} }
if (gBosses[0].timer_050 == 0) { if (gBosses[0].timer_050 == 0) {
@ -3812,7 +3811,7 @@ void func_effect_80081C5C(Effect* effect) {
} }
velocity.x = velocity.y = 0.0f; 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); 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, 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) { 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; x = gPlayer[0].pos.x + xSway - xPos;
y = gPlayer[0].pos.y - yPos; y = gPlayer[0].pos.y - yPos;
z = gPlayer[0].unk_138 - zPos; z = gPlayer[0].trueZpos - zPos;
yRot = Math_Atan2F(x, z); yRot = Math_Atan2F(x, z);
xRot = -Math_Atan2F(y, sqrtf(SQ(x) + SQ(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); Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest);
dest.z -= D_ctx_80177D08; dest.z -= gPathVelZ;
for (i = 0; i < 6; i++) { for (i = 0; i < 6; i++) {
for (j = 0; j < ARRAY_COUNT(gEffects); j++) { for (j = 0; j < ARRAY_COUNT(gEffects); j++) {

View File

@ -135,7 +135,7 @@ void Object_SetInfo(ObjectInfo* info, u32 objId) {
*info = D_edata_800CC124[objId]; *info = D_edata_800CC124[objId];
info->hitbox = SEGMENTED_TO_VIRTUAL(D_edata_800CC124[objId].hitbox); info->hitbox = SEGMENTED_TO_VIRTUAL(D_edata_800CC124[objId].hitbox);
if (gLevelMode == LEVELMODE_UNK_2) { 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.x = objInit->rot.x;
item->obj.rot.z = objInit->rot.z; item->obj.rot.z = objInit->rot.z;
item->obj.id = objInit->id; item->obj.id = objInit->id;
item->scale = 1.0f; item->width = 1.0f;
Object_SetInfo(&item->info, item->obj.id); 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); effect->obj.rot.z = RAND_FLOAT(360.0f);
Object_SetInfo(&effect->info, effect->obj.id); Object_SetInfo(&effect->info, effect->obj.id);
if (gLevelType == LEVELTYPE_PLANET) { 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) { if (gEffects[i].obj.status == OBJ_FREE) {
x = gPlayer[0].pos.x + RAND_FLOAT_CENTERED(400.0f) + (5.0f * gPlayer[0].vel.x); 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); y = gPlayer[0].pos.y + RAND_FLOAT_CENTERED(400.0f) + (5.0f * gPlayer[0].vel.y);
z = -D_ctx_80177D20 - 500.0f; z = -gPathProgress - 500.0f;
if (D_ctx_80177D08 < 0.0f) { if (gPathVelZ < 0.0f) {
z = -D_ctx_80177D20 + 500.0f; z = -gPathProgress + 500.0f;
} }
func_enmy_80061958(&gEffects[i], x, y, z); func_enmy_80061958(&gEffects[i], x, y, z);
break; break;
@ -322,9 +322,9 @@ void func_enmy_80061B68(void) {
while (y <= gGroundHeight) { while (y <= gGroundHeight) {
y = gPlayer[0].pos.y + RAND_FLOAT_CENTERED(2000.0f) + (5.0f * gPlayer[0].vel.y); y = gPlayer[0].pos.y + RAND_FLOAT_CENTERED(2000.0f) + (5.0f * gPlayer[0].vel.y);
} }
z = -D_ctx_80177D20 - 3000.0f; z = -gPathProgress - 3000.0f;
if (D_ctx_80177D08 < 0.0f) { if (gPathVelZ < 0.0f) {
z = -D_ctx_80177D20 + 1000.0f; z = -gPathProgress + 1000.0f;
} }
func_enmy_80061958(&gEffects[i], x, y, z); func_enmy_80061958(&gEffects[i], x, y, z);
break; break;
@ -342,9 +342,9 @@ void func_enmy_80061CD0(void) {
if (gEffects[i].obj.status == OBJ_FREE) { if (gEffects[i].obj.status == OBJ_FREE) {
x = gPlayer[gPlayerNum].pos.x + RAND_FLOAT_CENTERED(3000.0f) + (5.0f * gPlayer[gPlayerNum].vel.x); 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); 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); z = -gPathProgress - RAND_FLOAT(2000.0f);
if (D_ctx_80177D08 < 0.0f) { if (gPathVelZ < 0.0f) {
z = -D_ctx_80177D20 + 1000.0f; z = -gPathProgress + 1000.0f;
} }
func_enmy_80061958(&gEffects[i], x, y, z); func_enmy_80061958(&gEffects[i], x, y, z);
break; break;
@ -388,7 +388,7 @@ void ActorEvent_Load(Actor* actor, ObjectInit* objInit, s32 index) {
actor->aiType = objInit->id - ACTOR_EVENT_ID; actor->aiType = objInit->id - ACTOR_EVENT_ID;
Object_SetInfo(&actor->info, actor->obj.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->fwork[25] = 20000.0f;
actor->iwork[1] = gPrevEventActorIndex; actor->iwork[1] = gPrevEventActorIndex;
actor->iwork[10] = gActors[gPrevEventActorIndex].aiType; 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) { void Object_Load(ObjectInit* objInit, f32 xMax, f32 xMin, f32 yMax, f32 yMin) {
s32 i; s32 i;
if ((xMax > objInit->xPos - gPlayer[0].unk_0AC) && (objInit->xPos - gPlayer[0].unk_0AC > xMin) && if ((xMax > objInit->xPos - gPlayer[0].xPath) && (objInit->xPos - gPlayer[0].xPath > xMin) &&
(yMax > objInit->yPos - gPlayer[0].unk_0B0) && (objInit->yPos - gPlayer[0].unk_0B0 > yMin)) { (yMax > objInit->yPos - gPlayer[0].yPath) && (objInit->yPos - gPlayer[0].yPath > yMin)) {
if (objInit->id < OBJ_SPRITE_CO_POLE) { if (objInit->id < OBJ_SPRITE_CO_POLE) {
for (i = 0; i < ARRAY_COUNT(gScenery); i++) { for (i = 0; i < ARRAY_COUNT(gScenery); i++) {
if (gScenery[i].obj.status == OBJ_FREE) { if (gScenery[i].obj.status == OBJ_FREE) {
@ -560,20 +560,20 @@ void Object_LoadLevelObjects(void) {
yMin = xMin = -4000.0f; 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; 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; xMin = -10000.0f;
} }
gLastPathChange = 0; gLastPathChange = 0;
for (i = 0, objInit = &gLevelObjects[gObjectLoadIndex]; i < 10000; i++, gObjectLoadIndex++, objInit++) { for (i = 0, objInit = &gLevelObjects[gObjectLoadIndex]; i < 10000; i++, gObjectLoadIndex++, objInit++) {
if ((objInit->id > OBJ_INVALID) && D_ctx_80177D20 <= objInit->zPos1 && if ((objInit->id > OBJ_INVALID) && gPathProgress <= objInit->zPos1 &&
objInit->zPos1 <= D_ctx_80177D20 + 200.0f) { objInit->zPos1 <= gPathProgress + 200.0f) {
if ((gCurrentLevel == LEVEL_VENOM_1) && (objInit->id >= ACTOR_EVENT_ID)) { if ((gCurrentLevel == LEVEL_VENOM_1) && (objInit->id >= ACTOR_EVENT_ID)) {
if (((objInit->rot.y < 180.0f) && (objInit->xPos < gPlayer[0].unk_0AC)) || if (((objInit->rot.y < 180.0f) && (objInit->xPos < gPlayer[0].xPath)) ||
((objInit->rot.y > 180.0f) && (gPlayer[0].unk_0AC < objInit->xPos))) { ((objInit->rot.y > 180.0f) && (gPlayer[0].xPath < objInit->xPos))) {
Object_Load(objInit, xMax, xMin, yMax, yMin); Object_Load(objInit, xMax, xMin, yMax, yMin);
} }
} else { } else {
@ -747,12 +747,12 @@ bool Object_CheckPolyCollision(Vec3f* pos, Vec3f* vel, ObjectId objId, Object* o
objPos.z = obj->pos.z; objPos.z = obj->pos.z;
if ((objId == OBJ_ACTOR_180) || (objId == OBJ_SCENERY_149) || (objId == OBJ_SCENERY_150) || 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_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; colId = COL1_0;
if (objId == OBJ_BOSS_312) { if (objId == OBJ_BOSS_312) {
colId = COL1_9; colId = COL1_9;
} }
if (objId == OBJ_SCENERY_39) { if (objId == OBJ_SCENERY_ME_TUNNEL) {
colId = COL1_1; colId = COL1_1;
} else if (objId == OBJ_BOSS_308) { } else if (objId == OBJ_BOSS_308) {
colId = COL1_4; 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.status == OBJ_ACTIVE) {
if ((scenery->obj.id == OBJ_SCENERY_1) || (scenery->obj.id == OBJ_SCENERY_4) || 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_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)) { if (Object_CheckPolyCollision(pos, vel, scenery->obj.id, &scenery->obj)) {
return 2; return 2;
} }
@ -902,9 +902,9 @@ s32 Object_CheckCollision(s32 index, Vec3f* pos, Vec3f* vel, s32 mode) {
} else if (actor->scale < 0.0f) { } else if (actor->scale < 0.0f) {
if (Object_CheckHitboxCollision(pos, actor->info.hitbox, &actor->obj, actor->vwork[29].x, 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->vwork[29].y, actor->vwork[29].z + actor->unk_0F4.z)) {
actor->unk_0D0 = 1; actor->dmgType = 1;
actor->damage = 10; actor->damage = 10;
actor->unk_0D2 = -1; actor->dmgPart = -1;
actor->hitPos.x = pos->x; actor->hitPos.x = pos->x;
actor->hitPos.y = pos->y; actor->hitPos.y = pos->y;
actor->hitPos.z = pos->z; 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)) { } else if ((mode != 2) && (mode != 3)) {
if (Object_CheckSingleHitbox(pos, actor->info.hitbox, &actor->obj.pos)) { if (Object_CheckSingleHitbox(pos, actor->info.hitbox, &actor->obj.pos)) {
actor->unk_0D0 = 1; actor->dmgType = 1;
actor->damage = 10; actor->damage = 10;
actor->unk_0D2 = -1; actor->dmgPart = -1;
if (!(((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->iwork[12] != 0)) || if (!(((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->iwork[12] != 0)) ||
((actor->obj.id == OBJ_ACTOR_ALLRANGE) && ((actor->obj.id == OBJ_ACTOR_ALLRANGE) &&
((actor->aiType < AI360_10) || (actor->aiType >= AI360_GREAT_FOX))))) { ((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) { 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) { 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) { void Object_Init(s32 index, ObjectId objId) {
@ -1037,7 +1037,7 @@ void Object_Init(s32 index, ObjectId objId) {
break; break;
case OBJ_EFFECT_368: case OBJ_EFFECT_368:
if (gCurrentLevel == LEVEL_TITANIA) { 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); &sp50);
gEffects[index].obj.pos.y = sp4C + 3.0f; gEffects[index].obj.pos.y = sp4C + 3.0f;
gEffects[index].obj.rot.x = RAD_TO_DEG(sp54); 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; gEffects[index].obj.status = OBJ_FREE;
} }
break; break;
case OBJ_SCENERY_30: case OBJ_SCENERY_TI_RIB_0:
func_enmy_80063E5C(&gScenery[index], D_TI_6006940); func_enmy_80063E5C(&gScenery[index], D_TI_6006940);
break; break;
case OBJ_SCENERY_31: case OBJ_SCENERY_TI_RIB_1:
func_enmy_80063E5C(&gScenery[index], D_TI_600695C); func_enmy_80063E5C(&gScenery[index], D_TI_600695C);
break; break;
case OBJ_SCENERY_32: case OBJ_SCENERY_TI_RIB_2:
func_enmy_80063E5C(&gScenery[index], D_TI_6006978); func_enmy_80063E5C(&gScenery[index], D_TI_6006978);
break; break;
case OBJ_SCENERY_33: case OBJ_SCENERY_TI_RIB_3:
func_enmy_80063E5C(&gScenery[index], D_TI_6006994); func_enmy_80063E5C(&gScenery[index], D_TI_6006994);
break; break;
case OBJ_SCENERY_34: case OBJ_SCENERY_TI_RIB_4:
func_enmy_80063E5C(&gScenery[index], D_TI_60069B0); func_enmy_80063E5C(&gScenery[index], D_TI_60069B0);
break; break;
case OBJ_SCENERY_35: case OBJ_SCENERY_TI_RIB_5:
func_enmy_80063E5C(&gScenery[index], D_TI_60069CC); func_enmy_80063E5C(&gScenery[index], D_TI_60069CC);
break; break;
case OBJ_SCENERY_36: case OBJ_SCENERY_TI_RIB_6:
func_enmy_80063E5C(&gScenery[index], D_TI_60069E8); func_enmy_80063E5C(&gScenery[index], D_TI_60069E8);
break; break;
case OBJ_SCENERY_37: case OBJ_SCENERY_TI_RIB_7:
func_enmy_80063E5C(&gScenery[index], D_TI_6006A04); func_enmy_80063E5C(&gScenery[index], D_TI_6006A04);
break; break;
case OBJ_SCENERY_38: case OBJ_SCENERY_TI_RIB_8:
func_enmy_80063E5C(&gScenery[index], D_TI_6006A20); func_enmy_80063E5C(&gScenery[index], D_TI_6006A20);
break; break;
case OBJ_SCENERY_23: 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 sp2C;
f32 sp28; f32 sp28;
f32 sp24; f32 sp24;
if ((gGroundType == 4) && (scenery->state == 0)) { 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.pos.y = sp24 + 3.0f;
scenery->obj.rot.x = RAD_TO_DEG(sp2C); scenery->obj.rot.x = RAD_TO_DEG(sp2C);
scenery->obj.rot.z = RAD_TO_DEG(sp28); scenery->obj.rot.z = RAD_TO_DEG(sp28);
@ -1513,7 +1513,7 @@ void func_enmy_800656D4(Actor* actor) {
} }
} else { } else {
actor->fwork[29] = gPlayer[0].unk_138; actor->fwork[29] = gPlayer[0].trueZpos;
actor->fwork[28] = gPlayer[0].pos.y; actor->fwork[28] = gPlayer[0].pos.y;
actor->fwork[27] = gPlayer[0].pos.x; 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) && if ((fabsf(actor->fwork[27] - actor->obj.pos.x) < 60.0f) &&
(fabsf(actor->fwork[28] - actor->obj.pos.y) < 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))) { (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].damage = 20;
gActors[spC4].unk_0D4 = 2; gActors[spC4].dmgSource = 2;
func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); func_effect_8007A6F0(&actor->obj.pos, 0x2903A008);
func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 5.0f); func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 5.0f);
Object_Kill(&actor->obj, actor->sfxSource); 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]); Math_Vec3fFromAngles(&sp98, actor->obj.rot.x, actor->obj.rot.y, actor->fwork[5]);
actor->vel.x = sp98.x; actor->vel.x = sp98.x;
actor->vel.y = sp98.y; actor->vel.y = sp98.y;
actor->vel.z = sp98.z - D_ctx_80177D08; actor->vel.z = sp98.z - gPathVelZ;
if (actor->unk_0B4 == 0) { if (actor->unk_0B4 == 0) {
actor->obj.rot.z += 5.0f; 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); 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); func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 5.0f);
Object_Kill(&actor->obj, actor->sfxSource); Object_Kill(&actor->obj, actor->sfxSource);
} }
sp8C.x = actor->vel.x; sp8C.x = actor->vel.x;
sp8C.y = actor->vel.y; sp8C.y = actor->vel.y;
sp8C.z = actor->vel.z; 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)) { (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); func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 3.0f);
Object_Kill(&actor->obj, actor->sfxSource); Object_Kill(&actor->obj, actor->sfxSource);
if (actor->unk_0D0 != 0) { if (actor->dmgType != 0) {
actor->itemDrop = DROP_SILVER_RING_50p; actor->itemDrop = DROP_SILVER_RING_50p;
if ((gCurrentLevel == LEVEL_CORNERIA)) { if ((gCurrentLevel == LEVEL_CORNERIA)) {
if (gLevelMode == LEVELMODE_ALL_RANGE) { if (gLevelMode == LEVELMODE_ALL_RANGE) {
@ -1604,10 +1604,10 @@ void func_enmy_800656D4(Actor* actor) {
func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); func_effect_8007A6F0(&actor->obj.pos, 0x2903A008);
} }
if (gLevelMode == LEVELMODE_ON_RAILS) { 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; 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); Object_Kill(&actor->obj, actor->sfxSource);
} }
} }
@ -1649,12 +1649,12 @@ void Actor_Despawn(Actor* actor) {
s32 i; s32 i;
if (gVersusMode) { 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_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)) { } else if (!((actor->obj.id == OBJ_ACTOR_ALLRANGE) && (actor->unk_0B6 == 1))) {
if ((actor->unk_0D4 == 1) && (actor->info.bonus != 0)) { if ((actor->dmgSource == 1) && (actor->info.bonus != 0)) {
gHitCount += actor->info.bonus; gHitCount += actor->info.bonus;
D_ctx_80177850 = 15; D_ctx_80177850 = 15;
if ((gLevelMode == LEVELMODE_ALL_RANGE) && (gDropHitCountItem != 0)) { if ((gLevelMode == LEVELMODE_ALL_RANGE) && (gDropHitCountItem != 0)) {
@ -1751,10 +1751,10 @@ void func_enmy_8006654C(Actor* actor) {
break; break;
} }
actor->scale = 0.8f; actor->scale = 0.8f;
if (actor->unk_0D0 != 0) { if (actor->dmgType != 0) {
actor->obj.status = OBJ_DYING; actor->obj.status = OBJ_DYING;
actor->vel.y = RAND_FLOAT(5.0f) + 6.0f; 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.y = -2.0f;
} }
actor->vel.z = -15.0f; actor->vel.z = -15.0f;
@ -1798,7 +1798,7 @@ void func_enmy_800669A0(Actor* actor) {
} }
} else { } else {
actor->obj.rot.y += 5.0f; 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_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, 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); 5);
@ -1892,42 +1892,42 @@ void func_enmy_80066EA8(Scenery* scenery) {
void func_enmy_80066EE4(Sprite* sprite) { void func_enmy_80066EE4(Sprite* sprite) {
} }
void func_enmy_80066EF0(Item* item) { void Item_CheckBounds(Item* this) {
f32 var_fa1; f32 var_fa1;
if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_STANDBY)) { 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)) { if ((gLevelMode == LEVELMODE_ON_RAILS) && (gLastPathChange == 0)) {
var_fa1 = 900.0f; var_fa1 = 900.0f;
if (gPlayer[0].form != FORM_ARWING) { if (gPlayer[0].form != FORM_ARWING) {
var_fa1 = 600.0f; var_fa1 = 600.0f;
} }
if (item->obj.pos.x > gPlayer[0].unk_0AC + var_fa1) { if (this->obj.pos.x > gPlayer[0].xPath + var_fa1) {
Math_SmoothStepToF(&item->obj.pos.x, gPlayer[0].unk_0AC + var_fa1, 0.1f, 10.0f, 0.01f); 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) { if (this->obj.pos.x < gPlayer[0].xPath - var_fa1) {
Math_SmoothStepToF(&item->obj.pos.x, gPlayer[0].unk_0AC - var_fa1, 0.1f, 10.0f, 0.01f); Math_SmoothStepToF(&this->obj.pos.x, gPlayer[0].xPath - var_fa1, 0.1f, 10.0f, 0.01f);
} }
} }
if (item->obj.pos.y > 650.0f) { if (this->obj.pos.y > 650.0f) {
Math_SmoothStepToF(&item->obj.pos.y, 650.0f, 0.1f, 10.0f, 0.01f); Math_SmoothStepToF(&this->obj.pos.y, 650.0f, 0.1f, 10.0f, 0.01f);
} }
if (gLevelType == LEVELTYPE_PLANET) { if (gLevelType == LEVELTYPE_PLANET) {
if (item->obj.pos.y < gGroundHeight + 70.0f) { if (this->obj.pos.y < gGroundHeight + 70.0f) {
Math_SmoothStepToF(&item->obj.pos.y, gGroundHeight + 70.0f, 0.1f, 5.0f, 0.01f); Math_SmoothStepToF(&this->obj.pos.y, gGroundHeight + 70.0f, 0.1f, 5.0f, 0.01f);
} }
if ((gCurrentLevel == LEVEL_AQUAS) && (gBossActive != 0)) { 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) { } else if (this->obj.pos.y < -500.0f) {
Math_SmoothStepToF(&item->obj.pos.y, -500.0f, 0.1f, 5.0f, 0.01f); 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 (gVersusMode && (this->index == 0) && (gItems[1].obj.status == OBJ_ACTIVE)) {
if (fabsf(item->obj.pos.x - gItems[1].obj.pos.x) < 200.0f) { if (fabsf(this->obj.pos.x - gItems[1].obj.pos.x) < 200.0f) {
if (fabsf(item->obj.pos.z - gItems[1].obj.pos.z) < 200.0f) { if (fabsf(this->obj.pos.z - gItems[1].obj.pos.z) < 200.0f) {
item->obj.pos.x = item->obj.pos.x - 5.0f; this->obj.pos.x = this->obj.pos.x - 5.0f;
item->obj.pos.z = item->obj.pos.z - 5.0f; this->obj.pos.z = this->obj.pos.z - 5.0f;
gItems[1].obj.pos.x += 5.0f; gItems[1].obj.pos.x += 5.0f;
gItems[1].obj.pos.z += 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) { void Item_SpinPickup(Item* this) {
s32 var_v0; s32 sparkleMask;
Vec3f sp40; Vec3f sp40;
Vec3f sp34; Vec3f sp34;
Math_SmoothStepToF(&item->unk_50, 10.0f, 1.0f, 2.0f, 0.0f); Math_SmoothStepToF(&this->unk_50, 10.0f, 1.0f, 2.0f, 0.0f);
if (item->unk_50 > 30.0f) { if (this->unk_50 > 30.0f) {
var_v0 = 0; sparkleMask = 1 - 1;
} else if (item->unk_50 > 20.0f) { } else if (this->unk_50 > 20.0f) {
var_v0 = 1; sparkleMask = 2 - 1;
} else { } else {
var_v0 = 7; sparkleMask = 8 - 1;
} }
if (!(var_v0 & gGameFrameCount)) { if (!(sparkleMask & gGameFrameCount)) {
Matrix_RotateY(gCalcMatrix, gGameFrameCount * 23.0f * M_DTOR, MTXF_NEW); Matrix_RotateY(gCalcMatrix, gGameFrameCount * 23.0f * M_DTOR, MTXF_NEW);
sp40.x = 50.0f; sp40.x = 50.0f;
sp40.y = RAND_FLOAT_CENTERED(120.0f); sp40.y = RAND_FLOAT_CENTERED(120.0f);
sp40.z = 0.0f; sp40.z = 0.0f;
Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp40, &sp34); 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; this->obj.rot.y += this->unk_50;
item->obj.rot.y = Math_ModF(item->obj.rot.y, 360.0f); 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) { 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); Math_SmoothStepToF(&this->obj.pos.y, 300.0f, 0.05f, 50.0f, 0.01f);
} }
} }
if (this->unk_0D0 != 0) { if (this->dmgType != 0) {
this->unk_0D0 = 0; this->dmgType = 0;
this->health -= this->damage; this->health -= this->damage;
if (this->health <= 0) { if (this->health <= 0) {
func_effect_8007A6F0(&this->obj.pos, 0x2903A008); 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.x = this->obj.pos.x;
gRadarMarks[63].pos.y = this->obj.pos.y; gRadarMarks[63].pos.y = this->obj.pos.y;
gRadarMarks[63].pos.z = this->obj.pos.z; gRadarMarks[63].pos.z = this->obj.pos.z;
gRadarMarks[63].unk_10 = 0.0f; gRadarMarks[63].yRot = 0.0f;
} }
void ActorSupplies_Draw(Actor* actor) { void ActorSupplies_Draw(Actor* actor) {
@ -2073,8 +2073,8 @@ void func_enmy_80067A40(void) {
} }
void Item1up_Update(Item1UP* this) { void Item1up_Update(Item1UP* this) {
func_enmy_80066EF0(this); Item_CheckBounds(this);
func_enmy_800671D0(this); Item_SpinPickup(this);
if (this->collected) { if (this->collected) {
Object_Kill(&this->obj, this->sfxSource); Object_Kill(&this->obj, this->sfxSource);
func_enmy_80060F30(gPlayer[this->playerNum].sfxSource, 0x4900C024, this->playerNum); func_enmy_80060F30(gPlayer[this->playerNum].sfxSource, 0x4900C024, this->playerNum);
@ -2088,12 +2088,12 @@ void Item1up_Update(Item1UP* this) {
} }
void ItemPickup_Update(Item* this) { void ItemPickup_Update(Item* this) {
func_enmy_80066EF0(this); Item_CheckBounds(this);
func_enmy_800671D0(this); Item_SpinPickup(this);
if (this->state == 0) { if (this->state == 0) {
switch (this->obj.id) { switch (this->obj.id) {
case OBJ_ITEM_BOMB: case OBJ_ITEM_BOMB:
this->scale = 18.0f; this->width = 18.0f;
if (this->collected) { if (this->collected) {
this->timer_4A = 50; this->timer_4A = 50;
this->state = 1; this->state = 1;
@ -2105,7 +2105,7 @@ void ItemPickup_Update(Item* this) {
} }
break; break;
case OBJ_ITEM_LASERS: case OBJ_ITEM_LASERS:
this->scale = 18.0f; this->width = 18.0f;
if (this->collected) { if (this->collected) {
this->timer_4A = 50; this->timer_4A = 50;
this->state = 1; this->state = 1;
@ -2127,14 +2127,14 @@ void ItemPickup_Update(Item* this) {
break; break;
} }
} else { } 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; this->obj.pos.x += (gPlayer[this->playerNum].pos.x - this->obj.pos.x) * 0.5f;
if (gPlayer[this->playerNum].form == FORM_LANDMASTER) { if (gPlayer[this->playerNum].form == FORM_LANDMASTER) {
this->obj.pos.y += ((gPlayer[this->playerNum].pos.y + 50.0f) - this->obj.pos.y) * 0.5f; this->obj.pos.y += ((gPlayer[this->playerNum].pos.y + 50.0f) - this->obj.pos.y) * 0.5f;
} else { } else {
this->obj.pos.y += (gPlayer[this->playerNum].pos.y - this->obj.pos.y) * 0.5f; 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) { if (this->timer_48 == 0) {
Object_Kill(&this->obj, this->sfxSource); Object_Kill(&this->obj, this->sfxSource);
} }
@ -2159,9 +2159,9 @@ void ItemSupplyRing_Update(Item* this) {
switch (this->state) { switch (this->state) {
case 0: case 0:
Math_SmoothStepToF(&this->scale, 0.4f, 1.0f, 0.05f, 0.0f); Math_SmoothStepToF(&this->width, 0.4f, 1.0f, 0.05f, 0.0f);
func_enmy_80066EF0(this); Item_CheckBounds(this);
func_enmy_800671D0(this); Item_SpinPickup(this);
if (this->collected) { if (this->collected) {
this->state = 1; this->state = 1;
this->timer_48 = 50; this->timer_48 = 50;
@ -2179,7 +2179,7 @@ void ItemSupplyRing_Update(Item* this) {
} }
gPlayer[this->playerNum].heal += 32; gPlayer[this->playerNum].heal += 32;
BonusText_Display(gPlayer[this->playerNum].pos.x, gPlayer[this->playerNum].pos.y, 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 { } else {
gPlayer[this->playerNum].heal += 32; gPlayer[this->playerNum].heal += 32;
func_enmy_80060F30(gPlayer[this->playerNum].sfxSource, 0x49003013, this->playerNum); func_enmy_80060F30(gPlayer[this->playerNum].sfxSource, 0x49003013, this->playerNum);
@ -2195,9 +2195,9 @@ void ItemSupplyRing_Update(Item* this) {
break; break;
case 1: case 1:
if (this->timer_48 > 30) { 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 { } 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; this->obj.pos.x += (gPlayer[this->playerNum].pos.x - this->obj.pos.x) * 0.5f;
if (gPlayer[this->playerNum].form == FORM_LANDMASTER) { 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; this->obj.pos.y += (gPlayer[this->playerNum].pos.y - this->obj.pos.y) * 0.5f;
} }
if (gPlayer[0].cockpitView && (gLevelMode == LEVELMODE_ON_RAILS)) { 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 { } 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; this->obj.rot.z += 22.0f;
Math_SmoothStepToAngle(&this->obj.rot.y, Math_RadToDeg(-gPlayer[this->playerNum].camYaw), 0.2f, 10.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) { if (this->timer_48 == 0) {
Object_Kill(&this->obj, this->sfxSource); 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_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW);
Matrix_RotateZ(gCalcMatrix, gGameFrameCount * 37.0f * M_DTOR, MTXF_APPLY); Matrix_RotateZ(gCalcMatrix, gGameFrameCount * 37.0f * M_DTOR, MTXF_APPLY);
sp4C.x = 0.0f; sp4C.x = 0.0f;
sp4C.y = this->scale * 100.0f; sp4C.y = this->width * 100.0f;
sp4C.z = 0.0f; sp4C.z = 0.0f;
Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp4C, &sp40); 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, 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) { void ItemWingRepair_Update(ItemWingRepair* this) {
func_enmy_80066EF0(this); Item_CheckBounds(this);
func_enmy_800671D0(this); Item_SpinPickup(this);
if (this->collected) { if (this->collected) {
func_enmy_80067A40(); func_enmy_80067A40();
Object_Kill(&this->obj, this->sfxSource); Object_Kill(&this->obj, this->sfxSource);
@ -2251,16 +2251,16 @@ void ItemWingRepair_Update(ItemWingRepair* this) {
} }
void ItemMeteoWarp_Update(ItemMeteoWarp* this) { void ItemMeteoWarp_Update(ItemMeteoWarp* this) {
func_enmy_80066EF0(this); Item_CheckBounds(this);
if (this->state > 0) { if (this->state > 0) {
if (this->state == 1) { if (this->state == 1) {
this->obj.rot.z -= 10.0f; this->obj.rot.z -= 10.0f;
this->obj.pos.x += (gPlayer[this->playerNum].pos.x - this->obj.pos.x) * 0.3f; 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.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->obj.pos.z += (gPlayer[this->playerNum].trueZpos - this->obj.pos.z) * 0.3f;
this->scale -= 5.0f; this->width -= 5.0f;
if (this->scale < 0.0f) { if (this->width < 0.0f) {
this->scale = 0.0f; this->width = 0.0f;
} }
} }
this->unk_44 -= 10; this->unk_44 -= 10;
@ -2268,14 +2268,14 @@ void ItemMeteoWarp_Update(ItemMeteoWarp* this) {
Object_Kill(&this->obj, this->sfxSource); Object_Kill(&this->obj, this->sfxSource);
} }
} else { } else {
this->scale = 100.0f; this->width = 100.0f;
if (gRingPassCount < 0) { if (gRingPassCount < 0) {
this->state = 2; this->state = 2;
this->unk_44 = 255; this->unk_44 = 255;
} else if (this->collected) { } else if (this->collected) {
this->state = 1; this->state = 1;
this->unk_44 = 255; this->unk_44 = 255;
gPlayer[this->playerNum].timer_27C = 100; gPlayer[this->playerNum].meteoWarpTimer = 100;
AUDIO_PLAY_SFX(gWarpRingSfx[gRingPassCount], gPlayer[0].sfxSource, 0); AUDIO_PLAY_SFX(gWarpRingSfx[gRingPassCount], gPlayer[0].sfxSource, 0);
if (gRingPassCount == 0) { if (gRingPassCount == 0) {
gPlayer[0].boostSpeed = 0.0f; gPlayer[0].boostSpeed = 0.0f;
@ -2283,7 +2283,7 @@ void ItemMeteoWarp_Update(ItemMeteoWarp* this) {
gRingPassCount++; gRingPassCount++;
if (gRingPassCount >= 7) { if (gRingPassCount >= 7) {
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_ENTER_WARP_ZONE; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_ENTER_WARP_ZONE;
gPlayer[0].unk_1D0 = 0; gPlayer[0].csState = 0;
AUDIO_PLAY_SFX(0x1900602A, gDefaultSfxSource, 0); AUDIO_PLAY_SFX(0x1900602A, gDefaultSfxSource, 0);
gMissionStatus = MISSION_WARP; gMissionStatus = MISSION_WARP;
gLeveLClearStatus[gCurrentLevel] = 1; gLeveLClearStatus[gCurrentLevel] = 1;
@ -2295,7 +2295,7 @@ void ItemMeteoWarp_Update(ItemMeteoWarp* this) {
void ItemCheckpoint_Update(ItemCheckpoint* this) { void ItemCheckpoint_Update(ItemCheckpoint* this) {
s32 i; s32 i;
func_enmy_80066EF0(this); Item_CheckBounds(this);
this->unk_58 -= this->unk_44; this->unk_58 -= this->unk_44;
if (this->state > 0) { if (this->state > 0) {
this->unk_44++; 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; this->obj.pos.y += (gPlayer[this->playerNum].pos.y - this->obj.pos.y) * 0.3f;
} }
if (gPlayer[0].cockpitView) { 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 { } 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) { 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_50, 0.0f, 0.1f, 0.03f, 0.0f);
Math_SmoothStepToF(&this->unk_54, 4.0f, 0.1f, 0.2f, 0.01f); 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); Object_Kill(&this->obj, this->sfxSource);
} }
} else { } else {
this->unk_44 = 2; this->unk_44 = 2;
this->unk_50 = 1.0f; this->unk_50 = 1.0f;
this->unk_54 = 1.0f; this->unk_54 = 1.0f;
this->scale = 100.0f; this->width = 100.0f;
if (this->collected) { if (this->collected) {
gPlayer[this->playerNum].heal = 128; gPlayer[this->playerNum].heal = 128;
this->state++; this->state++;
this->timer_48 = 15; this->timer_48 = 15;
gSavedGroundSurface = gGroundSurface; gSavedGroundSurface = gGroundSurface;
D_ctx_80177CB0 = -this->obj.pos.z; gSavedPathProgress = -this->obj.pos.z;
D_ctx_80177CB0 -= 250.0f; gSavedPathProgress -= 250.0f;
gSavedObjectLoadIndex = gObjectLoadIndex; gSavedObjectLoadIndex = gObjectLoadIndex;
gSavedZoSearchlightStatus = gMissedZoSearchlight; gSavedZoSearchlightStatus = gMissedZoSearchlight;
gSavedHitCount = gHitCount; gSavedHitCount = gHitCount;
@ -2341,9 +2341,9 @@ void ItemCheckpoint_Update(ItemCheckpoint* this) {
} }
} }
void ItemRingCheck_Update(Item* item) { void ItemRingCheck_Update(Item* this) {
if (item->collected) { if (this->collected) {
Object_Kill(&item->obj, item->sfxSource); Object_Kill(&this->obj, this->sfxSource);
gRingPassCount++; gRingPassCount++;
} }
} }
@ -2354,14 +2354,14 @@ void ItemPathChange_Update(Item* this) {
Object_Kill(&this->obj, this->sfxSource); Object_Kill(&this->obj, this->sfxSource);
} else if (((gCurrentLevel == LEVEL_METEO) || (gCurrentLevel == LEVEL_SECTOR_X)) && (gLevelPhase == 1)) { } else if (((gCurrentLevel == LEVEL_METEO) || (gCurrentLevel == LEVEL_SECTOR_X)) && (gLevelPhase == 1)) {
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE;
gPlayer[0].unk_1D0 = 0; gPlayer[0].csState = 0;
Object_Kill(&this->obj, this->sfxSource); Object_Kill(&this->obj, this->sfxSource);
} else if (gCurrentLevel == LEVEL_TRAINING) { } else if (gCurrentLevel == LEVEL_TRAINING) {
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_START_360; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_START_360;
gPlayer[0].unk_1D0 = 0; gPlayer[0].csState = 0;
Object_Kill(&this->obj, this->sfxSource); Object_Kill(&this->obj, this->sfxSource);
} else if (this->state == 0) { } 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) { switch (this->obj.id) {
case OBJ_ITEM_PATH_SPLIT_Y: case OBJ_ITEM_PATH_SPLIT_Y:
case OBJ_ITEM_PATH_TURN_UP: case OBJ_ITEM_PATH_TURN_UP:
@ -2380,42 +2380,42 @@ void ItemPathChange_Update(Item* this) {
} }
if (this->collected) { if (this->collected) {
Object_Kill(&this->obj, this->sfxSource); Object_Kill(&this->obj, this->sfxSource);
gPlayer[0].unk_0B4 = 0.0f; gPlayer[0].pathStep = 0.0f;
gPlayer[0].timer_210 = this->scale * 0.05f; gPlayer[0].timer_210 = this->width * 0.05f;
switch (this->obj.id) { switch (this->obj.id) {
case OBJ_ITEM_PATH_SPLIT_X: case OBJ_ITEM_PATH_SPLIT_X:
if (this->obj.pos.x < gPlayer[0].pos.x) { if (this->obj.pos.x < gPlayer[0].pos.x) {
gPlayer[0].unk_118 = -30.0f; gPlayer[0].yRot_118 = -30.0f;
gPlayer[0].unk_0B8 = gPlayer[0].unk_0AC + this->scale; gPlayer[0].xPathTarget = gPlayer[0].xPath + this->width;
} else { } else {
gPlayer[0].unk_118 = 30.0f; gPlayer[0].yRot_118 = 30.0f;
gPlayer[0].unk_0B8 = gPlayer[0].unk_0AC - this->scale; gPlayer[0].xPathTarget = gPlayer[0].xPath - this->width;
} }
break; break;
case OBJ_ITEM_PATH_TURN_LEFT: case OBJ_ITEM_PATH_TURN_LEFT:
gPlayer[0].unk_118 = 30.0f; gPlayer[0].yRot_118 = 30.0f;
gPlayer[0].unk_0B8 = gPlayer[0].unk_0AC - this->scale; gPlayer[0].xPathTarget = gPlayer[0].xPath - this->width;
break; break;
case OBJ_ITEM_PATH_TURN_RIGHT: case OBJ_ITEM_PATH_TURN_RIGHT:
gPlayer[0].unk_118 = -30.0f; gPlayer[0].yRot_118 = -30.0f;
gPlayer[0].unk_0B8 = gPlayer[0].unk_0AC + this->scale; gPlayer[0].xPathTarget = gPlayer[0].xPath + this->width;
break; break;
case OBJ_ITEM_PATH_SPLIT_Y: case OBJ_ITEM_PATH_SPLIT_Y:
if (this->obj.pos.y < gPlayer[0].pos.y) { if (this->obj.pos.y < gPlayer[0].pos.y) {
gPlayer[0].unk_124 = 30.0f; gPlayer[0].xRot_124 = 30.0f;
gPlayer[0].unk_0BC = gPlayer[0].unk_0B0 + this->scale; gPlayer[0].yPathTarget = gPlayer[0].yPath + this->width;
} else { } else {
gPlayer[0].unk_124 = -30.0f; gPlayer[0].xRot_124 = -30.0f;
gPlayer[0].unk_0BC = gPlayer[0].unk_0B0 - this->scale; gPlayer[0].yPathTarget = gPlayer[0].yPath - this->width;
} }
break; break;
case OBJ_ITEM_PATH_TURN_UP: case OBJ_ITEM_PATH_TURN_UP:
gPlayer[0].unk_124 = 30.0f; gPlayer[0].xRot_124 = 30.0f;
gPlayer[0].unk_0BC = gPlayer[0].unk_0B0 + this->scale; gPlayer[0].yPathTarget = gPlayer[0].yPath + this->width;
break; break;
case OBJ_ITEM_PATH_TURN_DOWN: case OBJ_ITEM_PATH_TURN_DOWN:
gPlayer[0].unk_124 = -30.0f; gPlayer[0].xRot_124 = -30.0f;
gPlayer[0].unk_0BC = gPlayer[0].unk_0B0 - this->scale; gPlayer[0].yPathTarget = gPlayer[0].yPath - this->width;
break; break;
} }
} }
@ -2423,10 +2423,10 @@ void ItemPathChange_Update(Item* this) {
} }
void Sprite_UpdateDoodad(Sprite* this) { void Sprite_UpdateDoodad(Sprite* this) {
this->obj.rot.y = (Math_Atan2F(gPlayer[0].cam.eye.x - this->obj.pos.x, this->obj.rot.y =
gPlayer[0].cam.eye.z - (this->obj.pos.z + D_ctx_80177D20)) * (Math_Atan2F(gPlayer[0].cam.eye.x - this->obj.pos.x, gPlayer[0].cam.eye.z - (this->obj.pos.z + gPathProgress)) *
180.0f) / 180.0f) /
M_PI; M_PI;
if (this->unk_46 != 0) { if (this->unk_46 != 0) {
this->obj.status = OBJ_FREE; this->obj.status = OBJ_FREE;
func_effect_8007A6F0(&this->obj.pos, 0x1903400F); func_effect_8007A6F0(&this->obj.pos, 0x1903400F);
@ -2458,7 +2458,7 @@ void Object_Dying(s32 index, ObjectId objId) {
func_enmy2_800763A4(&gActors[index]); func_enmy2_800763A4(&gActors[index]);
break; break;
case OBJ_ACTOR_194: case OBJ_ACTOR_194:
Actor194_Init(&gActors[index]); Actor194_Dying(&gActors[index]);
break; break;
case OBJ_ACTOR_186: case OBJ_ACTOR_186:
Meteo_80187B08(&gActors[index]); Meteo_80187B08(&gActors[index]);
@ -2488,48 +2488,50 @@ void Object_Dying(s32 index, ObjectId objId) {
} }
void Actor_Move(Actor* actor) { void Actor_Move(Actor* actor) {
f32 var_fv0;
actor->obj.pos.x += actor->vel.x; actor->obj.pos.x += actor->vel.x;
actor->obj.pos.z += actor->vel.z; actor->obj.pos.z += actor->vel.z;
actor->obj.pos.y += actor->vel.y; actor->obj.pos.y += actor->vel.y;
actor->vel.y -= actor->gravity; actor->vel.y -= actor->gravity;
if ((D_ctx_80161AB8 != 0) && (actor->obj.id != OBJ_ACTOR_TEAM_BOSS) && if (!gCullObjects || (actor->obj.id == OBJ_ACTOR_TEAM_BOSS) ||
((gCurrentLevel != LEVEL_MACBETH) || (actor->obj.id == OBJ_ACTOR_EVENT))) { ((gCurrentLevel == LEVEL_MACBETH) && (actor->obj.id != OBJ_ACTOR_EVENT))) {
f32 var_fv0 = 4000.0f; return;
}
var_fv0 = 4000.0f;
if ((actor->obj.id == OBJ_ACTOR_236) || (gCurrentLevel == LEVEL_MACBETH) || if ((actor->obj.id == OBJ_ACTOR_236) || (gCurrentLevel == LEVEL_MACBETH) ||
((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == EINFO_56))) { ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == EINFO_56))) {
var_fv0 = 8000.0f; var_fv0 = 8000.0f;
} else if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ENTER_WARP_ZONE) { } else if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ENTER_WARP_ZONE) {
var_fv0 = 100000.0f; var_fv0 = 100000.0f;
} }
if (((gPlayer[0].cam.eye.z + actor->info.unk_10) < (actor->obj.pos.z + D_ctx_80177D20)) || if (((gPlayer[0].cam.eye.z + actor->info.cullDistance) < (actor->obj.pos.z + gPathProgress)) ||
((actor->obj.pos.z + D_ctx_80177D20) < -15000.0f) || (actor->obj.pos.y < (gPlayer[0].unk_0B0 - var_fv0)) || ((actor->obj.pos.z + gPathProgress) < -15000.0f) || (actor->obj.pos.y < (gPlayer[0].yPath - var_fv0)) ||
((gPlayer[0].unk_0B0 + var_fv0) < actor->obj.pos.y) || ((gPlayer[0].yPath + var_fv0) < actor->obj.pos.y) || ((gPlayer[0].xPath + var_fv0) < actor->obj.pos.x) ||
((gPlayer[0].unk_0AC + var_fv0) < actor->obj.pos.x) || (actor->obj.pos.x < (gPlayer[0].xPath - var_fv0))) {
(actor->obj.pos.x < (gPlayer[0].unk_0AC - var_fv0))) { Object_Kill(&actor->obj, actor->sfxSource);
Object_Kill(&actor->obj, actor->sfxSource); switch (actor->obj.id) {
switch (actor->obj.id) { case OBJ_ACTOR_236:
case OBJ_ACTOR_236: D_ctx_801784A4 = 0;
D_ctx_801784A4 = 0; break;
break; case OBJ_ACTOR_229:
case OBJ_ACTOR_229: Titania_8018E3B0(actor);
Titania_8018E3B0(actor); break;
break; case OBJ_ACTOR_194:
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; gActor194Status[actor->unk_046] = 0;
break; } else if ((actor->unk_0B4 == EINFO_38) && (actor->unk_046 != 2)) {
case OBJ_ACTOR_EVENT: gRingPassCount = -1;
if ((actor->unk_0B4 >= EINFO_200) && (actor->unk_0B4 < EINFO_300)) { }
gActor194Status[actor->unk_046] = 0; break;
} else if ((actor->unk_0B4 == EINFO_38) && (actor->unk_046 != 2)) { case OBJ_ACTOR_252:
gRingPassCount = -1; gMissedZoSearchlight = true;
} break;
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.y += boss->vel.y;
boss->obj.pos.z += boss->vel.z; boss->obj.pos.z += boss->vel.z;
boss->vel.y -= boss->gravity; 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 if (gPlayer[0].cam.eye.z) {} // fake
Object_Kill(&boss->obj, boss->sfxSource); Object_Kill(&boss->obj, boss->sfxSource);
} }
@ -2548,7 +2550,7 @@ void Boss_Move(Boss* boss) {
void Scenery_Move(Scenery* scenery) { void Scenery_Move(Scenery* scenery) {
if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) { if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) {
scenery->obj.pos.z += scenery->unk_60; 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); Object_Kill(&scenery->obj, scenery->sfxSource);
} }
} else if ((gLevelMode == LEVELMODE_ON_RAILS) && (gBossActive != 2)) { } else if ((gLevelMode == LEVELMODE_ON_RAILS) && (gBossActive != 2)) {
@ -2559,18 +2561,18 @@ void Scenery_Move(Scenery* scenery) {
var_fa0 = 1000.0f; var_fa0 = 1000.0f;
} }
temp_fv0 = ((temp_fv0 - var_fa0) < 0.0f) ? 0.0f : (temp_fv0 - var_fa0) * 1.7f; 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 = 0.0f;
} }
temp_fv0 -= gPlayer[0].cam.eye.z; 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); Object_Kill(&scenery->obj, scenery->sfxSource);
} }
} }
} }
void Sprite_Move(Sprite* sprite) { 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 temp_fv0 = fabsf(sprite->obj.pos.x - gPlayer[0].cam.eye.x);
f32 var_fa0 = 500.0f; 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 = ((temp_fv0 - var_fa0) < 0.0f) ? 0.0f * 1.7f : (temp_fv0 - var_fa0) * 1.7f;
temp_fv0 -= gPlayer[0].cam.eye.z; 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; sprite->obj.status = OBJ_FREE;
} }
} }
@ -2591,8 +2593,8 @@ void Effect_Move(Effect* effect) {
effect->obj.pos.x += effect->vel.x; effect->obj.pos.x += effect->vel.x;
effect->obj.pos.y += effect->vel.y; effect->obj.pos.y += effect->vel.y;
effect->obj.pos.z += effect->vel.z; effect->obj.pos.z += effect->vel.z;
if (D_ctx_80161AB8 != 0) { if (gCullObjects) {
if ((gPlayer[0].cam.eye.z + effect->info.unk_10) < (effect->obj.pos.z + D_ctx_80177D20)) { if ((gPlayer[0].cam.eye.z + effect->info.cullDistance) < (effect->obj.pos.z + gPathProgress)) {
Object_Kill(&effect->obj, effect->sfxSource); Object_Kill(&effect->obj, effect->sfxSource);
} else if ((fabsf(effect->obj.pos.y - gPlayer[0].cam.eye.y) > 25000.0f) || } 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)) { (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) { void Item_Move(Item* item) {
if (D_ctx_80161AB8 != 0) { if (gCullObjects) {
f32 temp = (0.0f - gPlayer[0].cam.eye.z); 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); Object_Kill(&item->obj, item->sfxSource);
if ((item->obj.id == OBJ_ITEM_METEO_WARP) && (item->state == 0)) { if ((item->obj.id == OBJ_ITEM_METEO_WARP) && (item->state == 0)) {
gRingPassCount = -1; gRingPassCount = -1;
@ -2798,36 +2800,36 @@ void Effect_Update(Effect* this) {
void TexturedLine_Update(TexturedLine* this) { void TexturedLine_Update(TexturedLine* this) {
Vec3f sp44; Vec3f sp44;
Vec3f sp38; Vec3f sp38;
f32 sp34; f32 dx;
f32 sp30; f32 dy;
f32 sp2C; f32 dz;
if (this->timer != 0) { if (this->timer != 0) {
this->timer--; this->timer--;
} }
sp34 = this->unk_04.x - this->unk_10.x; dx = this->posAA.x - this->posBB.x;
sp30 = this->unk_04.y - this->unk_10.y; dy = this->posAA.y - this->posBB.y;
sp2C = this->unk_04.z - this->unk_10.z; dz = this->posAA.z - this->posBB.z;
this->unk_20 = Math_Atan2F(sp34, sp2C); this->yRot = Math_Atan2F(dx, dz);
this->unk_1C = -Math_Atan2F(sp30, sqrtf(SQ(sp34) + SQ(sp2C))); this->xRot = -Math_Atan2F(dy, sqrtf(SQ(dx) + SQ(dz)));
if (this->mode != 4) { 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 (gGameState == GSTATE_PLAY) {
if (((this->mode == 1) || (this->mode == 101) || (this->mode == 50)) && if (((this->mode == 1) || (this->mode == 101) || (this->mode == 50)) &&
(gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (gPlayer[0].unk_1F4 == 0)) { (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (gPlayer[0].hitTimer == 0)) {
Matrix_RotateX(gCalcMatrix, -this->unk_1C, MTXF_NEW); Matrix_RotateX(gCalcMatrix, -this->xRot, MTXF_NEW);
Matrix_RotateY(gCalcMatrix, -this->unk_20, MTXF_APPLY); Matrix_RotateY(gCalcMatrix, -this->yRot, MTXF_APPLY);
sp44.x = gPlayer[gPlayerNum].pos.x - this->unk_04.x; sp44.x = gPlayer[gPlayerNum].pos.x - this->posAA.x;
sp44.y = gPlayer[gPlayerNum].pos.y - this->unk_04.y; sp44.y = gPlayer[gPlayerNum].pos.y - this->posAA.y;
sp44.z = gPlayer[gPlayerNum].unk_138 - this->unk_04.z; sp44.z = gPlayer[gPlayerNum].trueZpos - this->posAA.z;
Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp38); Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp38);
sp38.x += this->unk_04.x; sp38.x += this->posAA.x;
sp38.y += this->unk_04.y; sp38.y += this->posAA.y;
sp38.z += this->unk_04.z; sp38.z += this->posAA.z;
if ((fabsf(sp38.x - this->unk_04.x) < 30.0f) && (fabsf(sp38.y - this->unk_04.y) < 30.0f) && if ((fabsf(sp38.x - this->posAA.x) < 30.0f) && (fabsf(sp38.y - this->posAA.y) < 30.0f) &&
(sp38.z < this->unk_04.z) && ((this->unk_04.z - this->unk_24) < sp38.z)) { (sp38.z < this->posAA.z) && ((this->posAA.z - this->zScale) < sp38.z)) {
if (gCurrentLevel == LEVEL_AQUAS) { if (gCurrentLevel == LEVEL_AQUAS) {
Player_ApplyDamage(&gPlayer[0], 0, 30); Player_ApplyDamage(&gPlayer[0], 0, 30);
} else { } 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; this->mode = 0;
} }
if (((this->mode == 3) || (this->mode == 50)) && (this->timer == 0)) { if (((this->mode == 3) || (this->mode == 50)) && (this->timer == 0)) {
@ -2869,12 +2871,12 @@ void Object_Update(void) {
Item* item; Item* item;
Effect* effect; Effect* effect;
D_ctx_80161AB8 = 0; gCullObjects = false;
if ((gLevelMode == LEVELMODE_ON_RAILS) && 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_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_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))) { (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 (gLevelMode != LEVELMODE_ALL_RANGE) {
if ((gLoadLevelObjects != 0) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO)) { if ((gLoadLevelObjects != 0) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO)) {

View File

@ -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 sp24;
Vec3f sp18; 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); func_effect_8007F11C(OBJ_EFFECT_353, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, gEnemyShotSpeed);
this->timer_0BC = 20; 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.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( this->obj.rot.x = -Math_RadToDeg(
Math_Atan2F(gPlayer[0].cam.eye.y - this->obj.pos.y, Math_Atan2F(gPlayer[0].cam.eye.y - this->obj.pos.y,
@ -147,7 +147,7 @@ void Actor202_Update(Actor202* this) {
this->gravity = 1.5f; this->gravity = 1.5f;
sp34 = false; sp34 = false;
this->obj.rot.y = Math_RadToDeg( 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) { if (this->obj.pos.y < -500.0f) {
this->obj.pos.y = -500.0f; this->obj.pos.y = -500.0f;
this->vel.y = 0.0f; this->vel.y = 0.0f;
@ -209,9 +209,9 @@ void Actor202_Update(Actor202* this) {
break; break;
} }
if (this->unk_0D0 != 0) { if (this->dmgType != 0) {
this->health -= 10; 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_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, 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); this->vel.z, 8.0f, 30);
@ -220,7 +220,7 @@ void Actor202_Update(Actor202* this) {
gHitCount += this->info.bonus; gHitCount += this->info.bonus;
D_ctx_80177850 = 15; D_ctx_80177850 = 15;
} else { } else {
this->unk_0D0 = 0; this->dmgType = 0;
this->timer_0C6 = 20; this->timer_0C6 = 20;
AUDIO_PLAY_SFX(0x2903300E, this->sfxSource, 4); 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); 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 }; 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; Vec3f sp34;
s32 temp_hi; 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 }; Vec3f sp34 = { 0.0f, 0.0f, 0.0f };
Matrix_Push(&gGfxMatrix); 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) { if (arg7 != 1) {
Matrix_RotateY(gGfxMatrix, M_DTOR * yRot, MTXF_APPLY); 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) { if (arg7 != 1) {
RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar);
if ((arg7 == 0) && (this->lockOnTimers[TEAM_ID_FOX] != 0)) { if ((arg7 == 0) && (this->lockOnTimers[TEAM_ID_FOX] != 0)) {
sp34.y += this->info.unk_1C; sp34.y += this->info.targetOffset;
Matrix_MultVec3f(gGfxMatrix, &sp34, D_display_80161578); Matrix_MultVec3f(gGfxMatrix, &sp34, &gLockOnTargetViewPos[TEAM_ID_FOX]);
if (D_display_80161578->z > -500.0f) { if (gLockOnTargetViewPos[TEAM_ID_FOX].z > -500.0f) {
this->lockOnTimers[TEAM_ID_FOX] = 0; 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.x += this->vel.x;
this->obj.pos.y += this->vel.y; this->obj.pos.y += this->vel.y;
this->obj.pos.z += this->vel.z; this->obj.pos.z += this->vel.z;
@ -424,7 +424,7 @@ void Actor196_Update(Actor196* this) {
this->vel.x = sp44.x; this->vel.x = sp44.x;
this->vel.y = sp44.y; this->vel.y = sp44.y;
this->vel.z = sp44.z; 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->state = 2;
this->timer_0BC = 20; this->timer_0BC = 20;
this->vel.z = 0.0f; 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); 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); 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); Object_Kill(&this->obj, this->sfxSource);
this->itemDrop = DROP_SILVER_RING; this->itemDrop = DROP_SILVER_RING;
Actor_Despawn(this); 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 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: case 40:
if (this->unk_04A & 4) { if (this->unk_04A & 4) {
this->obj.pos.x = gPlayer[0].pos.x + this->fwork[3]; 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]; 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.y += this->fwork[1];
this->obj.rot.z += this->fwork[2]; 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) { if (this->obj.pos.y < sp48) {
this->obj.pos.y = sp48; this->obj.pos.y = sp48;
@ -586,7 +586,7 @@ void Actor189_Update(Actor189* this) {
break; break;
case 47: 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)) { if (this->obj.pos.y < this->fwork[3] + (-100.0f + sp48)) {
this->obj.pos.y = this->fwork[3] + sp48; this->obj.pos.y = this->fwork[3] + sp48;
@ -837,7 +837,7 @@ void func_enmy2_8006D0F4(Actor* this) {
D_ctx_80178544 = 40; D_ctx_80178544 = 40;
for (i = 0; i < ARRAY_COUNT(gScenery); i++) { 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]; hitboxData = D_edata_800CF964[gScenery[i].obj.id];
count = *hitboxData; count = *hitboxData;
if (count != 0) { 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; this->obj.rot.z += 1.0f;
} }
@ -878,13 +878,13 @@ typedef struct {
/* 0x00 */ Gfx* dList; /* 0x00 */ Gfx* dList;
/* 0x04 */ f32* hitbox; /* 0x04 */ f32* hitbox;
/* 0x08 */ f32 scale; /* 0x08 */ f32 scale;
/* 0x0C */ f32 info_unk_10; /* 0x0C */ f32 cullDistance;
/* 0x10 */ f32 unk_10; /* 0x10 */ f32 unk_10;
/* 0x14 */ u8 info_unk_16; /* 0x14 */ u8 info_unk_16;
/* 0x15 */ u8 info_unk_14; /* 0x15 */ u8 info_unk_14;
/* 0x16 */ u8 sfx; /* 0x16 */ u8 sfx;
/* 0x17 */ u8 info_unk_19; /* 0x17 */ u8 info_unk_19;
/* 0x18 */ f32 info_unk_1C; /* 0x18 */ f32 targetOffset;
/* 0x1C */ u8 bonus; /* 0x1C */ u8 bonus;
} UnkStruct_D003C; // size = 0x20 } UnkStruct_D003C; // size = 0x20
@ -1064,8 +1064,8 @@ void ActorEvent_ProcessScript(ActorEvent* this) {
switch (EV_OPC_MASK(actorScript[this->aiIndex])) { switch (EV_OPC_MASK(actorScript[this->aiIndex])) {
case EV_OPC(EVOP_STOP_SCRIPT): case EV_OPC(EVOP_STOP_SCRIPT):
this->state = EVSTATE_SCRIPT_END; this->state = EVSTATE_SCRIPT_END;
if (this->info.unk_10 > 10000.0f) { if (this->info.cullDistance > 10000.0f) {
this->info.unk_10 = 100.0f; this->info.cullDistance = 100.0f;
} }
break; break;
@ -1094,7 +1094,7 @@ void ActorEvent_ProcessScript(ActorEvent* this) {
if ((this->unk_0B4 >= EINFO_200) && (this->unk_0B4 < EINFO_300)) { if ((this->unk_0B4 >= EINFO_200) && (this->unk_0B4 < EINFO_300)) {
this->unk_046 = 100; this->unk_046 = 100;
this->info.hitbox = gCubeHitbox200; this->info.hitbox = gCubeHitbox200;
this->info.unk_1C = 1.0f; this->info.targetOffset = 1.0f;
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
if (gActor194Status[i] == 0) { 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_16 = D_800D003C[this->unk_0B4].info_unk_16;
this->info.unk_14 = D_800D003C[this->unk_0B4].info_unk_14; 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_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; this->info.bonus = D_800D003C[this->unk_0B4].bonus;
if (this->unk_0B4 == EINFO_78) { if (this->unk_0B4 == EINFO_78) {
this->info.damage = 0; 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; this->fwork[25] = D_800D003C[this->unk_0B4].unk_10;
switch (D_800D003C[this->unk_0B4].sfx) { switch (D_800D003C[this->unk_0B4].sfx) {
@ -1185,8 +1185,8 @@ void ActorEvent_ProcessScript(ActorEvent* this) {
break; break;
} }
if (gPlayer[0].unk_138 < this->obj.pos.z) { if (gPlayer[0].trueZpos < this->obj.pos.z) {
this->info.unk_10 = 3000.0f; this->info.cullDistance = 3000.0f;
} }
if (this->info.unk_16 == 0) { if (this->info.unk_16 == 0) {
@ -1323,9 +1323,9 @@ void ActorEvent_ProcessScript(ActorEvent* this) {
case EV_OPC(EVOP_DAMAGE_TEAM): case EV_OPC(EVOP_DAMAGE_TEAM):
if (this->iwork[12] == actorScript[this->aiIndex + 1]) { if (this->iwork[12] == actorScript[this->aiIndex + 1]) {
this->unk_0D0 = 1; this->dmgType = 1;
this->damage = actorScript[this->aiIndex] & 0x1FF; this->damage = actorScript[this->aiIndex] & 0x1FF;
this->unk_0D4 = 100; this->dmgSource = 100;
} else { } else {
gTeamDamage[actorScript[this->aiIndex + 1]] = actorScript[this->aiIndex] & 0x1FF; 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++) { for (i = 0; i < ARRAY_COUNT(gTexturedLines); i++) {
if (gTexturedLines[i].mode == 0) { if (gTexturedLines[i].mode == 0) {
gTexturedLines[i].mode = 1; gTexturedLines[i].mode = 1;
gTexturedLines[i].unk_28 = 3.0f; gTexturedLines[i].xyScale = 3.0f;
gTexturedLines[i].unk_04.x = this->obj.pos.x - this->vel.x; gTexturedLines[i].posAA.x = this->obj.pos.x - this->vel.x;
gTexturedLines[i].unk_04.y = this->obj.pos.y - this->vel.y; gTexturedLines[i].posAA.y = this->obj.pos.y - this->vel.y;
gTexturedLines[i].unk_04.z = this->obj.pos.z - this->vel.z; gTexturedLines[i].posAA.z = this->obj.pos.z - this->vel.z;
gTexturedLines[i].unk_2C = D_800D0DBC[actorScript[this->aiIndex + 1]][0]; gTexturedLines[i].red = D_800D0DBC[actorScript[this->aiIndex + 1]][0];
gTexturedLines[i].unk_2D = D_800D0DBC[actorScript[this->aiIndex + 1]][1]; gTexturedLines[i].green = D_800D0DBC[actorScript[this->aiIndex + 1]][1];
gTexturedLines[i].unk_2E = D_800D0DBC[actorScript[this->aiIndex + 1]][2]; gTexturedLines[i].blue = D_800D0DBC[actorScript[this->aiIndex + 1]][2];
gTexturedLines[i].unk_2F = D_800D0DBC[actorScript[this->aiIndex + 1]][3]; gTexturedLines[i].alpha = D_800D0DBC[actorScript[this->aiIndex + 1]][3];
this->iwork[8] = i; this->iwork[8] = i;
break; break;
} }
@ -1573,9 +1573,9 @@ void ActorEvent_ProcessScript(ActorEvent* this) {
void ActorEvent_UpdateTexLines(ActorEvent* this) { void ActorEvent_UpdateTexLines(ActorEvent* this) {
if ((this->iwork[7] != 0) && (gTexturedLines[this->iwork[8]].mode != 0)) { 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]].posBB.x = this->obj.pos.x;
gTexturedLines[this->iwork[8]].unk_10.y = this->obj.pos.y; gTexturedLines[this->iwork[8]].posBB.y = this->obj.pos.y;
gTexturedLines[this->iwork[8]].unk_10.z = this->obj.pos.z; gTexturedLines[this->iwork[8]].posBB.z = this->obj.pos.z;
} }
} }
@ -1794,7 +1794,7 @@ void ActorEvent_ProcessActions(ActorEvent* this) {
break; break;
case EVACT_2: 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, func_effect_8007F11C(OBJ_EFFECT_353, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z,
gEnemyShotSpeed); gEnemyShotSpeed);
} }
@ -1844,7 +1844,7 @@ void ActorEvent_ProcessActions(ActorEvent* this) {
break; break;
case EVACT_6: 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, func_effect_8007F11C(OBJ_EFFECT_355, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z,
gEnemyShotSpeed); gEnemyShotSpeed);
} }
@ -1852,7 +1852,7 @@ void ActorEvent_ProcessActions(ActorEvent* this) {
break; break;
case EVACT_7: 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); 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; this->unk_048 = EVACT_NONE;
@ -1975,7 +1975,7 @@ void ActorEvent_ProcessActions(ActorEvent* this) {
void ActorEvent_8006FE28(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) && 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(); func_enmy_80067A40();
Audio_KillSfxBySourceAndId(this->sfxSource, 0x1900302B); Audio_KillSfxBySourceAndId(this->sfxSource, 0x1900302B);
Object_Kill(&this->obj, this->sfxSource); Object_Kill(&this->obj, this->sfxSource);
@ -1985,8 +1985,8 @@ void ActorEvent_8006FE28(ActorEvent* this) {
void ActorEvent_8006FEEC(ActorEvent* this) { void ActorEvent_8006FEEC(ActorEvent* this) {
s32 i; s32 i;
if ((this->unk_0D0 != 0) && (this->health != 0)) { if ((this->dmgType != 0) && (this->health != 0)) {
this->unk_0D0 = 0; this->dmgType = 0;
this->timer_0C6 = 15; this->timer_0C6 = 15;
this->health -= this->damage; this->health -= this->damage;
@ -2029,7 +2029,7 @@ bool ActorEvent_800700A4(ActorEvent* this) {
gTeamShields[this->iwork[12]] = -1; gTeamShields[this->iwork[12]] = -1;
gTeamDamage[this->iwork[12]] = 0; gTeamDamage[this->iwork[12]] = 0;
this->timer_0C2 = 5000; this->timer_0C2 = 5000;
this->unk_0D0 = 0; this->dmgType = 0;
return true; return true;
} }
return false; return false;
@ -2037,22 +2037,22 @@ bool ActorEvent_800700A4(ActorEvent* this) {
void ActorEvent_800701E0(ActorEvent* this) { void ActorEvent_800701E0(ActorEvent* this) {
Vec3f sp3C; Vec3f sp3C;
f32 var_fv1; f32 chance;
f32 temp_fv1; f32 temp_fv1;
if (ActorEvent_800700A4(this)) { if (ActorEvent_800700A4(this)) {
return; return;
} }
if ((this->unk_0D0 != 0) && (this->unk_0B4 == EINFO_67) && (this->unk_0D2 == 0)) { if ((this->dmgType != 0) && (this->unk_0B4 == EINFO_67) && (this->dmgPart == 0)) {
this->unk_0D0 = 0; this->dmgType = 0;
} }
if ((this->unk_0D0 != 0) && (this->unk_0B4 == EINFO_83) && (this->timer_0C2 >= 2)) { if ((this->dmgType != 0) && (this->unk_0B4 == EINFO_83) && (this->timer_0C2 >= 2)) {
this->unk_0D0 = 0; this->dmgType = 0;
} }
if ((this->unk_0D0 != 0) && if ((this->dmgType != 0) &&
(((this->unk_0B4 == EINFO_64) && (this->unk_0D2 == 2)) || (this->unk_0B4 != EINFO_64))) { (((this->unk_0B4 == EINFO_64) && (this->dmgPart == 2)) || (this->unk_0B4 != EINFO_64))) {
if (this->iwork[12] >= TEAM_ID_KATT) { if (this->iwork[12] >= TEAM_ID_KATT) {
this->damage = 0; this->damage = 0;
} }
@ -2081,18 +2081,18 @@ void ActorEvent_800701E0(ActorEvent* this) {
} }
this->obj.status = OBJ_DYING; this->obj.status = OBJ_DYING;
var_fv1 = 0.7f; chance = 0.7f;
if (gLevelType == LEVELTYPE_SPACE) { 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->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->damage <= 30) && (this->unk_0B4 != EINFO_62) && (this->unk_0B4 != EINFO_64) &&
(this->unk_0B4 != EINFO_72) && (this->unk_0B4 != EINFO_68)) { (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); 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; this->timer_0C2 = 10;
@ -2123,7 +2123,7 @@ void ActorEvent_800701E0(ActorEvent* this) {
} else { } else {
this->vel.z = this->vel.z * 0.3f; 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); this->vel.z = RAND_FLOAT(-10.0f);
} }
} }
@ -2146,9 +2146,9 @@ void ActorEvent_800701E0(ActorEvent* this) {
this->obj.status = OBJ_ACTIVE; this->obj.status = OBJ_ACTIVE;
func_effect_8007D0E0(this->obj.pos.x - this->vel.x, this->obj.pos.y + 30.0f, 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->obj.pos.z - this->vel.z, this->scale * 5.0f);
this->unk_0D0 = 0; this->dmgType = 0;
this->timer_0C2 = 10000; this->timer_0C2 = 10000;
this->info.unk_1C = 0.0f; this->info.targetOffset = 0.0f;
gHitCount += this->info.bonus; gHitCount += this->info.bonus;
D_ctx_80177850 = 15; D_ctx_80177850 = 15;
break; break;
@ -2166,7 +2166,7 @@ void ActorEvent_800701E0(ActorEvent* this) {
if (this->unk_0B4 == EINFO_82) { if (this->unk_0B4 == EINFO_82) {
AUDIO_PLAY_SFX(0x11000055, this->sfxSource, 0); 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); func_effect_8007C688(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 3.0f, 60);
} }
} else { } else {
@ -2191,10 +2191,10 @@ void ActorEvent_800701E0(ActorEvent* this) {
} }
} }
if (this->unk_0D4 == 1) { if (this->dmgSource == 1) {
switch (this->iwork[12]) { switch (this->iwork[12]) {
case TEAM_ID_FALCO: case TEAM_ID_FALCO:
if (this->unk_0D0 == 3) { if (this->dmgType == 3) {
ActorEvent_SetMessage(gMsg_ID_20210, RCID_FALCO); ActorEvent_SetMessage(gMsg_ID_20210, RCID_FALCO);
} else { } else {
ActorEvent_SetMessage(gMsg_ID_20060, RCID_FALCO); ActorEvent_SetMessage(gMsg_ID_20060, RCID_FALCO);
@ -2202,7 +2202,7 @@ void ActorEvent_800701E0(ActorEvent* this) {
break; break;
case TEAM_ID_PEPPY: case TEAM_ID_PEPPY:
if (this->unk_0D0 == 3) { if (this->dmgType == 3) {
ActorEvent_SetMessage(gMsg_ID_20200, RCID_PEPPY); ActorEvent_SetMessage(gMsg_ID_20200, RCID_PEPPY);
} else { } else {
ActorEvent_SetMessage(gMsg_ID_20070, RCID_PEPPY); ActorEvent_SetMessage(gMsg_ID_20070, RCID_PEPPY);
@ -2210,7 +2210,7 @@ void ActorEvent_800701E0(ActorEvent* this) {
break; break;
case TEAM_ID_SLIPPY: case TEAM_ID_SLIPPY:
if (this->unk_0D0 == 3) { if (this->dmgType == 3) {
ActorEvent_SetMessage(gMsg_ID_20190, RCID_SLIPPY); ActorEvent_SetMessage(gMsg_ID_20190, RCID_SLIPPY);
} else { } else {
ActorEvent_SetMessage(gMsg_ID_20080, RCID_SLIPPY); ActorEvent_SetMessage(gMsg_ID_20080, RCID_SLIPPY);
@ -2226,7 +2226,7 @@ void ActorEvent_800701E0(ActorEvent* this) {
break; break;
} }
} }
this->unk_0D0 = 0; this->dmgType = 0;
} }
} }
if ((this->iwork[12] == 0) && (this->iwork[13] == 0) && (this->info.unk_16 != 2) && 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.pos.y < (gGroundHeight + 20.0f))) {
this->obj.status = OBJ_DYING; this->obj.status = OBJ_DYING;
this->obj.pos.z -= this->vel.z; this->obj.pos.z -= this->vel.z;
this->unk_0D0 = 1; this->dmgType = 1;
if (this->unk_0B4 == EINFO_13) { if (this->unk_0B4 == EINFO_13) {
this->obj.id = OBJ_ACTOR_182; this->obj.id = OBJ_ACTOR_182;
func_enmy_800654E4(&this->obj); func_enmy_800654E4(&this->obj);
@ -2253,9 +2253,9 @@ void ActorEvent_800701E0(ActorEvent* this) {
} }
void ActorEvent_80070BA8(ActorEvent* this) { void ActorEvent_80070BA8(ActorEvent* this) {
if (this->unk_0D0 != 0) { if (this->dmgType != 0) {
this->unk_0D0 = 0; this->dmgType = 0;
if ((this->unk_0B4 != EINFO_17) || ((this->unk_0B4 == EINFO_17) && (this->unk_0D2 == 0))) { if ((this->unk_0B4 != EINFO_17) || ((this->unk_0B4 == EINFO_17) && (this->dmgPart == 0))) {
this->timer_0C6 = 10; 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, func_effect_8007C120(this->hitPos.x, this->hitPos.y, this->hitPos.z, this->vel.x, this->vel.y, this->vel.z,
0.2f, 10); 0.2f, 10);
@ -2300,7 +2300,7 @@ void ActorEvent_ProcessTriggers(ActorEvent* this) {
} }
if (this->iwork[2] >= EVC_CLOSE_Z) { 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); ActorEvent_TriggerBranch(this);
} }
return; return;
@ -2591,7 +2591,7 @@ void ActorEvent_ProcessTriggers(ActorEvent* this) {
break; break;
case EVC_TOOK_DAMAGE: case EVC_TOOK_DAMAGE:
if (this->unk_0D0 != 0) { if (this->dmgType != 0) {
ActorEvent_TriggerBranch(this); ActorEvent_TriggerBranch(this);
} }
break; break;
@ -2846,12 +2846,12 @@ void ActorEvent_80071DC0(ActorEvent* this) {
void ActorEvent_800720E8(ActorEvent* this) { void ActorEvent_800720E8(ActorEvent* this) {
switch (this->unk_046) { switch (this->unk_046) {
case 0: case 0:
if (this->unk_0D0 != 0) { if (this->dmgType != 0) {
if (this->unk_0D0 == 2) { if (this->dmgType == 2) {
this->damage = 3; 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; this->damage = 20;
} }
@ -2870,7 +2870,7 @@ void ActorEvent_800720E8(ActorEvent* this) {
} else { } else {
AUDIO_PLAY_SFX(0x2903300E, this->sfxSource, 0); AUDIO_PLAY_SFX(0x2903300E, this->sfxSource, 0);
} }
this->unk_0D0 = 0; this->dmgType = 0;
} }
break; break;
@ -2941,7 +2941,7 @@ void ActorEvent_80072474(ActorEvent* this) {
} }
if (this->iwork[15] != 0) { 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) { } else if (this->iwork[6] != 0) {
var_fv1 = this->unk_0F4.y; var_fv1 = this->unk_0F4.y;
} else { } else {
@ -3008,8 +3008,8 @@ void ActorEvent_Update(ActorEvent* this) {
gActor194yRot[this->unk_046][this->unk_04E] = this->obj.rot.y; gActor194yRot[this->unk_046][this->unk_04E] = this->obj.rot.y;
gActor194zRot[this->unk_046][this->unk_04E] = this->obj.rot.z; gActor194zRot[this->unk_046][this->unk_04E] = this->obj.rot.z;
if (this->unk_0D0 != 0) { if (this->dmgType != 0) {
this->unk_0D0 = 0; this->dmgType = 0;
this->timer_0C6 = 20; this->timer_0C6 = 20;
this->health -= this->damage; this->health -= this->damage;
@ -3377,13 +3377,13 @@ void ActorEvent_Update(ActorEvent* this) {
if (this->iwork[5] == EV_ZMODE(EMZ_RELATIVE)) { if (this->iwork[5] == EV_ZMODE(EMZ_RELATIVE)) {
this->vel.z -= this->fwork[22]; this->vel.z -= this->fwork[22];
if ((gCurrentLevel == LEVEL_SECTOR_Y) && (D_ctx_80177D08 < 0.0f)) { if ((gCurrentLevel == LEVEL_SECTOR_Y) && (gPathVelZ < 0.0f)) {
this->vel.z -= D_ctx_80177D08; this->vel.z -= gPathVelZ;
} }
} }
if (this->iwork[5] == EV_ZMODE(EMZ_PLAYER)) { 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) { if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ENTER_WARP_ZONE) {
@ -3400,9 +3400,9 @@ void ActorEvent_Update(ActorEvent* this) {
if (this->scale <= -1.999f) { if (this->scale <= -1.999f) {
ActorEvent_80070BA8(this); ActorEvent_80070BA8(this);
} else { } 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_0B4 != EINFO_49) && (this->unk_0B4 != EINFO_50)) {
this->unk_0D0 = 0; this->dmgType = 0;
if (gCurrentLevel == LEVEL_METEO) { if (gCurrentLevel == LEVEL_METEO) {
AUDIO_PLAY_SFX(0x2902107D, this->sfxSource, 4); AUDIO_PLAY_SFX(0x2902107D, this->sfxSource, 4);
} else { } else {
@ -3790,7 +3790,7 @@ bool ActorEvent_OverrideLimbDraw3(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f*
return false; return false;
} }
s32 Obj111_Draw(Scenery_111* this) { s32 Scenery111_Draw(Scenery_111* this) {
RCP_SetupDL(&gMasterDisp, 0x3C); RCP_SetupDL(&gMasterDisp, 0x3C);
gSPDisplayList(gMasterDisp++, D_SY_601AD70); gSPDisplayList(gMasterDisp++, D_SY_601AD70);
RCP_SetupDL(&gMasterDisp, 0x40); RCP_SetupDL(&gMasterDisp, 0x40);
@ -4214,7 +4214,7 @@ void func_enmy2_800763A4(Actor* actor) {
} }
if (gGroundType == 4) { 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_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, 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); 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))) { ((actor->itemDrop != DROP_NONE) && (actor->obj.id != OBJ_ACTOR_ALLRANGE))) {
if (gLevelMode == LEVELMODE_ALL_RANGE) { if (gLevelMode == LEVELMODE_ALL_RANGE) {
for (var_s0 = 0; var_s0 < 4; var_s0++) { for (var_s0 = 0; var_s0 < 4; var_s0++) {

View File

@ -100,7 +100,7 @@ void Game_SetGameState(void) {
gNextGameState = GSTATE_NONE; gNextGameState = GSTATE_NONE;
gSceneSetup = 0; gSceneSetup = 0;
gFillScreenColor = gBgColor = 0; gFillScreenColor = gBgColor = 0;
D_ctx_80177D20 = 0.0f; gPathProgress = 0.0f;
if ((gCurrentLevel == LEVEL_VENOM_2) && (gLevelPhase == 2)) { if ((gCurrentLevel == LEVEL_VENOM_2) && (gLevelPhase == 2)) {
gFillScreenColor = gBgColor = 0xFFFF; // 248, 248, 248 gFillScreenColor = gBgColor = 0xFFFF; // 248, 248, 248
gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255;
@ -389,7 +389,7 @@ void Game_Update(void) {
Play_ClearObjectData(); Play_ClearObjectData();
gCamCount = 1; gCamCount = 1;
gLifeCount[0] = 2; gLifeCount[0] = 2;
D_ctx_80177D20 = 0.0f; gPathProgress = 0.0f;
D_hud_8016170C = gCsFrameCount = gShowLevelClearStatusScreen = gLevelStartStatusScreenTimer = D_hud_8016170C = gCsFrameCount = gShowLevelClearStatusScreen = gLevelStartStatusScreenTimer =
gLevelClearScreenTimer = gVsMatchState = gVersusMode = gTitleState = gStarCount = gMapState = gLevelClearScreenTimer = gVsMatchState = gVersusMode = gTitleState = gStarCount = gMapState =
gPlayState = gOptionMenuStatus = gDrawMode = gShowBossHealth = gShowHud = gBgColor = gPlayState = gOptionMenuStatus = gDrawMode = gShowBossHealth = gShowHud = gBgColor =

View File

@ -1559,7 +1559,7 @@ void func_hud_80088970(void) {
D_ctx_80177CA4 = D_play_80161A5C; D_ctx_80177CA4 = D_play_80161A5C;
} }
D_ctx_80177CB0 = 0.0f; gSavedPathProgress = 0.0f;
gAllRangeCheckpoint = 0; gAllRangeCheckpoint = 0;
gSavedZoSearchlightStatus = false; gSavedZoSearchlightStatus = false;
@ -1568,7 +1568,7 @@ void func_hud_80088970(void) {
Audio_StopPlayerNoise(0); Audio_StopPlayerNoise(0);
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_NEXT; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_NEXT;
gScreenFlashTimer = 0; gScreenFlashTimer = 0;
gPlayer[0].timer_1F8 = 0; gPlayer[0].csTimer = 0;
gFillScreenAlpha = gFillScreenAlphaTarget = 255; gFillScreenAlpha = gFillScreenAlphaTarget = 255;
gFadeoutType = 7; gFadeoutType = 7;
@ -1953,8 +1953,8 @@ void func_hud_8008A240(void) {
} }
gRadarMarks[i].status = 1; gRadarMarks[i].status = 1;
gRadarMarks[i].type = i; gRadarMarks[i].type = i;
gRadarMarks[i].unk_10 = gPlayer[i].unk_114 + gPlayer[i].unk_0E8; gRadarMarks[i].yRot = gPlayer[i].yRot_114 + gPlayer[i].rot.y;
gRadarMarks[i].pos.z = gPlayer[i].unk_138; gRadarMarks[i].pos.z = gPlayer[i].trueZpos;
gRadarMarks[i].pos.x = gPlayer[i].pos.x; gRadarMarks[i].pos.x = gPlayer[i].pos.x;
if (gPlayerNum == i) { 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.x = item->obj.pos.x;
gRadarMarks[item->index + 50].pos.y = item->obj.pos.y; gRadarMarks[item->index + 50].pos.y = item->obj.pos.y;
gRadarMarks[item->index + 50].pos.z = item->obj.pos.z; 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); Matrix_Translate(gGfxMatrix, gRadarMarks[i].pos.x * 0.008f, -gRadarMarks[i].pos.z * 0.008f, 0.0f, MTXF_APPLY);
if (gRadarMarks[i].type == 103) { 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_Scale(gGfxMatrix, scale, scale, 1.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp); Matrix_SetGfxMtx(&gMasterDisp);
@ -2460,7 +2460,7 @@ s32 func_hud_8008B774(void) {
(gCurrentLevel == LEVEL_SECTOR_Y))) { (gCurrentLevel == LEVEL_SECTOR_Y))) {
for (i = 0; i < 60; i++) { for (i = 0; i < 60; i++) {
if ((gActors[i].obj.status == OBJ_ACTIVE) && (gActors[i].iwork[12] == temp)) { 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].obj.id == OBJ_ACTOR_TEAM_BOSS) &&
((gActors[i].aiType == AI360_FALCO) || (gActors[i].aiType == AI360_SLIPPY) || ((gActors[i].aiType == AI360_FALCO) || (gActors[i].aiType == AI360_SLIPPY) ||
(gActors[i].aiType == AI360_PEPPY)))) { (gActors[i].aiType == AI360_PEPPY)))) {
@ -2478,7 +2478,7 @@ s32 func_hud_8008B774(void) {
switch (i) { switch (i) {
case 0: case 0:
if (gPlayer[0].timer_220) { if (gPlayer[0].radioDamageTimer) {
ret = 1; ret = 1;
} }
break; break;
@ -3913,11 +3913,11 @@ bool func_hud_80090A00(Actor* actor) {
break; break;
case 4: case 4:
actor->fwork[6] = gPlayer[0].unk_138; actor->fwork[6] = gPlayer[0].trueZpos;
actor->fwork[5] = 100.0f; actor->fwork[5] = 100.0f;
actor->fwork[4] = gPlayer[0].pos.x; actor->fwork[4] = gPlayer[0].pos.x;
if ((fabsf(actor->obj.pos.x - gPlayer[0].pos.x) < 300.0f) && 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[5] = 5;
actor->iwork[3] = 20; actor->iwork[3] = 20;
actor->iwork[2] = 0; actor->iwork[2] = 0;
@ -3925,7 +3925,7 @@ bool func_hud_80090A00(Actor* actor) {
break; break;
case 5: 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[5] = 1000.0f;
actor->fwork[4] = gPlayer[0].pos.x - 1000.0f; actor->fwork[4] = gPlayer[0].pos.x - 1000.0f;
actor->iwork[2]++; actor->iwork[2]++;
@ -4068,7 +4068,7 @@ bool func_hud_80091298(Actor* actor) {
actor->fwork[3] = 3.6f; actor->fwork[3] = 3.6f;
actor->fwork[4] = gPlayer[0].pos.x + ((f32) (actor->aiType - 2) * 700.0f); actor->fwork[4] = gPlayer[0].pos.x + ((f32) (actor->aiType - 2) * 700.0f);
actor->fwork[5] = gPlayer[0].pos.y; 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)) { 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; 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->obj.pos.y = gGroundHeight + 40.0f;
actor->vel.y = 0.0f; actor->vel.y = 0.0f;
} }
actor->vel.z -= D_ctx_80177D08; actor->vel.z -= gPathVelZ;
return false; return false;
} }
@ -4335,11 +4335,11 @@ bool func_hud_80091DF4(Actor* actor) {
} }
bool func_hud_80091F00(Actor* actor) { bool func_hud_80091F00(Actor* actor) {
u8 temp_v0 = actor->unk_0D0; u8 temp_v0 = actor->dmgType;
Vec3f sp40; Vec3f sp40;
Vec3f sp34; Vec3f sp34;
actor->unk_0D0 = 0; actor->dmgType = 0;
if ((actor->state == 3) || (temp_v0 == 2)) { if ((actor->state == 3) || (temp_v0 == 2)) {
return false; return false;
@ -4376,7 +4376,7 @@ bool func_hud_80091F00(Actor* actor) {
return false; return false;
} }
if ((actor->unk_0D0 == 3) && (actor->unk_0D4 == 1)) { if ((actor->dmgType == 3) && (actor->dmgSource == 1)) {
switch (actor->aiType) { switch (actor->aiType) {
case AI360_FALCO: case AI360_FALCO:
Radio_PlayMessage(gMsg_ID_20210, RCID_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) { switch (actor->aiType) {
case AI360_FALCO: case AI360_FALCO:
Radio_PlayMessage(gMsg_ID_20060, RCID_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) { switch (actor->aiType) {
case AI360_FALCO: case AI360_FALCO:
Radio_PlayMessage(gMsg_ID_20030, RCID_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.x = actor->obj.pos.x;
gRadarMarks[actor->index].pos.y = actor->obj.pos.y; gRadarMarks[actor->index].pos.y = actor->obj.pos.y;
gRadarMarks[actor->index].pos.z = actor->obj.pos.z; 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) { 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); 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) { if (actor->fwork[28] < 0.0f) {
actor->fwork[28] = actor->fwork[28] + 0.2f; actor->fwork[28] = actor->fwork[28] + 0.2f;
} }
@ -4705,7 +4705,7 @@ void ActorTeamBoss_Update(ActorTeamBoss* this) {
func_hud_80091B90(this); func_hud_80091B90(this);
func_hud_80091DF4(this); func_hud_80091DF4(this);
if (this->unk_0D0 != 0) { if (this->dmgType != 0) {
func_hud_80091F00(this); func_hud_80091F00(this);
} }
@ -4826,7 +4826,7 @@ void func_hud_80093310(void) {
this->obj.pos.z -= 5000.0f; this->obj.pos.z -= 5000.0f;
gActors[0].unk_0B6 = 1; gActors[0].unk_0B6 = 1;
if (1) {} if (1) {}
this->obj.id = OBJ_ACTOR_195; this->obj.id = OBJ_ACTOR_CUTSCENE;
Object_SetInfo(&this->info, this->obj.id); Object_SetInfo(&this->info, this->obj.id);
AUDIO_PLAY_SFX(0x11030010, this->sfxSource, 0); 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; effect->obj.pos.z = z;
if ((player->state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && (gCurrentLevel == LEVEL_AQUAS) && if ((player->state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && (gCurrentLevel == LEVEL_AQUAS) &&
(player->unk_1D0 < 2)) { (player->csState < 2)) {
effect->scale1 = 0.4f; effect->scale1 = 0.4f;
effect->unk_44 = 0; effect->unk_44 = 0;
effect->unk_46 = 24; 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; effect->unk_48 = -effect->unk_48;
} }
if (player->unk_1D0 >= 5) { if (player->csState >= 5) {
effect->unk_4A = 96; effect->unk_4A = 96;
effect->unk_46 = 4; effect->unk_46 = 4;
} else { } else {
@ -4920,7 +4920,7 @@ void HUD_AquasStart(Player* player) {
actor = &gActors[0]; actor = &gActors[0];
switch (player->unk_1D0) { switch (player->csState) {
case 0: case 0:
func_hud_80093310(); func_hud_80093310();
@ -4928,7 +4928,7 @@ void HUD_AquasStart(Player* player) {
D_ctx_80177AB0 = 1; D_ctx_80177AB0 = 1;
gAqDrawMode = 1; gAqDrawMode = 1;
player->unk_234 = 0; player->unk_234 = 0;
player->unk_1D0 = 1; player->csState = 1;
player->unk_208 = 0; player->unk_208 = 0;
player->baseSpeed = 0.0f; player->baseSpeed = 0.0f;
@ -5051,7 +5051,7 @@ void HUD_AquasStart(Player* player) {
if (gCsFrameCount >= 50) { if (gCsFrameCount >= 50) {
// clang-format off // clang-format off
if (gFillScreenAlpha == 255) { player->unk_1D0 = 2; } if (gFillScreenAlpha == 255) { player->csState = 2; }
// clang-format on // clang-format on
gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255;
gFillScreenAlphaTarget = 255; gFillScreenAlphaTarget = 255;
@ -5082,14 +5082,14 @@ void HUD_AquasStart(Player* player) {
D_ctx_80177A48[3] = -1600.0f; D_ctx_80177A48[3] = -1600.0f;
D_ctx_80177A48[4] = 520.0f; D_ctx_80177A48[4] = 520.0f;
player->unk_1D0 = 3; player->csState = 3;
D_ctx_80177AB0 = 0; D_ctx_80177AB0 = 0;
player->camRoll = 60.0f; 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.z = -5100.0f;
player->pos.x = -50.0f; player->pos.x = -50.0f;
@ -5104,7 +5104,7 @@ void HUD_AquasStart(Player* player) {
case 3: case 3:
gFillScreenAlphaStep = 16; gFillScreenAlphaStep = 16;
if (player->timer_1F8 >= 775) { if (player->csTimer > 774) {
if (D_ctx_80177A48[4] >= 200.0f) { if (D_ctx_80177A48[4] >= 200.0f) {
Math_SmoothStepToF(&D_ctx_80177A48[4], -200.0f, 1.00f, 4.0f, 4.0f); Math_SmoothStepToF(&D_ctx_80177A48[4], -200.0f, 1.00f, 4.0f, 4.0f);
} else { } else {
@ -5132,12 +5132,12 @@ void HUD_AquasStart(Player* player) {
player->cam.eye.z = gCsCamEyeZ; player->cam.eye.z = gCsCamEyeZ;
} }
if (player->timer_1F8 == 774) { if (player->csTimer == 774) {
AUDIO_PLAY_SFX(0x01038026, player->sfxSource, 0); AUDIO_PLAY_SFX(0x01038026, player->sfxSource, 0);
D_ctx_80177A10[9] = 40; D_ctx_80177A10[9] = 40;
} }
if (player->timer_1F8 < 775) { if (player->csTimer <= 774) {
D_ctx_80177A48[0] = 0.0f; D_ctx_80177A48[0] = 0.0f;
temp2 = 0.0f; temp2 = 0.0f;
@ -5167,7 +5167,7 @@ void HUD_AquasStart(Player* player) {
player->pos.y = dest.y; player->pos.y = dest.y;
player->pos.z = dest.z; 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); 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]++; 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++) { for (i = 0; i < 8; i++) {
Aquas_801AC8A8(player->cam.eye.x + RAND_FLOAT_CENTERED(D_800D22C4), Aquas_801AC8A8(player->cam.eye.x + RAND_FLOAT_CENTERED(D_800D22C4),
player->cam.eye.y + 260.0f + RAND_FLOAT_CENTERED(D_800D22C8), 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) { if (player->csTimer < 736) {
player->unk_1D0 = 4; player->csState = 4;
gAqDrawMode = 1; gAqDrawMode = 1;
gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255;
gFillScreenAlphaTarget = 255; gFillScreenAlphaTarget = 255;
@ -5200,7 +5200,7 @@ void HUD_AquasStart(Player* player) {
case 4: case 4:
if (gFillScreenAlpha == 255) { if (gFillScreenAlpha == 255) {
player->unk_1D0 = 5; player->csState = 5;
} }
break; break;
@ -5209,12 +5209,12 @@ void HUD_AquasStart(Player* player) {
player->pos.y = 350.0f; player->pos.y = 350.0f;
player->pos.z = 0.0f; player->pos.z = 0.0f;
player->cam.eye.x = player->pos.x * (600.0f / player->unk_09C); player->cam.eye.x = player->pos.x * (600.0f / player->pathWidth);
player->cam.eye.y = player->pos.y * (1040.0f / player->unk_0A0); player->cam.eye.y = player->pos.y * (1040.0f / player->pathHeight);
player->cam.eye.y -= 50.0f; player->cam.eye.y -= 50.0f;
player->cam.at.x = player->pos.x * (600.0f / player->unk_09C); player->cam.at.x = player->pos.x * (600.0f / player->pathWidth);
player->cam.at.y = player->pos.y * (1050.0f / player->unk_0A0); player->cam.at.y = player->pos.y * (1050.0f / player->pathHeight);
player->cam.at.y += player->unk_060 * 10.0f; player->cam.at.y += player->unk_060 * 10.0f;
player->pos.z += 1000.0f; player->pos.z += 1000.0f;
@ -5222,12 +5222,12 @@ void HUD_AquasStart(Player* player) {
D_ctx_80177A48[0] = 0.1f; D_ctx_80177A48[0] = 0.1f;
player->unk_0E8 = 0.0f; player->rot.y = 0.0f;
player->baseSpeed = 20.0f; player->baseSpeed = 20.0f;
player->unk_234 = 1; player->unk_234 = 1;
player->unk_1D0 = 6; player->csState = 6;
player->timer_1F8 = 1000; player->csTimer = 1000;
gAqDrawMode = 0; gAqDrawMode = 0;
gFillScreenAlphaTarget = 0; gFillScreenAlphaTarget = 0;
@ -5238,36 +5238,36 @@ void HUD_AquasStart(Player* player) {
player->cam.at.z = gCsCamAtZ = 0.0f; player->cam.at.z = gCsCamAtZ = 0.0f;
case 6: case 6:
player->unk_060 = SIN_DEG(player->unk_0F4 * 0.7f) * 0.5f; player->unk_060 = SIN_DEG(player->rockPhase * 0.7f) * 0.5f;
player->unk_088 += 10.0f; player->bobPhase += 10.0f;
player->unk_0F4 += 8.0f; player->rockPhase += 8.0f;
player->unk_080 = -SIN_DEG(player->unk_088) * 0.5f; player->yBob = -SIN_DEG(player->bobPhase) * 0.5f;
player->unk_0F0 = SIN_DEG(player->unk_0F4) * 1.5f; player->rockAngle = SIN_DEG(player->rockPhase) * 1.5f;
gCsCamEyeX = player->pos.x * (600.0f / player->unk_09C); gCsCamEyeX = player->pos.x * (600.0f / player->pathWidth);
gCsCamEyeY = player->pos.y * (740.0f / player->unk_0A0); gCsCamEyeY = player->pos.y * (740.0f / player->pathHeight);
gCsCamEyeY -= -50.0f; gCsCamEyeY -= -50.0f;
gCsCamAtX = player->pos.x * (600.0f / player->unk_09C); gCsCamAtX = player->pos.x * (600.0f / player->pathWidth);
gCsCamAtY = player->pos.y * (750.0f / player->unk_0A0); gCsCamAtY = player->pos.y * (750.0f / player->pathHeight);
gCsCamAtY += player->unk_060 * 10.0f; gCsCamAtY += player->unk_060 * 10.0f;
Math_SmoothStepToF(&player->pos.z, 0.0f, 0.1f, 40.0f, 0.1f); Math_SmoothStepToF(&player->pos.z, 0.0f, 0.1f, 40.0f, 0.1f);
D_ctx_80177A48[0] = 0.03f; D_ctx_80177A48[0] = 0.03f;
gCsCamEyeZ = 240.0f; 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); 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; gLevelStartStatusScreenTimer = 50;
player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->state_1C8 = PLAYERSTATE_1C8_ACTIVE;
player->unk_1D0 = 0; player->csState = 0;
player->timer_1F8 = 0; player->csTimer = 0;
gLoadLevelObjects = 1; gLoadLevelObjects = 1;
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 50); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 50);
@ -5283,8 +5283,8 @@ void HUD_AquasStart(Player* player) {
break; break;
} }
Matrix_RotateY(gCalcMatrix, M_DTOR * (player->unk_0E8 + player->unk_114 + 180.0f), MTXF_NEW); Matrix_RotateY(gCalcMatrix, M_DTOR * (player->rot.y + player->yRot_114 + 180.0f), MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -(M_DTOR * player->unk_0E4), MTXF_APPLY); Matrix_RotateX(gCalcMatrix, -(M_DTOR * player->rot.x), MTXF_APPLY);
src.x = 0.0f; src.x = 0.0f;
src.y = 0.0f; src.y = 0.0f;
@ -5298,9 +5298,9 @@ void HUD_AquasStart(Player* player) {
player->pos.x += player->vel.x; player->pos.x += player->vel.x;
player->pos.y += player->vel.y; 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.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.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) { void func_hud_80094954(Effect* effect) {
Player* player = &gPlayer[0]; 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) { switch (effect->state) {
case 0: case 0:
effect->unk_44 += effect->unk_46; effect->unk_44 += effect->unk_46;
@ -5358,7 +5358,7 @@ void func_hud_80094954(Effect* effect) {
if (player->state_1C8 == PLAYERSTATE_1C8_NEXT) { if (player->state_1C8 == PLAYERSTATE_1C8_NEXT) {
effect->unk_46 = 2; effect->unk_46 = 2;
if (player->unk_1D0 >= 4) { if (player->csState >= 4) {
effect->vel.y -= 0.13f; effect->vel.y -= 0.13f;
} }
} }
@ -5367,7 +5367,7 @@ void func_hud_80094954(Effect* effect) {
effect->unk_4A -= effect->unk_46; effect->unk_4A -= effect->unk_46;
if ((effect->unk_4A < 0) || ((player->state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && 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); Object_Kill(&effect->obj, effect->sfxSource);
} }
effect->obj.rot.z += effect->unk_48; effect->obj.rot.z += effect->unk_48;
@ -5376,7 +5376,7 @@ void func_hud_80094954(Effect* effect) {
void func_hud_80094BBC(Effect* effect) { void func_hud_80094BBC(Effect* effect) {
if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && (gCurrentLevel == LEVEL_AQUAS) && 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); RCP_SetupDL(&gMasterDisp, 0x44);
gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 21, 34, effect->unk_4A); gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 21, 34, effect->unk_4A);
gDPSetEnvColor(gMasterDisp++, 255, 255, 251, 0); gDPSetEnvColor(gMasterDisp++, 255, 255, 251, 0);
@ -5532,7 +5532,7 @@ void func_hud_80094D20(f32 x, f32 y) {
void func_hud_80095350(Actor* actor) { void func_hud_80095350(Actor* actor) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_ACTIVE; actor->obj.status = OBJ_ACTIVE;
actor->obj.id = OBJ_ACTOR_195; actor->obj.id = OBJ_ACTOR_CUTSCENE;
actor->unk_0B6 = 9999; actor->unk_0B6 = 9999;
Object_SetInfo(&actor->info, actor->obj.id); Object_SetInfo(&actor->info, actor->obj.id);
} }
@ -5547,9 +5547,9 @@ void func_hud_800953A0(Actor* actor, s32 arg1) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_ACTIVE; 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 = D_800D2510[arg1];
actor->obj.pos.z -= D_ctx_80177D20; actor->obj.pos.z -= gPathProgress;
actor->unk_0B6 = 45; actor->unk_0B6 = 45;
Object_SetInfo(&actor->info, actor->obj.id); Object_SetInfo(&actor->info, actor->obj.id);
} }
@ -5562,9 +5562,9 @@ void func_hud_8009546C(Actor* actor, s32 arg1) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_ACTIVE; 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 = D_800D2540[arg1];
actor->obj.pos.z -= D_ctx_80177D20; actor->obj.pos.z -= gPathProgress;
actor->unk_0B6 = 46; actor->unk_0B6 = 46;
Object_SetInfo(&actor->info, actor->obj.id); Object_SetInfo(&actor->info, actor->obj.id);
} }
@ -5577,9 +5577,9 @@ void func_hud_80095538(Actor* actor, s32 arg1) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_ACTIVE; 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 = D_800D257C[arg1];
actor->obj.pos.z -= D_ctx_80177D20; actor->obj.pos.z -= gPathProgress;
actor->unk_0B6 = 47; actor->unk_0B6 = 47;
Object_SetInfo(&actor->info, actor->obj.id); Object_SetInfo(&actor->info, actor->obj.id);
} }
@ -5600,11 +5600,11 @@ void HUD_AquasComplete(Player* player) {
actor = &gActors[0]; actor = &gActors[0];
switch (player->unk_1D0) { switch (player->csState) {
case 0: case 0:
gCsFrameCount = 0; gCsFrameCount = 0;
player->unk_280 = 0; player->barrelRollAlpha = 0;
player->unk_1D0 = 1; player->csState = 1;
D_ctx_80177A48[1] = gBosses[0].obj.pos.x; D_ctx_80177A48[1] = gBosses[0].obj.pos.x;
D_ctx_80177A48[2] = gBosses[0].obj.pos.y; D_ctx_80177A48[2] = gBosses[0].obj.pos.y;
@ -5624,7 +5624,7 @@ void HUD_AquasComplete(Player* player) {
gFillScreenAlphaTarget = 255; gFillScreenAlphaTarget = 255;
gFillScreenAlphaStep = 16; gFillScreenAlphaStep = 16;
if (gCsFrameCount == 280) { if (gCsFrameCount == 280) {
player->unk_1D0 = 10; player->csState = 10;
} }
} }
@ -5653,13 +5653,13 @@ void HUD_AquasComplete(Player* player) {
if (gCsFrameCount >= 90) { if (gCsFrameCount >= 90) {
dest.x = player->cam.eye.x; dest.x = player->cam.eye.x;
dest.y = player->cam.eye.y; 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->zRotBarrelRoll, 0.0f, 0.05f, 1.2f, 0.0001f);
Math_SmoothStepToAngle(&player->unk_12C, 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_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; x = player->pos.x - dest.x;
y = player->pos.y - dest.y; y = player->pos.y - dest.y;
@ -5676,9 +5676,9 @@ void HUD_AquasComplete(Player* player) {
x1 = 0.0f; x1 = 0.0f;
} }
z1 = Math_SmoothStepToAngle(&player->unk_0E8, y1, 0.5f, 2.0f, 0.0001f) * 30.0f; z1 = Math_SmoothStepToAngle(&player->rot.y, y1, 0.5f, 2.0f, 0.0001f) * 30.0f;
Math_SmoothStepToAngle(&player->unk_0E4, x1, 0.5f, 2.0f, 0.0001f); Math_SmoothStepToAngle(&player->rot.x, x1, 0.5f, 2.0f, 0.0001f);
Math_SmoothStepToAngle(&player->unk_0EC, z1, 0.1f, 5.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_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); 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]; src.z = D_ctx_80177A48[9];
Matrix_Translate(gCalcMatrix, gBosses[0].obj.pos.x, gBosses[0].obj.pos.y, 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_RotateY(gCalcMatrix, -(M_DTOR * D_ctx_80177A48[4]), MTXF_APPLY);
Matrix_MultVec3f(gCalcMatrix, &src, &dest); Matrix_MultVec3f(gCalcMatrix, &src, &dest);
@ -5704,11 +5704,11 @@ void HUD_AquasComplete(Player* player) {
if (gCsFrameCount < 200) { if (gCsFrameCount < 200) {
Math_SmoothStepToF(&gCsCamAtX, gBosses[0].obj.pos.x, 0.03f, 100.0f, 0.001f); 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(&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 { } else {
Math_SmoothStepToF(&gCsCamAtX, player->pos.x, D_ctx_80177A48[6], 1000.0f, 0.001f); 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(&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) { if (gCsFrameCount > 180) {
D_ctx_80177A48[6] += 0.005f; D_ctx_80177A48[6] += 0.005f;
} else { } else {
@ -5726,17 +5726,17 @@ void HUD_AquasComplete(Player* player) {
case 10: case 10:
player->unk_234 = 1; player->unk_234 = 1;
gAqDrawMode = 2; 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->vel.x = player->vel.y = player->vel.z = 0.0f;
player->unk_0E4 = player->unk_0E8 = player->unk_0EC = 0.0f; player->rot.x = player->rot.y = player->rot.z = 0.0f;
player->boostSpeed = player->unk_114 = 0.0f; player->boostSpeed = player->yRot_114 = 0.0f;
player->baseSpeed = 3.6f; 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.y = 100.0f;
player->pos.x = -100.0f; player->pos.x = -100.0f;
player->unk_280 = 0; player->barrelRollAlpha = 0;
player->unk_17C = player->unk_180 = 0.0f; player->unk_17C = player->unk_180 = 0.0f;
D_bg_8015F974 = D_bg_8015F978 = D_bg_8015F97C = 255; D_bg_8015F974 = D_bg_8015F978 = D_bg_8015F97C = 255;
@ -5752,7 +5752,7 @@ void HUD_AquasComplete(Player* player) {
Play_ClearObjectData(); Play_ClearObjectData();
player->unk_144 = D_ctx_80177D20 = 0; player->zPath = gPathProgress = 0;
j = 0; j = 0;
func_hud_80095350(actor); func_hud_80095350(actor);
@ -5770,8 +5770,8 @@ void HUD_AquasComplete(Player* player) {
func_hud_800953A0(&gActors[j], i); func_hud_800953A0(&gActors[j], i);
} }
player->pos.z -= D_ctx_80177D20; player->pos.z -= gPathProgress;
player->unk_138 = player->pos.z; player->trueZpos = player->pos.z;
actor->fwork[1] = 0.0f; actor->fwork[1] = 0.0f;
actor->fwork[2] = 600.0f; actor->fwork[2] = 600.0f;
@ -5784,13 +5784,13 @@ void HUD_AquasComplete(Player* player) {
src.y = actor->fwork[2]; src.y = actor->fwork[2];
src.z = actor->fwork[3]; 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_RotateY(gCalcMatrix, -(M_DTOR * actor->unk_0F4.y), MTXF_APPLY);
Matrix_MultVec3f(gCalcMatrix, &src, &dest); Matrix_MultVec3f(gCalcMatrix, &src, &dest);
player->cam.at.x = gCsCamAtX = player->pos.x; player->cam.at.x = gCsCamAtX = player->pos.x;
player->cam.at.y = gCsCamAtY = player->pos.y; 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.x = gCsCamEyeX = dest.x;
player->cam.eye.y = gCsCamEyeY = dest.y; player->cam.eye.y = gCsCamEyeY = dest.y;
@ -5804,7 +5804,7 @@ void HUD_AquasComplete(Player* player) {
gFillScreenAlphaStep = 8; gFillScreenAlphaStep = 8;
if (gFillScreenAlpha == 0) { if (gFillScreenAlpha == 0) {
player->unk_1D0 = 12; player->csState = 12;
} }
case 12: case 12:
@ -5824,17 +5824,17 @@ void HUD_AquasComplete(Player* player) {
} else { } else {
actor->fwork[4] = player->pos.x; actor->fwork[4] = player->pos.x;
actor->fwork[5] = player->pos.y; actor->fwork[5] = player->pos.y;
actor->fwork[6] = player->unk_138 + D_ctx_80177D20; actor->fwork[6] = player->trueZpos + gPathProgress;
} }
if (gCsFrameCount < 1200) { if (gCsFrameCount < 1200) {
gCsCamAtX = player->pos.x; gCsCamAtX = player->pos.x;
gCsCamAtY = player->pos.y; gCsCamAtY = player->pos.y;
gCsCamAtZ = player->pos.z - 50.0f + D_ctx_80177D20; gCsCamAtZ = player->pos.z - 50.0f + gPathProgress;
} else { } else {
gCsCamAtX = player->pos.x; gCsCamAtX = player->pos.x;
gCsCamAtY = player->pos.y + 10.0f; 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; D_ctx_80177A48[0] = 0.05f;
@ -5866,7 +5866,7 @@ void HUD_AquasComplete(Player* player) {
if (gFillScreenAlpha == 255) { if (gFillScreenAlpha == 255) {
gLeveLClearStatus[LEVEL_AQUAS] = Play_CheckMedalStatus(150) + 1; gLeveLClearStatus[LEVEL_AQUAS] = Play_CheckMedalStatus(150) + 1;
player->state_1C8 = PLAYERSTATE_1C8_NEXT; player->state_1C8 = PLAYERSTATE_1C8_NEXT;
player->timer_1F8 = 0; player->csTimer = 0;
Audio_FadeOutAll(10); Audio_FadeOutAll(10);
gFadeoutType = 4; gFadeoutType = 4;
} }
@ -5936,8 +5936,8 @@ void HUD_AquasComplete(Player* player) {
break; break;
} }
Matrix_RotateY(gCalcMatrix, M_DTOR * (player->unk_0E8 + player->unk_114 + 180.0f), MTXF_NEW); Matrix_RotateY(gCalcMatrix, M_DTOR * (player->rot.y + player->yRot_114 + 180.0f), MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -(M_DTOR * player->unk_0E4), MTXF_APPLY); Matrix_RotateX(gCalcMatrix, -(M_DTOR * player->rot.x), MTXF_APPLY);
src.x = 0.0f; src.x = 0.0f;
src.y = 0.0f; src.y = 0.0f;
@ -5953,15 +5953,15 @@ void HUD_AquasComplete(Player* player) {
player->pos.y += player->vel.y; player->pos.y += player->vel.y;
player->pos.z += player->vel.z; 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_060 = SIN_DEG(player->rockPhase * 0.7f) * 0.5f;
player->unk_088 += 10.0f; player->bobPhase += 10.0f;
player->unk_0F4 += 8.0f; player->rockPhase += 8.0f;
player->unk_080 = -SIN_DEG(player->unk_088) * 0.5f; player->yBob = -SIN_DEG(player->bobPhase) * 0.5f;
player->unk_0F0 = SIN_DEG(player->unk_0F4) * 1.5f; player->rockAngle = SIN_DEG(player->rockPhase) * 1.5f;
if (player->unk_234) { if (player->unk_234) {
src.x = 0.0f; src.x = 0.0f;
@ -5987,17 +5987,17 @@ void func_hud_80096A74(Player* player) {
Vec3f src, dest; Vec3f src, dest;
s32 button; s32 button;
switch (player->unk_1D0) { switch (player->csState) {
case 0: case 0:
player->pos.y += 3400.0f; player->pos.y += 3400.0f;
player->unk_0E4 = 270.0f; player->rot.x = 270.0f;
gPlayer[0].baseSpeed = 0.0f; gPlayer[0].baseSpeed = 0.0f;
D_ctx_80177A48[1] = 100.0f; D_ctx_80177A48[1] = 100.0f;
D_ctx_80177A48[2] = 0.0f; D_ctx_80177A48[2] = 0.0f;
D_ctx_80177A48[0] = 0.2f; D_ctx_80177A48[0] = 0.2f;
gCsFrameCount = 0; gCsFrameCount = 0;
player->unk_1D0 = 1; player->csState = 1;
gFillScreenAlpha = gFillScreenAlphaTarget = 255; gFillScreenAlpha = gFillScreenAlphaTarget = 255;
player->cam.eye.x = gCsCamEyeX = 0.0f; player->cam.eye.x = gCsCamEyeX = 0.0f;
@ -6053,7 +6053,7 @@ void func_hud_80096A74(Player* player) {
if (gCsFrameCount == 270) { if (gCsFrameCount == 270) {
player->unk_190 = player->unk_194 = 10.0f; player->unk_190 = player->unk_194 = 10.0f;
player->unk_1D0 = 2; player->csState = 2;
D_ctx_80177A48[1] = 400.0f; D_ctx_80177A48[1] = 400.0f;
AUDIO_PLAY_SFX(0x09004002, player->sfxSource, 0); AUDIO_PLAY_SFX(0x09004002, player->sfxSource, 0);
} }
@ -6070,7 +6070,7 @@ void func_hud_80096A74(Player* player) {
button = gControllerHold[player->num].button; button = gControllerHold[player->num].button;
gControllerHold[player->num].button = gBoostButton[player->num]; gControllerHold[player->num].button = gBoostButton[player->num];
player->boostMeter = 1; player->boostMeter = 1;
player->timer_1F8 = 60; player->csTimer = 60;
func_play_800B2574(player); func_play_800B2574(player);
@ -6086,12 +6086,12 @@ void func_hud_80096A74(Player* player) {
gCsCamAtZ = player->pos.z; gCsCamAtZ = player->pos.z;
if (gCsFrameCount == 300) { if (gCsFrameCount == 300) {
D_ctx_80177CE8 = 0; gPathTexScroll = 0;
gLevelStartStatusScreenTimer = 50; gLevelStartStatusScreenTimer = 50;
player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->state_1C8 = PLAYERSTATE_1C8_ACTIVE;
player->baseSpeed = gArwingSpeed; player->baseSpeed = gArwingSpeed;
player->unk_1D0 = 0; player->csState = 0;
player->timer_1F8 = 0; player->csTimer = 0;
player->unk_014 = 0.0f; player->unk_014 = 0.0f;
player->unk_018 = 0.0f; player->unk_018 = 0.0f;
player->camRoll = 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); Math_SmoothStepToF(&player->baseSpeed, 30.0f, 0.05f, 1000.0f, 0.001f);
if (gCsFrameCount < 110) { if (gCsFrameCount < 110) {
player->unk_0EC += (D_ctx_80177A48[4] * 2.0f); player->rot.z += (D_ctx_80177A48[4] * 2.0f);
if (player->unk_0EC >= 360.0f) { if (player->rot.z >= 360.0f) {
player->unk_0EC -= 360.0f; player->rot.z -= 360.0f;
} }
if (player->unk_0EC < 0.0f) { if (player->rot.z < 0.0f) {
player->unk_0EC += 360.0f; player->rot.z += 360.0f;
} }
} else { } else {
Math_SmoothStepToAngle(&player->unk_0EC, 0.0f, 0.4f, (D_ctx_80177A48[4] * 2.0f), 1.0f); Math_SmoothStepToAngle(&player->rot.z, 0.0f, 0.4f, (D_ctx_80177A48[4] * 2.0f), 1.0f);
if (player->unk_0EC == 0.0f) { if (player->rot.z == 0.0f) {
if (player->unk_0E4 != 0.0f) { if (player->rot.x != 0.0f) {
Math_SmoothStepToAngle(&player->unk_0E4, 0.0f, 0.1f, 2.4f, 0.001f); Math_SmoothStepToAngle(&player->rot.x, 0.0f, 0.1f, 2.4f, 0.001f);
} else { } else {
player->unk_088 += 10.0f; player->bobPhase += 10.0f;
player->unk_080 = -SIN_DEG(player->unk_088) * 0.5f; player->yBob = -SIN_DEG(player->bobPhase) * 0.5f;
player->unk_0F4 += 3.0f; player->rockPhase += 3.0f;
player->unk_0F0 = SIN_DEG(player->unk_0F4) * 1.5f; player->rockAngle = SIN_DEG(player->rockPhase) * 1.5f;
} }
} }
} }
Matrix_RotateY(gCalcMatrix, M_DTOR * (player->unk_0E8 + player->unk_114 + 180.0f), MTXF_NEW); Matrix_RotateY(gCalcMatrix, M_DTOR * (player->rot.y + player->yRot_114 + 180.0f), MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -(M_DTOR * (player->unk_0E4)), MTXF_APPLY); Matrix_RotateX(gCalcMatrix, -(M_DTOR * (player->rot.x)), MTXF_APPLY);
src.x = 0.0f; src.x = 0.0f;
src.y = 0.0f; src.y = 0.0f;
@ -6140,9 +6140,9 @@ void func_hud_80096A74(Player* player) {
player->pos.x += player->vel.x; player->pos.x += player->vel.x;
player->pos.y += player->vel.y; 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.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0.0f);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -322,16 +322,16 @@ void func_versus_800BDE44(void) {
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
if ((gPlayer[i].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[i].state_1C8 == PLAYERSTATE_1C8_U_TURN)) { 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; D_80178810[i] += 4;
if (D_80178810[i] > 15) { if (D_80178810[i] > 15) {
if (D_ctx_80177C30[i] > D_80178808[i]) { if (gPlayerScores[i] > D_80178808[i]) {
D_80178808[i] += 1; D_80178808[i] += 1;
} else { } else {
D_80178808[i] -= 1; D_80178808[i] -= 1;
} }
if (D_ctx_80177C30[i] != D_80178808[i]) { if (gPlayerScores[i] != D_80178808[i]) {
D_80178810[i] -= 15; D_80178810[i] -= 15;
} else { } else {
D_80178810[i] = 0; 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]); func_versus_800BDAA0(D_800D4B70[i], D_800D4B80[i], D_80178808[i] + 1, D_80178808[i], D_80178810[i]);
} else { } else {
func_versus_800BDAA0(D_800D4B70[i], D_800D4B80[i], D_80178808[i] - 1, D_80178808[i], D_80178810[i]); 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; D_801787E8[i] = 32.0f;
} }
} }
gPlayer[i].unk_1D0 = 0; gPlayer[i].csState = 0;
} else { } else {
D_80178780[i] = 0; D_80178780[i] = 0;
gPlayer[i].unk_1D0 = 0; gPlayer[i].csState = 0;
if ((D_80178780[i] == 0) && (D_801787F8[i] == 0)) { if ((D_80178780[i] == 0) && (D_801787F8[i] == 0)) {
if (sUnlockLandmaster && sUnlockOnFoot) { if (sUnlockLandmaster && sUnlockOnFoot) {
D_80178780[i] = RAND_INT(3.0f) + 1; D_80178780[i] = RAND_INT(3.0f) + 1;
@ -718,9 +718,9 @@ s32 func_versus_800BF17C(void) {
D_80178820[i]++; D_80178820[i]++;
if (gVsMatchType == 2) { 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++) { for (i = 0; i < 4; i++) {
if ((gPlayer[i].state_1C8 == PLAYERSTATE_1C8_DOWN) || if ((gPlayer[i].state_1C8 == PLAYERSTATE_1C8_DOWN) ||
(gPlayer[i].state_1C8 == PLAYERSTATE_1C8_VS_STANDBY)) { (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; D_80178820[i] += 1;
} }
} }
@ -906,11 +906,11 @@ s32 Versus_CheckForWinner(void) {
} }
if (i != j) { if (i != j) {
if (D_ctx_80177C30[i] < D_ctx_80177C30[j]) { if (gPlayerScores[i] < gPlayerScores[j]) {
temp2[i] = 1; temp2[i] = 1;
break; break;
} }
if (D_ctx_80177C30[i] == D_ctx_80177C30[j]) { if (gPlayerScores[i] == gPlayerScores[j]) {
temp = 1; temp = 1;
} }
} }
@ -1249,7 +1249,7 @@ bool func_versus_800C0D10(void) {
cont = 0; cont = 0;
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
if (D_ctx_80177C30[i] == D_80178838[i]) { if (gPlayerScores[i] == D_80178838[i]) {
cont++; cont++;
continue; continue;
} }
@ -1379,7 +1379,7 @@ void func_versus_800C1368(void) {
gFillScreenAlphaTarget = 0; gFillScreenAlphaTarget = 0;
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
D_ctx_80177C30[i] = 0; gPlayerScores[i] = 0;
D_80178808[i] = 0; D_80178808[i] = 0;
D_80178810[i] = 0; D_80178810[i] = 0;
D_80178820[i] = 0; D_80178820[i] = 0;

View File

@ -12,7 +12,7 @@ typedef struct RamEntry {
static RamEntry oRamEntries[8] = { 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.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.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 }, { 0, 0, offsetof(Player, vel.z), 2, 3, 0, 0 },
}; };

View File

@ -1383,7 +1383,7 @@ void Ending_8018B3D8(void) {
void Ending_8018B3E0(void) { void Ending_8018B3E0(void) {
} }
void Ending_8018B3E8(Actor* arg0, s32 arg1) { void Ending_8018B3E8(Actor* actor, s32 arg1) {
Vec3f sp38[2] = { Vec3f sp38[2] = {
{ 2880.0f, 860.0f, -1440.0f }, { 2880.0f, 860.0f, -1440.0f },
{ -6000.0f, 3400.0f, 3600.0f }, { -6000.0f, 3400.0f, 3600.0f },
@ -1393,24 +1393,24 @@ void Ending_8018B3E8(Actor* arg0, s32 arg1) {
{ 0.0f, 290.0f, 0.0f }, { 0.0f, 290.0f, 0.0f },
}; };
Actor_Initialize(arg0); Actor_Initialize(actor);
arg0->obj.status = OBJ_ACTIVE; actor->obj.status = OBJ_ACTIVE;
arg0->obj.id = 0; actor->obj.id = 0;
arg0->state = arg1; actor->state = arg1;
arg0->unk_0F4.x = sp20[arg1].x; actor->unk_0F4.x = sp20[arg1].x;
arg0->unk_0F4.y = sp20[arg1].y; actor->unk_0F4.y = sp20[arg1].y;
arg0->unk_0F4.z = sp20[arg1].z; actor->unk_0F4.z = sp20[arg1].z;
arg0->obj.pos = sp38[arg1]; actor->obj.pos = sp38[arg1];
if (arg1 == 0) { if (arg1 == 0) {
arg0->obj.pos.x -= 600.0f; actor->obj.pos.x -= 600.0f;
arg0->obj.pos.y += 150.0f; actor->obj.pos.y += 150.0f;
arg0->fwork[0] = 6.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] = { Vec3f sp44[3] = {
{ -230.0f, -750.0f, -1300.0f }, { -230.0f, -750.0f, -1300.0f },
{ 230.0f, -240.0f, -1150.0f }, { 230.0f, -240.0f, -1150.0f },
@ -1422,31 +1422,31 @@ void Ending_8018B52C(Actor* arg0, s32 arg1) {
{ 180.0f, 0.0f, 0.0f }, { 180.0f, 0.0f, 0.0f },
}; };
Actor_Initialize(arg0); Actor_Initialize(actor);
arg0->obj.status = OBJ_ACTIVE; actor->obj.status = OBJ_ACTIVE;
arg0->obj.id = 1; actor->obj.id = 1;
arg0->obj.pos = sp44[arg1]; actor->obj.pos = sp44[arg1];
arg0->unk_0F4.x = sp20[arg1].x; actor->unk_0F4.x = sp20[arg1].x;
arg0->unk_0F4.y = sp20[arg1].y; actor->unk_0F4.y = sp20[arg1].y;
arg0->unk_0F4.z = sp20[arg1].z; actor->unk_0F4.z = sp20[arg1].z;
arg0->scale = 1.0f; actor->scale = 1.0f;
} }
void Ending_8018B624(Actor* arg0) { void Ending_8018B624(Actor* actor) {
Vec3f sp24 = { -40.0f, -560.0f, 400.0f }; Vec3f sp24 = { -40.0f, -560.0f, 400.0f };
Vec3f sp18 = { 0.0f, 290.0f, 0.0f }; Vec3f sp18 = { 0.0f, 290.0f, 0.0f };
Actor_Initialize(arg0); Actor_Initialize(actor);
arg0->obj.status = 2; actor->obj.status = 2;
arg0->obj.id = 2; actor->obj.id = 2;
arg0->obj.pos = sp24; actor->obj.pos = sp24;
arg0->unk_0F4.x = sp18.x; actor->unk_0F4.x = sp18.x;
arg0->unk_0F4.y = sp18.y; actor->unk_0F4.y = sp18.y;
arg0->unk_0F4.z = sp18.z; actor->unk_0F4.z = sp18.z;
arg0->scale = 1.0f; actor->scale = 1.0f;
} }
void Ending_8018B6D8(Actor* arg0, s32 arg1) { void Ending_8018B6D8(Actor* actor, s32 arg1) {
Vec3f sp80[6] = { Vec3f sp80[6] = {
{ -400.0f, 500.0f, -1200.0f }, { -160.0f, 500.0f, -1400.0f }, { 80.0f, 500.0f, -1600.0f }, { -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 }, { 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 }; s32 sp20[6] = { 150, 157, 164, 171, 178, 185 };
Actor_Initialize(arg0); Actor_Initialize(actor);
arg0->obj.status = OBJ_ACTIVE; actor->obj.status = OBJ_ACTIVE;
arg0->obj.id = 3; actor->obj.id = 3;
arg0->obj.pos = sp80[arg1]; actor->obj.pos = sp80[arg1];
arg0->unk_0F4.x = sp38[arg1].x; actor->unk_0F4.x = sp38[arg1].x;
arg0->unk_0F4.y = sp38[arg1].y; actor->unk_0F4.y = sp38[arg1].y;
arg0->unk_0F4.z = sp38[arg1].z; actor->unk_0F4.z = sp38[arg1].z;
arg0->obj.pos.x += 3200.0f; actor->obj.pos.x += 3200.0f;
arg0->obj.pos.z -= 200.0f; actor->obj.pos.z -= 200.0f;
arg0->scale = 1.0f; actor->scale = 1.0f;
arg0->fwork[1] = 1.0f; actor->fwork[1] = 1.0f;
arg0->iwork[1] = 100; actor->iwork[1] = 100;
arg0->fwork[0] = 30.0f; actor->fwork[0] = 30.0f;
arg0->iwork[0] = sp20[arg1]; actor->iwork[0] = sp20[arg1];
arg0->unk_046 = arg1; actor->unk_046 = arg1;
} }
void Ending_8018B860(void) { void Ending_8018B860(void) {

View File

@ -1079,7 +1079,7 @@ void Ending_801926D4(void) {
if (D_ctx_80177824 == 0) { if (D_ctx_80177824 == 0) {
D_ending_80198590 = gPlayer[0].wings; D_ending_80198590 = gPlayer[0].wings;
} else { } 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); AUDIO_PLAY_BGM(SEQ_ID_ENDING);
} }

View File

@ -102,7 +102,7 @@ void Corneria_Boss292_Init(Boss292* this) {
if (gLevelMode == LEVELMODE_ON_RAILS) { if (gLevelMode == LEVELMODE_ON_RAILS) {
if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) { if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) {
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_START_360; 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_BGM, 50);
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 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) || if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) ||
(gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) { (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) {
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE;
gPlayer[0].unk_1D0 = gPlayer[0].timer_1F8 = 0; gPlayer[0].csState = gPlayer[0].csTimer = 0;
gPlayer[0].unk_0E8 += gPlayer[0].unk_114; gPlayer[0].rot.y += gPlayer[0].yRot_114;
if (gPlayer[0].unk_0E8 > 360.0f) { if (gPlayer[0].rot.y > 360.0f) {
gPlayer[0].unk_0E8 -= 360.0f; gPlayer[0].rot.y -= 360.0f;
} }
if (gPlayer[0].unk_0E8 < 0.0f) { if (gPlayer[0].rot.y < 0.0f) {
gPlayer[0].unk_0E8 += 360.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); Radio_PlayMessage(gMsg_ID_2280, RCID_BOSS_CORNERIA);
Boss_AwardBonus(boss); Boss_AwardBonus(boss);
@ -387,14 +387,14 @@ void Corneria_801887AC(Boss* boss) {
if (boss->swork[3] != 1000) { if (boss->swork[3] != 1000) {
sp3C.x = gPlayer[0].pos.x; sp3C.x = gPlayer[0].pos.x;
sp3C.y = gPlayer[0].pos.y; 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.x += RAND_FLOAT_CENTERED(300.0f);
gPlayer[0].pos.y += 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); 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.x = sp3C.x;
gPlayer[0].pos.y = sp3C.y; gPlayer[0].pos.y = sp3C.y;
gPlayer[0].unk_138 = sp3C.z; gPlayer[0].trueZpos = sp3C.z;
} }
boss->swork[30] = 0; boss->swork[30] = 0;
break; break;
@ -475,7 +475,7 @@ void Corneria_80188D50(Boss* boss) {
s32 temp_ft3; s32 temp_ft3;
if (boss->swork[36] == 0) { if (boss->swork[36] == 0) {
if (gPlayer[0].unk_1F4 != 0) { if (gPlayer[0].hitTimer != 0) {
D_i1_801997E0 = 80; D_i1_801997E0 = 80;
} }
@ -483,7 +483,7 @@ void Corneria_80188D50(Boss* boss) {
D_i1_801997E0--; D_i1_801997E0--;
} else if ((gPlayer[0].pos.y < 200.0f) && (boss->state < 5) && } 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.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]++; boss->swork[36]++;
D_i1_801997E0 = 20; D_i1_801997E0 = 20;
AUDIO_PLAY_SFX(0x49008025, gDefaultSfxSource, 4); AUDIO_PLAY_SFX(0x49008025, gDefaultSfxSource, 4);
@ -507,7 +507,7 @@ void Corneria_80188D50(Boss* boss) {
break; 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.x = 0.0f;
sp48.y = 0.0f; sp48.y = 0.0f;
sp48.z = -2500.0f; sp48.z = -2500.0f;
@ -519,7 +519,7 @@ void Corneria_80188D50(Boss* boss) {
gItems[i].obj.id = OBJ_ITEM_1UP; gItems[i].obj.id = OBJ_ITEM_1UP;
gItems[i].obj.pos.x = gPlayer[0].pos.x + sp3C.x; 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.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; gItems[i].timer_4A = 8;
Object_SetInfo(&gItems[i].info, gItems[i].obj.id); 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); 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.y = boss->obj.pos.y;
gRadarMarks[59].pos.z = boss->obj.pos.z; 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); Corneria_80188D50(boss);
if (D_edisplay_801615D0.z > 0.0f) { if (D_edisplay_801615D0.z > 0.0f) {
if (D_edisplay_801615D0.x > 0.0f) { if (D_edisplay_801615D0.x > 0.0f) {
@ -683,7 +683,7 @@ void Corneria_80189058(Boss* boss) {
boss->unk_04C = 0; boss->unk_04C = 0;
D_i1_8019B6D8[17] = gPlayer[0].pos.x; D_i1_8019B6D8[17] = gPlayer[0].pos.x;
D_i1_8019B6D8[18] = gPlayer[0].pos.y; 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) { if (boss->timer_050 == 0) {
switch (boss->swork[31]) { switch (boss->swork[31]) {
case 1: case 1:
@ -722,7 +722,7 @@ void Corneria_80189058(Boss* boss) {
case 1: case 1:
D_i1_8019B6D8[17] = D_i1_8019B6D8[66] = gPlayer[0].pos.x; D_i1_8019B6D8[17] = D_i1_8019B6D8[66] = gPlayer[0].pos.x;
D_i1_8019B6D8[18] = gPlayer[0].pos.y; 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; boss->unk_04C += 2;
if (boss->unk_04C >= Animation_GetFrameCount(&D_CO_602BC18)) { if (boss->unk_04C >= Animation_GetFrameCount(&D_CO_602BC18)) {
@ -739,7 +739,7 @@ void Corneria_80189058(Boss* boss) {
case 2: case 2:
D_i1_8019B6D8[17] = D_i1_8019B6D8[66] = gPlayer[0].pos.x; D_i1_8019B6D8[17] = D_i1_8019B6D8[66] = gPlayer[0].pos.x;
D_i1_8019B6D8[18] = gPlayer[0].pos.y; 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; boss->unk_04C -= 4;
if (boss->unk_04C < 0) { if (boss->unk_04C < 0) {
@ -760,7 +760,7 @@ void Corneria_80189058(Boss* boss) {
case 3: case 3:
D_i1_8019B6D8[17] = D_i1_8019B6D8[66] = gPlayer[0].pos.x; D_i1_8019B6D8[17] = D_i1_8019B6D8[66] = gPlayer[0].pos.x;
D_i1_8019B6D8[18] = gPlayer[0].pos.y; 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; boss->unk_04C += 4;
if (boss->unk_04C > 100) { if (boss->unk_04C > 100) {
@ -781,7 +781,7 @@ void Corneria_80189058(Boss* boss) {
case 4: case 4:
D_i1_8019B6D8[17] = gPlayer[0].pos.x; D_i1_8019B6D8[17] = gPlayer[0].pos.x;
D_i1_8019B6D8[18] = gPlayer[0].pos.y; 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; boss->unk_04C += 4;
if (boss->unk_04C > 100) { if (boss->unk_04C > 100) {
@ -798,7 +798,7 @@ void Corneria_80189058(Boss* boss) {
if (((gGameFrameCount % 8) == 0)) { if (((gGameFrameCount % 8) == 0)) {
D_i1_8019B6D8[17] = gPlayer[0].pos.x + RAND_FLOAT_CENTERED(2000.0f); D_i1_8019B6D8[17] = gPlayer[0].pos.x + RAND_FLOAT_CENTERED(2000.0f);
D_i1_8019B6D8[18] = gPlayer[0].pos.y; 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; boss->fwork[12] += 0.05f;
if (boss->state == 6) { if (boss->state == 6) {
@ -1127,9 +1127,9 @@ s32 Corneria_8018AB64(Actor* actor) {
void Corneria_8018ACE0(Actor* actor) { void Corneria_8018ACE0(Actor* actor) {
if (actor->unk_0D0 != 0) { if (actor->dmgType != 0) {
actor->unk_0D0 = 0; actor->dmgType = 0;
if (actor->unk_0D2 == 0) { if (actor->dmgPart == 0) {
AUDIO_PLAY_SFX(0x29034003, actor->sfxSource, 4); 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, 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); 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); 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.x - gPlayer[0].pos.x) < 200.0f) &&
(fabsf(actor->obj.pos.y - gPlayer[0].pos.y) < 200.0f)) { (fabsf(actor->obj.pos.y - gPlayer[0].pos.y) < 200.0f)) {
*gControllerRumbleTimers = 25; *gControllerRumbleTimers = 25;
@ -1483,16 +1483,16 @@ void Corneria_Boss293_Init(Boss293* this) {
this->timer_050 = 354; this->timer_050 = 354;
this->health = 601; this->health = 601;
this->fwork[18] = -gArwingSpeed - 10.0f; 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->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); AUDIO_PLAY_SFX(0x31038018, this->sfxSource, 4);
D_i1_8019B6D0 = 0; D_i1_8019B6D0 = 0;
} else { } else {
D_i1_8019B6D0 = 1; D_i1_8019B6D0 = 1;
this->obj.rot.y = 180.0f; this->obj.rot.y = 180.0f;
this->fwork[6] = 800.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[7] = this->obj.pos.x;
this->fwork[5] = 30.0f; this->fwork[5] = 30.0f;
AUDIO_PLAY_SFX(0x31038018, this->sfxSource, 4); AUDIO_PLAY_SFX(0x31038018, this->sfxSource, 4);
@ -1587,7 +1587,7 @@ void Corneria_8018C19C(Boss* boss) {
Matrix_MultVec3f(gCalcMatrix, &sp78, &sp6C); Matrix_MultVec3f(gCalcMatrix, &sp78, &sp6C);
boss->vel.x = sp6C.x; boss->vel.x = sp6C.x;
boss->vel.y = sp6C.y; boss->vel.y = sp6C.y;
boss->vel.z = sp6C.z - D_ctx_80177D08; boss->vel.z = sp6C.z - gPathVelZ;
boss->fwork[16] = 4.0f; boss->fwork[16] = 4.0f;
if (((gGameFrameCount % 2) == 0)) { if (((gGameFrameCount % 2) == 0)) {
Matrix_MultVec3f(gCalcMatrix, &D_i1_80199914[0], &sp84[6]); Matrix_MultVec3f(gCalcMatrix, &D_i1_80199914[0], &sp84[6]);
@ -1651,7 +1651,7 @@ void Corneria_8018C19C(Boss* boss) {
} }
boss->vel.z = boss->fwork[18]; boss->vel.z = boss->fwork[18];
if (boss->state > 0) { 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) { if (boss->state != 7) {
Math_SmoothStepToF(&boss->fwork[4], boss->fwork[5], 0.1f, 2.0f, 0.00001f); 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) { switch (boss->state) {
case 0: case 0:
boss->fwork[3] = gPlayer[0].unk_138 + 1500.0f; boss->fwork[3] = gPlayer[0].trueZpos + 1500.0f;
if (boss->timer_050 == 350) { if (boss->timer_050 == 350) {
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 40); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 40);
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 40); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 40);
@ -1728,7 +1728,7 @@ void Corneria_8018C19C(Boss* boss) {
boss->fwork[13] = 180.0f; boss->fwork[13] = 180.0f;
boss->fwork[12] = 1.5f; boss->fwork[12] = 1.5f;
boss->fwork[6] = 800.0f; 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; boss->fwork[18] = -gArwingSpeed;
AUDIO_PLAY_BGM(SEQ_ID_CO_BOSS_2 | SEQ_FLAG); AUDIO_PLAY_BGM(SEQ_ID_CO_BOSS_2 | SEQ_FLAG);
boss->timer_050 = 40; boss->timer_050 = 40;
@ -1836,7 +1836,7 @@ void Corneria_8018C19C(Boss* boss) {
} }
break; break;
case 7: 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); Math_SmoothStepToF(&boss->obj.pos.z, boss->fwork[3], 0.1f, 15.0f, 0.00001f);
if (boss->timer_058 == 0) { if (boss->timer_058 == 0) {
@ -1865,7 +1865,7 @@ void Corneria_8018C19C(Boss* boss) {
boss->swork[6] &= 1; boss->swork[6] &= 1;
} }
if (((gGameFrameCount % 8) == 0)) { 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]); Matrix_MultVec3f(gCalcMatrix, &D_i1_801998F0[0], &sp84[3]);
effect = gEffects; effect = gEffects;
@ -1923,7 +1923,7 @@ void Corneria_8018C19C(Boss* boss) {
Matrix_MultVec3f(gCalcMatrix, &sp78, &sp6C); Matrix_MultVec3f(gCalcMatrix, &sp78, &sp6C);
boss->vel.x = sp6C.x; boss->vel.x = sp6C.x;
boss->vel.y = sp6C.y; boss->vel.y = sp6C.y;
boss->vel.z = sp6C.z - D_ctx_80177D08; boss->vel.z = sp6C.z - gPathVelZ;
} }
break; break;
case 8: case 8:
@ -1967,7 +1967,7 @@ void Corneria_8018C19C(Boss* boss) {
Matrix_MultVec3f(gCalcMatrix, &sp78, &sp6C); Matrix_MultVec3f(gCalcMatrix, &sp78, &sp6C);
boss->vel.x = sp6C.x; boss->vel.x = sp6C.x;
boss->vel.y = sp6C.y; boss->vel.y = sp6C.y;
boss->vel.z = sp6C.z - D_ctx_80177D08; boss->vel.z = sp6C.z - gPathVelZ;
if (boss->timer_056 == 60) { if (boss->timer_056 == 60) {
Radio_PlayMessage(gMsg_ID_2295, RCID_FOX); Radio_PlayMessage(gMsg_ID_2295, RCID_FOX);
} }
@ -2075,7 +2075,7 @@ void Corneria_8018DDAC(Boss* boss) {
} else { } else {
Radio_PlayMessage(gMsg_ID_7085, RCID_FALCO); 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[14] = 25.0f;
gBosses[0].fwork[15] = 0.0f; gBosses[0].fwork[15] = 0.0f;
AUDIO_PLAY_SFX(0x2940C027, boss->sfxSource, 4); AUDIO_PLAY_SFX(0x2940C027, boss->sfxSource, 4);
@ -2168,7 +2168,7 @@ void Corneria_8018E290(Boss* boss) {
} else { } else {
Radio_PlayMessage(gMsg_ID_7085, RCID_FALCO); 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[15] = 0.0f;
gBosses[0].fwork[14] = 335.0f; gBosses[0].fwork[14] = 335.0f;
boss->health = 0; boss->health = 0;
@ -2260,7 +2260,7 @@ void Corneria_8018E76C(Boss* boss) {
} else { } else {
Radio_PlayMessage(gMsg_ID_7085, RCID_FALCO); 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[15] = 0.0f;
gBosses[0].fwork[14] = 335.0f; gBosses[0].fwork[14] = 335.0f;
boss->health = 0; boss->health = 0;
@ -2467,13 +2467,13 @@ void Corneria_8018F3BC(Scenery* scenery, f32 arg1) {
scenery->unk_60 = 60.0f; scenery->unk_60 = 60.0f;
Object_SetInfo(&scenery->info, scenery->obj.id); Object_SetInfo(&scenery->info, scenery->obj.id);
scenery->obj.pos.z = -2000.0f; scenery->obj.pos.z = -2000.0f;
scenery->info.unk_10 = 15000.0f; scenery->info.cullDistance = 15000.0f;
} }
void Corneria_8018F4A4(void) { void Corneria_8018F4A4(void) {
s32 i; 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++) { for (i = 0; i < 50; i++) {
if (gScenery[i].obj.status == OBJ_FREE) { if (gScenery[i].obj.status == OBJ_FREE) {
Corneria_8018F3BC(&gScenery[i], 4000.0f); 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) { void Corneria_8018F6F8(Actor* actor, s32 arg1) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_INIT; 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.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.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].x = D_i1_80199AB4[arg1] + gPlayer[0].pos.x;
actor->vwork[20].y = gPlayer[0].pos.y; 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->obj.rot.z = D_i1_80199AD8[arg1];
actor->state = 100; actor->state = 100;
actor->obj.rot.y = 180.0f; actor->obj.rot.y = 180.0f;
@ -2547,7 +2547,7 @@ void Corneria_8018F6F8(Actor* actor, s32 arg1) {
Object_SetInfo(&actor->info, actor->obj.id); Object_SetInfo(&actor->info, actor->obj.id);
actor->unk_0C9 = 1; actor->unk_0C9 = 1;
actor->iwork[11] = 1; actor->iwork[11] = 1;
actor->info.unk_10 = 200.0f; actor->info.cullDistance = 200.0f;
AUDIO_PLAY_SFX(0x3100000C, actor->sfxSource, 4); AUDIO_PLAY_SFX(0x3100000C, actor->sfxSource, 4);
} }
@ -2567,7 +2567,7 @@ void Corneria_LevelStart(Player* player) {
if (gCsFrameCount < 815) { if (gCsFrameCount < 815) {
sp3C = player->pos.x; sp3C = player->pos.x;
sp38 = player->pos.y + 15.0f; sp38 = player->pos.y + 15.0f;
sp34 = player->unk_138 - 20.0f; sp34 = player->trueZpos - 20.0f;
} else { } else {
if (gCsFrameCount < 1009) { if (gCsFrameCount < 1009) {
sp3C = actor0->obj.pos.x; sp3C = actor0->obj.pos.x;
@ -2637,19 +2637,19 @@ void Corneria_LevelStart(Player* player) {
} }
player->vel.z = 0.0f; player->vel.z = 0.0f;
player->pos.z = player->pos.z; player->pos.z = player->pos.z;
player->unk_138 = player->pos.z + player->unk_08C; player->trueZpos = player->pos.z + player->camDist;
player->unk_088 += 10.0f; player->bobPhase += 10.0f;
player->unk_080 = -SIN_DEG(player->unk_088) * 0.5f; player->yBob = -SIN_DEG(player->bobPhase) * 0.5f;
player->unk_0F4 += 3.0f; player->rockPhase += 3.0f;
player->unk_0F0 = SIN_DEG(player->unk_0F4) * 1.5f; player->rockAngle = SIN_DEG(player->rockPhase) * 1.5f;
Corneria_8018F678(); Corneria_8018F678();
player->wings.unk_30 = 0; player->wings.unk_30 = 0;
switch (player->unk_1D0) { switch (player->csState) {
case 0: case 0:
gCsFrameCount = 0; gCsFrameCount = 0;
player->unk_1D0 = 1; player->csState = 1;
player->timer_1F8 = 600; player->csTimer = 600;
player->pos.y = 6000.0f; player->pos.y = 6000.0f;
player->pos.x = 0.1f; player->pos.x = 0.1f;
Corneria_8018F6F8(&gActors[0], 0); Corneria_8018F6F8(&gActors[0], 0);
@ -2660,10 +2660,10 @@ void Corneria_LevelStart(Player* player) {
actor2->iwork[14] = 4; actor2->iwork[14] = 4;
player->cam.eye.x = gCsCamEyeX = player->pos.x - 400.0f; player->cam.eye.x = gCsCamEyeX = player->pos.x - 400.0f;
gPlayer[0].cam.eye.y = gCsCamEyeY = player->pos.y + 600.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.x = gCsCamAtX = player->pos.x;
player->cam.at.y = gCsCamAtY = player->pos.y; 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[0] = 0;
D_ctx_80177A48[1] = D_ctx_80177A48[2] = 0; D_ctx_80177A48[1] = D_ctx_80177A48[2] = 0;
gFillScreenAlphaTarget = 255; gFillScreenAlphaTarget = 255;
@ -2671,46 +2671,46 @@ void Corneria_LevelStart(Player* player) {
gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255;
break; break;
case 1: case 1:
if (player->timer_1F8 < 550) { if (player->csTimer < 550) {
gFillScreenAlphaTarget = 0; gFillScreenAlphaTarget = 0;
gFillScreenAlphaStep = 3; gFillScreenAlphaStep = 3;
Math_SmoothStepToF(&D_ctx_80177A48[0], 0.01f, 1.0f, 0.0005f, 0.0f); Math_SmoothStepToF(&D_ctx_80177A48[0], 0.01f, 1.0f, 0.0005f, 0.0f);
} }
gCsCamEyeX = player->pos.x - 150.0f; gCsCamEyeX = player->pos.x - 150.0f;
gCsCamEyeY = player->pos.y - 70.0f; gCsCamEyeY = player->pos.y - 70.0f;
gCsCamEyeZ = player->unk_138 + 150.0f; gCsCamEyeZ = player->trueZpos + 150.0f;
gCsCamAtX = player->pos.x; gCsCamAtX = player->pos.x;
gCsCamAtY = player->pos.y; gCsCamAtY = player->pos.y;
gCsCamAtZ = player->unk_138; gCsCamAtZ = player->trueZpos;
if (player->timer_1F8 == 0) { if (player->csTimer == 0) {
player->unk_1D0 = 2; player->csState = 2;
player->timer_1F8 = 130; player->csTimer = 130;
D_ctx_80177A48[0] = 0.0f; D_ctx_80177A48[0] = 0.0f;
} }
if (player->timer_1F8 == 315) { if (player->csTimer == 315) {
player->pos.x = 0.0f; player->pos.x = 0.0f;
} }
if (player->timer_1F8 == 270) { if (player->csTimer == 270) {
gHideRadio = false; gHideRadio = false;
Radio_PlayMessage(gMsg_ID_2005, RCID_FOX); Radio_PlayMessage(gMsg_ID_2005, RCID_FOX);
} }
if (player->timer_1F8 == 180) { if (player->csTimer == 180) {
AUDIO_PLAY_SFX(0x09000007, player->sfxSource, 0); AUDIO_PLAY_SFX(0x09000007, player->sfxSource, 0);
} }
if (player->timer_1F8 == 120) { if (player->csTimer == 120) {
AUDIO_PLAY_SFX(0x09000013, player->sfxSource, 0); 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); 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; 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[1] = RAND_FLOAT_CENTERED(60.0f);
D_ctx_80177A48[2] = 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[1] = 0.0f;
D_ctx_80177A48[2] = D_ctx_80177A48[1]; 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); Math_SmoothStepToF(&D_ctx_80177A48[0], 0.1f, 1.0f, 0.001f, 0.0f);
gCsCamEyeX = player->pos.x - 50.0f; gCsCamEyeX = player->pos.x - 50.0f;
gCsCamEyeY = player->pos.y + 10.0f; gCsCamEyeY = player->pos.y + 10.0f;
gCsCamEyeZ = player->unk_138 - 10.0f; gCsCamEyeZ = player->trueZpos - 10.0f;
gCsCamAtX = player->pos.x; gCsCamAtX = player->pos.x;
gCsCamAtY = player->pos.y + 10.0f; gCsCamAtY = player->pos.y + 10.0f;
gCsCamAtZ = player->unk_138 + 10.0f; gCsCamAtZ = player->trueZpos + 10.0f;
if (player->timer_1F8 == 20) { if (player->csTimer == 20) {
Radio_PlayMessage(gMsg_ID_2010, RCID_FOX); Radio_PlayMessage(gMsg_ID_2010, RCID_FOX);
} }
if (player->timer_1F8 == 0) { if (player->csTimer == 0) {
player->unk_1D0 = 3; player->csState = 3;
player->timer_1F8 = 180; player->csTimer = 180;
player->unk_004 = 0.0f; player->unk_004 = 0.0f;
actor0->state = 0; actor0->state = 0;
actor2->state = 0; actor2->state = 0;
@ -2742,9 +2742,9 @@ void Corneria_LevelStart(Player* player) {
break; break;
case 3: case 3:
if (fabsf(Math_SmoothStepToF(&actor0->obj.pos.z, player->pos.z + 100.0f, 0.05f, 5.0f, 0.0f)) < 1.0f) { 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; D_ctx_80177A48[0] = 0.0f;
player->timer_1F8 = 190; player->csTimer = 190;
} }
if (gMsgCharIsPrinting && (gGameFrameCount & 2)) { if (gMsgCharIsPrinting && (gGameFrameCount & 2)) {
player->wings.unk_30 = 5.0f; player->wings.unk_30 = 5.0f;
@ -2763,14 +2763,14 @@ void Corneria_LevelStart(Player* player) {
gCsCamAtX = actor0->obj.pos.x; gCsCamAtX = actor0->obj.pos.x;
gCsCamAtY = actor0->obj.pos.y + 10.0f; gCsCamAtY = actor0->obj.pos.y + 10.0f;
gCsCamAtZ = actor0->obj.pos.z + 10.0f; gCsCamAtZ = actor0->obj.pos.z + 10.0f;
if (player->timer_1F8 == 0) { if (player->csTimer == 0) {
player->unk_1D0 = 5; player->csState = 5;
player->timer_1F8 = 5; player->csTimer = 5;
} }
if (player->timer_1F8 == 80) { if (player->csTimer == 80) {
Radio_PlayMessage(gMsg_ID_2020, RCID_FALCO); 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); Math_SmoothStepToF(&actor0->fwork[19], 50.0f, 0.1f, 3.0f, 0.01f);
} }
actor0->fwork[20] = 0.0f; actor0->fwork[20] = 0.0f;
@ -2780,10 +2780,10 @@ void Corneria_LevelStart(Player* player) {
break; break;
case 5: case 5:
Math_SmoothStepToF(&actor0->fwork[19], 0, 0.1f, 3.0f, 0.01f); Math_SmoothStepToF(&actor0->fwork[19], 0, 0.1f, 3.0f, 0.01f);
if (player->timer_1F8 == 0) { if (player->csTimer == 0) {
player->unk_1D0 = 6; player->csState = 6;
D_ctx_80177A48[0] = 0.0f; D_ctx_80177A48[0] = 0.0f;
player->timer_1F8 = 190; player->csTimer = 190;
} }
gCsCamEyeY = actor0->obj.pos.y + 10.0f; gCsCamEyeY = actor0->obj.pos.y + 10.0f;
@ -2803,14 +2803,14 @@ void Corneria_LevelStart(Player* player) {
gCsCamAtY = actor2->obj.pos.y + 10.0f; gCsCamAtY = actor2->obj.pos.y + 10.0f;
gCsCamAtZ = actor2->obj.pos.z + 10.0f; gCsCamAtZ = actor2->obj.pos.z + 10.0f;
if (player->timer_1F8 == 0) { if (player->csTimer == 0) {
player->unk_1D0 = 7; player->csState = 7;
player->timer_1F8 = 190; player->csTimer = 190;
D_ctx_80177A48[0] = 0.0f; D_ctx_80177A48[0] = 0.0f;
actor0->obj.pos.y = player->pos.y; 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); Radio_PlayMessage(gMsg_ID_2030, RCID_PEPPY);
} }
actor2->fwork[20] = 0.0f; actor2->fwork[20] = 0.0f;
@ -2826,18 +2826,18 @@ void Corneria_LevelStart(Player* player) {
gCsCamAtX = actor1->obj.pos.x + 10.0f; gCsCamAtX = actor1->obj.pos.x + 10.0f;
gCsCamAtY = actor1->obj.pos.y + 10.0f; gCsCamAtY = actor1->obj.pos.y + 10.0f;
gCsCamAtZ = actor1->obj.pos.z + 10.0f; gCsCamAtZ = actor1->obj.pos.z + 10.0f;
if (player->timer_1F8 == 0) { if (player->csTimer == 0) {
player->unk_1D0 = 8; player->csState = 8;
D_ctx_80177A48[0] = 0.0f; D_ctx_80177A48[0] = 0.0f;
player->timer_1F8 = 300; player->csTimer = 300;
D_ctx_80177A48[8] = 50.0f; D_ctx_80177A48[8] = 50.0f;
D_ctx_80177A48[3] = 0.0f; D_ctx_80177A48[3] = 0.0f;
} }
if (player->timer_1F8 == 80) { if (player->csTimer == 80) {
Radio_PlayMessage(gMsg_ID_2040, RCID_SLIPPY); Radio_PlayMessage(gMsg_ID_2040, RCID_SLIPPY);
player->pos.x = 0.1f; 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); Math_SmoothStepToF(&actor1->fwork[19], -20.0f, 0.1f, 3.0f, 0.01f);
} }
actor1->fwork[20] = 0.0f; actor1->fwork[20] = 0.0f;
@ -2847,60 +2847,60 @@ void Corneria_LevelStart(Player* player) {
break; break;
case 8: case 8:
Math_SmoothStepToF(&D_ctx_80177A48[0], 0.1f, 1.0f, 0.001f, 0.0f); 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; D_ctx_80177A48[3] += player->unk_004;
Math_SmoothStepToF(&player->unk_004, 2.0f, 1.0f, 0.2f, 0.0f); Math_SmoothStepToF(&player->unk_004, 2.0f, 1.0f, 0.2f, 0.0f);
} }
gCsCamEyeX = player->pos.x; 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]; gCsCamEyeY = player->pos.y + D_ctx_80177A48[8];
gCsCamAtX = player->pos.x; gCsCamAtX = player->pos.x;
gCsCamAtY = player->pos.y + 20.0f; gCsCamAtY = player->pos.y + 20.0f;
gCsCamAtZ = player->unk_138 + 100.0f; gCsCamAtZ = player->trueZpos + 100.0f;
if (player->timer_1F8 < 100) { if (player->csTimer < 100) {
Math_SmoothStepToF(&D_ctx_80177A48[8], 10.0f, 0.1f, 0.7f, 0.0f); 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); Radio_PlayMessage(gMsg_ID_2050, RCID_FOX);
} }
player->wings.unk_30 = 0.0f; player->wings.unk_30 = 0.0f;
if (gMsgCharIsPrinting && (gGameFrameCount & 2)) { if (gMsgCharIsPrinting && (gGameFrameCount & 2)) {
player->wings.unk_30 = 5.0f; player->wings.unk_30 = 5.0f;
} }
if (player->timer_1F8 == 80) { if (player->csTimer == 80) {
actor0->fwork[29] = 5.0f; actor0->fwork[29] = 5.0f;
} }
if (player->timer_1F8 == 60) { if (player->csTimer == 60) {
actor1->fwork[29] = 5.0f; actor1->fwork[29] = 5.0f;
} }
if (player->timer_1F8 == 40) { if (player->csTimer == 40) {
actor2->fwork[29] = 5.0f; 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; actor0->iwork[11] = 2;
} }
if ((player->timer_1F8 > 50) && (player->timer_1F8 < 60)) { if ((player->csTimer > 50) && (player->csTimer < 60)) {
actor1->iwork[11] = 2; actor1->iwork[11] = 2;
} }
if ((player->timer_1F8 > 30) && (player->timer_1F8 < 40)) { if ((player->csTimer > 30) && (player->csTimer < 40)) {
actor2->iwork[11] = 2; actor2->iwork[11] = 2;
} }
if (player->timer_1F8 == 70) { if (player->csTimer == 70) {
actor0->state = 1; actor0->state = 1;
func_play_800A6028(player->sfxSource, 0x09000002); func_play_800A6028(player->sfxSource, 0x09000002);
} }
if (player->timer_1F8 == 50) { if (player->csTimer == 50) {
actor1->state = 2; actor1->state = 2;
func_play_800A6028(player->sfxSource, 0x09000002); func_play_800A6028(player->sfxSource, 0x09000002);
} }
if (player->timer_1F8 == 30) { if (player->csTimer == 30) {
actor2->state = 3; actor2->state = 3;
func_play_800A6028(player->sfxSource, 0x09000002); func_play_800A6028(player->sfxSource, 0x09000002);
} }
if (player->timer_1F8 == 0) { if (player->csTimer == 0) {
player->unk_1D0 = 9; player->csState = 9;
func_play_800A6028(player->sfxSource, 0x09000002); func_play_800A6028(player->sfxSource, 0x09000002);
player->timer_1F8 = 3; player->csTimer = 3;
player->unk_194 = 5.0f; player->unk_194 = 5.0f;
player->unk_190 = 5.0f; player->unk_190 = 5.0f;
} }
@ -2908,13 +2908,13 @@ void Corneria_LevelStart(Player* player) {
case 9: case 9:
gCsCamEyeX = player->pos.x; gCsCamEyeX = player->pos.x;
gCsCamEyeY = player->pos.y; gCsCamEyeY = player->pos.y;
gCsCamEyeZ = player->unk_138 + 1000.0f; gCsCamEyeZ = player->trueZpos + 1000.0f;
gCsCamAtX = player->pos.x; gCsCamAtX = player->pos.x;
gCsCamAtY = player->pos.y; gCsCamAtY = player->pos.y;
gCsCamAtZ = player->unk_138 + 1100.0f; gCsCamAtZ = player->trueZpos + 1100.0f;
D_ctx_80177A48[0] = 0.03f; D_ctx_80177A48[0] = 0.03f;
player->unk_190 = 2.0f; player->unk_190 = 2.0f;
if (player->timer_1F8 == 0) { if (player->csTimer == 0) {
gFillScreenAlphaTarget = 255; gFillScreenAlphaTarget = 255;
gFillScreenAlphaStep = 48; gFillScreenAlphaStep = 48;
gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; 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.y = (player->pos.y * player->unk_148) + 50.0f;
player->cam.eye.z = 30.0f; player->cam.eye.z = 30.0f;
player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->state_1C8 = PLAYERSTATE_1C8_ACTIVE;
player->unk_1D0 = 0; player->csState = 0;
player->cam.at.x = player->pos.x; player->cam.at.x = player->pos.x;
player->cam.at.y = (player->pos.y * player->unk_148) + 20.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;
D_ctx_80177950 = 1.0f; D_ctx_80177950 = 1.0f;
gPlayerGlareAlphas[0] = gPlayerGlareAlphas[1] = gPlayerGlareAlphas[2] = gPlayerGlareAlphas[3] = 0; gPlayerGlareAlphas[0] = gPlayerGlareAlphas[1] = gPlayerGlareAlphas[2] = gPlayerGlareAlphas[3] = 0;
gLoadLevelObjects = 1; gLoadLevelObjects = 1;
gFillScreenAlphaTarget = 0; gFillScreenAlphaTarget = 0;
player->timer_1F8 = 15; player->csTimer = 15;
} }
break; break;
case 10: case 10:
break; break;
} }
Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 20000.0f, 0.0f); 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.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.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->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_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); 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; Vec3f sp38;
Player* player = &gPlayer[0]; 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.x = D_i1_80199AE4[arg1];
sp5C.y = D_i1_80199AF0[arg1]; sp5C.y = D_i1_80199AF0[arg1];
sp5C.z = D_i1_80199AFC[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.y = player->vel.y;
actor->vel.z = player->vel.z; actor->vel.z = player->vel.z;
actor->obj.status = OBJ_INIT; 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]; actor->obj.rot.z = D_i1_80199B2C[arg1];
Object_SetInfo(&actor->info, actor->obj.id); Object_SetInfo(&actor->info, actor->obj.id);
actor->iwork[11] = 1; actor->iwork[11] = 1;
@ -3027,12 +3027,12 @@ void Corneria_LevelComplete1(Player* player) {
f32 temp_deg; f32 temp_deg;
player->wings.unk_04 = player->wings.unk_0C = player->wings.unk_08 = player->wings.unk_10 = 0.0f; 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->zRotBarrelRoll, 0.0f, 0.1f, 15.0f, 0.0f);
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(&player->camRoll, 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); 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.eye.y += 3.0f;
player->cam.at.y += 3.0f; player->cam.at.y += 3.0f;
player->pos.y += 3.0f; player->pos.y += 3.0f;
@ -3043,7 +3043,7 @@ void Corneria_LevelComplete1(Player* player) {
gBgColor = 0x845; // 8, 8, 32 gBgColor = 0x845; // 8, 8, 32
switch (player->unk_1D0) { switch (player->csState) {
case 0: case 0:
Audio_StopSfxByBankAndSource(1, player->sfxSource); Audio_StopSfxByBankAndSource(1, player->sfxSource);
sp54 = player->cam.eye.x - D_i1_8019B6D8[62]; 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[0] = Math_RadToDeg(Math_Atan2F(sp54, sp4C));
D_ctx_80177A48[1] = sqrtf(SQ(sp54) + SQ(sp4C)); D_ctx_80177A48[1] = sqrtf(SQ(sp54) + SQ(sp4C));
player->unk_1D0++; player->csState++;
D_ctx_80177A48[5] = 0.0f; D_ctx_80177A48[5] = 0.0f;
D_ctx_80177A48[4] = D_ctx_80177A48[5]; D_ctx_80177A48[4] = D_ctx_80177A48[5];
D_ctx_80177A48[2] = D_ctx_80177A48[5]; D_ctx_80177A48[2] = D_ctx_80177A48[5];
/* fallthrough */ /* fallthrough */
case 1: 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(&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); 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; D_ctx_80177A48[0] += 0.5f;
} else { } else {
D_ctx_80177A48[0] -= 0.5f; D_ctx_80177A48[0] -= 0.5f;
@ -3080,25 +3080,25 @@ void Corneria_LevelComplete1(Player* player) {
temp_fa1 = player->pos.z - D_i1_8019B6D8[64]; temp_fa1 = player->pos.z - D_i1_8019B6D8[64];
if (gCsFrameCount < 30) { if (gCsFrameCount < 30) {
temp_deg = Math_RadToDeg(-Math_Atan2F(temp_fa0, temp_fa1)); 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 { } else {
temp_deg = Math_RadToDeg(Math_Atan2F(temp_fa0, temp_fa1)); 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) { if (gCsFrameCount == 220) {
player->unk_1D0++; player->csState++;
} }
break; break;
case 2: case 2:
Math_SmoothStepToAngle(&player->unk_0E4, 20.0f, 0.1f, 0.5f, 0.0001f); Math_SmoothStepToAngle(&player->rot.x, 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.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(&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.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.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); Math_SmoothStepToF(&player->cam.at.z, player->pos.z, D_ctx_80177A48[2], 500.0f, 0.0f);
if (gCsFrameCount == 350) { if (gCsFrameCount == 350) {
player->unk_1D0++; player->csState++;
D_ctx_80177A48[2] = 0.0f; D_ctx_80177A48[2] = 0.0f;
D_ctx_80177A48[3] = 0.05f; D_ctx_80177A48[3] = 0.05f;
} }
@ -3107,12 +3107,12 @@ void Corneria_LevelComplete1(Player* player) {
if ((gCsFrameCount > 700) && (gCsFrameCount < 1000)) { if ((gCsFrameCount > 700) && (gCsFrameCount < 1000)) {
func_demo_8004AA84(); func_demo_8004AA84();
} }
Math_SmoothStepToAngle(&player->unk_0E4, 20.0f, 0.1f, 0.5f, 0); Math_SmoothStepToAngle(&player->rot.x, 20.0f, 0.1f, 0.5f, 0);
Math_SmoothStepToAngle(&player->unk_0EC, 0.0f, 0.1f, 1.0f, 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(&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[2], 0.1f, 1.0f, 0.002f, 0);
Math_SmoothStepToF(&D_ctx_80177A48[3], 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_Push(&gCalcMatrix);
Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[5] * M_DTOR, MTXF_APPLY); Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[5] * M_DTOR, MTXF_APPLY);
sp64.x = 0.0f; 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_BGM, 50);
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50);
AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0); AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0);
player->unk_1D0++; player->csState++;
player->baseSpeed = 2.0f; player->baseSpeed = 2.0f;
player->unk_194 = 5.0f; player->unk_194 = 5.0f;
player->unk_190 = 5.0f; player->unk_190 = 5.0f;
@ -3151,9 +3151,9 @@ void Corneria_LevelComplete1(Player* player) {
case 4: case 4:
if (gCsFrameCount >= 1270) { if (gCsFrameCount >= 1270) {
player->baseSpeed *= 1.2f; player->baseSpeed *= 1.2f;
player->unk_25C += 0.04f; player->contrailScale += 0.04f;
if (player->unk_25C > 0.6f) { if (player->contrailScale > 0.6f) {
player->unk_25C = 0.6f; player->contrailScale = 0.6f;
} }
player->unk_190 = 2.0f; player->unk_190 = 2.0f;
} }
@ -3166,7 +3166,7 @@ void Corneria_LevelComplete1(Player* player) {
gFillScreenAlphaStep = 8; gFillScreenAlphaStep = 8;
if (gFillScreenAlpha == 255) { if (gFillScreenAlpha == 255) {
player->state_1C8 = PLAYERSTATE_1C8_NEXT; player->state_1C8 = PLAYERSTATE_1C8_NEXT;
player->timer_1F8 = 0; player->csTimer = 0;
gFadeoutType = 4; gFadeoutType = 4;
gLeveLClearStatus[gCurrentLevel] = Play_CheckMedalStatus(150) + 1; gLeveLClearStatus[gCurrentLevel] = Play_CheckMedalStatus(150) + 1;
} }
@ -3251,8 +3251,8 @@ void Corneria_LevelComplete1(Player* player) {
} }
break; break;
} }
Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); Matrix_RotateY(gCalcMatrix, (player->rot.y + 180.0f) * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -((player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); Matrix_RotateX(gCalcMatrix, -((player->rot.x + player->aerobaticPitch) * M_DTOR), MTXF_APPLY);
sp64.x = 0.0f; sp64.x = 0.0f;
sp64.y = 0.0f; sp64.y = 0.0f;
sp64.z = player->baseSpeed + player->boostSpeed; sp64.z = player->baseSpeed + player->boostSpeed;
@ -3263,10 +3263,10 @@ void Corneria_LevelComplete1(Player* player) {
player->pos.x += player->vel.x; player->pos.x += player->vel.x;
player->pos.y += player->vel.y; player->pos.y += player->vel.y;
player->pos.z += player->vel.z; 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_088 += 10.0f; player->bobPhase += 10.0f;
player->unk_080 = -SIN_DEG(player->unk_088) * 0.3f; player->yBob = -SIN_DEG(player->bobPhase) * 0.3f;
player->unk_0F4 += 8.0f; player->rockPhase += 8.0f;
player->unk_0F0 = SIN_DEG(player->unk_0F4); player->rockAngle = SIN_DEG(player->rockPhase);
} }

View File

@ -21,14 +21,14 @@ void Training_ItemRing_Update(ItemTrainingRing* this) {
switch (this->state) { switch (this->state) {
case 0: case 0:
this->obj.rot.z += 1.0f; 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->unk_44 == 0) && !gPlayer[0].somersault) {
if (this->obj.rot.y == 0.0f) { if (this->obj.rot.y == 0.0f) {
var_fv0 = 550.0f; var_fv0 = 550.0f;
} else { } else {
var_fv0 = 1000.0f; 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; this->unk_44 = 1;
PRINTF("♪:リング未通過音\n"); // Ring not passed sound PRINTF("♪:リング未通過音\n"); // Ring not passed sound
AUDIO_PLAY_SFX(0x4900402F, gDefaultSfxSource, 4); AUDIO_PLAY_SFX(0x4900402F, gDefaultSfxSource, 4);
@ -38,7 +38,7 @@ void Training_ItemRing_Update(ItemTrainingRing* this) {
if (this->collected) { if (this->collected) {
this->state = 1; this->state = 1;
this->timer_48 = 50; this->timer_48 = 50;
this->info.unk_10 = 10000.0f; this->info.cullDistance = 10000.0f;
PRINTF("♪:リング通過音\n"); // Ring passing sound PRINTF("♪:リング通過音\n"); // Ring passing sound
AUDIO_PLAY_SFX(0x49008025, gDefaultSfxSource, 4); AUDIO_PLAY_SFX(0x49008025, gDefaultSfxSource, 4);
gRingPassCount++; 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.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); this->obj.pos.y += ((gPlayer[this->playerNum].pos.y - this->obj.pos.y) * 0.05f);
if (gPlayer[0].cockpitView) { 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 { } 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; this->obj.rot.z += 22.0f;
Math_SmoothStepToAngle(&this->obj.rot.y, Math_RadToDeg(-gPlayer[this->playerNum].camYaw), 0.2f, 10.0f, Math_SmoothStepToAngle(&this->obj.rot.y, Math_RadToDeg(-gPlayer[this->playerNum].camYaw), 0.2f, 10.0f,

View File

@ -154,7 +154,7 @@ void Training_80199024(Actor* actor) {
radarMark->pos.x = actor->obj.pos.x; radarMark->pos.x = actor->obj.pos.x;
radarMark->pos.y = actor->obj.pos.y; radarMark->pos.y = actor->obj.pos.y;
radarMark->pos.z = actor->obj.pos.z; 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) { if (actor->iwork[8] != 0) {
actor->iwork[8]--; actor->iwork[8]--;
} }
@ -217,22 +217,22 @@ void Training_8019949C(void) {
} }
} }
if (D_ctx_80177C78 != 0) { if (gTraining360MsgTimer != 0) {
D_ctx_80177C78--; gTraining360MsgTimer--;
} }
if (D_ctx_80177C78 == 0) { if (gTraining360MsgTimer == 0) {
if (D_i1_8019AE50[D_ctx_80177C8C].msg == 0) { if (D_i1_8019AE50[gTraining360MsgIndex].msg == 0) {
D_ctx_80177C8C = 1; gTraining360MsgIndex = 1;
} }
if (D_i1_8019AE50[D_ctx_80177C8C].unk != 0) { if (D_i1_8019AE50[gTraining360MsgIndex].unk != 0) {
Radio_PlayMessage(D_i1_8019AE50[D_ctx_80177C8C].msg, RCID_TR); Radio_PlayMessage(D_i1_8019AE50[gTraining360MsgIndex].msg, RCID_TR);
D_ctx_80177C78 = D_i1_8019AE50[D_ctx_80177C8C].unk; gTraining360MsgTimer = D_i1_8019AE50[gTraining360MsgIndex].unk;
} else { } else {
gCallTimer = 80; gCallTimer = 80;
D_ctx_80177C78 = 320; gTraining360MsgTimer = 320;
} }
D_ctx_80177C8C++; gTraining360MsgIndex++;
} }
if ((gCallTimer != 0) && (gControllerPress[gMainController].button & R_CBUTTONS)) { if ((gCallTimer != 0) && (gControllerPress[gMainController].button & R_CBUTTONS)) {

View File

@ -339,8 +339,8 @@ void Venom1_80192518(Actor* actor) {
f32 temp_fv1_2; f32 temp_fv1_2;
Effect* effect; Effect* effect;
if (actor->unk_0D0 == 1) { if (actor->dmgType == 1) {
actor->unk_0D0 = 0; actor->dmgType = 0;
func_effect_8007A6F0(&actor->obj.pos, 0x29121007); func_effect_8007A6F0(&actor->obj.pos, 0x29121007);
} }
@ -621,8 +621,8 @@ void Venom1_80192CB0(Actor* actor) {
} }
void Venom1_80192CD4(Actor* actor) { void Venom1_80192CD4(Actor* actor) {
if (actor->unk_0D0 == 1) { if (actor->dmgType == 1) {
actor->unk_0D0 = 0; actor->dmgType = 0;
func_effect_8007A6F0(&actor->obj.pos, 0x29121007); func_effect_8007A6F0(&actor->obj.pos, 0x29121007);
} }
@ -763,8 +763,8 @@ void Venom1_80192EB0(Actor* actor) {
} }
break; break;
} }
if (actor->unk_0D0 == 1) { if (actor->dmgType == 1) {
actor->unk_0D0 = 0; actor->dmgType = 0;
func_effect_8007A6F0(&actor->obj.pos, 0x29121007); func_effect_8007A6F0(&actor->obj.pos, 0x29121007);
} }
actor->iwork[0]++; actor->iwork[0]++;
@ -778,8 +778,8 @@ void Venom1_801933B4(Actor* actor) {
void Venom1_801933DC(Actor* actor) { void Venom1_801933DC(Actor* actor) {
f32* hitboxData; f32* hitboxData;
if (actor->unk_0D0 == 1) { if (actor->dmgType == 1) {
actor->unk_0D0 = 0; actor->dmgType = 0;
AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 0); AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 0);
} }
@ -804,7 +804,7 @@ void Venom1_801934D0(Actor* actor) {
} }
void Venom1_80193540(Scenery* scenery) { 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); 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]) { switch (boss->swork[6]) {
case 0: 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->swork[15] == 0) {
if (boss->obj.pos.z >= temp_fs0) { 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); var_fv0 = Math_SmoothStepToF(&boss->obj.pos.z, temp_fs0, 0.5f, 35.0f, 0.01f);
} else { } else {
var_fv0 = Math_SmoothStepToF(&boss->obj.pos.z, temp_fs0, 0.4f, 10.0f, 0.01f); 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; 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)) { if ((fabsf(temp_fs0) <= 70.0f) && (boss->state == 3)) {
boss->swork[5] = D_i1_8019AD2C[4].unk_0[0].unk_0; boss->swork[5] = D_i1_8019AD2C[4].unk_0[0].unk_0;
boss->swork[4] = boss->swork[4]; boss->swork[4] = boss->swork[4];
@ -2221,7 +2221,7 @@ void Venom1_80194398(Boss* boss) {
if (actor->obj.status == OBJ_FREE) { if (actor->obj.status == OBJ_FREE) {
while ((is3 <= boss->swork[22]) && 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++; is3++;
} }
if (is3 <= boss->swork[22]) { if (is3 <= boss->swork[22]) {
@ -2368,7 +2368,7 @@ void Venom1_801985E4(Boss* boss) {
boss->state = boss->swork[9]; boss->state = boss->swork[9];
} }
void Venom1_8019864C(PlayerShot* playerShot) { void Venom1_8019864C(PlayerShot* shot) {
s32 i; s32 i;
s32 j; s32 j;
s32 count; s32 count;
@ -2382,7 +2382,7 @@ void Venom1_8019864C(PlayerShot* playerShot) {
boss = gBosses; boss = gBosses;
for (i = 0; i < 4; i++, boss++) { for (i = 0; i < 4; i++, boss++) {
if ((boss->obj.id == OBJ_BOSS_319) && (boss->obj.status == OBJ_ACTIVE) && (boss->timer_05A == 0)) { 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; hitboxData = boss->info.hitbox;
count = *hitboxData++; count = *hitboxData++;
if (count != 0) { if (count != 0) {
@ -2392,9 +2392,9 @@ void Venom1_8019864C(PlayerShot* playerShot) {
Matrix_RotateX(gCalcMatrix, -boss->obj.rot.x * M_DTOR, MTXF_APPLY); Matrix_RotateX(gCalcMatrix, -boss->obj.rot.x * M_DTOR, MTXF_APPLY);
Matrix_RotateY(gCalcMatrix, -boss->obj.rot.y * 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.x = shot->obj.pos.x - boss->obj.pos.x;
sp88.y = playerShot->obj.pos.y - boss->obj.pos.y; sp88.y = shot->obj.pos.y - boss->obj.pos.y;
sp88.z = playerShot->obj.pos.z - boss->obj.pos.z; sp88.z = shot->obj.pos.z - boss->obj.pos.z;
Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp88, &sp78); Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp88, &sp78);

View File

@ -44,8 +44,8 @@ Vec3f D_i2_80195610[] = {
}; };
void Meteo_80187530(Actor* actor) { void Meteo_80187530(Actor* actor) {
if (actor->unk_0D0 == 1) { if (actor->dmgType == 1) {
actor->unk_0D0 = 0; actor->dmgType = 0;
func_effect_8007A6F0(&actor->obj.pos, 0x2902107D); func_effect_8007A6F0(&actor->obj.pos, 0x2902107D);
} }
} }
@ -53,8 +53,8 @@ void Meteo_80187530(Actor* actor) {
void Meteo_8018756C(Actor* actor) { void Meteo_8018756C(Actor* actor) {
Vec3f vec; Vec3f vec;
if (actor->unk_0D0 != 0) { if (actor->dmgType != 0) {
actor->unk_0D0 = 0; actor->dmgType = 0;
actor->health -= actor->damage; actor->health -= actor->damage;
if (actor->health <= 0) { if (actor->health <= 0) {
actor->obj.status = OBJ_DYING; 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); 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_8007A6F0(&actor->obj.pos, 0x2903A008);
func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 10.0f); func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 10.0f);
Object_Kill(&actor->obj, actor->sfxSource); 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.x = actor->fwork[0] + sp44.x;
actor->obj.pos.y = actor->fwork[1] + sp44.y; actor->obj.pos.y = actor->fwork[1] + sp44.y;
if (actor->unk_0D0 != 0) { if (actor->dmgType != 0) {
Actor_Despawn(actor); Actor_Despawn(actor);
func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); func_effect_8007A6F0(&actor->obj.pos, 0x2903A008);
Object_Kill(&actor->obj, actor->sfxSource); Object_Kill(&actor->obj, actor->sfxSource);
@ -142,7 +142,7 @@ void Meteo_801877C4(Actor* actor) {
if (actor->timer_0BC == 0) { if (actor->timer_0BC == 0) {
actor->timer_0BC = 40; 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); 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.y += 7.0f;
actor->obj.rot.x += 3.3f; actor->obj.rot.x += 3.3f;
if (actor->unk_0D0 != 0) { if (actor->dmgType != 0) {
Actor_Despawn(actor); Actor_Despawn(actor);
func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); func_effect_8007A6F0(&actor->obj.pos, 0x2903A008);
Object_Kill(&actor->obj, actor->sfxSource); 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); 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); func_effect_8007A6F0(&actor->obj.pos, 0x2903A008);
Object_Kill(&actor->obj, actor->sfxSource); 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); 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); 20.0f, 30);
boss->state = 5; boss->state = 5;
boss->info.unk_10 = 1000.0f; boss->info.cullDistance = 1000.0f;
Audio_KillSfxBySourceAndId(boss->sfxSource, 0x3103605B); Audio_KillSfxBySourceAndId(boss->sfxSource, 0x3103605B);
AUDIO_PLAY_SFX(0x3102405D, boss->sfxSource, 4); AUDIO_PLAY_SFX(0x3102405D, boss->sfxSource, 4);
@ -933,7 +933,7 @@ void Meteo_8018978C(Boss* boss) {
if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) ||
(gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) { (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) {
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE;
gPlayer[0].unk_1D0 = 0; gPlayer[0].csState = 0;
gCsFrameCount = 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 >= 3) {
if (boss->state < 20) { if (boss->state < 20) {
@ -1085,7 +1085,7 @@ void Meteo_8018978C(Boss* boss) {
boss->swork[1] = 10; boss->swork[1] = 10;
boss->obj.pos.y += ((0.0f - boss->obj.pos.y) * boss->fwork[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 (sp7C < boss->fwork[9]) { if (sp7C < boss->fwork[9]) {
boss->state = 1; boss->state = 1;
@ -1101,7 +1101,7 @@ void Meteo_8018978C(Boss* boss) {
case 1: case 1:
boss->obj.pos.y += ((0.0f - boss->obj.pos.y) * boss->fwork[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) { if (boss->fwork[0] < 0.0f) {
boss->fwork[0] += 0.5f; boss->fwork[0] += 0.5f;
@ -1119,7 +1119,7 @@ void Meteo_8018978C(Boss* boss) {
case 2: case 2:
boss->obj.pos.y += ((0.0f - boss->obj.pos.y) * boss->fwork[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[1] < 0.05f) { if (boss->fwork[1] < 0.05f) {
boss->fwork[1] = boss->fwork[1] + 0.0004f; boss->fwork[1] = boss->fwork[1] + 0.0004f;
@ -1775,16 +1775,16 @@ void Meteo_8018BACC(Boss* boss) {
void Meteo_8018C77C(Actor* actor, s32 arg1) { void Meteo_8018C77C(Actor* actor, s32 arg1) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_INIT; 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.x = D_i2_80195584[arg1] + gPlayer[0].pos.x;
actor->obj.pos.y = D_i2_80195594[arg1] + gPlayer[0].pos.y; 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->unk_0B6 = D_i2_801955B4[arg1];
actor->obj.rot.y = 180.0f; actor->obj.rot.y = 180.0f;
Object_SetInfo(&actor->info, actor->obj.id); Object_SetInfo(&actor->info, actor->obj.id);
actor->info.unk_10 = 200.0f; actor->info.cullDistance = 200.0f;
if (actor->unk_0B6 == 0) { if (actor->unk_0B6 == 0) {
actor->iwork[11] = 1; actor->iwork[11] = 1;
@ -1839,7 +1839,7 @@ void Meteo_8018CAD8(void) {
actor->obj.pos.y = 0.0f; actor->obj.pos.y = 0.0f;
actor->obj.pos.z = 9000.0f; actor->obj.pos.z = 9000.0f;
actor->unk_0B6 = 10; actor->unk_0B6 = 10;
actor->obj.id = OBJ_ACTOR_195; actor->obj.id = OBJ_ACTOR_CUTSCENE;
Object_SetInfo(&actor->info, actor->obj.id); Object_SetInfo(&actor->info, actor->obj.id);
} }
@ -1897,7 +1897,7 @@ void Meteo_LevelStart(Player* player) {
PRINTF("Demo_Time %d\n"); PRINTF("Demo_Time %d\n");
switch (player->unk_1D0) { switch (player->csState) {
case 0: case 0:
gCsFrameCount = 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.x = gCsCamEyeX = player->pos.x + 100.0f;
player->cam.eye.y = gCsCamEyeY = player->pos.y; 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.x = gCsCamAtX = D_ctx_80177A48[2] + player->pos.x;
player->cam.at.y = gCsCamAtY = player->pos.y; 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; D_ctx_80177A48[3] = 1.0f;
@ -1938,14 +1938,14 @@ void Meteo_LevelStart(Player* player) {
actor3->vel.z = 4.0f; actor3->vel.z = 4.0f;
gCsCamEyeX = player->pos.x + 100.0f; gCsCamEyeX = player->pos.x + 100.0f;
gCsCamEyeY = player->pos.y; 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; gCsCamAtX = D_ctx_80177A48[2] + player->pos.x;
gCsCamAtY = player->pos.y + 20.0f; 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[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[2], 0.0f, 0.05f, 25.0f, 0);
Math_SmoothStepToF(&D_ctx_80177A48[4], 0.0f, 0.05f, 200.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; D_ctx_80177A48[0] = 0.1f;
if (gCsFrameCount == 680) { if (gCsFrameCount == 680) {
@ -1961,29 +1961,29 @@ void Meteo_LevelStart(Player* player) {
actor1->state = 13; actor1->state = 13;
} }
if (gCsFrameCount > 810) { if (gCsFrameCount > 810) {
player->unk_1D0 = 2; player->csState = 2;
D_ctx_80177A48[0] = 0.0f; D_ctx_80177A48[0] = 0.0f;
player->timer_1F8 = 40; player->csTimer = 40;
} }
sp8F = false; sp8F = false;
if (gCsFrameCount == 190) { if (gCsFrameCount == 190) {
player->timer_1FC = 5; player->csEventTimer = 5;
player->unk_1D8 = 10; player->meTargetIndex = 10;
sp8F = true; sp8F = true;
} }
if (gCsFrameCount == 230) { if (gCsFrameCount == 230) {
player->timer_1FC = 3; player->csEventTimer = 3;
player->unk_1D8 = 6; player->meTargetIndex = 6;
sp8F = true; sp8F = true;
} }
if (gCsFrameCount == 240) { if (gCsFrameCount == 240) {
player->timer_1FC = 3; player->csEventTimer = 3;
player->unk_1D8 = 11; player->meTargetIndex = 11;
sp8F = true; sp8F = true;
} }
if (gCsFrameCount == 270) { if (gCsFrameCount == 270) {
player->timer_1FC = 2; player->csEventTimer = 2;
player->unk_1D8 = 12; player->meTargetIndex = 12;
sp8F = true; sp8F = true;
} }
if (gCsFrameCount == 600) { if (gCsFrameCount == 600) {
@ -2022,16 +2022,16 @@ void Meteo_LevelStart(Player* player) {
Meteo_8018CCF8(&gActors[8]); Meteo_8018CCF8(&gActors[8]);
} }
if (player->timer_1FC != 0) { if (player->csEventTimer != 0) {
if (sp8F != 0) { if (sp8F != 0) {
sp58 = D_i2_801955C4; sp58 = D_i2_801955C4;
D_ctx_80177A48[3] *= -1.0f; D_ctx_80177A48[3] *= -1.0f;
x = gActors[player->unk_1D8].obj.pos.x - (actor3->obj.pos.x + (D_ctx_80177A48[3] * 74.0f)); x = gActors[player->meTargetIndex].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); y = gActors[player->meTargetIndex].obj.pos.y - (actor3->obj.pos.y - 232.0f);
z = gActors[player->unk_1D8].obj.pos.z - (actor3->obj.pos.z - 1190.0f); z = gActors[player->meTargetIndex].obj.pos.z - (actor3->obj.pos.z - 1190.0f);
sp64 = Math_RadToDeg(Math_Atan2F(x, z)); 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)); sp68 = Math_RadToDeg(-Math_Atan2F(y, x));
Matrix_RotateY(gCalcMatrix, M_DTOR * sp64, MTXF_NEW); 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, actor3->obj.pos.z - 1190.0f + (sp4C.z * 0.8f), sp4C.x, sp4C.y, sp4C.z, sp68,
sp64, 0.0f); sp64, 0.0f);
} }
if (player->timer_1FC == 1) { if (player->csEventTimer == 1) {
func_effect_8007D2C8(gActors[player->unk_1D8].obj.pos.x, gActors[player->unk_1D8].obj.pos.y, func_effect_8007D2C8(gActors[player->meTargetIndex].obj.pos.x,
gActors[player->unk_1D8].obj.pos.z, 10.0f); gActors[player->meTargetIndex].obj.pos.y,
gActors[player->unk_1D8].obj.status = OBJ_FREE; gActors[player->meTargetIndex].obj.pos.z, 10.0f);
Meteo_8018CCF8(&gActors[player->unk_1D8]); gActors[player->meTargetIndex].obj.status = OBJ_FREE;
Meteo_8018CCF8(&gActors[player->meTargetIndex]);
Object_Kill(&gPlayerShots[0].obj, gPlayerShots[0].sfxSource); Object_Kill(&gPlayerShots[0].obj, gPlayerShots[0].sfxSource);
} }
} }
@ -2059,23 +2060,23 @@ void Meteo_LevelStart(Player* player) {
gCsCamEyeZ = 400.0f; gCsCamEyeZ = 400.0f;
gCsCamAtX = player->pos.x; gCsCamAtX = player->pos.x;
gCsCamAtY = (player->pos.y * player->unk_148) + 20.0f; 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); 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); AUDIO_PLAY_BGM(gBgmSeqId);
gLevelStartStatusScreenTimer = 80; gLevelStartStatusScreenTimer = 80;
player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->state_1C8 = PLAYERSTATE_1C8_ACTIVE;
player->unk_1D0 = 0; player->csState = 0;
player->timer_1F8 = 0; player->csTimer = 0;
player->timer_1FC = 0; player->csEventTimer = 0;
player->cam.eye.x = player->pos.x; player->cam.eye.x = player->pos.x;
player->cam.eye.y = (player->pos.y * player->unk_148) + 50.0f; player->cam.eye.y = (player->pos.y * player->unk_148) + 50.0f;
player->cam.eye.z = 400.0f; player->cam.eye.z = 400.0f;
player->cam.at.x = player->pos.x; player->cam.at.x = player->pos.x;
player->cam.at.y = (player->pos.y * player->unk_148) + 20.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;
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
Object_Kill(&gActors[i].obj, gActors[i].sfxSource); Object_Kill(&gActors[i].obj, gActors[i].sfxSource);
@ -2184,11 +2185,11 @@ void Meteo_8018DE14(Effect* effect) {
void Meteo_8018DF08(Actor* actor, s32 idx) { void Meteo_8018DF08(Actor* actor, s32 idx) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_INIT; 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.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.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.y = 0.0f;
actor->unk_0F4.z = D_i2_80195600[idx]; actor->unk_0F4.z = D_i2_80195600[idx];
@ -2212,19 +2213,19 @@ void Meteo_LevelComplete(Player* player) {
gBosses[1].obj.status = OBJ_FREE; gBosses[1].obj.status = OBJ_FREE;
Math_SmoothStepToF(&player->unk_130, 0.0f, 0.1f, 15.0f, 0.0f); Math_SmoothStepToF(&player->zRotBarrelRoll, 0.0f, 0.1f, 15.0f, 0.0f);
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(&player->unk_0E8, 0.0f, 0.1f, 3.0f, 0.0f); Math_SmoothStepToF(&player->rot.y, 0.0f, 0.1f, 3.0f, 0.0f);
Math_SmoothStepToF(&player->unk_0EC, 0.0f, 0.1f, 3.0f, 0.0f); Math_SmoothStepToF(&player->rot.z, 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);
Math_SmoothStepToF(&player->camRoll, 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); Math_SmoothStepToF(&player->boostSpeed, 0.0f, 0.1f, 3.0f, 0.0f);
switch (player->unk_1D0) { switch (player->csState) {
case 0: case 0:
Audio_StopSfxByBankAndSource(1, player->sfxSource); Audio_StopSfxByBankAndSource(1, player->sfxSource);
player->unk_1D0++; player->csState++;
D_ctx_80177A48[0] = 0.0f; D_ctx_80177A48[0] = 0.0f;
D_ctx_80177A48[1] = 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; gCsCamEyeX = gBosses[0].obj.pos.x + dest.x;
gCsCamEyeY = gBosses[0].obj.pos.y + dest.y; 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; gCsCamAtX = gBosses[0].obj.pos.x;
gCsCamAtY = gBosses[0].obj.pos.y; 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[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[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(&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(&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(&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) { if (gCsFrameCount == 320) {
gCsFrameCount = 200; gCsFrameCount = 200;
D_ctx_80177A48[0] = 0.0f; D_ctx_80177A48[0] = 0.0f;
D_ctx_80177A48[3] = 0.0f; D_ctx_80177A48[3] = 0.0f;
D_ctx_80177A48[4] = 0.0f; D_ctx_80177A48[4] = 0.0f;
player->unk_1D0++; player->csState++;
player->timer_1F8 = 100; player->csTimer = 100;
} }
break; break;
case 2: 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); 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); AUDIO_PLAY_BGM(SEQ_ID_GOOD_END);
} }
@ -2311,11 +2312,11 @@ void Meteo_LevelComplete(Player* player) {
gCsCamAtX = player->pos.x; gCsCamAtX = player->pos.x;
gCsCamAtY = player->pos.y; gCsCamAtY = player->pos.y;
gCsCamAtZ = player->unk_138 + D_ctx_80177D20 + 150.0f; gCsCamAtZ = player->trueZpos + gPathProgress + 150.0f;
if (gCsFrameCount > 1390) { if (gCsFrameCount > 1390) {
player->baseSpeed += 2.0f; player->baseSpeed += 2.0f;
player->unk_0E4 += 0.1f; player->rot.x += 0.1f;
player->unk_190 = 2.0f; player->unk_190 = 2.0f;
if (gCsFrameCount == 1465) { if (gCsFrameCount == 1465) {
@ -2328,7 +2329,7 @@ void Meteo_LevelComplete(Player* player) {
gFillScreenAlphaStep = 8; gFillScreenAlphaStep = 8;
if (gFillScreenAlpha == 255) { if (gFillScreenAlpha == 255) {
player->state_1C8 = PLAYERSTATE_1C8_NEXT; player->state_1C8 = PLAYERSTATE_1C8_NEXT;
player->timer_1F8 = 0; player->csTimer = 0;
gFadeoutType = 4; gFadeoutType = 4;
gLeveLClearStatus[LEVEL_METEO] = Play_CheckMedalStatus(200) + 1; gLeveLClearStatus[LEVEL_METEO] = Play_CheckMedalStatus(200) + 1;
} }
@ -2336,7 +2337,7 @@ void Meteo_LevelComplete(Player* player) {
} else { } else {
gCsCamEyeX = player->pos.x + dest.x; gCsCamEyeX = player->pos.x + dest.x;
gCsCamEyeY = player->pos.y + dest.y; 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; break;
} }
@ -2439,7 +2440,7 @@ void Meteo_LevelComplete(Player* player) {
gActors[3].state = 1; gActors[3].state = 1;
gActors[3].obj.pos.x = player->cam.eye.x - 700.0f; gActors[3].obj.pos.x = player->cam.eye.x - 700.0f;
gActors[3].obj.pos.y = player->cam.eye.y; 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; 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.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0);
Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, 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_RotateY(gCalcMatrix, (player->rot.y + 180.0f) * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -((player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); Matrix_RotateX(gCalcMatrix, -((player->rot.x + player->aerobaticPitch) * M_DTOR), MTXF_APPLY);
src.x = 0.0f; src.x = 0.0f;
src.y = 0.0f; src.y = 0.0f;
@ -2467,12 +2468,12 @@ void Meteo_LevelComplete(Player* player) {
player->pos.y += player->vel.y; player->pos.y += player->vel.y;
player->pos.z += player->vel.z; player->pos.z += player->vel.z;
player->unk_138 = player->pos.z + player->unk_08C; player->trueZpos = player->pos.z + player->camDist;
player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll;
player->unk_088 += 10.0f; player->bobPhase += 10.0f;
player->unk_080 = -SIN_DEG(player->unk_088) * 0.3f; player->yBob = -SIN_DEG(player->bobPhase) * 0.3f;
player->unk_0F4 += 8.0f; player->rockPhase += 8.0f;
player->unk_0F0 = SIN_DEG(player->unk_0F4); player->rockAngle = SIN_DEG(player->rockPhase);
} }
void Meteo_8018ED9C(Actor* actor) { void Meteo_8018ED9C(Actor* actor) {

View File

@ -28,7 +28,7 @@ void SectorX_8018F030(void) {
actor->obj.rot.y = 180.0f; actor->obj.rot.y = 180.0f;
actor->obj.pos.x = gPlayer[0].cam.eye.x - 300.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.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->iwork[11] = 1;
actor->aiType = AI360_SLIPPY; actor->aiType = AI360_SLIPPY;
Object_SetInfo(&actor->info, actor->obj.id); 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.y = gPlayer[0].cam.eye.y - 3000.0f;
actor->obj.pos.z = gPlayer[0].pos.z + 30000.0f; actor->obj.pos.z = gPlayer[0].pos.z + 30000.0f;
Object_SetInfo(&actor->info, actor->obj.id); Object_SetInfo(&actor->info, actor->obj.id);
actor->info.unk_10 = 100000.0f; actor->info.cullDistance = 100000.0f;
} }
void SectorX_8018F1DC(Actor* actor) { 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(&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.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.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.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); Math_SmoothStepToF(&gPlayer[0].cam.eye.y, actor->obj.pos.y, actor->fwork[1], 20.0f, 0.0f);
if (actor->timer_0BC == 0) { if (actor->timer_0BC == 0) {
@ -197,8 +197,8 @@ void SectorX_8018FA04(f32 x, f32 y, f32 z) {
actor->obj.pos.z = z; actor->obj.pos.z = z;
Object_SetInfo(&actor->info, actor->obj.id); Object_SetInfo(&actor->info, actor->obj.id);
actor->info.hitbox = SEGMENTED_TO_VIRTUAL(D_SX_60328CC); actor->info.hitbox = SEGMENTED_TO_VIRTUAL(D_SX_60328CC);
xRot = Math_Atan2F(gPlayer[0].pos.x - x, 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].unk_138 - z)); pad = sqrtf(SQ(gPlayer[0].pos.x - x) + SQ(gPlayer[0].trueZpos - z));
yRot = -Math_Atan2F(gPlayer[0].pos.y - y, pad); yRot = -Math_Atan2F(gPlayer[0].pos.y - y, pad);
Matrix_RotateY(gCalcMatrix, xRot, MTXF_NEW); Matrix_RotateY(gCalcMatrix, xRot, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, yRot, MTXF_APPLY); Matrix_RotateX(gCalcMatrix, yRot, MTXF_APPLY);
@ -208,7 +208,7 @@ void SectorX_8018FA04(f32 x, f32 y, f32 z) {
Matrix_MultVec3f(gCalcMatrix, &src, &dest); Matrix_MultVec3f(gCalcMatrix, &src, &dest);
actor->vel.x = dest.x; actor->vel.x = dest.x;
actor->vel.y = dest.y; actor->vel.y = dest.y;
actor->vel.z = dest.z - D_ctx_80177D08; actor->vel.z = dest.z - gPathVelZ;
break; break;
} }
} }
@ -360,7 +360,7 @@ void SectorX_80190078(Boss* boss) {
} }
sp68 = gPlayer[0].pos.x - boss->obj.pos.x; 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) { if (boss->swork[7] != 0) {
sp70 = Math_RadToDeg(Math_Atan2F(sp68, sp64)); sp70 = Math_RadToDeg(Math_Atan2F(sp68, sp64));
@ -498,7 +498,7 @@ void SectorX_80190078(Boss* boss) {
switch (boss->state) { switch (boss->state) {
case 0: case 0:
boss->swork[7] = 1; boss->swork[7] = 1;
boss->obj.pos.x = gPlayer[0].unk_0AC; boss->obj.pos.x = gPlayer[0].xPath;
boss->swork[0] = 0; boss->swork[0] = 0;
Animation_GetFrameData(&D_SX_60206DC, boss->unk_04C, boss->vwork); Animation_GetFrameData(&D_SX_60206DC, boss->unk_04C, boss->vwork);
boss->fwork[1] = -2000.0f; boss->fwork[1] = -2000.0f;
@ -1072,7 +1072,7 @@ void SectorX_80190078(Boss* boss) {
if (boss->timer_050 == 120) { if (boss->timer_050 == 120) {
if ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_NEXT) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_DOWN)) { 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].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE;
gPlayer[0].unk_1D0 = 0; gPlayer[0].csState = 0;
gPlayer[0].unk_234 = 1; gPlayer[0].unk_234 = 1;
} }
Object_Kill(&boss->obj, boss->sfxSource); Object_Kill(&boss->obj, boss->sfxSource);
@ -1412,7 +1412,7 @@ void SectorX_80193800(Actor* actor, s32 arg1) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_ACTIVE; 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.x = D_i2_801956B0[arg1].x;
actor->obj.pos.y = D_i2_801956B0[arg1].y; actor->obj.pos.y = D_i2_801956B0[arg1].y;
actor->obj.pos.z = D_i2_801956B0[arg1].z; 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) { void SectorX_801938D8(Actor* actor, s32 arg1) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_ACTIVE; 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.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.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; 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 xzDeg;
f32 xyzDeg; f32 xyzDeg;
switch (player->unk_1D0) { switch (player->csState) {
case 0: case 0:
gCsFrameCount = 0; gCsFrameCount = 0;
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
SectorX_80193800(&gActors[5 + i], i); SectorX_80193800(&gActors[5 + i], i);
} }
player->unk_1D0 = 1; player->csState = 1;
player->cam.eye.x = gCsCamEyeX = 100.0f; player->cam.eye.x = gCsCamEyeX = 100.0f;
player->cam.eye.y = gCsCamEyeY = 0.0f; player->cam.eye.y = gCsCamEyeY = 0.0f;
player->cam.eye.z = gCsCamEyeZ = -200.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_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); func_effect_8007A6F0(&gActors[5].obj.pos, 0x2903B009);
player->unk_1D0 += 1; player->csState += 1;
D_ctx_80177A48[0] = 0.1f; D_ctx_80177A48[0] = 0.1f;
} }
break; break;
@ -1515,13 +1515,13 @@ void SectorX_LevelStart(Player* player) {
if (gCsFrameCount == 170) { if (gCsFrameCount == 170) {
player->pos.x = 0.0f; player->pos.x = 0.0f;
player->pos.y = player->cam.eye.y + 50.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->pos.z = player->cam.eye.z + 20.0f;
player->unk_194 = 10.0f; player->unk_194 = 10.0f;
player->unk_190 = 10.0f; player->unk_190 = 10.0f;
player->baseSpeed = 30.0f; player->baseSpeed = 30.0f;
player->unk_0EC = -80.0f; player->rot.z = -80.0f;
player->unk_0E4 = -20.0f; player->rot.x = -20.0f;
AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0); AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0);
for (i = 6; i < 10; i++) { for (i = 6; i < 10; i++) {
Object_Kill(&gActors[i].obj, gActors[i].sfxSource); 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->camRoll, 0.0f, 0.5f, 0.07f, 0);
Math_SmoothStepToF(&player->unk_0EC, 0.0f, 0.2f, 2.0f, 0); Math_SmoothStepToF(&player->rot.z, 0.0f, 0.2f, 2.0f, 0);
Math_SmoothStepToF(&player->unk_0E4, 20.0f, 0.1f, 1.0f, 0); Math_SmoothStepToF(&player->rot.x, 20.0f, 0.1f, 1.0f, 0);
switch (gCsFrameCount) { switch (gCsFrameCount) {
case 195: case 195:
@ -1561,8 +1561,8 @@ void SectorX_LevelStart(Player* player) {
} }
if (gCsFrameCount > 300) { if (gCsFrameCount > 300) {
player->unk_1D0 += 1; player->csState += 1;
player->timer_1F8 = 40; player->csTimer = 40;
D_ctx_80177A48[0] = 0.0f; D_ctx_80177A48[0] = 0.0f;
gActors[0].obj.pos.z -= player->pos.z; gActors[0].obj.pos.z -= player->pos.z;
gActors[1].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: case 4:
Math_SmoothStepToF(&player->camRoll, 0.0f, 0.2f, 0.5f, 0); 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->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; gCsCamEyeX = player->pos.x;
gCsCamEyeY = (player->pos.y * player->unk_148) + 50.0f; gCsCamEyeY = (player->pos.y * player->unk_148) + 50.0f;
gCsCamEyeZ = 400.0f; gCsCamEyeZ = 400.0f;
gCsCamAtX = player->pos.x; gCsCamAtX = player->pos.x;
gCsCamAtY = (player->pos.y * player->unk_148) + 20.0f; 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); Math_SmoothStepToF(D_ctx_80177A48, 1.0f, 1.0f, 0.01f, 0);
if (player->timer_1F8 == 0) { if (player->csTimer == 0) {
player->baseSpeed = gArwingSpeed; player->baseSpeed = gArwingSpeed;
AUDIO_PLAY_BGM(gBgmSeqId); AUDIO_PLAY_BGM(gBgmSeqId);
gLevelStartStatusScreenTimer = 80; gLevelStartStatusScreenTimer = 80;
player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; 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.y = player->pos.y * player->unk_148 + 50.0f;
player->cam.eye.z = 400.0f; player->cam.eye.z = 400.0f;
player->cam.at.y = player->pos.y * player->unk_148 + 20.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; player->cam.at.x = player->cam.eye.x = player->pos.x;
gLoadLevelObjects = 1; gLoadLevelObjects = 1;
for (i = 0; i < 3; i++) { 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.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.y, gCsCamAtY, D_ctx_80177A48[0], 20000.0f, 0);
Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, 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_RotateY(gCalcMatrix, (player->rot.y + 180.0f) * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); Matrix_RotateX(gCalcMatrix, -(player->rot.x * M_DTOR), MTXF_APPLY);
src.x = 0.0f; src.x = 0.0f;
src.y = 0.0f; src.y = 0.0f;
src.z = player->baseSpeed; src.z = player->baseSpeed;
@ -1624,7 +1624,7 @@ void SectorX_LevelStart(Player* player) {
player->pos.x += player->vel.x; player->pos.x += player->vel.x;
player->pos.y += player->vel.y; player->pos.y += player->vel.y;
player->pos.z += player->vel.z; 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) { void SectorX_801944D4(Actor* actor, s32 arg1) {
@ -1634,7 +1634,7 @@ void SectorX_801944D4(Actor* actor, s32 arg1) {
Vec3f destB; Vec3f destB;
Player* player = &gPlayer[0]; 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.x = D_i2_80195710[arg1];
srcA.y = D_i2_80195720[arg1]; srcA.y = D_i2_80195720[arg1];
srcA.z = D_i2_80195730[arg1]; srcA.z = D_i2_80195730[arg1];
@ -1647,7 +1647,7 @@ void SectorX_801944D4(Actor* actor, s32 arg1) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.pos.x = player->pos.x + destA.x; actor->obj.pos.x = player->pos.x + destA.x;
actor->obj.pos.y = player->pos.y + destA.y; 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[0] = destB.x;
actor->fwork[1] = destB.y; actor->fwork[1] = destB.y;
actor->fwork[2] = destB.z; actor->fwork[2] = destB.z;
@ -1657,13 +1657,13 @@ void SectorX_801944D4(Actor* actor, s32 arg1) {
actor->vel.y = player->vel.y; actor->vel.y = player->vel.y;
actor->vel.z = player->vel.z; actor->vel.z = player->vel.z;
actor->obj.status = OBJ_INIT; actor->obj.status = OBJ_INIT;
actor->obj.id = OBJ_ACTOR_195; actor->obj.id = OBJ_ACTOR_CUTSCENE;
Object_SetInfo(&actor->info, actor->obj.id); Object_SetInfo(&actor->info, actor->obj.id);
if (arg1 == 3) { if (arg1 == 3) {
actor->unk_0B6 = 1; actor->unk_0B6 = 1;
actor->state = 20; actor->state = 20;
actor->obj.rot.x = -player->unk_0E4 - 10.0f; actor->obj.rot.x = -player->rot.x - 10.0f;
actor->obj.rot.y = (player->unk_0E8 + 180.0f) - 10.0f; actor->obj.rot.y = (player->rot.y + 180.0f) - 10.0f;
actor->fwork[9] = 10.0f; actor->fwork[9] = 10.0f;
} else { } else {
actor->obj.rot.z = D_i2_80195770[arg1]; actor->obj.rot.z = D_i2_80195770[arg1];
@ -1678,23 +1678,23 @@ void SectorX_LevelComplete(Player* player) {
Vec3f sp48; Vec3f sp48;
s32 pad[5]; s32 pad[5];
Math_SmoothStepToF(&player->unk_130, 0.0f, 0.1f, 15.0f, 0.0f); Math_SmoothStepToF(&player->zRotBarrelRoll, 0.0f, 0.1f, 15.0f, 0.0f);
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(&player->unk_0E4, 0.0f, 0.1f, 3.0f, 0.0f); Math_SmoothStepToF(&player->rot.x, 0.0f, 0.1f, 3.0f, 0.0f);
Math_SmoothStepToF(&player->unk_0E8, 0.0f, 0.1f, 3.0f, 0.0f); Math_SmoothStepToF(&player->rot.y, 0.0f, 0.1f, 3.0f, 0.0f);
Math_SmoothStepToF(&player->unk_0EC, 0.0f, 0.1f, 3.0f, 0.0f); Math_SmoothStepToF(&player->rot.z, 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);
Math_SmoothStepToF(&player->camRoll, 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); Math_SmoothStepToF(&player->boostSpeed, 0.0f, 0.1f, 3.0f, 0.0f);
D_ctx_80178430 += 0.2f; D_ctx_80178430 += 0.2f;
D_ctx_8017842C -= 0.2f; D_ctx_8017842C -= 0.2f;
switch (player->unk_1D0) { switch (player->csState) {
case 0: case 0:
Audio_StopSfxByBankAndSource(1, player->sfxSource); Audio_StopSfxByBankAndSource(1, player->sfxSource);
player->unk_1D0 += 1; player->csState += 1;
D_ctx_80177A48[1] = 0.05f; D_ctx_80177A48[1] = 0.05f;
D_ctx_80177A48[0] = 0.02f; D_ctx_80177A48[0] = 0.02f;
D_ctx_80177A48[2] = 0.0f; 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(&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, 0.1f, 1.0f, 0.002f, 0.0f);
Math_SmoothStepToF(D_ctx_80177A48 + 1, 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_RotateY(gCalcMatrix, player->rot.y * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, MTXF_APPLY); Matrix_RotateX(gCalcMatrix, player->rot.x * M_DTOR, MTXF_APPLY);
Matrix_Push(&gCalcMatrix); Matrix_Push(&gCalcMatrix);
Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[2] * M_DTOR, MTXF_APPLY); Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[2] * M_DTOR, MTXF_APPLY);
sp54.x = 0.0f; sp54.x = 0.0f;
@ -1728,7 +1728,7 @@ void SectorX_LevelComplete(Player* player) {
Matrix_MultVec3f(gCalcMatrix, &sp54, &sp48); 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.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.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); 0.0f);
Matrix_Pop(&gCalcMatrix); Matrix_Pop(&gCalcMatrix);
sp54.x = 0.0f; sp54.x = 0.0f;
@ -1737,14 +1737,14 @@ void SectorX_LevelComplete(Player* player) {
Matrix_MultVec3f(gCalcMatrix, &sp54, &sp48); 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.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.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); 0.0f);
break; break;
case 2: case 2:
player->baseSpeed += 2.0f; player->baseSpeed += 2.0f;
if (player->timer_1F8 == 0) { if (player->csTimer == 0) {
Math_SmoothStepToAngle(&player->unk_0E4, 20.0f, 0.1f, 0.5f, 0.0f); Math_SmoothStepToAngle(&player->rot.x, 20.0f, 0.1f, 0.5f, 0.0f);
} }
if (gCsFrameCount == 1195) { if (gCsFrameCount == 1195) {
@ -1757,7 +1757,7 @@ void SectorX_LevelComplete(Player* player) {
if (gFillScreenAlpha == 255) { if (gFillScreenAlpha == 255) {
player->state_1C8 = PLAYERSTATE_1C8_NEXT; player->state_1C8 = PLAYERSTATE_1C8_NEXT;
gFadeoutType = 4; gFadeoutType = 4;
player->timer_1F8 = 0; player->csTimer = 0;
Play_ClearObjectData(); Play_ClearObjectData();
gLeveLClearStatus[LEVEL_SECTOR_X] = Play_CheckMedalStatus(150) + 1; 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_BGM, 50);
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50);
AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0); AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0);
player->unk_1D0 = 2; player->csState = 2;
player->timer_1F8 = 40; player->csTimer = 40;
player->unk_194 = 5.0f; player->unk_194 = 5.0f;
player->unk_190 = 5.0f; player->unk_190 = 5.0f;
break; break;
@ -1925,8 +1925,8 @@ void SectorX_LevelComplete(Player* player) {
break; break;
} }
} }
Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); Matrix_RotateY(gCalcMatrix, (player->rot.y + 180.0f) * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -((player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); Matrix_RotateX(gCalcMatrix, -((player->rot.x + player->aerobaticPitch) * M_DTOR), MTXF_APPLY);
sp54.x = 0.0f; sp54.x = 0.0f;
sp54.y = 0.0f; sp54.y = 0.0f;
sp54.z = player->baseSpeed + player->boostSpeed; sp54.z = player->baseSpeed + player->boostSpeed;
@ -1937,10 +1937,10 @@ void SectorX_LevelComplete(Player* player) {
player->pos.x += player->vel.x; player->pos.x += player->vel.x;
player->pos.y += player->vel.y; player->pos.y += player->vel.y;
player->pos.z += player->vel.z; player->pos.z += player->vel.z;
player->unk_138 = player->pos.z + player->unk_08C; player->trueZpos = player->pos.z + player->camDist;
player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll;
player->unk_088 += 10.0f; player->bobPhase += 10.0f;
player->unk_080 = -SIN_DEG(player->unk_088) * 0.3f; player->yBob = -SIN_DEG(player->bobPhase) * 0.3f;
player->unk_0F4 += 8.0f; player->rockPhase += 8.0f;
player->unk_0F0 = SIN_DEG(player->unk_0F4); player->rockAngle = SIN_DEG(player->rockPhase);
} }

View File

@ -552,10 +552,10 @@ void Area6_80187944(Boss* bossA6) {
if ((bossA6->state < 6) || ((bossA6->state >= 8) && (bossA6->state < 12))) { 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, 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 = bossA6->obj.rot.x =
RAD_TO_DEG(-Math_Atan2F(gPlayer[0].cam.eye.y - bossA6->obj.pos.y, 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)))); SQ(gPlayer[0].cam.eye.x - bossA6->obj.pos.x))));
} }
@ -583,7 +583,7 @@ void Area6_80187944(Boss* bossA6) {
gTeamLowHealthMsgTimer = -1; 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); AUDIO_PLAY_SFX(0x2940D09A, bossA6->sfxSource, 4);
@ -688,7 +688,7 @@ void Area6_80187944(Boss* bossA6) {
if (bossA6->state != 0) { 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->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); bossA6->fwork[A6_FWK_4], 0.00001f);
if (bossA6->state < 5) { if (bossA6->state < 5) {
sp120 = 2.0f; sp120 = 2.0f;
@ -785,7 +785,7 @@ void Area6_80187944(Boss* bossA6) {
if ((bossA6->timer_050 != 0) && (bossA6->timer_050 < 200)) { if ((bossA6->timer_050 != 0) && (bossA6->timer_050 < 200)) {
dx_11C = gPlayer[0].cam.eye.x - bossA6->obj.pos.x; dx_11C = gPlayer[0].cam.eye.x - bossA6->obj.pos.x;
dy_118 = gPlayer[0].cam.eye.y - bossA6->obj.pos.y; 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; sp104 = 100.0f;
} }
@ -823,7 +823,7 @@ void Area6_80187944(Boss* bossA6) {
Audio_KillSfxBySource(bossA6->sfxSource); Audio_KillSfxBySource(bossA6->sfxSource);
AUDIO_PLAY_SFX(0x19004051, bossA6->sfxSource, 4); AUDIO_PLAY_SFX(0x19004051, bossA6->sfxSource, 4);
bossA6->timer_050 = 20; 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_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->fwork[A6_FWK_7] = bossA6->obj.pos.y = gPlayer[0].cam.eye.y;
bossA6->state = 2; 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)) { 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->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_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->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) || 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_U_TURN))) {
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE;
gPlayer[0].unk_1D0 = 0; gPlayer[0].csState = 0;
} }
if (bossA6->timer_052 < 50) { if (bossA6->timer_052 < 50) {
D_ctx_801779A8[0] = 50.0f; D_ctx_801779A8[0] = 50.0f;
@ -2115,7 +2115,7 @@ void Area6_8018D5C8(void) {
gActors[i].unk_0B6 = 1; gActors[i].unk_0B6 = 1;
gActors[i].state = 90; gActors[i].state = 90;
gActors[i].fwork[0] = 0.0f; 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); Object_SetInfo(&gActors[i].info, gActors[i].obj.id);
AUDIO_PLAY_SFX(0x11030010, gActors[i].sfxSource, 0); AUDIO_PLAY_SFX(0x11030010, gActors[i].sfxSource, 0);
} }
@ -2128,7 +2128,7 @@ void Area6_8018D694(Actor* actor, s32 arg1) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_ACTIVE; 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.x = sp2C[arg1].x + 100.0f;
actor->obj.pos.y = sp2C[arg1].y + 350.0f; actor->obj.pos.y = sp2C[arg1].y + 350.0f;
actor->obj.pos.z = sp2C[arg1].z + 1000.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_Initialize(actor);
actor->obj.status = OBJ_ACTIVE; 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.x = sp2C[arg1].x + player->pos.x;
actor->obj.pos.y = sp2C[arg1].y + player->pos.y; actor->obj.pos.y = sp2C[arg1].y + player->pos.y;
actor->obj.pos.z = sp2C[arg1].z + player->pos.z; actor->obj.pos.z = sp2C[arg1].z + player->pos.z;
@ -2282,10 +2282,10 @@ void Area6_LevelStart(Player* player) {
f32 temp3; // 50 f32 temp3; // 50
f32 temp4; // 4C f32 temp4; // 4C
switch (player->unk_1D0) { switch (player->csState) {
case 0: case 0:
gCsFrameCount = 0; gCsFrameCount = 0;
player->unk_1D0 = 1; player->csState = 1;
Rand_SetSeed(1, 29000, 9876); Rand_SetSeed(1, 29000, 9876);
Area6_8018D694(&gActors[1], 0); Area6_8018D694(&gActors[1], 0);
Area6_8018D694(&gActors[2], 1); Area6_8018D694(&gActors[2], 1);
@ -2378,8 +2378,8 @@ void Area6_LevelStart(Player* player) {
player->pos.z = 0.0f; player->pos.z = 0.0f;
player->pos.y = 350.0f; player->pos.y = 350.0f;
player->baseSpeed = gArwingSpeed; player->baseSpeed = gArwingSpeed;
player->unk_1D0 = 0; player->csState = 0;
player->timer_1F8 = 0; player->csTimer = 0;
AUDIO_PLAY_BGM(SEQ_ID_AREA_6 | SEQ_FLAG); AUDIO_PLAY_BGM(SEQ_ID_AREA_6 | SEQ_FLAG);
player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->state_1C8 = PLAYERSTATE_1C8_ACTIVE;
@ -2448,8 +2448,8 @@ void Area6_LevelStart(Player* player) {
Play_ClearObjectData(); Play_ClearObjectData();
break; break;
} }
Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114 + 180.0f) * M_DTOR, MTXF_NEW); Matrix_RotateY(gCalcMatrix, (player->rot.y + player->yRot_114 + 180.0f) * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); Matrix_RotateX(gCalcMatrix, -(player->rot.x * M_DTOR), MTXF_APPLY);
if (player->state_1C8 != PLAYERSTATE_1C8_ACTIVE) { if (player->state_1C8 != PLAYERSTATE_1C8_ACTIVE) {
sp74.x = 0.0f; sp74.x = 0.0f;
sp74.y = 0.0f; sp74.y = 0.0f;
@ -2461,9 +2461,9 @@ void Area6_LevelStart(Player* player) {
player->pos.x += player->vel.x; player->pos.x += player->vel.x;
player->pos.y += player->vel.y; player->pos.y += player->vel.y;
player->pos.z += player->vel.z; 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.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.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); 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) { void Area6_8018EA88(Actor* actor) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_ACTIVE; 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.x = 0.0f;
actor->obj.pos.y = 0.0f; actor->obj.pos.y = 0.0f;
actor->obj.pos.z = gBosses[0].obj.pos.z + 500.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_Initialize(actor);
actor->obj.status = OBJ_INIT; 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.x = player->pos.x;
actor->obj.pos.y = player->pos.y + 600.0f; actor->obj.pos.y = player->pos.y + 600.0f;
actor->obj.pos.z = player->pos.z + 2800.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) { if (gTeamShields[arg1 + 1] > 0) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_ACTIVE; 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.x = sp2C[arg1].x + player->pos.x;
actor->obj.pos.y = sp2C[arg1].y + player->pos.y; actor->obj.pos.y = sp2C[arg1].y + player->pos.y;
actor->obj.pos.z = sp2C[arg1].z + player->pos.z; actor->obj.pos.z = sp2C[arg1].z + player->pos.z;
@ -2548,10 +2548,10 @@ void Area6_LevelComplete(Player* player) {
Actor* actor4 = &gActors[4]; Actor* actor4 = &gActors[4];
s32 pad; s32 pad;
switch (player->unk_1D0) { switch (player->csState) {
case 0: case 0:
gCsFrameCount = 0; gCsFrameCount = 0;
player->unk_1D0 = 1; player->csState = 1;
player->wings.modelId = 1; player->wings.modelId = 1;
player->unk_194 = 5.0f; player->unk_194 = 5.0f;
player->unk_190 = 2.0f; player->unk_190 = 2.0f;
@ -2560,10 +2560,10 @@ void Area6_LevelComplete(Player* player) {
D_ctx_80177A48[3] = 0.0f; D_ctx_80177A48[3] = 0.0f;
/* fallthrough */ /* fallthrough */
case 1: case 1:
Math_SmoothStepToAngle(&player->unk_130, 0.0f, 0.05f, 1.2f, 0.0001f); Math_SmoothStepToAngle(&player->zRotBarrelRoll, 0.0f, 0.05f, 1.2f, 0.0001f);
Math_SmoothStepToAngle(&player->unk_12C, 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_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) { if (gCsFrameCount < 60) {
spf90.x = -100.0f; spf90.x = -100.0f;
spf90.y = -100.0f; spf90.y = -100.0f;
@ -2577,9 +2577,9 @@ void Area6_LevelComplete(Player* player) {
if (sp88 > 180.0f) { if (sp88 > 180.0f) {
sp88 = 0.0f; sp88 = 0.0f;
} }
sp84 = Math_SmoothStepToAngle(&player->unk_0E8, sp8C, 0.5f, 2.0f, 0.0001f) * 30.0f; sp84 = Math_SmoothStepToAngle(&player->rot.y, sp8C, 0.5f, 2.0f, 0.0001f) * 30.0f;
Math_SmoothStepToAngle(&player->unk_0E4, sp88, 0.1f, 5.0f, 0.0001f); Math_SmoothStepToAngle(&player->rot.x, sp88, 0.1f, 5.0f, 0.0001f);
Math_SmoothStepToAngle(&player->unk_0EC, sp84, 0.1f, 5.0f, 0.0001f); Math_SmoothStepToAngle(&player->rot.z, sp84, 0.1f, 5.0f, 0.0001f);
} }
if (gCsFrameCount == 60) { if (gCsFrameCount == 60) {
player->unk_234 = 0; 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(&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(&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.x = gCsCamEyeX;
player->cam.eye.y = gCsCamEyeY; player->cam.eye.y = gCsCamEyeY;
player->cam.eye.z = gCsCamEyeZ; player->cam.eye.z = gCsCamEyeZ;
gCsCamAtX = gBosses[0].obj.pos.x; gCsCamAtX = gBosses[0].obj.pos.x;
gCsCamAtY = gBosses[0].obj.pos.y; 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; D_ctx_80177A48[0] = 0.04f;
if (gCsFrameCount == 140) { if (gCsFrameCount == 140) {
Area6_8018EA88(actor4); Area6_8018EA88(actor4);
@ -2604,7 +2604,7 @@ void Area6_LevelComplete(Player* player) {
} }
if (gCsFrameCount >= 200) { if (gCsFrameCount >= 200) {
if (gFillScreenAlpha == 255) { if (gFillScreenAlpha == 255) {
player->unk_1D0 = 2; player->csState = 2;
Play_ClearObjectData(); Play_ClearObjectData();
} else { } else {
gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255;
@ -2653,10 +2653,11 @@ void Area6_LevelComplete(Player* player) {
player->pos.x = 0.0f; player->pos.x = 0.0f;
player->pos.y = 200.0f; player->pos.y = 200.0f;
player->pos.z = 1000.0f; player->pos.z = 1000.0f;
player->unk_08C = player->unk_0EC = player->unk_0E8 = player->unk_0E4 = player->baseSpeed = player->camDist = player->rot.z = player->rot.y = player->rot.x = player->baseSpeed =
player->boostSpeed = player->camRoll = player->unk_12C = player->unk_130 = player->unk_4D8 = 0.0f; 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[1], 0);
Area6_8018EC38(&gActors[2], 1); Area6_8018EC38(&gActors[2], 1);
Area6_8018EC38(&gActors[3], 2); Area6_8018EC38(&gActors[3], 2);
@ -2666,13 +2667,13 @@ void Area6_LevelComplete(Player* player) {
D_ctx_80177A48[9] = 50.0f; D_ctx_80177A48[9] = 50.0f;
player->cam.at.x = gCsCamAtX = player->pos.x; player->cam.at.x = gCsCamAtX = player->pos.x;
player->cam.at.y = gCsCamAtY = 0.0f; 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) { if (gFillScreenAlpha != 0) {
gFillScreenAlphaTarget = 0; gFillScreenAlphaTarget = 0;
gFillScreenAlphaStep = 4; gFillScreenAlphaStep = 4;
} else { } else {
player->unk_1D0 = 3; player->csState = 3;
} }
case 3: case 3:
Math_SmoothStepToF(&player->pos.y, 0.0f, 0.01f, 10.0f, 0.001f); 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; gCsCamAtX = player->pos.x;
gCsCamAtY = 0.0f; 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; D_ctx_80177A48[0] = 0.008f;
} else { } else {
Math_SmoothStepToAngle(&D_ctx_80177A48[4], 0.0f, 0.1f, 10.0f, 0.001f); 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; gCsCamAtX += 2.0f;
player->cam.at.x = gCsCamAtX = player->pos.x; player->cam.at.x = gCsCamAtX = player->pos.x;
player->cam.at.y = gCsCamAtY = 0.0f; 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.x = 0.0f;
sp78.y = 0.0f; sp78.y = 0.0f;
sp78.z = D_ctx_80177A48[5]; 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_RotateY(gCalcMatrix, -(D_ctx_80177A48[4] * M_DTOR), MTXF_APPLY);
Matrix_MultVec3f(gCalcMatrix, &sp78, &sp6C); Matrix_MultVec3f(gCalcMatrix, &sp78, &sp6C);
player->cam.eye.x = gCsCamEyeX = sp6C.x; player->cam.eye.x = gCsCamEyeX = sp6C.x;
@ -2796,8 +2797,8 @@ void Area6_LevelComplete(Player* player) {
if (gCsFrameCount >= 1076) { if (gCsFrameCount >= 1076) {
Math_SmoothStepToF(&player->baseSpeed, 50.0f, 0.1f, 1000.0f, 0.001f); 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_RotateY(gCalcMatrix, (player->rot.y + player->yRot_114 + 180.0f) * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); Matrix_RotateX(gCalcMatrix, -(player->rot.x * M_DTOR), MTXF_APPLY);
sp78.x = 0.0f; sp78.x = 0.0f;
sp78.y = 0.0f; sp78.y = 0.0f;
sp78.z = player->baseSpeed; sp78.z = player->baseSpeed;
@ -2808,8 +2809,8 @@ void Area6_LevelComplete(Player* player) {
player->pos.x += player->vel.x; player->pos.x += player->vel.x;
player->pos.y += player->vel.y; player->pos.y += player->vel.y;
player->pos.z += player->vel.z; 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.0001f); 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.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); Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0.0001f);

File diff suppressed because it is too large Load Diff

View File

@ -240,10 +240,10 @@ void Solar_8019EA7C(Actor* actor) {
s32 sp30; s32 sp30;
if (actor->state == 0) { if (actor->state == 0) {
actor->vel.z = 20.0f - D_ctx_80177D08; actor->vel.z = 20.0f - gPathVelZ;
actor->fwork[0] = 12.0f; actor->fwork[0] = 12.0f;
} else { } else {
actor->vel.z = actor->fwork[1] - D_ctx_80177D08; actor->vel.z = actor->fwork[1] - gPathVelZ;
if (actor->state == 2) { if (actor->state == 2) {
Math_SmoothStepToF(&actor->obj.pos.x, gPlayer[0].pos.x, 1.0f, 100.0f, 10.0f); Math_SmoothStepToF(&actor->obj.pos.x, gPlayer[0].pos.x, 1.0f, 100.0f, 10.0f);
} else { } else {
@ -293,7 +293,7 @@ void Solar_8019EA7C(Actor* actor) {
D_ctx_801782EC[sp30 - 12] = actor->fwork[0] * 0.1f; D_ctx_801782EC[sp30 - 12] = actor->fwork[0] * 0.1f;
} }
} }
switch (actor->unk_0D0) { switch (actor->dmgType) {
case 3: case 3:
Solar_801A8DB8(&actor->obj.pos, 0x11002052, actor->vel.z); Solar_801A8DB8(&actor->obj.pos, 0x11002052, actor->vel.z);
/* fallthrough */ /* 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, 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); 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); 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); Object_Kill(&actor->obj, actor->sfxSource);
if (actor->obj.id == OBJ_ACTOR_277) { if (actor->obj.id == OBJ_ACTOR_277) {
@ -938,7 +938,7 @@ void Solar_801A0FD4(Actor* actor, s32 index) {
if (gTeamShields[3 - index] > 0) { if (gTeamShields[3 - index] > 0) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_ACTIVE; 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.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.y = D_i3_801BF95C[index].y + gPlayer[0].pos.y;
actor->obj.pos.z = D_i3_801BF95C[index].z + gPlayer[0].pos.z; 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) { if (D_ctx_80177A10[1] != 0) {
D_ctx_80177A10[1]--; D_ctx_80177A10[1]--;
} }
switch (player->unk_1D0) { switch (player->csState) {
case 0: case 0:
gCsFrameCount = 0; gCsFrameCount = 0;
Rand_SetSeed(1, 29100, 9786); Rand_SetSeed(1, 29100, 9786);
player->unk_1D0 = 1; player->csState = 1;
player->cam.eye.x = -2000.0f; player->cam.eye.x = -2000.0f;
gCsCamEyeX = -2800.0f; gCsCamEyeX = -2800.0f;
player->cam.eye.y = gCsCamEyeY = 120.0f; player->cam.eye.y = gCsCamEyeY = 120.0f;
@ -991,7 +991,7 @@ void Solar_LevelStart(Player* player) {
AUDIO_PLAY_SFX(0x3140807E, player->sfxSource, 0); AUDIO_PLAY_SFX(0x3140807E, player->sfxSource, 0);
break; break;
case 1: case 1:
D_ctx_80177CE8 += 30.0f; gPathTexScroll += 30.0f;
if (gCsFrameCount == 140) { if (gCsFrameCount == 140) {
Solar_801A0DF8(-400.0f, -2000.0f, 45.0f, 3, 1.0f); Solar_801A0DF8(-400.0f, -2000.0f, 45.0f, 3, 1.0f);
} }
@ -1019,7 +1019,7 @@ void Solar_LevelStart(Player* player) {
} }
if (((gGameFrameCount % 8) == 0)) { if (((gGameFrameCount % 8) == 0)) {
Solar_8019E8B8(RAND_FLOAT_CENTERED(6000.0f), RAND_FLOAT_CENTERED(5.0f) - 90.0f, 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) { if (gCsFrameCount == 380) {
for (i = 0; i < 100; i++) { 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); Solar_801A0DF8(400.0f, -2800.0f, 340.0f, 1, 1.0f);
} }
if (gCsFrameCount == 410) { if (gCsFrameCount == 410) {
player->unk_1D0++; player->csState++;
player->cam.eye.x = 200.0f; player->cam.eye.x = 200.0f;
gCsCamEyeX = 800.0f; gCsCamEyeX = 800.0f;
player->cam.eye.y = 140.0f; player->cam.eye.y = 140.0f;
@ -1056,7 +1056,7 @@ void Solar_LevelStart(Player* player) {
} }
break; break;
case 2: case 2:
D_ctx_80177CE8 += 60.0f; gPathTexScroll += 60.0f;
gFillScreenAlphaTarget = 0; gFillScreenAlphaTarget = 0;
gFillScreenAlphaStep = 8; gFillScreenAlphaStep = 8;
Math_SmoothStepToF(D_ctx_80177A48, 0.02f, 1.0f, 0.0000003f, 0.0f); 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); Solar_801A0DF8(30.0f, -1500.0f, 160.0f, 3, 2.0f);
} }
if (player->cam.eye.z <= -2465.0f) { if (player->cam.eye.z <= -2465.0f) {
player->unk_1D0++; player->csState++;
gCsCamEyeY = player->pos.y + 180.0f; gCsCamEyeY = player->pos.y + 180.0f;
gCsCamAtX = 0.0f; gCsCamAtX = 0.0f;
gCsCamEyeX = 0.0f; gCsCamEyeX = 0.0f;
@ -1077,10 +1077,10 @@ void Solar_LevelStart(Player* player) {
} }
break; break;
case 3: case 3:
D_ctx_80177CE8 += 60.0f; gPathTexScroll += 60.0f;
if (((gGameFrameCount % 4) == 0)) { if (((gGameFrameCount % 4) == 0)) {
Solar_8019E8B8(RAND_FLOAT_CENTERED(6000.0f), -400.0f - ((player->cam.eye.y - 1380.0f) * 0.3f), 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) { if (gCsFrameCount == 615) {
func_play_800A6028(player->sfxSource, 0x09000002); func_play_800A6028(player->sfxSource, 0x09000002);
@ -1088,23 +1088,23 @@ void Solar_LevelStart(Player* player) {
gActors[0].state = 3; gActors[0].state = 3;
gActors[1].state = 2; gActors[1].state = 2;
gActors[2].state = 1; gActors[2].state = 1;
player->timer_1F8 = 3; player->csTimer = 3;
player->unk_190 = 5.0f; player->unk_190 = 5.0f;
player->unk_1D0++; player->csState++;
player->unk_194 = 5.0f; player->unk_194 = 5.0f;
} }
break; break;
case 4: case 4:
gCsCamEyeX = player->pos.x; gCsCamEyeX = player->pos.x;
gCsCamEyeY = player->pos.y; gCsCamEyeY = player->pos.y;
gCsCamEyeZ = player->unk_138 + 1000.0f; gCsCamEyeZ = player->trueZpos + 1000.0f;
gCsCamAtX = player->pos.x; gCsCamAtX = player->pos.x;
gCsCamAtY = player->pos.y; gCsCamAtY = player->pos.y;
gCsCamAtZ = player->unk_138 + 1100.0f; gCsCamAtZ = player->trueZpos + 1100.0f;
D_ctx_80177A48[0] = 0.03f; D_ctx_80177A48[0] = 0.03f;
D_ctx_801779A8[gMainController] = 60.0f; D_ctx_801779A8[gMainController] = 60.0f;
player->unk_190 = 2.0f; player->unk_190 = 2.0f;
if (player->timer_1F8 == 0) { if (player->csTimer == 0) {
gFillScreenAlphaTarget = 255; gFillScreenAlphaTarget = 255;
gFillScreenAlphaStep = 24; gFillScreenAlphaStep = 24;
gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255;
@ -1116,7 +1116,7 @@ void Solar_LevelStart(Player* player) {
Play_ClearObjectData(); Play_ClearObjectData();
gLevelStartStatusScreenTimer = 50; gLevelStartStatusScreenTimer = 50;
player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->state_1C8 = PLAYERSTATE_1C8_ACTIVE;
player->unk_1D0 = 0; player->csState = 0;
player->pos.y = 350.0f; player->pos.y = 350.0f;
player->cam.eye.x = player->pos.x; 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.x = player->pos.x;
player->cam.at.y = 20.0f + player->pos.y * player->unk_148; 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; D_ctx_80177950 = 1.0f;
Audio_SetHeatAlarmParams(255, 3); Audio_SetHeatAlarmParams(255, 3);
AUDIO_PLAY_SFX(0x4100C023, gDefaultSfxSource, 4); AUDIO_PLAY_SFX(0x4100C023, gDefaultSfxSource, 4);
gLoadLevelObjects = 1; gLoadLevelObjects = 1;
gFillScreenAlphaTarget = 0; gFillScreenAlphaTarget = 0;
player->timer_1F8 = 15; player->csTimer = 15;
gPlayer[0].shields = 255; gPlayer[0].shields = 255;
} }
break; break;
case 10: case 10:
D_ctx_80177CE8 += 60.0f; gPathTexScroll += 60.0f;
break; break;
} }
Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 20000.0f, 0); 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.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.y, gCsCamAtY, D_ctx_80177A48[0], 20000.0f, 0);
Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, 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_RotateY(gCalcMatrix, (player->rot.y + 180.0f) * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); Matrix_RotateX(gCalcMatrix, -(player->rot.x * M_DTOR), MTXF_APPLY);
sp50.x = 0.f; sp50.x = 0.f;
sp50.y = 0.0f; sp50.y = 0.0f;
sp50.z = player->baseSpeed; sp50.z = player->baseSpeed;
@ -1158,7 +1158,7 @@ void Solar_LevelStart(Player* player) {
player->pos.x += player->vel.x; player->pos.x += player->vel.x;
player->pos.y += player->vel.y; player->pos.y += player->vel.y;
player->pos.z += player->vel.z; 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, 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); Math_SmoothStepToF(&D_ctx_801779A8[gMainController], 120.0f, 1.0f, 3.5f, 0.0f);
} }
if (gBossFrameCount == 60) { if (gBossFrameCount == 60) {
gActors[10].unk_0D0 = 3; gActors[10].dmgType = 3;
AUDIO_PLAY_SFX(0x19036053, bossSO->sfxSource, 4); AUDIO_PLAY_SFX(0x19036053, bossSO->sfxSource, 4);
} }
if (bossSO->timer_050 == 100) { if (bossSO->timer_050 == 100) {
@ -1493,7 +1493,7 @@ void Solar_801A2C98(Boss* bossSO) {
} }
} }
if (bossSO->unk_04C == 20) { if (bossSO->unk_04C == 20) {
gActors[10].unk_0D0 = 3; gActors[10].dmgType = 3;
AUDIO_PLAY_SFX(0x19036054, bossSO->sfxSource, 4); AUDIO_PLAY_SFX(0x19036054, bossSO->sfxSource, 4);
} }
if (bossSO->unk_04C == 0) { if (bossSO->unk_04C == 0) {
@ -1501,7 +1501,7 @@ void Solar_801A2C98(Boss* bossSO) {
bossSO->swork[SO_SWK_11] = 100; bossSO->swork[SO_SWK_11] = 100;
bossSO->obj.pos.y = -500.0f; bossSO->obj.pos.y = -500.0f;
bossSO->fwork[SO_FWK_3] = 4800.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; bossSO->obj.rot.y = -bossSO->obj.rot.y;
} }
} else { } else {
@ -1527,7 +1527,7 @@ void Solar_801A2C98(Boss* bossSO) {
Solar_801A3468(bossSO); Solar_801A3468(bossSO);
} }
if (bossSO->swork[SO_SWK_11] == 50) { if (bossSO->swork[SO_SWK_11] == 50) {
gActors[9].unk_0D0 = 3; gActors[9].dmgType = 3;
AUDIO_PLAY_SFX(0x19036053, bossSO->sfxSource, 4); 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); Solar_801A0CEC(&gActors[10], bossSO->obj.pos.x, bossSO->obj.pos.z + 2000.0f, 10.0f, 1);
} }
if (bossSO->unk_04C == 40) { if (bossSO->unk_04C == 40) {
gActors[10].unk_0D0 = 3; gActors[10].dmgType = 3;
AUDIO_PLAY_SFX(0x19036054, bossSO->sfxSource, 4); AUDIO_PLAY_SFX(0x19036054, bossSO->sfxSource, 4);
} }
if (bossSO->unk_04C == 0) { if (bossSO->unk_04C == 0) {
@ -1562,7 +1562,7 @@ void Solar_801A3128(Boss* bossSO) {
bossSO->swork[SO_SWK_11] = 100; bossSO->swork[SO_SWK_11] = 100;
bossSO->obj.pos.y = -500.0f; bossSO->obj.pos.y = -500.0f;
bossSO->fwork[SO_FWK_3] = 2400.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 { } else {
bossSO->unk_04C = Animation_GetFrameCount(&D_SO_601388C) - 2; 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) { if (bossSO->swork[SO_SWK_11] == 50) {
gActors[9].unk_0D0 = 3; gActors[9].dmgType = 3;
AUDIO_PLAY_SFX(0x19036053, bossSO->sfxSource, 4); AUDIO_PLAY_SFX(0x19036053, bossSO->sfxSource, 4);
} }
} }
@ -1817,16 +1817,16 @@ void Solar_801A3C4C(Boss* bossSO) {
AUDIO_PLAY_SFX(0x2940D09A, bossSO->sfxSource, 4); AUDIO_PLAY_SFX(0x2940D09A, bossSO->sfxSource, 4);
if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) { if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) {
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE;
gPlayer[0].timer_1F8 = 0; gPlayer[0].csTimer = 0;
gPlayer[0].unk_1D0 = gPlayer[0].timer_1F8; gPlayer[0].csState = gPlayer[0].csTimer;
gPlayer[0].unk_0E8 += gPlayer[0].unk_114; gPlayer[0].rot.y += gPlayer[0].yRot_114;
if (gPlayer[0].unk_0E8 > 360.0f) { if (gPlayer[0].rot.y > 360.0f) {
gPlayer[0].unk_0E8 -= 360.0f; gPlayer[0].rot.y -= 360.0f;
} }
if (gPlayer[0].unk_0E8 < 0.0f) { if (gPlayer[0].rot.y < 0.0f) {
gPlayer[0].unk_0E8 += 360.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_31] = 0.0f;
bossSO->fwork[SO_FWK_3] = 2400.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)) { if ((bossSO->swork[SO_SWK_0] == 4) && (bossSO->unk_04C >= 60) && (bossSO->unk_04C < 67)) {
for (i = 4; i < 60; i++) { for (i = 4; i < 60; i++) {
if (gActors[i].obj.id == OBJ_ACTOR_278) { if (gActors[i].obj.id == OBJ_ACTOR_278) {
gActors[i].unk_0D0 = 2; gActors[i].dmgType = 2;
break; break;
} }
} }
@ -2098,14 +2098,14 @@ void Solar_801A4EF8(Boss* bossSO) {
} }
} }
if (bossSO->swork[SO_SWK_11] == 16) { if (bossSO->swork[SO_SWK_11] == 16) {
gActors[10].unk_0D0 = 2; gActors[10].dmgType = 2;
} }
if (bossSO->obj.pos.y <= -900.0f) { if (bossSO->obj.pos.y <= -900.0f) {
bossSO->state++; bossSO->state++;
bossSO->swork[SO_SWK_11] = 500; bossSO->swork[SO_SWK_11] = 500;
bossSO->obj.pos.y = -1500.0f; bossSO->obj.pos.y = -1500.0f;
bossSO->fwork[SO_FWK_3] = 4800.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->swork[SO_SWK_1] = 0;
bossSO->unk_078.y = bossSO->obj.rot.y = 0.0f; bossSO->unk_078.y = bossSO->obj.rot.y = 0.0f;
bossSO->vel.y = 0.0f; bossSO->vel.y = 0.0f;
@ -2129,7 +2129,7 @@ void Solar_801A4EF8(Boss* bossSO) {
if (bossSO->swork[SO_SWK_11] == 170) { if (bossSO->swork[SO_SWK_11] == 170) {
AUDIO_PLAY_SFX(0x29432073, bossSO->sfxSource, 4); AUDIO_PLAY_SFX(0x29432073, bossSO->sfxSource, 4);
bossSO->obj.pos.y = -500.0f; bossSO->obj.pos.y = -500.0f;
gActors[9].unk_0D0 = 2; gActors[9].dmgType = 2;
} }
if (bossSO->swork[SO_SWK_11] <= 170) { if (bossSO->swork[SO_SWK_11] <= 170) {
bossSO->vel.y = COS_DEG(bossSO->obj.rot.x) * 80.0f; 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->swork[SO_SWK_11] = 100;
bossSO->obj.pos.y = -500.0f; bossSO->obj.pos.y = -500.0f;
bossSO->fwork[SO_FWK_3] = 4800.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->unk_04C = 0;
bossSO->obj.rot.x = 0.0f; bossSO->obj.rot.x = 0.0f;
bossSO->fwork[SO_FWK_31] = bossSO->vel.y = bossSO->vel.z = 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; bossSO->fwork[SO_FWK_0] = 0.01f;
} }
if (bossSO->swork[SO_SWK_11] == 50) { if (bossSO->swork[SO_SWK_11] == 50) {
gActors[9].unk_0D0 = 2; gActors[9].dmgType = 2;
} }
break; break;
} }
@ -2307,9 +2307,9 @@ void Solar_801A5B3C(Boss* bossSO) {
Radio_PlayMessage(gMsg_ID_10320, RCID_PEPPY); Radio_PlayMessage(gMsg_ID_10320, RCID_PEPPY);
} }
if (bossSO->health != 0) { 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 { } 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) { if (bossSO->swork[SO_SWK_2] != 0) {
bossSO->info.hitbox[7] = bossSO->fwork[SO_FWK_12] - bossSO->obj.pos.z; 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); gDPSetEnvColor(gMasterDisp++, 255, 192, 0, 255);
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
Matrix_Push(&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); MTXF_APPLY);
Matrix_Scale(gGfxMatrix, D_i3_801C2768[3], D_i3_801C2768[2], 1.0f, MTXF_APPLY); Matrix_Scale(gGfxMatrix, D_i3_801C2768[3], D_i3_801C2768[2], 1.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp); Matrix_SetGfxMtx(&gMasterDisp);
@ -2723,7 +2723,7 @@ void Solar_801A71B8(Boss* bossSO) {
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, bossSO->obj.pos.x + spE8[i].x, bossSO->obj.pos.y + spE8[i].y, 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_RotateY(gGfxMatrix, spC4[i] * M_DTOR, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, spA0[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); 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_Pop(&gGfxMatrix);
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, bossSO->obj.pos.x, bossSO->obj.pos.y + 230.0f, 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_RotateX(gGfxMatrix, M_DTOR * 5.0f, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, D_i3_801C2768[13], 1.0f, D_i3_801C2768[13], MTXF_APPLY); Matrix_Scale(gGfxMatrix, D_i3_801C2768[13], 1.0f, D_i3_801C2768[13], MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp); Matrix_SetGfxMtx(&gMasterDisp);
@ -2746,7 +2746,7 @@ void Solar_801A71B8(Boss* bossSO) {
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, bossSO->obj.pos.x, bossSO->obj.pos.y + 270.0f, 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_RotateX(gGfxMatrix, -3.0f * M_DTOR, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, D_i3_801C2768[13], 1.0f, D_i3_801C2768[13], MTXF_APPLY); Matrix_Scale(gGfxMatrix, D_i3_801C2768[13], 1.0f, D_i3_801C2768[13], MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp); Matrix_SetGfxMtx(&gMasterDisp);
@ -2788,7 +2788,7 @@ void Solar_801A7750(void) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_INIT; 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.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; actor->obj.pos.y = D_i3_801BFB30[i].y + gPlayer[0].pos.y;
@ -2810,14 +2810,14 @@ void Solar_LevelComplete(Player* player) {
Vec3f sp54; Vec3f sp54;
Boss* bossSO = &gBosses[0]; Boss* bossSO = &gBosses[0];
switch (player->unk_1D0) { switch (player->csState) {
case 0: case 0:
gCsFrameCount = 0; gCsFrameCount = 0;
player->camRoll = player->unk_4D8 = 0.0f; player->camRoll = player->aerobaticPitch = 0.0f;
player->baseSpeed = 40.0f; player->baseSpeed = 40.0f;
player->wings.unk_04 = player->wings.unk_0C = player->wings.unk_08 = player->wings.unk_10 = 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; player->unk_234 = 1;
gCsCamEyeX = player->cam.eye.x; gCsCamEyeX = player->cam.eye.x;
gCsCamEyeY = player->cam.eye.y; 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[2].obj, gActors[2].sfxSource);
Object_Kill(&gActors[3].obj, gActors[3].sfxSource); Object_Kill(&gActors[3].obj, gActors[3].sfxSource);
Object_Kill(&gActors[4].obj, gActors[4].sfxSource); Object_Kill(&gActors[4].obj, gActors[4].sfxSource);
player->unk_1D0 = 1; player->csState = 1;
D_ctx_80177A48[0] = 0.1f; D_ctx_80177A48[0] = 0.1f;
if (Rand_ZeroOne() > 0.5f) { if (Rand_ZeroOne() > 0.5f) {
D_ctx_80177A48[9] = -1.0f; D_ctx_80177A48[9] = -1.0f;
@ -2842,28 +2842,28 @@ void Solar_LevelComplete(Player* player) {
} }
break; break;
case 1: case 1:
D_ctx_80177CE8 += 30.0f; gPathTexScroll += 30.0f;
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, 200.0f, 0.05f, 10.0f, 0.0f); Math_SmoothStepToF(&player->pos.y, 200.0f, 0.05f, 10.0f, 0.0f);
dx = player->pos.x - bossSO->obj.pos.x; dx = player->pos.x - bossSO->obj.pos.x;
dz = (player->pos.z - bossSO->obj.pos.z) * 0.05f; dz = (player->pos.z - bossSO->obj.pos.z) * 0.05f;
sp78 = Math_RadToDeg(-Math_Atan2F(dx, dz)); sp78 = Math_RadToDeg(-Math_Atan2F(dx, dz));
Math_SmoothStepToF(&gCsCamEyeY, 300.0f, 1.0f, 20.0f, 0.0f); Math_SmoothStepToF(&gCsCamEyeY, 300.0f, 1.0f, 20.0f, 0.0f);
Math_SmoothStepToF(&gCsCamAtY, 290.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) { 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; gCsCamAtX = 0.0f;
gCsCamEyeX = 0.0f; gCsCamEyeX = 0.0f;
} else if (sp74 < 0.0f) { } else if (sp74 < 0.0f) {
player->unk_0EC -= 30.0f; player->rot.z -= 30.0f;
} else { } else {
player->unk_0EC += 30.0f; player->rot.z += 30.0f;
} }
if (gCsFrameCount >= 200) { if (gCsFrameCount >= 200) {
player->unk_0E4 += 1.0f; player->rot.x += 1.0f;
player->unk_0E8 += 1.0f; player->rot.y += 1.0f;
player->unk_0EC += 1.0f; player->rot.z += 1.0f;
} }
if (gCsFrameCount >= 230) { if (gCsFrameCount >= 230) {
gFillScreenAlphaTarget = 255; gFillScreenAlphaTarget = 255;
@ -2874,25 +2874,25 @@ void Solar_LevelComplete(Player* player) {
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50);
} }
if (gCsFrameCount == 400) { if (gCsFrameCount == 400) {
player->unk_1D0++; player->csState++;
Play_ClearObjectData(); Play_ClearObjectData();
Audio_StopPlayerNoise(0); Audio_StopPlayerNoise(0);
Audio_KillSfxBySource(player->sfxSource); Audio_KillSfxBySource(player->sfxSource);
gFillScreenAlpha = 250; gFillScreenAlpha = 250;
player->timer_1F8 = 20; player->csTimer = 20;
player->baseSpeed = 0.0f; player->baseSpeed = 0.0f;
player->unk_0E4 = 0.0f; player->rot.x = 0.0f;
player->unk_0E8 = 0.0f; player->rot.y = 0.0f;
player->unk_0EC = 0.0f; player->rot.z = 0.0f;
} }
break; break;
case 2: case 2:
D_ctx_80177CE8 += 60.0f; gPathTexScroll += 60.0f;
if (player->timer_1F8 == 0) { if (player->csTimer == 0) {
player->pos.x = 0.0f; player->pos.x = 0.0f;
player->pos.y = 200.0f; player->pos.y = 200.0f;
player->pos.z = -(D_ctx_80177D20 - 500.0f); player->pos.z = -(gPathProgress - 500.0f);
player->unk_1D0++; player->csState++;
player->wings.modelId = 1; player->wings.modelId = 1;
Audio_StartPlayerNoise(0); Audio_StartPlayerNoise(0);
AUDIO_PLAY_BGM(SEQ_ID_GOOD_END); AUDIO_PLAY_BGM(SEQ_ID_GOOD_END);
@ -2902,18 +2902,18 @@ void Solar_LevelComplete(Player* player) {
D_ctx_80177A48[2] = 0.0f; D_ctx_80177A48[2] = 0.0f;
player->cam.eye.x = 0.0f; player->cam.eye.x = 0.0f;
player->cam.eye.y = player->pos.y + 80.0f; player->cam.eye.y = player->pos.y + 80.0f;
player->cam.eye.z = player->pos.z + D_ctx_80177D20 - 4000.0f; player->cam.eye.z = player->pos.z + gPathProgress - 4000.0f;
gCsCamEyeZ = player->pos.z + D_ctx_80177D20 - 4900.0f; gCsCamEyeZ = player->pos.z + gPathProgress - 4900.0f;
player->cam.at.x = gCsCamAtX = 0.0f; player->cam.at.x = gCsCamAtX = 0.0f;
player->cam.at.y = gCsCamAtY = 200.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; D_ctx_80177A48[0] = 0.0f;
Object_Kill(&gActors[4].obj, gActors[4].sfxSource); Object_Kill(&gActors[4].obj, gActors[4].sfxSource);
Object_Kill(&gActors[5].obj, gActors[5].sfxSource); Object_Kill(&gActors[5].obj, gActors[5].sfxSource);
} }
break; break;
case 3: case 3:
D_ctx_80177CE8 += 60.0f; gPathTexScroll += 60.0f;
gFillScreenAlphaTarget = 0; gFillScreenAlphaTarget = 0;
gFillScreenAlphaStep = 4; gFillScreenAlphaStep = 4;
if (gMsgCharIsPrinting) { if (gMsgCharIsPrinting) {
@ -2921,10 +2921,10 @@ void Solar_LevelComplete(Player* player) {
} }
switch (gCsFrameCount) { switch (gCsFrameCount) {
case 450: 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; break;
case 545: 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; break;
case 550: case 550:
Object_Kill(&gActors[4].obj, gActors[4].sfxSource); 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); Object_Kill(&gActors[5].obj, gActors[5].sfxSource);
break; break;
case 700: case 700:
player->unk_1D0++; player->csState++;
Solar_801A7750(); Solar_801A7750();
D_i3_801C2768[3] = 1000.0f; D_i3_801C2768[3] = 1000.0f;
break; break;
@ -2942,19 +2942,19 @@ void Solar_LevelComplete(Player* player) {
Math_SmoothStepToF(&player->pos.x, 400.0f, 0.1f, 10.0f, 0.1f); Math_SmoothStepToF(&player->pos.x, 400.0f, 0.1f, 10.0f, 0.1f);
} }
if ((gCsFrameCount >= 520) && (gCsFrameCount < 570)) { 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)) { 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)) { if ((gCsFrameCount >= 605) && (gCsFrameCount < 620)) {
player->unk_0EC += 30.0f; player->rot.z += 30.0f;
} }
if ((gCsFrameCount >= 620) && (gCsFrameCount < 640)) { 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) { 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) { if (gCsFrameCount >= 585) {
Math_SmoothStepToF(&player->pos.x, 0.0f, 0.2f, 9.0f, 0); Math_SmoothStepToF(&player->pos.x, 0.0f, 0.2f, 9.0f, 0);
@ -2962,18 +2962,18 @@ void Solar_LevelComplete(Player* player) {
if (gCsFrameCount >= 600) { if (gCsFrameCount >= 600) {
Math_SmoothStepToF(&player->pos.y, 950.0f, 0.1f, 10.0f, 0.0001f); 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) { if (gCsFrameCount >= 620) {
Math_SmoothStepToF(&player->cam.eye.x, 0.0f, 1.0f, 10.0f, 0); 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.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.x = gCsCamAtX = player->pos.x;
player->cam.at.y = gCsCamAtY = player->pos.y; 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; break;
case 4: case 4:
D_ctx_80177CE8 += 60.0f; gPathTexScroll += 60.0f;
gFillScreenAlphaTarget = 0; gFillScreenAlphaTarget = 0;
gFillScreenAlphaStep = 4; gFillScreenAlphaStep = 4;
D_ctx_80177A48[1] += D_ctx_80177A48[2] * 0.8f; D_ctx_80177A48[1] += D_ctx_80177A48[2] * 0.8f;
@ -2985,11 +2985,11 @@ void Solar_LevelComplete(Player* player) {
if (gCsFrameCount < 1440) { if (gCsFrameCount < 1440) {
gCsCamEyeX = sp54.x; gCsCamEyeX = sp54.x;
gCsCamEyeY = D_i3_801C2768[3] + sp54.y; 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; gCsCamAtX = 0.0f;
gCsCamAtY = player->pos.y + 75.0f; gCsCamAtY = player->pos.y + 75.0f;
Math_SmoothStepToF(&D_i3_801C2768[3], 500.0f, 0.1f, 1.0f, 0.0001f); 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) { if (gCsFrameCount >= 1400) {
gCsCamAtZ -= (gCsFrameCount * 8) - 11200; gCsCamAtZ -= (gCsFrameCount * 8) - 11200;
} }
@ -2997,11 +2997,11 @@ void Solar_LevelComplete(Player* player) {
Math_SmoothStepToF(&gCsCamEyeX, 0.0f, 0.1f, 1.0f, 0.0001f); Math_SmoothStepToF(&gCsCamEyeX, 0.0f, 0.1f, 1.0f, 0.0001f);
gCsCamAtX = 0.0f; gCsCamAtX = 0.0f;
gCsCamAtY = player->pos.y + 75.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) { if (gCsFrameCount > 1460) {
player->baseSpeed += 2.0f; 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); Math_SmoothStepToF(&D_ctx_80177A48[2], 0.0f, 1.0f, 0.001f, 0);
player->unk_190 = 2.0f; player->unk_190 = 2.0f;
} else { } else {
@ -3019,7 +3019,7 @@ void Solar_LevelComplete(Player* player) {
Audio_StopPlayerNoise(0); Audio_StopPlayerNoise(0);
Audio_FadeOutAll(10); Audio_FadeOutAll(10);
player->state_1C8 = PLAYERSTATE_1C8_NEXT; player->state_1C8 = PLAYERSTATE_1C8_NEXT;
player->timer_1F8 = 0; player->csTimer = 0;
gFadeoutType = 4; gFadeoutType = 4;
gLeveLClearStatus[LEVEL_SOLAR] = Play_CheckMedalStatus(100) + 1; gLeveLClearStatus[LEVEL_SOLAR] = Play_CheckMedalStatus(100) + 1;
} }
@ -3102,8 +3102,8 @@ void Solar_LevelComplete(Player* player) {
} }
break; break;
} }
Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4) * M_DTOR), MTXF_APPLY); Matrix_RotateX(gCalcMatrix, -((player->xRot_120 + player->rot.x) * M_DTOR), MTXF_APPLY);
sp60.x = 0.0f; sp60.x = 0.0f;
sp60.y = 0.0f; sp60.y = 0.0f;
sp60.z = player->baseSpeed; sp60.z = player->baseSpeed;
@ -3116,18 +3116,18 @@ void Solar_LevelComplete(Player* player) {
player->pos.y += player->vel.y; player->pos.y += player->vel.y;
player->pos.z += player->vel.z; player->pos.z += player->vel.z;
player->unk_138 = player->pos.z; player->trueZpos = player->pos.z;
player->unk_0F8 = player->unk_0EC; 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.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.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.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.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.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); Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0.0f);
player->unk_088 += 10.0f; player->bobPhase += 10.0f;
player->unk_080 = -SIN_DEG(player->unk_088) * 0.3f; player->yBob = -SIN_DEG(player->bobPhase) * 0.3f;
player->unk_0F4 += 8.0f; player->rockPhase += 8.0f;
player->unk_0F0 = SIN_DEG(player->unk_0F4); player->rockAngle = SIN_DEG(player->rockPhase);
} }
void Solar_801A8BE8(Actor* actor) { void Solar_801A8BE8(Actor* actor) {

View File

@ -92,9 +92,9 @@ void Zoness_8019962C(Boss* bossZO, f32 arg1);
// /* 232 */ char padE8[8]; // /* 232 */ char padE8[8];
// /* 240 */ Vec3f unk_F0; // /* 240 */ Vec3f unk_F0;
// /* 252 */ char padFC[8]; // /* 252 */ char padFC[8];
// /* 260 */ Vec3f unk_104; // /* 260 */ Vec3f rot_104.x;
// /* 272 */ Vec3f boostSpeed; // /* 272 */ Vec3f boostSpeed;
// /* 284 */ Vec3f unk_11C; // /* 284 */ Vec3f yRotVel_11C;
// /* 296 */ char pad128[76]; // /* 296 */ char pad128[76];
// /* 372 */ Vec3f unk_174; // /* 372 */ Vec3f unk_174;
// /* 384 */ Vec3f unk_180; // /* 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? (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, 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))); gPlayer[0].cam.eye.z - (actor->obj.pos.z + gPathProgress)));
temp = sqrtf(SQ(gPlayer[0].cam.eye.z - (actor->obj.pos.z + D_ctx_80177D20)) + temp = sqrtf(SQ(gPlayer[0].cam.eye.z - (actor->obj.pos.z + gPathProgress)) +
SQ(gPlayer[0].cam.eye.x - actor->obj.pos.x)); 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)); 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) { if (Animation_GetFrameCount(&D_ZO_600E5EC) < actor->unk_0B6) {
actor->unk_0B6 = 0; actor->unk_0B6 = 0;
} }
if ((actor->unk_0D0 != 0) && (actor->health != 0)) { if ((actor->dmgType != 0) && (actor->health != 0)) {
actor->unk_0D0 = 0; actor->dmgType = 0;
if (actor->state > 0) { if (actor->state > 0) {
actor->timer_0C6 = 15; actor->timer_0C6 = 15;
actor->health -= actor->damage; actor->health -= actor->damage;
@ -757,8 +757,8 @@ void Zoness_80190A00(Actor* actor) {
actor->timer_0C0 = 30; actor->timer_0C0 = 30;
} }
Zoness_80190790(actor); Zoness_80190790(actor);
if (actor->unk_0D0 != 0) { if (actor->dmgType != 0) {
actor->unk_0D0 = 0; actor->dmgType = 0;
AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); 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) { void Zoness_80190B4C(f32 xPos, f32 yPos, f32 zPos, f32 xRot, f32 yRot, f32 zRot, u8 arg6, s32 arg7) {
Matrix_Push(&gGfxMatrix); 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_RotateY(gGfxMatrix, M_DTOR * yRot, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, M_DTOR * xRot, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, M_DTOR * xRot, MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, M_DTOR * zRot, 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); func_effect_8007A6F0(&actor->obj.pos, 0x29018036);
break; break;
} }
if ((actor->unk_0D0 != 0) && (actor->health != 0)) { if ((actor->dmgType != 0) && (actor->health != 0)) {
actor->unk_0D0 = 0; actor->dmgType = 0;
actor->timer_0C6 = 15; actor->timer_0C6 = 15;
actor->health -= actor->damage; actor->health -= actor->damage;
if (actor->health <= 0) { if (actor->health <= 0) {
@ -978,8 +978,8 @@ void Zoness_80191680(Actor* actor) {
if (actor->obj.pos.z < actor->fwork[0]) { if (actor->obj.pos.z < actor->fwork[0]) {
actor->state = 1; actor->state = 1;
} }
if ((actor->unk_0D0 != 0) && (actor->health != 0)) { if ((actor->dmgType != 0) && (actor->health != 0)) {
actor->unk_0D0 = 0; actor->dmgType = 0;
actor->timer_0C6 = 15; actor->timer_0C6 = 15;
actor->health -= actor->damage; actor->health -= actor->damage;
AUDIO_PLAY_SFX(0x29033037, actor->sfxSource, 4); AUDIO_PLAY_SFX(0x29033037, actor->sfxSource, 4);
@ -998,7 +998,7 @@ void Zoness_80191680(Actor* actor) {
actor->timer_0BC = 30; actor->timer_0BC = 30;
actor->fwork[1] = gPlayer[0].pos.x + RAND_FLOAT_CENTERED(1000.0f); 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[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; actor->fwork[3] += gPlayer[0].vel.z;
sp64 = actor->fwork[1] - actor->obj.pos.x; sp64 = actor->fwork[1] - actor->obj.pos.x;
@ -1008,7 +1008,7 @@ void Zoness_80191680(Actor* actor) {
otherActor = &gActors[actor->iwork[0]]; otherActor = &gActors[actor->iwork[0]];
if ((actor->state != 0) || (otherActor->obj.status == OBJ_FREE)) { if ((actor->state != 0) || (otherActor->obj.status == OBJ_FREE)) {
actor->lockOnTimers[TEAM_ID_FOX] = 0; actor->lockOnTimers[TEAM_ID_FOX] = 0;
actor->info.unk_1C = 0.0f; actor->info.targetOffset = 0.0f;
sp54 += 180.0f; sp54 += 180.0f;
if (sp54 > 360.0f) { if (sp54 > 360.0f) {
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; temp_fs0 = gPlayer[0].pos.x - actor->obj.pos.x;
spB0 = gPlayer[0].pos.y - actor->obj.pos.y; 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)); spA4 = Math_RadToDeg(Math_Atan2F(temp_fs0, temp_fs1));
temp_fs0_2 = sqrtf(SQ(temp_fs0) + SQ(temp_fs1)); temp_fs0_2 = sqrtf(SQ(temp_fs0) + SQ(temp_fs1));
temp_fs0_2 = Math_RadToDeg(-Math_Atan2F(spB0, temp_fs0_2)); 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); func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 10.0f);
break; break;
} }
if ((actor->unk_0D0 != 0) && (actor->state < 3)) { if ((actor->dmgType != 0) && (actor->state < 3)) {
if (actor->unk_0D0 != 1) { if (actor->dmgType != 1) {
BonusText_Display(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + 200.0f, 5); BonusText_Display(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + 200.0f, 5);
gHitCount += 6; gHitCount += 6;
D_ctx_80177850 = 15; D_ctx_80177850 = 15;
actor->state = 4; 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 += 20.0f;
actor->obj.rot.x = Math_ModF(actor->obj.rot.x, 360.0f); actor->obj.rot.x = Math_ModF(actor->obj.rot.x, 360.0f);
if ((actor->unk_0D0 != 0) && (actor->health != 0)) { if ((actor->dmgType != 0) && (actor->health != 0)) {
actor->unk_0D0 = 0; actor->dmgType = 0;
actor->health -= actor->damage; actor->health -= actor->damage;
if (actor->health <= 0) { if (actor->health <= 0) {
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); func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 10.0f);
break; break;
} }
if (actor->unk_0D0 != 0) { if (actor->dmgType != 0) {
if (actor->unk_0D0 != 1) { if (actor->dmgType != 1) {
if ((actor->state != 0) && (actor->state != 3)) { if ((actor->state != 0) && (actor->state != 3)) {
BonusText_Display(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + 200.0f, 2); BonusText_Display(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + 200.0f, 2);
gHitCount += 3; gHitCount += 3;
@ -1474,7 +1474,7 @@ void Zoness_80192E64(Actor* actor) {
} else { } else {
AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); 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)) { 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); 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) { if (sZoSwork[ZO_BSS_24] == 0) {
Math_SmoothStepToF(&sZoFwork[ZO_BSF_27], sZoFwork[ZO_BSF_26], 0.1f, 2.0f, 0.00001f); 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); sZoFwork[ZO_BSF_27], 0.00001f);
} }
if ((gGameFrameCount % 4U) == 0) { if ((gGameFrameCount % 4U) == 0) {
@ -2067,7 +2067,7 @@ void Zoness_80194A84(Boss* bossZO) {
sZoSwork[ZO_BSS_43] = 255; 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) { if (bossZO->swork[ZO_SWK_8] == 0) {
Radio_PlayMessage(gMsg_ID_6068, RCID_BOSS_ZONESS); 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->fwork[ZO_FWK_5] += 4.0f;
bossZO->vel.x = COS_DEG(bossZO->fwork[ZO_FWK_5]) * 40.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, 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); bossZO->obj.pos.z);
padF4 = Math_RadToDeg(padF4); padF4 = Math_RadToDeg(padF4);
Math_SmoothStepToAngle(&bossZO->fwork[ZO_FWK_7], padF4, 0.1f, 100.0f, 0.001f); 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; spE4.z = 20.0f;
Matrix_MultVec3fNoTranslate(gCalcMatrix, &spE4, &spCC); Matrix_MultVec3fNoTranslate(gCalcMatrix, &spE4, &spCC);
var_s0 = 0; var_s0 = 0;
bossZO->vel.z = spCC.z - D_ctx_80177D08; bossZO->vel.z = spCC.z - gPathVelZ;
if (bossZO->vel.x > 0.0f) { if (bossZO->vel.x > 0.0f) {
var_s0 = 1; var_s0 = 1;
} }
@ -2298,7 +2298,7 @@ void Zoness_80194A84(Boss* bossZO) {
Matrix_RotateY(gCalcMatrix, -bossZO->obj.rot.y * M_DTOR, MTXF_APPLY); Matrix_RotateY(gCalcMatrix, -bossZO->obj.rot.y * M_DTOR, MTXF_APPLY);
spE4.x = gPlayer[0].pos.x - sZoFwork[ZO_BSF_93_X]; spE4.x = gPlayer[0].pos.x - sZoFwork[ZO_BSF_93_X];
spE4.y = gPlayer[0].pos.y - sZoFwork[ZO_BSF_93_Y]; 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); Matrix_MultVec3f(gCalcMatrix, &spE4, &spC0);
sp10C = Math_Atan2F(spC0.x, spC0.z); sp10C = Math_Atan2F(spC0.x, spC0.z);
sp10C = Math_RadToDeg(sp10C); 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.x = gPlayer[0].pos.x - sZoFwork[ZO_BSF_96_X];
spE4.y = gPlayer[0].pos.y - sZoFwork[ZO_BSF_96_Y]; 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); Matrix_MultVec3f(gCalcMatrix, &spE4, &spB4);
sp104 = Math_Atan2F(spB4.x, spB4.z); sp104 = Math_Atan2F(spB4.x, spB4.z);
sp104 = Math_RadToDeg(sp104); sp104 = Math_RadToDeg(sp104);
@ -2496,15 +2496,15 @@ void Zoness_80194A84(Boss* bossZO) {
(gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) { (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) {
gCsFrameCount = 0; gCsFrameCount = 0;
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE;
gPlayer[0].unk_1D0 = gPlayer[0].timer_1F8 = 0; gPlayer[0].csState = gPlayer[0].csTimer = 0;
gPlayer[0].unk_0E8 += gPlayer[0].unk_114; gPlayer[0].rot.y += gPlayer[0].yRot_114;
if (gPlayer[0].unk_0E8 > 360.0f) { if (gPlayer[0].rot.y > 360.0f) {
gPlayer[0].unk_0E8 -= 360.0f; gPlayer[0].rot.y -= 360.0f;
} }
if (gPlayer[0].unk_0E8 < 0.0f) { if (gPlayer[0].rot.y < 0.0f) {
gPlayer[0].unk_0E8 += 360.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); Boss_CompleteLevel(&gPlayer[0], bossZO->obj.pos.x, 0.0f, bossZO->obj.pos.z);
} }
bossZO->timer_050 = 70; bossZO->timer_050 = 70;
@ -2596,7 +2596,7 @@ void Zoness_80194A84(Boss* bossZO) {
} }
sZoFwork[ZO_BSF_2] += 20.0f; sZoFwork[ZO_BSF_2] += 20.0f;
spE4.x = gPlayer[0].pos.x - bossZO->obj.pos.x; 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_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); 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)) && 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.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); 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)) { if ((bossZO->state >= 3) && (bossZO->state < 6)) {
Matrix_RotateY(gCalcMatrix, bossZO->obj.rot.y * M_DTOR, MTXF_NEW); 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); Matrix_RotateY(gCalcMatrix, -bossZO->obj.rot.y * M_DTOR, MTXF_APPLY);
spE4.x = gPlayer[0].pos.x - (bossZO->obj.pos.x + spD8.x); 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.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); Matrix_MultVec3f(gCalcMatrix, &spE4, &spD8);
sp11C = Math_Atan2F(spD8.x, spD8.z); sp11C = Math_Atan2F(spD8.x, spD8.z);
sp11C = Math_RadToDeg(sp11C); sp11C = Math_RadToDeg(sp11C);
@ -2633,7 +2633,7 @@ void Zoness_80194A84(Boss* bossZO) {
sp120 = Math_RadToDeg(-sp120); sp120 = Math_RadToDeg(-sp120);
spE4.x = gPlayer[0].pos.x - (bossZO->obj.pos.x + spCC.x); 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.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); Matrix_MultVec3f(gCalcMatrix, &spE4, &spCC);
sp114 = Math_Atan2F(spCC.x, spCC.z); sp114 = Math_Atan2F(spCC.x, spCC.z);
sp114 = Math_RadToDeg(sp114); sp114 = Math_RadToDeg(sp114);
@ -3184,7 +3184,7 @@ void Zoness_80198BE8(Boss* bossZO, s32 arg1) {
Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp3C, &sp30); Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp3C, &sp30);
effect->vel.x = sp30.x; effect->vel.x = sp30.x;
effect->vel.y = sp30.y; 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); Object_SetInfo(&effect->info, effect->obj.id);
break; break;
} }
@ -3336,7 +3336,7 @@ void Zoness_8019962C(Boss* bossZO, f32 arg1) {
void Zoness_8019969C(Actor* actor) { void Zoness_8019969C(Actor* actor) {
s32 i; s32 i;
if ((actor->unk_0D0 != 0) && (actor->health != 0)) { if ((actor->dmgType != 0) && (actor->health != 0)) {
actor->health -= actor->damage; actor->health -= actor->damage;
if (actor->health <= 0) { if (actor->health <= 0) {
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); func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + 200.0f, 5.0f);
actor->itemDrop = DROP_BOMB; actor->itemDrop = DROP_BOMB;
actor->unk_0D4 = 2; actor->dmgSource = 2;
actor->obj.pos.z -= 100.0f; actor->obj.pos.z -= 100.0f;
Actor_Despawn(actor); Actor_Despawn(actor);
Object_Kill(&actor->obj, actor->sfxSource); Object_Kill(&actor->obj, actor->sfxSource);
func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); func_effect_8007A6F0(&actor->obj.pos, 0x2903A008);
} }
actor->unk_0D0 = 0; actor->dmgType = 0;
} }
actor->fwork[0] += 10.0f; actor->fwork[0] += 10.0f;
Zoness_8018FF50(actor); Zoness_8018FF50(actor);
@ -3444,17 +3444,17 @@ void Zoness_80199A28(Actor* actor) {
} }
Math_SmoothStepToAngle(&actor->obj.rot.z, sp38, 0.1f, 1.0f, 0); Math_SmoothStepToAngle(&actor->obj.rot.z, sp38, 0.1f, 1.0f, 0);
} }
if ((actor->unk_0D0 != 0) && (actor->health != 0)) { if ((actor->dmgType != 0) && (actor->health != 0)) {
actor->unk_0D0 = 0; actor->dmgType = 0;
actor->itemDrop = DROP_SILVER_RING_50p; 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); 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->obj.pos.y += 200.0f;
Actor_Despawn(actor); Actor_Despawn(actor);
Object_Kill(&actor->obj, actor->sfxSource); Object_Kill(&actor->obj, actor->sfxSource);
func_effect_8007A6F0(&actor->obj.pos, 0x1903400F); func_effect_8007A6F0(&actor->obj.pos, 0x1903400F);
} else { } 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); Zoness_801999CC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z);
Object_Kill(&actor->obj, actor->sfxSource); Object_Kill(&actor->obj, actor->sfxSource);
func_effect_8007A6F0(&actor->obj.pos, 0x2903B009); 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)) { 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); 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->itemDrop = DROP_SILVER_RING_50p;
actor->unk_0D4 = 2; actor->dmgSource = 2;
actor->obj.pos.y += 200.0f; actor->obj.pos.y += 200.0f;
Actor_Despawn(actor); Actor_Despawn(actor);
Object_Kill(&actor->obj, actor->sfxSource); Object_Kill(&actor->obj, actor->sfxSource);
@ -3540,11 +3540,11 @@ void Zoness_80199F10(Actor* actor) {
} }
break; break;
} }
if (actor->unk_0D0 != 0) { if (actor->dmgType != 0) {
if (actor->unk_0D0 == 1) { if (actor->dmgType == 1) {
AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); 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; 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); 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); 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; actor->iwork[0] = 0;
if (actor->timer_0BC == 0) { if (actor->timer_0BC == 0) {
actor->vel.x = 0.0f; actor->vel.x = 0.0f;
actor->vel.z = -D_ctx_80177D08; actor->vel.z = -gPathVelZ;
actor->gravity = 5.0f; actor->gravity = 5.0f;
actor->fwork[5] = actor->vel.y * -3.0f; actor->fwork[5] = actor->vel.y * -3.0f;
if (actor->obj.pos.y < -150.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; 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], Zoness_8019A4E0(actor, sZoFwork[ZO_BSF_65_X], sZoFwork[ZO_BSF_65_Y] - var_fa0, sZoFwork[ZO_BSF_65_Z],
30.0f); 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, if (Object_CheckHitboxCollision(&actor->obj.pos, gBosses[0].info.hitbox, &gBosses[0].obj, 0.0f, 0.0f,
0.0f) != 0) { 0.0f) != 0) {
@ -3702,11 +3702,11 @@ void Zoness_8019A5D4(Actor* actor) {
break; break;
} }
Zoness_8018FF50(actor); Zoness_8018FF50(actor);
if (actor->unk_0D0 != 0) { if (actor->dmgType != 0) {
if (actor->unk_0D0 == 1) { if (actor->dmgType == 1) {
AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); 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) && 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)) { (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) { if (var_s4 < 0) {
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_RotateY(gGfxMatrix, temp_fs4, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, temp_fs0_2, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, temp_fs0_2, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 0.0f, 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_Pop(&gGfxMatrix);
Matrix_Push(&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_RotateY(gGfxMatrix, actor->obj.rot.y * M_DTOR, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, actor->obj.rot.x * 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); Matrix_Scale(gGfxMatrix, 2.6f, 2.6f, 2.6f, MTXF_APPLY);
@ -3913,7 +3913,7 @@ void Zoness_8019B548(Actor* actor) {
} }
break; 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)) { 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); 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 spA8 = { 0.0f, 0.0f, 0.0f };
Vec3f sp9C; Vec3f sp9C;
if ((actor->unk_0D0 != 0) && (actor->health != 0)) { if ((actor->dmgType != 0) && (actor->health != 0)) {
actor->unk_0D0 = 0; actor->dmgType = 0;
actor->timer_0C6 = 15; actor->timer_0C6 = 15;
actor->health -= actor->damage; actor->health -= actor->damage;
AUDIO_PLAY_SFX(0x2903300E, actor->sfxSource, 4); AUDIO_PLAY_SFX(0x2903300E, actor->sfxSource, 4);
@ -4078,8 +4078,8 @@ void Zoness_8019BE48(Actor* actor) {
actor->state++; actor->state++;
break; break;
case 1: case 1:
if ((actor->unk_0D0 != 0) && (actor->health != 0)) { if ((actor->dmgType != 0) && (actor->health != 0)) {
actor->unk_0D0 = 0; actor->dmgType = 0;
actor->timer_0C6 = 15; actor->timer_0C6 = 15;
actor->health -= actor->damage; actor->health -= actor->damage;
if (actor->health <= 0) { if (actor->health <= 0) {
@ -4179,7 +4179,7 @@ void Zoness_8019C454(Actor* actor) {
Vec3f sp34; Vec3f sp34;
Actor* otherActor; 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->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); Math_SmoothStepToAngle(&actor->obj.rot.y, actor->fwork[5], 1.0f, actor->fwork[6], 0.01f);
if (actor->fwork[5] != actor->obj.rot.y) { if (actor->fwork[5] != actor->obj.rot.y) {
@ -4206,7 +4206,7 @@ void Zoness_8019C454(Actor* actor) {
switch (actor->iwork[4]) { switch (actor->iwork[4]) {
case 1: case 1:
if ((actor->fwork[5] == actor->obj.rot.y) && 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) { if (otherActor->obj.id == OBJ_ACTOR_251) {
otherActor->gravity = 1.0f; otherActor->gravity = 1.0f;
} }
@ -4408,9 +4408,9 @@ void Zoness_8019D15C(Actor* actor) {
Actor* otherActor; Actor* otherActor;
if (actor->state == 0) { if (actor->state == 0) {
if (actor->unk_0D0 != 0) { if (actor->dmgType != 0) {
actor->unk_0D0 = 0; actor->dmgType = 0;
if (actor->unk_0D2 < 2) { if (actor->dmgPart < 2) {
AUDIO_PLAY_SFX(0x1903001E, actor->sfxSource, 4); AUDIO_PLAY_SFX(0x1903001E, actor->sfxSource, 4);
if ((actor->obj.pos.y + 268.0f) < actor->hitPos.y) { if ((actor->obj.pos.y + 268.0f) < actor->hitPos.y) {
actor->fwork[1] = 20.0f; actor->fwork[1] = 20.0f;
@ -4469,11 +4469,11 @@ void Zoness_8019D3C4(Actor* actor) {
void Zoness_LevelStart(Player* player) { void Zoness_LevelStart(Player* player) {
s32 sp2C; s32 sp2C;
player->unk_088 += 10.0f; player->bobPhase += 10.0f;
player->unk_080 = -SIN_DEG(player->unk_088) * 0.5f; player->yBob = -SIN_DEG(player->bobPhase) * 0.5f;
player->unk_0F4 += 3.0f; player->rockPhase += 3.0f;
player->unk_0F0 = SIN_DEG(player->unk_0F4) * 1.5f; player->rockAngle = SIN_DEG(player->rockPhase) * 1.5f;
switch (player->unk_1D0) { /* irregular */ switch (player->csState) {
case 0: case 0:
gCsFrameCount = 0; gCsFrameCount = 0;
player->pos.z += 10000.0f; 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.x = gCsCamAtX = player->pos.x;
player->cam.at.y = gCsCamAtY = (player->pos.y * player->unk_148) + 20.0f - 230.0f; player->cam.at.y = gCsCamAtY = (player->pos.y * player->unk_148) + 20.0f - 230.0f;
player->cam.at.z = gCsCamAtZ = 0.0f; player->cam.at.z = gCsCamAtZ = 0.0f;
player->unk_1D0 = 1; player->csState = 1;
/* fallthrough */ /* fallthrough */
case 1: case 1:
Math_SmoothStepToF(&player->pos.z, 0.0f, 0.1f, 48.0f, 0); 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); Math_SmoothStepToF(&player->cam.at.y, (player->pos.y * player->unk_148) + 20.0f, 0.1f, 1.0f, 0.0f);
if (gCsFrameCount >= 230) { 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; sp2C = gControllerHold[gMainController].button;
gControllerHold[gMainController].button = gBoostButton[gMainController]; gControllerHold[gMainController].button = gBoostButton[gMainController];
player->timer_1F8 = 60; player->csTimer = 60;
player->boostMeter = 1.0f; player->boostMeter = 1.0f;
func_play_800B2574(player); func_play_800B2574(player);
if (gCsFrameCount > 195) { if (gCsFrameCount > 195) {
@ -4506,14 +4506,14 @@ void Zoness_LevelStart(Player* player) {
AUDIO_PLAY_BGM(SEQ_ID_ZONESS | SEQ_FLAG); AUDIO_PLAY_BGM(SEQ_ID_ZONESS | SEQ_FLAG);
gLevelStartStatusScreenTimer = 80; gLevelStartStatusScreenTimer = 80;
player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->state_1C8 = PLAYERSTATE_1C8_ACTIVE;
player->unk_1D0 = 0; player->csState = 0;
player->timer_1F8 = 0; player->csTimer = 0;
player->timer_1FC = 0; player->csEventTimer = 0;
gLoadLevelObjects = 1; gLoadLevelObjects = 1;
} }
break; break;
} }
D_ctx_80177CE8 += 40.0f; gPathTexScroll += 40.0f;
} }
void Zoness_LevelComplete(Player* player) { void Zoness_LevelComplete(Player* player) {
@ -4526,16 +4526,16 @@ void Zoness_LevelComplete(Player* player) {
Vec3f sp4C; Vec3f sp4C;
Boss* boss = &gBosses[0]; Boss* boss = &gBosses[0];
switch (player->unk_1D0) { switch (player->csState) {
case 0: case 0:
case 10: case 10:
gCsFrameCount = 0; gCsFrameCount = 0;
player->unk_4D8 = 0.0f; player->aerobaticPitch = 0.0f;
player->camRoll = 0.0f; player->camRoll = 0.0f;
player->baseSpeed = 40.0f; player->baseSpeed = 40.0f;
player->unk_234 = 1; player->unk_234 = 1;
player->wings.unk_04 = player->wings.unk_0C = player->wings.unk_08 = player->wings.unk_10 = 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; gCsCamEyeX = player->cam.eye.x;
gCsCamEyeY = player->cam.eye.y; gCsCamEyeY = player->cam.eye.y;
gCsCamEyeZ = player->cam.eye.z; 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[2].obj, gActors[2].sfxSource);
Object_Kill(&gActors[3].obj, gActors[3].sfxSource); Object_Kill(&gActors[3].obj, gActors[3].sfxSource);
Object_Kill(&gActors[4].obj, gActors[4].sfxSource); Object_Kill(&gActors[4].obj, gActors[4].sfxSource);
player->unk_1D0 = 1; player->csState = 1;
D_ctx_80177A48[0] = 0.05f; D_ctx_80177A48[0] = 0.05f;
if (Rand_ZeroOne() > 0.5f) { if (Rand_ZeroOne() > 0.5f) {
D_ctx_80177A48[9] = -1.0f; D_ctx_80177A48[9] = -1.0f;
@ -4559,47 +4559,47 @@ void Zoness_LevelComplete(Player* player) {
} }
break; break;
case 1: case 1:
D_ctx_80177CE8 += 30.0f; gPathTexScroll += 30.0f;
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, 200.0f, 0.05f, 10.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(&gCsCamEyeY, 250.0f, 1.0f, 20.0f, 0.0f);
Math_SmoothStepToF(&gCsCamAtY, 240.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; dx = player->pos.x - boss->obj.pos.x;
dz = (player->pos.z - boss->obj.pos.z) * 0.05f; dz = (player->pos.z - boss->obj.pos.z) * 0.05f;
temp_ft5 = Math_RadToDeg(-Math_Atan2F(dx, dz)); 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) { 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) { } else if (temp_fa0 < 0.0f) {
player->unk_0EC -= 30.0f; player->rot.z -= 30.0f;
} else { } else {
player->unk_0EC += 30.0f; player->rot.z += 30.0f;
} }
if (gCsFrameCount >= 140) { if (gCsFrameCount >= 140) {
gFillScreenAlphaTarget = 255; gFillScreenAlphaTarget = 255;
gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255;
} }
if (gCsFrameCount == 160) { if (gCsFrameCount == 160) {
player->unk_1D0++; player->csState++;
Play_ClearObjectData(); Play_ClearObjectData();
Audio_StopPlayerNoise(0); Audio_StopPlayerNoise(0);
Audio_KillSfxBySource(player->sfxSource); Audio_KillSfxBySource(player->sfxSource);
gFillScreenAlpha = 250; gFillScreenAlpha = 250;
player->timer_1F8 = 20; player->csTimer = 20;
player->wings.modelId = 1; player->wings.modelId = 1;
player->baseSpeed = 0.0f; player->baseSpeed = 0.0f;
player->unk_0E4 = 0.0f; player->rot.x = 0.0f;
player->unk_0E8 = 0.0f; player->rot.y = 0.0f;
player->unk_0EC = 0.0f; player->rot.z = 0.0f;
} }
break; break;
case 2: case 2:
D_ctx_80177CE8 += 60.0f; gPathTexScroll += 60.0f;
if (player->timer_1F8 == 0) { if (player->csTimer == 0) {
player->pos.x = 0.0f; player->pos.x = 0.0f;
player->pos.y = 200.0f; player->pos.y = 200.0f;
player->pos.z = -(D_ctx_80177D20 + 1500.0f); player->pos.z = -(gPathProgress + 1500.0f);
player->unk_1D0++; player->csState++;
Audio_StartPlayerNoise(0); Audio_StartPlayerNoise(0);
AUDIO_PLAY_BGM(SEQ_ID_GOOD_END); AUDIO_PLAY_BGM(SEQ_ID_GOOD_END);
D_ctx_80177A98 = 1; D_ctx_80177A98 = 1;
@ -4614,23 +4614,23 @@ void Zoness_LevelComplete(Player* player) {
D_ctx_80177A48[3] = 800.0f; D_ctx_80177A48[3] = 800.0f;
D_ctx_80177A48[4] = -0.15f; D_ctx_80177A48[4] = -0.15f;
D_ctx_80177A48[5] = -250.0f; 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 { } else {
player->cam.eye.x = -1500.0f; player->cam.eye.x = -1500.0f;
player->cam.at.x = gCsCamAtX = -1500.0f; player->cam.at.x = gCsCamAtX = -1500.0f;
D_ctx_80177A48[3] = -800.0f; D_ctx_80177A48[3] = -800.0f;
D_ctx_80177A48[4] = 0.2f; D_ctx_80177A48[4] = 0.2f;
D_ctx_80177A48[5] = 250.0f; 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.eye.y = 200.0f;
player->cam.at.y = gCsCamAtY = player->pos.y; 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; D_ctx_80177A48[0] = 0.0f;
} }
break; break;
case 3: case 3:
D_ctx_80177CE8 += 60.0f; gPathTexScroll += 60.0f;
gFillScreenAlphaTarget = 0; gFillScreenAlphaTarget = 0;
gFillScreenAlphaStep = 4; gFillScreenAlphaStep = 4;
D_ctx_80177A48[1] += D_ctx_80177A48[2]; D_ctx_80177A48[1] += D_ctx_80177A48[2];
@ -4642,19 +4642,19 @@ void Zoness_LevelComplete(Player* player) {
if (gCsFrameCount < 1180) { if (gCsFrameCount < 1180) {
gCsCamEyeX = sp4C.x; gCsCamEyeX = sp4C.x;
gCsCamEyeY = 200.0f + sp4C.y; gCsCamEyeY = 200.0f + sp4C.y;
gCsCamEyeZ = player->pos.z + D_ctx_80177D20 + sp4C.z; gCsCamEyeZ = player->pos.z + gPathProgress + sp4C.z;
gCsCamAtX = 0.0f; gCsCamAtX = 0.0f;
gCsCamAtY = player->pos.y; 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); Math_SmoothStepToF(&D_ctx_80177A48[5], 250.0f, 1.0f, 1.0f, 0.0f);
} else { } else {
gCsCamAtX = 0.0f; gCsCamAtX = 0.0f;
gCsCamAtY = player->pos.y; gCsCamAtY = player->pos.y;
gCsCamAtZ = player->pos.z + D_ctx_80177D20; gCsCamAtZ = player->pos.z + gPathProgress;
} }
if (gCsFrameCount > 1180) { if (gCsFrameCount > 1180) {
player->baseSpeed += 2.0f; 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); Math_SmoothStepToF(&D_ctx_80177A48[2], 0.0f, 1.0f, 0.001f, 0);
player->unk_190 = 2.0f; player->unk_190 = 2.0f;
if (!gMissedZoSearchlight) { if (!gMissedZoSearchlight) {
@ -4675,7 +4675,7 @@ void Zoness_LevelComplete(Player* player) {
Audio_StopPlayerNoise(0); Audio_StopPlayerNoise(0);
Audio_FadeOutAll(10); Audio_FadeOutAll(10);
player->state_1C8 = PLAYERSTATE_1C8_NEXT; player->state_1C8 = PLAYERSTATE_1C8_NEXT;
player->timer_1F8 = 0; player->csTimer = 0;
gFadeoutType = 4; gFadeoutType = 4;
gLeveLClearStatus[LEVEL_ZONESS] = Play_CheckMedalStatus(250) + 1; gLeveLClearStatus[LEVEL_ZONESS] = Play_CheckMedalStatus(250) + 1;
} }
@ -4767,13 +4767,13 @@ void Zoness_LevelComplete(Player* player) {
break; break;
} }
if (gCsFrameCount >= 1180) { if (gCsFrameCount >= 1180) {
player->unk_25C += 0.02f; player->contrailScale += 0.02f;
if (player->unk_25C > 0.6f) { if (player->contrailScale > 0.6f) {
player->unk_25C = 0.6f; player->contrailScale = 0.6f;
} }
} }
Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4) * M_DTOR), MTXF_APPLY); Matrix_RotateX(gCalcMatrix, -((player->xRot_120 + player->rot.x) * M_DTOR), MTXF_APPLY);
sp58.x = 0.0f; sp58.x = 0.0f;
sp58.y = 0.0f; sp58.y = 0.0f;
sp58.z = player->baseSpeed; sp58.z = player->baseSpeed;
@ -4783,18 +4783,18 @@ void Zoness_LevelComplete(Player* player) {
player->vel.y = sp4C.y; player->vel.y = sp4C.y;
player->pos.x += player->vel.x; player->pos.x += player->vel.x;
player->pos.y += player->vel.y; player->pos.y += player->vel.y;
player->unk_138 = player->pos.z += player->vel.z; player->trueZpos = player->pos.z += player->vel.z;
player->unk_0F8 = player->unk_0EC; 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.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.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.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.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.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); Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0.0f);
player->unk_088 += 10.0f; player->bobPhase += 10.0f;
player->unk_080 = -SIN_DEG(player->unk_088) * 0.3f; player->yBob = -SIN_DEG(player->bobPhase) * 0.3f;
player->unk_0F4 += 8.0f; player->rockPhase += 8.0f;
player->unk_0F0 = SIN_DEG(player->unk_0F4); player->rockAngle = SIN_DEG(player->rockPhase);
} }
void Zoness_8019E5F0(Actor* actor) { void Zoness_8019E5F0(Actor* actor) {

View File

@ -125,70 +125,70 @@ void Bolse_8018BD60(Actor* this) {
f32 D_i4_8019EEE4[] = { -200.0f, -100.0f, -0.0f, 100.0f, 200.0f }; 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; s32 i;
Actor* actorPtr; Actor* enemy;
for (i = 10, actorPtr = &gActors[10]; i < arg1 + 10; i++, actorPtr++) { for (i = AI360_10, enemy = &gActors[AI360_10]; i < count + AI360_10; i++, enemy++) {
if (actorPtr->obj.status == OBJ_FREE) { if (enemy->obj.status == OBJ_FREE) {
Actor_Initialize(actorPtr); Actor_Initialize(enemy);
actorPtr->obj.status = OBJ_ACTIVE; enemy->obj.status = OBJ_ACTIVE;
actorPtr->obj.id = OBJ_ACTOR_ALLRANGE; enemy->obj.id = OBJ_ACTOR_ALLRANGE;
actorPtr->obj.pos.z = 0.0f; enemy->obj.pos.z = 0.0f;
if (D_i4_801A0530 > 1000) { if (D_i4_801A0530 > 1000) {
actorPtr->obj.pos.x = 10000.0f; enemy->obj.pos.x = 10000.0f;
actorPtr->obj.pos.y = 3000.0f; enemy->obj.pos.y = 3000.0f;
} else { } else {
actorPtr->obj.pos.x = D_i4_8019EEE4[actor->unk_04E]; enemy->obj.pos.x = D_i4_8019EEE4[this->unk_04E];
actorPtr->obj.pos.y = 50.0f; enemy->obj.pos.y = 50.0f;
AUDIO_PLAY_SFX(0x2903305F, actorPtr->sfxSource, 4); AUDIO_PLAY_SFX(0x2903305F, enemy->sfxSource, 4);
actorPtr->timer_0BC = 5; enemy->timer_0BC = 5;
actorPtr->timer_0C2 = 100; enemy->timer_0C2 = 100;
actorPtr->unk_0F4.x = 90.0f; enemy->unk_0F4.x = 90.0f;
} }
actorPtr->state = 1; enemy->state = 1;
actorPtr->timer_0C4 = 300; enemy->timer_0C4 = 300;
actorPtr->aiType = i; enemy->aiType = i;
actorPtr->aiIndex = -1; enemy->aiIndex = -1;
if (i < 13) { if (i < AI360_10 + 3) {
actorPtr->aiIndex = AI360_SLIPPY; enemy->aiIndex = AI360_SLIPPY;
gActors[AI360_SLIPPY].aiIndex = -1; gActors[AI360_SLIPPY].aiIndex = -1;
} }
if ((i == 17) || (i == 18)) { if ((i == AI360_10 + 7) || (i == AI360_10 + 8)) {
actorPtr->aiIndex = AI360_FOX; enemy->aiIndex = AI360_FOX;
} }
if ((i == 20) || (i == 21)) { if ((i == AI360_10 + 10) || (i == AI360_10 + 11)) {
actorPtr->aiIndex = AI360_PEPPY; enemy->aiIndex = AI360_PEPPY;
gActors[AI360_PEPPY].aiIndex = -1; gActors[AI360_PEPPY].aiIndex = -1;
} }
if (i == 22) { if (i == AI360_10 + 12) {
actorPtr->aiIndex = AI360_FALCO; enemy->aiIndex = AI360_FALCO;
gActors[AI360_FALCO].aiIndex = -1; gActors[AI360_FALCO].aiIndex = -1;
} }
if ((D_i4_801A0530 > 16000) && ((i == 23) || (i == 24))) { if ((D_i4_801A0530 > 16000) && ((i == AI360_10 + 13) || (i == AI360_10 + 14))) {
actorPtr->aiIndex = AI360_FOX; enemy->aiIndex = AI360_FOX;
} }
actorPtr->health = 24; enemy->health = 24;
actorPtr->iwork[11] = 1; enemy->iwork[11] = 1;
if (D_i4_801A0530 < 16000) { if (D_i4_801A0530 < 16000) {
actorPtr->itemDrop = DROP_SILVER_RING_50p; enemy->itemDrop = DROP_SILVER_RING_50p;
} }
Object_SetInfo(&actorPtr->info, actorPtr->obj.id); Object_SetInfo(&enemy->info, enemy->obj.id);
AUDIO_PLAY_SFX(0x3100000C, actorPtr->sfxSource, 4); AUDIO_PLAY_SFX(0x3100000C, enemy->sfxSource, 4);
actor->unk_04E++; this->unk_04E++;
if (actor->unk_04E >= 5) { if (this->unk_04E >= 5) {
actor->unk_04E = 0; this->unk_04E = 0;
} }
break; break;
} }
@ -254,7 +254,7 @@ void Bolse_UpdateEventHandler(Actor* this) {
} }
if ((D_i4_801A0530 < 9600) && (D_i4_801A0530 & 0x400)) { if ((D_i4_801A0530 < 9600) && (D_i4_801A0530 & 0x400)) {
Bolse_8018BEF8(this, 8); Bolse_SpawnEnemies(this, 8);
} }
if (gBosses[2].state == 10) { if (gBosses[2].state == 10) {
@ -263,8 +263,8 @@ void Bolse_UpdateEventHandler(Actor* this) {
if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) ||
(gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) { (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) {
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE;
gPlayer[0].timer_1F8 = 30; gPlayer[0].csTimer = 30;
gPlayer[0].unk_1D0 = 0; gPlayer[0].csState = 0;
gPlayer[0].unk_000 = 0.0f; gPlayer[0].unk_000 = 0.0f;
} }
AllRange_ClearRadio(); AllRange_ClearRadio();
@ -377,7 +377,7 @@ void Bolse_UpdateEventHandler(Actor* this) {
} }
if ((this->timer_0BC % 8) == 0) { if ((this->timer_0BC % 8) == 0) {
Bolse_8018BEF8(this, 15); Bolse_SpawnEnemies(this, 15);
} }
if (!this->timer_0BC) { if (!this->timer_0BC) {
@ -605,11 +605,11 @@ void Bolse_8018D124(Actor* actor) {
bool Bolse_8018D278(Actor* actor) { bool Bolse_8018D278(Actor* actor) {
s32 i; s32 i;
if (actor->unk_0D0 == 0) { if (actor->dmgType == 0) {
return false; return false;
} }
actor->unk_0D0 = 0; actor->dmgType = 0;
actor->obj.pos.y += 150.0f; 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); 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->info.bonus = 0;
actor->lockOnTimers[TEAM_ID_FOX] = 0; actor->lockOnTimers[TEAM_ID_FOX] = 0;
actor->info.unk_1C = 0.0f; actor->info.targetOffset = 0.0f;
return true; return true;
} }
@ -691,13 +691,13 @@ s32 Bolse_8018D4F0(Actor* actor) {
bool Bolse_8018D584(Actor* actor) { bool Bolse_8018D584(Actor* actor) {
s32 i; s32 i;
if (actor->unk_0D0 == 0) { if (actor->dmgType == 0) {
return false; return false;
} }
if ((actor->unk_0D2 < 2) && (actor->state == 0)) { if ((actor->dmgPart < 2) && (actor->state == 0)) {
actor->timer_0C6 = 20; actor->timer_0C6 = 20;
actor->unk_0D0 = 0; actor->dmgType = 0;
AUDIO_PLAY_SFX(0x29024003, actor->sfxSource, 0); AUDIO_PLAY_SFX(0x29024003, actor->sfxSource, 0);
actor->health += actor->damage; actor->health += actor->damage;
@ -745,7 +745,7 @@ void Bolse_8018D7F0(Actor* actor) {
} else { } else {
actor->lockOnTimers[TEAM_ID_FOX] = 0; actor->lockOnTimers[TEAM_ID_FOX] = 0;
actor->info.bonus = 0; actor->info.bonus = 0;
actor->info.unk_1C = 0.0f; actor->info.targetOffset = 0.0f;
} }
actor->scale = -1.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.x = gPlayer[0].pos.x - (boss->obj.pos.x + temp_fs2);
src.y = gPlayer[0].pos.y - (boss->obj.pos.y + 580.0f); 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); Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest);
if ((fabsf(dest.x) < 100.0f) && (fabsf(dest.y) < 200.0f)) { 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); Player_ApplyDamage(gPlayer, 0, 40);
if (dest.y > 0.0f) { if (dest.y > 0.0f) {
gPlayer[0].unk_0D8.y = 20.0f; gPlayer[0].knockback.y = 20.0f;
} else { } else {
gPlayer[0].unk_0D8.y = -20.0f; gPlayer[0].knockback.y = -20.0f;
} }
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
func_effect_8007C484(gPlayer[0].pos.x + RAND_FLOAT_CENTERED(30.0f), func_effect_8007C484(gPlayer[0].pos.x + RAND_FLOAT_CENTERED(30.0f),
gPlayer[0].pos.y + RAND_FLOAT(10.0f), gPlayer[0].pos.y + RAND_FLOAT(10.0f),
gPlayer[0].unk_138 + RAND_FLOAT_CENTERED(30.0f), gPlayer[0].vel.x, gPlayer[0].trueZpos + 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].vel.y + gPlayer[0].knockback.y, gPlayer[0].vel.z,
gPlayer[0].num + 11); 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), 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; 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) { void Bolse_8018EAEC(Actor* actor, s32 index) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_INIT; 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.x = D_i4_8019EFDC[index] + gPlayer[0].pos.x;
actor->obj.pos.y = D_i4_8019EFE8[index] + gPlayer[0].pos.y; actor->obj.pos.y = D_i4_8019EFE8[index] + gPlayer[0].pos.y;
actor->obj.pos.z = D_i4_8019EFF4[index] + gPlayer[0].pos.z; 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->obj.pos.z = -9000.0f;
actor->unk_0B6 = 30; actor->unk_0B6 = 30;
actor->fwork[20] = 1.0f; actor->fwork[20] = 1.0f;
actor->obj.id = OBJ_ACTOR_195; actor->obj.id = OBJ_ACTOR_CUTSCENE;
Object_SetInfo(&actor->info, actor->obj.id); Object_SetInfo(&actor->info, actor->obj.id);
actor->info.bonus = 1; actor->info.bonus = 1;
} }
@ -1079,7 +1079,7 @@ void Bolse_8018ED44(void) {
if (actor->obj.status == OBJ_FREE) { if (actor->obj.status == OBJ_FREE) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_INIT; 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.x = RAND_FLOAT_CENTERED(500.0f);
actor->obj.pos.y = gActors[50].obj.pos.y + RAND_FLOAT(100.0f); actor->obj.pos.y = gActors[50].obj.pos.y + RAND_FLOAT(100.0f);
actor->obj.pos.z = -9000.0f; actor->obj.pos.z = -9000.0f;
@ -1101,7 +1101,7 @@ void Bolse_8018EE4C(f32 x, f32 y) {
if (actor->obj.status == OBJ_FREE) { if (actor->obj.status == OBJ_FREE) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_INIT; 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.x = x;
actor->obj.pos.y = gActors[50].obj.pos.y + y; actor->obj.pos.y = gActors[50].obj.pos.y + y;
actor->obj.pos.z = -9000.0f; actor->obj.pos.z = -9000.0f;
@ -1139,7 +1139,7 @@ void Bolse_LevelStart(Player* player) {
Actor* actor; Actor* actor;
s32 pad[4]; s32 pad[4];
switch (player->unk_1D0) { switch (player->csState) {
case 0: case 0:
gLight1R = 100; gLight1R = 100;
gLight1G = 100; gLight1G = 100;
@ -1184,7 +1184,7 @@ void Bolse_LevelStart(Player* player) {
gCsCamAtY = player->pos.y; gCsCamAtY = player->pos.y;
gCsCamAtZ = player->pos.z; gCsCamAtZ = player->pos.z;
player->unk_1D0 = 1; player->csState = 1;
player->unk_204 = 1; player->unk_204 = 1;
D_ctx_80177A48[0] = 1.0f; D_ctx_80177A48[0] = 1.0f;
@ -1198,7 +1198,7 @@ void Bolse_LevelStart(Player* player) {
gCsCamAtZ = player->pos.z; gCsCamAtZ = player->pos.z;
D_ctx_80177A48[2] += 4.5f; D_ctx_80177A48[2] += 4.5f;
sp60 = SIN_DEG(D_ctx_80177A48[2]) * 10.0f; 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)) { if (((gCsFrameCount % 8) == 0) && (Rand_ZeroOne() < 0.5f)) {
Bolse_8018ED44(); Bolse_8018ED44();
@ -1245,13 +1245,13 @@ void Bolse_LevelStart(Player* player) {
Bolse_80191ED8(); Bolse_80191ED8();
ActorAllRange_SpawnTeam(); ActorAllRange_SpawnTeam();
player->unk_1D0 = 2; player->csState = 2;
player->pos.x = 0.0f; player->pos.x = 0.0f;
player->pos.y = 1400.0f; player->pos.y = 1400.0f;
player->pos.z = 14000.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++) { for (i = 0, actor = &gActors[1]; i < 3; i++, actor++) {
actor->obj.pos.x = D_i4_8019F030[i - 1].x + player->pos.x; 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; gCsCamAtY = player->pos.y;
gCsCamAtZ = player->pos.z; 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) { if (gCsFrameCount == 200) {
player->unk_204 = 2; player->unk_204 = 2;
@ -1313,8 +1313,8 @@ void Bolse_LevelStart(Player* player) {
break; break;
} }
Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); Matrix_RotateY(gCalcMatrix, (player->rot.y + 180.0f) * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); Matrix_RotateX(gCalcMatrix, -(player->rot.x * M_DTOR), MTXF_APPLY);
sp54.x = 0.0f; sp54.x = 0.0f;
sp54.y = 0; sp54.y = 0;
@ -1330,8 +1330,8 @@ void Bolse_LevelStart(Player* player) {
player->pos.y += player->vel.y; player->pos.y += player->vel.y;
player->pos.z += player->vel.z; 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); 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.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) { void Bolse_8018F83C(Actor* actor, s32 arg1) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_INIT; 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.x = D_i4_8019F06C[arg1] + gPlayer[0].pos.x;
actor->obj.pos.y = D_i4_8019F078[arg1] + gPlayer[0].pos.y; actor->obj.pos.y = D_i4_8019F078[arg1] + gPlayer[0].pos.y;
actor->obj.pos.z = D_i4_8019F084[arg1] + gPlayer[0].pos.z; actor->obj.pos.z = D_i4_8019F084[arg1] + gPlayer[0].pos.z;
@ -1370,7 +1370,7 @@ void Bolse_LevelComplete(Player* player) {
sp8C = 100.0f; sp8C = 100.0f;
sp88 = 100.0f; sp88 = 100.0f;
switch (player->unk_1D0) { switch (player->csState) {
case 0: case 0:
Audio_StopSfxByBankAndSource(1, player->sfxSource); Audio_StopSfxByBankAndSource(1, player->sfxSource);
gCsFrameCount = 0; gCsFrameCount = 0;
@ -1378,13 +1378,13 @@ void Bolse_LevelComplete(Player* player) {
D_i4_801A03D4 = 100.0f; D_i4_801A03D4 = 100.0f;
D_i4_801A03D8 = 80.0f; D_i4_801A03D8 = 80.0f;
Math_SmoothStepToF(&player->unk_0E8, -40.0f, 0.1f, 2.5f, 0.0f); Math_SmoothStepToF(&player->rot.y, -40.0f, 0.1f, 2.5f, 0.0f);
Math_SmoothStepToF(&player->unk_0EC, -60.0f, 0.2f, 5.0f, 0.0f); Math_SmoothStepToF(&player->rot.z, -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.x, 0.0f, 0.1f, 2.5f, 0.0f);
if (player->timer_1F8 == 0) { if (player->csTimer == 0) {
player->unk_1D0 = 1; player->csState = 1;
player->timer_1F8 = 200; player->csTimer = 200;
AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0); AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0);
player->unk_194 = 5.0f; player->unk_194 = 5.0f;
player->unk_190 = 5.0f; player->unk_190 = 5.0f;
@ -1395,18 +1395,18 @@ void Bolse_LevelComplete(Player* player) {
case 1: case 1:
player->unk_190 = 2.0f; player->unk_190 = 2.0f;
Math_SmoothStepToF(&player->unk_0E4, 15.0f, 0.1f, 0.4f, 0.0f); Math_SmoothStepToF(&player->rot.x, 15.0f, 0.1f, 0.4f, 0.0f);
Math_SmoothStepToF(&player->unk_0EC, 40.0f, 0.2f, 5.0f, 0.0f); Math_SmoothStepToF(&player->rot.z, 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.y, 120.0f, 0.1f, 2.0f, 0.0f);
player->baseSpeed += 1.0f; player->baseSpeed += 1.0f;
if (player->baseSpeed >= 70.0f) { if (player->baseSpeed >= 70.0f) {
player->baseSpeed = 70.0f; player->baseSpeed = 70.0f;
} }
if (player->timer_1F8 == 0) { if (player->csTimer == 0) {
player->unk_1D0 = 5; player->csState = 5;
player->timer_1F8 = 1000; player->csTimer = 1000;
Audio_StopPlayerNoise(0); Audio_StopPlayerNoise(0);
Audio_KillSfxBySource(player->sfxSource); Audio_KillSfxBySource(player->sfxSource);
Play_ClearObjectData(); Play_ClearObjectData();
@ -1421,10 +1421,10 @@ void Bolse_LevelComplete(Player* player) {
player->pos.y = actor50->obj.pos.y; player->pos.y = actor50->obj.pos.y;
player->pos.z = actor50->obj.pos.z - 1000.0f; player->pos.z = actor50->obj.pos.z - 1000.0f;
player->unk_0E4 = 0.0f; player->rot.x = 0.0f;
player->unk_0EC = 0.0f; player->rot.z = 0.0f;
player->unk_0E8 = 0.0f; player->rot.y = 0.0f;
player->unk_114 = 0.0f; player->yRot_114 = 0.0f;
player->baseSpeed = 40.0f; player->baseSpeed = 40.0f;
if (gTeamShields[TEAM_ID_FALCO] > 0) { if (gTeamShields[TEAM_ID_FALCO] > 0) {
@ -1460,7 +1460,7 @@ void Bolse_LevelComplete(Player* player) {
case 5: case 5:
gFillScreenAlpha = gFillScreenAlphaTarget = 0; gFillScreenAlpha = gFillScreenAlphaTarget = 0;
player->unk_1D0 = 10; player->csState = 10;
case 10: case 10:
gCsCamAtX = gPlayer[0].pos.x; gCsCamAtX = gPlayer[0].pos.x;
@ -1537,7 +1537,7 @@ void Bolse_LevelComplete(Player* player) {
break; break;
case 240: case 240:
player->unk_1D0++; player->csState++;
D_ctx_80177A48[0] = 0; D_ctx_80177A48[0] = 0;
D_ctx_80177A48[5] = 20.0f; D_ctx_80177A48[5] = 20.0f;
D_ctx_80177A48[6] = 0.0f; D_ctx_80177A48[6] = 0.0f;
@ -1601,8 +1601,8 @@ void Bolse_LevelComplete(Player* player) {
break; break;
case 800: case 800:
player->unk_1D0 += 1; player->csState += 1;
player->timer_1F8 = 50; player->csTimer = 50;
player->unk_194 = 5.0f; player->unk_194 = 5.0f;
player->unk_190 = 5.0f; player->unk_190 = 5.0f;
AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0); AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0);
@ -1618,11 +1618,11 @@ void Bolse_LevelComplete(Player* player) {
player->unk_190 = 2.0f; player->unk_190 = 2.0f;
player->baseSpeed += 5; player->baseSpeed += 5;
if (player->timer_1F8 == 30) { if (player->csTimer == 30) {
Audio_FadeOutAll(30); Audio_FadeOutAll(30);
} }
if (player->timer_1F8 == 0) { if (player->csTimer == 0) {
gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0; gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0;
gFillScreenAlphaTarget = 255; gFillScreenAlphaTarget = 255;
if (gFillScreenAlpha == 255) { if (gFillScreenAlpha == 255) {
@ -1686,8 +1686,8 @@ void Bolse_LevelComplete(Player* player) {
gLight1G = D_i4_801A03D4; gLight1G = D_i4_801A03D4;
gLight1B = D_i4_801A03D8; gLight1B = D_i4_801A03D8;
Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); Matrix_RotateX(gCalcMatrix, -((player->xRot_120 + player->rot.x + player->aerobaticPitch) * M_DTOR), MTXF_APPLY);
sp74.x = 0.0f; sp74.x = 0.0f;
sp74.y = 0.0f; sp74.y = 0.0f;
@ -1703,15 +1703,15 @@ void Bolse_LevelComplete(Player* player) {
player->pos.y += player->vel.y; player->pos.y += player->vel.y;
player->pos.z += player->vel.z; 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;
if (player->unk_1D0 < 10) { if (player->csState < 10) {
Math_SmoothStepToF(&player->unk_130, 0.0f, 0.1f, 15.0f, 0.0f); Math_SmoothStepToF(&player->zRotBarrelRoll, 0.0f, 0.1f, 15.0f, 0.0f);
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(&player->camRoll, 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);
if (player->pos.y < 700.0f) { if (player->pos.y < 700.0f) {
Math_SmoothStepToF(&player->pos.y, 700.0f, 0.1f, 10.0f, 0.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.y, gCsCamAtY, D_ctx_80177A48[0], 50000, 0);
Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, 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->bobPhase += 10.0f;
player->unk_080 = -SIN_DEG(player->unk_088) * 0.3f; player->yBob = -SIN_DEG(player->bobPhase) * 0.3f;
player->unk_0F4 += 8.0f; player->rockPhase += 8.0f;
player->unk_0F0 = SIN_DEG(player->unk_0F4); player->rockAngle = SIN_DEG(player->rockPhase);
} }
void Bolse_80190D98(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 xRot, f32 yRot) { 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) { void Bolse_80191054(Effect* effect) {
switch (effect->state) { switch (effect->state) {
case 0: case 0:
if (gPlayer[0].unk_280 == 0) { if (gPlayer[0].barrelRollAlpha == 0) {
func_effect_8007A774(gPlayer, effect, 150.0f); func_effect_8007A774(gPlayer, effect, 150.0f);
} }

View File

@ -191,7 +191,7 @@ void Fortuna_UpdateEvents(Actor* actor) {
actor->iwork[0] = 0; actor->iwork[0] = 0;
actor->state = 6; actor->state = 6;
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE;
gPlayer[0].unk_1D0 = 0; gPlayer[0].csState = 0;
gPlayer[0].unk_000 = 0.0f; gPlayer[0].unk_000 = 0.0f;
AllRange_ClearRadio(); AllRange_ClearRadio();
@ -204,7 +204,7 @@ void Fortuna_UpdateEvents(Actor* actor) {
(gStarWolfTeamAlive[3] == 0)) { (gStarWolfTeamAlive[3] == 0)) {
Radio_PlayMessage(gMsg_ID_9411, RCID_FOX); Radio_PlayMessage(gMsg_ID_9411, RCID_FOX);
gMissionStatus = MISSION_ACCOMPLISHED; gMissionStatus = MISSION_ACCOMPLISHED;
gPlayer[0].timer_1F8 = 50; gPlayer[0].csTimer = 50;
player->unk_190 = 5.0f; player->unk_190 = 5.0f;
player->unk_194 = 5.0f; player->unk_194 = 5.0f;
AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0); AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0);
@ -212,7 +212,7 @@ void Fortuna_UpdateEvents(Actor* actor) {
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 30); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 30);
} else { } else {
gMissionStatus = MISSION_COMPLETE; 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.x = 0.0f;
player->pos.z = 15000.0f; player->pos.z = 15000.0f;
player->pos.y = 670.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++) { for (actorPtr = &gActors[1], i = 0; i < 3; i++, actorPtr++) {
actorPtr->obj.pos.x = D_i4_8019EDF8[i - 1].x; 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 }; Vec3f sp50 = { 0.0f, 0.0f, -10000 };
Actor_Initialize(actor19); Actor_Initialize(actor19);
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);
Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114) * M_DTOR, MTXF_APPLY); Matrix_RotateY(gCalcMatrix, (player->rot.y + player->yRot_114) * M_DTOR, MTXF_APPLY);
Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, MTXF_APPLY); Matrix_RotateX(gCalcMatrix, player->rot.x * M_DTOR, MTXF_APPLY);
Matrix_MultVec3f(gCalcMatrix, &sp50, &actor19->obj.pos); Matrix_MultVec3f(gCalcMatrix, &sp50, &actor19->obj.pos);
actor19->obj.status = OBJ_ACTIVE; actor19->obj.status = OBJ_ACTIVE;
actor19->obj.id = OBJ_ACTOR_ALLRANGE; actor19->obj.id = OBJ_ACTOR_ALLRANGE;
actor19->state = 4; 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->unk_0F4.x = 15.0f;
actor19->aiType = AI360_GREAT_FOX; actor19->aiType = AI360_GREAT_FOX;
actor19->fwork[1] = 90.0f; actor19->fwork[1] = 90.0f;
@ -489,11 +489,11 @@ void Fortuna_80188AD0(Actor* actor) {
actor->obj.pos.y -= 230.0f; actor->obj.pos.y -= 230.0f;
} }
if ((actor->unk_0D0 != 0) && (actor->state == 0)) { if ((actor->dmgType != 0) && (actor->state == 0)) {
actor->unk_0D0 = 0; actor->dmgType = 0;
actor->state = 1; actor->state = 1;
actor->info.hitbox = SEGMENTED_TO_VIRTUAL(D_FO_600FF64); 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->lockOnTimers[TEAM_ID_FOX] = 0;
actor->info.bonus = 0; actor->info.bonus = 0;
AUDIO_PLAY_SFX(0x2903B009, actor->sfxSource, 4); AUDIO_PLAY_SFX(0x2903B009, actor->sfxSource, 4);
@ -586,7 +586,7 @@ void Fortuna_8018906C(void) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_INIT; 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.x = 0.0f;
actor->obj.pos.y = 0.0f; actor->obj.pos.y = 0.0f;
actor->obj.pos.z = -9000.0f; actor->obj.pos.z = -9000.0f;
@ -609,10 +609,10 @@ Matrix D_BO_8019EE80 = { {
void Fortuna_801890EC(Actor* actor, s32 arg1) { void Fortuna_801890EC(Actor* actor, s32 arg1) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_INIT; 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.x = D_i4_8019EE4C[arg1] + gPlayer[0].pos.x;
actor->obj.pos.y = D_i4_8019EE5C[arg1] + gPlayer[0].pos.y; 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; actor->vel.z = gPlayer[0].baseSpeed;
Object_SetInfo(&actor->info, actor->obj.id); Object_SetInfo(&actor->info, actor->obj.id);
@ -640,11 +640,11 @@ void Fortuna_LevelComplete(Player* player) {
Actor* actor3 = &gActors[3]; Actor* actor3 = &gActors[3];
s32 pad[3]; s32 pad[3];
if ((player->unk_1D0 < 10) && (player->unk_1D0 >= 0)) { if ((player->csState < 10) && (player->csState >= 0)) {
Math_SmoothStepToF(&player->unk_130, 0.0f, 0.1f, 15.0f, 0.0f); Math_SmoothStepToF(&player->zRotBarrelRoll, 0.0f, 0.1f, 15.0f, 0.0f);
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(&player->camRoll, 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);
if (gMissionStatus == MISSION_COMPLETE) { if (gMissionStatus == MISSION_COMPLETE) {
if (player->pos.y < 700.0f) { if (player->pos.y < 700.0f) {
Math_SmoothStepToF(&player->pos.y, 700.0f, 0.1f, 10.0f, 0.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); Math_SmoothStepToF(&player->boostSpeed, 0.0f, 0.1f, 1.5f, 0.0f);
switch (player->unk_1D0) { switch (player->csState) {
case -1: case -1:
player->wings.modelId = 1; player->wings.modelId = 1;
player->unk_0E8 = 0.0f; player->rot.y = 0.0f;
player->baseSpeed = 30.0f; player->baseSpeed = 30.0f;
player->unk_114 = 180.0f; player->yRot_114 = 180.0f;
player->unk_0E4 = -7.0f; player->rot.x = -7.0f;
Math_SmoothStepToF(&player->unk_0EC, 0.0f, 0.05f, 1.0f, 0.0f); Math_SmoothStepToF(&player->rot.z, 0.0f, 0.05f, 1.0f, 0.0f);
player->unk_12C = 0.0f; player->zRotBank = 0.0f;
player->unk_130 = 0.0f; player->zRotBarrelRoll = 0.0f;
player->unk_4D8 = 0.0f; player->aerobaticPitch = 0.0f;
player->cam.eye.x = -200.0f; player->cam.eye.x = -200.0f;
player->cam.eye.y = 100.0f; player->cam.eye.y = 100.0f;
player->cam.eye.z = -1500.0f; player->cam.eye.z = -1500.0f;
player->cam.at.x = player->pos.x; player->cam.at.x = player->pos.x;
player->cam.at.y = player->pos.y; 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; gFillScreenAlphaTarget = 255;
gFillScreenAlphaStep = 10; gFillScreenAlphaStep = 10;
gFillScreenGreen = gFillScreenRed = gFillScreenBlue = 0; gFillScreenGreen = gFillScreenRed = gFillScreenBlue = 0;
if (player->timer_1F8 == 0) { if (player->csTimer == 0) {
player->timer_1F8 = 0; player->csTimer = 0;
player->unk_1D0 = 1; player->csState = 1;
} }
} }
break; break;
case 0: case 0:
if (gMissionStatus == MISSION_COMPLETE) { if (gMissionStatus == MISSION_COMPLETE) {
Math_SmoothStepToF(&player->unk_0E8, 40.0f, 0.1f, 2.5f, 0.0f); Math_SmoothStepToF(&player->rot.y, 40.0f, 0.1f, 2.5f, 0.0f);
Math_SmoothStepToF(&player->unk_0EC, 60.0f, 0.2f, 5.0f, 0.0f); Math_SmoothStepToF(&player->rot.z, 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.x, 0.0f, 0.1f, 2.5f, 0.0f);
} else { } else {
player->unk_190 = 2.0f; player->unk_190 = 2.0f;
player->cam.eye.y += 3.0f; player->cam.eye.y += 3.0f;
Math_SmoothStepToF(&player->unk_0EC, Math_SmoothStepToF(&player->rot.z,
Math_SmoothStepToF(&player->unk_114, Math_SmoothStepToF(&player->yRot_114,
Math_RadToDeg(Math_Atan2F(player->pos.x, player->unk_138)), 0.1f, Math_RadToDeg(Math_Atan2F(player->pos.x, player->trueZpos)), 0.1f,
4.0f, 0.0f) * 4.0f, 0.0f) *
20.0f, 20.0f,
0.2f, 5.0f, 0.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) { if (gMissionStatus != MISSION_COMPLETE) {
player->timer_1F8 = 150; player->csTimer = 150;
player->unk_1D0 = -1; player->csState = -1;
player->pos.x = 0.0f; player->pos.x = 0.0f;
player->boostSpeed = 0.0f; player->boostSpeed = 0.0f;
player->baseSpeed = 0.0f; player->baseSpeed = 0.0f;
player->pos.y = 350.0f; player->pos.y = 350.0f;
player->pos.z = -2800.0f; player->pos.z = -2800.0f;
} else { } else {
player->timer_1F8 = 280; player->csTimer = 280;
player->unk_1D0 = 1; player->csState = 1;
} }
player->unk_194 = 5.0f; player->unk_194 = 5.0f;
player->unk_190 = 5.0f; player->unk_190 = 5.0f;
@ -732,20 +732,20 @@ void Fortuna_LevelComplete(Player* player) {
case 1: case 1:
player->unk_190 = 2.0f; player->unk_190 = 2.0f;
Math_SmoothStepToF(&player->unk_0E4, 15.0f, 0.1f, 0.4f, 0.0f); Math_SmoothStepToF(&player->rot.x, 15.0f, 0.1f, 0.4f, 0.0f);
Math_SmoothStepToF(&player->unk_0EC, -40.0f, 0.2f, 5.0f, 0.0f); Math_SmoothStepToF(&player->rot.z, -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.y, -120.0f, 0.1f, 2.0f, 0.0f);
player->baseSpeed += 1.0f; player->baseSpeed += 1.0f;
if (player->baseSpeed >= 70.0f) { if (player->baseSpeed >= 70.0f) {
player->baseSpeed = 70.0f; player->baseSpeed = 70.0f;
player->unk_25C += 0.04f; player->contrailScale += 0.04f;
if (player->unk_25C > 0.6f) { if (player->contrailScale > 0.6f) {
player->unk_25C = 0.6f; player->contrailScale = 0.6f;
} }
} }
if (player->timer_1F8 == 0) { if (player->csTimer == 0) {
player->unk_1D0 = 2; player->csState = 2;
player->timer_1F8 = 1000; player->csTimer = 1000;
for (i = 0; i < ARRAY_COUNT(gActors); i++) { for (i = 0; i < ARRAY_COUNT(gActors); i++) {
Object_Kill(&gActors[i].obj, gActors[i].sfxSource); Object_Kill(&gActors[i].obj, gActors[i].sfxSource);
} }
@ -763,14 +763,14 @@ void Fortuna_LevelComplete(Player* player) {
break; break;
case 2: case 2:
if (!(gMissionStatus) && (player->timer_1F8) > 830) { if (!(gMissionStatus) && (player->csTimer) > 830) {
gFillScreenAlphaTarget = 0; gFillScreenAlphaTarget = 0;
gFillScreenAlphaStep = 8; gFillScreenAlphaStep = 8;
} }
if (player->timer_1F8 == 810) { if (player->csTimer == 810) {
Audio_KillSfxBySource(gBosses[0].sfxSource); Audio_KillSfxBySource(gBosses[0].sfxSource);
} }
if (player->timer_1F8 == 830) { if (player->csTimer == 830) {
gFillScreenAlphaTarget = 255; gFillScreenAlphaTarget = 255;
gFillScreenAlphaStep = 2; gFillScreenAlphaStep = 2;
gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255;
@ -781,9 +781,9 @@ void Fortuna_LevelComplete(Player* player) {
if ((func_hud_80090200(&gBosses[0]) == 2) || (gMissionStatus != MISSION_COMPLETE)) { if ((func_hud_80090200(&gBosses[0]) == 2) || (gMissionStatus != MISSION_COMPLETE)) {
Play_ClearObjectData(); Play_ClearObjectData();
if (gMissionStatus == MISSION_COMPLETE) { if (gMissionStatus == MISSION_COMPLETE) {
player->unk_1D0 = 10; player->csState = 10;
} else { } else {
player->unk_1D0 = 20; player->csState = 20;
} }
for (i = 0; i < 200; i++) { for (i = 0; i < 200; i++) {
@ -806,21 +806,21 @@ void Fortuna_LevelComplete(Player* player) {
if (gMissionStatus == MISSION_COMPLETE) { if (gMissionStatus == MISSION_COMPLETE) {
player->pos.x = 0.0f; player->pos.x = 0.0f;
player->pos.y = 0.0f; player->pos.y = 0.0f;
player->unk_0E4 = 0.0f; player->rot.x = 0.0f;
player->unk_0EC = 0.0f; player->rot.z = 0.0f;
player->baseSpeed = 0.0f; player->baseSpeed = 0.0f;
player->unk_114 = 0.0f; player->yRot_114 = 0.0f;
player->unk_0E8 = 180.0f; player->rot.y = 180.0f;
Fortuna_8018906C(); Fortuna_8018906C();
} else { } else {
player->pos.x = 0.0f; player->pos.x = 0.0f;
player->unk_0E4 = 0.0f; player->rot.x = 0.0f;
player->unk_0EC = 0.0f; player->rot.z = 0.0f;
player->unk_114 = 0.0f; player->yRot_114 = 0.0f;
player->baseSpeed = 0.0f; player->baseSpeed = 0.0f;
player->cam.at.y = 16.0f; player->cam.at.y = 16.0f;
player->pos.y = -100.0f; player->pos.y = -100.0f;
player->unk_0E8 = 180.0f; player->rot.y = 180.0f;
} }
player->pos.z = -10000.0f; player->pos.z = -10000.0f;
gCsFrameCount = 0; gCsFrameCount = 0;
@ -860,7 +860,7 @@ void Fortuna_LevelComplete(Player* player) {
} }
if (gCsFrameCount == 496) { if (gCsFrameCount == 496) {
player->unk_1D0 = 11; player->csState = 11;
D_ctx_80177A48[0] = 0.01f; D_ctx_80177A48[0] = 0.01f;
D_ctx_80177A48[1] = 0.0f; D_ctx_80177A48[1] = 0.0f;
D_ctx_80177A48[2] = -400.0f; D_ctx_80177A48[2] = -400.0f;
@ -1016,8 +1016,8 @@ void Fortuna_LevelComplete(Player* player) {
D_ctx_8017842C += 0.3f; D_ctx_8017842C += 0.3f;
Math_SmoothStepToF(&D_ctx_80177A48[3], 0.0f, 1.0f, 0.02f, 0); Math_SmoothStepToF(&D_ctx_80177A48[3], 0.0f, 1.0f, 0.02f, 0);
if (gCsFrameCount == 1216) { if (gCsFrameCount == 1216) {
player->unk_1D0 = 12; player->csState = 12;
player->timer_1F8 = 1000; player->csTimer = 1000;
D_ctx_80177A48[4] = 1.0f; D_ctx_80177A48[4] = 1.0f;
actor2->vel.y = 0.1f; actor2->vel.y = 0.1f;
actor1->vel.y = 0.1f; actor1->vel.y = 0.1f;
@ -1040,12 +1040,12 @@ void Fortuna_LevelComplete(Player* player) {
player->unk_190 = 2.0f; player->unk_190 = 2.0f;
if (gTeamShields[TEAM_ID_FALCO] > 0) { if (gTeamShields[TEAM_ID_FALCO] > 0) {
if (player->timer_1F8 == 980) { if (player->csTimer == 980) {
AUDIO_PLAY_SFX(0x09000002, actor3->sfxSource, 0); AUDIO_PLAY_SFX(0x09000002, actor3->sfxSource, 0);
actor3->vel.y = 1.0f; actor3->vel.y = 1.0f;
actor3->fwork[29] = 5.0f; actor3->fwork[29] = 5.0f;
} }
if (player->timer_1F8 < 980) { if (player->csTimer < 980) {
actor3->vel.z += 1.0f; actor3->vel.z += 1.0f;
actor3->vel.z *= 1.15f; actor3->vel.z *= 1.15f;
actor3->vel.y *= 1.19f; 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); AUDIO_PLAY_SFX(0x09000002, actor2->sfxSource, 0);
actor2->vel.y = 1.0f; actor2->vel.y = 1.0f;
actor2->fwork[29] = 5.0f; actor2->fwork[29] = 5.0f;
} }
if (player->timer_1F8 < 960) { if (player->csTimer < 960) {
actor2->vel.z += 1.0f; actor2->vel.z += 1.0f;
actor2->vel.z *= 1.15f; actor2->vel.z *= 1.15f;
actor2->vel.y *= 1.19f; actor2->vel.y *= 1.19f;
@ -1067,13 +1067,13 @@ void Fortuna_LevelComplete(Player* player) {
} }
if (gTeamShields[TEAM_ID_SLIPPY] > 0) { if (gTeamShields[TEAM_ID_SLIPPY] > 0) {
if (player->timer_1F8 == 940) { if (player->csTimer == 940) {
AUDIO_PLAY_SFX(0x09000002, actor1->sfxSource, 0); AUDIO_PLAY_SFX(0x09000002, actor1->sfxSource, 0);
actor1->vel.y = 1.0f; actor1->vel.y = 1.0f;
actor1->fwork[29] = 5.0f; actor1->fwork[29] = 5.0f;
} }
if (player->timer_1F8 < 940) { if (player->csTimer < 940) {
actor1->vel.z += 1.0f; actor1->vel.z += 1.0f;
actor1->vel.z *= 1.15f; actor1->vel.z *= 1.15f;
actor1->vel.y *= 1.19f; 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->vel.y = 1.0f;
actor0->obj.rot.x = -2.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.0f;
actor0->vel.z *= 1.02f; actor0->vel.z *= 1.02f;
actor0->vel.y *= 1.06f; actor0->vel.y *= 1.06f;
@ -1095,7 +1095,7 @@ void Fortuna_LevelComplete(Player* player) {
if (gCsFrameCount == 1382) { if (gCsFrameCount == 1382) {
player->state_1C8 = PLAYERSTATE_1C8_NEXT; player->state_1C8 = PLAYERSTATE_1C8_NEXT;
player->timer_1F8 = 0; player->csTimer = 0;
gFadeoutType = 4; gFadeoutType = 4;
Audio_FadeOutAll(10); Audio_FadeOutAll(10);
for (i = 0; i < 6; i++) { for (i = 0; i < 6; i++) {
@ -1110,21 +1110,21 @@ void Fortuna_LevelComplete(Player* player) {
Fortuna_801890EC(actor3, 0); Fortuna_801890EC(actor3, 0);
actor3->obj.pos.x = (player->pos.x - 100.0f) - 400.0f; actor3->obj.pos.x = (player->pos.x - 100.0f) - 400.0f;
actor3->obj.pos.y = player->pos.y + 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; actor3->obj.rot.z = 90.0f;
} }
if (gTeamShields[TEAM_ID_SLIPPY] > 0) { if (gTeamShields[TEAM_ID_SLIPPY] > 0) {
Fortuna_801890EC(actor1, 1); Fortuna_801890EC(actor1, 1);
actor1->obj.pos.x = player->pos.x + 100.0f + 400.0f; actor1->obj.pos.x = player->pos.x + 100.0f + 400.0f;
actor1->obj.pos.y = player->pos.y + 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; actor1->obj.rot.z = -90.0f;
} }
if (gTeamShields[TEAM_ID_PEPPY] > 0) { if (gTeamShields[TEAM_ID_PEPPY] > 0) {
Fortuna_801890EC(actor2, 2); Fortuna_801890EC(actor2, 2);
actor2->obj.pos.x = player->pos.x; actor2->obj.pos.x = player->pos.x;
actor2->obj.pos.y = player->pos.y + 100.0f + 400.0f; 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); Fortuna_801890EC(actor0, 3);
@ -1132,7 +1132,7 @@ void Fortuna_LevelComplete(Player* player) {
actor0->vel.z = 0.0f; actor0->vel.z = 0.0f;
actor0->info.bonus = 1; actor0->info.bonus = 1;
gCsFrameCount = 0; gCsFrameCount = 0;
player->unk_1D0 = 21; player->csState = 21;
player->unk_234 = 1; player->unk_234 = 1;
for (i = 0; i < 9; i++) { for (i = 0; i < 9; i++) {
@ -1187,7 +1187,7 @@ void Fortuna_LevelComplete(Player* player) {
actor1->obj.pos.x = 100.0f; actor1->obj.pos.x = 100.0f;
actor1->obj.pos.y = 40.0f; actor1->obj.pos.y = 40.0f;
actor2->obj.pos.y = 90.0f; actor2->obj.pos.y = 90.0f;
player->unk_1D0 = 22; player->csState = 22;
} }
switch (gCsFrameCount) { switch (gCsFrameCount) {
@ -1201,7 +1201,7 @@ void Fortuna_LevelComplete(Player* player) {
src.x = 0.0f; src.x = 0.0f;
src.y = D_ctx_80177A48[7]; src.y = D_ctx_80177A48[7];
src.z = D_ctx_80177A48[5]; 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_RotateY(gCalcMatrix, -(D_ctx_80177A48[4] * M_DTOR), MTXF_APPLY);
Matrix_MultVec3f(gCalcMatrix, &src, &dest); Matrix_MultVec3f(gCalcMatrix, &src, &dest);
player->cam.eye.x = gCsCamEyeX = dest.x; 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); Math_SmoothStepToF(&gCsCamAtY, 0.0f, 0.005f, 1000.0f, 0.0001f);
player->cam.at.x = player->pos.x; player->cam.at.x = player->pos.x;
player->cam.at.y = gCsCamAtY; player->cam.at.y = gCsCamAtY;
player->cam.at.z = player->pos.z + D_ctx_80177D20; player->cam.at.z = player->pos.z + gPathProgress;
break; break;
case 22: case 22:
@ -1318,7 +1318,7 @@ void Fortuna_LevelComplete(Player* player) {
gFillScreenAlphaStep = 16; gFillScreenAlphaStep = 16;
if (gFillScreenAlpha == 255) { if (gFillScreenAlpha == 255) {
player->state_1C8 = PLAYERSTATE_1C8_NEXT; player->state_1C8 = PLAYERSTATE_1C8_NEXT;
player->timer_1F8 = 0; player->csTimer = 0;
gFadeoutType = 4; gFadeoutType = 4;
Audio_FadeOutAll(10); Audio_FadeOutAll(10);
@ -1374,7 +1374,7 @@ void Fortuna_LevelComplete(Player* player) {
src.x = 0.0f; src.x = 0.0f;
src.y = D_ctx_80177A48[7]; src.y = D_ctx_80177A48[7];
src.z = D_ctx_80177A48[5]; 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_RotateY(gCalcMatrix, -(D_ctx_80177A48[4] * M_DTOR), MTXF_APPLY);
Matrix_MultVec3f(gCalcMatrix, &src, &dest); Matrix_MultVec3f(gCalcMatrix, &src, &dest);
player->cam.eye.x = gCsCamEyeX = dest.x; 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.x = gCsCamAtX = player->pos.x;
player->cam.at.y = gCsCamAtY; 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; break;
} }
if (player->unk_1D0 < 20) { if (player->csState < 20) {
switch (gCsFrameCount) { switch (gCsFrameCount) {
case 1020: case 1020:
gShowLevelClearStatusScreen = 1; 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_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); Matrix_RotateX(gCalcMatrix, -((player->xRot_120 + player->rot.x + player->aerobaticPitch) * M_DTOR), MTXF_APPLY);
src.x = 0.0f; src.x = 0.0f;
src.y = 0.0f; src.y = 0.0f;
@ -1429,8 +1429,8 @@ void Fortuna_LevelComplete(Player* player) {
player->pos.x += player->vel.x; player->pos.x += player->vel.x;
player->pos.y += player->vel.y; player->pos.y += player->vel.y;
player->pos.z += player->vel.z; 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;
} }
void Fortuna_8018BA2C(void) { void Fortuna_8018BA2C(void) {

View File

@ -171,7 +171,7 @@ void Katina_80192C8C(void) {
if (actor->obj.status == OBJ_FREE) { if (actor->obj.status == OBJ_FREE) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_INIT; 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); Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_i4_8019F0F0[i], &actor->obj.pos);
actor->obj.rot = D_i4_8019F138[i]; actor->obj.rot = D_i4_8019F138[i];
Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_i4_8019F114[i], &dest); Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_i4_8019F114[i], &dest);
@ -196,11 +196,11 @@ void Katina_LevelStart(Player* player) {
gAllRangeEventTimer = 0; gAllRangeEventTimer = 0;
if (player->unk_1D0 != 0) { if (player->csState != 0) {
Katina_801981F8(&gActors[4]); Katina_801981F8(&gActors[4]);
} }
switch (player->unk_1D0) { switch (player->csState) {
case 1: case 1:
case 2: case 2:
case 3: case 3:
@ -222,7 +222,7 @@ void Katina_LevelStart(Player* player) {
gCsCamAtX = gActors[4].obj.pos.x; gCsCamAtX = gActors[4].obj.pos.x;
gCsCamAtY = gActors[4].obj.pos.y; gCsCamAtY = gActors[4].obj.pos.y;
gCsCamAtZ = gActors[4].obj.pos.z; gCsCamAtZ = gActors[4].obj.pos.z;
player->unk_1D0 = 11; player->csState = 11;
D_ctx_80177A48[0] = 1.0f; D_ctx_80177A48[0] = 1.0f;
break; break;
@ -235,7 +235,7 @@ void Katina_LevelStart(Player* player) {
gActors[6].obj.rot.z += 0.7f; gActors[6].obj.rot.z += 0.7f;
if (gCsFrameCount == 100) { if (gCsFrameCount == 100) {
gCsFrameCount = 80; gCsFrameCount = 80;
player->unk_1D0 = 12; player->csState = 12;
} }
break; break;
@ -245,11 +245,11 @@ void Katina_LevelStart(Player* player) {
gActors[4].obj.rot.z -= 1.0f; gActors[4].obj.rot.z -= 1.0f;
if (gCsFrameCount == 120) { if (gCsFrameCount == 120) {
ActorAllRange_SpawnTeam(); ActorAllRange_SpawnTeam();
player->unk_1D0 = 13; player->csState = 13;
player->pos.x = 0.0f; player->pos.x = 0.0f;
player->pos.y = 1300.0f; player->pos.y = 1300.0f;
player->pos.z = 10000.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++) { 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.x = D_i4_8019F168[i - 1].x + player->pos.x;
actor->obj.pos.y = D_i4_8019F168[i - 1].y + player->pos.y; 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); Object_Kill(&gActors[5].obj, gActors[5].sfxSource);
break; break;
} }
Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114 + 180.0f) * M_DTOR, MTXF_NEW); Matrix_RotateY(gCalcMatrix, (player->rot.y + player->yRot_114 + 180.0f) * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); Matrix_RotateX(gCalcMatrix, -(player->rot.x * M_DTOR), MTXF_APPLY);
src.x = 0; src.x = 0;
src.y = 0.0f; src.y = 0.0f;
src.z = player->baseSpeed; src.z = player->baseSpeed;
@ -340,8 +340,8 @@ void Katina_LevelStart(Player* player) {
player->pos.x += player->vel.x; player->pos.x += player->vel.x;
player->pos.y += player->vel.y; player->pos.y += player->vel.y;
player->pos.z += player->vel.z; 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.0f); 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.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.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) { if (boss->timer_050 == 500) {
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE;
gPlayer[0].unk_1D0 = 100; gPlayer[0].csState = 100;
gPlayer[0].unk_234 = 0; gPlayer[0].unk_234 = 0;
gCsFrameCount = 5000; gCsFrameCount = 5000;
} }
@ -1039,17 +1039,16 @@ void Katina_801946C4(Boss* boss) {
gFillScreenBlue = 255; gFillScreenBlue = 255;
if (gFillScreenAlpha == 255) { if (gFillScreenAlpha == 255) {
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE;
gPlayer[0].unk_1D0 = 2; gPlayer[0].csState = 2;
gPlayer[0].unk_234 = 1; gPlayer[0].unk_234 = 1;
gCsFrameCount = 200; gCsFrameCount = 200;
Audio_StopPlayerNoise(0); Audio_StopPlayerNoise(0);
Audio_KillSfxBySource(&gPlayer[0].sfxSource[0]); Audio_KillSfxBySource(&gPlayer[0].sfxSource[0]);
gPlayer[0].timer_1F8 = 50; gPlayer[0].csTimer = 50;
gPlayer[0].baseSpeed = 0.0f; 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].rot.z = gPlayer[0].rot.y = gPlayer[0].rot.x = gPlayer[0].xRot_120 = gPlayer[0].yRot_114;
gPlayer[0].unk_114;
Play_ClearObjectData(); Play_ClearObjectData();
gEnvLightyRot = 60.0f; gEnvLightyRot = 60.0f;
gLight1R = 100; gLight1R = 100;
@ -1065,7 +1064,7 @@ void Katina_801946C4(Boss* boss) {
if ((boss->timer_050 == 0) && ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || 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_U_TURN))) {
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE;
gPlayer[0].unk_1D0 = 0; gPlayer[0].csState = 0;
gMissionStatus = MISSION_ACCOMPLISHED; gMissionStatus = MISSION_ACCOMPLISHED;
boss->obj.pos.z = 0.0f; boss->obj.pos.z = 0.0f;
boss->health = -1; boss->health = -1;
@ -1147,7 +1146,7 @@ void Katina_801946C4(Boss* boss) {
gRadarMarks[64].pos.x = boss->obj.pos.x; gRadarMarks[64].pos.x = boss->obj.pos.x;
gRadarMarks[64].pos.y = boss->obj.pos.y; gRadarMarks[64].pos.y = boss->obj.pos.y;
gRadarMarks[64].pos.z = boss->obj.pos.z; 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) { 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.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); 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_Initialize(actor);
actor->obj.status = OBJ_INIT; 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.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.y = D_i4_8019F26C[idx + 1] + gPlayer[0].pos.y;
actor->obj.pos.z = D_i4_8019F278[idx + 1] + gPlayer[0].pos.z; 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_Initialize(actor);
actor->obj.status = OBJ_INIT; 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.x = D_i4_8019F29C[idx + 1];
actor->obj.pos.y = D_i4_8019F2AC[idx + 1]; actor->obj.pos.y = D_i4_8019F2AC[idx + 1];
actor->obj.pos.z = D_i4_8019F2BC[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))) { if ((D_i4_8019F2F0[i] >= gKaAllyKillCount) && ((i >= 3) || (gTeamShields[i + 1] > 0))) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_INIT; 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.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.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); 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_0C = 0.0f;
player->wings.unk_08 = 0.0f; player->wings.unk_08 = 0.0f;
player->wings.unk_04 = 0.0f; player->wings.unk_04 = 0.0f;
player->unk_4D8 = 0.0f; player->aerobaticPitch = 0.0f;
D_ctx_80177A48[0] = 1.0f; D_ctx_80177A48[0] = 1.0f;
switch (player->unk_1D0) { switch (player->csState) {
case 0: case 0:
Audio_StopSfxByBankAndSource(1, &player->sfxSource[0]); Audio_StopSfxByBankAndSource(1, &player->sfxSource[0]);
gCsFrameCount = 0; gCsFrameCount = 0;
@ -1417,8 +1416,8 @@ void Katina_LevelComplete(Player* player) {
player->pos.x = boss->obj.pos.x; player->pos.x = boss->obj.pos.x;
player->pos.y = 800.0f; player->pos.y = 800.0f;
player->pos.z = boss->obj.pos.z; player->pos.z = boss->obj.pos.z;
player->unk_114 = player->unk_120 = player->unk_0E4 = player->camRoll = player->unk_4D8 = 0.0f; player->yRot_114 = player->xRot_120 = player->rot.x = player->camRoll = player->aerobaticPitch = 0.0f;
player->unk_0E8 = 120.0f; player->rot.y = 120.0f;
player->baseSpeed = 40.0f; player->baseSpeed = 40.0f;
gCsCamEyeX = boss->obj.pos.x + 5000.0f; gCsCamEyeX = boss->obj.pos.x + 5000.0f;
gCsCamEyeY = 750.0f; gCsCamEyeY = 750.0f;
@ -1431,7 +1430,7 @@ void Katina_LevelComplete(Player* player) {
Object_Kill(&gActors[i].obj, gActors[i].sfxSource); Object_Kill(&gActors[i].obj, gActors[i].sfxSource);
} }
} }
player->unk_1D0 += 1; player->csState += 1;
if (gTeamShields[TEAM_ID_FALCO] > 0) { if (gTeamShields[TEAM_ID_FALCO] > 0) {
Katina_80196E30(&gActors[1], 0); Katina_80196E30(&gActors[1], 0);
} }
@ -1450,18 +1449,17 @@ void Katina_LevelComplete(Player* player) {
gCsCamAtX = boss->obj.pos.x; gCsCamAtX = boss->obj.pos.x;
gCsCamAtY = 1000.0f; gCsCamAtY = 1000.0f;
gCsCamAtZ = boss->obj.pos.z; gCsCamAtZ = boss->obj.pos.z;
Math_SmoothStepToF(&player->unk_0EC, Math_SmoothStepToF(&player->rot.z, Math_SmoothStepToAngle(&player->rot.y, 283.0f, 0.1f, 3.0f, 0.0f) * 20.0f,
Math_SmoothStepToAngle(&player->unk_0E8, 283.0f, 0.1f, 3.0f, 0.0f) * 20.0f, 0.1f, 1.0f, 0.1f, 1.0f, 0.0f);
0.0f);
for (i = 1; i < 4; i++) { for (i = 1; i < 4; i++) {
angle = Math_SmoothStepToAngle(&gActors[i].unk_0F4.y, gActors[i].fwork[1], 0.1f, 3.0f, 0.0f); 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); Math_SmoothStepToF(&gActors[i].unk_0F4.z, angle * 20.0f, 0.1f, 1.0f, 0.0f);
} }
if (gCsFrameCount >= 200) { if (gCsFrameCount >= 200) {
player->unk_0E4 += 1.0f; player->rot.x += 1.0f;
player->unk_0E8 += 1.0f; player->rot.y += 1.0f;
player->unk_0EC += 1.0f; player->rot.z += 1.0f;
} }
if (gCsFrameCount >= 225) { if (gCsFrameCount >= 225) {
@ -1479,25 +1477,25 @@ void Katina_LevelComplete(Player* player) {
} }
if (gCsFrameCount == 250) { if (gCsFrameCount == 250) {
player->unk_1D0 = 2; player->csState = 2;
Play_ClearObjectData(); Play_ClearObjectData();
Audio_StopPlayerNoise(0); Audio_StopPlayerNoise(0);
Audio_KillSfxBySource(&player->sfxSource[0]); Audio_KillSfxBySource(&player->sfxSource[0]);
player->timer_1F8 = 50; player->csTimer = 50;
player->baseSpeed = 0.0f; player->baseSpeed = 0.0f;
player->unk_0E4 = 0.0f; player->rot.x = 0.0f;
player->unk_0E8 = 0.0f; player->rot.y = 0.0f;
player->unk_0EC = 0.0f; player->rot.z = 0.0f;
} }
break; break;
case 2: case 2:
if (player->timer_1F8 == 0) { if (player->csTimer == 0) {
player->unk_240 = 1; player->unk_240 = 1;
player->pos.x = 0.0f; player->pos.x = 0.0f;
player->pos.y = 3500.0f; player->pos.y = 3500.0f;
player->pos.z = 150.0f; player->pos.z = 150.0f;
player->unk_1D0 = 3; player->csState = 3;
Audio_StartPlayerNoise(0); Audio_StartPlayerNoise(0);
if (gMissionStatus != MISSION_COMPLETE) { if (gMissionStatus != MISSION_COMPLETE) {
AUDIO_PLAY_BGM(SEQ_ID_GOOD_END); AUDIO_PLAY_BGM(SEQ_ID_GOOD_END);
@ -1530,12 +1528,12 @@ void Katina_LevelComplete(Player* player) {
gCsCamAtZ = player->pos.z + 500; gCsCamAtZ = player->pos.z + 500;
if (gCsFrameCount > 1010) { if (gCsFrameCount > 1010) {
player->baseSpeed += 2.0f; 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); Math_SmoothStepToF(&D_ctx_80177A48[2], 0.0f, 1.0f, 0.001f, 0);
player->unk_190 = 2.0f; player->unk_190 = 2.0f;
player->unk_25C += 0.04f; player->contrailScale += 0.04f;
if (player->unk_25C > 0.6f) { if (player->contrailScale > 0.6f) {
player->unk_25C = 0.6f; player->contrailScale = 0.6f;
} }
} else { } else {
Math_SmoothStepToF(&D_ctx_80177A48[2], 0.2f, 1.0f, 0.005f, 0); Math_SmoothStepToF(&D_ctx_80177A48[2], 0.2f, 1.0f, 0.005f, 0);
@ -1551,7 +1549,7 @@ void Katina_LevelComplete(Player* player) {
gFillScreenAlphaStep = 8; gFillScreenAlphaStep = 8;
if (gFillScreenAlpha == 255) { if (gFillScreenAlpha == 255) {
player->state_1C8 = PLAYERSTATE_1C8_NEXT; player->state_1C8 = PLAYERSTATE_1C8_NEXT;
player->timer_1F8 = 0; player->csTimer = 0;
gFadeoutType = 4; gFadeoutType = 4;
gLeveLClearStatus[LEVEL_KATINA] = Play_CheckMedalStatus(150) + 1; gLeveLClearStatus[LEVEL_KATINA] = Play_CheckMedalStatus(150) + 1;
} }
@ -1625,7 +1623,7 @@ void Katina_LevelComplete(Player* player) {
if (gTeamShields[TEAM_ID_PEPPY] > 0) { if (gTeamShields[TEAM_ID_PEPPY] > 0) {
Katina_80196F40(&gActors[4], 3); Katina_80196F40(&gActors[4], 3);
} }
player->unk_1D0 += 1; player->csState += 1;
break; break;
case 101: case 101:
@ -1639,8 +1637,8 @@ void Katina_LevelComplete(Player* player) {
gActors[4].unk_0F4.x += 0.08f; gActors[4].unk_0F4.x += 0.08f;
break; break;
} }
Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4) * M_DTOR), MTXF_APPLY); Matrix_RotateX(gCalcMatrix, -((player->xRot_120 + player->rot.x) * M_DTOR), MTXF_APPLY);
src.x = 0.0f; src.x = 0.0f;
src.y = 0.0f; src.y = 0.0f;
src.z = player->baseSpeed; src.z = player->baseSpeed;
@ -1651,9 +1649,9 @@ void Katina_LevelComplete(Player* player) {
player->pos.x += player->vel.x; player->pos.x += player->vel.x;
player->pos.y += player->vel.y; player->pos.y += player->vel.y;
player->pos.z += player->vel.z; player->pos.z += player->vel.z;
player->unk_0F8 = player->unk_0EC; player->bankAngle = player->rot.z;
player->unk_138 = player->pos.z; player->trueZpos = player->pos.z;
if (player->unk_1D0 < 100) { if (player->csState < 100) {
Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0); 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.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->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.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0);
Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, 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->bobPhase += 10.0f;
player->unk_080 = -SIN_DEG(player->unk_088) * 0.3f; player->yBob = -SIN_DEG(player->bobPhase) * 0.3f;
player->unk_0F4 += 8.0f; player->rockPhase += 8.0f;
player->unk_0F0 = SIN_DEG(player->unk_0F4); player->rockAngle = SIN_DEG(player->rockPhase);
} }
void Katina_80197F10(Actor* actor) { void Katina_80197F10(Actor* actor) {
@ -1764,7 +1762,7 @@ void Katina_801981F8(Actor* actor) {
actor_it->timer_0C2 = 30; actor_it->timer_0C2 = 30;
Object_SetInfo(&actor_it->info, actor_it->obj.id); Object_SetInfo(&actor_it->info, actor_it->obj.id);
if (actor_it->unk_0B6 == 1) { if (actor_it->unk_0B6 == 1) {
actor_it->info.unk_1C = 0.0f; actor_it->info.targetOffset = 0.0f;
actor_it->info.bonus = 0; actor_it->info.bonus = 0;
AUDIO_PLAY_SFX(0x3100000C, actor_it->sfxSource, 4); AUDIO_PLAY_SFX(0x3100000C, actor_it->sfxSource, 4);
} }
@ -1795,7 +1793,7 @@ void Katina_8019848C(void) {
actor->timer_0C2 = 30; actor->timer_0C2 = 30;
actor->obj.id = OBJ_ACTOR_ALLRANGE; actor->obj.id = OBJ_ACTOR_ALLRANGE;
Object_SetInfo(&actor->info, actor->obj.id); Object_SetInfo(&actor->info, actor->obj.id);
actor->info.unk_1C = 0.0f; actor->info.targetOffset = 0.0f;
actor->info.bonus = 0; actor->info.bonus = 0;
AUDIO_PLAY_SFX(0x3100000C, actor->sfxSource, 4); 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.x = actor->obj.pos.x;
radarMark->pos.y = actor->obj.pos.y; radarMark->pos.y = actor->obj.pos.y;
radarMark->pos.z = actor->obj.pos.z; 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) { if (actor->iwork[8] != 0) {
actor->iwork[8]--; actor->iwork[8]--;
} }

View File

@ -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))) { ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN))) {
gCsFrameCount = 0; gCsFrameCount = 0;
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE;
gPlayer[0].unk_1D0 = 1000; gPlayer[0].csState = 1000;
gActors[0].state = 6; gActors[0].state = 6;
gPlayer[0].timer_1F8 = 30; gPlayer[0].csTimer = 30;
AUDIO_PLAY_SFX(0x11030010, gActors[0].sfxSource, 0); AUDIO_PLAY_SFX(0x11030010, gActors[0].sfxSource, 0);
AUDIO_PLAY_SFX(0x31024059, gActors[0].sfxSource, 0); AUDIO_PLAY_SFX(0x31024059, gActors[0].sfxSource, 0);
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 1); 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)) { (fabsf(this->fwork[MISSILE_TARGET_Z] - this->obj.pos.z) < 800.0f)) {
SectorZ_80199900(this, 0); SectorZ_80199900(this, 0);
gCameraShake = 25; 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)) { 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].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE;
gPlayer[0].unk_1D0 = 0; gPlayer[0].csState = 0;
gActors[0].state = -31072; gActors[0].state = -31072;
return; 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_ACTIVE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_GFOX_REPAIR)) ||
(gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN))) { (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN))) {
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE;
gPlayer[0].unk_1D0 = 100; gPlayer[0].csState = 100;
gActors[0].state = -31072; gActors[0].state = -31072;
} }
} }
@ -245,7 +245,7 @@ void SectorZ_8019A1D0(void) {
Object_SetInfo(&actor->info, actor->obj.id); 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); AUDIO_PLAY_SFX(0x31000011, actor->sfxSource, 4);
} }
@ -453,10 +453,10 @@ void SectorZ_8019A3E8(Actor* actor) {
bool SectorZ_8019AA9C(Player* player) { bool SectorZ_8019AA9C(Player* player) {
if (player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) { 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) && 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->unk_138) < 172.0f)) { (fabsf(player->pos.y - 265.0f) < 100.0f) && (fabsf(player->trueZpos) < 172.0f)) {
player->state_1C8 = PLAYERSTATE_1C8_GFOX_REPAIR; player->state_1C8 = PLAYERSTATE_1C8_GFOX_REPAIR;
player->unk_1D0 = 0; player->csState = 0;
gActors[0].state = 20; gActors[0].state = 20;
gAllRangeEventTimer--; gAllRangeEventTimer--;
return true; return true;
@ -662,7 +662,7 @@ void SectorZ_8019B48C(void) {
for (i = 0; i < ARRAY_COUNT(D_i4_8019F528); i++, actor++) { for (i = 0; i < ARRAY_COUNT(D_i4_8019F528); i++, actor++) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_INIT; actor->obj.status = OBJ_INIT;
actor->obj.id = OBJ_ACTOR_195; actor->obj.id = OBJ_ACTOR_CUTSCENE;
actor->unk_0B6 = 25; actor->unk_0B6 = 25;
actor->obj.pos.x = D_i4_8019F528[i].x; actor->obj.pos.x = D_i4_8019F528[i].x;
actor->obj.pos.y = D_i4_8019F528[i].y; actor->obj.pos.y = D_i4_8019F528[i].y;
@ -678,7 +678,7 @@ void SectorZ_8019B568(void) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_INIT; 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.x = 5000.0f;
actor->obj.pos.y = 0.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) { void SectorZ_8019B630(Actor* actor, s32 index) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_ACTIVE; 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.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; 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_Initialize(actor);
actor->obj.status = OBJ_ACTIVE; 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.x = D_i4_8019F5BC[arg1].x + newActor->obj.pos.x;
actor->obj.pos.y = newActor->obj.pos.y - 500.0f; 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); AUDIO_PLAY_SFX(0x3100000C, actor->sfxSource, 4);
actor->info.hitbox = SEGMENTED_TO_VIRTUAL(gTeamHitbox); actor->info.hitbox = SEGMENTED_TO_VIRTUAL(gTeamHitbox);
actor->info.unk_16 = 0; 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; gAllRangeEventTimer = 0;
switch (player->unk_1D0) { switch (player->csState) {
case 0: case 0:
gCsFrameCount = 0; gCsFrameCount = 0;
player->unk_1D0++; player->csState++;
SectorZ_8019B568(); SectorZ_8019B568();
SectorZ_8019B48C(); SectorZ_8019B48C();
@ -819,7 +819,7 @@ void SectorZ_LevelStart(Player* player) {
if (gCsFrameCount == 320) { if (gCsFrameCount == 320) {
actor = &actor[0]; actor = &actor[0];
player->unk_1D0 = 2; player->csState = 2;
actor->vel.x = -10.0f; actor->vel.x = -10.0f;
actor->obj.pos.x = 1000.0f; actor->obj.pos.x = 1000.0f;
gCsCamEyeX = 0.0f; gCsCamEyeX = 0.0f;
@ -846,7 +846,7 @@ void SectorZ_LevelStart(Player* player) {
if (gCsFrameCount == 500) { if (gCsFrameCount == 500) {
gCsFrameCount = 520; gCsFrameCount = 520;
player->unk_1D0++; player->csState++;
actor->vel.x = 0.0f; actor->vel.x = 0.0f;
@ -910,7 +910,7 @@ void SectorZ_LevelStart(Player* player) {
gActors[32].vel.y += 0.4f; gActors[32].vel.y += 0.4f;
if (gCsFrameCount > 760) { if (gCsFrameCount > 760) {
player->unk_0E4 += 0.25f; player->rot.x += 0.25f;
} }
if (gCsFrameCount > 765) { if (gCsFrameCount > 765) {
@ -991,15 +991,15 @@ void SectorZ_LevelStart(Player* player) {
case 760: case 760:
player->unk_194 = 5.0f; player->unk_194 = 5.0f;
player->unk_190 = 5.0f; player->unk_190 = 5.0f;
player->unk_114 = 90.0f; player->yRot_114 = 90.0f;
player->baseSpeed = gArwingSpeed; player->baseSpeed = gArwingSpeed;
player->unk_234 = 1; player->unk_234 = 1;
AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0); AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0);
break; break;
} }
Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114 + 180.0f) * M_DTOR, MTXF_NEW); Matrix_RotateY(gCalcMatrix, (player->rot.y + player->yRot_114 + 180.0f) * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); Matrix_RotateX(gCalcMatrix, -(player->rot.x * M_DTOR), MTXF_APPLY);
sp74.x = 0.0f; sp74.x = 0.0f;
sp74.y = 0.0f; sp74.y = 0.0f;
@ -1015,8 +1015,8 @@ void SectorZ_LevelStart(Player* player) {
player->pos.y += player->vel.y; player->pos.y += player->vel.y;
player->pos.z += player->vel.z; 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); 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.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0);
@ -1041,14 +1041,14 @@ void SectorZ_8019C574(Actor* actor, s32 index) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_INIT; 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.x = D_i4_8019F61C[index] * var_fv0;
actor->obj.pos.y = D_i4_8019F62C[index]; actor->obj.pos.y = D_i4_8019F62C[index];
actor->obj.pos.z = D_i4_8019F63C[index]; actor->obj.pos.z = D_i4_8019F63C[index];
actor->fwork[0] = gPlayer[0].baseSpeed; 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); Object_SetInfo(&actor->info, actor->obj.id);
@ -1069,7 +1069,7 @@ void SectorZ_8019C70C(void) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_INIT; 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.x = gBosses[0].obj.pos.x + 700.0f;
actor->obj.pos.y = gBosses[0].obj.pos.y - 1000.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); Math_SmoothStepToF(&player->boostSpeed, 0.0f, 0.1f, 1.5f, 0.0f);
switch (player->unk_1D0) { switch (player->csState) {
case 1000: case 1000:
Math_SmoothStepToF(&player->unk_0E8, -40.0f, 0.1f, 2.5f, 0); Math_SmoothStepToF(&player->rot.y, -40.0f, 0.1f, 2.5f, 0);
Math_SmoothStepToF(&player->unk_0EC, -60.0f, 0.2f, 5.0f, 0); Math_SmoothStepToF(&player->rot.z, -60.0f, 0.2f, 5.0f, 0);
Math_SmoothStepToF(&player->unk_0E4, 0, 0.1f, 2.5f, 0); Math_SmoothStepToF(&player->rot.x, 0, 0.1f, 2.5f, 0);
if (player->timer_1F8 == 0) { if (player->csTimer == 0) {
player->unk_1D0 = 1001; player->csState = 1001;
player->timer_1F8 = 100; player->csTimer = 100;
AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0); AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0);
player->unk_194 = 5.0f; player->unk_194 = 5.0f;
player->unk_190 = 5.0f; player->unk_190 = 5.0f;
@ -1128,17 +1128,17 @@ void SectorZ_LevelComplete(Player* player) {
case 1001: case 1001:
player->unk_190 = 2.0f; player->unk_190 = 2.0f;
Math_SmoothStepToF(&player->unk_0E4, 15.0f, 0.1f, 0.4f, 0); Math_SmoothStepToF(&player->rot.x, 15.0f, 0.1f, 0.4f, 0);
Math_SmoothStepToF(&player->unk_0EC, 40.0f, 0.2f, 5.0f, 0); Math_SmoothStepToF(&player->rot.z, 40.0f, 0.2f, 5.0f, 0);
Math_SmoothStepToF(&player->unk_0E8, 120.0f, 0.1f, 2.0f, 0); Math_SmoothStepToF(&player->rot.y, 120.0f, 0.1f, 2.0f, 0);
player->baseSpeed += 1.0f; player->baseSpeed += 1.0f;
if (player->baseSpeed >= 70.0f) { if (player->baseSpeed >= 70.0f) {
player->baseSpeed = 70.0f; player->baseSpeed = 70.0f;
} }
if (player->timer_1F8 == 0) { if (player->csTimer == 0) {
gPlayer[0].unk_1D0 = 0; gPlayer[0].csState = 0;
} }
break; break;
@ -1159,7 +1159,7 @@ void SectorZ_LevelComplete(Player* player) {
player->camRoll = 0.0f; player->camRoll = 0.0f;
if (boss0->state != 0) { if (boss0->state != 0) {
player->unk_1D0 = 0; player->csState = 0;
} }
break; break;
@ -1174,11 +1174,11 @@ void SectorZ_LevelComplete(Player* player) {
D_ctx_80177A48[0] = 1.0f; D_ctx_80177A48[0] = 1.0f;
player->unk_1D0 = 1; player->csState = 1;
gProjectFar = 30000.0f; gProjectFar = 30000.0f;
player->timer_1F8 = 550; player->csTimer = 550;
player->baseSpeed = 0.0f; player->baseSpeed = 0.0f;
player->camRoll = 0.0f; player->camRoll = 0.0f;
@ -1220,8 +1220,8 @@ void SectorZ_LevelComplete(Player* player) {
gCsCamAtY = boss0->obj.pos.y + (2.0f * gCameraShakeY); gCsCamAtY = boss0->obj.pos.y + (2.0f * gCameraShakeY);
gCsCamAtZ = boss0->obj.pos.z; gCsCamAtZ = boss0->obj.pos.z;
if (player->timer_1F8 == 0) { if (player->csTimer == 0) {
player->unk_1D0 = 2; player->csState = 2;
} }
break; break;
@ -1229,7 +1229,7 @@ void SectorZ_LevelComplete(Player* player) {
gFillScreenAlphaTarget = 0; gFillScreenAlphaTarget = 0;
gFillScreenAlpha = 0; gFillScreenAlpha = 0;
if (player->timer_1F8 == 0) { if (player->csTimer == 0) {
if (!gGreatFoxIntact) { if (!gGreatFoxIntact) {
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 50); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 50);
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50);
@ -1237,8 +1237,8 @@ void SectorZ_LevelComplete(Player* player) {
gCsFrameCount = 1280; gCsFrameCount = 1280;
player->unk_1D0 = 10; player->csState = 10;
player->timer_1F8 = 1000; player->csTimer = 1000;
Audio_StopPlayerNoise(0U); Audio_StopPlayerNoise(0U);
Audio_KillSfxBySource(player->sfxSource); Audio_KillSfxBySource(player->sfxSource);
@ -1248,12 +1248,12 @@ void SectorZ_LevelComplete(Player* player) {
player->pos.y = 0.0f; player->pos.y = 0.0f;
player->pos.z = 0.0f; player->pos.z = 0.0f;
player->unk_0E4 = 0.0f; player->rot.x = 0.0f;
player->unk_234 = 1; player->unk_234 = 1;
player->unk_0E8 = 180.0f; player->rot.y = 180.0f;
player->unk_0EC = 0.0f; player->rot.z = 0.0f;
player->unk_114 = 0.0f; player->yRot_114 = 0.0f;
player->unk_4D8 = 0.0f; player->aerobaticPitch = 0.0f;
player->baseSpeed = 40.0f; player->baseSpeed = 40.0f;
gCsCamEyeX = 0.0f - (200.0f * var_fv1); gCsCamEyeX = 0.0f - (200.0f * var_fv1);
@ -1284,7 +1284,7 @@ void SectorZ_LevelComplete(Player* player) {
gCsCamAtZ = player->pos.z; gCsCamAtZ = player->pos.z;
if (gCsFrameCount == 1620) { if (gCsFrameCount == 1620) {
player->unk_1D0 += 1; player->csState += 1;
D_ctx_80177A48[0] = 0.0f; D_ctx_80177A48[0] = 0.0f;
D_ctx_80177A48[1] = 0.0f; D_ctx_80177A48[1] = 0.0f;
D_ctx_80177A48[2] = 0.0f; D_ctx_80177A48[2] = 0.0f;
@ -1325,7 +1325,7 @@ void SectorZ_LevelComplete(Player* player) {
if (gCsFrameCount > 2510) { if (gCsFrameCount > 2510) {
player->baseSpeed += 2.0f; player->baseSpeed += 2.0f;
player->unk_0E4 += 0.1f; player->rot.x += 0.1f;
player->unk_190 = 2.0f; player->unk_190 = 2.0f;
} }
@ -1351,7 +1351,7 @@ void SectorZ_LevelComplete(Player* player) {
gFillScreenAlphaStep = 8; gFillScreenAlphaStep = 8;
if (gFillScreenAlpha == 255) { if (gFillScreenAlpha == 255) {
player->state_1C8 = PLAYERSTATE_1C8_NEXT; player->state_1C8 = PLAYERSTATE_1C8_NEXT;
player->timer_1F8 = 0; player->csTimer = 0;
gFadeoutType = 4; gFadeoutType = 4;
gLeveLClearStatus[LEVEL_SECTOR_Z] = Play_CheckMedalStatus(100) + 1; gLeveLClearStatus[LEVEL_SECTOR_Z] = Play_CheckMedalStatus(100) + 1;
} }
@ -1524,8 +1524,8 @@ void SectorZ_LevelComplete(Player* player) {
break; break;
} }
Matrix_RotateY(gCalcMatrix, ((player->unk_114 + player->unk_0E8) + 180.0f) * M_DTOR, MTXF_NEW); Matrix_RotateY(gCalcMatrix, ((player->yRot_114 + player->rot.y) + 180.0f) * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -(((player->unk_120 + player->unk_0E4) + player->unk_4D8) * M_DTOR), MTXF_APPLY); Matrix_RotateX(gCalcMatrix, -(((player->xRot_120 + player->rot.x) + player->aerobaticPitch) * M_DTOR), MTXF_APPLY);
src.x = 0.0f; src.x = 0.0f;
src.y = 0.0f; src.y = 0.0f;
@ -1541,15 +1541,15 @@ void SectorZ_LevelComplete(Player* player) {
player->pos.y += player->vel.y; player->pos.y += player->vel.y;
player->pos.z += player->vel.z; 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->unk_130, 0.0f, 0.1f, 15.0f, 0.0f); Math_SmoothStepToF(&player->zRotBarrelRoll, 0.0f, 0.1f, 15.0f, 0.0f);
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(&player->camRoll, 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);
if (player->unk_1D0 >= 1000) { if (player->csState >= 1000) {
if (player->pos.y < 700.0f) { if (player->pos.y < 700.0f) {
Math_SmoothStepToF(&player->pos.y, 700.0f, 0.1f, 10.0f, 0.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); Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0.0f);
} }
player->unk_088 += 10.0f; player->bobPhase += 10.0f;
player->unk_080 = -SIN_DEG(player->unk_088) * 0.3f; player->yBob = -SIN_DEG(player->bobPhase) * 0.3f;
player->unk_0F4 += 8.0f; player->rockPhase += 8.0f;
player->unk_0F0 = SIN_DEG(player->unk_0F4); player->rockAngle = SIN_DEG(player->rockPhase);
} }
void SectorZ_8019DD20(Actor* actor) { 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.x += actor->unk_0F4.x;
actor->obj.rot.y += actor->unk_0F4.y; actor->obj.rot.y += actor->unk_0F4.y;
if (actor->unk_0D0 != 0) { if (actor->dmgType != 0) {
actor->timer_0C6 = 20; actor->timer_0C6 = 20;
actor->unk_0D0 = 0; actor->dmgType = 0;
actor->health -= actor->damage; actor->health -= actor->damage;
AUDIO_PLAY_SFX(0x2903300E, actor->sfxSource, 4); AUDIO_PLAY_SFX(0x2903300E, actor->sfxSource, 4);
if (actor->health <= 0) { if (actor->health <= 0) {
@ -1719,7 +1719,7 @@ void SectorZ_8019E454(Boss* boss) {
Vec3f src; Vec3f src;
Vec3f dest; Vec3f dest;
if (boss->dmgType == DMG_UNK_100) { if (boss->dmgType == DMG_zRot_0FC) {
boss->dmgType = 0; boss->dmgType = 0;
boss->timer_050 = 10; boss->timer_050 = 10;
boss->timer_052 = 60; boss->timer_052 = 60;

File diff suppressed because it is too large Load Diff

View File

@ -144,7 +144,7 @@ void Titania_801891F4(Actor* actor) {
f32 temp2; f32 temp2;
temp_fs0 = gPlayer[0].pos.x - actor->obj.pos.x; 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)); 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); 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; 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); 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)); 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); 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 */ /* fallthrough */
case 1: case 1:
actor->fwork[7] = 20.0f; 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->state = 2;
actor->timer_0BC = 30; actor->timer_0BC = 30;
} }
@ -245,7 +245,7 @@ void Titania_801895B8(Actor* actor) {
case 2: case 2:
if (actor->iwork[0] == 1) { if (actor->iwork[0] == 1) {
actor->fwork[7] = 5.0f; 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; actor->fwork[7] = 0.0f;
} }
Titania_801891F4(actor); Titania_801891F4(actor);
@ -253,14 +253,14 @@ void Titania_801895B8(Actor* actor) {
if (actor->timer_0BC == 0) { if (actor->timer_0BC == 0) {
actor->timer_0BC = 40; actor->timer_0BC = 40;
Titania_80189380(actor); 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; actor->fwork[6] = -10.0f;
} }
} }
break; 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; actor->obj.pos.y = sp3C;
if (actor->obj.rot.x < sp44 * M_RTOD) { 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_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW);
Matrix_Push(&gCalcMatrix); 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_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY);
Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, MTXF_APPLY); Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, MTXF_APPLY);
Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_i5_801B752C, &sp48); Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_i5_801B752C, &sp48);
@ -304,7 +304,7 @@ void Titania_801895B8(Actor* actor) {
actor->vel.y = sp48.y; actor->vel.y = sp48.y;
actor->vel.z = sp48.z; actor->vel.z = sp48.z;
if (actor->unk_0D0 > 0) { if (actor->dmgType > 0) {
if (Rand_ZeroOne() <= 0.25f) { if (Rand_ZeroOne() <= 0.25f) {
actor->itemDrop = DROP_SILVER_RING_50p; actor->itemDrop = DROP_SILVER_RING_50p;
} else { } else {
@ -331,7 +331,7 @@ static Vec3f D_i5_801B7544 = { 0.0f, -50.0f, 178.0f };
void Titania_80189B80(Actor* actor) { void Titania_80189B80(Actor* actor) {
f32 sp2C; 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->health = 10;
actor->info.hitbox = SEGMENTED_TO_VIRTUAL(D_TI_60068F0); actor->info.hitbox = SEGMENTED_TO_VIRTUAL(D_TI_60068F0);
Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW);
@ -353,15 +353,15 @@ void Titania_80189CC8(Actor* actor) {
f32 temp; f32 temp;
if (actor->health > 0) { if (actor->health > 0) {
if (actor->unk_0D0 != 0) { if (actor->dmgType != 0) {
actor->unk_0D0 = 0; actor->dmgType = 0;
actor->timer_0C6 = 15; actor->timer_0C6 = 15;
actor->health -= actor->damage; actor->health -= actor->damage;
if (actor->health <= 0) { if (actor->health <= 0) {
actor->health = 0; actor->health = 0;
AUDIO_PLAY_SFX(0x2903A008, actor->sfxSource, 4); AUDIO_PLAY_SFX(0x2903A008, actor->sfxSource, 4);
actor->lockOnTimers[TEAM_ID_FOX] = actor->itemDrop = 0; actor->lockOnTimers[TEAM_ID_FOX] = actor->itemDrop = 0;
actor->info.unk_1C = 0.0f; actor->info.targetOffset = 0.0f;
Actor_Despawn(actor); Actor_Despawn(actor);
actor->info.bonus = 0; actor->info.bonus = 0;
actor->info.hitbox = SEGMENTED_TO_VIRTUAL(D_TI_6006924); actor->info.hitbox = SEGMENTED_TO_VIRTUAL(D_TI_6006924);
@ -493,12 +493,12 @@ void Titania_8018A544(Actor* actor) {
actor->unk_0C9 = 1; 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); Object_Kill(&actor->obj, actor->sfxSource);
} }
if (actor->unk_0D0 != 0) { if (actor->dmgType != 0) {
actor->unk_0D0 = 0; actor->dmgType = 0;
actor->timer_0C6 = 15; actor->timer_0C6 = 15;
actor->health += actor->damage; actor->health += actor->damage;
if (actor->scale == 1.0f) { if (actor->scale == 1.0f) {
@ -530,7 +530,7 @@ void Titania_8018A544(Actor* actor) {
if (actor->unk_046 == 2) { if (actor->unk_046 == 2) {
actor->gravity = 0.0f; 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[0] = sp4C;
actor->fwork[1] = sp44; actor->fwork[1] = sp44;
actor->fwork[2] = sp48; actor->fwork[2] = sp48;
@ -538,7 +538,7 @@ void Titania_8018A544(Actor* actor) {
} }
actor->gravity = 3.0f; 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[0] = sp4C;
actor->fwork[1] = sp44; actor->fwork[1] = sp44;
actor->fwork[2] = sp48; actor->fwork[2] = sp48;
@ -608,7 +608,7 @@ void Titania_8018AB44(Actor* actor) {
switch (actor->state) { switch (actor->state) {
case 0: case 0:
actor->gravity = 1.0f; 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)) { if (actor->obj.pos.y <= (sp34 + 3.0f)) {
AUDIO_PLAY_SFX(0x19000024, actor->sfxSource, 4); AUDIO_PLAY_SFX(0x19000024, actor->sfxSource, 4);
actor->obj.pos.y = sp34 + 3.0f; actor->obj.pos.y = sp34 + 3.0f;
@ -624,7 +624,7 @@ void Titania_8018AB44(Actor* actor) {
break; break;
} }
switch (actor->unk_0D0) { switch (actor->dmgType) {
case 1: case 1:
AUDIO_PLAY_SFX(0x29022086, actor->sfxSource, 4); AUDIO_PLAY_SFX(0x29022086, actor->sfxSource, 4);
break; 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)); 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].vel.y = 20.0f;
gPlayer[0].pos.y += 15.0f; gPlayer[0].pos.y += 15.0f;
gPlayer[0].unk_1DC = 1; gPlayer[0].barrelRoll = 1;
gPlayer[0].timer_1E8 = 15; gPlayer[0].timer_1E8 = 15;
gPlayer[0].unk_1EC = 20; gPlayer[0].rollRate = 20;
if (actor->obj.pos.x < gPlayer[0].pos.x) { if (actor->obj.pos.x < gPlayer[0].pos.x) {
gPlayer[0].unk_1EC = -20; gPlayer[0].rollRate = -20;
} }
Object_Kill(&actor->obj, actor->sfxSource); Object_Kill(&actor->obj, actor->sfxSource);
break; break;
} }
actor->unk_0D0 = 0; actor->dmgType = 0;
} }
static Vec3f D_i5_801B75AC = { -70.0f, 50.0f, 212.0f }; 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.z = 0.0f;
actor->obj.rot.x = 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; actor->obj.pos.y = sp58;
@ -774,8 +774,8 @@ void Titania_8018B268(Actor* actor) {
Actor* sp3C = actor->iwork[0]; Actor* sp3C = actor->iwork[0];
Actor* sp38 = actor->iwork[1]; Actor* sp38 = actor->iwork[1];
if (actor->unk_0D0 > 0) { if (actor->dmgType > 0) {
actor->unk_0D0 = 0; actor->dmgType = 0;
if (actor->health > 0) { if (actor->health > 0) {
actor->health -= actor->damage; actor->health -= actor->damage;
if (actor->health <= 0) { if (actor->health <= 0) {
@ -867,7 +867,7 @@ void Titania_8018B268(Actor* actor) {
&gIdentityMatrix); &gIdentityMatrix);
func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 10.0f); func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 10.0f);
actor->lockOnTimers[TEAM_ID_FOX] = 0; 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) { void Titania_Actor231_Init(Actor* actor) {
f32 sp24; 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.rot.x = actor->obj.rot.y = actor->obj.rot.z = 0.0f;
actor->obj.pos.y -= 20.0f; actor->obj.pos.y -= 20.0f;
} }
@ -978,17 +978,17 @@ void Titania_8018B9D0(Actor* actor) {
Player_ApplyDamage(gPlayer, 0, 60); Player_ApplyDamage(gPlayer, 0, 60);
gPlayer[0].vel.y = 20.0f; gPlayer[0].vel.y = 20.0f;
gPlayer[0].pos.y += 15.0f; gPlayer[0].pos.y += 15.0f;
gPlayer[0].unk_1DC = 1; gPlayer[0].barrelRoll = 1;
gPlayer[0].timer_1E8 = 15; gPlayer[0].timer_1E8 = 15;
gPlayer[0].unk_1EC = 20; gPlayer[0].rollRate = 20;
if (actor->obj.pos.x < gPlayer[0].pos.x) { if (actor->obj.pos.x < gPlayer[0].pos.x) {
gPlayer[0].unk_1EC = -20; gPlayer[0].rollRate = -20;
} }
} }
break; break;
case 1: 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[0] = sp50;
actor->fwork[1] = sp4C; actor->fwork[1] = sp4C;
actor->fwork[2] = sp48; actor->fwork[2] = sp48;
@ -1018,11 +1018,11 @@ void Titania_8018B9D0(Actor* actor) {
actor->obj.rot.x = (var_fa0 / 130.0f) * 90.0f; 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); AUDIO_PLAY_SFX(0x19020008, actor->sfxSource, 4);
sp44 = actor->obj.pos.x - actor->hitPos.x; sp44 = actor->obj.pos.x - actor->hitPos.x;
sp40 = fabsf(sp44); sp40 = fabsf(sp44);
actor->unk_0D0 = 0; actor->dmgType = 0;
actor->state = 1; actor->state = 1;
actor->timer_0BC = 0; actor->timer_0BC = 0;
actor->timer_0BE = 0; actor->timer_0BE = 0;
@ -1282,11 +1282,11 @@ void Titania_8018C8A8(Actor* actor) {
s32 pad; s32 pad;
actor->iwork[7]++; 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) { if (actor->iwork[4] > 0) {
actor->iwork[4]--; 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; gControllerRumbleFlags[0] = 1;
actor->iwork[3]--; actor->iwork[3]--;
} }
@ -1299,8 +1299,8 @@ void Titania_8018C8A8(Actor* actor) {
actor->iwork[6]--; actor->iwork[6]--;
} }
if ((actor->health > 0) && (actor->unk_0D0 > 0) && (actor->unk_0D0 != 3) && (actor->state >= 3)) { if ((actor->health > 0) && (actor->dmgType > 0) && (actor->dmgType != 3) && (actor->state >= 3)) {
if ((actor->health > 0) && (actor->unk_0D2 >= 0) && (actor->unk_0D2 < 3)) { if ((actor->health > 0) && (actor->dmgPart >= 0) && (actor->dmgPart < 3)) {
actor->iwork[5] = 10; actor->iwork[5] = 10;
if (actor->state == 4) { if (actor->state == 4) {
Audio_KillSfxBySourceAndId(actor->sfxSource, 0x31030043); Audio_KillSfxBySourceAndId(actor->sfxSource, 0x31030043);
@ -1321,10 +1321,10 @@ void Titania_8018C8A8(Actor* actor) {
} else { } else {
AUDIO_PLAY_SFX(0x29034041, actor->sfxSource, 4); 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); func_effect_8007A6F0(&actor->obj.pos, 0x29121007);
} }
actor->unk_0D0 = 0; actor->dmgType = 0;
} }
switch (actor->state) { switch (actor->state) {
@ -1344,7 +1344,7 @@ void Titania_8018C8A8(Actor* actor) {
break; break;
case 1: 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[0] = sp9C;
actor->fwork[1] = spA0; actor->fwork[1] = spA0;
actor->fwork[2] = sp98; actor->fwork[2] = sp98;
@ -1445,7 +1445,7 @@ void Titania_8018C8A8(Actor* actor) {
break; break;
case 4: 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[0] = sp9C;
actor->fwork[1] = spA0; actor->fwork[1] = spA0;
actor->fwork[2] = sp98; actor->fwork[2] = sp98;
@ -1677,12 +1677,12 @@ void Titania_8018C8A8(Actor* actor) {
} }
if (actor->health > 0) { if (actor->health > 0) {
actor->info.unk_1C = actor->fwork[27]; actor->info.targetOffset = actor->fwork[27];
} else { } else {
actor->lockOnTimers[TEAM_ID_FOX] = 0; 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) { void Titania_8018E2D8(Actor* actor) {
@ -1712,7 +1712,7 @@ void Titania_8018E3CC(Actor* actor) {
Vec3f sp34; Vec3f sp34;
s32 i; 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; actor->obj.pos.y -= 20.0f;
actorPtr = gActors; actorPtr = gActors;
@ -1785,7 +1785,7 @@ void Titania_8018E5F8(Actor* actor) {
sp9C = gPlayer[0].pos.x - actor->obj.pos.x; sp9C = gPlayer[0].pos.x - actor->obj.pos.x;
spA0 = (gPlayer[0].pos.y - actor->obj.pos.y) - 30.0f; 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) { switch (actor->state) {
case 0: 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); func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 10.0f);
actor->timer_0BE = 10; 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)) { if (actor->obj.pos.y < (94.0f + sp7C)) {
spA4 = fabsf(spA4); spA4 = fabsf(spA4);
if (spA4 < 5000.0f) { if (spA4 < 5000.0f) {
@ -1851,7 +1851,7 @@ void Titania_8018E5F8(Actor* actor) {
case 4: case 4:
if (actor->iwork[7] > 0) { if (actor->iwork[7] > 0) {
actor->iwork[7]--; 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; gControllerRumbleFlags[0] = 1;
actor->iwork[8]--; actor->iwork[8]--;
} }
@ -1874,8 +1874,8 @@ void Titania_8018E5F8(Actor* actor) {
actor->fwork[3] = sp84.x; actor->fwork[3] = sp84.x;
actor->fwork[4] = sp84.y; actor->fwork[4] = sp84.y;
actor->fwork[5] = sp84.z; actor->fwork[5] = sp84.z;
if (actor->unk_0D0 > 0) { if (actor->dmgType > 0) {
actor->unk_0D0 = 0; actor->dmgType = 0;
actor->timer_0C6 = 10; actor->timer_0C6 = 10;
if (actor->health > 0) { if (actor->health > 0) {
actor->health -= actor->damage; 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); BonusText_Display(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + actor->fwork[27], 2);
gHitCount += 2; gHitCount += 2;
actor->lockOnTimers[TEAM_ID_FOX] = actor->health = actor->itemDrop = 0; 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_Despawn(actor);
actor->info.bonus = 0; actor->info.bonus = 0;
((Actor*) actor->iwork[4])->iwork[0] = 0; ((Actor*) actor->iwork[4])->iwork[0] = 0;
@ -1913,7 +1913,7 @@ void Titania_8018E5F8(Actor* actor) {
for (i = 0; i <= 3000; i += 50) { for (i = 0; i <= 3000; i += 50) {
sp5C = (sp68 * i) + sp40; sp5C = (sp68 * i) + sp40;
sp54 = (sp60 * i) + sp48; 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) { if ((sp64 * i) + sp44 < sp70) {
break; break;
} }
@ -1922,25 +1922,25 @@ void Titania_8018E5F8(Actor* actor) {
if (actor->iwork[2] == 0) { if (actor->iwork[2] == 0) {
index = actor->iwork[3] - 1; index = actor->iwork[3] - 1;
gTexturedLines[index].mode = 101; gTexturedLines[index].mode = 101;
gTexturedLines[index].unk_04.x = actor->obj.pos.x + actor->fwork[0]; gTexturedLines[index].posAA.x = actor->obj.pos.x + actor->fwork[0];
gTexturedLines[index].unk_04.y = actor->obj.pos.y + actor->fwork[1]; gTexturedLines[index].posAA.y = actor->obj.pos.y + actor->fwork[1];
gTexturedLines[index].unk_04.z = actor->obj.pos.z + actor->fwork[2]; gTexturedLines[index].posAA.z = actor->obj.pos.z + actor->fwork[2];
gTexturedLines[index].unk_2C = 255; gTexturedLines[index].red = 255;
gTexturedLines[index].unk_2D = 255; gTexturedLines[index].green = 255;
gTexturedLines[index].unk_2E = 0; gTexturedLines[index].blue = 0;
gTexturedLines[index].unk_2F = 255; gTexturedLines[index].alpha = 255;
gTexturedLines[index].unk_10.x = sp5C; gTexturedLines[index].posBB.x = sp5C;
gTexturedLines[index].unk_10.y = sp70; gTexturedLines[index].posBB.y = sp70;
gTexturedLines[index].unk_10.z = sp54; gTexturedLines[index].posBB.z = sp54;
gTexturedLines[index].unk_28 = 3.0f; gTexturedLines[index].xyScale = 3.0f;
if (actor->timer_0C0 == 0) { if (actor->timer_0C0 == 0) {
gTexturedLines[index].unk_2C = 255; gTexturedLines[index].red = 255;
gTexturedLines[index].unk_2D = 255; gTexturedLines[index].green = 255;
gTexturedLines[index].unk_2E = 64; gTexturedLines[index].blue = 64;
} else { } else {
gTexturedLines[index].unk_2C = 255; gTexturedLines[index].red = 255;
gTexturedLines[index].unk_2D = 100; gTexturedLines[index].green = 100;
gTexturedLines[index].unk_2E = 0; gTexturedLines[index].blue = 0;
} }
if (i <= 3000) { if (i <= 3000) {
if (actor->timer_0C0 == 0) { if (actor->timer_0C0 == 0) {
@ -1990,13 +1990,13 @@ void Titania_8018EFF0(Sprite* sprite) {
f32 sp24; f32 sp24;
f32 sp20; 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; sprite->obj.pos.y = sp24;
} }
void Titania_Cactus_Update(Sprite* sprite) { void Titania_Cactus_Update(Sprite* sprite) {
sprite->obj.rot.y = Math_Atan2F(gPlayer[0].cam.eye.x - sprite->obj.pos.x, 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; M_RTOD;
if (sprite->unk_46 != 0) { if (sprite->unk_46 != 0) {
func_effect_8007D074(sprite->obj.pos.x, sprite->obj.pos.y + 96.0f, sprite->obj.pos.z, 4.0f); 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)) { if ((limbIndex == 71) && (boss->fwork[0x2E] != 0.0f)) {
sp70.x = (gPlayer[0].pos.x - (boss->obj.pos.x + sp7C.x)) * boss->fwork[0x2E]; 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.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.y = Math_Atan2F(sp70.x, sp70.z) * M_RTOD;
sp5C.x = -Math_Atan2F(sp70.y, sqrtf(SQ(sp70.x) + SQ(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 { } else {
sp70.x = gPlayer[0].pos.x - (boss->obj.pos.x + sp7C.x); 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.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.y = Math_Atan2F(sp70.x, sp70.z) * M_RTOD;
sp5C.x = -Math_Atan2F(sp70.y, sqrtf(SQ(sp70.x) + SQ(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_A0002BC, 0, &D_i5_801BCDC8[8]);
Animation_GetFrameData(&D_TI_A000934, 0, &D_i5_801BC978[16]); Animation_GetFrameData(&D_TI_A000934, 0, &D_i5_801BC978[16]);
Animation_GetFrameData(&D_TI_A000934, 0, &D_i5_801BCDC8[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_19C = -1;
gPlayer[0].unk_000 = 0.0f; gPlayer[0].unk_000 = 0.0f;
boss->swork[1] = 2; 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->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.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]); Animation_GetFrameData(&D_TI_A000D50, D_i5_801BBEF0[24] >> 1, &D_i5_801BC978[16]);
switch (D_i5_801BBEF0[39]) { switch (D_i5_801BBEF0[39]) {
@ -4032,7 +4032,7 @@ void Titania_80193DF0(Boss* boss) {
actor->obj.pos.x = 0.0f; actor->obj.pos.x = 0.0f;
actor->obj.pos.y = 0.0f; actor->obj.pos.y = 0.0f;
actor->obj.pos.z = boss->obj.pos.z + 2000.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_046 = D_i5_801B7770[D_i5_801B8198[i].unk_00][5];
actor->unk_048 = D_i5_801B7770[D_i5_801B8198[i].unk_00][1]; 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; 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_801BBEF0[1] = 25;
D_i5_801BBEF4[0] = 0.25f; D_i5_801BBEF4[0] = 0.25f;
boss->obj.pos.x = gPlayer[0].pos.x; 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; boss->vel.z = 0.0f;
Animation_GetFrameData(&D_TI_900FC4C, 0, D_i5_801BCDC8); Animation_GetFrameData(&D_TI_900FC4C, 0, D_i5_801BCDC8);
D_i5_801BBEF4[8] = 48.0f; 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)) { if ((boss->unk_04C == 0) || (boss->unk_04C == 68) || (boss->unk_04C == 96) || (boss->unk_04C == 149)) {
AUDIO_PLAY_SFX(0x2900502A, boss->sfxSource, 4); 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) { if (temp_f < 0.0f) {
boss->obj.pos.z += temp_f; 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.pos.z = boss->obj.pos.z + spC8.z;
effect->obj.rot.y = boss->fwork[49] + -44.0f; effect->obj.rot.y = boss->fwork[49] + -44.0f;
effect->unk_44 = 53; effect->unk_44 = 53;
effect->info.unk_10 = 400.0f; effect->info.cullDistance = 400.0f;
effect->info.unk_14 = -1; effect->info.unk_14 = -1;
effect->unk_74 = D_TI2_7009A80; 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.pos.z = boss->obj.pos.z + spC8.z;
effect->obj.rot.y = boss->fwork[49] + 44.0f; effect->obj.rot.y = boss->fwork[49] + 44.0f;
effect->unk_44 = 53; effect->unk_44 = 53;
effect->info.unk_10 = 400.0f; effect->info.cullDistance = 400.0f;
effect->info.unk_14 = -1; effect->info.unk_14 = -1;
effect->unk_74 = D_TI2_7009A80; effect->unk_74 = D_TI2_7009A80;
} }
@ -4734,7 +4734,7 @@ void Titania_80197A94(Boss* boss) {
AUDIO_PLAY_SFX(0x29121007, boss->sfxSource, 4); AUDIO_PLAY_SFX(0x29121007, boss->sfxSource, 4);
boss->dmgType = DMG_NONE; 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; gControllerRumbleFlags[0] = 1;
boss->swork[39]--; boss->swork[39]--;
} }
@ -5134,22 +5134,22 @@ void Titania_801982A8(Boss* boss) {
spF4.y = D_i5_801B8E24[i][1] * boss->fwork[41]; spF4.y = D_i5_801B8E24[i][1] * boss->fwork[41];
spF4.z = boss->fwork[42]; spF4.z = boss->fwork[42];
Matrix_MultVec3f(gCalcMatrix, &spF4, &spE8); Matrix_MultVec3f(gCalcMatrix, &spF4, &spE8);
gTexturedLines[temp_v1_28].unk_04.x = temp_fs0; gTexturedLines[temp_v1_28].posAA.x = temp_fs0;
gTexturedLines[temp_v1_28].unk_04.y = temp_fs1; gTexturedLines[temp_v1_28].posAA.y = temp_fs1;
gTexturedLines[temp_v1_28].unk_04.z = temp_fs2; gTexturedLines[temp_v1_28].posAA.z = temp_fs2;
gTexturedLines[temp_v1_28].unk_10.x = temp_fs0 + spE8.x; gTexturedLines[temp_v1_28].posBB.x = temp_fs0 + spE8.x;
gTexturedLines[temp_v1_28].unk_10.y = temp_fs1 + spE8.y; gTexturedLines[temp_v1_28].posBB.y = temp_fs1 + spE8.y;
gTexturedLines[temp_v1_28].unk_10.z = temp_fs2 + spE8.z; gTexturedLines[temp_v1_28].posBB.z = temp_fs2 + spE8.z;
if (boss->swork[32] == 0) { if (boss->swork[32] == 0) {
gTexturedLines[temp_v1_28].mode = 0; gTexturedLines[temp_v1_28].mode = 0;
} else { } else {
gTexturedLines[temp_v1_28].mode = 1; gTexturedLines[temp_v1_28].mode = 1;
} }
gTexturedLines[temp_v1_28].unk_2C = 0; gTexturedLines[temp_v1_28].red = 0;
gTexturedLines[temp_v1_28].unk_2E = 0; gTexturedLines[temp_v1_28].blue = 0;
gTexturedLines[temp_v1_28].unk_2D = 0; gTexturedLines[temp_v1_28].green = 0;
gTexturedLines[temp_v1_28].unk_2F = 0; gTexturedLines[temp_v1_28].alpha = 0;
gTexturedLines[temp_v1_28].unk_28 = 1; gTexturedLines[temp_v1_28].xyScale = 1;
} }
} }
} }
@ -5234,7 +5234,7 @@ void Titania_801990DC(Boss* boss) {
actor->fwork[4] = -200.0f; actor->fwork[4] = -200.0f;
actor->obj.pos.x = gPlayer[0].pos.x; actor->obj.pos.x = gPlayer[0].pos.x;
actor->obj.pos.y = 500.0f; 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.y = (RAND_FLOAT(5.0f) + 90.0f) - 2.5f;
actor->obj.rot.z = (RAND_FLOAT(5.0f) + 180.0f) - 2.5f; actor->obj.rot.z = (RAND_FLOAT(5.0f) + 180.0f) - 2.5f;
actor->vel.y = -10.0f; actor->vel.y = -10.0f;
@ -5256,7 +5256,7 @@ void Titania_801990DC(Boss* boss) {
actor->fwork[5] = 200.0f; actor->fwork[5] = 200.0f;
actor->obj.pos.x = gPlayer[0].pos.x + actor->fwork[3]; actor->obj.pos.x = gPlayer[0].pos.x + actor->fwork[3];
actor->obj.pos.y = 500.0f; 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->obj.rot.z = 90.0f;
actor->vel.y = -10.0f; actor->vel.y = -10.0f;
actor->gravity = 0.8f; actor->gravity = 0.8f;
@ -5277,7 +5277,7 @@ void Titania_801990DC(Boss* boss) {
actor->fwork[5] = 200.0f; actor->fwork[5] = 200.0f;
actor->obj.pos.x = gPlayer[0].pos.x + actor->fwork[3]; actor->obj.pos.x = gPlayer[0].pos.x + actor->fwork[3];
actor->obj.pos.y = 500.0f; 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->obj.rot.z = 90.0f;
actor->vel.y = -10.0f; actor->vel.y = -10.0f;
actor->gravity = 0.8f; 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)) { if ((boss->timer_050 == 0) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE)) {
Object_Kill(&boss->obj, boss->sfxSource); Object_Kill(&boss->obj, boss->sfxSource);
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE;
gPlayer[0].unk_1D0 = 0; gPlayer[0].csState = 0;
} }
} }

View File

@ -11,7 +11,7 @@ f32 D_i5_801B7348[] = { 90.0f, -90.0f, 0.0f };
void Titania_80187530(Actor* actor) { void Titania_80187530(Actor* actor) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_INIT; 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.x = 0.0f;
actor->obj.pos.y = 3000.0f; actor->obj.pos.y = 3000.0f;
@ -26,7 +26,7 @@ void Titania_80187530(Actor* actor) {
void Titania_801875D0(Actor* actor, s32 arg1) { void Titania_801875D0(Actor* actor, s32 arg1) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_INIT; 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.x = D_i5_801B72A0[arg1].x;
actor->obj.pos.y = D_i5_801B72A0[arg1].y + 3000.0f; actor->obj.pos.y = D_i5_801B72A0[arg1].y + 3000.0f;
@ -46,11 +46,11 @@ void Titania_LevelStart(Player* player) {
sp64 = 20000.0f; sp64 = 20000.0f;
switch (player->unk_1D0) { switch (player->csState) {
case 0: case 0:
gCsFrameCount = 0; gCsFrameCount = 0;
gTiStartLandmaster = 1; gTiStartLandmaster = 1;
player->unk_0D4 = 0.0f; player->gravity = 0.0f;
Titania_80187530(&gActors[3]); Titania_80187530(&gActors[3]);
@ -75,7 +75,7 @@ void Titania_LevelStart(Player* player) {
player->cam.at.z = gCsCamAtZ = player->pos.z; player->cam.at.z = gCsCamAtZ = player->pos.z;
player->unk_240 = 1; player->unk_240 = 1;
player->unk_1D0 = 1; player->csState = 1;
gFogFar = 1006; gFogFar = 1006;
gPlayer[0].unk_19C = 0; gPlayer[0].unk_19C = 0;
gBgColor = 0x78C1; // 120, 24, 0 gBgColor = 0x78C1; // 120, 24, 0
@ -92,8 +92,8 @@ void Titania_LevelStart(Player* player) {
} }
if (gCsFrameCount == 430) { if (gCsFrameCount == 430) {
player->unk_1D0 = 2; player->csState = 2;
player->timer_1F8 = 10; player->csTimer = 10;
AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0); AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0);
} }
gCsCamAtX = player->pos.x; gCsCamAtX = player->pos.x;
@ -107,14 +107,14 @@ void Titania_LevelStart(Player* player) {
gCsCamAtY = player->pos.y; gCsCamAtY = player->pos.y;
gCsCamAtZ = player->pos.z; gCsCamAtZ = player->pos.z;
if (player->timer_1F8 == 1) { if (player->csTimer == 1) {
player->unk_0D4 = 1.0f; player->gravity = 1.0f;
D_ctx_80177A48[0] = 0.05f; D_ctx_80177A48[0] = 0.05f;
} }
if (player->timer_1F8 == 0) { if (player->csTimer == 0) {
if (player->unk_0D4 > -0.3f) { if (player->gravity > -0.3f) {
player->unk_0D4 = player->unk_0D4 - 0.05f; player->gravity = player->gravity - 0.05f;
} }
} }
@ -129,14 +129,14 @@ void Titania_LevelStart(Player* player) {
if (gCsFrameCount == 500) { if (gCsFrameCount == 500) {
gCsFrameCount = 480; gCsFrameCount = 480;
player->unk_1D0 = 3; player->csState = 3;
player->unk_144 = 200.0f; player->zPath = 200.0f;
D_ctx_80177D20 = 200.0f; gPathProgress = 200.0f;
D_ctx_80177CC8 = D_ctx_80177D20; gPathGroundScroll = gPathProgress;
player->pos.z = -(D_ctx_80177D20) -200.0f; player->pos.z = -(gPathProgress) -200.0f;
player->unk_0D4 = 0.0f; player->gravity = 0.0f;
player->vel.y = 0.0f; player->vel.y = 0.0f;
player->pos.y = 2000.0f; player->pos.y = 2000.0f;
player->vel.z = 0.0f; player->vel.z = 0.0f;
@ -173,7 +173,7 @@ void Titania_LevelStart(Player* player) {
gCsCamEyeY = sp48.y; gCsCamEyeY = sp48.y;
player->cam.eye.y = 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; break;
@ -189,12 +189,12 @@ void Titania_LevelStart(Player* player) {
gCsCamEyeX = sp48.x; gCsCamEyeX = sp48.x;
gCsCamEyeY = sp48.y; gCsCamEyeY = sp48.y;
gCsCamEyeZ = player->pos.z + player->unk_144 + sp48.z; gCsCamEyeZ = player->pos.z + player->zPath + sp48.z;
gCsCamAtX = player->pos.x; gCsCamAtX = player->pos.x;
player->cam.at.x = gCsCamAtX; player->cam.at.x = gCsCamAtX;
player->cam.at.y = gCsCamAtY = player->pos.y; 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); 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) { if (player->pos.y < 100.0f) {
func_effect_8007A900(RAND_FLOAT_CENTERED(30.0f) + player->pos.x, 30.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); 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) { if (gCsFrameCount == 580) {
gLevelStartStatusScreenTimer = 50; gLevelStartStatusScreenTimer = 50;
player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->state_1C8 = PLAYERSTATE_1C8_ACTIVE;
player->unk_1D0 = player->timer_1F8 = player->timer_1FC = player->unk_240 = 0; player->csState = player->csTimer = player->csEventTimer = player->unk_240 = 0;
player->unk_0D4 = 3.0f; player->gravity = 3.0f;
player->unk_014 = 0.0f; player->unk_014 = 0.0f;
D_ctx_8017782C = 1; D_ctx_8017782C = 1;
func_play_800A594C(); func_play_800A594C();
@ -235,9 +236,9 @@ void Titania_LevelStart(Player* player) {
} }
player->pos.y += player->vel.y; player->pos.y += player->vel.y;
player->vel.y -= player->unk_0D4; player->vel.y -= player->gravity;
player->pos.z += player->vel.z; 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.x, gCsCamEyeX, D_ctx_80177A48[0], sp64, 0.00f);
Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, 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->vel.z = player->vel.z;
actor->obj.status = OBJ_INIT; actor->obj.status = OBJ_INIT;
actor->obj.id = OBJ_ACTOR_195; actor->obj.id = OBJ_ACTOR_CUTSCENE;
actor->obj.rot.y = 180.0f; actor->obj.rot.y = 180.0f;
Object_SetInfo(&actor->info, actor->obj.id); Object_SetInfo(&actor->info, actor->obj.id);
@ -289,20 +290,20 @@ void Titania_LevelComplete(Player* player) {
Vec3f dest; Vec3f dest;
s32 i; s32 i;
switch (player->unk_1D0) { switch (player->csState) {
case 0: case 0:
gCsFrameCount = gBossActive = gLoadLevelObjects = 0; gCsFrameCount = gBossActive = gLoadLevelObjects = 0;
Play_ClearObjectData(); Play_ClearObjectData();
player->unk_1D0 = 1; player->csState = 1;
D_ctx_80177A48[0] = 0.0f; D_ctx_80177A48[0] = 0.0f;
D_ctx_80177A48[1] = 0.0f; D_ctx_80177A48[1] = 0.0f;
D_ctx_80177A48[2] = 0.0f; D_ctx_80177A48[2] = 0.0f;
D_ctx_80177A48[3] = 250.0f; D_ctx_80177A48[3] = 250.0f;
player->unk_0D4 = 3.0f; player->gravity = 3.0f;
Titania_80188108(&gActors[0], 0); Titania_80188108(&gActors[0], 0);
@ -318,7 +319,7 @@ void Titania_LevelComplete(Player* player) {
case 1: case 1:
Math_SmoothStepToF(D_ctx_80177A48, 0.1f, 1.0f, 0.01f, 0.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->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) { if (gCsFrameCount < 1120) {
Math_SmoothStepToF(&D_ctx_80177A48[1], 0.65f, 0.1f, 0.01f, 0.0f); 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; gCsCamEyeX = player->pos.x + dest.x;
gCsCamEyeY = player->pos.y + dest.y; 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) { if (gCsCamEyeY < 5.0f) {
gCsCamEyeY = 5.0f; gCsCamEyeY = 5.0f;
@ -347,7 +348,7 @@ void Titania_LevelComplete(Player* player) {
gCsCamAtX = player->pos.x; gCsCamAtX = player->pos.x;
gCsCamAtY = player->pos.y + 30.0f; 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_80045130(player);
func_tank_80044868(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); y = D_i5_801B72B8[i].y + RAND_FLOAT_CENTERED(10.0f);
z = D_i5_801B72B8[i].z; 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); RAND_FLOAT(0.5f) + 0.5f, 255, 21, 0);
} }
} }
@ -379,7 +380,7 @@ void Titania_LevelComplete(Player* player) {
gCsCamAtX = player->pos.x; gCsCamAtX = player->pos.x;
gCsCamAtY = player->pos.y + 30.0f; 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) { if (player->pos.y < 100.0f) {
camAtY = SIN_DEG(gGameFrameCount * 130.0f) * 3.0f; camAtY = SIN_DEG(gGameFrameCount * 130.0f) * 3.0f;
@ -390,13 +391,14 @@ void Titania_LevelComplete(Player* player) {
if (gCsFrameCount < 1470) { if (gCsFrameCount < 1470) {
func_effect_8007A900(RAND_FLOAT_CENTERED(30.0f) + (player->pos.x + 30.0f), 30.0f, 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, 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);
Math_SmoothStepToF(&player->unk_0F0, SIN_DEG(gGameFrameCount * 6.0f) * 18.0f, 0.1f, 100.0f, 0.0f); Math_SmoothStepToF(&player->rockAngle, 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); 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; 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.y += player->vel.y;
player->pos.z += player->vel.z; player->pos.z += player->vel.z;
player->unk_138 = player->pos.z; player->trueZpos = player->pos.z;
break; break;
} }
@ -491,7 +493,7 @@ void Titania_LevelComplete(Player* player) {
break; break;
case 1300: case 1300:
player->unk_1D0++; player->csState++;
D_ctx_80177A48[0] = 0.0f; D_ctx_80177A48[0] = 0.0f;
player->vel.z = 0.0f; player->vel.z = 0.0f;
player->vel.y = 0.0f; player->vel.y = 0.0f;

View File

@ -269,7 +269,7 @@ void Andross_801880E4(Actor* actor) {
actor->fwork[1] = 47.0f; actor->fwork[1] = 47.0f;
if ((fabsf(actor->obj.pos.x - gPlayer[0].pos.x) < 1000.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.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->iwork[11] = 2;
actor->fwork[1] = 65.0f; 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.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.y, 0.0f, 0.2f, 0.5f, 0.0f);
Math_SmoothStepToF(&actor->vel.z, 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); func_effect_8007A6F0(&actor->obj.pos, 0x2903A008);
Object_Kill(&actor->obj, actor->sfxSource); Object_Kill(&actor->obj, actor->sfxSource);
func_effect_8007B344(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 3.0f, 5); 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) { if ((actor->timer_0BC % 2U) == 1) {
func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 5.0f); 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, 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); actor->vel.z, 7.0f, 20);
func_effect_8007B344(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 10.0f, 5); 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->state = 12;
boss->timer_050 = 50; boss->timer_050 = 50;
boss->fwork[3] = gPlayer[0].pos.x; 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); AUDIO_PLAY_SFX(0x2940B096, boss->sfxSource, 4);
} }
} }
@ -517,14 +517,14 @@ void Andross_80188CB8(Boss* boss) {
for (i = 10; i < 12; i++) { for (i = 10; i < 12; i++) {
if ((gActors[i].obj.status == OBJ_ACTIVE) && (gActors[i].obj.id == OBJ_ACTOR_ALLRANGE)) { if ((gActors[i].obj.status == OBJ_ACTIVE) && (gActors[i].obj.id == OBJ_ACTOR_ALLRANGE)) {
gTexturedLines[i].mode = 50; gTexturedLines[i].mode = 50;
gTexturedLines[i].unk_28 = 1.0f; gTexturedLines[i].xyScale = 1.0f;
gTexturedLines[i].unk_04.x = boss->obj.pos.x; gTexturedLines[i].posAA.x = boss->obj.pos.x;
gTexturedLines[i].unk_04.y = boss->obj.pos.y - 200.0f; gTexturedLines[i].posAA.y = boss->obj.pos.y - 200.0f;
gTexturedLines[i].unk_04.z = boss->obj.pos.z; gTexturedLines[i].posAA.z = boss->obj.pos.z;
gTexturedLines[i].timer = 3; gTexturedLines[i].timer = 3;
gTexturedLines[i].unk_10.x = gActors[i].obj.pos.x; gTexturedLines[i].posBB.x = gActors[i].obj.pos.x;
gTexturedLines[i].unk_10.y = gActors[i].obj.pos.y; gTexturedLines[i].posBB.y = gActors[i].obj.pos.y;
gTexturedLines[i].unk_10.z = gActors[i].obj.pos.z; gTexturedLines[i].posBB.z = gActors[i].obj.pos.z;
boss->swork[4] = 1; boss->swork[4] = 1;
} }
} }
@ -586,17 +586,17 @@ void Andross_80189214(void) {
PRINTF("FO_Game_Sw %d\n"); PRINTF("FO_Game_Sw %d\n");
player->cam.at.x = 0.0f; player->cam.at.x = 0.0f;
player->cam.at.y = 0.0f; player->cam.at.y = 0.0f;
player->unk_114 = 0.0f; player->yRot_114 = 0.0f;
player->unk_144 = 0.0f; player->zPath = 0.0f;
D_ctx_80177D20 = 0.0f; gPathProgress = 0.0f;
player->unk_018 = player->unk_014 = 1.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); func_play_800B56BC(player);
} }
void Andross_8018933C(Actor* actor) { void Andross_8018933C(Actor* actor) {
if ((fabsf(actor->obj.pos.x - gPlayer[0].pos.x) < 1000.0f) && 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; gStartAndrossFightTimer = 50;
Object_Kill(&actor->obj, actor->sfxSource); 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) && 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.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; D_ctx_80177AB0 = 7;
Radio_PlayMessage(gMsg_ID_19370, RCID_JAMES); Radio_PlayMessage(gMsg_ID_19370, RCID_JAMES);
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 20); 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) && 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_KillSfxById(0x11403076);
Audio_SetEnvSfxReverb(0); Audio_SetEnvSfxReverb(0);
gCurrentLevel = LEVEL_VENOM_2; gCurrentLevel = LEVEL_VENOM_2;
gLevelPhase = 1; gLevelPhase = 1;
gVenomHardClear = 1; gVenomHardClear = 1;
player->state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; player->state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE;
player->unk_1D0 = 3; player->csState = 3;
player->unk_144 = D_ctx_80177D20 = 0.0f; player->zPath = gPathProgress = 0.0f;
D_ctx_80177AB0 = D_ctx_80177A98 = 1; D_ctx_80177AB0 = D_ctx_80177A98 = 1;
player->cam.eye.x = 1200.0f; player->cam.eye.x = 1200.0f;
player->cam.eye.z = 1200.0f; player->cam.eye.z = 1200.0f;
@ -667,7 +667,7 @@ void Andross_80189470(Actor* actor) {
func_play_800A594C(); func_play_800A594C();
gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0; gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0;
gFillScreenAlpha = gFillScreenAlphaTarget = 255; gFillScreenAlpha = gFillScreenAlphaTarget = 255;
player->timer_1F8 = 2; player->csTimer = 2;
gCsFrameCount = 0; gCsFrameCount = 0;
D_ctx_80177A48[1] = 0.0f; D_ctx_80177A48[1] = 0.0f;
} }
@ -680,7 +680,7 @@ void Andross_80189724(Actor* actor) {
Vec3f vel; Vec3f vel;
if ((fabsf(actor->obj.pos.x - gPlayer[0].pos.x) < 2000.0f) && 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); Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW);
vec.x = 0.0f; vec.x = 0.0f;
vec.y = 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) && 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)) { if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE || gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) {
gPlayer[0].shields = 0; gPlayer[0].shields = 0;
gRightWingHealth[0] = gLeftWingHealth[0] = 0; gRightWingHealth[0] = gLeftWingHealth[0] = 0;
Player_ApplyDamage(&gPlayer[0], 1, 60); Player_ApplyDamage(&gPlayer[0], 1, 60);
Player_ApplyDamage(&gPlayer[0], 2, 60); Player_ApplyDamage(&gPlayer[0], 2, 60);
actor->timer_0BC = 10; actor->timer_0BC = 10;
gPlayer[0].timer_220 = 200; gPlayer[0].radioDamageTimer = 200;
} }
} }
if (actor->timer_0BC == 1) { 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) && 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.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->state = 11;
boss->timer_050 = 150; boss->timer_050 = 150;
AUDIO_PLAY_SFX(0x31408097, boss->sfxSource, 4); AUDIO_PLAY_SFX(0x31408097, boss->sfxSource, 4);
@ -807,7 +807,7 @@ void Andross_80189B70(Boss* boss) {
boss->swork[5] = 100; boss->swork[5] = 100;
if (boss->timer_050 == 0) { if (boss->timer_050 == 0) {
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_START_360; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_START_360;
gPlayer[0].unk_1D0 = 0; gPlayer[0].csState = 0;
boss->state = 1; boss->state = 1;
gPlayer[0].unk_240 = 1; gPlayer[0].unk_240 = 1;
} }
@ -840,7 +840,7 @@ void Andross_80189B70(Boss* boss) {
gFillScreenAlphaTarget = 80; gFillScreenAlphaTarget = 80;
gFillScreenAlphaStep = 1; gFillScreenAlphaStep = 1;
gPlayer[0].timer_224 = gGameFrameCount % 8U; 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); 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)) { if (((gGameFrameCount % 32) == 0) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE)) {
Player_ApplyDamage(&gPlayer[0], 3, 10); Player_ApplyDamage(&gPlayer[0], 3, 10);
@ -880,7 +880,7 @@ void Andross_80189B70(Boss* boss) {
boss->fwork[2] = 1.3f; boss->fwork[2] = 1.3f;
boss->fwork[3] = gPlayer[0].pos.x; boss->fwork[3] = gPlayer[0].pos.x;
boss->fwork[4] = gPlayer[0].pos.y; boss->fwork[4] = gPlayer[0].pos.y;
boss->fwork[5] = gPlayer[0].unk_138; boss->fwork[5] = gPlayer[0].trueZpos;
break; break;
case 12: case 12:
boss->info.hitbox = SEGMENTED_TO_VIRTUAL(&gNoHitbox); boss->info.hitbox = SEGMENTED_TO_VIRTUAL(&gNoHitbox);
@ -981,7 +981,7 @@ void Andross_80189B70(Boss* boss) {
case 30: case 30:
gRadioState = 0; gRadioState = 0;
Radio_PlayMessage(gMsg_ID_20318, RCID_FOX); Radio_PlayMessage(gMsg_ID_20318, RCID_FOX);
gPlayer[0].timer_220 = 200; gPlayer[0].radioDamageTimer = 200;
break; break;
case 350: case 350:
Radio_PlayMessage(gMsg_ID_19468, RCID_JAMES); 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.x = -25995.0f;
gPlayer[0].pos.y = 300.0f; gPlayer[0].pos.y = 300.0f;
gPlayer[0].pos.z = -11140.0f; gPlayer[0].pos.z = -11140.0f;
gPlayer[0].unk_08C = 0.0f; gPlayer[0].camDist = 0.0f;
gPlayer[0].unk_114 = 271.0f; gPlayer[0].yRot_114 = 271.0f;
gPlayer[0].boostSpeed = gPlayer[0].unk_4D8 = gPlayer[0].unk_0E8 = gPlayer[0].unk_0E4 = gPlayer[0].boostSpeed = gPlayer[0].aerobaticPitch = gPlayer[0].rot.y = gPlayer[0].rot.x =
gPlayer[0].unk_0EC = 0.0f; gPlayer[0].rot.z = 0.0f;
gPlayer[0].unk_12C = 150.0f; gPlayer[0].zRotBank = 150.0f;
gPlayer[0].camRoll = -90.0f; gPlayer[0].camRoll = -90.0f;
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE;
gPlayer[0].unk_1D0 = 100; gPlayer[0].csState = 100;
gPlayer[0].timer_1F8 = 240; gPlayer[0].csTimer = 240;
gPlayer[0].unk_234 = 1; gPlayer[0].unk_234 = 1;
D_ctx_80177A48[5] = -1200.0f; D_ctx_80177A48[5] = -1200.0f;
@ -1044,12 +1044,12 @@ void Andross_80189B70(Boss* boss) {
boss->obj.pos.y = 10000.0f; boss->obj.pos.y = 10000.0f;
if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && ((gGameFrameCount % 4) == 0)) { 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.x = RAND_FLOAT_CENTERED(800.0f);
vec.y = 600.0f; vec.y = 600.0f;
vec.z = RAND_FLOAT(1000.0f) + -3000.0f; vec.z = RAND_FLOAT(1000.0f) + -3000.0f;
Matrix_MultVec3fNoTranslate(gCalcMatrix, &vec, &sp64); 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) { if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_STANDBY) {
Matrix_RotateY(gCalcMatrix, -gPlayer[0].camYaw, MTXF_NEW); Matrix_RotateY(gCalcMatrix, -gPlayer[0].camYaw, MTXF_NEW);
@ -1104,17 +1104,17 @@ void Andross_80189B70(Boss* boss) {
Matrix_MultVec3fNoTranslate(gCalcMatrix, &vec, &sp64); Matrix_MultVec3fNoTranslate(gCalcMatrix, &vec, &sp64);
boss->vel.x = sp64.x; boss->vel.x = sp64.x;
boss->vel.y = sp64.y; boss->vel.y = sp64.y;
boss->vel.z = sp64.z - D_ctx_80177D08; boss->vel.z = sp64.z - gPathVelZ;
if (boss->state < 20) { if (boss->state < 20) {
gRadarMarks[59].status = 1; gRadarMarks[59].status = 1;
gRadarMarks[59].type = 102; gRadarMarks[59].type = 102;
gRadarMarks[59].pos.x = boss->obj.pos.x; gRadarMarks[59].pos.x = boss->obj.pos.x;
gRadarMarks[59].pos.y = boss->obj.pos.y; gRadarMarks[59].pos.y = boss->obj.pos.y;
gRadarMarks[59].pos.z = boss->obj.pos.z; 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[10].info.targetOffset = 1.0f;
gActors[11].info.unk_1C = 1.0f; gActors[11].info.targetOffset = 1.0f;
if (boss->swork[5] != 0) { if (boss->swork[5] != 0) {
boss->swork[5]--; boss->swork[5]--;
if (boss->swork[5] == 0) { 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].obj.pos.z = boss->obj.pos.z + 200.0f;
gActors[10].state = 0; gActors[10].state = 0;
gActors[10].timer_0C2 = 20; 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.x = boss->obj.pos.x - 200.0f;
gActors[11].obj.pos.y = boss->obj.pos.y - 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].obj.pos.z = boss->obj.pos.z + 200.0f;
gActors[11].state = 0; gActors[11].state = 0;
gActors[11].timer_0C2 = 20; 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[21], boss->fwork[22], 1.0f, 6.0f, 0);
Math_SmoothStepToF(&boss->fwork[23], boss->fwork[24], 0.3f, 0.01f, 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) { void Andross_8018C390(Player* player) {
player->boostCooldown = 1; player->boostCooldown = 1;
player->unk_280 = 0; player->barrelRollAlpha = 0;
switch (player->unk_1D0) { switch (player->csState) {
case 2: case 2:
case 3: case 3:
break; 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.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.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); 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.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.x, 0.0f, 0.05f, 10.0f, 0);
Math_SmoothStepToF(&player->cam.eye.y, 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); Math_SmoothStepToF(&player->cam.at.z, 100.0f, 0.05f, 10.0f, 0.0f);
break; break;
case 1: case 1:
player->unk_0E4 += 15.0f; player->rot.x += 15.0f;
if (player->unk_0E4 > 180.0f) { if (player->rot.x > 180.0f) {
player->unk_0E4 -= 360.0f; player->rot.x -= 360.0f;
} }
player->unk_0E8 += 9.0f; player->rot.y += 9.0f;
if (player->unk_0E8 > 180.0f) { if (player->rot.y > 180.0f) {
player->unk_0E8 -= 360.0f; player->rot.y -= 360.0f;
} }
Math_SmoothStepToF(&player->cam.eye.z, 400.0f, 0.05f, 20.0f, 0.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) { 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->state_1C8 = PLAYERSTATE_1C8_ACTIVE;
player->unk_014 = 0.0f; player->unk_014 = 0.0f;
player->unk_018 = 0.0f; player->unk_018 = 0.0f;
} }
break; break;
} }
player->unk_138 = player->pos.z + player->unk_08C; player->trueZpos = player->pos.z + player->camDist;
func_play_800A46A0(player); 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.x = RAND_FLOAT(10.0f) + 10.0f;
effect->unk_60.y = RAND_FLOAT(10.0f) + 10.0f; effect->unk_60.y = RAND_FLOAT(10.0f) + 10.0f;
Object_SetInfo(&effect->info, effect->obj.id); 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) { 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); effect->unk_60.z = RAND_FLOAT_CENTERED(20.0f);
Object_SetInfo(&effect->info, effect->obj.id); Object_SetInfo(&effect->info, effect->obj.id);
effect->info.unk_14 = 1; 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) { 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); Matrix_MultVec3f(gCalcMatrix, &vec, &vel);
effect->vel.x = vel.x; effect->vel.x = vel.x;
effect->vel.y = vel.y; 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) && 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)) { (fabsf(effect->obj.pos.z - (gBosses[0].obj.pos.z - 100.0f)) <= 100.0f)) {
Object_Kill(&effect->obj, effect->sfxSource); Object_Kill(&effect->obj, effect->sfxSource);
} }
} else { } 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.x, 0.0f, 0.05f, 1.0f, 0);
Math_SmoothStepToF(&effect->vel.y, 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); 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->state = 31;
boss->timer_050 = 200; boss->timer_050 = 200;
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE;
gPlayer[0].unk_1D0 = 0; gPlayer[0].csState = 0;
} else if (boss->health < 50) { } else if (boss->health < 50) {
AUDIO_PLAY_SFX(0x2943500F, boss->sfxSource, 4); AUDIO_PLAY_SFX(0x2943500F, boss->sfxSource, 4);
} else { } else {
@ -1840,7 +1840,7 @@ void Andross_8018DBF0(Boss* boss) {
if (player->unk_234 != 0) { if (player->unk_234 != 0) {
xDisplacement = gPlayer[0].pos.x - boss->vwork[2].x; xDisplacement = gPlayer[0].pos.x - boss->vwork[2].x;
yDisplacement = gPlayer[0].pos.y - boss->vwork[2].y; 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)); yaw = Math_RadToDeg(Math_Atan2F(xDisplacement, zDisplacement));
pitch = Math_RadToDeg(Math_Atan2F(yDisplacement, sqrtf(SQ(xDisplacement) + SQ(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) { if (player->unk_234 != 0) {
xDisplacement = gPlayer[0].pos.x - boss->vwork[3].x; xDisplacement = gPlayer[0].pos.x - boss->vwork[3].x;
yDisplacement = gPlayer[0].pos.y - boss->vwork[3].y; 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)); yaw = Math_RadToDeg(Math_Atan2F(xDisplacement, zDisplacement));
pitch = Math_RadToDeg(Math_Atan2F(yDisplacement, sqrtf(SQ(xDisplacement) + SQ(zDisplacement)))); pitch = Math_RadToDeg(Math_Atan2F(yDisplacement, sqrtf(SQ(xDisplacement) + SQ(zDisplacement))));
if ((yaw > 30.0f) && (yaw < 180.0f)) { 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)) { if ((boss->unk_04C == 13) && (player->state_1C8 == PLAYERSTATE_1C8_ANDROSS_MOUTH)) {
player->unk_234 = 1; player->unk_234 = 1;
player->unk_1D0 = 1; player->csState = 1;
player->timer_1F8 = 60; player->csTimer = 60;
player->timer_498 = 50; player->timer_498 = 50;
boss->swork[8] = 0; boss->swork[8] = 0;
gControllerRumbleTimers[0] = 30; gControllerRumbleTimers[0] = 30;
@ -2371,7 +2371,7 @@ void Andross_8018DBF0(Boss* boss) {
if ((boss->timer_050 > 70) && (boss->timer_050 < 1000) && ((gGameFrameCount % 4) == 0)) { if ((boss->timer_050 > 70) && (boss->timer_050 < 1000) && ((gGameFrameCount % 4) == 0)) {
Andross_8018C734(gPlayer[0].cam.eye.x + RAND_FLOAT_CENTERED(3000.0f), 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.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) { if (boss->timer_050 > 0) {
playerShot = gPlayerShots; 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.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(&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); 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->state = 15;
boss->swork[8] = 1; boss->swork[8] = 1;
boss->fwork[9] = 0.2f; boss->fwork[9] = 0.2f;
boss->unk_04C = 0; boss->unk_04C = 0;
if (player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) { if (player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) {
player->state_1C8 = PLAYERSTATE_1C8_ANDROSS_MOUTH; player->state_1C8 = PLAYERSTATE_1C8_ANDROSS_MOUTH;
player->unk_1D0 = 0; player->csState = 0;
} }
break; break;
} }
@ -3139,7 +3139,7 @@ void Andross_801928C8(Boss* boss) {
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
if (boss->fwork[20] > 0.05f) { 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); MTXF_APPLY);
if (boss->fwork[21] > 0.05f) { if (boss->fwork[21] > 0.05f) {
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
@ -3221,13 +3221,13 @@ void Andross_80192E94(Actor* actor) {
actor->timer_0BC = 5; actor->timer_0BC = 5;
otherActor->timer_0BC = 5; otherActor->timer_0BC = 5;
gTexturedLines[actor->index].mode = 50; gTexturedLines[actor->index].mode = 50;
gTexturedLines[actor->index].unk_28 = 1.0f; gTexturedLines[actor->index].xyScale = 1.0f;
gTexturedLines[actor->index].unk_04.x = actor->obj.pos.x; gTexturedLines[actor->index].posAA.x = actor->obj.pos.x;
gTexturedLines[actor->index].unk_04.y = actor->obj.pos.y; gTexturedLines[actor->index].posAA.y = actor->obj.pos.y;
gTexturedLines[actor->index].unk_04.z = actor->obj.pos.z; gTexturedLines[actor->index].posAA.z = actor->obj.pos.z;
gTexturedLines[actor->index].unk_10.x = otherActor->obj.pos.x; gTexturedLines[actor->index].posBB.x = otherActor->obj.pos.x;
gTexturedLines[actor->index].unk_10.y = otherActor->obj.pos.y; gTexturedLines[actor->index].posBB.y = otherActor->obj.pos.y;
gTexturedLines[actor->index].unk_10.z = otherActor->obj.pos.z; gTexturedLines[actor->index].posBB.z = otherActor->obj.pos.z;
gTexturedLines[actor->index].timer = 3; gTexturedLines[actor->index].timer = 3;
break; break;
} }
@ -3241,8 +3241,8 @@ void Andross_80192E94(Actor* actor) {
break; break;
} }
if (actor->unk_0D0 != 0) { if (actor->dmgType != 0) {
actor->unk_0D0 = 0; actor->dmgType = 0;
actor->health -= actor->damage; actor->health -= actor->damage;
if (actor->health <= 0) { if (actor->health <= 0) {
func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 5.0f); 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) { switch (scenery->state) {
case 0: 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->state = 1;
scenery->info.hitbox = SEGMENTED_TO_VIRTUAL(D_ANDROSS_C038AC4); 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; scenery->unk_60 = -40.0f;
Object_SetInfo(&scenery->info, scenery->obj.id); Object_SetInfo(&scenery->info, scenery->obj.id);
scenery->timer_4C = (arg4 * 50) + 100; scenery->timer_4C = (arg4 * 50) + 100;
scenery->info.unk_10 = 100000.0f; scenery->info.cullDistance = 100000.0f;
} }
void Andross_80193710(void) { void Andross_80193710(void) {
@ -3410,7 +3410,7 @@ void Andross_801939A0(s32 actorIndex) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_ACTIVE; 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.x = 0.0f;
actor->obj.pos.y = gPlayer[0].cam.at.y; actor->obj.pos.y = gPlayer[0].cam.at.y;
actor->obj.pos.z = 0.0f; actor->obj.pos.z = 0.0f;
@ -3443,7 +3443,7 @@ void Andross_80193AE4(s32 actorIndex) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_ACTIVE; 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.x = D_i6_801A6878[actorIndex].x;
actor->obj.pos.y = D_i6_801A6878[actorIndex].y; actor->obj.pos.y = D_i6_801A6878[actorIndex].y;
actor->obj.pos.z = D_i6_801A6878[actorIndex].z; 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); 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; 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: case 0:
gCsFrameCount = 0; gCsFrameCount = 0;
player->wings.modelId = 1; player->wings.modelId = 1;
D_ctx_80177A48[0] = 0.0f; D_ctx_80177A48[0] = 0.0f;
if (player->unk_4D8 > 180.0f) { if (player->aerobaticPitch > 180.0f) {
player->unk_4D8 -= 360.0f; player->aerobaticPitch -= 360.0f;
} }
player->unk_1D0++; player->csState++;
player->timer_1F8 = 50; player->csTimer = 50;
player->vel.z = -40.0f; player->vel.z = -40.0f;
/* fallthrough */ /* fallthrough */
case 1: 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(&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.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->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.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); Math_SmoothStepToF(&player->cam.eye.y, player->pos.y + 30.0f, 0.1f, 15.0f, 0.0f);
if (player->timer_1F8 == 0) { if (player->csTimer == 0) {
player->pos.y += SIN_DEG(player->unk_0E4) * 15.0f; player->pos.y += SIN_DEG(player->rot.x) * 15.0f;
Math_SmoothStepToF(&player->unk_0E4, 180.0f, 0.1f, 5.0f, 0.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); Math_SmoothStepToF(&player->vel.z, 40.0f, 1.0f, 2.0f, 0.0f);
} else { } else {
Math_SmoothStepToF(&player->unk_08C, 0.0f, 1.0f, 5.0f, 0.0f); Math_SmoothStepToF(&player->camDist, 0.0f, 1.0f, 5.0f, 0.0f);
Math_SmoothStepToF(&player->unk_0E4, 0.0f, 0.1f, 10.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; player->cam.eye.z += player->vel.z * 0.5f;
switch (gCsFrameCount) { switch (gCsFrameCount) {
@ -3529,7 +3529,7 @@ void Andross_80193C4C(Player* player) {
D_ctx_80177AB0 = 0; D_ctx_80177AB0 = 0;
break; break;
case 111: case 111:
player->unk_1D0 = 2; player->csState = 2;
AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0); AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0);
player->unk_190 = player->unk_194 = 7.0f; player->unk_190 = player->unk_194 = 7.0f;
D_ctx_80177A48[0] = 0.0f; D_ctx_80177A48[0] = 0.0f;
@ -3543,7 +3543,7 @@ void Andross_80193C4C(Player* player) {
} }
gCsCamAtX = gBosses[0].obj.pos.x; gCsCamAtX = gBosses[0].obj.pos.x;
gCsCamAtY = gBosses[0].obj.pos.y; 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); Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 3.0f, 0.0f);
break; break;
case 2: 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); 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]; player->cam.eye.z += player->vel.z * D_ctx_80177A48[2];
if (gCsFrameCount > 230) { if (gCsFrameCount > 230) {
player->unk_08C -= 7.0f; player->camDist -= 7.0f;
} }
if (gCsFrameCount > 230) { if (gCsFrameCount > 230) {
Math_SmoothStepToF(&D_ctx_80177A48[7], 3.0f, 1.0f, 0.1f, 0.0f); 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.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->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); Math_SmoothStepToF(&D_ctx_80177A48[6], 3.0f, 1.0f, 0.05f, 0.0f);
gCsCamAtX = player->pos.x; gCsCamAtX = player->pos.x;
gCsCamAtY = player->pos.y; gCsCamAtY = player->pos.y;
gCsCamAtZ = player->unk_138 + D_ctx_80177D20; gCsCamAtZ = player->trueZpos + gPathProgress;
if (gCsFrameCount > 200) { if (gCsFrameCount > 200) {
player->unk_25C += 0.03f; player->contrailScale += 0.03f;
if (player->unk_25C > 0.6f) { if (player->contrailScale > 0.6f) {
player->unk_25C = 0.6f; player->contrailScale = 0.6f;
} }
Math_SmoothStepToF(&player->camRoll, 3.0f, 0.5f, 0.1f, 0.0f); 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); Math_SmoothStepToF(D_ctx_801779A8, 70.0f, 1.0f, 2.0f, 0.0f);
@ -3624,7 +3624,7 @@ void Andross_80193C4C(Player* player) {
case 25: case 25:
for (i = 0; i < 12; i++) { for (i = 0; i < 12; i++) {
Andross_80193668(&gScenery[i], player->pos.x, player->pos.y, 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; break;
case 150: case 150:
@ -3638,8 +3638,8 @@ void Andross_80193C4C(Player* player) {
gCurrentLevel = LEVEL_VENOM_2; gCurrentLevel = LEVEL_VENOM_2;
gLevelPhase = 1; gLevelPhase = 1;
gLevelMode = LEVELMODE_ALL_RANGE; gLevelMode = LEVELMODE_ALL_RANGE;
player->unk_1D0 = 3; player->csState = 3;
player->unk_144 = D_ctx_80177D20 = 0.0f; player->zPath = gPathProgress = 0.0f;
D_ctx_80177AB0 = D_ctx_80177A98 = 1; D_ctx_80177AB0 = D_ctx_80177A98 = 1;
player->cam.eye.x = 1200.0f; player->cam.eye.x = 1200.0f;
player->cam.eye.z = 1200.0f; player->cam.eye.z = 1200.0f;
@ -3660,14 +3660,14 @@ void Andross_80193C4C(Player* player) {
func_play_800A594C(); func_play_800A594C();
gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0; gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0;
gFillScreenAlpha = gFillScreenAlphaTarget = 255; gFillScreenAlpha = gFillScreenAlphaTarget = 255;
player->timer_1F8 = 2; player->csTimer = 2;
gCsFrameCount = 0; gCsFrameCount = 0;
D_ctx_80177A48[1] = 0.0f; D_ctx_80177A48[1] = 0.0f;
break; break;
} }
break; break;
case 3: case 3:
if (player->timer_1F8 == 0) { if (player->csTimer == 0) {
gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0; gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0;
gFillScreenAlpha = gFillScreenAlphaTarget = 0; gFillScreenAlpha = gFillScreenAlphaTarget = 0;
} else { } else {
@ -3704,7 +3704,7 @@ void Andross_80193C4C(Player* player) {
AUDIO_PLAY_BGM(SEQ_ID_VE_CLEAR | SEQ_FLAG); AUDIO_PLAY_BGM(SEQ_ID_VE_CLEAR | SEQ_FLAG);
} }
if (gCsFrameCount == 150) { if (gCsFrameCount == 150) {
player->unk_1D0++; player->csState++;
D_ctx_80177A48[0] = 1.0f; D_ctx_80177A48[0] = 1.0f;
D_ctx_80177A48[1] = 1000.0f; D_ctx_80177A48[1] = 1000.0f;
D_ctx_80177A48[2] = 0; D_ctx_80177A48[2] = 0;
@ -3784,7 +3784,7 @@ void Andross_80193C4C(Player* player) {
} }
if (gCsFrameCount == 360) { if (gCsFrameCount == 360) {
gCsFrameCount = 340; gCsFrameCount = 340;
player->unk_1D0++; player->csState++;
D_ctx_80177A48[0] = 1.0f; D_ctx_80177A48[0] = 1.0f;
D_ctx_80177A48[1] = 0.0f; D_ctx_80177A48[1] = 0.0f;
D_ctx_80177A48[2] = 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; gActors[10].unk_0F4.x = gActors[10].unk_0F4.y = 0.0f;
gFillScreenAlpha = gFillScreenAlphaTarget = 255; gFillScreenAlpha = gFillScreenAlphaTarget = 255;
gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0; gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0;
player->timer_1F8 = 3; player->csTimer = 3;
gStarCount = 500; gStarCount = 500;
} }
if (gCsFrameCount == 250) { if (gCsFrameCount == 250) {
@ -3812,7 +3812,7 @@ void Andross_80193C4C(Player* player) {
} }
break; break;
case 5: case 5:
if (player->timer_1F8 == 1) { if (player->csTimer == 1) {
gFillScreenAlpha = gFillScreenAlphaTarget = 0; gFillScreenAlpha = gFillScreenAlphaTarget = 0;
} }
if (gVenomHardClear != 0) { if (gVenomHardClear != 0) {
@ -3825,9 +3825,9 @@ void Andross_80193C4C(Player* player) {
} }
if ((gCsFrameCount >= 920) && (gTeamShields[TEAM_ID_PEPPY] > 0)) { if ((gCsFrameCount >= 920) && (gTeamShields[TEAM_ID_PEPPY] > 0)) {
if (gCsFrameCount == 920) { 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 { } else {
if (gCsFrameCount < 850) { if (gCsFrameCount < 850) {
switch (gCsFrameCount) { switch (gCsFrameCount) {
@ -3956,8 +3956,9 @@ void Andross_80193C4C(Player* player) {
if (gPlayerGlareAlphas[0] > 255) { if (gPlayerGlareAlphas[0] > 255) {
gPlayerGlareAlphas[0] = 0; gPlayerGlareAlphas[0] = 0;
} }
Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); Matrix_RotateX(gCalcMatrix, -((player->xRot_120 + player->rot.x + player->aerobaticPitch) * M_DTOR),
MTXF_APPLY);
sp74.x = 0.0f; sp74.x = 0.0f;
sp74.y = 0.0f; sp74.y = 0.0f;
sp74.z = player->baseSpeed; sp74.z = player->baseSpeed;
@ -3965,7 +3966,7 @@ void Andross_80193C4C(Player* player) {
player->vel.x = sp68.x; player->vel.x = sp68.x;
player->vel.z = sp68.z; player->vel.z = sp68.z;
player->vel.y = sp68.y; player->vel.y = sp68.y;
if (player->timer_1F8 == 0) { if (player->csTimer == 0) {
player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->state_1C8 = PLAYERSTATE_1C8_ACTIVE;
player->unk_014 = 0.2f; player->unk_014 = 0.2f;
player->unk_018 = 0.0f; 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.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.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->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); Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 0.4f, 0.0f);
break; break;
} }
player->pos.x += player->vel.x; player->pos.x += player->vel.x;
player->pos.y += player->vel.y; player->pos.y += player->vel.y;
player->pos.z += player->vel.z; player->pos.z += player->vel.z;
player->unk_138 = player->pos.z + player->unk_08C; player->trueZpos = player->pos.z + player->camDist;
player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; 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->zRotBarrelRoll, 0.0f, 0.1f, 15.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->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0); 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.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0);
Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0); Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0);

View File

@ -26,7 +26,7 @@ f32 D_i6_801A8440[3];
void SectorY_80197B30(Actor* actor, s32 timer) { void SectorY_80197B30(Actor* actor, s32 timer) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_ACTIVE; 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.x = gPlayer[0].pos.x;
actor->obj.pos.y = gPlayer[0].pos.y; actor->obj.pos.y = gPlayer[0].pos.y;
actor->obj.pos.z = gPlayer[0].pos.z; 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.x = gPlayer[0].vel.x;
actor->vel.y = gPlayer[0].vel.y; actor->vel.y = gPlayer[0].vel.y;
actor->vel.z = gPlayer[0].vel.z; 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.x = gPlayer[0].xRot_120 + gPlayer[0].rot.x + gPlayer[0].aerobaticPitch;
actor->obj.rot.y = gPlayer[0].unk_114 + gPlayer[0].unk_0E8 + 180.0f; actor->obj.rot.y = gPlayer[0].yRot_114 + gPlayer[0].rot.y + 180.0f;
actor->obj.rot.z = gPlayer[0].unk_0EC; actor->obj.rot.z = gPlayer[0].rot.z;
actor->state = 5; actor->state = 5;
actor->timer_04C = timer; actor->timer_04C = timer;
actor->iwork[11] = 1; actor->iwork[11] = 1;
@ -98,7 +98,7 @@ void SectorY_Boss314_Init(Boss314* this) {
if (gLevelMode == LEVELMODE_ON_RAILS) { if (gLevelMode == LEVELMODE_ON_RAILS) {
if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) { if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) {
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_START_360; 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_BGM, 50);
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50);
} }
@ -232,7 +232,7 @@ void SectorY_801983E4(Boss* boss) {
SectorY_8019C194(boss, zSpeed, xSpeed); SectorY_8019C194(boss, zSpeed, xSpeed);
if (boss->swork[22] == 1) { if (boss->swork[22] == 1) {
yAngle = gPlayer[0].unk_114 - 180.0f; yAngle = gPlayer[0].yRot_114 - 180.0f;
if (yAngle < 0.0f) { if (yAngle < 0.0f) {
yAngle += 360.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)) { if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) {
gCsFrameCount = 0; gCsFrameCount = 0;
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE;
gPlayer[0].timer_1F8 = 0; gPlayer[0].csTimer = 0;
gPlayer[0].unk_1D0 = gPlayer[0].timer_1F8; gPlayer[0].csState = gPlayer[0].csTimer;
gPlayer[0].unk_0E8 += gPlayer[0].unk_114; gPlayer[0].rot.y += gPlayer[0].yRot_114;
if (gPlayer[0].unk_0E8 > 360.0f) { if (gPlayer[0].rot.y > 360.0f) {
gPlayer[0].unk_0E8 -= 360.0f; gPlayer[0].rot.y -= 360.0f;
} }
if (gPlayer[0].unk_0E8 < 0.0f) { if (gPlayer[0].rot.y < 0.0f) {
gPlayer[0].unk_0E8 += 360.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); AUDIO_PLAY_SFX(0x2940D09A, boss->sfxSource, 4);
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 30); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 30);
@ -714,7 +714,7 @@ void SectorY_80199DAC(Boss* boss) {
} else { } else {
Math_SmoothStepToF(&boss->vel.x, boss->fwork[11], 0.1f, 0.5f, 0.1f); 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); 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) { if (yAngle < 0.0f) {
yAngle += 360.0f; yAngle += 360.0f;
} }
@ -1247,13 +1247,13 @@ void SectorY_8019BC14(Boss* boss) {
gPlayer[0].pos.x = boss->fwork[0x12]; gPlayer[0].pos.x = boss->fwork[0x12];
gPlayer[0].pos.y = boss->fwork[0x13]; 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); 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.x = sp4C;
gPlayer[0].pos.y = sp48; 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) { if (boss->index == 0) {
AUDIO_PLAY_SFX(0x2901306E, boss->sfxSource, 4); 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.x = boss->obj.pos.x;
radarMark->pos.y = boss->obj.pos.y; radarMark->pos.y = boss->obj.pos.y;
radarMark->pos.z = boss->obj.pos.z; 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 { } else {
radarMark = &gRadarMarks[boss->index + 4]; radarMark = &gRadarMarks[boss->index + 4];
radarMark->status = 1; radarMark->status = 1;
@ -1640,7 +1640,7 @@ void SectorY_8019C888(Boss* boss) {
radarMark->pos.x = boss->obj.pos.x; radarMark->pos.x = boss->obj.pos.x;
radarMark->pos.y = boss->obj.pos.y; radarMark->pos.y = boss->obj.pos.y;
radarMark->pos.z = boss->obj.pos.z; 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) { if (gBossFrameCount == 250) {
@ -1902,7 +1902,7 @@ void SectorY_8019E2C4(Boss* boss) {
Matrix_RotateZ(gGfxMatrix, -boss->obj.rot.z * M_DTOR, MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, -boss->obj.rot.z * M_DTOR, MTXF_APPLY);
sp98 = gPlayer[0].cam.eye.x - boss->obj.pos.x; sp98 = gPlayer[0].cam.eye.x - boss->obj.pos.x;
sp94 = gPlayer[0].cam.eye.y - boss->obj.pos.y; 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); sp8C = -Math_Atan2F(sp98, sp90);
sp9C = sqrtf(SQ(sp90) + SQ(sp98)); sp9C = sqrtf(SQ(sp90) + SQ(sp98));
sp88 = Math_Atan2F(sp94, sp9C); sp88 = Math_Atan2F(sp94, sp9C);
@ -2003,7 +2003,7 @@ void SectorY_8019EB80(void) {
} }
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_INIT; 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.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.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); 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]; Boss* boss = &gBosses[0];
f32 temp_ft1; f32 temp_ft1;
switch (player->unk_1D0) { switch (player->csState) {
case 0: case 0:
gCsFrameCount = 0; gCsFrameCount = 0;
player->unk_4D8 = 0.0f; player->aerobaticPitch = 0.0f;
player->camRoll = 0.0f; player->camRoll = 0.0f;
player->baseSpeed = 40.0f; player->baseSpeed = 40.0f;
player->boostSpeed = 0.0f; player->boostSpeed = 0.0f;
player->wings.unk_04 = player->wings.unk_0C = player->wings.unk_08 = player->wings.unk_10 = 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; player->unk_234 = 1;
D_ctx_80177A48[8] = Math_RadToDeg( 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)); 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[3].obj, gActors[3].sfxSource);
Object_Kill(&gActors[4].obj, gActors[4].sfxSource); Object_Kill(&gActors[4].obj, gActors[4].sfxSource);
player->unk_1D0++; player->csState++;
D_ctx_80177A48[0] = 0.05f; D_ctx_80177A48[0] = 0.05f;
if (Rand_ZeroOne() > 0.5f) { if (Rand_ZeroOne() > 0.5f) {
@ -2082,13 +2082,13 @@ void SectorY_LevelComplete(Player* player) {
break; break;
case 1: 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); Math_SmoothStepToF(&player->pos.y, 400.0f, 0.05f, 3.0f, 0);
temp1 = player->pos.x - boss->obj.pos.x; temp1 = player->pos.x - boss->obj.pos.x;
temp2 = player->pos.z - boss->obj.pos.z; temp2 = player->pos.z - boss->obj.pos.z;
temp_ft1 = Math_RadToDeg(Math_Atan2F(temp1, temp2)); 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; temp_ft1 = Math_SmoothStepToAngle(&player->rot.y, temp_ft1, 0.5f, 2.0f, 0.0001f) * 30.0f;
Math_SmoothStepToAngle(&player->unk_0EC, -temp_ft1, 0.1f, 5.0f, 0.0001f); Math_SmoothStepToAngle(&player->rot.z, -temp_ft1, 0.1f, 5.0f, 0.0001f);
if (gCsFrameCount < 180) { if (gCsFrameCount < 180) {
D_ctx_80177A48[8] += D_ctx_80177A48[9]; D_ctx_80177A48[8] += D_ctx_80177A48[9];
@ -2100,8 +2100,8 @@ void SectorY_LevelComplete(Player* player) {
gCsCamEyeX = boss->obj.pos.x + sp54.x; gCsCamEyeX = boss->obj.pos.x + sp54.x;
gCsCamEyeZ = boss->obj.pos.z + sp54.z; gCsCamEyeZ = boss->obj.pos.z + sp54.z;
} }
temp_ft1 = Math_SmoothStepToAngle(&player->unk_0E8, 283.0f, 0.1f, 3.0f, 0.0f); temp_ft1 = Math_SmoothStepToAngle(&player->rot.y, 283.0f, 0.1f, 3.0f, 0.0f);
Math_SmoothStepToF(&player->unk_0EC, temp_ft1 * 20.0f, 0.1f, 1.0f, 0); Math_SmoothStepToF(&player->rot.z, temp_ft1 * 20.0f, 0.1f, 1.0f, 0);
for (i = 1; i < 4; i++) { 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); 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) { if (gCsFrameCount == 230) {
D_ctx_80177A48[0] = 1.0f; D_ctx_80177A48[0] = 1.0f;
player->unk_1D0++; player->csState++;
Play_ClearObjectData(); Play_ClearObjectData();
Audio_StopPlayerNoise(0); Audio_StopPlayerNoise(0);
Audio_KillSfxBySource(player->sfxSource); Audio_KillSfxBySource(player->sfxSource);
gFillScreenAlpha = 250; gFillScreenAlpha = 250;
player->timer_1F8 = 50; player->csTimer = 50;
player->baseSpeed = 0.0f; player->baseSpeed = 0.0f;
player->unk_0E4 = 0.0f; player->rot.x = 0.0f;
player->unk_0E8 = 0.0f; player->rot.y = 0.0f;
player->unk_0EC = 0.0f; player->rot.z = 0.0f;
} }
break; break;
case 2: case 2:
if (player->timer_1F8 == 0) { if (player->csTimer == 0) {
player->unk_240 = 1; player->unk_240 = 1;
player->pos.x = 0.0f; player->pos.x = 0.0f;
player->pos.y = 3500.0f; player->pos.y = 3500.0f;
player->pos.z = 0.0f; player->pos.z = 0.0f;
player->unk_1D0++; player->csState++;
Audio_StartPlayerNoise(0); Audio_StartPlayerNoise(0);
AUDIO_PLAY_BGM(SEQ_ID_GOOD_END); AUDIO_PLAY_BGM(SEQ_ID_GOOD_END);
D_ctx_80177A98 = 0; D_ctx_80177A98 = 0;
@ -2203,7 +2203,7 @@ void SectorY_LevelComplete(Player* player) {
if (gCsFrameCount > 1440) { if (gCsFrameCount > 1440) {
player->baseSpeed += 2.0f; 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); Math_SmoothStepToF(&D_ctx_80177A48[2], 0.0f, 1.0f, 0.001f, 0);
player->unk_190 = 2.0f; player->unk_190 = 2.0f;
} else if (D_ctx_80177A48[1] >= 92.0f) { } else if (D_ctx_80177A48[1] >= 92.0f) {
@ -2219,7 +2219,7 @@ void SectorY_LevelComplete(Player* player) {
if (gFillScreenAlpha == 255) { if (gFillScreenAlpha == 255) {
Audio_FadeOutAll(10); Audio_FadeOutAll(10);
player->state_1C8 = PLAYERSTATE_1C8_NEXT; player->state_1C8 = PLAYERSTATE_1C8_NEXT;
player->timer_1F8 = 0; player->csTimer = 0;
gFadeoutType = 4; gFadeoutType = 4;
gLeveLClearStatus[LEVEL_SECTOR_Y] = Play_CheckMedalStatus(150) + 1; gLeveLClearStatus[LEVEL_SECTOR_Y] = Play_CheckMedalStatus(150) + 1;
} }
@ -2338,8 +2338,8 @@ void SectorY_LevelComplete(Player* player) {
break; break;
} }
Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4) * M_DTOR), MTXF_APPLY); Matrix_RotateX(gCalcMatrix, -((player->xRot_120 + player->rot.x) * M_DTOR), MTXF_APPLY);
sp60.x = 0.0f; sp60.x = 0.0f;
sp60.y = 0.0f; sp60.y = 0.0f;
sp60.z = player->baseSpeed; sp60.z = player->baseSpeed;
@ -2350,18 +2350,18 @@ void SectorY_LevelComplete(Player* player) {
player->pos.x += player->vel.x; player->pos.x += player->vel.x;
player->pos.y += player->vel.y; player->pos.y += player->vel.y;
player->pos.z += player->vel.z; player->pos.z += player->vel.z;
player->unk_138 = player->pos.z; player->trueZpos = player->pos.z;
player->unk_0F8 = player->unk_0EC; 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.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.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.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.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.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); Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0.0f);
player->unk_088 += 10.0f; player->bobPhase += 10.0f;
player->unk_080 = -SIN_DEG(player->unk_088) * 0.3f; player->yBob = -SIN_DEG(player->bobPhase) * 0.3f;
player->unk_0F4 += 8.0f; player->rockPhase += 8.0f;
player->unk_0F0 = SIN_DEG(player->unk_0F4); player->rockAngle = SIN_DEG(player->rockPhase);
} }
void SectorY_8019FF00(Actor* actor) { void SectorY_8019FF00(Actor* actor) {
@ -2404,10 +2404,10 @@ void SectorY_8019FF00(Actor* actor) {
break; break;
case 7: case 7:
actor->unk_0F4.y = gPlayer[0].unk_0E8; actor->unk_0F4.y = gPlayer[0].rot.y;
actor->unk_0F4.z = gPlayer[0].unk_0EC; actor->unk_0F4.z = gPlayer[0].rot.z;
Math_SmoothStepToF(&actor->obj.pos.y, 50.0f, 0.1f, 1.0f, 0.0f); 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); Math_SmoothStepToF(&actor->obj.pos.x, 1300.0f, 1.0f, 2.0f, 0.0f);
} else { } else {
if (gCsFrameCount == 540) { 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_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); Math_SmoothStepToAngle(&actor->unk_0F4.z, 45.0f, 1.0f, 4.0f, 0.0f);
} else { } else {
actor->unk_0F4.y = gPlayer[0].unk_0E8; actor->unk_0F4.y = gPlayer[0].rot.y;
actor->unk_0F4.z = gPlayer[0].unk_0EC; actor->unk_0F4.z = gPlayer[0].rot.z;
Math_SmoothStepToF(&actor->obj.pos.x, -230.0f, 1.0f, 13.0f, 0.0f); Math_SmoothStepToF(&actor->obj.pos.x, -230.0f, 1.0f, 13.0f, 0.0f);
} }
break; 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_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); Math_SmoothStepToAngle(&actor->unk_0F4.z, 315.0f, 1.0f, 2.0f, 0.0f);
} else { } else {
actor->unk_0F4.y = gPlayer[0].unk_0E8; actor->unk_0F4.y = gPlayer[0].rot.y;
actor->unk_0F4.z = gPlayer[0].unk_0EC; actor->unk_0F4.z = gPlayer[0].rot.z;
Math_SmoothStepToF(&actor->obj.pos.x, 150.0f, 1.0f, 13.0f, 0.0f); Math_SmoothStepToF(&actor->obj.pos.x, 150.0f, 1.0f, 13.0f, 0.0f);
} }
break; break;
@ -2477,7 +2477,7 @@ void SectorY_801A0510(Actor* actor, s32 arg1) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_ACTIVE; 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.x = D_i6_801A6A74[arg1].x;
actor->obj.pos.y = D_i6_801A6A74[arg1].y; actor->obj.pos.y = D_i6_801A6A74[arg1].y;
actor->obj.pos.z = D_i6_801A6A74[arg1].z; 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) { if (gTeamShields[1 + arg1] > 0) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_ACTIVE; 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.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.y = gPlayer[0].pos.y + D_i6_801A6AEC[arg1].y;
actor->obj.pos.z = gPlayer[0].pos.z + D_i6_801A6AEC[arg1].z; actor->obj.pos.z = gPlayer[0].pos.z + D_i6_801A6AEC[arg1].z;
actor->fwork[0] = gPlayer[0].baseSpeed; actor->fwork[0] = gPlayer[0].baseSpeed;
actor->unk_0F4.y = gPlayer[0].unk_0E8; actor->unk_0F4.y = gPlayer[0].rot.y;
actor->unk_0F4.z = gPlayer[0].unk_0EC; actor->unk_0F4.z = gPlayer[0].rot.z;
actor->state = arg1 + 7; actor->state = arg1 + 7;
actor->iwork[11] = 1; actor->iwork[11] = 1;
Object_SetInfo(&actor->info, actor->obj.id); Object_SetInfo(&actor->info, actor->obj.id);
@ -2561,7 +2561,7 @@ void SectorY_801A07FC(Actor* actor0, Actor* actor1) {
Actor_Initialize(actor1); Actor_Initialize(actor1);
actor1->obj.status = OBJ_ACTIVE; actor1->obj.status = OBJ_ACTIVE;
actor1->obj.id = OBJ_ACTOR_195; actor1->obj.id = OBJ_ACTOR_CUTSCENE;
actor0->fwork[6] = 1.8f; actor0->fwork[6] = 1.8f;
sp3C.x = -40.0f; sp3C.x = -40.0f;
sp3C.y = 0.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) { void SectorY_801A0A08(Actor* actor, f32 xPos, f32 yPos, f32 zPos, f32 arg4) {
Actor_Initialize(actor); Actor_Initialize(actor);
actor->obj.status = OBJ_ACTIVE; actor->obj.status = OBJ_ACTIVE;
actor->obj.id = OBJ_ACTOR_195; actor->obj.id = OBJ_ACTOR_CUTSCENE;
actor->fwork[0] = arg4; actor->fwork[0] = arg4;
actor->obj.pos.x = xPos; actor->obj.pos.x = xPos;
actor->obj.pos.y = yPos; actor->obj.pos.y = yPos;
@ -2617,13 +2617,13 @@ void SectorY_801A0AC0(Player* player) {
f32 sp84; f32 sp84;
f32 sp80; f32 sp80;
switch (player->unk_1D0) { switch (player->csState) {
case 0: case 0:
gCsFrameCount = 0; gCsFrameCount = 0;
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
SectorY_801A0510(&gActors[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.x = gCsCamEyeX = -2000.0f;
player->cam.eye.y = gCsCamEyeY = 0.0f; player->cam.eye.y = gCsCamEyeY = 0.0f;
player->cam.eye.z = gCsCamEyeZ = -1700.0f; player->cam.eye.z = gCsCamEyeZ = -1700.0f;
@ -2868,7 +2868,7 @@ void SectorY_801A0AC0(Player* player) {
gFillScreenAlpha = 255; gFillScreenAlpha = 255;
gFillScreenAlphaTarget = 0; gFillScreenAlphaTarget = 0;
Object_Kill(&gActors[8].obj, gActors[8].sfxSource); Object_Kill(&gActors[8].obj, gActors[8].sfxSource);
player->unk_1D0++; player->csState++;
player->cam.eye.x = gCsCamEyeX = 0.0f; player->cam.eye.x = gCsCamEyeX = 0.0f;
player->cam.eye.y = gCsCamEyeY = 0.0f; player->cam.eye.y = gCsCamEyeY = 0.0f;
player->cam.eye.z = gCsCamEyeZ = 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[4] = 4;
gActors[7].iwork[5] = 0; gActors[7].iwork[5] = 0;
gActors[7].vel.x = -1.5f; gActors[7].vel.x = -1.5f;
player->unk_1D0++; player->csState++;
break; break;
} }
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); 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_SmoothStepToF(&gPlayer[0].pos.y, 0.0f, 0.1f, 5.0f, 0.0f);
Math_SmoothStepToAngle(&player->unk_0EC, Math_SmoothStepToAngle(&player->rot.z,
Math_SmoothStepToAngle(&player->unk_0E8, 0.0f, 1.0f, 0.7f, 0.0f) * 30.0f, 0.1f, Math_SmoothStepToAngle(&player->rot.y, 0.0f, 1.0f, 0.7f, 0.0f) * 30.0f, 0.1f,
5.0f, 0); 5.0f, 0);
Math_SmoothStepToF(&gPlayer[0].pos.x, 0.0f, 1.0f, 13.0f, 0.0f); Math_SmoothStepToF(&gPlayer[0].pos.x, 0.0f, 1.0f, 13.0f, 0.0f);
} }
if (player->unk_0E8 == 0.0f) { if (player->rot.y == 0.0f) {
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, 2.0f, 0.0f); 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.y = 300.0f;
player->pos.z = 4000.0f; player->pos.z = 4000.0f;
player->baseSpeed = 40.0f; player->baseSpeed = 40.0f;
player->unk_0E8 = 80.0f; player->rot.y = 80.0f;
player->unk_0EC = 240.0f; player->rot.z = 240.0f;
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
SectorY_801A06A4(&gActors[i], i); SectorY_801A06A4(&gActors[i], i);
@ -3272,13 +3272,13 @@ void SectorY_801A0AC0(Player* player) {
gActors[7].obj.rot.y = 140.0f; gActors[7].obj.rot.y = 140.0f;
gActors[5].fwork[0] = 2.8f; gActors[5].fwork[0] = 2.8f;
AUDIO_PLAY_SFX(0x2902306C, gActors[5].sfxSource, 4); AUDIO_PLAY_SFX(0x2902306C, gActors[5].sfxSource, 4);
player->unk_1D0++; player->csState++;
break; break;
} }
break; break;
case 4: 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(&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); 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.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.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_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); Math_SmoothStepToF(&player->pos.x, 0.0f, 1.0f, 1.0f, 0.0f);
} else { } else {
Math_SmoothStepToF(&gActors[5].obj.pos.z, -12000.0f, 1.0f, 100.0f, 1.0f); 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[8].obj.pos.z = -8100.0f;
gActors[9].obj.pos.z = -7100.0f; gActors[9].obj.pos.z = -7100.0f;
D_ctx_80177A48[0] = 1.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; player->baseSpeed = gArwingSpeed;
AUDIO_PLAY_BGM(SEQ_ID_SECTOR_Y | SEQ_FLAG); AUDIO_PLAY_BGM(SEQ_ID_SECTOR_Y | SEQ_FLAG);
gLevelStartStatusScreenTimer = 100; gLevelStartStatusScreenTimer = 100;
player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->state_1C8 = PLAYERSTATE_1C8_ACTIVE;
player->unk_1D0 = 0; player->csState = 0;
player->timer_1F8 = 0; player->csTimer = 0;
player->timer_1FC = 0; player->csEventTimer = 0;
gCsCamEyeX = player->pos.x; gCsCamEyeX = player->pos.x;
gCsCamEyeY = (player->pos.y * player->unk_148) + 50.0f; gCsCamEyeY = (player->pos.y * player->unk_148) + 50.0f;
gCsCamEyeZ = 400.0f; gCsCamEyeZ = 400.0f;
gCsCamAtX = player->pos.x; gCsCamAtX = player->pos.x;
gCsCamAtY = (player->pos.y * player->unk_148) + 20.0f; 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.x = player->pos.x;
player->cam.eye.y = player->pos.y * player->unk_148; player->cam.eye.y = player->pos.y * player->unk_148;
player->cam.eye.y += 50.0f; 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.x = player->pos.x;
player->cam.at.y = player->pos.y * player->unk_148; player->cam.at.y = player->pos.y * player->unk_148;
player->cam.at.y += 20.0f; 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++) { for (i = 0; i < 11; i++) {
Object_Kill(&gActors[i].obj, gActors[i].sfxSource); 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.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.y, gCsCamAtY, D_ctx_80177A48[0], 20000.0f, 0);
Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, 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_RotateY(gCalcMatrix, (player->rot.y + 180.0f) * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); Matrix_RotateX(gCalcMatrix, -(player->rot.x * M_DTOR), MTXF_APPLY);
spA4.x = 0.0f; spA4.x = 0.0f;
spA4.y = 0.0f; spA4.y = 0.0f;
spA4.z = player->baseSpeed; spA4.z = player->baseSpeed;
@ -3393,7 +3393,7 @@ void SectorY_801A0AC0(Player* player) {
player->pos.x += player->vel.x; player->pos.x += player->vel.x;
player->pos.y += player->vel.y; player->pos.y += player->vel.y;
player->pos.z += player->vel.z; 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) { 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); 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) { if (this->dmgType == 2) {
this->unk_0D2 = 1; this->dmgPart = 1;
} }
this->unk_0D0 = 0; this->dmgType = 0;
if (this->unk_0D2 == 0) { if (this->dmgPart == 0) {
this->iwork[18] = 15; this->iwork[18] = 15;
AUDIO_PLAY_SFX(0x29121007, this->sfxSource, 4); AUDIO_PLAY_SFX(0x29121007, this->sfxSource, 4);
@ -3815,7 +3815,7 @@ void SectorY_Actor204_Draw(Actor204* this) {
gDPSetEnvColor(gMasterDisp++, 255, 48, 0, 255); gDPSetEnvColor(gMasterDisp++, 255, 48, 0, 255);
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
Matrix_Push(&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_Scale(gGfxMatrix, scale, scale, scale, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp); Matrix_SetGfxMtx(&gMasterDisp);

View File

@ -8,7 +8,7 @@ void Turret_801A5560(Player* player, PlayerShot* shot, f32 xOffset, f32 yOffset,
PlayerShot_Initialize(shot); PlayerShot_Initialize(shot);
Matrix_RotateY(gCalcMatrix, player->unk_000 * M_DTOR, MTXF_NEW); Matrix_RotateY(gCalcMatrix, player->unk_000 * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, player->unk_004 * M_DTOR, MTXF_APPLY); 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_RotateY(gCalcMatrix, player->unk_180 * M_DTOR, MTXF_APPLY);
Matrix_RotateX(gCalcMatrix, player->unk_17C * M_DTOR, MTXF_APPLY); Matrix_RotateX(gCalcMatrix, player->unk_17C * M_DTOR, MTXF_APPLY);
sp4C.x = xOffset; sp4C.x = xOffset;
@ -17,11 +17,11 @@ void Turret_801A5560(Player* player, PlayerShot* shot, f32 xOffset, f32 yOffset,
Matrix_MultVec3f(gCalcMatrix, &sp4C, &sp34); Matrix_MultVec3f(gCalcMatrix, &sp4C, &sp34);
Matrix_RotateY(gCalcMatrix, player->unk_000 * M_DTOR, MTXF_NEW); Matrix_RotateY(gCalcMatrix, player->unk_000 * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, player->unk_004 * M_DTOR, MTXF_APPLY); 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_RotateY(gCalcMatrix, player->unk_180 * M_DTOR, MTXF_APPLY);
Matrix_RotateX(gCalcMatrix, player->unk_17C * 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_RotateY(gCalcMatrix, player->rot.y * M_DTOR, MTXF_APPLY);
Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, MTXF_APPLY); Matrix_RotateX(gCalcMatrix, player->rot.x * M_DTOR, MTXF_APPLY);
sp4C.x = sp4C.y = 0.0f; sp4C.x = sp4C.y = 0.0f;
sp4C.z = speed; sp4C.z = speed;
Matrix_MultVec3f(gCalcMatrix, &sp4C, &sp40); 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_50 = player->unk_004;
shot->unk_54 = player->unk_000; 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->unk_60 = 0;
shot->obj.id = shotId; shot->obj.id = shotId;
shot->unk_64 = 40; shot->unk_64 = 40;
shot->unk_44 = 1.5f; shot->scale = 1.5f;
shot->playerNum = player->num; shot->playerNum = player->num;
} }
@ -97,22 +97,22 @@ void Turret_801A58A8(Player* player) {
for (i = 0; i < player->unk_1C0; i++) { for (i = 0; i < player->unk_1C0; i++) {
if ((gActors[i].obj.status == OBJ_ACTIVE) && (gActors[i].obj.id == OBJ_ACTOR_EVENT)) { if ((gActors[i].obj.status == OBJ_ACTIVE) && (gActors[i].obj.id == OBJ_ACTOR_EVENT)) {
gTexturedLines[i].mode = 3; 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].posAA.x = player->pos.x;
gTexturedLines[i].unk_04.y = player->pos.y; gTexturedLines[i].posAA.y = player->pos.y;
gTexturedLines[i].unk_04.z = player->pos.z - 100.0f; gTexturedLines[i].posAA.z = player->pos.z - 100.0f;
gTexturedLines[i].timer = 2; gTexturedLines[i].timer = 2;
gTexturedLines[i].unk_2C = 255; gTexturedLines[i].red = 255;
gTexturedLines[i].unk_2D = 255; gTexturedLines[i].green = 255;
gTexturedLines[i].unk_2E = 255; gTexturedLines[i].blue = 255;
gTexturedLines[i].unk_2F = 255; gTexturedLines[i].alpha = 255;
gTexturedLines[i].unk_10.x = gActors[i].obj.pos.x; gTexturedLines[i].posBB.x = gActors[i].obj.pos.x;
gTexturedLines[i].unk_10.y = gActors[i].obj.pos.y; gTexturedLines[i].posBB.y = gActors[i].obj.pos.y;
gTexturedLines[i].unk_10.z = gActors[i].obj.pos.z; gTexturedLines[i].posBB.z = gActors[i].obj.pos.z;
} }
} }
if (gControllerHold[player->num].button & R_TRIG) { 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->pos.z = gActors[player->unk_1B4].obj.pos.z;
player->unk_000 = gActors[player->unk_1B4].obj.rot.y; player->unk_000 = gActors[player->unk_1B4].obj.rot.y;
player->unk_004 = gActors[player->unk_1B4].obj.rot.x; 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 < 2) {
if (player->unk_1B0 == 0) { if (player->unk_1B0 == 0) {
player->unk_1BC = 200; player->unk_1BC = 200;
@ -151,14 +151,14 @@ void Turret_801A5AD4(Player* player) {
} }
sp2C = (f32) gControllerPress[player->num].stick_x; sp2C = (f32) gControllerPress[player->num].stick_x;
sp28 = -(f32) gControllerPress[player->num].stick_y; sp28 = -(f32) gControllerPress[player->num].stick_y;
Math_SmoothStepToF(&player->unk_0E8, -sp2C * 0.35000002f, 0.5f, 2.0f, 0.00001f); Math_SmoothStepToF(&player->rot.y, -sp2C * 0.35000002f, 0.5f, 2.0f, 0.00001f);
Math_SmoothStepToF(&player->unk_0E4, -sp28 * 0.3f, 0.5f, 2.0f, 0.00001f); Math_SmoothStepToF(&player->rot.x, -sp28 * 0.3f, 0.5f, 2.0f, 0.00001f);
player->unk_138 = player->pos.z; player->trueZpos = player->pos.z;
player->unk_140 = -gActors[player->unk_1B4].vel.z; player->zPathVel = -gActors[player->unk_1B4].vel.z;
player->unk_144 += player->unk_140; player->zPath += player->zPathVel;
D_ctx_80177D08 = player->unk_140; gPathVelZ = player->zPathVel;
D_ctx_80177D20 = player->unk_144; gPathProgress = player->zPath;
if (!(gControllerHold[player->num].button & Z_TRIG) && (sqrtf((sp2C * sp2C) + (sp28 * sp28)) > 55.0f)) { if (!(gControllerHold[player->num].button & Z_TRIG) && (sqrtf((sp2C * sp2C) + (sp28 * sp28)) > 55.0f)) {
if ((gControllerHold[player->num].button & R_CBUTTONS) || (sp2C > 40.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.x = 0.0f;
sp3C.y = 0.0f; sp3C.y = 0.0f;
sp3C.z = 100.0f; sp3C.z = 100.0f;
Matrix_RotateY(gCalcMatrix, (player->unk_000 + (player->unk_134 * 0.3f)) * M_DTOR, MTXF_NEW); Matrix_RotateY(gCalcMatrix, (player->unk_000 + (player->damageShake * 0.3f)) * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, (player->unk_004 + (player->unk_134 * 0.3f)) * M_DTOR, MTXF_APPLY); Matrix_RotateX(gCalcMatrix, (player->unk_004 + (player->damageShake * 0.3f)) * 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_RotateY(gCalcMatrix, player->unk_180 * M_DTOR, MTXF_APPLY);
Matrix_RotateX(gCalcMatrix, player->unk_17C * M_DTOR, MTXF_APPLY); Matrix_RotateX(gCalcMatrix, player->unk_17C * M_DTOR, MTXF_APPLY);
// unclear what values are being multiplied by 0.0f // unclear what values are being multiplied by 0.0f
@ -226,10 +226,10 @@ void Turret_801A5FC0(Player* player) {
Matrix_MultVec3f(gCalcMatrix, &sp3C, &sp30); Matrix_MultVec3f(gCalcMatrix, &sp3C, &sp30);
player->cam.at.x = player->pos.x + sp30.x; player->cam.at.x = player->pos.x + sp30.x;
player->cam.at.y = player->pos.y + sp30.y; 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.x = player->pos.x;
player->cam.eye.y = player->pos.y; 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) { void Turret_801A6164(Player* player) {
@ -245,8 +245,8 @@ void Turret_801A6164(Player* player) {
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
RCP_SetupDL_36(); RCP_SetupDL_36();
Matrix_Translate(gGfxMatrix, 0.0f, -100.0f, 0.0f, MTXF_APPLY); Matrix_Translate(gGfxMatrix, 0.0f, -100.0f, 0.0f, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, player->unk_0E8 * M_DTOR, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, player->rot.y * M_DTOR, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, -player->unk_0E4 * M_DTOR, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, -player->rot.x * M_DTOR, MTXF_APPLY);
if (player->unk_1B0 < 2) { if (player->unk_1B0 < 2) {
Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -5000.0f + (player->unk_1BC * 25), MTXF_APPLY); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -5000.0f + (player->unk_1BC * 25), MTXF_APPLY);
} else { } else {
@ -263,15 +263,15 @@ void Turret_801A6164(Player* player) {
} }
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, -100.0f, -100.0f, -200.0f + player->unk_1BC, MTXF_APPLY); 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_RotateY(gGfxMatrix, player->rot.y * M_DTOR, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, -player->unk_0E4 * 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_Scale(gGfxMatrix, 1.0f, 1.0f, 1.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp); Matrix_SetGfxMtx(&gMasterDisp);
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, 100.0f, -100.0f, -200.0f + player->unk_1BC, MTXF_APPLY); 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_RotateY(gGfxMatrix, player->rot.y * M_DTOR, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, -player->unk_0E4 * 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_Scale(gGfxMatrix, 1.0f, 1.0f, 1.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp); Matrix_SetGfxMtx(&gMasterDisp);
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
@ -280,16 +280,16 @@ void Turret_801A6164(Player* player) {
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 128); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 128);
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, -100.0f, -100.0f, -200.0f + player->unk_1BC, MTXF_APPLY); 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_RotateY(gGfxMatrix, player->rot.y * M_DTOR, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, -player->unk_0E4 * 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_Translate(gGfxMatrix, 0.0f, 0.0f, -188.0f, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp); Matrix_SetGfxMtx(&gMasterDisp);
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, 100.0f, -100.0f, -200.0f + player->unk_1BC, MTXF_APPLY); 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_RotateY(gGfxMatrix, player->rot.y * M_DTOR, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, -player->unk_0E4 * 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_Translate(gGfxMatrix, 0.0f, 0.0f, -188.0f, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp); Matrix_SetGfxMtx(&gMasterDisp);

View File

@ -61,8 +61,8 @@ void Venom2_UpdateEvents(Actor* this) {
player->pos.x = 0.0f; player->pos.x = 0.0f;
player->pos.z = 16000.0f; player->pos.z = 16000.0f;
player->pos.y = 4350.0f; player->pos.y = 4350.0f;
player->unk_0E4 = -20.0f; player->rot.x = -20.0f;
player->unk_114 = 0.0f; player->yRot_114 = 0.0f;
this->timer_0BC = 210; this->timer_0BC = 210;
for (team = &gActors[1], i = 1; i < 4; i++, team++) { for (team = &gActors[1], i = 1; i < 4; i++, team++) {
team->obj.pos.x = D_i6_801A68B0[i - 1].x; 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->state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE;
player->unk_1D0 = 0; player->csState = 0;
gLeveLClearStatus[gCurrentLevel] = 2; gLeveLClearStatus[gCurrentLevel] = 2;
D_ctx_80177C94 = gGoldRingCount[0]; D_ctx_80177C94 = gGoldRingCount[0];
D_ctx_80177C9C = player->shields + 1; D_ctx_80177C9C = player->shields + 1;
@ -226,8 +226,8 @@ void Venom2_LevelStart(Player* player) {
gFillScreenAlphaStep = 3; gFillScreenAlphaStep = 3;
gFillScreenAlphaTarget = 0; gFillScreenAlphaTarget = 0;
} }
Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); Matrix_RotateX(gCalcMatrix, -((player->xRot_120 + player->rot.x + player->aerobaticPitch) * M_DTOR), MTXF_APPLY);
vec.x = 0.0f; vec.x = 0.0f;
vec.y = 0.0f; vec.y = 0.0f;
vec.z = player->baseSpeed + player->boostSpeed; vec.z = player->baseSpeed + player->boostSpeed;
@ -239,8 +239,8 @@ void Venom2_LevelStart(Player* player) {
player->pos.y += player->vel.y; player->pos.y += player->vel.y;
player->pos.z += player->vel.z; player->pos.z += player->vel.z;
player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll;
player->unk_138 = player->pos.z; player->trueZpos = player->pos.z;
player->cam.eye.x = 50.0f; player->cam.eye.x = 50.0f;
player->cam.eye.y = 1800.0f; player->cam.eye.y = 1800.0f;
player->cam.eye.z = 9000.0f; player->cam.eye.z = 9000.0f;
@ -267,11 +267,11 @@ void Venom2_LevelComplete(Player* player) {
s32 pad2; s32 pad2;
Math_SmoothStepToF(&player->boostSpeed, 0.0f, 0.1f, 1.5f, 0.0f); 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->rot.y, 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.x, 0.0f, 0.1f, 1.5f, 0.0f);
var_fa0 = -player->unk_120; var_fa0 = -player->xRot_120;
temp_fv1 = player->unk_0EC; temp_fv1 = player->rot.z;
if (var_fa0 < -90.0f) { if (var_fa0 < -90.0f) {
var_fa0 = 0.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); sp90 = player->pos.y - (gBosses[0].obj.pos.y + 700.0f);
sp8C = player->pos.z - gBosses[0].obj.pos.z; sp8C = player->pos.z - gBosses[0].obj.pos.z;
switch (player->unk_1D0) { switch (player->csState) {
case 0: 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.unk_04 = player->wings.unk_0C = player->wings.unk_08 = player->wings.unk_10 = 0.0f;
player->wings.modelId = 1; player->wings.modelId = 1;
D_ctx_80177A48[0] = 0.0f; D_ctx_80177A48[0] = 0.0f;
D_ctx_80177A48[1] = 0.1f; D_ctx_80177A48[1] = 0.1f;
D_ctx_80177A48[3] = 0.0f; D_ctx_80177A48[3] = 0.0f;
D_ctx_80177A48[4] = 0.0f; D_ctx_80177A48[4] = 0.0f;
player->timer_1F8 = 0; player->csTimer = 0;
if ((fabsf(sp94) < 4000.0f) && (fabsf(sp8C) < 4000.0f)) { if ((fabsf(sp94) < 4000.0f) && (fabsf(sp8C) < 4000.0f)) {
player->timer_1F8 = 250; player->csTimer = 250;
sp64.x = 0.0f; sp64.x = 0.0f;
sp64.y = 0.0f; sp64.y = 0.0f;
sp64.z = 5000.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); Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp64, &sp58);
D_ctx_80177A48[5] = sp58.x; D_ctx_80177A48[5] = sp58.x;
D_ctx_80177A48[6] = sp58.z; D_ctx_80177A48[6] = sp58.z;
} }
if (gLevelPhase == 2) { if (gLevelPhase == 2) {
player->timer_1FC = 240; player->csEventTimer = 240;
} else { } else {
player->timer_1FC = 180; player->csEventTimer = 180;
} }
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 60); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 60);
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 60); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 60);
@ -330,11 +330,11 @@ void Venom2_LevelComplete(Player* player) {
gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255;
} }
Math_SmoothStepToF(&D_ctx_80177A48[1], 0.8f, 1.0f, 0.05f, 0.0f); 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); Math_SmoothStepToF(&player->zRotBank, 0.0f, 0.1f, 15.0f, 0.0f);
if (player->timer_1F8 == 1) { if (player->csTimer == 1) {
D_ctx_80177A48[4] = 0.0f; 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]); sp94 = player->pos.x - (gBosses[0].obj.pos.x + D_ctx_80177A48[5]);
sp90 = player->pos.y - (gBosses[0].obj.pos.y + 700.0f); sp90 = player->pos.y - (gBosses[0].obj.pos.y + 700.0f);
sp8C = player->pos.z - (gBosses[0].obj.pos.z + D_ctx_80177A48[6]); 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)); sp84 = Math_RadToDeg(Math_Atan2F(sp94, sp8C));
sp8C = sqrtf(SQ(sp94) + SQ(sp8C)); sp8C = sqrtf(SQ(sp94) + SQ(sp8C));
pad88 = Math_RadToDeg(-Math_Atan2F(sp90, sp8C)); pad88 = Math_RadToDeg(-Math_Atan2F(sp90, sp8C));
Math_SmoothStepToAngle(&player->unk_120, pad88, 0.1f, D_ctx_80177A48[4], 0.0f); Math_SmoothStepToAngle(&player->xRot_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; pad80 = Math_SmoothStepToAngle(&player->yRot_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_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); Math_SmoothStepToF(&D_ctx_80177A48[4], 3.0f, 1.0f, 0.1f, 0.0f);
Matrix_RotateX(gCalcMatrix, -(D_PI / 9), MTXF_NEW); 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; D_ctx_80177A48[3] += 1.0f;
sp64.x = 0.0f; sp64.x = 0.0f;
sp64.y = 0.0f; sp64.y = 0.0f;
@ -358,14 +358,14 @@ void Venom2_LevelComplete(Player* player) {
gCsCamEyeZ = player->pos.z + sp58.z; gCsCamEyeZ = player->pos.z + sp58.z;
Math_SmoothStepToF(D_ctx_80177A48, 0.5f, 1.0f, 0.01f, 0.0f); 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); 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)) { if ((player->csTimer == 0) && (fabsf(sp94) < 50.0f) && (fabsf(sp8C) < 50.0f)) {
player->unk_1D0++; player->csState++;
D_ctx_80177A48[2] = 0.75f; D_ctx_80177A48[2] = 0.75f;
D_ctx_80177A48[3] = 0.0f; D_ctx_80177A48[3] = 0.0f;
D_ctx_80177A48[4] = 0.0f; D_ctx_80177A48[4] = 0.0f;
if (player->unk_120 >= 180.0f) { if (player->xRot_120 >= 180.0f) {
player->unk_120 -= 360.0f; player->xRot_120 -= 360.0f;
} }
AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0); AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0);
player->unk_194 = 5.0f; player->unk_194 = 5.0f;
@ -376,17 +376,17 @@ void Venom2_LevelComplete(Player* player) {
break; break;
case 2: case 2:
player->unk_190 = 2.0f; 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); Math_SmoothStepToF(&D_ctx_80177A48[2], 4.0f, 1.0f, 0.05f, 0.0f);
if (player->unk_120 > 80.0f) { if (player->xRot_120 > 80.0f) {
Math_SmoothStepToF(&player->unk_12C, 10000.0f, 0.1f, 8.0f, 0.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.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(&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); 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(&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(&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); 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; break;
} }
if (player->timer_1FC == 150) { if (player->csEventTimer == 150) {
Radio_PlayMessage(gMsg_ID_8215, RCID_FOX); Radio_PlayMessage(gMsg_ID_8215, RCID_FOX);
AUDIO_PLAY_BGM(SEQ_ID_TO_ANDROSS | SEQ_FLAG); 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) || if ((gTeamShields[TEAM_ID_SLIPPY] > 0) || (gTeamShields[TEAM_ID_FALCO] > 0) ||
(gTeamShields[TEAM_ID_PEPPY] > 0)) { (gTeamShields[TEAM_ID_PEPPY] > 0)) {
Radio_PlayMessage(gMsg_ID_8230, RCID_FALCO); Radio_PlayMessage(gMsg_ID_8230, RCID_FALCO);
@ -446,9 +446,9 @@ void Venom2_LevelComplete(Player* player) {
} }
gCsCamAtX = player->pos.x; gCsCamAtX = player->pos.x;
gCsCamAtY = player->pos.y; gCsCamAtY = player->pos.y;
gCsCamAtZ = player->unk_138; gCsCamAtZ = player->trueZpos;
Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); Matrix_RotateX(gCalcMatrix, -((player->xRot_120 + player->rot.x + player->aerobaticPitch) * M_DTOR), MTXF_APPLY);
sp64.x = 0.0f; sp64.x = 0.0f;
sp64.y = 0.0f; sp64.y = 0.0f;
sp64.z = player->baseSpeed + player->boostSpeed; sp64.z = player->baseSpeed + player->boostSpeed;
@ -459,18 +459,18 @@ void Venom2_LevelComplete(Player* player) {
player->pos.x += player->vel.x; player->pos.x += player->vel.x;
player->pos.y += player->vel.y; player->pos.y += player->vel.y;
player->pos.z += player->vel.z; 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->unk_130, 0.0f, 0.1f, 15.0f, 0.0f); Math_SmoothStepToF(&player->zRotBarrelRoll, 0.0f, 0.1f, 15.0f, 0.0f);
Math_SmoothStepToAngle(&player->unk_4D8, 0.0f, 0.1f, 5.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.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.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.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.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.y, gCsCamAtY, D_ctx_80177A48[1], 100.0f, 0);
Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, 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->bobPhase += 10.0f;
player->unk_080 = -SIN_DEG(player->unk_088) * 0.3f; player->yBob = -SIN_DEG(player->bobPhase) * 0.3f;
player->unk_0F4 += 8.0f; player->rockPhase += 8.0f;
player->unk_0F0 = SIN_DEG(player->unk_0F4); player->rockAngle = SIN_DEG(player->rockPhase);
} }

View File

@ -1340,7 +1340,7 @@ void Map_8019E99C(void) {
gFillScreenRed = 0; gFillScreenRed = 0;
gFillScreenGreen = 0; gFillScreenGreen = 0;
gFillScreenBlue = 0; gFillScreenBlue = 0;
D_ctx_80177D20 = 0.0f; gPathProgress = 0.0f;
D_menu_801CF018 = 0; D_menu_801CF018 = 0;
@ -1588,7 +1588,7 @@ void Map_8019F600(void) {
//! @bug gPlanetPathStatus is 2 shorter than sPaths //! @bug gPlanetPathStatus is 2 shorter than sPaths
for (i = 0; i < ARRAY_COUNT(sPaths); i++) { for (i = 0; i < ARRAY_COUNT(sPaths); i++) {
gPlanetPathStatus[i] = 0; gPlanetPathStatus[i] = 0;
gTexturedLines[i].unk_24 = 0.0f; gTexturedLines[i].zScale = 0.0f;
} }
for (i = 0; i < ARRAY_COUNT(gMissionMedal); i++) { for (i = 0; i < ARRAY_COUNT(gMissionMedal); i++) {
@ -1639,7 +1639,7 @@ void Map_8019F83C(void) {
} }
sPaths[i].alpha = 0; 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(); Play_Setup();
gSavedObjectLoadIndex = 0; gSavedObjectLoadIndex = 0;
D_ctx_80177CB0 = 0.0f; gSavedPathProgress = 0.0f;
D_ctx_8017782C = 1; D_ctx_8017782C = 1;
} }
@ -6113,9 +6113,9 @@ void Map_801AC200(s32 index) {
f32 r2; f32 r2;
Vec3f vec; Vec3f vec;
v.x = gTexturedLines[index].unk_10.x - gTexturedLines[index].unk_04.x; v.x = gTexturedLines[index].posBB.x - gTexturedLines[index].posAA.x;
v.y = gTexturedLines[index].unk_10.y - gTexturedLines[index].unk_04.y; v.y = gTexturedLines[index].posBB.y - gTexturedLines[index].posAA.y;
v.z = gTexturedLines[index].unk_10.z - gTexturedLines[index].unk_04.z; v.z = gTexturedLines[index].posBB.z - gTexturedLines[index].posAA.z;
r = VEC3F_MAG(&v); r = VEC3F_MAG(&v);
@ -6128,9 +6128,9 @@ void Map_801AC200(s32 index) {
vec.y = (v.y / r) * (r / (sPaths[index].length - 1)); vec.y = (v.y / r) * (r / (sPaths[index].length - 1));
vec.z = (v.z / 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.x = gTexturedLines[index].posAA.x + (vec.x * D_menu_801CEEA0);
D_menu_801CEEB0.y = gTexturedLines[index].unk_04.y + (vec.y * D_menu_801CEEA0); D_menu_801CEEB0.y = gTexturedLines[index].posAA.y + (vec.y * D_menu_801CEEA0);
D_menu_801CEEB0.z = gTexturedLines[index].unk_04.z + (vec.z * D_menu_801CEEA0); D_menu_801CEEB0.z = gTexturedLines[index].posAA.z + (vec.z * D_menu_801CEEA0);
switch (D_menu_801CEEA4) { switch (D_menu_801CEEA4) {
case 0: case 0:
@ -6167,17 +6167,17 @@ void Map_801AC200(s32 index) {
return; return;
} }
} else { } else {
vec.x = (v.x / r) * gTexturedLines[index].unk_24; vec.x = (v.x / r) * gTexturedLines[index].zScale;
vec.y = (v.y / r) * gTexturedLines[index].unk_24; vec.y = (v.y / r) * gTexturedLines[index].zScale;
vec.z = (v.z / r) * gTexturedLines[index].unk_24; vec.z = (v.z / r) * gTexturedLines[index].zScale;
D_menu_801CEEB0.x = gTexturedLines[index].unk_04.x + vec.x; D_menu_801CEEB0.x = gTexturedLines[index].posAA.x + vec.x;
D_menu_801CEEB0.y = gTexturedLines[index].unk_04.y + vec.y; D_menu_801CEEB0.y = gTexturedLines[index].posAA.y + vec.y;
D_menu_801CEEB0.z = gTexturedLines[index].unk_04.z + vec.z; D_menu_801CEEB0.z = gTexturedLines[index].posAA.z + vec.z;
v.x = D_menu_801CEEB0.x - gTexturedLines[index].unk_04.x; v.x = D_menu_801CEEB0.x - gTexturedLines[index].posAA.x;
v.y = D_menu_801CEEB0.y - gTexturedLines[index].unk_04.y; v.y = D_menu_801CEEB0.y - gTexturedLines[index].posAA.y;
v.z = D_menu_801CEEB0.z - gTexturedLines[index].unk_04.z; v.z = D_menu_801CEEB0.z - gTexturedLines[index].posAA.z;
r2 = VEC3F_MAG(&v); r2 = VEC3F_MAG(&v);
if (((r / 9.0f) * 8.0f) < r2) { 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_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, 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); 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].mode = 4;
gTexturedLines[index].unk_04.x = srcPos.x; gTexturedLines[index].posAA.x = srcPos.x;
gTexturedLines[index].unk_04.y = srcPos.y; gTexturedLines[index].posAA.y = srcPos.y;
gTexturedLines[index].unk_04.z = srcPos.z; gTexturedLines[index].posAA.z = srcPos.z;
gTexturedLines[index].unk_10.x = destPos.x; gTexturedLines[index].posBB.x = destPos.x;
gTexturedLines[index].unk_10.y = destPos.y; gTexturedLines[index].posBB.y = destPos.y;
gTexturedLines[index].unk_10.z = destPos.z; gTexturedLines[index].posBB.z = destPos.z;
gTexturedLines[index].unk_20 = Math_Atan2F(x, z); gTexturedLines[index].yRot = Math_Atan2F(x, z);
gTexturedLines[index].unk_1C = -Math_Atan2F(y, sqrtf(SQ(x) + SQ(z))); gTexturedLines[index].xRot = -Math_Atan2F(y, sqrtf(SQ(x) + SQ(z)));
switch (gPlanetPathStatus[index]) { switch (gPlanetPathStatus[index]) {
case 1: case 1:
@ -6364,9 +6364,9 @@ void Map_801AC9A0(s32 index) {
break; break;
case 11: case 11:
Math_SmoothStepToF(&gTexturedLines[index].unk_24, target, 0.1f, 100.0f, 4.0f); Math_SmoothStepToF(&gTexturedLines[index].zScale, target, 0.1f, 100.0f, 4.0f);
gTexturedLines[index].unk_2F = 255; gTexturedLines[index].alpha = 255;
if (gTexturedLines[index].unk_24 == target) { if (gTexturedLines[index].zScale == target) {
Audio_KillSfxById(0x1900404D); Audio_KillSfxById(0x1900404D);
gPlanetPathStatus[index] = 4; gPlanetPathStatus[index] = 4;
} }
@ -6374,9 +6374,9 @@ void Map_801AC9A0(s32 index) {
case 5: case 5:
case 6: case 6:
Math_SmoothStepToF(&gTexturedLines[index].unk_24, target, 0.1f, 100.0f, 1.0f); Math_SmoothStepToF(&gTexturedLines[index].zScale, target, 0.1f, 100.0f, 1.0f);
if (gTexturedLines[index].unk_24 == target) { if (gTexturedLines[index].zScale == target) {
gTexturedLines[index].unk_24 = 0.0f; gTexturedLines[index].zScale = 0.0f;
gPlanetPathStatus[index] = 6; gPlanetPathStatus[index] = 6;
D_menu_801CEEAC = 255; D_menu_801CEEAC = 255;
} }
@ -6387,55 +6387,55 @@ void Map_801AC9A0(s32 index) {
if (D_menu_801CD944 == 7) { if (D_menu_801CD944 == 7) {
temp = 0.25f; temp = 0.25f;
} }
Math_SmoothStepToF(&gTexturedLines[index].unk_24, target, temp, 100.0f, 4.0f); Math_SmoothStepToF(&gTexturedLines[index].zScale, target, temp, 100.0f, 4.0f);
gTexturedLines[index].unk_2F = 255; gTexturedLines[index].alpha = 255;
if (gTexturedLines[index].unk_24 == target) { if (gTexturedLines[index].zScale == target) {
gPlanetPathStatus[index] = 3; gPlanetPathStatus[index] = 3;
} }
break; break;
case 3: case 3:
case 4: case 4:
gTexturedLines[index].unk_24 = target; gTexturedLines[index].zScale = target;
gTexturedLines[index].unk_2F = sPaths[index].alpha; gTexturedLines[index].alpha = sPaths[index].alpha;
break; break;
} }
if ((gPlanetPathStatus[index] == 1) || (gPlanetPathStatus[index] == 11) || (gPlanetPathStatus[index] == 4)) { if ((gPlanetPathStatus[index] == 1) || (gPlanetPathStatus[index] == 11) || (gPlanetPathStatus[index] == 4)) {
gTexturedLines[index].unk_2C = 32; gTexturedLines[index].red = 32;
gTexturedLines[index].unk_2D = 32; gTexturedLines[index].green = 32;
gTexturedLines[index].unk_2E = 32; gTexturedLines[index].blue = 32;
gTexturedLines[index].unk_28 = 4.0f; gTexturedLines[index].xyScale = 4.0f;
} else { } else {
switch (sPaths[index].type) { switch (sPaths[index].type) {
case PL_PATH_BLU: case PL_PATH_BLU:
gTexturedLines[index].unk_2C = 16; gTexturedLines[index].red = 16;
gTexturedLines[index].unk_2D = 64; gTexturedLines[index].green = 64;
gTexturedLines[index].unk_2E = 255; gTexturedLines[index].blue = 255;
gTexturedLines[index].unk_28 = 8.0f; gTexturedLines[index].xyScale = 8.0f;
break; break;
case PL_PATH_YLW: case PL_PATH_YLW:
gTexturedLines[index].unk_2C = 255; gTexturedLines[index].red = 255;
gTexturedLines[index].unk_2D = 175; gTexturedLines[index].green = 175;
gTexturedLines[index].unk_2E = 0; gTexturedLines[index].blue = 0;
gTexturedLines[index].unk_28 = 8.0f; gTexturedLines[index].xyScale = 8.0f;
break; break;
case PL_PATH_RED: case PL_PATH_RED:
gTexturedLines[index].unk_2C = 255; gTexturedLines[index].red = 255;
gTexturedLines[index].unk_2D = 0; gTexturedLines[index].green = 0;
gTexturedLines[index].unk_2E = 0; gTexturedLines[index].blue = 0;
gTexturedLines[index].unk_28 = 8.0f; gTexturedLines[index].xyScale = 8.0f;
break; break;
case PL_WARP_YLW: case PL_WARP_YLW:
case PL_WARP_RED: case PL_WARP_RED:
gTexturedLines[index].unk_2C = 0; gTexturedLines[index].red = 0;
gTexturedLines[index].unk_2D = 0; gTexturedLines[index].green = 0;
gTexturedLines[index].unk_2E = 0; gTexturedLines[index].blue = 0;
gTexturedLines[index].unk_2F = 0; gTexturedLines[index].alpha = 0;
gTexturedLines[index].unk_28 = 0.1f; gTexturedLines[index].xyScale = 0.1f;
break; break;
} }
} }

View File

@ -804,7 +804,7 @@ void Option_TrainingUpdate(void) {
gDrawMode = DRAW_NONE; gDrawMode = DRAW_NONE;
Play_Setup(); Play_Setup();
gSavedObjectLoadIndex = 0; gSavedObjectLoadIndex = 0;
D_ctx_80177CB0 = 0.0f; gSavedPathProgress = 0.0f;
D_ctx_8017782C = 1; D_ctx_8017782C = 1;
gControllerLock = 3; gControllerLock = 3;
AUDIO_SET_SPEC(SFXCHAN_0, AUDIOSPEC_28); AUDIO_SET_SPEC(SFXCHAN_0, AUDIOSPEC_28);