mirror of https://github.com/zeldaret/mm.git
parent
afd3ae243d
commit
bbc6dd77ea
|
@ -374,7 +374,8 @@ typedef enum {
|
|||
/* 0x31 */ GID_POTION_RED,
|
||||
/* 0x32 */ GID_POTION_BLUE,
|
||||
/* 0x33 */ GID_SHIELD_MIRROR,
|
||||
/* 0x3A */ GID_3A = 0x3A,
|
||||
/* 0x39 */ GID_39 = 0x39,
|
||||
/* 0x3A */ GID_3A,
|
||||
/* 0x3B */ GID_FAIRY,
|
||||
/* 0x3E */ GID_3E = 0x3E,
|
||||
/* 0x44 */ GID_44 = 0x44,
|
||||
|
|
4
spec
4
spec
|
@ -4394,9 +4394,7 @@ beginseg
|
|||
name "ovl_Obj_Nozoki"
|
||||
compress
|
||||
include "build/src/overlays/actors/ovl_Obj_Nozoki/z_obj_nozoki.o"
|
||||
include "build/data/ovl_Obj_Nozoki/ovl_Obj_Nozoki.data.o"
|
||||
include "build/data/ovl_Obj_Nozoki/ovl_Obj_Nozoki.bss.o"
|
||||
include "build/data/ovl_Obj_Nozoki/ovl_Obj_Nozoki.reloc.o"
|
||||
include "build/src/overlays/actors/ovl_Obj_Nozoki/ovl_Obj_Nozoki_reloc.o"
|
||||
endseg
|
||||
|
||||
beginseg
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
#include "z_obj_nozoki.h"
|
||||
#include "objects/object_secom_obj/object_secom_obj.h"
|
||||
|
||||
#define FLAGS (ACTOR_FLAG_10)
|
||||
|
||||
|
@ -14,17 +15,23 @@ void ObjNozoki_Init(Actor* thisx, GlobalContext* globalCtx);
|
|||
void ObjNozoki_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
||||
void ObjNozoki_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
|
||||
void ObjNozoki_SetupAction(ObjNozoki* this, ObjNozokiActionFunc actionFunc);
|
||||
void func_80BA2514(ObjNozoki* this, GlobalContext* globalCtx);
|
||||
void func_80BA27C4(ObjNozoki* this, GlobalContext* globalCtx);
|
||||
void func_80BA28DC(ObjNozoki* this, GlobalContext* globalCtx);
|
||||
void func_80BA2AB4(ObjNozoki* this, GlobalContext* globalCtx);
|
||||
void func_80BA2BA4(ObjNozoki* this, GlobalContext* globalCtx);
|
||||
void func_80BA2C94(ObjNozoki* this, GlobalContext* globalCtx);
|
||||
void func_80BA3044(ObjNozoki* this, GlobalContext* globalCtx);
|
||||
void func_80BA311C(ObjNozoki* this, GlobalContext* globalCtx);
|
||||
void func_80BA3230(ObjNozoki* this, GlobalContext* globalCtx);
|
||||
void func_80BA3344(ObjNozoki* this, GlobalContext* globalCtx);
|
||||
void ObjNozoki_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
|
||||
void ObjNozoki_SetupAction(ObjNozoki* this, ObjNozokiActionFunc actionFunc);
|
||||
s32 D_80BA36B0;
|
||||
s32 D_80BA36B4;
|
||||
f32 D_80BA36B8;
|
||||
|
||||
#if 0
|
||||
const ActorInit Obj_Nozoki_InitVars = {
|
||||
ACTOR_OBJ_NOZOKI,
|
||||
ACTORCAT_ITEMACTION,
|
||||
|
@ -37,54 +44,428 @@ const ActorInit Obj_Nozoki_InitVars = {
|
|||
(ActorFunc)NULL,
|
||||
};
|
||||
|
||||
// static InitChainEntry sInitChain[] = {
|
||||
static InitChainEntry D_80BA34B0[] = {
|
||||
static InitChainEntry sInitChain[] = {
|
||||
ICHAIN_VEC3F(scale, 1, ICHAIN_CONTINUE),
|
||||
ICHAIN_U8(targetMode, 0, ICHAIN_STOP),
|
||||
};
|
||||
|
||||
#endif
|
||||
s16 D_80BA34B8[] = { OBJECT_SECOM_OBJ, OBJECT_GI_MSSA, OBJECT_SECOM_OBJ, OBJECT_SECOM_OBJ };
|
||||
|
||||
extern InitChainEntry D_80BA34B0[];
|
||||
Vec3f D_80BA34C0 = { 0.0f, 0.0f, -1110.0f };
|
||||
|
||||
extern UNK_TYPE D_060001C0;
|
||||
Vec3f D_80BA34CC = { 0.0f, 0.0f, 38.0f };
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Nozoki/ObjNozoki_SetupAction.s")
|
||||
f32 D_80BA34D8[] = { 100.0f, 9999.0f, 9999.0f };
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Nozoki/ObjNozoki_Init.s")
|
||||
f32 D_80BA34E4[] = { 0.5f, 0.25f, 1.0f };
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Nozoki/ObjNozoki_Destroy.s")
|
||||
void ObjNozoki_SetupAction(ObjNozoki* this, ObjNozokiActionFunc actionFunc) {
|
||||
this->actionFunc = actionFunc;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Nozoki/func_80BA2514.s")
|
||||
void ObjNozoki_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
ObjNozoki* this = THIS;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Nozoki/func_80BA26A8.s")
|
||||
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
||||
this->dyna.actor.shape.rot.x = 0;
|
||||
this->dyna.actor.shape.rot.z = 0;
|
||||
this->unk_15F = this->dyna.actor.cutscene;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Nozoki/func_80BA2708.s")
|
||||
if (globalCtx->sceneNum == SCENE_AYASHIISHOP) {
|
||||
this->unk_15C = 4;
|
||||
ObjNozoki_SetupAction(this, func_80BA3230);
|
||||
this->dyna.actor.colChkInfo.cylRadius = -40;
|
||||
} else {
|
||||
this->unk_15C = OBJNOZOKI_GET_180(&this->dyna.actor);
|
||||
if (this->unk_15C == 0) {
|
||||
DynaPolyActor_Init(&this->dyna, 0);
|
||||
}
|
||||
ObjNozoki_SetupAction(this, func_80BA2514);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Nozoki/func_80BA2790.s")
|
||||
void ObjNozoki_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
ObjNozoki* this = THIS;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Nozoki/func_80BA27C4.s")
|
||||
if (this->unk_15C == 0) {
|
||||
DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Nozoki/func_80BA28DC.s")
|
||||
void func_80BA2514(ObjNozoki* this, GlobalContext* globalCtx) {
|
||||
s32 sp24 = Object_GetIndex(&globalCtx->objectCtx, D_80BA34B8[this->unk_15C]);
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Nozoki/func_80BA2AB4.s")
|
||||
if (sp24 < 0) {
|
||||
Actor_MarkForDeath(&this->dyna.actor);
|
||||
return;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Nozoki/func_80BA2B64.s")
|
||||
if (Object_IsLoaded(&globalCtx->objectCtx, sp24)) {
|
||||
this->dyna.actor.objBankIndex = sp24;
|
||||
this->dyna.actor.draw = ObjNozoki_Draw;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Nozoki/func_80BA2BA4.s")
|
||||
if (this->unk_15C == 0) {
|
||||
Actor_SetObjectDependency(globalCtx, &this->dyna.actor);
|
||||
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_secom_obj_Colheader_0001C0);
|
||||
if (ActorCutscene_GetAdditionalCutscene(this->unk_15F) >= 0) {
|
||||
this->dyna.actor.params |= OBJNOZOKI_400;
|
||||
}
|
||||
ObjNozoki_SetupAction(this, func_80BA27C4);
|
||||
} else if (this->unk_15C == 1) {
|
||||
Lib_Vec3f_TranslateAndRotateY(&this->dyna.actor.world.pos, this->dyna.actor.shape.rot.y, &D_80BA34C0,
|
||||
&this->dyna.actor.home.pos);
|
||||
Actor_SetScale(&this->dyna.actor, 0.6f);
|
||||
this->dyna.actor.flags |= ACTOR_FLAG_20;
|
||||
ObjNozoki_SetupAction(this, func_80BA2BA4);
|
||||
} else if (this->unk_15C == 2) {
|
||||
Lib_Vec3f_TranslateAndRotateY(&this->dyna.actor.home.pos, this->dyna.actor.shape.rot.y, &D_80BA34CC,
|
||||
&this->dyna.actor.focus.pos);
|
||||
Math_Vec3f_Copy(&this->dyna.actor.world.pos, &this->dyna.actor.focus.pos);
|
||||
ObjNozoki_SetupAction(this, func_80BA3044);
|
||||
} else {
|
||||
ObjNozoki_SetupAction(this, func_80BA311C);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Nozoki/func_80BA2C28.s")
|
||||
s32 func_80BA26A8(ObjNozoki* this) {
|
||||
if (this->unk_15F < 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Nozoki/func_80BA2C94.s")
|
||||
if (ActorCutscene_GetCanPlayNext(this->unk_15F)) {
|
||||
ActorCutscene_StartAndSetUnkLinkFields(this->unk_15F, &this->dyna.actor);
|
||||
return true;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Nozoki/func_80BA3044.s")
|
||||
ActorCutscene_SetIntentToPlay(this->unk_15F);
|
||||
return false;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Nozoki/func_80BA311C.s")
|
||||
s32 func_80BA2708(ObjNozoki* this, GlobalContext* globalCtx) {
|
||||
Actor* enemy = globalCtx->actorCtx.actorLists[ACTORCAT_ENEMY].first;
|
||||
Vec3f sp30;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Nozoki/func_80BA3230.s")
|
||||
while (enemy != NULL) {
|
||||
Actor_OffsetOfPointInActorCoords(&this->dyna.actor, &sp30, &enemy->world.pos);
|
||||
if (sp30.z >= 0.0f) {
|
||||
return false;
|
||||
}
|
||||
enemy = enemy->next;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Nozoki/func_80BA3344.s")
|
||||
return true;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Nozoki/ObjNozoki_Update.s")
|
||||
void func_80BA2790(ObjNozoki* this) {
|
||||
ObjNozoki_SetupAction(this, func_80BA28DC);
|
||||
this->dyna.actor.velocity.y = 0.0f;
|
||||
this->unk_15E = 0;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Nozoki/func_80BA3434.s")
|
||||
void func_80BA27C4(ObjNozoki* this, GlobalContext* globalCtx) {
|
||||
if (!(globalCtx->actorCtx.unk5 & 0x20)) {
|
||||
if (OBJNOZOKI_GET_200(&this->dyna.actor)) {
|
||||
if (!func_80BA2708(this, globalCtx)) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (D_80BA36B0 != 0) {
|
||||
globalCtx->actorCtx.unk5 |= 0x80;
|
||||
}
|
||||
|
||||
if (!Flags_GetSwitch(globalCtx, OBJNOZOKI_GET_SWITCHFLAG1(&this->dyna.actor))) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ((D_80BA36B0 == 0) || func_80BA26A8(this)) {
|
||||
func_80BA2790(this);
|
||||
if (D_80BA36B0 == 0) {
|
||||
this->unk_15E = 25;
|
||||
play_sound(NA_SE_SY_SECOM_WARNING);
|
||||
} else {
|
||||
this->unk_15E = ActorCutscene_GetLength(this->unk_15F);
|
||||
if (this->unk_15E < 0) {
|
||||
this->unk_15E = 50;
|
||||
}
|
||||
globalCtx->actorCtx.unk5 |= 0x10;
|
||||
}
|
||||
}
|
||||
GET_PLAYER(globalCtx)->linearVelocity = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
void func_80BA28DC(ObjNozoki* this, GlobalContext* globalCtx) {
|
||||
if (this->unk_15E != 0) {
|
||||
if (DECR(this->unk_15E) == 0) {
|
||||
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_OPEN);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(globalCtx->actorCtx.unk5 & 0x20)) {
|
||||
Math_StepToF(&this->dyna.actor.velocity.y, 15.0f, 3.0f);
|
||||
Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 200.0f, this->dyna.actor.velocity.y);
|
||||
|
||||
if (OBJNOZOKI_GET_200(&this->dyna.actor)) {
|
||||
if (!Flags_GetSwitch(globalCtx, OBJNOZOKI_GET_SWITCHFLAG1(&this->dyna.actor))) {
|
||||
return;
|
||||
}
|
||||
} else if (Flags_GetSwitch(globalCtx, OBJNOZOKI_GET_SWITCHFLAG1(&this->dyna.actor))) {
|
||||
s32 cs = this->dyna.actor.cutscene;
|
||||
|
||||
if (cs == this->unk_15F) {
|
||||
if (OBJNOZOKI_GET_400(&this->dyna.actor)) {
|
||||
Vec3f sp28;
|
||||
|
||||
Actor_OffsetOfPointInActorCoords(&this->dyna.actor, &sp28, &GET_PLAYER(globalCtx)->actor.world.pos);
|
||||
if (sp28.z < -20.0f) {
|
||||
this->unk_15F = ActorCutscene_GetAdditionalCutscene(this->unk_15F);
|
||||
}
|
||||
}
|
||||
} else if (D_80BA36B4 == 0) {
|
||||
if (func_80BA26A8(this)) {
|
||||
D_80BA36B4 = 1;
|
||||
}
|
||||
} else if (ActorCutscene_GetCurrentIndex() != this->unk_15F) {
|
||||
this->unk_15F = cs;
|
||||
this->dyna.actor.params &= ~OBJNOZOKI_400;
|
||||
Audio_QueueSeqCmd(0x881A);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ObjNozoki_SetupAction(this, func_80BA2AB4);
|
||||
this->dyna.actor.velocity.y = 0.0f;
|
||||
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_CLOSE);
|
||||
}
|
||||
|
||||
void func_80BA2AB4(ObjNozoki* this, GlobalContext* globalCtx) {
|
||||
this->dyna.actor.velocity.y = 30.0f;
|
||||
|
||||
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 30.0f) && (D_80BA36B0 == 0)) {
|
||||
ObjNozoki_SetupAction(this, func_80BA27C4);
|
||||
D_80BA36B0 = 1;
|
||||
}
|
||||
|
||||
if (!(globalCtx->actorCtx.unk5 & 0x20)) {
|
||||
if (!(OBJNOZOKI_GET_200(&this->dyna.actor)) &&
|
||||
Flags_GetSwitch(globalCtx, OBJNOZOKI_GET_SWITCHFLAG1(&this->dyna.actor))) {
|
||||
func_80BA2790(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_80BA2B64(ObjNozoki* this, GlobalContext* globalCtx, s32 arg2, s32 arg3) {
|
||||
this->unk_15D = arg2;
|
||||
this->unk_15E = 80;
|
||||
Flags_UnsetSwitch(globalCtx, arg3);
|
||||
}
|
||||
|
||||
void func_80BA2BA4(ObjNozoki* this, GlobalContext* globalCtx) {
|
||||
if (!Flags_GetSwitch(globalCtx, OBJNOZOKI_GET_SWITCHFLAG1(&this->dyna.actor))) {
|
||||
this->dyna.actor.shape.rot.x = -0x1F40;
|
||||
this->unk_15E = 80;
|
||||
} else if (DECR(this->unk_15E) == 0) {
|
||||
ObjNozoki_SetupAction(this, func_80BA2C94);
|
||||
}
|
||||
}
|
||||
|
||||
s32 func_80BA2C28(ObjNozoki* this) {
|
||||
s32 i;
|
||||
s16 cs = this->unk_15F;
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
if (ActorCutscene_GetCurrentIndex() == cs) {
|
||||
return i;
|
||||
}
|
||||
cs = ActorCutscene_GetAdditionalCutscene(cs);
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
void func_80BA2C94(ObjNozoki* this, GlobalContext* globalCtx) {
|
||||
s32 temp_v0 = func_80BA2C28(this);
|
||||
f32 sp38;
|
||||
f32 sp34;
|
||||
f32 temp_f0;
|
||||
|
||||
if (temp_v0 >= 0) {
|
||||
D_80BA36B4 = temp_v0;
|
||||
}
|
||||
|
||||
if ((temp_v0 < 0) && Play_InCsMode(globalCtx)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (D_80BA36B8 < D_80BA34D8[D_80BA36B4]) {
|
||||
sp38 = this->dyna.actor.home.pos.y - this->dyna.actor.world.pos.y;
|
||||
|
||||
if ((this->unk_15D != 1) && Flags_GetSwitch(globalCtx, this->dyna.actor.world.rot.z)) {
|
||||
func_80BA2B64(this, globalCtx, 1, this->dyna.actor.world.rot.x);
|
||||
} else if ((this->unk_15D != 2) && Flags_GetSwitch(globalCtx, this->dyna.actor.world.rot.x)) {
|
||||
func_80BA2B64(this, globalCtx, 2, this->dyna.actor.world.rot.z);
|
||||
} else if (DECR(this->unk_15E) == 0) {
|
||||
this->unk_15D = 0;
|
||||
Flags_UnsetSwitch(globalCtx, this->dyna.actor.world.rot.z);
|
||||
Flags_UnsetSwitch(globalCtx, this->dyna.actor.world.rot.x);
|
||||
}
|
||||
|
||||
Math_StepToF(&this->dyna.actor.speedXZ, D_80BA34E4[this->unk_15D], 0.1f);
|
||||
|
||||
if ((globalCtx->actorCtx.unk5 & 0x40) || (globalCtx->actorCtx.unk5 & 0x20)) {
|
||||
temp_f0 = 0.5f;
|
||||
} else {
|
||||
temp_f0 = this->dyna.actor.speedXZ;
|
||||
}
|
||||
|
||||
sp34 = Math_Vec3f_StepToXZ(&this->dyna.actor.world.pos, &this->dyna.actor.home.pos, temp_f0);
|
||||
|
||||
D_80BA36B8 += this->dyna.actor.speedXZ;
|
||||
|
||||
if (globalCtx->actorCtx.unk5 & 0x40) {
|
||||
if (sp34 <= 5.0f) {
|
||||
Actor_MarkForDeath(&this->dyna.actor);
|
||||
}
|
||||
} else if (!(globalCtx->actorCtx.unk5 & 0x20) && (GET_PLAYER(globalCtx)->actor.id == ACTOR_PLAYER) &&
|
||||
Flags_GetSwitch(globalCtx, OBJNOZOKI_GET_SWITCHFLAG2(&this->dyna.actor)) && (sp38 < 20.0f)) {
|
||||
static Vec3f D_80BA34F0 = { 0.0f, 0.0f, 50.0f };
|
||||
|
||||
globalCtx->actorCtx.unk5 |= 0x40;
|
||||
Lib_Vec3f_TranslateAndRotateY(&this->dyna.actor.home.pos, this->dyna.actor.shape.rot.y, &D_80BA34F0,
|
||||
&this->dyna.actor.world.pos);
|
||||
this->dyna.actor.shape.rot.x = -0x1F40;
|
||||
} else if (sp34 < 50.0f) {
|
||||
globalCtx->actorCtx.unk5 |= 0x20;
|
||||
|
||||
if (sp34 < 20.0f) {
|
||||
this->dyna.actor.velocity.y -= 0.4f;
|
||||
this->dyna.actor.world.pos.y += this->dyna.actor.velocity.y;
|
||||
|
||||
sp38 = this->dyna.actor.home.pos.y - this->dyna.actor.world.pos.y;
|
||||
if (sp38 >= 100.0f) {
|
||||
Actor_MarkForDeath(&this->dyna.actor);
|
||||
}
|
||||
|
||||
this->dyna.actor.shape.rot.x = -0x1F40 - (s16)(sp38 * 400.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this->dyna.actor.velocity.x += this->dyna.actor.speedXZ * 0.66f;
|
||||
if (this->dyna.actor.velocity.x >= 0x10000) {
|
||||
this->dyna.actor.velocity.x -= 0x10000;
|
||||
}
|
||||
|
||||
globalCtx->roomCtx.unk7A[0] = this->dyna.actor.velocity.x;
|
||||
|
||||
func_8019FAD8(&D_801DB4A4, NA_SE_EV_SECOM_CONVEYOR - SFX_FLAG, this->dyna.actor.speedXZ);
|
||||
}
|
||||
|
||||
void func_80BA3044(ObjNozoki* this, GlobalContext* globalCtx) {
|
||||
Vec3f* sp1C = &this->dyna.actor.focus.pos;
|
||||
|
||||
if (this->unk_15D == 0) {
|
||||
if (globalCtx->actorCtx.unk5 & 0x40) {
|
||||
this->unk_15D = 1;
|
||||
this->unk_15E = 20;
|
||||
Math_Vec3f_Copy(&this->dyna.actor.world.pos, sp1C);
|
||||
} else if (!(globalCtx->actorCtx.unk5 & 0x20) &&
|
||||
Flags_GetSwitch(globalCtx, OBJNOZOKI_GET_SWITCHFLAG1(&this->dyna.actor))) {
|
||||
sp1C = &this->dyna.actor.home.pos;
|
||||
}
|
||||
} else if (DECR(this->unk_15E) == 0) {
|
||||
sp1C = &this->dyna.actor.home.pos;
|
||||
}
|
||||
|
||||
Math_Vec3f_StepToXZ(&this->dyna.actor.world.pos, sp1C, 8.0f);
|
||||
}
|
||||
|
||||
void func_80BA311C(ObjNozoki* this, GlobalContext* globalCtx) {
|
||||
if (this->unk_15D == 0) {
|
||||
if (Flags_GetSwitch(globalCtx, OBJNOZOKI_GET_SWITCHFLAG1(&this->dyna.actor))) {
|
||||
this->unk_15D = 1;
|
||||
this->unk_15E = 70;
|
||||
}
|
||||
} else if (this->unk_15D == 1) {
|
||||
if (D_80BA36B8 > 40.0f) {
|
||||
this->unk_15D = 2;
|
||||
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_PL_SIT_ON_HORSE);
|
||||
} else if (this->unk_15E != 0) {
|
||||
if (DECR(this->unk_15E) == 0) {
|
||||
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_CONVEYOR_SHUTTER_OPEN);
|
||||
}
|
||||
} else {
|
||||
Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 50.0f, 4.0f);
|
||||
}
|
||||
} else {
|
||||
Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 4.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80BA3230(ObjNozoki* this, GlobalContext* globalCtx) {
|
||||
if (gSaveContext.save.weekEventReg[64] & 0x20) {
|
||||
Actor* npc = globalCtx->actorCtx.actorLists[ACTORCAT_NPC].first;
|
||||
Actor* test3 = SubS_FindActor(globalCtx, npc, ACTORCAT_NPC, ACTOR_EN_TEST3);
|
||||
|
||||
if ((test3 != NULL) && (test3->draw != NULL)) {
|
||||
if ((globalCtx->curSpawn == 3) && !(gSaveContext.save.weekEventReg[64] & 0x40)) {
|
||||
this->dyna.actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10000);
|
||||
this->dyna.actor.textId = 0x297A;
|
||||
} else {
|
||||
this->dyna.actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8);
|
||||
if (gSaveContext.save.weekEventReg[64] & 0x40) {
|
||||
this->dyna.actor.textId = 0;
|
||||
} else {
|
||||
this->dyna.actor.textId = 0x2979;
|
||||
}
|
||||
}
|
||||
|
||||
if (Actor_ProcessTalkRequest(&this->dyna.actor, &globalCtx->state)) {
|
||||
ObjNozoki_SetupAction(this, func_80BA3344);
|
||||
} else {
|
||||
func_800B8614(&this->dyna.actor, globalCtx, 50.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_80BA3344(ObjNozoki* this, GlobalContext* globalCtx) {
|
||||
if ((globalCtx->curSpawn == 3) && !(gSaveContext.save.weekEventReg[64] & 0x40)) {
|
||||
if (Actor_TextboxIsClosing(&this->dyna.actor, globalCtx)) {
|
||||
gSaveContext.save.weekEventReg[64] |= 0x40;
|
||||
this->dyna.actor.flags &= ~ACTOR_FLAG_10000;
|
||||
ObjNozoki_SetupAction(this, func_80BA3230);
|
||||
}
|
||||
} else if ((this->dyna.actor.textId == 0) || Actor_TextboxIsClosing(&this->dyna.actor, globalCtx)) {
|
||||
globalCtx->nextEntranceIndex = 0xE20;
|
||||
globalCtx->sceneLoadFlag = 0x14;
|
||||
}
|
||||
}
|
||||
|
||||
void ObjNozoki_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
ObjNozoki* this = THIS;
|
||||
|
||||
this->actionFunc(this, globalCtx);
|
||||
}
|
||||
|
||||
Gfx* D_80BA34FC[] = {
|
||||
object_secom_obj_DL_000080,
|
||||
(Gfx*)0x0A0001A0, //! @bug This dlist should point to a dlist in OBJECT_GI_MSSA, but the segment and the offset are
|
||||
//! wrong. This doesn't have side effects because of the extra check in the Draw function
|
||||
object_secom_obj_DL_001230,
|
||||
object_secom_obj_DL_001300,
|
||||
};
|
||||
|
||||
void ObjNozoki_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
ObjNozoki* this = THIS;
|
||||
|
||||
if (this->unk_15C == 1) {
|
||||
GetItem_Draw(globalCtx, GID_39);
|
||||
} else {
|
||||
Gfx_DrawDListOpa(globalCtx, D_80BA34FC[this->unk_15C]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,9 +7,20 @@ struct ObjNozoki;
|
|||
|
||||
typedef void (*ObjNozokiActionFunc)(struct ObjNozoki*, GlobalContext*);
|
||||
|
||||
#define OBJNOZOKI_GET_SWITCHFLAG1(thisx) ((thisx)->params & 0x7F)
|
||||
#define OBJNOZOKI_GET_180(thisx) (((thisx)->params >> 7) & 3)
|
||||
#define OBJNOZOKI_GET_200(thisx) ((thisx)->params & 0x200)
|
||||
#define OBJNOZOKI_GET_400(thisx) ((thisx)->params & 0x400)
|
||||
#define OBJNOZOKI_GET_SWITCHFLAG2(thisx) (((thisx)->params >> 9) & 0x7F)
|
||||
|
||||
#define OBJNOZOKI_400 0x400
|
||||
|
||||
typedef struct ObjNozoki {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x0144 */ char unk_144[0x1C];
|
||||
/* 0x0000 */ DynaPolyActor dyna;
|
||||
/* 0x015C */ u8 unk_15C;
|
||||
/* 0x015D */ u8 unk_15D;
|
||||
/* 0x015E */ s8 unk_15E;
|
||||
/* 0x015F */ s8 unk_15F;
|
||||
/* 0x0160 */ ObjNozokiActionFunc actionFunc;
|
||||
} ObjNozoki; // size = 0x164
|
||||
|
||||
|
|
|
@ -15076,7 +15076,7 @@
|
|||
0x80BA3230:("func_80BA3230",),
|
||||
0x80BA3344:("func_80BA3344",),
|
||||
0x80BA3410:("ObjNozoki_Update",),
|
||||
0x80BA3434:("func_80BA3434",),
|
||||
0x80BA3434:("ObjNozoki_Draw",),
|
||||
0x80BA36C0:("func_80BA36C0",),
|
||||
0x80BA36FC:("EnToto_Init",),
|
||||
0x80BA3810:("EnToto_Destroy",),
|
||||
|
|
|
@ -1662,10 +1662,6 @@ D_06000030 = 0x06000030;
|
|||
D_06002068 = 0x06002068;
|
||||
D_06002188 = 0x06002188;
|
||||
|
||||
// ovl_Obj_Nozoki
|
||||
|
||||
D_060001C0 = 0x060001C0;
|
||||
|
||||
// ovl_Obj_Ocarinalift
|
||||
|
||||
D_06001DB0 = 0x06001DB0;
|
||||
|
|
Loading…
Reference in New Issue