func_80AB2BBC OK

This commit is contained in:
tom-overton
2021-10-31 20:27:06 -07:00
parent 8b0e9b4e2b
commit 8c2f3aa082
2 changed files with 49 additions and 3 deletions
@@ -37,6 +37,7 @@ void func_80AB4040(ObjTokeidai* this, GlobalContext* globalCtx);
void func_80AB4080(ObjTokeidai* this, GlobalContext* globalCtx);
void func_80AB4160(ObjTokeidai* this, GlobalContext* globalCtx);
void func_80AB4394(Actor* thisx, GlobalContext* globalCtx);
void func_80AB4664(Actor* thisx, GlobalContext* globalCtx);
const ActorInit Obj_Tokeidai_InitVars = {
ACTOR_OBJ_TOKEIDAI,
@@ -59,6 +60,7 @@ static InitChainEntry D_80AB49E0[] = {
};
extern UNK_TYPE D_06009A08;
extern UNK_TYPE D_0600B0C0;
extern UNK_TYPE D_0600B208;
extern UNK_TYPE D_0600BA78;
extern UNK_TYPE D_0600CF28;
@@ -76,7 +78,48 @@ extern UNK_TYPE D_0600D8E8;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Tokeidai/func_80AB29F8.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Tokeidai/func_80AB2BBC.s")
void func_80AB2BBC(ObjTokeidai* this, GlobalContext* globalCtx) {
s32 type;
this->actor.draw = func_80AB4664;
this->unk_144 = &D_0600B208;
this->unk_148 = &D_0600B0C0;
if (gSaveContext.isNight != 0) {
this->unk_16C = 100;
} else {
this->unk_16C = 0;
}
if ((globalCtx->sceneNum == SCENE_CLOCKTOWER && gSaveContext.sceneSetupIndex == 2 &&
globalCtx->csCtx.unk_12 == 0) ||
(globalCtx->sceneNum == SCENE_00KEIKOKU && gSaveContext.sceneSetupIndex == 2 && globalCtx->csCtx.unk_12 == 0)) {
this->unk_16C = 0;
func_80AB3BB0(this);
if (this->actor.child == NULL) {
type = OBJ_TOKEIDAI_TYPE(&this->actor);
if (type == 3 || type == 6) {
this->actor.child =
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HANABI, this->actor.world.pos.x,
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0);
}
}
if (this->actor.child != NULL) {
if (OBJ_TOKEIDAI_TYPE(&this->actor) == 6) {
this->actor.child->home.rot.x = 0x384;
} else {
this->actor.child->home.rot.x = 0x12C;
}
}
} else if ((gSaveContext.day % 5 == 3 && gSaveContext.time < 0x4000) || gSaveContext.day % 5 >= 4) {
this->unk_16C = 0;
this->actor.world.pos.y += this->actor.scale.y * -2160.0f;
this->actor.world.pos.x += Math_SinS(this->actor.world.rot.y) * this->actor.scale.z * 5400.0f;
this->actor.world.pos.z += -Math_CosS(this->actor.world.rot.y) * this->actor.scale.z * 5400.0f;
this->actor.shape.rot.x = -0x4000;
this->actionFunc = func_80AB3598;
} else {
this->actionFunc = func_80AB4160;
}
}
void ObjTokeidai_Init(Actor* thisx, GlobalContext* globalCtx) {
ObjTokeidai* this = THIS;
@@ -90,7 +133,7 @@ void ObjTokeidai_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_162 = 0;
this->unk_170 = gSaveContext.time;
this->actor.home.rot.x = 0;
switch ((this->actor.params & 0xF000) >> 0xC) {
switch (OBJ_TOKEIDAI_TYPE(&this->actor)) {
case 4:
Actor_SetScale(&this->actor, 0.15f);
func_80AB28C8(this, globalCtx);
@@ -3,6 +3,8 @@
#include "global.h"
#define OBJ_TOKEIDAI_TYPE(thisx) (((thisx)->params & 0xF000) >> 12)
struct ObjTokeidai;
typedef void (*ObjTokeidaiActionFunc)(struct ObjTokeidai*, GlobalContext*);
@@ -15,7 +17,8 @@ typedef struct ObjTokeidai {
/* 0x015E */ s16 unk_15E;
/* 0x0160 */ s16 unk_160;
/* 0x0162 */ s16 unk_162;
/* 0x0164 */ char unk_164[0xC];
/* 0x0164 */ char unk_164[0x8];
/* 0x016C */ s32 unk_16C;
/* 0x0170 */ u16 unk_170;
/* 0x0174 */ ObjTokeidaiActionFunc actionFunc;
} ObjTokeidai; // size = 0x178