mirror of https://github.com/zeldaret/mm.git
En_hg Decompiled (#221)
* starting on en_hg * working on another func * fixing some stuff in ghaka, and tweaks in en_hg * fixing some stuff * fixing state flags * all functions matching just data issues * en_hg OK * fixed to give OK * some docs, and fixes * fixing warnings * fixing some things * fixing warning * adding pr comments * fixing a typo
This commit is contained in:
parent
c774f880e1
commit
b59d9a9935
|
|
@ -942,7 +942,9 @@ typedef struct {
|
|||
/* 0x12023 */ s8 unk12023;
|
||||
/* 0x12024 */ UNK_TYPE1 unk12024[0x6];
|
||||
/* 0x1202A */ u16 unk1202A;
|
||||
/* 0x1202C */ UNK_TYPE1 pad1202C[0x18];
|
||||
/* 0x1202C */ UNK_TYPE1 pad1202C[0x2];
|
||||
/* 0x1202E */ u16 unk1202E;
|
||||
/* 0x12030 */ UNK_TYPE1 pad12030[0x14];
|
||||
/* 0x12044 */ s16 unk12044;
|
||||
/* 0x12046 */ UNK_TYPE1 pad12046[0x24];
|
||||
/* 0x1206A */ s16 unk1206A;
|
||||
|
|
|
|||
|
|
@ -8045,9 +8045,9 @@ SECTIONS
|
|||
ovl_En_Hg : AT(RomLocation)
|
||||
{
|
||||
build/src/overlays/actors/ovl_En_Hg/z_en_hg.o(.text)
|
||||
build/asm/overlays/ovl_En_Hg_data.o(.data)
|
||||
build/src/overlays/actors/ovl_En_Hg/z_en_hg.o(.data)
|
||||
build/src/overlays/actors/ovl_En_Hg/z_en_hg.o(.rodata)
|
||||
build/asm/overlays/ovl_En_Hg_rodata.o(.rodata)
|
||||
build/src/overlays/actors/ovl_En_Hg/z_en_hg_overlay.o(.ovl)
|
||||
}
|
||||
SegmentEnd = .;
|
||||
SegmentSize = SegmentEnd - SegmentStart;
|
||||
|
|
|
|||
|
|
@ -347,6 +347,18 @@ D_06006320 = 0x06006320;
|
|||
D_06006720 = 0x06006720;
|
||||
D_06006920 = 0x06006920;
|
||||
|
||||
/* z_en_hg */
|
||||
D_06008580 = 0x06008580;
|
||||
D_0600260C = 0x0600260C;
|
||||
D_06005E28 = 0x06005E28;
|
||||
D_06009D44 = 0x06009D44;
|
||||
D_0600A164 = 0x0600A164;
|
||||
D_06000370 = 0x06000370;
|
||||
D_06001138 = 0x06001138;
|
||||
D_060015D4 = 0x060015D4;
|
||||
D_06001960 = 0x06001960;
|
||||
D_0600AE1C = 0x0600AE1C;
|
||||
|
||||
/* z_en_in */
|
||||
D_06014EA8 = 0x06014EA8;
|
||||
D_06015E38 = 0x06015E38;
|
||||
|
|
@ -756,3 +768,4 @@ D_06000968 = 0x06000968;
|
|||
/* z_obj_visiblock */
|
||||
D_06000AD0 = 0x06000AD0;
|
||||
D_06000140 = 0x06000140;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,9 @@
|
|||
/*
|
||||
* File: z_en_hg.c
|
||||
* Overlay: En_Hg
|
||||
* Description: Pamela's Father (Human)
|
||||
*/
|
||||
|
||||
#include "z_en_hg.h"
|
||||
|
||||
#define FLAGS 0x02100019
|
||||
|
|
@ -9,7 +15,32 @@ void EnHg_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
|||
void EnHg_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnHg_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
|
||||
#if 0
|
||||
void func_80BCF354(EnHg* this);
|
||||
void func_80BCF398(EnHg* this, GlobalContext* globalCtx);
|
||||
void func_80BCF468(EnHg* this);
|
||||
void func_80BCF468(EnHg* this);
|
||||
void func_80BCF4AC(EnHg* this, GlobalContext* globalCtx);
|
||||
void func_80BCF5F0(EnHg* this);
|
||||
void func_80BCF634(EnHg* this, GlobalContext* globalCtx);
|
||||
void func_80BCF68C(EnHg* this);
|
||||
void func_80BCF6D0(EnHg* this, GlobalContext* globalCtx);
|
||||
void func_80BCF8A0(EnHg* this, GlobalContext* globalCtx);
|
||||
void func_80BCF93C(EnHg* this);
|
||||
void func_80BCF95C(EnHg* this, GlobalContext* globalCtx);
|
||||
s32 EnHg_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx);
|
||||
void EnHg_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx);
|
||||
|
||||
extern FlexSkeletonHeader D_06008580;
|
||||
extern AnimationHeader D_0600260C;
|
||||
extern AnimationHeader D_06009D44;
|
||||
extern AnimationHeader D_0600A164;
|
||||
extern AnimationHeader D_06000370;
|
||||
extern AnimationHeader D_06001138;
|
||||
extern AnimationHeader D_060015D4;
|
||||
extern AnimationHeader D_06001960;
|
||||
extern AnimationHeader D_0600AE1C;
|
||||
extern Gfx D_06005E28[];
|
||||
|
||||
const ActorInit En_Hg_InitVars = {
|
||||
ACTOR_EN_HG,
|
||||
ACTORCAT_PROP,
|
||||
|
|
@ -22,17 +53,27 @@ const ActorInit En_Hg_InitVars = {
|
|||
(ActorFunc)EnHg_Draw,
|
||||
};
|
||||
|
||||
|
||||
// static ColliderCylinderInit sCylinderInit = {
|
||||
static ColliderCylinderInit D_80BCFFB0 = {
|
||||
{ COLTYPE_HIT0, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_2, COLSHAPE_CYLINDER, },
|
||||
{ ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, },
|
||||
static ColliderCylinderInit sCylinderInit = {
|
||||
{
|
||||
COLTYPE_HIT0,
|
||||
AT_NONE,
|
||||
AC_ON | AC_TYPE_PLAYER,
|
||||
OC1_ON | OC1_TYPE_ALL,
|
||||
OC2_TYPE_2,
|
||||
COLSHAPE_CYLINDER,
|
||||
},
|
||||
{
|
||||
ELEMTYPE_UNK0,
|
||||
{ 0x00000000, 0x00, 0x00 },
|
||||
{ 0xF7CFFFFF, 0x00, 0x00 },
|
||||
TOUCH_NONE | TOUCH_SFX_NORMAL,
|
||||
BUMP_ON,
|
||||
OCELEM_ON,
|
||||
},
|
||||
{ 18, 46, 0, { 0, 0, 0 } },
|
||||
};
|
||||
|
||||
|
||||
// static DamageTable sDamageTable = {
|
||||
static DamageTable D_80BCFFDC = {
|
||||
static DamageTable sDamageTable = {
|
||||
/* Deku Nut */ DMG_ENTRY(0, 0x1),
|
||||
/* Deku Stick */ DMG_ENTRY(1, 0xD),
|
||||
/* Horse trample */ DMG_ENTRY(0, 0x0),
|
||||
|
|
@ -67,56 +108,320 @@ static DamageTable D_80BCFFDC = {
|
|||
/* Powder Keg */ DMG_ENTRY(1, 0xF),
|
||||
};
|
||||
|
||||
static CollisionCheckInfoInit2 sColChkInfoInit2 = {
|
||||
0, 0, 0, 0, 0x80,
|
||||
};
|
||||
|
||||
// sColChkInfoInit
|
||||
static CollisionCheckInfoInit2 D_80BCFFFC = { 0, 0, 0, 0, 128 };
|
||||
static ActorAnimationEntry sAnimations[] = {
|
||||
{ &D_0600260C, 1.0f, 0.0f, 0.0f, 0, -4.0f }, { &D_06009D44, 1.0f, 0.0f, 0.0f, 0, -4.0f },
|
||||
{ &D_0600A164, 1.0f, 0.0f, 0.0f, 0, -4.0f }, { &D_06000370, 1.0f, 0.0f, 0.0f, 2, 0.0f },
|
||||
{ &D_06001138, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &D_060015D4, 1.0f, 0.0f, 0.0f, 2, 0.0f },
|
||||
{ &D_06001960, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &D_0600AE1C, 1.0f, 0.0f, 0.0f, 0, 0.0f },
|
||||
};
|
||||
|
||||
static u32 D_80BD00C8 = false;
|
||||
|
||||
extern ColliderCylinderInit D_80BCFFB0;
|
||||
extern DamageTable D_80BCFFDC;
|
||||
extern CollisionCheckInfoInit2 D_80BCFFFC;
|
||||
#endif
|
||||
void EnHg_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnHg* this = THIS;
|
||||
s16 currentCutscene = this->actor.cutscene;
|
||||
s32 i;
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Hg_0x80BCF1D0/EnHg_Init.asm")
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, NULL, 36.0f);
|
||||
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06008580, &D_0600260C, this->limbDrawTbl, this->transitionDrawTbl,
|
||||
HG_LIMB_MAX);
|
||||
Collider_InitCylinder(globalCtx, &this->collider);
|
||||
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
|
||||
CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit2);
|
||||
if ((gSaveContext.weekEventReg[0x4B] & 0x20) || (gSaveContext.weekEventReg[0x34] & 0x20)) {
|
||||
Actor_MarkForDeath(&this->actor);
|
||||
}
|
||||
this->actor.targetMode = 1;
|
||||
this->actor.colChkInfo.health = 0;
|
||||
this->actor.gravity = -1.0f;
|
||||
for (i = 0; i < ARRAY_COUNT(this->cutscenes); i++) {
|
||||
if (currentCutscene == -1) {
|
||||
break;
|
||||
}
|
||||
this->cutscenes[i] = currentCutscene;
|
||||
currentCutscene = ActorCutscene_GetAdditionalCutscene(currentCutscene);
|
||||
}
|
||||
func_80BCF354(this);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Hg_0x80BCF1D0/EnHg_Destroy.asm")
|
||||
void EnHg_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnHg* this = THIS;
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Hg_0x80BCF1D0/func_80BCF354.asm")
|
||||
Collider_DestroyCylinder(globalCtx, &this->collider);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Hg_0x80BCF1D0/func_80BCF398.asm")
|
||||
void func_80BCF354(EnHg* this) {
|
||||
func_800BDC5C(&this->skelAnime, sAnimations, 0);
|
||||
this->actionFunc = func_80BCF398;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Hg_0x80BCF1D0/func_80BCF468.asm")
|
||||
void func_80BCF398(EnHg* this, GlobalContext* globalCtx) {
|
||||
if (this->actor.colChkInfo.health == 1) {
|
||||
if ((this->actor.xzDistToPlayer < 200.0f && this->actor.yDistToPlayer < 40.0f) &&
|
||||
!func_800EE29C(globalCtx, 0x1E3)) {
|
||||
func_80BCF468(this);
|
||||
}
|
||||
if ((gSaveContext.sceneSetupIndex == 0 && globalCtx->csCtx.unk_12 == 0) &&
|
||||
(globalCtx->csCtx.frames == 20 || globalCtx->csCtx.frames == 60)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_HALF_REDEAD_SURPRISE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Hg_0x80BCF1D0/func_80BCF4AC.asm")
|
||||
void func_80BCF468(EnHg* this) {
|
||||
func_800BDC5C(&this->skelAnime, sAnimations, 1);
|
||||
this->actionFunc = func_80BCF4AC;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Hg_0x80BCF1D0/func_80BCF5F0.asm")
|
||||
void func_80BCF4AC(EnHg* this, GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
s32 pad;
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Hg_0x80BCF1D0/func_80BCF634.asm")
|
||||
this->actor.speedXZ = 1.6f;
|
||||
if (!(player->stateFlags2 & 0x08000000) && !func_80152498(&globalCtx->msgCtx)) {
|
||||
if (((this->skelAnime.animCurrentFrame > 9.0f) && (this->skelAnime.animCurrentFrame < 16.0f)) ||
|
||||
(this->skelAnime.animCurrentFrame > 44.0f) && (this->skelAnime.animCurrentFrame < 51.0f)) {
|
||||
Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor);
|
||||
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, 0x3E8, 0x14);
|
||||
this->actor.world.rot.y = this->actor.shape.rot.y;
|
||||
}
|
||||
if ((Math_Vec3f_DistXZ(&this->actor.world.pos, &this->actor.home.pos) > 200.0f) &&
|
||||
(Math_Vec3f_DistXZ(&player->actor.world.pos, &this->actor.home.pos) > 200.0f)) {
|
||||
func_80BCF5F0(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Hg_0x80BCF1D0/func_80BCF68C.asm")
|
||||
void func_80BCF5F0(EnHg* this) {
|
||||
func_800BDC5C(&this->skelAnime, sAnimations, 0);
|
||||
this->actionFunc = func_80BCF634;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Hg_0x80BCF1D0/func_80BCF6D0.asm")
|
||||
void func_80BCF634(EnHg* this, GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Hg_0x80BCF1D0/func_80BCF710.asm")
|
||||
if (Math_Vec3f_DistXZ(&player->actor.world.pos, &this->actor.home.pos) < 200.0f) {
|
||||
func_80BCF468(this);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Hg_0x80BCF1D0/func_80BCF778.asm")
|
||||
void func_80BCF68C(EnHg* this) {
|
||||
func_800BDC5C(&this->skelAnime, sAnimations, 2);
|
||||
this->actionFunc = func_80BCF6D0;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Hg_0x80BCF1D0/func_80BCF7D8.asm")
|
||||
void func_80BCF6D0(EnHg* this, GlobalContext* globalCtx) {
|
||||
if (func_801378B8(&this->skelAnime, this->skelAnime.animFrameCount)) {
|
||||
func_80BCF5F0(this);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Hg_0x80BCF1D0/func_80BCF88C.asm")
|
||||
void func_80BCF710(EnHg* this, GlobalContext* globalCtx) {
|
||||
if (!func_80152498(&globalCtx->msgCtx)) {
|
||||
if (func_800B84D0(&this->actor, globalCtx)) {
|
||||
func_801518B0(globalCtx, 0x24F, &this->actor);
|
||||
} else {
|
||||
func_800B8614(&this->actor, globalCtx, 80.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Hg_0x80BCF1D0/func_80BCF8A0.asm")
|
||||
void func_80BCF778(EnHg* this, GlobalContext* globalCtx) {
|
||||
if (this->actor.colChkInfo.health == 1) {
|
||||
if (this->actionFunc == func_80BCF4AC || this->actionFunc == func_80BCF6D0 ||
|
||||
this->actionFunc == func_80BCF634) {
|
||||
func_800B9010(&this->actor, 0x32B7);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Hg_0x80BCF1D0/func_80BCF93C.asm")
|
||||
void func_80BCF7D8(EnHg* this, GlobalContext* globalCtx) {
|
||||
if (this->actor.colChkInfo.health) {
|
||||
if (this->collider.base.acFlags & AC_HIT) {
|
||||
this->collider.base.acFlags &= ~AC_HIT;
|
||||
func_80BCF68C(this);
|
||||
}
|
||||
Collider_UpdateCylinder(&this->actor, &this->collider);
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
|
||||
if (this->actionFunc != func_80BCF6D0 && this->actionFunc != func_80BCF8A0 &&
|
||||
this->actionFunc != func_80BCF95C) {
|
||||
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Hg_0x80BCF1D0/func_80BCF95C.asm")
|
||||
void func_80BCF88C(EnHg* this) {
|
||||
this->actionFunc = func_80BCF8A0;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Hg_0x80BCF1D0/func_80BCFC0C.asm")
|
||||
void func_80BCF8A0(EnHg* this, GlobalContext* globalCtx) {
|
||||
if (ActorCutscene_GetCanPlayNext(this->cutscenes[this->unk218])) {
|
||||
ActorCutscene_Start(this->cutscenes[this->unk218], &this->actor);
|
||||
func_80BCF93C(this);
|
||||
} else {
|
||||
if (ActorCutscene_GetCurrentIndex() == 0x7C) {
|
||||
ActorCutscene_Stop(0x7C);
|
||||
}
|
||||
ActorCutscene_SetIntentToPlay(this->cutscenes[this->unk218]);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Hg_0x80BCF1D0/EnHg_Update.asm")
|
||||
void func_80BCF93C(EnHg* this) {
|
||||
this->cutscenes[3] = 0x63;
|
||||
this->cutscenes[2] = 0;
|
||||
this->actionFunc = func_80BCF95C;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Hg_0x80BCF1D0/func_80BCFE54.asm")
|
||||
void func_80BCF95C(EnHg* this, GlobalContext* globalCtx) {
|
||||
if (func_800EE29C(globalCtx, 0x1E4)) {
|
||||
u32 actionIndex = func_800EE200(globalCtx, 0x1E4);
|
||||
if (this->cutscenes[3] != globalCtx->csCtx.npcActions[actionIndex]->unk0) {
|
||||
this->cutscenes[3] = globalCtx->csCtx.npcActions[actionIndex]->unk0;
|
||||
switch (globalCtx->csCtx.npcActions[actionIndex]->unk0) {
|
||||
case 1:
|
||||
this->currentAnimation = NULL;
|
||||
func_800BDC5C(&this->skelAnime, sAnimations, 0);
|
||||
break;
|
||||
case 2:
|
||||
this->cutscenes[2] = 0;
|
||||
this->currentAnimation = 3;
|
||||
func_800BDC5C(&this->skelAnime, sAnimations, 3);
|
||||
break;
|
||||
case 3:
|
||||
this->cutscenes[2] = 0;
|
||||
this->currentAnimation = 5;
|
||||
func_800BDC5C(&this->skelAnime, sAnimations, 5);
|
||||
break;
|
||||
case 4:
|
||||
this->cutscenes[2] = 0;
|
||||
this->currentAnimation = 7;
|
||||
if ((this->unk218 == 1) || (this->unk218 == 3)) {
|
||||
func_8019F128(NA_SE_EN_HALF_REDEAD_TRANS);
|
||||
}
|
||||
func_800BDC5C(&this->skelAnime, sAnimations, 7);
|
||||
break;
|
||||
case 5:
|
||||
this->currentAnimation = 1;
|
||||
func_800BDC5C(&this->skelAnime, sAnimations, 1);
|
||||
break;
|
||||
case 6:
|
||||
gSaveContext.weekEventReg[0x4B] |= 0x20;
|
||||
Actor_MarkForDeath(&this->actor);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (func_801378B8(&this->skelAnime, this->skelAnime.animFrameCount)) {
|
||||
switch (this->currentAnimation) {
|
||||
case 3:
|
||||
this->currentAnimation = 4;
|
||||
func_800BDC5C(&this->skelAnime, sAnimations, 4);
|
||||
break;
|
||||
case 5:
|
||||
this->currentAnimation = 6;
|
||||
func_800BDC5C(&this->skelAnime, sAnimations, 6);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
switch (this->currentAnimation) {
|
||||
case 3:
|
||||
case 4:
|
||||
func_800B9010(&this->actor, NA_SE_EN_HALF_REDEAD_LOOP - SFX_FLAG);
|
||||
break;
|
||||
case 5:
|
||||
case 6:
|
||||
func_800B9010(&this->actor, NA_SE_EN_HALF_REDEAD_SCREAME - SFX_FLAG);
|
||||
break;
|
||||
case 7:
|
||||
if ((this->unk218 == 0) || (this->unk218 == 2)) {
|
||||
func_800B9010(&this->actor, NA_SE_EN_HALF_REDEAD_SCREAME - SFX_FLAG);
|
||||
}
|
||||
break;
|
||||
}
|
||||
func_800EDF24(&this->actor, globalCtx, actionIndex);
|
||||
return;
|
||||
} else if (globalCtx->csCtx.state == 0) {
|
||||
func_80BCF354(this);
|
||||
}
|
||||
this->cutscenes[3] = 0x63;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Hg_0x80BCF1D0/func_80BCFE70.asm")
|
||||
void func_80BCFC0C(EnHg* this, GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Hg_0x80BCF1D0/EnHg_Draw.asm")
|
||||
if (this->actor.colChkInfo.health == 1 && !(fabsf(this->actor.yDistToPlayer) >= 80.0f)) {
|
||||
if (player->stateFlags2 & 0x08000000) {
|
||||
if (!D_80BD00C8) {
|
||||
play_sound(NA_SE_SY_TRE_BOX_APPEAR);
|
||||
}
|
||||
D_80BD00C8 = true;
|
||||
} else {
|
||||
D_80BD00C8 = false;
|
||||
}
|
||||
if (globalCtx->msgCtx.unk1202A == 3) {
|
||||
if (globalCtx->msgCtx.unk1202E == 7 && gSaveContext.playerForm == PLAYER_FORM_HUMAN) {
|
||||
if (INV_CONTENT(0x41) == 0x41) {
|
||||
this->unk218 = 3;
|
||||
} else {
|
||||
this->unk218 = 1;
|
||||
}
|
||||
func_80BCF88C(this);
|
||||
}
|
||||
} else {
|
||||
if (this->actor.xzDistToPlayer < 60.0f && fabsf(this->actor.yDistToPlayer) < 40.0f) {
|
||||
if ((this->actionFunc != func_80BCF8A0) && (this->actionFunc != func_80BCF95C)) {
|
||||
if (!(gSaveContext.weekEventReg[0x3D] & 2)) {
|
||||
gSaveContext.weekEventReg[0x3D] |= 2;
|
||||
this->unk218 = 0;
|
||||
} else {
|
||||
this->unk218 = 2;
|
||||
}
|
||||
func_80BCF88C(this);
|
||||
return;
|
||||
}
|
||||
}
|
||||
func_80BCF710(this, globalCtx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EnHg_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnHg* this = THIS;
|
||||
|
||||
this->actionFunc(this, globalCtx);
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
func_80BCF7D8(this, globalCtx);
|
||||
func_80BCFC0C(this, globalCtx);
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 25.0f, 0.0f, 5);
|
||||
func_80BCF778(this, globalCtx);
|
||||
}
|
||||
|
||||
s32 EnHg_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EnHg_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
|
||||
EnHg* this = THIS;
|
||||
if (limbIndex == HG_LIMB_HEAD) {
|
||||
SysMatrix_CopyCurrentState(&this->unk1D8);
|
||||
} else if (limbIndex == HG_LIMB_PELVIS) {
|
||||
SysMatrix_GetStateTranslation(&this->actor.focus.pos);
|
||||
}
|
||||
}
|
||||
|
||||
void EnHg_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnHg* this = THIS;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount,
|
||||
EnHg_OverrideLimbDraw, EnHg_PostLimbDraw, &this->actor);
|
||||
SysMatrix_SetCurrentState(&this->unk1D8);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, D_06005E28);
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,9 +5,43 @@
|
|||
|
||||
struct EnHg;
|
||||
|
||||
typedef void (*EnHgActionFunc)(struct EnHg*, GlobalContext*);
|
||||
|
||||
typedef enum {
|
||||
/* 00 */ HG_LIMB_NONE,
|
||||
/* 01 */ HG_LIMB_ABDOMEN,
|
||||
/* 02 */ HG_LIMB_CHEST,
|
||||
/* 03 */ HG_LIMB_SHOULDER_LEFT,
|
||||
/* 04 */ HG_LIMB_ARM_LEFT,
|
||||
/* 05 */ HG_LIMB_HAND_LEFT,
|
||||
/* 06 */ HG_LIMB_SHOULDER_RIGHT,
|
||||
/* 07 */ HG_LIMB_ARM_RIGHT,
|
||||
/* 08 */ HG_LIMB_HAND_RIGHT,
|
||||
/* 09 */ HG_LIMB_EYEBROW,
|
||||
/* 10 */ HG_LIMB_HEAD,
|
||||
/* 11 */ HG_LIMB_PELVIS,
|
||||
/* 12 */ HG_LIMB_THIGH_LEFT,
|
||||
/* 13 */ HG_LIMB_LEG_LEFT,
|
||||
/* 14 */ HG_LIMB_FOOT_LEFT,
|
||||
/* 15 */ HG_LIMB_THIGH_RIGHT,
|
||||
/* 16 */ HG_LIMB_LEG_RIGHT,
|
||||
/* 17 */ HG_LIMB_FOOT_RIGHT,
|
||||
/* 19 */ HG_LIMB_UNK,
|
||||
/* 20 */ HG_LIMB_MAX,
|
||||
} ObjectHgLimbs;
|
||||
|
||||
typedef struct EnHg {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ char unk_144[0x1D4];
|
||||
/* 0x144 */ ColliderCylinder collider;
|
||||
/* 0x190 */ SkelAnime skelAnime;
|
||||
/* 0x1D4 */ EnHgActionFunc actionFunc;
|
||||
/* 0x1D8 */ MtxF unk1D8;
|
||||
/* 0x218 */ s32 unk218;
|
||||
/* 0x21C */ s32 currentAnimation;
|
||||
/* 0x220 */ Vec3s limbDrawTbl[HG_LIMB_MAX];
|
||||
/* 0x292 */ Vec3s transitionDrawTbl[HG_LIMB_MAX];
|
||||
/* 0x304 */ UNK_TYPE1 pad304[0xC];
|
||||
/* 0x310 */ u16 cutscenes[4];
|
||||
} EnHg; // size = 0x318
|
||||
|
||||
extern const ActorInit En_Hg_InitVars;
|
||||
|
|
|
|||
|
|
@ -15702,8 +15702,8 @@
|
|||
0x80BCF95C:("func_80BCF95C",),
|
||||
0x80BCFC0C:("func_80BCFC0C",),
|
||||
0x80BCFDC4:("EnHg_Update",),
|
||||
0x80BCFE54:("func_80BCFE54",),
|
||||
0x80BCFE70:("func_80BCFE70",),
|
||||
0x80BCFE54:("EnHg_OverrideLimbDraw",),
|
||||
0x80BCFE70:("EnHg_PostLimbDraw",),
|
||||
0x80BCFEC4:("EnHg_Draw",),
|
||||
0x80BD02B0:("EnHgo_Init",),
|
||||
0x80BD03C0:("EnHgo_Destroy",),
|
||||
|
|
|
|||
Loading…
Reference in New Issue