1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-21 22:41:14 +00:00

z_demo documentation (#1327)

* commit old stuff

* progress

* progress

* progress

* progress

* more progress, renaming cues next

* small changes

* enum values added for all actions

* hardcoded values removed when possible

* commands renamed

* first pass of action -> cue

* fix some matches

* some more cleanup

* scriptPtr

* forgot one

* remove cue rot union

* more changes

* some more stuff

* more stuff

* fix matching issues

* some more things

* progress, starting to rename destinations

* small changes

* name some destinations

* more names

* need to switch branch

* progress

* first pass of destination names

* usages fixed

* use destination enum

* fix csdis

* format

* command descriptions

* revert accidental zap changes

* forgot some things

* use a single macro for CutsceneCameraPoint (idk why i didnt think of this sooner)

* typo

* review1

* clarify ruby/sapphire comment

* remove endframe for commands that dont use it

* some more review

* most review, but not all

* scriptPtr -> script, and another small change

* ocarina action

* remove +1 from light settings command, change comment

* actionIndex -> cueIdTemp (i guess)

* _SetCueX -> _SetXFromCue

* format

* tweak fade out seq arg names

* use spline terminology

* more dragorn and engineer review

* misc start/end frame note

* cleanup StartPosRotFromCue vs PosRotFromCue

* cleanup spline terminology

* sPrevCamId -> sReturnToCamId

* comment on debug cs data address

* Cutscene_Init -> Cutscene_InitContext

* single point types are not a list

* remove todo comment

* some more review

* rumble struct names

* some review

* more review

* missed one

* reword pointer comment

* even more review

* match transition terminology with z_play

* change condition and format

* frame count

* command specific structs with alignment

* anon review

* remove unneeded arg from time macro

* yeet `CsCmdGeneric`

* remove unused from single point types

* typo

* compromise attempt -- name endFrame everywhere

* fixes

* fix again

* copied the wrong note

* cutscene data note

* review, format

* compat defines

* idk whats going on man

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
This commit is contained in:
fig02 2022-12-24 13:55:17 -05:00 committed by GitHub
parent 92e03cf747
commit 7927e7b330
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
130 changed files with 6392 additions and 5954 deletions

View file

@ -1117,22 +1117,23 @@ s32 EnIk_UpdateSkelAnime(EnIk* this) {
return SkelAnime_Update(&this->skelAnime);
}
CsCmdActorAction* EnIk_GetNpcAction(PlayState* play, s32 actionIdx) {
CsCmdActorCue* EnIk_GetCue(PlayState* play, s32 cueChannel) {
if (play->csCtx.state != CS_STATE_IDLE) {
return play->csCtx.npcActions[actionIdx];
return play->csCtx.actorCues[cueChannel];
} else {
return NULL;
}
}
void EnIk_MoveNpcToPos(EnIk* this, PlayState* play, s32 actionIdx) {
CsCmdActorAction* npcAction = EnIk_GetNpcAction(play, actionIdx);
void EnIk_SetStartPosRotFromCue(EnIk* this, PlayState* play, s32 cueChannel) {
CsCmdActorCue* cue = EnIk_GetCue(play, cueChannel);
if (npcAction != NULL) {
this->actor.world.pos.x = npcAction->startPos.x;
this->actor.world.pos.y = npcAction->startPos.y;
this->actor.world.pos.z = npcAction->startPos.z;
this->actor.world.rot.y = this->actor.shape.rot.y = npcAction->rot.y;
if (cue != NULL) {
this->actor.world.pos.x = cue->startPos.x;
this->actor.world.pos.y = cue->startPos.y;
this->actor.world.pos.z = cue->startPos.z;
this->actor.world.rot.y = this->actor.shape.rot.y = cue->rot.y;
}
}
@ -1153,7 +1154,7 @@ void EnIk_SetupCsAction0(EnIk* this) {
void EnIk_SetupCsAction1(EnIk* this, PlayState* play) {
Animation_Change(&this->skelAnime, &gIronKnuckleNabooruSummonAxeAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gIronKnuckleNabooruSummonAxeAnim), ANIMMODE_ONCE, 0.0f);
EnIk_MoveNpcToPos(this, play, 4);
EnIk_SetStartPosRotFromCue(this, play, 4);
this->csAction = IK_CS_ACTION_1;
this->csDrawMode = IK_CS_DRAW_INTRO;
this->actor.shape.shadowAlpha = 255;
@ -1170,7 +1171,7 @@ void EnIk_SetupCsAction2(EnIk* this) {
}
void EnIk_HandleEnemyChange(EnIk* this, PlayState* play, s32 animFinished) {
if (animFinished && (EnIk_GetNpcAction(play, 4) != NULL)) {
if (animFinished && (EnIk_GetCue(play, 4) != NULL)) {
EnIk_ChangeToEnemy(this, play);
}
}
@ -1200,7 +1201,7 @@ void EnIk_SetupCsAction3(EnIk* this, PlayState* play) {
Animation_Change(&this->skelAnime, &gIronKnuckleNabooruDeathAnim, 1.0f, 0.0f, endFrame, ANIMMODE_ONCE, 0.0f);
this->csAction = IK_CS_ACTION_3;
this->csDrawMode = IK_CS_DRAW_DEFEAT;
EnIk_MoveNpcToPos(this, play, 4);
EnIk_SetStartPosRotFromCue(this, play, 4);
EnIk_PlayDeathSfx(this, play);
this->actor.shape.shadowAlpha = 255;
}
@ -1232,7 +1233,7 @@ void EnIk_CsAction4(EnIk* this, PlayState* play) {
}
void EnIk_CsAction5(EnIk* this, PlayState* play) {
if (EnIk_GetNpcAction(play, 4) == NULL) {
if (EnIk_GetCue(play, 4) == NULL) {
Actor_Kill(&this->actor);
}
}
@ -1321,14 +1322,16 @@ void EnIk_CsDrawDefeat(EnIk* this, PlayState* play) {
}
void EnIk_HandleCsCues(EnIk* this, PlayState* play) {
CsCmdActorAction* npcAction = EnIk_GetNpcAction(play, 4);
CsCmdActorCue* cue = EnIk_GetCue(play, 4);
u32 nextCueId;
u32 currentCueId;
if (npcAction != NULL) {
s32 action = npcAction->action;
s32 currentNpcAction = this->npcAction;
if (cue != NULL) {
nextCueId = cue->id;
currentCueId = this->cueId;
if (action != currentNpcAction) {
switch (action) {
if (nextCueId != currentCueId) {
switch (nextCueId) {
case 1:
EnIk_SetupCsAction0(this);
break;
@ -1361,7 +1364,7 @@ void EnIk_HandleCsCues(EnIk* this, PlayState* play) {
osSyncPrintf("En_Ik_inConfrontion_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
}
this->npcAction = action;
this->cueId = nextCueId;
}
}
}
@ -1529,7 +1532,7 @@ void EnIk_StartDefeatCutscene(Actor* thisx, PlayState* play) {
if (!Play_InCsMode(play)) {
this->actor.update = EnIk_UpdateCutscene;
this->actor.draw = EnIk_DrawCutscene;
Cutscene_SetSegment(play, gSpiritBossNabooruKnuckleDefeatCs);
Cutscene_SetScript(play, gSpiritBossNabooruKnuckleDefeatCs);
gSaveContext.cutsceneTrigger = 1;
Actor_SetScale(&this->actor, 0.01f);
SET_EVENTCHKINF(EVENTCHKINF_3C);

View file

@ -113,7 +113,7 @@ typedef struct EnIk {
/* 0x04C4 */ s32 blureIdx;
/* 0x04C8 */ s32 csAction;
/* 0x04CC */ s32 csDrawMode;
/* 0x04D0 */ u32 npcAction;
/* 0x04D0 */ u32 cueId;
/* 0x04D4 */ s32 isAxeSummoned;
/* 0x04D8 */ char unk_4D8[0x04];
} EnIk; // size = 0x04DC