1
0
mirror of https://github.com/blawar/ooot.git synced 2024-06-28 07:24:04 +00:00

framerate fixes

This commit is contained in:
Blake Warner 2022-04-08 18:00:42 -04:00
parent 7258c27df1
commit 2da19230d4
14 changed files with 355 additions and 391 deletions

View File

@ -131,6 +131,12 @@ class Timer
typedef Timer Counter;
typedef Timer Rotation;
typedef Timer Position;
typedef Timer TimerU8;
typedef Timer TimerU16;
typedef Timer TimerS16;
typedef Timer TimerS32;
typedef Timer TimerU32;
class Step
{

View File

@ -51,6 +51,8 @@ struct VecRot
Rotation x, y, z;
};
typedef VecRot VecPos;
struct Sphere16
{
Vec3s center;

View File

@ -8,6 +8,7 @@
#include "n64fault.h"
#include "padmgr.h"
#include "speedmeter.h"
#include "state.h"
#include "title_setup.h"
#include "ultra64/sched.h"
#include "ultra64/time.h"
@ -391,6 +392,7 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState)
gameState->running = false;
}
}
static u64 frameCount = 0;
void Graph_ThreadEntry(void* arg0)
{
@ -437,11 +439,15 @@ void Graph_ThreadEntry(void* arg0)
}
else
{
if(gfx_start_frame())
if(oot::state.fastForward == 1 || (frameCount % oot::state.fastForward) == 0)
{
Graph_Update(&gfxCtx, gameState);
gfx_end_frame();
if(gfx_start_frame())
{
Graph_Update(&gfxCtx, gameState);
gfx_end_frame();
}
}
frameCount++;
}
}

View File

@ -329,7 +329,7 @@ void BossGanondrof_SetupIntro(BossGanondrof* pthis, GlobalContext* globalCtx)
{
Animation_PlayLoop(&pthis->skelAnime, &gPhantomGanonRidePoseAnim);
pthis->actionFunc = BossGanondrof_Intro;
pthis->work[GND_MASK_OFF] = true;
pthis->GND_MASK_OFF = true;
}
void BossGanondrof_Intro(BossGanondrof* pthis, GlobalContext* globalCtx)
@ -359,7 +359,7 @@ void BossGanondrof_Intro(BossGanondrof* pthis, GlobalContext* globalCtx)
if(pthis->timers[1] == 20)
{
pthis->work[GND_MASK_OFF] = false;
pthis->GND_MASK_OFF = false;
}
if(pthis->timers[1] == 30)
@ -398,7 +398,7 @@ void BossGanondrof_Intro(BossGanondrof* pthis, GlobalContext* globalCtx)
Animation_MorphToPlayOnce(&pthis->skelAnime, &gPhantomGanonRideSpearResetAnim, -5.0f);
}
switch(pthis->work[GND_EYE_STATE])
switch(pthis->GND_EYE_STATE)
{
case GND_EYESTATE_FADE:
pthis->fwork[GND_EYE_ALPHA] += 40.0f;
@ -417,12 +417,12 @@ void BossGanondrof_Intro(BossGanondrof* pthis, GlobalContext* globalCtx)
break;
}
pthis->armRotY = Math_SinS(pthis->work[GND_VARIANCE_TIMER] * 0x6E8) * 0;
pthis->armRotZ = Math_CosS(pthis->work[GND_VARIANCE_TIMER] * 0x8DC) * 300.0f;
pthis->armRotY = Math_SinS(pthis->GND_VARIANCE_TIMER * 0x6E8) * 0;
pthis->armRotZ = Math_CosS(pthis->GND_VARIANCE_TIMER * 0x8DC) * 300.0f;
for(i = 0; i < 30; i++)
{
pthis->rideRotY[i] = Math_SinS(pthis->work[GND_VARIANCE_TIMER] * ((i * 50) + 0x7B0)) * 100.0f;
pthis->rideRotZ[i] = Math_CosS(pthis->work[GND_VARIANCE_TIMER] * ((i * 50) + 0x8DC)) * 100.0f;
pthis->rideRotY[i] = Math_SinS(pthis->GND_VARIANCE_TIMER * ((i * 50) + 0x7B0)) * 100.0f;
pthis->rideRotZ[i] = Math_CosS(pthis->GND_VARIANCE_TIMER * ((i * 50) + 0x8DC)) * 100.0f;
}
if(horse->bossGndSignal == FHG_START_FIGHT)
@ -548,7 +548,7 @@ void BossGanondrof_Neutral(BossGanondrof* pthis, GlobalContext* globalCtx)
Audio_PlayActorSound2(thisx, NA_SE_EN_FANTOM_LAUGH);
}
}
else if((rand01 < 0.5f) || (pthis->work[GND_THROW_COUNT] < 5))
else if((rand01 < 0.5f) || (pthis->GND_THROW_COUNT < 5))
{
BossGanondrof_SetupThrow(pthis, globalCtx);
}
@ -578,16 +578,16 @@ void BossGanondrof_Neutral(BossGanondrof* pthis, GlobalContext* globalCtx)
}
targetY = playerx->world.pos.y + 100.0f + 0.0f;
targetX += Math_SinS(pthis->work[GND_VARIANCE_TIMER] * 0x500) * 100.0f;
targetZ += Math_CosS(pthis->work[GND_VARIANCE_TIMER] * 0x700) * 100.0f;
targetX += Math_SinS(pthis->GND_VARIANCE_TIMER * 0x500) * 100.0f;
targetZ += Math_CosS(pthis->GND_VARIANCE_TIMER * 0x700) * 100.0f;
break;
case GND_FLY_VOLLEY:
targetX = GND_BOSSROOM_CENTER_X - 14.0f;
targetZ = GND_BOSSROOM_CENTER_Z + 265.0f;
targetY = playerx->world.pos.y + 100.0f + 100.0f;
targetX += Math_SinS(pthis->work[GND_VARIANCE_TIMER] * 0x500) * 100.0f;
targetZ += Math_CosS(pthis->work[GND_VARIANCE_TIMER] * 0x700) * 100.0f;
targetX += Math_SinS(pthis->GND_VARIANCE_TIMER * 0x500) * 100.0f;
targetZ += Math_CosS(pthis->GND_VARIANCE_TIMER * 0x700) * 100.0f;
if(pthis->timers[0] == 0)
{
pthis->flyMode = GND_FLY_RETURN;
@ -601,8 +601,8 @@ void BossGanondrof_Neutral(BossGanondrof* pthis, GlobalContext* globalCtx)
targetZ = GND_BOSSROOM_CENTER_Z + 265.0f;
targetY = playerx->world.pos.y + 100.0f + 100.0f;
targetX += Math_SinS(pthis->work[GND_VARIANCE_TIMER] * 0x500) * 50.0f;
targetZ += Math_CosS(pthis->work[GND_VARIANCE_TIMER] * 0x700) * 50.0f;
targetX += Math_SinS(pthis->GND_VARIANCE_TIMER * 0x500) * 50.0f;
targetZ += Math_CosS(pthis->GND_VARIANCE_TIMER * 0x700) * 50.0f;
if(pthis->returnSuccess)
{
pthis->returnSuccess = false;
@ -620,8 +620,8 @@ void BossGanondrof_Neutral(BossGanondrof* pthis, GlobalContext* globalCtx)
targetZ = GND_BOSSROOM_CENTER_Z + 215.0f;
targetY = playerx->world.pos.y + 100.0f + 50.0f;
targetX += Math_SinS(pthis->work[GND_VARIANCE_TIMER] * 0x500) * 100.0f;
targetZ += Math_CosS(pthis->work[GND_VARIANCE_TIMER] * 0x700) * 100.0f;
targetX += Math_SinS(pthis->GND_VARIANCE_TIMER * 0x500) * 100.0f;
targetZ += Math_CosS(pthis->GND_VARIANCE_TIMER * 0x700) * 100.0f;
if(pthis->timers[0] == 0)
{
BossGanondrof_SetupCharge(pthis, globalCtx);
@ -643,9 +643,9 @@ void BossGanondrof_Neutral(BossGanondrof* pthis, GlobalContext* globalCtx)
Math_ApproachF(&pthis->fwork[GND_FLOAT_SPEED], 50.0f, 1.0f, 0.5f);
thisx->velocity.x = thisx->world.pos.x - thisx->prevPos.x;
thisx->velocity.z = thisx->world.pos.z - thisx->prevPos.z;
thisx->world.pos.y += 2.0f * Math_SinS(pthis->work[GND_VARIANCE_TIMER] * 1500);
thisx->world.pos.y += 2.0f * Math_SinS(pthis->GND_VARIANCE_TIMER * 1500);
Math_ApproachS(&thisx->shape.rot.y, thisx->yawTowardsPlayer, 5, 0xBB8);
if((pthis->work[GND_VARIANCE_TIMER] & 1) == 0)
if((pthis->GND_VARIANCE_TIMER & 1) == 0)
{
Vec3f pos;
Vec3f vel = {0.0f, 0.0f, 0.0f};
@ -677,23 +677,23 @@ void BossGanondrof_SetupThrow(BossGanondrof* pthis, GlobalContext* globalCtx)
pthis->fwork[GND_END_FRAME] = Animation_GetLastFrame(&gPhantomGanonThrowAnim);
Animation_MorphToPlayOnce(&pthis->skelAnime, &gPhantomGanonThrowAnim, -5.0f);
pthis->actionFunc = BossGanondrof_Throw;
if((Rand_ZeroOne() <= 0.1f) && (pthis->work[GND_THROW_COUNT] >= 10) && (pthis->flyMode == GND_FLY_NEUTRAL))
if((Rand_ZeroOne() <= 0.1f) && (pthis->GND_THROW_COUNT >= 10) && (pthis->flyMode == GND_FLY_NEUTRAL))
{
pthis->work[GND_ACTION_STATE] = THROW_SLOW;
pthis->work[GND_THROW_FRAME] = 1000;
pthis->GND_ACTION_STATE = THROW_SLOW;
pthis->GND_THROW_FRAME = 1000;
lightTime = 32;
}
else
{
pthis->work[GND_ACTION_STATE] = THROW_NORMAL;
pthis->work[GND_THROW_FRAME] = 25;
pthis->GND_ACTION_STATE = THROW_NORMAL;
pthis->GND_THROW_FRAME = 25;
lightTime = 25;
}
horseTemp = (EnfHG*)pthis->actor.child;
Actor_SpawnAsChild(&globalCtx->actorCtx, &pthis->actor, globalCtx, ACTOR_EN_FHG_FIRE, pthis->spearTip.x, pthis->spearTip.y, pthis->spearTip.z, lightTime, FHGFIRE_LIGHT_GREEN, 0, FHGFIRE_SPEAR_LIGHT);
pthis->actor.child = &horseTemp->actor;
pthis->work[GND_THROW_COUNT]++;
pthis->GND_THROW_COUNT++;
Audio_PlayActorSound2(&pthis->actor, NA_SE_EN_FANTOM_STICK);
}
@ -701,20 +701,20 @@ void BossGanondrof_Throw(BossGanondrof* pthis, GlobalContext* globalCtx)
{
SkelAnime_Update(&pthis->skelAnime);
osSyncPrintf("pthis->fwork[GND_END_FRAME] = %d\n", (s16)pthis->fwork[GND_END_FRAME]);
osSyncPrintf("pthis->work[GND_SHOT_FRAME] = %d\n", pthis->work[GND_THROW_FRAME]);
osSyncPrintf("pthis->GND_SHOT_FRAME = %d\n", pthis->GND_THROW_FRAME);
if(Animation_OnFrame(&pthis->skelAnime, pthis->fwork[GND_END_FRAME]))
{
BossGanondrof_SetupNeutral(pthis, -6.0f);
}
if((pthis->work[GND_ACTION_STATE] != THROW_NORMAL) && Animation_OnFrame(&pthis->skelAnime, 21.0f))
if((pthis->GND_ACTION_STATE != THROW_NORMAL) && Animation_OnFrame(&pthis->skelAnime, 21.0f))
{
pthis->fwork[GND_END_FRAME] = Animation_GetLastFrame(&gPhantomGanonThrowEndAnim);
Animation_MorphToPlayOnce(&pthis->skelAnime, &gPhantomGanonThrowEndAnim, 0.0f);
pthis->work[GND_THROW_FRAME] = 10;
pthis->GND_THROW_FRAME = 10;
}
if(Animation_OnFrame(&pthis->skelAnime, pthis->work[GND_THROW_FRAME]))
if(Animation_OnFrame(&pthis->skelAnime, pthis->GND_THROW_FRAME))
{
if(pthis->flyMode <= GND_FLY_NEUTRAL)
{
@ -728,11 +728,11 @@ void BossGanondrof_Throw(BossGanondrof* pthis, GlobalContext* globalCtx)
Audio_PlayActorSound2(&pthis->actor, NA_SE_EN_FANTOM_VOICE);
}
if(Animation_OnFrame(&pthis->skelAnime, pthis->work[GND_THROW_FRAME]))
if(Animation_OnFrame(&pthis->skelAnime, pthis->GND_THROW_FRAME))
{
EnfHG* horseTemp = (EnfHG*)pthis->actor.child;
Actor_SpawnAsChild(&globalCtx->actorCtx, &pthis->actor, globalCtx, ACTOR_EN_FHG_FIRE, pthis->spearTip.x, pthis->spearTip.y, pthis->spearTip.z, pthis->work[GND_ACTION_STATE], 0, 0, FHGFIRE_ENERGY_BALL);
Actor_SpawnAsChild(&globalCtx->actorCtx, &pthis->actor, globalCtx, ACTOR_EN_FHG_FIRE, pthis->spearTip.x, pthis->spearTip.y, pthis->spearTip.z, pthis->GND_ACTION_STATE, 0, 0, FHGFIRE_ENERGY_BALL);
pthis->actor.child = &horseTemp->actor;
}
@ -741,7 +741,7 @@ void BossGanondrof_Throw(BossGanondrof* pthis, GlobalContext* globalCtx)
pthis->actor.world.pos.z += pthis->actor.velocity.z;
Math_ApproachZeroF(&pthis->actor.velocity.x, 1.0f, 0.5f);
Math_ApproachZeroF(&pthis->actor.velocity.z, 1.0f, 0.5f);
pthis->actor.world.pos.y += 2.0f * Math_SinS(pthis->work[GND_VARIANCE_TIMER] * 1500);
pthis->actor.world.pos.y += 2.0f * Math_SinS(pthis->GND_VARIANCE_TIMER * 1500);
}
void BossGanondrof_SetupReturn(BossGanondrof* pthis, GlobalContext* globalCtx)
@ -772,7 +772,7 @@ void BossGanondrof_Return(BossGanondrof* pthis, GlobalContext* globalCtx)
pthis->actor.world.pos.z += pthis->actor.velocity.z;
Math_ApproachZeroF(&pthis->actor.velocity.x, 1.0f, 0.5f);
Math_ApproachZeroF(&pthis->actor.velocity.z, 1.0f, 0.5f);
pthis->actor.world.pos.y += 2.0f * Math_SinS(pthis->work[GND_VARIANCE_TIMER] * 1500);
pthis->actor.world.pos.y += 2.0f * Math_SinS(pthis->GND_VARIANCE_TIMER * 1500);
if(pthis->returnSuccess)
{
pthis->returnSuccess = false;
@ -797,7 +797,7 @@ void BossGanondrof_SetupStunned(BossGanondrof* pthis, GlobalContext* globalCtx)
}
pthis->actionFunc = BossGanondrof_Stunned;
pthis->work[GND_ACTION_STATE] = STUNNED_FALL;
pthis->GND_ACTION_STATE = STUNNED_FALL;
pthis->actor.velocity.x = 0.0f;
pthis->actor.velocity.z = 0.0f;
}
@ -809,11 +809,11 @@ void BossGanondrof_Stunned(BossGanondrof* pthis, GlobalContext* globalCtx)
pthis->actor.gravity = -0.2f;
if(pthis->actor.world.pos.y <= 5.0f)
{
if(pthis->work[GND_ACTION_STATE] == STUNNED_FALL)
if(pthis->GND_ACTION_STATE == STUNNED_FALL)
{
pthis->fwork[GND_END_FRAME] = Animation_GetLastFrame(&gPhantomGanonStunnedAnim);
Animation_MorphToLoop(&pthis->skelAnime, &gPhantomGanonStunnedAnim, -10.0f);
pthis->work[GND_ACTION_STATE] = STUNNED_GROUND;
pthis->GND_ACTION_STATE = STUNNED_GROUND;
}
pthis->actor.velocity.y = 0.0f;
@ -857,7 +857,7 @@ void BossGanondrof_Block(BossGanondrof* pthis, GlobalContext* globalCtx)
pthis->actor.world.pos.z += pthis->actor.velocity.z;
Math_ApproachZeroF(&pthis->actor.velocity.x, 1.0f, 0.5f);
Math_ApproachZeroF(&pthis->actor.velocity.z, 1.0f, 0.5f);
pthis->actor.world.pos.y += 2.0f * Math_SinS(pthis->work[GND_VARIANCE_TIMER] * 1500);
pthis->actor.world.pos.y += 2.0f * Math_SinS(pthis->GND_VARIANCE_TIMER * 1500);
if(pthis->timers[0] == 0)
{
BossGanondrof_SetupNeutral(pthis, -5.0f);
@ -872,7 +872,7 @@ void BossGanondrof_SetupCharge(BossGanondrof* pthis, GlobalContext* globalCtx)
Animation_MorphToLoop(&pthis->skelAnime, &gPhantomGanonChargeWindupAnim, -3.0f);
pthis->actionFunc = BossGanondrof_Charge;
pthis->timers[0] = 20;
pthis->work[GND_ACTION_STATE] = CHARGE_WINDUP;
pthis->GND_ACTION_STATE = CHARGE_WINDUP;
}
void BossGanondrof_Charge(BossGanondrof* pthis, GlobalContext* globalCtx)
@ -885,7 +885,7 @@ void BossGanondrof_Charge(BossGanondrof* pthis, GlobalContext* globalCtx)
pthis->colliderBody.base.colType = COLTYPE_METAL;
SkelAnime_Update(&pthis->skelAnime);
switch(pthis->work[GND_ACTION_STATE])
switch(pthis->GND_ACTION_STATE)
{
case CHARGE_WINDUP:
if(pthis->timers[0] == 218)
@ -904,7 +904,7 @@ void BossGanondrof_Charge(BossGanondrof* pthis, GlobalContext* globalCtx)
Math_ApproachZeroF(&thisx->velocity.z, 1.0f, 0.5f);
if(pthis->timers[0] == 0)
{
pthis->work[GND_ACTION_STATE] = CHARGE_START;
pthis->GND_ACTION_STATE = CHARGE_START;
pthis->timers[0] = 10;
thisx->speedXZ = 0.0f;
pthis->fwork[GND_END_FRAME] = Animation_GetLastFrame(&gPhantomGanonChargeStartAnim);
@ -918,7 +918,7 @@ void BossGanondrof_Charge(BossGanondrof* pthis, GlobalContext* globalCtx)
{
pthis->fwork[GND_END_FRAME] = Animation_GetLastFrame(&gPhantomGanonChargeAnim);
Animation_MorphToLoop(&pthis->skelAnime, &gPhantomGanonChargeAnim, 0.0f);
pthis->work[GND_ACTION_STATE] = CHARGE_ATTACK;
pthis->GND_ACTION_STATE = CHARGE_ATTACK;
}
case CHARGE_ATTACK:
if(pthis->timers[0] != 0)
@ -938,7 +938,7 @@ void BossGanondrof_Charge(BossGanondrof* pthis, GlobalContext* globalCtx)
Math_ApproachF(&thisx->speedXZ, 10.0f, 1.0f, 0.5f);
if((sqrtf(SQ(dxCenter) + SQ(dzCenter)) > 280.0f) || (thisx->xyzDistToPlayerSq < SQ(100.0f)))
{
pthis->work[GND_ACTION_STATE] = CHARGE_FINISH;
pthis->GND_ACTION_STATE = CHARGE_FINISH;
pthis->timers[0] = 20;
}
break;
@ -975,7 +975,7 @@ void BossGanondrof_Charge(BossGanondrof* pthis, GlobalContext* globalCtx)
if(thisx->world.pos.y > (GND_BOSSROOM_CENTER_Y + 83.0f))
{
thisx->world.pos.y += 2.0f * Math_SinS(pthis->work[GND_VARIANCE_TIMER] * 1500);
thisx->world.pos.y += 2.0f * Math_SinS(pthis->GND_VARIANCE_TIMER * 1500);
}
{
s16 i;
@ -991,7 +991,7 @@ void BossGanondrof_Charge(BossGanondrof* pthis, GlobalContext* globalCtx)
Matrix_Push();
Matrix_RotateY((thisx->shape.rot.y / (f32)0x8000) * M_PI, MTXMODE_NEW);
Matrix_RotateX((thisx->shape.rot.x / (f32)0x8000) * M_PI, MTXMODE_APPLY);
Matrix_RotateZ((pthis->work[GND_PARTICLE_ANGLE] / (f32)0x8000) * M_PI, MTXMODE_APPLY);
Matrix_RotateZ((pthis->GND_PARTICLE_ANGLE / (f32)0x8000) * M_PI, MTXMODE_APPLY);
Matrix_MultVec3f(&baseOffset, &offset);
Matrix_Pop();
pos.x = pthis->spearTip.x + offset.x;
@ -1004,11 +1004,11 @@ void BossGanondrof_Charge(BossGanondrof* pthis, GlobalContext* globalCtx)
accel.y = (offset.y * -50.0f) / 1000.0f;
accel.z = (offset.z * -50.0f) / 1000.0f;
EffectSsFhgFlash_SpawnLightBall(globalCtx, &pos, &vel, &accel, 150, i % 7);
pthis->work[GND_PARTICLE_ANGLE] += 0x1A5C;
pthis->GND_PARTICLE_ANGLE += 0x1A5C;
}
}
if(!(pthis->work[GND_VARIANCE_TIMER] & 7))
if(!(pthis->GND_VARIANCE_TIMER & 7))
{
EnfHG* horse = (EnfHG*)thisx->child;
@ -1026,7 +1026,7 @@ void BossGanondrof_SetupDeath(BossGanondrof* pthis, GlobalContext* globalCtx)
Audio_PlayActorSound2(&pthis->actor, NA_SE_EN_FANTOM_DEAD);
pthis->deathState = DEATH_START;
pthis->actor.flags &= ~ACTOR_FLAG_0;
pthis->work[GND_VARIANCE_TIMER] = 0;
pthis->GND_VARIANCE_TIMER = 0;
pthis->shockTimer = 50;
}
@ -1042,8 +1042,8 @@ void BossGanondrof_Death(BossGanondrof* pthis, GlobalContext* globalCtx)
osSyncPrintf("PYP %f\n", player->actor.floorHeight);
SkelAnime_Update(&pthis->skelAnime);
pthis->work[GND_DEATH_SFX_TIMER]++;
if(((60 < pthis->work[GND_DEATH_SFX_TIMER]) && (pthis->work[GND_DEATH_SFX_TIMER] < 500)) || ((501 < pthis->work[GND_DEATH_SFX_TIMER]) && (pthis->work[GND_DEATH_SFX_TIMER] < 620)))
pthis->GND_DEATH_SFX_TIMER++;
if(((60 < pthis->GND_DEATH_SFX_TIMER) && (pthis->GND_DEATH_SFX_TIMER < 500)) || ((501 < pthis->GND_DEATH_SFX_TIMER) && (pthis->GND_DEATH_SFX_TIMER < 620)))
{
Audio_PlayActorSound2(&pthis->actor, NA_SE_EN_GOMA_LAST - SFX_FLAG);
}
@ -1077,20 +1077,20 @@ void BossGanondrof_Death(BossGanondrof* pthis, GlobalContext* globalCtx)
pthis->cameraAtVel.z = fabsf(camera->at.z - pthis->cameraNextAt.z);
pthis->cameraAccel = 0.02f;
pthis->cameraEyeMaxVel.x = pthis->cameraEyeMaxVel.y = pthis->cameraEyeMaxVel.z = 0.05f;
pthis->work[GND_ACTION_STATE] = DEATH_SPASM;
pthis->GND_ACTION_STATE = DEATH_SPASM;
pthis->timers[0] = 150;
pthis->cameraAtMaxVel.x = 0.2f;
pthis->cameraAtMaxVel.y = 0.2f;
pthis->cameraAtMaxVel.z = 0.2f;
case DEATH_THROES:
switch(pthis->work[GND_ACTION_STATE])
switch(pthis->GND_ACTION_STATE)
{
case DEATH_SPASM:
if(Animation_OnFrame(&pthis->skelAnime, pthis->fwork[GND_END_FRAME]))
{
pthis->fwork[GND_END_FRAME] = Animation_GetLastFrame(&gPhantomGanonAirDamageAnim);
Animation_Change(&pthis->skelAnime, &gPhantomGanonAirDamageAnim, 0.5f, 0.0f, pthis->fwork[GND_END_FRAME], ANIMMODE_ONCE_INTERP, 0.0f);
pthis->work[GND_ACTION_STATE] = DEATH_LIMP;
pthis->GND_ACTION_STATE = DEATH_LIMP;
}
break;
case DEATH_LIMP:
@ -1098,16 +1098,16 @@ void BossGanondrof_Death(BossGanondrof* pthis, GlobalContext* globalCtx)
{
pthis->fwork[GND_END_FRAME] = Animation_GetLastFrame(&gPhantomGanonLimpAnim);
Animation_MorphToLoop(&pthis->skelAnime, &gPhantomGanonLimpAnim, -20.0f);
pthis->work[GND_ACTION_STATE] = DEATH_HUNCHED;
pthis->GND_ACTION_STATE = DEATH_HUNCHED;
}
case DEATH_HUNCHED:
bodyDecayLevel = 1;
break;
}
Math_ApproachS(&pthis->actor.shape.rot.y, pthis->work[GND_VARIANCE_TIMER] * -100, 5, 0xBB8);
Math_ApproachS(&pthis->actor.shape.rot.y, pthis->GND_VARIANCE_TIMER * -100, 5, 0xBB8);
Math_ApproachF(&pthis->cameraNextEye.z, pthis->targetPos.z + 60.0f, 0.02f, 0.5f);
Math_ApproachF(&pthis->actor.world.pos.y, GND_BOSSROOM_CENTER_Y + 133.0f, 0.05f, 100.0f);
pthis->actor.world.pos.y += Math_SinS(pthis->work[GND_VARIANCE_TIMER] * 1500);
pthis->actor.world.pos.y += Math_SinS(pthis->GND_VARIANCE_TIMER * 1500);
pthis->cameraNextAt.x = pthis->targetPos.x;
pthis->cameraNextAt.y = pthis->targetPos.y - 10.0f;
pthis->cameraNextAt.z = pthis->targetPos.z;
@ -1135,7 +1135,7 @@ void BossGanondrof_Death(BossGanondrof* pthis, GlobalContext* globalCtx)
}
pthis->actor.shape.rot.y -= 0xC8;
pthis->actor.world.pos.y += Math_SinS(pthis->work[GND_VARIANCE_TIMER] * 1500);
pthis->actor.world.pos.y += Math_SinS(pthis->GND_VARIANCE_TIMER * 1500);
pthis->fwork[GND_CAMERA_ANGLE] += 0x78;
camX = Math_SinS(pthis->fwork[GND_CAMERA_ANGLE]) * pthis->fwork[GND_CAMERA_ZOOM];
camZ = Math_CosS(pthis->fwork[GND_CAMERA_ANGLE]) * pthis->fwork[GND_CAMERA_ZOOM];
@ -1159,7 +1159,7 @@ void BossGanondrof_Death(BossGanondrof* pthis, GlobalContext* globalCtx)
pthis->actor.world.pos.y = GND_BOSSROOM_CENTER_Y + 83.0f;
pthis->actor.world.pos.z = GND_BOSSROOM_CENTER_Z;
pthis->actor.shape.rot.y = 0;
pthis->work[GND_BODY_DECAY_INDEX] = 0;
pthis->GND_BODY_DECAY_INDEX = 0;
Audio_PlayActorSound2(&pthis->actor, NA_SE_EN_FANTOM_LAST);
}
@ -1180,7 +1180,7 @@ void BossGanondrof_Death(BossGanondrof* pthis, GlobalContext* globalCtx)
{
pthis->deathState = DEATH_DISINTEGRATE;
Animation_MorphToPlayOnce(&pthis->skelAnime, &gPhantomGanonLastPoseAnim, -10.0f);
pthis->work[GND_BODY_DECAY_INDEX] = 0;
pthis->GND_BODY_DECAY_INDEX = 0;
pthis->timers[0] = 40;
}
break;
@ -1242,31 +1242,31 @@ void BossGanondrof_Death(BossGanondrof* pthis, GlobalContext* globalCtx)
vel.z = pthis->actor.world.pos.z - pthis->actor.prevPos.z;
if(bodyDecayLevel < 10)
{
if(pthis->work[GND_DEATH_ENV_TIMER] == 0)
if(pthis->GND_DEATH_ENV_TIMER == 0)
{
if(globalCtx->envCtx.unk_BF == 0)
{
globalCtx->envCtx.unk_BF = 3;
pthis->work[GND_DEATH_ENV_TIMER] = (s16)Rand_ZeroFloat(5.0f) + 4.0f;
pthis->GND_DEATH_ENV_TIMER = (s16)Rand_ZeroFloat(5.0f) + 4.0f;
globalCtx->envCtx.unk_D6 = 0x28;
}
else
{
globalCtx->envCtx.unk_BF = 0;
pthis->work[GND_DEATH_ENV_TIMER] = (s16)Rand_ZeroFloat(2.0f) + 2.0f;
pthis->GND_DEATH_ENV_TIMER = (s16)Rand_ZeroFloat(2.0f) + 2.0f;
globalCtx->envCtx.unk_D6 = 0x14;
}
}
else
{
pthis->work[GND_DEATH_ENV_TIMER]--;
pthis->GND_DEATH_ENV_TIMER--;
}
for(i = 0; i <= 0; i++)
{
limbDecayIndex = pthis->work[GND_LIMB_DECAY_INDEX];
pthis->work[GND_LIMB_DECAY_INDEX]++;
pthis->work[GND_LIMB_DECAY_INDEX] %= 25;
limbDecayIndex = pthis->GND_LIMB_DECAY_INDEX;
pthis->GND_LIMB_DECAY_INDEX++;
pthis->GND_LIMB_DECAY_INDEX %= 25;
pos.x = pthis->bodyPartsPos[limbDecayIndex].x + Rand_CenteredFloat(5.0f);
pos.y = pthis->bodyPartsPos[limbDecayIndex].y + Rand_CenteredFloat(5.0f);
pos.z = pthis->bodyPartsPos[limbDecayIndex].z + Rand_CenteredFloat(5.0f);
@ -1295,25 +1295,25 @@ void BossGanondrof_Death(BossGanondrof* pthis, GlobalContext* globalCtx)
globalCtx->envCtx.unk_D6 = 0x14;
}
pthis->work[GND_BODY_DECAY_FLAG] = true;
pthis->GND_BODY_DECAY_FLAG = true;
for(i = 0; i < 5; i++)
{
if(bodyDecayLevel == 1)
{
BossGanondrof_ClearPixels(sDecayMaskLow, pthis->work[GND_BODY_DECAY_INDEX]);
BossGanondrof_ClearPixels(sDecayMaskLow, pthis->GND_BODY_DECAY_INDEX);
}
else if(bodyDecayLevel == 2)
{
BossGanondrof_ClearPixels(sDecayMaskHigh, pthis->work[GND_BODY_DECAY_INDEX]);
BossGanondrof_ClearPixels(sDecayMaskHigh, pthis->GND_BODY_DECAY_INDEX);
}
else
{
BossGanondrof_ClearPixels(sDecayMaskTotal, pthis->work[GND_BODY_DECAY_INDEX]);
BossGanondrof_ClearPixels(sDecayMaskTotal, pthis->GND_BODY_DECAY_INDEX);
}
if(pthis->work[GND_BODY_DECAY_INDEX] < 0x100)
if(pthis->GND_BODY_DECAY_INDEX < 0x100)
{
pthis->work[GND_BODY_DECAY_INDEX]++;
pthis->GND_BODY_DECAY_INDEX++;
}
}
}
@ -1341,9 +1341,9 @@ void BossGanondrof_CollisionCheck(BossGanondrof* pthis, GlobalContext* globalCtx
EnfHG* horse = (EnfHG*)pthis->actor.child;
ColliderInfo* hurtbox = NULL;
if(pthis->work[GND_INVINC_TIMER] != 0)
if(pthis->GND_INVINC_TIMER != 0)
{
pthis->work[GND_INVINC_TIMER]--;
pthis->GND_INVINC_TIMER--;
pthis->returnCount = 0;
pthis->colliderBody.base.acFlags &= ~AC_HIT;
}
@ -1395,7 +1395,7 @@ void BossGanondrof_CollisionCheck(BossGanondrof* pthis, GlobalContext* globalCtx
{
pthis->timers[0] = 120;
}
pthis->work[GND_INVINC_TIMER] = 10;
pthis->GND_INVINC_TIMER = 10;
horse->hitTimer = 20;
Audio_PlayActorSound2(&pthis->actor, NA_SE_EN_FANTOM_DAMAGE);
}
@ -1406,7 +1406,7 @@ void BossGanondrof_CollisionCheck(BossGanondrof* pthis, GlobalContext* globalCtx
}
else if(acHit && (hurtbox->toucher.dmgFlags & 0x0001F8A4))
{
pthis->work[GND_INVINC_TIMER] = 10;
pthis->GND_INVINC_TIMER = 10;
pthis->actor.colChkInfo.health -= 2;
horse->hitTimer = 20;
Audio_PlayActorSound2(&pthis->actor, NA_SE_EN_FANTOM_DAMAGE);
@ -1437,7 +1437,7 @@ void BossGanondrof_Update(Actor* thisx, GlobalContext* globalCtx)
Actor_Kill(&pthis->actor);
return;
}
pthis->work[GND_VARIANCE_TIMER]++;
pthis->GND_VARIANCE_TIMER++;
horse = (EnfHG*)pthis->actor.child;
osSyncPrintf("MOVE START EEEEEEEEEEEEEEEEEEEEEE%d\n", pthis->actor.params);
@ -1450,13 +1450,13 @@ void BossGanondrof_Update(Actor* thisx, GlobalContext* globalCtx)
pthis->timers[i]--;
}
}
if(pthis->work[GND_UNKTIMER_1])
if(pthis->GND_UNKTIMER_1)
{
pthis->work[GND_UNKTIMER_1]--;
pthis->GND_UNKTIMER_1--;
}
if(pthis->work[GND_UNKTIMER_2])
if(pthis->GND_UNKTIMER_2)
{
pthis->work[GND_UNKTIMER_2]--;
pthis->GND_UNKTIMER_2--;
}
if(pthis->actionFunc != BossGanondrof_Death)
@ -1497,7 +1497,7 @@ void BossGanondrof_Update(Actor* thisx, GlobalContext* globalCtx)
Math_ApproachF(&pthis->legRotZ, legRotTargetZ, 1.0f, 600.0f);
if((pthis->flyMode != GND_FLY_PAINTING) && (pthis->actionFunc != BossGanondrof_Stunned) && (pthis->deathState == NOT_DEAD))
{
legSplitTarget = (Math_SinS(pthis->work[GND_VARIANCE_TIMER] * 0x8DC) * -500.0f) - 500.0f;
legSplitTarget = (Math_SinS(pthis->GND_VARIANCE_TIMER * 0x8DC) * -500.0f) - 500.0f;
}
else
{
@ -1532,7 +1532,7 @@ s32 BossGanondrof_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx*
switch(limbIndex)
{
case 15:
if((pthis->actionFunc == BossGanondrof_Intro) && pthis->work[GND_MASK_OFF])
if((pthis->actionFunc == BossGanondrof_Intro) && pthis->GND_MASK_OFF)
{
*dList = gPhantomGanonFaceDL;
}
@ -1656,7 +1656,7 @@ void BossGanondrof_Draw(Actor* thisx, GlobalContext* globalCtx)
osSyncPrintf("YP %f\n", pthis->actor.world.pos.y);
func_80093D18(globalCtx->state.gfxCtx);
if(pthis->work[GND_INVINC_TIMER] & 4)
if(pthis->GND_INVINC_TIMER & 4)
{
POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 255, 50, 0, 0, 900, 1099);
}
@ -1668,7 +1668,7 @@ void BossGanondrof_Draw(Actor* thisx, GlobalContext* globalCtx)
osSyncPrintf("DRAW 11\n");
osSyncPrintf("EYE_COL %d\n", (s16)pthis->fwork[GND_EYE_BRIGHTNESS]);
gDPSetEnvColor(POLY_OPA_DISP++, (s16)pthis->fwork[GND_EYE_BRIGHTNESS], (s16)pthis->fwork[GND_EYE_BRIGHTNESS], (s16)pthis->fwork[GND_EYE_BRIGHTNESS], (s16)pthis->fwork[GND_EYE_ALPHA]);
if(pthis->work[GND_BODY_DECAY_FLAG])
if(pthis->GND_BODY_DECAY_FLAG)
{
gSPSegment(POLY_OPA_DISP++, 0x08, BossGanondrof_GetClearPixelDList(globalCtx->state.gfxCtx));
}

View File

@ -31,29 +31,6 @@ enum BossGanondrofEyeState
/* 2 */ GND_EYESTATE_BRIGHTEN
};
enum BossGanondrofS16Var
{
/* 0 */ GND_VARIANCE_TIMER,
/* 1 */ GND_US_1,
/* 2 */ GND_US_2,
/* 3 */ GND_US_3,
/* 4 */ GND_UNKTIMER_1,
/* 5 */ GND_UNKTIMER_2,
/* 6 */ GND_INVINC_TIMER,
/* 7 */ GND_ACTION_STATE,
/* 8 */ GND_THROW_FRAME,
/* 9 */ GND_THROW_COUNT,
/* 10 */ GND_MASK_OFF,
/* 11 */ GND_EYE_STATE,
/* 12 */ GND_PARTICLE_ANGLE,
/* 13 */ GND_BODY_DECAY_INDEX,
/* 14 */ GND_BODY_DECAY_FLAG,
/* 15 */ GND_LIMB_DECAY_INDEX,
/* 16 */ GND_DEATH_ENV_TIMER,
/* 17 */ GND_DEATH_SFX_TIMER,
/* 20 */ GND_SHORT_COUNT = 20
};
enum BossGanondrofF32Var
{
/* 0 */ GND_FLOAT_SPEED,
@ -107,11 +84,28 @@ struct BossGanondrof
/* 0x0000 */ Actor actor;
/* 0x014C */ SkelAnime skelAnime;
/* 0x0190 */ BossGanondrofActionFunc actionFunc;
/* 0x0194 */ s16 work[GND_SHORT_COUNT];
Timer GND_VARIANCE_TIMER;
s16 GND_US_1;
s16 GND_US_2;
s16 GND_US_3;
Timer GND_UNKTIMER_1;
Timer GND_UNKTIMER_2;
Timer GND_INVINC_TIMER;
s16 GND_ACTION_STATE;
s16 GND_THROW_FRAME;
s16 GND_THROW_COUNT;
s16 GND_MASK_OFF;
s16 GND_EYE_STATE;
Rotation GND_PARTICLE_ANGLE;
s16 GND_BODY_DECAY_INDEX;
s16 GND_BODY_DECAY_FLAG;
s16 GND_LIMB_DECAY_INDEX;
Timer GND_DEATH_ENV_TIMER;
Timer GND_DEATH_SFX_TIMER;
/* 0x01BC */ Timer timers[5];
/* 0x01C6 */ u8 killActor;
/* 0x01C7 */ u8 returnCount;
/* 0x01C8 */ u8 shockTimer;
/* 0x01C8 */ TimerU8 shockTimer;
/* 0x01C9 */ u8 flyMode;
/* 0x01CA */ u8 returnSuccess;
/* 0x01CC */ f32 fwork[GND_FLOAT_COUNT];

View File

@ -58,7 +58,7 @@ struct BossSst
/* 0x0195 */ s8 ready;
/* 0x0196 */ u8 effectMode;
/* 0x0198 */ Timer timer;
/* 0x019A */ s16 handAngSpeed;
/* 0x019A */ Counter handAngSpeed;
/* 0x019C */ s16 handMaxSpeed;
/* 0x019E */ s16 handZPosMod;
/* 0x01A0 */ s16 handYRotMod;

View File

@ -158,35 +158,35 @@ void func_809B5268(EnAttackNiw* pthis, GlobalContext* globalCtx, s16 arg2)
if(pthis->unk_288 != pthis->unk_2C0)
{
Math_ApproachF(&pthis->unk_2C0, pthis->unk_288, 0.5f, 4000.0f);
Math_ApproachF(&pthis->unk_2C0, pthis->unk_288, 0.5f, 4000.0f * FRAMERATE_SCALER);
}
if(pthis->unk_264 != pthis->unk_2BC)
{
Math_ApproachF(&pthis->unk_2BC, pthis->unk_264, 0.5f, 4000.0f);
Math_ApproachF(&pthis->unk_2BC, pthis->unk_264, 0.5f, 4000.0f * FRAMERATE_SCALER);
}
if(pthis->unk_26C != pthis->unk_2A4.x)
{
Math_ApproachF(&pthis->unk_2A4.x, pthis->unk_26C, 0.8f, 7000.0f);
Math_ApproachF(&pthis->unk_2A4.x, pthis->unk_26C, 0.8f, 7000.0f * FRAMERATE_SCALER);
}
if(pthis->unk_280 != pthis->unk_2A4.y)
{
Math_ApproachF(&pthis->unk_2A4.y, pthis->unk_280, 0.8f, 7000.0f);
Math_ApproachF(&pthis->unk_2A4.y, pthis->unk_280, 0.8f, 7000.0f * FRAMERATE_SCALER);
}
if(pthis->unk_284 != pthis->unk_2A4.z)
{
Math_ApproachF(&pthis->unk_2A4.z, pthis->unk_284, 0.8f, 7000.0f);
Math_ApproachF(&pthis->unk_2A4.z, pthis->unk_284, 0.8f, 7000.0f * FRAMERATE_SCALER);
}
if(pthis->unk_268 != pthis->unk_2B0.x)
{
Math_ApproachF(&pthis->unk_2B0.x, pthis->unk_268, 0.8f, 7000.0f);
Math_ApproachF(&pthis->unk_2B0.x, pthis->unk_268, 0.8f, 7000.0f * FRAMERATE_SCALER);
}
if(pthis->unk_278 != pthis->unk_2B0.y)
{
Math_ApproachF(&pthis->unk_2B0.y, pthis->unk_278, 0.8f, 7000.0f);
Math_ApproachF(&pthis->unk_2B0.y, pthis->unk_278, 0.8f, 7000.0f * FRAMERATE_SCALER);
}
if(pthis->unk_27C != pthis->unk_2B0.z)
{
Math_ApproachF(&pthis->unk_2B0.z, pthis->unk_27C, 0.8f, 7000.0f);
Math_ApproachF(&pthis->unk_2B0.z, pthis->unk_27C, 0.8f, 7000.0f * FRAMERATE_SCALER);
}
}

View File

@ -15,14 +15,14 @@ struct EnAttackNiw
/* 0x0190 */ Vec3s jointTable[16];
/* 0x01F0 */ Vec3s morphTable[16];
/* 0x0250 */ EnAttackNiwActionFunc actionFunc;
/* 0x0254 */ s16 unk_254;
/* 0x0254 */ Timer unk_254;
/* 0x0256 */ s16 unk_256;
/* 0x0258 */ s16 unk_258;
/* 0x025A */ s16 unk_25A;
/* 0x025C */ s16 unk_25C;
/* 0x025E */ s16 unk_25E;
/* 0x0260 */ s16 unk_260;
/* 0x0262 */ s16 unk_262;
/* 0x0258 */ Timer unk_258;
/* 0x025A */ Timer unk_25A;
/* 0x025C */ Timer unk_25C;
/* 0x025E */ Timer unk_25E;
/* 0x0260 */ Timer unk_260;
/* 0x0262 */ Timer unk_262;
/* 0x0264 */ f32 unk_264;
/* 0x0268 */ f32 unk_268;
/* 0x026C */ f32 unk_26C;

View File

@ -155,12 +155,12 @@ void EnGoroiwa_SetSpeed(EnGoroiwa* pthis, GlobalContext* globalCtx)
if(globalCtx->sceneNum == SCENE_SPOT04)
{
pthis->isInKokiri = true;
R_EN_GOROIWA_SPEED = 920;
R_EN_GOROIWA_SPEED = 920 * FRAMERATE_SCALER;
}
else
{
pthis->isInKokiri = false;
R_EN_GOROIWA_SPEED = 1000;
R_EN_GOROIWA_SPEED = 1000 * FRAMERATE_SCALER;
}
}

View File

@ -30,19 +30,19 @@ void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx);
void EnNiw_Draw(Actor* thisx, GlobalContext* globalCtx);
void EnNiw_ResetAction(EnNiw* pthis, GlobalContext* globalCtx);
void func_80AB6324(EnNiw* pthis, GlobalContext* globalCtx);
void func_80AB63A8(EnNiw* pthis, GlobalContext* globalCtx);
void func_80AB6450(EnNiw* pthis, GlobalContext* globalCtx);
void func_80AB6570(EnNiw* pthis, GlobalContext* globalCtx);
void func_80AB6A38(EnNiw* pthis, GlobalContext* globalCtx);
void func_80AB6BF8(EnNiw* pthis, GlobalContext* globalCtx);
void action_80AB6324(EnNiw* pthis, GlobalContext* globalCtx);
void action_80AB63A8(EnNiw* pthis, GlobalContext* globalCtx);
void action_80AB6450(EnNiw* pthis, GlobalContext* globalCtx);
void action_80AB6570(EnNiw* pthis, GlobalContext* globalCtx);
void action_80AB6A38(EnNiw* pthis, GlobalContext* globalCtx);
void action_80AB6BF8(EnNiw* pthis, GlobalContext* globalCtx);
void func_80AB6D08(EnNiw* pthis, GlobalContext* globalCtx);
void func_80AB6EB4(EnNiw* pthis, GlobalContext* globalCtx);
void func_80AB70F8(EnNiw* pthis, GlobalContext* globalCtx);
void func_80AB714C(EnNiw* pthis, GlobalContext* globalCtx);
void func_80AB7204(EnNiw* pthis, GlobalContext* globalCtx);
void func_80AB7290(EnNiw* pthis, GlobalContext* globalCtx);
void func_80AB7328(EnNiw* pthis, GlobalContext* globalCtx);
void action_wait_for_death_cucco_cutscene(EnNiw* pthis, GlobalContext* globalCtx);
void action_cucco_death_timer_cry_then_execute(EnNiw* pthis, GlobalContext* globalCtx);
void action_spawn_death_cuccos(EnNiw* pthis, GlobalContext* globalCtx);
void action_80AB7290(EnNiw* pthis, GlobalContext* globalCtx);
void action_80AB7328(EnNiw* pthis, GlobalContext* globalCtx);
void EnNiw_FeatherSpawn(EnNiw* pthis, Vec3f* pos, Vec3f* vel, Vec3f* accel, f32 scale);
void EnNiw_FeatherUpdate(EnNiw* pthis, GlobalContext* globalCtx);
void EnNiw_FeatherDraw(EnNiw* pthis, GlobalContext* globalCtx);
@ -183,15 +183,16 @@ void EnNiw_Init(Actor* thisx, GlobalContext* globalCtx)
}
}
Math_Vec3f_Copy(&pthis->unk_2AC, &pthis->actor.world.pos);
Math_Vec3f_Copy(&pthis->unk_2B8, &pthis->actor.world.pos);
pthis->unk_2AC = pthis->actor.world.pos;
pthis->unk_2B8 = pthis->actor.world.pos;
pthis->unk_304 = 10.0f;
Actor_SetScale(&pthis->actor, 0.01f);
pthis->unk_2A4 = (s16)Rand_ZeroFloat(3.99f) + 5;
pthis->jumpY = (s16)Rand_ZeroFloat(3.99f) + 5;
if(pthis->unk_2A4 < 0)
if(pthis->jumpY < 0)
{
pthis->unk_2A4 = 1;
pthis->jumpY = 1;
}
switch(pthis->actor.params)
@ -352,35 +353,35 @@ void func_80AB5BF8(EnNiw* pthis, GlobalContext* globalCtx, s16 arg2)
}
if(pthis->unk_2E0 != pthis->unk_26C[9])
{
Math_ApproachF(&pthis->unk_2E0, pthis->unk_26C[9], 0.5f, 4000.0f);
Math_ApproachF(&pthis->unk_2E0, pthis->unk_26C[9], 0.5f, 4000.0f * FRAMERATE_SCALER);
}
if(pthis->unk_2DC != pthis->unk_26C[0])
{
Math_ApproachF(&pthis->unk_2DC, pthis->unk_26C[0], 0.5f, 4000.0f);
Math_ApproachF(&pthis->unk_2DC, pthis->unk_26C[0], 0.5f, 4000.0f * FRAMERATE_SCALER);
}
if(pthis->unk_2C4 != pthis->unk_26C[2])
{
Math_ApproachF(&pthis->unk_2C4, pthis->unk_26C[2], 0.8f, 7000.0f);
Math_ApproachF(&pthis->unk_2C4, pthis->unk_26C[2], 0.8f, 7000.0f * FRAMERATE_SCALER);
}
if(pthis->unk_2C8 != pthis->unk_26C[7])
{
Math_ApproachF(&pthis->unk_2C8, pthis->unk_26C[7], 0.8f, 7000.0f);
Math_ApproachF(&pthis->unk_2C8, pthis->unk_26C[7], 0.8f, 7000.0f * FRAMERATE_SCALER);
}
if(pthis->unk_2CC != pthis->unk_26C[8])
{
Math_ApproachF(&pthis->unk_2CC, pthis->unk_26C[8], 0.8f, 7000.0f);
Math_ApproachF(&pthis->unk_2CC, pthis->unk_26C[8], 0.8f, 7000.0f * FRAMERATE_SCALER);
}
if(pthis->unk_2D0 != pthis->unk_26C[1])
{
Math_ApproachF(&pthis->unk_2D0, pthis->unk_26C[1], 0.8f, 7000.0f);
Math_ApproachF(&pthis->unk_2D0, pthis->unk_26C[1], 0.8f, 7000.0f * FRAMERATE_SCALER);
}
if(pthis->unk_2D4 != pthis->unk_26C[5])
{
Math_ApproachF(&pthis->unk_2D4, pthis->unk_26C[5], 0.8f, 7000.0f);
Math_ApproachF(&pthis->unk_2D4, pthis->unk_26C[5], 0.8f, 7000.0f * FRAMERATE_SCALER);
}
if(pthis->unk_2D8 != pthis->unk_26C[6])
{
Math_ApproachF(&pthis->unk_2D8, pthis->unk_26C[6], 0.8f, 7000.0f);
Math_ApproachF(&pthis->unk_2D8, pthis->unk_26C[6], 0.8f, 7000.0f * FRAMERATE_SCALER);
}
}
@ -451,13 +452,13 @@ void func_80AB6100(EnNiw* pthis, GlobalContext* globalCtx, s32 arg2)
if(pthis->timer8 == 0)
{
pthis->timer8 = 70;
pthis->unk_2E4 = pthis->actor.yawTowardsPlayer;
pthis->unk_angle_yaw_2E4 = pthis->actor.yawTowardsPlayer;
}
}
}
targetRotY = pthis->unk_2E4 + factor;
Math_SmoothStepToS(&pthis->actor.world.rot.y, targetRotY, 3, pthis->unk_2FC, 0);
Math_ApproachF(&pthis->unk_2FC, 3000.0f, 1.0f, 500.0f);
targetRotY = pthis->unk_angle_yaw_2E4 + factor;
Math_SmoothStepToS(&pthis->actor.world.rot.y, targetRotY, 3, pthis->unk_2FC * FRAMERATE_SCALER, 0);
Math_ApproachF(&pthis->unk_2FC, 3000.0f, 1.0f, 500.0f * FRAMERATE_SCALER);
func_80AB5BF8(pthis, globalCtx, 5);
}
@ -468,29 +469,29 @@ void EnNiw_ResetAction(EnNiw* pthis, GlobalContext* globalCtx)
switch(pthis->actor.params)
{
case 4:
pthis->actionFunc = func_80AB6450;
pthis->actionFunc = action_80AB6450;
break;
case 0xD:
pthis->actionFunc = func_80AB6324;
pthis->actionFunc = action_80AB6324;
break;
default:
pthis->actionFunc = func_80AB6570;
pthis->actionFunc = action_80AB6570;
break;
}
}
void func_80AB6324(EnNiw* pthis, GlobalContext* globalCtx)
void action_80AB6324(EnNiw* pthis, GlobalContext* globalCtx)
{
if(pthis->unk_308 != 0)
{
pthis->actor.velocity.y = Rand_ZeroFloat(2.0f) + 4.0f;
pthis->actor.speedXZ = Rand_ZeroFloat(2.0f) + 3.0f;
pthis->actionFunc = func_80AB63A8;
pthis->actionFunc = action_80AB63A8;
}
func_80AB5BF8(pthis, globalCtx, 1);
}
void func_80AB63A8(EnNiw* pthis, GlobalContext* globalCtx)
void action_80AB63A8(EnNiw* pthis, GlobalContext* globalCtx)
{
if(pthis->actor.bgCheckFlags & 1 && pthis->actor.velocity.y < 0.0f)
{
@ -501,7 +502,7 @@ void func_80AB63A8(EnNiw* pthis, GlobalContext* globalCtx)
pthis->unk_26C[7] = pthis->unk_26C[5] = pthis->unk_26C[6] = pthis->unk_26C[8] = pthis->actor.speedXZ = pthis->unk_2FC = pthis->unk_300 = 0.0f;
pthis->actionFunc = func_80AB6570;
pthis->actionFunc = action_80AB6570;
}
else
{
@ -509,7 +510,7 @@ void func_80AB63A8(EnNiw* pthis, GlobalContext* globalCtx)
}
}
void func_80AB6450(EnNiw* pthis, GlobalContext* globalCtx)
void action_80AB6450(EnNiw* pthis, GlobalContext* globalCtx)
{
Player* player = GET_PLAYER(globalCtx);
@ -517,7 +518,7 @@ void func_80AB6450(EnNiw* pthis, GlobalContext* globalCtx)
{
pthis->timer6 = 100;
pthis->actor.gravity = -2.0f;
pthis->actionFunc = func_80AB7290;
pthis->actionFunc = action_80AB7290;
}
else if(Actor_HasParent(&pthis->actor, globalCtx))
{
@ -528,7 +529,7 @@ void func_80AB6450(EnNiw* pthis, GlobalContext* globalCtx)
pthis->timer4 = 30;
pthis->actor.flags &= ~ACTOR_FLAG_0;
pthis->actor.speedXZ = 0.0f;
pthis->actionFunc = func_80AB6BF8;
pthis->actionFunc = action_80AB6BF8;
}
else
{
@ -538,10 +539,10 @@ void func_80AB6450(EnNiw* pthis, GlobalContext* globalCtx)
}
}
void func_80AB6570(EnNiw* pthis, GlobalContext* globalCtx)
void action_80AB6570(EnNiw* pthis, GlobalContext* globalCtx)
{
s32 pad[2];
f32 posY = Rand_CenteredFloat(100.0f);
f32 posX = Rand_CenteredFloat(100.0f);
f32 posZ = Rand_CenteredFloat(100.0f);
s16 tmp;
@ -555,7 +556,7 @@ void func_80AB6570(EnNiw* pthis, GlobalContext* globalCtx)
pthis->timer4 = 30;
pthis->actor.flags &= ~ACTOR_FLAG_0;
pthis->actor.speedXZ = 0.0f;
pthis->actionFunc = func_80AB6BF8;
pthis->actionFunc = action_80AB6BF8;
return;
}
func_8002F580(&pthis->actor, globalCtx);
@ -564,7 +565,7 @@ void func_80AB6570(EnNiw* pthis, GlobalContext* globalCtx)
{
if(pthis->path != 0)
{
pthis->unk_2A6 = 1;
pthis->hitSpawnFeathers = 1;
if(pthis->sfxTimer3 == 0)
{
Audio_PlayActorSound2(&pthis->actor, NA_SE_EV_CHICKEN_CRY_M);
@ -574,7 +575,7 @@ void func_80AB6570(EnNiw* pthis, GlobalContext* globalCtx)
pthis->actor.speedXZ = 4.0f;
pthis->unk_300 = 0.0f;
pthis->unk_2FC = 0.0f;
pthis->actionFunc = func_80AB6A38;
pthis->actionFunc = action_80AB6A38;
return;
}
}
@ -588,7 +589,7 @@ void func_80AB6570(EnNiw* pthis, GlobalContext* globalCtx)
pthis->unk_2E6++;
pthis->unk_2E6 &= 1;
}
Math_ApproachF(&pthis->unk_26C[9], D_80AB8604[pthis->unk_2E6], 0.5f, 4000.0f);
Math_ApproachF(&pthis->unk_26C[9], D_80AB8604[pthis->unk_2E6], 0.5f, 4000.0f * FRAMERATE_SCALER);
}
if(pthis->timer5 == 0 && pthis->timer4 == 0)
@ -601,13 +602,13 @@ void func_80AB6570(EnNiw* pthis, GlobalContext* globalCtx)
pthis->unk_29E = Rand_ZeroFloat(3.99f);
if(pthis->actor.params != 0xA && pthis->actor.params != 8)
{
if(posY < 0.0f)
if(posX < 0.0f)
{
posY -= 100.0f;
posX -= 100.0f;
}
else
{
posY += 100.0f;
posX += 100.0f;
}
if(posZ < 0.0f)
{
@ -620,30 +621,19 @@ void func_80AB6570(EnNiw* pthis, GlobalContext* globalCtx)
}
else
{
posY = Rand_CenteredFloat(30.0f);
posX = Rand_CenteredFloat(30.0f);
posZ = Rand_CenteredFloat(30.0f);
if(posY < 0.0f)
if(posX < 0.0f)
{
posY -= 20.0f;
posX -= 20.0f;
}
else
{
posY += 20.0f;
posX += 20.0f;
}
if(posZ < 0.0f)
{
if(1)
{
} // Required to match
if(1)
{
}
if(1)
{
}
if(1)
{
}
posZ -= 20.0f;
}
else
@ -651,8 +641,11 @@ void func_80AB6570(EnNiw* pthis, GlobalContext* globalCtx)
posZ += 20.0f;
}
}
pthis->unk_2B8.x = pthis->unk_2AC.x + posY;
pthis->unk_2B8.z = pthis->unk_2AC.z + posZ;
pthis->unk_2B8.x = pthis->unk_2AC.x;
pthis->unk_2B8.x += posX;
pthis->unk_2B8.z = pthis->unk_2AC.z;
pthis->unk_2B8.z += posZ;
}
else
{
@ -667,36 +660,36 @@ void func_80AB6570(EnNiw* pthis, GlobalContext* globalCtx)
if(pthis->timer4 != 0)
{
Math_ApproachZeroF(&pthis->unk_26C[9], 0.5f, 4000.0f);
Math_ApproachZeroF(&pthis->unk_26C[9], 0.5f, 4000.0f * FRAMERATE_SCALER);
tmp = 1;
Math_ApproachF(&pthis->actor.world.pos.x, pthis->unk_2B8.x, 1.0f, pthis->unk_2FC);
Math_ApproachF(&pthis->actor.world.pos.z, pthis->unk_2B8.z, 1.0f, pthis->unk_2FC);
Math_ApproachF(&pthis->unk_2FC, 3.0f, 1.0f, 0.3f);
posY = pthis->unk_2B8.x - pthis->actor.world.pos.x;
Math_ApproachF(&pthis->actor.world.pos.x, pthis->unk_2B8.x, 1.0f, pthis->unk_2FC * FRAMERATE_SCALER);
Math_ApproachF(&pthis->actor.world.pos.z, pthis->unk_2B8.z, 1.0f, pthis->unk_2FC * FRAMERATE_SCALER);
Math_ApproachF(&pthis->unk_2FC, 3.0f, 1.0f, 0.3f * FRAMERATE_SCALER);
posX = pthis->unk_2B8.x - pthis->actor.world.pos.x;
posZ = pthis->unk_2B8.z - pthis->actor.world.pos.z;
if(fabsf(posY) < 10.0f)
if(fabsf(posX) < 10.0f)
{
posY = 0.0;
posX = 0.0;
}
if(fabsf(posZ) < 10.0f)
{
posZ = 0.0;
}
if(posY == 0.0f && posZ == 0.0f)
if(posX == 0.0f && posZ == 0.0f && pthis->unk_29E.isWhole())
{
pthis->timer4 = 0;
pthis->unk_29E = 7;
}
Math_SmoothStepToS(&pthis->actor.world.rot.y, Math_FAtan2F(posY, posZ) * (0x8000 / M_PI), 3, pthis->unk_300, 0);
Math_ApproachF(&pthis->unk_300, 10000.0f, 1.0f, 1000.0f);
Math_SmoothStepToS(&pthis->actor.world.rot.y, Math_FAtan2F(posX, posZ) * (0x8000 / M_PI), 3, pthis->unk_300 * FRAMERATE_SCALER, 0);
Math_ApproachF(&pthis->unk_300, 10000.0f, 1.0f, 1000.0f * FRAMERATE_SCALER);
}
func_80AB5BF8(pthis, globalCtx, tmp);
}
void func_80AB6A38(EnNiw* pthis, GlobalContext* globalCtx)
void action_80AB6A38(EnNiw* pthis, GlobalContext* globalCtx)
{
Path* path;
Vec3s* pointPos;
@ -720,7 +713,7 @@ void func_80AB6A38(EnNiw* pthis, GlobalContext* globalCtx)
pointPos += pthis->waypoint;
pathDiffX = pointPos->x - pthis->actor.world.pos.x;
pathDiffZ = pointPos->z - pthis->actor.world.pos.z;
pthis->unk_2E4 = Math_FAtan2F(pathDiffX, pathDiffZ) * (0x8000 / M_PI);
pthis->unk_angle_yaw_2E4 = Math_FAtan2F(pathDiffX, pathDiffZ) * (0x8000 / M_PI);
func_80AB6100(pthis, globalCtx, 2);
if(fabsf(pathDiffX) < 30.0f && fabsf(pathDiffZ) < 30.0f)
@ -736,11 +729,11 @@ void func_80AB6A38(EnNiw* pthis, GlobalContext* globalCtx)
}
}
void func_80AB6BF8(EnNiw* pthis, GlobalContext* globalCtx)
void action_80AB6BF8(EnNiw* pthis, GlobalContext* globalCtx)
{
if(pthis->timer4 == 0)
{
pthis->unk_2A6 = 2;
pthis->hitSpawnFeathers = 2;
pthis->timer4 = 10;
}
@ -753,7 +746,7 @@ void func_80AB6BF8(EnNiw* pthis, GlobalContext* globalCtx)
if(pthis->actor.params == 0xD)
{
pthis->sfxTimer1 = 0;
pthis->unk_2A6 = 1;
pthis->hitSpawnFeathers = 1;
pthis->actionFunc = func_80AB6EB4;
pthis->actor.velocity.y = 4.0f;
return;
@ -799,14 +792,14 @@ void func_80AB6D08(EnNiw* pthis, GlobalContext* globalCtx)
{
pthis->sfxTimer1 = 0;
pthis->actor.velocity.y = 4.0f;
pthis->unk_2A6 = 1;
pthis->hitSpawnFeathers = 1;
}
if(pthis->timer5 == 0)
{
pthis->timer6 = 100;
pthis->timer4 = 0;
pthis->path = 0;
pthis->actionFunc = func_80AB7290;
pthis->actionFunc = action_80AB7290;
return;
}
}
@ -819,7 +812,7 @@ void func_80AB6D08(EnNiw* pthis, GlobalContext* globalCtx)
pthis->timer4 = 30;
pthis->actor.flags &= ~ACTOR_FLAG_0;
pthis->actor.speedXZ = 0.0f;
pthis->actionFunc = func_80AB6BF8;
pthis->actionFunc = action_80AB6BF8;
}
else
{
@ -841,7 +834,7 @@ void func_80AB6EB4(EnNiw* pthis, GlobalContext* globalCtx)
func_80AB5BF8(pthis, globalCtx, 2);
}
void func_80AB6F04(EnNiw* pthis, GlobalContext* globalCtx)
void action_bubbly_80AB6F04(EnNiw* pthis, GlobalContext* globalCtx)
{
Vec3f pos;
@ -893,13 +886,14 @@ void func_80AB6F04(EnNiw* pthis, GlobalContext* globalCtx)
pthis->timer6 = 100;
pthis->timer4 = 0;
pthis->actor.velocity.y = 0.0f;
if(pthis->unk_2A8 == 0)
{
pthis->actionFunc = func_80AB7290;
pthis->actionFunc = action_80AB7290;
}
else
{
pthis->actionFunc = func_80AB7204;
pthis->actionFunc = action_spawn_death_cuccos;
}
}
}
@ -907,15 +901,15 @@ void func_80AB6F04(EnNiw* pthis, GlobalContext* globalCtx)
func_80AB5BF8(pthis, globalCtx, 2);
}
void func_80AB70A0(EnNiw* pthis, GlobalContext* globalCtx)
void action_start_death_cucco_cutscene(EnNiw* pthis, GlobalContext* globalCtx)
{
OnePointCutscene_Init(globalCtx, 2290, -99, &pthis->actor, MAIN_CAM);
pthis->timer5 = 100;
pthis->unk_2A2 = 1;
pthis->actionFunc = func_80AB70F8;
pthis->actionFunc = action_wait_for_death_cucco_cutscene;
}
void func_80AB70F8(EnNiw* pthis, GlobalContext* globalCtx)
void action_wait_for_death_cucco_cutscene(EnNiw* pthis, GlobalContext* globalCtx)
{
pthis->sfxTimer1 = 100;
@ -924,13 +918,13 @@ void func_80AB70F8(EnNiw* pthis, GlobalContext* globalCtx)
pthis->timer5 = 60;
pthis->timer1 = 10;
pthis->unk_2A2 = 4;
pthis->actionFunc = func_80AB714C;
pthis->actionFunc = action_cucco_death_timer_cry_then_execute;
}
func_80AB5BF8(pthis, globalCtx, pthis->unk_2A2);
}
void func_80AB714C(EnNiw* pthis, GlobalContext* globalCtx)
void action_cucco_death_timer_cry_then_execute(EnNiw* pthis, GlobalContext* globalCtx)
{
pthis->sfxTimer1 = 100;
@ -946,18 +940,19 @@ void func_80AB714C(EnNiw* pthis, GlobalContext* globalCtx)
pthis->timer1 = 10;
Audio_PlayActorSound2(&pthis->actor, NA_SE_EV_CHICKEN_CRY_M);
}
if(pthis->timer5 == 0)
{
pthis->timer7 = 10;
pthis->unk_2E4 = pthis->actor.yawTowardsPlayer;
pthis->unk_angle_yaw_2E4 = pthis->actor.yawTowardsPlayer;
pthis->actor.flags &= ~ACTOR_FLAG_0;
pthis->actionFunc = func_80AB7204;
pthis->actionFunc = action_spawn_death_cuccos;
}
func_80AB5BF8(pthis, globalCtx, pthis->unk_2A2);
}
void func_80AB7204(EnNiw* pthis, GlobalContext* globalCtx)
void action_spawn_death_cuccos(EnNiw* pthis, GlobalContext* globalCtx)
{
EnNiw_SpawnAttackCucco(pthis, globalCtx);
@ -976,15 +971,15 @@ void func_80AB7204(EnNiw* pthis, GlobalContext* globalCtx)
}
}
void func_80AB7290(EnNiw* pthis, GlobalContext* globalCtx)
void action_80AB7290(EnNiw* pthis, GlobalContext* globalCtx)
{
Animation_Change(&pthis->skelAnime, &gCuccoAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gCuccoAnim), ANIMMODE_LOOP, -10.0f);
pthis->unk_2A0 = Rand_ZeroFloat(1.99f);
pthis->actor.speedXZ = 4.0f;
pthis->actionFunc = func_80AB7328;
pthis->actionFunc = action_80AB7328;
}
void func_80AB7328(EnNiw* pthis, GlobalContext* globalCtx)
void action_80AB7328(EnNiw* pthis, GlobalContext* globalCtx)
{
Player* player = GET_PLAYER(globalCtx);
@ -1003,36 +998,36 @@ void func_80AB7328(EnNiw* pthis, GlobalContext* globalCtx)
}
else
{
pthis->unk_2E4 = Math_FAtan2F(pthis->actor.world.pos.x - player->actor.world.pos.x, pthis->actor.world.pos.z - player->actor.world.pos.z) * (0x8000 / M_PI);
pthis->unk_angle_yaw_2E4 = Math_FAtan2F(pthis->actor.world.pos.x - player->actor.world.pos.x, pthis->actor.world.pos.z - player->actor.world.pos.z) * (0x8000 / M_PI);
func_80AB6100(pthis, globalCtx, 0);
func_80AB5BF8(pthis, globalCtx, 2);
}
}
void func_80AB7420(EnNiw* pthis, GlobalContext* globalCtx)
void action_jump(EnNiw* pthis, GlobalContext* globalCtx)
{
if(pthis->actor.bgCheckFlags & 1)
{
pthis->unk_2A4 = (s16)Rand_ZeroFloat(3.99f) + 5;
pthis->jumpY = (s16)Rand_ZeroFloat(3.99f) + 5;
pthis->actionFunc = EnNiw_ResetAction;
}
}
void func_80AB747C(EnNiw* pthis, GlobalContext* globalCtx)
{
if(pthis->unk_2A8 == 0 && pthis->actor.params != 0xA && pthis->actionFunc != func_80AB6450 && pthis->collider.base.acFlags & AC_HIT)
if(pthis->unk_2A8 == 0 && pthis->actor.params != 0xA && pthis->actionFunc != action_80AB6450 && pthis->collider.base.acFlags & AC_HIT)
{
pthis->collider.base.acFlags &= ~AC_HIT;
pthis->sfxTimer1 = 30;
if(pthis->unk_2A4 > 0 && D_80AB85E0 == 0)
if(pthis->jumpY > 0 && D_80AB85E0 == 0)
{
pthis->unk_2A4--;
pthis->jumpY--;
}
pthis->unk_2A6 = 1;
pthis->hitSpawnFeathers = 1;
Audio_PlayActorSound2(&pthis->actor, NA_SE_EV_CHICKEN_CRY_M);
pthis->timer6 = 100;
pthis->path = 0;
pthis->actionFunc = func_80AB7290;
pthis->actionFunc = action_80AB7290;
}
}
@ -1055,27 +1050,17 @@ void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx)
f32 camResult;
s32 pad3[10];
if(1)
{
} // Required to match
if(1)
{
}
if(1)
{
}
pthis->unk_294++;
if(pthis->actionFunc != func_80AB6570)
if(pthis->actionFunc != action_80AB6570)
{
pthis->unk_26C[9] = 0.0f;
}
if(pthis->unk_2A6)
if(pthis->hitSpawnFeathers)
{
featherCount = 20;
if(pthis->unk_2A6 == 2)
if(pthis->hitSpawnFeathers == 2)
{
featherCount = 4;
}
@ -1087,7 +1072,7 @@ void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx)
pos.z = Rand_CenteredFloat(10.0f) + thisx->world.pos.z;
scale = Rand_ZeroFloat(6.0f) + 6.0f;
if(pthis->unk_2A6 == 2 && pthis->unk_304 != 0)
if(pthis->hitSpawnFeathers == 2 && pthis->unk_304 != 0)
{
pos.y += 10;
}
@ -1105,65 +1090,31 @@ void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx)
EnNiw_FeatherSpawn(pthis, &pos, &vel, &accel, scale);
}
pthis->unk_2A6 = 0;
pthis->hitSpawnFeathers = 0;
}
EnNiw_FeatherUpdate(pthis, globalCtx);
if(pthis->timer1 != 0)
{
pthis->timer1--;
}
if(pthis->timer2 != 0)
{
pthis->timer2--;
}
if(pthis->timer3 != 0)
{
pthis->timer3--;
}
if(pthis->timer4 != 0)
{
pthis->timer4--;
}
if(pthis->timer5 != 0)
{
pthis->timer5--;
}
if(pthis->timer7 != 0)
{
pthis->timer7--;
}
if(pthis->timer6 != 0)
{
pthis->timer6--;
}
if(pthis->sfxTimer1 != 0)
{
pthis->sfxTimer1--;
}
if(pthis->sfxTimer2 != 0)
{
pthis->sfxTimer2--;
}
if(pthis->sfxTimer3 != 0)
{
pthis->sfxTimer3--;
}
if(pthis->timer8 != 0)
{
pthis->timer8--;
}
if(pthis->timer9 != 0)
{
pthis->timer9--;
}
pthis->timer1.dec();
pthis->timer2.dec();
pthis->timer3.dec();
pthis->timer4.dec();
pthis->timer5.dec();
pthis->timer6.dec();
pthis->timer7.dec();
pthis->timer8.dec();
pthis->timer9.dec();
pthis->sfxTimer1.dec();
pthis->sfxTimer2.dec();
pthis->sfxTimer3.dec();
thisx->shape.rot = thisx->world.rot;
thisx->shape.shadowScale = 15.0f;
pthis->actionFunc(pthis, globalCtx);
Actor_SetFocus(&pthis->actor, pthis->unk_304);
Actor_MoveForward(&pthis->actor);
if(pthis->actionFunc != func_80AB6EB4 && pthis->actionFunc != func_80AB6450 && globalCtx->sceneNum != SCENE_SPOT03)
if(pthis->actionFunc != func_80AB6EB4 && pthis->actionFunc != action_80AB6450 && globalCtx->sceneNum != SCENE_SPOT03)
{
Actor_UpdateBgCheckInfo(globalCtx, &pthis->actor, 20.0f, 20.0f, 60.0f, 31);
}
@ -1199,8 +1150,10 @@ void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx)
osSyncPrintf("\n\n");
thisx->speedXZ = 0.0f;
thisx->gravity = -2.0f;
Math_Vec3f_Copy(&pthis->unk_2AC, &thisx->home.pos);
Math_Vec3f_Copy(&pthis->unk_2B8, &thisx->home.pos);
pthis->unk_2AC = thisx->home.pos;
pthis->unk_2B8 = thisx->home.pos;
pthis->unk_300 = 0.0f;
pthis->unk_2FC = 0.0f;
pthis->unk_2F0.z = 0.0f;
@ -1214,7 +1167,7 @@ void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx)
pthis->unk_2C4 = 0.0f;
pthis->unk_2DC = 0.0f;
pthis->unk_2E0 = 0.0f;
pthis->unk_2A8 = pthis->unk_294 = pthis->unk_298 = pthis->unk_2A6 = pthis->unk_29E = pthis->unk_2A0 = pthis->unk_2A2 = 0;
pthis->unk_2A8 = pthis->unk_294 = pthis->unk_298 = pthis->hitSpawnFeathers = pthis->unk_29E = pthis->unk_2A0 = pthis->unk_2A2 = 0;
for(i = 0; i < ARRAY_COUNT(pthis->unk_26C); i++)
{
@ -1222,11 +1175,11 @@ void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx)
}
pthis->unk_2A8 = 0;
pthis->actionFunc = func_80AB7420;
pthis->actionFunc = action_jump;
return;
}
if(thisx->bgCheckFlags & 0x20 && thisx->yDistToWater > 15.0f && pthis->actionFunc != func_80AB6F04 && thisx->params != 0xD && thisx->params != 0xE && thisx->params != 0xA)
if(thisx->bgCheckFlags & 0x20 && thisx->yDistToWater > 15.0f && pthis->actionFunc != action_bubbly_80AB6F04 && thisx->params != 0xD && thisx->params != 0xE && thisx->params != 0xA)
{
thisx->velocity.y = 0.0f;
thisx->gravity = 0.0f;
@ -1238,11 +1191,11 @@ void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx)
osSyncPrintf("\n\n");
osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ ぶくぶく ☆☆☆☆☆ \n" VT_RST);
osSyncPrintf("\n\n");
pthis->actionFunc = func_80AB6F04;
pthis->actionFunc = action_bubbly_80AB6F04;
return;
}
if(D_80AB85E0 == 0 && pthis->unk_2A4 <= 0 && thisx->params != 0xD && thisx->params != 0xE && thisx->params != 0xA)
if(D_80AB85E0 == 0 && pthis->jumpY <= 0 && thisx->params != 0xD && thisx->params != 0xE && thisx->params != 0xA)
{
pthis->timer6 = 100;
@ -1262,7 +1215,7 @@ void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx)
pthis->unk_2AC.x = pthis->unk_2B8.x = thisx->world.pos.x;
pthis->unk_2AC.y = pthis->unk_2B8.y = thisx->world.pos.y;
pthis->unk_2AC.z = pthis->unk_2B8.z = thisx->world.pos.z;
pthis->actionFunc = func_80AB70A0;
pthis->actionFunc = action_start_death_cucco_cutscene;
return;
}
}
@ -1276,14 +1229,14 @@ void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx)
func_80AB747C(pthis, globalCtx);
if(pthis->sfxTimer2 == 0 && pthis->actionFunc == func_80AB6BF8)
if(pthis->sfxTimer2 == 0 && pthis->actionFunc == action_80AB6BF8)
{
pthis->sfxTimer2 = 7;
Audio_PlayActorSound2(&pthis->actor, NA_SE_EN_DEKU_WAKEUP);
}
if(pthis->sfxTimer1 == 0)
{
if(pthis->actionFunc != func_80AB6570)
if(pthis->actionFunc != action_80AB6570)
{
pthis->sfxTimer1 = 30;
Audio_PlayActorSound2(&pthis->actor, NA_SE_EV_CHICKEN_CRY_A);
@ -1302,7 +1255,7 @@ void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx)
{
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &pthis->collider.base);
}
if(pthis->actionFunc != func_80AB6BF8 && pthis->actionFunc != func_80AB6D08 && pthis->actionFunc != func_80AB6324 && pthis->actionFunc != func_80AB63A8 && pthis->actionFunc != func_80AB6450)
if(pthis->actionFunc != action_80AB6BF8 && pthis->actionFunc != func_80AB6D08 && pthis->actionFunc != action_80AB6324 && pthis->actionFunc != action_80AB63A8 && pthis->actionFunc != action_80AB6450)
{
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &pthis->collider.base);
}
@ -1347,7 +1300,7 @@ void EnNiw_Draw(Actor* thisx, GlobalContext* globalCtx)
func_80093D18(globalCtx->state.gfxCtx);
SkelAnime_DrawFlexOpa(globalCtx, pthis->skelAnime.skeleton, pthis->skelAnime.jointTable, pthis->skelAnime.dListCount, EnNiw_OverrideLimbDraw, NULL, pthis);
if(pthis->actionFunc == func_80AB6450)
if(pthis->actionFunc == action_80AB6450)
{
func_80033C30(&pthis->actor.world.pos, &scale, 255, globalCtx);
}
@ -1396,8 +1349,8 @@ void EnNiw_FeatherUpdate(EnNiw* pthis, GlobalContext* globalCtx)
if(feather->type == 1)
{
feather->unk_2A++;
Math_ApproachF(&feather->vel.x, 0.0f, 1.0f, 0.05f);
Math_ApproachF(&feather->vel.z, 0.0f, 1.0f, 0.05f);
Math_ApproachF(&feather->vel.x, 0.0f, 1.0f, 0.05f * FRAMERATE_SCALER);
Math_ApproachF(&feather->vel.z, 0.0f, 1.0f, 0.05f * FRAMERATE_SCALER);
if(feather->vel.y < -0.5f)
{
feather->vel.y = -0.5f;

View File

@ -15,10 +15,10 @@ struct EnNiwFeather
/* 0x0010 */ Vec3f vel;
/* 0x001C */ Vec3f accel;
/* 0x0028 */ s16 life;
/* 0x002A */ s16 unk_2A; // Variance timer?
/* 0x002A */ Counter unk_2A; // Variance timer?
/* 0x002C */ f32 scale;
/* 0x0030 */ f32 unk_30;
/* 0x0034 */ u8 timer;
/* 0x0034 */ TimerU8 timer;
};
struct EnNiw
@ -42,19 +42,19 @@ struct EnNiw
/* 0x026A */ Timer timer9;
/* 0x026C */ f32 unk_26C[10];
/* 0x0294 */ s16 unk_294;
/* 0x0296 */ s16 unk_296;
/* 0x0296 */ Timer unk_296;
/* 0x0298 */ s16 unk_298;
/* 0x029A */ s16 unk_29A;
/* 0x029C */ s16 unk_29C;
/* 0x029E */ s16 unk_29E;
/* 0x029E */ Counter unk_29E; // important for state change
/* 0x02A0 */ s16 unk_2A0;
/* 0x02A2 */ s16 unk_2A2;
/* 0x02A4 */ s16 unk_2A4;
/* 0x02A6 */ s16 unk_2A6;
/* 0x02A4 */ Timer jumpY;
/* 0x02A6 */ s16 hitSpawnFeathers;
/* 0x02A8 */ s16 unk_2A8;
/* 0x02AA */ s16 unk_2AA;
/* 0x02AC */ Vec3f unk_2AC;
/* 0x02B8 */ Vec3f unk_2B8;
/* 0x02AC */ VecPos unk_2AC;
/* 0x02B8 */ VecPos unk_2B8;
/* 0x02C4 */ f32 unk_2C4;
/* 0x02C8 */ f32 unk_2C8;
/* 0x02CC */ f32 unk_2CC;
@ -63,7 +63,7 @@ struct EnNiw
/* 0x02D8 */ f32 unk_2D8;
/* 0x02DC */ f32 unk_2DC;
/* 0x02E0 */ f32 unk_2E0;
/* 0x02E4 */ s16 unk_2E4;
/* 0x02E4 */ s16 unk_angle_yaw_2E4;
/* 0x02E6 */ s16 unk_2E6;
/* 0x02E8 */ s16 path;
/* 0x02EA */ s16 waypoint;

View File

@ -116,7 +116,7 @@ void EnOwl_Init(Actor* thisx, GlobalContext* globalCtx)
pthis->actor.targetArrowOffset = 500.0f;
EnOwl_ChangeMode(pthis, EnOwl_WaitDefault, func_80ACC540, &pthis->skelAnime2, &gOwlPerchAnim, 0.0f);
pthis->actionFlags = pthis->unk_406 = pthis->unk_409 = 0;
pthis->unk_405 = 4;
pthis->timerUnk_405 = 4;
pthis->unk_404 = pthis->unk_407 = 0;
pthis->unk_408 = 4;
owlType = (pthis->actor.params & 0xFC0) >> 6;
@ -364,7 +364,7 @@ void func_80ACA71C(EnOwl* pthis)
pthis->unk_408 = 4;
pthis->unk_404 = 0;
pthis->unk_406 = 0;
pthis->unk_405 = 4;
pthis->timerUnk_405 = 4;
pthis->unk_407 = pthis->unk_3F2;
}
@ -1030,7 +1030,7 @@ void func_80ACBD4C(EnOwl* pthis, GlobalContext* globalCtx)
if(pthis->actionFlags & 1)
{
EnOwl_ChangeMode(pthis, func_80ACBC0C, func_80ACC460, &pthis->skelAnime, &gOwlFlyAnim, 0.0f);
pthis->unk_3FE = 6;
pthis->timerUnk_3FE = 6;
if(pthis->actionFlags & 0x40)
{
pthis->unk_400 += 0x2000;
@ -1048,7 +1048,7 @@ void func_80ACBEA0(EnOwl* pthis, GlobalContext* GlobalContext)
{
if(pthis->actionFlags & 1)
{
pthis->unk_3FE = 3;
pthis->timerUnk_3FE = 3;
EnOwl_ChangeMode(pthis, func_80ACBD4C, func_80ACC540, &pthis->skelAnime, &gOwlTakeoffAnim, 0.0f);
pthis->unk_3F8 = pthis->actor.world.pos.y;
pthis->actor.velocity.y = 2.0f;
@ -1073,7 +1073,7 @@ void func_80ACBF50(EnOwl* pthis, GlobalContext* globalCtx)
if(pthis->actionFlags & 1)
{
EnOwl_ChangeMode(pthis, func_80ACBC0C, func_80ACC460, &pthis->skelAnime, &gOwlFlyAnim, 0.0f);
pthis->unk_3FE = 6;
pthis->timerUnk_3FE = 6;
pthis->actor.velocity.y = 2.0f;
pthis->actor.gravity = 0.0f;
pthis->actor.speedXZ = 4.0f;
@ -1129,10 +1129,10 @@ void func_80ACC00C(EnOwl* pthis, GlobalContext* globalCtx)
if(pthis->skelAnime.curFrame >= 37.0f)
{
if(pthis->unk_3FE > 0)
if(pthis->timerUnk_3FE > 0)
{
pthis->skelAnime.curFrame = 21.0f;
pthis->unk_3FE--;
pthis->timerUnk_3FE--;
}
else
{
@ -1160,7 +1160,7 @@ void func_80ACC23C(EnOwl* pthis, GlobalContext* globalCtx)
{
pthis->skelAnime.curFrame = 21.0f;
pthis->actionFunc = func_80ACC00C;
pthis->unk_3FE = 5;
pthis->timerUnk_3FE = 5;
pthis->actor.velocity.y = 0.0f;
pthis->actor.gravity = 0.0f;
pthis->actor.speedXZ = 0.0f;
@ -1173,7 +1173,7 @@ void func_80ACC30C(EnOwl* pthis, GlobalContext* globalCtx)
{
if(pthis->actionFlags & 1)
{
pthis->unk_3FE = 3;
pthis->timerUnk_3FE = 3;
EnOwl_ChangeMode(pthis, func_80ACC23C, func_80ACC540, &pthis->skelAnime, &gOwlTakeoffAnim, 0.0f);
pthis->unk_3F8 = pthis->actor.world.pos.y;
pthis->actor.velocity.y = 0.2f;
@ -1186,15 +1186,15 @@ void func_80ACC390(EnOwl* pthis)
{
SkelAnime_Update(pthis->curSkelAnime);
if(pthis->unk_3FE > 0)
if(pthis->timerUnk_3FE > 0)
{
pthis->unk_3FE--;
pthis->actor.shape.rot.z = Math_SinS(pthis->unk_3FE * 0x333) * 1000.0f;
pthis->timerUnk_3FE--;
pthis->actor.shape.rot.z = Math_SinS(pthis->timerUnk_3FE * 0x333) * 1000.0f;
}
else
{
pthis->unk_410 = func_80ACC460;
pthis->unk_3FE = 6;
pthis->timerUnk_3FE = 6;
Animation_Change(pthis->curSkelAnime, &gOwlFlyAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gOwlFlyAnim), 2, 5.0f);
}
}
@ -1203,14 +1203,14 @@ void func_80ACC460(EnOwl* pthis)
{
if(SkelAnime_Update(pthis->curSkelAnime))
{
if(pthis->unk_3FE > 0)
if(pthis->timerUnk_3FE > 0)
{
pthis->unk_3FE--;
pthis->timerUnk_3FE--;
Animation_Change(pthis->curSkelAnime, (AnimationHeader*)pthis->curSkelAnime->animation, 1.0f, 0.0f, Animation_GetLastFrame(pthis->curSkelAnime->animation), ANIMMODE_ONCE, 0.0f);
}
else
{
pthis->unk_3FE = 0xA0;
pthis->timerUnk_3FE = 0xA0;
pthis->unk_410 = func_80ACC390;
Animation_Change(pthis->curSkelAnime, &gOwlGlideAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gOwlGlideAnim), 0, 5.0f);
}
@ -1341,14 +1341,14 @@ void EnOwl_Update(Actor* thisx, GlobalContext* globalCtx)
{
case 0:
pthis->unk_404 = 1;
pthis->unk_405 = 6;
pthis->timerUnk_405 = 6;
break;
case 1:
pthis->unk_405--;
pthis->timerUnk_405--;
if(pthis->unk_405 != 0)
if(pthis->timerUnk_405 != 0)
{
phi_a1 = Math_CosS(pthis->unk_405 * 8192) * 4096.0f;
phi_a1 = Math_CosS(pthis->timerUnk_405 * 8192) * 4096.0f;
}
else
{
@ -1403,38 +1403,38 @@ void EnOwl_Update(Actor* thisx, GlobalContext* globalCtx)
if(Rand_ZeroOne() < 0.3f)
{
pthis->unk_404 = 4;
pthis->unk_405 = 0xC;
pthis->timerUnk_405 = 0xC;
}
else
{
pthis->unk_404 = 1;
pthis->unk_405 = 4;
pthis->timerUnk_405 = 4;
}
}
pthis->unk_405--;
pthis->timerUnk_405--;
switch(pthis->unk_404)
{
case 1:
phi_a1 = Math_SinS((-pthis->unk_405 * 4096) + 0x4000) * 5000.0f;
if(pthis->unk_405 <= 0)
phi_a1 = Math_SinS((-pthis->timerUnk_405 * 4096) + 0x4000) * 5000.0f;
if(pthis->timerUnk_405 <= 0)
{
pthis->unk_405 = (s32)(Rand_ZeroFloat(15.0f) + 5.0f);
pthis->timerUnk_405 = (s32)(Rand_ZeroFloat(15.0f) + 5.0f);
pthis->unk_404 = 2;
}
break;
case 2:
phi_a1 = 0x1388;
if(pthis->unk_405 <= 0)
if(pthis->timerUnk_405 <= 0)
{
pthis->unk_404 = 3;
pthis->unk_405 = 4;
pthis->timerUnk_405 = 4;
}
break;
case 3:
phi_a1 = Math_SinS(pthis->unk_405 * 4096) * 5000.0f;
if(pthis->unk_405 <= 0)
phi_a1 = Math_SinS(pthis->timerUnk_405 * 4096) * 5000.0f;
if(pthis->timerUnk_405 <= 0)
{
pthis->unk_406 = (s32)Rand_ZeroFloat(20.0f) + 0x3C;
pthis->unk_404 = 0;
@ -1442,8 +1442,8 @@ void EnOwl_Update(Actor* thisx, GlobalContext* globalCtx)
}
break;
case 4:
phi_a1 = Math_SinS(pthis->unk_405 * 8192) * 5000.0f;
if(pthis->unk_405 <= 0)
phi_a1 = Math_SinS(pthis->timerUnk_405 * 8192) * 5000.0f;
if(pthis->timerUnk_405 <= 0)
{
pthis->unk_406 = (s32)Rand_ZeroFloat(20.0f) + 0x3C;
pthis->unk_404 = 0;
@ -1467,35 +1467,38 @@ void EnOwl_Update(Actor* thisx, GlobalContext* globalCtx)
else
{
pthis->unk_408--;
switch(pthis->unk_407)
if(pthis->unk_408.isWhole())
{
case 0:
pthis->unk_3F2 = (-pthis->unk_408 * 0x5DC) + 0x1770;
if(pthis->unk_408 <= 0)
{
pthis->unk_407 = 1;
pthis->unk_408 = (s32)(Rand_ZeroFloat(15.0f) + 5.0f);
}
break;
case 1:
pthis->unk_3F2 = 0x1770;
if(pthis->unk_408 <= 0)
{
pthis->unk_407 = 2;
pthis->unk_408 = 4;
}
break;
case 2:
pthis->unk_3F2 = pthis->unk_408 * 0x5DC;
if(pthis->unk_408 <= 0)
{
pthis->unk_407 = 0;
pthis->unk_408 = 4;
pthis->unk_409 = (s32)Rand_ZeroFloat(40.0f) + 0xA0;
}
break;
default:
break;
switch(pthis->unk_407.whole())
{
case 0:
pthis->unk_3F2 = (-pthis->unk_408 * 0x5DC) + 0x1770;
if(pthis->unk_408 <= 0)
{
pthis->unk_407 = 1;
pthis->unk_408 = (s32)(Rand_ZeroFloat(15.0f) + 5.0f);
}
break;
case 1:
pthis->unk_3F2 = 0x1770;
if(pthis->unk_408 <= 0)
{
pthis->unk_407 = 2;
pthis->unk_408 = 4;
}
break;
case 2:
pthis->unk_3F2 = pthis->unk_408 * 0x5DC;
if(pthis->unk_408 <= 0)
{
pthis->unk_407 = 0;
pthis->unk_408 = 4;
pthis->unk_409 = (s32)Rand_ZeroFloat(40.0f) + 0xA0;
}
break;
default:
break;
}
}
}
}

View File

@ -51,15 +51,15 @@ struct EnOwl
/* 0x03F6 */ Timer blinkTimer;
/* 0x03F8 */ f32 unk_3F8;
/* 0x03FC */ u16 actionFlags;
/* 0x03FE */ u16 unk_3FE;
/* 0x0400 */ s16 unk_400;
/* 0x03FE */ Timer timerUnk_3FE;
/* 0x0400 */ Rotation unk_400;
/* 0x0402 */ s16 cameraIdx;
/* 0x0404 */ u8 unk_404;
/* 0x0405 */ u8 unk_405;
/* 0x0406 */ u8 unk_406;
/* 0x0407 */ u8 unk_407;
/* 0x0408 */ u8 unk_408;
/* 0x0409 */ u8 unk_409;
/* 0x0405 */ TimerU8 timerUnk_405;
/* 0x0406 */ TimerU8 unk_406;
/* 0x0407 */ TimerU8 unk_407;
/* 0x0408 */ TimerU8 unk_408;
/* 0x0409 */ TimerU8 unk_409;
/* 0x040A */ u8 unk_40A;
/* 0x040B */ u8 unk_40B;
/* 0x040C */ EnOwlActionFunc actionFunc;

View File

@ -293,7 +293,7 @@ void EnfHG_Intro(EnfHG* pthis, GlobalContext* globalCtx)
}
if(pthis->timers[0] == 30)
{
bossGnd->work[GND_EYE_STATE] = GND_EYESTATE_BRIGHTEN;
bossGnd->GND_EYE_STATE = GND_EYESTATE_BRIGHTEN;
}
if(pthis->timers[0] == 35)
{
@ -301,7 +301,7 @@ void EnfHG_Intro(EnfHG* pthis, GlobalContext* globalCtx)
}
if(pthis->timers[0] == 130)
{
bossGnd->work[GND_EYE_STATE] = GND_EYESTATE_FADE;
bossGnd->GND_EYE_STATE = GND_EYESTATE_FADE;
Common_PlaySfxAtPos(&audioVec_43, NA_SE_EN_FANTOM_ST_LAUGH);
}
if(pthis->timers[0] == 20)
@ -772,7 +772,7 @@ void EnfHG_Draw(Actor* thisx, GlobalContext* globalCtx)
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_fhg.c", 2439);
func_80093D18(globalCtx->state.gfxCtx);
POLY_OPA_DISP = ((bossGnd->work[GND_INVINC_TIMER] & 4) && (bossGnd->flyMode == GND_FLY_PAINTING))
POLY_OPA_DISP = ((bossGnd->GND_INVINC_TIMER & 4) && (bossGnd->flyMode == GND_FLY_PAINTING))
? Gfx_SetFog(POLY_OPA_DISP, 255, 50, 0, 0, 900, 1099)
: Gfx_SetFog(POLY_OPA_DISP, (u32)pthis->warpColorFilterR, (u32)pthis->warpColorFilterG, (u32)pthis->warpColorFilterB, 0, (s32)pthis->warpColorFilterUnk1 + 995, (s32)pthis->warpColorFilterUnk2 + 1000);
func_800A6330(&pthis->actor, globalCtx, &pthis->skin, EnfHG_Noop, 0x23);