1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-17 21:35:11 +00:00

EnGoma OK (#770)

* En_Goma OK

* Label Goma

* Remove asm

* Labeling

* Review changes

* Forgot a comment

* sizeof

* Review comments and fix warnings

* review

Co-authored-by: Fig02 <fig02srl@gmail.com>
This commit is contained in:
Synray 2021-04-12 10:45:58 -07:00 committed by GitHub
parent c952fd4490
commit e3c1b52887
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
52 changed files with 1322 additions and 3420 deletions

View file

@ -977,7 +977,7 @@ void Audio_SequenceChannelProcessScript(SequenceChannel* channel) {
channel->delay--;
goto exit_loop;
}
while (true) {
M64ScriptState* scriptState = &channel->scriptState;
s32 param;
@ -1103,7 +1103,7 @@ void Audio_SequenceChannelProcessScript(SequenceChannel* channel) {
channel->changes.s.pan = true;
break;
case 0xDB:
signedParam = (s8) parameters[0];
signedParam = (s8)parameters[0];
channel->transposition = signedParam;
break;
case 0xDA:
@ -1151,7 +1151,7 @@ void Audio_SequenceChannelProcessScript(SequenceChannel* channel) {
channel->reverb = command;
break;
case 0xC6:
result = (u8)parameters[0]; // category error: should be t not v
result = (u8)parameters[0]; // category error: should be t not v
command = result;
if (player->defaultBank != 0xFF) {
@ -1313,7 +1313,7 @@ void Audio_SequenceChannelProcessScript(SequenceChannel* channel) {
}
break;
case 0xB2:
offset = (u16) parameters[0];
offset = (u16)parameters[0];
channel->unk_22 = *(u16*)(offset + scriptState->value * 2 + player->seqData);
break;
case 0xB4:
@ -1328,19 +1328,19 @@ void Audio_SequenceChannelProcessScript(SequenceChannel* channel) {
break;
case 0xB7:
channel->unk_22 = (parameters[0] == 0) ? gAudioContext.gAudioRandom // odd load here
: gAudioContext.gAudioRandom % parameters[0];
: gAudioContext.gAudioRandom % parameters[0];
break;
case 0xB8:
scriptState->value = (parameters[0] == 0) ? gAudioContext.gAudioRandom
: gAudioContext.gAudioRandom % parameters[0];
: gAudioContext.gAudioRandom % parameters[0];
break;
case 0xBD: {
result = Audio_NextRandom();
channel->unk_22 = (parameters[0] == 0) ? (u32) result : (u32)result % parameters[0];
channel->unk_22 = (parameters[0] == 0) ? (u32)result : (u32)result % parameters[0];
channel->unk_22 += parameters[1];
pad2 = (channel->unk_22 / 0x100) + 0x80; // i is wrong here
param = channel->unk_22 % 0x100;
channel->unk_22 = (pad2 << 8) | param;
channel->unk_22 = (pad2 << 8) | param;
} break;
case 0xB9:
channel->velocityRandomVariance = parameters[0];
@ -1411,15 +1411,15 @@ void Audio_SequenceChannelProcessScript(SequenceChannel* channel) {
case 0x10:
if (lowBits < 8) {
channel->soundScriptIO[lowBits] = -1;
if (func_800E3414(channel->bankId, scriptState->value,
&channel->soundScriptIO[lowBits]) == -1) {
if (func_800E3414(channel->bankId, scriptState->value, &channel->soundScriptIO[lowBits]) ==
-1) {
break;
}
} else {
lowBits -= 8;
channel->soundScriptIO[lowBits] = -1;
if (func_800E3414(channel->bankId, channel->unk_22 + 0x100,
&channel->soundScriptIO[lowBits]) == -1) {
if (func_800E3414(channel->bankId, channel->unk_22 + 0x100, &channel->soundScriptIO[lowBits]) ==
-1) {
break;
}
}
@ -1435,8 +1435,7 @@ void Audio_SequenceChannelProcessScript(SequenceChannel* channel) {
break;
case 0x20:
offset = Audio_M64ReadS16(scriptState);
Audio_SequenceChannelEnable(player, lowBits,
&player->seqData[offset]);
Audio_SequenceChannelEnable(player, lowBits, &player->seqData[offset]);
break;
case 0x30:
command = Audio_M64ReadU8(scriptState);
@ -1450,7 +1449,7 @@ void Audio_SequenceChannelProcessScript(SequenceChannel* channel) {
}
}
exit_loop:
for (i = 0; i < ARRAY_COUNT(channel->layers); i++) {
if (channel->layers[i] != NULL) {
Audio_SeqChannelLayerProcessScript(channel->layers[i]);
@ -1463,7 +1462,8 @@ void Audio_SequenceChannelProcessScript(SequenceChannel* seqChannel);
#endif
#ifdef NON_MATCHING
// regalloc, redundant branch, and extra cast. The large number of pads suggests cases may have their own temp variables.
// regalloc, redundant branch, and extra cast. The large number of pads suggests cases may have their own temp
// variables.
void Audio_SequencePlayerProcessSequence(SequencePlayer* seqPlayer) {
u8 command;
u8 commandLow;
@ -1478,7 +1478,7 @@ void Audio_SequencePlayerProcessSequence(SequencePlayer* seqPlayer) {
s32 pad2;
s32 pad3;
s32 pad4;
if (!seqPlayer->enabled) {
return;
}
@ -1522,7 +1522,7 @@ void Audio_SequencePlayerProcessSequence(SequencePlayer* seqPlayer) {
s32 scriptHandled =
Audio_HandleScriptFlowControl(seqPlayer, seqScript, command,
Audio_GetScriptControlFlowArgument(&seqPlayer->scriptState, command));
if (scriptHandled != 0) {
if (scriptHandled == -1) {
Audio_SequencePlayerDisable(seqPlayer);
@ -1573,7 +1573,7 @@ void Audio_SequencePlayerProcessSequence(SequencePlayer* seqPlayer) {
case 2:
seqPlayer->fadeTimer = offset;
seqPlayer->state = command;
seqPlayer->fadeVelocity = (0 - seqPlayer->fadeVolume) / (s32) seqPlayer->fadeTimer;
seqPlayer->fadeVelocity = (0 - seqPlayer->fadeVolume) / (s32)seqPlayer->fadeTimer;
break;
}
break;
@ -1587,8 +1587,8 @@ void Audio_SequencePlayerProcessSequence(SequencePlayer* seqPlayer) {
case 0:
seqPlayer->fadeTimer = seqPlayer->fadeTimerUnkEu;
if (seqPlayer->fadeTimerUnkEu != 0) {
seqPlayer->fadeVelocity = ((value / 127.0f) - seqPlayer->fadeVolume) /
(s32)(seqPlayer->fadeTimer);
seqPlayer->fadeVelocity =
((value / 127.0f) - seqPlayer->fadeVolume) / (s32)(seqPlayer->fadeTimer);
} else {
seqPlayer->fadeVolume = (s32)value / 127.0f;
}
@ -1617,7 +1617,7 @@ void Audio_SequencePlayerProcessSequence(SequencePlayer* seqPlayer) {
seqPlayer->muteBehavior = Audio_M64ReadU8(seqScript);
break;
case 0xD1:
case 0xD2:
case 0xD2:
temp = Audio_M64ReadS16(seqScript);
data = &seqPlayer->seqData[temp];
if (command == 0xD2) {
@ -1712,19 +1712,16 @@ void Audio_SequencePlayerProcessSequence(SequencePlayer* seqPlayer) {
break;
case 0x90:
temp = Audio_M64ReadS16(seqScript);
Audio_SequenceChannelEnable(seqPlayer, commandLow,
(void*)&seqPlayer->seqData[temp]);
Audio_SequenceChannelEnable(seqPlayer, commandLow, (void*)&seqPlayer->seqData[temp]);
break;
case 0xA0:
tempS = Audio_M64ReadS16(seqScript);
Audio_SequenceChannelEnable(seqPlayer, commandLow,
(void*)&seqScript->pc[tempS]);
Audio_SequenceChannelEnable(seqPlayer, commandLow, (void*)&seqScript->pc[tempS]);
break;
case 0xB0:
command = Audio_M64ReadU8(seqScript);
temp = Audio_M64ReadS16(seqScript);
func_800E390C(command, &seqPlayer->seqData[temp],
&seqPlayer->unk_158[commandLow]);
func_800E390C(command, &seqPlayer->seqData[temp], &seqPlayer->unk_158[commandLow]);
break;
case 0x60: {
command = Audio_M64ReadU8(seqScript); // This shouldn't be cast to u8 when saved

View file

@ -42,9 +42,9 @@ typedef struct {
void func_8006D0EC(GlobalContext* globalCtx, Player* player) {
s32 i;
HorseSpawn horseSpawns[] = {
{ SCENE_SPOT00, -460, 100, 6640, 0, 2 }, { SCENE_SPOT06, -1929, -1025, 768, 0, 2 },
{ SCENE_SPOT09, 2566, -259, 767, 0, 2 }, { SCENE_SPOT12, -328, 10, 953, 0, 2 },
{ SCENE_SPOT20, 928, 0, -2280, 0, 2 },
{ SCENE_SPOT00, -460, 100, 6640, 0, 2 }, { SCENE_SPOT06, -1929, -1025, 768, 0, 2 },
{ SCENE_SPOT09, 2566, -259, 767, 0, 2 }, { SCENE_SPOT12, -328, 10, 953, 0, 2 },
{ SCENE_SPOT20, 928, 0, -2280, 0, 2 },
};
if ((AREG(6) != 0) && (Flags_GetEventChkInf(0x18) || (DREG(1) != 0))) {

View file

@ -1364,8 +1364,8 @@ u32 func_80091738(GlobalContext* globalCtx, u8* segment, SkelAnime* skelAnime) {
gSegments[4] = VIRTUAL_TO_PHYSICAL(segment + 0x3800);
gSegments[6] = VIRTUAL_TO_PHYSICAL(segment + 0x8800);
SkelAnime_InitLink(globalCtx, skelAnime, gPlayerSkelHeaders[(void)0, gSaveContext.linkAge], &gPlayerAnim_003238, 9, ptr,
ptr, PLAYER_LIMB_MAX);
SkelAnime_InitLink(globalCtx, skelAnime, gPlayerSkelHeaders[(void)0, gSaveContext.linkAge], &gPlayerAnim_003238, 9,
ptr, ptr, PLAYER_LIMB_MAX);
return size + 0x8890;
}

View file

@ -305,7 +305,7 @@ void BgJyaCobra_UpdateShadowFromSide(BgJyaCobra* this) {
Matrix_RotateX((M_PI / 4), MTXMODE_NEW);
rotY = !(this->dyna.actor.params & 3) ? (this->dyna.actor.shape.rot.y + 0x4000)
: (this->dyna.actor.shape.rot.y - 0x4000);
: (this->dyna.actor.shape.rot.y - 0x4000);
Matrix_RotateY(rotY * (M_PI / 0x8000), MTXMODE_APPLY);
Matrix_Scale(0.9f, 0.9f, 0.9f, MTXMODE_APPLY);

View file

@ -256,38 +256,37 @@ static u8 sClearPixelTableSecondPass[16 * 16] = {
};
// indexed by limb (where the root limb is 1)
static u8 D_8091B244[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x1E, // tail end/last part
0x28, // tail 2nd to last part
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0A, // back of right claw/hand
0x0F, // front of right claw/hand
0x15, // part of right arm (inner)
0x00, 0x00,
0x19, // part of right arm (shell)
0x00, 0x00,
0x1F, // part of right arm (shell on shoulder)
0x23, // part of right arm (shoulder)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x2B, // end of left antenna
0x30, // middle of left antenna
0x35, // start of left antenna
0x00, 0x00, 0x00, 0x00,
0x2A, // end of right antenna
0x2D, // middle of right antenna
0x35, // start of right antenna
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0B, // back of left claw/hand
0x0F, // front of left claw/hand
0x15, // part of left arm (inner)
0x00, 0x00,
0x19, // part of left arm (shell)
0x00, 0x00,
0x1E, // part of left arm (shell on shoulder)
0x23, // part of left arm (shoulder)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
static u8 sDeadLimbLifetime[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
30, // tail end/last part
40, // tail 2nd to last part
0, 0, 0, 0, 0, 0, 0, 0,
10, // back of right claw/hand
15, // front of right claw/hand
21, // part of right arm (inner)
0, 0,
25, // part of right arm (shell)
0, 0,
31, // part of right arm (shell on shoulder)
35, // part of right arm (shoulder)
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
43, // end of left antenna
48, // middle of left antenna
53, // start of left antenna
0, 0, 0, 0,
42, // end of right antenna
45, // middle of right antenna
53, // start of right antenna
0, 0, 0, 0, 0, 0,
11, // back of left claw/hand
15, // front of left claw/hand
21, // part of left arm (inner)
0, 0,
25, // part of left arm (shell)
0, 0,
30, // part of left arm (shell on shoulder)
35, // part of left arm (shoulder)
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
/**
@ -1004,7 +1003,7 @@ void BossGoma_Defeated(BossGoma* this, GlobalContext* globalCtx) {
if (this->framesUntilNextAction == 1001) {
for (i = 0; i < 90; i++) {
if (D_8091B244[i] != 0) {
if (sDeadLimbLifetime[i] != 0) {
this->deadLimbsState[i] = 1;
}
}
@ -2073,9 +2072,9 @@ void BossGoma_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
// These are the pieces of Gohma as it falls apart. It appears to use the same actor as the baby gohmas.
babyGohma = (EnGoma*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_GOMA,
childPos.x, childPos.y, childPos.z, childRot.x, childRot.y, childRot.z,
D_8091B244[limbIndex] + 100);
sDeadLimbLifetime[limbIndex] + 100);
if (babyGohma != NULL) {
babyGohma->unk_308 = *dList;
babyGohma->bossLimbDl = *dList;
babyGohma->actor.objBankIndex = this->actor.objBankIndex;
}
}

View file

@ -630,7 +630,8 @@ void EnGe1_TalkNoPrize_Archery(EnGe1* this, GlobalContext* globalCtx) {
void EnGe1_TalkAfterGame_Archery(EnGe1* this, GlobalContext* globalCtx) {
gSaveContext.eventInf[0] &= ~0x100;
LOG_NUM("z_common_data.yabusame_total", gSaveContext.minigameScore, "../z_en_ge1.c", 1110);
LOG_NUM("z_common_data.memory.information.room_inf[127][ 0 ]", gSaveContext.highScores[HS_HBA], "../z_en_ge1.c", 1111);
LOG_NUM("z_common_data.memory.information.room_inf[127][ 0 ]", gSaveContext.highScores[HS_HBA], "../z_en_ge1.c",
1111);
this->actor.flags |= 0x10000;
if (gSaveContext.highScores[HS_HBA] < gSaveContext.minigameScore) {
@ -810,6 +811,6 @@ void EnGe1_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sEyeTextures[this->eyeIndex]));
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
EnGe1_OverrideLimbDraw, EnGe1_PostLimbDraw, this);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_ge1.c", 1459);
}

View file

@ -1,5 +1,7 @@
#include "z_en_goma.h"
#include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h"
#include "overlays/actors/ovl_Boss_Goma/z_boss_goma.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
#define FLAGS 0x00000035
@ -10,18 +12,48 @@ void EnGoma_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnGoma_Update(Actor* thisx, GlobalContext* globalCtx);
void EnGoma_Draw(Actor* thisx, GlobalContext* globalCtx);
extern UNK_TYPE D_0600017C;
extern UNK_TYPE D_06000334;
extern UNK_TYPE D_06000544;
extern UNK_TYPE D_06000838;
extern UNK_TYPE D_06000B78;
extern UNK_TYPE D_06000E4C;
extern UNK_TYPE D_06001548;
extern UNK_TYPE D_06002A70;
extern UNK_TYPE D_06003B40;
extern UNK_TYPE D_06003D78;
void EnGoma_Flee(EnGoma* this, GlobalContext* globalCtx);
void EnGoma_EggFallToGround(EnGoma* this, GlobalContext* globalCtx);
void EnGoma_Egg(EnGoma* this, GlobalContext* globalCtx);
void EnGoma_Hatch(EnGoma* this, GlobalContext* globalCtx);
void EnGoma_Hurt(EnGoma* this, GlobalContext* globalCtx);
void EnGoma_Die(EnGoma* this, GlobalContext* globalCtx);
void EnGoma_Dead(EnGoma* this, GlobalContext* globalCtx);
void EnGoma_PrepareJump(EnGoma* this, GlobalContext* globalCtx);
void EnGoma_Land(EnGoma* this, GlobalContext* globalCtx);
void EnGoma_Jump(EnGoma* this, GlobalContext* globalCtx);
void EnGoma_Stand(EnGoma* this, GlobalContext* globalCtx);
void EnGoma_ChasePlayer(EnGoma* this, GlobalContext* globalCtx);
void EnGoma_Stunned(EnGoma* this, GlobalContext* globalCtx);
void EnGoma_LookAtPlayer(EnGoma* this, GlobalContext* globalCtx);
void EnGoma_UpdateHit(EnGoma* this, GlobalContext* globalCtx);
void EnGoma_Debris(EnGoma* this, GlobalContext* globalCtx);
void EnGoma_SpawnHatchDebris(EnGoma* this, GlobalContext* globalCtx2);
void EnGoma_BossLimb(EnGoma* this, GlobalContext* globalCtx);
void EnGoma_SetupFlee(EnGoma* this);
void EnGoma_SetupHatch(EnGoma* this, GlobalContext* globalCtx);
void EnGoma_SetupHurt(EnGoma* this, GlobalContext* globalCtx);
void EnGoma_SetupDie(EnGoma* this);
void EnGoma_SetupDead(EnGoma* this);
void EnGoma_SetupStand(EnGoma* this);
void EnGoma_SetupChasePlayer(EnGoma* this);
void EnGoma_SetupPrepareJump(EnGoma* this);
void EnGoma_SetupLand(EnGoma* this);
void EnGoma_SetupJump(EnGoma* this);
void EnGoma_SetupStunned(EnGoma* this, GlobalContext* globalCtx);
extern AnimationHeader D_0600017C;
extern AnimationHeader D_06000334;
extern AnimationHeader D_06000544;
extern AnimationHeader D_06000838;
extern AnimationHeader D_06000B78;
extern AnimationHeader D_06000E4C;
extern AnimationHeader D_06001548;
extern Gfx D_06002A70[]; // Egg DL
extern SkeletonHeader D_06003B40;
extern AnimationHeader D_06003D78;
/*
const ActorInit En_Goma_InitVars = {
ACTOR_BOSS_GOMA,
ACTORCAT_ENEMY,
@ -73,77 +105,807 @@ static ColliderCylinderInit D_80A4B7CC = {
},
{ 15, 30, 10, { 0, 0, 0 } },
};
*/
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/EnGoma_Init.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/EnGoma_Destroy.s")
static u8 sSpawnNum = 0;
static Vec3f sDeadEffectVel = { 0.0f, 0.0f, 0.0f };
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A49294.s")
static InitChainEntry sInitChain[] = {
ICHAIN_U8(targetMode, 3, ICHAIN_CONTINUE),
ICHAIN_S8(naviEnemyId, 3, ICHAIN_CONTINUE),
ICHAIN_F32_DIV1000(gravity, 0, ICHAIN_CONTINUE),
ICHAIN_F32(targetArrowOffset, 20, ICHAIN_STOP),
};
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A49338.s")
void EnGoma_Init(Actor* thisx, GlobalContext* globalCtx) {
EnGoma* this = THIS;
s16 params;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A493D8.s")
this->eggTimer = Rand_ZeroOne() * 200.0f;
Actor_ProcessInitChain(&this->actor, sInitChain);
Actor_SetScale(&this->actor, 0.01f);
params = this->actor.params;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A49668.s")
if (params >= 100) { // piece of boss goma
Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_BOSS);
this->actionFunc = EnGoma_BossLimb;
this->gomaType = ENGOMA_BOSSLIMB;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.0f);
this->actionTimer = this->actor.params + 150;
this->actor.flags &= ~1;
} else if (params >= 10) { // Debris when hatching
this->actor.gravity = -1.3f;
this->actor.flags &= ~1;
this->actionTimer = 50;
this->gomaType = ENGOMA_HATCH_DEBRIS;
this->eggScale = 1.0f;
this->actor.velocity.y = Rand_ZeroOne() * 5.0f + 5.0f;
this->actionFunc = EnGoma_Debris;
this->actor.speedXZ = Rand_ZeroOne() * 2.3f + 1.5f;
this->actionTimer = 30;
this->actor.scale.x = Rand_ZeroOne() * 0.005f + 0.01f;
this->actor.scale.y = Rand_ZeroOne() * 0.005f + 0.01f;
this->actor.scale.z = Rand_ZeroOne() * 0.005f + 0.01f;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.0f);
} else { // Egg
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 40.0f);
SkelAnime_Init(globalCtx, &this->skelanime, &D_06003B40, &D_06001548, this->jointTable, this->morphTable, 24);
Animation_PlayLoop(&this->skelanime, &D_06001548);
this->actor.colChkInfo.health = 2;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A498A8.s")
if (this->actor.params < 3) { // Spawned by boss
this->actionFunc = EnGoma_EggFallToGround;
this->invincibilityTimer = 10;
this->actor.speedXZ = 1.5f;
} else if (this->actor.params == 8 || this->actor.params == 6) {
this->actionFunc = EnGoma_Egg;
this->spawnNum = sSpawnNum++;
} else if (this->actor.params == 9 || this->actor.params == 7) {
this->actionFunc = EnGoma_Egg;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A49974.s")
if (this->actor.params >= 8) { // on ceiling
this->eggYOffset = -1500.0f;
} else {
this->eggYOffset = 1500.0f;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A499BC.s")
this->gomaType = ENGOMA_EGG;
this->eggScale = 1.0f;
this->eggSquishAngle = Rand_ZeroOne() * 1000.0f;
this->actionTimer = 50;
Collider_InitCylinder(globalCtx, &this->colCyl1);
Collider_SetCylinder(globalCtx, &this->colCyl1, &this->actor, &D_80A4B7A0);
Collider_InitCylinder(globalCtx, &this->colCyl2);
Collider_SetCylinder(globalCtx, &this->colCyl2, &this->actor, &D_80A4B7CC);
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A49AA8.s")
void EnGoma_Destroy(Actor* thisx, GlobalContext* globalCtx) {
EnGoma* this = THIS;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A49B30.s")
if (this->actor.params < 10) {
Collider_DestroyCylinder(globalCtx, &this->colCyl1);
Collider_DestroyCylinder(globalCtx, &this->colCyl2);
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A49BF0.s")
void EnGoma_SetupFlee(EnGoma* this) {
Animation_Change(&this->skelanime, &D_06003D78, 2.0f, 0.0f, Animation_GetLastFrame(&D_06003D78), ANIMMODE_LOOP,
-2.0f);
this->actionFunc = EnGoma_Flee;
this->actionTimer = 20;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A49C94.s")
if (this->actor.params < 6) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_BJR_DAM2);
} else {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_DAM2);
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A49D0C.s")
void EnGoma_Flee(EnGoma* this, GlobalContext* globalCtx) {
SkelAnime_Update(&this->skelanime);
Math_ApproachF(&this->actor.speedXZ, 6.6666665f, 0.5f, 2.0f);
Math_ApproachS(&this->actor.world.rot.y, Actor_WorldYawTowardActor(&this->actor, &PLAYER->actor) + 0x8000, 3, 2000);
Math_ApproachS(&this->actor.shape.rot.y, this->actor.world.rot.y, 2, 3000);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A49E80.s")
if (this->actionTimer == 0) {
EnGoma_SetupStand(this);
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A49F10.s")
void EnGoma_EggFallToGround(EnGoma* this, GlobalContext* globalCtx) {
this->actor.gravity = -1.3f;
this->eggSquishAccel += 0.03f;
this->eggSquishAngle += 1.0f + this->eggSquishAccel;
Math_ApproachZeroF(&this->eggSquishAmount, 1.0f, 0.005f);
Math_ApproachF(&this->eggYOffset, 1500.0f, 1.0f, 150.0f);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A49F94.s")
switch (this->hatchState) {
case 0:
if (this->actor.bgCheckFlags & 1) { // floor
if (this->actor.params < 6) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_BJR_EGG1);
} else {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_EGG1);
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A010.s")
if (this->actor.params > 5) {
EnGoma_SetupHatch(this, globalCtx);
} else {
this->hatchState = 1;
this->actionTimer = 3;
Math_ApproachF(&this->eggScale, 1.5f, 0.5f, 1.0f);
}
}
break;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A0A8.s")
case 1:
if (this->actionTimer == 0) {
this->hatchState = 2;
this->actionTimer = 3;
Math_ApproachF(&this->eggScale, 0.75f, 0.5f, 1.0f);
this->actor.velocity.y = 5.0f;
this->actor.speedXZ = 2.0f;
} else {
Math_ApproachF(&this->eggScale, 1.5f, 0.5f, 1.0f);
}
break;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A120.s")
case 2:
if (this->actionTimer == 0) {
this->hatchState = 3;
this->actionTimer = 80;
} else {
Math_ApproachF(&this->eggScale, 0.75f, 0.5f, 1.0f);
}
break;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A18C.s")
case 3:
Math_ApproachF(&this->eggScale, 1.0f, 0.1f, 0.1f);
if (this->actionTimer == 0) {
EnGoma_SetupHatch(this, globalCtx);
}
break;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A234.s")
if (this->actor.bgCheckFlags & 1) {
Math_ApproachZeroF(&this->actor.speedXZ, 0.2f, 0.05f);
}
this->eggPitch += (this->actor.speedXZ * 0.1f);
this->actor.shape.rot.y = this->actor.world.rot.y;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A2EC.s")
void EnGoma_Egg(EnGoma* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
s32 i;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A368.s")
this->eggSquishAngle += 1.0f;
Math_ApproachF(&this->eggSquishAmount, 0.1f, 1.0f, 0.005f);
if (fabsf(this->actor.world.pos.x - player->actor.world.pos.x) < 100.0f &&
fabsf(this->actor.world.pos.z - player->actor.world.pos.z) < 100.0f) {
if (++this->playerDetectionTimer > 9) {
this->actionFunc = EnGoma_EggFallToGround;
}
} else {
this->playerDetectionTimer = 0;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A470.s")
if (!(this->eggTimer & 0xF) && Rand_ZeroOne() < 0.5f) {
for (i = 0; i < 2; i++) {
Vec3f vel = { 0.0f, 0.0f, 0.0f };
Vec3f acc = { 0.0f, -0.5f, 0.0f };
Vec3f pos;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A50C.s")
pos.x = Rand_CenteredFloat(30.0f) + this->actor.world.pos.x;
pos.y = Rand_ZeroFloat(30.0f) + this->actor.world.pos.y;
pos.z = Rand_CenteredFloat(30.0f) + this->actor.world.pos.z;
EffectSsHahen_Spawn(globalCtx, &pos, &vel, &acc, 0, (s16)(Rand_ZeroOne() * 5.0f) + 10, HAHEN_OBJECT_DEFAULT,
10, NULL);
}
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A608.s")
void EnGoma_SetupHatch(EnGoma* this, GlobalContext* globalCtx) {
Animation_Change(&this->skelanime, &D_06000544, 1.0f, 0.0f, Animation_GetLastFrame(&D_06000544), ANIMMODE_ONCE,
0.0f);
this->actionFunc = EnGoma_Hatch;
Actor_SetScale(&this->actor, 0.005f);
this->gomaType = ENGOMA_NORMAL;
this->actionTimer = 5;
this->actor.shape.rot.y = Actor_WorldYawTowardActor(&this->actor, &PLAYER->actor);
this->actor.world.rot.y = this->actor.shape.rot.y;
EnGoma_SpawnHatchDebris(this, globalCtx);
this->eggScale = 1.0f;
this->actor.speedXZ = 0.0f;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A6AC.s")
void EnGoma_Hatch(EnGoma* this, GlobalContext* globalCtx) {
SkelAnime_Update(&this->skelanime);
if (this->actionTimer == 0) {
EnGoma_SetupStand(this);
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A8D4.s")
void EnGoma_SetupHurt(EnGoma* this, GlobalContext* globalCtx) {
Animation_Change(&this->skelanime, &D_06000838, 1.0f, 0.0f, Animation_GetLastFrame(&D_06000838), ANIMMODE_ONCE,
-2.0f);
this->actionFunc = EnGoma_Hurt;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A964.s")
if ((s8)this->actor.colChkInfo.health <= 0) {
this->actionTimer = 5;
func_80032C7C(globalCtx, &this->actor);
} else {
this->actionTimer = 10;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/EnGoma_Update.s")
this->actor.speedXZ = 20.0f;
this->actor.world.rot.y = this->actor.yawTowardsPlayer + 0x8000;
if (this->actor.params < 6) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_BJR_DAM1);
} else {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_DAM1);
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4ACC0.s")
void EnGoma_Hurt(EnGoma* this, GlobalContext* globalCtx) {
SkelAnime_Update(&this->skelanime);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4AE60.s")
if (this->actor.bgCheckFlags & 1) {
Math_ApproachZeroF(&this->actor.speedXZ, 1.0f, 2.0f);
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/EnGoma_Draw.s")
if (this->actionTimer == 0) {
if ((s8)this->actor.colChkInfo.health <= 0) {
EnGoma_SetupDie(this);
} else {
EnGoma_SetupFlee(this);
}
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4B3AC.s")
void EnGoma_SetupDie(EnGoma* this) {
Animation_Change(&this->skelanime, &D_06000B78, 1.0f, 0.0f, Animation_GetLastFrame(&D_06000B78), ANIMMODE_ONCE,
-2.0f);
this->actionFunc = EnGoma_Die;
this->actionTimer = 30;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4B3F0.s")
if (this->actor.params < 6) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_BJR_DEAD);
} else {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_DEAD);
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4B554.s")
this->invincibilityTimer = 100;
this->actor.flags &= ~1;
}
void EnGoma_Die(EnGoma* this, GlobalContext* globalCtx) {
SkelAnime_Update(&this->skelanime);
if (this->actor.bgCheckFlags & 1) {
Math_ApproachZeroF(&this->actor.speedXZ, 1.0f, 2.0f);
}
if (this->actionTimer == 17) {
if (this->actor.params < 6) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_BJR_LAND);
} else {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_LAND);
}
}
if (this->actionTimer == 0) {
EnGoma_SetupDead(this);
}
}
void EnGoma_SetupDead(EnGoma* this) {
Animation_Change(&this->skelanime, &D_06000334, 1.0f, 0.0f, Animation_GetLastFrame(&D_06000334), ANIMMODE_LOOP,
-2.0f);
this->actionFunc = EnGoma_Dead;
this->actionTimer = 3;
}
void EnGoma_Dead(EnGoma* this, GlobalContext* globalCtx) {
Vec3f accel;
Vec3f pos;
SkelAnime_Update(&this->skelanime);
Math_ApproachZeroF(&this->actor.speedXZ, 1.0f, 2.0f);
if (this->actionTimer == 2) {
pos.x = this->actor.world.pos.x;
pos.y = (this->actor.world.pos.y + 5.0f) - 10.0f;
pos.z = this->actor.world.pos.z;
accel = sDeadEffectVel;
accel.y = 0.03f;
EffectSsKFire_Spawn(globalCtx, &pos, &sDeadEffectVel, &accel, 40, 0);
}
if (this->actionTimer == 0 && Math_SmoothStepToF(&this->actor.scale.y, 0.0f, 0.5f, 0.00225f, 0.00001f) <= 0.001f) {
if (this->actor.params < 6) {
BossGoma* parent = (BossGoma*)this->actor.parent;
parent->childrenGohmaState[this->actor.params] = -1;
}
Audio_PlaySoundGeneral(NA_SE_EN_EXTINCT, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8);
Actor_Kill(&this->actor);
Item_DropCollectibleRandom(globalCtx, NULL, &this->actor.world.pos, 0x30);
}
this->visualState = 2;
}
void EnGoma_SetupStand(EnGoma* this) {
f32 lastFrame;
lastFrame = Animation_GetLastFrame(&D_06001548);
this->actionTimer = Rand_S16Offset(10, 30);
Animation_Change(&this->skelanime, &D_06001548, 1.0f, 0.0f, lastFrame, ANIMMODE_LOOP, -5.0f);
this->actionFunc = EnGoma_Stand;
this->gomaType = ENGOMA_NORMAL;
}
void EnGoma_SetupChasePlayer(EnGoma* this) {
Animation_Change(&this->skelanime, &D_06003D78, 1.0f, 0.0f, Animation_GetLastFrame(&D_06003D78), ANIMMODE_LOOP,
-5.0f);
this->actionFunc = EnGoma_ChasePlayer;
this->actionTimer = Rand_S16Offset(70, 110);
}
void EnGoma_SetupPrepareJump(EnGoma* this) {
Animation_Change(&this->skelanime, &D_06000E4C, 1.0f, 0.0f, Animation_GetLastFrame(&D_06000E4C), ANIMMODE_ONCE,
-5.0f);
this->actionFunc = EnGoma_PrepareJump;
this->actionTimer = 30;
}
void EnGoma_PrepareJump(EnGoma* this, GlobalContext* globalCtx) {
s16 targetAngle;
SkelAnime_Update(&this->skelanime);
Math_ApproachZeroF(&this->actor.speedXZ, 0.5f, 2.0f);
targetAngle = Actor_WorldYawTowardActor(&this->actor, &PLAYER->actor);
Math_ApproachS(&this->actor.world.rot.y, targetAngle, 2, 4000);
Math_ApproachS(&this->actor.shape.rot.y, targetAngle, 2, 3000);
if (this->actionTimer == 0) {
EnGoma_SetupJump(this);
}
this->visualState = 0;
}
void EnGoma_SetupLand(EnGoma* this) {
Animation_Change(&this->skelanime, &D_0600017C, 1.0f, 0.0f, Animation_GetLastFrame(&D_0600017C), ANIMMODE_ONCE,
0.0f);
this->actionFunc = EnGoma_Land;
this->actionTimer = 10;
}
void EnGoma_Land(EnGoma* this, GlobalContext* globalCtx) {
SkelAnime_Update(&this->skelanime);
if (this->actor.bgCheckFlags & 1) {
Math_ApproachZeroF(&this->actor.speedXZ, 1.0f, 2.0f);
}
if (this->actionTimer == 0) {
EnGoma_SetupStand(this);
}
}
void EnGoma_SetupJump(EnGoma* this) {
Animation_Change(&this->skelanime, &D_06000544, 1.0f, 0.0f, Animation_GetLastFrame(&D_06000544), ANIMMODE_ONCE,
0.0f);
this->actionFunc = EnGoma_Jump;
this->actor.velocity.y = 8.0f;
if (this->actor.params < 6) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_BJR_CRY);
} else {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_CRY);
}
}
void EnGoma_Jump(EnGoma* this, GlobalContext* globalCtx) {
this->actor.flags |= 0x1000000;
SkelAnime_Update(&this->skelanime);
Math_ApproachF(&this->actor.speedXZ, 10.0f, 0.5f, 5.0f);
if (this->actor.velocity.y <= 0.0f && (this->actor.bgCheckFlags & 1)) {
EnGoma_SetupLand(this);
if (this->actor.params < 6) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_BJR_LAND2);
} else {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_LAND2);
}
}
this->visualState = 0;
}
void EnGoma_Stand(EnGoma* this, GlobalContext* globalCtx) {
SkelAnime_Update(&this->skelanime);
Math_ApproachZeroF(&this->actor.speedXZ, 0.5f, 2.0f);
Math_ApproachS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, &PLAYER->actor), 2, 3000);
if (this->actionTimer == 0) {
EnGoma_SetupChasePlayer(this);
}
}
void EnGoma_ChasePlayer(EnGoma* this, GlobalContext* globalCtx) {
SkelAnime_Update(&this->skelanime);
if (Animation_OnFrame(&this->skelanime, 1.0f) || Animation_OnFrame(&this->skelanime, 5.0f)) {
if (this->actor.params < 6) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_BJR_WALK);
} else {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_WALK);
}
}
Math_ApproachF(&this->actor.speedXZ, 3.3333333f, 0.5f, 2.0f);
Math_ApproachS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 3, 2000);
Math_ApproachS(&this->actor.shape.rot.y, this->actor.world.rot.y, 2, 3000);
if (this->actor.bgCheckFlags & 1) {
this->actor.velocity.y = 0.0f;
}
if (this->actor.xzDistToPlayer <= 150.0f) {
EnGoma_SetupPrepareJump(this);
}
}
void EnGoma_SetupStunned(EnGoma* this, GlobalContext* globalCtx) {
this->actionFunc = EnGoma_Stunned;
this->stunTimer = 100;
Animation_MorphToLoop(&this->skelanime, &D_06001548, -5.0f);
this->actionTimer = (s16)Rand_ZeroFloat(15.0f) + 3;
if (this->actor.params < 6) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_BJR_FREEZE);
} else {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE);
}
}
void EnGoma_Stunned(EnGoma* this, GlobalContext* globalCtx) {
Actor_SetColorFilter(&this->actor, 0, 180, 0, 2);
this->visualState = 2;
if (this->actionTimer != 0) {
SkelAnime_Update(&this->skelanime);
}
if (this->actor.bgCheckFlags & 1) {
this->actor.velocity.y = 0.0f;
Math_ApproachZeroF(&this->actor.speedXZ, 0.5f, 2.0f);
}
if (this->stunTimer == 0) {
EnGoma_SetupStand(this);
} else if (--this->stunTimer < 30) {
if (this->stunTimer & 1) {
this->actor.world.pos.x += 1.5f;
this->actor.world.pos.z += 1.5f;
} else {
this->actor.world.pos.x -= 1.5f;
this->actor.world.pos.z -= 1.5f;
}
}
}
void EnGoma_LookAtPlayer(EnGoma* this, GlobalContext* globalCtx) {
s16 eyePitch;
s16 eyeYaw;
eyeYaw = Actor_WorldYawTowardActor(&this->actor, &PLAYER->actor) - this->actor.shape.rot.y;
eyePitch = Actor_WorldPitchTowardActor(&this->actor, &PLAYER->actor) - this->actor.shape.rot.x;
if (eyeYaw > 6000) {
eyeYaw = 6000;
}
if (eyeYaw < -6000) {
eyeYaw = -6000;
}
Math_ApproachS(&this->eyeYaw, eyeYaw, 3, 2000);
Math_ApproachS(&this->eyePitch, eyePitch, 3, 2000);
}
void EnGoma_UpdateHit(EnGoma* this, GlobalContext* globalCtx) {
static Vec3f sShieldKnockbackVel = { 0.0f, 0.0f, 20.0f };
Player* player = PLAYER;
if (this->hurtTimer != 0) {
this->hurtTimer--;
} else {
ColliderInfo* acHitInfo;
u8 swordDamage;
if ((this->colCyl1.base.atFlags & 2) && this->actionFunc == EnGoma_Jump) {
EnGoma_SetupLand(this);
this->actor.speedXZ = 0.0f;
this->actor.velocity.y = 0.0f;
}
if ((this->colCyl2.base.acFlags & AC_HIT) && (s8)this->actor.colChkInfo.health > 0) {
acHitInfo = this->colCyl2.info.acHitInfo;
this->colCyl2.base.acFlags &= ~AC_HIT;
if (this->gomaType == ENGOMA_NORMAL) {
u32 dmgFlags = acHitInfo->toucher.dmgFlags;
if (dmgFlags & 0x100000) {
if (this->actionFunc == EnGoma_Jump) {
EnGoma_SetupLand(this);
this->actor.velocity.y = 0.0f;
this->actor.speedXZ = -5.0f;
} else {
Matrix_RotateY(player->actor.shape.rot.y / 32768.0f * 3.1415927f, MTXMODE_NEW);
Matrix_MultVec3f(&sShieldKnockbackVel, &this->shieldKnockbackVel);
this->invincibilityTimer = 5;
}
} else if (dmgFlags & 1) { // stun
if (this->actionFunc != EnGoma_Stunned) {
EnGoma_SetupStunned(this, globalCtx);
this->hurtTimer = 8;
}
} else {
swordDamage = CollisionCheck_GetSwordDamage(dmgFlags);
if (swordDamage) {
EffectSsSibuki_SpawnBurst(globalCtx, &this->actor.focus.pos);
} else {
swordDamage = 1;
}
this->actor.colChkInfo.health -= swordDamage;
EnGoma_SetupHurt(this, globalCtx);
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 5);
this->hurtTimer = 13;
}
} else {
// die if still an egg
if (this->actor.params <= 5) { //! BossGoma only has 3 children
BossGoma* parent = (BossGoma*)this->actor.parent;
parent->childrenGohmaState[this->actor.params] = -1;
}
EnGoma_SpawnHatchDebris(this, globalCtx);
Actor_Kill(&this->actor);
}
}
}
}
void EnGoma_UpdateEyeEnvColor(EnGoma* this) {
static f32 sTargetEyeEnvColors[][3] = {
{ 255.0f, 0.0f, 50.0f },
{ 17.0f, 255.0f, 50.0f },
{ 0.0f, 170.0f, 50.0f },
};
Math_ApproachF(&this->eyeEnvColor[0], sTargetEyeEnvColors[0][this->visualState], 0.5f, 20.0f);
Math_ApproachF(&this->eyeEnvColor[1], sTargetEyeEnvColors[1][this->visualState], 0.5f, 20.0f);
Math_ApproachF(&this->eyeEnvColor[2], sTargetEyeEnvColors[2][this->visualState], 0.5f, 20.0f);
}
void EnGoma_SetFloorRot(EnGoma* this) {
f32 nx;
f32 ny;
f32 nz;
if (this->actor.floorPoly != NULL) {
nx = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.x);
ny = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.y);
nz = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.z);
Math_ApproachS(&this->slopePitch, -Math_FAtan2F(-nz * ny, 1.0f) * 10430.378f, 1, 1000);
Math_ApproachS(&this->slopeRoll, Math_FAtan2F(-nx * ny, 1.0f) * 10430.378f, 1, 1000);
}
}
void EnGoma_Update(Actor* thisx, GlobalContext* globalCtx) {
EnGoma* this = THIS;
s32 pad;
Player* player = PLAYER;
if (this->actionTimer != 0) {
this->actionTimer--;
}
if (this->invincibilityTimer != 0) {
this->invincibilityTimer--;
}
this->actionFunc(this, globalCtx);
Actor_MoveForward(&this->actor);
this->actor.world.pos.x = this->actor.world.pos.x + this->shieldKnockbackVel.x;
this->actor.world.pos.z = this->actor.world.pos.z + this->shieldKnockbackVel.z;
Math_ApproachZeroF(&this->shieldKnockbackVel.x, 1.0f, 3.0f);
Math_ApproachZeroF(&this->shieldKnockbackVel.z, 1.0f, 3.0f);
if (this->actor.params < 10) {
this->eggTimer++;
Math_SmoothStepToF(&this->actor.scale.x, 0.01f, 0.5f, 0.00075f, 0.000001f);
Math_SmoothStepToF(&this->actor.scale.y, 0.01f, 0.5f, 0.00075f, 0.000001f);
Math_SmoothStepToF(&this->actor.scale.z, 0.01f, 0.5f, 0.00075f, 0.000001f);
EnGoma_UpdateHit(this, globalCtx);
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 50.0f, 50.0f, 100.0f, 5);
EnGoma_SetFloorRot(this);
Actor_SetFocus(&this->actor, 20.0f);
EnGoma_LookAtPlayer(this, globalCtx);
EnGoma_UpdateEyeEnvColor(this);
this->visualState = 1;
if (player->swordState != 0) {
this->colCyl2.dim.radius = 35;
this->colCyl2.dim.height = 35;
this->colCyl2.dim.yShift = 0;
} else {
this->colCyl2.dim.radius = 15;
this->colCyl2.dim.height = 30;
this->colCyl2.dim.yShift = 10;
}
if (this->invincibilityTimer == 0) {
Collider_UpdateCylinder(&this->actor, &this->colCyl1);
Collider_UpdateCylinder(&this->actor, &this->colCyl2);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colCyl1.base);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colCyl2.base);
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->colCyl1.base);
}
}
}
s32 EnGoma_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) {
EnGoma* this = THIS;
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_goma.c", 1976);
gDPSetEnvColor(POLY_OPA_DISP++, (s16)this->eyeEnvColor[0], (s16)this->eyeEnvColor[1], (s16)this->eyeEnvColor[2],
255);
if (limbIndex == 7) {
rot->x += this->eyePitch;
rot->y += this->eyeYaw;
} else if (limbIndex == 3 && this->hurtTimer != 0) {
gDPSetEnvColor(POLY_OPA_DISP++, (s16)(Rand_ZeroOne() * 255.0f), (s16)(Rand_ZeroOne() * 255.0f),
(s16)(Rand_ZeroOne() * 255.0f), 255);
}
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_goma.c", 2011);
return 0;
}
Gfx* EnGoma_NoBackfaceCullingDlist(GraphicsContext* gfxCtx) {
Gfx* dListHead;
Gfx* dList;
dListHead = dList = Graph_Alloc(gfxCtx, sizeof(Gfx) * 4);
gDPPipeSync(dListHead++);
gDPSetRenderMode(dListHead++, G_RM_PASS, G_RM_AA_ZB_TEX_EDGE2);
gSPClearGeometryMode(dListHead++, G_CULL_BACK);
gSPEndDisplayList(dListHead++);
return dList;
}
void EnGoma_Draw(Actor* thisx, GlobalContext* globalCtx) {
EnGoma* this = THIS;
s32 y;
s32 pad;
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_goma.c", 2040);
func_80093D18(globalCtx->state.gfxCtx);
switch (this->gomaType) {
case ENGOMA_NORMAL:
this->actor.naviEnemyId = 3;
Matrix_Translate(this->actor.world.pos.x,
this->actor.world.pos.y + ((this->actor.shape.yOffset * this->actor.scale.y) +
globalCtx->mainCamera.skyboxOffset.y),
this->actor.world.pos.z, MTXMODE_NEW);
Matrix_RotateX(this->slopePitch / 32768.0f * 3.1415927f, MTXMODE_APPLY);
Matrix_RotateZ(this->slopeRoll / 32768.0f * 3.1415927f, MTXMODE_APPLY);
Matrix_RotateY(this->actor.shape.rot.y / 32768.0f * 3.1415927f, MTXMODE_APPLY);
Matrix_RotateX(this->actor.shape.rot.x / 32768.0f * 3.1415927f, MTXMODE_APPLY);
Matrix_RotateZ(this->actor.shape.rot.z / 32768.0f * 3.1415927f, MTXMODE_APPLY);
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
SkelAnime_DrawOpa(globalCtx, this->skelanime.skeleton, this->skelanime.jointTable, EnGoma_OverrideLimbDraw,
NULL, this);
break;
case ENGOMA_EGG:
this->actor.naviEnemyId = 2;
y = (s16)(sinf((this->eggTimer * 5.0f * 3.1415f) / 180.0f) * 31.9f);
y = (s16)(y + 31);
gSPSegment(POLY_OPA_DISP++, 0x08, func_80094E78(globalCtx->state.gfxCtx, 0, y));
Matrix_Push();
Matrix_Scale(this->eggScale, 1.0f / this->eggScale, this->eggScale, MTXMODE_APPLY);
Matrix_RotateY(this->eggSquishAngle * 0.15f, MTXMODE_APPLY);
Matrix_RotateZ(this->eggSquishAngle * 0.1f, MTXMODE_APPLY);
Matrix_Scale(0.95f - this->eggSquishAmount, this->eggSquishAmount + 1.05f, 0.95f - this->eggSquishAmount,
MTXMODE_APPLY);
Matrix_RotateZ(-(this->eggSquishAngle * 0.1f), MTXMODE_APPLY);
Matrix_RotateY(-(this->eggSquishAngle * 0.15f), MTXMODE_APPLY);
Matrix_Translate(0.0f, this->eggYOffset, 0.0f, MTXMODE_APPLY);
Matrix_RotateX(this->eggPitch, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_goma.c", 2101),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, D_06002A70);
Matrix_Pop();
break;
case ENGOMA_HATCH_DEBRIS:
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_goma.c", 2107),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, gBrownFragmentDL);
break;
case ENGOMA_BOSSLIMB:
if (this->bossLimbDl != NULL) {
gSPSegment(POLY_OPA_DISP++, 0x08, EnGoma_NoBackfaceCullingDlist(globalCtx->state.gfxCtx));
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_goma.c", 2114),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, this->bossLimbDl);
}
break;
}
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_goma.c", 2119);
}
void EnGoma_Debris(EnGoma* this, GlobalContext* globalCtx) {
this->actor.shape.rot.y += 2500;
this->actor.shape.rot.x += 3500;
if (this->actionTimer == 0) {
Actor_Kill(&this->actor);
}
}
void EnGoma_SpawnHatchDebris(EnGoma* this, GlobalContext* globalCtx2) {
GlobalContext* globalCtx = globalCtx2;
s16 i;
if (this->actor.params < 6) {
Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 0x28, NA_SE_EN_GOMA_BJR_EGG2);
} else {
Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 0x28, NA_SE_EN_GOMA_EGG2);
}
for (i = 0; i < 15; i++) {
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_GOMA,
Rand_CenteredFloat(10.0f) + this->actor.world.pos.x,
Rand_CenteredFloat(10.0f) + this->actor.world.pos.y + 15.0f,
Rand_CenteredFloat(10.0f) + this->actor.world.pos.z, 0, Rand_CenteredFloat(65535.99f), 0,
i + 10);
}
}
void EnGoma_BossLimb(EnGoma* this, GlobalContext* globalCtx) {
Vec3f vel = { 0.0f, 0.0f, 0.0f };
Vec3f accel = { 0.0f, 1.0f, 0.0f };
Color_RGBA8 primColor = { 255, 255, 255, 255 };
Color_RGBA8 envColor = { 0, 100, 255, 255 };
Vec3f pos;
this->actor.world.pos.y -= 5.0f;
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 50.0f, 50.0f, 100.0f, 4);
this->actor.world.pos.y += 5.0f;
if (this->actor.bgCheckFlags & 1) {
this->actor.velocity.y = 0.0f;
} else if (this->actionTimer < 250) {
this->actor.shape.rot.y += 2000;
}
if (this->actionTimer == 250) {
this->actor.gravity = -1.0f;
}
if (this->actionTimer < 121) {
if (Math_SmoothStepToF(&this->actor.scale.y, 0.0f, 1.0f, 0.00075f, 0) <= 0.001f) {
Actor_Kill(&this->actor);
}
this->actor.scale.x = this->actor.scale.z = this->actor.scale.y;
}
if (this->actionTimer % 8 == 0 && this->actionTimer != 0) {
pos.x = Rand_CenteredFloat(20.0f) + this->actor.world.pos.x;
pos.y = Rand_CenteredFloat(10.0f) + this->actor.world.pos.y;
pos.z = Rand_CenteredFloat(20.0f) + this->actor.world.pos.z;
func_8002836C(globalCtx, &pos, &vel, &accel, &primColor, &envColor, 500, 10, 10);
}
}

View file

@ -4,13 +4,49 @@
#include "ultra64.h"
#include "global.h"
typedef enum {
/* 0 */ ENGOMA_NORMAL,
/* 1 */ ENGOMA_EGG,
/* 2 */ ENGOMA_HATCH_DEBRIS,
/* 3 */ ENGOMA_BOSSLIMB
} GomaType;
struct EnGoma;
typedef void (*EnGomaActionFunc)(struct EnGoma*, GlobalContext*);
typedef struct EnGoma {
/* 0x0000 */ Actor actor;
/* 0x014C */ char unk_14C[0x1BC];
/* 0x0308 */ Gfx* unk_308; // set by z_boss_goma
/* 0x030C */ char unk_30C[0x98];
/* 0x000 */ Actor actor;
/* 0x14C */ SkelAnime skelanime;
/* 0x190 */ Vec3s jointTable[24];
/* 0x220 */ Vec3s morphTable[24];
/* 0x2B0 */ EnGomaActionFunc actionFunc;
/* 0x2B4 */ s16 slopePitch;
/* 0x2B6 */ s16 slopeRoll;
/* 0x2B8 */ s16 gomaType;
/* 0x2BA */ s16 eyePitch;
/* 0x2BC */ s16 eyeYaw;
/* 0x2BE */ s16 hatchState;
/* 0x2C0 */ s16 eggTimer;
/* 0x2C2 */ s16 hurtTimer;
/* 0x2C4 */ s16 visualState;
/* 0x2C6 */ s16 playerDetectionTimer;
/* 0x2C8 */ s16 spawnNum; // some debug spawn ID
/* 0x2CA */ s16 invincibilityTimer;
/* 0x2CC */ s16 actionTimer;
/* 0x2D0 */ f32 eggScale;
/* 0x2D4 */ f32 eggPitch;
/* 0x2D8 */ f32 eggSquishAngle;
/* 0x2DC */ f32 eggSquishAccel;
/* 0x2E0 */ f32 eyeEnvColor[3];
/* 0x2EC */ f32 eggSquishAmount;
/* 0x2F0 */ f32 eggYOffset;
/* 0x2F4 */ s32 unk_2F4;
/* 0x2F8 */ s16 stunTimer;
/* 0x2FC */ Vec3f shieldKnockbackVel;
/* 0x308 */ Gfx* bossLimbDl; // set by z_boss_goma
/* 0x30C */ ColliderCylinder colCyl1;
/* 0x358 */ ColliderCylinder colCyl2;
} EnGoma; // size = 0x03A4
extern const ActorInit En_Goma_InitVars;

View file

@ -149,102 +149,183 @@ typedef struct {
static EnHorseSpawnpoint sHorseSpawns[] = {
// Hyrule Field
{ SCENE_SPOT00, 16, 0, 1341, 0 }, { SCENE_SPOT00, -1297, 0, 1459, 0 },
{ SCENE_SPOT00, -5416, -300, 1296, 0 }, { SCENE_SPOT00, -4667, -300, 3620, 0 },
{ SCENE_SPOT00, -3837, 81, 5537, 0 }, { SCENE_SPOT00, -5093, -226, 6661, 0 },
{ SCENE_SPOT00, -6588, -79, 5053, 0 }, { SCENE_SPOT00, -7072, -500, 7538, 0 },
{ SCENE_SPOT00, -6139, -500, 8910, 0 }, { SCENE_SPOT00, -8497, -300, 7802, 0 },
{ SCENE_SPOT00, -5481, -499, 12127, 0 }, { SCENE_SPOT00, -4808, -700, 13583, 0 },
{ SCENE_SPOT00, -3416, -490, 12092, 0 }, { SCENE_SPOT00, -2915, 100, 8339, 0 },
{ SCENE_SPOT00, -2277, -500, 13247, 0 }, { SCENE_SPOT00, -1026, -500, 12101, 0 },
{ SCENE_SPOT00, 1427, -500, 13341, 0 }, { SCENE_SPOT00, -200, -486, 10205, 0 },
{ SCENE_SPOT00, -1469, 100, 7496, 0 }, { SCENE_SPOT00, -995, 168, 5652, 0 },
{ SCENE_SPOT00, 1938, 89, 6232, 0 }, { SCENE_SPOT00, 1387, -105, 9206, 0 },
{ SCENE_SPOT00, 1571, -223, 7701, 0 }, { SCENE_SPOT00, 3893, -121, 7068, 0 },
{ SCENE_SPOT00, 3179, 373, 5221, 0 }, { SCENE_SPOT00, 4678, -20, 3869, 0 },
{ SCENE_SPOT00, 3460, 246, 4207, 0 }, { SCENE_SPOT00, 3686, 128, 2366, 0 },
{ SCENE_SPOT00, 1791, 18, 152, 0 }, { SCENE_SPOT00, 3667, -16, 1399, 0 },
{ SCENE_SPOT00, 1827, -15, 983, 0 }, { SCENE_SPOT00, 1574, 399, 4318, 0 },
{ SCENE_SPOT00, 716, 95, 3391, 0 }, { SCENE_SPOT00, -1189, -41, 4739, 0 },
{ SCENE_SPOT00, -1976, -171, 4172, 0 }, { SCENE_SPOT00, 1314, 391, 5665, 0 },
{ SCENE_SPOT00, 112, 0, 1959, 0 }, { SCENE_SPOT00, -3011, -111, 9397, 0 },
{ SCENE_SPOT00, -5674, -270, 8585, 0 }, { SCENE_SPOT00, -8861, -300, 7836, 0 },
{ SCENE_SPOT00, -6056, -500, 7810, 0 }, { SCENE_SPOT00, -7306, -500, 5994, 0 },
{ SCENE_SPOT00, -7305, -500, 7605, 0 }, { SCENE_SPOT00, -7439, -300, 7600, 0 },
{ SCENE_SPOT00, -7464, -300, 6268, 0 }, { SCENE_SPOT00, -8080, -300, 7553, 0 },
{ SCENE_SPOT00, -8091, -300, 7349, 0 }, { SCENE_SPOT00, -8785, -300, 7383, 0 },
{ SCENE_SPOT00, -8745, -300, 7508, 0 }, { SCENE_SPOT00, -8777, -300, 7788, 0 },
{ SCENE_SPOT00, -8048, -299, 7738, 0 }, { SCENE_SPOT00, -7341, -184, 7730, 0 },
{ SCENE_SPOT00, -6410, -288, 7824, 0 }, { SCENE_SPOT00, -6326, -290, 8205, 0 },
{ SCENE_SPOT00, -6546, -292, 8400, 0 }, { SCENE_SPOT00, -7533, -180, 8459, 0 },
{ SCENE_SPOT00, -8024, -295, 7903, 0 }, { SCENE_SPOT00, -8078, -308, 7994, 0 },
{ SCENE_SPOT00, -9425, -287, 7696, 0 }, { SCENE_SPOT00, -9322, -292, 7577, 0 },
{ SCENE_SPOT00, -9602, -199, 7160, 0 }, { SCENE_SPOT00, -9307, -300, 7758, 0 },
{ SCENE_SPOT00, -9230, -300, 7642, 0 }, { SCENE_SPOT00, -7556, -499, 8695, 0 },
{ SCENE_SPOT00, -6438, -500, 8606, 0 }, { SCENE_SPOT00, -6078, -500, 8258, 0 },
{ SCENE_SPOT00, -6233, -500, 7613, 0 }, { SCENE_SPOT00, -5035, -205, 7814, 0 },
{ SCENE_SPOT00, -5971, -500, 8501, 0 }, { SCENE_SPOT00, -5724, -498, 10123, 0 },
{ SCENE_SPOT00, -5094, -392, 11106, 0 }, { SCENE_SPOT00, -5105, -393, 11312, 0 },
{ SCENE_SPOT00, -4477, -314, 11132, 0 }, { SCENE_SPOT00, -3867, -380, 11419, 0 },
{ SCENE_SPOT00, -2952, -500, 11944, 0 }, { SCENE_SPOT00, -2871, -488, 11743, 0 },
{ SCENE_SPOT00, -3829, -372, 11327, 0 }, { SCENE_SPOT00, -4439, -293, 10989, 0 },
{ SCENE_SPOT00, -5014, -381, 11086, 0 }, { SCENE_SPOT00, -5113, -188, 10968, 0 },
{ SCENE_SPOT00, -5269, -188, 11156, 0 }, { SCENE_SPOT00, -5596, -178, 9972, 0 },
{ SCENE_SPOT00, -5801, -288, 8518, 0 }, { SCENE_SPOT00, -4910, -178, 7931, 0 },
{ SCENE_SPOT00, -3586, 73, 8140, 0 }, { SCENE_SPOT00, -4487, -106, 9362, 0 },
{ SCENE_SPOT00, -4339, -112, 6412, 0 }, { SCENE_SPOT00, -3417, 105, 8194, 0 },
{ SCENE_SPOT00, -4505, -20, 6608, 0 }, { SCENE_SPOT00, -5038, -199, 6603, 0 },
{ SCENE_SPOT00, -4481, 1, 6448, 0 }, { SCENE_SPOT00, -5032, -168, 6418, 0 },
{ SCENE_SPOT00, -5256, -700, 14329, 0 }, { SCENE_SPOT00, -5749, -820, 15380, 0 },
{ SCENE_SPOT00, -3122, -700, 13608, 0 }, { SCENE_SPOT00, -3758, -525, 13228, 0 },
{ SCENE_SPOT00, -3670, -500, 13123, 0 }, { SCENE_SPOT00, -2924, -500, 13526, 0 },
{ SCENE_SPOT00, 1389, -115, 9370, 0 }, { SCENE_SPOT00, 548, -116, 8889, 0 },
{ SCENE_SPOT00, -106, -107, 8530, 0 }, { SCENE_SPOT00, -1608, 85, 7646, 0 },
{ SCENE_SPOT00, -5300, -700, 13772, 0 }, { SCENE_SPOT00, -5114, -700, 13400, 0 },
{ SCENE_SPOT00, -4561, -700, 13700, 0 }, { SCENE_SPOT00, -4762, -700, 14084, 0 },
{ SCENE_SPOT00, -2954, 100, 8216, 0 }, { SCENE_SPOT00, 1460, -104, 9246, 0 },
{ SCENE_SPOT00, 629, -105, 8791, 0 }, { SCENE_SPOT00, -10, -90, 8419, 0 },
{ SCENE_SPOT00, -1462, 100, 7504, 0 }, { SCENE_SPOT00, -3018, -500, 12493, 0 },
{ SCENE_SPOT00, -2994, -311, 10331, 0 }, { SCENE_SPOT00, -4006, -700, 14152, 0 },
{ SCENE_SPOT00, -4341, -500, 12743, 0 }, { SCENE_SPOT00, -5879, -497, 6799, 0 },
{ SCENE_SPOT00, 22, -473, 10103, 0 }, { SCENE_SPOT00, -1389, -192, 8874, 0 },
{ SCENE_SPOT00, -4, 92, 6866, 0 }, { SCENE_SPOT00, 483, 104, 6637, 0 },
{ SCENE_SPOT00, 1580, 183, 5987, 0 }, { SCENE_SPOT00, 1548, 308, 5077, 0 },
{ SCENE_SPOT00, 1511, 399, 4267, 0 }, { SCENE_SPOT00, 1358, 385, 4271, 0 },
{ SCENE_SPOT00, 1379, 395, 5063, 0 }, { SCENE_SPOT00, 1360, 394, 5870, 0 },
{ SCENE_SPOT00, 813, 283, 6194, 0 }, { SCENE_SPOT00, -57, 101, 6743, 0 },
{ SCENE_SPOT00, 91, 325, 5143, 0 }, { SCENE_SPOT00, 1425, -214, 7659, 0 },
{ SCENE_SPOT00, 3487, -19, 880, 0 }, { SCENE_SPOT00, 2933, 152, 2094, 0 },
{ SCENE_SPOT00, 2888, -145, 6862, 0 }, { SCENE_SPOT00, 1511, 67, 6471, 0 },
{ SCENE_SPOT00, 4051, -47, 1722, 0 }, { SCENE_SPOT00, -7335, -500, 8627, 0 },
{ SCENE_SPOT00, -7728, -462, 8498, 0 }, { SCENE_SPOT00, -7791, -446, 8832, 0 },
{ SCENE_SPOT00, -2915, -435, 11334, 0 }, { SCENE_SPOT00, 165, -278, 3352, 0 },
{ SCENE_SPOT00, 16, 0, 1341, 0 },
{ SCENE_SPOT00, -1297, 0, 1459, 0 },
{ SCENE_SPOT00, -5416, -300, 1296, 0 },
{ SCENE_SPOT00, -4667, -300, 3620, 0 },
{ SCENE_SPOT00, -3837, 81, 5537, 0 },
{ SCENE_SPOT00, -5093, -226, 6661, 0 },
{ SCENE_SPOT00, -6588, -79, 5053, 0 },
{ SCENE_SPOT00, -7072, -500, 7538, 0 },
{ SCENE_SPOT00, -6139, -500, 8910, 0 },
{ SCENE_SPOT00, -8497, -300, 7802, 0 },
{ SCENE_SPOT00, -5481, -499, 12127, 0 },
{ SCENE_SPOT00, -4808, -700, 13583, 0 },
{ SCENE_SPOT00, -3416, -490, 12092, 0 },
{ SCENE_SPOT00, -2915, 100, 8339, 0 },
{ SCENE_SPOT00, -2277, -500, 13247, 0 },
{ SCENE_SPOT00, -1026, -500, 12101, 0 },
{ SCENE_SPOT00, 1427, -500, 13341, 0 },
{ SCENE_SPOT00, -200, -486, 10205, 0 },
{ SCENE_SPOT00, -1469, 100, 7496, 0 },
{ SCENE_SPOT00, -995, 168, 5652, 0 },
{ SCENE_SPOT00, 1938, 89, 6232, 0 },
{ SCENE_SPOT00, 1387, -105, 9206, 0 },
{ SCENE_SPOT00, 1571, -223, 7701, 0 },
{ SCENE_SPOT00, 3893, -121, 7068, 0 },
{ SCENE_SPOT00, 3179, 373, 5221, 0 },
{ SCENE_SPOT00, 4678, -20, 3869, 0 },
{ SCENE_SPOT00, 3460, 246, 4207, 0 },
{ SCENE_SPOT00, 3686, 128, 2366, 0 },
{ SCENE_SPOT00, 1791, 18, 152, 0 },
{ SCENE_SPOT00, 3667, -16, 1399, 0 },
{ SCENE_SPOT00, 1827, -15, 983, 0 },
{ SCENE_SPOT00, 1574, 399, 4318, 0 },
{ SCENE_SPOT00, 716, 95, 3391, 0 },
{ SCENE_SPOT00, -1189, -41, 4739, 0 },
{ SCENE_SPOT00, -1976, -171, 4172, 0 },
{ SCENE_SPOT00, 1314, 391, 5665, 0 },
{ SCENE_SPOT00, 112, 0, 1959, 0 },
{ SCENE_SPOT00, -3011, -111, 9397, 0 },
{ SCENE_SPOT00, -5674, -270, 8585, 0 },
{ SCENE_SPOT00, -8861, -300, 7836, 0 },
{ SCENE_SPOT00, -6056, -500, 7810, 0 },
{ SCENE_SPOT00, -7306, -500, 5994, 0 },
{ SCENE_SPOT00, -7305, -500, 7605, 0 },
{ SCENE_SPOT00, -7439, -300, 7600, 0 },
{ SCENE_SPOT00, -7464, -300, 6268, 0 },
{ SCENE_SPOT00, -8080, -300, 7553, 0 },
{ SCENE_SPOT00, -8091, -300, 7349, 0 },
{ SCENE_SPOT00, -8785, -300, 7383, 0 },
{ SCENE_SPOT00, -8745, -300, 7508, 0 },
{ SCENE_SPOT00, -8777, -300, 7788, 0 },
{ SCENE_SPOT00, -8048, -299, 7738, 0 },
{ SCENE_SPOT00, -7341, -184, 7730, 0 },
{ SCENE_SPOT00, -6410, -288, 7824, 0 },
{ SCENE_SPOT00, -6326, -290, 8205, 0 },
{ SCENE_SPOT00, -6546, -292, 8400, 0 },
{ SCENE_SPOT00, -7533, -180, 8459, 0 },
{ SCENE_SPOT00, -8024, -295, 7903, 0 },
{ SCENE_SPOT00, -8078, -308, 7994, 0 },
{ SCENE_SPOT00, -9425, -287, 7696, 0 },
{ SCENE_SPOT00, -9322, -292, 7577, 0 },
{ SCENE_SPOT00, -9602, -199, 7160, 0 },
{ SCENE_SPOT00, -9307, -300, 7758, 0 },
{ SCENE_SPOT00, -9230, -300, 7642, 0 },
{ SCENE_SPOT00, -7556, -499, 8695, 0 },
{ SCENE_SPOT00, -6438, -500, 8606, 0 },
{ SCENE_SPOT00, -6078, -500, 8258, 0 },
{ SCENE_SPOT00, -6233, -500, 7613, 0 },
{ SCENE_SPOT00, -5035, -205, 7814, 0 },
{ SCENE_SPOT00, -5971, -500, 8501, 0 },
{ SCENE_SPOT00, -5724, -498, 10123, 0 },
{ SCENE_SPOT00, -5094, -392, 11106, 0 },
{ SCENE_SPOT00, -5105, -393, 11312, 0 },
{ SCENE_SPOT00, -4477, -314, 11132, 0 },
{ SCENE_SPOT00, -3867, -380, 11419, 0 },
{ SCENE_SPOT00, -2952, -500, 11944, 0 },
{ SCENE_SPOT00, -2871, -488, 11743, 0 },
{ SCENE_SPOT00, -3829, -372, 11327, 0 },
{ SCENE_SPOT00, -4439, -293, 10989, 0 },
{ SCENE_SPOT00, -5014, -381, 11086, 0 },
{ SCENE_SPOT00, -5113, -188, 10968, 0 },
{ SCENE_SPOT00, -5269, -188, 11156, 0 },
{ SCENE_SPOT00, -5596, -178, 9972, 0 },
{ SCENE_SPOT00, -5801, -288, 8518, 0 },
{ SCENE_SPOT00, -4910, -178, 7931, 0 },
{ SCENE_SPOT00, -3586, 73, 8140, 0 },
{ SCENE_SPOT00, -4487, -106, 9362, 0 },
{ SCENE_SPOT00, -4339, -112, 6412, 0 },
{ SCENE_SPOT00, -3417, 105, 8194, 0 },
{ SCENE_SPOT00, -4505, -20, 6608, 0 },
{ SCENE_SPOT00, -5038, -199, 6603, 0 },
{ SCENE_SPOT00, -4481, 1, 6448, 0 },
{ SCENE_SPOT00, -5032, -168, 6418, 0 },
{ SCENE_SPOT00, -5256, -700, 14329, 0 },
{ SCENE_SPOT00, -5749, -820, 15380, 0 },
{ SCENE_SPOT00, -3122, -700, 13608, 0 },
{ SCENE_SPOT00, -3758, -525, 13228, 0 },
{ SCENE_SPOT00, -3670, -500, 13123, 0 },
{ SCENE_SPOT00, -2924, -500, 13526, 0 },
{ SCENE_SPOT00, 1389, -115, 9370, 0 },
{ SCENE_SPOT00, 548, -116, 8889, 0 },
{ SCENE_SPOT00, -106, -107, 8530, 0 },
{ SCENE_SPOT00, -1608, 85, 7646, 0 },
{ SCENE_SPOT00, -5300, -700, 13772, 0 },
{ SCENE_SPOT00, -5114, -700, 13400, 0 },
{ SCENE_SPOT00, -4561, -700, 13700, 0 },
{ SCENE_SPOT00, -4762, -700, 14084, 0 },
{ SCENE_SPOT00, -2954, 100, 8216, 0 },
{ SCENE_SPOT00, 1460, -104, 9246, 0 },
{ SCENE_SPOT00, 629, -105, 8791, 0 },
{ SCENE_SPOT00, -10, -90, 8419, 0 },
{ SCENE_SPOT00, -1462, 100, 7504, 0 },
{ SCENE_SPOT00, -3018, -500, 12493, 0 },
{ SCENE_SPOT00, -2994, -311, 10331, 0 },
{ SCENE_SPOT00, -4006, -700, 14152, 0 },
{ SCENE_SPOT00, -4341, -500, 12743, 0 },
{ SCENE_SPOT00, -5879, -497, 6799, 0 },
{ SCENE_SPOT00, 22, -473, 10103, 0 },
{ SCENE_SPOT00, -1389, -192, 8874, 0 },
{ SCENE_SPOT00, -4, 92, 6866, 0 },
{ SCENE_SPOT00, 483, 104, 6637, 0 },
{ SCENE_SPOT00, 1580, 183, 5987, 0 },
{ SCENE_SPOT00, 1548, 308, 5077, 0 },
{ SCENE_SPOT00, 1511, 399, 4267, 0 },
{ SCENE_SPOT00, 1358, 385, 4271, 0 },
{ SCENE_SPOT00, 1379, 395, 5063, 0 },
{ SCENE_SPOT00, 1360, 394, 5870, 0 },
{ SCENE_SPOT00, 813, 283, 6194, 0 },
{ SCENE_SPOT00, -57, 101, 6743, 0 },
{ SCENE_SPOT00, 91, 325, 5143, 0 },
{ SCENE_SPOT00, 1425, -214, 7659, 0 },
{ SCENE_SPOT00, 3487, -19, 880, 0 },
{ SCENE_SPOT00, 2933, 152, 2094, 0 },
{ SCENE_SPOT00, 2888, -145, 6862, 0 },
{ SCENE_SPOT00, 1511, 67, 6471, 0 },
{ SCENE_SPOT00, 4051, -47, 1722, 0 },
{ SCENE_SPOT00, -7335, -500, 8627, 0 },
{ SCENE_SPOT00, -7728, -462, 8498, 0 },
{ SCENE_SPOT00, -7791, -446, 8832, 0 },
{ SCENE_SPOT00, -2915, -435, 11334, 0 },
{ SCENE_SPOT00, 165, -278, 3352, 0 },
// Lake Hylia
{ SCENE_SPOT06, -2109, -882, 1724, 0 }, { SCENE_SPOT06, -328, -1238, 2705, 0 },
{ SCENE_SPOT06, -3092, -1033, 3527, 0 },
{ SCENE_SPOT06, -2109, -882, 1724, 0 },
{ SCENE_SPOT06, -328, -1238, 2705, 0 },
{ SCENE_SPOT06, -3092, -1033, 3527, 0 },
// Gerudo Valley
{ SCENE_SPOT09, 2687, -269, 753, 0 }, { SCENE_SPOT09, 2066, -132, 317, 0 },
{ SCENE_SPOT09, 523, -8, 635, 0 }, { SCENE_SPOT09, 558, 36, -323, 0 },
{ SCENE_SPOT09, 615, 51, -839, 0 }, { SCENE_SPOT09, -614, 32, 29, 0 },
{ SCENE_SPOT09, -639, -3, 553, 0 }, { SCENE_SPOT09, -540, 10, -889, 0 },
{ SCENE_SPOT09, -1666, 58, 378, 0 }, { SCENE_SPOT09, -3044, 210, -648, 0 },
{ SCENE_SPOT09, 2687, -269, 753, 0 },
{ SCENE_SPOT09, 2066, -132, 317, 0 },
{ SCENE_SPOT09, 523, -8, 635, 0 },
{ SCENE_SPOT09, 558, 36, -323, 0 },
{ SCENE_SPOT09, 615, 51, -839, 0 },
{ SCENE_SPOT09, -614, 32, 29, 0 },
{ SCENE_SPOT09, -639, -3, 553, 0 },
{ SCENE_SPOT09, -540, 10, -889, 0 },
{ SCENE_SPOT09, -1666, 58, 378, 0 },
{ SCENE_SPOT09, -3044, 210, -648, 0 },
// Gerudo's Fortress
{ SCENE_SPOT12, -678, 21, -623, 0 }, { SCENE_SPOT12, 149, 333, -2499, 0 },
{ SCENE_SPOT12, 499, 581, -547, 0 }, { SCENE_SPOT12, 3187, 1413, -3775, 0 },
{ SCENE_SPOT12, 3198, 1413, 307, 0 }, { SCENE_SPOT12, 3380, 1413, -1200, 0 },
{ SCENE_SPOT12, -966, 1, -56, 0 }, { SCENE_SPOT12, -966, 24, -761, 0 },
{ SCENE_SPOT12, -694, 174, -2820, 0 },
{ SCENE_SPOT12, -678, 21, -623, 0 },
{ SCENE_SPOT12, 149, 333, -2499, 0 },
{ SCENE_SPOT12, 499, 581, -547, 0 },
{ SCENE_SPOT12, 3187, 1413, -3775, 0 },
{ SCENE_SPOT12, 3198, 1413, 307, 0 },
{ SCENE_SPOT12, 3380, 1413, -1200, 0 },
{ SCENE_SPOT12, -966, 1, -56, 0 },
{ SCENE_SPOT12, -966, 24, -761, 0 },
{ SCENE_SPOT12, -694, 174, -2820, 0 },
/* Lon Lon Ranch */
{ SCENE_SPOT20, 1039, 0, 2051, 0 }, { SCENE_SPOT20, -1443, 0, 1429, 0 },
{ SCENE_SPOT20, 856, 0, -918, 0 }, // Hardcoded to always load in lon lon
{ SCENE_SPOT20, 882, 0, -2256, 0 },
{ SCENE_SPOT20, -1003, 0, -755, 0 }, // Hardcoded to always load in lon lon
{ SCENE_SPOT20, -2254, 0, -629, 0 },
{ SCENE_SPOT20, 907, 0, -2336, 0 },
{ SCENE_SPOT20, 1039, 0, 2051, 0 },
{ SCENE_SPOT20, -1443, 0, 1429, 0 },
{ SCENE_SPOT20, 856, 0, -918, 0 }, // Hardcoded to always load in lon lon
{ SCENE_SPOT20, 882, 0, -2256, 0 },
{ SCENE_SPOT20, -1003, 0, -755, 0 }, // Hardcoded to always load in lon lon
{ SCENE_SPOT20, -2254, 0, -629, 0 },
{ SCENE_SPOT20, 907, 0, -2336, 0 },
};
typedef struct {
@ -280,14 +361,62 @@ typedef struct {
} RaceInfo;
static RaceWaypoint sIngoRaceWaypoints[] = {
{ 1056, 1, -1540, 11, 0x2A8D, },
{ 1593, 1, -985, 10, 0xFC27, },
{ 1645, 1, -221, 11, 0xE891, },
{ 985, 1, 403, 10, 0xBB9C, },
{ -1023, 1, 354, 11, 0xA37D, },
{ -1679, 1, -213, 10, 0x889C, },
{ -1552, 1, -1008, 11, 0x638D, },
{ -947, -1, -1604, 10, 0x4002, },
{
1056,
1,
-1540,
11,
0x2A8D,
},
{
1593,
1,
-985,
10,
0xFC27,
},
{
1645,
1,
-221,
11,
0xE891,
},
{
985,
1,
403,
10,
0xBB9C,
},
{
-1023,
1,
354,
11,
0xA37D,
},
{
-1679,
1,
-213,
10,
0x889C,
},
{
-1552,
1,
-1008,
11,
0x638D,
},
{
-947,
-1,
-1604,
10,
0x4002,
},
};
static RaceInfo sIngoRace = { 8, sIngoRaceWaypoints };
@ -335,17 +464,64 @@ typedef struct {
} CsActionEntry;
static CsActionEntry sCsActionTable[] = {
{ 36, 1, }, { 37, 2, },
{ 38, 3, }, { 64, 4, },
{ 65, 5, },
{
36,
1,
},
{
37,
2,
},
{
38,
3,
},
{
64,
4,
},
{
65,
5,
},
};
static RaceWaypoint sHbaWaypoints[] = {
{ 3600, 1413, -5055, 11, 0x8001, },
{ 3360, 1413, -5220, 5, 0xC000, },
{ 3100, 1413, -4900, 5, 0x0000, },
{ 3600, 1413, -4100, 11, 0x0000, },
{ 3600, 1413, 360, 11, 0x0000, },
{
3600,
1413,
-5055,
11,
0x8001,
},
{
3360,
1413,
-5220,
5,
0xC000,
},
{
3100,
1413,
-4900,
5,
0x0000,
},
{
3600,
1413,
-4100,
11,
0x0000,
},
{
3600,
1413,
360,
11,
0x0000,
},
};
static RaceInfo sHbaInfo = { 5, sHbaWaypoints };
@ -786,9 +962,9 @@ void EnHorse_Init(Actor* thisx, GlobalContext* globalCtx2) {
EnHorse_InitInactive(this);
} else if (this->actor.params == 3) {
EnHorse_InitIngoHorse(this);
this->rider = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_IN, this->actor.world.pos.x,
this->actor.world.pos.y, this->actor.world.pos.z, this->actor.shape.rot.x,
this->actor.shape.rot.y, 1, 1);
this->rider =
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_IN, this->actor.world.pos.x, this->actor.world.pos.y,
this->actor.world.pos.z, this->actor.shape.rot.x, this->actor.shape.rot.y, 1, 1);
if (this->rider == NULL) {
__assert("this->race.rider != NULL", "../z_en_horse.c", 3077);
}
@ -2532,17 +2708,17 @@ void EnHorse_FleePlayer(EnHorse* this, GlobalContext* globalCtx) {
}
}
if (this->actor.speedXZ >= 6.0f) { // hoof it
if (this->actor.speedXZ >= 6.0f) { // hoof it
this->skin.skelAnime.playSpeed = this->actor.speedXZ * 0.3f;
nextAnim = ENHORSE_ANIM_GALLOP;
} else if (this->actor.speedXZ >= 3.0f) { // trot
} else if (this->actor.speedXZ >= 3.0f) { // trot
this->skin.skelAnime.playSpeed = this->actor.speedXZ * 0.375f;
nextAnim = ENHORSE_ANIM_TROT;
} else if (this->actor.speedXZ > 0.1f) { // walk
} else if (this->actor.speedXZ > 0.1f) { // walk
this->skin.skelAnime.playSpeed = this->actor.speedXZ * 0.75f;
nextAnim = ENHORSE_ANIM_WALK;
EnHorse_PlayWalkingSound(this);
} else { // idle
} else { // idle
nextAnim = Rand_ZeroOne() > 0.5f ? 1 : 0;
EnHorse_IdleAnimSounds(this, globalCtx);
this->skin.skelAnime.playSpeed = 1.0f;
@ -3221,7 +3397,8 @@ void EnHorse_CheckBoost(EnHorse* thisx, GlobalContext* globalCtx) {
if (this->action == ENHORSE_ACT_MOUNTED_WALK || this->action == ENHORSE_ACT_MOUNTED_TROT ||
this->action == ENHORSE_ACT_MOUNTED_GALLOP) {
if (CHECK_BTN_ALL(globalCtx2->state.input[0].press.button, BTN_A) && (globalCtx2->interfaceCtx.unk_1EE == 8)) {
if (!(this->stateFlags & ENHORSE_BOOST) && !(this->stateFlags & ENHORSE_FLAG_8) && !(this->stateFlags & ENHORSE_FLAG_9)) {
if (!(this->stateFlags & ENHORSE_BOOST) && !(this->stateFlags & ENHORSE_FLAG_8) &&
!(this->stateFlags & ENHORSE_FLAG_9)) {
if (this->numBoosts > 0) {
func_800AA000(0.0f, 180, 20, 100);
this->stateFlags |= ENHORSE_BOOST;
@ -3485,7 +3662,7 @@ void EnHorse_Update(Actor* thisx, GlobalContext* globalCtx) {
this->blinkTimer = 0;
}
}
if (thisx->speedXZ == 0.0f && !(this->stateFlags & ENHORSE_FLAG_19)) {
thisx->colChkInfo.mass = 0xFF;
} else {

View file

@ -655,8 +655,7 @@ void func_80A7A568(EnIn* this, GlobalContext* globalCtx) {
this->unk_308.unk_00 = 0;
return;
}
gSaveContext.eventInf[0] =
(gSaveContext.eventInf[0] & ~0x10) | (((EnHorse*)PLAYER->rideActor)->type << 4);
gSaveContext.eventInf[0] = (gSaveContext.eventInf[0] & ~0x10) | (((EnHorse*)PLAYER->rideActor)->type << 4);
gSaveContext.eventInf[0] = (gSaveContext.eventInf[0] & ~0xF) | 2;
phi_a2 = 2;
phi_a3 = 2;

View file

@ -1424,7 +1424,8 @@ void EnNb_Init(Actor* thisx, GlobalContext* globalCtx) {
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
EnNb_SetupCollider(thisx, globalCtx);
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gNabooruSkel, NULL, this->jointTable, this->morphTable, NB_LIMB_MAX);
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gNabooruSkel, NULL, this->jointTable, this->morphTable,
NB_LIMB_MAX);
switch (EnNb_GetType(this)) {
case NB_TYPE_DEMO02:

View file

@ -623,183 +623,228 @@ GetItemEntry sGetItemTable[] = {
};
LinkAnimationHeader* D_80853914[] = {
&gPlayerAnim_003240, &gPlayerAnim_003238, &gPlayerAnim_003238, &gPlayerAnim_002BE0, &gPlayerAnim_003240, &gPlayerAnim_003240,
&gPlayerAnim_003240, &gPlayerAnim_003238, &gPlayerAnim_003238,
&gPlayerAnim_002BE0, &gPlayerAnim_003240, &gPlayerAnim_003240,
};
LinkAnimationHeader* D_8085392C[] = {
&gPlayerAnim_003290, &gPlayerAnim_003268, &gPlayerAnim_003268, &gPlayerAnim_002BF8, &gPlayerAnim_003290, &gPlayerAnim_003290,
&gPlayerAnim_003290, &gPlayerAnim_003268, &gPlayerAnim_003268,
&gPlayerAnim_002BF8, &gPlayerAnim_003290, &gPlayerAnim_003290,
};
LinkAnimationHeader* D_80853944[] = {
&gPlayerAnim_003140, &gPlayerAnim_002B38, &gPlayerAnim_003138, &gPlayerAnim_002B40, &gPlayerAnim_003140, &gPlayerAnim_003140,
&gPlayerAnim_003140, &gPlayerAnim_002B38, &gPlayerAnim_003138,
&gPlayerAnim_002B40, &gPlayerAnim_003140, &gPlayerAnim_003140,
};
LinkAnimationHeader* D_8085395C[] = {
&gPlayerAnim_002E98, &gPlayerAnim_0029E8, &gPlayerAnim_002E98, &gPlayerAnim_0029F0, &gPlayerAnim_002E98, &gPlayerAnim_002E98,
&gPlayerAnim_002E98, &gPlayerAnim_0029E8, &gPlayerAnim_002E98,
&gPlayerAnim_0029F0, &gPlayerAnim_002E98, &gPlayerAnim_002E98,
};
LinkAnimationHeader* D_80853974[] = {
&gPlayerAnim_002FB0, &gPlayerAnim_002FA8, &gPlayerAnim_002FB0, &gPlayerAnim_002A40, &gPlayerAnim_002FB0, &gPlayerAnim_002FB0,
&gPlayerAnim_002FB0, &gPlayerAnim_002FA8, &gPlayerAnim_002FB0,
&gPlayerAnim_002A40, &gPlayerAnim_002FB0, &gPlayerAnim_002FB0,
};
LinkAnimationHeader* D_8085398C[] = {
&gPlayerAnim_003220, &gPlayerAnim_002590, &gPlayerAnim_002590, &gPlayerAnim_002BC0, &gPlayerAnim_003220, &gPlayerAnim_003220,
&gPlayerAnim_003220, &gPlayerAnim_002590, &gPlayerAnim_002590,
&gPlayerAnim_002BC0, &gPlayerAnim_003220, &gPlayerAnim_003220,
};
LinkAnimationHeader* D_808539A4[] = {
&gPlayerAnim_003230, &gPlayerAnim_0025D0, &gPlayerAnim_0025D0, &gPlayerAnim_002BD0, &gPlayerAnim_003230, &gPlayerAnim_003230,
&gPlayerAnim_003230, &gPlayerAnim_0025D0, &gPlayerAnim_0025D0,
&gPlayerAnim_002BD0, &gPlayerAnim_003230, &gPlayerAnim_003230,
};
LinkAnimationHeader* D_808539BC[] = {
&gPlayerAnim_002BB0, &gPlayerAnim_0031F8, &gPlayerAnim_0031F8, &gPlayerAnim_002BB0, &gPlayerAnim_002BB0, &gPlayerAnim_002BB0,
&gPlayerAnim_002BB0, &gPlayerAnim_0031F8, &gPlayerAnim_0031F8,
&gPlayerAnim_002BB0, &gPlayerAnim_002BB0, &gPlayerAnim_002BB0,
};
LinkAnimationHeader* D_808539D4[] = {
&gPlayerAnim_003088, &gPlayerAnim_002A70, &gPlayerAnim_002A70, &gPlayerAnim_003088, &gPlayerAnim_003088, &gPlayerAnim_003088,
&gPlayerAnim_003088, &gPlayerAnim_002A70, &gPlayerAnim_002A70,
&gPlayerAnim_003088, &gPlayerAnim_003088, &gPlayerAnim_003088,
};
LinkAnimationHeader* D_808539EC[] = {
&gPlayerAnim_002750, &gPlayerAnim_002748, &gPlayerAnim_002748, &gPlayerAnim_002750, &gPlayerAnim_002750, &gPlayerAnim_002750,
&gPlayerAnim_002750, &gPlayerAnim_002748, &gPlayerAnim_002748,
&gPlayerAnim_002750, &gPlayerAnim_002750, &gPlayerAnim_002750,
};
LinkAnimationHeader* D_80853A04[] = {
&gPlayerAnim_002330, &gPlayerAnim_002330, &gPlayerAnim_002330, &gPlayerAnim_002330, &gPlayerAnim_002330, &gPlayerAnim_002330,
&gPlayerAnim_002330, &gPlayerAnim_002330, &gPlayerAnim_002330,
&gPlayerAnim_002330, &gPlayerAnim_002330, &gPlayerAnim_002330,
};
LinkAnimationHeader* D_80853A1C[] = {
&gPlayerAnim_002760, &gPlayerAnim_002758, &gPlayerAnim_002758, &gPlayerAnim_002760, &gPlayerAnim_002760, &gPlayerAnim_002760,
&gPlayerAnim_002760, &gPlayerAnim_002758, &gPlayerAnim_002758,
&gPlayerAnim_002760, &gPlayerAnim_002760, &gPlayerAnim_002760,
};
LinkAnimationHeader* D_80853A34[] = {
&gPlayerAnim_002338, &gPlayerAnim_002338, &gPlayerAnim_002338, &gPlayerAnim_002338, &gPlayerAnim_002338, &gPlayerAnim_002338,
&gPlayerAnim_002338, &gPlayerAnim_002338, &gPlayerAnim_002338,
&gPlayerAnim_002338, &gPlayerAnim_002338, &gPlayerAnim_002338,
};
LinkAnimationHeader* D_80853A4C[] = {
&gPlayerAnim_002E08, &gPlayerAnim_002E00, &gPlayerAnim_002E00, &gPlayerAnim_002E08, &gPlayerAnim_002E08, &gPlayerAnim_002E08,
&gPlayerAnim_002E08, &gPlayerAnim_002E00, &gPlayerAnim_002E00,
&gPlayerAnim_002E08, &gPlayerAnim_002E08, &gPlayerAnim_002E08,
};
LinkAnimationHeader* D_80853A64[] = {
&gPlayerAnim_003028, &gPlayerAnim_003020, &gPlayerAnim_003020, &gPlayerAnim_003028, &gPlayerAnim_003028, &gPlayerAnim_003028,
&gPlayerAnim_003028, &gPlayerAnim_003020, &gPlayerAnim_003020,
&gPlayerAnim_003028, &gPlayerAnim_003028, &gPlayerAnim_003028,
};
LinkAnimationHeader* D_80853A7C[] = {
&gPlayerAnim_003170, &gPlayerAnim_003168, &gPlayerAnim_003168, &gPlayerAnim_003170, &gPlayerAnim_003170, &gPlayerAnim_003170,
&gPlayerAnim_003170, &gPlayerAnim_003168, &gPlayerAnim_003168,
&gPlayerAnim_003170, &gPlayerAnim_003170, &gPlayerAnim_003170,
};
LinkAnimationHeader* D_80853A94[] = {
&gPlayerAnim_003038, &gPlayerAnim_003030, &gPlayerAnim_003030, &gPlayerAnim_002A68, &gPlayerAnim_003038, &gPlayerAnim_003038,
&gPlayerAnim_003038, &gPlayerAnim_003030, &gPlayerAnim_003030,
&gPlayerAnim_002A68, &gPlayerAnim_003038, &gPlayerAnim_003038,
};
LinkAnimationHeader* D_80853AAC[] = {
&gPlayerAnim_002FC0, &gPlayerAnim_002FB8, &gPlayerAnim_002FB8, &gPlayerAnim_002FC8, &gPlayerAnim_002FC0, &gPlayerAnim_002FC0,
&gPlayerAnim_002FC0, &gPlayerAnim_002FB8, &gPlayerAnim_002FB8,
&gPlayerAnim_002FC8, &gPlayerAnim_002FC0, &gPlayerAnim_002FC0,
};
LinkAnimationHeader* D_80853AC4[] = {
&gPlayerAnim_003278, &gPlayerAnim_003270, &gPlayerAnim_003270, &gPlayerAnim_002BE8, &gPlayerAnim_003278, &gPlayerAnim_003278,
&gPlayerAnim_003278, &gPlayerAnim_003270, &gPlayerAnim_003270,
&gPlayerAnim_002BE8, &gPlayerAnim_003278, &gPlayerAnim_003278,
};
LinkAnimationHeader* D_80853ADC[] = {
&gPlayerAnim_003288, &gPlayerAnim_003280, &gPlayerAnim_003280, &gPlayerAnim_002BF0, &gPlayerAnim_003288, &gPlayerAnim_003288,
&gPlayerAnim_003288, &gPlayerAnim_003280, &gPlayerAnim_003280,
&gPlayerAnim_002BF0, &gPlayerAnim_003288, &gPlayerAnim_003288,
};
LinkAnimationHeader* D_80853AF4[] = {
&gPlayerAnim_002EB8, &gPlayerAnim_002EA0, &gPlayerAnim_002EA0, &gPlayerAnim_002EB8, &gPlayerAnim_0026C8, &gPlayerAnim_002EB8,
&gPlayerAnim_002EB8, &gPlayerAnim_002EA0, &gPlayerAnim_002EA0,
&gPlayerAnim_002EB8, &gPlayerAnim_0026C8, &gPlayerAnim_002EB8,
};
LinkAnimationHeader* D_80853B0C[] = {
&gPlayerAnim_002ED8, &gPlayerAnim_002ED0, &gPlayerAnim_002ED0, &gPlayerAnim_002ED8, &gPlayerAnim_0026D0, &gPlayerAnim_002ED8,
&gPlayerAnim_002ED8, &gPlayerAnim_002ED0, &gPlayerAnim_002ED0,
&gPlayerAnim_002ED8, &gPlayerAnim_0026D0, &gPlayerAnim_002ED8,
};
LinkAnimationHeader* D_80853B24[] = {
&gPlayerAnim_002EB0, &gPlayerAnim_002EA8, &gPlayerAnim_002EA8, &gPlayerAnim_002EB0, &gPlayerAnim_002EB0, &gPlayerAnim_002EB0,
&gPlayerAnim_002EB0, &gPlayerAnim_002EA8, &gPlayerAnim_002EA8,
&gPlayerAnim_002EB0, &gPlayerAnim_002EB0, &gPlayerAnim_002EB0,
};
LinkAnimationHeader* D_80853B3C[] = {
&gPlayerAnim_003190, &gPlayerAnim_003188, &gPlayerAnim_003188, &gPlayerAnim_002B68, &gPlayerAnim_003190, &gPlayerAnim_003190,
&gPlayerAnim_003190, &gPlayerAnim_003188, &gPlayerAnim_003188,
&gPlayerAnim_002B68, &gPlayerAnim_003190, &gPlayerAnim_003190,
};
LinkAnimationHeader* D_80853B54[] = {
&gPlayerAnim_003178, &gPlayerAnim_002568, &gPlayerAnim_002568, &gPlayerAnim_002B58, &gPlayerAnim_003178, &gPlayerAnim_003178,
&gPlayerAnim_003178, &gPlayerAnim_002568, &gPlayerAnim_002568,
&gPlayerAnim_002B58, &gPlayerAnim_003178, &gPlayerAnim_003178,
};
LinkAnimationHeader* D_80853B6C[] = {
&gPlayerAnim_003180, &gPlayerAnim_002570, &gPlayerAnim_002570, &gPlayerAnim_002B60, &gPlayerAnim_003180, &gPlayerAnim_003180,
&gPlayerAnim_003180, &gPlayerAnim_002570, &gPlayerAnim_002570,
&gPlayerAnim_002B60, &gPlayerAnim_003180, &gPlayerAnim_003180,
};
LinkAnimationHeader* D_80853B84[] = {
&gPlayerAnim_002D60, &gPlayerAnim_002D58, &gPlayerAnim_002D58, &gPlayerAnim_002D60, &gPlayerAnim_002D60, &gPlayerAnim_002D60,
&gPlayerAnim_002D60, &gPlayerAnim_002D58, &gPlayerAnim_002D58,
&gPlayerAnim_002D60, &gPlayerAnim_002D60, &gPlayerAnim_002D60,
};
LinkAnimationHeader* D_80853B9C[] = {
&gPlayerAnim_002BB8, &gPlayerAnim_003218, &gPlayerAnim_003218, &gPlayerAnim_002BB8, &gPlayerAnim_002BB8, &gPlayerAnim_002BB8,
&gPlayerAnim_002BB8, &gPlayerAnim_003218, &gPlayerAnim_003218,
&gPlayerAnim_002BB8, &gPlayerAnim_002BB8, &gPlayerAnim_002BB8,
};
LinkAnimationHeader* D_80853BB4[] = {
&gPlayerAnim_002BC8, &gPlayerAnim_003228, &gPlayerAnim_003228, &gPlayerAnim_002BC8, &gPlayerAnim_002BC8, &gPlayerAnim_002BC8,
&gPlayerAnim_002BC8, &gPlayerAnim_003228, &gPlayerAnim_003228,
&gPlayerAnim_002BC8, &gPlayerAnim_002BC8, &gPlayerAnim_002BC8,
};
LinkAnimationHeader* D_80853BCC[] = {
&gPlayerAnim_0031C8, &gPlayerAnim_0031C0, &gPlayerAnim_0031C0, &gPlayerAnim_0031C8, &gPlayerAnim_0031C8, &gPlayerAnim_0031C8,
&gPlayerAnim_0031C8, &gPlayerAnim_0031C0, &gPlayerAnim_0031C0,
&gPlayerAnim_0031C8, &gPlayerAnim_0031C8, &gPlayerAnim_0031C8,
};
LinkAnimationHeader* D_80853BE4[] = {
&gPlayerAnim_003118, &gPlayerAnim_003110, &gPlayerAnim_003110, &gPlayerAnim_003118, &gPlayerAnim_003118, &gPlayerAnim_003118,
&gPlayerAnim_003118, &gPlayerAnim_003110, &gPlayerAnim_003110,
&gPlayerAnim_003118, &gPlayerAnim_003118, &gPlayerAnim_003118,
};
LinkAnimationHeader* D_80853BFC[] = {
&gPlayerAnim_002DE8, &gPlayerAnim_002DE8, &gPlayerAnim_002DE8, &gPlayerAnim_002DE8, &gPlayerAnim_002DE8, &gPlayerAnim_002DE8,
&gPlayerAnim_002DE8, &gPlayerAnim_002DE8, &gPlayerAnim_002DE8,
&gPlayerAnim_002DE8, &gPlayerAnim_002DE8, &gPlayerAnim_002DE8,
};
LinkAnimationHeader* D_80853C14[] = {
&gPlayerAnim_002E30, &gPlayerAnim_002E18, &gPlayerAnim_002E18, &gPlayerAnim_002E30, &gPlayerAnim_002E30, &gPlayerAnim_002E30,
&gPlayerAnim_002E30, &gPlayerAnim_002E18, &gPlayerAnim_002E18,
&gPlayerAnim_002E30, &gPlayerAnim_002E30, &gPlayerAnim_002E30,
};
LinkAnimationHeader* D_80853C2C[] = {
&gPlayerAnim_002E40, &gPlayerAnim_002E38, &gPlayerAnim_002E38, &gPlayerAnim_002E40, &gPlayerAnim_002E40, &gPlayerAnim_002E40,
&gPlayerAnim_002E40, &gPlayerAnim_002E38, &gPlayerAnim_002E38,
&gPlayerAnim_002E40, &gPlayerAnim_002E40, &gPlayerAnim_002E40,
};
LinkAnimationHeader* D_80853C44[] = {
&gPlayerAnim_002E28, &gPlayerAnim_002E20, &gPlayerAnim_002E20, &gPlayerAnim_002E28, &gPlayerAnim_002E28, &gPlayerAnim_002E28,
&gPlayerAnim_002E28, &gPlayerAnim_002E20, &gPlayerAnim_002E20,
&gPlayerAnim_002E28, &gPlayerAnim_002E28, &gPlayerAnim_002E28,
};
LinkAnimationHeader* D_80853C5C[] = {
&gPlayerAnim_0030C8, &gPlayerAnim_0030C0, &gPlayerAnim_0030C0, &gPlayerAnim_0030C8, &gPlayerAnim_0030C8, &gPlayerAnim_0030C8,
&gPlayerAnim_0030C8, &gPlayerAnim_0030C0, &gPlayerAnim_0030C0,
&gPlayerAnim_0030C8, &gPlayerAnim_0030C8, &gPlayerAnim_0030C8,
};
LinkAnimationHeader* D_80853C74[] = {
&gPlayerAnim_0030D8, &gPlayerAnim_0030D0, &gPlayerAnim_0030D0, &gPlayerAnim_0030D8, &gPlayerAnim_0030D8, &gPlayerAnim_0030D8,
&gPlayerAnim_0030D8, &gPlayerAnim_0030D0, &gPlayerAnim_0030D0,
&gPlayerAnim_0030D8, &gPlayerAnim_0030D8, &gPlayerAnim_0030D8,
};
LinkAnimationHeader* D_80853C8C[] = {
&gPlayerAnim_0030B8, &gPlayerAnim_0030B0, &gPlayerAnim_0030B0, &gPlayerAnim_0030B8, &gPlayerAnim_0030B8, &gPlayerAnim_0030B8,
&gPlayerAnim_0030B8, &gPlayerAnim_0030B0, &gPlayerAnim_0030B0,
&gPlayerAnim_0030B8, &gPlayerAnim_0030B8, &gPlayerAnim_0030B8,
};
LinkAnimationHeader* D_80853CA4[] = {
&gPlayerAnim_002F20, &gPlayerAnim_002F18, &gPlayerAnim_002F18, &gPlayerAnim_002F20, &gPlayerAnim_002F20, &gPlayerAnim_002F20,
&gPlayerAnim_002F20, &gPlayerAnim_002F18, &gPlayerAnim_002F18,
&gPlayerAnim_002F20, &gPlayerAnim_002F20, &gPlayerAnim_002F20,
};
LinkAnimationHeader* D_80853CBC[] = {
&gPlayerAnim_002FF0, &gPlayerAnim_002FE8, &gPlayerAnim_002FE8, &gPlayerAnim_002FF0, &gPlayerAnim_002FF0, &gPlayerAnim_002FF0,
&gPlayerAnim_002FF0, &gPlayerAnim_002FE8, &gPlayerAnim_002FE8,
&gPlayerAnim_002FF0, &gPlayerAnim_002FF0, &gPlayerAnim_002FF0,
};
LinkAnimationHeader* D_80853CD4[] = {
&gPlayerAnim_003010, &gPlayerAnim_003008, &gPlayerAnim_003008, &gPlayerAnim_003010, &gPlayerAnim_003010, &gPlayerAnim_003010,
&gPlayerAnim_003010, &gPlayerAnim_003008, &gPlayerAnim_003008,
&gPlayerAnim_003010, &gPlayerAnim_003010, &gPlayerAnim_003010,
};
LinkAnimationHeader* D_80853CEC[] = {
&gPlayerAnim_003000, &gPlayerAnim_002FF8, &gPlayerAnim_002FF8, &gPlayerAnim_003000, &gPlayerAnim_003000, &gPlayerAnim_003000,
&gPlayerAnim_003000, &gPlayerAnim_002FF8, &gPlayerAnim_002FF8,
&gPlayerAnim_003000, &gPlayerAnim_003000, &gPlayerAnim_003000,
};
LinkAnimationHeader* D_80853D04[] = {
&gPlayerAnim_002EF0, &gPlayerAnim_002EE8, &gPlayerAnim_002EE8, &gPlayerAnim_002EF8, &gPlayerAnim_002EF0, &gPlayerAnim_002EF0,
&gPlayerAnim_002EF0, &gPlayerAnim_002EE8, &gPlayerAnim_002EE8,
&gPlayerAnim_002EF8, &gPlayerAnim_002EF0, &gPlayerAnim_002EF0,
};
LinkAnimationHeader* D_80853D1C[] = {
&gPlayerAnim_0031E0, &gPlayerAnim_0031D8, &gPlayerAnim_0031D8, &gPlayerAnim_0031E8, &gPlayerAnim_0031E0, &gPlayerAnim_0031E0,
&gPlayerAnim_0031E0, &gPlayerAnim_0031D8, &gPlayerAnim_0031D8,
&gPlayerAnim_0031E8, &gPlayerAnim_0031E0, &gPlayerAnim_0031E0,
};
LinkAnimationHeader* D_80853D34[] = {
&gPlayerAnim_003468, &gPlayerAnim_003438, &gPlayerAnim_003438, &gPlayerAnim_003468, &gPlayerAnim_003468, &gPlayerAnim_003468,
&gPlayerAnim_003468, &gPlayerAnim_003438, &gPlayerAnim_003438,
&gPlayerAnim_003468, &gPlayerAnim_003468, &gPlayerAnim_003468,
};
LinkAnimationHeader* D_80853D4C[][3] = {
@ -810,10 +855,12 @@ LinkAnimationHeader* D_80853D4C[][3] = {
};
LinkAnimationHeader* D_80853D7C[][2] = {
{ &gPlayerAnim_003248, &gPlayerAnim_003200 }, { &gPlayerAnim_003258, &gPlayerAnim_003210 }, { &gPlayerAnim_003250, &gPlayerAnim_003208 },
{ &gPlayerAnim_003250, &gPlayerAnim_003208 }, { &gPlayerAnim_003430, &gPlayerAnim_0033F0 }, { &gPlayerAnim_003430, &gPlayerAnim_0033F0 },
{ &gPlayerAnim_003430, &gPlayerAnim_0033F0 }, { &gPlayerAnim_0033F8, &gPlayerAnim_0033D0 }, { &gPlayerAnim_003400, &gPlayerAnim_0033D8 },
{ &gPlayerAnim_003420, &gPlayerAnim_003420 }, { &gPlayerAnim_003408, &gPlayerAnim_0033E0 }, { &gPlayerAnim_003410, &gPlayerAnim_0033E8 },
{ &gPlayerAnim_003248, &gPlayerAnim_003200 }, { &gPlayerAnim_003258, &gPlayerAnim_003210 },
{ &gPlayerAnim_003250, &gPlayerAnim_003208 }, { &gPlayerAnim_003250, &gPlayerAnim_003208 },
{ &gPlayerAnim_003430, &gPlayerAnim_0033F0 }, { &gPlayerAnim_003430, &gPlayerAnim_0033F0 },
{ &gPlayerAnim_003430, &gPlayerAnim_0033F0 }, { &gPlayerAnim_0033F8, &gPlayerAnim_0033D0 },
{ &gPlayerAnim_003400, &gPlayerAnim_0033D8 }, { &gPlayerAnim_003420, &gPlayerAnim_003420 },
{ &gPlayerAnim_003408, &gPlayerAnim_0033E0 }, { &gPlayerAnim_003410, &gPlayerAnim_0033E8 },
{ &gPlayerAnim_003418, &gPlayerAnim_003418 }, { &gPlayerAnim_003428, &gPlayerAnim_003428 },
};
@ -969,7 +1016,7 @@ struct_808540F4 D_808540F4[] = {
{ &gPlayerAnim_002F50, 12 }, { &gPlayerAnim_003080, 6 }, { &gPlayerAnim_002C68, 8 }, { &gPlayerAnim_003090, 8 },
{ &gPlayerAnim_002A20, 8 }, { &gPlayerAnim_002F30, 10 }, { &gPlayerAnim_002C58, 7 }, { &gPlayerAnim_002C60, 11 },
{ &gPlayerAnim_002F50, 12 }, { &gPlayerAnim_003078, 4 }, { &gPlayerAnim_003058, 4 }, { &gPlayerAnim_002F38, 4 },
{ &gPlayerAnim_0024E0, 5 }, { &gPlayerAnim_002F48, 13 },
{ &gPlayerAnim_0024E0, 5 }, { &gPlayerAnim_002F48, 13 },
};
s8 D_80854164[][6] = {
@ -2499,7 +2546,8 @@ s32 func_808358F0(Player* this, GlobalContext* globalCtx) {
if (!D_80853618) {
func_80833638(this, func_808359FC);
LinkAnimation_PlayOnce(globalCtx, &this->skelAnime2, (this->unk_870 < 0.5f) ? &gPlayerAnim_002608 : &gPlayerAnim_002600);
LinkAnimation_PlayOnce(globalCtx, &this->skelAnime2,
(this->unk_870 < 0.5f) ? &gPlayerAnim_002608 : &gPlayerAnim_002600);
}
return 1;
@ -3360,7 +3408,7 @@ void func_80837B9C(Player* this, GlobalContext* globalCtx) {
LinkAnimationHeader* D_808544B0[] = {
&gPlayerAnim_002F80, &gPlayerAnim_002F78, &gPlayerAnim_002DE0, &gPlayerAnim_002DD8,
&gPlayerAnim_002F70, &gPlayerAnim_002528, &gPlayerAnim_002DC8, &gPlayerAnim_0024F0,
&gPlayerAnim_002F70, &gPlayerAnim_002528, &gPlayerAnim_002DC8, &gPlayerAnim_0024F0,
};
void func_80837C0C(GlobalContext* globalCtx, Player* this, s32 arg2, f32 arg3, f32 arg4, s16 arg5, s32 arg6) {
@ -6868,7 +6916,8 @@ void func_80841138(Player* this, GlobalContext* globalCtx) {
func_8084029C(this, 1.2f + ((REG(38) / 1000.0f) * temp2));
}
LinkAnimation_LoadToMorph(globalCtx, &this->skelAnime, D_80853BFC[this->modelAnimType], this->unk_868);
LinkAnimation_LoadToJoint(globalCtx, &this->skelAnime, &gPlayerAnim_002DD0, this->unk_868 * (16.0f / 29.0f));
LinkAnimation_LoadToJoint(globalCtx, &this->skelAnime, &gPlayerAnim_002DD0,
this->unk_868 * (16.0f / 29.0f));
}
}
@ -8862,7 +8911,8 @@ void func_80846660(GlobalContext* globalCtx, Player* this) {
this->unk_84F = 1;
}
this->stateFlags1 |= 0x20000000;
LinkAnimation_Change(globalCtx, &this->skelAnime, &gPlayerAnim_003298, 2.0f / 3.0f, 0.0f, 24.0f, ANIMMODE_ONCE, 0.0f);
LinkAnimation_Change(globalCtx, &this->skelAnime, &gPlayerAnim_003298, 2.0f / 3.0f, 0.0f, 24.0f, ANIMMODE_ONCE,
0.0f);
this->actor.world.pos.y += 800.0f;
}
@ -10032,8 +10082,9 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) {
func_80837B9C(this, globalCtx);
} else if ((this->actor.bgCheckFlags & 1) || (this->stateFlags1 & 0x8000000)) {
func_80836448(globalCtx, this,
func_808332B8(this) ? &gPlayerAnim_003310
: (this->shockTimer != 0) ? &gPlayerAnim_002F08 : &gPlayerAnim_002878);
func_808332B8(this)
? &gPlayerAnim_003310
: (this->shockTimer != 0) ? &gPlayerAnim_002F08 : &gPlayerAnim_002878);
}
} else {
if ((this->actor.parent == NULL) &&
@ -14078,7 +14129,8 @@ void func_80853148(GlobalContext* globalCtx, Actor* actor) {
}
} else {
func_80836898(globalCtx, this, func_8083A2F8);
func_808322D0(globalCtx, this, (actor->xzDistToPlayer < 40.0f) ? &gPlayerAnim_002DF0 : &gPlayerAnim_0031A0);
func_808322D0(globalCtx, this,
(actor->xzDistToPlayer < 40.0f) ? &gPlayerAnim_002DF0 : &gPlayerAnim_0031A0);
}
if (this->skelAnime.animation == &gPlayerAnim_002DF0) {