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
50 changed files with 4628 additions and 4611 deletions
+67 -66
View File
@@ -168,12 +168,12 @@ void AllRange_GreatFoxRepair(Player* player) {
Vec3f sp60;
gCsFrameCount++;
switch (player->unk_1D0) {
switch (player->csState) {
case 0:
player->unk_1F4 = player->timer_498 = player->damage = player->unk_280 = player->boostMeter =
player->hitTimer = player->timer_498 = player->damage = player->barrelRollAlpha = player->boostMeter =
player->boostCooldown = player->somersault = gCsFrameCount = 0;
player->unk_130 = player->camRoll = player->boostSpeed = player->unk_08C = player->unk_0D8.x =
player->unk_0D8.y = player->unk_0D8.z = player->unk_134 = player->unk_4D8 = 0.0f;
player->zRotBarrelRoll = player->camRoll = player->boostSpeed = player->camDist = player->knockback.x =
player->knockback.y = player->knockback.z = player->damageShake = player->aerobaticPitch = 0.0f;
gCsCamEyeX = 1673.0f;
gCsCamEyeY = 337.0f;
if (player->pos.z < 0.0f) {
@@ -181,11 +181,11 @@ void AllRange_GreatFoxRepair(Player* player) {
} else {
gCsCamEyeZ = 480.0f;
}
player->unk_0E8 = 0.0f;
player->rot.y = 0.0f;
player->pos.x = 2100.0f;
player->baseSpeed = 30.0f;
player->unk_0E4 = -8.0f;
player->unk_114 = 90.0f;
player->rot.x = -8.0f;
player->yRot_114 = 90.0f;
gCsCamAtX = 2100.0f;
player->pos.y = 450.0f;
gCsCamAtY = 450.0f;
@@ -193,7 +193,7 @@ void AllRange_GreatFoxRepair(Player* player) {
gCsCamAtZ = 0.0f;
D_ctx_80177A48[0] = 1.0f;
player->wings.modelId = 1;
player->unk_1D0++;
player->csState++;
break;
case 1:
if (gCsFrameCount >= 47) {
@@ -202,7 +202,7 @@ void AllRange_GreatFoxRepair(Player* player) {
gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0;
}
if (gCsFrameCount >= 64) {
player->unk_1D0++;
player->csState++;
player->baseSpeed = 0.0f;
}
break;
@@ -212,7 +212,7 @@ void AllRange_GreatFoxRepair(Player* player) {
player->pos.x = 400.0f;
player->pos.y = -420.0f;
player->pos.z = 0.0f;
player->unk_0EC = 0.0f;
player->rot.z = 0.0f;
gCsCamEyeX = -683.0f;
gCsCamEyeY = -346.0f;
gCsCamEyeZ = 305.0f;
@@ -225,7 +225,7 @@ void AllRange_GreatFoxRepair(Player* player) {
gRightWingHealth[0] = gLeftWingHealth[0] = 60;
}
AUDIO_PLAY_SFX(0x4900200E, gDefaultSfxSource, 4);
player->unk_1D0++;
player->csState++;
}
break;
case 3:
@@ -233,9 +233,9 @@ void AllRange_GreatFoxRepair(Player* player) {
gCsCamEyeZ -= 1.0f;
if (gFillScreenAlpha == 0) {
player->unk_190 = player->unk_194 = 5.0f;
player->unk_114 = 90.0f;
player->yRot_114 = 90.0f;
player->baseSpeed = gArwingSpeed;
player->unk_1D0++;
player->csState++;
AUDIO_PLAY_SFX(0x09000002, player->sfxSource, 0);
}
@@ -243,7 +243,7 @@ void AllRange_GreatFoxRepair(Player* player) {
case 4:
gCsCamEyeZ -= 1.0f;
gCsCamEyeX -= 1.0f;
player->unk_0E4 += 0.4f;
player->rot.x += 0.4f;
if (gCsFrameCount >= 130) {
player->state_1C8 = PLAYERSTATE_1C8_ACTIVE;
player->wings.modelId = 0;
@@ -257,10 +257,10 @@ void AllRange_GreatFoxRepair(Player* player) {
gCsCamAtX = player->pos.x;
gCsCamAtY = player->pos.y;
gCsCamAtZ = player->pos.z;
Math_SmoothStepToF(&player->unk_0EC, 0.0f, 0.1f, 2.0f, 0);
Math_SmoothStepToF(&player->unk_12C, 0.0f, 0.1f, 3.0f, 0);
Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114 + 180.0f) * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY);
Math_SmoothStepToF(&player->rot.z, 0.0f, 0.1f, 2.0f, 0);
Math_SmoothStepToF(&player->zRotBank, 0.0f, 0.1f, 3.0f, 0);
Matrix_RotateY(gCalcMatrix, (player->rot.y + player->yRot_114 + 180.0f) * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -(player->rot.x * M_DTOR), MTXF_APPLY);
sp6C.x = 0.0f;
sp6C.y = 0.0f;
sp6C.z = player->baseSpeed;
@@ -271,8 +271,8 @@ void AllRange_GreatFoxRepair(Player* player) {
player->pos.x += player->vel.x;
player->pos.y += player->vel.y;
player->pos.z += player->vel.z;
player->unk_138 = player->pos.z;
player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130;
player->trueZpos = player->pos.z;
player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll;
Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0);
Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0);
Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0);
@@ -284,14 +284,14 @@ void AllRange_GreatFoxRepair(Player* player) {
void AllRange_FortunaIntro(Player* player) {
Vec3f sp24;
Math_Vec3fFromAngles(&sp24, 0.0f, player->unk_114 + 180.0f, 40.0f);
Math_Vec3fFromAngles(&sp24, 0.0f, player->yRot_114 + 180.0f, 40.0f);
player->vel.x = sp24.x;
player->vel.z = sp24.z;
player->vel.y = sp24.y;
player->pos.x += player->vel.x;
player->pos.y += player->vel.y;
player->pos.z += player->vel.z;
player->unk_138 = player->pos.z;
player->trueZpos = player->pos.z;
player->cam.eye.x = -200.0f;
player->cam.eye.y = 500.0f;
player->cam.eye.z = 7000.0f;
@@ -415,7 +415,7 @@ void ActorAllRange_SpawnTeam(void) {
if (actor->aiType <= AI360_PEPPY) {
AUDIO_PLAY_SFX(0x3100000C, actor->sfxSource, 4);
actor->info.hitbox = SEGMENTED_TO_VIRTUAL(gTeamHitbox);
actor->info.unk_1C = 0.0f;
actor->info.targetOffset = 0.0f;
actor->info.bonus = 0;
} else {
AUDIO_PLAY_SFX(0x31000011, actor->sfxSource, 4);
@@ -505,15 +505,15 @@ void func_360_8002F69C(Actor* this) {
}
gPlayer[0].cam.eye.y = 2500.0f;
gPlayer[0].cam.eye.z = 5000.0f;
gPlayer[0].cam.at.x = gActors[4].obj.pos.x;
gPlayer[0].cam.at.y = gActors[4].obj.pos.y;
gPlayer[0].cam.at.z = gActors[4].obj.pos.z;
gPlayer[0].cam.at.x = gActors[AI360_WOLF].obj.pos.x;
gPlayer[0].cam.at.y = gActors[AI360_WOLF].obj.pos.y;
gPlayer[0].cam.at.z = gActors[AI360_WOLF].obj.pos.z;
}
if ((gAllRangeEventTimer > D_360_800C9B4C) && (gStarWolfMsgTimer == 0)) {
gAllRangeFrameCount++;
for (i = 1, actor = &gActors[1]; i < 8; i++, actor++) {
for (i = AI360_FALCO, actor = &gActors[AI360_FALCO]; i <= AI360_ANDREW; i++, actor++) {
if ((actor->obj.status == OBJ_ACTIVE) && (actor->state == STATE360_2) && (actor->health < 70) &&
(actor->timer_0C6 != 0) && (actor->unk_0D4 == 1)) {
(actor->timer_0C6 != 0) && (actor->dmgSource == 1)) {
if ((gActors[actor->aiIndex].state == STATE360_3) && (gActors[actor->aiIndex].aiType <= AI360_ANDREW)) {
gActors[actor->aiIndex].iwork[2] = AI360_FOX;
gActors[actor->aiIndex].state = STATE360_2;
@@ -603,7 +603,7 @@ void func_360_8002FC00(Actor* this) {
}
if (gTeamShields[actor->aiIndex] > 0) {
func_360_8002FB4C(&gActors[actor->aiIndex]);
if ((actor->iwork[5] != 0) && (actor->unk_0D4 == 1) && (gActors[actor->aiIndex].iwork[3] == 0)) {
if ((actor->iwork[5] != 0) && (actor->dmgSource == 1) && (gActors[actor->aiIndex].iwork[3] == 0)) {
if (gTeamHelpActor == &gActors[actor->aiIndex]) {
gTeamHelpActor = NULL;
gTeamHelpTimer = 0;
@@ -814,40 +814,40 @@ void ActorAllRange_ApplyDamage(Actor* this) {
Vec3f sp48;
Vec3f sp3C;
if (this->unk_0D0 != 0) {
if (this->dmgType != 0) {
if (this->aiType == AI360_GREAT_FOX) {
this->unk_0D0 = 0;
this->dmgType = 0;
}
if ((this->unk_0D0 >= 2) && (this->aiType >= AI360_WOLF) && (this->aiType < AI360_KATT)) {
if ((this->dmgType >= 2) && (this->aiType >= AI360_WOLF) && (this->aiType < AI360_KATT)) {
this->damage = 10;
this->timer_0C2 = 10;
}
if (((this->aiType <= AI360_PEPPY) || (this->aiType == AI360_BILL) || (this->aiType == AI360_KATT)) &&
(this->unk_0D0 == 2)) {
this->unk_0D0 = 0;
(this->dmgType == 2)) {
this->dmgType = 0;
}
if ((this->unk_0D0 == 2) && (this->fwork[22] > 0.0f)) {
this->unk_0D0 = 0;
if ((this->dmgType == 2) && (this->fwork[22] > 0.0f)) {
this->dmgType = 0;
}
if (this->fwork[23] > 1.0f) {
this->unk_0D0 = 0;
this->dmgType = 0;
}
if (this->unk_0D0 != 0) {
if (this->dmgType != 0) {
var_a1 = false;
if ((this->unk_0B6 == 3) ||
((gCurrentLevel == LEVEL_BOLSE) && (gBosses[1].obj.status != OBJ_FREE) &&
(this->aiType >= AI360_WOLF)) ||
((gCurrentLevel == LEVEL_VENOM_2) && (this->aiType >= AI360_WOLF) && (this->aiType < AI360_10) &&
(this->unk_0D0 == 2))) {
(this->dmgType == 2))) {
this->damage = 0;
var_a1 = true;
if (gCurrentLevel == LEVEL_BOLSE) {
this->unk_0D4 = 0;
this->dmgSource = 0;
}
}
if (this->aiType >= AI360_WOLF) {
if (((this->unk_0D0 != 3) || (this->aiType != AI360_WOLF)) &&
((this->aiType != AI360_MISSILE) || (this->unk_0D0 != 2))) {
if (!((this->dmgType == 3) && (this->aiType == AI360_WOLF)) &&
!((this->aiType == AI360_MISSILE) && (this->dmgType == 2))) {
this->health -= this->damage;
}
} else if ((this->aiType <= AI360_PEPPY) && (this->state != STATE360_6)) {
@@ -861,7 +861,7 @@ void ActorAllRange_ApplyDamage(Actor* this) {
this->health = 0;
if (this->aiType == AI360_MISSILE) {
SectorZ_80199900(this, 1);
if (this->unk_0D4 == 1) {
if (this->dmgSource == 1) {
if (gActors[8].obj.status == OBJ_ACTIVE) {
Radio_PlayMessage(gMsg_ID_16140, RCID_KATT);
}
@@ -869,7 +869,7 @@ void ActorAllRange_ApplyDamage(Actor* this) {
gHitCount += 11;
D_ctx_80177850 = 15;
} else {
switch (this->unk_0D4) {
switch (this->dmgSource) {
case 102:
Radio_PlayMessage(gMsg_ID_16170, RCID_FALCO);
break;
@@ -919,13 +919,13 @@ void ActorAllRange_ApplyDamage(Actor* this) {
this->timer_0BC = RAND_INT(50.0f);
}
}
if ((this->aiType >= AI360_WOLF) && (this->aiType < AI360_KATT)) {
if ((this->aiType >= AI360_WOLF) && (this->aiType <= AI360_ANDREW)) {
this->timer_0BC = RAND_INT(40.0f) + 60.0f;
}
if (this->damage >= 20) {
this->timer_0BC = 0;
}
if ((gCurrentLevel == LEVEL_KATINA) && (this->unk_0B6 == 1) && (this->unk_0D4 == 1)) {
if ((gCurrentLevel == LEVEL_KATINA) && (this->unk_0B6 == 1) && (this->dmgSource == 1)) {
if (gKaAllyKillCount < 2) {
ActorAllRange_PlayMessage(gMsg_ID_18018, RCID_BILL);
}
@@ -968,7 +968,7 @@ void ActorAllRange_ApplyDamage(Actor* this) {
if ((this->aiType >= AI360_WOLF) && (this->aiType <= AI360_ANDREW)) {
sStarWolfKillTimer = 150;
}
switch (this->unk_0D4) {
switch (this->dmgSource) {
case 1:
if (this->aiType >= AI360_10) {
switch (this->iwork[2]) {
@@ -987,10 +987,10 @@ void ActorAllRange_ApplyDamage(Actor* this) {
case 102:
case 103:
case 104:
if ((this->aiType >= AI360_WOLF) && (this->aiType < AI360_KATT)) {
if ((this->aiType >= AI360_WOLF) && (this->aiType <= AI360_ANDREW)) {
if ((gStarWolfTeamAlive[0] + gStarWolfTeamAlive[1] + gStarWolfTeamAlive[2] +
gStarWolfTeamAlive[3]) == 0) {
switch (this->unk_0D4) {
switch (this->dmgSource) {
case 102:
Radio_PlayMessage(gMsg_ID_9438, RCID_FALCO);
break;
@@ -1002,10 +1002,10 @@ void ActorAllRange_ApplyDamage(Actor* this) {
break;
}
} else {
gActors[this->unk_0D4 - 101].iwork[1] = 80;
gActors[this->dmgSource - 101].iwork[1] = 80;
}
} else {
gActors[this->unk_0D4 - 101].iwork[1] = 80;
gActors[this->dmgSource - 101].iwork[1] = 80;
}
break;
}
@@ -1054,7 +1054,7 @@ void ActorAllRange_ApplyDamage(Actor* this) {
this->fwork[12] = sp3C.z;
}
if ((gRadioState == 0) && (gActors[0].obj.status == OBJ_ACTIVE)) {
if (this->unk_0D0 == 3) {
if (this->dmgType == 3) {
switch (this->aiType) {
case AI360_FALCO:
ActorAllRange_PlayMessage(gMsg_ID_20210, RCID_FALCO);
@@ -1069,11 +1069,11 @@ void ActorAllRange_ApplyDamage(Actor* this) {
ActorAllRange_PlayMessage(gMsg_ID_20084, RCID_KATT);
break;
}
} else if (this->unk_0D4 < 105) {
} else if (this->dmgSource <= AI360_PEPPY + 101) {
if (this->aiType >= AI360_WOLF) {
if (this->unk_0D4 == 1) {
if ((gCurrentLevel == LEVEL_KATINA) && (this->unk_0B6 == 1) && (gKaKilledAlly == 0)) {
gKaKilledAlly = 1;
if (this->dmgSource == 1) {
if ((gCurrentLevel == LEVEL_KATINA) && (this->unk_0B6 == 1) && !gKaKilledAlly) {
gKaKilledAlly = true;
Radio_PlayMessage(gMsg_ID_18015, RCID_BILL);
} else if (this->aiType == AI360_KATT) {
ActorAllRange_PlayMessage(gMsg_ID_20084, RCID_KATT);
@@ -1096,7 +1096,7 @@ void ActorAllRange_ApplyDamage(Actor* this) {
}
}
}
} else if (this->unk_0D4 == 1) {
} else if (this->dmgSource == AI360_FOX + 1) {
switch (this->aiType) {
case AI360_FALCO:
ActorAllRange_PlayMessage(gMsg_ID_20060, RCID_FALCO);
@@ -1149,7 +1149,7 @@ void ActorAllRange_ApplyDamage(Actor* this) {
}
}
}
this->unk_0D0 = 0;
this->dmgType = 0;
}
}
}
@@ -1158,7 +1158,7 @@ void ActorAllRange_CheckPlayerNearby(Actor* actor) {
if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (actor->iwork[24] != 0) &&
(fabsf(actor->obj.pos.x - gPlayer[0].pos.x) < 1000.0f) &&
(fabsf(actor->obj.pos.y - gPlayer[0].pos.y) < 1000.0f) &&
(fabsf(actor->obj.pos.z - gPlayer[0].unk_138) < 1000.0f)) {
(fabsf(actor->obj.pos.z - gPlayer[0].trueZpos) < 1000.0f)) {
actor->iwork[10]++;
} else {
actor->iwork[10] = 0;
@@ -1215,7 +1215,7 @@ void ActorAllRange_Update(Actor* this) {
if (this->aiType == AI360_EVENT_HANDLER) {
this->timer_0C2 = 10;
this->info.unk_1C = 0.0f;
this->info.targetOffset = 0.0f;
ActorAllRange_UpdateEvents(this);
return;
}
@@ -1344,7 +1344,7 @@ void ActorAllRange_Update(Actor* this) {
}
sp104 = 0;
this->iwork[5] = 0;
if ((this->aiType > AI360_FOX) && (this->aiType <= AI360_PEPPY) && (gTeamShields[this->aiType] <= 0) &&
if ((this->aiType >= AI360_FALCO) && (this->aiType <= AI360_PEPPY) && (gTeamShields[this->aiType] <= 0) &&
(this->state != STATE360_6)) {
this->state = STATE360_6;
if (this->timer_0C2 < 100) {
@@ -1489,7 +1489,7 @@ void ActorAllRange_Update(Actor* this) {
if (!gPlayer[0].somersault) {
this->fwork[4] = gPlayer[0].pos.x + spCC;
this->fwork[5] = gPlayer[0].pos.y + spC8;
this->fwork[6] = gPlayer[0].unk_138 + spC4;
this->fwork[6] = gPlayer[0].trueZpos + spC4;
this->fwork[1] = gPlayer[0].baseSpeed + 10.0f;
}
if ((gActors[0].state == STATE360_6) && (this->aiType <= AI360_PEPPY)) {
@@ -1546,7 +1546,8 @@ void ActorAllRange_Update(Actor* this) {
} else {
this->fwork[1] = gPlayer[0].baseSpeed - 5.0f;
if ((gCurrentLevel == LEVEL_VENOM_2) &&
(gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN) && (gPlayer[0].unk_4D8 > 100.0f)) {
(gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN) &&
(gPlayer[0].aerobaticPitch > 100.0f)) {
this->iwork[16] = STATE360_8;
}
}
@@ -2051,7 +2052,7 @@ void ActorAllRange_Update(Actor* this) {
radarMark->pos.x = this->obj.pos.x;
radarMark->pos.y = this->obj.pos.y;
radarMark->pos.z = this->obj.pos.z;
radarMark->unk_10 = this->unk_0F4.y + 180.0f;
radarMark->yRot = this->unk_0F4.y + 180.0f;
if (this->iwork[1] != 0) {
this->iwork[1]--;
if ((this->iwork[1] == 0) && (gActors[0].state == STATE360_2) && (gRadioState == 0)) {
@@ -2095,7 +2096,7 @@ void ActorAllRange_Update(Actor* this) {
func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 0.0f, 0.0f, 0.0f, 5.0f, 15);
func_effect_8007A6F0(&this->obj.pos, 0x2903A008);
} else {
this->unk_0D0 = 1;
this->dmgType = 1;
this->damage = 10;
this->health = 0;
ActorAllRange_ApplyDamage(this);
@@ -2257,7 +2258,7 @@ void ActorAllRange_Draw(ActorAllRange* this) {
case AI360_GREAT_FOX:
Display_SetSecondLight(&this->obj.pos);
this->unk_0B6 = 1;
Actor195_Draw(this);
ActorCutscene_Draw(this);
break;
case AI360_MISSILE:
Animation_GetFrameData(&D_SZ_6006D64, 0, sp7C);
+86 -86
View File
@@ -52,7 +52,7 @@ void func_beam_80035E78(PlayerShot* shot) {
if (shot->unk_5C == 0) {
shot->vel.x = shot->vel.y = shot->vel.z = shot->obj.rot.x = shot->obj.rot.y = shot->obj.rot.z = 0.0f;
shot->unk_44 = 1.0f;
shot->scale = 1.0f;
shot->unk_5C = 1;
shot->unk_64 = 30;
shot->unk_58 = 150;
@@ -137,7 +137,7 @@ void func_beam_80036318(PlayerShot* shot) {
}
func_beam_80035E78(shot);
} else if (shot->obj.id == PLAYERSHOT_8) {
shot->unk_44 = 7.5f;
shot->scale = 7.5f;
for (i = 0; i < ARRAY_COUNT(gActors); i++) {
gActors[i].lockOnTimers[shot->playerNum] = 0;
}
@@ -367,7 +367,7 @@ s32 func_beam_80036F88(PlayerShot* shot, Actor* actor) {
if (count != 0) {
xySizeMod = 0.0f;
if (actor->info.unk_16 == 1) {
xySizeMod = fabsf((actor->obj.pos.z + D_ctx_80177D20) / 50.0f) + 10.0f;
xySizeMod = fabsf((actor->obj.pos.z + gPathProgress) / 50.0f) + 10.0f;
if ((shot->playerNum < 4) &&
((gLaserStrength[shot->playerNum] != LASERS_SINGLE) || (shot->obj.id == PLAYERSHOT_8))) {
xySizeMod += 30.0f;
@@ -429,7 +429,7 @@ bool func_beam_80037438(PlayerShot* shot, Actor* actor) {
if (((s32) hitboxData[0] != 0) && (sqrtf(SQ(temp_fv1) + SQ(temp_fa0)) <= 500.0f)) {
if (shot->playerNum < 4) {
temp_fv1 = actor->obj.pos.x - gPlayer[0].cam.eye.x;
temp_fa0 = actor->obj.pos.z + D_ctx_80177D20 - gPlayer[0].cam.eye.z;
temp_fa0 = actor->obj.pos.z + gPathProgress - gPlayer[0].cam.eye.z;
var_fa1 = (sqrtf(SQ(temp_fv1) + SQ(temp_fa0)) / 50.0f) + 20.0f + 10.0f;
if (var_fa1 > 200.0f) {
var_fa1 = 200.0f;
@@ -486,7 +486,7 @@ bool func_beam_8003774C(PlayerShot* shot, ObjectId objId, Object* obj) {
sp7C.z = obj->pos.z - shot->obj.pos.z;
// undefined behavior: if this check fails, the function returns no value
if (((fabsf(sp7C.x) < 1100.0f) && (fabsf(sp7C.z) < 1100.0f) && (shot->obj.pos.y < 900.0f)) ||
(objId == OBJ_BOSS_313) || (objId == ACTOR_EVENT_ID) || (objId == OBJ_SCENERY_39)) {
(objId == OBJ_BOSS_313) || (objId == ACTOR_EVENT_ID) || (objId == OBJ_SCENERY_ME_TUNNEL)) {
Matrix_RotateY(gCalcMatrix, -obj->rot.y * M_DTOR, MTXF_NEW);
sp7C.x = shot->obj.pos.x - obj->pos.x;
sp7C.y = shot->obj.pos.y - obj->pos.y;
@@ -533,7 +533,7 @@ bool func_beam_8003774C(PlayerShot* shot, ObjectId objId, Object* obj) {
case OBJ_BOSS_313:
objId = COL1_8;
break;
case OBJ_SCENERY_39:
case OBJ_SCENERY_ME_TUNNEL:
objId = COL1_1;
break;
case OBJ_SCENERY_120:
@@ -652,8 +652,8 @@ void func_beam_80037CF4(PlayerShot* shot, Actor* actor, s32 hitIndex) {
Vec3f sp44 = { 0.0f, 0.0f, -100.0f };
Vec3f sp38;
actor->unk_0D0 = 1;
actor->unk_0D2 = hitIndex - 1;
actor->dmgType = 1;
actor->dmgPart = hitIndex - 1;
actor->timer_0C2 = 2;
actor->damage = 10;
if ((shot->playerNum < 4) && (gPlayer[shot->playerNum].form != FORM_LANDMASTER)) {
@@ -677,19 +677,19 @@ void func_beam_80037CF4(PlayerShot* shot, Actor* actor, s32 hitIndex) {
if (gCurrentLevel == LEVEL_AQUAS) {
actor->damage = 31;
} else {
actor->unk_0D0 = 2;
actor->dmgType = 2;
actor->damage = 30;
actor->lockOnTimers[shot->playerNum] = 0;
}
}
actor->unk_0D4 = shot->playerNum + 1;
actor->dmgSource = shot->playerNum + 1;
actor->hitPos.x = shot->obj.pos.x;
actor->hitPos.y = shot->obj.pos.y;
actor->hitPos.z = shot->obj.pos.z;
if (((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0D2 == 0) &&
if (((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->dmgPart == 0) &&
((actor->unk_0B4 == EINFO_48) || (actor->unk_0B4 == EINFO_49) || (actor->unk_0B4 == EINFO_50))) ||
((actor->obj.id == OBJ_ACTOR_ALLRANGE) && (actor->fwork[23] > 1.0f)) ||
((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0D2 == 0) && (actor->unk_0B4 == EINFO_67)) ||
((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->dmgPart == 0) && (actor->unk_0B4 == EINFO_67)) ||
((actor->obj.id == OBJ_ACTOR_261) && (shot->obj.id != PLAYERSHOT_8) &&
((actor->state < 3) || (actor->state >= 5))) ||
((actor->obj.id == OBJ_ACTOR_260) && (shot->obj.id != PLAYERSHOT_8) && (actor->timer_0BC != 0))) {
@@ -760,16 +760,16 @@ void func_beam_80038140(PlayerShot* shot) {
switch (actor->obj.id) {
case OBJ_ACTOR_180:
if (func_beam_8003774C(shot, actor->obj.id, &actor->obj)) {
actor->unk_0D0 = 1;
actor->unk_0D2 = shot->playerNum;
actor->dmgType = 1;
actor->dmgPart = shot->playerNum;
return;
}
break;
case OBJ_ACTOR_EVENT:
if (actor->unk_0B4 == EINFO_42) {
if (func_beam_8003774C(shot, ACTOR_EVENT_ID, &actor->obj)) {
actor->unk_0D0 = 1;
actor->unk_0D2 = shot->playerNum;
actor->dmgType = 1;
actor->dmgPart = shot->playerNum;
return;
}
} else if (actor->unk_0B4 == EINFO_63) {
@@ -827,7 +827,7 @@ void func_beam_80038140(PlayerShot* shot) {
!((gLaserStrength[shot->playerNum] == LASERS_SINGLE) && (shot->obj.id != PLAYERSHOT_8))) {
test.x = 100.0f;
}
if (player->unk_280 >= 100) {
if (player->barrelRollAlpha >= 100) {
test.x = 150.0f;
}
if (player->form == FORM_LANDMASTER) {
@@ -841,11 +841,11 @@ void func_beam_80038140(PlayerShot* shot) {
test.z = test.x;
if ((i != shot->playerNum) &&
((player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (player->state_1C8 == PLAYERSTATE_1C8_DOWN)) &&
(fabsf(player->unk_138 - shot->obj.pos.z) < test.z) &&
(fabsf(player->trueZpos - shot->obj.pos.z) < test.z) &&
(fabsf(player->pos.x - shot->obj.pos.x) < test.x) &&
(fabsf(player->pos.y - shot->obj.pos.y) < test.y)) {
if (player->unk_280 >= 100) {
shot->obj.rot.y = player->unk_0E8 + player->unk_114 + 180.0f + 90.0f;
if (player->barrelRollAlpha >= 100) {
shot->obj.rot.y = player->rot.y + player->yRot_114 + 180.0f + 90.0f;
shot->obj.rot.x = RAND_FLOAT(360.0f);
Matrix_RotateY(gCalcMatrix, shot->obj.rot.y * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, shot->obj.rot.x * M_DTOR, MTXF_APPLY);
@@ -860,10 +860,10 @@ void func_beam_80038140(PlayerShot* shot) {
shot->obj.pos.z += 2.0f * shot->vel.z;
shot->unk_64 = 5;
AUDIO_PLAY_SFX(0x09007011, player->sfxSource, 0);
func_effect_80078E50(player->pos.x, player->pos.y, player->unk_138, 8.0f);
func_effect_80078E50(player->pos.x, player->pos.y, player->trueZpos, 8.0f);
} else {
func_beam_80036318(shot);
if (player->unk_1F4 == 0) {
if (player->hitTimer == 0) {
if (gPlayer[0].form == 3) {
Player_ApplyDamage(player, 0, 60);
} else {
@@ -873,11 +873,11 @@ void func_beam_80038140(PlayerShot* shot) {
if (gCamCount != 1) {
player->unk_288 = shot->playerNum + 1;
}
player->unk_0D8.x = shot->vel.x * 0.1f;
player->unk_0D8.y = shot->vel.y * 0.1f;
player->unk_0D8.z = shot->vel.z * 0.1f;
player->knockback.x = shot->vel.x * 0.1f;
player->knockback.y = shot->vel.y * 0.1f;
player->knockback.z = shot->vel.z * 0.1f;
if (player->form != FORM_ON_FOOT) {
func_effect_8007D1E0(player->pos.x, player->pos.y, player->unk_138, 2.0f);
func_effect_8007D1E0(player->pos.x, player->pos.y, player->trueZpos, 2.0f);
}
}
}
@@ -885,7 +885,7 @@ void func_beam_80038140(PlayerShot* shot) {
}
}
}
if ((gGroundType == 4) && Ground_801B6AEC(shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z + D_ctx_80177D20)) {
if ((gGroundType == 4) && Ground_801B6AEC(shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z + gPathProgress)) {
func_beam_80036318(shot);
if (shot->obj.id != PLAYERSHOT_4) {
func_effect_8007A900(shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z, 2.0f, 255, 15, 0);
@@ -915,7 +915,7 @@ void func_beam_80038140(PlayerShot* shot) {
} else {
for (i = 0, scenery = gScenery; i < 50; i++, scenery++) {
if (scenery->obj.status == OBJ_ACTIVE) {
if ((scenery->obj.id == OBJ_SCENERY_1) || (scenery->obj.id == OBJ_SCENERY_39) ||
if ((scenery->obj.id == OBJ_SCENERY_1) || (scenery->obj.id == OBJ_SCENERY_ME_TUNNEL) ||
(scenery->obj.id == OBJ_SCENERY_4) || (scenery->obj.id == OBJ_SCENERY_5) ||
(scenery->obj.id == OBJ_SCENERY_120) || (scenery->obj.id == OBJ_SCENERY_124) ||
(scenery->obj.id == OBJ_SCENERY_126) || (scenery->obj.id == OBJ_SCENERY_47) ||
@@ -1035,7 +1035,7 @@ void func_beam_80038F34(PlayerShot* shot) {
Vec3f sp4C = { 0.0f, 0.0f, 0.0f };
s32 sp48 = 0;
Matrix_Translate(gGfxMatrix, shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z + D_ctx_80177D20, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z + gPathProgress, MTXF_APPLY);
Matrix_MultVec3f(gGfxMatrix, &sp4C, &D_beam_8015F950);
if ((D_beam_8015F950.z < 0.0f) && (D_beam_8015F950.z > -10000.0f)) {
if (fabsf(D_beam_8015F950.x) < (fabsf(D_beam_8015F950.z * 0.5f) + 500.0f)) {
@@ -1217,7 +1217,7 @@ void func_beam_80039A50(PlayerShot* shot) {
f32 var_fv1;
s32 sp104 = 0;
Matrix_Translate(gGfxMatrix, shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z + D_ctx_80177D20, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z + gPathProgress, MTXF_APPLY);
Matrix_MultVec3f(gGfxMatrix, &sp11C, &D_beam_8015F950);
if ((D_beam_8015F950.z < 0.0f) && (D_beam_8015F950.z > -10000.0f)) {
var_fv1 = fabsf(D_beam_8015F950.x); // probably fake. The use of temps was likely different
@@ -1241,9 +1241,9 @@ void func_beam_80039A50(PlayerShot* shot) {
Matrix_RotateX(gGfxMatrix, shot->obj.rot.x * M_DTOR, MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, shot->obj.rot.z * M_DTOR, MTXF_APPLY);
if ((shot->obj.id == PLAYERSHOT_BOMB) && (shot->unk_5C == 0)) {
Matrix_RotateZ(gGfxMatrix, shot->unk_34 * M_DTOR, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, shot->unk_30 * M_DTOR, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, shot->unk_2C * M_DTOR, MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, shot->vec_2C.z * M_DTOR, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, shot->vec_2C.y * M_DTOR, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, shot->vec_2C.x * M_DTOR, MTXF_APPLY);
}
}
Matrix_Translate(gGfxMatrix, 0.f, 0.f, D_800C9BD8[shot->obj.id], MTXF_APPLY);
@@ -1259,7 +1259,7 @@ void func_beam_80039A50(PlayerShot* shot) {
gSPDisplayList(gMasterDisp++, D_10231A0);
Matrix_Pop(&gGfxMatrix);
Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z + D_ctx_80177D20,
Matrix_Translate(gGfxMatrix, shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z + gPathProgress,
MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].camYaw, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].camPitch, MTXF_APPLY);
@@ -1292,7 +1292,7 @@ void func_beam_80039A50(PlayerShot* shot) {
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_1024AC0);
} else {
Matrix_Scale(gGfxMatrix, shot->unk_44, shot->unk_44, shot->unk_44, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, shot->scale, shot->scale, shot->scale, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
if (gVersusMode) {
RCP_SetupDL_49();
@@ -1371,7 +1371,7 @@ void func_beam_80039A50(PlayerShot* shot) {
break;
case PLAYERSHOT_6:
case PLAYERSHOT_7:
Matrix_Scale(gGfxMatrix, shot->unk_44, shot->unk_44, shot->unk_44, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, shot->scale, shot->scale, shot->scale, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
RCP_SetupDL(&gMasterDisp, 0x31);
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255);
@@ -1399,19 +1399,19 @@ void func_beam_80039A50(PlayerShot* shot) {
gSPDisplayList(gMasterDisp++, D_AQ_600DB80);
Matrix_Pop(&gGfxMatrix);
Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, shot->obj.pos.x, gGroundHeight, shot->obj.pos.z + D_ctx_80177D20,
Matrix_Translate(gGfxMatrix, shot->obj.pos.x, gGroundHeight, shot->obj.pos.z + gPathProgress,
MTXF_APPLY);
Matrix_Scale(gGfxMatrix, shot->unk_2C, shot->unk_30, shot->unk_34, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, shot->vec_2C.x, shot->vec_2C.y, shot->vec_2C.z, MTXF_APPLY);
RCP_SetupDL(&gMasterDisp, 0x31);
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 32, 32, 0, shot->unk_58);
gDPSetEnvColor(gMasterDisp++, 32, 16, 16, shot->unk_58);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_1024AC0);
} else if (shot->unk_5C == 0) {
if (!(shot->unk_44 > 1.5f)) {
if (!(shot->scale > 1.5f)) {
Matrix_Pop(&gGfxMatrix);
Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z + D_ctx_80177D20,
Matrix_Translate(gGfxMatrix, shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z + gPathProgress,
MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].camYaw, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].camPitch, MTXF_APPLY);
@@ -1457,7 +1457,7 @@ void func_beam_80039A50(PlayerShot* shot) {
gSPDisplayList(gMasterDisp++, D_10231A0);
Matrix_Pop(&gGfxMatrix);
Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z + D_ctx_80177D20,
Matrix_Translate(gGfxMatrix, shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z + gPathProgress,
MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].camYaw, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].camPitch, MTXF_APPLY);
@@ -1509,10 +1509,10 @@ void func_beam_8003B00C(PlayerShot* shot, Player* player) {
Vec3f sp38;
switch (shot->unk_5C) {
case 0:
Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY);
Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0) * M_DTOR), MTXF_APPLY);
Matrix_Translate(gCalcMatrix, player->unk_084, player->unk_080, 0.0f, MTXF_APPLY);
Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -(player->rot.x * M_DTOR), MTXF_APPLY);
Matrix_RotateZ(gCalcMatrix, -((player->bankAngle + player->rockAngle) * M_DTOR), MTXF_APPLY);
Matrix_Translate(gCalcMatrix, player->xShake, player->yBob, 0.0f, MTXF_APPLY);
sp5C.x = 0.0f;
sp5C.y = 0.0f;
sp5C.z = player->baseSpeed + 200.0f;
@@ -1526,19 +1526,19 @@ void func_beam_8003B00C(PlayerShot* shot, Player* player) {
Matrix_MultVec3f(gCalcMatrix, &sp5C, &sp44);
shot->unk_48 = player->pos.x + sp44.x;
shot->unk_4C = player->pos.y + sp44.y;
shot->unk_50 = player->unk_138 + sp44.z;
shot->unk_44 += 200.0f;
if (shot->unk_44 > 5000.0f) {
shot->unk_44 = 5000.0f;
shot->unk_50 = player->trueZpos + sp44.z;
shot->scale += 200.0f;
if (shot->scale > 5000.0f) {
shot->scale = 5000.0f;
}
for (sp5C.z = 0.0f; sp5C.z <= shot->unk_44; sp5C.z += 200.0f) {
for (sp5C.z = 0.0f; sp5C.z <= shot->scale; sp5C.z += 200.0f) {
Matrix_MultVec3f(gCalcMatrix, &sp5C, &sp38);
D_ctx_80178498 = shot->obj.pos.z;
D_ctx_801784A0 = shot->obj.pos.y;
D_ctx_8017849C = shot->obj.pos.x;
shot->obj.pos.x = player->pos.x + sp38.x;
shot->obj.pos.y = player->pos.y + sp38.y;
shot->obj.pos.z = player->unk_138 + sp38.z;
shot->obj.pos.z = player->trueZpos + sp38.z;
Matrix_Push(&gCalcMatrix);
func_beam_80038140(shot);
Matrix_Pop(&gCalcMatrix);
@@ -1552,7 +1552,7 @@ void func_beam_8003B00C(PlayerShot* shot, Player* player) {
}
}
shot->unk_64 = 30;
shot->obj.rot.y = player->unk_0E8 + player->unk_114;
shot->obj.rot.y = player->rot.y + player->yRot_114;
if (!(gControllerHold->button & U_CBUTTONS) && !(gControllerHold->button & A_BUTTON)) {
shot->unk_5C = 1;
}
@@ -1698,9 +1698,9 @@ bool func_beam_8003BB4C(PlayerShot* shot) {
var_fa0 = 200.0f;
}
for (i = 0, actor = gActors; i < 60; i++, actor++) {
if ((actor->obj.status == OBJ_ACTIVE) && (actor->info.unk_1C != 0.0f) &&
if ((actor->obj.status == OBJ_ACTIVE) && (actor->info.targetOffset != 0.0f) &&
((actor->lockOnTimers[shot->playerNum] == 0) && (fabsf(shot->obj.pos.x - actor->obj.pos.x) <= var_fa0) &&
(fabsf(shot->obj.pos.y - (actor->obj.pos.y + actor->info.unk_1C)) <= var_fa0) &&
(fabsf(shot->obj.pos.y - (actor->obj.pos.y + actor->info.targetOffset)) <= var_fa0) &&
(fabsf(shot->obj.pos.z - actor->obj.pos.z) <= var_fa0))) {
actor->lockOnTimers[shot->playerNum] = 20;
func_enmy_80060F30(gPlayer[shot->playerNum].sfxSource, 0x49008027, shot->playerNum);
@@ -1720,7 +1720,7 @@ bool func_beam_8003BB4C(PlayerShot* shot) {
(player->form != FORM_ON_FOOT) && (i != shot->playerNum) &&
(gVsLockOnTimers[i][shot->playerNum] == 0) && (fabsf(shot->obj.pos.x - player->pos.x) <= var_fa0) &&
(fabsf(shot->obj.pos.y - player->pos.y) <= var_fa0) &&
(fabsf(shot->obj.pos.z - player->unk_138) <= var_fa0)) {
(fabsf(shot->obj.pos.z - player->trueZpos) <= var_fa0)) {
gVsLockOnTimers[0][shot->playerNum] = gVsLockOnTimers[1][shot->playerNum] =
gVsLockOnTimers[2][shot->playerNum] = gVsLockOnTimers[3][shot->playerNum] = 0;
gVsLockOnTimers[i][shot->playerNum] = 20;
@@ -1771,10 +1771,10 @@ void func_beam_8003C008(PlayerShot* shot) {
if ((boss->obj.status == OBJ_ACTIVE) && (boss->timer_05A == 0)) {
if (boss->obj.id == OBJ_BOSS_316) {
var_s6 = gGameFrameCount % 8U;
var_fs2 = shot->unk_44 * 40.0f;
var_fs2 = shot->scale * 40.0f;
} else {
var_s6 = gGameFrameCount % 16U;
var_fs2 = shot->unk_44 * 30.0f;
var_fs2 = shot->scale * 30.0f;
}
hitboxData = boss->info.hitbox;
count = *hitboxData++;
@@ -1852,7 +1852,7 @@ void func_beam_8003C4D0(PlayerShot* shot, s32 damage) {
Scenery* scenery;
Effect* effect;
Player* player;
f32 temp_fs2 = shot->unk_44 * 60.0f;
f32 temp_fs2 = shot->scale * 60.0f;
for (i = 0, scenery = gScenery; i < 50; i++, scenery++) {
if ((scenery->obj.status == OBJ_ACTIVE) && (scenery->obj.id == OBJ_SCENERY_56)) {
@@ -1900,16 +1900,16 @@ void func_beam_8003C4D0(PlayerShot* shot, s32 damage) {
((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == EINFO_78)) ||
((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == EINFO_38)) ||
(actor->obj.id == OBJ_ACTOR_196)) {
actor->unk_0D0 = 2;
actor->unk_0D2 = 0;
actor->unk_0D4 = shot->playerNum + 1;
actor->dmgType = 2;
actor->dmgPart = 0;
actor->dmgSource = shot->playerNum + 1;
actor->damage = damage;
if (actor->info.bonus != 0) {
shot->bonus++;
}
} else if ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->scale >= 0.5f) && (damage > 30)) {
actor->unk_0D4 = shot->playerNum + 1;
actor->dmgSource = shot->playerNum + 1;
actor->vel.x = sp68 * 0.03f;
actor->vel.y = sp64 * 0.03f;
actor->vel.z = sp60 * 0.03f;
@@ -1922,9 +1922,9 @@ void func_beam_8003C4D0(PlayerShot* shot, s32 damage) {
shot->bonus++;
}
} else {
actor->unk_0D0 = 2;
actor->unk_0D2 = 0;
actor->unk_0D4 = shot->playerNum + 1;
actor->dmgType = 2;
actor->dmgPart = 0;
actor->dmgSource = shot->playerNum + 1;
actor->damage = damage;
if (actor->info.bonus != 0) {
shot->bonus++;
@@ -1969,10 +1969,10 @@ void func_beam_8003C4D0(PlayerShot* shot, s32 damage) {
}
if (gVersusMode) {
for (i = 0, player = gPlayer; i < gCamCount; i++, player++) {
if ((i != shot->playerNum) && (player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (player->unk_1F4 == 0)) {
if ((i != shot->playerNum) && (player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (player->hitTimer == 0)) {
sp68 = player->pos.x - shot->obj.pos.x;
sp64 = player->pos.y - shot->obj.pos.y;
sp60 = player->unk_138 - shot->obj.pos.z;
sp60 = player->trueZpos - shot->obj.pos.z;
if (sqrtf(SQ(sp68) + SQ(sp64) + SQ(sp60)) < temp_fs2) {
player->unk_288 = shot->playerNum + 1;
switch (player->form) {
@@ -2032,13 +2032,13 @@ void func_beam_8003CC08(PlayerShot* shot) {
case 1:
D_ctx_8017812C = 2;
shot->obj.rot.y += 1.0f;
Math_SmoothStepToF(&shot->unk_44, shot->unk_48, 0.05f, 1.5f, 0.001f);
Math_SmoothStepToF(&shot->scale, shot->unk_48, 0.05f, 1.5f, 0.001f);
if ((shot->unk_64 > 0) && (shot->unk_64 < 30)) {
if (!gVersusMode && ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) ||
(gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN))) {
test.x = gPlayer[0].pos.x - shot->obj.pos.x;
test.y = gPlayer[0].pos.y - shot->obj.pos.y;
test.z = gPlayer[0].unk_138 - shot->obj.pos.z;
test.z = gPlayer[0].trueZpos - shot->obj.pos.z;
var_ft5 = VEC3F_MAG(&test) * 0.01f;
if (var_ft5 > 60.0f) {
var_ft5 = 60.0f;
@@ -2090,12 +2090,12 @@ void func_beam_8003CF90(PlayerShot* shot) {
var_a3 = 0;
if (shot->unk_60 == 0) {
for (i = 0, actor = gActors; i < 60; i++, actor++) {
if ((actor->obj.status == OBJ_ACTIVE) && (actor->info.unk_1C != 0.0f) &&
if ((actor->obj.status == OBJ_ACTIVE) && (actor->info.targetOffset != 0.0f) &&
(actor->lockOnTimers[shot->playerNum] != 0)) {
var_a3 = 1;
actor->lockOnTimers[shot->playerNum] = 2;
D_800C9C24 = actor->obj.pos;
D_800C9C24.y += actor->info.unk_1C;
D_800C9C24.y += actor->info.targetOffset;
}
}
for (i = 0, player = gPlayer; i < gCamCount; i++, player++) {
@@ -2109,7 +2109,7 @@ void func_beam_8003CF90(PlayerShot* shot) {
} else {
D_800C9C24.y = player->pos.y + 30.0f;
}
D_800C9C24.z = player->unk_138;
D_800C9C24.z = player->trueZpos;
}
}
if (var_a3 != 0) {
@@ -2118,20 +2118,20 @@ void func_beam_8003CF90(PlayerShot* shot) {
sp64 = shot->obj.pos.z - D_800C9C24.z;
sp58 = Math_RadToDeg(Math_Atan2F(sp6C, sp64));
sp5C = Math_RadToDeg(-Math_Atan2F(sp68, sqrtf(SQ(sp6C) + SQ(sp64))));
if (shot->unk_30 >= 360.0f) {
shot->unk_30 -= 360.0f;
if (shot->vec_2C.y >= 360.0f) {
shot->vec_2C.y -= 360.0f;
}
if (shot->unk_30 < 0.0f) {
shot->unk_30 += 360.0f;
if (shot->vec_2C.y < 0.0f) {
shot->vec_2C.y += 360.0f;
}
if (shot->unk_2C >= 360.0f) {
shot->unk_2C -= 360.0f;
if (shot->vec_2C.x >= 360.0f) {
shot->vec_2C.x -= 360.0f;
}
if (shot->unk_2C < 0.0f) {
shot->unk_2C += 360.0f;
if (shot->vec_2C.x < 0.0f) {
shot->vec_2C.x += 360.0f;
}
Math_SmoothStepToAngle(&shot->unk_30, sp58, 1.0f, shot->unk_50, 0.0f);
Math_SmoothStepToAngle(&shot->unk_2C, sp5C, 1.0f, shot->unk_50, 0.0f);
Math_SmoothStepToAngle(&shot->vec_2C.y, sp58, 1.0f, shot->unk_50, 0.0f);
Math_SmoothStepToAngle(&shot->vec_2C.x, sp5C, 1.0f, shot->unk_50, 0.0f);
shot->unk_64 = 30;
} else {
shot->unk_60 = 1;
@@ -2147,8 +2147,8 @@ void func_beam_8003CF90(PlayerShot* shot) {
Vec3f sp44;
Vec3f sp38;
shot->obj.rot.y = shot->unk_30;
shot->obj.rot.x = shot->unk_2C;
shot->obj.rot.y = shot->vec_2C.y;
shot->obj.rot.x = shot->vec_2C.x;
Matrix_RotateY(gCalcMatrix, shot->obj.rot.y * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, shot->obj.rot.x * M_DTOR, MTXF_APPLY);
sp44.x = sp44.y = 0.0f;
@@ -2203,11 +2203,11 @@ void func_beam_8003D54C(PlayerShot* shot, s32 index) {
func_beam_8003BACC(shot);
break;
case PLAYERSHOT_8:
if (shot->unk_44 > 1.5f) {
if (shot->scale > 1.5f) {
func_beam_8003C4D0(shot, 30);
if (shot->bonus != 0) {
if (gVersusMode) {
D_ctx_80177C30[shot->playerNum] += shot->bonus;
gPlayerScores[shot->playerNum] += shot->bonus;
} else {
bonus = shot->bonus;
if (shot->bonus > 10) {
+28 -28
View File
@@ -414,7 +414,7 @@ void Background_DrawBackdrop(void) {
break;
case LEVEL_AQUAS:
if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) {
sp13C = ((Math_RadToDeg(gPlayer[gPlayerNum].camYaw) - gPlayer[gPlayerNum].unk_114));
sp13C = Math_RadToDeg(gPlayer[gPlayerNum].camYaw) - gPlayer[gPlayerNum].yRot_114;
sp134 = (gPlayer[gPlayerNum].camPitch * -7000.0f) - (gPlayer[gPlayerNum].cam.eye.y * 0.6f);
sp13C = Math_ModF(sp13C * -40.44444f * 2.0f, 7280.0f); // close to 7280.0f / 180.0f
RCP_SetupDL_17();
@@ -449,16 +449,16 @@ void Background_DrawBackdrop(void) {
case LEVEL_ZONESS:
case LEVEL_MACBETH:
case LEVEL_TITANIA:
sp12C = Math_RadToDeg(gPlayer[gPlayerNum].camYaw) - gPlayer[gPlayerNum].unk_114;
sp12C = Math_RadToDeg(gPlayer[gPlayerNum].camYaw) - gPlayer[gPlayerNum].yRot_114;
sp134 = (gPlayer[gPlayerNum].camPitch * -7000.0f) - (gPlayer[gPlayerNum].cam.eye.y * 0.6f);
sp13C = sp12C * -40.44444f * 2.0f; // close to 7280.0f / 180.0f
if ((gCurrentLevel == LEVEL_TITANIA) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) &&
(gPlayer[0].unk_1D0 < 3)) {
(gPlayer[0].csState < 3)) {
D_bg_8015F968 += __sinf(gPlayer[0].camYaw) * 20.0f;
sp13C += D_bg_8015F968;
}
if ((gCurrentLevel == LEVEL_SOLAR) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) &&
(gPlayer[0].unk_1D0 >= 2) && (gPlayer[0].cam.eye.z <= -1900.0f)) {
(gPlayer[0].csState >= 2) && (gPlayer[0].cam.eye.z <= -1900.0f)) {
D_bg_8015F968 = __sinf(gPlayer[0].camPitch) * 7000.0f;
sp134 -= fabsf(D_bg_8015F968);
}
@@ -527,7 +527,7 @@ void Background_DrawBackdrop(void) {
sp138 = Math_ModF(sp138 - 34.5f, 480.0f);
sp134 = Math_ModF(sp134 + 19.0f, 360.0f);
} else if (levelId == LEVEL_BOLSE) {
if ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE) || (gPlayer[0].unk_1D0 < 10)) {
if ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE) || (gPlayer[0].csState < 10)) {
sp134 = Math_ModF(sp134 + 360.0f - 100.0f, 360.0f);
}
} else {
@@ -565,7 +565,7 @@ void Background_DrawBackdrop(void) {
Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 1.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_ME_600DDF0);
} else if (D_ctx_80177D20 > 185668.0f) {
} else if (gPathProgress > 185668.0f) {
Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f) - 130.0f, -290.0f,
MTXF_APPLY);
Matrix_Scale(gGfxMatrix, 0.4f, 0.4f, 1.0f, MTXF_APPLY);
@@ -593,7 +593,7 @@ void Background_DrawBackdrop(void) {
break;
case LEVEL_AREA_6:
case LEVEL_UNK_4:
sp128 = (D_ctx_80177D20 * 0.00004f) + 0.5f;
sp128 = (gPathProgress * 0.00004f) + 0.5f;
if (sp128 > 3.5f) {
sp128 = 3.5f;
}
@@ -712,7 +712,7 @@ void Background_DrawSun(void) {
if (gCurrentLevel == LEVEL_KATINA) {
gSunViewY -= 80.0f;
}
if ((gCurrentLevel == LEVEL_ZONESS) && (gPlayer[0].unk_1D0 >= 2) && !gMissedZoSearchlight) {
if ((gCurrentLevel == LEVEL_ZONESS) && (gPlayer[0].csState >= 2) && !gMissedZoSearchlight) {
gSunViewY -= 60.0f;
gSunViewX -= 480.0f;
}
@@ -834,7 +834,7 @@ void Background_DrawGround(void) {
}
if (gGroundType == 7) {
sp1D4 = 0.0f;
gPlayer[gPlayerNum].unk_0AC = 0.0f;
gPlayer[gPlayerNum].xPath = 0.0f;
}
if (gLevelMode == LEVELMODE_ALL_RANGE) {
@@ -844,7 +844,7 @@ void Background_DrawGround(void) {
f32 temp_fa0;
sp1D4 = 0.0f;
gPlayer[gPlayerNum].unk_0AC = 0.0f;
gPlayer[gPlayerNum].xPath = 0.0f;
sp1B4.x = 0;
sp1B4.y = 0;
@@ -854,16 +854,16 @@ void Background_DrawGround(void) {
temp_fv1 = gPlayer[gPlayerNum].cam.eye.x + sp1A8.x;
temp_fa0 = gPlayer[gPlayerNum].cam.eye.z + sp1A8.z;
if (temp_fv1 > 6000.0f) {
gPlayer[gPlayerNum].unk_0AC = 12000.0f;
gPlayer[gPlayerNum].xPath = 12000.0f;
}
if (temp_fv1 > 18000.0f) {
gPlayer[gPlayerNum].unk_0AC = 24000.0f;
gPlayer[gPlayerNum].xPath = 24000.0f;
}
if (temp_fv1 < -6000.0f) {
gPlayer[gPlayerNum].unk_0AC = -12000.0f;
gPlayer[gPlayerNum].xPath = -12000.0f;
}
if (temp_fv1 < -18000.0f) {
gPlayer[gPlayerNum].unk_0AC = -24000.0f;
gPlayer[gPlayerNum].xPath = -24000.0f;
}
if (temp_fa0 > 6000.0f) {
sp1D4 = 12000.0f;
@@ -879,7 +879,7 @@ void Background_DrawGround(void) {
}
}
Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, gPlayer[gPlayerNum].unk_0AC, -3.0f + gCameraShakeY, sp1D4, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, gPlayer[gPlayerNum].xPath, -3.0f + gCameraShakeY, sp1D4, MTXF_APPLY);
if (D_ctx_80177C70 == 2) {
Matrix_Scale(gGfxMatrix, 1.2f, 1.2f, 1.0f, MTXF_APPLY);
}
@@ -893,8 +893,8 @@ void Background_DrawGround(void) {
}
if (gLevelMode == LEVELMODE_ON_RAILS) {
gDPSetTextureImage(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, SEGMENTED_TO_VIRTUAL(D_CO_601B6C0));
temp_s0 = fabsf(Math_ModF(2.0f * (D_ctx_80177CE8 * 0.2133333f), 128.0f)); // 0.64f / 3.0f
temp_fv0 = Math_ModF((10000.0f - gPlayer[gPlayerNum].unk_0AC) * 0.32f, 128.0f);
temp_s0 = fabsf(Math_ModF(2.0f * (gPathTexScroll * 0.2133333f), 128.0f)); // 0.64f / 3.0f
temp_fv0 = Math_ModF((10000.0f - gPlayer[gPlayerNum].xPath) * 0.32f, 128.0f);
gDPSetupTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, temp_fv0, temp_s0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD);
switch (gGroundSurface) {
@@ -955,8 +955,8 @@ void Background_DrawGround(void) {
break;
}
gDPSetTextureImage(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sp1C4);
temp_s0 = fabsf(Math_ModF(2.0f * (D_ctx_80177CE8 * 0.2133333f), 128.0f));
temp_fv0 = Math_ModF((10000.0f - gPlayer[gPlayerNum].unk_0AC) * 0.32f, 128.0f);
temp_s0 = fabsf(Math_ModF(2.0f * (gPathTexScroll * 0.2133333f), 128.0f));
temp_fv0 = Math_ModF((10000.0f - gPlayer[gPlayerNum].xPath) * 0.32f, 128.0f);
gDPSetupTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, temp_fv0, temp_s0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD);
Matrix_Push(&gGfxMatrix);
@@ -975,18 +975,18 @@ void Background_DrawGround(void) {
case LEVEL_TRAINING:
RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar);
if (gLevelMode == LEVELMODE_ON_RAILS) {
if (D_ctx_80177CE8 > 290.0f) {
D_ctx_80177CE8 -= 290.0f;
if (gPathTexScroll > 290.0f) {
gPathTexScroll -= 290.0f;
}
Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -3000.0f + D_ctx_80177CE8, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -3000.0f + gPathTexScroll, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_TR_6005880);
Matrix_Pop(&gGfxMatrix);
if (1) {}
Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 3000.0f + D_ctx_80177CE8, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 3000.0f + gPathTexScroll, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_TR_6005880);
@@ -1011,8 +1011,8 @@ void Background_DrawGround(void) {
gDPLoadTileTexture(gMasterDisp++, SEGMENTED_TO_VIRTUAL(D_AQ_600AB68), G_IM_FMT_RGBA, G_IM_SIZ_16b, 32,
32);
gDPSetTextureImage(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, SEGMENTED_TO_VIRTUAL(D_AQ_600AB68));
temp_s0 = fabsf(Math_ModF(2.0f * (D_ctx_80177CE8 * 0.2133333f), 128.0f));
temp_fv0 = Math_ModF((10000.0f - gPlayer[gPlayerNum].unk_0AC) * 0.32f, 128.0f);
temp_s0 = fabsf(Math_ModF(2.0f * (gPathTexScroll * 0.2133333f), 128.0f));
temp_fv0 = Math_ModF((10000.0f - gPlayer[gPlayerNum].xPath) * 0.32f, 128.0f);
gDPSetupTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, temp_fv0, temp_s0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD);
@@ -1033,8 +1033,8 @@ void Background_DrawGround(void) {
gDPLoadTileTexture(gMasterDisp++, SEGMENTED_TO_VIRTUAL(D_AQ_602ACC0), G_IM_FMT_RGBA, G_IM_SIZ_16b, 32,
32);
gDPSetTextureImage(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, SEGMENTED_TO_VIRTUAL(D_AQ_602ACC0));
temp_s0 = fabsf(Math_ModF(2.0f * (D_ctx_80177CE8 * 0.2133333f), 128.0f));
temp_fv0 = Math_ModF((10000.0f - gPlayer[gPlayerNum].unk_0AC) * 0.32f, 128.0f);
temp_s0 = fabsf(Math_ModF(2.0f * (gPathTexScroll * 0.2133333f), 128.0f));
temp_fv0 = Math_ModF((10000.0f - gPlayer[gPlayerNum].xPath) * 0.32f, 128.0f);
gDPSetupTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, temp_fv0, temp_s0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD);
if (gAqDrawMode != 0) {
@@ -1042,7 +1042,7 @@ void Background_DrawGround(void) {
} else {
RCP_SetupDL(&gMasterDisp, 0x25);
}
if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && (gPlayer[0].unk_1D0 < 2)) {
if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && (gPlayer[0].csState < 2)) {
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255);
} else if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) {
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, D_bg_8015F974, D_bg_8015F978, D_bg_8015F97C,
+6 -6
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) {
boss->info.unk_10 = 30000.0f;
boss->info.cullDistance = 30000.0f;
}
void Boss_CompleteLevel(Player* player, f32 xPos, f32 yPos, f32 zPos) {
@@ -104,17 +104,17 @@ void Boss_CompleteLevel(Player* player, f32 xPos, f32 yPos, f32 zPos) {
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 80);
gCsFrameCount = 0;
D_ctx_80178448 = zPos + D_ctx_80177D20;
D_ctx_80178448 = zPos + gPathProgress;
D_ctx_80178440 = xPos;
D_ctx_80178444 = yPos;
player->state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE;
player->unk_1D0 = 10;
player->timer_1F8 = 50;
player->timer_1FC = 50;
player->csState = 10;
player->csTimer = 50;
player->csEventTimer = 50;
player->unk_000 = 0.0f;
player->unk_004 = 1.0f;
if (player->pos.x < player->unk_0AC) {
if (player->pos.x < player->xPath) {
player->unk_004 = -1.0f;
}
gPlayer[0].vel.x = 0.0f;
+20 -20
View File
@@ -25,8 +25,8 @@ s32 gTeamDamage[6];
u8 gMissionStatus; // next planet path
f32 gGroundHeight;
f32 D_ctx_80177950;
f32 D_ctx_80177968;
f32 D_ctx_80177970;
f32 gPlayerTurnRate;
f32 gPlayerTurnStickMod;
f32 gCsCamEyeX;
f32 gCsCamEyeY;
f32 gCsCamEyeZ;
@@ -63,13 +63,13 @@ u16 gBgmSeqId;
u8 gLevelType;
s32 gSavedObjectLoadIndex;
UNK_TYPE F_80177CA8;
f32 D_ctx_80177CB0;
f32 gSavedPathProgress;
UNK_TYPE F_80177CB8;
f32 gWaterLevel;
f32 D_ctx_80177CC8;
f32 D_ctx_80177CE8;
f32 D_ctx_80177D08;
f32 D_ctx_80177D20;
f32 gPathGroundScroll;
f32 gPathTexScroll;
f32 gPathVelZ;
f32 gPathProgress;
f32 gRadioPortraitScaleY;
f32 gRadioTextBoxScaleY;
f32 gRadioMsgRadioId;
@@ -252,7 +252,7 @@ s32 gHitCount;
s32 gSavedHitCount;
s16 gLifeCount[4];
LaserStrength gLaserStrength[4];
s32 D_ctx_80161AB8;
s32 gCullObjects;
UNK_TYPE F_80161AC0[4];
UNK_TYPE F_80161AD0[4];
UNK_TYPE F_80161AE0[4];
@@ -303,13 +303,13 @@ s32 D_ctx_80177990[4]; // these two are also rumble related
f32 D_ctx_801779A8[4];
u8 gPauseEnabled;
s32 gChargeTimers[4];
f32 D_ctx_801779E4;
f32 D_ctx_801779F4;
s32 D_Timer_80177A00[4];
s32 D_Timer_80177A38[4];
s32 D_Timer_80177A70[4];
s32 D_Timer_80177A88[4];
f32 D_ctx_80177AA0[4];
f32 gPathVelX;
f32 gPathVelY;
s32 gUturnDownTimers[4];
s32 gUturnBrakeTimers[4];
s32 gLoopDownTimers[4];
s32 gLoopBoostTimers[4];
f32 gMuzzleFlashScale[4];
f32 gShieldAlpha[4];
s32 gHasShield[4];
s32 gShieldTimer[4];
@@ -320,12 +320,12 @@ u8 gCoUturnCount;
u8 gGreatFoxIntact;
u8 gTiStartLandmaster;
u16 gControllerRumbleTimers[4];
u16 D_ctx_80177C30[4];
u16 gPlayerScores[4];
s32 D_ctx_80177C50;
s32 D_ctx_80177C70;
s32 D_ctx_80177C78;
s32 D_ctx_80177C8C;
s32 D_ctx_80177C94;
s32 D_ctx_80177C70; // sets camera field of view Y. initialized to 0 and never changed
s32 gTraining360MsgTimer;
s32 gTraining360MsgIndex;
s32 D_ctx_80177C94; // these save player parameters across the Venom -> Andross transition
s32 D_ctx_80177C9C;
s32 D_ctx_80177CA4;
s32 D_ctx_80177CAC;
+486 -486
View File
File diff suppressed because it is too large Load Diff
+125 -109
View File
@@ -12,7 +12,7 @@ s16 gReflectY;
Matrix D_display_80161418[4];
Vec3f D_display_80161518[4];
Vec3f D_display_80161548[4];
Vec3f D_display_80161578[4];
Vec3f gLockOnTargetViewPos[4];
f32 D_display_801615A8[4];
f32 D_display_801615B8[4];
@@ -53,7 +53,7 @@ void func_display_80051B30(void) {
Matrix_RotateX(gCalcMatrix, gPlayer[0].camPitch, MTXF_APPLY);
sp68.x = gTeamHelpActor->obj.pos.x - gPlayer[0].cam.eye.x;
sp68.y = gTeamHelpActor->obj.pos.y - gPlayer[0].cam.eye.y;
sp68.z = gTeamHelpActor->obj.pos.z + D_ctx_80177D20 - gPlayer[0].cam.eye.z;
sp68.z = gTeamHelpActor->obj.pos.z + gPathProgress - gPlayer[0].cam.eye.z;
Matrix_MultVec3f(gCalcMatrix, &sp68, &sp5C);
sp7C = 0;
if ((sp5C.z < 0.0f) && (sp5C.z > -12000.0f) && (fabsf(sp5C.x) < fabsf(sp5C.z * 0.4f))) {
@@ -233,11 +233,11 @@ void func_display_8005250C(s32 limbIndex, Vec3f* rot, void* data) {
void func_display_80052584(Player* player) {
Matrix_Push(&gGfxMatrix);
Matrix_Copy(gGfxMatrix, &gIdentityMatrix);
if ((player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (player->timer_1F8 != 0)) {
if ((player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (player->csTimer != 0)) {
Matrix_Translate(gGfxMatrix, D_display_801613B0[player->num].x, D_display_801613B0[player->num].y,
D_display_801613B0[player->num].z, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, D_display_800CA23C[player->timer_1F8 - 1], D_display_800CA23C[player->timer_1F8 - 1],
D_display_800CA23C[player->timer_1F8 - 1], MTXF_APPLY);
Matrix_Scale(gGfxMatrix, D_display_800CA23C[player->csTimer - 1], D_display_800CA23C[player->csTimer - 1],
D_display_800CA23C[player->csTimer - 1], MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
RCP_SetupDL_40();
gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK);
@@ -617,7 +617,7 @@ void func_display_80053C38(Player* player, s32 arg1) {
Matrix_MultVec3f(gGfxMatrix, &sp4C, &D_display_801613E0[1]);
}
if (player->cockpitView && (gLevelMode == LEVELMODE_ON_RAILS) &&
(fabsf(player->unk_138 + D_ctx_80177D20 - player->cam.eye.z) < 10.0f)) {
(fabsf(player->trueZpos + gPathProgress - player->cam.eye.z) < 10.0f)) {
if (arg1 == 0) {
sDrawCockpit = 1;
Matrix_Push(&gGfxMatrix);
@@ -711,10 +711,10 @@ void func_display_80054300(Player* player) {
Math_SmoothStepToF(&sPlayerShadowing, player->shadowing, 1.0f, 10.0f, 0.0f);
RCP_SetupDL(&gMasterDisp, 0x42);
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, (s32) sPlayerShadowing);
if (player->unk_068 > 30.0f) {
if (player->groundPos.y > 30.0f) {
gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK);
}
if ((gGroundSurface == SURFACE_WATER) && (player->unk_068 < 10.0f)) {
if ((gGroundSurface == SURFACE_WATER) && (player->groundPos.y < 10.0f)) {
player->shadowing = 90;
} else {
player->shadowing = 180;
@@ -782,7 +782,7 @@ void func_display_8005478C(Player* player) {
RCP_SetupDL_64();
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 100);
Matrix_Push(&gGfxMatrix);
Matrix_RotateZ(gGfxMatrix, player->unk_0F8 * M_DTOR, MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, player->bankAngle * M_DTOR, MTXF_APPLY);
if (player->form == FORM_LANDMASTER) {
if (player->unk_194 <= 0.0f) {
Matrix_Pop(&gGfxMatrix);
@@ -807,23 +807,26 @@ void func_display_80054914(Player* player) {
Vec3f sp40;
Vec3f sp34;
if (player->unk_280 != 0) {
Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134 + 180.0f) * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_134 + player->unk_4D8) * M_DTOR),
if (player->barrelRollAlpha != 0) {
Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + player->damageShake + 180.0f) * M_DTOR,
MTXF_NEW);
Matrix_RotateX(gCalcMatrix,
-((player->xRot_120 + player->rot.x + player->damageShake + player->aerobaticPitch) * M_DTOR),
MTXF_APPLY);
Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), MTXF_APPLY);
Matrix_Translate(gCalcMatrix, player->unk_084, player->unk_080, 0.0f, MTXF_APPLY);
Matrix_RotateZ(gCalcMatrix, -((player->bankAngle + player->rockAngle + player->damageShake) * M_DTOR),
MTXF_APPLY);
Matrix_Translate(gCalcMatrix, player->xShake, player->yBob, 0.0f, MTXF_APPLY);
sp40.x = 0.0f;
sp40.y = 0.0f;
sp40.z = -30.0f;
Matrix_MultVec3f(gCalcMatrix, &sp40, &sp34);
sp4C = 1.0f;
if (player->unk_1F0 < 0) {
if (player->baseRollRate < 0) {
sp4C = -1.0f;
}
Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, player->pos.x + sp34.x, player->pos.y + sp34.y,
player->unk_138 + player->unk_144 + sp34.z, MTXF_APPLY);
player->trueZpos + player->zPath + sp34.z, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].camYaw, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].camPitch, MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 20.0f * sp4C * M_DTOR, MTXF_APPLY);
@@ -832,13 +835,13 @@ void func_display_80054914(Player* player) {
} else {
Matrix_Scale(gGfxMatrix, 1.2f, 1.2f, 1.2f, MTXF_APPLY);
}
if (player->unk_1F0 < 0) {
if (player->baseRollRate < 0) {
Matrix_RotateX(gGfxMatrix, M_PI, MTXF_APPLY);
}
Matrix_SetGfxMtx(&gMasterDisp);
RCP_SetupDL(&gMasterDisp, 0x43);
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, player->unk_280);
gDPSetEnvColor(gMasterDisp++, 0, 0, 160, player->unk_280);
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, player->barrelRollAlpha);
gDPSetEnvColor(gMasterDisp++, 0, 0, 160, player->barrelRollAlpha);
gSPDisplayList(gMasterDisp++, D_101DC10);
Matrix_Pop(&gGfxMatrix);
}
@@ -929,7 +932,7 @@ void func_display_80054E80(Player* player) {
gSPDisplayList(gMasterDisp++, D_1024AC0);
Matrix_Pop(&gGfxMatrix);
}
if (D_ctx_80177AA0[player->num] > 0.1f) {
if (gMuzzleFlashScale[player->num] > 0.1f) {
Matrix_Push(&gGfxMatrix);
RCP_SetupDL(&gMasterDisp, 0x43);
Matrix_Copy(gCalcMatrix, &D_display_80161418[player->num]);
@@ -948,7 +951,8 @@ void func_display_80054E80(Player* player) {
}
Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, sp94.x, sp94.y, sp94.z, MTXF_NEW);
Matrix_Scale(gGfxMatrix, D_ctx_80177AA0[player->num], D_ctx_80177AA0[player->num], 1.0f, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, gMuzzleFlashScale[player->num], gMuzzleFlashScale[player->num], 1.0f,
MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_1024AC0);
Matrix_Pop(&gGfxMatrix);
@@ -966,13 +970,15 @@ void func_display_80054E80(Player* player) {
Matrix_MultVec3f(gCalcMatrix, &spA0, &sp88);
Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, sp94.x, sp94.y, sp94.z, MTXF_NEW);
Matrix_Scale(gGfxMatrix, D_ctx_80177AA0[player->num], D_ctx_80177AA0[player->num], 1.0f, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, gMuzzleFlashScale[player->num], gMuzzleFlashScale[player->num], 1.0f,
MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_1024AC0);
Matrix_Pop(&gGfxMatrix);
Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, sp88.x, sp88.y, sp88.z, MTXF_NEW);
Matrix_Scale(gGfxMatrix, D_ctx_80177AA0[player->num], D_ctx_80177AA0[player->num], 1.0f, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, gMuzzleFlashScale[player->num], gMuzzleFlashScale[player->num], 1.0f,
MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_1024AC0);
Matrix_Pop(&gGfxMatrix);
@@ -1042,14 +1048,15 @@ void func_display_80055B58(Player* player) {
if ((player->unk_234 != 0) && (player->state_1C8 != PLAYERSTATE_1C8_DOWN)) {
switch (player->form) {
case FORM_ARWING:
Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134 + 180.0f) * M_DTOR,
Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + player->damageShake + 180.0f) * M_DTOR,
MTXF_NEW);
Matrix_RotateX(gCalcMatrix,
-((player->unk_120 + player->unk_0E4 + player->unk_134 + player->unk_4D8) * M_DTOR),
Matrix_RotateX(
gCalcMatrix,
-((player->xRot_120 + player->rot.x + player->damageShake + player->aerobaticPitch) * M_DTOR),
MTXF_APPLY);
Matrix_RotateZ(gCalcMatrix, -((player->bankAngle + player->rockAngle + player->damageShake) * M_DTOR),
MTXF_APPLY);
Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR),
MTXF_APPLY);
Matrix_Translate(gCalcMatrix, player->unk_084, player->unk_080, 0.0f, MTXF_APPLY);
Matrix_Translate(gCalcMatrix, player->xShake, player->yBob, 0.0f, MTXF_APPLY);
var_fv0 = player->unk_194 * 30.0f;
if (var_fv0 > 30.0f) {
var_fv0 = 30.0f;
@@ -1062,7 +1069,7 @@ void func_display_80055B58(Player* player) {
Matrix_MultVec3f(gCalcMatrix, &sp4C, &sp40);
Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, player->pos.x + sp40.x, player->pos.y + sp40.y,
player->unk_138 + player->unk_144 + sp40.z, MTXF_APPLY);
player->trueZpos + player->zPath + sp40.z, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].camYaw, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].camPitch, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
@@ -1102,17 +1109,17 @@ void func_display_80055E98(Player* player) {
sp5C = 108.0f;
sp58 = -22.0f;
}
if (player->unk_25C != 0.0f) {
if (player->contrailScale != 0.0f) {
sp54 = 0.0f;
if ((gGameFrameCount % 2) != 0) {
sp54 = 180.0f;
}
var_fs0 = player->unk_0E8;
var_fs0 = player->rot.y;
if (var_fs0 > 90.0f) {
var_fs0 -= 180.0f;
}
var_fs0 = var_fs0 * 0.25f;
sp50 = player->unk_0E4 * 0.25f;
sp50 = player->rot.x * 0.25f;
if (player->state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) {
var_fs0 = 0.0f;
sp50 = 0.0f;
@@ -1124,7 +1131,7 @@ void func_display_80055E98(Player* player) {
Matrix_Translate(gGfxMatrix, sp5C, sp58, -100.0f, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, M_DTOR * sp50, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, -(M_DTOR * var_fs0), MTXF_APPLY);
Matrix_Scale(gGfxMatrix, player->unk_25C, 1.0f, 50.0f, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, player->contrailScale, 1.0f, 50.0f, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -17.5f, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, M_DTOR * sp54, MTXF_APPLY);
@@ -1137,7 +1144,7 @@ void func_display_80055E98(Player* player) {
Matrix_Translate(gGfxMatrix, -sp5C, sp58, -100.0f, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, M_DTOR * sp50, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, -(M_DTOR * var_fs0), MTXF_APPLY);
Matrix_Scale(gGfxMatrix, player->unk_25C, 1.0f, 50.0f, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, player->contrailScale, 1.0f, 50.0f, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -17.5f, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, M_DTOR * sp54, MTXF_APPLY);
@@ -1152,11 +1159,12 @@ void func_display_80056230(Player* player) {
if ((player->unk_234 != 0) && (player->form == FORM_ARWING) && (gCurrentLevel != LEVEL_VENOM_ANDROSS) &&
(gCurrentLevel != LEVEL_TRAINING) && (gLevelType == LEVELTYPE_PLANET)) {
Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, player->pos.x, player->pos.y, player->unk_138 + player->unk_144, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), MTXF_APPLY);
Matrix_Translate(gGfxMatrix, player->unk_084, player->unk_080, 0.0f, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, player->pos.x, player->pos.y, player->trueZpos + player->zPath, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, -((player->xRot_120 + player->rot.x + player->aerobaticPitch) * M_DTOR), MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, -((player->bankAngle + player->rockAngle + player->damageShake) * M_DTOR),
MTXF_APPLY);
Matrix_Translate(gGfxMatrix, player->xShake, player->yBob, 0.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
func_display_80055E98(player);
Matrix_Pop(&gGfxMatrix);
@@ -1193,19 +1201,19 @@ void func_display_800564C0(Player* player, s32 arg1) {
if (player->unk_234 != 0) {
Matrix_Push(&gGfxMatrix);
if (player->form == FORM_LANDMASTER) {
if (player->unk_1D4 != 0) {
if (player->grounded) {
Matrix_Translate(gGfxMatrix, 0.0f, gCameraShakeY, 0.0f, MTXF_APPLY);
}
Matrix_Translate(gGfxMatrix, player->pos.x, player->pos.y + player->unk_18C + 30.0f,
player->unk_138 + player->unk_144, MTXF_APPLY);
player->trueZpos + player->zPath, MTXF_APPLY);
if (gVersusMode) {
for (i = 0; i < gCamCount; i++) {
if (gVsLockOnTimers[player->num][i] != 0) {
Matrix_MultVec3f(gGfxMatrix, &sp50, &D_display_80161578[i]);
Matrix_MultVec3f(gGfxMatrix, &sp50, &gLockOnTargetViewPos[i]);
if ((i == gPlayerNum) &&
((D_display_80161578[i].z > 300.0f) || (D_display_80161578[i].z < -8000.0f) ||
(fabsf(D_display_80161578[i].x) > (fabsf(D_display_80161578[i].z * 0.5f) + 100.0f)) ||
(fabsf(D_display_80161578[i].y)) > (fabsf(D_display_80161578[i].z * 0.5f) + 100.0f))) {
((gLockOnTargetViewPos[i].z > 300.0f) || (gLockOnTargetViewPos[i].z < -8000.0f) ||
(fabsf(gLockOnTargetViewPos[i].x) > (fabsf(gLockOnTargetViewPos[i].z * 0.5f) + 100.0f)) ||
(fabsf(gLockOnTargetViewPos[i].y)) > (fabsf(gLockOnTargetViewPos[i].z * 0.5f) + 100.0f))) {
gVsLockOnTimers[player->num][i] = 0;
}
@@ -1216,18 +1224,18 @@ void func_display_800564C0(Player* player, s32 arg1) {
Matrix_Pop(&gGfxMatrix);
return;
}
Matrix_RotateX(gGfxMatrix, (player->unk_0E4 + player->unk_134) * M_DTOR, MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, (player->unk_0EC + player->unk_0F0 + player->unk_134) * M_DTOR, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, (player->rot.x + player->damageShake) * M_DTOR, MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, (player->rot.z + player->rockAngle + player->damageShake) * M_DTOR, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_APPLY);
if (gVersusMode) {
Matrix_RotateX(gGfxMatrix, player->unk_000 * M_DTOR, MTXF_APPLY);
}
Matrix_RotateZ(gGfxMatrix, (-player->unk_12C - player->unk_130) * M_DTOR, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, player->unk_084, player->unk_080 - 30.0f, 0.0f, MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, (-player->zRotBank - player->zRotBarrelRoll) * M_DTOR, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, player->xShake, player->yBob - 30.0f, 0.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
} else if (player->form == FORM_ON_FOOT) {
Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, player->pos.x, player->pos.y, player->unk_138 + player->unk_144, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, player->pos.x, player->pos.y, player->trueZpos + player->zPath, MTXF_APPLY);
if (!func_display_800563B4(player->num, arg1)) {
Matrix_Pop(&gGfxMatrix);
Matrix_Pop(&gGfxMatrix);
@@ -1235,22 +1243,24 @@ void func_display_800564C0(Player* player, s32 arg1) {
}
Matrix_Pop(&gGfxMatrix);
Matrix_Translate(gCalcMatrix, player->pos.x, player->pos.y + gCameraShakeY,
player->unk_138 + player->unk_144, MTXF_NEW);
Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134 + 180.0f) * M_DTOR,
player->trueZpos + player->zPath, MTXF_NEW);
Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + player->damageShake + 180.0f) * M_DTOR,
MTXF_APPLY);
Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_134) * M_DTOR), MTXF_APPLY);
Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), MTXF_APPLY);
Matrix_Translate(gCalcMatrix, player->unk_084, player->unk_080, 0.0f, MTXF_APPLY);
Matrix_RotateX(gCalcMatrix, -((player->xRot_120 + player->rot.x + player->damageShake) * M_DTOR),
MTXF_APPLY);
Matrix_RotateZ(gCalcMatrix, -((player->bankAngle + player->rockAngle + player->damageShake) * M_DTOR),
MTXF_APPLY);
Matrix_Translate(gCalcMatrix, player->xShake, player->yBob, 0.0f, MTXF_APPLY);
} else {
Matrix_Translate(gGfxMatrix, player->pos.x, player->pos.y, player->unk_138 + player->unk_144, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, player->pos.x, player->pos.y, player->trueZpos + player->zPath, MTXF_APPLY);
if (gVersusMode) {
for (i = 0; i < gCamCount; i++) {
if (gVsLockOnTimers[player->num][i] != 0) {
Matrix_MultVec3f(gGfxMatrix, &sp50, &D_display_80161578[i]);
Matrix_MultVec3f(gGfxMatrix, &sp50, &gLockOnTargetViewPos[i]);
if ((i == gPlayerNum) &&
((D_display_80161578[i].z > 300.0f) || (D_display_80161578[i].z < -8000.0f) ||
(fabsf(D_display_80161578[i].x) > (fabsf(D_display_80161578[i].z * 0.5f) + 100.0f)) ||
(fabsf(D_display_80161578[i].y) > (fabsf(D_display_80161578[i].z * 0.5f) + 100.0f)))) {
((gLockOnTargetViewPos[i].z > 300.0f) || (gLockOnTargetViewPos[i].z < -8000.0f) ||
(fabsf(gLockOnTargetViewPos[i].x) > (fabsf(gLockOnTargetViewPos[i].z * 0.5f) + 100.0f)) ||
(fabsf(gLockOnTargetViewPos[i].y) > (fabsf(gLockOnTargetViewPos[i].z * 0.5f) + 100.0f)))) {
gVsLockOnTimers[player->num][i] = 0;
}
@@ -1261,13 +1271,15 @@ void func_display_800564C0(Player* player, s32 arg1) {
Matrix_Pop(&gGfxMatrix);
return;
}
Matrix_RotateY(gGfxMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134 + 180.0f) * M_DTOR,
Matrix_RotateY(gGfxMatrix, (player->yRot_114 + player->rot.y + player->damageShake + 180.0f) * M_DTOR,
MTXF_APPLY);
Matrix_RotateX(gGfxMatrix,
-((player->unk_120 + player->unk_0E4 + player->unk_4D8 + player->unk_134) * M_DTOR),
Matrix_RotateX(
gGfxMatrix,
-((player->xRot_120 + player->rot.x + player->aerobaticPitch + player->damageShake) * M_DTOR),
MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, -((player->bankAngle + player->rockAngle + player->damageShake) * M_DTOR),
MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), MTXF_APPLY);
Matrix_Translate(gGfxMatrix, player->unk_084, player->unk_080, 0.0f, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, player->xShake, player->yBob, 0.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
}
switch (player->unk_200) {
@@ -1293,7 +1305,7 @@ void func_display_800564C0(Player* player, s32 arg1) {
break;
}
if (arg1 != 0) {
func_edisplay_800596C0();
Object_ApplyWaterDistortion();
} else {
Matrix_Copy(&D_display_80161418[player->num], gGfxMatrix);
}
@@ -1322,41 +1334,45 @@ void func_display_80056E2C(Player* player) {
if ((player->unk_234 != 0) && (player->unk_240 == 0)) {
sp34 = D_display_800CA334[gGameFrameCount % 8U];
sp30 = D_display_800CA334[(gGameFrameCount + 4) % 8U];
if (player->unk_1D4 != 0) {
if (player->grounded) {
sp34 = sp30 = 0.0f;
}
Matrix_Push(&gGfxMatrix);
if (gLevelMode == LEVELMODE_ALL_RANGE) {
if (player->form == FORM_ON_FOOT) {
Matrix_Translate(gGfxMatrix, player->unk_064, player->unk_068 + 2.0f, player->unk_06C, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, player->groundPos.x, player->groundPos.y + 2.0f, player->groundPos.z,
MTXF_APPLY);
} else {
Matrix_Translate(gGfxMatrix, player->unk_064, player->unk_068 + 2.0f, player->unk_06C, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, player->groundPos.x, player->groundPos.y + 2.0f, player->groundPos.z,
MTXF_APPLY);
}
} else {
Matrix_Translate(gGfxMatrix, player->unk_064, player->unk_068 + 2.0f, player->unk_06C + player->unk_144,
MTXF_APPLY);
Matrix_Translate(gGfxMatrix, player->groundPos.x, player->groundPos.y + 2.0f,
player->groundPos.z + player->zPath, MTXF_APPLY);
}
Matrix_RotateY(gGfxMatrix, player->unk_070, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, player->groundRotY, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, player->unk_248, MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, player->unk_24C, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, 0.8f + sp34, 0.0f, 0.8f + sp30, MTXF_APPLY);
if ((player->form == FORM_ARWING) || (player->form == FORM_BLUE_MARINE) || (player->form == FORM_ON_FOOT)) {
sp2C = player->unk_0F8 + player->unk_0F0 + player->unk_134;
sp2C = player->bankAngle + player->rockAngle + player->damageShake;
if (((sp2C > 70.0f) && (sp2C < 110.0f)) || ((sp2C < -70.0f) && (sp2C > -110.0f))) {
sp2C = 70.0f;
}
Matrix_RotateY(gGfxMatrix, -player->unk_070, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134) * M_DTOR, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix,
-((player->unk_120 + player->unk_0E4 + player->unk_4D8 + player->unk_134) * M_DTOR),
MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, -player->groundRotY, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, (player->yRot_114 + player->rot.y + player->damageShake) * M_DTOR, MTXF_APPLY);
Matrix_RotateX(
gGfxMatrix,
-((player->xRot_120 + player->rot.x + player->aerobaticPitch + player->damageShake) * M_DTOR),
MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, M_DTOR * sp2C, MTXF_APPLY);
} else {
Matrix_RotateY(gGfxMatrix, player->unk_114 * M_DTOR, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, (player->unk_0E4 + player->unk_4D8 + player->unk_134) * M_DTOR, MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, (player->unk_0EC + player->unk_0F0 + player->unk_134) * M_DTOR, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, player->unk_0E8 * M_DTOR, MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, (-player->unk_12C - player->unk_130) * M_DTOR, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, player->yRot_114 * M_DTOR, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, (player->rot.x + player->aerobaticPitch + player->damageShake) * M_DTOR,
MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, (player->rot.z + player->rockAngle + player->damageShake) * M_DTOR, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, player->rot.y * M_DTOR, MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, (-player->zRotBank - player->zRotBarrelRoll) * M_DTOR, MTXF_APPLY);
}
func_display_80054300(player);
Matrix_Pop(&gGfxMatrix);
@@ -1407,8 +1423,8 @@ void func_display_80057504(void) {
f32 var_fs0;
for (i = 0; i < gCamCount; i++) {
if (D_display_80161578[i].z < 0.0f) {
var_fs0 = (VEC3F_MAG(&D_display_80161578[i]));
if (gLockOnTargetViewPos[i].z < 0.0f) {
var_fs0 = (VEC3F_MAG(&gLockOnTargetViewPos[i]));
if (var_fs0 < 20000.0f) {
var_fs0 *= 0.0015f;
if (var_fs0 > 100.0f) {
@@ -1418,8 +1434,8 @@ void func_display_80057504(void) {
var_fs0 = 1.2f;
}
Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, D_display_80161578[i].x, D_display_80161578[i].y, D_display_80161578[i].z,
MTXF_APPLY);
Matrix_Translate(gGfxMatrix, gLockOnTargetViewPos[i].x, gLockOnTargetViewPos[i].y,
gLockOnTargetViewPos[i].z, MTXF_APPLY);
if ((gPlayState != PLAY_PAUSE) && (i == gPlayerNum)) {
Math_SmoothStepToF(&D_display_801615A8[i], 0.0f, 0.5f, 20.0f, 0);
Math_SmoothStepToF(&D_display_801615B8[i], 1.0, 0.5f, 0.2f, 0);
@@ -1438,8 +1454,8 @@ void func_display_80057504(void) {
}
for (j = 0; j < gCamCount; j++) {
D_display_80161578[j].x = D_display_80161578[j].y = 0.f;
D_display_80161578[j].z = 100.0f;
gLockOnTargetViewPos[j].x = gLockOnTargetViewPos[j].y = 0.f;
gLockOnTargetViewPos[j].z = 100.0f;
}
}
@@ -1449,7 +1465,7 @@ void func_display_80057814(Player* player) {
sp20.x = player->pos.x;
sp20.y = player->pos.y;
sp20.z = player->unk_138;
sp20.z = player->trueZpos;
sp2C.x = player->sfxSource[0];
sp2C.y = player->sfxSource[1];
sp2C.z = player->sfxSource[2];
@@ -1460,7 +1476,7 @@ void func_display_80057814(Player* player) {
player->sfx.srcVel = player->sfxVel;
player->sfx.srcPos = player->sfxSource;
player->sfx.yVel = player->vel.y;
player->sfx.zRot = player->unk_0F8;
player->sfx.zRot = player->bankAngle;
}
void func_display_800578C4(Player* player) {
@@ -1483,14 +1499,14 @@ void func_display_800578C4(Player* player) {
case 1:
case 2:
case 3:
sp38 = Math_RadToDeg(player->camPitch) + player->unk_0E4;
sp38 = Math_RadToDeg(player->camPitch) + player->rot.x;
if (sp38 > 360.0f) {
sp38 -= 360.0f;
}
if (sp38 < 0.0f) {
sp38 += 360.0f;
}
sp3C = (Math_RadToDeg(player->camYaw) + 180.0f) - player->unk_0E8;
sp3C = (Math_RadToDeg(player->camYaw) + 180.0f) - player->rot.y;
if (sp3C > 360.0f) {
sp3C -= 360.0f;
}
@@ -1504,15 +1520,15 @@ void func_display_800578C4(Player* player) {
Math_SmoothStepToF(&D_display_800CA384, gControllerPress->stick_x * 3.0f, 0.1f, 5.0f, 0.0f);
Math_SmoothStepToF(&D_display_800CA388, D_display_800CA38C[D_display_800CA220], 0.1f, 10.0f, 0.0f);
sp4C.z = D_display_800CA388;
Matrix_RotateX(gCalcMatrix, (player->unk_0E8 + D_display_800CA380) * M_DTOR, MTXF_NEW);
Matrix_RotateY(gCalcMatrix, (player->unk_0E4 + D_display_800CA384) * M_DTOR, MTXF_APPLY);
Matrix_RotateX(gCalcMatrix, (player->rot.y + D_display_800CA380) * M_DTOR, MTXF_NEW);
Matrix_RotateY(gCalcMatrix, (player->rot.x + D_display_800CA384) * M_DTOR, MTXF_APPLY);
Matrix_MultVec3f(gCalcMatrix, &sp4C, &sp40);
gPlayerCamEye.x = player->pos.x + sp40.x;
gPlayerCamEye.y = player->pos.y + sp40.y + 20.0f;
gPlayerCamEye.z = player->unk_138 + sp40.z;
gPlayerCamEye.z = player->trueZpos + sp40.z;
gPlayerCamAt.x = (SIN_DEG(gGameFrameCount * 3.0f) * 3.0f) + player->pos.x;
gPlayerCamAt.y = (COS_DEG(gGameFrameCount * 4.0f) * 3.0f) + player->pos.y;
gPlayerCamAt.z = (SIN_DEG(gGameFrameCount * 3.5f) * 3.0f) + player->unk_138;
gPlayerCamAt.z = (SIN_DEG(gGameFrameCount * 3.5f) * 3.0f) + player->trueZpos;
break;
}
}
@@ -1546,24 +1562,24 @@ void Play_Draw(void) {
Lights_SetOneLight(&gMasterDisp, gLight1x, gLight1y, gLight1z, gLight1R, gLight1G, gLight1B, gAmbientR, gAmbientG,
gAmbientB);
if (gLevelMode == LEVELMODE_ON_RAILS) {
Matrix_RotateY(gCalcMatrix, player->unk_114 * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, player->unk_120 * M_DTOR, MTXF_APPLY);
Matrix_RotateY(gCalcMatrix, player->yRot_114 * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, player->xRot_120 * M_DTOR, MTXF_APPLY);
tempVec.x = player->cam.eye.x - player->pos.x;
tempVec.y = player->cam.eye.y - player->pos.y;
tempVec.z = player->cam.eye.z - (player->unk_138 + player->unk_144);
tempVec.z = player->cam.eye.z - (player->trueZpos + player->zPath);
Matrix_MultVec3f(gCalcMatrix, &tempVec, &gPlayerCamEye);
gPlayerCamEye.x += player->pos.x;
gPlayerCamEye.y += player->pos.y;
gPlayerCamEye.z += player->unk_138 + player->unk_144;
gPlayerCamEye.z += player->trueZpos + player->zPath;
tempVec.x = player->cam.at.x - player->pos.x;
tempVec.y = player->cam.at.y - player->pos.y;
tempVec.z = player->cam.at.z - (player->unk_138 + player->unk_144);
tempVec.z = player->cam.at.z - (player->trueZpos + player->zPath);
Matrix_MultVec3f(gCalcMatrix, &tempVec, &gPlayerCamAt);
gPlayerCamAt.x += player->pos.x;
gPlayerCamAt.y += player->pos.y;
gPlayerCamAt.z += player->unk_138 + player->unk_144;
gPlayerCamAt.z += player->trueZpos + player->zPath;
if (player->cockpitView && (player->boostSpeed > 5.0f)) {
gPlayerCamAt.x += SIN_DEG(gGameFrameCount * 150.0f) * player->boostSpeed * 0.2f;
@@ -1605,8 +1621,8 @@ void Play_Draw(void) {
Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, 0.0f, gCameraShakeY, 0.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
Ground_801B58AC(&gMasterDisp, D_ctx_80177CC8);
D_ctx_80177CC8 = 0.0f;
Ground_801B58AC(&gMasterDisp, gPathGroundScroll);
gPathGroundScroll = 0.0f;
Matrix_Pop(&gGfxMatrix);
} else if (gGroundSurface != SURFACE_WATER) {
D_bg_8015F964 = false;
@@ -1618,7 +1634,7 @@ void Play_Draw(void) {
for (i = 0, opponent = gPlayer; i < gCamCount; i++, opponent++) {
opponentPos.x = opponent->pos.x;
opponentPos.y = opponent->pos.y;
opponentPos.z = opponent->unk_138;
opponentPos.z = opponent->trueZpos;
Display_SetSecondLight(&opponentPos);
func_display_800564C0(opponent, 0);
func_display_80057814(opponent);
@@ -1631,7 +1647,7 @@ void Play_Draw(void) {
for (i = 0, opponent = gPlayer; i < gCamCount; i++, opponent++) {
opponentPos.x = opponent->pos.x;
opponentPos.y = opponent->pos.y;
opponentPos.z = opponent->unk_138;
opponentPos.z = opponent->trueZpos;
func_display_800564C0(opponent, 1);
}
Matrix_Pop(&gGfxMatrix);
+15 -15
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_27, */ {(void*) D_CO_60143E0, 0, (ObjectFunc) NULL, D_CO_603EAE0, 2500.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_28, */ {(void*) D_CO_6014A20, 0, (ObjectFunc) NULL, D_CO_603EB0C, 2500.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_29, */ {(void*) func_edisplay_80059B20, 1, (ObjectFunc) func_enmy_800652CC, D_TI_60064FC, 100.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_30, */ {(void*) func_edisplay_80059B20, 1, (ObjectFunc) func_enmy_800652CC, D_TI_6006518, 100.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_31, */ {(void*) func_edisplay_80059B20, 1, (ObjectFunc) func_enmy_800652CC, D_TI_6006564, 100.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_32, */ {(void*) func_edisplay_80059B20, 1, (ObjectFunc) func_enmy_800652CC, D_TI_60065B0, 100.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_33, */ {(void*) func_edisplay_80059B20, 1, (ObjectFunc) func_enmy_800652CC, D_TI_60065FC, 100.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_34, */ {(void*) func_edisplay_80059B20, 1, (ObjectFunc) func_enmy_800652CC, D_TI_6006648, 100.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_35, */ {(void*) func_edisplay_80059B20, 1, (ObjectFunc) func_enmy_800652CC, D_TI_6006694, 100.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_36, */ {(void*) func_edisplay_80059B20, 1, (ObjectFunc) func_enmy_800652CC, D_TI_60066E0, 100.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_37, */ {(void*) func_edisplay_80059B20, 1, (ObjectFunc) func_enmy_800652CC, D_TI_600672C, 100.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_38, */ {(void*) func_edisplay_80059B20, 1, (ObjectFunc) func_enmy_800652CC, D_TI_6006778, 100.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_39, */ {(void*) Obj39_Draw, 1, (ObjectFunc) Obj39_Update, gNoHitbox, 6000.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_TI_SKULL, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, D_TI_60064FC, 100.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_TI_RIB_0, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, D_TI_6006518, 100.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_TI_RIB_1, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, D_TI_6006564, 100.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_TI_RIB_2, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, D_TI_60065B0, 100.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_TI_RIB_3, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, D_TI_60065FC, 100.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_TI_RIB_4, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, D_TI_6006648, 100.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_TI_RIB_5, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, D_TI_6006694, 100.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_TI_RIB_6, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, D_TI_60066E0, 100.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_TI_RIB_7, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, D_TI_600672C, 100.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_TI_RIB_8, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, D_TI_6006778, 100.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_ME_TUNNEL, */ {(void*) MeteoTunnel_Draw, 1, (ObjectFunc) MeteoTunnel_Update, gNoHitbox, 6000.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_40, */ {(void*) func_edisplay_80059F68, 1, (ObjectFunc) func_enmy_80066D5C, D_CO_603E4A4, 1000.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_41, */ {(void*) func_edisplay_80059FDC, 1, (ObjectFunc) func_enmy_80066EA8, D_CO_603E4DC, 300.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_42, */ {(void*) Obj42_Draw, 1, (ObjectFunc) Obj42_Update, D_CO_603E514, 1000.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_42, */ {(void*) Scenery42_Draw, 1, (ObjectFunc) Scenery42_Update, D_CO_603E514, 1000.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_43, */ {(void*) D_ZO_6024AC0, 0, (ObjectFunc) NULL, D_ZO_602B9EC, 200.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_44, */ {(void*) D_ZO_600F560, 0, (ObjectFunc) NULL, D_ZO_602BA20, 1500.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_45, */ {(void*) D_ZO_600EC90, 0, (ObjectFunc) NULL, D_ZO_602BAE4, 1500.0f, 0, 0, 40, 0, 0.0f, 0 },
@@ -147,7 +147,7 @@ ObjectInfo D_edata_800CC124[0x190] = {
/* OBJ_SCENERY_51, */ {(void*) D_VE1_6006F50, 0, (ObjectFunc) NULL, D_VE1_601B584, 2500.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_52, */ {(void*) D_VE1_6005780, 0, (ObjectFunc) Venom1_80193540, D_VE1_601B5F4, 2500.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_53, */ {(void*) D_VE1_6003610, 0, (ObjectFunc) NULL, D_VE1_601B644, 2500.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_54, */ {(void*) D_CO_6000E00, 0, (ObjectFunc) Obj54_Update, D_CO_603E0EC, 1000.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_54, */ {(void*) D_CO_6000E00, 0, (ObjectFunc) Scenery54_Update, D_CO_603E0EC, 1000.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_55, */ {(void*) D_CO_6013B50, 0, (ObjectFunc) NULL, D_CO_603E88C, 1000.0f, 0, 0, 41, 0, 0.0f, 0 },
/* OBJ_SCENERY_56, */ {(void*) Corneria_8018F31C, 2, (ObjectFunc) Corneria_8018F044, D_CO_603E8A8, 1000.0f, 0, 0, 39, 0, 0.0f, 0 },
/* OBJ_SCENERY_57, */ {(void*) Titania_8018F8B8, 1, (ObjectFunc) Titania_8018F4D8, D_TI_6006BF0, 800.0f, 0, 0, 40, 0, 0.0f, 0 },
@@ -204,7 +204,7 @@ ObjectInfo D_edata_800CC124[0x190] = {
/* OBJ_SCENERY_108 */ {(void*) D_SY_60102C0, 0, (ObjectFunc) NULL, D_SY_6034588, 4000.0f, 0, 0, 41, 0, 0.0f, 0 },
/* OBJ_SCENERY_109 */ {(void*) D_SY_60036A0, 0, (ObjectFunc) SectorY_801A4E44, D_SY_6034664, 4000.0f, 0, 0, 41, 0, 0.0f, 0 },
/* OBJ_SCENERY_110 */ {(void*) D_SY_6005360, 0, (ObjectFunc) NULL, D_SY_6034770, 4000.0f, 0, 0, 41, 0, 0.0f, 0 },
/* OBJ_SCENERY_111 */ {(void*) Obj111_Draw, 1, (ObjectFunc) NULL, gNoHitbox, 2000.0f, 0, 0, 0, 0, 0.0f, 0 },
/* OBJ_SCENERY_111 */ {(void*) Scenery111_Draw, 1, (ObjectFunc) NULL, gNoHitbox, 2000.0f, 0, 0, 0, 0, 0.0f, 0 },
/* OBJ_SCENERY_112 */ {(void*) D_SY_600F6C0, 0, (ObjectFunc) SectorY_801A52B8, D_SY_60347F0, 4000.0f, 0, 0, 41, 0, 0.0f, 0 },
/* OBJ_SCENERY_113 */ {(void*) D_SY_601B610, 0, (ObjectFunc) NULL, gNoHitbox, 2000.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_SCENERY_114 */ {(void*) D_SY_601C6A0, 0, (ObjectFunc) NULL, gNoHitbox, 2000.0f, 0, 0, 40, 0, 0.0f, 0 },
@@ -288,7 +288,7 @@ ObjectInfo D_edata_800CC124[0x190] = {
/* OBJ_ACTOR_192 */ {(void*) func_edisplay_8005B9A4, 1, (ObjectFunc) func_enmy_8006654C, D_CO_603E54C, 200.0f, 0, 1, 39, 0, 50.0f, 1 },
/* OBJ_ACTOR_193 */ {(void*) func_edisplay_8005BA30, 1, (ObjectFunc) func_enmy_800669A0, D_CO_603E598, 100.0f, 0, 1, 39, 0, 0.0f, 0 },
/* OBJ_ACTOR_194 */ {(void*) Actor194_Draw, 1, (ObjectFunc) Actor194_Update, gActor194Hitbox, 200.0f, 0, 1, 39, 0, 0.0f, 1 },
/* OBJ_ACTOR_195 */ {(void*) Actor195_Draw, 1, (ObjectFunc) Actor195_Update, gNoHitbox, 20000.0f, 0, 1, 39, 0, 0.0f, 0 },
/* OBJ_ACTOR_CUTSCENE */ {(void*) ActorCutscene_Draw, 1, (ObjectFunc) ActorCutscene_Update, gNoHitbox, 20000.0f, 0, 1, 39, 0, 0.0f, 0 },
/* OBJ_ACTOR_196 */ {(void*) Actor196_Draw, 1, (ObjectFunc) Actor196_Update, D_CO_603E5B4, 200.0f, 0, 1, 39, 0, 1.0f, 1 },
/* OBJ_ACTOR_ALLRANGE */ {(void*) ActorAllRange_Draw, 1, (ObjectFunc) ActorAllRange_Update, gActorAllRangeHItbox, 20000.0f, 0, 1, 39, 1, 1.0f, 1 },
/* OBJ_ACTOR_TEAM_BOSS */ {(void*) ActorAllRange_Draw, 1, (ObjectFunc) ActorTeamBoss_Update, gTeamHitbox, 20000.0f, 0, 0, 39, 1, 0.0f, 0 },
+113 -113
View File
@@ -23,14 +23,14 @@
#include "assets/ast_zoness.h"
Vec3f D_edisplay_801615D0;
Vec3f D_edisplay_801615E0;
s32 D_edisplay_801615EC;
Vec3f sViewPos;
s32 sDrewActor;
Matrix D_edisplay_801615F0;
WingInfo D_edisplay_80161630;
char D_edisplay_800CF970[] = "$Id: fox_edisplay.c,v 1.196 1997/05/08 08:31:50 morita Exp $";
void func_edisplay_800596C0(void) {
void Object_ApplyWaterDistortion(void) {
Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 13.0f * M_DTOR, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, 1.02f, 0.98f, 1.0f, MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, -(f32) gGameFrameCount * 13.0f * M_DTOR, MTXF_APPLY);
@@ -38,7 +38,7 @@ void func_edisplay_800596C0(void) {
Matrix_SetGfxMtx(&gMasterDisp);
}
void func_edisplay_800597C0(s32 arg0) {
void Object_SetCullDirection(s32 arg0) {
if (arg0 < 0) {
gSPSetGeometryMode(gMasterDisp++, G_CULL_FRONT);
gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK);
@@ -56,7 +56,7 @@ void Sprite168_Draw(Sprite168* this) {
RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar);
}
void func_edisplay_800598DC(s32 arg0) {
void Object_dummy_800598DC(s32 arg0) {
}
void Actor201_Draw(Actor201* this) {
@@ -65,7 +65,7 @@ void Actor201_Draw(Actor201* this) {
RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar);
}
void func_edisplay_800599A4(s32 limbIndex, Vec3f* rot, void* index) {
void Actor202_PostLimbDraw(s32 limbIndex, Vec3f* rot, void* index) {
Vec3f sp24;
Vec3f sp18;
@@ -95,18 +95,18 @@ void Actor202_Draw(Actor202* this) {
Matrix_Translate(gGfxMatrix, 0.f, -temp, 0.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
Animation_GetFrameData(&D_ME_601E8C4, this->unk_0B6, sp30);
Animation_DrawSkeleton(1, D_ME_601E9D0, sp30, NULL, func_edisplay_800599A4, &this->index, &gIdentityMatrix);
Animation_DrawSkeleton(1, D_ME_601E9D0, sp30, NULL, Actor202_PostLimbDraw, &this->index, &gIdentityMatrix);
}
void Obj39_Draw(Scenery_39* this) {
void MeteoTunnel_Draw(Scenery_39* this) {
gSPDisplayList(gMasterDisp++, D_ME_601AE40);
}
void func_edisplay_80059B20(Scenery* scenery) {
if (scenery->obj.id == OBJ_SCENERY_29) {
void Scenery_DrawTitaniaBones(Scenery* scenery) {
if (scenery->obj.id == OBJ_SCENERY_TI_SKULL) {
gSPDisplayList(gMasterDisp++, D_TI1_7007350);
} else {
Graphics_SetScaleMtx(D_edisplay_800CF9B0[scenery->obj.id + 2]);
Graphics_SetScaleMtx(D_edisplay_800CFA2C[scenery->obj.id - 29]);
gSPDisplayList(gMasterDisp++, D_TI1_700BB10);
}
}
@@ -114,7 +114,7 @@ void func_edisplay_80059B20(Scenery* scenery) {
void func_edisplay_80059BB0(void* arg0) {
}
void Obj42_Draw(Scenery_42* this) {
void Scenery42_Draw(Scenery_42* this) {
gSPDisplayList(gMasterDisp++, D_CO_6023AC0);
}
@@ -515,10 +515,10 @@ void func_edisplay_8005B388(Actor* actor) {
(gPlayer[0].state_1C8 == PLAYERSTATE_1C8_STANDBY) || (gCurrentLevel == LEVEL_VENOM_ANDROSS) ||
(gCurrentLevel == LEVEL_VENOM_2) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE)) &&
(gCurrentLevel != LEVEL_MACBETH) && (gCurrentLevel != LEVEL_TITANIA)) {
if (actor->obj.id == OBJ_ACTOR_195) {
if (actor->obj.id == OBJ_ACTOR_CUTSCENE) {
if (((gCurrentLevel == LEVEL_VENOM_2) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) &&
(actor->index == 10)) ||
((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) && (gPlayer[0].unk_1D0 >= 100) &&
((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) && (gPlayer[0].csState >= 100) &&
(gCurrentLevel == LEVEL_KATINA) && (actor->index == 1)) ||
((gCurrentLevel == LEVEL_SECTOR_Y) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_STANDBY) &&
(actor->state == 5))) {
@@ -634,7 +634,7 @@ void func_edisplay_8005BAB4(ObjectId objId, s32 index) {
}
RCP_SetupDL(&gMasterDisp, 0x40);
break;
case OBJ_ACTOR_195:
case OBJ_ACTOR_CUTSCENE:
case OBJ_ACTOR_TEAM_BOSS:
case OBJ_ACTOR_EVENT:
switch (gActors[index].unk_0B4) {
@@ -782,7 +782,7 @@ void ItemCheckpoint_Draw(ItemCheckpoint* this) {
for (i = 0; i < 8; i++) {
Matrix_Push(&gGfxMatrix);
Matrix_RotateZ(gGfxMatrix, i * 45.0f * M_DTOR, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, 2.0f * this->scale, 0.0f, 0.0f, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, 2.0f * this->width, 0.0f, 0.0f, MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, (gGameFrameCount + (i * 110.0f)) * M_DTOR * 7.2f * this->unk_54, MTXF_APPLY);
Graphics_SetScaleMtx(2.0f * this->unk_50);
gSPDisplayList(gMasterDisp++, D_101CAE0);
@@ -795,7 +795,7 @@ void ItemSilverRing_Draw(ItemSilverRing* this) {
RCP_SetupDL(&gMasterDisp, 0x1D);
gSPTexture(gMasterDisp++, 3000, 0, 0, G_TX_RENDERTILE, G_ON);
gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR);
Graphics_SetScaleMtx(this->scale);
Graphics_SetScaleMtx(this->width);
gSPDisplayList(gMasterDisp++, D_101A570);
gSPClearGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR);
}
@@ -804,7 +804,7 @@ void ItemSilverStar_Draw(ItemSilverStar* this) {
RCP_SetupDL(&gMasterDisp, 0x1D);
gSPTexture(gMasterDisp++, 3000, 0, 0, G_TX_RENDERTILE, G_ON);
gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR);
Graphics_SetScaleMtx(this->scale);
Graphics_SetScaleMtx(this->width);
gSPDisplayList(gMasterDisp++, D_1019CA0);
gSPClearGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR);
}
@@ -813,17 +813,17 @@ void ItemGoldRing_Draw(ItemGoldRing* this) {
RCP_SetupDL(&gMasterDisp, 0x1D);
gSPTexture(gMasterDisp++, 1900, 1700, 0, G_TX_RENDERTILE, G_ON);
gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR);
Graphics_SetScaleMtx(this->scale);
Graphics_SetScaleMtx(this->width);
gSPDisplayList(gMasterDisp++, D_1016870);
gSPClearGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR);
}
void ItemBomb_Draw(ItemBomb* this) {
if (gCurrentLevel == LEVEL_AQUAS) {
Graphics_SetScaleMtx(this->scale);
Graphics_SetScaleMtx(this->width);
gSPDisplayList(gMasterDisp++, D_blue_marine_3005980);
} else {
Graphics_SetScaleMtx(this->scale * 0.1f);
Graphics_SetScaleMtx(this->width * 0.1f);
RCP_SetupDL(&gMasterDisp, 0x1D);
gSPTexture(gMasterDisp++, 2000, 2000, 0, G_TX_RENDERTILE, G_ON);
gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN);
@@ -836,7 +836,7 @@ void ItemBomb_Draw(ItemBomb* this) {
}
void ItemLasers_Draw(ItemLasers* this) {
Graphics_SetScaleMtx(this->scale * 0.1f);
Graphics_SetScaleMtx(this->width * 0.1f);
RCP_SetupDL(&gMasterDisp, 0x1D);
gSPTexture(gMasterDisp++, 2000, 2000, 0, G_TX_RENDERTILE, G_ON);
gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN);
@@ -851,7 +851,7 @@ void ItemMeteoWarp_Draw(ItemMeteoWarp* this) {
s32 i;
this->obj.rot.y = (Math_Atan2F(gPlayer[gPlayerNum].cam.eye.x - this->obj.pos.x,
gPlayer[gPlayerNum].cam.eye.z - (this->obj.pos.z + D_ctx_80177D20)) *
gPlayer[gPlayerNum].cam.eye.z - (this->obj.pos.z + gPathProgress)) *
180.0f) /
M_PI;
if (this->state != 0) {
@@ -864,7 +864,7 @@ void ItemMeteoWarp_Draw(ItemMeteoWarp* this) {
for (i = 0; i < 7; i++) {
Matrix_Push(&gGfxMatrix);
Matrix_RotateZ(gGfxMatrix, (i * 360.0f / 7.0f) * M_DTOR, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, 0.0f, this->scale, 0.0f, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, 0.0f, this->width, 0.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_102FE80);
Matrix_Pop(&gGfxMatrix);
@@ -874,7 +874,7 @@ void ItemMeteoWarp_Draw(ItemMeteoWarp* this) {
void func_edisplay_8005D008(Object* obj, s32 drawType) {
if (drawType == 2) {
Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, D_ctx_80177D20, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, gPathProgress, MTXF_APPLY);
Matrix_Translate(gCalcMatrix, obj->pos.x, obj->pos.y, obj->pos.z, MTXF_NEW);
Matrix_Push(&gGfxMatrix);
Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY);
@@ -884,7 +884,7 @@ void func_edisplay_8005D008(Object* obj, s32 drawType) {
Matrix_RotateX(gCalcMatrix, obj->rot.x * M_DTOR, MTXF_APPLY);
Matrix_RotateZ(gCalcMatrix, obj->rot.z * M_DTOR, MTXF_APPLY);
} else {
Matrix_Translate(gGfxMatrix, obj->pos.x, obj->pos.y, obj->pos.z + D_ctx_80177D20, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, obj->pos.x, obj->pos.y, obj->pos.z + gPathProgress, MTXF_APPLY);
Matrix_Copy(&D_edisplay_801615F0, gGfxMatrix);
Matrix_RotateY(gGfxMatrix, obj->rot.y * M_DTOR, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, obj->rot.x * M_DTOR, MTXF_APPLY);
@@ -895,7 +895,7 @@ void func_edisplay_8005D008(Object* obj, s32 drawType) {
void func_edisplay_8005D1F0(Object* obj, s32 drawType) {
if (drawType == 2) {
Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, D_ctx_80177D20, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, gPathProgress, MTXF_APPLY);
Matrix_Translate(gCalcMatrix, obj->pos.x, obj->pos.y, obj->pos.z, MTXF_NEW);
Matrix_Push(&gGfxMatrix);
Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY);
@@ -905,7 +905,7 @@ void func_edisplay_8005D1F0(Object* obj, s32 drawType) {
Matrix_RotateX(gCalcMatrix, obj->rot.x * M_DTOR, MTXF_APPLY);
Matrix_RotateZ(gCalcMatrix, obj->rot.z * M_DTOR, MTXF_APPLY);
} else {
Matrix_Translate(gGfxMatrix, obj->pos.x, obj->pos.y, obj->pos.z + D_ctx_80177D20, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, obj->pos.x, obj->pos.y, obj->pos.z + gPathProgress, MTXF_APPLY);
Matrix_Copy(&D_edisplay_801615F0, gGfxMatrix);
Matrix_RotateY(gGfxMatrix, obj->rot.y * M_DTOR, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, obj->rot.x * M_DTOR, MTXF_APPLY);
@@ -915,7 +915,7 @@ void func_edisplay_8005D1F0(Object* obj, s32 drawType) {
void func_edisplay_8005D3CC(Object* obj, f32 xRot, f32 yRot, f32 zRot, s32 drawType) {
if (drawType == 2) {
Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, D_ctx_80177D20, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, gPathProgress, MTXF_APPLY);
Matrix_Translate(gCalcMatrix, obj->pos.x, obj->pos.y, obj->pos.z, MTXF_NEW);
Matrix_Push(&gGfxMatrix);
Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY);
@@ -928,7 +928,7 @@ void func_edisplay_8005D3CC(Object* obj, f32 xRot, f32 yRot, f32 zRot, s32 drawT
Matrix_RotateX(gCalcMatrix, obj->rot.x * M_DTOR, MTXF_APPLY);
Matrix_RotateZ(gCalcMatrix, obj->rot.z * M_DTOR, MTXF_APPLY);
} else {
Matrix_Translate(gGfxMatrix, obj->pos.x, obj->pos.y, obj->pos.z + D_ctx_80177D20, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, obj->pos.x, obj->pos.y, obj->pos.z + gPathProgress, MTXF_APPLY);
Matrix_Copy(&D_edisplay_801615F0, gGfxMatrix);
Matrix_RotateY(gGfxMatrix, M_DTOR * yRot, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, M_DTOR * xRot, MTXF_APPLY);
@@ -950,7 +950,7 @@ void Scenery_Draw(Scenery* this, s32 arg1) {
RCP_SetupDL_57(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar);
gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK);
if (arg1 < 0) {
func_edisplay_800596C0();
Object_ApplyWaterDistortion();
}
gSPDisplayList(gMasterDisp++, this->info.dList);
RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar);
@@ -961,9 +961,9 @@ void Scenery_Draw(Scenery* this, s32 arg1) {
}
RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar);
}
func_edisplay_800597C0(arg1);
Object_SetCullDirection(arg1);
if (arg1 < 0) {
func_edisplay_800596C0();
Object_ApplyWaterDistortion();
}
gSPDisplayList(gMasterDisp++, this->info.dList);
if (this->obj.id == OBJ_SCENERY_8) {
@@ -971,7 +971,7 @@ void Scenery_Draw(Scenery* this, s32 arg1) {
}
}
} else if (this->info.draw != NULL) {
func_edisplay_800597C0(arg1);
Object_SetCullDirection(arg1);
this->info.draw(&this->obj);
}
}
@@ -1027,9 +1027,9 @@ void Actor_DrawOnRails(Actor* this) {
}
}
if ((this->lockOnTimers[TEAM_ID_FOX] != 0) && (gReflectY > 0)) {
sp34.y += this->info.unk_1C;
Matrix_MultVec3f(gGfxMatrix, &sp34, &D_display_80161578[0]);
if (D_display_80161578[0].z > -200.0f) {
sp34.y += this->info.targetOffset;
Matrix_MultVec3f(gGfxMatrix, &sp34, &gLockOnTargetViewPos[TEAM_ID_FOX]);
if (gLockOnTargetViewPos[TEAM_ID_FOX].z > -200.0f) {
this->lockOnTimers[TEAM_ID_FOX] = 0;
}
}
@@ -1038,20 +1038,20 @@ void Actor_DrawOnRails(Actor* this) {
}
void Actor_DrawAllRange(Actor* this) {
s32 var_v1;
s32 playerNum;
Vec3f sp50 = { 0.0f, 0.0f, 0.0f };
f32 var_fa1;
f32 var_ft5;
f32 var_fv0;
f32 var_fv1;
D_edisplay_801615EC = 0;
sDrewActor = false;
if (this->info.drawType == 2) {
Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, D_ctx_80177D20, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, gPathProgress, MTXF_APPLY);
Matrix_Translate(gCalcMatrix, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, MTXF_NEW);
Matrix_Push(&gGfxMatrix);
Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY);
Matrix_MultVec3f(gGfxMatrix, &sp50, &D_edisplay_801615E0);
Matrix_MultVec3f(gGfxMatrix, &sp50, &sViewPos);
Matrix_Pop(&gGfxMatrix);
var_fv0 = 0.0f;
var_fv1 = -12000.0f;
@@ -1059,28 +1059,28 @@ void Actor_DrawAllRange(Actor* this) {
var_fv0 = 1000.0f;
var_fv1 = -25000.0f;
}
if ((var_fv0 > D_edisplay_801615E0.z) && (D_edisplay_801615E0.z > var_fv1)) {
if (fabsf(D_edisplay_801615E0.x) < (fabsf(D_edisplay_801615E0.z * 0.5f) + 500.0f)) {
if (fabsf(D_edisplay_801615E0.y) < (fabsf(D_edisplay_801615E0.z * 0.5f) + 500.0f)) {
if ((var_fv0 > sViewPos.z) && (sViewPos.z > var_fv1)) {
if (fabsf(sViewPos.x) < (fabsf(sViewPos.z * 0.5f) + 500.0f)) {
if (fabsf(sViewPos.y) < (fabsf(sViewPos.z * 0.5f) + 500.0f)) {
Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_APPLY);
Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY);
Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY);
this->info.draw(&this->obj);
D_edisplay_801615EC = 1;
sDrewActor = true;
if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (this->obj.id == OBJ_ACTOR_ALLRANGE) &&
(this->aiType == AI360_MISSILE)) {
gTeamArrowsViewPos[0] = D_edisplay_801615E0;
gTeamArrowsViewPos[0] = sViewPos;
}
}
}
}
} else {
Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, MTXF_APPLY);
Matrix_MultVec3f(gGfxMatrix, &sp50, &D_edisplay_801615E0);
Matrix_MultVec3f(gGfxMatrix, &sp50, &sViewPos);
if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) ||
(gPlayer[0].state_1C8 == PLAYERSTATE_1C8_STANDBY) ||
((this->obj.id == OBJ_ACTOR_ALLRANGE) && (this->aiType >= AI360_GREAT_FOX)) ||
((this->obj.id == OBJ_ACTOR_195) && (this->info.bonus != 0))) {
((this->obj.id == OBJ_ACTOR_CUTSCENE) && (this->info.bonus != 0))) {
var_ft5 = var_fv0 = 3000.0f;
var_fv1 = -29000.0f;
var_fa1 = 0.7f;
@@ -1090,45 +1090,45 @@ void Actor_DrawAllRange(Actor* this) {
var_fv1 = -20000.0f;
var_fa1 = 0.5f;
}
if ((var_fv0 > D_edisplay_801615E0.z) && (D_edisplay_801615E0.z > var_fv1)) {
if (fabsf(D_edisplay_801615E0.x) < (fabsf(D_edisplay_801615E0.z * var_fa1) + var_ft5)) {
if (fabsf(D_edisplay_801615E0.y) < (fabsf(D_edisplay_801615E0.z * var_fa1) + var_ft5)) {
if ((var_fv0 > sViewPos.z) && (sViewPos.z > var_fv1)) {
if (fabsf(sViewPos.x) < (fabsf(sViewPos.z * var_fa1) + var_ft5)) {
if (fabsf(sViewPos.y) < (fabsf(sViewPos.z * var_fa1) + var_ft5)) {
if (this->info.draw != NULL) {
Matrix_RotateY(gGfxMatrix, this->obj.rot.y * M_DTOR, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
this->info.draw(&this->obj);
D_edisplay_801615EC = 1;
sDrewActor = true;
if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) &&
(((this->obj.id == OBJ_ACTOR_ALLRANGE) &&
((this->aiType <= AI360_PEPPY) || (this->aiType == AI360_KATT) ||
(this->aiType == AI360_BILL))) ||
(this->obj.id == OBJ_ACTOR_TEAM_BOSS))) {
gTeamArrowsViewPos[this->aiType] = D_edisplay_801615E0;
gTeamArrowsViewPos[this->aiType] = sViewPos;
}
}
}
}
}
}
if (D_edisplay_801615EC == 0) {
if (!sDrewActor) {
this->lockOnTimers[gPlayerNum] = 0;
if ((this->obj.id == OBJ_ACTOR_189) || (this->obj.id == OBJ_ACTOR_286)) {
Object_Kill(&this->obj, this->sfxSource);
}
}
for (var_v1 = 0; var_v1 < gCamCount; var_v1++) {
if (this->lockOnTimers[var_v1] != 0) {
D_display_80161578[var_v1] = D_edisplay_801615E0;
D_display_80161578[var_v1].y += this->info.unk_1C;
if ((var_v1 == gPlayerNum) && (D_display_80161578[var_v1].z > -300.0f)) {
this->lockOnTimers[var_v1] = 0;
for (playerNum = 0; playerNum < gCamCount; playerNum++) {
if (this->lockOnTimers[playerNum] != 0) {
gLockOnTargetViewPos[playerNum] = sViewPos;
gLockOnTargetViewPos[playerNum].y += this->info.targetOffset;
if ((playerNum == gPlayerNum) && (gLockOnTargetViewPos[playerNum].z > -300.0f)) {
this->lockOnTimers[playerNum] = 0;
}
}
}
func_edisplay_8005F290(this->sfxSource, &D_edisplay_801615E0);
this->iwork[24] = D_edisplay_801615EC;
func_edisplay_8005F290(this->sfxSource, &sViewPos);
this->iwork[24] = sDrewActor;
}
void Boss_Draw(Boss* this, s32 arg1) {
@@ -1177,7 +1177,7 @@ void Boss_Draw(Boss* this, s32 arg1) {
Matrix_SetGfxMtx(&gMasterDisp);
}
if (arg1 < 0) {
func_edisplay_800596C0();
Object_ApplyWaterDistortion();
}
this->info.draw(&this->obj);
}
@@ -1214,22 +1214,22 @@ void Effect_DrawOnRails(Effect* this, s32 arg1) {
void Effect_DrawAllRange(Effect* this) {
Vec3f sp4C = { 0.0f, 0.0f, 0.0f };
Vec3f sp40;
f32 var_fv0;
u8 sp3B = 0;
f32 minZ;
u8 drawn = false;
if (this->info.unk_14 == -1) {
Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y + gCameraShakeY, this->obj.pos.z + D_ctx_80177D20,
Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y + gCameraShakeY, this->obj.pos.z + gPathProgress,
MTXF_APPLY);
} else {
Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + D_ctx_80177D20, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + gPathProgress, MTXF_APPLY);
}
Matrix_MultVec3f(gGfxMatrix, &sp4C, &sp40);
if ((gCurrentLevel == LEVEL_SECTOR_Z) || (gCurrentLevel == LEVEL_BOLSE)) {
var_fv0 = -20000.0f;
minZ = -20000.0f;
} else {
var_fv0 = -10000.0f;
minZ = -10000.0f;
}
if ((sp40.z < 0.0f) && (var_fv0 < sp40.z)) {
if ((0.0f > sp40.z) && (sp40.z > minZ)) {
if (fabsf(sp40.x) < (fabsf(sp40.z * 0.5f) + 500.0f)) {
if (fabsf(sp40.y) < (fabsf(sp40.z * 0.5f) + 500.0f)) {
if (this->info.draw != NULL) {
@@ -1239,12 +1239,12 @@ void Effect_DrawAllRange(Effect* this) {
Matrix_SetGfxMtx(&gMasterDisp);
this->info.draw(&this->obj);
}
sp3B = 1;
drawn = true;
}
}
}
func_edisplay_8005F290(this->sfxSource, &sp40);
if ((sp3B == 0) && (this->obj.id != OBJ_EFFECT_352) && (this->obj.id != OBJ_EFFECT_373) && (!gVersusMode)) {
if (!drawn && (this->obj.id != OBJ_EFFECT_352) && (this->obj.id != OBJ_EFFECT_373) && (!gVersusMode)) {
Object_Kill(&this->obj, this->sfxSource);
}
}
@@ -1252,12 +1252,12 @@ void Effect_DrawAllRange(Effect* this) {
void Item_Draw(Item* this, s32 arg1) {
Vec3f sp44 = { 0.0f, 0.0f, 0.0f };
Vec3f sp38;
u8 var_v0;
u8 drawn;
Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + D_ctx_80177D20, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + gPathProgress, MTXF_APPLY);
Matrix_MultVec3f(gGfxMatrix, &sp44, &sp38);
var_v0 = 0;
if ((sp38.z < 0.0f) && (sp38.z > -12000.0f)) {
drawn = false;
if ((0.0f > sp38.z) && (sp38.z > -12000.0f)) {
if (fabsf(sp38.x) < (fabsf(sp38.z * 0.5f) + 500.0f)) {
if (fabsf(sp38.y) < (fabsf(sp38.z * 0.5f) + 500.0f)) {
if (this->info.draw != NULL) {
@@ -1271,12 +1271,12 @@ void Item_Draw(Item* this, s32 arg1) {
this->info.draw(&this->obj);
}
}
var_v0 = 1;
drawn = true;
}
}
}
func_edisplay_8005F290(this->sfxSource, &sp38);
if ((var_v0 == 0) && (gLevelMode == LEVELMODE_ALL_RANGE) && (gCamCount == 1) && (this->obj.id < 336) &&
if (!drawn && (gLevelMode == LEVELMODE_ALL_RANGE) && (gCamCount == 1) && (this->obj.id < OBJ_ITEM_GOLD_RING) &&
(gCurrentLevel != LEVEL_VENOM_ANDROSS)) {
Object_Kill(&this->obj, this->sfxSource);
}
@@ -1322,21 +1322,21 @@ void Object_DrawShadow(s32 index, Object* obj) {
switch (obj->id) {
case OBJ_ACTOR_230:
Matrix_Translate(gGfxMatrix, obj->pos.x, gGroundHeight + 2.0f + gActors[index].fwork[1],
obj->pos.z + D_ctx_80177D20, MTXF_APPLY);
obj->pos.z + gPathProgress, MTXF_APPLY);
break;
case OBJ_ACTOR_229:
case OBJ_ACTOR_231:
Matrix_Translate(gGfxMatrix, obj->pos.x, gGroundHeight + 2.0f + gActors[index].fwork[0],
obj->pos.z + D_ctx_80177D20, MTXF_APPLY);
obj->pos.z + gPathProgress, MTXF_APPLY);
break;
case OBJ_BOSS_316:
Matrix_Translate(gGfxMatrix, obj->pos.x, gGroundHeight + 2.0f + gCameraShakeY, obj->pos.z, MTXF_APPLY);
break;
default:
Matrix_Translate(gGfxMatrix, obj->pos.x, gGroundHeight + 2.0f, obj->pos.z + D_ctx_80177D20, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, obj->pos.x, gGroundHeight + 2.0f, obj->pos.z + gPathProgress, MTXF_APPLY);
break;
}
if ((gGroundType != 4) || (obj->id == OBJ_ACTOR_EVENT) || (obj->id == OBJ_ACTOR_195) ||
if ((gGroundType != 4) || (obj->id == OBJ_ACTOR_EVENT) || (obj->id == OBJ_ACTOR_CUTSCENE) ||
(obj->id == OBJ_ACTOR_TEAM_BOSS)) {
Matrix_Scale(gGfxMatrix, 1.0f, 0.0f, 1.0f, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, obj->rot.y * M_DTOR, MTXF_APPLY);
@@ -1383,7 +1383,7 @@ void func_edisplay_8005F0E8(f32* sfxSrc, Vec3f* pos) {
Matrix_RotateX(gCalcMatrix, gPlayer[0].camPitch, MTXF_APPLY);
sp2C.x = pos->x - gPlayerCamEye.x;
sp2C.y = pos->y - gPlayerCamEye.y;
sp2C.z = pos->z + D_ctx_80177D20 - gPlayerCamEye.z;
sp2C.z = pos->z + gPathProgress - gPlayerCamEye.z;
Matrix_MultVec3f(gCalcMatrix, &sp2C, &sp20);
sfxSrc[0] = sp20.x;
sfxSrc[1] = sp20.y;
@@ -1472,11 +1472,11 @@ void Display_SetSecondLight(Vec3f* pos) {
Vec3f sp9C;
f32 sp98;
f32 sp94;
f32 temp_fv0;
f32 lightDist;
Vec3f sp84;
f32 temp1;
f32 temp2;
f32 var_fs0;
f32 lightFade;
Vec3f sp6C;
f32 temp3;
f32 pad;
@@ -1485,17 +1485,17 @@ void Display_SetSecondLight(Vec3f* pos) {
sp9C.x = pos->x - gLight3x;
sp9C.y = pos->y - gLight3y;
sp9C.z = pos->z - gLight3z;
temp_fv0 = VEC3F_MAG(&sp9C);
lightDist = VEC3F_MAG(&sp9C);
if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) {
var_fs0 = 700.0f / temp_fv0;
lightFade = 700.0f / lightDist;
} else {
var_fs0 = 200.0f / temp_fv0;
lightFade = 200.0f / lightDist;
}
if (var_fs0 > 1.0f) {
var_fs0 = 1.0f;
if (lightFade > 1.0f) {
lightFade = 1.0f;
}
if (D_ctx_8017812C == 2) {
var_fs0 = 1.0f;
lightFade = 1.0f;
}
sp94 = Math_Atan2F(sp9C.x, sp9C.z);
sp98 = -Math_Atan2F(sp9C.y, sqrtf(SQ(sp9C.x) + SQ(sp9C.z)));
@@ -1509,9 +1509,9 @@ void Display_SetSecondLight(Vec3f* pos) {
sp6C.z = -100.0f;
Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp6C, &sp84);
Matrix_Pop(&gCalcMatrix);
temp1 = gLight3R * gLight3Brightness * var_fs0;
temp2 = gLight3G * gLight3Brightness * var_fs0;
temp3 = gLight3B * gLight3Brightness * var_fs0;
temp1 = gLight3R * gLight3Brightness * lightFade;
temp2 = gLight3G * gLight3Brightness * lightFade;
temp3 = gLight3B * gLight3Brightness * lightFade;
Lights_SetTwoLights(&gMasterDisp, gLight1x, gLight1y, gLight1z, sp84.x, sp84.y, sp84.z, gLight1R, gLight1G,
gLight1B, temp1, temp2, temp3, gAmbientR, gAmbientG, gAmbientB);
}
@@ -1589,7 +1589,7 @@ void Object_DrawAll(s32 arg0) {
RCP_SetupDL_27();
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 64, 64, 255, 255);
}
func_edisplay_800597C0(arg0);
Object_SetCullDirection(arg0);
Matrix_Push(&gGfxMatrix);
Boss_Draw(boss, arg0);
Matrix_Pop(&gGfxMatrix);
@@ -1638,7 +1638,7 @@ void Object_DrawAll(s32 arg0) {
(gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) || (gCurrentLevel == LEVEL_AQUAS)) {
Display_SetSecondLight(&actor->obj.pos);
}
func_edisplay_800597C0(arg0);
Object_SetCullDirection(arg0);
Actor_DrawOnRails(actor);
Matrix_Pop(&gGfxMatrix);
if (actor->unk_0C9 != 0) {
@@ -1651,8 +1651,8 @@ void Object_DrawAll(s32 arg0) {
Matrix_Push(&gGfxMatrix);
Actor_DrawAllRange(actor);
Matrix_Pop(&gGfxMatrix);
if ((actor->unk_0C9 != 0) && (D_edisplay_801615EC != 0) &&
((D_edisplay_801615E0.z > -4000.0f) || (gCurrentLevel != LEVEL_KATINA))) {
if ((actor->unk_0C9 != 0) && (sDrewActor != 0) &&
((sViewPos.z > -4000.0f) || (gCurrentLevel != LEVEL_KATINA))) {
Matrix_Push(&gGfxMatrix);
Object_DrawShadow(i, &actor->obj);
Matrix_Pop(&gGfxMatrix);
@@ -1668,7 +1668,7 @@ void Object_DrawAll(s32 arg0) {
if (item->obj.status >= OBJ_ACTIVE) {
Matrix_Push(&gGfxMatrix);
RCP_SetupDL(&gMasterDisp, 0x1D);
func_edisplay_800597C0(arg0);
Object_SetCullDirection(arg0);
Item_Draw(item, arg0);
Matrix_Pop(&gGfxMatrix);
}
@@ -1779,12 +1779,12 @@ void TexturedLine_Draw(void) {
if (gTexturedLines[i].mode != 0) {
Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, texLine->unk_04.x, texLine->unk_04.y, texLine->unk_04.z + D_ctx_80177D20,
Matrix_Translate(gGfxMatrix, texLine->posAA.x, texLine->posAA.y, texLine->posAA.z + gPathProgress,
MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, texLine->unk_20, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, texLine->unk_1C, MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, texLine->unk_20, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, texLine->unk_28, texLine->unk_28, texLine->unk_24, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, texLine->yRot, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, texLine->xRot, MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, texLine->yRot, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, texLine->xyScale, texLine->xyScale, texLine->zScale, MTXF_APPLY);
if ((gCurrentLevel == LEVEL_AQUAS) || (gCurrentLevel == LEVEL_VENOM_ANDROSS)) {
s32 alpha = ((gGameFrameCount % 2) != 0) ? 180 : 50;
@@ -1808,8 +1808,8 @@ void TexturedLine_Draw(void) {
if (gCurrentLevel == LEVEL_MACBETH) {
gSPDisplayList(gMasterDisp++, D_MA_6012C00);
} else {
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, texLine->unk_2C, texLine->unk_2D, texLine->unk_2E,
texLine->unk_2F);
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, texLine->red, texLine->green, texLine->blue,
texLine->alpha);
gSPDisplayList(gMasterDisp++, D_edisplay_800CFD80);
}
}
@@ -1821,18 +1821,18 @@ void TexturedLine_Draw(void) {
void TexturedLine_DrawPath(s32 index) {
TexturedLine* texLine = &gTexturedLines[index];
if (texLine->unk_2F == 255) {
if (texLine->alpha == 255) {
RCP_SetupDL(&gMasterDisp, 5);
} else {
RCP_SetupDL(&gMasterDisp, 0xE);
}
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, texLine->unk_2C, texLine->unk_2D, texLine->unk_2E, texLine->unk_2F);
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, texLine->red, texLine->green, texLine->blue, texLine->alpha);
Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, texLine->unk_04.x, texLine->unk_04.y, texLine->unk_04.z, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, texLine->unk_20, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, texLine->unk_1C, MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, texLine->unk_1C, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, texLine->unk_28, 1.0f, texLine->unk_24, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, texLine->posAA.x, texLine->posAA.y, texLine->posAA.z, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, texLine->yRot, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, texLine->xRot, MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, texLine->xRot, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, texLine->xyScale, 1.0f, texLine->zScale, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK);
gSPDisplayList(gMasterDisp++, D_edisplay_800CFD80);
+56 -57
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.y = yPos;
gBonusText[i].pos.z = zPos;
gBonusText[i].unk_10 = 0.0f;
gBonusText[i].rise = 0.0f;
gBonusText[i].timer = 65;
break;
}
@@ -52,14 +52,14 @@ void BonusText_Update(void) {
}
if (gLevelMode == LEVELMODE_ON_RAILS) {
bonus->pos.z -= D_ctx_80177D08;
bonus->pos.z -= gPathVelZ;
} else if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) {
bonus->pos.x += gPlayer[0].vel.x;
bonus->pos.z += gPlayer[0].vel.z;
}
if (bonus->timer < 45) {
Math_SmoothStepToF(&bonus->unk_10, 300.0f, 0.1f, 20.0f, 0.0f);
Math_SmoothStepToF(&bonus->rise, 300.0f, 0.1f, 20.0f, 0.0f);
}
}
}
@@ -83,7 +83,7 @@ void BonusText_Draw(BonusText* bonus) {
f32 sp50;
if (bonus->timer <= 45) {
Matrix_Translate(gGfxMatrix, bonus->pos.x, bonus->pos.y, bonus->pos.z + D_ctx_80177D20, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, bonus->pos.x, bonus->pos.y, bonus->pos.z + gPathProgress, MTXF_APPLY);
Matrix_MultVec3f(gGfxMatrix, &sp60, &sp54);
if ((fabsf(sp54.x) < 20000.0f) && (fabsf(sp54.y) < 20000.0f)) {
@@ -92,7 +92,7 @@ void BonusText_Draw(BonusText* bonus) {
Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].camYaw, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].camPitch, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, sp50, sp50, 1.0f, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, 0.0f, bonus->unk_10, 0.0f, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, 0.0f, bonus->rise, 0.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
if (bonus->hits <= 10) {
@@ -980,7 +980,7 @@ void func_effect_8007A748(Effect* effect) {
}
bool func_effect_8007A774(Player* player, Effect* effect, f32 arg2) {
if ((fabsf(player->unk_138 - effect->obj.pos.z) < arg2) && (fabsf(player->pos.x - effect->obj.pos.x) < arg2) &&
if ((fabsf(player->trueZpos - effect->obj.pos.z) < arg2) && (fabsf(player->pos.x - effect->obj.pos.x) < arg2) &&
(fabsf(player->pos.y - effect->obj.pos.y) < arg2) && (player->timer_498 == 0)) {
Player_ApplyDamage(player, 0, effect->info.damage);
return true;
@@ -1145,7 +1145,7 @@ void func_effect_8007AF30(Effect* effect, f32 xPos, f32 zPos, f32 xVel, f32 zVel
effect->obj.pos.z = zPos;
effect->vel.x = xVel;
effect->vel.z = zVel - D_ctx_80177D08;
effect->vel.z = zVel - gPathVelZ;
effect->scale1 = scale1;
effect->timer_50 = 100;
Object_SetInfo(&effect->info, effect->obj.id);
@@ -2207,7 +2207,7 @@ void func_effect_8007DB70(Effect* effect) {
}
}
effect->obj.rot.y = 180.0f - effect->obj.rot.y;
if ((fabsf(gPlayer[0].unk_138 - effect->obj.pos.z) < 40.0f) &&
if ((fabsf(gPlayer[0].trueZpos - effect->obj.pos.z) < 40.0f) &&
(fabsf(gPlayer[0].pos.x - effect->obj.pos.x) < 80.0f)) {
if ((effect->obj.pos.y < gPlayer[0].pos.y) &&
((gPlayer[0].pos.y - effect->obj.pos.y) < (effect->scale2 * 35.0f)) &&
@@ -2246,7 +2246,7 @@ void func_effect_8007E014(Effect* effect) {
f32 y;
if (gGroundType == 4) {
Ground_801B6E20(effect->obj.pos.x, effect->obj.pos.z + D_ctx_80177D20, &x, &y, &z);
Ground_801B6E20(effect->obj.pos.x, effect->obj.pos.z + gPathProgress, &x, &y, &z);
effect->obj.pos.y = y + 3.0f;
effect->obj.rot.x = RAD_TO_DEG(x);
effect->obj.rot.z = RAD_TO_DEG(z);
@@ -2377,8 +2377,8 @@ void func_effect_8007E6B8(Effect* effect, u32 objId, f32 xPos, f32 yPos, f32 zPo
effect->obj.pos.z = zPos;
Object_SetInfo(&effect->info, effect->obj.id);
sp50 = Math_Atan2F(gPlayer[0].pos.x - xPos, gPlayer[0].unk_138 - zPos);
temp_ft4 = sqrtf(SQ(gPlayer[0].pos.x - xPos) + SQ(gPlayer[0].unk_138 - zPos));
sp50 = Math_Atan2F(gPlayer[0].pos.x - xPos, gPlayer[0].trueZpos - zPos);
temp_ft4 = sqrtf(SQ(gPlayer[0].pos.x - xPos) + SQ(gPlayer[0].trueZpos - zPos));
sp54 = -Math_Atan2F(gPlayer[0].pos.y - yPos, temp_ft4);
Matrix_RotateY(gCalcMatrix, sp50, MTXF_NEW);
@@ -2390,9 +2390,9 @@ void func_effect_8007E6B8(Effect* effect, u32 objId, f32 xPos, f32 yPos, f32 zPo
Matrix_MultVec3f(gCalcMatrix, &sp40, &sp34);
effect->vel.x = sp34.x + D_ctx_801779E4;
effect->vel.y = sp34.y + D_ctx_801779F4;
effect->vel.z = sp34.z - D_ctx_80177D08;
effect->vel.x = sp34.x + gPathVelX;
effect->vel.y = sp34.y + gPathVelY;
effect->vel.z = sp34.z - gPathVelZ;
if ((objId == OBJ_EFFECT_353) || (objId == OBJ_EFFECT_354)) {
effect->obj.rot.x = RAD_TO_DEG(sp54);
@@ -2447,9 +2447,9 @@ void func_effect_8007E93C(Effect* effect, u32 objId, f32 xPos, f32 yPos, f32 zPo
Matrix_MultVec3f(gCalcMatrix, &sp40, &sp34);
effect->vel.x = sp34.x + D_ctx_801779E4;
effect->vel.y = sp34.y + D_ctx_801779F4;
effect->vel.z = sp34.z - D_ctx_80177D08;
effect->vel.x = sp34.x + gPathVelX;
effect->vel.y = sp34.y + gPathVelY;
effect->vel.z = sp34.z - gPathVelZ;
if (objId == OBJ_EFFECT_353) {
effect->obj.rot.x = RAD_TO_DEG(sp54);
@@ -2559,8 +2559,8 @@ void func_effect_8007EE68(ObjectId objId, Vec3f* pos, Vec3f* rot, Vec3f* arg3, V
for (i = ARRAY_COUNT(gEffects) - 1; i >= 0; i--) {
if (gEffects[i].obj.status == OBJ_FREE) {
func_effect_8007ED54(&gEffects[i], objId, pos->x + sp68.x, pos->y + sp68.y, pos->z + sp68.z, rot->x, rot->y,
rot->z, arg3->x, arg3->y, arg3->z, sp68.x + D_ctx_801779E4, sp68.y + D_ctx_801779F4,
sp68.z - D_ctx_80177D08, scale2);
rot->z, arg3->x, arg3->y, arg3->z, sp68.x + gPathVelX, sp68.y + gPathVelY,
sp68.z - gPathVelZ, scale2);
break;
}
}
@@ -2582,7 +2582,7 @@ void func_effect_8007F04C(ObjectId objId, f32 xPos, f32 yPos, f32 zPos, f32 xRot
void func_effect_8007F11C(ObjectId objId, f32 xPos, f32 yPos, f32 zPos, f32 speed) {
s32 i;
if ((fabsf(zPos - gPlayer[0].unk_138) > 300.0f) || (fabsf(xPos - gPlayer[0].pos.x) > 300.0f)) {
if ((fabsf(zPos - gPlayer[0].trueZpos) > 300.0f) || (fabsf(xPos - gPlayer[0].pos.x) > 300.0f)) {
for (i = ARRAY_COUNT(gEffects) - 1; i >= 0; i--) {
if (gEffects[i].obj.status == OBJ_FREE) {
Matrix_Push(&gCalcMatrix);
@@ -2653,7 +2653,7 @@ void func_effect_8007F438(Effect* effect) {
effect->unk_46--;
}
if (D_ctx_80177D08 < 0.0f) {
if (gPathVelZ < 0.0f) {
effect->vel.z = -10.0f;
}
@@ -2723,7 +2723,7 @@ void func_effect_8007F6B0(Effect* effect) {
yPos = gGroundHeight + 40.0f;
if (gGroundType == 4) {
Ground_801B6E20(effect->obj.pos.x + sin, effect->obj.pos.z + cos + D_ctx_80177D20, &x, &y, &z);
Ground_801B6E20(effect->obj.pos.x + sin, effect->obj.pos.z + cos + gPathProgress, &x, &y, &z);
yPos = y + 30.0f;
}
@@ -2770,7 +2770,7 @@ void func_effect_8007F958(Effect* effect) {
yPos = gGroundHeight + 10.0f;
if (gGroundType == 4) {
Ground_801B6E20(effect->obj.pos.x + sin, effect->obj.pos.z + cos + D_ctx_80177D20, &x, &y, &z);
Ground_801B6E20(effect->obj.pos.x + sin, effect->obj.pos.z + cos + gPathProgress, &x, &y, &z);
yPos = y + 10.0f;
}
@@ -2825,13 +2825,13 @@ bool func_effect_8007FD84(Effect* effect) {
(fabsf(actor->obj.pos.z - effect->obj.pos.z) < 100.0f) &&
(fabsf(actor->obj.pos.x - effect->obj.pos.x) < 100.0f) &&
(fabsf(actor->obj.pos.y - effect->obj.pos.y) < 100.0f)) {
actor->unk_0D0 = 1;
actor->unk_0D2 = 0;
actor->dmgType = 1;
actor->dmgPart = 0;
actor->damage = 10;
if (effect->obj.id == OBJ_EFFECT_354) {
actor->damage = 30;
}
actor->unk_0D4 = 100;
actor->dmgSource = 100;
return true;
}
}
@@ -2855,14 +2855,14 @@ void func_effect_8007FE88(Effect* effect) {
return;
}
if (gPlayer[0].unk_280 != 0) {
if (gPlayer[0].barrelRollAlpha != 0) {
var_fa0 = 100.0f;
}
if (fabsf(gPlayer[0].unk_138 - effect->obj.pos.z) < (50.0f + var_fa0)) {
if (fabsf(gPlayer[0].trueZpos - effect->obj.pos.z) < (50.0f + var_fa0)) {
if ((fabsf(gPlayer[0].pos.x - effect->obj.pos.x) < (30.0f + var_fa0)) &&
(fabsf(gPlayer[0].pos.y - effect->obj.pos.y) < (30.0f + var_fa0))) {
if ((gPlayer[0].unk_280 != 0) || (gPlayer[0].timer_27C != 0)) {
if ((gPlayer[0].barrelRollAlpha != 0) || (gPlayer[0].meteoWarpTimer != 0)) {
effect->obj.rot.y = 90.0f;
effect->obj.rot.x = RAND_FLOAT(360.0f);
Matrix_RotateY(gCalcMatrix, effect->obj.rot.y * M_DTOR, MTXF_NEW);
@@ -2878,16 +2878,16 @@ void func_effect_8007FE88(Effect* effect) {
AUDIO_PLAY_SFX(0x09007011, effect->sfxSource, 0);
}
if ((gPlayer[0].unk_280 == 0) && (gPlayer[0].timer_498 == 0)) {
if ((gPlayer[0].barrelRollAlpha == 0) && (gPlayer[0].timer_498 == 0)) {
Player_ApplyDamage(gPlayer, 0, effect->info.damage);
gPlayer[0].unk_0D8.x = 20.0f;
gPlayer[0].knockback.x = 20.0f;
if (effect->vel.x < 0.0f) {
gPlayer[0].unk_0D8.x *= -1.0f;
gPlayer[0].knockback.x *= -1.0f;
}
if (gCurrentLevel != LEVEL_MACBETH) {
gPlayer[0].unk_0D8.y = 20.0f;
gPlayer[0].knockback.y = 20.0f;
if (effect->vel.y < 0.0f) {
gPlayer[0].unk_0D8.y *= -1.0f;
gPlayer[0].knockback.y *= -1.0f;
}
}
Object_Kill(&effect->obj, effect->sfxSource);
@@ -2896,7 +2896,7 @@ void func_effect_8007FE88(Effect* effect) {
}
if (gGroundType == 4) {
if (Ground_801B6AEC(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z + D_ctx_80177D20) != 0) {
if (Ground_801B6AEC(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z + gPathProgress) != 0) {
Object_Kill(&effect->obj, effect->sfxSource);
}
} else if (effect->obj.pos.y < gGroundHeight) {
@@ -2961,8 +2961,8 @@ void func_effect_8008040C(Effect* effect) {
switch (effect->state) {
case 0:
yRot = Math_Atan2F(gPlayer[0].pos.x - effect->obj.pos.x, gPlayer[0].unk_138 - effect->obj.pos.z);
temp = sqrtf(SQ(gPlayer[0].pos.x - effect->obj.pos.x) + SQ(gPlayer[0].unk_138 - effect->obj.pos.z));
yRot = Math_Atan2F(gPlayer[0].pos.x - effect->obj.pos.x, gPlayer[0].trueZpos - effect->obj.pos.z);
temp = sqrtf(SQ(gPlayer[0].pos.x - effect->obj.pos.x) + SQ(gPlayer[0].trueZpos - effect->obj.pos.z));
xRot = -Math_Atan2F(gPlayer[0].pos.y - effect->obj.pos.y, temp);
Matrix_RotateY(gCalcMatrix, yRot, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, xRot, MTXF_APPLY);
@@ -2970,9 +2970,9 @@ void func_effect_8008040C(Effect* effect) {
srcVelocity.x = 0.0f;
srcVelocity.z = 100.0f;
Matrix_MultVec3f(gCalcMatrix, &srcVelocity, &destVelocity);
effect->vel.x = destVelocity.x + D_ctx_801779E4;
effect->vel.y = destVelocity.y + D_ctx_801779F4;
effect->vel.z = destVelocity.z - D_ctx_80177D08;
effect->vel.x = destVelocity.x + gPathVelX;
effect->vel.y = destVelocity.y + gPathVelY;
effect->vel.z = destVelocity.z - gPathVelZ;
effect->state++;
break;
@@ -2988,14 +2988,14 @@ void func_effect_8008040C(Effect* effect) {
return;
}
if (gPlayer[0].unk_280 != 0) {
if (gPlayer[0].barrelRollAlpha != 0) {
var_fa0 = 100.0f;
}
if (fabsf(gPlayer[0].unk_138 - effect->obj.pos.z) < (50.0f + var_fa0)) {
if (fabsf(gPlayer[0].trueZpos - effect->obj.pos.z) < (50.0f + var_fa0)) {
if ((fabsf(gPlayer[0].pos.x - effect->obj.pos.x) < (30.0f + var_fa0)) &&
(fabsf(gPlayer[0].pos.y - effect->obj.pos.y) < (30.0f + var_fa0))) {
if ((gPlayer[0].unk_280 != 0) || (gPlayer[0].timer_27C != 0)) {
if ((gPlayer[0].barrelRollAlpha != 0) || (gPlayer[0].meteoWarpTimer != 0)) {
effect->obj.rot.y = 90.0f;
effect->obj.rot.x = RAND_FLOAT(360.0f);
Matrix_RotateY(gCalcMatrix, effect->obj.rot.y * M_DTOR, MTXF_NEW);
@@ -3011,23 +3011,22 @@ void func_effect_8008040C(Effect* effect) {
AUDIO_PLAY_SFX(0x09007011, effect->sfxSource, 0);
}
if ((gPlayer[0].unk_280 == 0) && (gPlayer[0].timer_498 == 0)) {
if ((gPlayer[0].barrelRollAlpha == 0) && (gPlayer[0].timer_498 == 0)) {
Player_ApplyDamage(gPlayer, 0, effect->info.damage);
gPlayer[0].unk_0D8.x = 20.0f;
gPlayer[0].knockback.x = 20.0f;
if (effect->vel.x < 0.0f) {
gPlayer[0].unk_0D8.x *= -1.0f;
gPlayer[0].knockback.x *= -1.0f;
}
gPlayer[0].unk_0D8.y = 20.0f;
gPlayer[0].knockback.y = 20.0f;
if (effect->vel.y < 0.0f) {
gPlayer[0].unk_0D8.y *= -1.0f;
gPlayer[0].knockback.y *= -1.0f;
}
Object_Kill(&effect->obj, effect->sfxSource);
}
}
if (gGroundType == 4) {
if (Ground_801B6AEC(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z + D_ctx_80177D20) !=
0) {
if (Ground_801B6AEC(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z + gPathProgress) != 0) {
Object_Kill(&effect->obj, effect->sfxSource);
}
} else if (effect->obj.pos.y < gGroundHeight) {
@@ -3576,7 +3575,7 @@ void func_effect_80081C5C(Effect* effect) {
if (effect->unk_44 != 0) {
Object_Kill(&effect->obj, effect->sfxSource);
func_effect_8007D0E0(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 5.0f);
} else if (fabsf(gPlayer[0].unk_138 - effect->obj.pos.z) < 1000.0f) {
} else if (fabsf(gPlayer[0].trueZpos - effect->obj.pos.z) < 1000.0f) {
ActorEvent_8006F0D8(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 15.0f);
Object_Kill(&effect->obj, effect->sfxSource);
}
@@ -3766,11 +3765,11 @@ void func_effect_80081C5C(Effect* effect) {
if ((((gGameFrameCount % 16) == 0)) && (effect->timer_50 == 0)) {
D_800D18EC =
RAD_TO_DEG(Math_Atan2F(gPlayer[0].cam.eye.x - gBosses[0].obj.pos.x,
gPlayer[0].cam.eye.z - (gBosses[0].obj.pos.z + D_ctx_80177D20)));
gPlayer[0].cam.eye.z - (gBosses[0].obj.pos.z + gPathProgress)));
D_800D18E8 = RAD_TO_DEG(
-Math_Atan2F(gPlayer[0].cam.eye.y - gBosses[0].obj.pos.y,
sqrtf(SQ(gPlayer[0].cam.eye.z - (gBosses[0].obj.pos.z + D_ctx_80177D20)) +
sqrtf(SQ(gPlayer[0].cam.eye.z - (gBosses[0].obj.pos.z + gPathProgress)) +
SQ(gPlayer[0].cam.eye.x - gBosses[0].obj.pos.x))));
}
if (gBosses[0].timer_050 == 0) {
@@ -3812,7 +3811,7 @@ void func_effect_80081C5C(Effect* effect) {
}
velocity.x = velocity.y = 0.0f;
velocity.z = fabsf(gPlayer[0].unk_138 - effect->obj.pos.z);
velocity.z = fabsf(gPlayer[0].trueZpos - effect->obj.pos.z);
Matrix_MultVec3fNoTranslate(gCalcMatrix, &velocity, &velocityDest);
@@ -4052,7 +4051,7 @@ void func_effect_800837EC(Effect* effect) {
}
effect->obj.rot.y = RAD_TO_DEG(Math_Atan2F(gPlayer[0].cam.eye.x - effect->obj.pos.x,
gPlayer[0].cam.eye.z - (effect->obj.pos.z + D_ctx_80177D20)));
gPlayer[0].cam.eye.z - (effect->obj.pos.z + gPathProgress)));
}
void func_effect_80083B8C(Effect* effect) {
@@ -4116,7 +4115,7 @@ void func_effect_80083D2C(f32 xPos, f32 yPos, f32 zPos, f32 srcZ) {
x = gPlayer[0].pos.x + xSway - xPos;
y = gPlayer[0].pos.y - yPos;
z = gPlayer[0].unk_138 - zPos;
z = gPlayer[0].trueZpos - zPos;
yRot = Math_Atan2F(x, z);
xRot = -Math_Atan2F(y, sqrtf(SQ(x) + SQ(z)));
@@ -4129,7 +4128,7 @@ void func_effect_80083D2C(f32 xPos, f32 yPos, f32 zPos, f32 srcZ) {
Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest);
dest.z -= D_ctx_80177D08;
dest.z -= gPathVelZ;
for (i = 0; i < 6; i++) {
for (j = 0; j < ARRAY_COUNT(gEffects); j++) {
+226 -224
View File
@@ -135,7 +135,7 @@ void Object_SetInfo(ObjectInfo* info, u32 objId) {
*info = D_edata_800CC124[objId];
info->hitbox = SEGMENTED_TO_VIRTUAL(D_edata_800CC124[objId].hitbox);
if (gLevelMode == LEVELMODE_UNK_2) {
info->unk_10 += 200.0f;
info->cullDistance += 200.0f;
}
}
@@ -263,7 +263,7 @@ void Item_Load(Item* item, ObjectInit* objInit) {
item->obj.rot.x = objInit->rot.x;
item->obj.rot.z = objInit->rot.z;
item->obj.id = objInit->id;
item->scale = 1.0f;
item->width = 1.0f;
Object_SetInfo(&item->info, item->obj.id);
}
@@ -284,7 +284,7 @@ void func_enmy_80061958(Effect* effect, f32 xPos, f32 yPos, f32 zPos) {
effect->obj.rot.z = RAND_FLOAT(360.0f);
Object_SetInfo(&effect->info, effect->obj.id);
if (gLevelType == LEVELTYPE_PLANET) {
effect->info.unk_10 = 100.0f;
effect->info.cullDistance = 100.0f;
}
}
@@ -298,9 +298,9 @@ void func_enmy_80061A4C(void) {
if (gEffects[i].obj.status == OBJ_FREE) {
x = gPlayer[0].pos.x + RAND_FLOAT_CENTERED(400.0f) + (5.0f * gPlayer[0].vel.x);
y = gPlayer[0].pos.y + RAND_FLOAT_CENTERED(400.0f) + (5.0f * gPlayer[0].vel.y);
z = -D_ctx_80177D20 - 500.0f;
if (D_ctx_80177D08 < 0.0f) {
z = -D_ctx_80177D20 + 500.0f;
z = -gPathProgress - 500.0f;
if (gPathVelZ < 0.0f) {
z = -gPathProgress + 500.0f;
}
func_enmy_80061958(&gEffects[i], x, y, z);
break;
@@ -322,9 +322,9 @@ void func_enmy_80061B68(void) {
while (y <= gGroundHeight) {
y = gPlayer[0].pos.y + RAND_FLOAT_CENTERED(2000.0f) + (5.0f * gPlayer[0].vel.y);
}
z = -D_ctx_80177D20 - 3000.0f;
if (D_ctx_80177D08 < 0.0f) {
z = -D_ctx_80177D20 + 1000.0f;
z = -gPathProgress - 3000.0f;
if (gPathVelZ < 0.0f) {
z = -gPathProgress + 1000.0f;
}
func_enmy_80061958(&gEffects[i], x, y, z);
break;
@@ -342,9 +342,9 @@ void func_enmy_80061CD0(void) {
if (gEffects[i].obj.status == OBJ_FREE) {
x = gPlayer[gPlayerNum].pos.x + RAND_FLOAT_CENTERED(3000.0f) + (5.0f * gPlayer[gPlayerNum].vel.x);
y = gPlayer[gPlayerNum].pos.y + 1000.0f + RAND_FLOAT_CENTERED(500.0f) + (5.0f * gPlayer[gPlayerNum].vel.y);
z = -D_ctx_80177D20 - RAND_FLOAT(2000.0f);
if (D_ctx_80177D08 < 0.0f) {
z = -D_ctx_80177D20 + 1000.0f;
z = -gPathProgress - RAND_FLOAT(2000.0f);
if (gPathVelZ < 0.0f) {
z = -gPathProgress + 1000.0f;
}
func_enmy_80061958(&gEffects[i], x, y, z);
break;
@@ -388,7 +388,7 @@ void ActorEvent_Load(Actor* actor, ObjectInit* objInit, s32 index) {
actor->aiType = objInit->id - ACTOR_EVENT_ID;
Object_SetInfo(&actor->info, actor->obj.id);
actor->info.unk_10 = 3000.0f;
actor->info.cullDistance = 3000.0f;
actor->fwork[25] = 20000.0f;
actor->iwork[1] = gPrevEventActorIndex;
actor->iwork[10] = gActors[gPrevEventActorIndex].aiType;
@@ -408,8 +408,8 @@ void ActorEvent_Load(Actor* actor, ObjectInit* objInit, s32 index) {
void Object_Load(ObjectInit* objInit, f32 xMax, f32 xMin, f32 yMax, f32 yMin) {
s32 i;
if ((xMax > objInit->xPos - gPlayer[0].unk_0AC) && (objInit->xPos - gPlayer[0].unk_0AC > xMin) &&
(yMax > objInit->yPos - gPlayer[0].unk_0B0) && (objInit->yPos - gPlayer[0].unk_0B0 > yMin)) {
if ((xMax > objInit->xPos - gPlayer[0].xPath) && (objInit->xPos - gPlayer[0].xPath > xMin) &&
(yMax > objInit->yPos - gPlayer[0].yPath) && (objInit->yPos - gPlayer[0].yPath > yMin)) {
if (objInit->id < OBJ_SPRITE_CO_POLE) {
for (i = 0; i < ARRAY_COUNT(gScenery); i++) {
if (gScenery[i].obj.status == OBJ_FREE) {
@@ -560,20 +560,20 @@ void Object_LoadLevelObjects(void) {
yMin = xMin = -4000.0f;
}
if ((gPlayer[0].timer_210 != 0) && (gPlayer[0].unk_118 < 0.0f)) {
if ((gPlayer[0].timer_210 != 0) && (gPlayer[0].yRot_118 < 0.0f)) {
xMax = 10000.0f;
}
if ((gPlayer[0].timer_210 != 0) && (gPlayer[0].unk_118 > 0.0f)) {
if ((gPlayer[0].timer_210 != 0) && (gPlayer[0].yRot_118 > 0.0f)) {
xMin = -10000.0f;
}
gLastPathChange = 0;
for (i = 0, objInit = &gLevelObjects[gObjectLoadIndex]; i < 10000; i++, gObjectLoadIndex++, objInit++) {
if ((objInit->id > OBJ_INVALID) && D_ctx_80177D20 <= objInit->zPos1 &&
objInit->zPos1 <= D_ctx_80177D20 + 200.0f) {
if ((objInit->id > OBJ_INVALID) && gPathProgress <= objInit->zPos1 &&
objInit->zPos1 <= gPathProgress + 200.0f) {
if ((gCurrentLevel == LEVEL_VENOM_1) && (objInit->id >= ACTOR_EVENT_ID)) {
if (((objInit->rot.y < 180.0f) && (objInit->xPos < gPlayer[0].unk_0AC)) ||
((objInit->rot.y > 180.0f) && (gPlayer[0].unk_0AC < objInit->xPos))) {
if (((objInit->rot.y < 180.0f) && (objInit->xPos < gPlayer[0].xPath)) ||
((objInit->rot.y > 180.0f) && (gPlayer[0].xPath < objInit->xPos))) {
Object_Load(objInit, xMax, xMin, yMax, yMin);
}
} else {
@@ -747,12 +747,12 @@ bool Object_CheckPolyCollision(Vec3f* pos, Vec3f* vel, ObjectId objId, Object* o
objPos.z = obj->pos.z;
if ((objId == OBJ_ACTOR_180) || (objId == OBJ_SCENERY_149) || (objId == OBJ_SCENERY_150) ||
(objId == OBJ_BOSS_308) || (objId == OBJ_BOSS_313) || (objId == OBJ_BOSS_312) || (objId == OBJ_BOSS_309) ||
(objId == OBJ_SCENERY_39)) {
(objId == OBJ_SCENERY_ME_TUNNEL)) {
colId = COL1_0;
if (objId == OBJ_BOSS_312) {
colId = COL1_9;
}
if (objId == OBJ_SCENERY_39) {
if (objId == OBJ_SCENERY_ME_TUNNEL) {
colId = COL1_1;
} else if (objId == OBJ_BOSS_308) {
colId = COL1_4;
@@ -829,7 +829,7 @@ s32 Object_CheckCollision(s32 index, Vec3f* pos, Vec3f* vel, s32 mode) {
if (scenery->obj.status == OBJ_ACTIVE) {
if ((scenery->obj.id == OBJ_SCENERY_1) || (scenery->obj.id == OBJ_SCENERY_4) ||
(scenery->obj.id == OBJ_SCENERY_5) || (scenery->obj.id == OBJ_SCENERY_2) ||
(scenery->obj.id == OBJ_SCENERY_39) || (scenery->obj.id == OBJ_SCENERY_3)) {
(scenery->obj.id == OBJ_SCENERY_ME_TUNNEL) || (scenery->obj.id == OBJ_SCENERY_3)) {
if (Object_CheckPolyCollision(pos, vel, scenery->obj.id, &scenery->obj)) {
return 2;
}
@@ -902,9 +902,9 @@ s32 Object_CheckCollision(s32 index, Vec3f* pos, Vec3f* vel, s32 mode) {
} else if (actor->scale < 0.0f) {
if (Object_CheckHitboxCollision(pos, actor->info.hitbox, &actor->obj, actor->vwork[29].x,
actor->vwork[29].y, actor->vwork[29].z + actor->unk_0F4.z)) {
actor->unk_0D0 = 1;
actor->dmgType = 1;
actor->damage = 10;
actor->unk_0D2 = -1;
actor->dmgPart = -1;
actor->hitPos.x = pos->x;
actor->hitPos.y = pos->y;
actor->hitPos.z = pos->z;
@@ -912,9 +912,9 @@ s32 Object_CheckCollision(s32 index, Vec3f* pos, Vec3f* vel, s32 mode) {
}
} else if ((mode != 2) && (mode != 3)) {
if (Object_CheckSingleHitbox(pos, actor->info.hitbox, &actor->obj.pos)) {
actor->unk_0D0 = 1;
actor->dmgType = 1;
actor->damage = 10;
actor->unk_0D2 = -1;
actor->dmgPart = -1;
if (!(((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->iwork[12] != 0)) ||
((actor->obj.id == OBJ_ACTOR_ALLRANGE) &&
((actor->aiType < AI360_10) || (actor->aiType >= AI360_GREAT_FOX))))) {
@@ -1001,11 +1001,11 @@ void func_enmy_80063F4C(s32 arg0) {
}
void func_enmy_80063F58(Item* item) {
item->scale = item->obj.rot.z * 100.0f;
item->width = item->obj.rot.z * 100.0f;
}
void func_enmy_80063F74(Item* item) {
item->scale = item->obj.rot.z * 100.0f;
item->width = item->obj.rot.z * 100.0f;
}
void Object_Init(s32 index, ObjectId objId) {
@@ -1037,7 +1037,7 @@ void Object_Init(s32 index, ObjectId objId) {
break;
case OBJ_EFFECT_368:
if (gCurrentLevel == LEVEL_TITANIA) {
Ground_801B6E20(gEffects[index].obj.pos.x, gEffects[index].obj.pos.z + D_ctx_80177D20, &sp54, &sp4C,
Ground_801B6E20(gEffects[index].obj.pos.x, gEffects[index].obj.pos.z + gPathProgress, &sp54, &sp4C,
&sp50);
gEffects[index].obj.pos.y = sp4C + 3.0f;
gEffects[index].obj.rot.x = RAD_TO_DEG(sp54);
@@ -1046,31 +1046,31 @@ void Object_Init(s32 index, ObjectId objId) {
gEffects[index].obj.status = OBJ_FREE;
}
break;
case OBJ_SCENERY_30:
case OBJ_SCENERY_TI_RIB_0:
func_enmy_80063E5C(&gScenery[index], D_TI_6006940);
break;
case OBJ_SCENERY_31:
case OBJ_SCENERY_TI_RIB_1:
func_enmy_80063E5C(&gScenery[index], D_TI_600695C);
break;
case OBJ_SCENERY_32:
case OBJ_SCENERY_TI_RIB_2:
func_enmy_80063E5C(&gScenery[index], D_TI_6006978);
break;
case OBJ_SCENERY_33:
case OBJ_SCENERY_TI_RIB_3:
func_enmy_80063E5C(&gScenery[index], D_TI_6006994);
break;
case OBJ_SCENERY_34:
case OBJ_SCENERY_TI_RIB_4:
func_enmy_80063E5C(&gScenery[index], D_TI_60069B0);
break;
case OBJ_SCENERY_35:
case OBJ_SCENERY_TI_RIB_5:
func_enmy_80063E5C(&gScenery[index], D_TI_60069CC);
break;
case OBJ_SCENERY_36:
case OBJ_SCENERY_TI_RIB_6:
func_enmy_80063E5C(&gScenery[index], D_TI_60069E8);
break;
case OBJ_SCENERY_37:
case OBJ_SCENERY_TI_RIB_7:
func_enmy_80063E5C(&gScenery[index], D_TI_6006A04);
break;
case OBJ_SCENERY_38:
case OBJ_SCENERY_TI_RIB_8:
func_enmy_80063E5C(&gScenery[index], D_TI_6006A20);
break;
case OBJ_SCENERY_23:
@@ -1342,13 +1342,13 @@ void Object_Init(s32 index, ObjectId objId) {
}
}
void func_enmy_800652CC(Scenery* scenery) {
void Scenery_UpdateTitaniaBones(Scenery* scenery) {
f32 sp2C;
f32 sp28;
f32 sp24;
if ((gGroundType == 4) && (scenery->state == 0)) {
Ground_801B6E20(scenery->obj.pos.x, scenery->obj.pos.z + D_ctx_80177D20, &sp2C, &sp24, &sp28);
Ground_801B6E20(scenery->obj.pos.x, scenery->obj.pos.z + gPathProgress, &sp2C, &sp24, &sp28);
scenery->obj.pos.y = sp24 + 3.0f;
scenery->obj.rot.x = RAD_TO_DEG(sp2C);
scenery->obj.rot.z = RAD_TO_DEG(sp28);
@@ -1513,7 +1513,7 @@ void func_enmy_800656D4(Actor* actor) {
}
} else {
actor->fwork[29] = gPlayer[0].unk_138;
actor->fwork[29] = gPlayer[0].trueZpos;
actor->fwork[28] = gPlayer[0].pos.y;
actor->fwork[27] = gPlayer[0].pos.x;
}
@@ -1547,9 +1547,9 @@ void func_enmy_800656D4(Actor* actor) {
if ((fabsf(actor->fwork[27] - actor->obj.pos.x) < 60.0f) &&
(fabsf(actor->fwork[28] - actor->obj.pos.y) < 60.0f) &&
(fabsf(actor->fwork[29] - actor->obj.pos.z) < 60.0f) && ((spC4 == 2) || (spC4 == 3) || (spC4 == 4))) {
gActors[spC4].unk_0D0 = 1;
gActors[spC4].dmgType = 1;
gActors[spC4].damage = 20;
gActors[spC4].unk_0D4 = 2;
gActors[spC4].dmgSource = 2;
func_effect_8007A6F0(&actor->obj.pos, 0x2903A008);
func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 5.0f);
Object_Kill(&actor->obj, actor->sfxSource);
@@ -1558,7 +1558,7 @@ void func_enmy_800656D4(Actor* actor) {
Math_Vec3fFromAngles(&sp98, actor->obj.rot.x, actor->obj.rot.y, actor->fwork[5]);
actor->vel.x = sp98.x;
actor->vel.y = sp98.y;
actor->vel.z = sp98.z - D_ctx_80177D08;
actor->vel.z = sp98.z - gPathVelZ;
if (actor->unk_0B4 == 0) {
actor->obj.rot.z += 5.0f;
}
@@ -1576,18 +1576,18 @@ void func_enmy_800656D4(Actor* actor) {
}
Math_SmoothStepToAngle(&actor->obj.rot.z, var_fv0, 0.1f, 3.0f, 0.01f);
}
if ((gGroundType == 4) && Ground_801B6AEC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + D_ctx_80177D20)) {
if ((gGroundType == 4) && Ground_801B6AEC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + gPathProgress)) {
func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 5.0f);
Object_Kill(&actor->obj, actor->sfxSource);
}
sp8C.x = actor->vel.x;
sp8C.y = actor->vel.y;
sp8C.z = actor->vel.z;
if ((Object_CheckCollision(actor->index, &actor->obj.pos, &sp8C, 1) != 0) || (actor->unk_0D0 != 0) ||
if ((Object_CheckCollision(actor->index, &actor->obj.pos, &sp8C, 1) != 0) || (actor->dmgType != 0) ||
(actor->obj.pos.y < (gGroundHeight + 10.0f)) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE)) {
func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 3.0f);
Object_Kill(&actor->obj, actor->sfxSource);
if (actor->unk_0D0 != 0) {
if (actor->dmgType != 0) {
actor->itemDrop = DROP_SILVER_RING_50p;
if ((gCurrentLevel == LEVEL_CORNERIA)) {
if (gLevelMode == LEVELMODE_ALL_RANGE) {
@@ -1604,10 +1604,10 @@ void func_enmy_800656D4(Actor* actor) {
func_effect_8007A6F0(&actor->obj.pos, 0x2903A008);
}
if (gLevelMode == LEVELMODE_ON_RAILS) {
if (fabsf(actor->obj.pos.z - gPlayer[0].unk_138) < 100.0f) {
if (fabsf(actor->obj.pos.z - gPlayer[0].trueZpos) < 100.0f) {
actor->iwork[10] = 1;
}
if (gPlayer[0].cam.eye.z < (actor->obj.pos.z + D_ctx_80177D20)) {
if (gPlayer[0].cam.eye.z < (actor->obj.pos.z + gPathProgress)) {
Object_Kill(&actor->obj, actor->sfxSource);
}
}
@@ -1649,12 +1649,12 @@ void Actor_Despawn(Actor* actor) {
s32 i;
if (gVersusMode) {
if ((actor->unk_0D4 > 0) && (actor->unk_0D4 < 5) &&
if ((actor->dmgSource > 0) && (actor->dmgSource < 5) &&
!((D_versus_80178768[0] == 0) && (D_versus_80178768[1] == 0) && (D_versus_80178768[2] == 0))) {
D_ctx_80177C30[actor->unk_0D4 - 1] += actor->info.bonus;
gPlayerScores[actor->dmgSource - 1] += actor->info.bonus;
}
} else if ((actor->obj.id != OBJ_ACTOR_ALLRANGE) || (actor->unk_0B6 != 1)) {
if ((actor->unk_0D4 == 1) && (actor->info.bonus != 0)) {
} else if (!((actor->obj.id == OBJ_ACTOR_ALLRANGE) && (actor->unk_0B6 == 1))) {
if ((actor->dmgSource == 1) && (actor->info.bonus != 0)) {
gHitCount += actor->info.bonus;
D_ctx_80177850 = 15;
if ((gLevelMode == LEVELMODE_ALL_RANGE) && (gDropHitCountItem != 0)) {
@@ -1751,10 +1751,10 @@ void func_enmy_8006654C(Actor* actor) {
break;
}
actor->scale = 0.8f;
if (actor->unk_0D0 != 0) {
if (actor->dmgType != 0) {
actor->obj.status = OBJ_DYING;
actor->vel.y = RAND_FLOAT(5.0f) + 6.0f;
if (actor->unk_0D0 == 2) {
if (actor->dmgType == 2) {
actor->vel.y = -2.0f;
}
actor->vel.z = -15.0f;
@@ -1798,7 +1798,7 @@ void func_enmy_800669A0(Actor* actor) {
}
} else {
actor->obj.rot.y += 5.0f;
if (actor->unk_0D0 != 0) {
if (actor->dmgType != 0) {
func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y + 130.0f, actor->obj.pos.z, 8.0f);
func_effect_8007BFFC(actor->obj.pos.x, actor->obj.pos.y + 130.0f, actor->obj.pos.z, 0.0f, 0.0f, 0.0f, 4.0f,
5);
@@ -1892,42 +1892,42 @@ void func_enmy_80066EA8(Scenery* scenery) {
void func_enmy_80066EE4(Sprite* sprite) {
}
void func_enmy_80066EF0(Item* item) {
void Item_CheckBounds(Item* this) {
f32 var_fa1;
if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_STANDBY)) {
Object_Kill(&item->obj, item->sfxSource);
Object_Kill(&this->obj, this->sfxSource);
}
if ((gLevelMode == LEVELMODE_ON_RAILS) && (gLastPathChange == 0)) {
var_fa1 = 900.0f;
if (gPlayer[0].form != FORM_ARWING) {
var_fa1 = 600.0f;
}
if (item->obj.pos.x > gPlayer[0].unk_0AC + var_fa1) {
Math_SmoothStepToF(&item->obj.pos.x, gPlayer[0].unk_0AC + var_fa1, 0.1f, 10.0f, 0.01f);
if (this->obj.pos.x > gPlayer[0].xPath + var_fa1) {
Math_SmoothStepToF(&this->obj.pos.x, gPlayer[0].xPath + var_fa1, 0.1f, 10.0f, 0.01f);
}
if (item->obj.pos.x < gPlayer[0].unk_0AC - var_fa1) {
Math_SmoothStepToF(&item->obj.pos.x, gPlayer[0].unk_0AC - var_fa1, 0.1f, 10.0f, 0.01f);
if (this->obj.pos.x < gPlayer[0].xPath - var_fa1) {
Math_SmoothStepToF(&this->obj.pos.x, gPlayer[0].xPath - var_fa1, 0.1f, 10.0f, 0.01f);
}
}
if (item->obj.pos.y > 650.0f) {
Math_SmoothStepToF(&item->obj.pos.y, 650.0f, 0.1f, 10.0f, 0.01f);
if (this->obj.pos.y > 650.0f) {
Math_SmoothStepToF(&this->obj.pos.y, 650.0f, 0.1f, 10.0f, 0.01f);
}
if (gLevelType == LEVELTYPE_PLANET) {
if (item->obj.pos.y < gGroundHeight + 70.0f) {
Math_SmoothStepToF(&item->obj.pos.y, gGroundHeight + 70.0f, 0.1f, 5.0f, 0.01f);
if (this->obj.pos.y < gGroundHeight + 70.0f) {
Math_SmoothStepToF(&this->obj.pos.y, gGroundHeight + 70.0f, 0.1f, 5.0f, 0.01f);
}
if ((gCurrentLevel == LEVEL_AQUAS) && (gBossActive != 0)) {
item->obj.pos.z += 20.0f;
this->obj.pos.z += 20.0f;
}
} else if (item->obj.pos.y < -500.0f) {
Math_SmoothStepToF(&item->obj.pos.y, -500.0f, 0.1f, 5.0f, 0.01f);
} else if (this->obj.pos.y < -500.0f) {
Math_SmoothStepToF(&this->obj.pos.y, -500.0f, 0.1f, 5.0f, 0.01f);
}
if (gVersusMode && (item->index == 0) && (gItems[1].obj.status == OBJ_ACTIVE)) {
if (fabsf(item->obj.pos.x - gItems[1].obj.pos.x) < 200.0f) {
if (fabsf(item->obj.pos.z - gItems[1].obj.pos.z) < 200.0f) {
item->obj.pos.x = item->obj.pos.x - 5.0f;
item->obj.pos.z = item->obj.pos.z - 5.0f;
if (gVersusMode && (this->index == 0) && (gItems[1].obj.status == OBJ_ACTIVE)) {
if (fabsf(this->obj.pos.x - gItems[1].obj.pos.x) < 200.0f) {
if (fabsf(this->obj.pos.z - gItems[1].obj.pos.z) < 200.0f) {
this->obj.pos.x = this->obj.pos.x - 5.0f;
this->obj.pos.z = this->obj.pos.z - 5.0f;
gItems[1].obj.pos.x += 5.0f;
gItems[1].obj.pos.z += 5.0f;
}
@@ -1935,29 +1935,29 @@ void func_enmy_80066EF0(Item* item) {
}
}
void func_enmy_800671D0(Item* item) {
s32 var_v0;
void Item_SpinPickup(Item* this) {
s32 sparkleMask;
Vec3f sp40;
Vec3f sp34;
Math_SmoothStepToF(&item->unk_50, 10.0f, 1.0f, 2.0f, 0.0f);
if (item->unk_50 > 30.0f) {
var_v0 = 0;
} else if (item->unk_50 > 20.0f) {
var_v0 = 1;
Math_SmoothStepToF(&this->unk_50, 10.0f, 1.0f, 2.0f, 0.0f);
if (this->unk_50 > 30.0f) {
sparkleMask = 1 - 1;
} else if (this->unk_50 > 20.0f) {
sparkleMask = 2 - 1;
} else {
var_v0 = 7;
sparkleMask = 8 - 1;
}
if (!(var_v0 & gGameFrameCount)) {
if (!(sparkleMask & gGameFrameCount)) {
Matrix_RotateY(gCalcMatrix, gGameFrameCount * 23.0f * M_DTOR, MTXF_NEW);
sp40.x = 50.0f;
sp40.y = RAND_FLOAT_CENTERED(120.0f);
sp40.z = 0.0f;
Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp40, &sp34);
func_effect_80078E50(item->obj.pos.x + sp34.x, item->obj.pos.y + sp34.y, item->obj.pos.z + sp34.z, 3.0f);
func_effect_80078E50(this->obj.pos.x + sp34.x, this->obj.pos.y + sp34.y, this->obj.pos.z + sp34.z, 3.0f);
}
item->obj.rot.y += item->unk_50;
item->obj.rot.y = Math_ModF(item->obj.rot.y, 360.0f);
this->obj.rot.y += this->unk_50;
this->obj.rot.y = Math_ModF(this->obj.rot.y, 360.0f);
}
void func_enmy_80067348(Actor* actor, f32 xPos, f32 yPos, f32 zPos, f32 xRot, f32 yRot, f32 arg6, f32 arg7, f32 arg8) {
@@ -2003,8 +2003,8 @@ void ActorSupplies_Update(ActorSupplies* this) {
Math_SmoothStepToF(&this->obj.pos.y, 300.0f, 0.05f, 50.0f, 0.01f);
}
}
if (this->unk_0D0 != 0) {
this->unk_0D0 = 0;
if (this->dmgType != 0) {
this->dmgType = 0;
this->health -= this->damage;
if (this->health <= 0) {
func_effect_8007A6F0(&this->obj.pos, 0x2903A008);
@@ -2035,7 +2035,7 @@ void ActorSupplies_Update(ActorSupplies* this) {
gRadarMarks[63].pos.x = this->obj.pos.x;
gRadarMarks[63].pos.y = this->obj.pos.y;
gRadarMarks[63].pos.z = this->obj.pos.z;
gRadarMarks[63].unk_10 = 0.0f;
gRadarMarks[63].yRot = 0.0f;
}
void ActorSupplies_Draw(Actor* actor) {
@@ -2073,8 +2073,8 @@ void func_enmy_80067A40(void) {
}
void Item1up_Update(Item1UP* this) {
func_enmy_80066EF0(this);
func_enmy_800671D0(this);
Item_CheckBounds(this);
Item_SpinPickup(this);
if (this->collected) {
Object_Kill(&this->obj, this->sfxSource);
func_enmy_80060F30(gPlayer[this->playerNum].sfxSource, 0x4900C024, this->playerNum);
@@ -2088,12 +2088,12 @@ void Item1up_Update(Item1UP* this) {
}
void ItemPickup_Update(Item* this) {
func_enmy_80066EF0(this);
func_enmy_800671D0(this);
Item_CheckBounds(this);
Item_SpinPickup(this);
if (this->state == 0) {
switch (this->obj.id) {
case OBJ_ITEM_BOMB:
this->scale = 18.0f;
this->width = 18.0f;
if (this->collected) {
this->timer_4A = 50;
this->state = 1;
@@ -2105,7 +2105,7 @@ void ItemPickup_Update(Item* this) {
}
break;
case OBJ_ITEM_LASERS:
this->scale = 18.0f;
this->width = 18.0f;
if (this->collected) {
this->timer_4A = 50;
this->state = 1;
@@ -2127,14 +2127,14 @@ void ItemPickup_Update(Item* this) {
break;
}
} else {
Math_SmoothStepToF(&this->scale, 2.5f, 1.0f, 0.5f, 0.0f);
Math_SmoothStepToF(&this->width, 2.5f, 1.0f, 0.5f, 0.0f);
this->obj.pos.x += (gPlayer[this->playerNum].pos.x - this->obj.pos.x) * 0.5f;
if (gPlayer[this->playerNum].form == FORM_LANDMASTER) {
this->obj.pos.y += ((gPlayer[this->playerNum].pos.y + 50.0f) - this->obj.pos.y) * 0.5f;
} else {
this->obj.pos.y += (gPlayer[this->playerNum].pos.y - this->obj.pos.y) * 0.5f;
}
this->obj.pos.z += (gPlayer[this->playerNum].unk_138 - this->obj.pos.z) * 0.5f;
this->obj.pos.z += (gPlayer[this->playerNum].trueZpos - this->obj.pos.z) * 0.5f;
if (this->timer_48 == 0) {
Object_Kill(&this->obj, this->sfxSource);
}
@@ -2159,9 +2159,9 @@ void ItemSupplyRing_Update(Item* this) {
switch (this->state) {
case 0:
Math_SmoothStepToF(&this->scale, 0.4f, 1.0f, 0.05f, 0.0f);
func_enmy_80066EF0(this);
func_enmy_800671D0(this);
Math_SmoothStepToF(&this->width, 0.4f, 1.0f, 0.05f, 0.0f);
Item_CheckBounds(this);
Item_SpinPickup(this);
if (this->collected) {
this->state = 1;
this->timer_48 = 50;
@@ -2179,7 +2179,7 @@ void ItemSupplyRing_Update(Item* this) {
}
gPlayer[this->playerNum].heal += 32;
BonusText_Display(gPlayer[this->playerNum].pos.x, gPlayer[this->playerNum].pos.y,
gPlayer[this->playerNum].unk_138, BONUS_TEXT_1UP);
gPlayer[this->playerNum].trueZpos, BONUS_TEXT_1UP);
} else {
gPlayer[this->playerNum].heal += 32;
func_enmy_80060F30(gPlayer[this->playerNum].sfxSource, 0x49003013, this->playerNum);
@@ -2195,9 +2195,9 @@ void ItemSupplyRing_Update(Item* this) {
break;
case 1:
if (this->timer_48 > 30) {
Math_SmoothStepToF(&this->scale, 1.0f, 1.0f, 0.06f, 0.0f);
Math_SmoothStepToF(&this->width, 1.0f, 1.0f, 0.06f, 0.0f);
} else {
Math_SmoothStepToF(&this->scale, 0.0f, 1.0f, 0.06f, 0.0f);
Math_SmoothStepToF(&this->width, 0.0f, 1.0f, 0.06f, 0.0f);
}
this->obj.pos.x += (gPlayer[this->playerNum].pos.x - this->obj.pos.x) * 0.5f;
if (gPlayer[this->playerNum].form == FORM_LANDMASTER) {
@@ -2206,9 +2206,9 @@ void ItemSupplyRing_Update(Item* this) {
this->obj.pos.y += (gPlayer[this->playerNum].pos.y - this->obj.pos.y) * 0.5f;
}
if (gPlayer[0].cockpitView && (gLevelMode == LEVELMODE_ON_RAILS)) {
this->obj.pos.z += (gPlayer[this->playerNum].unk_138 - 300.0f - this->obj.pos.z) * 0.3f;
this->obj.pos.z += (gPlayer[this->playerNum].trueZpos - 300.0f - this->obj.pos.z) * 0.3f;
} else {
this->obj.pos.z += (gPlayer[this->playerNum].unk_138 - this->obj.pos.z) * 0.5f;
this->obj.pos.z += (gPlayer[this->playerNum].trueZpos - this->obj.pos.z) * 0.5f;
}
this->obj.rot.z += 22.0f;
Math_SmoothStepToAngle(&this->obj.rot.y, Math_RadToDeg(-gPlayer[this->playerNum].camYaw), 0.2f, 10.0f,
@@ -2216,11 +2216,11 @@ void ItemSupplyRing_Update(Item* this) {
if (this->timer_48 == 0) {
Object_Kill(&this->obj, this->sfxSource);
}
if (this->scale > 0.3f) {
if (this->width > 0.3f) {
Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW);
Matrix_RotateZ(gCalcMatrix, gGameFrameCount * 37.0f * M_DTOR, MTXF_APPLY);
sp4C.x = 0.0f;
sp4C.y = this->scale * 100.0f;
sp4C.y = this->width * 100.0f;
sp4C.z = 0.0f;
Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp4C, &sp40);
func_effect_80078E50(this->obj.pos.x + sp40.x, this->obj.pos.y + sp40.y, this->obj.pos.z + sp40.z,
@@ -2239,8 +2239,8 @@ void ItemGoldRing_Update(ItemGoldRing* this) {
}
void ItemWingRepair_Update(ItemWingRepair* this) {
func_enmy_80066EF0(this);
func_enmy_800671D0(this);
Item_CheckBounds(this);
Item_SpinPickup(this);
if (this->collected) {
func_enmy_80067A40();
Object_Kill(&this->obj, this->sfxSource);
@@ -2251,16 +2251,16 @@ void ItemWingRepair_Update(ItemWingRepair* this) {
}
void ItemMeteoWarp_Update(ItemMeteoWarp* this) {
func_enmy_80066EF0(this);
Item_CheckBounds(this);
if (this->state > 0) {
if (this->state == 1) {
this->obj.rot.z -= 10.0f;
this->obj.pos.x += (gPlayer[this->playerNum].pos.x - this->obj.pos.x) * 0.3f;
this->obj.pos.y += (gPlayer[this->playerNum].pos.y - this->obj.pos.y) * 0.3f;
this->obj.pos.z += (gPlayer[this->playerNum].unk_138 - this->obj.pos.z) * 0.3f;
this->scale -= 5.0f;
if (this->scale < 0.0f) {
this->scale = 0.0f;
this->obj.pos.z += (gPlayer[this->playerNum].trueZpos - this->obj.pos.z) * 0.3f;
this->width -= 5.0f;
if (this->width < 0.0f) {
this->width = 0.0f;
}
}
this->unk_44 -= 10;
@@ -2268,14 +2268,14 @@ void ItemMeteoWarp_Update(ItemMeteoWarp* this) {
Object_Kill(&this->obj, this->sfxSource);
}
} else {
this->scale = 100.0f;
this->width = 100.0f;
if (gRingPassCount < 0) {
this->state = 2;
this->unk_44 = 255;
} else if (this->collected) {
this->state = 1;
this->unk_44 = 255;
gPlayer[this->playerNum].timer_27C = 100;
gPlayer[this->playerNum].meteoWarpTimer = 100;
AUDIO_PLAY_SFX(gWarpRingSfx[gRingPassCount], gPlayer[0].sfxSource, 0);
if (gRingPassCount == 0) {
gPlayer[0].boostSpeed = 0.0f;
@@ -2283,7 +2283,7 @@ void ItemMeteoWarp_Update(ItemMeteoWarp* this) {
gRingPassCount++;
if (gRingPassCount >= 7) {
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_ENTER_WARP_ZONE;
gPlayer[0].unk_1D0 = 0;
gPlayer[0].csState = 0;
AUDIO_PLAY_SFX(0x1900602A, gDefaultSfxSource, 0);
gMissionStatus = MISSION_WARP;
gLeveLClearStatus[gCurrentLevel] = 1;
@@ -2295,7 +2295,7 @@ void ItemMeteoWarp_Update(ItemMeteoWarp* this) {
void ItemCheckpoint_Update(ItemCheckpoint* this) {
s32 i;
func_enmy_80066EF0(this);
Item_CheckBounds(this);
this->unk_58 -= this->unk_44;
if (this->state > 0) {
this->unk_44++;
@@ -2306,30 +2306,30 @@ void ItemCheckpoint_Update(ItemCheckpoint* this) {
this->obj.pos.y += (gPlayer[this->playerNum].pos.y - this->obj.pos.y) * 0.3f;
}
if (gPlayer[0].cockpitView) {
this->obj.pos.z += (gPlayer[this->playerNum].unk_138 - 200.0f - this->obj.pos.z) * 0.3f;
this->obj.pos.z += (gPlayer[this->playerNum].trueZpos - 200.0f - this->obj.pos.z) * 0.3f;
} else {
this->obj.pos.z += (gPlayer[this->playerNum].unk_138 - 100.0f - this->obj.pos.z) * 0.3f;
this->obj.pos.z += (gPlayer[this->playerNum].trueZpos - 100.0f - this->obj.pos.z) * 0.3f;
}
if (this->timer_48 == 0) {
Math_SmoothStepToF(&this->scale, 5.0f, 0.2f, 15.0f, 0.01f);
Math_SmoothStepToF(&this->width, 5.0f, 0.2f, 15.0f, 0.01f);
Math_SmoothStepToF(&this->unk_50, 0.0f, 0.1f, 0.03f, 0.0f);
Math_SmoothStepToF(&this->unk_54, 4.0f, 0.1f, 0.2f, 0.01f);
}
if (this->scale <= 6.5f) {
if (this->width <= 6.5f) {
Object_Kill(&this->obj, this->sfxSource);
}
} else {
this->unk_44 = 2;
this->unk_50 = 1.0f;
this->unk_54 = 1.0f;
this->scale = 100.0f;
this->width = 100.0f;
if (this->collected) {
gPlayer[this->playerNum].heal = 128;
this->state++;
this->timer_48 = 15;
gSavedGroundSurface = gGroundSurface;
D_ctx_80177CB0 = -this->obj.pos.z;
D_ctx_80177CB0 -= 250.0f;
gSavedPathProgress = -this->obj.pos.z;
gSavedPathProgress -= 250.0f;
gSavedObjectLoadIndex = gObjectLoadIndex;
gSavedZoSearchlightStatus = gMissedZoSearchlight;
gSavedHitCount = gHitCount;
@@ -2341,9 +2341,9 @@ void ItemCheckpoint_Update(ItemCheckpoint* this) {
}
}
void ItemRingCheck_Update(Item* item) {
if (item->collected) {
Object_Kill(&item->obj, item->sfxSource);
void ItemRingCheck_Update(Item* this) {
if (this->collected) {
Object_Kill(&this->obj, this->sfxSource);
gRingPassCount++;
}
}
@@ -2354,14 +2354,14 @@ void ItemPathChange_Update(Item* this) {
Object_Kill(&this->obj, this->sfxSource);
} else if (((gCurrentLevel == LEVEL_METEO) || (gCurrentLevel == LEVEL_SECTOR_X)) && (gLevelPhase == 1)) {
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE;
gPlayer[0].unk_1D0 = 0;
gPlayer[0].csState = 0;
Object_Kill(&this->obj, this->sfxSource);
} else if (gCurrentLevel == LEVEL_TRAINING) {
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_START_360;
gPlayer[0].unk_1D0 = 0;
gPlayer[0].csState = 0;
Object_Kill(&this->obj, this->sfxSource);
} else if (this->state == 0) {
if (((this->obj.pos.z + D_ctx_80177D20) > -2700.0f) && (fabsf(this->obj.pos.x - gPlayer[0].pos.x) < 1000.0f)) {
if (((this->obj.pos.z + gPathProgress) > -2700.0f) && (fabsf(this->obj.pos.x - gPlayer[0].pos.x) < 1000.0f)) {
switch (this->obj.id) {
case OBJ_ITEM_PATH_SPLIT_Y:
case OBJ_ITEM_PATH_TURN_UP:
@@ -2380,42 +2380,42 @@ void ItemPathChange_Update(Item* this) {
}
if (this->collected) {
Object_Kill(&this->obj, this->sfxSource);
gPlayer[0].unk_0B4 = 0.0f;
gPlayer[0].timer_210 = this->scale * 0.05f;
gPlayer[0].pathStep = 0.0f;
gPlayer[0].timer_210 = this->width * 0.05f;
switch (this->obj.id) {
case OBJ_ITEM_PATH_SPLIT_X:
if (this->obj.pos.x < gPlayer[0].pos.x) {
gPlayer[0].unk_118 = -30.0f;
gPlayer[0].unk_0B8 = gPlayer[0].unk_0AC + this->scale;
gPlayer[0].yRot_118 = -30.0f;
gPlayer[0].xPathTarget = gPlayer[0].xPath + this->width;
} else {
gPlayer[0].unk_118 = 30.0f;
gPlayer[0].unk_0B8 = gPlayer[0].unk_0AC - this->scale;
gPlayer[0].yRot_118 = 30.0f;
gPlayer[0].xPathTarget = gPlayer[0].xPath - this->width;
}
break;
case OBJ_ITEM_PATH_TURN_LEFT:
gPlayer[0].unk_118 = 30.0f;
gPlayer[0].unk_0B8 = gPlayer[0].unk_0AC - this->scale;
gPlayer[0].yRot_118 = 30.0f;
gPlayer[0].xPathTarget = gPlayer[0].xPath - this->width;
break;
case OBJ_ITEM_PATH_TURN_RIGHT:
gPlayer[0].unk_118 = -30.0f;
gPlayer[0].unk_0B8 = gPlayer[0].unk_0AC + this->scale;
gPlayer[0].yRot_118 = -30.0f;
gPlayer[0].xPathTarget = gPlayer[0].xPath + this->width;
break;
case OBJ_ITEM_PATH_SPLIT_Y:
if (this->obj.pos.y < gPlayer[0].pos.y) {
gPlayer[0].unk_124 = 30.0f;
gPlayer[0].unk_0BC = gPlayer[0].unk_0B0 + this->scale;
gPlayer[0].xRot_124 = 30.0f;
gPlayer[0].yPathTarget = gPlayer[0].yPath + this->width;
} else {
gPlayer[0].unk_124 = -30.0f;
gPlayer[0].unk_0BC = gPlayer[0].unk_0B0 - this->scale;
gPlayer[0].xRot_124 = -30.0f;
gPlayer[0].yPathTarget = gPlayer[0].yPath - this->width;
}
break;
case OBJ_ITEM_PATH_TURN_UP:
gPlayer[0].unk_124 = 30.0f;
gPlayer[0].unk_0BC = gPlayer[0].unk_0B0 + this->scale;
gPlayer[0].xRot_124 = 30.0f;
gPlayer[0].yPathTarget = gPlayer[0].yPath + this->width;
break;
case OBJ_ITEM_PATH_TURN_DOWN:
gPlayer[0].unk_124 = -30.0f;
gPlayer[0].unk_0BC = gPlayer[0].unk_0B0 - this->scale;
gPlayer[0].xRot_124 = -30.0f;
gPlayer[0].yPathTarget = gPlayer[0].yPath - this->width;
break;
}
}
@@ -2423,10 +2423,10 @@ void ItemPathChange_Update(Item* this) {
}
void Sprite_UpdateDoodad(Sprite* this) {
this->obj.rot.y = (Math_Atan2F(gPlayer[0].cam.eye.x - this->obj.pos.x,
gPlayer[0].cam.eye.z - (this->obj.pos.z + D_ctx_80177D20)) *
180.0f) /
M_PI;
this->obj.rot.y =
(Math_Atan2F(gPlayer[0].cam.eye.x - this->obj.pos.x, gPlayer[0].cam.eye.z - (this->obj.pos.z + gPathProgress)) *
180.0f) /
M_PI;
if (this->unk_46 != 0) {
this->obj.status = OBJ_FREE;
func_effect_8007A6F0(&this->obj.pos, 0x1903400F);
@@ -2458,7 +2458,7 @@ void Object_Dying(s32 index, ObjectId objId) {
func_enmy2_800763A4(&gActors[index]);
break;
case OBJ_ACTOR_194:
Actor194_Init(&gActors[index]);
Actor194_Dying(&gActors[index]);
break;
case OBJ_ACTOR_186:
Meteo_80187B08(&gActors[index]);
@@ -2488,48 +2488,50 @@ void Object_Dying(s32 index, ObjectId objId) {
}
void Actor_Move(Actor* actor) {
f32 var_fv0;
actor->obj.pos.x += actor->vel.x;
actor->obj.pos.z += actor->vel.z;
actor->obj.pos.y += actor->vel.y;
actor->vel.y -= actor->gravity;
if ((D_ctx_80161AB8 != 0) && (actor->obj.id != OBJ_ACTOR_TEAM_BOSS) &&
((gCurrentLevel != LEVEL_MACBETH) || (actor->obj.id == OBJ_ACTOR_EVENT))) {
f32 var_fv0 = 4000.0f;
if (!gCullObjects || (actor->obj.id == OBJ_ACTOR_TEAM_BOSS) ||
((gCurrentLevel == LEVEL_MACBETH) && (actor->obj.id != OBJ_ACTOR_EVENT))) {
return;
}
var_fv0 = 4000.0f;
if ((actor->obj.id == OBJ_ACTOR_236) || (gCurrentLevel == LEVEL_MACBETH) ||
((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == EINFO_56))) {
var_fv0 = 8000.0f;
} else if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ENTER_WARP_ZONE) {
var_fv0 = 100000.0f;
}
if (((gPlayer[0].cam.eye.z + actor->info.unk_10) < (actor->obj.pos.z + D_ctx_80177D20)) ||
((actor->obj.pos.z + D_ctx_80177D20) < -15000.0f) || (actor->obj.pos.y < (gPlayer[0].unk_0B0 - var_fv0)) ||
((gPlayer[0].unk_0B0 + var_fv0) < actor->obj.pos.y) ||
((gPlayer[0].unk_0AC + var_fv0) < actor->obj.pos.x) ||
(actor->obj.pos.x < (gPlayer[0].unk_0AC - var_fv0))) {
Object_Kill(&actor->obj, actor->sfxSource);
switch (actor->obj.id) {
case OBJ_ACTOR_236:
D_ctx_801784A4 = 0;
break;
case OBJ_ACTOR_229:
Titania_8018E3B0(actor);
break;
case OBJ_ACTOR_194:
if ((actor->obj.id == OBJ_ACTOR_236) || (gCurrentLevel == LEVEL_MACBETH) ||
((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == EINFO_56))) {
var_fv0 = 8000.0f;
} else if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ENTER_WARP_ZONE) {
var_fv0 = 100000.0f;
}
if (((gPlayer[0].cam.eye.z + actor->info.cullDistance) < (actor->obj.pos.z + gPathProgress)) ||
((actor->obj.pos.z + gPathProgress) < -15000.0f) || (actor->obj.pos.y < (gPlayer[0].yPath - var_fv0)) ||
((gPlayer[0].yPath + var_fv0) < actor->obj.pos.y) || ((gPlayer[0].xPath + var_fv0) < actor->obj.pos.x) ||
(actor->obj.pos.x < (gPlayer[0].xPath - var_fv0))) {
Object_Kill(&actor->obj, actor->sfxSource);
switch (actor->obj.id) {
case OBJ_ACTOR_236:
D_ctx_801784A4 = 0;
break;
case OBJ_ACTOR_229:
Titania_8018E3B0(actor);
break;
case OBJ_ACTOR_194:
gActor194Status[actor->unk_046] = 0;
break;
case OBJ_ACTOR_EVENT:
if ((actor->unk_0B4 >= EINFO_200) && (actor->unk_0B4 < EINFO_300)) {
gActor194Status[actor->unk_046] = 0;
break;
case OBJ_ACTOR_EVENT:
if ((actor->unk_0B4 >= EINFO_200) && (actor->unk_0B4 < EINFO_300)) {
gActor194Status[actor->unk_046] = 0;
} else if ((actor->unk_0B4 == EINFO_38) && (actor->unk_046 != 2)) {
gRingPassCount = -1;
}
break;
case OBJ_ACTOR_252:
gMissedZoSearchlight = true;
break;
}
} else if ((actor->unk_0B4 == EINFO_38) && (actor->unk_046 != 2)) {
gRingPassCount = -1;
}
break;
case OBJ_ACTOR_252:
gMissedZoSearchlight = true;
break;
}
}
}
@@ -2539,7 +2541,7 @@ void Boss_Move(Boss* boss) {
boss->obj.pos.y += boss->vel.y;
boss->obj.pos.z += boss->vel.z;
boss->vel.y -= boss->gravity;
if ((D_ctx_80161AB8 != 0) && ((boss->obj.pos.z + D_ctx_80177D20) > (boss->info.unk_10 - gPlayer[0].cam.eye.z))) {
if (gCullObjects && ((boss->obj.pos.z + gPathProgress) > (boss->info.cullDistance - gPlayer[0].cam.eye.z))) {
if (gPlayer[0].cam.eye.z) {} // fake
Object_Kill(&boss->obj, boss->sfxSource);
}
@@ -2548,7 +2550,7 @@ void Boss_Move(Boss* boss) {
void Scenery_Move(Scenery* scenery) {
if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) {
scenery->obj.pos.z += scenery->unk_60;
if (scenery->info.unk_10 < scenery->obj.pos.z) {
if (scenery->info.cullDistance < scenery->obj.pos.z) {
Object_Kill(&scenery->obj, scenery->sfxSource);
}
} else if ((gLevelMode == LEVELMODE_ON_RAILS) && (gBossActive != 2)) {
@@ -2559,18 +2561,18 @@ void Scenery_Move(Scenery* scenery) {
var_fa0 = 1000.0f;
}
temp_fv0 = ((temp_fv0 - var_fa0) < 0.0f) ? 0.0f : (temp_fv0 - var_fa0) * 1.7f;
if ((fabsf(gPlayer[0].unk_114) > 1.0f) || (gCurrentLevel == LEVEL_MACBETH)) {
if ((fabsf(gPlayer[0].yRot_114) > 1.0f) || (gCurrentLevel == LEVEL_MACBETH)) {
temp_fv0 = 0.0f;
}
temp_fv0 -= gPlayer[0].cam.eye.z;
if ((scenery->info.unk_10 - temp_fv0) < (scenery->obj.pos.z + D_ctx_80177D20)) {
if ((scenery->info.cullDistance - temp_fv0) < (scenery->obj.pos.z + gPathProgress)) {
Object_Kill(&scenery->obj, scenery->sfxSource);
}
}
}
void Sprite_Move(Sprite* sprite) {
if (D_ctx_80161AB8 != 0) {
if (gCullObjects) {
f32 temp_fv0 = fabsf(sprite->obj.pos.x - gPlayer[0].cam.eye.x);
f32 var_fa0 = 500.0f;
@@ -2581,7 +2583,7 @@ void Sprite_Move(Sprite* sprite) {
}
temp_fv0 = ((temp_fv0 - var_fa0) < 0.0f) ? 0.0f * 1.7f : (temp_fv0 - var_fa0) * 1.7f;
temp_fv0 -= gPlayer[0].cam.eye.z;
if ((sprite->info.unk_10 - temp_fv0) < (sprite->obj.pos.z + D_ctx_80177D20)) {
if ((sprite->info.cullDistance - temp_fv0) < (sprite->obj.pos.z + gPathProgress)) {
sprite->obj.status = OBJ_FREE;
}
}
@@ -2591,8 +2593,8 @@ void Effect_Move(Effect* effect) {
effect->obj.pos.x += effect->vel.x;
effect->obj.pos.y += effect->vel.y;
effect->obj.pos.z += effect->vel.z;
if (D_ctx_80161AB8 != 0) {
if ((gPlayer[0].cam.eye.z + effect->info.unk_10) < (effect->obj.pos.z + D_ctx_80177D20)) {
if (gCullObjects) {
if ((gPlayer[0].cam.eye.z + effect->info.cullDistance) < (effect->obj.pos.z + gPathProgress)) {
Object_Kill(&effect->obj, effect->sfxSource);
} else if ((fabsf(effect->obj.pos.y - gPlayer[0].cam.eye.y) > 25000.0f) ||
(fabsf(effect->obj.pos.x - gPlayer[0].cam.eye.x) > 25000.0f)) {
@@ -2602,10 +2604,10 @@ void Effect_Move(Effect* effect) {
}
void Item_Move(Item* item) {
if (D_ctx_80161AB8 != 0) {
if (gCullObjects) {
f32 temp = (0.0f - gPlayer[0].cam.eye.z);
if ((item->info.unk_10 - temp) < (item->obj.pos.z + D_ctx_80177D20)) {
if ((item->info.cullDistance - temp) < (item->obj.pos.z + gPathProgress)) {
Object_Kill(&item->obj, item->sfxSource);
if ((item->obj.id == OBJ_ITEM_METEO_WARP) && (item->state == 0)) {
gRingPassCount = -1;
@@ -2798,36 +2800,36 @@ void Effect_Update(Effect* this) {
void TexturedLine_Update(TexturedLine* this) {
Vec3f sp44;
Vec3f sp38;
f32 sp34;
f32 sp30;
f32 sp2C;
f32 dx;
f32 dy;
f32 dz;
if (this->timer != 0) {
this->timer--;
}
sp34 = this->unk_04.x - this->unk_10.x;
sp30 = this->unk_04.y - this->unk_10.y;
sp2C = this->unk_04.z - this->unk_10.z;
this->unk_20 = Math_Atan2F(sp34, sp2C);
this->unk_1C = -Math_Atan2F(sp30, sqrtf(SQ(sp34) + SQ(sp2C)));
dx = this->posAA.x - this->posBB.x;
dy = this->posAA.y - this->posBB.y;
dz = this->posAA.z - this->posBB.z;
this->yRot = Math_Atan2F(dx, dz);
this->xRot = -Math_Atan2F(dy, sqrtf(SQ(dx) + SQ(dz)));
if (this->mode != 4) {
this->unk_24 = sqrtf(SQ(sp34) + SQ(sp30) + SQ(sp2C));
this->zScale = sqrtf(SQ(dx) + SQ(dy) + SQ(dz));
}
if (gGameState == GSTATE_PLAY) {
if (((this->mode == 1) || (this->mode == 101) || (this->mode == 50)) &&
(gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (gPlayer[0].unk_1F4 == 0)) {
Matrix_RotateX(gCalcMatrix, -this->unk_1C, MTXF_NEW);
Matrix_RotateY(gCalcMatrix, -this->unk_20, MTXF_APPLY);
sp44.x = gPlayer[gPlayerNum].pos.x - this->unk_04.x;
sp44.y = gPlayer[gPlayerNum].pos.y - this->unk_04.y;
sp44.z = gPlayer[gPlayerNum].unk_138 - this->unk_04.z;
(gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (gPlayer[0].hitTimer == 0)) {
Matrix_RotateX(gCalcMatrix, -this->xRot, MTXF_NEW);
Matrix_RotateY(gCalcMatrix, -this->yRot, MTXF_APPLY);
sp44.x = gPlayer[gPlayerNum].pos.x - this->posAA.x;
sp44.y = gPlayer[gPlayerNum].pos.y - this->posAA.y;
sp44.z = gPlayer[gPlayerNum].trueZpos - this->posAA.z;
Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp38);
sp38.x += this->unk_04.x;
sp38.y += this->unk_04.y;
sp38.z += this->unk_04.z;
if ((fabsf(sp38.x - this->unk_04.x) < 30.0f) && (fabsf(sp38.y - this->unk_04.y) < 30.0f) &&
(sp38.z < this->unk_04.z) && ((this->unk_04.z - this->unk_24) < sp38.z)) {
sp38.x += this->posAA.x;
sp38.y += this->posAA.y;
sp38.z += this->posAA.z;
if ((fabsf(sp38.x - this->posAA.x) < 30.0f) && (fabsf(sp38.y - this->posAA.y) < 30.0f) &&
(sp38.z < this->posAA.z) && ((this->posAA.z - this->zScale) < sp38.z)) {
if (gCurrentLevel == LEVEL_AQUAS) {
Player_ApplyDamage(&gPlayer[0], 0, 30);
} else {
@@ -2838,7 +2840,7 @@ void TexturedLine_Update(TexturedLine* this) {
}
}
}
if (((this->unk_04.z + D_ctx_80177D20) > 1000.0f) && (gLevelMode != LEVELMODE_ALL_RANGE)) {
if (((this->posAA.z + gPathProgress) > 1000.0f) && (gLevelMode != LEVELMODE_ALL_RANGE)) {
this->mode = 0;
}
if (((this->mode == 3) || (this->mode == 50)) && (this->timer == 0)) {
@@ -2869,12 +2871,12 @@ void Object_Update(void) {
Item* item;
Effect* effect;
D_ctx_80161AB8 = 0;
gCullObjects = false;
if ((gLevelMode == LEVELMODE_ON_RAILS) &&
((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_INIT) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) ||
(gPlayer[0].state_1C8 == PLAYERSTATE_1C8_DOWN) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ENTER_WARP_ZONE) ||
(gPlayer[0].state_1C8 == PLAYERSTATE_1C8_START_360) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_NEXT))) {
D_ctx_80161AB8 = 1;
gCullObjects = true;
}
if (gLevelMode != LEVELMODE_ALL_RANGE) {
if ((gLoadLevelObjects != 0) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO)) {
+90 -90
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 sp18;
@@ -134,7 +134,7 @@ void Actor201_Update(Actor201* this) {
func_effect_8007F11C(OBJ_EFFECT_353, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, gEnemyShotSpeed);
this->timer_0BC = 20;
}
sp2C = this->obj.pos.z + D_ctx_80177D20;
sp2C = this->obj.pos.z + gPathProgress;
this->obj.rot.y = Math_RadToDeg(Math_Atan2F(gPlayer[0].cam.eye.x - this->obj.pos.x, gPlayer[0].cam.eye.z - sp2C));
this->obj.rot.x = -Math_RadToDeg(
Math_Atan2F(gPlayer[0].cam.eye.y - this->obj.pos.y,
@@ -147,7 +147,7 @@ void Actor202_Update(Actor202* this) {
this->gravity = 1.5f;
sp34 = false;
this->obj.rot.y = Math_RadToDeg(
Math_Atan2F(gPlayer[gPlayerNum].pos.x - this->obj.pos.x, gPlayer[gPlayerNum].unk_138 - this->obj.pos.z));
Math_Atan2F(gPlayer[gPlayerNum].pos.x - this->obj.pos.x, gPlayer[gPlayerNum].trueZpos - this->obj.pos.z));
if (this->obj.pos.y < -500.0f) {
this->obj.pos.y = -500.0f;
this->vel.y = 0.0f;
@@ -209,9 +209,9 @@ void Actor202_Update(Actor202* this) {
break;
}
if (this->unk_0D0 != 0) {
if (this->dmgType != 0) {
this->health -= 10;
if ((this->health <= 0) || (this->unk_0D0 >= 2)) {
if ((this->health <= 0) || (this->dmgType >= 2)) {
func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y + 180.0f, this->obj.pos.z, 10.0f);
func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y + 180.0f, this->obj.pos.z, this->vel.x, this->vel.y,
this->vel.z, 8.0f, 30);
@@ -220,7 +220,7 @@ void Actor202_Update(Actor202* this) {
gHitCount += this->info.bonus;
D_ctx_80177850 = 15;
} else {
this->unk_0D0 = 0;
this->dmgType = 0;
this->timer_0C6 = 20;
AUDIO_PLAY_SFX(0x2903300E, this->sfxSource, 4);
func_effect_8007D1E0(this->obj.pos.x, this->obj.pos.y + 180.0f, this->obj.pos.z, 5.0f);
@@ -240,7 +240,7 @@ static f32 D_800CFFC4[16] = {
};
static Gfx* D_800D0004[3] = { D_ENMY_SPACE_4000170, D_ENMY_SPACE_40084D0, D_ENMY_SPACE_400A630 };
void Actor194_Init(Actor194* this) {
void Actor194_Dying(Actor194* this) {
Vec3f sp34;
s32 temp_hi;
@@ -294,7 +294,7 @@ void Actor194_8006B46C(Actor194* this, f32 xTrans, f32 yTrans, f32 zTrans, f32 x
Vec3f sp34 = { 0.0f, 0.0f, 0.0f };
Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, xTrans, yTrans, zTrans + D_ctx_80177D20, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, xTrans, yTrans, zTrans + gPathProgress, MTXF_APPLY);
if (arg7 != 1) {
Matrix_RotateY(gGfxMatrix, M_DTOR * yRot, MTXF_APPLY);
@@ -308,9 +308,9 @@ void Actor194_8006B46C(Actor194* this, f32 xTrans, f32 yTrans, f32 zTrans, f32 x
if (arg7 != 1) {
RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar);
if ((arg7 == 0) && (this->lockOnTimers[TEAM_ID_FOX] != 0)) {
sp34.y += this->info.unk_1C;
Matrix_MultVec3f(gGfxMatrix, &sp34, D_display_80161578);
if (D_display_80161578->z > -500.0f) {
sp34.y += this->info.targetOffset;
Matrix_MultVec3f(gGfxMatrix, &sp34, &gLockOnTargetViewPos[TEAM_ID_FOX]);
if (gLockOnTargetViewPos[TEAM_ID_FOX].z > -500.0f) {
this->lockOnTimers[TEAM_ID_FOX] = 0;
}
}
@@ -341,7 +341,7 @@ void Actor194_Draw(Actor194* this) {
}
}
void Obj42_Update(Scenery_42* this) {
void Scenery42_Update(Scenery_42* this) {
this->obj.pos.x += this->vel.x;
this->obj.pos.y += this->vel.y;
this->obj.pos.z += this->vel.z;
@@ -424,7 +424,7 @@ void Actor196_Update(Actor196* this) {
this->vel.x = sp44.x;
this->vel.y = sp44.y;
this->vel.z = sp44.z;
if (fabsf((this->obj.pos.z + this->fwork[10]) - gPlayer[0].unk_138) < 3000.0f) {
if (fabsf((this->obj.pos.z + this->fwork[10]) - gPlayer[0].trueZpos) < 3000.0f) {
this->state = 2;
this->timer_0BC = 20;
this->vel.z = 0.0f;
@@ -478,13 +478,13 @@ void Actor196_Update(Actor196* this) {
RAND_FLOAT_CENTERED(50.0f) + this->obj.pos.z, 0.5f);
}
if ((this->unk_0D0 != 0) && (this->unk_0B6 != 0)) {
if ((this->dmgType != 0) && (this->unk_0B6 != 0)) {
func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 0.0f, this->vel.y, 0.0f, 3.0f, 5);
Object_Kill(&this->obj, this->sfxSource);
this->itemDrop = DROP_SILVER_RING;
Actor_Despawn(this);
}
this->unk_0D0 = 0;
this->dmgType = 0;
}
static f32 D_800D001C[5] = { 0.0f, 30.0f, 60.0f, -60.0f, -30.0f }; // could be in-function
@@ -507,7 +507,7 @@ void Actor189_Update(Actor189* this) {
case 40:
if (this->unk_04A & 4) {
this->obj.pos.x = gPlayer[0].pos.x + this->fwork[3];
this->obj.pos.z = gPlayer[0].unk_138 + this->fwork[4];
this->obj.pos.z = gPlayer[0].trueZpos + this->fwork[4];
}
this->obj.rot.x += this->fwork[0];
@@ -566,7 +566,7 @@ void Actor189_Update(Actor189* this) {
this->obj.rot.y += this->fwork[1];
this->obj.rot.z += this->fwork[2];
Ground_801B6E20(this->obj.pos.x, this->obj.pos.z + D_ctx_80177D20, &sp4C, &sp48, &sp4C);
Ground_801B6E20(this->obj.pos.x, this->obj.pos.z + gPathProgress, &sp4C, &sp48, &sp4C);
if (this->obj.pos.y < sp48) {
this->obj.pos.y = sp48;
@@ -586,7 +586,7 @@ void Actor189_Update(Actor189* this) {
break;
case 47:
Ground_801B6E20(this->obj.pos.x, this->obj.pos.z + D_ctx_80177D20, &sp4C, &sp48, &sp4C);
Ground_801B6E20(this->obj.pos.x, this->obj.pos.z + gPathProgress, &sp4C, &sp48, &sp4C);
if (this->obj.pos.y < this->fwork[3] + (-100.0f + sp48)) {
this->obj.pos.y = this->fwork[3] + sp48;
@@ -837,7 +837,7 @@ void func_enmy2_8006D0F4(Actor* this) {
D_ctx_80178544 = 40;
for (i = 0; i < ARRAY_COUNT(gScenery); i++) {
if ((gScenery[i].obj.status == OBJ_ACTIVE) && ((gPlayer[0].unk_138 - 3000.0f) < gScenery[i].obj.pos.z)) {
if ((gScenery[i].obj.status == OBJ_ACTIVE) && ((gPlayer[0].trueZpos - 3000.0f) < gScenery[i].obj.pos.z)) {
hitboxData = D_edata_800CF964[gScenery[i].obj.id];
count = *hitboxData;
if (count != 0) {
@@ -870,7 +870,7 @@ void func_enmy2_8006D0F4(Actor* this) {
}
}
void Obj39_Update(Scenery_39* this) {
void MeteoTunnel_Update(Scenery_39* this) {
this->obj.rot.z += 1.0f;
}
@@ -878,13 +878,13 @@ typedef struct {
/* 0x00 */ Gfx* dList;
/* 0x04 */ f32* hitbox;
/* 0x08 */ f32 scale;
/* 0x0C */ f32 info_unk_10;
/* 0x0C */ f32 cullDistance;
/* 0x10 */ f32 unk_10;
/* 0x14 */ u8 info_unk_16;
/* 0x15 */ u8 info_unk_14;
/* 0x16 */ u8 sfx;
/* 0x17 */ u8 info_unk_19;
/* 0x18 */ f32 info_unk_1C;
/* 0x18 */ f32 targetOffset;
/* 0x1C */ u8 bonus;
} UnkStruct_D003C; // size = 0x20
@@ -1064,8 +1064,8 @@ void ActorEvent_ProcessScript(ActorEvent* this) {
switch (EV_OPC_MASK(actorScript[this->aiIndex])) {
case EV_OPC(EVOP_STOP_SCRIPT):
this->state = EVSTATE_SCRIPT_END;
if (this->info.unk_10 > 10000.0f) {
this->info.unk_10 = 100.0f;
if (this->info.cullDistance > 10000.0f) {
this->info.cullDistance = 100.0f;
}
break;
@@ -1094,7 +1094,7 @@ void ActorEvent_ProcessScript(ActorEvent* this) {
if ((this->unk_0B4 >= EINFO_200) && (this->unk_0B4 < EINFO_300)) {
this->unk_046 = 100;
this->info.hitbox = gCubeHitbox200;
this->info.unk_1C = 1.0f;
this->info.targetOffset = 1.0f;
for (i = 0; i < 2; i++) {
if (gActor194Status[i] == 0) {
@@ -1148,14 +1148,14 @@ void ActorEvent_ProcessScript(ActorEvent* this) {
this->info.unk_16 = D_800D003C[this->unk_0B4].info_unk_16;
this->info.unk_14 = D_800D003C[this->unk_0B4].info_unk_14;
this->info.unk_19 = D_800D003C[this->unk_0B4].info_unk_19;
this->info.unk_1C = D_800D003C[this->unk_0B4].info_unk_1C;
this->info.targetOffset = D_800D003C[this->unk_0B4].targetOffset;
this->info.bonus = D_800D003C[this->unk_0B4].bonus;
if (this->unk_0B4 == EINFO_78) {
this->info.damage = 0;
}
this->info.unk_10 = D_800D003C[this->unk_0B4].info_unk_10;
this->info.cullDistance = D_800D003C[this->unk_0B4].cullDistance;
this->fwork[25] = D_800D003C[this->unk_0B4].unk_10;
switch (D_800D003C[this->unk_0B4].sfx) {
@@ -1185,8 +1185,8 @@ void ActorEvent_ProcessScript(ActorEvent* this) {
break;
}
if (gPlayer[0].unk_138 < this->obj.pos.z) {
this->info.unk_10 = 3000.0f;
if (gPlayer[0].trueZpos < this->obj.pos.z) {
this->info.cullDistance = 3000.0f;
}
if (this->info.unk_16 == 0) {
@@ -1323,9 +1323,9 @@ void ActorEvent_ProcessScript(ActorEvent* this) {
case EV_OPC(EVOP_DAMAGE_TEAM):
if (this->iwork[12] == actorScript[this->aiIndex + 1]) {
this->unk_0D0 = 1;
this->dmgType = 1;
this->damage = actorScript[this->aiIndex] & 0x1FF;
this->unk_0D4 = 100;
this->dmgSource = 100;
} else {
gTeamDamage[actorScript[this->aiIndex + 1]] = actorScript[this->aiIndex] & 0x1FF;
}
@@ -1338,14 +1338,14 @@ void ActorEvent_ProcessScript(ActorEvent* this) {
for (i = 0; i < ARRAY_COUNT(gTexturedLines); i++) {
if (gTexturedLines[i].mode == 0) {
gTexturedLines[i].mode = 1;
gTexturedLines[i].unk_28 = 3.0f;
gTexturedLines[i].unk_04.x = this->obj.pos.x - this->vel.x;
gTexturedLines[i].unk_04.y = this->obj.pos.y - this->vel.y;
gTexturedLines[i].unk_04.z = this->obj.pos.z - this->vel.z;
gTexturedLines[i].unk_2C = D_800D0DBC[actorScript[this->aiIndex + 1]][0];
gTexturedLines[i].unk_2D = D_800D0DBC[actorScript[this->aiIndex + 1]][1];
gTexturedLines[i].unk_2E = D_800D0DBC[actorScript[this->aiIndex + 1]][2];
gTexturedLines[i].unk_2F = D_800D0DBC[actorScript[this->aiIndex + 1]][3];
gTexturedLines[i].xyScale = 3.0f;
gTexturedLines[i].posAA.x = this->obj.pos.x - this->vel.x;
gTexturedLines[i].posAA.y = this->obj.pos.y - this->vel.y;
gTexturedLines[i].posAA.z = this->obj.pos.z - this->vel.z;
gTexturedLines[i].red = D_800D0DBC[actorScript[this->aiIndex + 1]][0];
gTexturedLines[i].green = D_800D0DBC[actorScript[this->aiIndex + 1]][1];
gTexturedLines[i].blue = D_800D0DBC[actorScript[this->aiIndex + 1]][2];
gTexturedLines[i].alpha = D_800D0DBC[actorScript[this->aiIndex + 1]][3];
this->iwork[8] = i;
break;
}
@@ -1573,9 +1573,9 @@ void ActorEvent_ProcessScript(ActorEvent* this) {
void ActorEvent_UpdateTexLines(ActorEvent* this) {
if ((this->iwork[7] != 0) && (gTexturedLines[this->iwork[8]].mode != 0)) {
gTexturedLines[this->iwork[8]].unk_10.x = this->obj.pos.x;
gTexturedLines[this->iwork[8]].unk_10.y = this->obj.pos.y;
gTexturedLines[this->iwork[8]].unk_10.z = this->obj.pos.z;
gTexturedLines[this->iwork[8]].posBB.x = this->obj.pos.x;
gTexturedLines[this->iwork[8]].posBB.y = this->obj.pos.y;
gTexturedLines[this->iwork[8]].posBB.z = this->obj.pos.z;
}
}
@@ -1794,7 +1794,7 @@ void ActorEvent_ProcessActions(ActorEvent* this) {
break;
case EVACT_2:
if (this->obj.pos.z < (gPlayer[0].unk_138 - 600.0f)) {
if (this->obj.pos.z < (gPlayer[0].trueZpos - 600.0f)) {
func_effect_8007F11C(OBJ_EFFECT_353, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z,
gEnemyShotSpeed);
}
@@ -1844,7 +1844,7 @@ void ActorEvent_ProcessActions(ActorEvent* this) {
break;
case EVACT_6:
if (this->obj.pos.z < (gPlayer[0].unk_138 - 600.0f)) {
if (this->obj.pos.z < (gPlayer[0].trueZpos - 600.0f)) {
func_effect_8007F11C(OBJ_EFFECT_355, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z,
gEnemyShotSpeed);
}
@@ -1852,7 +1852,7 @@ void ActorEvent_ProcessActions(ActorEvent* this) {
break;
case EVACT_7:
if (this->obj.pos.z < (gPlayer[0].unk_138 - 600.0f)) {
if (this->obj.pos.z < (gPlayer[0].trueZpos - 600.0f)) {
func_effect_8007F11C(OBJ_EFFECT_356, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 60.0f);
}
this->unk_048 = EVACT_NONE;
@@ -1975,7 +1975,7 @@ void ActorEvent_ProcessActions(ActorEvent* this) {
void ActorEvent_8006FE28(ActorEvent* this) {
if ((fabsf(this->obj.pos.x - gPlayer[0].pos.x) < 100.0f) && (fabsf(this->obj.pos.y - gPlayer[0].pos.y) < 100.0f) &&
(fabsf(this->obj.pos.z - gPlayer[0].unk_138) < 50.0f)) {
(fabsf(this->obj.pos.z - gPlayer[0].trueZpos) < 50.0f)) {
func_enmy_80067A40();
Audio_KillSfxBySourceAndId(this->sfxSource, 0x1900302B);
Object_Kill(&this->obj, this->sfxSource);
@@ -1985,8 +1985,8 @@ void ActorEvent_8006FE28(ActorEvent* this) {
void ActorEvent_8006FEEC(ActorEvent* this) {
s32 i;
if ((this->unk_0D0 != 0) && (this->health != 0)) {
this->unk_0D0 = 0;
if ((this->dmgType != 0) && (this->health != 0)) {
this->dmgType = 0;
this->timer_0C6 = 15;
this->health -= this->damage;
@@ -2029,7 +2029,7 @@ bool ActorEvent_800700A4(ActorEvent* this) {
gTeamShields[this->iwork[12]] = -1;
gTeamDamage[this->iwork[12]] = 0;
this->timer_0C2 = 5000;
this->unk_0D0 = 0;
this->dmgType = 0;
return true;
}
return false;
@@ -2037,22 +2037,22 @@ bool ActorEvent_800700A4(ActorEvent* this) {
void ActorEvent_800701E0(ActorEvent* this) {
Vec3f sp3C;
f32 var_fv1;
f32 chance;
f32 temp_fv1;
if (ActorEvent_800700A4(this)) {
return;
}
if ((this->unk_0D0 != 0) && (this->unk_0B4 == EINFO_67) && (this->unk_0D2 == 0)) {
this->unk_0D0 = 0;
if ((this->dmgType != 0) && (this->unk_0B4 == EINFO_67) && (this->dmgPart == 0)) {
this->dmgType = 0;
}
if ((this->unk_0D0 != 0) && (this->unk_0B4 == EINFO_83) && (this->timer_0C2 >= 2)) {
this->unk_0D0 = 0;
if ((this->dmgType != 0) && (this->unk_0B4 == EINFO_83) && (this->timer_0C2 >= 2)) {
this->dmgType = 0;
}
if ((this->unk_0D0 != 0) &&
(((this->unk_0B4 == EINFO_64) && (this->unk_0D2 == 2)) || (this->unk_0B4 != EINFO_64))) {
if ((this->dmgType != 0) &&
(((this->unk_0B4 == EINFO_64) && (this->dmgPart == 2)) || (this->unk_0B4 != EINFO_64))) {
if (this->iwork[12] >= TEAM_ID_KATT) {
this->damage = 0;
}
@@ -2081,18 +2081,18 @@ void ActorEvent_800701E0(ActorEvent* this) {
}
this->obj.status = OBJ_DYING;
var_fv1 = 0.7f;
chance = 0.7f;
if (gLevelType == LEVELTYPE_SPACE) {
var_fv1 = 0.3f;
chance = 0.3f;
}
if (((Rand_ZeroOne() < var_fv1) || (this->iwork[12] != 0)) && (this->info.unk_14 == 0) &&
if (((Rand_ZeroOne() < chance) || (this->iwork[12] != 0)) && (this->info.unk_14 == 0) &&
(this->unk_0B4 != EINFO_13) && (this->unk_0B4 != EINFO_14) && (this->unk_0B4 != EINFO_61) &&
(this->damage <= 30) && (this->unk_0B4 != EINFO_62) && (this->unk_0B4 != EINFO_64) &&
(this->unk_0B4 != EINFO_72) && (this->unk_0B4 != EINFO_68)) {
func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->scale * 4.0f);
this->unk_0D0 = 0;
this->dmgType = 0;
}
this->timer_0C2 = 10;
@@ -2123,7 +2123,7 @@ void ActorEvent_800701E0(ActorEvent* this) {
} else {
this->vel.z = this->vel.z * 0.3f;
}
if (((this->obj.pos.z + D_ctx_80177D20) > -3000.0f) && (this->vel.z > 0.0f)) {
if (((this->obj.pos.z + gPathProgress) > -3000.0f) && (this->vel.z > 0.0f)) {
this->vel.z = RAND_FLOAT(-10.0f);
}
}
@@ -2146,9 +2146,9 @@ void ActorEvent_800701E0(ActorEvent* this) {
this->obj.status = OBJ_ACTIVE;
func_effect_8007D0E0(this->obj.pos.x - this->vel.x, this->obj.pos.y + 30.0f,
this->obj.pos.z - this->vel.z, this->scale * 5.0f);
this->unk_0D0 = 0;
this->dmgType = 0;
this->timer_0C2 = 10000;
this->info.unk_1C = 0.0f;
this->info.targetOffset = 0.0f;
gHitCount += this->info.bonus;
D_ctx_80177850 = 15;
break;
@@ -2166,7 +2166,7 @@ void ActorEvent_800701E0(ActorEvent* this) {
if (this->unk_0B4 == EINFO_82) {
AUDIO_PLAY_SFX(0x11000055, this->sfxSource, 0);
this->unk_0D0 = 1;
this->dmgType = 1;
func_effect_8007C688(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 3.0f, 60);
}
} else {
@@ -2191,10 +2191,10 @@ void ActorEvent_800701E0(ActorEvent* this) {
}
}
if (this->unk_0D4 == 1) {
if (this->dmgSource == 1) {
switch (this->iwork[12]) {
case TEAM_ID_FALCO:
if (this->unk_0D0 == 3) {
if (this->dmgType == 3) {
ActorEvent_SetMessage(gMsg_ID_20210, RCID_FALCO);
} else {
ActorEvent_SetMessage(gMsg_ID_20060, RCID_FALCO);
@@ -2202,7 +2202,7 @@ void ActorEvent_800701E0(ActorEvent* this) {
break;
case TEAM_ID_PEPPY:
if (this->unk_0D0 == 3) {
if (this->dmgType == 3) {
ActorEvent_SetMessage(gMsg_ID_20200, RCID_PEPPY);
} else {
ActorEvent_SetMessage(gMsg_ID_20070, RCID_PEPPY);
@@ -2210,7 +2210,7 @@ void ActorEvent_800701E0(ActorEvent* this) {
break;
case TEAM_ID_SLIPPY:
if (this->unk_0D0 == 3) {
if (this->dmgType == 3) {
ActorEvent_SetMessage(gMsg_ID_20190, RCID_SLIPPY);
} else {
ActorEvent_SetMessage(gMsg_ID_20080, RCID_SLIPPY);
@@ -2226,7 +2226,7 @@ void ActorEvent_800701E0(ActorEvent* this) {
break;
}
}
this->unk_0D0 = 0;
this->dmgType = 0;
}
}
if ((this->iwork[12] == 0) && (this->iwork[13] == 0) && (this->info.unk_16 != 2) &&
@@ -2239,7 +2239,7 @@ void ActorEvent_800701E0(ActorEvent* this) {
(this->obj.pos.y < (gGroundHeight + 20.0f))) {
this->obj.status = OBJ_DYING;
this->obj.pos.z -= this->vel.z;
this->unk_0D0 = 1;
this->dmgType = 1;
if (this->unk_0B4 == EINFO_13) {
this->obj.id = OBJ_ACTOR_182;
func_enmy_800654E4(&this->obj);
@@ -2253,9 +2253,9 @@ void ActorEvent_800701E0(ActorEvent* this) {
}
void ActorEvent_80070BA8(ActorEvent* this) {
if (this->unk_0D0 != 0) {
this->unk_0D0 = 0;
if ((this->unk_0B4 != EINFO_17) || ((this->unk_0B4 == EINFO_17) && (this->unk_0D2 == 0))) {
if (this->dmgType != 0) {
this->dmgType = 0;
if ((this->unk_0B4 != EINFO_17) || ((this->unk_0B4 == EINFO_17) && (this->dmgPart == 0))) {
this->timer_0C6 = 10;
func_effect_8007C120(this->hitPos.x, this->hitPos.y, this->hitPos.z, this->vel.x, this->vel.y, this->vel.z,
0.2f, 10);
@@ -2300,7 +2300,7 @@ void ActorEvent_ProcessTriggers(ActorEvent* this) {
}
if (this->iwork[2] >= EVC_CLOSE_Z) {
if (fabsf(this->obj.pos.z - gPlayer[0].unk_138) <= ((this->iwork[2] - EVC_CLOSE_Z) * 100.0f)) {
if (fabsf(this->obj.pos.z - gPlayer[0].trueZpos) <= ((this->iwork[2] - EVC_CLOSE_Z) * 100.0f)) {
ActorEvent_TriggerBranch(this);
}
return;
@@ -2591,7 +2591,7 @@ void ActorEvent_ProcessTriggers(ActorEvent* this) {
break;
case EVC_TOOK_DAMAGE:
if (this->unk_0D0 != 0) {
if (this->dmgType != 0) {
ActorEvent_TriggerBranch(this);
}
break;
@@ -2846,12 +2846,12 @@ void ActorEvent_80071DC0(ActorEvent* this) {
void ActorEvent_800720E8(ActorEvent* this) {
switch (this->unk_046) {
case 0:
if (this->unk_0D0 != 0) {
if (this->unk_0D0 == 2) {
if (this->dmgType != 0) {
if (this->dmgType == 2) {
this->damage = 3;
}
if ((this->unk_0D4 >= 101) && (gActors[this->unk_0D4 - 101].unk_0B4 == 85)) {
if ((this->dmgSource >= 101) && (gActors[this->dmgSource - 101].unk_0B4 == EINFO_85)) {
this->damage = 20;
}
@@ -2870,7 +2870,7 @@ void ActorEvent_800720E8(ActorEvent* this) {
} else {
AUDIO_PLAY_SFX(0x2903300E, this->sfxSource, 0);
}
this->unk_0D0 = 0;
this->dmgType = 0;
}
break;
@@ -2941,7 +2941,7 @@ void ActorEvent_80072474(ActorEvent* this) {
}
if (this->iwork[15] != 0) {
var_fv1 = Math_RadToDeg(Math_Atan2F(gPlayer[0].pos.x - this->obj.pos.x, gPlayer[0].unk_138 - this->obj.pos.z));
var_fv1 = Math_RadToDeg(Math_Atan2F(gPlayer[0].pos.x - this->obj.pos.x, gPlayer[0].trueZpos - this->obj.pos.z));
} else if (this->iwork[6] != 0) {
var_fv1 = this->unk_0F4.y;
} else {
@@ -3008,8 +3008,8 @@ void ActorEvent_Update(ActorEvent* this) {
gActor194yRot[this->unk_046][this->unk_04E] = this->obj.rot.y;
gActor194zRot[this->unk_046][this->unk_04E] = this->obj.rot.z;
if (this->unk_0D0 != 0) {
this->unk_0D0 = 0;
if (this->dmgType != 0) {
this->dmgType = 0;
this->timer_0C6 = 20;
this->health -= this->damage;
@@ -3377,13 +3377,13 @@ void ActorEvent_Update(ActorEvent* this) {
if (this->iwork[5] == EV_ZMODE(EMZ_RELATIVE)) {
this->vel.z -= this->fwork[22];
if ((gCurrentLevel == LEVEL_SECTOR_Y) && (D_ctx_80177D08 < 0.0f)) {
this->vel.z -= D_ctx_80177D08;
if ((gCurrentLevel == LEVEL_SECTOR_Y) && (gPathVelZ < 0.0f)) {
this->vel.z -= gPathVelZ;
}
}
if (this->iwork[5] == EV_ZMODE(EMZ_PLAYER)) {
this->vel.z -= D_ctx_80177D08;
this->vel.z -= gPathVelZ;
}
if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ENTER_WARP_ZONE) {
@@ -3400,9 +3400,9 @@ void ActorEvent_Update(ActorEvent* this) {
if (this->scale <= -1.999f) {
ActorEvent_80070BA8(this);
} else {
if ((this->unk_0D0 == 1) && (this->scale < 0.5f) && (this->unk_0B4 != EINFO_48) &&
if ((this->dmgType == 1) && (this->scale < 0.5f) && (this->unk_0B4 != EINFO_48) &&
(this->unk_0B4 != EINFO_49) && (this->unk_0B4 != EINFO_50)) {
this->unk_0D0 = 0;
this->dmgType = 0;
if (gCurrentLevel == LEVEL_METEO) {
AUDIO_PLAY_SFX(0x2902107D, this->sfxSource, 4);
} else {
@@ -3790,7 +3790,7 @@ bool ActorEvent_OverrideLimbDraw3(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f*
return false;
}
s32 Obj111_Draw(Scenery_111* this) {
s32 Scenery111_Draw(Scenery_111* this) {
RCP_SetupDL(&gMasterDisp, 0x3C);
gSPDisplayList(gMasterDisp++, D_SY_601AD70);
RCP_SetupDL(&gMasterDisp, 0x40);
@@ -4214,7 +4214,7 @@ void func_enmy2_800763A4(Actor* actor) {
}
if (gGroundType == 4) {
if (Ground_801B6AEC(actor->obj.pos.x, actor->obj.pos.y - 10.0f, actor->obj.pos.z + D_ctx_80177D20) != 0) {
if (Ground_801B6AEC(actor->obj.pos.x, actor->obj.pos.y - 10.0f, actor->obj.pos.z + gPathProgress) != 0) {
func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y + 20.0f, actor->obj.pos.z, actor->scale * 6.0f);
func_effect_8007BFFC(actor->obj.pos.x - actor->vel.x, actor->obj.pos.y + 30.0f,
actor->obj.pos.z - actor->vel.z, 0.0f, 0.0f, 0.0f, actor->scale * 4.0f, 20);
@@ -4327,7 +4327,7 @@ void func_enmy2_800763A4(Actor* actor) {
}
}
}
if ((actor->unk_0D0 != 0) || (actor->timer_0BC == 0) ||
if ((actor->dmgType != 0) || (actor->timer_0BC == 0) ||
((actor->itemDrop != DROP_NONE) && (actor->obj.id != OBJ_ACTOR_ALLRANGE))) {
if (gLevelMode == LEVELMODE_ALL_RANGE) {
for (var_s0 = 0; var_s0 < 4; var_s0++) {
+2 -2
View File
@@ -100,7 +100,7 @@ void Game_SetGameState(void) {
gNextGameState = GSTATE_NONE;
gSceneSetup = 0;
gFillScreenColor = gBgColor = 0;
D_ctx_80177D20 = 0.0f;
gPathProgress = 0.0f;
if ((gCurrentLevel == LEVEL_VENOM_2) && (gLevelPhase == 2)) {
gFillScreenColor = gBgColor = 0xFFFF; // 248, 248, 248
gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255;
@@ -389,7 +389,7 @@ void Game_Update(void) {
Play_ClearObjectData();
gCamCount = 1;
gLifeCount[0] = 2;
D_ctx_80177D20 = 0.0f;
gPathProgress = 0.0f;
D_hud_8016170C = gCsFrameCount = gShowLevelClearStatusScreen = gLevelStartStatusScreenTimer =
gLevelClearScreenTimer = gVsMatchState = gVersusMode = gTitleState = gStarCount = gMapState =
gPlayState = gOptionMenuStatus = gDrawMode = gShowBossHealth = gShowHud = gBgColor =
+139 -139
View File
@@ -1559,7 +1559,7 @@ void func_hud_80088970(void) {
D_ctx_80177CA4 = D_play_80161A5C;
}
D_ctx_80177CB0 = 0.0f;
gSavedPathProgress = 0.0f;
gAllRangeCheckpoint = 0;
gSavedZoSearchlightStatus = false;
@@ -1568,7 +1568,7 @@ void func_hud_80088970(void) {
Audio_StopPlayerNoise(0);
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_NEXT;
gScreenFlashTimer = 0;
gPlayer[0].timer_1F8 = 0;
gPlayer[0].csTimer = 0;
gFillScreenAlpha = gFillScreenAlphaTarget = 255;
gFadeoutType = 7;
@@ -1953,8 +1953,8 @@ void func_hud_8008A240(void) {
}
gRadarMarks[i].status = 1;
gRadarMarks[i].type = i;
gRadarMarks[i].unk_10 = gPlayer[i].unk_114 + gPlayer[i].unk_0E8;
gRadarMarks[i].pos.z = gPlayer[i].unk_138;
gRadarMarks[i].yRot = gPlayer[i].yRot_114 + gPlayer[i].rot.y;
gRadarMarks[i].pos.z = gPlayer[i].trueZpos;
gRadarMarks[i].pos.x = gPlayer[i].pos.x;
if (gPlayerNum == i) {
@@ -1986,7 +1986,7 @@ void func_hud_8008A240(void) {
gRadarMarks[item->index + 50].pos.x = item->obj.pos.x;
gRadarMarks[item->index + 50].pos.y = item->obj.pos.y;
gRadarMarks[item->index + 50].pos.z = item->obj.pos.z;
gRadarMarks[item->index + 50].unk_10 = 0.0f;
gRadarMarks[item->index + 50].yRot = 0.0f;
}
}
}
@@ -2142,10 +2142,10 @@ s32 func_hud_8008A4DC(void) {
Matrix_Translate(gGfxMatrix, gRadarMarks[i].pos.x * 0.008f, -gRadarMarks[i].pos.z * 0.008f, 0.0f, MTXF_APPLY);
if (gRadarMarks[i].type == 103) {
gRadarMarks[i].unk_10 = 45.0f;
gRadarMarks[i].yRot = 45.0f;
}
Matrix_RotateZ(gGfxMatrix, M_DTOR * gRadarMarks[i].unk_10, MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, M_DTOR * gRadarMarks[i].yRot, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, scale, scale, 1.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
@@ -2460,7 +2460,7 @@ s32 func_hud_8008B774(void) {
(gCurrentLevel == LEVEL_SECTOR_Y))) {
for (i = 0; i < 60; i++) {
if ((gActors[i].obj.status == OBJ_ACTIVE) && (gActors[i].iwork[12] == temp)) {
if ((gActors[i].unk_0B4 == 2) || (gActors[i].unk_0B4 == 43) ||
if ((gActors[i].unk_0B4 == EINFO_2) || (gActors[i].unk_0B4 == EINFO_43) ||
((gActors[i].obj.id == OBJ_ACTOR_TEAM_BOSS) &&
((gActors[i].aiType == AI360_FALCO) || (gActors[i].aiType == AI360_SLIPPY) ||
(gActors[i].aiType == AI360_PEPPY)))) {
@@ -2478,7 +2478,7 @@ s32 func_hud_8008B774(void) {
switch (i) {
case 0:
if (gPlayer[0].timer_220) {
if (gPlayer[0].radioDamageTimer) {
ret = 1;
}
break;
@@ -3913,11 +3913,11 @@ bool func_hud_80090A00(Actor* actor) {
break;
case 4:
actor->fwork[6] = gPlayer[0].unk_138;
actor->fwork[6] = gPlayer[0].trueZpos;
actor->fwork[5] = 100.0f;
actor->fwork[4] = gPlayer[0].pos.x;
if ((fabsf(actor->obj.pos.x - gPlayer[0].pos.x) < 300.0f) &&
(fabsf(actor->obj.pos.z - gPlayer[0].unk_138) < 300.0f)) {
(fabsf(actor->obj.pos.z - gPlayer[0].trueZpos) < 300.0f)) {
actor->iwork[5] = 5;
actor->iwork[3] = 20;
actor->iwork[2] = 0;
@@ -3925,7 +3925,7 @@ bool func_hud_80090A00(Actor* actor) {
break;
case 5:
actor->fwork[6] = gPlayer[0].unk_138 + 1000.0f;
actor->fwork[6] = gPlayer[0].trueZpos + 1000.0f;
actor->fwork[5] = 1000.0f;
actor->fwork[4] = gPlayer[0].pos.x - 1000.0f;
actor->iwork[2]++;
@@ -4068,7 +4068,7 @@ bool func_hud_80091298(Actor* actor) {
actor->fwork[3] = 3.6f;
actor->fwork[4] = gPlayer[0].pos.x + ((f32) (actor->aiType - 2) * 700.0f);
actor->fwork[5] = gPlayer[0].pos.y;
actor->fwork[6] = gPlayer[0].unk_138;
actor->fwork[6] = gPlayer[0].trueZpos;
if ((fabsf(actor->obj.pos.x - actor->fwork[4]) < 700.0f) || (fabsf(actor->obj.pos.z - actor->fwork[6]) < 700.0f)) {
actor->fwork[1] = gPlayer[0].baseSpeed - 10.0f;
@@ -4293,7 +4293,7 @@ bool func_hud_80091B90(Actor* actor) {
actor->obj.pos.y = gGroundHeight + 40.0f;
actor->vel.y = 0.0f;
}
actor->vel.z -= D_ctx_80177D08;
actor->vel.z -= gPathVelZ;
return false;
}
@@ -4335,11 +4335,11 @@ bool func_hud_80091DF4(Actor* actor) {
}
bool func_hud_80091F00(Actor* actor) {
u8 temp_v0 = actor->unk_0D0;
u8 temp_v0 = actor->dmgType;
Vec3f sp40;
Vec3f sp34;
actor->unk_0D0 = 0;
actor->dmgType = 0;
if ((actor->state == 3) || (temp_v0 == 2)) {
return false;
@@ -4376,7 +4376,7 @@ bool func_hud_80091F00(Actor* actor) {
return false;
}
if ((actor->unk_0D0 == 3) && (actor->unk_0D4 == 1)) {
if ((actor->dmgType == 3) && (actor->dmgSource == 1)) {
switch (actor->aiType) {
case AI360_FALCO:
Radio_PlayMessage(gMsg_ID_20210, RCID_FALCO);
@@ -4390,7 +4390,7 @@ bool func_hud_80091F00(Actor* actor) {
}
}
if ((actor->unk_0D0 != 3) && (actor->unk_0D4 == 1)) {
if ((actor->dmgType != 3) && (actor->dmgSource == 1)) {
switch (actor->aiType) {
case AI360_FALCO:
Radio_PlayMessage(gMsg_ID_20060, RCID_FALCO);
@@ -4404,7 +4404,7 @@ bool func_hud_80091F00(Actor* actor) {
}
}
if ((actor->unk_0D4 == 2) || (actor->unk_0D4 == 100)) {
if ((actor->dmgSource == 2) || (actor->dmgSource == 100)) {
switch (actor->aiType) {
case AI360_FALCO:
Radio_PlayMessage(gMsg_ID_20030, RCID_FALCO);
@@ -4428,7 +4428,7 @@ void func_hud_80092244(Actor* actor) {
gRadarMarks[actor->index].pos.x = actor->obj.pos.x;
gRadarMarks[actor->index].pos.y = actor->obj.pos.y;
gRadarMarks[actor->index].pos.z = actor->obj.pos.z;
gRadarMarks[actor->index].unk_10 = actor->unk_0F4.y + 180.0f;
gRadarMarks[actor->index].yRot = actor->unk_0F4.y + 180.0f;
}
void func_hud_800922F4(Actor* actor) {
@@ -4620,7 +4620,7 @@ bool func_hud_800927A0(Actor* actor) {
Math_SmoothStepToAngle(&actor->unk_0F4.y, sp50, 0.1f, 2.0f, 0.0f);
}
if (actor->obj.pos.y < gPlayer[0].unk_0A0) {
if (actor->obj.pos.y < gPlayer[0].pathHeight) {
if (actor->fwork[28] < 0.0f) {
actor->fwork[28] = actor->fwork[28] + 0.2f;
}
@@ -4705,7 +4705,7 @@ void ActorTeamBoss_Update(ActorTeamBoss* this) {
func_hud_80091B90(this);
func_hud_80091DF4(this);
if (this->unk_0D0 != 0) {
if (this->dmgType != 0) {
func_hud_80091F00(this);
}
@@ -4826,7 +4826,7 @@ void func_hud_80093310(void) {
this->obj.pos.z -= 5000.0f;
gActors[0].unk_0B6 = 1;
if (1) {}
this->obj.id = OBJ_ACTOR_195;
this->obj.id = OBJ_ACTOR_CUTSCENE;
Object_SetInfo(&this->info, this->obj.id);
AUDIO_PLAY_SFX(0x11030010, this->sfxSource, 0);
}
@@ -4846,7 +4846,7 @@ void func_hud_800933D8(f32 x, f32 y, f32 z, f32 arg3) {
effect->obj.pos.z = z;
if ((player->state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && (gCurrentLevel == LEVEL_AQUAS) &&
(player->unk_1D0 < 2)) {
(player->csState < 2)) {
effect->scale1 = 0.4f;
effect->unk_44 = 0;
effect->unk_46 = 24;
@@ -4863,7 +4863,7 @@ void func_hud_800933D8(f32 x, f32 y, f32 z, f32 arg3) {
effect->unk_48 = -effect->unk_48;
}
if (player->unk_1D0 >= 5) {
if (player->csState >= 5) {
effect->unk_4A = 96;
effect->unk_46 = 4;
} else {
@@ -4920,7 +4920,7 @@ void HUD_AquasStart(Player* player) {
actor = &gActors[0];
switch (player->unk_1D0) {
switch (player->csState) {
case 0:
func_hud_80093310();
@@ -4928,7 +4928,7 @@ void HUD_AquasStart(Player* player) {
D_ctx_80177AB0 = 1;
gAqDrawMode = 1;
player->unk_234 = 0;
player->unk_1D0 = 1;
player->csState = 1;
player->unk_208 = 0;
player->baseSpeed = 0.0f;
@@ -5051,7 +5051,7 @@ void HUD_AquasStart(Player* player) {
if (gCsFrameCount >= 50) {
// clang-format off
if (gFillScreenAlpha == 255) { player->unk_1D0 = 2; }
if (gFillScreenAlpha == 255) { player->csState = 2; }
// clang-format on
gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255;
gFillScreenAlphaTarget = 255;
@@ -5082,14 +5082,14 @@ void HUD_AquasStart(Player* player) {
D_ctx_80177A48[3] = -1600.0f;
D_ctx_80177A48[4] = 520.0f;
player->unk_1D0 = 3;
player->csState = 3;
D_ctx_80177AB0 = 0;
player->camRoll = 60.0f;
player->timer_1F8 = 1000;
player->csTimer = 1000;
player->unk_0E8 = 30.0f;
player->rot.y = 30.0f;
player->pos.z = -5100.0f;
player->pos.x = -50.0f;
@@ -5104,7 +5104,7 @@ void HUD_AquasStart(Player* player) {
case 3:
gFillScreenAlphaStep = 16;
if (player->timer_1F8 >= 775) {
if (player->csTimer > 774) {
if (D_ctx_80177A48[4] >= 200.0f) {
Math_SmoothStepToF(&D_ctx_80177A48[4], -200.0f, 1.00f, 4.0f, 4.0f);
} else {
@@ -5132,12 +5132,12 @@ void HUD_AquasStart(Player* player) {
player->cam.eye.z = gCsCamEyeZ;
}
if (player->timer_1F8 == 774) {
if (player->csTimer == 774) {
AUDIO_PLAY_SFX(0x01038026, player->sfxSource, 0);
D_ctx_80177A10[9] = 40;
}
if (player->timer_1F8 < 775) {
if (player->csTimer <= 774) {
D_ctx_80177A48[0] = 0.0f;
temp2 = 0.0f;
@@ -5167,7 +5167,7 @@ void HUD_AquasStart(Player* player) {
player->pos.y = dest.y;
player->pos.z = dest.z;
if (((player->timer_1F8 % 8) == 0) && (player->timer_1F8 > 740)) {
if (((player->csTimer % 8) == 0) && (player->csTimer > 740)) {
func_effect_8007D9DC(player->cam.eye.x, 1600.0f, player->cam.eye.z, 10.0f, 100.0f, 0);
}
@@ -5181,7 +5181,7 @@ void HUD_AquasStart(Player* player) {
D_ctx_80177A10[8]++;
}
if (((gGameFrameCount % 3) == 0) && (player->timer_1F8 <= 740)) {
if (((gGameFrameCount % 3) == 0) && (player->csTimer <= 740)) {
for (i = 0; i < 8; i++) {
Aquas_801AC8A8(player->cam.eye.x + RAND_FLOAT_CENTERED(D_800D22C4),
player->cam.eye.y + 260.0f + RAND_FLOAT_CENTERED(D_800D22C8),
@@ -5190,8 +5190,8 @@ void HUD_AquasStart(Player* player) {
}
}
if (player->timer_1F8 < 736) {
player->unk_1D0 = 4;
if (player->csTimer < 736) {
player->csState = 4;
gAqDrawMode = 1;
gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255;
gFillScreenAlphaTarget = 255;
@@ -5200,7 +5200,7 @@ void HUD_AquasStart(Player* player) {
case 4:
if (gFillScreenAlpha == 255) {
player->unk_1D0 = 5;
player->csState = 5;
}
break;
@@ -5209,12 +5209,12 @@ void HUD_AquasStart(Player* player) {
player->pos.y = 350.0f;
player->pos.z = 0.0f;
player->cam.eye.x = player->pos.x * (600.0f / player->unk_09C);
player->cam.eye.y = player->pos.y * (1040.0f / player->unk_0A0);
player->cam.eye.x = player->pos.x * (600.0f / player->pathWidth);
player->cam.eye.y = player->pos.y * (1040.0f / player->pathHeight);
player->cam.eye.y -= 50.0f;
player->cam.at.x = player->pos.x * (600.0f / player->unk_09C);
player->cam.at.y = player->pos.y * (1050.0f / player->unk_0A0);
player->cam.at.x = player->pos.x * (600.0f / player->pathWidth);
player->cam.at.y = player->pos.y * (1050.0f / player->pathHeight);
player->cam.at.y += player->unk_060 * 10.0f;
player->pos.z += 1000.0f;
@@ -5222,12 +5222,12 @@ void HUD_AquasStart(Player* player) {
D_ctx_80177A48[0] = 0.1f;
player->unk_0E8 = 0.0f;
player->rot.y = 0.0f;
player->baseSpeed = 20.0f;
player->unk_234 = 1;
player->unk_1D0 = 6;
player->csState = 6;
player->timer_1F8 = 1000;
player->csTimer = 1000;
gAqDrawMode = 0;
gFillScreenAlphaTarget = 0;
@@ -5238,36 +5238,36 @@ void HUD_AquasStart(Player* player) {
player->cam.at.z = gCsCamAtZ = 0.0f;
case 6:
player->unk_060 = SIN_DEG(player->unk_0F4 * 0.7f) * 0.5f;
player->unk_088 += 10.0f;
player->unk_0F4 += 8.0f;
player->unk_080 = -SIN_DEG(player->unk_088) * 0.5f;
player->unk_0F0 = SIN_DEG(player->unk_0F4) * 1.5f;
player->unk_060 = SIN_DEG(player->rockPhase * 0.7f) * 0.5f;
player->bobPhase += 10.0f;
player->rockPhase += 8.0f;
player->yBob = -SIN_DEG(player->bobPhase) * 0.5f;
player->rockAngle = SIN_DEG(player->rockPhase) * 1.5f;
gCsCamEyeX = player->pos.x * (600.0f / player->unk_09C);
gCsCamEyeY = player->pos.y * (740.0f / player->unk_0A0);
gCsCamEyeX = player->pos.x * (600.0f / player->pathWidth);
gCsCamEyeY = player->pos.y * (740.0f / player->pathHeight);
gCsCamEyeY -= -50.0f;
gCsCamAtX = player->pos.x * (600.0f / player->unk_09C);
gCsCamAtY = player->pos.y * (750.0f / player->unk_0A0);
gCsCamAtX = player->pos.x * (600.0f / player->pathWidth);
gCsCamAtY = player->pos.y * (750.0f / player->pathHeight);
gCsCamAtY += player->unk_060 * 10.0f;
Math_SmoothStepToF(&player->pos.z, 0.0f, 0.1f, 40.0f, 0.1f);
D_ctx_80177A48[0] = 0.03f;
gCsCamEyeZ = 240.0f;
gCsCamAtZ = player->pos.z + (D_ctx_80177D20 - 1.0f);
gCsCamAtZ = player->pos.z + (gPathProgress - 1.0f);
if (((player->timer_1F8 % 2) == 0) && (player->timer_1F8 > 962)) {
if (((player->csTimer % 2) == 0) && (player->csTimer > 962)) {
func_hud_800933D8(player->pos.x, player->pos.y, player->pos.z + 50.0f, 20.0f);
}
if (player->timer_1F8 <= 900) {
if (player->csTimer <= 900) {
gLevelStartStatusScreenTimer = 50;
player->state_1C8 = PLAYERSTATE_1C8_ACTIVE;
player->unk_1D0 = 0;
player->timer_1F8 = 0;
player->csState = 0;
player->csTimer = 0;
gLoadLevelObjects = 1;
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 50);
@@ -5283,8 +5283,8 @@ void HUD_AquasStart(Player* player) {
break;
}
Matrix_RotateY(gCalcMatrix, M_DTOR * (player->unk_0E8 + player->unk_114 + 180.0f), MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -(M_DTOR * player->unk_0E4), MTXF_APPLY);
Matrix_RotateY(gCalcMatrix, M_DTOR * (player->rot.y + player->yRot_114 + 180.0f), MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -(M_DTOR * player->rot.x), MTXF_APPLY);
src.x = 0.0f;
src.y = 0.0f;
@@ -5298,9 +5298,9 @@ void HUD_AquasStart(Player* player) {
player->pos.x += player->vel.x;
player->pos.y += player->vel.y;
D_ctx_80177CE8 -= player->vel.z;
gPathTexScroll -= player->vel.z;
player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130;
player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll;
Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0.0f);
Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0.0f);
@@ -5320,7 +5320,7 @@ f32 D_800D24CC = 0.02f;
void func_hud_80094954(Effect* effect) {
Player* player = &gPlayer[0];
if ((player->state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && (gCurrentLevel == LEVEL_AQUAS) && (player->unk_1D0 < 2)) {
if ((player->state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && (gCurrentLevel == LEVEL_AQUAS) && (player->csState < 2)) {
switch (effect->state) {
case 0:
effect->unk_44 += effect->unk_46;
@@ -5358,7 +5358,7 @@ void func_hud_80094954(Effect* effect) {
if (player->state_1C8 == PLAYERSTATE_1C8_NEXT) {
effect->unk_46 = 2;
if (player->unk_1D0 >= 4) {
if (player->csState >= 4) {
effect->vel.y -= 0.13f;
}
}
@@ -5367,7 +5367,7 @@ void func_hud_80094954(Effect* effect) {
effect->unk_4A -= effect->unk_46;
if ((effect->unk_4A < 0) || ((player->state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) &&
(gCurrentLevel == LEVEL_AQUAS) && (player->unk_1D0 == 5))) {
(gCurrentLevel == LEVEL_AQUAS) && (player->csState == 5))) {
Object_Kill(&effect->obj, effect->sfxSource);
}
effect->obj.rot.z += effect->unk_48;
@@ -5376,7 +5376,7 @@ void func_hud_80094954(Effect* effect) {
void func_hud_80094BBC(Effect* effect) {
if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && (gCurrentLevel == LEVEL_AQUAS) &&
(gPlayer[0].unk_1D0 < 2)) {
(gPlayer[0].csState < 2)) {
RCP_SetupDL(&gMasterDisp, 0x44);
gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 21, 34, effect->unk_4A);
gDPSetEnvColor(gMasterDisp++, 255, 255, 251, 0);
@@ -5532,7 +5532,7 @@ void func_hud_80094D20(f32 x, f32 y) {
void func_hud_80095350(Actor* actor) {
Actor_Initialize(actor);
actor->obj.status = OBJ_ACTIVE;
actor->obj.id = OBJ_ACTOR_195;
actor->obj.id = OBJ_ACTOR_CUTSCENE;
actor->unk_0B6 = 9999;
Object_SetInfo(&actor->info, actor->obj.id);
}
@@ -5547,9 +5547,9 @@ void func_hud_800953A0(Actor* actor, s32 arg1) {
Actor_Initialize(actor);
actor->obj.status = OBJ_ACTIVE;
actor->obj.id = OBJ_ACTOR_195;
actor->obj.id = OBJ_ACTOR_CUTSCENE;
actor->obj.pos = D_800D2510[arg1];
actor->obj.pos.z -= D_ctx_80177D20;
actor->obj.pos.z -= gPathProgress;
actor->unk_0B6 = 45;
Object_SetInfo(&actor->info, actor->obj.id);
}
@@ -5562,9 +5562,9 @@ void func_hud_8009546C(Actor* actor, s32 arg1) {
Actor_Initialize(actor);
actor->obj.status = OBJ_ACTIVE;
actor->obj.id = OBJ_ACTOR_195;
actor->obj.id = OBJ_ACTOR_CUTSCENE;
actor->obj.pos = D_800D2540[arg1];
actor->obj.pos.z -= D_ctx_80177D20;
actor->obj.pos.z -= gPathProgress;
actor->unk_0B6 = 46;
Object_SetInfo(&actor->info, actor->obj.id);
}
@@ -5577,9 +5577,9 @@ void func_hud_80095538(Actor* actor, s32 arg1) {
Actor_Initialize(actor);
actor->obj.status = OBJ_ACTIVE;
actor->obj.id = OBJ_ACTOR_195;
actor->obj.id = OBJ_ACTOR_CUTSCENE;
actor->obj.pos = D_800D257C[arg1];
actor->obj.pos.z -= D_ctx_80177D20;
actor->obj.pos.z -= gPathProgress;
actor->unk_0B6 = 47;
Object_SetInfo(&actor->info, actor->obj.id);
}
@@ -5600,11 +5600,11 @@ void HUD_AquasComplete(Player* player) {
actor = &gActors[0];
switch (player->unk_1D0) {
switch (player->csState) {
case 0:
gCsFrameCount = 0;
player->unk_280 = 0;
player->unk_1D0 = 1;
player->barrelRollAlpha = 0;
player->csState = 1;
D_ctx_80177A48[1] = gBosses[0].obj.pos.x;
D_ctx_80177A48[2] = gBosses[0].obj.pos.y;
@@ -5624,7 +5624,7 @@ void HUD_AquasComplete(Player* player) {
gFillScreenAlphaTarget = 255;
gFillScreenAlphaStep = 16;
if (gCsFrameCount == 280) {
player->unk_1D0 = 10;
player->csState = 10;
}
}
@@ -5653,13 +5653,13 @@ void HUD_AquasComplete(Player* player) {
if (gCsFrameCount >= 90) {
dest.x = player->cam.eye.x;
dest.y = player->cam.eye.y;
dest.z = player->cam.eye.z + 200.0f - D_ctx_80177D20;
dest.z = player->cam.eye.z + 200.0f - gPathProgress;
}
Math_SmoothStepToAngle(&player->unk_130, 0.0f, 0.05f, 1.2f, 0.0001f);
Math_SmoothStepToAngle(&player->unk_12C, 0.0f, 0.05f, 1.2f, 0.0001f);
Math_SmoothStepToAngle(&player->zRotBarrelRoll, 0.0f, 0.05f, 1.2f, 0.0001f);
Math_SmoothStepToAngle(&player->zRotBank, 0.0f, 0.05f, 1.2f, 0.0001f);
Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 3.0f, 0.0f);
Math_SmoothStepToAngle(&player->unk_4D8, 0.0f, 0.1f, 20.0f, 0.0f);
Math_SmoothStepToAngle(&player->aerobaticPitch, 0.0f, 0.1f, 20.0f, 0.0f);
x = player->pos.x - dest.x;
y = player->pos.y - dest.y;
@@ -5676,9 +5676,9 @@ void HUD_AquasComplete(Player* player) {
x1 = 0.0f;
}
z1 = Math_SmoothStepToAngle(&player->unk_0E8, y1, 0.5f, 2.0f, 0.0001f) * 30.0f;
Math_SmoothStepToAngle(&player->unk_0E4, x1, 0.5f, 2.0f, 0.0001f);
Math_SmoothStepToAngle(&player->unk_0EC, z1, 0.1f, 5.0f, 0.0001f);
z1 = Math_SmoothStepToAngle(&player->rot.y, y1, 0.5f, 2.0f, 0.0001f) * 30.0f;
Math_SmoothStepToAngle(&player->rot.x, x1, 0.5f, 2.0f, 0.0001f);
Math_SmoothStepToAngle(&player->rot.z, z1, 0.1f, 5.0f, 0.0001f);
Math_SmoothStepToAngle(&D_ctx_80177A48[4], 30.0f, 0.05f, 1.0f, 0.001f);
Math_SmoothStepToF(&D_ctx_80177A48[8], 600.0f, 0.05f, 1000.0f, 0.001f);
@@ -5689,7 +5689,7 @@ void HUD_AquasComplete(Player* player) {
src.z = D_ctx_80177A48[9];
Matrix_Translate(gCalcMatrix, gBosses[0].obj.pos.x, gBosses[0].obj.pos.y,
gBosses[0].obj.pos.z + D_ctx_80177D20, MTXF_NEW);
gBosses[0].obj.pos.z + gPathProgress, MTXF_NEW);
Matrix_RotateY(gCalcMatrix, -(M_DTOR * D_ctx_80177A48[4]), MTXF_APPLY);
Matrix_MultVec3f(gCalcMatrix, &src, &dest);
@@ -5704,11 +5704,11 @@ void HUD_AquasComplete(Player* player) {
if (gCsFrameCount < 200) {
Math_SmoothStepToF(&gCsCamAtX, gBosses[0].obj.pos.x, 0.03f, 100.0f, 0.001f);
Math_SmoothStepToF(&gCsCamAtY, gBosses[0].obj.pos.y, 0.03f, 100.0f, 0.001f);
Math_SmoothStepToF(&gCsCamAtZ, gBosses[0].obj.pos.z + 600.0f + D_ctx_80177D20, 0.03f, 100.0f, 0.001f);
Math_SmoothStepToF(&gCsCamAtZ, gBosses[0].obj.pos.z + 600.0f + gPathProgress, 0.03f, 100.0f, 0.001f);
} else {
Math_SmoothStepToF(&gCsCamAtX, player->pos.x, D_ctx_80177A48[6], 1000.0f, 0.001f);
Math_SmoothStepToF(&gCsCamAtY, player->pos.y, D_ctx_80177A48[6], 1000.0f, 0.001f);
Math_SmoothStepToF(&gCsCamAtZ, player->pos.z + D_ctx_80177D20, D_ctx_80177A48[6], 1000.0f, 0.001f);
Math_SmoothStepToF(&gCsCamAtZ, player->pos.z + gPathProgress, D_ctx_80177A48[6], 1000.0f, 0.001f);
if (gCsFrameCount > 180) {
D_ctx_80177A48[6] += 0.005f;
} else {
@@ -5726,17 +5726,17 @@ void HUD_AquasComplete(Player* player) {
case 10:
player->unk_234 = 1;
gAqDrawMode = 2;
player->unk_1D0 = 11;
player->csState = 11;
player->unk_0F8 = player->unk_0EC = player->unk_12C = player->unk_130 = 0.0f;
player->bankAngle = player->rot.z = player->zRotBank = player->zRotBarrelRoll = 0.0f;
player->vel.x = player->vel.y = player->vel.z = 0.0f;
player->unk_0E4 = player->unk_0E8 = player->unk_0EC = 0.0f;
player->boostSpeed = player->unk_114 = 0.0f;
player->rot.x = player->rot.y = player->rot.z = 0.0f;
player->boostSpeed = player->yRot_114 = 0.0f;
player->baseSpeed = 3.6f;
player->unk_138 = player->pos.z = 0.0f;
player->trueZpos = player->pos.z = 0.0f;
player->pos.y = 100.0f;
player->pos.x = -100.0f;
player->unk_280 = 0;
player->barrelRollAlpha = 0;
player->unk_17C = player->unk_180 = 0.0f;
D_bg_8015F974 = D_bg_8015F978 = D_bg_8015F97C = 255;
@@ -5752,7 +5752,7 @@ void HUD_AquasComplete(Player* player) {
Play_ClearObjectData();
player->unk_144 = D_ctx_80177D20 = 0;
player->zPath = gPathProgress = 0;
j = 0;
func_hud_80095350(actor);
@@ -5770,8 +5770,8 @@ void HUD_AquasComplete(Player* player) {
func_hud_800953A0(&gActors[j], i);
}
player->pos.z -= D_ctx_80177D20;
player->unk_138 = player->pos.z;
player->pos.z -= gPathProgress;
player->trueZpos = player->pos.z;
actor->fwork[1] = 0.0f;
actor->fwork[2] = 600.0f;
@@ -5784,13 +5784,13 @@ void HUD_AquasComplete(Player* player) {
src.y = actor->fwork[2];
src.z = actor->fwork[3];
Matrix_Translate(gCalcMatrix, player->pos.x, player->pos.y, player->unk_138 + D_ctx_80177D20, MTXF_NEW);
Matrix_Translate(gCalcMatrix, player->pos.x, player->pos.y, player->trueZpos + gPathProgress, MTXF_NEW);
Matrix_RotateY(gCalcMatrix, -(M_DTOR * actor->unk_0F4.y), MTXF_APPLY);
Matrix_MultVec3f(gCalcMatrix, &src, &dest);
player->cam.at.x = gCsCamAtX = player->pos.x;
player->cam.at.y = gCsCamAtY = player->pos.y;
player->cam.at.z = gCsCamAtZ = player->pos.z - 50.0f + D_ctx_80177D20;
player->cam.at.z = gCsCamAtZ = player->pos.z - 50.0f + gPathProgress;
player->cam.eye.x = gCsCamEyeX = dest.x;
player->cam.eye.y = gCsCamEyeY = dest.y;
@@ -5804,7 +5804,7 @@ void HUD_AquasComplete(Player* player) {
gFillScreenAlphaStep = 8;
if (gFillScreenAlpha == 0) {
player->unk_1D0 = 12;
player->csState = 12;
}
case 12:
@@ -5824,17 +5824,17 @@ void HUD_AquasComplete(Player* player) {
} else {
actor->fwork[4] = player->pos.x;
actor->fwork[5] = player->pos.y;
actor->fwork[6] = player->unk_138 + D_ctx_80177D20;
actor->fwork[6] = player->trueZpos + gPathProgress;
}
if (gCsFrameCount < 1200) {
gCsCamAtX = player->pos.x;
gCsCamAtY = player->pos.y;
gCsCamAtZ = player->pos.z - 50.0f + D_ctx_80177D20;
gCsCamAtZ = player->pos.z - 50.0f + gPathProgress;
} else {
gCsCamAtX = player->pos.x;
gCsCamAtY = player->pos.y + 10.0f;
gCsCamAtZ = player->pos.z - 50.0f + D_ctx_80177D20;
gCsCamAtZ = player->pos.z - 50.0f + gPathProgress;
}
D_ctx_80177A48[0] = 0.05f;
@@ -5866,7 +5866,7 @@ void HUD_AquasComplete(Player* player) {
if (gFillScreenAlpha == 255) {
gLeveLClearStatus[LEVEL_AQUAS] = Play_CheckMedalStatus(150) + 1;
player->state_1C8 = PLAYERSTATE_1C8_NEXT;
player->timer_1F8 = 0;
player->csTimer = 0;
Audio_FadeOutAll(10);
gFadeoutType = 4;
}
@@ -5936,8 +5936,8 @@ void HUD_AquasComplete(Player* player) {
break;
}
Matrix_RotateY(gCalcMatrix, M_DTOR * (player->unk_0E8 + player->unk_114 + 180.0f), MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -(M_DTOR * player->unk_0E4), MTXF_APPLY);
Matrix_RotateY(gCalcMatrix, M_DTOR * (player->rot.y + player->yRot_114 + 180.0f), MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -(M_DTOR * player->rot.x), MTXF_APPLY);
src.x = 0.0f;
src.y = 0.0f;
@@ -5953,15 +5953,15 @@ void HUD_AquasComplete(Player* player) {
player->pos.y += player->vel.y;
player->pos.z += player->vel.z;
player->unk_138 = player->pos.z;
player->trueZpos = player->pos.z;
player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130;
player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll;
player->unk_060 = SIN_DEG(player->unk_0F4 * 0.7f) * 0.5f;
player->unk_088 += 10.0f;
player->unk_0F4 += 8.0f;
player->unk_080 = -SIN_DEG(player->unk_088) * 0.5f;
player->unk_0F0 = SIN_DEG(player->unk_0F4) * 1.5f;
player->unk_060 = SIN_DEG(player->rockPhase * 0.7f) * 0.5f;
player->bobPhase += 10.0f;
player->rockPhase += 8.0f;
player->yBob = -SIN_DEG(player->bobPhase) * 0.5f;
player->rockAngle = SIN_DEG(player->rockPhase) * 1.5f;
if (player->unk_234) {
src.x = 0.0f;
@@ -5987,17 +5987,17 @@ void func_hud_80096A74(Player* player) {
Vec3f src, dest;
s32 button;
switch (player->unk_1D0) {
switch (player->csState) {
case 0:
player->pos.y += 3400.0f;
player->unk_0E4 = 270.0f;
player->rot.x = 270.0f;
gPlayer[0].baseSpeed = 0.0f;
D_ctx_80177A48[1] = 100.0f;
D_ctx_80177A48[2] = 0.0f;
D_ctx_80177A48[0] = 0.2f;
gCsFrameCount = 0;
player->unk_1D0 = 1;
player->csState = 1;
gFillScreenAlpha = gFillScreenAlphaTarget = 255;
player->cam.eye.x = gCsCamEyeX = 0.0f;
@@ -6053,7 +6053,7 @@ void func_hud_80096A74(Player* player) {
if (gCsFrameCount == 270) {
player->unk_190 = player->unk_194 = 10.0f;
player->unk_1D0 = 2;
player->csState = 2;
D_ctx_80177A48[1] = 400.0f;
AUDIO_PLAY_SFX(0x09004002, player->sfxSource, 0);
}
@@ -6070,7 +6070,7 @@ void func_hud_80096A74(Player* player) {
button = gControllerHold[player->num].button;
gControllerHold[player->num].button = gBoostButton[player->num];
player->boostMeter = 1;
player->timer_1F8 = 60;
player->csTimer = 60;
func_play_800B2574(player);
@@ -6086,12 +6086,12 @@ void func_hud_80096A74(Player* player) {
gCsCamAtZ = player->pos.z;
if (gCsFrameCount == 300) {
D_ctx_80177CE8 = 0;
gPathTexScroll = 0;
gLevelStartStatusScreenTimer = 50;
player->state_1C8 = PLAYERSTATE_1C8_ACTIVE;
player->baseSpeed = gArwingSpeed;
player->unk_1D0 = 0;
player->timer_1F8 = 0;
player->csState = 0;
player->csTimer = 0;
player->unk_014 = 0.0f;
player->unk_018 = 0.0f;
player->camRoll = 0.0f;
@@ -6104,29 +6104,29 @@ void func_hud_80096A74(Player* player) {
Math_SmoothStepToF(&player->baseSpeed, 30.0f, 0.05f, 1000.0f, 0.001f);
if (gCsFrameCount < 110) {
player->unk_0EC += (D_ctx_80177A48[4] * 2.0f);
if (player->unk_0EC >= 360.0f) {
player->unk_0EC -= 360.0f;
player->rot.z += (D_ctx_80177A48[4] * 2.0f);
if (player->rot.z >= 360.0f) {
player->rot.z -= 360.0f;
}
if (player->unk_0EC < 0.0f) {
player->unk_0EC += 360.0f;
if (player->rot.z < 0.0f) {
player->rot.z += 360.0f;
}
} else {
Math_SmoothStepToAngle(&player->unk_0EC, 0.0f, 0.4f, (D_ctx_80177A48[4] * 2.0f), 1.0f);
if (player->unk_0EC == 0.0f) {
if (player->unk_0E4 != 0.0f) {
Math_SmoothStepToAngle(&player->unk_0E4, 0.0f, 0.1f, 2.4f, 0.001f);
Math_SmoothStepToAngle(&player->rot.z, 0.0f, 0.4f, (D_ctx_80177A48[4] * 2.0f), 1.0f);
if (player->rot.z == 0.0f) {
if (player->rot.x != 0.0f) {
Math_SmoothStepToAngle(&player->rot.x, 0.0f, 0.1f, 2.4f, 0.001f);
} else {
player->unk_088 += 10.0f;
player->unk_080 = -SIN_DEG(player->unk_088) * 0.5f;
player->unk_0F4 += 3.0f;
player->unk_0F0 = SIN_DEG(player->unk_0F4) * 1.5f;
player->bobPhase += 10.0f;
player->yBob = -SIN_DEG(player->bobPhase) * 0.5f;
player->rockPhase += 3.0f;
player->rockAngle = SIN_DEG(player->rockPhase) * 1.5f;
}
}
}
Matrix_RotateY(gCalcMatrix, M_DTOR * (player->unk_0E8 + player->unk_114 + 180.0f), MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -(M_DTOR * (player->unk_0E4)), MTXF_APPLY);
Matrix_RotateY(gCalcMatrix, M_DTOR * (player->rot.y + player->yRot_114 + 180.0f), MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -(M_DTOR * (player->rot.x)), MTXF_APPLY);
src.x = 0.0f;
src.y = 0.0f;
@@ -6140,9 +6140,9 @@ void func_hud_80096A74(Player* player) {
player->pos.x += player->vel.x;
player->pos.y += player->vel.y;
D_ctx_80177CE8 += player->vel.z;
gPathTexScroll += player->vel.z;
player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130;
player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll;
}
Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0.0f);
+721 -720
View File
File diff suppressed because it is too large Load Diff
+288 -287
View File
File diff suppressed because it is too large Load Diff
+13 -13
View File
@@ -322,16 +322,16 @@ void func_versus_800BDE44(void) {
for (i = 0; i < 4; i++) {
if ((gPlayer[i].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[i].state_1C8 == PLAYERSTATE_1C8_U_TURN)) {
if ((D_ctx_80177C30[i] != D_80178808[i]) || (D_80178810[i])) {
if ((gPlayerScores[i] != D_80178808[i]) || (D_80178810[i] != 0)) {
D_80178810[i] += 4;
if (D_80178810[i] > 15) {
if (D_ctx_80177C30[i] > D_80178808[i]) {
if (gPlayerScores[i] > D_80178808[i]) {
D_80178808[i] += 1;
} else {
D_80178808[i] -= 1;
}
if (D_ctx_80177C30[i] != D_80178808[i]) {
if (gPlayerScores[i] != D_80178808[i]) {
D_80178810[i] -= 15;
} else {
D_80178810[i] = 0;
@@ -340,7 +340,7 @@ void func_versus_800BDE44(void) {
}
}
if (D_ctx_80177C30[i] >= D_80178808[i]) {
if (gPlayerScores[i] >= D_80178808[i]) {
func_versus_800BDAA0(D_800D4B70[i], D_800D4B80[i], D_80178808[i] + 1, D_80178808[i], D_80178810[i]);
} else {
func_versus_800BDAA0(D_800D4B70[i], D_800D4B80[i], D_80178808[i] - 1, D_80178808[i], D_80178810[i]);
@@ -660,10 +660,10 @@ s32 func_versus_800BF17C(void) {
D_801787E8[i] = 32.0f;
}
}
gPlayer[i].unk_1D0 = 0;
gPlayer[i].csState = 0;
} else {
D_80178780[i] = 0;
gPlayer[i].unk_1D0 = 0;
gPlayer[i].csState = 0;
if ((D_80178780[i] == 0) && (D_801787F8[i] == 0)) {
if (sUnlockLandmaster && sUnlockOnFoot) {
D_80178780[i] = RAND_INT(3.0f) + 1;
@@ -718,9 +718,9 @@ s32 func_versus_800BF17C(void) {
D_80178820[i]++;
if (gVsMatchType == 2) {
D_ctx_80177C30[i] = D_80178838[i] = D_80178808[i] = D_80178810[i] = 0;
gPlayerScores[i] = D_80178838[i] = D_80178808[i] = D_80178810[i] = 0;
}
gPlayer[i].unk_1D0 = 1;
gPlayer[i].csState = 1;
}
}
}
@@ -883,7 +883,7 @@ s32 Versus_CheckForWinner(void) {
for (i = 0; i < 4; i++) {
if ((gPlayer[i].state_1C8 == PLAYERSTATE_1C8_DOWN) ||
(gPlayer[i].state_1C8 == PLAYERSTATE_1C8_VS_STANDBY)) {
D_ctx_80177C30[i] = D_80178838[i] = D_80178808[i] = D_80178810[i] = 0;
gPlayerScores[i] = D_80178838[i] = D_80178808[i] = D_80178810[i] = 0;
D_80178820[i] += 1;
}
}
@@ -906,11 +906,11 @@ s32 Versus_CheckForWinner(void) {
}
if (i != j) {
if (D_ctx_80177C30[i] < D_ctx_80177C30[j]) {
if (gPlayerScores[i] < gPlayerScores[j]) {
temp2[i] = 1;
break;
}
if (D_ctx_80177C30[i] == D_ctx_80177C30[j]) {
if (gPlayerScores[i] == gPlayerScores[j]) {
temp = 1;
}
}
@@ -1249,7 +1249,7 @@ bool func_versus_800C0D10(void) {
cont = 0;
for (i = 0; i < 4; i++) {
if (D_ctx_80177C30[i] == D_80178838[i]) {
if (gPlayerScores[i] == D_80178838[i]) {
cont++;
continue;
}
@@ -1379,7 +1379,7 @@ void func_versus_800C1368(void) {
gFillScreenAlphaTarget = 0;
for (i = 0; i < 4; i++) {
D_ctx_80177C30[i] = 0;
gPlayerScores[i] = 0;
D_80178808[i] = 0;
D_80178810[i] = 0;
D_80178820[i] = 0;