mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-16 12:54:40 +00:00
35/37 Functions Decompiled in ovl_En_Heishi2 (#117)
* started * did more work * did some more * Update * Merged master * EnHeishi2_Update OK * func_80A549E8 OK * func_80A54954 OK * EnHeishi2_Draw OK * Removed unused asm * func_80A543A0 OK * func_80A53638 OK. Fixed type of func_8008F08C * done for rn, will work on it later * func_80A53850 OK * func_80A53F30 OK * func_80A53D0C OK * Made cylinderInit in En_Ma3 static * Made suggested changes. Removed return from functions by adding else * Made suggested changes. Removed a.out file that accidentally got added * Made suggested changes * moved #include <vt.h> from header to c file * fixed formatting * added line break * Made suggested changes * ran format * Fixed unk_2F2
This commit is contained in:
parent
7d7c851289
commit
8e7ca2d497
45 changed files with 899 additions and 2271 deletions
|
@ -70,9 +70,10 @@ u8 func_8008F080(GlobalContext* globalCtx) {
|
|||
return player->currentMask;
|
||||
}
|
||||
|
||||
void func_8008F08C(GlobalContext* globalCtx) {
|
||||
Player* func_8008F08C(GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
player->currentMask = 0;
|
||||
return player;
|
||||
}
|
||||
|
||||
s32 func_8008F098(GlobalContext* globalCtx) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* File: z_bg_gate_shutter.c
|
||||
* Overlay: Bg_Gate_Shutter
|
||||
* Description:
|
||||
* Description: Death Mountain Trail Gate
|
||||
*/
|
||||
|
||||
#include "z_bg_gate_shutter.h"
|
||||
|
@ -34,8 +34,8 @@ const ActorInit Bg_Gate_Shutter_InitVars = {
|
|||
(ActorFunc)BgGateShutter_Draw,
|
||||
};
|
||||
|
||||
extern UNK_TYPE D_06001CD0;
|
||||
extern UNK_TYPE D_06001DA8;
|
||||
extern Gfx D_06001CD0[];
|
||||
extern Gfx D_06001DA8[];
|
||||
|
||||
void BgGateShutter_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
BgGateShutter* this = THIS;
|
||||
|
@ -45,14 +45,13 @@ void BgGateShutter_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
DynaPolyInfo_SetActorMove(&this->dyna, 0);
|
||||
DynaPolyInfo_Alloc(&D_06001DA8, &local_c);
|
||||
this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, local_c);
|
||||
this->somePosX = thisx->posRot.pos.x;
|
||||
this->somePosY = thisx->posRot.pos.y;
|
||||
this->somePosZ = thisx->posRot.pos.z;
|
||||
if ((gSaveContext.infTable[7] & 0x40) || (gSaveContext.eventChkInf[4] & 0x20)) {
|
||||
if (globalCtx->sceneNum == SCENE_SPOT01) {
|
||||
thisx->posRot.pos.x = -89.0f;
|
||||
thisx->posRot.pos.z = -1375.0f;
|
||||
}
|
||||
this->somePos.x = thisx->posRot.pos.x;
|
||||
this->somePos.y = thisx->posRot.pos.y;
|
||||
this->somePos.z = thisx->posRot.pos.z;
|
||||
if (((gSaveContext.infTable[7] & 0x40) || (gSaveContext.eventChkInf[4] & 0x20)) &&
|
||||
(globalCtx->sceneNum == SCENE_SPOT01)) {
|
||||
thisx->posRot.pos.x = -89.0f;
|
||||
thisx->posRot.pos.z = -1375.0f;
|
||||
}
|
||||
thisx->scale.x = 1.0f;
|
||||
thisx->scale.y = 1.0f;
|
||||
|
@ -69,13 +68,13 @@ void BgGateShutter_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void func_8087828C(BgGateShutter* this, GlobalContext* globalCtx) {
|
||||
if (this->unk_168 == 1 && !(gSaveContext.infTable[7] & 0x40)) {
|
||||
if (this->openingState == 1 && !(gSaveContext.infTable[7] & 0x40)) {
|
||||
this->unk_178 = 2;
|
||||
this->actionFunc = func_80878300;
|
||||
} else if (this->unk_168 == 2) {
|
||||
} else if (this->openingState == 2) {
|
||||
this->unk_178 = 2;
|
||||
this->actionFunc = func_80878300;
|
||||
} else if (this->unk_168 < 0) {
|
||||
} else if (this->openingState < 0) {
|
||||
this->unk_178 = 2;
|
||||
this->actionFunc = func_808783D4;
|
||||
}
|
||||
|
@ -98,7 +97,7 @@ void func_80878300(BgGateShutter* this, GlobalContext* globalCtx) {
|
|||
|
||||
void func_808783AC(BgGateShutter* this, GlobalContext* globalCtx) {
|
||||
if (this->unk_178 == 0) {
|
||||
this->unk_168 = 0;
|
||||
this->openingState = 0;
|
||||
this->actionFunc = func_8087828C;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,10 +11,8 @@ typedef void (*BgGateShutterActionFunc)(struct BgGateShutter*, GlobalContext*);
|
|||
typedef struct BgGateShutter {
|
||||
/* 0x0000 */ DynaPolyActor dyna;
|
||||
/* 0x0164 */ BgGateShutterActionFunc actionFunc;
|
||||
/* 0x0168 */ s16 unk_168;
|
||||
/* 0x016C */ f32 somePosX;
|
||||
/* 0x0170 */ f32 somePosY;
|
||||
/* 0x0174 */ f32 somePosZ;
|
||||
/* 0x0168 */ s16 openingState; // 1 if gate is opening
|
||||
/* 0x016C */ Vec3f somePos;
|
||||
/* 0x0178 */ s16 unk_178;
|
||||
} BgGateShutter; // size = 0x017C
|
||||
|
||||
|
|
|
@ -1,4 +1,14 @@
|
|||
/*
|
||||
* File: z_en_heishi2.c
|
||||
* Overlay: ovl_En_Heishi2
|
||||
* Description: Hyrulian Guards
|
||||
*/
|
||||
|
||||
#include "z_en_heishi2.h"
|
||||
#include "overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h"
|
||||
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
|
||||
#include "overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.h"
|
||||
#include <vt.h>
|
||||
|
||||
#define FLAGS 0x00000009
|
||||
|
||||
|
@ -9,7 +19,43 @@ void EnHeishi2_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
|||
void EnHeishi2_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnHeishi2_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
|
||||
/*
|
||||
void func_80A54C6C(Actor* thisx, GlobalContext* globalCtx);
|
||||
void func_80A531CC(EnHeishi2* this, GlobalContext* globalCtx);
|
||||
void func_80A531D8(EnHeishi2* this, GlobalContext* globalCtx);
|
||||
void func_80A531E4(EnHeishi2* this, GlobalContext* globalCtx);
|
||||
void func_80A53278(EnHeishi2* this, GlobalContext* globalCtx);
|
||||
void func_80A5344C(EnHeishi2* this, GlobalContext* globalCtx);
|
||||
void func_80A54954(EnHeishi2* this, GlobalContext* globalCtx);
|
||||
void func_80A53538(EnHeishi2* this, GlobalContext* globalCtx);
|
||||
void func_80A535BC(EnHeishi2* this, GlobalContext* globalCtx);
|
||||
void func_80A5399C(EnHeishi2* this, GlobalContext* globalCtx);
|
||||
void func_80A53638(EnHeishi2* this, GlobalContext* globalCtx);
|
||||
void func_80A5372C(EnHeishi2* this, GlobalContext* globalCtx);
|
||||
void func_80A5475C(EnHeishi2* this, GlobalContext* globalCtx);
|
||||
void func_80A53AD4(EnHeishi2* this, GlobalContext* globalCtx);
|
||||
void func_80A53C0C(EnHeishi2* this, GlobalContext* globalCtx);
|
||||
void func_80A53C90(EnHeishi2* this, GlobalContext* globalCtx);
|
||||
void func_80A53D0C(EnHeishi2* this, GlobalContext* globalCtx);
|
||||
void func_80A544AC(EnHeishi2* this, GlobalContext* globalCtx);
|
||||
void func_80A53908(EnHeishi2* this, GlobalContext* globalCtx);
|
||||
void func_80A53F30(EnHeishi2* this, GlobalContext* globalCtx);
|
||||
void func_80A54038(EnHeishi2* this, GlobalContext* globalCtx);
|
||||
void func_80A5427C(EnHeishi2* this, GlobalContext* globalCtx);
|
||||
void func_80A549E8(EnHeishi2* this, GlobalContext* globalCtx);
|
||||
void func_80A53850(EnHeishi2* this, GlobalContext* globalCtx);
|
||||
void func_80A54320(EnHeishi2* this, GlobalContext* globalCtx);
|
||||
void func_80A543A0(EnHeishi2* this, GlobalContext* globalCtx);
|
||||
void func_80A5455C(EnHeishi2* this, GlobalContext* globalCtx);
|
||||
void func_80A546DC(EnHeishi2* this, GlobalContext* globalCtx);
|
||||
void func_80A541FC(EnHeishi2* this, GlobalContext* globalCtx);
|
||||
void func_80A53DF8(EnHeishi2* this, GlobalContext* globalCtx);
|
||||
|
||||
extern AnimationHeader D_06005C30;
|
||||
extern AnimationHeader D_06005500;
|
||||
extern SkeletonHeader D_0600BAC8;
|
||||
extern Gfx D_0602B060[]; // Keaton Mask
|
||||
extern Gfx D_06002C10[];
|
||||
|
||||
const ActorInit En_Heishi2_InitVars = {
|
||||
ACTOR_EN_HEISHI2,
|
||||
ACTORTYPE_NPC,
|
||||
|
@ -21,77 +67,825 @@ const ActorInit En_Heishi2_InitVars = {
|
|||
(ActorFunc)EnHeishi2_Update,
|
||||
(ActorFunc)EnHeishi2_Draw,
|
||||
};
|
||||
*/
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/EnHeishi2_Init.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/EnHeishi2_Destroy.s")
|
||||
static ColliderCylinderInit cylinderInit = {
|
||||
{ COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER },
|
||||
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 },
|
||||
{ 33, 40, 0, { 0, 0, 0 } },
|
||||
};
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/func_80A531CC.s")
|
||||
void EnHeishi2_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
ColliderCylinder* collider;
|
||||
EnHeishi2* this = THIS;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/func_80A531D8.s")
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
this->initParams = this->actor.params & 0xFF;
|
||||
this->actor.colChkInfo.mass = 0xFF;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/func_80A531E4.s")
|
||||
if ((this->initParams == 6) || (this->initParams == 9)) {
|
||||
this->actor.draw = func_80A54C6C;
|
||||
this->actor.flags &= -2;
|
||||
Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, 6);
|
||||
if (this->initParams == 6) {
|
||||
this->actionFunc = func_80A531CC;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/func_80A53278.s")
|
||||
} else {
|
||||
osSyncPrintf("\n\n");
|
||||
// "No, I'm completely disappointed" (message for when shooting guard window in courtyard)
|
||||
osSyncPrintf(VT_FGCOL(PURPLE) " ☆☆☆☆☆ いやー ついうっかり ☆☆☆☆☆ \n" VT_RST);
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/func_80A5344C.s")
|
||||
Actor_SetScale(&this->actor, 0.02f);
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/func_80A53538.s")
|
||||
this->unk_274 = this->actor.posRot.pos;
|
||||
this->actor.posRot.rot.y = 0x7918;
|
||||
this->actor.posRot.pos.x += 90.0f;
|
||||
this->actor.posRot.pos.y -= 60.0f;
|
||||
this->actor.posRot.pos.z += 90.0f;
|
||||
this->actor.shape.rot.y = this->actor.posRot.rot.y;
|
||||
Collider_DestroyCylinder(globalCtx, &this->collider);
|
||||
func_8002DF54(globalCtx, 0, 8);
|
||||
this->actor.flags |= 0x11;
|
||||
this->actionFunc = func_80A544AC;
|
||||
}
|
||||
} else {
|
||||
this->unk_2E0 = 60.0f;
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f);
|
||||
SkelAnime_Init(globalCtx, &this->skelAnime, &D_0600BAC8, &D_06005C30, this->limbDrawTable,
|
||||
this->transitionDrawTable, 17);
|
||||
collider = &this->collider;
|
||||
Collider_InitCylinder(globalCtx, collider);
|
||||
Collider_SetCylinder(globalCtx, collider, &this->actor, &cylinderInit);
|
||||
this->collider.dim.yShift = 0;
|
||||
this->collider.dim.radius = 0xF;
|
||||
this->collider.dim.height = 0x46;
|
||||
this->actor.unk_1F = 6;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/func_80A535BC.s")
|
||||
switch (this->initParams) {
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/func_80A53638.s")
|
||||
case 2:
|
||||
this->actionFunc = func_80A531E4;
|
||||
this->actor.gravity = -1.0f;
|
||||
break;
|
||||
case 5:
|
||||
this->actionFunc = func_80A53908;
|
||||
this->actor.gravity = -1.0f;
|
||||
break;
|
||||
case 6:
|
||||
osSyncPrintf("\n\n");
|
||||
// "Peep hole soldier!"
|
||||
osSyncPrintf(VT_FGCOL(GREEN) " ☆☆☆☆☆ 覗き穴奥兵士ふぃ〜 ☆☆☆☆☆ \n" VT_RST);
|
||||
Collider_DestroyCylinder(globalCtx, collider);
|
||||
this->actor.flags &= -0xA;
|
||||
this->actionFunc = func_80A531D8;
|
||||
break;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/func_80A5372C.s")
|
||||
this->unk_2F0 = (this->actor.params >> 8) & 0xFF;
|
||||
osSyncPrintf("\n\n");
|
||||
// "Soldier Set 2 Completed!"
|
||||
osSyncPrintf(VT_FGCOL(GREEN) " ☆☆☆☆☆ 兵士2セット完了! ☆☆☆☆☆ %d\n" VT_RST, this->actor.params);
|
||||
// "Identification Completed!"
|
||||
osSyncPrintf(VT_FGCOL(YELLOW) " ☆☆☆☆☆ 識別完了! ☆☆☆☆☆ %d\n" VT_RST, this->initParams);
|
||||
// "Message completed!"
|
||||
osSyncPrintf(VT_FGCOL(PURPLE) " ☆☆☆☆☆ メッセージ完了! ☆☆☆☆☆ %x\n\n" VT_RST, (this->actor.params >> 8) & 0xF);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/func_80A53850.s")
|
||||
void EnHeishi2_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnHeishi2* this = THIS;
|
||||
if ((this->collider.dim.radius != 0) || (this->collider.dim.height != 0)) {
|
||||
Collider_DestroyCylinder(globalCtx, &this->collider);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/func_80A53908.s")
|
||||
void func_80A531CC(EnHeishi2* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/func_80A5399C.s")
|
||||
void func_80A531D8(EnHeishi2* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/func_80A53AD4.s")
|
||||
void func_80A531E4(EnHeishi2* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_ChangeAnim(&this->skelAnime, &D_06005C30, 1.0f, 0.0f,
|
||||
(s16)(f32)SkelAnime_GetFrameCount(&D_06005C30.genericHeader), 0, -10.0f);
|
||||
this->actionFunc = func_80A53278;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/func_80A53C0C.s")
|
||||
void func_80A53278(EnHeishi2* this, GlobalContext* globalCtx) {
|
||||
this->unk_30B = 0;
|
||||
this->unk_30E = 0;
|
||||
if (Text_GetFaceReaction(globalCtx, 5) != 0) {
|
||||
this->actor.textId = Text_GetFaceReaction(globalCtx, 5);
|
||||
this->unk_30B = 1;
|
||||
this->unk_300 = 6;
|
||||
this->actionFunc = func_80A5475C;
|
||||
} else if ((gSaveContext.eventChkInf[0] & 0x200) && (gSaveContext.eventChkInf[2] & 0x20) &&
|
||||
(gSaveContext.eventChkInf[3] & 0x80)) {
|
||||
// "Get all spiritual stones!"
|
||||
osSyncPrintf(VT_FGCOL(GREEN) " ☆☆☆☆☆ 全部の精霊石GET! ☆☆☆☆☆ \n" VT_RST);
|
||||
this->unk_300 = 6;
|
||||
this->actor.textId = 0x7006; // "There's a lot going on in the castle right now. I can't allow even..."
|
||||
this->actionFunc = func_80A5475C;
|
||||
} else if (gSaveContext.nightFlag) {
|
||||
// "Sleep early for children!"
|
||||
osSyncPrintf(VT_FGCOL(YELLOW) " ☆☆☆☆☆ 子供ははやくネロ! ☆☆☆☆☆ \n" VT_RST);
|
||||
this->unk_300 = 6;
|
||||
this->actor.textId = 0x7002; // "Welcome to Hyrule Castle Town. It's a peaceful, prosperous town."
|
||||
this->actionFunc = func_80A5475C;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/func_80A53C90.s")
|
||||
} else if (this->unk_30C != 0) {
|
||||
// "Anything passes"
|
||||
osSyncPrintf(VT_FGCOL(BLUE) " ☆☆☆☆☆ なんでも通るよ ☆☆☆☆☆ \n" VT_RST);
|
||||
this->unk_300 = 6;
|
||||
this->actor.textId = 0x7099; // "KEEP IT A SECRET FROM EVERYONE"
|
||||
this->actionFunc = func_80A5475C;
|
||||
} else if (gSaveContext.eventChkInf[1] & 4) {
|
||||
if (this->unk_30E == 0) {
|
||||
// "Start under the first sleeve!"
|
||||
osSyncPrintf(VT_FGCOL(PURPLE) " ☆☆☆☆☆ 1回目袖の下開始! ☆☆☆☆☆ \n" VT_RST);
|
||||
this->actor.textId = 0x7071; // "Do you really want to go through this gate that much?..."
|
||||
this->unk_30E = 1;
|
||||
} else {
|
||||
// "Start under the second sleeve!"
|
||||
osSyncPrintf(VT_FGCOL(PURPLE) " ☆☆☆☆☆ 2回目袖の下開始! ☆☆☆☆☆ \n" VT_RST);
|
||||
this->actor.textId = 0x7072; // "Give me 10 Rupees...Yes...No"
|
||||
}
|
||||
this->unk_300 = 4;
|
||||
this->actionFunc = func_80A5475C;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/func_80A53D0C.s")
|
||||
} else {
|
||||
// "That's okay"
|
||||
osSyncPrintf(VT_FGCOL(CYAN) " ☆☆☆☆☆ それはとおらんよぉ ☆☆☆☆☆ \n" VT_RST);
|
||||
this->unk_300 = 6;
|
||||
this->actor.textId = 0x7029; // "So you say you want to see Princess Zelda, eh?..."
|
||||
this->actionFunc = func_80A5475C;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/func_80A53DF8.s")
|
||||
void func_80A5344C(EnHeishi2* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
if ((func_8010BDBC(&globalCtx->msgCtx) == 4) && (func_80106BC8(globalCtx) != 0)) {
|
||||
this->unk_300 = 5;
|
||||
switch (globalCtx->msgCtx.choiceIndex) {
|
||||
case 0:
|
||||
if (gSaveContext.rupees >= 10) {
|
||||
Rupees_ChangeBy(-10);
|
||||
this->actor.textId = 0x7098; // "OK, I'll let you pass, quickly!"
|
||||
this->actionFunc = func_80A53538;
|
||||
break;
|
||||
} else {
|
||||
this->actor.textId = 0x7097; // "Well, maybe that's too much for a kid to pay."
|
||||
this->actionFunc = func_80A54954;
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
this->actor.textId = 0x7096; // "Tsk tsk."
|
||||
this->actionFunc = func_80A54954;
|
||||
break;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/func_80A53F30.s")
|
||||
default:
|
||||
break;
|
||||
}
|
||||
func_8010B720(globalCtx, this->actor.textId);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/func_80A54038.s")
|
||||
void func_80A53538(EnHeishi2* this, GlobalContext* globalCtx) {
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/func_80A540C0.s")
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
if (this->unk_300 == func_8010BDBC(&globalCtx->msgCtx)) {
|
||||
if (func_80106BC8(globalCtx) != 0) {
|
||||
func_8002DF54(globalCtx, NULL, 8);
|
||||
globalCtx->msgCtx.msgMode = 0x37;
|
||||
this->actionFunc = func_80A535BC;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/func_80A541FC.s")
|
||||
void func_80A535BC(EnHeishi2* this, GlobalContext* globalCtx) {
|
||||
f32 frames = SkelAnime_GetFrameCount(&D_06005500.genericHeader);
|
||||
this->unk_2EC = frames;
|
||||
SkelAnime_ChangeAnim(&this->skelAnime, &D_06005500, 1.0f, 0.0f, frames, 2, -10.0f);
|
||||
this->actionFunc = func_80A53638;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/func_80A5427C.s")
|
||||
void func_80A53638(EnHeishi2* this, GlobalContext* globalCtx) {
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/func_80A54320.s")
|
||||
Actor* thisx;
|
||||
f32 frameCount;
|
||||
BgSpot15Saku* actor;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/func_80A543A0.s")
|
||||
frameCount = this->skelAnime.animCurrentFrame;
|
||||
thisx = &this->actor;
|
||||
actor = globalCtx->actorCtx.actorList[ACTORTYPE_ITEMACTION].first;
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
if ((frameCount >= 12.0f) && (!this->audioFlag)) {
|
||||
Audio_PlayActorSound2(thisx, NA_SE_EV_SPEAR_HIT);
|
||||
this->audioFlag = 1;
|
||||
}
|
||||
if (this->unk_2EC <= frameCount) {
|
||||
while (actor != NULL) {
|
||||
if (ACTOR_BG_SPOT15_SAKU != actor->dyna.actor.id) {
|
||||
actor = (BgSpot15Saku*)(actor->dyna.actor.next);
|
||||
} else {
|
||||
this->attachedGate = actor;
|
||||
actor->unk_168 = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// "I've come!"
|
||||
osSyncPrintf(VT_FGCOL(PURPLE) "☆☆☆ きたきたきたぁ! ☆☆☆ %x\n" VT_RST, actor->dyna.actor.next);
|
||||
this->actionFunc = func_80A5372C;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/func_80A544AC.s")
|
||||
void func_80A5372C(EnHeishi2* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_ChangeAnim(&this->skelAnime, &D_06005C30, 1.0f, 0.0f,
|
||||
(s16)(f32)SkelAnime_GetFrameCount(&D_06005C30.genericHeader), 0, -10.0f);
|
||||
this->unk_2F2[0] = 200;
|
||||
this->cameraId = Gameplay_CreateSubCamera(globalCtx);
|
||||
Gameplay_ChangeCameraStatus(globalCtx, 0, 1);
|
||||
Gameplay_ChangeCameraStatus(globalCtx, this->cameraId, 7);
|
||||
this->unk_280.x = 947.0f;
|
||||
this->unk_280.y = 1195.0f;
|
||||
this->unk_280.z = 2682.0f;
|
||||
|
||||
this->unk_28C.x = 1164.0f;
|
||||
this->unk_28C.y = 1145.0f;
|
||||
this->unk_28C.z = 3014.0f;
|
||||
|
||||
func_800C04D8(globalCtx, this->cameraId, &this->unk_280, &this->unk_28C);
|
||||
this->actionFunc = func_80A53850;
|
||||
}
|
||||
|
||||
void func_80A53850(EnHeishi2* this, GlobalContext* globalCtx) {
|
||||
BgSpot15Saku* gate;
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
func_800C04D8(globalCtx, this->cameraId, &this->unk_280, &this->unk_28C);
|
||||
gate = (BgSpot15Saku*)this->attachedGate;
|
||||
if ((this->unk_2F2[0] == 0) || (gate->unk_168 == 0)) {
|
||||
Gameplay_ClearCamera(globalCtx, this->cameraId);
|
||||
Gameplay_ChangeCameraStatus(globalCtx, 0, 7);
|
||||
func_80106CCC(globalCtx);
|
||||
this->unk_30C = 1;
|
||||
func_8002DF54(globalCtx, NULL, 7);
|
||||
this->actionFunc = func_80A531E4;
|
||||
}
|
||||
}
|
||||
|
||||
void func_80A53908(EnHeishi2* this, GlobalContext* globalCtx) {
|
||||
f32 frameCount = SkelAnime_GetFrameCount(&D_06005C30.genericHeader);
|
||||
SkelAnime_ChangeAnim(&this->skelAnime, &D_06005C30, 1.0f, 0.0f, (s16)frameCount, 0, -10.0f);
|
||||
this->actionFunc = func_80A5399C;
|
||||
}
|
||||
|
||||
void func_80A5399C(EnHeishi2* this, GlobalContext* globalCtx) {
|
||||
s16 var;
|
||||
|
||||
this->unk_30B = 0;
|
||||
var = 0;
|
||||
if (gSaveContext.infTable[7] & 0x40) {
|
||||
if (!(gSaveContext.infTable[7] & 0x80)) {
|
||||
if (func_8008F080(globalCtx) == 1) {
|
||||
if (this->unk_309 == 0) {
|
||||
this->actor.textId = 0x200A; // "Wha-ha-ha-hah! Do you think you're in disguise, Mr. Hero?"
|
||||
} else {
|
||||
this->actor.textId = 0x200B; // "Will you sell it to me? Yes/No way"
|
||||
}
|
||||
this->unk_300 = 4;
|
||||
this->unk_30B = 1;
|
||||
var = 1;
|
||||
} else {
|
||||
this->actor.textId = 0x2016;
|
||||
// "I wish I could go to the mask shop in town to buy a present for my kid..sigh.."
|
||||
this->unk_300 = 6;
|
||||
var = 1;
|
||||
}
|
||||
} else {
|
||||
this->actor.textId = 0x2020; // "My boy will be very happy with this!"
|
||||
this->unk_300 = 5;
|
||||
this->unk_30E = 0;
|
||||
}
|
||||
if (Text_GetFaceReaction(globalCtx, 5) != 0) {
|
||||
if (var == 0) {
|
||||
this->actor.textId = Text_GetFaceReaction(globalCtx, 5);
|
||||
this->unk_30B = 1;
|
||||
this->unk_300 = 6;
|
||||
this->unk_30E = 0;
|
||||
}
|
||||
}
|
||||
this->actionFunc = func_80A5475C;
|
||||
} else {
|
||||
// "I don't know"
|
||||
osSyncPrintf(VT_FGCOL(PURPLE) " ☆☆☆☆☆ とおしゃしねぇちゅーの ☆☆☆☆☆ \n" VT_RST);
|
||||
this->actionFunc = func_80A53AD4;
|
||||
}
|
||||
}
|
||||
|
||||
void func_80A53AD4(EnHeishi2* this, GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
s32 exchangeItemId;
|
||||
s16 yawDiffTemp;
|
||||
s16 yawDiff;
|
||||
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
if (Text_GetFaceReaction(globalCtx, 5) != 0) {
|
||||
this->actor.textId = Text_GetFaceReaction(globalCtx, 5);
|
||||
} else {
|
||||
this->actor.textId = 0x200E; // "The road is closed beyond this point! Can't you read..."
|
||||
}
|
||||
this->unk_300 = 6;
|
||||
if (func_8002F194(&this->actor, globalCtx) != 0) {
|
||||
exchangeItemId = func_8002F368(globalCtx);
|
||||
if (exchangeItemId == 1) { // exchangeItemId = zelda's letter
|
||||
func_80078884(NA_SE_SY_CORRECT_CHIME);
|
||||
player->actor.textId = 0x2010; // "Oh, this is...this is surely Princess Zelda's handwriting!"
|
||||
this->unk_300 = 5;
|
||||
this->actionFunc = func_80A53C0C;
|
||||
} else if (exchangeItemId != 0) { // exchangeItemId != nothing
|
||||
player->actor.textId = 0x200F; // "I don't want that!"
|
||||
}
|
||||
} else {
|
||||
yawDiffTemp = this->actor.rotTowardsLinkY - this->actor.shape.rot.y;
|
||||
yawDiff = ABS(yawDiffTemp);
|
||||
if (!(120.0f < this->actor.xzDistanceFromLink) && (yawDiff < 0x4300)) {
|
||||
func_8002F298(&this->actor, globalCtx, 100.0f, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_80A53C0C(EnHeishi2* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
if (this->unk_300 == func_8010BDBC(&globalCtx->msgCtx)) {
|
||||
if (func_80106BC8(globalCtx) != 0) {
|
||||
func_8002DF54(globalCtx, 0, 8);
|
||||
globalCtx->msgCtx.msgMode = 0x37;
|
||||
this->actionFunc = func_80A53C90;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_80A53C90(EnHeishi2* this, GlobalContext* globalCtx) {
|
||||
f32 frameCount = SkelAnime_GetFrameCount(&D_06005500.genericHeader);
|
||||
this->unk_2EC = frameCount;
|
||||
SkelAnime_ChangeAnim(&this->skelAnime, &D_06005500, 1.0f, 0.0f, frameCount, 2, -10.0f);
|
||||
this->actionFunc = func_80A53D0C;
|
||||
}
|
||||
|
||||
void func_80A53D0C(EnHeishi2* this, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
f32 frameCount;
|
||||
BgGateShutter* gate;
|
||||
|
||||
frameCount = this->skelAnime.animCurrentFrame;
|
||||
gate = (BgGateShutter*)globalCtx->actorCtx.actorList[ACTORTYPE_ITEMACTION].first;
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
if (12.0f <= frameCount) {
|
||||
if (this->audioFlag == 0) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EV_SPEAR_HIT);
|
||||
this->audioFlag = 1;
|
||||
}
|
||||
}
|
||||
if (this->unk_2EC <= frameCount) {
|
||||
while (gate != NULL) {
|
||||
if (ACTOR_BG_GATE_SHUTTER != gate->dyna.actor.id) {
|
||||
gate = (BgGateShutter*)gate->dyna.actor.next;
|
||||
} else {
|
||||
this->attachedGate = gate;
|
||||
gate->openingState = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// "I've come!"
|
||||
osSyncPrintf(VT_FGCOL(PURPLE) "☆☆☆ きたきたきたぁ! ☆☆☆ %x\n" VT_RST, gate->dyna.actor.next);
|
||||
this->actionFunc = func_80A53DF8;
|
||||
}
|
||||
}
|
||||
|
||||
void func_80A53DF8(EnHeishi2* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_ChangeAnim(&this->skelAnime, &D_06005C30, 1.0f, 0.0f,
|
||||
(s16)(f32)SkelAnime_GetFrameCount(&D_06005C30.genericHeader), 0, -10.0f);
|
||||
this->unk_2F2[0] = 200;
|
||||
this->cameraId = Gameplay_CreateSubCamera(globalCtx);
|
||||
Gameplay_ChangeCameraStatus(globalCtx, 0, 1);
|
||||
Gameplay_ChangeCameraStatus(globalCtx, this->cameraId, 7);
|
||||
this->unk_2BC.x = -71.0f;
|
||||
this->unk_280.x = -71.0f;
|
||||
this->unk_2BC.y = 571.0f;
|
||||
this->unk_280.y = 571.0f;
|
||||
this->unk_2BC.z = -1487.0f;
|
||||
this->unk_280.z = -1487.0f;
|
||||
this->unk_298.x = 181.0f;
|
||||
this->unk_28C.x = 181.0f;
|
||||
this->unk_298.y = 417.0f;
|
||||
this->unk_28C.y = 417.0f;
|
||||
this->unk_298.z = -1079.0f;
|
||||
this->unk_28C.z = -1079.0f;
|
||||
func_800C04D8(globalCtx, this->cameraId, &this->unk_280, &this->unk_28C);
|
||||
this->actionFunc = func_80A53F30;
|
||||
}
|
||||
|
||||
void func_80A53F30(EnHeishi2* this, GlobalContext* globalCtx) {
|
||||
BgGateShutter* gate;
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
func_800C04D8(globalCtx, this->cameraId, &this->unk_280, &this->unk_28C);
|
||||
gate = (BgGateShutter*)this->attachedGate;
|
||||
if ((this->unk_2F2[0] == 0) || (gate->openingState == 0)) {
|
||||
Gameplay_ClearCamera(globalCtx, this->cameraId);
|
||||
Gameplay_ChangeCameraStatus(globalCtx, 0, 7);
|
||||
if ((this->unk_30A != 2)) {
|
||||
if (this->unk_30A == 0) {
|
||||
this->actor.textId = 0x2015; // "By the way Mr. Hero..If you're going to climb Death Mountain..."
|
||||
func_8010B720(globalCtx, this->actor.textId);
|
||||
this->actionFunc = func_80A54038;
|
||||
} else {
|
||||
func_80106CCC(globalCtx);
|
||||
func_8002DF54(globalCtx, NULL, 7);
|
||||
this->actionFunc = func_80A53908;
|
||||
}
|
||||
} else {
|
||||
this->unk_30E = 0;
|
||||
this->actor.textId = 0x2021; // "You sold the 10-Rupee mask for 15 Rupees. You earned a little profit."
|
||||
Rupees_ChangeBy(15);
|
||||
func_8010B720(globalCtx, this->actor.textId);
|
||||
this->actionFunc = func_80A5427C;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_80A54038(EnHeishi2* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
if (func_8010BDBC(&globalCtx->msgCtx) == 5) {
|
||||
if (func_80106BC8(globalCtx) != 0) {
|
||||
gSaveContext.infTable[7] |= 0x40;
|
||||
func_80106CCC(globalCtx);
|
||||
func_8002DF54(globalCtx, 0, 7);
|
||||
this->actionFunc = func_80A53908;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_80A540C0(EnHeishi2* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
if ((func_8010BDBC(&globalCtx->msgCtx) == 4) && (func_80106BC8(globalCtx) != 0)) {
|
||||
switch (globalCtx->msgCtx.choiceIndex) {
|
||||
case 0:
|
||||
this->actor.textId = 0x2020; // "My boy will be very happy with this!.."
|
||||
func_8010B720(globalCtx, this->actor.textId);
|
||||
func_8008F08C(globalCtx);
|
||||
gSaveContext.infTable[7] |= 0x80;
|
||||
gSaveContext.itemGetInf[3] |= 0x100;
|
||||
Item_Give(globalCtx, ITEM_SOLD_OUT);
|
||||
if (this->unk_30A != 0) {
|
||||
this->unk_30A = 2;
|
||||
this->unk_30E = 1;
|
||||
this->actionFunc = func_80A5427C;
|
||||
} else {
|
||||
this->unk_30E = 0;
|
||||
this->actionFunc = func_80A541FC;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
this->unk_30E = 1;
|
||||
this->actor.textId = 0x200C; // "I won't give up! I have plenty of patience.."
|
||||
func_8010B720(globalCtx, this->actor.textId);
|
||||
this->unk_300 = 5;
|
||||
if (this->unk_30A == 0) {
|
||||
this->actionFunc = func_80A5427C;
|
||||
} else {
|
||||
this->actionFunc = func_80A54954;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_80A541FC(EnHeishi2* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
if ((func_8010BDBC(&globalCtx->msgCtx) == 5) && (func_80106BC8(globalCtx) != 0)) {
|
||||
this->actor.textId = 0x2021; // "You sold the 10-Rupee mask for 15 Rupees. You earned a little profit. Let's
|
||||
// go to the Mask Shop..."
|
||||
Rupees_ChangeBy(15);
|
||||
func_8010B720(globalCtx, this->actor.textId);
|
||||
this->actionFunc = func_80A5427C;
|
||||
}
|
||||
}
|
||||
|
||||
void func_80A5427C(EnHeishi2* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
if ((func_8010BDBC(&globalCtx->msgCtx) == 5) && (func_80106BC8(globalCtx) != 0)) {
|
||||
if (this->unk_30E == 0) {
|
||||
this->unk_30E = 0;
|
||||
this->unk_30A = this->unk_30E;
|
||||
func_80106CCC(globalCtx);
|
||||
this->actionFunc = func_80A53908;
|
||||
} else {
|
||||
globalCtx->msgCtx.msgMode = 0x37;
|
||||
this->actionFunc = func_80A54320;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_80A54320(EnHeishi2* this, GlobalContext* globalCtx) {
|
||||
f32 frameCount = SkelAnime_GetFrameCount(&D_06005500.genericHeader);
|
||||
this->unk_2EC = frameCount;
|
||||
SkelAnime_ChangeAnim(&this->skelAnime, &D_06005500, 1.0f, 0.0f, frameCount, 2, -10.0f);
|
||||
this->audioFlag = 0;
|
||||
this->actionFunc = func_80A543A0;
|
||||
}
|
||||
|
||||
void func_80A543A0(EnHeishi2* this, GlobalContext* globalCtx) {
|
||||
Actor* thisx;
|
||||
f32 frameCount;
|
||||
BgGateShutter* gate;
|
||||
|
||||
frameCount = this->skelAnime.animCurrentFrame;
|
||||
thisx = &this->actor;
|
||||
gate = (BgGateShutter*)(globalCtx->actorCtx.actorList[ACTORTYPE_ITEMACTION].first);
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
if ((frameCount >= 12.0f) && (!this->audioFlag)) {
|
||||
Audio_PlayActorSound2(thisx, NA_SE_EV_SPEAR_HIT);
|
||||
this->audioFlag = 1;
|
||||
}
|
||||
if (this->unk_2EC <= frameCount) {
|
||||
while (gate != NULL) {
|
||||
if (ACTOR_BG_GATE_SHUTTER != gate->dyna.actor.id) {
|
||||
gate = (BgGateShutter*)(gate->dyna.actor.next);
|
||||
} else {
|
||||
this->attachedGate = gate;
|
||||
if (this->unk_30A != 2) {
|
||||
gate->openingState = -1;
|
||||
break;
|
||||
} else {
|
||||
gate->openingState = 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this->unk_30A == 0) {
|
||||
this->unk_30A = 1;
|
||||
}
|
||||
this->actionFunc = func_80A53DF8;
|
||||
}
|
||||
}
|
||||
void func_80A544AC(EnHeishi2* this, GlobalContext* globalCtx) {
|
||||
Math_SmoothScaleMaxMinS(&this->actor.shape.rot.z, -0x17D4, 5, (s16)(s32)(f32)this->unk_2E4, 0);
|
||||
Math_SmoothScaleMaxF(&this->unk_2E4, 3000.0f, 1.0f, 500.0f);
|
||||
this->actor.posRot.rot.z = this->actor.shape.rot.z;
|
||||
if (this->actor.shape.rot.z < -6000) {
|
||||
func_8010B680(globalCtx, 0x708F, 0);
|
||||
this->actor.flags |= 0x10000;
|
||||
this->actionFunc = func_80A5455C;
|
||||
this->unk_2E4 = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// ordering and float stuff
|
||||
void func_80A5455C(EnHeishi2* this, GlobalContext* globalCtx) {
|
||||
EnBom* bomb;
|
||||
Vec3f vec;
|
||||
Actor* thisx = &this->actor;
|
||||
s16 temp;
|
||||
if ((func_8010BDBC(&globalCtx->msgCtx) == 5)) {
|
||||
if (func_80106BC8(globalCtx) != 0) {
|
||||
|
||||
func_8002DF54(globalCtx, NULL, 7);
|
||||
func_80106CCC(globalCtx);
|
||||
vec.x = Math_Rand_CenteredFloat(20.0f) + this->unk_274.x;
|
||||
vec.y = Math_Rand_CenteredFloat(20.0f) + (this->unk_274.y - 40.0f);
|
||||
vec.z = Math_Rand_CenteredFloat(20.0f) + (this->unk_274.z - 20.0f);
|
||||
bomb = (EnBom*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOM, vec.x, vec.y, vec.z, 0,
|
||||
(s16)(Math_Rand_CenteredFloat(7000.0f) + thisx->rotTowardsLinkY), 0, 0);
|
||||
|
||||
if (bomb != NULL) {
|
||||
bomb->actor.speedXZ = Math_Rand_CenteredFloat(5.0f) + 10.0f;
|
||||
bomb->actor.velocity.y = Math_Rand_CenteredFloat(5.0f) + 10.0f;
|
||||
}
|
||||
// This is down!
|
||||
osSyncPrintf(VT_FGCOL(YELLOW) " ☆☆☆☆☆ これでダウンだ! ☆☆☆☆☆ \n" VT_RST);
|
||||
this->actionFunc = func_80A546DC;
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/func_80A5455C.s")
|
||||
#endif
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/func_80A546DC.s")
|
||||
void func_80A546DC(EnHeishi2* this, GlobalContext* globalCtx) {
|
||||
Math_SmoothScaleMaxMinS(&this->actor.shape.rot.z, 200, 5, this->unk_2E4, 0);
|
||||
Math_SmoothScaleMaxF(&this->unk_2E4, 3000.0f, 1.0f, 500.0f);
|
||||
this->actor.posRot.rot.z = this->actor.shape.rot.z;
|
||||
if (this->actor.shape.rot.z > 0) {
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
// can't get this to match, i think it's mostly functionally equivalent
|
||||
void func_80A5475C(EnHeishi2* this, GlobalContext* globalCtx) {
|
||||
Actor* thisx;
|
||||
s16 yawDiff;
|
||||
s16 yawDiffTemp;
|
||||
s16 phi_v0;
|
||||
|
||||
thisx = &this->actor;
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
if (Text_GetFaceReaction(globalCtx, 5) != 0) {
|
||||
if (this->unk_30B == 0) {
|
||||
if (this->initParams == 2) {
|
||||
this->actionFunc = func_80A53278;
|
||||
return;
|
||||
}
|
||||
if (this->initParams == ((((u16)5) & 0xFFu))) {
|
||||
this->actionFunc = func_80A5399C;
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (this->unk_30B != 0) {
|
||||
if (this->initParams == 2) {
|
||||
this->actionFunc = func_80A53278;
|
||||
return;
|
||||
}
|
||||
if (5 == this->initParams) {
|
||||
this->actionFunc = func_80A5399C;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((func_8002F194(thisx, globalCtx) != 0)) {
|
||||
if (this->initParams == 2) {
|
||||
if (this->unk_30E == 1) {
|
||||
this->actionFunc = func_80A5344C;
|
||||
return;
|
||||
}
|
||||
this->actionFunc = func_80A53278;
|
||||
return;
|
||||
}
|
||||
|
||||
if (this->initParams == 5) {
|
||||
phi_v0 = this->unk_300;
|
||||
|
||||
if (phi_v0 == 6) {
|
||||
this->actionFunc = func_80A5399C;
|
||||
phi_v0 = this->unk_300;
|
||||
do {
|
||||
phi_v0 = this->unk_300;
|
||||
} while (0);
|
||||
}
|
||||
|
||||
if (phi_v0 == 5) {
|
||||
this->actionFunc = func_80A54954;
|
||||
phi_v0 = this->unk_300;
|
||||
do {
|
||||
phi_v0 = this->unk_300;
|
||||
} while (0);
|
||||
}
|
||||
|
||||
if (phi_v0 != 4) {
|
||||
return;
|
||||
}
|
||||
this->unk_309 = 1;
|
||||
func_80078884(0x4807);
|
||||
this->actionFunc = func_80A540C0;
|
||||
return;
|
||||
}
|
||||
|
||||
phi_v0 = this->initParams;
|
||||
} else {
|
||||
if (this->initParams == 2) {
|
||||
yawDiffTemp = this->actor.rotTowardsLinkY - this->actor.shape.rot.y;
|
||||
yawDiff = ABS(yawDiffTemp);
|
||||
if ((!(120.0f < this->actor.xzDistanceFromLink)) && (yawDiff < 0x4300)) {
|
||||
func_8002F2F4(thisx, globalCtx);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/func_80A5475C.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/func_80A54954.s")
|
||||
void func_80A54954(EnHeishi2* this, GlobalContext* globalCtx) {
|
||||
f32 frameCount = SkelAnime_GetFrameCount(&D_06005C30.genericHeader);
|
||||
SkelAnime_ChangeAnim(&this->skelAnime, &D_06005C30, 1.0f, 0.0f, (s16)frameCount, 0, -10.0f);
|
||||
this->actionFunc = func_80A549E8;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/func_80A549E8.s")
|
||||
void func_80A549E8(EnHeishi2* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
if (this->unk_300 == func_8010BDBC(&globalCtx->msgCtx)) {
|
||||
if (func_80106BC8(globalCtx) != 0) {
|
||||
func_80106CCC(globalCtx);
|
||||
if (this->initParams == 2) {
|
||||
this->actionFunc = func_80A531E4;
|
||||
}
|
||||
if (this->initParams == 5) {
|
||||
this->actionFunc = func_80A53908;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/EnHeishi2_Update.s")
|
||||
void EnHeishi2_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
EnHeishi2* this = THIS;
|
||||
s32 i;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/func_80A54BC0.s")
|
||||
Actor_SetHeight(&this->actor, this->unk_2E0);
|
||||
if ((this->initParams == 2) || (this->initParams == 5)) {
|
||||
this->actor.posRot2.pos.y = 70.0f;
|
||||
Actor_SetHeight(&this->actor, 70.0f);
|
||||
func_80038290(globalCtx, &this->actor, &this->unk_260, &this->unk_26C, this->actor.posRot2.pos);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/func_80A54C34.s")
|
||||
this->unk_2FC++;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/func_80A54C6C.s")
|
||||
for (i = 0; i != 5; i++) {
|
||||
if (this->unk_2F2[i] != 0) {
|
||||
this->unk_2F2[i]--;
|
||||
}
|
||||
}
|
||||
this->actionFunc(this, globalCtx);
|
||||
Actor_MoveForward(&this->actor);
|
||||
switch (this->initParams) {
|
||||
case 6:
|
||||
break;
|
||||
case 9:
|
||||
break;
|
||||
default:
|
||||
func_8002E4B4(globalCtx, &this->actor, 10.0f, 10.0f, 30.0f, 0x1D);
|
||||
Collider_CylinderUpdate(&this->actor, &this->collider);
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/EnHeishi2_Draw.s")
|
||||
s32 EnHeishi2_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
|
||||
Actor* thisx) {
|
||||
EnHeishi2* this = THIS;
|
||||
switch (this->initParams) {
|
||||
case 1:
|
||||
break;
|
||||
case 7:
|
||||
break;
|
||||
default:
|
||||
if (limbIndex == 9) {
|
||||
rot->x = rot->x + this->unk_26C.y;
|
||||
}
|
||||
if (limbIndex == 16) {
|
||||
rot->x = rot->x + this->unk_260.y;
|
||||
rot->z = rot->z + this->unk_260.z;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EnHeishi2_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
|
||||
EnHeishi2* this = THIS;
|
||||
if (limbIndex == 16) {
|
||||
Matrix_Get(&this->mtxf_330);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80A54C6C(Actor* thisx, GlobalContext* globalCtx) {
|
||||
GraphicsContext* gfxCtx;
|
||||
Gfx* dispRefs[4];
|
||||
|
||||
gfxCtx = globalCtx->state.gfxCtx;
|
||||
Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_heishi2.c", 1772);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_heishi2.c", 1774),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, &D_06002C10); // 2D Guard in Window
|
||||
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_heishi2.c", 1777);
|
||||
}
|
||||
|
||||
void EnHeishi2_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnHeishi2* this;
|
||||
GraphicsContext* gfxCtx;
|
||||
s32 linkObjBankIndex;
|
||||
Mtx* mtx;
|
||||
Gfx* dispRefs[4];
|
||||
|
||||
gfxCtx = globalCtx->state.gfxCtx;
|
||||
Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_heishi2.c", 1792);
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
this = THIS;
|
||||
SkelAnime_Draw(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, EnHeishi2_OverrideLimbDraw,
|
||||
EnHeishi2_PostLimbDraw, &this->actor);
|
||||
if ((this->initParams == 5) && (gSaveContext.infTable[7] & 0x80)) {
|
||||
linkObjBankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_LINK_CHILD);
|
||||
if (linkObjBankIndex >= 0) {
|
||||
Matrix_Put(&this->mtxf_330);
|
||||
Matrix_Translate(-570.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_RotateZ(DEGTORAD(70.0), MTXMODE_APPLY);
|
||||
mtx = Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_heishi2.c", 1820) - 7;
|
||||
|
||||
gSPSegment(gfxCtx->polyOpa.p++, 0x06, globalCtx->objectCtx.status[linkObjBankIndex].segment);
|
||||
gSPSegment(gfxCtx->polyOpa.p++, 0x0D, mtx);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, &D_0602B060);
|
||||
gSPSegment(gfxCtx->polyOpa.p++, 0x06, globalCtx->objectCtx.status[this->actor.objBankIndex].segment);
|
||||
}
|
||||
}
|
||||
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_heishi2.c", 1834);
|
||||
}
|
||||
|
|
|
@ -4,11 +4,50 @@
|
|||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
|
||||
struct EnHeishi2;
|
||||
|
||||
typedef void (*EnHeishi2ActionFunc)(struct EnHeishi2*, GlobalContext*);
|
||||
|
||||
typedef struct EnHeishi2 {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ char unk_14C[0x298];
|
||||
/* 0x014C */ SkelAnime skelAnime;
|
||||
/* 0x0190 */ Vec3s limbDrawTable[17];
|
||||
/* 0x01F6 */ Vec3s transitionDrawTable[17];
|
||||
/* 0x025C */ EnHeishi2ActionFunc actionFunc;
|
||||
/* 0x0260 */ Vec3s unk_260;
|
||||
/* 0x0266 */ char unk_266[0x06];
|
||||
/* 0x026C */ Vec3s unk_26C; // padding inbetween these
|
||||
/* 0x0274 */ Vec3f unk_274;
|
||||
/* 0x0280 */ Vec3f unk_280; // camera related
|
||||
/* 0x028C */ Vec3f unk_28C; // camera related
|
||||
/* 0x0298 */ Vec3f unk_298; // camera related
|
||||
/* 0x02A4 */ char unk_2A4[0x18];
|
||||
/* 0x02BC */ Vec3f unk_2BC; // camera related
|
||||
/* 0x02C8 */ char unk_2C8[0x18];
|
||||
/* 0x02E0 */ f32 unk_2E0;
|
||||
/* 0x02E4 */ f32 unk_2E4;
|
||||
/* 0x02E8 */ char unk_2E8[0x4];
|
||||
/* 0x02EC */ f32 unk_2EC;
|
||||
/* 0x02F0 */ u16 unk_2F0;
|
||||
/* 0x02F2 */ s16 unk_2F2[0x5]; // starts counting down when guard starts to open gate.
|
||||
/* 0x02FC */ s16 unk_2FC;
|
||||
/* 0x02FE */ s16 initParams; // copy of actor params at init
|
||||
/* 0x0300 */ s16 unk_300; // mask related
|
||||
/* 0x0302 */ char unk_302[0x6];
|
||||
/* 0x0308 */ u8 audioFlag;
|
||||
/* 0x0309 */ u8 unk_309;
|
||||
/* 0x030A */ u8 unk_30A;
|
||||
/* 0x030B */ u8 unk_30B;
|
||||
/* 0x030C */ u8 unk_30C;
|
||||
/* 0x030D */ char unk_30D;
|
||||
/* 0x030E */ s16 unk_30E;
|
||||
/* 0x0310 */ s16 cameraId;
|
||||
/* 0x0314 */ Actor* attachedGate;
|
||||
/* 0x0318 */ char unk_318[0x18];
|
||||
/* 0x0330 */ MtxF mtxf_330;
|
||||
/* 0x0370 */ char unk_370[0x28];
|
||||
/* 0x0398 */ ColliderCylinder collider;
|
||||
} EnHeishi2; // size = 0x03E4
|
||||
|
||||
extern const ActorInit En_Heishi2_InitVars;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* File: z_en_ma3.c
|
||||
* Overlay: En_Ma3
|
||||
* Description:
|
||||
* Description: Adult Malon (Ranch)
|
||||
*/
|
||||
|
||||
#include "z_en_ma3.h"
|
||||
|
@ -37,7 +37,7 @@ const ActorInit En_Ma3_InitVars = {
|
|||
(ActorFunc)EnMa3_Draw,
|
||||
};
|
||||
|
||||
ColliderCylinderInit cylinderInit = {
|
||||
static ColliderCylinderInit cylinderInit = {
|
||||
{ COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER },
|
||||
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 },
|
||||
{ 18, 46, 0, { 0, 0, 0 } },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue