Zelda64Recomp/patches/gibdo_mask_cutscene_father_human.c
Wiseguy b5360b0546
Some checks failed
validate-internal / build (push) Has been cancelled
1.2.1 Changes (#625)
* Update runtime for hook and callback sorting, update version number

* Actually update version number

* Automatically open mods menu when dragging a mod which also prevents issues when installing a mod from the launcher menu

* Update RT64 to add texture pack shift configuration and fix minimized memory leak

* Update runtime for return hook getter exports

* Actually update rt64

* Update RT64 to fix texture pack ordering

* Implement optional dependencies, fix memory slotmaps, bump version number to 1.2.1-dev

* Add command-line option to show console output on Windows. (#632)

* Add new raphnet adapter revision to controller DB

* Add another mayflash N64 adapter to the controller database file

* Update runtime after merge for optional dependencies

* Update runtime for optional dependency mod callback fix

* Add mayflash magic NS to controller database

* Update RT64 for extended address fix and x11 dependency removal

* Update RT64 to fix build issue caused by x11

* Update runtime to remove unnnecessary x11 includes

* Fix more x11 define compilation issues

* Fix the x86-64 CPU requirement listing in the readme (#634)

* Transform tagging for keaton grass tornado

* Interpolation for sword trails

* Switch RT64 to gEXVertex fix branch (temporary until merge)

* Add 8bitdo 64 bluetooth controller to database

* Add export to get bowstring transform ID

* Update RT64 to fix linux dev mode menu and texture streaming race condition

* Fix all the interpolation glitches in the Gibdo Mask cutscene (#641)

* Fix the actor extension API breaking when registering an extension for actor type 0 first

* Remove slotmap submodule and integrate header directly after submodule URL changed

* Transform tagging for ObjGrass

* Adding autosave events. (#611)

* Adding autosave events. Dead simple.

* Update autosaving.c to include @recomp_event comments

* Prevent autosaves during minigames and fix holding powder keg on autosave load (#640)

* Update runtime for more accurate VI and switch to improved pacing RT64 branch (#644)

* Update runtime for more accurate VI and switch to improved pacing RT64 branch

* Update N64ModernRuntime and RT64 after merge

* Update recompiler to match runtime symbol list

* Remove unused gibdo patch file

---------

Co-authored-by: Darío <dariosamo@gmail.com>
Co-authored-by: Reonu <15913880+Reonu@users.noreply.github.com>
2025-08-15 21:31:57 -04:00

107 lines
4.5 KiB
C

#include "patches.h"
#include "transform_ids.h"
#include "overlays/actors/ovl_En_Hgo/z_en_hgo.h"
typedef enum {
/* 0 */ HGO_ANIM_ARMS_FOLDED,
/* 1 */ HGO_ANIM_ASTONISHED,
/* 2 */ HGO_ANIM_KNEEL_DOWN_AND_HUG,
/* 3 */ HGO_ANIM_CONSOLE,
/* 4 */ HGO_ANIM_CONSOLE_HEAD_UP,
/* 5 */ HGO_ANIM_REACH_DOWN_TO_LIFT,
/* 6 */ HGO_ANIM_TOSS,
/* 7 */ HGO_ANIM_MAX
} HgoAnimation;
extern AnimationInfo sPamelasFatherHumanAnimationInfo[];
extern void EnHgo_Draw(Actor* thisx, PlayState* play);
extern void EnHgo_DoNothing(EnHgo* this, PlayState* play);
extern void EnHgo_SetupInitCollision(EnHgo* this);
// @recomp Skip interpolation when the animations change during the cutscene, as the
// animation changes are meant to happen at the same time as the camera cuts.
RECOMP_PATCH s32 EnHgo_HandleCsAction(EnHgo* this, PlayState* play) {
s32 cueChannel;
if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_486)) {
cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_486);
if (this->cueId != play->csCtx.actorCues[cueChannel]->id) {
this->cueId = play->csCtx.actorCues[cueChannel]->id;
switch (play->csCtx.actorCues[cueChannel]->id) {
case 1:
this->animIndex = HGO_ANIM_ARMS_FOLDED;
Actor_ChangeAnimationByInfo(&this->skelAnime, sPamelasFatherHumanAnimationInfo, HGO_ANIM_ARMS_FOLDED);
break;
case 2:
this->actor.draw = EnHgo_Draw;
this->animIndex = HGO_ANIM_ASTONISHED;
Actor_ChangeAnimationByInfo(&this->skelAnime, sPamelasFatherHumanAnimationInfo, HGO_ANIM_ASTONISHED);
break;
case 3:
this->animIndex = HGO_ANIM_KNEEL_DOWN_AND_HUG;
Actor_ChangeAnimationByInfo(&this->skelAnime, sPamelasFatherHumanAnimationInfo, HGO_ANIM_KNEEL_DOWN_AND_HUG);
break;
case 4:
this->animIndex = HGO_ANIM_CONSOLE;
Actor_ChangeAnimationByInfo(&this->skelAnime, sPamelasFatherHumanAnimationInfo, HGO_ANIM_CONSOLE);
break;
case 5:
this->animIndex = HGO_ANIM_CONSOLE_HEAD_UP;
Actor_ChangeAnimationByInfo(&this->skelAnime, sPamelasFatherHumanAnimationInfo, HGO_ANIM_CONSOLE_HEAD_UP);
break;
case 6:
this->animIndex = HGO_ANIM_REACH_DOWN_TO_LIFT;
Actor_ChangeAnimationByInfo(&this->skelAnime, sPamelasFatherHumanAnimationInfo, HGO_ANIM_REACH_DOWN_TO_LIFT);
break;
default:
break;
}
actor_set_interpolation_skipped(&this->actor);
} else if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
switch (this->animIndex) {
case HGO_ANIM_ASTONISHED:
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame) && !this->isInCutscene) {
this->isInCutscene = true;
if ((gSaveContext.sceneLayer == 0) &&
((play->csCtx.scriptIndex == 2) || (play->csCtx.scriptIndex == 4))) {
Actor_PlaySfx(&this->actor, NA_SE_VO_GBVO02);
}
}
break;
case HGO_ANIM_KNEEL_DOWN_AND_HUG:
this->animIndex = HGO_ANIM_CONSOLE;
Actor_ChangeAnimationByInfo(&this->skelAnime, sPamelasFatherHumanAnimationInfo, HGO_ANIM_CONSOLE);
break;
case HGO_ANIM_REACH_DOWN_TO_LIFT:
this->animIndex = HGO_ANIM_TOSS;
Actor_ChangeAnimationByInfo(&this->skelAnime, sPamelasFatherHumanAnimationInfo, HGO_ANIM_TOSS);
default:
break;
}
}
Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel);
return true;
}
if ((play->csCtx.state == CS_STATE_IDLE) && CHECK_WEEKEVENTREG(WEEKEVENTREG_75_20) &&
(this->actionFunc == EnHgo_DoNothing)) {
this->actor.shape.rot.y = this->actor.world.rot.y;
Actor_Spawn(&play->actorCtx, play, ACTOR_ELF_MSG2, this->actor.focus.pos.x, this->actor.focus.pos.y,
this->actor.focus.pos.z, 7, 0, 0, 0x7F5A);
EnHgo_SetupInitCollision(this);
}
this->cueId = 99;
return false;
}