Actors revert cleanup (#1221)

* Revert "ovl_Bg_Keikoku_Spr OK (#111)"

This reverts commit fed1b37da1.

* Revert "z_bg_tobira01 OK (#168)"

This reverts commit 54aef44a9e.

* Revert "Bg_Lotus OK (#86)"

This reverts commit d0af9587ba.

* Revert "Door_Spiral OK (from zel) (#87)"

This reverts commit 6e4d156ad7.

* Revert "en_invadepoh OK (#200)"

This reverts commit e1219e7351.

* Revert "ovl_Item_B_Heart OK (#110)"

This reverts commit f0cd2db055.

* Revert "ovl_Obj_Boyo OK (#112)"

This reverts commit 536a484f73.

* more reverts and fix building

* restore timeconv.py

* restore func_800BFD84
This commit is contained in:
Anghelo Carvajal 2023-04-01 21:10:00 -03:00 committed by GitHub
parent d9493a5b99
commit f39d412bfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 648 additions and 5541 deletions

22
spec
View File

@ -999,7 +999,8 @@ beginseg
name "ovl_Item_B_Heart"
compress
include "build/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.o"
include "build/src/overlays/actors/ovl_Item_B_Heart/ovl_Item_B_Heart_reloc.o"
include "build/data/ovl_Item_B_Heart/ovl_Item_B_Heart.data.o"
include "build/data/ovl_Item_B_Heart/ovl_Item_B_Heart.reloc.o"
endseg
beginseg
@ -1034,7 +1035,8 @@ beginseg
name "ovl_Bg_Keikoku_Spr"
compress
include "build/src/overlays/actors/ovl_Bg_Keikoku_Spr/z_bg_keikoku_spr.o"
include "build/src/overlays/actors/ovl_Bg_Keikoku_Spr/ovl_Bg_Keikoku_Spr_reloc.o"
include "build/data/ovl_Bg_Keikoku_Spr/ovl_Bg_Keikoku_Spr.data.o"
include "build/data/ovl_Bg_Keikoku_Spr/ovl_Bg_Keikoku_Spr.reloc.o"
endseg
beginseg
@ -2113,7 +2115,8 @@ beginseg
name "ovl_Door_Spiral"
compress
include "build/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.o"
include "build/src/overlays/actors/ovl_Door_Spiral/ovl_Door_Spiral_reloc.o"
include "build/data/ovl_Door_Spiral/ovl_Door_Spiral.data.o"
include "build/data/ovl_Door_Spiral/ovl_Door_Spiral.reloc.o"
endseg
beginseg
@ -2141,7 +2144,8 @@ beginseg
name "ovl_Obj_Boyo"
compress
include "build/src/overlays/actors/ovl_Obj_Boyo/z_obj_boyo.o"
include "build/src/overlays/actors/ovl_Obj_Boyo/ovl_Obj_Boyo_reloc.o"
include "build/data/ovl_Obj_Boyo/ovl_Obj_Boyo.data.o"
include "build/data/ovl_Obj_Boyo/ovl_Obj_Boyo.reloc.o"
endseg
beginseg
@ -3334,7 +3338,8 @@ beginseg
name "ovl_Bg_Lotus"
compress
include "build/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.o"
include "build/src/overlays/actors/ovl_Bg_Lotus/ovl_Bg_Lotus_reloc.o"
include "build/data/ovl_Bg_Lotus/ovl_Bg_Lotus.data.o"
include "build/data/ovl_Bg_Lotus/ovl_Bg_Lotus.reloc.o"
endseg
beginseg
@ -3593,7 +3598,8 @@ beginseg
name "ovl_Bg_Tobira01"
compress
include "build/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.o"
include "build/src/overlays/actors/ovl_Bg_Tobira01/ovl_Bg_Tobira01_reloc.o"
include "build/data/ovl_Bg_Tobira01/ovl_Bg_Tobira01.data.o"
include "build/data/ovl_Bg_Tobira01/ovl_Bg_Tobira01.reloc.o"
endseg
beginseg
@ -3811,7 +3817,9 @@ beginseg
name "ovl_En_Invadepoh"
compress
include "build/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.o"
include "build/src/overlays/actors/ovl_En_Invadepoh/ovl_En_Invadepoh_reloc.o"
include "build/data/ovl_En_Invadepoh/ovl_En_Invadepoh.data.o"
include "build/data/ovl_En_Invadepoh/ovl_En_Invadepoh.bss.o"
include "build/data/ovl_En_Invadepoh/ovl_En_Invadepoh.reloc.o"
endseg
beginseg

View File

@ -1,9 +1,3 @@
/*
* File: z_bg_keikoku_spr.c
* Overlay: ovl_Bg_Keikoku_Spr
* Description: Termina Field Fountain Water
*/
#include "z_bg_keikoku_spr.h"
#include "objects/object_keikoku_obj/object_keikoku_obj.h"
@ -16,7 +10,8 @@ void BgKeikokuSpr_Destroy(Actor* thisx, PlayState* play);
void BgKeikokuSpr_Update(Actor* thisx, PlayState* play);
void BgKeikokuSpr_Draw(Actor* thisx, PlayState* play);
ActorInit Bg_Keikoku_Spr_InitVars = {
/*
const ActorInit Bg_Keikoku_Spr_InitVars = {
ACTOR_BG_KEIKOKU_SPR,
ACTORCAT_PROP,
FLAGS,
@ -25,38 +20,14 @@ ActorInit Bg_Keikoku_Spr_InitVars = {
(ActorFunc)BgKeikokuSpr_Init,
(ActorFunc)BgKeikokuSpr_Destroy,
(ActorFunc)BgKeikokuSpr_Update,
(ActorFunc)BgKeikokuSpr_Draw,
(ActorFunc)BgKeikokuSpr_Draw
};
*/
static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneForward, 3000, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneScale, 200, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 400, ICHAIN_CONTINUE),
ICHAIN_VEC3F_DIV1000(scale, 20, ICHAIN_STOP),
};
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Keikoku_Spr/BgKeikokuSpr_Init.s")
void BgKeikokuSpr_Init(Actor* thisx, PlayState* play) {
Actor_ProcessInitChain(thisx, sInitChain);
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Keikoku_Spr/BgKeikokuSpr_Destroy.s")
void BgKeikokuSpr_Destroy(Actor* thisx, PlayState* play) {
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Keikoku_Spr/BgKeikokuSpr_Update.s")
void BgKeikokuSpr_Update(Actor* thisx, PlayState* play) {
}
void BgKeikokuSpr_Draw(Actor* thisx, PlayState* play) {
s32 pad;
OPEN_DISPS(play->state.gfxCtx);
AnimatedMat_Draw(play, Lib_SegmentedToVirtual(object_keikoku_obj_Matanimheader_0001F8));
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, object_keikoku_obj_DL_000100);
AnimatedMat_Draw(play, Lib_SegmentedToVirtual(object_keikoku_obj_Matanimheader_0003F8));
gSPDisplayList(POLY_XLU_DISP++, object_keikoku_obj_DL_000300);
AnimatedMat_Draw(play, Lib_SegmentedToVirtual(object_keikoku_obj_Matanimheader_0005F8));
gSPDisplayList(POLY_XLU_DISP++, object_keikoku_obj_DL_000500);
CLOSE_DISPS(play->state.gfxCtx);
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Keikoku_Spr/BgKeikokuSpr_Draw.s")

View File

@ -1,9 +1,3 @@
/*
* File: z_bg_lotus.c
* Overlay: ovl_Bg_Lotus
* Description: Southern Swamp Lilypads
*/
#include "z_bg_lotus.h"
#include "objects/object_lotus/object_lotus.h"
@ -16,11 +10,8 @@ void BgLotus_Destroy(Actor* thisx, PlayState* play);
void BgLotus_Update(Actor* thisx, PlayState* play);
void BgLotus_Draw(Actor* thisx, PlayState* play);
void BgLotus_Wait(BgLotus* this, PlayState* play);
void BgLotus_Sink(BgLotus* this, PlayState* play);
void BgLotus_WaitToAppear(BgLotus* this, PlayState* play);
ActorInit Bg_Lotus_InitVars = {
/*
const ActorInit Bg_Lotus_InitVars = {
ACTOR_BG_LOTUS,
ACTORCAT_BG,
FLAGS,
@ -29,147 +20,22 @@ ActorInit Bg_Lotus_InitVars = {
(ActorFunc)BgLotus_Init,
(ActorFunc)BgLotus_Destroy,
(ActorFunc)BgLotus_Update,
(ActorFunc)BgLotus_Draw,
(ActorFunc)BgLotus_Draw
};
*/
static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
};
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Lotus/BgLotus_Init.s")
void BgLotus_Init(Actor* thisx, PlayState* play) {
BgLotus* this = THIS;
s32 pad;
s32 bgId;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Lotus/BgLotus_Destroy.s")
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
DynaPolyActor_Init(&this->dyna, 1);
DynaPolyActor_LoadMesh(play, &this->dyna, &gLilyPadCol);
this->dyna.actor.floorHeight = BgCheck_EntityRaycastFloor5(&play->colCtx, &thisx->floorPoly, &bgId,
&this->dyna.actor, &this->dyna.actor.world.pos);
this->timer2 = 96;
this->dyna.actor.world.rot.y = (s32)Rand_Next() >> 0x10;
this->actionFunc = BgLotus_Wait;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Lotus/func_80AD6830.s")
void BgLotus_Destroy(Actor* thisx, PlayState* play) {
BgLotus* this = THIS;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Lotus/func_80AD68DC.s")
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Lotus/func_80AD6A88.s")
void BgLotus_SetScaleXZ(BgLotus* this) {
f32 scale;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Lotus/func_80AD6B68.s")
if (this->dyna.actor.params == 0) {
scale = sin_rad(this->timer * 0.7853982f) * ((0.014f * ((f32)this->timer / 8)) + 0.01f);
this->dyna.actor.scale.x = (1.0f + scale) * 0.1f;
this->dyna.actor.scale.z = (1.0f - scale) * 0.1f;
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Lotus/BgLotus_Update.s")
void BgLotus_Wait(BgLotus* this, PlayState* play) {
f32 moveDist; // distance for the xz position of the lilypad to move
this->timer2--;
moveDist = sin_rad(this->timer2 * 0.06544985f) * 6.0f;
if (this->dyna.actor.params == 0) {
this->dyna.actor.world.pos.x =
(Math_SinS(this->dyna.actor.world.rot.y) * moveDist) + this->dyna.actor.home.pos.x;
this->dyna.actor.world.pos.z =
(Math_CosS(this->dyna.actor.world.rot.y) * moveDist) + this->dyna.actor.home.pos.z;
if (this->timer2 == 0) {
this->timer2 = 96;
this->dyna.actor.world.rot.y += (s16)((s32)Rand_Next() >> 0x12);
}
}
if (this->height < this->dyna.actor.floorHeight) {
this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight;
} else {
this->dyna.actor.world.pos.y = this->height;
if (DynaPolyActor_IsInRidingMovingState(&this->dyna)) {
if (this->hasSpawnedRipples == 0) {
EffectSsGRipple_Spawn(play, &this->dyna.actor.world.pos, 1000, 1400, 0);
EffectSsGRipple_Spawn(play, &this->dyna.actor.world.pos, 1000, 1400, 8);
this->timer = 40;
}
if (gSaveContext.save.playerForm != PLAYER_FORM_DEKU) {
this->timer = 40;
this->dyna.actor.flags |= ACTOR_FLAG_10;
this->actionFunc = BgLotus_Sink;
return;
}
this->hasSpawnedRipples = 1;
} else {
this->hasSpawnedRipples = 0;
}
}
if (this->timer > 0) {
this->timer--;
}
BgLotus_SetScaleXZ(this);
}
void BgLotus_Sink(BgLotus* this, PlayState* play) {
if (this->height < this->dyna.actor.world.pos.y) {
this->dyna.actor.world.pos.y = this->height;
}
this->dyna.actor.world.pos.y -= 1.0f;
if (this->dyna.actor.world.pos.y <= this->dyna.actor.floorHeight) {
this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight;
this->timer = 0;
}
if (this->timer > 0) {
this->timer--;
BgLotus_SetScaleXZ(this);
} else {
if (Math_StepToF(&this->dyna.actor.scale.x, 0, 0.0050000003539f)) {
this->dyna.actor.draw = NULL;
this->timer = 100;
func_800C62BC(play, &play->colCtx.dyna, this->dyna.bgId);
this->actionFunc = BgLotus_WaitToAppear;
}
this->dyna.actor.scale.z = this->dyna.actor.scale.x;
}
}
void BgLotus_WaitToAppear(BgLotus* this, PlayState* play) {
if (this->timer > 0) {
this->timer--;
} else if ((this->dyna.actor.xzDistToPlayer > 100.0f) && (this->dyna.actor.projectedPos.z < 0.0f)) {
this->dyna.actor.draw = BgLotus_Draw;
func_800C6314(play, &play->colCtx.dyna, this->dyna.bgId);
Actor_SetScale(&this->dyna.actor, 0.1f);
this->dyna.actor.world.pos.y = CLAMP_MIN(this->height, this->dyna.actor.floorHeight);
this->dyna.actor.flags &= ~ACTOR_FLAG_10;
this->timer2 = 96;
this->actionFunc = BgLotus_Wait;
this->dyna.actor.world.pos.x = this->dyna.actor.home.pos.x;
this->dyna.actor.world.pos.z = this->dyna.actor.home.pos.z;
}
}
void BgLotus_Update(Actor* thisx, PlayState* play) {
BgLotus* this = THIS;
s32 pad;
WaterBox* waterBox;
WaterBox_GetSurface1_2(play, &play->colCtx, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.z,
&this->height, &waterBox);
this->actionFunc(this, play);
}
void BgLotus_Draw(Actor* thisx, PlayState* play) {
Gfx_DrawDListOpa(play, gLilyPadDL);
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Lotus/BgLotus_Draw.s")

View File

@ -5,15 +5,9 @@
struct BgLotus;
typedef void (*BgLotusActionFunc)(struct BgLotus*, PlayState*);
typedef struct BgLotus {
/* 0x000 */ DynaPolyActor dyna;
/* 0x15C */ BgLotusActionFunc actionFunc;
/* 0x160 */ f32 height;
/* 0x164 */ u8 hasSpawnedRipples;
/* 0x166 */ s16 timer;
/* 0x168 */ s16 timer2;
/* 0x000 */ Actor actor;
/* 0x144 */ char unk_144[0x28];
} BgLotus; // size = 0x16C
#endif // Z_BG_LOTUS_H

View File

@ -16,7 +16,8 @@ void BgTobira01_Destroy(Actor* thisx, PlayState* play);
void BgTobira01_Update(Actor* thisx, PlayState* play);
void BgTobira01_Draw(Actor* thisx, PlayState* play);
ActorInit Bg_Tobira01_InitVars = {
/*
const ActorInit Bg_Tobira01_InitVars = {
ACTOR_BG_TOBIRA01,
ACTORCAT_PROP,
FLAGS,
@ -27,85 +28,14 @@ ActorInit Bg_Tobira01_InitVars = {
(ActorFunc)BgTobira01_Update,
(ActorFunc)BgTobira01_Draw,
};
*/
void BgTobira01_Open(BgTobira01* this, PlayState* play) {
Player* player = GET_PLAYER(play);
s16 cutsceneId = this->dyna.actor.cutscene;
s16 prevTimer;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Tobira01/func_80B12430.s")
if (this->playCutscene) {
if (ActorCutscene_GetCurrentIndex() == 0x7C) {
ActorCutscene_Stop(0x7C);
} else if (ActorCutscene_GetCanPlayNext(cutsceneId)) {
ActorCutscene_StartAndSetUnkLinkFields(cutsceneId, &this->dyna.actor);
SET_WEEKEVENTREG(WEEKEVENTREG_88_40);
this->playCutscene = false;
} else {
ActorCutscene_SetIntentToPlay(cutsceneId);
}
} else if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_88_40) && (this->timer == 0) && (play->actorCtx.unk_1F4.timer != 0) &&
(play->actorCtx.unk_1F4.unk_00 == 0) &&
(SurfaceType_GetSceneExitIndex(&play->colCtx, player->actor.floorPoly, player->actor.floorBgId) == 6)) {
this->playCutscene = true;
this->unk_16C = 0; // this variable is not used anywhere else
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Tobira01/BgTobira01_Init.s")
prevTimer = this->timer;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Tobira01/BgTobira01_Destroy.s")
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_88_40)) {
this->timer++;
} else {
this->timer--;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Tobira01/BgTobira01_Update.s")
this->timer = CLAMP(this->timer, 0, 60);
if (this->timer != prevTimer) {
if (1) {}
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_STONEDOOR_OPEN_S - SFX_FLAG);
this->dyna.actor.world.pos.y = (this->yOffset = (this->timer * (5.0f / 3.0f)) + this->dyna.actor.home.pos.y);
this->timer2 = 180;
}
if (!(player->stateFlags1 & PLAYER_STATE1_40) && CHECK_WEEKEVENTREG(WEEKEVENTREG_88_40) &&
(DECR(this->timer2) == 0)) {
CLEAR_WEEKEVENTREG(WEEKEVENTREG_88_40);
}
}
void BgTobira01_Init(Actor* thisx, PlayState* play) {
BgTobira01* this = THIS;
s32 pad;
DynaPolyActor_Init(&this->dyna, 1);
DynaPolyActor_LoadMesh(play, &this->dyna, &object_spot11_obj_Colheader_0011C0);
CLEAR_WEEKEVENTREG(WEEKEVENTREG_88_40);
Actor_SetScale(&this->dyna.actor, 1.0f);
this->timer2 = gSaveContext.save.isNight;
this->timer = 0;
this->actionFunc = BgTobira01_Open;
}
void BgTobira01_Destroy(Actor* thisx, PlayState* play) {
BgTobira01* this = THIS;
s32 pad;
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
}
void BgTobira01_Update(Actor* thisx, PlayState* play) {
BgTobira01* this = THIS;
s32 pad;
this->actionFunc(this, play);
}
void BgTobira01_Draw(Actor* thisx, PlayState* play) {
OPEN_DISPS(play->state.gfxCtx);
func_8012C28C(play->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, object_spot11_obj_DL_000088);
CLOSE_DISPS(play->state.gfxCtx);
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Tobira01/BgTobira01_Draw.s")

View File

@ -5,16 +5,9 @@
struct BgTobira01;
typedef void (*BgTobira01ActionFunc)(struct BgTobira01*, struct PlayState*);
typedef struct BgTobira01 {
/* 0x000 */ DynaPolyActor dyna;
/* 0x15C */ BgTobira01ActionFunc actionFunc;
/* 0x160 */ s16 timer;
/* 0x162 */ s16 timer2;
/* 0x164 */ f32 yOffset;
/* 0x168 */ s32 playCutscene;
/* 0x16C */ s32 unk_16C; // unused besides being set to 0
/* 0x000 */ Actor actor;
/* 0x144 */ char unk_144[0x2C];
} BgTobira01; // size = 0x170
#endif // Z_BG_TOBIRA01_H

View File

@ -16,58 +16,13 @@
#define THIS ((DoorSpiral*)thisx)
typedef enum {
/* 0 */ SPIRAL_OVERWORLD, // does not display anything as there is not a DL in GAMEPLAY_KEEP for it
/* 1 */ SPIRAL_DUNGEON,
/* 2 */ SPIRAL_WOODFALL_TEMPLE,
/* 3 */ SPIRAL_WOODFALL_TEMPLE_ALT, // SPIRAL_WOODFALL_TEMPLE but with positional lights enabled?
/* 4 */ SPIRAL_SNOWHEAD_TEMPLE,
/* 5 */ SPIRAL_STONE_TOWER,
/* 6 */ SPIRAL_IKANA_CASTLE,
/* 7 */ SPIRAL_DAMPES_HOUSE
} SpiralType;
typedef enum {
/* 0 */ SPIRAL_OBJECT_OVERWORLD,
/* 1 */ SPIRAL_OBJECT_DUNGEON,
/* 2 */ SPIRAL_OBJECT_WOODFALL,
/* 3 */ SPIRAL_OBJECT_SNOWHEAD,
/* 4 */ SPIRAL_OBJECT_STONE_TOWER,
/* 5 */ SPIRAL_OBJECT_DAMPES_HOUSE,
/* 6 */ SPIRAL_OBJECT_IKANA_CASTLE
} SpiralObjectType;
typedef struct {
/* 0x00 */ Gfx* spiralDL[2]; // one displaylist for downward spiral, and one for upward
/* 0x08 */ s32 unk8; // unused
/* 0x0C */ u8 unkC; // unused
/* 0x0D */ u8 unkD; // unused
/* 0x0E */ u8 spiralWidth;
/* 0x0F */ u8 spiralHeight;
} SpiralInfo;
// Maps SpiralObjectType to SpiralType
typedef struct {
/* 0x00 */ s16 objectBankId;
/* 0x02 */ u8 spiralType;
} SpiralObjectInfo;
// Maps scenes to SpiralObjectType
typedef struct {
/* 0x00 */ s16 sceneId;
/* 0x02 */ u8 objectType;
} SpiralSceneInfo;
void DoorSpiral_Init(Actor* thisx, PlayState* play);
void DoorSpiral_Destroy(Actor* thisx, PlayState* play);
void DoorSpiral_Update(Actor* thisx, PlayState* play);
void DoorSpiral_Draw(Actor* thisx, PlayState* play);
void DoorSpiral_WaitForObject(DoorSpiral* this, PlayState* play);
void DoorSpiral_Wait(DoorSpiral* this, PlayState* play);
void DoorSpiral_PlayerClimb(DoorSpiral* this, PlayState* play);
ActorInit Door_Spiral_InitVars = {
/*
const ActorInit Door_Spiral_InitVars = {
ACTOR_DOOR_SPIRAL,
ACTORCAT_DOOR,
FLAGS,
@ -76,257 +31,30 @@ ActorInit Door_Spiral_InitVars = {
(ActorFunc)DoorSpiral_Init,
(ActorFunc)DoorSpiral_Destroy,
(ActorFunc)DoorSpiral_Update,
(ActorFunc)DoorSpiral_Draw,
(ActorFunc)DoorSpiral_Draw
};
*/
// Parameters for each staircase, indexed with SpiralType
static SpiralInfo sSpiralInfo[] = {
{ { NULL, NULL }, 0, 130, 12, 50, 15 }, // SPIRAL_OVERWORLD
{ { gameplay_dangeon_keep_DL_0219E0, gameplay_dangeon_keep_DL_01D980 }, 0, 130, 12, 50, 15 }, // SPIRAL_DUNGEON
{ { object_numa_obj_DL_004448, object_numa_obj_DL_0007A8 }, 0, 130, 12, 50, 15 }, // SPIRAL_WOODFALL_TEMPLE
{ { object_numa_obj_DL_0051B8, object_numa_obj_DL_0014C8 }, 0, 130, 12, 50, 15 }, // SPIRAL_WOODFALL_TEMPLE_ALT
{ { object_hakugin_obj_DL_009278, object_hakugin_obj_DL_006128 }, 0, 130, 12, 50, 15 }, // SPIRAL_SNOWHEAD_TEMPLE
{ { object_ikana_obj_DL_013EA8, object_ikana_obj_DL_012B70 }, 0, 130, 12, 50, 15 }, // SPIRAL_STONE_TOWER
{ { object_ikninside_obj_DL_000EA0, object_ikninside_obj_DL_000590 }, 0, 130, 12, 50, 15 }, // SPIRAL_IKANA_CASTLE
{ { object_danpei_object_DL_002110, object_danpei_object_DL_0012C0 }, 0, 130, 12, 50, 15 }, // SPIRAL_DAMPES_HOUSE
};
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Spiral/func_809A2B60.s")
// Defines which object bank a staircase should use, and its index to `sSpiralInfo`
static SpiralObjectInfo sSpiralObjectInfo[] = {
{ GAMEPLAY_KEEP, SPIRAL_OVERWORLD }, { GAMEPLAY_DANGEON_KEEP, SPIRAL_DUNGEON },
{ OBJECT_NUMA_OBJ, SPIRAL_WOODFALL_TEMPLE }, { OBJECT_HAKUGIN_OBJ, SPIRAL_SNOWHEAD_TEMPLE },
{ OBJECT_IKANA_OBJ, SPIRAL_STONE_TOWER }, { OBJECT_DANPEI_OBJECT, SPIRAL_DAMPES_HOUSE },
{ OBJECT_IKNINSIDE_OBJ, SPIRAL_IKANA_CASTLE },
};
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Spiral/func_809A2B70.s")
/**
* Sets the actor's action function
*/
void DoorSpiral_SetupAction(DoorSpiral* this, DoorSpiralActionFunc actionFunc) {
this->actionFunc = actionFunc;
this->unk14A = 0; // set but never used
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Spiral/func_809A2BF8.s")
/**
* Sets this->spiralType, which is derived from `sSpiralObjectInfo`, and is used as an index to `sSpiralInfo`.
*/
s32 DoorSpiral_SetSpiralType(DoorSpiral* this, PlayState* play) {
SpiralObjectInfo* doorObjectInfo = &sSpiralObjectInfo[this->objectType];
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Spiral/DoorSpiral_Init.s")
this->spiralType = doorObjectInfo->spiralType;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Spiral/DoorSpiral_Destroy.s")
if ((this->spiralType == SPIRAL_DAMPES_HOUSE) ||
((this->spiralType == SPIRAL_WOODFALL_TEMPLE) && play->roomCtx.curRoom.enablePosLights)) {
if (this->spiralType == SPIRAL_WOODFALL_TEMPLE) {
this->spiralType = SPIRAL_WOODFALL_TEMPLE_ALT;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Spiral/func_809A2DB0.s")
this->actor.flags |= ACTOR_FLAG_10000000;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Spiral/func_809A2E08.s")
DoorSpiral_SetupAction(this, DoorSpiral_Wait);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Spiral/func_809A2EA0.s")
return 0;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Spiral/func_809A2FF8.s")
/**
* Gets the object type to be used as an index to `sSpiralObjectInfo`.
* It first checks `sSpiralSceneInfo`, but if the current scene is not found it will fall back to the default spiral
* (overworld or dungeon).
*/
s32 DoorSpiral_GetObjectType(PlayState* play) {
// Defines which object type should be used for specific scenes
static SpiralSceneInfo spiralSceneInfo[] = {
{ SCENE_MITURIN, SPIRAL_OBJECT_WOODFALL }, { SCENE_HAKUGIN, SPIRAL_OBJECT_SNOWHEAD },
{ SCENE_INISIE_N, SPIRAL_OBJECT_STONE_TOWER }, { SCENE_INISIE_R, SPIRAL_OBJECT_STONE_TOWER },
{ SCENE_DANPEI2TEST, SPIRAL_OBJECT_DAMPES_HOUSE }, { SCENE_IKNINSIDE, SPIRAL_OBJECT_IKANA_CASTLE },
{ SCENE_CASTLE, SPIRAL_OBJECT_IKANA_CASTLE },
};
SpiralSceneInfo* sceneInfo = spiralSceneInfo;
s32 i;
s32 type;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Spiral/func_809A3098.s")
for (i = 0; i < ARRAY_COUNT(spiralSceneInfo); sceneInfo++, i++) {
if (play->sceneId == sceneInfo->sceneId) {
break;
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Spiral/DoorSpiral_Update.s")
type = i;
if (type < ARRAY_COUNT(spiralSceneInfo)) {
type = sceneInfo->objectType;
} else {
// Set the type based on if link is in a dungeon scene, or the overworld
type = (Object_GetIndex(&play->objectCtx, GAMEPLAY_DANGEON_KEEP) >= 0) ? SPIRAL_OBJECT_DUNGEON
: SPIRAL_OBJECT_OVERWORLD;
}
return type;
}
static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F(scale, 1, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneScale, 400, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 400, ICHAIN_STOP),
};
void DoorSpiral_Init(Actor* thisx, PlayState* play) {
DoorSpiral* this = THIS;
s32 pad;
s32 transition = DOORSPIRAL_GET_TRANSITION_ID(thisx);
s8 objBankId;
if (this->actor.room != play->doorCtx.transitionActorList[transition].sides[0].room) {
Actor_Kill(&this->actor);
return;
}
Actor_ProcessInitChain(&this->actor, sInitChain);
this->unk145 = DOORSPIRAL_GET_UNK145(thisx); // set but never used
this->orientation = DOORSPIRAL_GET_ORIENTATION(thisx);
this->objectType = DoorSpiral_GetObjectType(play);
objBankId = Object_GetIndex(&play->objectCtx, sSpiralObjectInfo[this->objectType].objectBankId);
this->bankIndex = objBankId;
if (objBankId < 0) {
Actor_Kill(&this->actor);
return;
}
DoorSpiral_SetupAction(this, DoorSpiral_WaitForObject);
Actor_SetFocus(&this->actor, 60.0f);
}
void DoorSpiral_Destroy(Actor* thisx, PlayState* play) {
s32 transition = DOORSPIRAL_GET_TRANSITION_ID(thisx);
play->doorCtx.transitionActorList[transition].id *= -1;
}
/**
* Waits for the required object to be loaded.
*/
void DoorSpiral_WaitForObject(DoorSpiral* this, PlayState* play) {
if (Object_IsLoaded(&play->objectCtx, this->bankIndex)) {
this->actor.objBankIndex = this->bankIndex;
DoorSpiral_SetSpiralType(this, play);
}
}
/**
* Finds the distance between the stairs and the player.
*/
f32 DoorSpiral_GetDistFromPlayer(PlayState* play, DoorSpiral* this, f32 yOffset, f32 spiralWidth, f32 spiralHeight) {
Player* player = GET_PLAYER(play);
Vec3f target;
Vec3f offset;
target.x = player->actor.world.pos.x;
target.y = player->actor.world.pos.y + yOffset;
target.z = player->actor.world.pos.z;
Actor_OffsetOfPointInActorCoords(&this->actor, &offset, &target);
if ((spiralWidth < fabsf(offset.x)) || (spiralHeight < fabsf(offset.y))) {
return FLT_MAX;
}
return offset.z;
}
/**
* Checks if the player should climb the stairs.
*/
s32 DoorSpiral_PlayerShouldClimb(DoorSpiral* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (!Player_InCsMode(play)) {
SpiralInfo* spiralInfo = &sSpiralInfo[this->spiralType];
f32 dist = DoorSpiral_GetDistFromPlayer(play, this, 0.0f, spiralInfo->spiralWidth, spiralInfo->spiralHeight);
if (fabsf(dist) < 64.0f) {
s16 angle = player->actor.shape.rot.y - this->actor.shape.rot.y;
if (dist > 0.0f) {
angle = 0x8000 - angle;
}
if (ABS_ALT(angle) < 0x3000) {
return (dist >= 0.0f) ? 1.0f : -1.0f;
}
}
}
return 0;
}
/**
* Wait for the player to interact with the stairs.
*/
void DoorSpiral_Wait(DoorSpiral* this, PlayState* play) {
Player* player;
s32 transition;
if (this->shouldClimb) {
DoorSpiral_SetupAction(this, DoorSpiral_PlayerClimb);
} else if (DoorSpiral_PlayerShouldClimb(this, play)) {
player = GET_PLAYER(play);
player->doorType = PLAYER_DOORTYPE_STAIRCASE;
player->doorDirection = this->orientation;
player->doorActor = &this->actor;
transition = DOORSPIRAL_GET_TRANSITION_ID(&this->actor);
player->doorNext = ((u16)play->doorCtx.transitionActorList[transition].params) >> 10;
func_80122F28(player);
}
}
/**
* Player is climbing the stairs.
*/
void DoorSpiral_PlayerClimb(DoorSpiral* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (!(player->stateFlags1 & PLAYER_STATE1_20000000)) {
DoorSpiral_SetupAction(this, DoorSpiral_WaitForObject);
this->shouldClimb = 0;
}
}
void DoorSpiral_Update(Actor* thisx, PlayState* play) {
DoorSpiral* this = THIS;
s32 pad;
Player* player = GET_PLAYER(play);
if (!(player->stateFlags1 & (PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_400 | PLAYER_STATE1_10000000)) ||
(this->actionFunc == DoorSpiral_WaitForObject)) {
this->actionFunc(this, play);
}
}
void DoorSpiral_Draw(Actor* thisx, PlayState* play) {
s32 pad;
DoorSpiral* this = THIS;
if (this->actor.objBankIndex == this->bankIndex) {
SpiralInfo* spiralInfo = &sSpiralInfo[this->spiralType];
Gfx* dList;
// Set the model to render based on the orientation of the stairs (upward or downward)
dList = spiralInfo->spiralDL[this->orientation];
if (dList != NULL) {
OPEN_DISPS(play->state.gfxCtx);
func_8012C28C(play->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, spiralInfo->spiralDL[this->orientation]);
CLOSE_DISPS(play->state.gfxCtx);
}
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Spiral/DoorSpiral_Draw.s")

View File

@ -5,22 +5,9 @@
struct DoorSpiral;
#define DOORSPIRAL_GET_ORIENTATION(thisx) (((thisx)->params >> 7) & 0x1)
#define DOORSPIRAL_GET_UNK145(thisx) (((thisx)->params >> 8) & 0x3)
#define DOORSPIRAL_GET_TRANSITION_ID(thisx) ((u16)(thisx)->params >> 10)
typedef void (*DoorSpiralActionFunc)(struct DoorSpiral*, PlayState*);
typedef struct DoorSpiral {
/* 0x000 */ Actor actor;
/* 0x144 */ u8 shouldClimb; // Flag used to determine if the player should climb the stairs
/* 0x145 */ u8 unk145;
/* 0x146 */ u8 orientation; // Upward or downward staircase
/* 0x147 */ u8 objectType; // Index to list of objects
/* 0x148 */ u8 spiralType; // Type of skin the staircase should use
/* 0x149 */ s8 bankIndex; // Object bank to use
/* 0x14A */ s8 unk14A;
/* 0x14C */ DoorSpiralActionFunc actionFunc;
/* 0x144 */ char unk_144[0xC];
} DoorSpiral; // size = 0x150
#endif // Z_DOOR_SPIRAL_H

File diff suppressed because it is too large Load Diff

View File

@ -5,151 +5,9 @@
struct EnInvadepoh;
typedef void (*EnInvadepohInitFunc)(struct EnInvadepoh*, PlayState*);
typedef void (*EnInvadepohDestroyFunc)(struct EnInvadepoh*, PlayState*);
typedef void (*EnInvadepohActionFunc)(struct EnInvadepoh*, PlayState*);
#define INVADEPOH_TYPE(thisx) (((thisx)->params >> 4) & 0xF)
typedef enum{
/* 0 */ TYPE_UNK0,
/* 1 */ TYPE_ALIEN,
/* 2 */ TYPE_PARENT_COW,
/* 3 */ TYPE_CHILD_COW,
/* 4 */ TYPE_ROMANI,
/* 5 */ TYPE_ROMANI1,
/* 6 */ TYPE_UNK6,
/* 7 */ TYPE_ROMANI2,
/* 8 */ TYPE_ROMANI3,
/* 9 */ TYPE_ROMANI4,
/* 10 */ TYPE_DOG,
/* 11 */ TYPE_CREMIA,
/* 12 */ TYPE_ROMANI5,
/* 13 */ TYPE_ALIEN_CARRYING_COW
} EnInvadepohType;
typedef enum {
/* -1 */ DIRECTION_BACKWARD = -1,
/* 1 */ DIRECTION_FORWARD = 1,
} EnInvadepohDirection;
typedef struct unkStruct80B50350 {
/* 0x0 */ s8 unk0;
/* 0x1 */ s8 unk1;
/* 0x2 */ u8 unk2;
/* 0x4 */ Vec3f unk4;
} unkStruct80B50350; // size = 0x10;
typedef struct {
/* 0x0 */ s8* unk00;
/* 0x4 */ s8 unk04;
} unkstructInvadepoh0; // size = 0x8
typedef struct {
/* 0x0 */ s8 unk00;
/* 0x4 */ f32 unk04;
} unkstructInvadepoh1; // size = 0x8
typedef struct {
/* 0x0 */ s8 unk00;
/* 0x4 */ unkstructInvadepoh0* unk04;
} unkstructInvadepoh2; // size = 0x8
typedef struct {
/* 0x0 */ s8 unk0;
/* 0x4 */ unkstructInvadepoh0* unk4;
/* 0x8 */ s8 unk8;
/* 0xC */ unkstructInvadepoh1* unkC;
} unkstructInvadepoh3; // size = 0x10
typedef struct {
/* 0x00 */ s8 unk00;
/* 0x04 */ unkstructInvadepoh0* unk04;
/* 0x08 */ s8 unk08;
/* 0x0C */ unkstructInvadepoh1* unk0C;
/* 0x10 */ s16 unk10;
/* 0x12 */ s16 unk12;
} unkstructInvadepoh4; // size = 0x14
typedef struct {
/* 0x0 */ f32 unk00;
/* 0x4 */ s16 unk04;
/* 0x6 */ s16 unk06;
} unkstruct80B4EE0C; // size = 0x8
typedef struct EnInvadePohStruct {
/* 0x0 */ unkstructInvadepoh4* unk0;
/* 0x4 */ s8 unk4;
/* 0x8 */ unkstructInvadepoh4* unk8;
/* 0xC */ s16 unkC;
/* 0xE */ s8 unkE;
/* 0xF */ s8 unkF;
} EnInvadePohStruct; // size = 0x10;
typedef struct AlienBehaviorInfo {
/* 0x00 */ EnInvadePohStruct unk0;
/* 0x10 */ EnInvadePohStruct unk10;
/* 0x20 */ Vec3s unk20;
/* 0x26 */ Vec3s unk26;
/* 0x2C */ s16 unk2C;
/* 0x2E */ u16 unk2E;
/* 0x30 */ f32 unk30;
/* 0x34 */ f32 unk34;
/* 0x38 */ f32 unk38;
/* 0x3C */ f32 unk3C;
/* 0x40 */ s16 unk40;
/* 0x42 */ s16 unk42;
/* 0x44 */ f32 unk44;
/* 0x48 */ s16 unk48;
/* 0x4A */ UNK_TYPE1 unk4A[0x2];
/* 0x4C */ s16 unk4C;
/* 0x4E */ s16 unk4E;
} AlienBehaviorInfo; // size = 0x50
typedef struct EnInvadepoh {
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
/* 0x188 */ Vec3s jointTable[23];
/* 0x212 */ Vec3s morphTable[23];
/* 0x29C */ s8 animPlayFlag;
/* 0x2A0 */ ColliderCylinder collider;
/* 0x2EC */ EnInvadepohActionFunc actionFunc;
/* 0x2F0 */ s16 actionTimer;
/* 0x2F2 */ s16 counter; // general counter variable
/* 0x2F4 */ s8 bankIndex;
/* 0x2F8 */ f32 xzPosAdjFactor;
/* 0x2FC */ UNK_TYPE unk2FC; // unused
/* 0x300 */ f32 velocityStep;
/* 0x304 */ s16 unk304; // angle of some sort
/* 0x306 */ s16 unk306;
/* 0x308 */ s8 endPoint;
/* 0x309 */ s8 pathIndex;
/* 0x30A */ s8 direction; // only ever 1 or -1
/* 0x30C */ Vec3s* pathPoints;
/* 0x310 */ f32 pathTotalDist;
/* 0x314 */ Vec3f curPathPos;
/* 0x320 */ f32 clockTime;
/* 0x324 */ AlienBehaviorInfo behaviorInfo;
/* 0x374 */ s8 rand;
/* 0x376 */ u16 textId;
/* 0x378 */ s8 unk378;
/* 0x379 */ s8 unk379;
/* 0x37C */ f32 unk37C[3];
/* 0x388 */ s8 unk388; // unused
/* 0x389 */ u8 alienAlpha;
/* 0x38A */ s8 unk38A; // bool
/* 0x38B */ s8 drawAlien;
/* 0x38C */ s8 drawAlienDeathEffect;
/* 0x38D */ u8 alienBeamAlpha;
/* 0x390 */ Vec3f alienDeathEffectScale;
/* 0x39C */ f32 scaleFactorAdj;
/* 0x3A0 */ f32 scaleTarget;
/* 0x3A4 */ f32 scaleStep;
/* 0x3A8 */ s16 scaleAdjAngle;
/* 0x3AA */ s16 unk3AA;
/* 0x3AC */ s8 unk3AC; // index for D_80B4EDD0
/* 0x3AD */ UNK_TYPE1 unk3AD[0xF];
/* 0x3BC */ s8 unk3BC;
/* 0x144 */ char unk_144[0x27C];
} EnInvadepoh; // size = 0x3C0
#endif // Z_EN_INVADEPOH_H

View File

@ -229,6 +229,7 @@ void EnPoFusen_IncrementRomaniPop(EnPoFusen* this) {
if ((parent != NULL) && (parent->id == ACTOR_EN_MA4)) {
EnMa4* romani = (EnMa4*)parent;
romani->poppedBalloonCounter++;
}

View File

@ -1,9 +1,3 @@
/*
* File: z_item_b_heart.c
* Overlay: ovl_Item_B_Heart
* Description: Heart Container
*/
#include "z_item_b_heart.h"
#include "objects/object_gi_hearts/object_gi_hearts.h"
@ -16,9 +10,8 @@ void ItemBHeart_Destroy(Actor* thisx, PlayState* play);
void ItemBHeart_Update(Actor* thisx, PlayState* play);
void ItemBHeart_Draw(Actor* thisx, PlayState* play);
void func_808BCF54(ItemBHeart* this, PlayState* play);
ActorInit Item_B_Heart_InitVars = {
/*
const ActorInit Item_B_Heart_InitVars = {
ACTOR_ITEM_B_HEART,
ACTORCAT_BOSS,
FLAGS,
@ -27,89 +20,16 @@ ActorInit Item_B_Heart_InitVars = {
(ActorFunc)ItemBHeart_Init,
(ActorFunc)ItemBHeart_Destroy,
(ActorFunc)ItemBHeart_Update,
(ActorFunc)ItemBHeart_Draw,
(ActorFunc)ItemBHeart_Draw
};
*/
static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 0, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneScale, 800, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 800, ICHAIN_STOP),
};
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Item_B_Heart/ItemBHeart_Init.s")
void ItemBHeart_Init(Actor* thisx, PlayState* play) {
ItemBHeart* this = THIS;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Item_B_Heart/ItemBHeart_Destroy.s")
if (Flags_GetCollectible(play, 0x1F)) {
Actor_Kill(&this->actor);
return;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Item_B_Heart/ItemBHeart_Update.s")
Actor_ProcessInitChain(&this->actor, sInitChain);
ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.8f);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Item_B_Heart/func_808BCF54.s")
if (this->actor.params == 0x23) {
this->unk_168 = 0.1f;
} else {
this->unk_168 = 1.0f;
}
this->actor.world.pos.y += (20.0f * this->unk_168);
}
void ItemBHeart_Destroy(Actor* thisx, PlayState* play) {
}
void ItemBHeart_Update(Actor* thisx, PlayState* play) {
ItemBHeart* this = THIS;
func_808BCF54(this, play);
if (!(this->unk_168 < 0.5f)) {
if (Actor_HasParent(&this->actor, play)) {
Flags_SetCollectible(play, 0x1F);
Actor_Kill(&this->actor);
return;
}
Actor_OfferGetItem(&this->actor, play, GI_HEART_CONTAINER, 30.0f, 80.0f);
}
}
void func_808BCF54(ItemBHeart* this, PlayState* play) {
this->actor.shape.rot.y += 0x400;
Math_ApproachF(&this->unk_164, 0.4f, 0.1f, 0.01f);
Actor_SetScale(&this->actor, this->unk_164 * this->unk_168);
}
void ItemBHeart_Draw(Actor* thisx, PlayState* play) {
ItemBHeart* this = THIS;
Actor* blueWarpActor;
u8 flag = false;
OPEN_DISPS(play->state.gfxCtx);
blueWarpActor = play->actorCtx.actorLists[ACTORCAT_ITEMACTION].first;
while (blueWarpActor != NULL) {
if ((blueWarpActor->id == ACTOR_DOOR_WARP1) && (blueWarpActor->projectedPos.z > this->actor.projectedPos.z)) {
flag = true;
break;
}
blueWarpActor = blueWarpActor->next;
}
if (flag || thisx->world.rot.y != 0) {
func_8012C2DC(play->state.gfxCtx);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, gGiHeartBorderDL);
gSPDisplayList(POLY_XLU_DISP++, gGiHeartContainerDL);
} else {
func_8012C28C(play->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, gGiHeartBorderDL);
gSPDisplayList(POLY_OPA_DISP++, gGiHeartContainerDL);
}
CLOSE_DISPS(play->state.gfxCtx);
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Item_B_Heart/ItemBHeart_Draw.s")

View File

@ -7,8 +7,7 @@ struct ItemBHeart;
typedef struct ItemBHeart {
/* 0x000 */ Actor actor;
/* 0x144 */ UNK_TYPE1 unk_144[0x20];
/* 0x164 */ f32 unk_164;
/* 0x144 */ UNK_TYPE1 unk_144[0x24];
/* 0x168 */ f32 unk_168;
} ItemBHeart; // size = 0x16C

View File

@ -1,13 +1,4 @@
/*
* File: z_obj_boyo.c
* Overlay: ovl_Obj_Boyo
* Description: Unused Bumper
*/
#include "z_obj_boyo.h"
#include "overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.h"
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
#include "objects/object_boyo/object_boyo.h"
#define FLAGS (ACTOR_FLAG_10)
@ -18,7 +9,8 @@ void ObjBoyo_Destroy(Actor* thisx, PlayState* play2);
void ObjBoyo_Update(Actor* thisx, PlayState* play2);
void ObjBoyo_Draw(Actor* thisx, PlayState* play);
ActorInit Obj_Boyo_InitVars = {
/*
const ActorInit Obj_Boyo_InitVars = {
ACTOR_OBJ_BOYO,
ACTORCAT_PROP,
FLAGS,
@ -27,158 +19,22 @@ ActorInit Obj_Boyo_InitVars = {
(ActorFunc)ObjBoyo_Init,
(ActorFunc)ObjBoyo_Destroy,
(ActorFunc)ObjBoyo_Update,
(ActorFunc)ObjBoyo_Draw,
(ActorFunc)ObjBoyo_Draw
};
*/
static ColliderCylinderInit sCylinderInit = {
{
COLTYPE_NONE,
AT_NONE,
AC_ON | AC_HARD | AC_TYPE_PLAYER,
OC1_ON | OC1_TYPE_ALL,
OC2_TYPE_2,
COLSHAPE_CYLINDER,
},
{
ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x00 },
{ 0x01CBFFBE, 0x00, 0x00 },
TOUCH_NONE | TOUCH_SFX_NORMAL,
BUMP_ON,
OCELEM_ON,
},
{ 60, 140, 0, { 0, 0, 0 } },
};
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Boyo/ObjBoyo_Init.s")
static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneScale, 300, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 300, ICHAIN_CONTINUE),
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
};
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Boyo/ObjBoyo_Destroy.s")
void ObjBoyo_Init(Actor* thisx, PlayState* play) {
ObjBoyo* this = THIS;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Boyo/func_809A5DC0.s")
Actor_ProcessInitChain(&this->actor, sInitChain);
Collider_InitCylinder(play, &this->collider);
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
Collider_UpdateCylinder(&this->actor, &this->collider);
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
this->unk_190 = Lib_SegmentedToVirtual(object_boyo_Matanimheader_000E88);
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Boyo/func_809A5DE0.s")
void ObjBoyo_Destroy(Actor* thisx, PlayState* play2) {
PlayState* play = play2;
ObjBoyo* this = THIS;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Boyo/func_809A5E14.s")
Collider_DestroyCylinder(play, &this->collider);
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Boyo/func_809A5E24.s")
void ObjBoyo_UpdatePlayerBumpValues(ObjBoyo* this, Player* target) {
target->unk_B80 = 30.0f;
target->unk_B84 = this->actor.yawTowardsPlayer;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Boyo/ObjBoyo_Update.s")
void ObjBoyo_UpdatePirateBumpValues(ObjBoyo* src, EnKaizoku* target) {
target->unk_2F0 = 30.0f;
target->unk_2F4 = Actor_WorldYawTowardActor(&src->actor, &target->picto.actor);
}
void ObjBoyo_UpdateBombBumpValues(ObjBoyo* src, EnBom* target) {
target->timer = 0;
}
BumperCollideInfo sBumperCollideInfo[] = {
{ ACTOR_PLAYER, (BumperCollideActorFunc)ObjBoyo_UpdatePlayerBumpValues },
{ ACTOR_EN_KAIZOKU, (BumperCollideActorFunc)ObjBoyo_UpdatePirateBumpValues },
{ ACTOR_EN_BOM, (BumperCollideActorFunc)ObjBoyo_UpdateBombBumpValues },
};
Actor* ObjBoyo_GetCollidedActor(ObjBoyo* this, PlayState* play, s32* num) {
Actor* collideActor;
BumperCollideInfo* collideInfo;
s32 i;
if (this->collider.base.ocFlags2 & OC2_HIT_PLAYER) {
*num = 0;
return &GET_PLAYER(play)->actor;
}
if (this->collider.base.ocFlags1 & OC2_UNK1) {
for (collideActor = this->collider.base.oc, collideInfo = &sBumperCollideInfo[1], i = 1; i < 3;
collideInfo++, i++) {
if (collideInfo->id == collideActor->id) {
*num = i;
return collideActor;
}
}
}
return NULL;
}
void ObjBoyo_Update(Actor* thisx, PlayState* play2) {
PlayState* play = play2;
ObjBoyo* this = THIS;
Actor* target;
s32 num;
target = ObjBoyo_GetCollidedActor(this, play, &num);
if (target != NULL) {
sBumperCollideInfo[num].actorCollideFunc(this, (void*)target);
this->unk_194 = 100;
this->unk_196 = 3;
this->unk_198 = 0.01f;
this->unk_19C = this->unk_1A0 = 0.03f;
this->unk_1A4 = 0x3F40;
this->unk_1A6 = 2000;
this->unk_1A8 = 0;
this->unk_1AA = 0x2DF7;
this->unk_1AC = 600;
}
if (this->unk_194 > 0) {
this->unk_194 -= this->unk_196;
this->unk_1AA += this->unk_1AC;
this->unk_1A8 += this->unk_1AA;
this->actor.scale.x = this->actor.scale.z =
(Math_CosS(this->unk_1A8 + this->unk_1A4) * this->unk_194 * this->unk_19C * this->unk_198) + 0.1f;
this->actor.scale.y =
(Math_CosS(this->unk_1A8 + this->unk_1A6) * this->unk_194 * this->unk_1A0 * this->unk_198) + 0.1f;
} else {
Actor_SetScale(&this->actor, 0.1f);
if (this->collider.base.acFlags & AC_HIT) {
this->unk_194 = 30;
this->unk_196 = 2;
this->unk_198 = 0.033333335f;
this->unk_19C = 0.012f;
this->unk_1A0 = 0.006f;
this->unk_1A4 = 0x3F40;
this->unk_1A6 = 2000;
this->unk_1A8 = 0;
this->unk_1AA = 15000;
this->unk_1AC = 1600;
}
}
this->collider.base.acFlags &= ~AC_HIT;
this->collider.base.ocFlags1 &= ~OC1_HIT;
this->collider.base.ocFlags2 &= ~OC2_HIT_PLAYER;
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
if (thisx->xzDistToPlayer < 2000.0f) {
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
}
}
void ObjBoyo_Draw(Actor* thisx, PlayState* play) {
ObjBoyo* this = THIS;
AnimatedMat_Draw(play, this->unk_190);
Gfx_DrawDListOpa(play, object_boyo_DL_000300);
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Boyo/ObjBoyo_Draw.s")

View File

@ -5,27 +5,9 @@
struct ObjBoyo;
typedef void (*BumperCollideActorFunc)(struct ObjBoyo*, void*);
typedef struct {
/* 0x0 */ s16 id;
/* 0x4 */ BumperCollideActorFunc actorCollideFunc;
} BumperCollideInfo; // size = 0x8
typedef struct ObjBoyo {
/* 0x000 */ Actor actor;
/* 0x144 */ ColliderCylinder collider;
/* 0x190 */ AnimatedMaterial* unk_190;
/* 0x194 */ s16 unk_194;
/* 0x196 */ s16 unk_196;
/* 0x198 */ f32 unk_198;
/* 0x19C */ f32 unk_19C;
/* 0x1A0 */ f32 unk_1A0;
/* 0x1A4 */ s16 unk_1A4;
/* 0x1A6 */ s16 unk_1A6;
/* 0x1A8 */ s16 unk_1A8;
/* 0x1AA */ s16 unk_1AA;
/* 0x1AC */ s16 unk_1AC;
/* 0x144 */ char unk_144[0x6C];
} ObjBoyo; // size = 0x1B0
#endif // Z_OBJ_BOYO_H

View File

@ -8682,7 +8682,7 @@
0x809A20FC:("EnMm2_WaitForRead",),
0x809A2194:("EnMm2_Update",),
0x809A21B8:("EnMm2_Draw",),
0x809A2B60:("DoorSpiral_SetupAction",),
0x809A2B60:("func_809A2B60",),
0x809A2B70:("func_809A2B70",),
0x809A2BF8:("func_809A2BF8",),
0x809A2C78:("DoorSpiral_Init",),
@ -13735,9 +13735,9 @@
0x80B43DD4:("func_80B43DD4",),
0x80B43E6C:("func_80B43E6C",),
0x80B43F0C:("func_80B43F0C",),
0x80B43F70:("EnInvadepoh_GetTotalPathDistance",),
0x80B43F70:("func_80B43F70",),
0x80B44024:("func_80B44024",),
0x80B4407C:("EnInvadepoh_SetPathPointToWorldPos",),
0x80B4407C:("func_80B4407C",),
0x80B440B8:("func_80B440B8",),
0x80B44234:("func_80B44234",),
0x80B442E4:("func_80B442E4",),
@ -13771,9 +13771,9 @@
0x80B453F4:("func_80B453F4",),
0x80B45460:("func_80B45460",),
0x80B454BC:("func_80B454BC",),
0x80B45518:("EnInvadepoh_SetSysMatrix",),
0x80B45518:("func_80B45518",),
0x80B45550:("func_80B45550",),
0x80B4560C:("EnInvadepoh_SetTextID",),
0x80B4560C:("func_80B4560C",),
0x80B45648:("func_80B45648",),
0x80B456A8:("func_80B456A8",),
0x80B457A0:("func_80B457A0",),
@ -13791,13 +13791,13 @@
0x80B46184:("func_80B46184",),
0x80B461DC:("func_80B461DC",),
0x80B4627C:("func_80B4627C",),
0x80B46414:("EnInvadepoh_InitAlien",),
0x80B46520:("EnInvadepoh_InitParentCow",),
0x80B465CC:("EnInvadepoh_InitChildCow",),
0x80B46644:("EnInvadepoh_InitRomani",),
0x80B46414:("func_80B46414",),
0x80B46520:("func_80B46520",),
0x80B465CC:("func_80B465CC",),
0x80B46644:("func_80B46644",),
0x80B468B4:("func_80B468B4",),
0x80B469C4:("EnInvadepoh_InitDog",),
0x80B46A80:("EnInvadepoh_InitCremia",),
0x80B469C4:("func_80B469C4",),
0x80B46A80:("func_80B46A80",),
0x80B46B74:("EnInvadepoh_Init",),
0x80B46BB0:("func_80B46BB0",),
0x80B46BC0:("func_80B46BC0",),

View File

@ -9511,7 +9511,7 @@
0x809A6150:("Obj_Boyo_InitVars","UNK_TYPE1","",0x1),
0x809A6170:("D_809A6170","UNK_TYPE1","",0x1),
0x809A619C:("D_809A619C","UNK_TYPE1","",0x1),
0x809A61B0:("sBumperCollideInfo","UNK_TYPE1","",0x1),
0x809A61B0:("D_809A61B0","UNK_TYPE1","",0x1),
0x809A61B4:("D_809A61B4","UNK_TYPE2","",0x2),
0x809A61D0:("D_809A61D0","f32","",0x4),
0x809A61D4:("D_809A61D4","f32","",0x4),
@ -14328,11 +14328,11 @@
0x80B4E934:("D_80B4E934","UNK_TYPE4","",0x4),
0x80B4E938:("D_80B4E938","f32","",0x4),
0x80B4E940:("D_80B4E940","UNK_TYPE4","",0x4),
0x80B4E944:("sRomaniEyeTextures","UNK_TYPE4","",0x4),
0x80B4E958:("sRomaniMouthTextures","UNK_TYPE4","",0x4),
0x80B4E944:("D_80B4E944","UNK_TYPE4","",0x4),
0x80B4E958:("D_80B4E958","UNK_TYPE4","",0x4),
0x80B4E968:("D_80B4E968","UNK_TYPE1","",0x1),
0x80B4E96C:("sCremiaEyeTextures","UNK_TYPE4","",0x4),
0x80B4E984:("sCremiaMouthTextures","UNK_TYPE4","",0x4),
0x80B4E96C:("D_80B4E96C","UNK_TYPE4","",0x4),
0x80B4E984:("D_80B4E984","UNK_TYPE4","",0x4),
0x80B4E994:("D_80B4E994","UNK_TYPE1","",0x1),
0x80B4E998:("D_80B4E998","UNK_TYPE1","",0x1),
0x80B4E99C:("D_80B4E99C","UNK_TYPE1","",0x1),
@ -14418,6 +14418,21 @@
0x80B4EE0C:("D_80B4EE0C","UNK_TYPE1","",0x1),
0x80B4EE24:("D_80B4EE24","UNK_TYPE1","",0x1),
0x80B4EE30:("D_80B4EE30","UNK_TYPE1","",0x1),
0x80B4EE40:("D_80B4EE40","f32","",0x4),
0x80B4EE44:("D_80B4EE44","f32","",0x4),
0x80B4EE48:("D_80B4EE48","f32","",0x4),
0x80B4EE4C:("D_80B4EE4C","f32","",0x4),
0x80B4EE50:("D_80B4EE50","f32","",0x4),
0x80B4EE54:("D_80B4EE54","f32","",0x4),
0x80B4EE58:("D_80B4EE58","f32","",0x4),
0x80B4EE5C:("D_80B4EE5C","f32","",0x4),
0x80B4EE60:("D_80B4EE60","f32","",0x4),
0x80B4EE64:("D_80B4EE64","f32","",0x4),
0x80B4EE68:("D_80B4EE68","f32","",0x4),
0x80B4EE6C:("D_80B4EE6C","f32","",0x4),
0x80B4EE70:("D_80B4EE70","f32","",0x4),
0x80B4EE74:("D_80B4EE74","f32","",0x4),
0x80B4EE78:("D_80B4EE78","f32","",0x4),
0x80B4EE7C:("D_80B4EE7C","f32","",0x4),
0x80B4EE80:("D_80B4EE80","f32","",0x4),
0x80B4EE84:("D_80B4EE84","f32","",0x4),
@ -14558,8 +14573,8 @@
0x80B503F0:("D_80B503F0","UNK_TYPE4","",0x4),
0x80B503F4:("D_80B503F4","UNK_TYPE4","",0x4),
0x80B503F8:("D_80B503F8","UNK_TYPE4","",0x4),
0x80B503FC:("sAlienEyeBeamTexAnim","UNK_TYPE4","",0x4),
0x80B50400:("sAlienEmptyTexAnim","UNK_TYPE4","",0x4),
0x80B503FC:("D_80B503FC","UNK_TYPE4","",0x4),
0x80B50400:("D_80B50400","UNK_TYPE4","",0x4),
0x80B50404:("D_80B50404","UNK_TYPE2","",0x2),
0x80B50406:("D_80B50406","UNK_TYPE2","",0x2),
0x80B5040A:("D_80B5040A","UNK_TYPE1","",0x1),

View File

@ -574,6 +574,22 @@ D_06001680 = 0x06001680;
D_06000288 = 0x06000288;
// ovl_Bg_Keikoku_Spr
D_06000100 = 0x06000100;
D_060001F8 = 0x060001F8;
D_060003F8 = 0x060003F8;
D_06000500 = 0x06000500;
D_060005F8 = 0x060005F8;
/* ovl_Bg_Lotus */
D_06000A20 = 0x06000A20;
D_06000040 = 0x06000040;
/* ovl_Bg_Tobira01 */
D_060011C0 = 0x060011C0;
D_06000088 = 0x06000088;
// ovl_Boss_01
D_06000C44 = 0x06000C44;
@ -724,6 +740,21 @@ D_060129F0 = 0x060129F0;
D_06002D30 = 0x06002D30;
D_06011458 = 0x06011458;
// ovl_Door_Spiral
D_06000590 = 0x06000590;
D_060007A8 = 0x060007A8;
D_06000EA0 = 0x06000EA0;
D_060012C0 = 0x060012C0;
D_060014C8 = 0x060014C8;
D_06002110 = 0x06002110;
D_06004448 = 0x06004448;
D_060051B8 = 0x060051B8;
D_06006128 = 0x06006128;
D_06009278 = 0x06009278;
D_06012B70 = 0x06012B70;
D_06013EA8 = 0x06013EA8;
// ovl_Eff_Stk
D_06008920 = 0x06008920;
@ -830,6 +861,55 @@ D_0600A344 = 0x0600A344;
D_06001EFC = 0x06001EFC;
D_0600A808 = 0x0600A808;
// ovl_En_Invadepoh
D_06000080 = 0x06000080;
D_060003B0 = 0x060003B0;
D_06000550 = 0x06000550;
D_06000560 = 0x06000560;
D_06000608 = 0x06000608;
D_060006C8 = 0x060006C8;
D_06000720 = 0x06000720;
D_06000998 = 0x06000998;
D_06001560 = 0x06001560;
D_06001674 = 0x06001674;
D_06001BD8 = 0x06001BD8;
D_06001D80 = 0x06001D80;
D_060021C8 = 0x060021C8;
D_06002A8C = 0x06002A8C;
D_06004010 = 0x06004010;
D_06004264 = 0x06004264;
D_06004C30 = 0x06004C30;
D_06004E50 = 0x06004E50;
D_06004E98 = 0x06004E98;
D_06007328 = 0x06007328;
D_060080F0 = 0x060080F0;
D_06009E58 = 0x06009E58;
D_0600A174 = 0x0600A174;
D_0600FFC8 = 0x0600FFC8;
D_060107C8 = 0x060107C8;
D_06010FC8 = 0x06010FC8;
D_060117C8 = 0x060117C8;
D_06011AD8 = 0x06011AD8;
D_06011FC8 = 0x06011FC8;
D_060122D8 = 0x060122D8;
D_060127C8 = 0x060127C8;
D_06012AD8 = 0x06012AD8;
D_06012BC8 = 0x06012BC8;
D_06012FC8 = 0x06012FC8;
D_060132D8 = 0x060132D8;
D_060133C8 = 0x060133C8;
D_06013928 = 0x06013928;
D_06013AD8 = 0x06013AD8;
D_06014088 = 0x06014088;
D_060142D8 = 0x060142D8;
D_06014AD8 = 0x06014AD8;
D_06014ED8 = 0x06014ED8;
D_060152D8 = 0x060152D8;
D_06015C28 = 0x06015C28;
D_060156D8 = 0x060156D8;
D_06016720 = 0x06016720;
// ovl_En_Invadepoh_Demo
D_06000080 = 0x06000080;
@ -1010,6 +1090,16 @@ D_06000D94 = 0x06000D94;
D_06007650 = 0x06007650;
D_0600D658 = 0x0600D658;
// ovl_Item_B_Heart
D_06001290 = 0x06001290;
D_06001470 = 0x06001470;
// ovl_Obj_Boyo
D_06000300 = 0x06000300;
D_06000E88 = 0x06000E88;
// ovl_Obj_Mine
D_06000030 = 0x06000030;