Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gerudo objects #757

Merged
merged 11 commits into from
Apr 10, 2021
Prev Previous commit
Next Next commit
replaced symbols in EnNb, limb enums
  • Loading branch information
EllipticEllipsis committed Apr 5, 2021
commit e4f3046aafa59bcd99b44b5ee4c3a8e4007d0dc4
2 changes: 1 addition & 1 deletion assets/xml/objects/object_nb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<Animation Name="gNabooruStandingHandsOnHipsAnim" Offset="0x04BB4"/>
<Animation Name="gNabooruStandingToWalkingTransitionAnim" Offset="0x04E60"/>
<Animation Name="gNabooruSittingCrossLeggedLookingUpRightAnim" Offset="0x05614"/>
<Animation Name="gNabooruSittingCrossLeggedTurningToLookUpRightTransitionAnim_005CA4" Offset="0x05CA4"/>
<Animation Name="gNabooruSittingCrossLeggedTurningToLookUpRightTransitionAnim" Offset="0x05CA4"/>
<Animation Name="gNabooruKneeingToRunningToHitAnim" Offset="0x06320"/>
<Animation Name="gNabooruUnusedKneelingAtCrawlspaceToStandingTransitionAnim" Offset="0x0676C"/>
<Animation Name="gNabooruKneeingAtCrawlspaceAnim" Offset="0x06E78"/>
Expand Down
103 changes: 39 additions & 64 deletions src/overlays/actors/ovl_En_Nb/z_en_nb.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "z_en_nb.h"
#include "vt.h"
#include "objects/object_nb/object_nb.h"

#define FLAGS 0x00000010

Expand Down Expand Up @@ -52,32 +53,6 @@ void EnNb_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnNb_Update(Actor* thisx, GlobalContext* globalCtx);
void EnNb_Draw(Actor* thisx, GlobalContext* globalCtx);

extern FlexSkeletonHeader D_060181C8;
extern AnimationHeader D_06004BB4; // standing up hands on hips
extern AnimationHeader D_06006E78;
extern AnimationHeader D_06004E60; // getting up from crawlspace
extern AnimationHeader D_06004BB4;
extern AnimationHeader D_06009238;
extern AnimationHeader D_06009694; // hands on hips standing
extern AnimationHeader D_0600274C; // raising both arms up transition (giving medallion to link ?)
extern AnimationHeader D_06002B4C; // raising both arms up stable (giving medallion to link ?)
extern AnimationHeader D_06000410; // clasping hands together
extern AnimationHeader D_06001E7C; // looking around ?
extern AnimationHeader D_06001350; // i think this is the animation where she is in the purple thing
extern AnimationHeader D_06001104; // transition to raising arm up in purple portal
extern AnimationHeader D_06008BD0; // falls to the ground
extern AnimationHeader D_060046A8; // looking in crawlspace ?
extern AnimationHeader D_06003954; // on ground getting up ??
extern AnimationHeader D_06004030; // looking behind her to the right
extern AnimationHeader D_06002DBC; // freaking out
extern AnimationHeader D_060035A8; // looking behind her
extern AnimationHeader D_06006320; // sees unk from behind, turns and runs
extern AnimationHeader D_06000BC0; // crossed legs
extern AnimationHeader D_06005CA4; // crossed legs, turns head and looks behind to the right
extern AnimationHeader D_06005614; // crossed legs, looking behind to the right
extern Gfx D_06013158[];
extern u64 D_0600D8E8;

static ColliderCylinderInitType1 sCylinderInit = {
{
COLTYPE_HIT0,
Expand All @@ -98,9 +73,9 @@ static ColliderCylinderInitType1 sCylinderInit = {
};

static u64* sEyeTextures[] = {
0x0600B428,
0x0600D0E8,
0x0600D4E8,
gNabooruEyeOpenTex,
gNabooruEyeHalfTex,
gNabooruEyeClosedTex,
};

static s32 D_80AB4318 = 0;
Expand Down Expand Up @@ -322,7 +297,7 @@ void EnNb_SetCurrentAnim(EnNb* this, AnimationHeader* animation, u8 mode, f32 tr
}

void EnNb_SetChamberAnim(EnNb* this, GlobalContext* globalCtx) {
EnNb_SetCurrentAnim(this, &D_06009694, 0, 0, 0);
EnNb_SetCurrentAnim(this, &gNabooruStandingHandsOnHipsChamberOfSagesAnim, 0, 0, 0);
this->actor.shape.yOffset = -10000.0f;
}

Expand Down Expand Up @@ -385,7 +360,7 @@ void EnNb_SetupDefaultChamberIdle(EnNb* this) {
}

void EnNb_SetupArmRaise(EnNb* this, GlobalContext* globalCtx) {
AnimationHeader* animation = &D_0600274C;
AnimationHeader* animation = &gNabooruRaisingArmsGivingMedallionAnim;
CsCmdActorAction* csCmdNPCAction;

if (globalCtx->csCtx.state != CS_STATE_IDLE) {
Expand All @@ -399,7 +374,7 @@ void EnNb_SetupArmRaise(EnNb* this, GlobalContext* globalCtx) {
}

void EnNb_SetupRaisedArmTransition(EnNb* this, s32 animFinished) {
AnimationHeader* animation = &D_06002B4C;
AnimationHeader* animation = &gNabooruArmsRaisedGivingMedallionAnim;

if (animFinished) {
Animation_Change(&this->skelAnime, animation, 1.0f, 0.0f, Animation_GetLastFrame(animation), ANIMMODE_LOOP,
Expand Down Expand Up @@ -466,7 +441,7 @@ void func_80AB19FC(EnNb* this, GlobalContext* globalCtx) {
}

void EnNb_SetupLightArrowOrSealingCs(EnNb* this, GlobalContext* globalCtx) {
EnNb_SetCurrentAnim(this, &D_06000410, 2, 0.0f, 0);
EnNb_SetCurrentAnim(this, &gNabooruPuttingHandsTogetherCastingMagicAnim, 2, 0.0f, 0);
this->action = NB_ACTION_7;
this->actor.shape.shadowAlpha = 0;
}
Expand Down Expand Up @@ -579,7 +554,7 @@ void EnNb_DrawTransparency(EnNb* this, GlobalContext* globalCtx) {
}

void EnNb_InitKidnap(EnNb* this, GlobalContext* globalCtx) {
EnNb_SetCurrentAnim(this, &D_06001E7C, 0, 0.0f, 0);
EnNb_SetCurrentAnim(this, &gNabooruTrappedInVortexPushingGroundAnim, 0, 0.0f, 0);
this->action = NB_KIDNAPPED;
this->actor.shape.shadowAlpha = 0;
gSaveContext.eventChkInf[9] |= 0x20;
Expand Down Expand Up @@ -627,7 +602,7 @@ void EnNb_SetupCaptureCutsceneState(EnNb* this, GlobalContext* globalCtx) {
}

void EnNb_SetRaisedArmCaptureAnim(EnNb* this, s32 animFinished) {
AnimationHeader* animation = &D_06001350;
AnimationHeader* animation = &gNabooruSuckedByVortexAnim;

if (animFinished) {
Animation_Change(&this->skelAnime, animation, 1.0f, 0.0f, Animation_GetLastFrame(animation), ANIMMODE_LOOP,
Expand All @@ -636,15 +611,15 @@ void EnNb_SetRaisedArmCaptureAnim(EnNb* this, s32 animFinished) {
}

void EnNb_SetupLookAroundInKidnap(EnNb* this) {
AnimationHeader* animation = &D_06001E7C;
AnimationHeader* animation = &gNabooruTrappedInVortexPushingGroundAnim;

Animation_Change(&this->skelAnime, animation, 1.0f, 0.0f, Animation_GetLastFrame(animation), ANIMMODE_LOOP, -8.0f);
this->action = NB_KIDNAPPED_LOOK_AROUND;
this->drawMode = NB_DRAW_DEFAULT;
}

void EnNb_SetupKidnap(EnNb* this) {
AnimationHeader* animation = &D_06001104;
AnimationHeader* animation = &gNabooruTrappedInVortexRaisingArmAnim;

Animation_Change(&this->skelAnime, animation, 1.0f, 0.0f, Animation_GetLastFrame(animation), ANIMMODE_ONCE, -8.0f);
this->action = NB_PORTAL_FALLTHROUGH;
Expand Down Expand Up @@ -707,7 +682,7 @@ void EnNb_SuckedInByPortal(EnNb* this, GlobalContext* globalCtx) {
}

void EnNb_SetupConfrontation(EnNb* this, GlobalContext* globalCtx) {
AnimationHeader* animation = &D_06008BD0;
AnimationHeader* animation = &gNabooruCollapseFromStandingToKneelingTransitionAnim;

EnNb_SetCurrentAnim(this, animation, 0, 0.0f, 0);
this->action = NB_IN_CONFRONTATION;
Expand Down Expand Up @@ -766,7 +741,7 @@ void func_80AB26C8(EnNb* this) {

void func_80AB26DC(EnNb* this, GlobalContext* globalCtx) {
s32 pad;
AnimationHeader* animation = &D_06008BD0;
AnimationHeader* animation = &gNabooruCollapseFromStandingToKneelingTransitionAnim;
f32 frames = Animation_GetLastFrame(animation);

EnNb_SetupCsPosRot(this, globalCtx, 1);
Expand All @@ -777,7 +752,7 @@ void func_80AB26DC(EnNb* this, GlobalContext* globalCtx) {
}

void EnNb_SetupKneel(EnNb* this) {
AnimationHeader* animation = &D_06008BD0;
AnimationHeader* animation = &gNabooruCollapseFromStandingToKneelingTransitionAnim;
f32 frames = Animation_GetLastFrame(animation);

Animation_Change(&this->skelAnime, animation, 1.0f, 0.0f, frames, ANIMMODE_ONCE, 0.0f);
Expand All @@ -787,7 +762,7 @@ void EnNb_SetupKneel(EnNb* this) {
}

void EnNb_CheckIfKneeling(EnNb* this, s32 animFinished) {
AnimationHeader* animation = &D_060046A8;
AnimationHeader* animation = &gNabooruOnAllFoursAnim;

if (animFinished) {
Animation_Change(&this->skelAnime, animation, 1.0f, 0.0f, Animation_GetLastFrame(animation), ANIMMODE_LOOP,
Expand All @@ -797,7 +772,7 @@ void EnNb_CheckIfKneeling(EnNb* this, s32 animFinished) {
}

void EnNb_SetupLookRight(EnNb* this) {
AnimationHeader* animation = &D_06003954;
AnimationHeader* animation = &gNabooruOnAllFoursToOnOneKneeLookingRightTransitionAnim;
f32 frames = Animation_GetLastFrame(animation);
EllipticEllipsis marked this conversation as resolved.
Show resolved Hide resolved

Animation_Change(&this->skelAnime, animation, 1.0f, 0.0f, frames, ANIMMODE_ONCE, -8.0f);
Expand All @@ -807,7 +782,7 @@ void EnNb_SetupLookRight(EnNb* this) {
}

void EnNb_CheckIfLookingRight(EnNb* this, s32 animFinished) {
AnimationHeader* animation = &D_06004030;
AnimationHeader* animation = &gNabooruOnOneKneeLookingRightAnim;

if (animFinished) {
Animation_Change(&this->skelAnime, animation, 1.0f, 0.0f, Animation_GetLastFrame(animation), ANIMMODE_LOOP,
Expand All @@ -817,7 +792,7 @@ void EnNb_CheckIfLookingRight(EnNb* this, s32 animFinished) {
}

void EnNb_SetupLookLeft(EnNb* this) {
AnimationHeader* animation = &D_06002DBC;
AnimationHeader* animation = &gNabooruOnOneKneeTurningHeadRightToLeftTransitionAnim;
f32 frames = Animation_GetLastFrame(animation);
EllipticEllipsis marked this conversation as resolved.
Show resolved Hide resolved

Animation_Change(&this->skelAnime, animation, 1.0f, 0.0f, frames, ANIMMODE_ONCE, -8.0f);
Expand All @@ -827,7 +802,7 @@ void EnNb_SetupLookLeft(EnNb* this) {
}

void EnNb_CheckIfLookLeft(EnNb* this, s32 animFinished) {
AnimationHeader* animation = &D_060035A8;
AnimationHeader* animation = &gNabooruOnOneKneeLookingLeftAnim;

if (animFinished) {
Animation_Change(&this->skelAnime, animation, 1.0f, 0.0f, Animation_GetLastFrame(animation), ANIMMODE_LOOP,
Expand All @@ -843,7 +818,7 @@ void EnNb_SetupDemo6KInConfrontation(EnNb* this, GlobalContext* globalCtx, s32 a
}

void EnNb_SetupRun(EnNb* this) {
AnimationHeader* animation = &D_06006320;
AnimationHeader* animation = &gNabooruKneeingToRunningToHitAnim;
f32 frames = Animation_GetLastFrame(animation);
EllipticEllipsis marked this conversation as resolved.
Show resolved Hide resolved

Animation_Change(&this->skelAnime, animation, 1.0f, 0.0f, frames, ANIMMODE_ONCE, -8.0f);
Expand Down Expand Up @@ -975,8 +950,8 @@ void func_80AB2E70(EnNb* this, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_nb_inConfrontion.c", 572);

func_80093D18(globalCtx->state.gfxCtx);
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(&D_0600D8E8));
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(&D_0600D8E8));
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(&gNabooruEyeWideTex));
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(&gNabooruEyeWideTex));
gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255);
gSPSegment(POLY_OPA_DISP++, 0x0C, &D_80116280[2]);
SkelAnime_DrawFlexOpa(globalCtx, skelAnime->skeleton, skelAnime->jointTable, skelAnime->dListCount, NULL, NULL,
Expand All @@ -988,8 +963,8 @@ void func_80AB2E70(EnNb* this, GlobalContext* globalCtx) {
s32 func_80AB2FC0(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) {
EnNb* this = THIS;

if (limbIndex == 15) {
*dList = D_06013158;
if (limbIndex == NB_LIMB_HEAD) {
*dList = gNabooruHeadMouthOpenDL;
}

return 0;
Expand All @@ -1016,7 +991,7 @@ void func_80AB2FE4(EnNb* this, GlobalContext* globalCtx) {
}

void EnNb_SetupCreditsSpawn(EnNb* this, GlobalContext* globalCtx) {
EnNb_SetCurrentAnim(this, &D_06000BC0, 0, 0.0f, 0);
EnNb_SetCurrentAnim(this, &gNabooruSittingCrossLeggedAnim, 0, 0.0f, 0);
this->action = NB_CREDITS_INIT;
this->drawMode = NB_DRAW_NOTHING;
this->actor.shape.shadowAlpha = 0;
Expand Down Expand Up @@ -1052,13 +1027,13 @@ void EnNb_SetupCreditsSit(EnNb* this) {
}

void EnNb_SetupCreditsHeadTurn(EnNb* this) {
EnNb_SetCurrentAnim(this, &D_06005CA4, 2, -8.0f, 0);
EnNb_SetCurrentAnim(this, &gNabooruSittingCrossLeggedTurningToLookUpRightTransitionAnim, 2, -8.0f, 0);
this->action = NB_CREDITS_HEAD_TURN;
}

void EnNb_CheckIfLookingUp(EnNb* this, s32 animFinished) {
if (animFinished) {
EnNb_SetCurrentAnim(this, &D_06005614, 0, 0.0f, 0);
EnNb_SetCurrentAnim(this, &gNabooruSittingCrossLeggedLookingUpRightAnim, 0, 0.0f, 0);
}
}

Expand Down Expand Up @@ -1122,11 +1097,11 @@ void EnNb_CrawlspaceSpawnCheck(EnNb* this, GlobalContext* globalCtx) {

// looking into crawlspace
if (!(gSaveContext.eventChkInf[9] & 0x10)) {
EnNb_SetCurrentAnim(this, &D_06006E78, 0, 0.0f, 0);
EnNb_SetCurrentAnim(this, &gNabooruKneeingAtCrawlspaceAnim, 0, 0.0f, 0);
this->action = NB_CROUCH_CRAWLSPACE;
this->drawMode = NB_DRAW_DEFAULT;
} else {
EnNb_SetCurrentAnim(this, &D_06004BB4, 0, 0.0f, 0);
EnNb_SetCurrentAnim(this, &gNabooruStandingHandsOnHipsAnim, 0, 0.0f, 0);
this->headTurnFlag = 1;
this->actor.flags |= 9;
this->actor.world.pos = this->finalPos;
Expand Down Expand Up @@ -1195,15 +1170,15 @@ void func_80AB36DC(EnNb* this, GlobalContext* globalCtx) {

void EnNb_CheckNoticed(EnNb* this, GlobalContext* globalCtx) {
if (EnNb_GetNoticedStatus(this, globalCtx)) {
EnNb_SetCurrentAnim(this, &D_06004E60, 2, -8.0f, 0);
EnNb_SetCurrentAnim(this, &gNabooruStandingToWalkingTransitionAnim, 2, -8.0f, 0);
this->action = NB_NOTICE_PLAYER;
EnNb_SetNoticeSFX(this);
}
}

void EnNb_SetupIdleCrawlspace(EnNb* this, s32 animFinished) {
if (animFinished) {
EnNb_SetCurrentAnim(this, &D_06004BB4, 0, -8.0f, 0);
EnNb_SetCurrentAnim(this, &gNabooruStandingHandsOnHipsAnim, 0, -8.0f, 0);
this->headTurnFlag = 1;
this->actor.flags |= 9;
this->action = NB_IDLE_CRAWLSPACE;
Expand All @@ -1227,7 +1202,7 @@ void func_80AB3838(EnNb* this, GlobalContext* globalCtx) {
}

void EnNb_SetupPathMovement(EnNb* this, GlobalContext* globalCtx) {
EnNb_SetCurrentAnim(this, &D_06004E60, 2, -8.0f, 0);
EnNb_SetCurrentAnim(this, &gNabooruStandingToWalkingTransitionAnim, 2, -8.0f, 0);
gSaveContext.eventChkInf[9] |= 0x10;
this->action = NB_IN_PATH;
this->actor.flags &= ~9;
Expand Down Expand Up @@ -1294,10 +1269,10 @@ void func_80AB3A7C(EnNb* this, GlobalContext* globalCtx, s32 animFinished) {

if ((u16)(kREG(17) + 0x19) > movementTimer) {
EllipticEllipsis marked this conversation as resolved.
Show resolved Hide resolved
if (animFinished) {
EnNb_SetCurrentAnim(this, &D_06009238, 0, 0.0f, 0);
EnNb_SetCurrentAnim(this, &gNabooruWalkingAnim, 0, 0.0f, 0);
}
} else {
EnNb_SetCurrentAnim(this, &D_06004BB4, 0, -8.0f, 0);
EnNb_SetCurrentAnim(this, &gNabooruStandingHandsOnHipsAnim, 0, -8.0f, 0);
this->action = NB_IDLE_AFTER_TALK;
}
}
Expand Down Expand Up @@ -1443,7 +1418,7 @@ 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, &D_060181C8, NULL, this->jointTable, this->morphTable, 19);
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gNabooruSkel, NULL, this->jointTable, this->morphTable, 19);

switch (EnNb_GetType(this)) {
case NB_TYPE_DEMO02:
Expand Down Expand Up @@ -1473,11 +1448,11 @@ s32 EnNb_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
s32 ret = false;

if (this->headTurnFlag != 0) {
if (limbIndex == 8) {
if (limbIndex == NB_LIMB_TORSO) {
rot->x += unk_300->unk_0E.y;
rot->y -= unk_300->unk_0E.x;
ret = false;
} else if (limbIndex == 15) {
} else if (limbIndex == NB_LIMB_HEAD) {
rot->x += unk_300->unk_08.y;
rot->z += unk_300->unk_08.x;
ret = false;
Expand All @@ -1490,7 +1465,7 @@ s32 EnNb_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
void EnNb_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) {
EnNb* this = THIS;

if (limbIndex == 15) {
if (limbIndex == NB_LIMB_HEAD) {
Vec3f vec1 = { 0.0f, 10.0f, 0.0f };
Vec3f vec2;

Expand Down
23 changes: 23 additions & 0 deletions src/overlays/actors/ovl_En_Nb/z_en_nb.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,29 @@ typedef enum {
/* 0x06 */ NB_TYPE_CRAWLSPACE
} EnNbType;

typedef enum {
/* 0x00 */ NB_LIMB_NONE,
/* 0x01 */ NB_LIMB_ROOT,
/* 0x02 */ NB_LIMB_L_THIGH,
/* 0x03 */ NB_LIMB_L_SHIN,
/* 0x04 */ NB_LIMB_L_FOOT,
/* 0x05 */ NB_LIMB_R_THIGH,
/* 0x06 */ NB_LIMB_R_SHIN,
/* 0x07 */ NB_LIMB_R_FOOT,
/* 0x08 */ NB_LIMB_TORSO,
/* 0x09 */ NB_LIMB_L_UPPER_ARM,
/* 0x0A */ NB_LIMB_L_FOREARM,
/* 0x0B */ NB_LIMB_L_HAND,
/* 0x0C */ NB_LIMB_R_UPPER_ARM,
/* 0x0D */ NB_LIMB_R_FOREARM,
/* 0x0E */ NB_LIMB_R_HAND,
/* 0x0F */ NB_LIMB_HEAD,
/* 0x10 */ NB_LIMB_BLANK,
/* 0x11 */ NB_LIMB_PONYTAIL,
/* 0x12 */ NB_LIMB_WAIST,
/* 0x13 */ NB_LIMB_MAX
} EnGeldBLimb;

extern const ActorInit En_Nb_InitVars;

#endif