mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-21 22:41:14 +00:00
PlayState Rename (#1231)
* global context -> play * fix PlayState* PlayState
This commit is contained in:
parent
154f44b6da
commit
2e6279bc8e
912 changed files with 40489 additions and 41078 deletions
|
@ -33,16 +33,16 @@ typedef enum {
|
|||
/* 2 */ EYE_CLOSED
|
||||
} BossFdEyeState;
|
||||
|
||||
void BossFd_Init(Actor* thisx, GlobalContext* globalCtx);
|
||||
void BossFd_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
||||
void BossFd_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
void BossFd_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
void BossFd_Init(Actor* thisx, PlayState* play);
|
||||
void BossFd_Destroy(Actor* thisx, PlayState* play);
|
||||
void BossFd_Update(Actor* thisx, PlayState* play);
|
||||
void BossFd_Draw(Actor* thisx, PlayState* play);
|
||||
|
||||
void BossFd_SetupFly(BossFd* this, GlobalContext* globalCtx);
|
||||
void BossFd_Fly(BossFd* this, GlobalContext* globalCtx);
|
||||
void BossFd_Wait(BossFd* this, GlobalContext* globalCtx);
|
||||
void BossFd_UpdateEffects(BossFd* this, GlobalContext* globalCtx);
|
||||
void BossFd_DrawBody(GlobalContext* globalCtx, BossFd* this);
|
||||
void BossFd_SetupFly(BossFd* this, PlayState* play);
|
||||
void BossFd_Fly(BossFd* this, PlayState* play);
|
||||
void BossFd_Wait(BossFd* this, PlayState* play);
|
||||
void BossFd_UpdateEffects(BossFd* this, PlayState* play);
|
||||
void BossFd_DrawBody(PlayState* play, BossFd* this);
|
||||
|
||||
const ActorInit Boss_Fd_InitVars = {
|
||||
ACTOR_BOSS_FD,
|
||||
|
@ -149,7 +149,7 @@ void BossFd_SetCameraSpeed(BossFd* this, f32 velFactor) {
|
|||
this->subCamAtVel.z = fabsf(this->subCamAt.z - this->subCamAtNext.z) * velFactor;
|
||||
}
|
||||
|
||||
void BossFd_UpdateCamera(BossFd* this, GlobalContext* globalCtx) {
|
||||
void BossFd_UpdateCamera(BossFd* this, PlayState* play) {
|
||||
if (this->subCamId != SUB_CAM_ID_DONE) {
|
||||
Math_ApproachF(&this->subCamEye.x, this->subCamEyeNext.x, this->subCamEyeMaxVelFrac.x,
|
||||
this->subCamEyeVel.x * this->subCamVelFactor);
|
||||
|
@ -165,27 +165,24 @@ void BossFd_UpdateCamera(BossFd* this, GlobalContext* globalCtx) {
|
|||
this->subCamAtVel.z * this->subCamVelFactor);
|
||||
Math_ApproachF(&this->subCamVelFactor, 1.0f, 1.0f, this->subCamAccel);
|
||||
this->subCamAt.y += this->subCamAtYOffset;
|
||||
Play_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye);
|
||||
Play_CameraSetAtEye(play, this->subCamId, &this->subCamAt, &this->subCamEye);
|
||||
Math_ApproachZeroF(&this->subCamAtYOffset, 1.0f, 0.1f);
|
||||
}
|
||||
}
|
||||
|
||||
void BossFd_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
void BossFd_Init(Actor* thisx, PlayState* play) {
|
||||
s32 pad;
|
||||
BossFd* this = (BossFd*)thisx;
|
||||
s16 i;
|
||||
|
||||
Flags_SetSwitch(globalCtx, 0x14);
|
||||
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_BG_VB_SIMA, 680.0f, -100.0f, 0.0f, 0, 0, 0,
|
||||
100);
|
||||
Flags_SetSwitch(play, 0x14);
|
||||
Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_BG_VB_SIMA, 680.0f, -100.0f, 0.0f, 0, 0, 0, 100);
|
||||
Actor_ProcessInitChain(&this->actor, sInitChain);
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f);
|
||||
Actor_SetScale(&this->actor, 0.05f);
|
||||
SkelAnime_Init(globalCtx, &this->skelAnimeHead, &gVolvagiaHeadSkel, &gVolvagiaHeadEmergeAnim, NULL, NULL, 0);
|
||||
SkelAnime_Init(globalCtx, &this->skelAnimeRightArm, &gVolvagiaRightArmSkel, &gVolvagiaRightArmEmergeAnim, NULL,
|
||||
NULL, 0);
|
||||
SkelAnime_Init(globalCtx, &this->skelAnimeLeftArm, &gVolvagiaLeftArmSkel, &gVolvagiaLeftArmEmergeAnim, NULL, NULL,
|
||||
0);
|
||||
SkelAnime_Init(play, &this->skelAnimeHead, &gVolvagiaHeadSkel, &gVolvagiaHeadEmergeAnim, NULL, NULL, 0);
|
||||
SkelAnime_Init(play, &this->skelAnimeRightArm, &gVolvagiaRightArmSkel, &gVolvagiaRightArmEmergeAnim, NULL, NULL, 0);
|
||||
SkelAnime_Init(play, &this->skelAnimeLeftArm, &gVolvagiaLeftArmSkel, &gVolvagiaLeftArmEmergeAnim, NULL, NULL, 0);
|
||||
this->introState = BFD_CS_WAIT;
|
||||
if (this->introState == BFD_CS_NONE) {
|
||||
Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_FIRE_BOSS);
|
||||
|
@ -193,8 +190,8 @@ void BossFd_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
|
||||
this->actor.world.pos.x = this->actor.world.pos.z = 0.0f;
|
||||
this->actor.world.pos.y = -200.0f;
|
||||
Collider_InitJntSph(globalCtx, &this->collider);
|
||||
Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->elements);
|
||||
Collider_InitJntSph(play, &this->collider);
|
||||
Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->elements);
|
||||
|
||||
for (i = 0; i < 100; i++) {
|
||||
this->bodySegsPos[i].x = this->actor.world.pos.x;
|
||||
|
@ -212,35 +209,35 @@ void BossFd_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
if (this->introState == BFD_CS_NONE) {
|
||||
this->actionFunc = BossFd_Wait;
|
||||
} else {
|
||||
BossFd_SetupFly(this, globalCtx);
|
||||
BossFd_SetupFly(this, play);
|
||||
}
|
||||
|
||||
if (Flags_GetClear(globalCtx, globalCtx->roomCtx.curRoom.num)) {
|
||||
if (Flags_GetClear(play, play->roomCtx.curRoom.num)) {
|
||||
Actor_Kill(&this->actor);
|
||||
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, 0.0f, 100.0f, 0.0f, 0, 0, 0,
|
||||
Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_DOOR_WARP1, 0.0f, 100.0f, 0.0f, 0, 0, 0,
|
||||
WARP_DUNGEON_ADULT);
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_ITEM_B_HEART, 0.0f, 100.0f, 200.0f, 0, 0, 0, 0);
|
||||
Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_B_HEART, 0.0f, 100.0f, 200.0f, 0, 0, 0, 0);
|
||||
} else {
|
||||
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_BOSS_FD2, this->actor.world.pos.x,
|
||||
Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_BOSS_FD2, this->actor.world.pos.x,
|
||||
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, this->introState);
|
||||
}
|
||||
}
|
||||
|
||||
void BossFd_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
void BossFd_Destroy(Actor* thisx, PlayState* play) {
|
||||
s32 pad;
|
||||
BossFd* this = (BossFd*)thisx;
|
||||
|
||||
SkelAnime_Free(&this->skelAnimeHead, globalCtx);
|
||||
SkelAnime_Free(&this->skelAnimeRightArm, globalCtx);
|
||||
SkelAnime_Free(&this->skelAnimeLeftArm, globalCtx);
|
||||
Collider_DestroyJntSph(globalCtx, &this->collider);
|
||||
SkelAnime_Free(&this->skelAnimeHead, play);
|
||||
SkelAnime_Free(&this->skelAnimeRightArm, play);
|
||||
SkelAnime_Free(&this->skelAnimeLeftArm, play);
|
||||
Collider_DestroyJntSph(play, &this->collider);
|
||||
}
|
||||
|
||||
s32 BossFd_IsFacingLink(BossFd* this) {
|
||||
return ABS((s16)(this->actor.yawTowardsPlayer - this->actor.world.rot.y)) < 0x2000;
|
||||
}
|
||||
|
||||
void BossFd_SetupFly(BossFd* this, GlobalContext* globalCtx) {
|
||||
void BossFd_SetupFly(BossFd* this, PlayState* play) {
|
||||
Animation_PlayOnce(&this->skelAnimeHead, &gVolvagiaHeadEmergeAnim);
|
||||
Animation_PlayOnce(&this->skelAnimeRightArm, &gVolvagiaRightArmEmergeAnim);
|
||||
Animation_PlayOnce(&this->skelAnimeLeftArm, &gVolvagiaLeftArmEmergeAnim);
|
||||
|
@ -259,7 +256,7 @@ static Vec3f sCeilingTargets[] = {
|
|||
{ 0.0f, 900.0f, 243.0f }, { -243.0f, 900.0f, 100.0f }, { -243.0, 900.0f, -100.0f },
|
||||
};
|
||||
|
||||
void BossFd_Fly(BossFd* this, GlobalContext* globalCtx) {
|
||||
void BossFd_Fly(BossFd* this, PlayState* play) {
|
||||
u8 sp1CF = false;
|
||||
u8 temp_rand;
|
||||
s16 i1;
|
||||
|
@ -268,7 +265,7 @@ void BossFd_Fly(BossFd* this, GlobalContext* globalCtx) {
|
|||
f32 dx;
|
||||
f32 dy;
|
||||
f32 dz;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
Player* player = GET_PLAYER(play);
|
||||
f32 angleToTarget;
|
||||
f32 pitchToTarget;
|
||||
Vec3f* holePosition1;
|
||||
|
@ -299,8 +296,8 @@ void BossFd_Fly(BossFd* this, GlobalContext* globalCtx) {
|
|||
// Boss Intro Cutscene
|
||||
|
||||
if (this->introState != BFD_CS_NONE) {
|
||||
Player* player2 = GET_PLAYER(globalCtx);
|
||||
Camera* mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN);
|
||||
Player* player2 = GET_PLAYER(play);
|
||||
Camera* mainCam = Play_GetCamera(play, CAM_ID_MAIN);
|
||||
|
||||
switch (this->introState) {
|
||||
case BFD_CS_WAIT:
|
||||
|
@ -314,11 +311,11 @@ void BossFd_Fly(BossFd* this, GlobalContext* globalCtx) {
|
|||
(fabsf(player2->actor.world.pos.x - 340.0f) < 60.0f)) {
|
||||
|
||||
this->introState = BFD_CS_START;
|
||||
func_80064520(globalCtx, &globalCtx->csCtx);
|
||||
func_8002DF54(globalCtx, &this->actor, 8);
|
||||
this->subCamId = Play_CreateSubCamera(globalCtx);
|
||||
Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT);
|
||||
Play_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE);
|
||||
func_80064520(play, &play->csCtx);
|
||||
func_8002DF54(play, &this->actor, 8);
|
||||
this->subCamId = Play_CreateSubCamera(play);
|
||||
Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STAT_WAIT);
|
||||
Play_ChangeCameraStatus(play, this->subCamId, CAM_STAT_ACTIVE);
|
||||
player2->actor.world.pos.x = 380.0f;
|
||||
player2->actor.world.pos.y = 100.0f;
|
||||
player2->actor.world.pos.z = 0.0f;
|
||||
|
@ -392,7 +389,7 @@ void BossFd_Fly(BossFd* this, GlobalContext* globalCtx) {
|
|||
Math_ApproachF(&this->subCamShake, 2.0f, 1.0f, 0.8 * 0.01f);
|
||||
}
|
||||
if (this->timers[0] == 40) {
|
||||
func_8002DF54(globalCtx, &this->actor, 0x13);
|
||||
func_8002DF54(play, &this->actor, 0x13);
|
||||
}
|
||||
if (this->timers[0] == 0) {
|
||||
this->introState = BFD_CS_LOOK_GROUND;
|
||||
|
@ -421,7 +418,7 @@ void BossFd_Fly(BossFd* this, GlobalContext* globalCtx) {
|
|||
this->timers[0] = 170;
|
||||
this->subCamVelFactor = 0.0f;
|
||||
this->subCamAccel = 0.0f;
|
||||
func_8002DF54(globalCtx, &this->actor, 0x14);
|
||||
func_8002DF54(play, &this->actor, 0x14);
|
||||
}
|
||||
break;
|
||||
case BFD_CS_COLLAPSE:
|
||||
|
@ -472,7 +469,7 @@ void BossFd_Fly(BossFd* this, GlobalContext* globalCtx) {
|
|||
if (this->timers[3] == 190) {
|
||||
this->subCamAtMaxVelFrac.x = this->subCamAtMaxVelFrac.y = this->subCamAtMaxVelFrac.z = 0.05f;
|
||||
this->platformSignal = VBSIMA_KILL;
|
||||
func_8002DF54(globalCtx, &this->actor, 1);
|
||||
func_8002DF54(play, &this->actor, 1);
|
||||
}
|
||||
if (this->actor.world.pos.y > 120.0f) {
|
||||
this->subCamAtNext = this->actor.world.pos;
|
||||
|
@ -493,7 +490,7 @@ void BossFd_Fly(BossFd* this, GlobalContext* globalCtx) {
|
|||
Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_FIRE_BOSS);
|
||||
}
|
||||
if ((this->timers[3] == 130) && !GET_EVENTCHKINF(EVENTCHKINF_73)) {
|
||||
TitleCard_InitBossName(globalCtx, &globalCtx->actorCtx.titleCtx,
|
||||
TitleCard_InitBossName(play, &play->actorCtx.titleCtx,
|
||||
SEGMENTED_TO_VIRTUAL(gVolvagiaBossTitleCardTex), 0xA0, 0xB4, 0x80, 0x28);
|
||||
}
|
||||
if (this->timers[3] <= 100) {
|
||||
|
@ -537,18 +534,18 @@ void BossFd_Fly(BossFd* this, GlobalContext* globalCtx) {
|
|||
mainCam->eye = this->subCamEye;
|
||||
mainCam->eyeNext = this->subCamEye;
|
||||
mainCam->at = this->subCamAt;
|
||||
func_800C08AC(globalCtx, this->subCamId, 0);
|
||||
func_800C08AC(play, this->subCamId, 0);
|
||||
// BFD_CS_NONE / BOSSFD_FLY_MAIN / SUB_CAM_ID_DONE
|
||||
this->introState = this->introFlyState = this->subCamId = 0;
|
||||
func_80064534(globalCtx, &globalCtx->csCtx);
|
||||
func_8002DF54(globalCtx, &this->actor, 7);
|
||||
func_80064534(play, &play->csCtx);
|
||||
func_8002DF54(play, &this->actor, 7);
|
||||
this->actionFunc = BossFd_Wait;
|
||||
this->handoffSignal = FD2_SIGNAL_GROUND;
|
||||
SET_EVENTCHKINF(EVENTCHKINF_73);
|
||||
}
|
||||
break;
|
||||
}
|
||||
BossFd_UpdateCamera(this, globalCtx);
|
||||
BossFd_UpdateCamera(this, play);
|
||||
} else {
|
||||
this->fwork[BFD_FLY_SPEED] = 5.0f;
|
||||
}
|
||||
|
@ -632,7 +629,7 @@ void BossFd_Fly(BossFd* this, GlobalContext* globalCtx) {
|
|||
this->holePosition.x = this->targetPosition.x;
|
||||
this->holePosition.z = this->targetPosition.z;
|
||||
|
||||
func_80033E1C(globalCtx, 1, 0x50, 0x5000);
|
||||
func_80033E1C(play, 1, 0x50, 0x5000);
|
||||
if (this->introState != BFD_CS_NONE) {
|
||||
this->timers[0] = 50;
|
||||
} else {
|
||||
|
@ -668,7 +665,7 @@ void BossFd_Fly(BossFd* this, GlobalContext* globalCtx) {
|
|||
this->work[BFD_CEILING_TARGET] = 0;
|
||||
}
|
||||
}
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 50.0f, 50.0f, 100.0f, UPDBGCHECKINFO_FLAG_1);
|
||||
Actor_UpdateBgCheckInfo(play, &this->actor, 50.0f, 50.0f, 100.0f, UPDBGCHECKINFO_FLAG_1);
|
||||
if (this->timers[1] == 0) {
|
||||
osSyncPrintf("BGCHECKKKKKKKKKKKKKKKKKKKKKKK\n");
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_CEILING) {
|
||||
|
@ -677,7 +674,7 @@ void BossFd_Fly(BossFd* this, GlobalContext* globalCtx) {
|
|||
Audio_PlaySoundGeneral(NA_SE_EV_EXPLOSION, &this->actor.projectedPos, 4,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultReverb);
|
||||
func_80033E1C(globalCtx, 3, 0xA, 0x7530);
|
||||
func_80033E1C(play, 3, 0xA, 0x7530);
|
||||
this->work[BFD_ROCK_TIMER] = 300;
|
||||
}
|
||||
} else {
|
||||
|
@ -769,7 +766,7 @@ void BossFd_Fly(BossFd* this, GlobalContext* globalCtx) {
|
|||
s16 sp150;
|
||||
|
||||
if (this->fogMode == 0) {
|
||||
globalCtx->envCtx.lightBlend = 0;
|
||||
play->envCtx.lightBlend = 0;
|
||||
}
|
||||
this->fogMode = 0xA;
|
||||
|
||||
|
@ -789,7 +786,7 @@ void BossFd_Fly(BossFd* this, GlobalContext* globalCtx) {
|
|||
|
||||
sp164.y = 0.03f;
|
||||
|
||||
EffectSsKFire_Spawn(globalCtx, &sp188, &sp17C, &sp164, (s16)Rand_ZeroFloat(20.0f) + 40, 0x64);
|
||||
EffectSsKFire_Spawn(play, &sp188, &sp17C, &sp164, (s16)Rand_ZeroFloat(20.0f) + 40, 0x64);
|
||||
|
||||
for (i2 = 0; i2 < 15; i2++) {
|
||||
sp170.x = Rand_CenteredFloat(20.0f);
|
||||
|
@ -852,7 +849,7 @@ void BossFd_Fly(BossFd* this, GlobalContext* globalCtx) {
|
|||
Audio_PlaySoundGeneral(NA_SE_EN_VALVAISA_LAND2, &this->actor.projectedPos, 4,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultReverb);
|
||||
func_8002DF54(globalCtx, &this->actor, 5);
|
||||
func_8002DF54(play, &this->actor, 5);
|
||||
for (i1 = 0; i1 < 15; i1++) {
|
||||
Vec3f sp144 = { 0.0f, 0.0f, 0.0f };
|
||||
Vec3f sp138 = { 0.0f, 0.0f, 0.0f };
|
||||
|
@ -901,7 +898,7 @@ void BossFd_Fly(BossFd* this, GlobalContext* globalCtx) {
|
|||
|
||||
sp108.y = 0.03f;
|
||||
|
||||
EffectSsKFire_Spawn(globalCtx, &sp120, &sp114, &sp108, (s16)Rand_ZeroFloat(15.0f) + 30, 0);
|
||||
EffectSsKFire_Spawn(play, &sp120, &sp114, &sp108, (s16)Rand_ZeroFloat(15.0f) + 30, 0);
|
||||
}
|
||||
if (this->timers[0] < 20) {
|
||||
Math_ApproachZeroF(&this->actor.scale.x, 1.0f, 0.0025f);
|
||||
|
@ -912,8 +909,8 @@ void BossFd_Fly(BossFd* this, GlobalContext* globalCtx) {
|
|||
this->actor.world.pos.y -= 1000.0f;
|
||||
}
|
||||
if (this->timers[0] == 7) {
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_ITEM_B_HEART, this->actor.world.pos.x,
|
||||
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0);
|
||||
Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_B_HEART, this->actor.world.pos.x, this->actor.world.pos.y,
|
||||
this->actor.world.pos.z, 0, 0, 0, 0);
|
||||
}
|
||||
break;
|
||||
case BOSSFD_WAIT_INTRO:
|
||||
|
@ -984,14 +981,14 @@ void BossFd_Fly(BossFd* this, GlobalContext* globalCtx) {
|
|||
if (this->work[BFD_ACTION_STATE] < BOSSFD_SKULL_FALL) {
|
||||
if ((this->actor.prevPos.y < 90.0f) && (90.0f <= this->actor.world.pos.y)) {
|
||||
this->timers[4] = 80;
|
||||
func_80033E1C(globalCtx, 1, 80, 0x5000);
|
||||
func_80033E1C(play, 1, 80, 0x5000);
|
||||
this->work[BFD_ROAR_TIMER] = 40;
|
||||
this->work[BFD_MANE_EMBERS_TIMER] = 30;
|
||||
this->work[BFD_SPLASH_TIMER] = 10;
|
||||
}
|
||||
if ((this->actor.prevPos.y > 90.0f) && (90.0f >= this->actor.world.pos.y)) {
|
||||
this->timers[4] = 80;
|
||||
func_80033E1C(globalCtx, 1, 80, 0x5000);
|
||||
func_80033E1C(play, 1, 80, 0x5000);
|
||||
this->work[BFD_MANE_EMBERS_TIMER] = 30;
|
||||
this->work[BFD_SPLASH_TIMER] = 10;
|
||||
}
|
||||
|
@ -1030,12 +1027,12 @@ void BossFd_Fly(BossFd* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
void BossFd_Wait(BossFd* this, GlobalContext* globalCtx) {
|
||||
void BossFd_Wait(BossFd* this, PlayState* play) {
|
||||
if (this->handoffSignal == FD2_SIGNAL_FLY) { // Set by BossFd2
|
||||
u8 temp_rand;
|
||||
|
||||
this->handoffSignal = FD2_SIGNAL_NONE;
|
||||
BossFd_SetupFly(this, globalCtx);
|
||||
BossFd_SetupFly(this, play);
|
||||
do {
|
||||
temp_rand = Rand_ZeroFloat(8.9f);
|
||||
} while (temp_rand == this->holeIndex);
|
||||
|
@ -1052,7 +1049,7 @@ void BossFd_Wait(BossFd* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
if (this->handoffSignal == FD2_SIGNAL_DEATH) {
|
||||
this->handoffSignal = FD2_SIGNAL_NONE;
|
||||
BossFd_SetupFly(this, globalCtx);
|
||||
BossFd_SetupFly(this, play);
|
||||
this->holeIndex = 1;
|
||||
this->targetPosition.x = sHoleLocations[1].x;
|
||||
this->targetPosition.y = sHoleLocations[1].y - 200.0f;
|
||||
|
@ -1065,7 +1062,7 @@ void BossFd_Wait(BossFd* this, GlobalContext* globalCtx) {
|
|||
|
||||
static Vec3f sFireAudioVec = { 0.0f, 0.0f, 50.0f };
|
||||
|
||||
void BossFd_Effects(BossFd* this, GlobalContext* globalCtx) {
|
||||
void BossFd_Effects(BossFd* this, PlayState* play) {
|
||||
static Color_RGBA8 colorYellow = { 255, 255, 0, 255 };
|
||||
static Color_RGBA8 colorRed = { 255, 10, 0, 255 };
|
||||
s16 breathOpacity = 0;
|
||||
|
@ -1081,36 +1078,36 @@ void BossFd_Effects(BossFd* this, GlobalContext* globalCtx) {
|
|||
if (1) {} // Needed for match
|
||||
|
||||
if (this->fogMode == 0) {
|
||||
globalCtx->envCtx.lightSettingOverride = 0;
|
||||
globalCtx->envCtx.lightBlend = 0.5f + 0.5f * Math_SinS(this->work[BFD_VAR_TIMER] * 0x500);
|
||||
globalCtx->envCtx.lightBlendOverride = LIGHT_BLEND_OVERRIDE_FULL_CONTROL;
|
||||
globalCtx->envCtx.lightSetting = 1;
|
||||
globalCtx->envCtx.prevLightSetting = 0;
|
||||
play->envCtx.lightSettingOverride = 0;
|
||||
play->envCtx.lightBlend = 0.5f + 0.5f * Math_SinS(this->work[BFD_VAR_TIMER] * 0x500);
|
||||
play->envCtx.lightBlendOverride = LIGHT_BLEND_OVERRIDE_FULL_CONTROL;
|
||||
play->envCtx.lightSetting = 1;
|
||||
play->envCtx.prevLightSetting = 0;
|
||||
} else if (this->fogMode == 3) {
|
||||
globalCtx->envCtx.lightSettingOverride = 0;
|
||||
globalCtx->envCtx.lightBlendOverride = LIGHT_BLEND_OVERRIDE_FULL_CONTROL;
|
||||
globalCtx->envCtx.lightSetting = 2;
|
||||
globalCtx->envCtx.prevLightSetting = 0;
|
||||
Math_ApproachF(&globalCtx->envCtx.lightBlend, 1.0f, 1.0f, 0.05f);
|
||||
play->envCtx.lightSettingOverride = 0;
|
||||
play->envCtx.lightBlendOverride = LIGHT_BLEND_OVERRIDE_FULL_CONTROL;
|
||||
play->envCtx.lightSetting = 2;
|
||||
play->envCtx.prevLightSetting = 0;
|
||||
Math_ApproachF(&play->envCtx.lightBlend, 1.0f, 1.0f, 0.05f);
|
||||
} else if (this->fogMode == 2) {
|
||||
this->fogMode--;
|
||||
globalCtx->envCtx.lightSettingOverride = 0;
|
||||
Math_ApproachF(&globalCtx->envCtx.lightBlend, 0.55f + 0.05f * Math_SinS(this->work[BFD_VAR_TIMER] * 0x3E00),
|
||||
1.0f, 0.15f);
|
||||
globalCtx->envCtx.lightBlendOverride = LIGHT_BLEND_OVERRIDE_FULL_CONTROL;
|
||||
globalCtx->envCtx.lightSetting = 3;
|
||||
globalCtx->envCtx.prevLightSetting = 0;
|
||||
play->envCtx.lightSettingOverride = 0;
|
||||
Math_ApproachF(&play->envCtx.lightBlend, 0.55f + 0.05f * Math_SinS(this->work[BFD_VAR_TIMER] * 0x3E00), 1.0f,
|
||||
0.15f);
|
||||
play->envCtx.lightBlendOverride = LIGHT_BLEND_OVERRIDE_FULL_CONTROL;
|
||||
play->envCtx.lightSetting = 3;
|
||||
play->envCtx.prevLightSetting = 0;
|
||||
} else if (this->fogMode == 10) {
|
||||
this->fogMode = 1;
|
||||
globalCtx->envCtx.lightSettingOverride = 0;
|
||||
Math_ApproachF(&globalCtx->envCtx.lightBlend, 0.21f + 0.07f * Math_SinS(this->work[BFD_VAR_TIMER] * 0xC00),
|
||||
1.0f, 0.05f);
|
||||
globalCtx->envCtx.lightBlendOverride = LIGHT_BLEND_OVERRIDE_FULL_CONTROL;
|
||||
globalCtx->envCtx.lightSetting = 3;
|
||||
globalCtx->envCtx.prevLightSetting = 0;
|
||||
play->envCtx.lightSettingOverride = 0;
|
||||
Math_ApproachF(&play->envCtx.lightBlend, 0.21f + 0.07f * Math_SinS(this->work[BFD_VAR_TIMER] * 0xC00), 1.0f,
|
||||
0.05f);
|
||||
play->envCtx.lightBlendOverride = LIGHT_BLEND_OVERRIDE_FULL_CONTROL;
|
||||
play->envCtx.lightSetting = 3;
|
||||
play->envCtx.prevLightSetting = 0;
|
||||
} else if (this->fogMode == 1) {
|
||||
Math_ApproachF(&globalCtx->envCtx.lightBlend, 0.0f, 1.0f, 0.03f);
|
||||
if (globalCtx->envCtx.lightBlend <= 0.01f) {
|
||||
Math_ApproachF(&play->envCtx.lightBlend, 0.0f, 1.0f, 0.03f);
|
||||
if (play->envCtx.lightBlend <= 0.01f) {
|
||||
this->fogMode = 0;
|
||||
}
|
||||
}
|
||||
|
@ -1164,7 +1161,7 @@ void BossFd_Effects(BossFd* this, GlobalContext* globalCtx) {
|
|||
if ((this->actor.colChkInfo.health == 0) ||
|
||||
((this->introState == BFD_CS_EMERGE) && (this->actor.world.rot.x > 0x3000))) {
|
||||
if ((u8)this->fogMode == 0) {
|
||||
globalCtx->envCtx.lightBlend = 0.0f;
|
||||
play->envCtx.lightBlend = 0.0f;
|
||||
}
|
||||
this->fogMode = 2;
|
||||
}
|
||||
|
@ -1182,7 +1179,7 @@ void BossFd_Effects(BossFd* this, GlobalContext* globalCtx) {
|
|||
spawnPos1.y = 100.0f;
|
||||
spawnPos1.z = temp_z + this->holePosition.z;
|
||||
|
||||
func_8002836C(globalCtx, &spawnPos1, &spawnVel1, &spawnAccel1, &colorYellow, &colorRed,
|
||||
func_8002836C(play, &spawnPos1, &spawnVel1, &spawnAccel1, &colorYellow, &colorRed,
|
||||
(s16)Rand_ZeroFloat(150.0f) + 800, 10, (s16)Rand_ZeroFloat(5.0f) + 17);
|
||||
}
|
||||
} else {
|
||||
|
@ -1200,7 +1197,7 @@ void BossFd_Effects(BossFd* this, GlobalContext* globalCtx) {
|
|||
spawnPos1.y = 100.0f;
|
||||
spawnPos1.z = temp_z + this->holePosition.z;
|
||||
|
||||
func_8002836C(globalCtx, &spawnPos1, &spawnVel1, &spawnAccel1, &colorYellow, &colorRed, 500, 10, 20);
|
||||
func_8002836C(play, &spawnPos1, &spawnVel1, &spawnAccel1, &colorYellow, &colorRed, 500, 10, 20);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1282,7 +1279,7 @@ void BossFd_Effects(BossFd* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
void BossFd_CollisionCheck(BossFd* this, GlobalContext* globalCtx) {
|
||||
void BossFd_CollisionCheck(BossFd* this, PlayState* play) {
|
||||
ColliderJntSphElement* headCollider = &this->collider.elements[0];
|
||||
ColliderInfo* hurtbox;
|
||||
|
||||
|
@ -1303,7 +1300,7 @@ void BossFd_CollisionCheck(BossFd* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
void BossFd_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
void BossFd_Update(Actor* thisx, PlayState* play) {
|
||||
s32 pad;
|
||||
BossFd* this = (BossFd*)thisx;
|
||||
f32 headGlow;
|
||||
|
@ -1314,7 +1311,7 @@ void BossFd_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
osSyncPrintf("FD MOVE START \n");
|
||||
this->work[BFD_VAR_TIMER]++;
|
||||
this->work[BFD_MOVE_TIMER]++;
|
||||
this->actionFunc(this, globalCtx);
|
||||
this->actionFunc(this, play);
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(this->timers); i++) {
|
||||
if (this->timers[i] != 0) {
|
||||
|
@ -1332,13 +1329,13 @@ void BossFd_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
}
|
||||
if (this->work[BFD_ACTION_STATE] < BOSSFD_DEATH_START) {
|
||||
if (this->work[BFD_INVINC_TIMER] == 0) {
|
||||
BossFd_CollisionCheck(this, globalCtx);
|
||||
BossFd_CollisionCheck(this, play);
|
||||
}
|
||||
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
|
||||
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
|
||||
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
|
||||
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base);
|
||||
}
|
||||
|
||||
BossFd_Effects(this, globalCtx);
|
||||
BossFd_Effects(this, play);
|
||||
this->fwork[BFD_TEX1_SCROLL_X] += 4.0f;
|
||||
this->fwork[BFD_TEX1_SCROLL_Y] = 120.0f;
|
||||
this->fwork[BFD_TEX2_SCROLL_X] += 3.0f;
|
||||
|
@ -1364,7 +1361,7 @@ void BossFd_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
this->work[BFD_ROCK_TIMER]--;
|
||||
if ((this->work[BFD_ROCK_TIMER] % 16) == 0) {
|
||||
EnVbBall* bossFdRock = (EnVbBall*)Actor_SpawnAsChild(
|
||||
&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_VB_BALL, this->actor.world.pos.x, 1000.0f,
|
||||
&play->actorCtx, &this->actor, play, ACTOR_EN_VB_BALL, this->actor.world.pos.x, 1000.0f,
|
||||
this->actor.world.pos.z, 0, 0, (s16)Rand_ZeroFloat(50.0f) + 130, 100);
|
||||
|
||||
if (bossFdRock != NULL) {
|
||||
|
@ -1427,13 +1424,13 @@ void BossFd_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
osSyncPrintf("FD MOVE END 1\n");
|
||||
BossFd_UpdateEffects(this, globalCtx);
|
||||
BossFd_UpdateEffects(this, play);
|
||||
osSyncPrintf("FD MOVE END 2\n");
|
||||
}
|
||||
|
||||
void BossFd_UpdateEffects(BossFd* this, GlobalContext* globalCtx) {
|
||||
void BossFd_UpdateEffects(BossFd* this, PlayState* play) {
|
||||
BossFdEffect* effect = this->effects;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
Player* player = GET_PLAYER(play);
|
||||
Color_RGB8 colors[4] = { { 255, 128, 0 }, { 255, 0, 0 }, { 255, 255, 0 }, { 255, 0, 0 } };
|
||||
Vec3f diff;
|
||||
s16 i1;
|
||||
|
@ -1480,7 +1477,7 @@ void BossFd_UpdateEffects(BossFd* this, GlobalContext* globalCtx) {
|
|||
diff.z = player->actor.world.pos.z - effect->pos.z;
|
||||
if ((this->timers[3] == 0) && (sqrtf(SQ(diff.x) + SQ(diff.y) + SQ(diff.z)) < 20.0f)) {
|
||||
this->timers[3] = 50;
|
||||
func_8002F6D4(globalCtx, NULL, 5.0f, effect->kbAngle, 0.0f, 0x30);
|
||||
func_8002F6D4(play, NULL, 5.0f, effect->kbAngle, 0.0f, 0x30);
|
||||
if (player->isBurning == false) {
|
||||
for (i2 = 0; i2 < PLAYER_BODYPART_MAX; i2++) {
|
||||
player->flameTimers[i2] = Rand_S16Offset(0, 200);
|
||||
|
@ -1514,12 +1511,12 @@ void BossFd_UpdateEffects(BossFd* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
void BossFd_DrawEffects(BossFdEffect* effect, GlobalContext* globalCtx) {
|
||||
void BossFd_DrawEffects(BossFdEffect* effect, PlayState* play) {
|
||||
static void* dustTex[] = {
|
||||
gDust1Tex, gDust1Tex, gDust2Tex, gDust3Tex, gDust4Tex, gDust5Tex, gDust6Tex, gDust7Tex, gDust8Tex,
|
||||
};
|
||||
u8 materialFlag = 0;
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
GraphicsContext* gfxCtx = play->state.gfxCtx;
|
||||
s16 i;
|
||||
BossFdEffect* firstEffect = effect;
|
||||
|
||||
|
@ -1528,14 +1525,14 @@ void BossFd_DrawEffects(BossFdEffect* effect, GlobalContext* globalCtx) {
|
|||
for (i = 0; i < BOSSFD_EFFECT_COUNT; i++, effect++) {
|
||||
if (effect->type == BFD_FX_EMBER) {
|
||||
if (materialFlag == 0) {
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
func_80093D84(play->state.gfxCtx);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gVolvagiaEmberMaterialDL);
|
||||
materialFlag++;
|
||||
}
|
||||
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, effect->color.r, effect->color.g, effect->color.b, effect->alpha);
|
||||
Matrix_Translate(effect->pos.x, effect->pos.y, effect->pos.z, MTXMODE_NEW);
|
||||
Matrix_ReplaceRotation(&globalCtx->billboardMtxF);
|
||||
Matrix_ReplaceRotation(&play->billboardMtxF);
|
||||
Matrix_Scale(effect->scale, effect->scale, 1.0f, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_boss_fd.c", 4046),
|
||||
|
@ -1549,7 +1546,7 @@ void BossFd_DrawEffects(BossFdEffect* effect, GlobalContext* globalCtx) {
|
|||
for (i = 0; i < BOSSFD_EFFECT_COUNT; i++, effect++) {
|
||||
if (effect->type == BFD_FX_DEBRIS) {
|
||||
if (materialFlag == 0) {
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
func_80093D18(play->state.gfxCtx);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gVolvagiaDebrisMaterialDL);
|
||||
materialFlag++;
|
||||
}
|
||||
|
@ -1579,7 +1576,7 @@ void BossFd_DrawEffects(BossFdEffect* effect, GlobalContext* globalCtx) {
|
|||
|
||||
Matrix_Translate(effect->pos.x, effect->pos.y, effect->pos.z, MTXMODE_NEW);
|
||||
Matrix_Scale(effect->scale, effect->scale, effect->scale, MTXMODE_APPLY);
|
||||
Matrix_ReplaceRotation(&globalCtx->billboardMtxF);
|
||||
Matrix_ReplaceRotation(&play->billboardMtxF);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_boss_fd.c", 4104),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
@ -1602,7 +1599,7 @@ void BossFd_DrawEffects(BossFdEffect* effect, GlobalContext* globalCtx) {
|
|||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 0, effect->alpha);
|
||||
Matrix_Translate(effect->pos.x, effect->pos.y, effect->pos.z, MTXMODE_NEW);
|
||||
Matrix_Scale(effect->scale, effect->scale, effect->scale, MTXMODE_APPLY);
|
||||
Matrix_ReplaceRotation(&globalCtx->billboardMtxF);
|
||||
Matrix_ReplaceRotation(&play->billboardMtxF);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_boss_fd.c", 4154),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
@ -1616,7 +1613,7 @@ void BossFd_DrawEffects(BossFdEffect* effect, GlobalContext* globalCtx) {
|
|||
for (i = 0; i < BOSSFD_EFFECT_COUNT; i++, effect++) {
|
||||
if (effect->type == BFD_FX_SKULL_PIECE) {
|
||||
if (materialFlag == 0) {
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
func_80093D84(play->state.gfxCtx);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gVolvagiaSkullPieceMaterialDL);
|
||||
materialFlag++;
|
||||
}
|
||||
|
@ -1635,30 +1632,29 @@ void BossFd_DrawEffects(BossFdEffect* effect, GlobalContext* globalCtx) {
|
|||
CLOSE_DISPS(gfxCtx, "../z_boss_fd.c", 4198);
|
||||
}
|
||||
|
||||
void BossFd_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
void BossFd_Draw(Actor* thisx, PlayState* play) {
|
||||
s32 pad;
|
||||
BossFd* this = (BossFd*)thisx;
|
||||
|
||||
osSyncPrintf("FD DRAW START\n");
|
||||
if (this->actionFunc != BossFd_Wait) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_boss_fd.c", 4217);
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_boss_fd.c", 4217);
|
||||
func_80093D18(play->state.gfxCtx);
|
||||
if (this->work[BFD_DAMAGE_FLASH_TIMER] & 2) {
|
||||
POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 255, 255, 255, 0, 900, 1099);
|
||||
}
|
||||
|
||||
BossFd_DrawBody(globalCtx, this);
|
||||
POLY_OPA_DISP = Play_SetFog(globalCtx, POLY_OPA_DISP);
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_boss_fd.c", 4243);
|
||||
BossFd_DrawBody(play, this);
|
||||
POLY_OPA_DISP = Play_SetFog(play, POLY_OPA_DISP);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_boss_fd.c", 4243);
|
||||
}
|
||||
|
||||
osSyncPrintf("FD DRAW END\n");
|
||||
BossFd_DrawEffects(this->effects, globalCtx);
|
||||
BossFd_DrawEffects(this->effects, play);
|
||||
osSyncPrintf("FD DRAW END2\n");
|
||||
}
|
||||
|
||||
s32 BossFd_OverrideRightArmDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
|
||||
void* thisx) {
|
||||
s32 BossFd_OverrideRightArmDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) {
|
||||
BossFd* this = (BossFd*)thisx;
|
||||
|
||||
switch (limbIndex) {
|
||||
|
@ -1680,8 +1676,7 @@ s32 BossFd_OverrideRightArmDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** d
|
|||
return false;
|
||||
}
|
||||
|
||||
s32 BossFd_OverrideLeftArmDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
|
||||
void* thisx) {
|
||||
s32 BossFd_OverrideLeftArmDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) {
|
||||
BossFd* this = (BossFd*)thisx;
|
||||
|
||||
switch (limbIndex) {
|
||||
|
@ -1706,7 +1701,7 @@ s32 BossFd_OverrideLeftArmDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dL
|
|||
static s16 sBodyIndex[] = { 0, 95, 90, 85, 80, 75, 70, 65, 60, 55, 50, 45, 40, 35, 30, 25, 20, 15, 10, 5 };
|
||||
static s16 sManeIndex[] = { 0, 28, 26, 24, 22, 20, 18, 16, 14, 12, 10 }; // Unused
|
||||
|
||||
void BossFd_DrawMane(GlobalContext* globalCtx, BossFd* this, Vec3f* manePos, Vec3f* maneRot, f32* maneScale, u8 mode) {
|
||||
void BossFd_DrawMane(PlayState* play, BossFd* this, Vec3f* manePos, Vec3f* maneRot, f32* maneScale, u8 mode) {
|
||||
f32 sp140[] = { 0.0f, 10.0f, 17.0f, 20.0f, 19.5f, 18.0f, 17.0f, 15.0f, 15.0f, 15.0f };
|
||||
f32 sp118[] = { 0.0f, 10.0f, 17.0f, 20.0f, 21.0f, 21.0f, 21.0f, 21.0f, 21.0f, 21.0f };
|
||||
f32 spF0[] = { 0.4636457f, 0.3366129f, 0.14879614f, 0.04995025f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f };
|
||||
|
@ -1722,7 +1717,7 @@ void BossFd_DrawMane(GlobalContext* globalCtx, BossFd* this, Vec3f* manePos, Vec
|
|||
f32 phi_f20;
|
||||
f32 phi_f22;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_boss_fd.c", 4419);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_boss_fd.c", 4419);
|
||||
|
||||
maneLength = this->skinSegments;
|
||||
maneLength = CLAMP_MAX(maneLength, 10);
|
||||
|
@ -1763,15 +1758,15 @@ void BossFd_DrawMane(GlobalContext* globalCtx, BossFd* this, Vec3f* manePos, Vec
|
|||
Matrix_Scale(maneScale[maneIndex] * (0.01f - (i * 0.0008f)), maneScale[maneIndex] * (0.01f - (i * 0.0008f)),
|
||||
0.01f, MTXMODE_APPLY);
|
||||
Matrix_RotateX(-M_PI / 2.0f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_boss_fd.c", 4480),
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_fd.c", 4480),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gVolvagiaManeModelDL);
|
||||
}
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_boss_fd.c", 4483);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_boss_fd.c", 4483);
|
||||
}
|
||||
|
||||
s32 BossFd_OverrideHeadDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) {
|
||||
s32 BossFd_OverrideHeadDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) {
|
||||
BossFd* this = (BossFd*)thisx;
|
||||
|
||||
switch (limbIndex) {
|
||||
|
@ -1798,7 +1793,7 @@ s32 BossFd_OverrideHeadDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList
|
|||
return false;
|
||||
}
|
||||
|
||||
void BossFd_PostHeadDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) {
|
||||
void BossFd_PostHeadDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) {
|
||||
static Vec3f targetMod = { 4500.0f, 0.0f, 0.0f };
|
||||
static Vec3f headMod = { 4000.0f, 0.0f, 0.0f };
|
||||
BossFd* this = (BossFd*)thisx;
|
||||
|
@ -1822,18 +1817,18 @@ static Gfx* sBodyDLists[] = {
|
|||
gVolvagiaBodySeg16DL, gVolvagiaBodySeg17DL, gVolvagiaBodySeg18DL,
|
||||
};
|
||||
|
||||
void BossFd_DrawBody(GlobalContext* globalCtx, BossFd* this) {
|
||||
void BossFd_DrawBody(PlayState* play, BossFd* this) {
|
||||
s16 segIndex;
|
||||
s16 i;
|
||||
f32 temp_float;
|
||||
Mtx* tempMat = Graph_Alloc(globalCtx->state.gfxCtx, 18 * sizeof(Mtx));
|
||||
Mtx* tempMat = Graph_Alloc(play->state.gfxCtx, 18 * sizeof(Mtx));
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_boss_fd.c", 4589);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_boss_fd.c", 4589);
|
||||
if (this->skinSegments != 0) {
|
||||
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(sEyeTextures[this->eyeState]));
|
||||
}
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08,
|
||||
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, (s16)this->fwork[BFD_TEX1_SCROLL_X],
|
||||
Gfx_TwoTexScroll(play->state.gfxCtx, 0, (s16)this->fwork[BFD_TEX1_SCROLL_X],
|
||||
(s16)this->fwork[BFD_TEX1_SCROLL_Y], 0x20, 0x20, 1, (s16)this->fwork[BFD_TEX2_SCROLL_X],
|
||||
(s16)this->fwork[BFD_TEX2_SCROLL_Y], 0x20, 0x20));
|
||||
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255);
|
||||
|
@ -1848,7 +1843,7 @@ void BossFd_DrawBody(GlobalContext* globalCtx, BossFd* this) {
|
|||
Matrix_RotateX(-this->bodySegsRot[segIndex].x, MTXMODE_APPLY);
|
||||
Matrix_Translate(-13.0f, -5.0f, 13.0f, MTXMODE_APPLY);
|
||||
Matrix_Scale(this->actor.scale.x * 0.1f, this->actor.scale.y * 0.1f, this->actor.scale.z * 0.1f, MTXMODE_APPLY);
|
||||
SkelAnime_DrawOpa(globalCtx, this->skelAnimeRightArm.skeleton, this->skelAnimeRightArm.jointTable,
|
||||
SkelAnime_DrawOpa(play, this->skelAnimeRightArm.skeleton, this->skelAnimeRightArm.jointTable,
|
||||
BossFd_OverrideRightArmDraw, NULL, this);
|
||||
Matrix_Pop();
|
||||
osSyncPrintf("RH\n");
|
||||
|
@ -1860,7 +1855,7 @@ void BossFd_DrawBody(GlobalContext* globalCtx, BossFd* this) {
|
|||
Matrix_RotateX(-this->bodySegsRot[segIndex].x, MTXMODE_APPLY);
|
||||
Matrix_Translate(13.0f, -5.0f, 13.0f, MTXMODE_APPLY);
|
||||
Matrix_Scale(this->actor.scale.x * 0.1f, this->actor.scale.y * 0.1f, this->actor.scale.z * 0.1f, MTXMODE_APPLY);
|
||||
SkelAnime_DrawOpa(globalCtx, this->skelAnimeLeftArm.skeleton, this->skelAnimeLeftArm.jointTable,
|
||||
SkelAnime_DrawOpa(play, this->skelAnimeLeftArm.skeleton, this->skelAnimeLeftArm.jointTable,
|
||||
BossFd_OverrideLeftArmDraw, NULL, this);
|
||||
Matrix_Pop();
|
||||
osSyncPrintf("BD\n");
|
||||
|
@ -1906,7 +1901,7 @@ void BossFd_DrawBody(GlobalContext* globalCtx, BossFd* this) {
|
|||
temp_float = 0.1f * sp84;
|
||||
}
|
||||
Matrix_Scale(0.1f, 0.1f, 0.1f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_boss_fd.c", 4768),
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_fd.c", 4768),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gVolvagiaRibsDL);
|
||||
|
||||
|
@ -1917,9 +1912,8 @@ void BossFd_DrawBody(GlobalContext* globalCtx, BossFd* this) {
|
|||
Matrix_MultVec3f(&spF0, &spE4);
|
||||
Matrix_Get(&spFC);
|
||||
Matrix_MtxFToYXZRotS(&spFC, &spDC, 0);
|
||||
bones =
|
||||
(EnVbBall*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_VB_BALL,
|
||||
spE4.x, spE4.y, spE4.z, spDC.x, spDC.y, spDC.z, i + 200);
|
||||
bones = (EnVbBall*)Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_VB_BALL, spE4.x,
|
||||
spE4.y, spE4.z, spDC.x, spDC.y, spDC.z, i + 200);
|
||||
|
||||
bones->actor.scale.x = this->actor.scale.x * temp_float;
|
||||
bones->actor.scale.y = this->actor.scale.y * spD4;
|
||||
|
@ -1953,34 +1947,34 @@ void BossFd_DrawBody(GlobalContext* globalCtx, BossFd* this) {
|
|||
Matrix_Pop();
|
||||
osSyncPrintf("BHCE\n");
|
||||
Matrix_Scale(this->actor.scale.x * 0.1f, this->actor.scale.y * 0.1f, this->actor.scale.z * 0.1f, MTXMODE_APPLY);
|
||||
SkelAnime_DrawOpa(globalCtx, this->skelAnimeHead.skeleton, this->skelAnimeHead.jointTable, BossFd_OverrideHeadDraw,
|
||||
SkelAnime_DrawOpa(play, this->skelAnimeHead.skeleton, this->skelAnimeHead.jointTable, BossFd_OverrideHeadDraw,
|
||||
BossFd_PostHeadDraw, &this->actor);
|
||||
osSyncPrintf("SK\n");
|
||||
{
|
||||
Vec3f spB0 = { 0.0f, 1700.0f, 7000.0f };
|
||||
Vec3f spA4 = { -1000.0f, 700.0f, 7000.0f };
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
func_80093D84(play->state.gfxCtx);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gVolvagiaManeMaterialDL);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, this->fwork[BFD_MANE_COLOR_CENTER], 0, 255);
|
||||
Matrix_Push();
|
||||
Matrix_MultVec3f(&spB0, &this->centerMane.head);
|
||||
BossFd_DrawMane(globalCtx, this, this->centerMane.pos, this->fireManeRot, this->centerMane.scale, MANE_CENTER);
|
||||
BossFd_DrawMane(play, this, this->centerMane.pos, this->fireManeRot, this->centerMane.scale, MANE_CENTER);
|
||||
Matrix_Pop();
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, this->fwork[BFD_MANE_COLOR_RIGHT], 0, 255);
|
||||
Matrix_Push();
|
||||
Matrix_MultVec3f(&spA4, &this->rightMane.head);
|
||||
BossFd_DrawMane(globalCtx, this, this->rightMane.pos, this->fireManeRot, this->rightMane.scale, MANE_RIGHT);
|
||||
BossFd_DrawMane(play, this, this->rightMane.pos, this->fireManeRot, this->rightMane.scale, MANE_RIGHT);
|
||||
Matrix_Pop();
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, this->fwork[BFD_MANE_COLOR_LEFT], 0, 255);
|
||||
Matrix_Push();
|
||||
spA4.x *= -1.0f;
|
||||
Matrix_MultVec3f(&spA4, &this->leftMane.head);
|
||||
BossFd_DrawMane(globalCtx, this, this->leftMane.pos, this->fireManeRot, this->leftMane.scale, MANE_LEFT);
|
||||
BossFd_DrawMane(play, this, this->leftMane.pos, this->fireManeRot, this->leftMane.scale, MANE_LEFT);
|
||||
Matrix_Pop();
|
||||
}
|
||||
|
||||
Matrix_Pop();
|
||||
osSyncPrintf("END\n");
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_boss_fd.c", 4987);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_boss_fd.c", 4987);
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
struct BossFd;
|
||||
|
||||
typedef void (*BossFdActionFunc)(struct BossFd*, GlobalContext*);
|
||||
typedef void (*BossFdActionFunc)(struct BossFd*, PlayState*);
|
||||
|
||||
typedef enum {
|
||||
/* -1 */ BOSSFD_WAIT_INTRO = -1,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue