mirror of
https://github.com/zeldaret/mm.git
synced 2026-08-09 02:45:25 -04:00
z_en_box OK, more documentation
This commit is contained in:
@@ -793,8 +793,7 @@ beginseg
|
||||
name "ovl_En_Box"
|
||||
compress
|
||||
include "build/src/overlays/actors/ovl_En_Box/z_en_box.o"
|
||||
include "build/data/ovl_En_Box/ovl_En_Box.data.o"
|
||||
include "build/data/ovl_En_Box/ovl_En_Box.reloc.o"
|
||||
include "build/src/overlays/actors/ovl_En_Box/ovl_En_Box_reloc.o"
|
||||
endseg
|
||||
|
||||
beginseg
|
||||
|
||||
@@ -5,9 +5,39 @@
|
||||
*/
|
||||
|
||||
#include "z_en_box.h"
|
||||
#include "objects/gameplay_keep/gameplay_keep.h"
|
||||
#include "objects/object_box/object_box.h"
|
||||
#include "overlays/actors/ovl_En_Elforg/z_en_elforg.h"
|
||||
|
||||
#define FLAGS 0x00000000
|
||||
|
||||
/*
|
||||
set on init unless treasure flag is set
|
||||
if clear, chest moves (Actor_MoveForward) (falls, likely)
|
||||
ends up cleared from SWITCH_FLAG_FALL types when switch flag is set
|
||||
*/
|
||||
#define ENBOX_MOVE_IMMOBILE (1 << 0)
|
||||
/*
|
||||
set in the logic for SWITCH_FLAG_FALL types
|
||||
otherwise unused
|
||||
*/
|
||||
#define ENBOX_MOVE_UNUSED (1 << 1)
|
||||
/*
|
||||
set with 50% chance on init for SWITCH_FLAG_FALL types
|
||||
only used for SWITCH_FLAG_FALL types
|
||||
ends up "blinking" (set/clear every frame) once switch flag is set,
|
||||
if some collision-related condition (?) is met
|
||||
only used for signum of z rotation
|
||||
*/
|
||||
#define ENBOX_MOVE_FALL_ANGLE_SIDE (1 << 2)
|
||||
/*
|
||||
when set, gets cleared next EnBox_Update call and clip to the floor
|
||||
*/
|
||||
#define ENBOX_MOVE_STICK_TO_GROUND (1 << 4)
|
||||
#define ENBOX_MOVE_0x20 (1 << 5)
|
||||
#define ENBOX_MOVE_0x40 (1 << 6)
|
||||
#define ENBOX_MOVE_0x80 (1 << 7)
|
||||
|
||||
#define THIS ((EnBox*)thisx)
|
||||
|
||||
void EnBox_Init(Actor* thisx, GlobalContext* globalCtx);
|
||||
@@ -15,21 +45,17 @@ void EnBox_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnBox_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnBox_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
|
||||
void func_80868944(EnBox* this, GlobalContext* globalCtx);
|
||||
void func_808689E8(EnBox* this, GlobalContext* globalCtx);
|
||||
void func_80868A6C(EnBox* this, GlobalContext* globalCtx);
|
||||
void EnBox_FallOnSwitchFlag(EnBox* this, GlobalContext* globalCtx);
|
||||
void EnBox_AppearSwitchFlag(EnBox* this, GlobalContext* globalCtx);
|
||||
void EnBox_AppearOnRoomClear(EnBox* this, GlobalContext* globalCtx);
|
||||
void func_80868AFC(EnBox* this, GlobalContext* globalCtx);
|
||||
void func_80868B74(EnBox* this, GlobalContext* globalCtx);
|
||||
void func_80868CC8(EnBox* this, GlobalContext* globalCtx);
|
||||
void func_80869020(EnBox* this, GlobalContext* globalCtx);
|
||||
void EnBox_WaitOpen(EnBox* this, GlobalContext* globalCtx);
|
||||
void EnBox_Open(EnBox* this, GlobalContext* globalCtx);
|
||||
|
||||
void func_80867FBC(func_80867BDC_a0* arg0, GlobalContext* globalCtx, s32 arg2);
|
||||
void func_80867FE4(func_80867BDC_a0* arg0, GlobalContext* globalCtx);
|
||||
|
||||
extern T_80869B54 D_80869B54;
|
||||
extern AnimationHeader* D_80869B68[5];
|
||||
|
||||
#if 0
|
||||
const ActorInit En_Box_InitVars = {
|
||||
ACTOR_EN_BOX,
|
||||
ACTORCAT_CHEST,
|
||||
@@ -42,26 +68,33 @@ const ActorInit En_Box_InitVars = {
|
||||
(ActorFunc)EnBox_Draw,
|
||||
};
|
||||
|
||||
// static InitChainEntry sInitChain[] = {
|
||||
static InitChainEntry D_80869B50[] = {
|
||||
static InitChainEntry sInitChain[] = {
|
||||
ICHAIN_U8(targetMode, 0, ICHAIN_STOP),
|
||||
};
|
||||
|
||||
#endif
|
||||
typedef struct {
|
||||
f32 data[5];
|
||||
} EnBox_PlaybackSpeed; // 0x14
|
||||
|
||||
extern InitChainEntry D_80869B50[];
|
||||
EnBox_PlaybackSpeed sPlaybackSpeed = {
|
||||
{
|
||||
1.5f,
|
||||
1.0f,
|
||||
1.5f,
|
||||
1.0f,
|
||||
1.5f
|
||||
}
|
||||
};
|
||||
|
||||
extern AnimationHeader D_0600043C;
|
||||
extern SkeletonHeader D_060066A0;
|
||||
extern CollisionHeader D_060080E8;
|
||||
extern Gfx D_060006F0;
|
||||
extern Gfx D_06000A50;
|
||||
extern Gfx D_06000DB0;
|
||||
extern Gfx D_060012E8;
|
||||
extern Gfx D_06001850;
|
||||
extern Gfx D_06001D58;
|
||||
AnimationHeader* sAnimations[5] = {
|
||||
&object_box_Anim_00024C,
|
||||
&object_box_Anim_007E54,
|
||||
&object_box_Anim_00024C,
|
||||
&object_box_Anim_007F30,
|
||||
&object_box_Anim_000128
|
||||
};
|
||||
|
||||
void func_80867BD0(EnBox* this, EnBoxActionFunc func) {
|
||||
void EnBox_SetupAction(EnBox* this, EnBoxActionFunc func) {
|
||||
this->actionFunc = func;
|
||||
}
|
||||
|
||||
@@ -125,7 +158,7 @@ void func_80867C8C(func_80867BDC_a0* arg0, GlobalContext* globalCtx) {
|
||||
Matrix_InsertMatrix(&globalCtx->billboardMtxF, 1);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, D_04023210);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_023210);
|
||||
}
|
||||
Matrix_StatePop();
|
||||
gSPMatrix(POLY_XLU_DISP++, &D_801D1DE0, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
@@ -145,17 +178,17 @@ void func_80867FE4(func_80867BDC_a0* arg0, GlobalContext* globalCtx) {
|
||||
func_80867BDC(arg0, globalCtx, &arg0->pos);
|
||||
}
|
||||
|
||||
void func_8086800C(EnBox* this, GlobalContext* globalCtx) {
|
||||
void EnBox_ClipToGround(EnBox* this, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
CollisionPoly* outPoly;
|
||||
s32 outBgId;
|
||||
CollisionPoly* poly;
|
||||
s32 bgId;
|
||||
Vec3f pos;
|
||||
f32 floorHeight;
|
||||
|
||||
if (!(this->unk_1EE & 0x80)) {
|
||||
if (!(this->movementFlags & ENBOX_MOVE_0x80)) {
|
||||
pos = this->dyna.actor.world.pos;
|
||||
pos.y += 1.0f;
|
||||
floorHeight = BgCheck_EntityRaycastFloor5(&globalCtx->colCtx, &outPoly, &outBgId, &this->dyna.actor, &pos);
|
||||
floorHeight = BgCheck_EntityRaycastFloor5(&globalCtx->colCtx, &poly, &bgId, &this->dyna.actor, &pos);
|
||||
if (floorHeight != BGCHECK_Y_MIN) {
|
||||
this->dyna.actor.world.pos.y = floorHeight;
|
||||
this->dyna.actor.floorHeight = floorHeight;
|
||||
@@ -163,102 +196,103 @@ void func_8086800C(EnBox* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
void EnBox_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
s16 phi_s0;
|
||||
s16 cutsceneIdx;
|
||||
EnBox* this = (EnBox*)thisx;
|
||||
s16 pad;
|
||||
CollisionHeader* sp48;
|
||||
f32 sp44; // animationFrame
|
||||
f32 sp40; // animationFrameCount
|
||||
s32 pad;
|
||||
CollisionHeader* colHeader;
|
||||
f32 animFrame;
|
||||
f32 animFrameEnd;
|
||||
|
||||
sp48 = NULL;
|
||||
sp44 = 0.0f;
|
||||
sp40 = Animation_GetLastFrame(&D_0600043C);
|
||||
Actor_ProcessInitChain(&this->dyna.actor, D_80869B50);
|
||||
colHeader = NULL;
|
||||
animFrame = 0.0f;
|
||||
animFrameEnd = Animation_GetLastFrame(&object_box_Anim_00043C);
|
||||
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
||||
DynaPolyActor_Init(&this->dyna, 0);
|
||||
CollisionHeader_GetVirtual(&D_060080E8, &sp48);
|
||||
CollisionHeader_GetVirtual(&object_box_Colheader_0080E8, &colHeader);
|
||||
|
||||
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, sp48);
|
||||
this->unk_1EE = 0;
|
||||
this->unk_1F1 = (this->dyna.actor.params >> 0xC) & 0xF;
|
||||
this->unk_1F2 = 0;
|
||||
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader);
|
||||
this->movementFlags = 0;
|
||||
this->type = (this->dyna.actor.params >> 0xC) & 0xF;
|
||||
this->iceSmokeTimer = 0;
|
||||
this->unk_1F3 = 0;
|
||||
this->dyna.actor.gravity = -5.5f;
|
||||
this->dyna.actor.minVelocityY = -50.0f;
|
||||
this->unk_1F0 = this->dyna.actor.world.rot.z;
|
||||
this->switchFlag = this->dyna.actor.world.rot.z;
|
||||
this->dyna.actor.floorHeight = this->dyna.actor.world.pos.y;
|
||||
if (this->dyna.actor.world.rot.x == 180) {
|
||||
this->unk_1EE = 0x80;
|
||||
this->movementFlags |= ENBOX_MOVE_0x80;
|
||||
this->dyna.actor.world.rot.x = 0x7FFF;
|
||||
this->unk_220 = 0;
|
||||
this->collectableFlag = 0;
|
||||
} else {
|
||||
func_800C636C(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
|
||||
this->unk_220 = this->dyna.actor.world.rot.x & 0x7F;
|
||||
this->collectableFlag = (this->dyna.actor.world.rot.x & 0x7F);
|
||||
this->dyna.actor.world.rot.x = 0;
|
||||
}
|
||||
this->getItem = (this->dyna.actor.params >> 5) & 0x7F;
|
||||
this->dyna.actor.shape.rot.x = this->dyna.actor.world.rot.x;
|
||||
if (Actor_GetChestFlag(globalCtx, this->dyna.actor.params & 0x1F) || this->getItem == 0) {
|
||||
this->unk_1EF = 0xFF;
|
||||
this->unk_1F2 = 100;
|
||||
func_80867BD0(this, func_80869020);
|
||||
this->unk_1EE |= 0x10;
|
||||
sp44 = sp40;
|
||||
} else if ((this->unk_1F1 == 3 || this->unk_1F1 == 8) && (Flags_GetSwitch(globalCtx, this->unk_1F0) == 0)) {
|
||||
thisx->shape.rot.x = this->dyna.actor.world.rot.x;
|
||||
this->getItem = (thisx->params >> 5) & 0x7F;
|
||||
|
||||
if (Actor_GetChestFlag(globalCtx, (this->dyna.actor.params & 0x1F)) || this->getItem == 0) {
|
||||
this->alpha = 255;
|
||||
this->iceSmokeTimer = 100;
|
||||
EnBox_SetupAction(this, EnBox_Open);
|
||||
this->movementFlags |= ENBOX_MOVE_STICK_TO_GROUND;
|
||||
animFrame = animFrameEnd;
|
||||
} else if ((this->type == ENBOX_TYPE_SWITCH_FLAG_FALL_BIG || this->type == ENBOX_TYPE_SWITCH_FLAG_FALL_SMALL)
|
||||
&& !Flags_GetSwitch(globalCtx, this->switchFlag)) {
|
||||
func_800C62BC(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
|
||||
if (Rand_ZeroOne() < 0.5f) {
|
||||
this->unk_1EE |= 4;
|
||||
this->movementFlags |= ENBOX_MOVE_FALL_ANGLE_SIDE;
|
||||
}
|
||||
this->unk_1A0 = -12;
|
||||
func_80867BD0(this, func_80868944);
|
||||
this->unk_1EF = 0;
|
||||
this->unk_1EE |= 1;
|
||||
EnBox_SetupAction(this, EnBox_FallOnSwitchFlag);
|
||||
this->alpha = 0;
|
||||
this->movementFlags |= ENBOX_MOVE_IMMOBILE;
|
||||
this->dyna.actor.flags |= 0x10;
|
||||
} else if ((this->unk_1F1 == 1 || this->unk_1F1 == 7) &&
|
||||
(Actor_GetRoomCleared(globalCtx, this->dyna.actor.room) == 0)) {
|
||||
func_80867BD0(this, func_80868A6C);
|
||||
} else if ((this->type == ENBOX_TYPE_ROOM_CLEAR_BIG || this->type == ENBOX_TYPE_ROOM_CLEAR_SMALL) &&
|
||||
!Actor_GetRoomCleared(globalCtx, this->dyna.actor.room)) {
|
||||
EnBox_SetupAction(this, EnBox_AppearOnRoomClear);
|
||||
func_800C62BC(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
|
||||
if (this->unk_1EE & 0x80) {
|
||||
if (this->movementFlags & ENBOX_MOVE_0x80) {
|
||||
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + 50.0f;
|
||||
} else {
|
||||
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y - 50.0f;
|
||||
}
|
||||
this->unk_1EF = 0;
|
||||
this->unk_1EE |= 1;
|
||||
this->alpha = 0;
|
||||
this->movementFlags |= ENBOX_MOVE_IMMOBILE;
|
||||
this->dyna.actor.flags |= 0x10;
|
||||
} else if (this->unk_1F1 == 9 || this->unk_1F1 == 0xA) {
|
||||
} else if (this->type == ENBOX_TYPE_9 || this->type == ENBOX_TYPE_10) {
|
||||
|
||||
} else if ((this->unk_1F1 == 0xB || this->unk_1F1 == 0xC) && (Flags_GetSwitch(globalCtx, this->unk_1F0) == 0)) {
|
||||
func_80867BD0(this, func_808689E8);
|
||||
} else if ((this->type == ENBOX_TYPE_SWITCH_FLAG_BIG || this->type == ENBOX_TYPE_12)
|
||||
&& !Flags_GetSwitch(globalCtx, this->switchFlag)) {
|
||||
EnBox_SetupAction(this, EnBox_AppearSwitchFlag);
|
||||
func_800C62BC(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
|
||||
if (this->unk_1EE & 0x80) {
|
||||
if (this->movementFlags & ENBOX_MOVE_0x80) {
|
||||
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + 50.0f;
|
||||
} else {
|
||||
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y - 50.0f;
|
||||
}
|
||||
this->unk_1EF = 0;
|
||||
this->unk_1EE |= 1;
|
||||
this->alpha = 0;
|
||||
this->movementFlags |= ENBOX_MOVE_IMMOBILE;
|
||||
this->dyna.actor.flags |= 0x10;
|
||||
} else {
|
||||
if (this->unk_1F1 == 4 || this->unk_1F1 == 6) {
|
||||
if (this->type == ENBOX_TYPE_4 || this->type == ENBOX_TYPE_6) {
|
||||
this->dyna.actor.flags |= 0x80;
|
||||
}
|
||||
func_80867BD0(this, func_80868CC8);
|
||||
this->unk_1EE |= 1;
|
||||
this->unk_1EE |= 0x10;
|
||||
EnBox_SetupAction(this, EnBox_WaitOpen);
|
||||
this->movementFlags |= ENBOX_MOVE_IMMOBILE;
|
||||
this->movementFlags |= ENBOX_MOVE_STICK_TO_GROUND;
|
||||
}
|
||||
|
||||
if (this->getItem == 0x11 && Actor_GetChestFlag(globalCtx, this->dyna.actor.params & 0x1F) == 0) {
|
||||
if (this->getItem == 0x11 && !Actor_GetChestFlag(globalCtx, this->dyna.actor.params & 0x1F)) {
|
||||
this->dyna.actor.flags |= 0x10;
|
||||
}
|
||||
|
||||
this->dyna.actor.shape.rot.y += 0x8000;
|
||||
|
||||
this->dyna.actor.home.rot.z = this->dyna.actor.world.rot.z = this->dyna.actor.shape.rot.z = 0;
|
||||
|
||||
SkelAnime_Init(globalCtx, &this->skelAnime, &D_060066A0, &D_0600043C, &this->jointTable, &this->morphTable, 5);
|
||||
Animation_Change(&this->skelAnime, &D_0600043C, 1.5f, sp44, sp40, (u8)2, 0.0f);
|
||||
SkelAnime_Init(globalCtx, &this->skelAnime, &object_box_Skel_0066A0, &object_box_Anim_00043C, &this->jointTable, &this->morphTable, 5);
|
||||
Animation_Change(&this->skelAnime, &object_box_Anim_00043C, 1.5f, animFrame, animFrameEnd, 2, 0.0f);
|
||||
if (func_800BE63C(this) != 0) {
|
||||
Actor_SetScale(&this->dyna.actor, 0.0075f);
|
||||
Actor_SetHeight(&this->dyna.actor, 20.0f);
|
||||
@@ -267,23 +301,20 @@ void EnBox_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
Actor_SetHeight(&this->dyna.actor, 40.0f);
|
||||
}
|
||||
|
||||
this->unk_218 = -1;
|
||||
this->unk_21A = -1;
|
||||
phi_s0 = this->dyna.actor.cutscene;
|
||||
this->cutsceneIdxA = -1;
|
||||
this->cutsceneIdxB = -1;
|
||||
cutsceneIdx = this->dyna.actor.cutscene;
|
||||
|
||||
while (phi_s0 != -1) {
|
||||
if (func_800F2178(phi_s0) == 1) {
|
||||
this->unk_21A = phi_s0;
|
||||
while (cutsceneIdx != -1) {
|
||||
if (func_800F2178(cutsceneIdx) == 1) {
|
||||
this->cutsceneIdxB = cutsceneIdx;
|
||||
} else {
|
||||
this->unk_218 = phi_s0;
|
||||
this->cutsceneIdxA = cutsceneIdx;
|
||||
}
|
||||
phi_s0 = ActorCutscene_GetAdditionalCutscene(phi_s0);
|
||||
cutsceneIdx = ActorCutscene_GetAdditionalCutscene(cutsceneIdx);
|
||||
}
|
||||
func_80867BDC(&this->unk_1F4, globalCtx, &this->dyna.actor.home.pos);
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Box/EnBox_Init.s")
|
||||
#endif
|
||||
|
||||
void EnBox_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnBox* this = (EnBox*)thisx;
|
||||
@@ -291,48 +322,48 @@ void EnBox_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
|
||||
}
|
||||
|
||||
void func_80868630(EnBox* this, Vec3f* pos, Vec3f* velocity, Vec3f* accel) {
|
||||
f32 sp24;
|
||||
s16 rot;
|
||||
void EnBox_RandomDustKinematic(EnBox* this, Vec3f* pos, Vec3f* velocity, Vec3f* accel) {
|
||||
f32 randomRadius = Rand_ZeroOne() * 25.0f;
|
||||
s16 randomAngle = Rand_ZeroOne() * 0x10000;
|
||||
|
||||
sp24 = Rand_ZeroOne() * 25.0f;
|
||||
rot = Rand_ZeroOne() * 65536.0f;
|
||||
*pos = this->dyna.actor.world.pos;
|
||||
pos->x += Math_SinS(rot) * sp24;
|
||||
pos->z += Math_CosS(rot) * sp24;
|
||||
pos->x += Math_SinS(randomAngle) * randomRadius;
|
||||
pos->z += Math_CosS(randomAngle) * randomRadius;
|
||||
|
||||
velocity->y = 1.0f;
|
||||
velocity->x = Math_SinS(rot);
|
||||
velocity->z = Math_CosS(rot);
|
||||
velocity->x = Math_SinS(randomAngle);
|
||||
velocity->z = Math_CosS(randomAngle);
|
||||
|
||||
accel->x = 0.0f;
|
||||
accel->y = 0.0f;
|
||||
accel->z = 0.0f;
|
||||
}
|
||||
|
||||
void func_80868734(EnBox* this, GlobalContext* globalCtx) {
|
||||
void EnBox_SpawnDust(EnBox* this, GlobalContext* globalCtx) {
|
||||
s32 i;
|
||||
Vec3f pos;
|
||||
Vec3f velocity;
|
||||
Vec3f accel;
|
||||
|
||||
for (i = 0; i < 20; i++) {
|
||||
func_80868630(this, &pos, &velocity, &accel);
|
||||
EnBox_RandomDustKinematic(this, &pos, &velocity, &accel);
|
||||
func_800B1280(globalCtx, &pos, &velocity, &accel, 100, 30, 15);
|
||||
}
|
||||
}
|
||||
|
||||
void func_808687E8(EnBox* this, GlobalContext* globalCtx) {
|
||||
f32 temp_f0;
|
||||
void EnBox_Fall(EnBox* this, GlobalContext* globalCtx) {
|
||||
f32 yDiff;
|
||||
|
||||
this->unk_1EF = -1;
|
||||
this->unk_1EE &= ~1;
|
||||
this->alpha = 255;
|
||||
this->movementFlags &= ~ENBOX_MOVE_IMMOBILE;
|
||||
if (this->dyna.actor.bgCheckFlags & 1) {
|
||||
this->unk_1EE |= 2;
|
||||
if (this->unk_1EE & 4) {
|
||||
this->unk_1EE &= ~4;
|
||||
this->movementFlags |= ENBOX_MOVE_UNUSED;
|
||||
if (this->movementFlags & ENBOX_MOVE_FALL_ANGLE_SIDE) {
|
||||
this->movementFlags &= ~ENBOX_MOVE_FALL_ANGLE_SIDE;
|
||||
} else {
|
||||
this->unk_1EE |= 4;
|
||||
this->movementFlags |= ENBOX_MOVE_FALL_ANGLE_SIDE;
|
||||
}
|
||||
if (this->unk_1F1 == 3) {
|
||||
if (this->type == ENBOX_TYPE_SWITCH_FLAG_FALL_BIG) {
|
||||
this->dyna.actor.velocity.y = -this->dyna.actor.velocity.y * 0.55f;
|
||||
} else {
|
||||
this->dyna.actor.velocity.y = -this->dyna.actor.velocity.y * 0.65f;
|
||||
@@ -340,63 +371,63 @@ void func_808687E8(EnBox* this, GlobalContext* globalCtx) {
|
||||
if (this->dyna.actor.velocity.y < 5.5f) {
|
||||
this->dyna.actor.shape.rot.z = 0;
|
||||
this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight;
|
||||
func_80867BD0(this, func_80868CC8);
|
||||
EnBox_SetupAction(this, EnBox_WaitOpen);
|
||||
}
|
||||
func_8019F1C0(&this->dyna.actor.projectedPos, NA_SE_EV_TRE_BOX_BOUND);
|
||||
func_80868734(this, globalCtx);
|
||||
EnBox_SpawnDust(this, globalCtx);
|
||||
}
|
||||
temp_f0 = this->dyna.actor.world.pos.y - this->dyna.actor.floorHeight;
|
||||
if (this->unk_1EE & 4) {
|
||||
this->dyna.actor.shape.rot.z = temp_f0 * 50.0f;
|
||||
yDiff = this->dyna.actor.world.pos.y - this->dyna.actor.floorHeight;
|
||||
if (this->movementFlags & ENBOX_MOVE_FALL_ANGLE_SIDE) {
|
||||
this->dyna.actor.shape.rot.z = yDiff * 50.0f;
|
||||
} else {
|
||||
this->dyna.actor.shape.rot.z = -temp_f0 * 50.0f;
|
||||
this->dyna.actor.shape.rot.z = -yDiff * 50.0f;
|
||||
}
|
||||
}
|
||||
|
||||
void func_80868944(EnBox* this, GlobalContext* globalCtx) {
|
||||
void EnBox_FallOnSwitchFlag(EnBox* this, GlobalContext* globalCtx) {
|
||||
func_800B8C50(&this->dyna.actor, globalCtx);
|
||||
if (this->unk_1A0 >= 0) {
|
||||
func_80867BD0(this, func_808687E8);
|
||||
EnBox_SetupAction(this, EnBox_Fall);
|
||||
func_800C6314(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
|
||||
} else if (this->unk_1A0 >= -11) {
|
||||
this->unk_1A0++;
|
||||
} else if (Flags_GetSwitch(globalCtx, this->unk_1F0)) {
|
||||
} else if (Flags_GetSwitch(globalCtx, this->switchFlag)) {
|
||||
this->unk_1A0++;
|
||||
}
|
||||
}
|
||||
|
||||
void func_808689E8(EnBox* this, GlobalContext* globalCtx) {
|
||||
void EnBox_AppearSwitchFlag(EnBox* this, GlobalContext* globalCtx) {
|
||||
func_800B8C50(&this->dyna.actor, globalCtx);
|
||||
if (Flags_GetSwitch(globalCtx, this->unk_1F0)) {
|
||||
if (ActorCutscene_GetCanPlayNext(this->unk_218)) {
|
||||
ActorCutscene_StartAndSetUnkLinkFields(this->unk_218, &this->dyna.actor);
|
||||
func_80867BD0(this, func_80868AFC);
|
||||
if (Flags_GetSwitch(globalCtx, this->switchFlag)) {
|
||||
if (ActorCutscene_GetCanPlayNext(this->cutsceneIdxA)) {
|
||||
ActorCutscene_StartAndSetUnkLinkFields(this->cutsceneIdxA, &this->dyna.actor);
|
||||
EnBox_SetupAction(this, func_80868AFC);
|
||||
this->unk_1A0 = -30;
|
||||
} else {
|
||||
ActorCutscene_SetIntentToPlay(this->unk_218);
|
||||
ActorCutscene_SetIntentToPlay(this->cutsceneIdxA);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_80868A6C(EnBox* this, GlobalContext* globalCtx) {
|
||||
void EnBox_AppearOnRoomClear(EnBox* this, GlobalContext* globalCtx) {
|
||||
func_800B8C50(&this->dyna.actor, globalCtx);
|
||||
if (Actor_GetRoomClearedTemp(globalCtx, this->dyna.actor.room)) {
|
||||
if (ActorCutscene_GetCanPlayNext(this->unk_218)) {
|
||||
ActorCutscene_StartAndSetUnkLinkFields(this->unk_218, &this->dyna.actor);
|
||||
if (ActorCutscene_GetCanPlayNext(this->cutsceneIdxA)) {
|
||||
ActorCutscene_StartAndSetUnkLinkFields(this->cutsceneIdxA, &this->dyna.actor);
|
||||
Actor_SetRoomCleared(globalCtx, this->dyna.actor.room);
|
||||
func_80867BD0(this, func_80868AFC);
|
||||
EnBox_SetupAction(this, func_80868AFC);
|
||||
this->unk_1A0 = -30;
|
||||
} else {
|
||||
ActorCutscene_SetIntentToPlay(this->unk_218);
|
||||
ActorCutscene_SetIntentToPlay(this->cutsceneIdxA);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_80868AFC(EnBox* this, GlobalContext* globalCtx) {
|
||||
if ((func_800F22C4(this->unk_218, &this->dyna.actor) != 0) || (this->unk_1A0 != 0)) {
|
||||
func_80867BD0(this, func_80868B74);
|
||||
if (func_800F22C4(this->cutsceneIdxA, &this->dyna.actor) != 0 || this->unk_1A0 != 0) {
|
||||
EnBox_SetupAction(this, func_80868B74);
|
||||
this->unk_1A0 = 0;
|
||||
func_80867FBC(&this->unk_1F4, globalCtx, (this->unk_1EE & 0x80) != 0);
|
||||
func_80867FBC(&this->unk_1F4, globalCtx, (this->movementFlags & ENBOX_MOVE_0x80) != 0);
|
||||
func_8019F1C0(&this->dyna.actor.projectedPos, 0x287B);
|
||||
}
|
||||
}
|
||||
@@ -406,13 +437,13 @@ void func_80868B74(EnBox* this, GlobalContext* globalCtx) {
|
||||
if (this->unk_1A0 < 0) {
|
||||
this->unk_1A0++;
|
||||
} else if (this->unk_1A0 < 40) {
|
||||
if (this->unk_1EE & 0x80) {
|
||||
if (this->movementFlags & ENBOX_MOVE_0x80) {
|
||||
this->dyna.actor.world.pos.y -= 1.25f;
|
||||
} else {
|
||||
this->dyna.actor.world.pos.y += 1.25f;
|
||||
}
|
||||
this->unk_1A0 += 1;
|
||||
if (this->unk_218 != -1 && ActorCutscene_GetCurrentIndex() == this->unk_218) {
|
||||
if (this->cutsceneIdxA != -1 && ActorCutscene_GetCurrentIndex() == this->cutsceneIdxA) {
|
||||
if (this->unk_1A0 == 2) {
|
||||
func_800B724C(globalCtx, &this->dyna.actor, 4);
|
||||
} else if (this->unk_1A0 == 22) {
|
||||
@@ -420,55 +451,55 @@ void func_80868B74(EnBox* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
} else if (this->unk_1A0 < 60) {
|
||||
this->unk_1EF += 12;
|
||||
this->alpha += 12;
|
||||
this->unk_1A0++;
|
||||
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y;
|
||||
} else {
|
||||
func_80867BD0(this, func_80868CC8);
|
||||
EnBox_SetupAction(this, EnBox_WaitOpen);
|
||||
ActorCutscene_Stop(this->dyna.actor.cutscene);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80868CC8(EnBox* this, GlobalContext* globalCtx) {
|
||||
void EnBox_WaitOpen(EnBox* this, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
AnimationHeader* animHeader;
|
||||
f32 lastFrame;
|
||||
f32 frameCount;
|
||||
f32 playbackSpeed;
|
||||
T_80869B54 sp5C;
|
||||
EnBox_PlaybackSpeed playbackSpeedTable;
|
||||
Player* player;
|
||||
Vec3f offset;
|
||||
|
||||
this->unk_1EF = 0xFF;
|
||||
this->unk_1EE |= 1;
|
||||
if (this->unk_1EC != 0 && (this->unk_21A < 0 || ActorCutscene_GetCurrentIndex() == this->unk_21A ||
|
||||
this->alpha = 255;
|
||||
this->movementFlags |= ENBOX_MOVE_IMMOBILE;
|
||||
if (this->unk_1EC != 0 && (this->cutsceneIdxB < 0 || ActorCutscene_GetCurrentIndex() == this->cutsceneIdxB ||
|
||||
ActorCutscene_GetCurrentIndex() == -1)) {
|
||||
if (this->unk_1EC < 0) {
|
||||
animHeader = &D_0600043C;
|
||||
animHeader = &object_box_Anim_00043C;
|
||||
playbackSpeed = 1.5f;
|
||||
} else {
|
||||
u8 playerForm;
|
||||
sp5C = D_80869B54;
|
||||
playbackSpeedTable = sPlaybackSpeed;
|
||||
playerForm = gSaveContext.playerForm;
|
||||
animHeader = D_80869B68[playerForm];
|
||||
playbackSpeed = sp5C.test[playerForm];
|
||||
animHeader = sAnimations[playerForm];
|
||||
playbackSpeed = playbackSpeedTable.data[playerForm];
|
||||
}
|
||||
|
||||
lastFrame = Animation_GetLastFrame(animHeader);
|
||||
Animation_Change(&this->skelAnime, animHeader, playbackSpeed, 0.0f, lastFrame, 2, 0.0f);
|
||||
func_80867BD0(this, func_80869020);
|
||||
frameCount = Animation_GetLastFrame(animHeader);
|
||||
Animation_Change(&this->skelAnime, animHeader, playbackSpeed, 0.0f, frameCount, 2, 0.0f);
|
||||
EnBox_SetupAction(this, EnBox_Open);
|
||||
if (this->unk_1EC > 0) {
|
||||
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->dyna.actor, globalCtx, ACTOR_DEMO_TRE_LGT,
|
||||
this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z,
|
||||
this->dyna.actor.shape.rot.x, this->dyna.actor.shape.rot.y, this->dyna.actor.shape.rot.z,
|
||||
-1);
|
||||
func_801A3098(0x92BU);
|
||||
func_801A3098(0x2B | 0x900);
|
||||
}
|
||||
|
||||
if (this->getItem == 0x11) {
|
||||
this->unk_1EE |= 0x20;
|
||||
this->movementFlags |= ENBOX_MOVE_0x20;
|
||||
} else {
|
||||
if (this->getItem == GI_HEART_PIECE || this->getItem == GI_5A) {
|
||||
Actor_SetCollectibleFlag(globalCtx, this->unk_220);
|
||||
Actor_SetCollectibleFlag(globalCtx, this->collectableFlag);
|
||||
}
|
||||
Actor_SetChestFlag(globalCtx, this->dyna.actor.params & 0x1F);
|
||||
}
|
||||
@@ -478,7 +509,7 @@ void func_80868CC8(EnBox* this, GlobalContext* globalCtx) {
|
||||
if (offset.z > -50.0f && offset.z < 0.0f && fabsf(offset.y) < 10.0f && fabsf(offset.x) < 20.0f &&
|
||||
Actor_IsLinkFacingActor(&this->dyna.actor, 0x3000, globalCtx)) {
|
||||
if ((this->getItem == GI_HEART_PIECE || this->getItem == GI_5A) &&
|
||||
Actor_GetCollectibleFlag(globalCtx, this->unk_220)) {
|
||||
Actor_GetCollectibleFlag(globalCtx, this->collectableFlag)) {
|
||||
this->getItem = GI_0A;
|
||||
}
|
||||
if (this->getItem == 0x7C && INV_CONTENT(ITEM_MASK_CAPTAIN) == ITEM_MASK_CAPTAIN) {
|
||||
@@ -490,52 +521,50 @@ void func_80868CC8(EnBox* this, GlobalContext* globalCtx) {
|
||||
func_800B8B84(&this->dyna.actor, globalCtx, -this->getItem);
|
||||
}
|
||||
if (Actor_GetChestFlag(globalCtx, this->dyna.actor.params & 0x1F)) {
|
||||
func_80867BD0(this, func_80869020);
|
||||
EnBox_SetupAction(this, EnBox_Open);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
void func_80869020(EnBox* this, GlobalContext* globalCtx) {
|
||||
void EnBox_Open(EnBox* this, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
|
||||
this->dyna.actor.flags &= ~0x80;
|
||||
|
||||
if (SkelAnime_Update(&this->skelAnime) != 0) {
|
||||
if (this->unk_1EC > 0) {
|
||||
if (this->unk_1EC < 0x78) {
|
||||
if (this->unk_1EC < 120) {
|
||||
this->unk_1EC++;
|
||||
} else {
|
||||
Math_StepToF(&this->unk_1A8, 0.0f, 0.05f);
|
||||
}
|
||||
} else if (this->unk_1EC >= -0x77) {
|
||||
} else if (this->unk_1EC > -120) {
|
||||
this->unk_1EC--;
|
||||
} else {
|
||||
Math_StepToF(&this->unk_1A8, 0.0f, 0.05f);
|
||||
}
|
||||
if (this->unk_1EE & 0x20) {
|
||||
this->unk_1EE &= ~0x20;
|
||||
if (this->movementFlags & ENBOX_MOVE_0x20) {
|
||||
this->movementFlags &= ~ENBOX_MOVE_0x20;
|
||||
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->dyna.actor, globalCtx, ACTOR_EN_ELFORG,
|
||||
this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z,
|
||||
this->dyna.actor.world.rot.x, this->dyna.actor.world.rot.y, this->dyna.actor.world.rot.z,
|
||||
((this->dyna.actor.params & 0x1F) << 9) | 2 | 4);
|
||||
} else if (this->unk_1EE & 0x40) {
|
||||
this->unk_1EE &= ~0x40;
|
||||
(((this->dyna.actor.params & 0x1F) & 0x7F) << 9) | STRAY_FAIRY_TYPE_CHEST);
|
||||
} else if (this->movementFlags & ENBOX_MOVE_0x40) {
|
||||
this->movementFlags &= ~ENBOX_MOVE_0x40;
|
||||
}
|
||||
} else {
|
||||
f32 sp58;
|
||||
WaterBox* sp54;
|
||||
s32 sp50;
|
||||
u16 sp4E = 0;
|
||||
f32 waterSurface;
|
||||
WaterBox* waterBox;
|
||||
s32 bgId;
|
||||
u16 sfxId = 0;
|
||||
|
||||
if (Animation_OnFrame(&this->skelAnime, gSaveContext.playerForm == PLAYER_FORM_DEKU ? 14.0f : 30.0f) != 0) {
|
||||
sp4E = NA_SE_EV_TBOX_UNLOCK;
|
||||
} else if (Animation_OnFrame(&this->skelAnime, gSaveContext.playerForm == PLAYER_FORM_DEKU ? 15.0f : 90.0f) !=
|
||||
0) {
|
||||
sp4E = NA_SE_EV_TBOX_OPEN;
|
||||
if (Animation_OnFrame(&this->skelAnime, gSaveContext.playerForm == PLAYER_FORM_DEKU ? 14.0f : 30.0f)) {
|
||||
sfxId = NA_SE_EV_TBOX_UNLOCK;
|
||||
} else if (Animation_OnFrame(&this->skelAnime, gSaveContext.playerForm == PLAYER_FORM_DEKU ? 15.0f : 90.0f)) {
|
||||
sfxId = NA_SE_EV_TBOX_OPEN;
|
||||
}
|
||||
if (sp4E != 0) {
|
||||
func_8019F1C0(&this->dyna.actor.projectedPos, sp4E);
|
||||
if (sfxId != 0) {
|
||||
func_8019F1C0(&this->dyna.actor.projectedPos, sfxId);
|
||||
}
|
||||
if (this->skelAnime.jointTable[3].z > 0) {
|
||||
this->unk_1A8 = (0x7D00 - this->skelAnime.jointTable[3].z) * 0.00006f;
|
||||
@@ -545,27 +574,22 @@ void func_80869020(EnBox* this, GlobalContext* globalCtx) {
|
||||
this->unk_1A8 = 1.0f;
|
||||
}
|
||||
}
|
||||
if ((WaterBox_GetSurfaceImpl(globalCtx, &globalCtx->colCtx, this->dyna.actor.world.pos.x,
|
||||
this->dyna.actor.world.pos.z, &sp58, &sp54, &sp50) != 0) &&
|
||||
this->dyna.actor.floorHeight < sp58) {
|
||||
if (WaterBox_GetSurfaceImpl(globalCtx, &globalCtx->colCtx, this->dyna.actor.world.pos.x,
|
||||
this->dyna.actor.world.pos.z, &waterSurface, &waterBox, &bgId) &&
|
||||
this->dyna.actor.floorHeight < waterSurface) {
|
||||
EffectSsBubble_Spawn(globalCtx, &this->dyna.actor.world.pos, 5.0f, 2.0f, 20.0f, 0.3f);
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Box/func_80869020.s")
|
||||
#endif
|
||||
|
||||
extern Vec3f D_80869B7C;
|
||||
extern Vec3f D_80869B88;
|
||||
|
||||
void func_808692E0(EnBox* this, GlobalContext* globalCtx) {
|
||||
void EnBox_SpawnIceSmoke(EnBox* this, GlobalContext* globalCtx) {
|
||||
Vec3f pos;
|
||||
Vec3f velocity = D_80869B7C;
|
||||
Vec3f accel = D_80869B88;
|
||||
Vec3f velocity = { 0, 1.0f, 0 };
|
||||
Vec3f accel = { 0, 0, 0 };
|
||||
f32 randomf;
|
||||
|
||||
this->unk_1F2++;
|
||||
this->iceSmokeTimer++;
|
||||
//! @bug sfxId should be NA_SE_EN_MIMICK_BREATH, but uses OoT's sfxId value
|
||||
func_800B9010(&this->dyna.actor, NA_SE_EN_LAST3_COIL_ATTACK_OLD - SFX_FLAG);
|
||||
if (Rand_ZeroOne() < 0.3f) {
|
||||
randomf = 2.0f * Rand_ZeroOne() - 1.0f;
|
||||
@@ -584,73 +608,72 @@ void func_808692E0(EnBox* this, GlobalContext* globalCtx) {
|
||||
void EnBox_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnBox* this = (EnBox*)thisx;
|
||||
|
||||
if (this->unk_1EE & 0x10) {
|
||||
this->unk_1EE &= ~0x10;
|
||||
func_8086800C(this, globalCtx);
|
||||
if (this->movementFlags & ENBOX_MOVE_STICK_TO_GROUND) {
|
||||
this->movementFlags &= ~ENBOX_MOVE_STICK_TO_GROUND;
|
||||
EnBox_ClipToGround(this, globalCtx);
|
||||
}
|
||||
if (this->getItem == 0x11 && !Actor_GetChestFlag(globalCtx, this->dyna.actor.params & 0x1F)) {
|
||||
globalCtx->actorCtx.unk5 |= 8;
|
||||
}
|
||||
this->actionFunc(this, globalCtx);
|
||||
if (this->unk_1EE & 0x80) {
|
||||
this->unk_1EE |= 1;
|
||||
if (this->movementFlags & ENBOX_MOVE_0x80) {
|
||||
this->movementFlags |= ENBOX_MOVE_IMMOBILE;
|
||||
}
|
||||
if (!(this->unk_1EE & 1)) {
|
||||
if (!(this->movementFlags & ENBOX_MOVE_IMMOBILE)) {
|
||||
Actor_SetVelocityAndMoveYRotationAndGravity(&this->dyna.actor);
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 0x1CU);
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 0x1C);
|
||||
}
|
||||
Actor_SetHeight(&this->dyna.actor, 40.0f);
|
||||
if (this->getItem == 0x76 && this->actionFunc == func_80869020 && this->skelAnime.curFrame > 45.0f &&
|
||||
this->unk_1F2 < 0x64) {
|
||||
func_808692E0(this, globalCtx);
|
||||
if (this->getItem == 0x76 && this->actionFunc == EnBox_Open && this->skelAnime.curFrame > 45.0f &&
|
||||
this->iceSmokeTimer < 100) {
|
||||
EnBox_SpawnIceSmoke(this, globalCtx);
|
||||
}
|
||||
if (this->unk_1F4.unk_0C != NULL) {
|
||||
this->unk_1F4.unk_0C(&this->unk_1F4, globalCtx);
|
||||
}
|
||||
}
|
||||
|
||||
// PostLimbDraw
|
||||
void func_80869600(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfx) {
|
||||
void EnBox_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfx) {
|
||||
EnBox* this = THIS;
|
||||
s32 pad;
|
||||
|
||||
if (limbIndex == 1) {
|
||||
gSPMatrix((*gfx)++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
if (this->unk_1F1 == 2) {
|
||||
gSPDisplayList((*gfx)++, &D_06000DB0);
|
||||
if (this->type == ENBOX_TYPE_DECORATED_BIG) {
|
||||
gSPDisplayList((*gfx)++, &object_box_DL_000DB0);
|
||||
} else if (func_800BE63C(this) != 0) {
|
||||
if (this->getItem == 0x3C) {
|
||||
gSPDisplayList((*gfx)++, &D_06000A50);
|
||||
gSPDisplayList((*gfx)++, &object_box_DL_000A50);
|
||||
} else {
|
||||
gSPDisplayList((*gfx)++, &D_060006F0);
|
||||
gSPDisplayList((*gfx)++, &object_box_DL_0006F0);
|
||||
}
|
||||
} else {
|
||||
gSPDisplayList((*gfx)++, &D_06000A50);
|
||||
gSPDisplayList((*gfx)++, &object_box_DL_000A50);
|
||||
}
|
||||
} else if (limbIndex == 3) {
|
||||
gSPMatrix((*gfx)++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
if (this->unk_1F1 == 2) {
|
||||
gSPDisplayList((*gfx)++, &D_06001D58);
|
||||
if (this->type == ENBOX_TYPE_DECORATED_BIG) {
|
||||
gSPDisplayList((*gfx)++, &object_box_DL_001D58);
|
||||
} else if (func_800BE63C(this) != 0) {
|
||||
if (this->getItem == 0x3C) {
|
||||
gSPDisplayList((*gfx)++, &D_06001850);
|
||||
gSPDisplayList((*gfx)++, &object_box_DL_001850);
|
||||
} else {
|
||||
gSPDisplayList((*gfx)++, &D_060012E8);
|
||||
gSPDisplayList((*gfx)++, &object_box_DL_0012E8);
|
||||
}
|
||||
} else {
|
||||
gSPDisplayList((*gfx)++, &D_06001850);
|
||||
gSPDisplayList((*gfx)++, &object_box_DL_001850);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Gfx* func_80869850(GraphicsContext* gfxCtx) {
|
||||
Gfx* EnBox_SetRenderMode1(GraphicsContext* gfxCtx) {
|
||||
Gfx* dl = GRAPH_ALLOC(gfxCtx, sizeof(Gfx) * 2);
|
||||
|
||||
gSPEndDisplayList(dl);
|
||||
return dl;
|
||||
}
|
||||
|
||||
Gfx* func_80869874(GraphicsContext* gfxCtx) {
|
||||
Gfx* EnBox_SetRenderMode2(GraphicsContext* gfxCtx) {
|
||||
Gfx* dl = GRAPH_ALLOC(gfxCtx, sizeof(Gfx) * 2);
|
||||
Gfx* cur = dl;
|
||||
|
||||
@@ -663,7 +686,7 @@ Gfx* func_80869874(GraphicsContext* gfxCtx) {
|
||||
return dl;
|
||||
}
|
||||
|
||||
Gfx* func_808698B4(GraphicsContext* gfxCtx) {
|
||||
Gfx* EnBox_SetRenderMode3(GraphicsContext* gfxCtx) {
|
||||
Gfx* dl = GRAPH_ALLOC(gfxCtx, sizeof(Gfx) * 2);
|
||||
Gfx* cur = dl;
|
||||
|
||||
@@ -680,25 +703,25 @@ void EnBox_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
if (this->unk_1F4.unk_10 != NULL) {
|
||||
this->unk_1F4.unk_10(&this->unk_1F4, globalCtx);
|
||||
}
|
||||
if ((this->unk_1EF == 0xFF && this->unk_1F1 != 4 && this->unk_1F1 != 6) ||
|
||||
((this->dyna.actor.flags & 0x80) != 0x80 && (this->unk_1F1 == 4 || this->unk_1F1 == 6))) {
|
||||
if ((this->alpha == 255 && this->type != ENBOX_TYPE_4 && this->type != ENBOX_TYPE_6) ||
|
||||
((this->dyna.actor.flags & 0x80) != 0x80 && (this->type == ENBOX_TYPE_4 || this->type == ENBOX_TYPE_6))) {
|
||||
gDPPipeSync(POLY_OPA_DISP++);
|
||||
gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, func_80869850(globalCtx->state.gfxCtx));
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, EnBox_SetRenderMode1(globalCtx->state.gfxCtx));
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
POLY_OPA_DISP = SkelAnime_Draw(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, NULL,
|
||||
func_80869600, &this->dyna.actor, POLY_OPA_DISP);
|
||||
} else if (this->unk_1EF != 0) {
|
||||
EnBox_PostLimbDraw, &this->dyna.actor, POLY_OPA_DISP);
|
||||
} else if (this->alpha != 0) {
|
||||
gDPPipeSync(POLY_XLU_DISP++);
|
||||
func_8012C2DC(globalCtx->state.gfxCtx);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, this->unk_1EF);
|
||||
if (this->unk_1F1 == 4 || this->unk_1F1 == 6) {
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, func_808698B4(globalCtx->state.gfxCtx));
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, this->alpha);
|
||||
if (this->type == ENBOX_TYPE_4 || this->type == ENBOX_TYPE_6) {
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, EnBox_SetRenderMode3(globalCtx->state.gfxCtx));
|
||||
} else {
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, func_80869874(globalCtx->state.gfxCtx));
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, EnBox_SetRenderMode2(globalCtx->state.gfxCtx));
|
||||
}
|
||||
POLY_XLU_DISP = SkelAnime_Draw(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, NULL,
|
||||
func_80869600, &this->dyna.actor, POLY_XLU_DISP);
|
||||
EnBox_PostLimbDraw, &this->dyna.actor, POLY_XLU_DISP);
|
||||
}
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
||||
@@ -19,9 +19,24 @@ typedef struct func_80867BDC_a0 {
|
||||
/* 0x20 */ s32 unk_20;
|
||||
} func_80867BDC_a0; //size 0x24
|
||||
|
||||
typedef struct {
|
||||
f32 test[5];
|
||||
} T_80869B54; // 0x14
|
||||
typedef enum {
|
||||
/*
|
||||
only values 1-12 are used explicitly, other values (like 0) default to another separate behavior
|
||||
*/
|
||||
/* 0 */ ENBOX_TYPE_BIG_DEFAULT,
|
||||
/* 1 */ ENBOX_TYPE_ROOM_CLEAR_BIG, // appear on room clear, store temp clear as permanent clear
|
||||
/* 2 */ ENBOX_TYPE_DECORATED_BIG, // boss key chest, different look, same as ENBOX_TYPE_BIG_DEFAULT otherwise
|
||||
/* 3 */ ENBOX_TYPE_SWITCH_FLAG_FALL_BIG, // falling, appear on switch flag set
|
||||
/* 4 */ ENBOX_TYPE_4, // big, drawn differently
|
||||
/* 5 */ ENBOX_TYPE_SMALL, // same as ENBOX_TYPE_BIG_DEFAULT but small
|
||||
/* 6 */ ENBOX_TYPE_6, // small, drawn differently
|
||||
/* 7 */ ENBOX_TYPE_ROOM_CLEAR_SMALL, // use room clear, store temp clear as perm clear
|
||||
/* 8 */ ENBOX_TYPE_SWITCH_FLAG_FALL_SMALL, // falling, appear on switch flag set
|
||||
/* 9 */ ENBOX_TYPE_9, // big, has something more to do with player and message context?
|
||||
/* 10 */ ENBOX_TYPE_10, // like 9
|
||||
/* 11 */ ENBOX_TYPE_SWITCH_FLAG_BIG, // big, appear on switch flag set
|
||||
/* 12 */ ENBOX_TYPE_12
|
||||
} EnBoxType;
|
||||
|
||||
typedef struct EnBox {
|
||||
/* 0x0000 */ DynaPolyActor dyna;
|
||||
@@ -33,17 +48,17 @@ typedef struct EnBox {
|
||||
/* 0x01B0 */ Vec3s jointTable[5];
|
||||
/* 0x01CE */ Vec3s morphTable[5];
|
||||
/* 0x01EC */ s16 unk_1EC;
|
||||
/* 0x01EE */ u8 unk_1EE;
|
||||
/* 0x01EF */ u8 unk_1EF;
|
||||
/* 0x01F0 */ u8 unk_1F0;
|
||||
/* 0x01F1 */ u8 unk_1F1;
|
||||
/* 0x01F2 */ u8 unk_1F2;
|
||||
/* 0x01EE */ u8 movementFlags;
|
||||
/* 0x01EF */ u8 alpha;
|
||||
/* 0x01F0 */ u8 switchFlag;
|
||||
/* 0x01F1 */ u8 type;
|
||||
/* 0x01F2 */ u8 iceSmokeTimer;
|
||||
/* 0x01F3 */ s8 unk_1F3;
|
||||
/* 0x01F4 */ func_80867BDC_a0 unk_1F4;
|
||||
/* 0x0218 */ s16 unk_218;
|
||||
/* 0x021A */ s16 unk_21A;
|
||||
/* 0x0218 */ s16 cutsceneIdxA;
|
||||
/* 0x021A */ s16 cutsceneIdxB;
|
||||
/* 0x021C */ s32 getItem;
|
||||
/* 0x0220 */ s32 unk_220;
|
||||
/* 0x0220 */ s32 collectableFlag;
|
||||
} EnBox; // size = 0x224
|
||||
|
||||
extern const ActorInit En_Box_InitVars;
|
||||
|
||||
+15
-15
@@ -4962,31 +4962,31 @@
|
||||
0x8086732C:("EnDoor_Update",),
|
||||
0x80867350:("func_80867350",),
|
||||
0x808674B0:("EnDoor_Draw",),
|
||||
0x80867BD0:("func_80867BD0",),
|
||||
0x80867BD0:("EnBox_SetupAction",),
|
||||
0x80867BDC:("func_80867BDC",),
|
||||
0x80867C14:("func_80867C14",),
|
||||
0x80867C8C:("func_80867C8C",),
|
||||
0x80867FBC:("func_80867FBC",),
|
||||
0x80867FE4:("func_80867FE4",),
|
||||
0x8086800C:("func_8086800C",),
|
||||
0x8086800C:("EnBox_ClipToGround",),
|
||||
0x808680AC:("EnBox_Init",),
|
||||
0x808685FC:("EnBox_Destroy",),
|
||||
0x80868630:("func_80868630",),
|
||||
0x80868734:("func_80868734",),
|
||||
0x808687E8:("func_808687E8",),
|
||||
0x80868944:("func_80868944",),
|
||||
0x808689E8:("func_808689E8",),
|
||||
0x80868A6C:("func_80868A6C",),
|
||||
0x80868630:("EnBox_RandomDustKinematic",),
|
||||
0x80868734:("EnBox_SpawnDust",),
|
||||
0x808687E8:("EnBox_Fall",),
|
||||
0x80868944:("EnBox_FallOnSwitchFlag",),
|
||||
0x808689E8:("EnBox_AppearSwitchFlag",),
|
||||
0x80868A6C:("EnBox_AppearOnRoomClear",),
|
||||
0x80868AFC:("func_80868AFC",),
|
||||
0x80868B74:("func_80868B74",),
|
||||
0x80868CC8:("func_80868CC8",),
|
||||
0x80869020:("func_80869020",),
|
||||
0x808692E0:("func_808692E0",),
|
||||
0x80868CC8:("EnBox_WaitOpen",),
|
||||
0x80869020:("EnBox_Open",),
|
||||
0x808692E0:("EnBox_SpawnIceSmoke",),
|
||||
0x808694A0:("EnBox_Update",),
|
||||
0x80869600:("func_80869600",),
|
||||
0x80869850:("func_80869850",),
|
||||
0x80869874:("func_80869874",),
|
||||
0x808698B4:("func_808698B4",),
|
||||
0x80869600:("EnBox_PostLimbDraw",),
|
||||
0x80869850:("EnBox_SetRenderMode1",),
|
||||
0x80869874:("EnBox_SetRenderMode2",),
|
||||
0x808698B4:("EnBox_SetRenderMode3",),
|
||||
0x808698F4:("EnBox_Draw",),
|
||||
0x80869D90:("EnPametfrog_Init",),
|
||||
0x80869F90:("EnPametfrog_Destroy",),
|
||||
|
||||
Reference in New Issue
Block a user