diff --git a/spec b/spec index 325fffa4aa..a10cb67ce4 100644 --- a/spec +++ b/spec @@ -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 diff --git a/src/overlays/actors/ovl_Bg_Keikoku_Spr/z_bg_keikoku_spr.c b/src/overlays/actors/ovl_Bg_Keikoku_Spr/z_bg_keikoku_spr.c index 8afd5d7307..8246a02983 100644 --- a/src/overlays/actors/ovl_Bg_Keikoku_Spr/z_bg_keikoku_spr.c +++ b/src/overlays/actors/ovl_Bg_Keikoku_Spr/z_bg_keikoku_spr.c @@ -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") diff --git a/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.c b/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.c index 20be54a2f3..765b58dbda 100644 --- a/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.c +++ b/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.c @@ -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") diff --git a/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.h b/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.h index 540c21b0e0..61d340a490 100644 --- a/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.h +++ b/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.h @@ -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 diff --git a/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c b/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c index a1c4f1d276..17722bda21 100644 --- a/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c +++ b/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c @@ -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") diff --git a/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.h b/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.h index 14a5e1b8e1..9ddd0233d2 100644 --- a/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.h +++ b/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.h @@ -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 diff --git a/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c b/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c index 541e3de233..6c7d321523 100644 --- a/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c +++ b/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c @@ -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") diff --git a/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.h b/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.h index 0f3e32a39e..701b386395 100644 --- a/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.h +++ b/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.h @@ -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 diff --git a/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c b/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c index f208ece37a..e29a91b4b3 100644 --- a/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c +++ b/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c @@ -1,17 +1,4 @@ -/* - * File: z_en_invadepoh.c - * Overlay: ovl_En_Invadepoh - * Description: Ranch nighttime actors - */ -#include "prevent_bss_reordering.h" #include "z_en_invadepoh.h" -#include "overlays/actors/ovl_En_Door/z_en_door.h" -#include "objects/gameplay_keep/gameplay_keep.h" -#include "objects/object_ma1/object_ma1.h" -#include "objects/object_ma2/object_ma2.h" -#include "objects/object_dog/object_dog.h" -#include "objects/object_cow/object_cow.h" -#include "objects/object_uch/object_uch.h" #define FLAGS (ACTOR_FLAG_10) @@ -21,164 +8,8 @@ void EnInvadepoh_Init(Actor* thisx, PlayState* play); void EnInvadepoh_Destroy(Actor* thisx, PlayState* play); void EnInvadepoh_Update(Actor* thisx, PlayState* play); -void func_80B46DA8(EnInvadepoh* this); -void func_80B46DC8(EnInvadepoh* this, PlayState* play); -void func_80B46E20(EnInvadepoh* this); -void func_80B46E44(EnInvadepoh* this, PlayState* play); -void func_80B46EC0(EnInvadepoh* this); -void func_80B46EE8(EnInvadepoh* this, PlayState* play); -void func_80B46F88(EnInvadepoh* this); -void func_80B46FA8(EnInvadepoh* this, PlayState* play); -void func_80B47064(EnInvadepoh* this); -void func_80B47084(EnInvadepoh* this, PlayState* play); -void func_80B470E0(EnInvadepoh* this); -void func_80B47108(EnInvadepoh* this, PlayState* play); -void func_80B471C0(EnInvadepoh* this); -void func_80B471E0(EnInvadepoh* this, PlayState* play); -void func_80B47248(EnInvadepoh* this); -void func_80B47268(EnInvadepoh* this, PlayState* play); -void func_80B47298(EnInvadepoh* this, PlayState* play); -void func_80B47304(EnInvadepoh* this); -void func_80B47324(EnInvadepoh* this, PlayState* play); -void func_80B473E4(EnInvadepoh* this, PlayState* play); -void func_80B474DC(EnInvadepoh* this, PlayState* play); -void func_80B47600(EnInvadepoh* this, PlayState* play); -void func_80B477B4(EnInvadepoh* this, PlayState* play); -void func_80B48324(EnInvadepoh* this, PlayState* play); -void func_80B4ACF0(EnInvadepoh* this, PlayState* play); -void func_80B4AD3C(EnInvadepoh* this); -void func_80B4AD60(EnInvadepoh* this, PlayState* play); -void func_80B4ADB8(EnInvadepoh* this); -void func_80B4ADCC(EnInvadepoh* this, PlayState* play); -void func_80B4AEC0(EnInvadepoh* this); -void func_80B4AEDC(EnInvadepoh* this, PlayState* play); -void func_80B4AF80(EnInvadepoh* this); -void func_80B4AF94(EnInvadepoh* this, PlayState* play); -void func_80B4B024(EnInvadepoh* this); -void func_80B4B048(EnInvadepoh* this, PlayState* play); -void func_80B4B484(EnInvadepoh* this, PlayState* play); -void func_80B4B510(EnInvadepoh* this); -void func_80B4B564(EnInvadepoh* this, PlayState* play); -void func_80B4B724(EnInvadepoh* this); -void func_80B4B768(EnInvadepoh* this, PlayState* play); -void func_80B4B820(EnInvadepoh* this); -void func_80B4B864(EnInvadepoh* this, PlayState* play); -void func_80B48374(EnInvadepoh* this); -void func_80B483CC(EnInvadepoh* this, PlayState* play); -void func_80B49A00(EnInvadepoh* this, PlayState* play); -void func_80B4994C(EnInvadepoh* this, PlayState* play); -void func_80B497EC(EnInvadepoh* this, PlayState* play); -void func_80B49628(EnInvadepoh* this); -void func_80B49670(EnInvadepoh* this, PlayState* play); -void func_80B49454(EnInvadepoh* this, PlayState* play); -void func_80B4934C(EnInvadepoh* this, PlayState* play); -void func_80B491EC(EnInvadepoh* this); -void func_80B49228(EnInvadepoh* this, PlayState* play); -void func_80B49C38(EnInvadepoh* this, PlayState* play); -void func_80B49DFC(EnInvadepoh* this, PlayState* play); -void func_80B4A350(EnInvadepoh* this, PlayState* play); -void func_80B4A5E4(EnInvadepoh* this, PlayState* play); -void func_80B4A67C(EnInvadepoh* this, PlayState* play); -void func_80B4A81C(EnInvadepoh* this, PlayState* play); -void func_80B4BC4C(EnInvadepoh* this, PlayState* play); -void func_80B4C058(EnInvadepoh* this, PlayState* play); -void func_80B4C218(EnInvadepoh* this, PlayState* play); -void func_80B4C730(EnInvadepoh* this, PlayState* play); -void func_80B4CB0C(EnInvadepoh* this, PlayState* play); -void func_80B4CCCC(EnInvadepoh* this, PlayState* play); -void func_80B4D480(EnInvadepoh* this, PlayState* play); -void func_80B47568(EnInvadepoh* this); -void func_80B478F4(EnInvadepoh* this, PlayState* play); -void func_80B47938(EnInvadepoh* this); -void func_80B479E8(EnInvadepoh* this, PlayState* play); -void func_80B4843C(EnInvadepoh* this); -void func_80B484EC(EnInvadepoh* this, PlayState* play); -void func_80B48588(EnInvadepoh* this); -void func_80B48610(EnInvadepoh* this, PlayState* play); -void func_80B48848(EnInvadepoh* this, PlayState* play); -void func_80B47278(EnInvadepoh* this); -void func_80B48AD4(EnInvadepoh* this, PlayState* play); -void func_80B48E4C(EnInvadepoh* this, PlayState* play); -void func_80B49404(EnInvadepoh* this); -void func_80B4A570(EnInvadepoh* this); -void func_80B4C1BC(EnInvadepoh* this); -void func_80B4D290(EnInvadepoh* this, PlayState* play); -void func_80B4CC70(EnInvadepoh* this); -void func_80B4770C(EnInvadepoh* this); -void func_80B48948(EnInvadepoh* this); -void func_80B49904(EnInvadepoh* this); -void func_80B499BC(EnInvadepoh* this); -void func_80B492FC(EnInvadepoh* this); -void func_80B4627C(EnInvadepoh* this, PlayState* play); -void EnInvadepoh_InitAlien(EnInvadepoh* this, PlayState* play); -void EnInvadepoh_InitParentCow(EnInvadepoh* this, PlayState* play); -void EnInvadepoh_InitChildCow(EnInvadepoh* this, PlayState* play); -void EnInvadepoh_InitRomani(EnInvadepoh* this, PlayState* play); -void func_80B468B4(EnInvadepoh* this, PlayState* play); -void EnInvadepoh_InitDog(EnInvadepoh* this, PlayState* play); -void EnInvadepoh_InitCremia(EnInvadepoh* this, PlayState* play); -void func_80B46BB0(EnInvadepoh* this, PlayState* play); -void func_80B46BC0(EnInvadepoh* this, PlayState* play); -void func_80B46C08(EnInvadepoh* this, PlayState* play); -void func_80B46C34(EnInvadepoh* this, PlayState* play); -void func_80B46C50(EnInvadepoh* this, PlayState* play); -void func_80B46C50(EnInvadepoh* this, PlayState* play); -void func_80B46C7C(EnInvadepoh* this, PlayState* play); -void func_80B46C50(EnInvadepoh* this, PlayState* play); -void func_80B46C50(EnInvadepoh* this, PlayState* play); -void func_80B46C50(EnInvadepoh* this, PlayState* play); -void func_80B46C94(EnInvadepoh* this, PlayState* play); -void func_80B46CC0(EnInvadepoh* this, PlayState* play); -void func_80B46CF4(EnInvadepoh* this, PlayState* play); -void func_80B46D28(EnInvadepoh* this, PlayState* play); -void func_80B4D670(Actor* thisx, PlayState* play); -void func_80B47BAC(Actor* thisx, PlayState* play); -void func_80B47D30(Actor* thisx, PlayState* play); -void func_80B47FA8(Actor* thisx, PlayState* play); -void func_80B48060(Actor* thisx, PlayState* play); -void func_80B481C4(Actor* thisx, PlayState* play); -void func_80B4827C(Actor* thisx, PlayState* play); -void func_80B48620(Actor* thisx, PlayState* play); -void func_80B48FB0(Actor* thisx, PlayState* play); -void func_80B49F88(Actor* thisx, PlayState* play); -void func_80B4A9C8(Actor* thisx, PlayState* play); -void func_80B4B0C4(Actor* thisx, PlayState* play); -void func_80B4CE54(Actor* thisx, PlayState* play); -void func_80B4B8BC(Actor* thisx, PlayState* play); -void func_80B4C3A0(Actor* thisx, PlayState* play); -void func_80B49B1C(Actor* thisx, PlayState* play); -void func_80B4E158(Actor* thisx, PlayState* play); -void func_80B4E3F0(Actor* thisx, PlayState* play); -void func_80B4D9B4(Actor* thisx, PlayState* play); -void func_80B4E1B0(Actor* thisx, PlayState* play); -void func_80B4E324(Actor* thisx, PlayState* play); -void func_80B4BA84(Actor* thisx, PlayState* play); -void func_80B4E660(Actor* thisx, PlayState* play); -void func_80B4C5C0(Actor* thisx, PlayState* play); -void func_80B4E7BC(Actor* thisx, PlayState* play); -void func_80B4A1B8(Actor* thisx, PlayState* play); -void func_80B4ABDC(Actor* thisx, PlayState* play); -void func_80B4D054(Actor* thisx, PlayState* play); -void func_80B4DB14(Actor* thisx, PlayState* play); -void func_80B4D760(Actor* thisx, PlayState* play); -void func_80B4A168(Actor* thisx, PlayState* play); -void func_80B4873C(Actor* thisx, PlayState* play); -void func_80B490F0(Actor* thisx, PlayState* play); -void func_80B4AB8C(Actor* thisx, PlayState* play); -void func_80B4B218(Actor* thisx, PlayState* play); -void func_80B4BA30(Actor* thisx, PlayState* play); -void func_80B4C568(Actor* thisx, PlayState* play); -void func_80B4CFFC(Actor* thisx, PlayState* play); -void func_80B46184(unkStruct80B50350* unkStruct); -s32 func_80B450C0(f32* x1, f32* z1, f32 x2, f32 z2, f32 speed); -s32 func_80B4516C(EnInvadepoh* this); -void func_80B45A4C(EnInvadePohStruct* s, unkstructInvadepoh4** u); -void func_80B45A94(EnInvadePohStruct* s, unkstructInvadepoh4** u); -void func_80B45B1C(EnInvadePohStruct* s, unkstructInvadepoh4** u); - -extern s32 D_801BDA9C; - -ActorInit En_Invadepoh_InitVars = { +/* +const ActorInit En_Invadepoh_InitVars = { ACTOR_EN_INVADEPOH, ACTORCAT_PROP, FLAGS, @@ -189,4414 +20,492 @@ ActorInit En_Invadepoh_InitVars = { (ActorFunc)EnInvadepoh_Update, (ActorFunc)NULL, }; +*/ -static ColliderCylinderInit sCylinderInitAlien = { - { - COLTYPE_HIT3, - AT_ON | AT_TYPE_ENEMY, - AC_ON | AC_TYPE_PLAYER, - OC1_ON | OC1_TYPE_ALL, - OC2_TYPE_1, - COLSHAPE_CYLINDER, - }, - { - ELEMTYPE_UNK4, - { 0xF7CFFFFF, 0x00, 0x04 }, - { 0x00003820, 0x00, 0x00 }, - TOUCH_ON | TOUCH_SFX_NONE, - BUMP_ON, - OCELEM_ON, - }, - { 40, 95, 10, { 0, 0, 0 } }, -}; - -static ColliderCylinderInit sCylinderInitRomaniAndCremia = { - { - COLTYPE_NONE, - AT_NONE, - AC_NONE, - OC1_ON | OC1_TYPE_ALL, - OC2_TYPE_2, - COLSHAPE_CYLINDER, - }, - { - ELEMTYPE_UNK0, - { 0x00000000, 0x00, 0x00 }, - { 0x00000000, 0x00, 0x00 }, - TOUCH_NONE | TOUCH_SFX_NORMAL, - BUMP_NONE, - OCELEM_ON, - }, - { 18, 46, 0, { 0, 0, 0 } }, -}; - -static ColliderCylinderInit sCylinderInitDog = { - { - COLTYPE_NONE, - AT_NONE, - AC_NONE, - OC1_ON | OC1_TYPE_ALL, - OC2_TYPE_1, - COLSHAPE_CYLINDER, - }, - { - ELEMTYPE_UNK1, - { 0x00000000, 0x00, 0x00 }, - { 0x00000000, 0x00, 0x00 }, - TOUCH_NONE | TOUCH_SFX_NORMAL, - BUMP_NONE, - OCELEM_ON, - }, - { 13, 19, 0, { 0, 0, 0 } }, -}; - -static Vec3f D_80B4E934 = { 216.0f, -20.0f, 1395.0f }; - -static s32 D_80B4E940 = 0; - -static TexturePtr sRomaniEyeTextures[] = { - gRomaniEyeOpenTex, gRomaniEyeHalfTex, gRomaniEyeClosedTex, gRomaniEyeHappyTex, gRomaniEyeSadTex, -}; - -static TexturePtr sRomaniMouthTextures[] = { - gRomaniMouthHappyTex, - gRomaniMouthFrownTex, - gRomaniMouthHangingOpenTex, - gRomaniMouthSmileTex, -}; - -static s8 D_80B4E968 = 0; - -static TexturePtr sCremiaEyeTextures[] = { - gCremiaEyeOpenTex, gCremiaEyeHalfTex, gCremiaEyeClosedTex, gCremiaEyeHappyTex, gCremiaEyeAngryTex, gCremiaEyeSadTex, -}; - -static TexturePtr sCremiaMouthTextures[] = { - gCremiaMouthNormalTex, - gCremiaMouthSlightSmileTex, - gCremiaMouthFrownTex, - gCremiaMouthHangingOpenTex, -}; - -static s8 D_80B4E994 = 0; - -static s8 D_80B4E998 = 0; - -static s8 D_80B4E99C[] = { 0 }; - -static s8 D_80B4E9A0[] = { 0, 1, 2, 0 }; - -static s8 D_80B4E9A4[] = { 0, 1, 2, 1, 0 }; - -static s8 D_80B4E9AC[] = { 0, 1, 2, 2, 1, 0 }; - -static s8 D_80B4E9B4[] = { - 0, 1, 2, 1, 0, 1, 2, 0, -}; - -static s8 D_80B4E9BC[] = { 1 }; - -static s8 D_80B4E9C0[] = { 3 }; - -static unkstructInvadepoh0 D_80B4E9C4 = { D_80B4E99C, 1 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B439B0.s") -static unkstructInvadepoh0 D_80B4E9CC = { D_80B4E9A0, 4 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B43A24.s") -static unkstructInvadepoh0 D_80B4E9D4 = { D_80B4E9A4, 5 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B43A74.s") -static unkstructInvadepoh0 D_80B4E9DC = { D_80B4E9AC, 6 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B43A9C.s") -static unkstructInvadepoh0 D_80B4E9E4 = { D_80B4E9B4, 8 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B43AB0.s") -static unkstructInvadepoh0 D_80B4E9EC = { D_80B4E9BC, 1 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B43AF0.s") -static unkstructInvadepoh0 D_80B4E9F4 = { D_80B4E9C0, 1 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B43B80.s") -static unkstructInvadepoh2 D_80B4E9FC = { 0, &D_80B4E9C4 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B43BC8.s") -static unkstructInvadepoh1 D_80B4EA04[] = { - { 2, 0.5f }, - { 3, 0.9f }, - { 4, 0.97f }, - { 5, 1.0f }, -}; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B43DD4.s") -static unkstructInvadepoh1 D_80B4EA24[] = { - { 1, 1.0f }, -}; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B43E6C.s") -static unkstructInvadepoh4 D_80B4EA2C = { 2, &D_80B4E9C4, 4, D_80B4EA04, 0x28, 0x3C }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B43F0C.s") -static unkstructInvadepoh3 D_80B4EA40 = { - 1, - &D_80B4E9CC, - 1, - D_80B4EA24, -}; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B43F70.s") -static unkstructInvadepoh3 D_80B4EA50 = { - 1, - &D_80B4E9D4, - 1, - D_80B4EA24, -}; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B44024.s") -static unkstructInvadepoh3 D_80B4EA60 = { - 1, - &D_80B4E9DC, - 1, - D_80B4EA24, -}; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4407C.s") -static unkstructInvadepoh3 D_80B4EA70 = { - 1, - &D_80B4E9E4, - 1, - D_80B4EA24, -}; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B440B8.s") -static unkstructInvadepoh2 D_80B4EA80 = { - 0, - &D_80B4E9EC, -}; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B44234.s") -static unkstructInvadepoh2 D_80B4EA88 = { - 0, - &D_80B4E9F4, -}; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B442E4.s") -static void* D_80B4EA90[] = { - &D_80B4E9FC, &D_80B4EA2C, &D_80B4EA40, &D_80B4EA50, &D_80B4EA60, &D_80B4EA70, &D_80B4EA80, &D_80B4EA88, -}; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B443A0.s") -static s8 D_80B4EAB0[] = { 0 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B444BC.s") -static s8 D_80B4EAB4[] = { 1 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B444F4.s") -static s8 D_80B4EAB8[] = { 2 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B44514.s") -static s8 D_80B4EABC[] = { 3 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B44540.s") -static unkstructInvadepoh0 D_80B4EAC0 = { D_80B4EAB0, 1 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B44570.s") -static unkstructInvadepoh0 D_80B4EAC8 = { D_80B4EAB4, 1 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B44620.s") -static unkstructInvadepoh0 D_80B4EAD0 = { D_80B4EAB8, 1 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B44640.s") -static unkstructInvadepoh0 D_80B4EAD8 = { D_80B4EABC, 1 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B44664.s") -static unkstructInvadepoh2 D_80B4EAE0 = { 0, &D_80B4EAC0 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B44690.s") -static unkstructInvadepoh2 D_80B4EAE8 = { 0, &D_80B4EAC8 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B446D0.s") -static unkstructInvadepoh2 D_80B4EAF0 = { 0, &D_80B4EAD0 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B44700.s") -static unkstructInvadepoh2 D_80B4EAF8 = { 0, &D_80B4EAD8 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B447C0.s") -static void* D_80B4EB00[] = { - &D_80B4EAE0, - &D_80B4EAE8, - &D_80B4EAF0, - &D_80B4EAF8, -}; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B44A90.s") -static s8 D_80B4EB10[] = { 0 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B44B78.s") -static s8 D_80B4EB14[] = { 0, 1, 2, 0 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B44B84.s") -static s8 D_80B4EB18[] = { 0, 1, 2, 1, 0 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B44C24.s") -static s8 D_80B4EB20[] = { 0, 1, 2, 2, 1, 0 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B44C80.s") -static s8 D_80B4EB28[] = { 0, 1, 2, 1, 0, 1, 2, 0 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B44E90.s") -static unkstructInvadepoh0 D_80B4EB30 = { D_80B4EB10, 1 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B44EFC.s") -static unkstructInvadepoh0 D_80B4EB38 = { D_80B4EB14, 4 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B44F58.s") -static unkstructInvadepoh0 D_80B4EB40 = { D_80B4EB18, 5 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B44FEC.s") -static unkstructInvadepoh0 D_80B4EB48 = { D_80B4EB20, 6 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B45080.s") -static unkstructInvadepoh0 D_80B4EB50 = { D_80B4EB28, 8 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B450C0.s") -static unkstructInvadepoh2 D_80B4EB58 = { 0, &D_80B4EB30 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4516C.s") -static unkstructInvadepoh1 D_80B4EB60[] = { - { 2, 0.5f }, - { 3, 0.9f }, - { 4, 0.95f }, - { 5, 1.0f }, -}; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B451A0.s") -static unkstructInvadepoh1 D_80B4EB80[] = { - { 1, 1.0f }, -}; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B452EC.s") -static unkstructInvadepoh4 D_80B4EB88 = { 2, &D_80B4EB30, 4, D_80B4EB60, 0x28, 0x3C }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B453F4.s") -static unkstructInvadepoh3 D_80B4EB9C = { - 1, - &D_80B4EB38, - 1, - D_80B4EB80, -}; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B45460.s") -static unkstructInvadepoh3 D_80B4EBAC = { - 1, - &D_80B4EB40, - 1, - D_80B4EB80, -}; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B454BC.s") -static unkstructInvadepoh3 D_80B4EBBC = { - 1, - &D_80B4EB48, - 1, - D_80B4EB80, -}; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B45518.s") -static unkstructInvadepoh3 D_80B4EBCC = { - 1, - &D_80B4EB50, - 1, - D_80B4EB80, -}; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B45550.s") -static void* D_80B4EBDC[] = { - &D_80B4EB58, &D_80B4EB88, &D_80B4EB9C, &D_80B4EBAC, &D_80B4EBBC, &D_80B4EBCC, -}; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4560C.s") -static s8 D_80B4EBF4[] = { 0 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B45648.s") -static unkstructInvadepoh0 D_80B4EBF8 = { D_80B4EBF4, 1 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B456A8.s") -static unkstructInvadepoh2 D_80B4EC00 = { 0, &D_80B4EBF8 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B457A0.s") -static void* D_80B4EC08[] = { &D_80B4EC00 }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B458D8.s") -static void (*D_80B4EC0C[])(struct EnInvadePohStruct*, unkstructInvadepoh4** arg1) = { - func_80B45A4C, - func_80B45A94, - func_80B45B1C, -}; - -static Color_RGBA8 D_80B4EC18 = { 255, 255, 200, 255 }; - -static Color_RGBA8 D_80B4EC1C = { 255, 200, 0, 0 }; - -static void (*D_80B4EC20[])(struct unkStruct80B50350*) = { func_80B46184 }; - -static InitChainEntry D_80B4EC24[] = { - ICHAIN_F32(uncullZoneForward, 20000, ICHAIN_CONTINUE), - ICHAIN_F32(uncullZoneScale, 500, ICHAIN_CONTINUE), - ICHAIN_F32(uncullZoneDownward, 600, ICHAIN_CONTINUE), - ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_STOP), -}; - -static InitChainEntry sInitChainParentCow[] = { - ICHAIN_F32(uncullZoneForward, 20000, ICHAIN_CONTINUE), - ICHAIN_F32(uncullZoneScale, 200, ICHAIN_CONTINUE), - ICHAIN_F32(uncullZoneDownward, 300, ICHAIN_CONTINUE), - ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_STOP), -}; - -static InitChainEntry sInitChainChildCow[] = { - ICHAIN_F32(uncullZoneForward, 20000, ICHAIN_CONTINUE), - ICHAIN_F32(uncullZoneScale, 100, ICHAIN_CONTINUE), - ICHAIN_F32(uncullZoneDownward, 100, ICHAIN_CONTINUE), - ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_STOP), -}; - -static InitChainEntry sInitChainRomani[] = { - ICHAIN_F32(uncullZoneForward, 20000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 100, ICHAIN_CONTINUE), - ICHAIN_F32(uncullZoneDownward, 100, ICHAIN_CONTINUE), ICHAIN_F32(targetArrowOffset, 1500, ICHAIN_CONTINUE), - ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_STOP), -}; - -static InitChainEntry D_80B4EC68[] = { - ICHAIN_F32(uncullZoneForward, 20000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 1000, ICHAIN_CONTINUE), - ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_CONTINUE), ICHAIN_VEC3S(shape.rot, 0, ICHAIN_CONTINUE), - ICHAIN_F32(terminalVelocity, -100, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP), -}; - -static InitChainEntry sInitChainDog[] = { - ICHAIN_F32(uncullZoneForward, 2000, ICHAIN_CONTINUE), - ICHAIN_F32(uncullZoneScale, 50, ICHAIN_CONTINUE), - ICHAIN_F32(uncullZoneDownward, 50, ICHAIN_CONTINUE), - ICHAIN_F32(gravity, -3, ICHAIN_CONTINUE), - ICHAIN_U8(targetMode, 4, ICHAIN_CONTINUE), - ICHAIN_VEC3F_DIV1000(scale, 7, ICHAIN_STOP), -}; - -static InitChainEntry sInitChainCremia[] = { - ICHAIN_F32(uncullZoneForward, 20000, ICHAIN_CONTINUE), - ICHAIN_F32(uncullZoneScale, 100, ICHAIN_CONTINUE), - ICHAIN_F32(uncullZoneDownward, 150, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 1500, ICHAIN_CONTINUE), - ICHAIN_U8(targetMode, 3, ICHAIN_CONTINUE), - ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_STOP), -}; - -static EnInvadepohInitFunc D_80B4ECB0[] = { - func_80B4627C, - EnInvadepoh_InitAlien, - EnInvadepoh_InitParentCow, - EnInvadepoh_InitChildCow, - EnInvadepoh_InitRomani, - EnInvadepoh_InitRomani, - func_80B468B4, - EnInvadepoh_InitRomani, - EnInvadepoh_InitRomani, - EnInvadepoh_InitRomani, - EnInvadepoh_InitDog, - EnInvadepoh_InitCremia, - EnInvadepoh_InitRomani, - EnInvadepoh_InitAlien, -}; - -static EnInvadepohDestroyFunc D_80B4ECE8[] = { - func_80B46BB0, func_80B46BC0, func_80B46C08, func_80B46C34, func_80B46C50, func_80B46C50, func_80B46C7C, - func_80B46C50, func_80B46C50, func_80B46C50, func_80B46C94, func_80B46CC0, func_80B46CF4, func_80B46D28, -}; - -static s16 D_80B4ED20[] = { - 130, 125, 115, 100, 80, 78, 76, 74, -}; - -static Vec3f D_80B4ED30[] = { - { 0.01f, 0.01f, 0.01f }, { 0.02f, 0.01f, 0.005f }, { -0.01f, 0.0f, 0.0f }, - { 0.01f, 0.01f, 0.01f }, { 0.005f, 0.01f, 0.02f }, -}; - -static Vec3f D_80B4ED6C[] = { - { 0.0005f, 0.0279999990016f, 0.01f }, { -0.01f, 0.0f, 0.0f }, { -0.01f, 0.0f, 0.0f }, - { 0.016f, 0.0004f, 0.01f }, { -0.01f, 0.0f, 0.0f }, { 0.0005f, 0.0005f, 0.0005f }, - { 0.0002f, 0.0002f, 0.0002f }, -}; - -static s16 D_80B4EDC0[] = { 0xE0C0, 0xE890, 0xD508 }; - -static s16 D_80B4EDC8[] = { - -1800, - -1000, - 0, - 2000, -}; - -static Vec3f D_80B4EDD0[] = { - { -1813.0f, 374.0f, 1900.0f }, { 2198.0f, 153.0f, 3365.0f }, { -1434.0f, 262.0f, 3365.0f }, - { -393.0f, 396.0f, 1084.0f }, { 0.0f, 1500.0f, 0.0f }, -}; - -static unkstruct80B4EE0C D_80B4EE0C[] = { - { 0.08f, 0x02BC, 0xFFF6 }, - { 0.09f, 0x012C, 0xFFFB }, - { 0.05f, 0x0190, 0x0000 }, -}; - -static Vec3f D_80B4EE24 = { - 2000.0f, - 1000.0f, - 0.0f, -}; - -static Vec3f D_80B4EE30 = { - 400.0f, - 270.0f, - 0.0f, -}; - -MtxF D_80B502A0; -MtxF D_80B502E0; -EnInvadepoh* D_80B50320[8]; -u8 D_80B50340[8]; -UNK_TYPE1 D_80B50348; -unkStruct80B50350 D_80B50350[10]; -EnInvadepoh* D_80B503F0; -EnInvadepoh* D_80B503F4; -EnInvadepoh* D_80B503F8; -AnimatedMaterial* sAlienEyeBeamTexAnim; -AnimatedMaterial* sAlienEmptyTexAnim; -s16 D_80B50404[3]; -EnInvadepoh* D_80B5040C; - -void func_80B439B0(s32 arg0, s32 arg1) { - arg1 -= 0x1AAA; - if (arg1 < 0) { - arg1 = 0; - } - - if (!(arg0 & 1)) { - gSaveContext.save.unk_E88[arg0 >> 1] = (gSaveContext.save.unk_E88[arg0 >> 1] & 0xFFFF0000) | (arg1 & 0xFFFF); - } else { - gSaveContext.save.unk_E88[arg0 >> 1] = - (gSaveContext.save.unk_E88[arg0 >> 1] & 0xFFFF) | ((arg1 & 0xFFFF) << 0x10); - } -} - -s32 func_80B43A24(s32 arg0) { - u32 phi_v1; - - if ((arg0 & 1) == 0) { - phi_v1 = gSaveContext.save.unk_E88[arg0 >> 1] & 0xFFFF; - } else { - phi_v1 = (gSaveContext.save.unk_E88[arg0 >> 1] & 0xFFFF0000) >> 0x10; - } - return phi_v1 + 0x1AAA; -} - -void func_80B43A74(s32 arg0) { - gSaveContext.save.unk_E88[4] = (gSaveContext.save.unk_E88[4] & ~0xFF) | (arg0 & 0xFF); -} - -s32 func_80B43A9C(void) { - return (gSaveContext.save.unk_E88[4] >> 0) & 0xFF; -} - -s32 func_80B43AB0(void) { - s32 retVal = func_80B43A9C(); - - if (retVal < 0xC) { - retVal++; - func_80B43A74(retVal); - } - return retVal; -} - -void func_80B43AF0(s32 arg0) { - s32 currentTime = gSaveContext.save.time; - - if (((CURRENT_DAY == 1) && (currentTime >= CLOCK_TIME(2, 30))) && (currentTime < CLOCK_TIME(5, 15))) { - s32 adjustment = (0xC - func_80B43A9C()) * 25.0f; - - func_80B439B0(arg0, currentTime + adjustment); - } -} - -s32 func_80B43B80(EnInvadepoh* this) { - s32 i; - s32 temp = this->endPoint - 1; - - for (i = 0; i < temp; i++) { - if (this->unk37C[i] > this->clockTime) { - break; - } - } - - return i; -} - -void func_80B43BC8(EnInvadepoh* this, s8* arg1, Vec3f* arg2) { - s32 temp_s5 = this->endPoint; - f32 pathTotalDistInv = 1.0f / this->pathTotalDist; - Vec3s* phi_s0 = &this->pathPoints[1]; - Vec3s* phi_s1 = &this->pathPoints[0]; - f32 new_var; - Vec3f sp70; - s32 phi_s2; - f32 temp_f0; - f32 temp_f12; - f32 temp_f14; - f32 temp_f6; - f32 phi_f20 = 0.0f; - f32 phi_f24 = 0.0f; - - for (phi_s2 = 0; phi_s2 < temp_s5; phi_s2++) { - sp70.x = phi_s0->x - phi_s1->x; - sp70.y = phi_s0->y - phi_s1->y; - sp70.z = phi_s0->z - phi_s1->z; - new_var = Math3D_Vec3fMagnitude(&sp70); - temp_f14 = phi_f20 + new_var; - temp_f12 = temp_f14 * pathTotalDistInv; - - if (this->clockTime <= temp_f12) { - temp_f6 = temp_f12 - phi_f24; - *arg1 = phi_s2; - temp_f0 = (this->clockTime - phi_f24) / temp_f6; - arg2->x = (temp_f0 * sp70.x) + phi_s1->x; - arg2->y = (temp_f0 * sp70.y) + phi_s1->y; - arg2->z = (temp_f0 * sp70.z) + phi_s1->z; - return; - } - - phi_s1 = phi_s0; - phi_s0++; - phi_f20 = temp_f14; - phi_f24 = temp_f12; - } - - *arg1 = temp_s5; - arg2->x = this->pathPoints[temp_s5].x; - arg2->y = this->pathPoints[temp_s5].y; - arg2->z = this->pathPoints[temp_s5].z; -} - -void func_80B43DD4(EnInvadepoh* this, s16 arg1, s16 arg2) { - s32 pad; - Vec3s* arr = &this->pathPoints[this->pathIndex]; - s32 pad2; - Vec3f sp30; - Vec3f sp24; - - if (this->pathIndex != this->endPoint) { - Math_Vec3s_ToVec3f(&sp30, &arr[0]); - Math_Vec3s_ToVec3f(&sp24, &arr[1]); - Math_ScaledStepToS(&this->actor.shape.rot.y, Math_Vec3f_Yaw(&sp30, &sp24) + arg2, arg1); - } -} - -void func_80B43E6C(EnInvadepoh* this, s16 arg1, s16 arg2, s16 arg3) { - s32 pad; - Vec3s* arr = &this->pathPoints[this->pathIndex]; - s32 pad2; - Vec3f sp38; - Vec3f sp2C; - - if (this->pathIndex != this->endPoint) { - Math_Vec3s_ToVec3f(&sp38, &arr[0]); - Math_Vec3s_ToVec3f(&sp2C, &arr[1]); - Math_SmoothStepToS(&this->actor.shape.rot.y, Math_Vec3f_Yaw(&sp38, &sp2C), arg1, arg2, arg3); - } -} - -void func_80B43F0C(EnInvadepoh* this) { - s32 pad; - Vec3s* arr = &this->pathPoints[this->pathIndex]; - s32 pad2; - Vec3f sp28; - Vec3f sp1C; - - Math_Vec3s_ToVec3f(&sp28, &arr[0]); - Math_Vec3s_ToVec3f(&sp1C, &arr[1]); - this->actor.shape.rot.y = Math_Vec3f_Yaw(&sp28, &sp1C); -} - -f32 EnInvadepoh_GetTotalPathLength(EnInvadepoh* this) { - f32 distance; - s32 pad; - Vec3f sp54; - Vec3f pathPointF; - Vec3s* pathPoint; - f32 totalDistance; - s32 i; - s32 temp_s4; - - temp_s4 = this->endPoint + 1; - pathPoint = this->pathPoints; - totalDistance = 0.0f; - Math_Vec3s_ToVec3f(&pathPointF, pathPoint); - pathPoint++; - for (i = 1; i < temp_s4; i++) { - Math_Vec3f_Copy(&sp54, &pathPointF); - Math_Vec3s_ToVec3f(&pathPointF, pathPoint); - distance = Math3D_Distance(&sp54, &pathPointF); - pathPoint++; - totalDistance += distance; - } - - return totalDistance; -} - -void func_80B44024(EnInvadepoh* this, PlayState* play) { - Path* path = &play->setupPathList[(this->actor.params >> 8) & 0x7F]; - - this->endPoint = path->count - 1; - this->pathPoints = Lib_SegmentedToVirtual(path->points); -} - -void EnInvadepoh_SetPathPointToWorldPos(EnInvadepoh* this, s32 pathIndex) { - Math_Vec3s_ToVec3f(&this->actor.world.pos, &this->pathPoints[pathIndex]); -} - -s32 func_80B440B8(EnInvadepoh* this, f32 arg1, f32 arg2) { - Vec3s* temp_a3 = &this->pathPoints[this->pathIndex + 1]; - Vec3s* sp48 = &this->pathPoints[this->pathIndex]; - f32 new_var; - f32 sp40; - f32 sp3C; - f32 sp38; - f32 sp34; - f32 sp30; - f32 sp2C; - f32 temp_f12_2; - s32 pad1; - s32 pad2; - s16 sp1E; - - if (this->pathIndex >= this->endPoint) { - return false; - } - - sp40 = temp_a3->x - sp48->x; - sp3C = temp_a3->z - sp48->z; - sp1E = Math_Atan2S_XY(sp3C, sp40); - sp38 = Math_CosS(sp1E); - sp34 = Math_SinS(sp1E); - sp30 = this->actor.world.pos.x - sp48->x; - sp2C = this->actor.world.pos.z - sp48->z; - - if ((arg1 - arg2) < fabsf((sp30 * sp38) - (sp2C * sp34))) { - return false; - } - - temp_f12_2 = (sp2C * sp38) + (sp30 * sp34); - new_var = Math3D_XZLength(sp40, sp3C); - - if ((temp_f12_2 < 0.0f) || (new_var < temp_f12_2)) { - return false; - } - - return true; -} - -s32 func_80B44234(EnInvadepoh* this, Vec3f* vec) { - f32 distance; - s8 temp_s3 = this->endPoint; - f32 min = FLT_MAX; - Vec3f sp48; - s32 i; - s32 ret = 0; - Vec3s* arr; - - for (i = 0, arr = this->pathPoints; i < temp_s3; i++, arr++) { - Math_Vec3s_ToVec3f(&sp48, arr); - distance = Math3D_Vec3fDistSq(&sp48, vec); - if (distance < min) { - min = distance; - ret = i; - } - } - - return ret; -} - -void func_80B442E4(EnInvadepoh* this) { - s32 temp_v1_2 = ((void)0, (s32)gSaveContext.save.time) - func_80B43A24(this->actor.params & 7); - - if (D_80B4E940 == 1) { - this->clockTime = 0.0f; - } else if (D_80B4E940 == 2) { - if (temp_v1_2 < 0) { - this->clockTime = 0.0f; - } else { - this->clockTime = temp_v1_2 * 0.00027777779f; - if (this->clockTime > 1.0f) { - this->clockTime = 1.0f; - } - } - } - - this->pathIndex = func_80B43B80(this); -} - -void func_80B443A0(EnInvadepoh* this) { - f32 pathTotalDistInv; - s8 temp_s5; - Vec3s* phi_s1; - Vec3f sp70; - Vec3f sp64; - f32* phi_s0; - f32 phi_f20; - s32 i; - - temp_s5 = this->endPoint; - pathTotalDistInv = 1.0f / this->pathTotalDist; - phi_f20 = 0.0f; - phi_s1 = this->pathPoints; - Math_Vec3s_ToVec3f(&sp64, phi_s1); - phi_s1++; - phi_s0 = this->unk37C; - - for (i = 1; i < temp_s5; i++, phi_s1++, phi_s0++) { - Math_Vec3f_Copy(&sp70, &sp64); - Math_Vec3s_ToVec3f(&sp64, phi_s1); - phi_f20 += Math3D_Distance(&sp70, &sp64); - *phi_s0 = phi_f20 * pathTotalDistInv; - if (*phi_s0 < 0.0f) { - *phi_s0 = 0.0f; - } else if (*phi_s0 > 1.0f) { - *phi_s0 = 1.0f; - } - } -} - -void func_80B444BC(EnInvadepoh* this, PlayState* play) { - func_80B44024(this, play); - this->pathTotalDist = EnInvadepoh_GetTotalPathLength(this); - func_80B443A0(this); -} - -void func_80B444F4(EnInvadepoh* this, PlayState* play) { - func_80B44024(this, play); -} - -void func_80B44514(EnInvadepoh* this) { - this->pathIndex++; - if (this->pathIndex >= this->endPoint) { - this->pathIndex = 0; - } -} - -void func_80B44540(EnInvadepoh* this, PlayState* play) { - func_80B44024(this, play); - this->pathTotalDist = EnInvadepoh_GetTotalPathLength(this); -} - -void func_80B44570(EnInvadepoh* this) { - s32 currentTime = gSaveContext.save.time; - - if ((currentTime < CLOCK_TIME(2, 0)) || (currentTime >= CLOCK_TIME(6, 0))) { - this->clockTime = 0.0f; - } else if ((currentTime >= CLOCK_TIME(2, 15)) && (currentTime < CLOCK_TIME(6, 0))) { - this->clockTime = 1.0f; - } else { - f32 new_var = (currentTime - 0x1555) * 0.0014641288f; - - this->clockTime = new_var; - this->clockTime = CLAMP(this->clockTime, 0.0f, 1.0f); - } -} - -void func_80B44620(EnInvadepoh* this, PlayState* play) { - func_80B44024(this, play); -} - -void func_80B44640(EnInvadepoh* this) { - if (this->pathIndex < this->endPoint) { - this->pathIndex++; - } -} - -void func_80B44664(EnInvadepoh* this, PlayState* play) { - func_80B44024(this, play); - this->direction = DIRECTION_FORWARD; -} - -void func_80B44690(EnInvadepoh* this) { - this->pathIndex += this->direction; - if (this->pathIndex >= this->endPoint) { - this->pathIndex = 0; - } else if (this->pathIndex < 0) { - this->pathIndex = this->endPoint - 1; - } -} - -void func_80B446D0(EnInvadepoh* this, PlayState* play) { - func_80B44024(this, play); - this->pathTotalDist = EnInvadepoh_GetTotalPathLength(this); -} - -void func_80B44700(EnInvadepoh* this) { - s32 currentTime = gSaveContext.save.time; - s32 new_var4 = 0xFFFF2AAB; - - if ((currentTime < CLOCK_TIME(20, 0)) && (currentTime >= CLOCK_TIME(6, 0))) { - this->clockTime = 0.0f; - } else if ((currentTime > 0xD7E0) || (currentTime < CLOCK_TIME(6, 0))) { - this->clockTime = 1.0f; - } else { - f32 new_var = 0.00153374229558f; - - this->clockTime = (currentTime + new_var4) * new_var; - this->clockTime = CLAMP(this->clockTime, 0.0f, 1.0f); - } -} - -void func_80B447C0(EnInvadepoh* this, PlayState* play) { - s32 pad1; - Vec3s* sp60; - s32 pad2; - Vec3f sp50; - Vec3f sp44; - f32 sp40 = this->actor.world.pos.y; - f32 sp3C; - s32 pad3; - f32 sp34; - f32 sp30; - f32 sp2C; - f32 phi_f2; - - sp60 = &this->pathPoints[this->pathIndex]; - if (this->pathIndex <= 0) { - sp3C = 0.0f; - } else { - sp3C = this->unk37C[this->pathIndex - 1]; - } - - if (this->pathIndex < (this->endPoint - 1)) { - phi_f2 = this->unk37C[this->pathIndex]; - } else { - phi_f2 = 1.0f; - } - - if ((phi_f2 - sp3C) < 0.001f) { - Math_Vec3s_ToVec3f(&this->curPathPos, sp60); - } else { - sp34 = this->clockTime - sp3C; - sp30 = phi_f2 - this->clockTime; - sp2C = 1.0f / (phi_f2 - sp3C); - Math_Vec3s_ToVec3f(&sp50, &sp60[0]); - Math_Vec3s_ToVec3f(&sp44, &sp60[1]); - this->curPathPos.x = ((sp50.x * sp30) + (sp44.x * sp34)) * sp2C; - this->curPathPos.y = ((sp50.y * sp30) + (sp44.y * sp34)) * sp2C; - this->curPathPos.z = ((sp50.z * sp30) + (sp44.z * sp34)) * sp2C; - } - - Math_Vec3f_Copy(&this->actor.world.pos, &this->curPathPos); - func_800B4AEC(play, &this->actor, 0.0f); - if (this->actor.floorHeight > BGCHECK_Y_MIN + 1) { - if (sp40 < this->actor.floorHeight) { - if (this->actor.velocity.y < 0.0f) { - this->actor.velocity.y = 0.0f; - } else { - this->actor.velocity.y += 2.0f; - this->actor.velocity.y = CLAMP_MAX(this->actor.velocity.y, 30.0f); - } - this->actor.world.pos.y = this->actor.velocity.y + sp40; - if (this->actor.world.pos.y > this->actor.floorHeight) { - this->actor.world.pos.y = this->actor.floorHeight; - } - } else { - if (this->actor.velocity.y > 0.0f) { - this->actor.velocity.y = 0.0f; - } else { - this->actor.velocity.y -= 2.0f; - } - - this->actor.world.pos.y = this->actor.velocity.y + sp40; - if (this->actor.world.pos.y < this->actor.floorHeight) { - this->actor.world.pos.y = this->actor.floorHeight; - this->actor.velocity.y = CLAMP_MIN(this->actor.velocity.y, -30.0f); - } - } - } else { - this->actor.world.pos.y = sp40; - } -} - -void func_80B44A90(EnInvadepoh* this, PlayState* play) { - if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { - this->actor.velocity.y *= 0.3f; - this->actor.speed *= 0.8f; - } else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { - this->actor.velocity.y *= 0.8f; - this->actor.speed *= 0.3f; - } else { - this->actor.velocity.y *= 0.8f; - this->actor.speed *= 0.8f; - } - Actor_MoveWithGravity(&this->actor); - Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 40.0f, 0.0f, 5); -} - -void func_80B44B78(EnInvadepoh* this) { -} - -s32 func_80B44B84(EnInvadepoh* this, PlayState* play, f32 speed, f32 arg3) { - s32 pad; - Vec3s* pathPoint = &this->pathPoints[this->pathIndex + 1]; - s32 retVal = func_80B450C0(&this->actor.world.pos.x, &this->actor.world.pos.z, pathPoint->x, pathPoint->z, speed); - - func_800B4AEC(play, &this->actor, arg3); - func_80B4516C(this); - return retVal; -} - -void func_80B44C24(EnInvadepoh* this, PlayState* play) { - s32 pad; - f32 worldPosY = this->actor.world.pos.y; - - func_80B43BC8(this, &this->pathIndex, &this->actor.world.pos); - this->actor.world.pos.y = worldPosY; - func_800B4AEC(play, &this->actor, 50.0f); - func_80B4516C(this); -} - -s32 func_80B44C80(EnInvadepoh* this, PlayState* play) { - s32 pad[6]; - Vec3s* temp_a2 = &this->pathPoints[this->pathIndex]; - f32 temp_f0; - Vec3f sp6C; - Vec3f sp60; - f32 temp_f0_2; - Vec3s* temp_v0_2; - f32 temp_f0_3; - f32 temp_f12; - f32 temp_f2; - f32 temp_f14; - f32 sp44; - s32 sp40 = 0; - s32 temp_v1 = this->pathIndex + this->direction; - s32 phi_v0; - - if (temp_v1 >= this->endPoint) { - temp_v1 = 0; - } else if (temp_v1 < 0) { - temp_v1 = this->endPoint - 1; - } - - temp_v0_2 = &this->pathPoints[temp_v1]; - - temp_f0 = temp_a2->x; - temp_f2 = temp_a2->z; - temp_f12 = temp_v0_2->x; - temp_f14 = temp_v0_2->z; - sp6C.x = temp_f12 - temp_f0; - sp6C.y = 0.0f; - sp6C.z = temp_f14 - temp_f2; - sp60.x = temp_f12 - this->actor.world.pos.x; - sp60.y = 0.0f; - sp60.z = temp_f14 - this->actor.world.pos.z; - temp_f0_3 = temp_f0 - this->actor.world.pos.x; - temp_f0_2 = temp_f2 - this->actor.world.pos.z; - - if (this->actor.speed > 0.0f) { - if (Math3D_AngleBetweenVectors(&sp6C, &sp60, &sp44) != 0) { - sp40 = 1; - } else if (sp44 <= 0.0f) { - sp40 = 1; - } - } - - Math_SmoothStepToS(&this->actor.world.rot.y, - Math_Atan2S_XY(((sp60.z + temp_f0_2) * 0.9f) + sp6C.z, ((sp60.x + temp_f0_3) * 0.9f) + sp6C.x), - 4, 0xFA0, 0x64); - Actor_MoveWithGravity(&this->actor); - if (func_80B440B8(this, 50.0f, 15.0f)) { - phi_v0 = 4; - } else { - phi_v0 = 5; - } - - Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 15.0f, 0.0f, phi_v0); - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.world.rot.y, 3, 0x1F40, 0x64); - return sp40; -} - -void func_80B44E90(EnInvadepoh* this, PlayState* play) { - Actor_MoveWithGravity(&this->actor); - Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 15.0f, 0.0f, 5); - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.world.rot.y, 3, 0x1F40, 0x64); -} - -void func_80B44EFC(EnInvadepoh* this, PlayState* play) { - s32 pad; - f32 worldPosY = this->actor.world.pos.y; - - func_80B43BC8(this, &this->pathIndex, &this->actor.world.pos); - this->actor.world.pos.y = worldPosY; - func_800B4AEC(play, &this->actor, 50.0f); - func_80B4516C(this); -} - -void func_80B44F58(void) { - s32 i; - TexturePtr* iter; - - if (!D_80B4E968) { - D_80B4E968 = true; - for (i = 0, iter = sRomaniEyeTextures; i < ARRAY_COUNT(sRomaniEyeTextures); i++, iter++) { - *iter = Lib_SegmentedToVirtual(*iter); - } - - for (i = 0, iter = sRomaniMouthTextures; i < ARRAY_COUNT(sRomaniMouthTextures); i++, iter++) { - *iter = Lib_SegmentedToVirtual(*iter); - } - } -} - -void func_80B44FEC(void) { - s32 i; - TexturePtr* iter; - - if (!D_80B4E994) { - D_80B4E994 = true; - for (i = 0, iter = sCremiaEyeTextures; i < ARRAY_COUNT(sCremiaEyeTextures); i++, iter++) { - *iter = Lib_SegmentedToVirtual(*iter); - } - - for (i = 0, iter = sCremiaMouthTextures; i < ARRAY_COUNT(sCremiaMouthTextures); i++, iter++) { - *iter = Lib_SegmentedToVirtual(*iter); - } - } -} - -void func_80B45080(void) { - sAlienEmptyTexAnim = Lib_SegmentedToVirtual(gAlienEmptyTexAnim); - sAlienEyeBeamTexAnim = Lib_SegmentedToVirtual(gAlienEyeBeamTexAnim); -} - -s32 func_80B450C0(f32* x1, f32* z1, f32 x2, f32 z2, f32 speed) { - f32 deltaX = x2 - *x1; - f32 deltaZ = z2 - *z1; - f32 temp_f0 = Math3D_XZLength(deltaX, deltaZ); - - if (speed < temp_f0) { - f32 temp_f2 = speed / temp_f0; - *x1 += (temp_f2 * deltaX); - *z1 += (temp_f2 * deltaZ); - return false; - } else { - *x1 = x2; - *z1 = z2; - return true; - } -} - -s32 func_80B4516C(EnInvadepoh* this) { - if (this->actor.floorHeight > BGCHECK_Y_MIN + 1) { - this->actor.world.pos.y = this->actor.floorHeight; - return true; - } - return false; -} - -void func_80B451A0(EnInvadepoh* this, PlayState* play) { - s32 currentTime; - s32 temp_v0_2; - s32 i; - s32 phi_s1_3; - - if (D_80B4E940 == 0) { - if (CURRENT_DAY <= 0) { - D_80B4E940 = 1; - } else if (CURRENT_DAY == 1) { - currentTime = gSaveContext.save.time; - if ((currentTime < CLOCK_TIME(2, 30)) || (currentTime >= CLOCK_TIME(6, 0))) { - D_80B4E940 = 1; - } else if (currentTime < CLOCK_TIME(5, 15)) { - phi_s1_3 = CLOCK_TIME(5, 15); - for (i = 0; i < this->unk379; i++) { - temp_v0_2 = func_80B43A24(i); - if (temp_v0_2 < phi_s1_3) { - phi_s1_3 = temp_v0_2; - } - } - - if (currentTime < (phi_s1_3 + 0xE11)) { - D_80B4E940 = 2; - } - - if (i) {} // required - } - } - - if (D_80B4E940 == 0) { - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { - D_80B4E940 = 3; - } else { - D_80B4E940 = 4; - } - } - } -} - -void func_80B452EC(EnInvadepoh* this, PlayState* play) { - s32 phi_s2 = (this->actor.params >> 8) & 0x7F; - s32 i; - - for (i = 0; i < this->unk379; i++) { - D_80B50320[i] = (EnInvadepoh*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_INVADEPOH, this->actor.world.pos.x, - this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, - (i & 7) | ((phi_s2 << 8) & 0x7F00) | 0x10); - if (phi_s2 != 0xFF) { - Path* path = &play->setupPathList[phi_s2]; - phi_s2 = path->unk1; - } - } -} - -void func_80B453F4(EnInvadepoh* this, PlayState* play, s32 arg2) { - Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_INVADEPOH, this->actor.home.pos.x, - this->actor.home.pos.y, this->actor.home.pos.z, 0, 0, 0, (arg2 & 7) | 0x20); -} - -void func_80B45460(EnInvadepoh* this, PlayState* play) { - Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_INVADEPOH, this->actor.home.pos.x, - this->actor.home.pos.y, this->actor.home.pos.z, 0, 0, 0, 0x40); -} - -void func_80B454BC(EnInvadepoh* this, PlayState* play) { - D_80B503F0 = (EnInvadepoh*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_INVADEPOH, this->actor.world.pos.x, - this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0x60); -} - -void EnInvadepoh_SetSysMatrix(Vec3f* vec) { - MtxF* sysMatrix = Matrix_GetCurrent(); - - sysMatrix->xw = vec->x; - sysMatrix->yw = vec->y; - sysMatrix->zw = vec->z; -} - -s32 func_80B45550(EnInvadepoh* this, PlayState* play, f32 range, s32 arg3) { - s32 pad; - Actor* actorIterator = play->actorCtx.actorLists[ACTORCAT_DOOR].first; - s32 retVal = false; - - while (actorIterator != NULL) { - if ((actorIterator->id == ACTOR_EN_DOOR) && (actorIterator->update != NULL) && - (actorIterator->room == this->actor.room) && - Math3D_Vec3fDistSq(&actorIterator->world.pos, &this->actor.world.pos) < range) { - ((EnDoor*)actorIterator)->unk_1A7 = arg3; - retVal = true; - break; - } - actorIterator = actorIterator->next; - } - return retVal; -} - -void EnInvadepoh_SetTextID(EnInvadepoh* this, PlayState* play, u16 arg2) { - this->textId = arg2; - Message_StartTextbox(play, arg2, &this->actor); -} - -void func_80B45648(EnInvadepoh* this) { - s32 i; - s16 cs = this->actor.cutscene; - - for (i = 0; i < 3; i++) { - D_80B50404[i] = cs; - cs = ActorCutscene_GetAdditionalCutscene(cs); - } -} - -s32 func_80B456A8(PlayState* play, Vec3f* worldPos) { - Vec3f projectedPos; - f32 invW; - - Actor_GetProjectedPos(play, worldPos, &projectedPos, &invW); - if (((projectedPos.z > 1.0f) && (fabsf(projectedPos.x * invW) < 1.0f)) && (fabsf(projectedPos.y * invW) < 1.0f)) { - s32 screenPosX = PROJECTED_TO_SCREEN_X(projectedPos, invW); - s32 screenPosY = PROJECTED_TO_SCREEN_Y(projectedPos, invW); - s32 wZ = (s32)(projectedPos.z * invW * 16352.0f) + 16352; - s32 zBuf = func_80178A94(screenPosX, screenPosY); - if (wZ < zBuf) { - return true; - } - } - - return false; -} - -void func_80B457A0(EnInvadepoh* this) { - f32 distanceSquared; - f32 phi_f20 = FLT_MAX; - s32 i; - s32 phi_s5 = -1; - - for (i = 0; i < this->unk379; i++) { - if ((D_80B50320[i] != NULL) && D_80B50320[i]->drawAlien) { - distanceSquared = Math3D_Vec3fDistSq(&D_80B50320[i]->actor.world.pos, &this->actor.world.pos); - if (distanceSquared < phi_f20) { - phi_f20 = distanceSquared; - phi_s5 = i; - } - } - D_80B50340[i] &= ~2; - } - - D_80B50348 = 0; - if (phi_f20 <= SQ(2000.0f)) { - D_80B50340[phi_s5] |= 2; - if (phi_f20 <= SQ(340.0f)) { - D_80B50348 = 1; - } - } -} - -EnInvadepoh* func_80B458D8(void) { - s32 i; - - for (i = 0; i < 8; i++) { - if (D_80B50340[i] & 2) { - return D_80B50320[i]; - } - } - - return NULL; -} - -s8 func_80B45980(unkstructInvadepoh1* arg0, s32 arg1) { - f32 rand = Rand_ZeroOne(); - s32 i; - unkstructInvadepoh1* ptr = arg0; - - arg1--; - for (i = 0; i < arg1; i++, ptr++) { - if (ptr->unk04 >= rand) { - break; - } - } - - return (arg0 + i)->unk00; -} - -void func_80B459E8(EnInvadePohStruct* s, unkstructInvadepoh4* u) { - s->unk4 = u->unk00; - s->unk8 = u; - s->unkE = 0; - s->unkF = *u->unk04->unk00; - if (s->unk4 == 2) { - s->unkC = Rand_S16Offset(u->unk10, u->unk12); - } -} - -void func_80B45A4C(EnInvadePohStruct* s, unkstructInvadepoh4** u) { - unkstructInvadepoh4* new_var = s->unk8; - unkstructInvadepoh0* temp_v1 = new_var->unk04; - - if (s->unkE < (temp_v1->unk04 - 1)) { - s->unkE++; - s->unkF = temp_v1->unk00[s->unkE]; - } -} - -void func_80B45A94(EnInvadePohStruct* s, unkstructInvadepoh4** u) { - unkstructInvadepoh0* temp_v1 = s->unk8->unk04; - unkstructInvadepoh1* temp_a0; - - if (s->unkE < (temp_v1->unk04 - 1)) { - s->unkE++; - s->unkF = temp_v1->unk00[s->unkE]; - } else { - func_80B459E8(s, u[func_80B45980(s->unk8->unk0C, s->unk8->unk08)]); - } -} - -void func_80B45B1C(EnInvadePohStruct* s, unkstructInvadepoh4** u) { - unkstructInvadepoh0* temp_v1 = s->unk8->unk04; - unkstructInvadepoh1* temp_a0; - - if (s->unkE < (temp_v1->unk04 - 1)) { - s->unkE++; - s->unkF = temp_v1->unk00[s->unkE]; - } else if (s->unkC > 0) { - s->unkC--; - } else { - func_80B459E8(s, u[func_80B45980(s->unk8->unk0C, s->unk8->unk08)]); - } -} - -void func_80B45BB8(EnInvadePohStruct* s) { - if ((s->unk0 != 0) && (s->unk8 != 0)) { - D_80B4EC0C[s->unk4](s, (unkstructInvadepoh4**)s->unk0); - } -} - -void func_80B45C04(AlienBehaviorInfo* substruct, void* arg1[], s32 arg2, void* arg3[], s32 arg4, Vec3s* arg5, s16 arg6, - f32 arg7, f32 arg8, f32 arg9) { - unkstructInvadepoh4* temp_v0; - - Math_Vec3s_Copy(&substruct->unk26, arg5); - substruct->unk2C = arg6; - substruct->unk30 = arg7; - substruct->unk38 = arg8; - substruct->unk3C = arg9; - if (arg1 != NULL) { - temp_v0 = arg1[arg2]; - substruct->unk0.unk0 = (unkstructInvadepoh4*)arg1; - substruct->unk0.unk4 = temp_v0->unk00; - substruct->unk0.unkC = 0; - substruct->unk0.unkE = 0; - substruct->unk0.unk8 = temp_v0; - substruct->unk0.unkF = *temp_v0->unk04->unk00; - } - if (arg3 != NULL) { - temp_v0 = arg3[arg4]; - substruct->unk10.unk0 = (unkstructInvadepoh4*)arg3; - substruct->unk10.unk4 = temp_v0->unk00; - substruct->unk10.unkC = 0; - substruct->unk10.unkE = 0; - substruct->unk10.unk8 = temp_v0; - substruct->unk10.unkF = *temp_v0->unk04->unk00; - } -} - -void func_80B45CE0(AlienBehaviorInfo* substruct) { - Vec3f sp3C; - Vec3s sp34; - s16 step; - - sp34.x = substruct->unk26.x - substruct->unk20.x; - sp34.y = substruct->unk26.y - substruct->unk20.y; - sp34.z = substruct->unk26.z - substruct->unk20.z; - Math_Vec3s_ToVec3f(&sp3C, &sp34); - Math_Vec3f_Scale(&sp3C, substruct->unk30); - Math_Vec3f_ToVec3s(&sp34, &sp3C); - sp34.x = ABS(sp34.x); - sp34.y = ABS(sp34.y); - sp34.z = ABS(sp34.z); - sp34.x = CLAMP_MAX(sp34.x, substruct->unk2C); - sp34.y = CLAMP_MAX(sp34.y, substruct->unk2C); - sp34.z = CLAMP_MAX(sp34.z, substruct->unk2C); - Math_ScaledStepToS(&substruct->unk20.x, substruct->unk26.x, sp34.x); - Math_ScaledStepToS(&substruct->unk20.y, substruct->unk26.y, sp34.y); - Math_ScaledStepToS(&substruct->unk20.z, substruct->unk26.z, sp34.z); - Math_StepToF(&substruct->unk34, substruct->unk38, substruct->unk3C); - - if (substruct->unk40 != substruct->unk42) { - step = substruct->unk42 - substruct->unk40; - step *= substruct->unk44; - step = ABS(step); - step = CLAMP(step, 100, substruct->unk48); - Math_ScaledStepToS(&substruct->unk40, substruct->unk42, step); - } - func_80B45BB8(&substruct->unk0); - func_80B45BB8(&substruct->unk10); -} - -void func_80B45EC8(EnInvadepoh* this, PlayState* play, s32 arg2) { - s16 phi_s0 = 0; - Vec3f spA8; - Vec3f sp9C; - Vec3f sp90; - f32 temp_f20; - s32 i; - - for (i = 0; i < arg2; i++) { - phi_s0 += (s16)(65536.0f / arg2); - - temp_f20 = (Rand_ZeroOne() * 0.5f) + 0.5f; - spA8.x = Math_SinS(phi_s0) * temp_f20; - spA8.z = Math_CosS(phi_s0) * temp_f20; - - sp9C.x = ((Rand_ZeroOne() * 16.0f) + (spA8.x * 30.0f)) - 8.0f; - sp9C.y = -8.0f; - sp9C.z = ((Rand_ZeroOne() * 16.0f) + (spA8.z * 30.0f)) - 8.0f; - - sp90.x = sp9C.x * -0.025f; - sp90.y = sp9C.y * -0.025f; - sp90.z = sp9C.z * -0.025f; - - spA8.x = (spA8.x * 100.0f) + this->actor.world.pos.x; - spA8.y = ((Rand_ZeroOne() * 180.0f) + this->actor.world.pos.y) - 90.0f; - spA8.z = (spA8.z * 100.0f) + this->actor.world.pos.z; - - EffectSsKirakira_SpawnDispersed(play, &spA8, &sp9C, &sp90, &D_80B4EC18, &D_80B4EC1C, 6000, -40); - } -} - -s32 func_80B46118(Vec3f* actorPos) { - unkStruct80B50350* phi_v1; - s32 i; - - for (phi_v1 = D_80B50350, i = 0; i < 10; phi_v1++, i++) { - if (phi_v1->unk1 <= 0) { - phi_v1->unk0 = 0; - phi_v1->unk1 = 40; - Math_Vec3f_Copy(&phi_v1->unk4, actorPos); - phi_v1->unk2 = 0; - return true; - } - } - return false; -} - -void func_80B46184(unkStruct80B50350* unkStruct) { - if (unkStruct->unk1 > 20) { - if (unkStruct->unk2 < 125) { - unkStruct->unk2 += 10; - } else { - unkStruct->unk2 = 135; - } - } else if (unkStruct->unk2 > 13) { - unkStruct->unk2 -= 13; - - } else { - unkStruct->unk2 = 0; - } -} - -s32 func_80B461DC(void) { - s32 phi_s4 = false; - unkStruct80B50350* phi_s0; - s32 i; - - for (phi_s0 = D_80B50350, i = 0; i < 10; phi_s0++, i++) { - if (phi_s0->unk1 > 0) { - D_80B4EC20[phi_s0->unk0](phi_s0); - phi_s0->unk1--; - phi_s4 = true; - } - } - return phi_s4; -} - -void func_80B4627C(EnInvadepoh* this, PlayState* play) { - s32 invadepohType; - s32 i; - - this->actor.flags |= ACTOR_FLAG_20; - invadepohType = (this->actor.params >> 8) & 0x7F; - - for (i = 1; i < 8; i++) { - Path* path = &play->setupPathList[invadepohType]; - invadepohType = path->unk1; - if (invadepohType == 0xFF) { - break; - } - } - - this->unk379 = i; - func_80B451A0(this, play); - func_80B45648(this); - func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_SWITCH); - - if (D_80B4E940 == 1) { - func_80B46DA8(this); - } else if (D_80B4E940 == 2) { - if (gSaveContext.save.time < CLOCK_TIME(2, 31)) { - func_80B46DA8(this); - } else { - func_80B454BC(this, play); - func_80B452EC(this, play); - SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, NA_BGM_ALIEN_INVASION | SEQ_FLAG_ASYNC); - func_80B46F88(this); - } - } else if (D_80B4E940 == 3) { - if (gSaveContext.save.entrance == ENTRANCE(ROMANI_RANCH, 6)) { - func_80B471C0(this); - - } else if (gSaveContext.save.entrance == ENTRANCE(ROMANI_RANCH, 7)) { - func_80B47248(this); - } else { - func_80B47248(this); - } - } else if (D_80B4E940 == 4) { - func_80B47304(this); - } -} - -void EnInvadepoh_InitAlien(EnInvadepoh* this, PlayState* play) { - s32 pad; - - Actor_ProcessInitChain(&this->actor, D_80B4EC24); - Collider_InitCylinder(play, &this->collider); - ActorShape_Init(&this->actor.shape, 6800.0f, ActorShadow_DrawWhiteCircle, 150.0f); - this->actor.shape.shadowAlpha = 140; - this->actor.flags = (ACTOR_FLAG_10 | ACTOR_FLAG_1000 | ACTOR_FLAG_80000000); - if (INVADEPOH_TYPE(&this->actor) == TYPE_ALIEN_CARRYING_COW) { - this->actor.update = func_80B4D670; - this->actor.world.pos.y = this->actor.home.pos.y + 150.0f; - } else { - this->actor.update = func_80B47BAC; - Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInitAlien); - this->actor.colChkInfo.mass = 40; - } - this->bankIndex = Object_GetIndex(&play->objectCtx, OBJECT_UCH); - if (this->bankIndex < 0) { - Actor_Kill(&this->actor); - } -} - -void EnInvadepoh_InitParentCow(EnInvadepoh* this, PlayState* play) { - Actor_ProcessInitChain(&this->actor, sInitChainParentCow); - this->actor.update = func_80B47FA8; - Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_INVADEPOH, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0x30); - this->bankIndex = Object_GetIndex(&play->objectCtx, OBJECT_COW); - if (this->bankIndex < 0) { - Actor_Kill(&this->actor); - } -} - -void EnInvadepoh_InitChildCow(EnInvadepoh* this, PlayState* play) { - Actor_ProcessInitChain(&this->actor, sInitChainChildCow); - this->actor.update = func_80B481C4; - this->bankIndex = Object_GetIndex(&play->objectCtx, OBJECT_COW); - if (this->bankIndex < 0) { - Actor_Kill(&this->actor); - } -} - -void EnInvadepoh_InitRomani(EnInvadepoh* this, PlayState* play) { - s32 pad; - s32 temp = INVADEPOH_TYPE(&this->actor); - - Actor_ProcessInitChain(&this->actor, sInitChainRomani); - - this->actor.targetMode = (temp == 7 || temp == 0xC) ? 3 : 6; - - func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_NPC); - Collider_InitCylinder(play, &this->collider); - if (temp != 4) { - ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawCircle, 18.0f); - Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInitRomaniAndCremia); - this->actor.colChkInfo.mass = MASS_IMMOVABLE; - } - if (temp == 4) { - this->actor.update = func_80B48620; - } else if (temp == 5) { - this->actor.update = func_80B48FB0; - this->actor.flags = (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10); - } else if (temp == 7) { - this->actor.update = func_80B49F88; - } else if (temp == 8) { - this->actor.update = func_80B4A9C8; - } else if (temp == 9) { - this->actor.update = func_80B4B0C4; - } else { - this->actor.update = func_80B4CE54; - } - - this->bankIndex = Object_GetIndex(&play->objectCtx, OBJECT_MA1); - if (this->bankIndex < 0) { - Actor_Kill(&this->actor); - } - - if (temp == 5) { - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { - Actor_Kill(&this->actor); - return; - } - } else if (temp == 7) { - if (gSaveContext.save.time < CLOCK_TIME(6, 0) && gSaveContext.save.time >= CLOCK_TIME(2, 15)) { - Actor_Kill(&this->actor); - return; - } - } else if (temp != 8) { - if (temp == 9) { - if (gSaveContext.save.entrance != ENTRANCE(ROMANI_RANCH, 6)) { - Actor_Kill(&this->actor); - return; - } - } else if (temp == 0xC) { - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { - Actor_Kill(&this->actor); - } - D_80B503F4 = this; - } - } -} - -void func_80B468B4(EnInvadepoh* this, PlayState* play) { - Actor_ProcessInitChain(&this->actor, D_80B4EC68); - this->actor.update = func_80B49B1C; - this->actor.draw = func_80B4E3F0; - func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_NPC); - if (D_80B4E940 == 1 || gSaveContext.save.time < CLOCK_TIME(2, 31)) { - this->actor.world.pos.x += D_80B4E934.x; - this->actor.world.pos.y += D_80B4E934.y + 3000.0f; - this->actor.world.pos.z += D_80B4E934.z; - func_80B491EC(this); - } else if (D_80B4E940 == 2) { - this->actor.world.pos.y += 1500.0f; - func_80B49628(this); - } else { - Actor_Kill(&this->actor); - } -} - -void EnInvadepoh_InitDog(EnInvadepoh* this, PlayState* play) { - s32 pad; - - Actor_ProcessInitChain(&this->actor, sInitChainDog); - this->actor.update = func_80B4B8BC; - Collider_InitCylinder(play, &this->collider); - Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInitDog); - this->actor.colChkInfo.mass = 80; - ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawCircle, 24.0f); - this->bankIndex = Object_GetIndex(&play->objectCtx, OBJECT_DOG); - if (this->bankIndex < 0) { - Actor_Kill(&this->actor); - } -} - -void EnInvadepoh_InitCremia(EnInvadepoh* this, PlayState* play) { - s32 pad; - - Actor_ProcessInitChain(&this->actor, sInitChainCremia); - this->actor.update = func_80B4C3A0; - func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_NPC); - Collider_InitCylinder(play, &this->collider); - Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInitRomaniAndCremia); - this->actor.colChkInfo.mass = MASS_HEAVY; - ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawCircle, 18.0f); - this->bankIndex = Object_GetIndex(&play->objectCtx, OBJECT_MA2); - if (this->bankIndex < 0) { - Actor_Kill(&this->actor); - } - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { - Actor_Kill(&this->actor); - } - D_80B503F8 = this; -} - -void EnInvadepoh_Init(Actor* thisx, PlayState* play) { - EnInvadepoh* this = THIS; - - D_80B4ECB0[INVADEPOH_TYPE(&this->actor)](this, play); -} - -void func_80B46BB0(EnInvadepoh* this, PlayState* play) { -} - -void func_80B46BC0(EnInvadepoh* this, PlayState* play) { - s32 pad; - s32 invadepohType = this->actor.params & 7; - - Collider_DestroyCylinder(play, &this->collider); - D_80B50320[invadepohType] = 0; -} - -void func_80B46C08(EnInvadepoh* this, PlayState* play) { - if (this->actor.parent != NULL) { - this->actor.parent->child = NULL; - } - - if (this->actor.child != NULL) { - this->actor.child->parent = NULL; - } -} - -void func_80B46C34(EnInvadepoh* this, PlayState* play) { - if (this->actor.parent != NULL) { - this->actor.parent->child = NULL; - } -} - -void func_80B46C50(EnInvadepoh* this, PlayState* play) { - Collider_DestroyCylinder(play, &this->collider); -} - -void func_80B46C7C(EnInvadepoh* this, PlayState* play) { - D_80B503F0 = NULL; -} - -void func_80B46C94(EnInvadepoh* this, PlayState* play) { - Collider_DestroyCylinder(play, &this->collider); -} - -void func_80B46CC0(EnInvadepoh* this, PlayState* play) { - Collider_DestroyCylinder(play, &this->collider); - D_80B503F8 = NULL; -} - -void func_80B46CF4(EnInvadepoh* this, PlayState* play) { - Collider_DestroyCylinder(play, &this->collider); - D_80B503F4 = NULL; -} - -void func_80B46D28(EnInvadepoh* this, PlayState* play) { - Collider_DestroyCylinder(play, &this->collider); - if (!this) {} // required to match - if (this->actor.child != NULL) { - this->actor.child->parent = NULL; - } -} - -void EnInvadepoh_Destroy(Actor* thisx, PlayState* play) { - EnInvadepoh* this = THIS; - - D_80B4ECE8[INVADEPOH_TYPE(&this->actor)](this, play); -} - -void func_80B46DA8(EnInvadepoh* this) { - D_80B4E940 = 1; - this->actionFunc = func_80B46DC8; -} - -void func_80B46DC8(EnInvadepoh* this, PlayState* play) { - if ((gSaveContext.save.time < CLOCK_TIME(6, 0)) && (gSaveContext.save.time >= CLOCK_TIME(2, 30))) { - func_80B454BC(this, play); - func_80B452EC(this, play); - func_80B46E20(this); - } -} - -void func_80B46E20(EnInvadepoh* this) { - D_80B4E940 = 2; - this->actionTimer = 2; - this->actionFunc = func_80B46E44; -} - -void func_80B46E44(EnInvadepoh* this, PlayState* play) { - if (this->actionTimer > 0) { - this->actionTimer--; - } else if (ActorCutscene_GetCanPlayNext(D_80B50404[0])) { - ActorCutscene_StartAndSetUnkLinkFields(D_80B50404[0], &this->actor); - func_80B46EC0(this); - } else { - ActorCutscene_SetIntentToPlay(D_80B50404[0]); - } -} - -void func_80B46EC0(EnInvadepoh* this) { - D_80B4E940 = 2; - this->actionTimer = 160; - this->actionFunc = func_80B46EE8; -} - -void func_80B46EE8(EnInvadepoh* this, PlayState* play) { - s32 i; - - for (i = 0; i < 8; i++) { - if (this->actionTimer == D_80B4ED20[i]) { - D_80B50340[i] |= 1; - } - } - - this->actionTimer--; - if (this->actionTimer <= 0) { - ActorCutscene_Stop(D_80B50404[0]); - SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, NA_BGM_ALIEN_INVASION | SEQ_FLAG_ASYNC); - func_80B46F88(this); - } -} - -void func_80B46F88(EnInvadepoh* this) { - D_80B4E940 = 2; - this->actionFunc = func_80B46FA8; -} - -void func_80B46FA8(EnInvadepoh* this, PlayState* play) { - s32 i; - - if ((gSaveContext.save.time < CLOCK_TIME(6, 0)) && (gSaveContext.save.time >= CLOCK_TIME(5, 15))) { - SET_WEEKEVENTREG(WEEKEVENTREG_22_01); - func_80B47064(this); - } else { - func_80B457A0(this); - for (i = 0; i < this->unk379; i++) { - if ((D_80B50320[i] != NULL) && (D_80B50320[i]->unk38A != 0)) { - func_80B47278(this); - break; - } - } - } -} - -void func_80B47064(EnInvadepoh* this) { - D_80B4E940 = 3; - this->actionFunc = func_80B47084; -} - -void func_80B47084(EnInvadepoh* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(D_80B50404[1])) { - ActorCutscene_StartAndSetUnkLinkFields(D_80B50404[1], &this->actor); - func_80B470E0(this); - } else { - ActorCutscene_SetIntentToPlay(D_80B50404[1]); - } -} - -void func_80B470E0(EnInvadepoh* this) { - D_80B4E940 = 3; - this->actionTimer = 110; - this->actionFunc = func_80B47108; -} - -void func_80B47108(EnInvadepoh* this, PlayState* play) { - if (this->actionTimer == 100) { - Audio_PlayFanfare(NA_BGM_CLEAR_EVENT); - } - this->actionTimer--; - if (this->actionTimer <= 0) { - play->nextEntrance = ENTRANCE(ROMANI_RANCH, 6); - gSaveContext.nextCutsceneIndex = 0; - play->transitionTrigger = TRANS_TRIGGER_START; - play->transitionType = TRANS_TYPE_73; - gSaveContext.nextTransitionType = TRANS_TYPE_72; - D_801BDAA0 = 1; - D_801BDA9C = 0; - func_80B47248(this); - } -} - -void func_80B471C0(EnInvadepoh* this) { - D_80B4E940 = 3; - this->actionFunc = func_80B471E0; -} - -void func_80B471E0(EnInvadepoh* this, PlayState* play) { - if (D_80B4E998) { - play->nextEntrance = ENTRANCE(ROMANI_RANCH, 7); - gSaveContext.nextCutsceneIndex = 0; - play->transitionTrigger = TRANS_TRIGGER_START; - play->transitionType = TRANS_TYPE_72; - gSaveContext.nextTransitionType = TRANS_TYPE_72; - func_80B47248(this); - } -} - -void func_80B47248(EnInvadepoh* this) { - D_80B4E940 = 3; - this->actionFunc = func_80B47268; -} - -void func_80B47268(EnInvadepoh* this, PlayState* play) { -} - -void func_80B47278(EnInvadepoh* this) { - D_80B4E940 = 4; - this->actionFunc = func_80B47298; -} - -void func_80B47298(EnInvadepoh* this, PlayState* play) { - play->nextEntrance = ENTRANCE(ROMANI_RANCH, 0); - gSaveContext.nextCutsceneIndex = 0xFFF3; - play->transitionTrigger = TRANS_TRIGGER_START; - play->transitionType = TRANS_TYPE_72; - gSaveContext.nextTransitionType = TRANS_TYPE_72; - SET_WEEKEVENTREG(WEEKEVENTREG_89_10); - func_80B47304(this); -} - -void func_80B47304(EnInvadepoh* this) { - D_80B4E940 = 4; - this->actionFunc = func_80B47324; -} - -void func_80B47324(EnInvadepoh* this, PlayState* play) { -} - -void EnInvadepoh_Update(Actor* thisx, PlayState* play) { - EnInvadepoh* this = THIS; - - this->actionFunc(this, play); - if (func_80B461DC()) { - this->actor.draw = func_80B4D9B4; - } else { - this->actor.draw = NULL; - } -} - -void func_80B47380(EnInvadepoh* this) { - this->collider.base.atFlags &= ~AT_ON; - this->collider.base.acFlags &= ~AC_ON; - this->collider.base.ocFlags1 &= ~OC1_ON; - this->actor.flags &= ~ACTOR_FLAG_80000000; - this->alienAlpha = 0; - this->actor.draw = NULL; - this->drawAlien = false; - this->drawAlienDeathEffect = false; - this->alienBeamAlpha = 0; - this->actionFunc = func_80B473E4; -} - -void func_80B473E4(EnInvadepoh* this, PlayState* play) { - func_80B442E4(this); - func_80B447C0(this, play); - func_80B43DD4(this, 800, 0); - if (D_80B50340[this->actor.params & 7] & 1) { - Actor_SetScale(&this->actor, 0.01f); - func_80B4516C(this); - func_80B46118(&this->actor.world.pos); - func_80B47568(this); - } -} - -void func_80B47478(EnInvadepoh* this) { - this->collider.base.atFlags &= ~AT_ON; - this->collider.base.acFlags &= ~AC_ON; - this->collider.base.ocFlags1 &= ~OC1_ON; - this->actor.flags &= ~ACTOR_FLAG_80000000; - this->alienAlpha = 0; - this->actor.draw = NULL; - this->drawAlien = false; - this->drawAlienDeathEffect = false; - this->alienBeamAlpha = 0; - this->actionFunc = func_80B474DC; -} - -void func_80B474DC(EnInvadepoh* this, PlayState* play) { - func_80B442E4(this); - func_80B447C0(this, play); - func_80B43DD4(this, 800, 0); - if (this->clockTime > 0.0f) { - Actor_SetScale(&this->actor, 0.01f); - func_80B4516C(this); - func_80B46118(&this->actor.world.pos); - func_80B47568(this); - } -} - -void func_80B47568(EnInvadepoh* this) { - Animation_MorphToLoop(&this->skelAnime, &gAlienFloatAnim, -6.0f); - this->collider.base.atFlags &= ~AT_ON; - this->collider.base.acFlags &= ~AC_ON; - this->collider.base.ocFlags1 &= ~OC1_ON; - this->alienAlpha = 0; - this->actor.draw = func_80B4DB14; - this->drawAlien = true; - this->drawAlienDeathEffect = false; - this->alienBeamAlpha = 0; - this->actor.flags |= ACTOR_FLAG_80000000; - this->actionFunc = func_80B47600; -} - -void func_80B47600(EnInvadepoh* this, PlayState* play) { - func_80B442E4(this); - func_80B447C0(this, play); - func_80B43DD4(this, 800, 0); - func_800B9010(&this->actor, NA_SE_EN_FOLLOWERS_BEAM_PRE - SFX_FLAG); - if (this->clockTime >= 0.9999f) { - this->unk38A = 1; - } - if (this->alienAlpha > 248) { - this->alienAlpha = 255; - } else { - this->alienAlpha += 6; - } - if (this->alienAlpha > 128) { - this->collider.base.atFlags |= AT_ON; - this->collider.base.acFlags |= AC_ON; - this->collider.base.ocFlags1 |= OC1_ON; - } - if (this->alienAlpha == 255) { - if (this->alienBeamAlpha >= 245) { - this->alienBeamAlpha = 255; - func_80B4770C(this); - } else { - this->alienBeamAlpha += 10; - } - } -} - -void func_80B4770C(EnInvadepoh* this) { - if (this->skelAnime.animation != &gAlienFloatAnim) { - Animation_MorphToLoop(&this->skelAnime, &gAlienFloatAnim, -6.0f); - } - this->collider.base.atFlags |= AT_ON; - this->collider.base.acFlags |= AC_ON; - this->collider.base.ocFlags1 |= OC1_ON; - this->alienAlpha = 255; - this->actor.draw = func_80B4DB14; - this->drawAlien = true; - this->drawAlienDeathEffect = false; - this->alienBeamAlpha = 255; - this->actor.flags |= ACTOR_FLAG_80000000; - this->actionFunc = func_80B477B4; -} - -void func_80B477B4(EnInvadepoh* this, PlayState* play) { - func_80B442E4(this); - func_80B447C0(this, play); - func_80B43DD4(this, 800, 0); - func_800B9010(&this->actor, NA_SE_EN_FOLLOWERS_BEAM_PRE - SFX_FLAG); - if (this->clockTime >= 0.9999f) { - this->unk38A = 1; - } -} - -void func_80B47830(EnInvadepoh* this) { - this->collider.base.atFlags &= ~AT_ON; - this->collider.base.acFlags &= ~AC_ON; - this->collider.base.ocFlags1 |= OC1_ON; - Animation_PlayLoop(&this->skelAnime, &gAlienJerkingAnim); - Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 16); - this->alienAlpha = 255; - this->actor.draw = func_80B4DB14; - this->drawAlien = true; - this->drawAlienDeathEffect = false; - this->alienBeamAlpha = 0; - this->actionTimer = 8; - this->counter = 0; - this->actor.flags |= ACTOR_FLAG_80000000; - this->actionFunc = func_80B478F4; -} - -void func_80B478F4(EnInvadepoh* this, PlayState* play) { - func_80B44A90(this, play); - this->actionTimer--; - if (this->actionTimer <= 0) { - func_80B47938(this); - } -} - -void func_80B47938(EnInvadepoh* this) { - this->collider.base.atFlags &= ~AT_ON; - this->collider.base.acFlags &= ~AC_ON; - this->collider.base.ocFlags1 &= ~OC1_ON; - Animation_PlayLoop(&this->skelAnime, &gAlienDeathAnim); - this->actor.flags &= ~ACTOR_FLAG_1; - this->actionTimer = 10; - this->alienAlpha = 255; - this->actor.draw = func_80B4DB14; - this->drawAlien = true; - this->drawAlienDeathEffect = false; - this->alienBeamAlpha = 255; - this->actor.flags |= ACTOR_FLAG_80000000; - this->actionFunc = func_80B479E8; -} - -void func_80B479E8(EnInvadepoh* this, PlayState* play) { - s16 unk2F2; - u32 index; - - func_80B44B78(this); - if (this->counter < 5) { - if (D_80B4ED30[this->counter].x > 0.0f) { - this->drawAlien = true; - this->alienBeamAlpha = 255; - Math_Vec3f_Copy(&this->actor.scale, &D_80B4ED30[this->counter]); - } else { - this->drawAlien = false; - this->alienBeamAlpha = 0; - } - } else { - this->drawAlien = false; - this->alienBeamAlpha = 0; - } - - unk2F2 = this->counter; - if ((unk2F2 >= 2) && (unk2F2 < 9)) { - index = unk2F2 - 2; - if (D_80B4ED6C[index].x > 0.0f) { - this->drawAlienDeathEffect = true; - Math_Vec3f_Copy(&this->alienDeathEffectScale, &D_80B4ED6C[index]); - } else { - this->drawAlienDeathEffect = false; - } - } else { - this->drawAlienDeathEffect = false; - } - - this->counter++; - if (this->actionTimer == 8) { - Actor_Spawn(&play->actorCtx, play, ACTOR_EN_CLEAR_TAG, this->actor.world.pos.x, this->actor.world.pos.y - 10.0f, - this->actor.world.pos.z, 0, 0, 3, CLEAR_TAG_SMOKE); - } - - if (this->actionTimer == 8) { - Enemy_StartFinishingBlow(play, &this->actor); - } - - this->actionTimer--; - if (this->actionTimer <= 0) { - func_80B43AF0(this->actor.params & 7); - func_80B43AB0(); - Item_DropCollectible(play, &this->actor.world.pos, ITEM00_ARROWS_30); - func_80B47478(this); - } -} - -void func_80B47BAC(Actor* thisx, PlayState* play) { - EnInvadepoh* this = THIS; - - if (Object_IsLoaded(&play->objectCtx, this->bankIndex)) { - this->actor.objBankIndex = this->bankIndex; - Actor_SetObjectDependency(play, &this->actor); - func_80B45080(); - this->actor.update = func_80B47D30; - SkelAnime_InitFlex(play, &this->skelAnime, &gAlienSkel, &gAlienFloatAnim, this->jointTable, this->morphTable, - ALIEN_LIMB_MAX); - this->skelAnime.curFrame = (this->actor.params & 7) * this->skelAnime.endFrame * 0.125f; - func_80B444BC(this, play); - func_80B442E4(this); - func_80B447C0(this, play); - func_80B43F0C(this); - func_80B4516C(this); - if (D_80B4E940 == 1 || gSaveContext.save.time < CLOCK_TIME(2, 31)) { - func_80B47380(this); - } else if (D_80B4E940 == 2) { - if (this->clockTime >= 0.0001f) { - func_80B4770C(this); - } else { - func_80B47568(this); - } - } else { - Actor_Kill(&this->actor); - } - } -} - -void func_80B47D30(Actor* thisx, PlayState* play) { - EnInvadepoh* this = THIS; - s32 pad; - - if (D_80B4E940 == 3) { - if ((this->actionFunc == func_80B477B4) || (this->actionFunc == func_80B47600)) { - thisx->speed = 0.0f; - thisx->velocity.y = 0.0f; - thisx->gravity = 0.0f; - func_80B47830(this); - } else if ((this->actionFunc == func_80B474DC) || (this->actionFunc == func_80B473E4)) { - Actor_Kill(&this->actor); - return; - } - } else if (this->collider.base.acFlags & AC_HIT) { - Actor* acAttached = this->collider.base.ac; - - thisx->speed = acAttached->speed * 0.5f; - thisx->speed = CLAMP(thisx->speed, -60.0f, 60.0f); - thisx->world.rot.y = acAttached->world.rot.y; - thisx->gravity = 0.0f; - thisx->velocity.y = acAttached->velocity.y * 0.5f; - thisx->velocity.y = CLAMP(thisx->velocity.y, -30.0f, 30.0f); - SoundSource_PlaySfxAtFixedWorldPos(play, &thisx->world.pos, 50, NA_SE_EN_INVADER_DEAD); - func_80B47830(this); - } - - this->actionFunc(this, play); - if (thisx->draw != NULL) { - this->animPlayFlag = SkelAnime_Update(&this->skelAnime); - } - - Collider_UpdateCylinder(&this->actor, &this->collider); - if (this->collider.base.atFlags & AT_ON) { - CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); - } else { - this->collider.base.atFlags &= ~AT_HIT; - } - - if (this->collider.base.acFlags & AC_ON) { - CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); - } else { - this->collider.base.acFlags &= ~AC_HIT; - } - - if (this->collider.base.ocFlags1 & OC1_ON) { - CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); - } else { - this->collider.base.ocFlags1 &= ~OC1_HIT; - } -} - -void func_80B47FA8(Actor* thisx, PlayState* play) { - EnInvadepoh* this = THIS; - s32 pad; - - if (Object_IsLoaded(&play->objectCtx, this->bankIndex)) { - this->actor.objBankIndex = this->bankIndex; - Actor_SetObjectDependency(play, thisx); - this->actor.update = func_80B48060; - this->actor.draw = func_80B4E158; - SkelAnime_InitFlex(play, &this->skelAnime, &gCowSkel, NULL, this->jointTable, this->morphTable, COW_LIMB_MAX); - Animation_PlayLoop(&this->skelAnime, &gCowMooAnim); - } -} - -void func_80B48060(Actor* thisx, PlayState* play) { - EnInvadepoh* this = THIS; - s32 pad; - s32 temp; - s32 pad2; - MtxF unkMtx; - - if (D_80B503F0 == NULL || this->actor.parent == NULL) { - Actor_Kill(&this->actor); - return; - } - - temp = this->actor.params & 7; - SkelAnime_Update(&this->skelAnime); - Math_ScaledStepToS(&this->actor.shape.rot.x, D_80B4EDC0[temp], 0x32); - if (this->actor.child != NULL) { - Matrix_Push(); - Matrix_SetTranslateRotateYXZ(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, - &this->actor.shape.rot); - Matrix_Translate(0, 57.0f, -36.0f, MTXMODE_APPLY); - Matrix_RotateXS(this->actor.shape.rot.x * -0.7f, MTXMODE_APPLY); - Matrix_RotateZS(this->actor.shape.rot.z * -0.7f, MTXMODE_APPLY); - Matrix_MultZero(&this->actor.child->world.pos); - Matrix_Get(&unkMtx); - Matrix_MtxFToYXZRot(&unkMtx, &this->actor.child->shape.rot, false); - Matrix_Pop(); - } -} - -void func_80B481C4(Actor* thisx, PlayState* play) { - EnInvadepoh* this = THIS; - s32 pad; - - if (Object_IsLoaded(&play->objectCtx, this->bankIndex)) { - this->actor.objBankIndex = this->bankIndex; - Actor_SetObjectDependency(play, &this->actor); - this->actor.update = func_80B4827C; - this->actor.draw = func_80B4E1B0; - SkelAnime_InitFlex(play, &this->skelAnime, &gCowTailSkel, NULL, this->jointTable, this->morphTable, - COW_TAIL_LIMB_MAX); - Animation_PlayLoop(&this->skelAnime, &gCowTailSwishAnim); - } -} - -void func_80B4827C(Actor* thisx, PlayState* play) { - EnInvadepoh* this = THIS; - - if (D_80B503F0 == NULL || this->actor.parent == NULL) { - Actor_Kill(&this->actor); - return; - } - - SkelAnime_Update(&this->skelAnime); -} - -void func_80B482D4(EnInvadepoh* this) { - this->actionTimer = 40; - Animation_MorphToLoop(&this->skelAnime, &gRomaniLookAroundAnim, -10.0f); - this->actor.draw = NULL; - this->actionFunc = func_80B48324; -} - -void func_80B48324(EnInvadepoh* this, PlayState* play) { - this->actionTimer--; - if (this->actionTimer <= 0) { - EnInvadepoh_SetTextID(this, play, 0x332F); - this->actor.draw = func_80B4E324; - func_80B48374(this); - } -} - -void func_80B48374(EnInvadepoh* this) { - this->actionTimer = 60; - Animation_MorphToLoop(&this->skelAnime, &gRomaniLookAroundAnim, -10.0f); - this->actor.draw = func_80B4E324; - this->actionFunc = func_80B483CC; -} - -void func_80B483CC(EnInvadepoh* this, PlayState* play) { - if (this->actionTimer == 20) { - f32 unkFloat = 0.1f; - - this->behaviorInfo.unk26.x = 2000; - this->behaviorInfo.unk26.y = 0; - this->behaviorInfo.unk26.z = 0; - this->behaviorInfo.unk30 = unkFloat; - this->behaviorInfo.unk2C = 1000; - } - - this->actionTimer--; - if (this->actionTimer <= 0) { - func_80B4843C(this); - } -} - -void func_80B4843C(EnInvadepoh* this) { - this->behaviorInfo.unk26.x = 3000; - this->behaviorInfo.unk26.y = 0; - this->behaviorInfo.unk26.z = 0; - this->behaviorInfo.unk30 = 0.24f; - this->behaviorInfo.unk2C = 3000; - this->behaviorInfo.unk42 = 15000; - this->behaviorInfo.unk44 = 0.1f; - this->behaviorInfo.unk48 = 2000; - this->actionTimer = 50; - Animation_Change(&this->skelAnime, &gRomaniRunAnim, 2.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -5.0f); - this->actor.draw = func_80B4E324; - this->actionFunc = func_80B484EC; -} - -void func_80B484EC(EnInvadepoh* this, PlayState* play) { - if (this->actionTimer == 40) { - this->behaviorInfo.unk26.y = 7000; - } else if (this->actionTimer == 30) { - this->behaviorInfo.unk26.y = -7000; - } else if (this->actionTimer == 20) { - this->behaviorInfo.unk26.y = 7000; - } else if (this->actionTimer == 10) { - this->behaviorInfo.unk26.y = 0; - } - this->actionTimer--; - if (this->actionTimer <= 0) { - func_80B48588(this); - } -} - -void func_80B48588(EnInvadepoh* this) { - this->behaviorInfo.unk26.x = 0; - this->behaviorInfo.unk26.y = 0; - this->behaviorInfo.unk26.z = 0; - this->behaviorInfo.unk30 = 0.24f; - this->behaviorInfo.unk2C = 5000; - this->behaviorInfo.unk42 = 0; - this->behaviorInfo.unk44 = 0.28f; - this->behaviorInfo.unk48 = 7000; - Animation_MorphToPlayOnce(&this->skelAnime, &gRomaniIdleAnim, -10.0f); - this->actor.draw = func_80B4E324; - this->actionFunc = func_80B48610; -} - -void func_80B48610(EnInvadepoh* this, PlayState* play) { -} - -void func_80B48620(Actor* thisx, PlayState* play) { - s32 pad[2]; - EnInvadepoh* this = THIS; - - if (Object_IsLoaded(&play->objectCtx, this->bankIndex)) { - this->actor.objBankIndex = this->bankIndex; - Actor_SetObjectDependency(play, &this->actor); - func_80B44F58(); - this->actor.update = func_80B4873C; - SkelAnime_InitFlex(play, &this->skelAnime, &gRomaniSkel, &gRomaniIdleAnim, this->jointTable, this->morphTable, - ROMANI_LIMB_MAX); - func_80B45C04(&this->behaviorInfo, D_80B4EA90, 6, D_80B4EB00, 2, &gZeroVec3s, 5000, 0.05f, 0.3f, 0.12f); - Animation_PlayLoop(&this->skelAnime, &gRomaniIdleAnim); - func_80B482D4(this); - } -} - -void func_80B4873C(Actor* thisx, PlayState* play) { - EnInvadepoh* this = THIS; - s32 pad; - AlienBehaviorInfo* substruct = &this->behaviorInfo; - - if (this->actor.parent == NULL) { - Actor_Kill(&this->actor); - return; - } - this->actionFunc(this, play); - SkelAnime_Update(&this->skelAnime); - func_80B45CE0(substruct); - if (substruct->unk40 != 0) { - this->actor.shape.rot.x = -substruct->unk40; - } -} - -void func_80B487B4(EnInvadepoh* this) { - AlienBehaviorInfo* substruct = &this->behaviorInfo; - u32 new_var; - - this->actionTimer = Rand_S16Offset(150, 250); - new_var = Rand_Next(); - substruct->unk26.x = D_80B4EDC8[new_var >> 0x1E]; - substruct->unk26.y = 0; - substruct->unk26.z = 0; - substruct->unk30 = 0.1f; - substruct->unk2C = 800; - Animation_MorphToLoop(&this->skelAnime, &gRomaniWalkAnim, -10.0f); - this->actionFunc = func_80B48848; -} - -void func_80B48848(EnInvadepoh* this, PlayState* play) { - s32 pad; - - Math_StepToF(&this->actor.speed, 1.6f, 0.1f); - if (func_80B44B84(this, play, this->actor.speed, 50.0f)) { - func_80B44514(this); - this->behaviorInfo.unk4C = 0xC8; - this->actor.speed *= 0.25f; - } else { - Math_StepToS(&this->behaviorInfo.unk4C, 0x7D0, 0x46); - } - func_80B43E6C(this, 6, this->behaviorInfo.unk4C, 0x46); - if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_40) && - (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 7.0f))) { - Actor_PlaySfx(&this->actor, NA_SE_EN_ROMANI_WALK); - } - if (this->actionTimer > 0) { - this->actionTimer--; - } else { - func_80B48948(this); - } -} - -void func_80B48948(EnInvadepoh* this) { - AlienBehaviorInfo* substruct = &this->behaviorInfo; - f32 rand = Rand_ZeroOne(); - - this->actionTimer = Rand_S16Offset(150, 150); - if (rand < 0.5f) { - this->rand = 0; - Math_Vec3s_Copy(&substruct->unk26, &gZeroVec3s); - substruct->unk30 = 0.1f; - substruct->unk2C = 1000; - } else if (rand < 0.75f) { - this->rand = 1; - substruct->unk26.x = Rand_S16Offset(0, 2000); - substruct->unk26.y = 0; - substruct->unk26.z = 0; - substruct->unk30 = 0.06f; - substruct->unk2C = 1000; - } else if (rand < 0.8f) { - this->rand = 2; - substruct->unk26.x = Rand_S16Offset(-2000, 2000); - substruct->unk26.y = 0; - substruct->unk26.z = 0; - substruct->unk30 = 0.05f; - substruct->unk2C = 1000; - } else { - this->rand = 3; - substruct->unk26.x = 0; - substruct->unk26.y = 0; - substruct->unk26.z = Rand_S16Offset(-2500, 5000); - substruct->unk30 = 0.04f; - substruct->unk2C = 1000; - } - - Animation_MorphToLoop(&this->skelAnime, &gRomaniIdleAnim, -10.0f); - this->actionFunc = func_80B48AD4; -} - -void func_80B48AD4(EnInvadepoh* this, PlayState* play) { - AlienBehaviorInfo* substruct = &this->behaviorInfo; - Player* player; - s16 new_var3; - s16 temp_v1; - s32 temp_v1_3; - - Math_StepToF(&this->actor.speed, 0.0f, 0.2f); - if (func_80B44B84(this, play, this->actor.speed, 50.0f)) { - func_80B44514(this); - } - - if (this->rand == 0) { - s32 requiredScopeTemp; - - if ((this->actor.xzDistToPlayer < 350.0f) && ((play->gameplayFrames & 0x60) != 0)) { - player = GET_PLAYER(play); - temp_v1 = Math_Vec3f_Pitch(&this->actor.focus.pos, &player->actor.focus.pos) * 0.85f; - temp_v1 -= this->actor.shape.rot.x; - substruct->unk26.x = CLAMP(temp_v1, -2500, 2500); - new_var3 = BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.shape.rot.y); - temp_v1 = new_var3 * 0.7f; - substruct->unk26.y = CLAMP(temp_v1, -0x1F40, 0x1F40); - } - } else { - substruct->unk26.x = 0; - substruct->unk26.y = 0; - } - - if (this->actionTimer > 0) { - temp_v1_3 = this->actionTimer & 0x1F; - if ((temp_v1_3 == 0) && (Rand_ZeroOne() < 0.3f)) { - temp_v1_3 = (s32)Rand_Next() % 4; - if (temp_v1_3 != this->rand) { - this->rand = temp_v1_3; - if (this->rand == 0) { - Math_Vec3s_Copy(&substruct->unk26, &gZeroVec3s); - substruct->unk30 = 0.07f; - } else if (this->rand == 1) { - substruct->unk26.x = Rand_S16Offset(1000, 1000); - substruct->unk26.y = Rand_S16Offset(-1000, 2000); - substruct->unk26.z = Rand_S16Offset(-800, 1600); - substruct->unk30 = 0.06f; - } else if (this->rand == 2) { - substruct->unk26.x = Rand_S16Offset(-2000, 1000); - substruct->unk26.y = Rand_S16Offset(-1000, 2000); - substruct->unk26.z = Rand_S16Offset(-800, 1600); - substruct->unk30 = 0.05f; - } else { - substruct->unk26.x = Rand_S16Offset(-1000, 2000); - substruct->unk26.y = Rand_S16Offset(-2000, 4000); - substruct->unk26.z = Rand_S16Offset(-2000, 4000); - substruct->unk30 = 0.04f; - } - } - } - - this->actionTimer--; - } else { - func_80B487B4(this); - } -} - -void func_80B48DE4(EnInvadepoh* this) { - AlienBehaviorInfo* substruct = &this->behaviorInfo; - - this->actor.speed = 0.0f; - Animation_MorphToLoop(&this->skelAnime, &gRomaniIdleAnim, -10.0f); - this->behaviorInfo.unk4C = 0; - substruct->unk30 = 0.05f; - substruct->unk2C = 1200; - this->actionFunc = func_80B48E4C; -} - -void func_80B48E4C(EnInvadepoh* this, PlayState* play) { - AlienBehaviorInfo* substruct = &this->behaviorInfo; - Player* player = GET_PLAYER(play); - s16 temp_v1; - s16 diff; - - Math_StepToS(&this->behaviorInfo.unk4C, 2000, 50); - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 6, this->behaviorInfo.unk4C, 35); - temp_v1 = Math_Vec3f_Pitch(&this->actor.focus.pos, &player->actor.focus.pos); - temp_v1 *= 0.85f; - temp_v1 -= this->actor.shape.rot.x; - substruct->unk26.x = CLAMP(temp_v1, -0xBB8, 0xBB8); - diff = BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.shape.rot.y); - temp_v1 = diff * 0.7f; - substruct->unk26.y = CLAMP(temp_v1, -0x1F40, 0x1F40); - if (Actor_TextboxIsClosing(&this->actor, play)) { - func_80B48948(this); - } -} - -void func_80B48FB0(Actor* thisx, PlayState* play) { - EnInvadepoh* this = THIS; - - if (Object_IsLoaded(&play->objectCtx, this->bankIndex)) { - this->actor.objBankIndex = this->bankIndex; - Actor_SetObjectDependency(play, &this->actor); - func_80B44F58(); - this->actor.update = func_80B490F0; - this->actor.draw = func_80B4E324; - this->actor.textId = 0x3330; - SkelAnime_InitFlex(play, &this->skelAnime, &gRomaniSkel, &gRomaniIdleAnim, this->jointTable, this->morphTable, - ROMANI_LIMB_MAX); - func_80B45C04(&this->behaviorInfo, D_80B4EA90, 6, D_80B4EB00, 2, &gZeroVec3s, 100, 0.03, 0.3, 0.03); - func_80B444F4(this, play); - EnInvadepoh_SetPathPointToWorldPos(this, 0); - func_800B4AEC(play, &this->actor, 50.0f); - func_80B4516C(this); - func_80B487B4(this); - } -} - -void func_80B490F0(Actor* thisx, PlayState* play) { - s32 pad; - EnInvadepoh* this = THIS; - s32 sp2C = CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_40); - s32 isTalking = Actor_ProcessTalkRequest(&this->actor, &play->state); - - if (isTalking) { - func_80151BB4(play, 5); - func_80B48DE4(this); - } - this->actionFunc(this, play); - if (sp2C) { - SkelAnime_Update(&this->skelAnime); - func_80B45CE0(&this->behaviorInfo); - if ((this->actionFunc != func_80B48E4C) && !isTalking && this->actor.isTargeted) { - func_800B8614(&this->actor, play, 100.0f); - } - Collider_UpdateCylinder(&this->actor, &this->collider); - CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); - } -} - -void func_80B491EC(EnInvadepoh* this) { - this->scaleFactorAdj = 0.0f; - this->scaleStep = 0.0f; - this->unk3AA = 0; - this->actor.gravity = -15.0f; - this->scaleTarget = 1.0f; - this->actionFunc = func_80B49228; -} - -void func_80B49228(EnInvadepoh* this, PlayState* play) { - s32 pad; - f32 temp_f0; - - Actor_UpdateVelocityWithGravity(&this->actor); - this->actor.velocity.y *= 0.97f; - temp_f0 = Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.home.pos.y + D_80B4E934.y + 300.0f, 0.7f, - fabsf(this->actor.velocity.y), 1.0f); - func_800B9010(&this->actor, NA_SE_EV_UFO_APPEAR - SFX_FLAG); - if (fabsf(temp_f0) < 1.0f) { - func_80B45EC8(this, play, 50); - func_80B492FC(this); - } -} - -void func_80B492FC(EnInvadepoh* this) { - this->actor.velocity.y *= 0.1f; - this->actionTimer = 20; - this->scaleTarget = 0.3f; - this->scaleStep = 0.03f; - this->unk3AA = 3000; - this->actionFunc = func_80B4934C; -} - -void func_80B4934C(EnInvadepoh* this, PlayState* play) { - f32 temp = this->actor.home.pos.y + D_80B4E934.y + 300.0f; - - if (this->actor.world.pos.y < temp) { - this->actor.gravity = 3.0f; - } else { - this->actor.gravity = -2.0f; - } - this->actor.velocity.y *= 0.96f; - Actor_MoveWithGravity(&this->actor); - func_800B9010(&this->actor, NA_SE_EV_UFO_APPEAR - SFX_FLAG); - this->actionTimer--; - if (this->actionTimer <= 0) { - func_80B49404(this); - } -} - -void func_80B49404(EnInvadepoh* this) { - this->actionTimer = 120; - this->scaleTarget = 0.2f; - this->scaleStep = 0.01f; - this->unk3AA = 3000; - this->unk3AC = 0; - this->counter = 0; - this->actor.gravity = 33.0f; - this->actionFunc = func_80B49454; -} - -void func_80B49454(EnInvadepoh* this, PlayState* play) { - s32 pad; - Vec3f sp30; - s32 pad2; - - if (this->counter < 25) { - this->counter++; - } else { - this->counter = 0; - this->unk3AC++; - this->unk3AC = CLAMP_MAX(this->unk3AC, 4); - this->actor.gravity = 33.0f; - func_80B45EC8(this, play, 20); - } - - Math_Vec3f_Sum(&D_80B4EDD0[this->unk3AC], &this->actor.home.pos, &sp30); - if (Math3D_Vec3fDistSq(&this->actor.world.pos, &sp30) < SQ(400.0f)) { - this->actor.speed *= 0.8f; - } else { - Math_StepToF(&this->actor.speed, 170.0f, 21.0f); - this->actor.speed *= 0.98f; - } - if (func_80B450C0(&this->actor.world.pos.x, &this->actor.world.pos.z, sp30.x, sp30.z, this->actor.speed)) { - this->actor.speed = 0.0f; - } - if (sp30.y < this->actor.world.pos.y) { - Math_StepToF(&this->actor.gravity, -12.0f, 7.0f); - } else { - Math_StepToF(&this->actor.gravity, 5.0f, 4.0f); - } - this->actor.velocity.y += this->actor.gravity; - this->actor.velocity.y *= 0.97f; - this->actor.world.pos.y += this->actor.velocity.y; - func_800B9010(&this->actor, NA_SE_EV_UFO_APPEAR - SFX_FLAG); - if (this->actionTimer > 0) { - this->actionTimer--; - } else { - func_80B49628(this); - } -} - -void func_80B49628(EnInvadepoh* this) { - this->scaleTarget = 0.2f; - this->scaleStep = 0.01f; - this->unk3AA = 3000; - this->actor.velocity.y *= 0.8f; - this->actionFunc = func_80B49670; -} - -void func_80B49670(EnInvadepoh* this, PlayState* play) { - s32 pad; - Vec3f sp30; - - sp30.x = this->actor.home.pos.x; - sp30.y = this->actor.home.pos.y + 1500.0f; - sp30.z = this->actor.home.pos.z; - Math_SmoothStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &sp30), 0xA, 0xBB8, 0x64); - if ((play->gameplayFrames % 64) < 14) { - Math_StepToF(&this->actor.speed, 5.0f, 1.0f); - } else { - this->actor.speed *= 0.97f; - } - if (sp30.y < this->actor.world.pos.y) { - this->actor.gravity = -0.5f; - } else { - this->actor.gravity = 2.0f; - } - this->actor.velocity.y *= 0.97f; - Actor_MoveWithGravity(&this->actor); - if (D_80B4E940 == 3) { - func_80B499BC(this); - } -} - -void func_80B497A4(EnInvadepoh* this) { - this->scaleTarget = 0.2f; - this->scaleStep = 0.01f; - this->unk3AA = 3000; - this->actionTimer = 35; - this->actor.gravity = -1.5f; - this->actionFunc = func_80B497EC; -} - -void func_80B497EC(EnInvadepoh* this, PlayState* play) { - s32 pad; - Vec3f sp30; - - sp30.x = this->actor.home.pos.x + D_80B4E934.x; - sp30.y = this->actor.home.pos.y + D_80B4E934.y + 400.0f; - sp30.z = this->actor.home.pos.z + D_80B4E934.z; - Math_SmoothStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &sp30), 4, 0x1F40, 0x64); - Math_StepToF(&this->actor.speed, 70.0f, 3.0f); - if (sp30.y < this->actor.world.pos.y) { - this->actor.gravity = -2.0f; - } else { - this->actor.gravity = 2.0f; - } - this->actor.velocity.y *= 0.97f; - Actor_MoveWithGravity(&this->actor); - if (this->actionTimer > 0) { - this->actionTimer--; - } else { - func_80B49904(this); - } -} - -void func_80B49904(EnInvadepoh* this) { - this->scaleTarget = 0.2f; - this->scaleStep = 0.01f; - this->unk3AA = 3000; - this->actionTimer = 60; - this->actor.gravity = 1.0f; - this->actionFunc = func_80B4994C; -} - -void func_80B4994C(EnInvadepoh* this, PlayState* play) { - Math_StepToF(&this->actor.speed, 150.0f, 4.0f); - this->actor.velocity.y *= 0.95f; - Actor_MoveWithGravity(&this->actor); - if (this->actionTimer > 0) { - this->actionTimer--; - } else { - Actor_Kill(&this->actor); - } -} - -void func_80B499BC(EnInvadepoh* this) { - this->actionTimer = 40; - this->scaleTarget = 0.2f; - this->scaleStep = 0.01f; - this->unk3AA = 3000; - this->actor.speed = 0.0f; - this->actionFunc = func_80B49A00; -} - -void func_80B49A00(EnInvadepoh* this, PlayState* play) { - s32 pad; - Vec3f sp30; - - sp30.x = this->actor.home.pos.x; - sp30.y = this->actor.home.pos.y + 800.0f; - sp30.z = this->actor.home.pos.z; - Math_SmoothStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &sp30), 4, 0x1F40, 0x64); - Math_StepToF(&this->actor.speed, 30.0f, 3.0f); - this->actor.velocity.y *= 0.98f; - if (sp30.y < this->actor.world.pos.y) { - this->actor.gravity = -0.5f; - } else { - this->actor.gravity = 2.0f; - } - Actor_MoveWithGravity(&this->actor); - Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, 4); - if (this->actionTimer > 0) { - this->actionTimer--; - } else { - func_80B497A4(this); - } -} - -void func_80B49B1C(Actor* thisx, PlayState* play) { - EnInvadepoh* this = THIS; - f32 scale; - - this->actionFunc(this, play); - this->scaleAdjAngle += this->unk3AA; - Math_StepToF(&this->scaleFactorAdj, this->scaleTarget, this->scaleStep); - scale = Math_SinS(this->scaleAdjAngle) * this->scaleFactorAdj + 1.0f; - Actor_SetScale(&this->actor, 0.27f * scale); - Math_StepToS(&this->unk306, 600, 8); - this->actor.world.rot.y += this->unk306; - this->unk304 += 600; -} - -void func_80B49BD0(EnInvadepoh* this) { - AlienBehaviorInfo* substruct = &this->behaviorInfo; - - Animation_MorphToLoop(&this->skelAnime, &gRomaniWalkAnim, -10.0f); - substruct->unk26.x = 0; - substruct->unk26.y = 0; - substruct->unk26.z = 0; - substruct->unk30 = 0.1f; - substruct->unk2C = 800; - this->actionFunc = func_80B49C38; -} - -void func_80B49C38(EnInvadepoh* this, PlayState* play) { - s32 pad; - s32 temp_v0_2; - - func_80B44570(this); - func_80B44C24(this, play); - func_80B43E6C(this, 6, 2000, 100); - if (1) {} - if (this->pathIndex == 0 || (this->pathIndex + 1) == this->endPoint) { - if (this->unk378 == 0) { - temp_v0_2 = func_800FE620(play); - if (temp_v0_2 > 0) { - temp_v0_2 = (R_TIME_SPEED * -16.0f / temp_v0_2) - 0.5f; - this->unk378 = func_80B45550(this, play, SQ(80.0f), temp_v0_2); - } - } - this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8); - } else { - this->unk378 = 0; - this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8); - } - - if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_40) && - (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 7.0f))) { - Actor_PlaySfx(&this->actor, NA_SE_EN_ROMANI_WALK); - } - if (this->clockTime >= 0.9999f) { - Actor_Kill(&this->actor); - } -} - -void func_80B49DA0(EnInvadepoh* this) { - this->behaviorInfo.unk30 = 0.08f; - this->behaviorInfo.unk2C = 2000; - this->behaviorInfo.unk4C = 0; - Animation_MorphToLoop(&this->skelAnime, &gRomaniIdleAnim, -10.0f); - this->actionFunc = func_80B49DFC; -} - -void func_80B49DFC(EnInvadepoh* this, PlayState* play) { - AlienBehaviorInfo* substruct = &this->behaviorInfo; - Player* player = GET_PLAYER(play); - s16 temp_v1; - s16 diff; - - Math_StepToS(&this->behaviorInfo.unk4C, 2000, 500); - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, this->behaviorInfo.unk4C, 40); - temp_v1 = (Math_Vec3f_Pitch(&this->actor.focus.pos, &player->actor.focus.pos) * 0.85f); - temp_v1 -= this->actor.shape.rot.x; - substruct->unk26.x = CLAMP(temp_v1, -0xBB8, 0xBB8); - diff = BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.shape.rot.y); - temp_v1 = diff; - temp_v1 *= 0.7f; - substruct->unk26.y = CLAMP(temp_v1, -0x1F40, 0x1F40); - if (Actor_TextboxIsClosing(&this->actor, play)) { - if (this->actor.textId == 0x332D) { - SET_WEEKEVENTREG(WEEKEVENTREG_54_10); - this->actor.textId = 0x332E; - } - func_80B49BD0(this); - } -} - -void func_80B49F88(Actor* thisx, PlayState* play) { - s32 pad[2]; - EnInvadepoh* this = THIS; - s32 sp38; - - if (Object_IsLoaded(&play->objectCtx, this->bankIndex)) { - sp38 = gSaveContext.save.time; - this->actor.objBankIndex = this->bankIndex; - Actor_SetObjectDependency(play, &this->actor); - func_80B44F58(); - SkelAnime_InitFlex(play, &this->skelAnime, &gRomaniSkel, &gRomaniWalkAnim, this->jointTable, this->morphTable, - ROMANI_LIMB_MAX); - func_80B45C04(&this->behaviorInfo, D_80B4EA90, 1, D_80B4EB00, 1, &gZeroVec3s, 100, 0.03, 0.3, 0.03); - func_80B44540(this, play); - func_80B44570(this); - func_80B44C24(this, play); - func_80B43F0C(this); - func_80B4516C(this); - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_21_20)) { - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_54_10)) { - this->actor.textId = 0x332E; - } else { - this->actor.textId = 0x332D; - } - - } else { - this->actor.textId = 0x332C; - } - - if (sp38 >= CLOCK_TIME(18, 0) || sp38 < CLOCK_TIME(2, 0)) { - this->actor.update = func_80B4A168; - this->actor.draw = NULL; - } else if ((sp38 < CLOCK_TIME(6, 0)) && (sp38 >= CLOCK_TIME(2, 0)) && (sp38 < CLOCK_TIME(2, 15))) { - this->actor.update = func_80B4A1B8; - this->actor.draw = func_80B4E324; - func_80B49BD0(this); - } else { - Actor_Kill(&this->actor); - } - } -} - -void func_80B4A168(Actor* thisx, PlayState* play) { - EnInvadepoh* this = THIS; - - if ((gSaveContext.save.time < CLOCK_TIME(6, 0)) && (gSaveContext.save.time >= CLOCK_TIME(2, 0))) { - this->actor.update = func_80B4A1B8; - this->actor.draw = func_80B4E324; - func_80B49BD0(this); - } -} - -void func_80B4A1B8(Actor* thisx, PlayState* play) { - s32 pad; - EnInvadepoh* this = THIS; - s32 sp2C = CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_40); - s32 isTalking = Actor_ProcessTalkRequest(&this->actor, &play->state); - - if (isTalking) { - func_80151BB4(play, 5); - func_80B49DA0(this); - } - this->actionFunc(this, play); - if (sp2C && this->actor.update != NULL) { - SkelAnime_Update(&this->skelAnime); - func_80B45CE0(&this->behaviorInfo); - if ((this->actionFunc != func_80B49DFC) && !isTalking && this->actor.isTargeted) { - func_800B8614(&this->actor, play, 350.0f); - } - Collider_UpdateCylinder(&this->actor, &this->collider); - CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); - } -} - -void func_80B4A2C0(EnInvadepoh* this) { - AlienBehaviorInfo* substruct = &this->behaviorInfo; - - Animation_MorphToLoop(&this->skelAnime, &gRomaniIdleAnim, -10.0f); - substruct->unk26.x = 0; - substruct->unk26.y = 0; - substruct->unk26.z = 0; - substruct->unk30 = 0.1f; - substruct->unk2C = 1500; - this->actionTimer = Rand_S16Offset(200, 200); - this->unk304 = this->actor.shape.rot.y; - this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8); - this->actionFunc = func_80B4A350; -} - -void func_80B4A350(EnInvadepoh* this, PlayState* play) { - s16 temp_v0; - s16 temp_v1_2; - s16 diff; - Vec3f sp44; - s16 sp42; - AlienBehaviorInfo* substruct = &this->behaviorInfo; - - if ((play->gameplayFrames % 256) == 0) { - Math_Vec3s_ToVec3f(&sp44, this->pathPoints); - sp42 = Math_Vec3f_Yaw(&this->actor.world.pos, &sp44); - temp_v0 = Rand_S16Offset(-0x1F40, 0x3E80); - this->unk304 = temp_v0 + sp42; - this->behaviorInfo.unk4C = 0; - } - - Math_StepToS(&this->behaviorInfo.unk4C, 2000, 40); - Math_SmoothStepToS(&this->actor.shape.rot.y, this->unk304, 6, this->behaviorInfo.unk4C, 40); - if (this->actor.xzDistToPlayer < 300.0f) { - Player* player = GET_PLAYER(play); - - temp_v1_2 = Math_Vec3f_Pitch(&this->actor.focus.pos, &player->actor.focus.pos); - temp_v1_2 *= 0.85f; - temp_v1_2 -= this->actor.shape.rot.x; - substruct->unk26.x = CLAMP(temp_v1_2, -0x9C4, 0x9C4); - diff = BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.shape.rot.y); - temp_v1_2 = diff; - temp_v1_2 *= 0.7f; - substruct->unk26.y = CLAMP(temp_v1_2, -0x1F40, 0x1F40); - if ((play->gameplayFrames % 256) == 0) { - substruct->unk26.z = Rand_S16Offset(-0x5DC, 0xBB8); - } - } else { - substruct->unk26.x = 0; - substruct->unk26.y = 0; - substruct->unk26.z = 0; - } - if (this->actionTimer > 0) { - this->actionTimer--; - } else { - func_80B4A570(this); - } -} - -void func_80B4A570(EnInvadepoh* this) { - AlienBehaviorInfo* substruct = &this->behaviorInfo; - - Animation_MorphToPlayOnce(&this->skelAnime, &gRomaniLookAroundAnim, -10.0f); - substruct->unk26.x = 0; - substruct->unk26.y = 0; - substruct->unk26.z = 0; - substruct->unk30 = 0.1f; - substruct->unk2C = 800; - this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8); - this->actionFunc = func_80B4A5E4; -} - -void func_80B4A5E4(EnInvadepoh* this, PlayState* play) { - if (this->animPlayFlag) { - func_80B4A2C0(this); - } -} - -void func_80B4A614(EnInvadepoh* this) { - AlienBehaviorInfo* substruct = &this->behaviorInfo; - - Animation_MorphToLoop(&this->skelAnime, &gRomaniWalkAnim, 0.0f); - substruct->unk26.x = 0; - substruct->unk26.y = 0; - substruct->unk26.z = 0; - substruct->unk30 = 0.1f; - substruct->unk2C = 800; - this->actionFunc = func_80B4A67C; -} - -void func_80B4A67C(EnInvadepoh* this, PlayState* play) { - s32 pad; - - Math_StepToF(&this->actor.speed, 5.0f, 1.0f); - if (func_80B44B84(this, play, this->actor.speed, 50.0f)) { - func_80B44640(this); - this->behaviorInfo.unk4C = 0x5DC; - this->actor.speed *= 0.5f; - } else { - Math_StepToS(&this->behaviorInfo.unk4C, 0x190, 0x32); - } - func_80B43E6C(this, 6, this->behaviorInfo.unk4C, 0x32); - if (this->pathIndex == 0) { - if (this->unk378 == 0) { - this->unk378 = func_80B45550(this, play, SQ(80.0f), -0xF); - } - this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8); - } else { - this->unk378 = 0; - this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8); - } - if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_40) && - (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 7.0f))) { - Actor_PlaySfx(&this->actor, NA_SE_EN_ROMANI_WALK); - } - if (this->pathIndex == this->endPoint) { - func_80B4A2C0(this); - } -} - -void func_80B4A7C0(EnInvadepoh* this) { - this->behaviorInfo.unk30 = 0.08f; - this->behaviorInfo.unk2C = 2000; - this->behaviorInfo.unk4C = 0; - Animation_MorphToLoop(&this->skelAnime, &gRomaniIdleAnim, 0.0f); - this->actionFunc = func_80B4A81C; -} - -void func_80B4A81C(EnInvadepoh* this, PlayState* play) { - AlienBehaviorInfo* substruct = &this->behaviorInfo; - Player* player = GET_PLAYER(play); - s16 temp_v1; - s16 diff; - - Math_StepToS(&this->behaviorInfo.unk4C, 2000, 500); - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, this->behaviorInfo.unk4C, 40); - temp_v1 = (Math_Vec3f_Pitch(&this->actor.focus.pos, &player->actor.focus.pos) * 0.85f); - temp_v1 -= this->actor.shape.rot.x; - substruct->unk26.x = CLAMP(temp_v1, -0xBB8, 0xBB8); - diff = BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.shape.rot.y); - temp_v1 = diff; - temp_v1 *= 0.7f; - substruct->unk26.y = CLAMP(temp_v1, -0x1F40, 0x1F40); - - if (Actor_TextboxIsClosing(&this->actor, play)) { - if (this->actor.textId == 0x332D) { - SET_WEEKEVENTREG(WEEKEVENTREG_54_10); - this->actor.textId = 0x332E; - } - if (this->pathIndex == this->endPoint) { - func_80B4A2C0(this); - } else { - func_80B4A614(this); - } - } -} - -void func_80B4A9C8(Actor* thisx, PlayState* play) { - EnInvadepoh* this = THIS; - s32 pad[2]; - s32 sp38; - - if (Object_IsLoaded(&play->objectCtx, this->bankIndex)) { - sp38 = gSaveContext.save.time; - this->actor.objBankIndex = this->bankIndex; - Actor_SetObjectDependency(play, &this->actor); - func_80B44F58(); - SkelAnime_InitFlex(play, &this->skelAnime, &gRomaniSkel, &gRomaniWalkAnim, this->jointTable, this->morphTable, - ROMANI_LIMB_MAX); - func_80B45C04(&this->behaviorInfo, D_80B4EA90, 1, D_80B4EB00, 1, &gZeroVec3s, 100, 0.03f, 0.3f, 0.03f); - func_80B44620(this, play); - if ((sp38 < CLOCK_TIME(2, 15)) || (sp38 >= CLOCK_TIME(6, 0))) { - this->pathIndex = 0; - this->actor.update = func_80B4AB8C; - } else { - this->pathIndex = this->endPoint; - this->actor.update = func_80B4ABDC; - this->actor.draw = func_80B4E324; - func_80B4A2C0(this); - } - - EnInvadepoh_SetPathPointToWorldPos(this, this->pathIndex); - func_80B43F0C(this); - func_800B4AEC(play, &this->actor, 50.0f); - func_80B4516C(this); - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_21_20)) { - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_54_10)) { - this->actor.textId = 0x332E; - } else { - this->actor.textId = 0x332D; - } - } else { - this->actor.textId = 0x332C; - } - } -} - -void func_80B4AB8C(Actor* thisx, PlayState* play) { - EnInvadepoh* this = THIS; - - if ((gSaveContext.save.time < CLOCK_TIME(6, 0)) && (gSaveContext.save.time >= CLOCK_TIME(2, 15))) { - this->actor.update = func_80B4ABDC; - this->actor.draw = func_80B4E324; - func_80B4A614(this); - } -} - -void func_80B4ABDC(Actor* thisx, PlayState* play) { - s32 pad; - EnInvadepoh* this = THIS; - s32 sp2C = CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_40); - s32 isTalking = Actor_ProcessTalkRequest(&this->actor, &play->state); - - if (isTalking) { - func_80151BB4(play, 5); - func_80B4A7C0(this); - } - this->actionFunc(this, play); - if (sp2C) { - this->animPlayFlag = SkelAnime_Update(&this->skelAnime); - func_80B45CE0(&this->behaviorInfo); - if ((this->actionFunc != func_80B4A81C) && !isTalking && this->actor.isTargeted) { - func_800B8614(&this->actor, play, 100.0f); - } - Collider_UpdateCylinder(&this->actor, &this->collider); - CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); - } -} - -void func_80B4ACDC(EnInvadepoh* this) { - this->actionFunc = func_80B4ACF0; -} - -void func_80B4ACF0(EnInvadepoh* this, PlayState* play) { - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { - this->actor.draw = func_80B4E324; - this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8); - func_80B4AD3C(this); - } -} - -void func_80B4AD3C(EnInvadepoh* this) { - this->actor.flags |= ACTOR_FLAG_10000; - this->actionFunc = func_80B4AD60; -} - -void func_80B4AD60(EnInvadepoh* this, PlayState* play) { - if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { - EnInvadepoh_SetTextID(this, play, 0x3331); - func_80B4ADB8(this); - } else { - func_800B8614(&this->actor, play, 2000.0f); - } -} - -void func_80B4ADB8(EnInvadepoh* this) { - this->actionFunc = func_80B4ADCC; -} - -void func_80B4ADCC(EnInvadepoh* this, PlayState* play) { - if ((Message_GetState(&play->msgCtx) == TEXT_STATE_5) && Message_ShouldAdvance(play)) { - if (this->textId == 0x3331) { - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_22_02)) { - EnInvadepoh_SetTextID(this, play, 0x3334); - func_80151BB4(play, 0x1D); - func_80151BB4(play, 5); - return; - } - EnInvadepoh_SetTextID(this, play, 0x3333); - return; - } - if (this->textId == 0x3333) { - func_80B4AEC0(this); - } else if (this->textId == 0x3334) { - Message_CloseTextbox(play); - func_80B4B024(this); - } - } -} - -void func_80B4AEC0(EnInvadepoh* this) { - this->actionTimer = 2; - this->actionFunc = func_80B4AEDC; -} - -void func_80B4AEDC(EnInvadepoh* this, PlayState* play) { - if (this->actionTimer > 0) { - this->actionTimer--; - if (this->actionTimer == 0) { - Message_CloseTextbox(play); - } - } - if (Actor_HasParent(&this->actor, play)) { - this->actor.parent = NULL; - SET_WEEKEVENTREG(WEEKEVENTREG_22_02); - func_80B4AF80(this); - } else { - Actor_OfferGetItem(&this->actor, play, GI_MILK_BOTTLE, 2000.0f, 2000.0f); - } -} - -void func_80B4AF80(EnInvadepoh* this) { - this->actionFunc = func_80B4AF94; -} - -void func_80B4AF94(EnInvadepoh* this, PlayState* play) { - if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { - EnInvadepoh_SetTextID(this, play, 0x3334); - func_80151BB4(play, 0x1E); - func_80151BB4(play, 0x1D); - func_80151BB4(play, 5); - func_80B4ADB8(this); - } else { - func_800B85E0(&this->actor, play, 2000.0f, PLAYER_IA_MINUS1); - } -} - -void func_80B4B024(EnInvadepoh* this) { - this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8); - this->actionFunc = func_80B4B048; -} - -void func_80B4B048(EnInvadepoh* this, PlayState* play) { - if (play->msgCtx.unk120B1 == 0) { - if (play->msgCtx.msgMode == 0) { - D_80B4E998 = 1; - } else if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) || - (Message_GetState(&play->msgCtx) == TEXT_STATE_5)) { - D_80B4E998 = 1; - } - } -} - -void func_80B4B0C4(Actor* thisx, PlayState* play) { - EnInvadepoh* this = THIS; - AlienBehaviorInfo* substruct; - s32 pad; - - if (Object_IsLoaded(&play->objectCtx, this->bankIndex)) { - this->actor.objBankIndex = this->bankIndex; - Actor_SetObjectDependency(play, &this->actor); - func_80B44F58(); - this->actor.update = func_80B4B218; - SkelAnime_InitFlex(play, &this->skelAnime, &gRomaniSkel, &gRomaniWalkAnim, this->jointTable, this->morphTable, - ROMANI_LIMB_MAX); - Animation_MorphToLoop(&this->skelAnime, &gRomaniIdleAnim, 0.0f); - substruct = &this->behaviorInfo; - func_80B45C04(&this->behaviorInfo, D_80B4EA90, 1, D_80B4EB00, 3, &gZeroVec3s, 2000, 0.08f, 0.3f, 0.03f); - substruct->unk30 = 0.08f; - substruct->unk2C = 0x7D0; - func_800B4AEC(play, &this->actor, 50.0f); - func_80B4516C(this); - func_80B4ACDC(this); - } -} - -void func_80B4B218(Actor* thisx, PlayState* play) { - s16 diff; - EnInvadepoh* this = THIS; - s16 temp_v1; - s32 sp38 = CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_40); - Player* player; - AlienBehaviorInfo* substruct = &this->behaviorInfo; - - this->actionFunc(this, play); - if (sp38 && this->actor.update != NULL) { - SkelAnime_Update(&this->skelAnime); - player = GET_PLAYER(play); - Math_StepToS(&this->behaviorInfo.unk4C, 2000, 40); - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 6, this->behaviorInfo.unk4C, 40); - temp_v1 = (Math_Vec3f_Pitch(&this->actor.focus.pos, &player->actor.focus.pos) * 0.9f); - temp_v1 -= this->actor.shape.rot.x; - substruct->unk26.x = CLAMP(temp_v1, -0xBB8, 0xBB8); - diff = BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.shape.rot.y); - temp_v1 = diff; - temp_v1 *= 0.7f; - substruct->unk26.y = CLAMP(temp_v1, -0x1F40, 0x1F40); - func_80B45CE0(substruct); - Collider_UpdateCylinder(&this->actor, &this->collider); - CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); - } -} - -void func_80B4B3DC(EnInvadepoh* this) { - s32 pad; - - if (Animation_OnFrame(&this->skelAnime, 1.0f) || Animation_OnFrame(&this->skelAnime, 7.0f)) { - Actor_PlaySfx(&this->actor, NA_SE_EV_MONKEY_WALK); - } -} - -void func_80B4B430(EnInvadepoh* this) { - Animation_MorphToLoop(&this->skelAnime, &gDogWalkAnim, -6.0f); - this->actionTimer = Rand_S16Offset(50, 80); - this->actionFunc = func_80B4B484; -} - -void func_80B4B484(EnInvadepoh* this, PlayState* play) { - Math_StepToF(&this->actor.speed, 1.1f, 0.5f); - if (func_80B44C80(this, play)) { - func_80B44690(this); - } - func_80B4B3DC(this); - if (this->unk3BC >= 0) { - this->actionTimer = 0; - } - - if (this->actionTimer > 0) { - this->actionTimer--; - } else { - func_80B4B510(this); - } -} - -void func_80B4B510(EnInvadepoh* this) { - Animation_MorphToLoop(&this->skelAnime, &gDogRunAnim, -6.0f); - this->actionTimer = Rand_S16Offset(50, 200); - this->actionFunc = func_80B4B564; -} - -void func_80B4B564(EnInvadepoh* this, PlayState* play) { - s32 pad; - Vec3f sp28; - f32 temp_f0; - - Math_StepToF(&this->actor.speed, 3.8f, 0.45f); - - if (this->unk3BC >= 0) { - Math_Vec3s_ToVec3f(&sp28, &this->pathPoints[this->unk3BC]); - temp_f0 = Math3D_Vec3fDistSq(&this->actor.world.pos, &sp28); - if (temp_f0 < SQ(80.0f)) { - this->actor.speed *= 0.85f; - } else if (temp_f0 < SQ(150.0f)) { - this->actor.speed *= 0.93f; - } else if (temp_f0 < SQ(250.0f)) { - this->actor.speed *= 0.96f; - } - if (this->pathIndex == this->unk3BC || temp_f0 < SQ(50.0f)) { - this->actionTimer = 0; - } - } - func_80B4B3DC(this); - if (func_80B44C80(this, play)) { - func_80B44690(this); - } - - if (this->actionTimer > 0) { - this->actionTimer--; - } else if (this->unk3BC >= 0) { - if ((D_80B50348 == 0) && (Rand_ZeroOne() < 0.4f)) { - Actor_PlaySfx(&this->actor, NA_SE_EV_SMALL_DOG_GROAN); - } - func_80B4B724(this); - } else { - func_80B4B430(this); - } -} - -void func_80B4B724(EnInvadepoh* this) { - Animation_MorphToPlayOnce(&this->skelAnime, &gDogBarkAnim, -6.0f); - this->actionFunc = func_80B4B768; -} - -void func_80B4B768(EnInvadepoh* this, PlayState* play) { - s32 pad; - - Math_StepToF(&this->actor.speed, 0.0f, 1.0f); - Math_SmoothStepToS(&this->actor.world.rot.y, Actor_WorldYawTowardActor(&this->actor, &D_80B5040C->actor), 5, 0x1388, - 0x64); - func_80B44E90(this, play); - if (Animation_OnFrame(&this->skelAnime, 13.0f) || Animation_OnFrame(&this->skelAnime, 19.0f)) { - Actor_PlaySfx(&this->actor, NA_SE_EV_SMALL_DOG_ANG_BARK); - } - if (this->animPlayFlag) { - func_80B4B510(this); - } -} - -void func_80B4B820(EnInvadepoh* this) { - Animation_MorphToPlayOnce(&this->skelAnime, &gDogJumpAnim, -6.0f); - this->actionFunc = func_80B4B864; -} - -void func_80B4B864(EnInvadepoh* this, PlayState* play) { - Math_StepToF(&this->actor.speed, 0.5f, 1.0f); - func_80B44E90(this, play); - if (this->animPlayFlag) { - func_80B4B510(this); - } -} - -void func_80B4B8BC(Actor* thisx, PlayState* play) { - EnInvadepoh* this = THIS; - s32 pad; - - if (Object_IsLoaded(&play->objectCtx, this->bankIndex)) { - this->actor.objBankIndex = this->bankIndex; - Actor_SetObjectDependency(play, &this->actor); - SkelAnime_InitFlex(play, &this->skelAnime, &gDogSkel, &gDogWalkAnim, this->jointTable, this->morphTable, - DOG_LIMB_MAX); - func_80B45C04(&this->behaviorInfo, 0, 0, 0, 0, &gZeroVec3s, 3000, 0.1f, 0.0f, 0.0f); - func_80B44664(this, play); - EnInvadepoh_SetPathPointToWorldPos(this, 0); - func_800B4AEC(play, &this->actor, 50.0f); - func_80B4516C(this); - Math_Vec3f_Copy(&this->curPathPos, &this->actor.world.pos); - if (D_80B4E940 == 2) { - this->actor.update = func_80B4BA84; - this->actor.draw = func_80B4E660; - this->actor.flags |= ACTOR_FLAG_1; - func_80B4B430(this); - } else if (D_80B4E940 == 1) { - this->actor.update = func_80B4BA30; - } else { - Actor_Kill(&this->actor); - if (!this) {} - } - } -} - -void func_80B4BA30(Actor* thisx, PlayState* play) { - EnInvadepoh* this = THIS; - - if (D_80B4E940 == 2) { - this->actor.update = func_80B4BA84; - this->actor.draw = func_80B4E660; - this->actor.flags |= ACTOR_FLAG_1; - func_80B4B430(this); - } -} - -void func_80B4BA84(Actor* thisx, PlayState* play) { - EnInvadepoh* this = THIS; - s32 temp_v0_3; - s32 sp34 = CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_40); - s32 temp_v1_2; - s32 sp2C; - s32 temp_v0_2; - s32 phi_v0; - - D_80B5040C = func_80B458D8(); - if (D_80B5040C == NULL) { - temp_v0_2 = this->unk3BC >= 0; - this->unk3BC = -1; - if (temp_v0_2) { - func_80B4B820(this); - } - } else { - sp2C = this->unk3BC; - this->unk3BC = func_80B44234(this, &D_80B5040C->actor.world.pos); - if (sp2C != this->unk3BC) { - phi_v0 = this->unk3BC - this->pathIndex; - if (phi_v0 < 0) { - phi_v0 += this->endPoint; - } - - if ((this->endPoint >> 1) < phi_v0) { - this->direction = DIRECTION_BACKWARD; - } else if (phi_v0 < (this->endPoint >> 1)) { - this->direction = DIRECTION_FORWARD; - } - } - } - - this->actionFunc(this, play); - this->animPlayFlag = SkelAnime_Update(&this->skelAnime); - if (sp34 && (this->actor.update != NULL)) { - func_80B45CE0(&this->behaviorInfo); - Collider_UpdateCylinder(&this->actor, &this->collider); - CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); - } -} - -void func_80B4BBE0(EnInvadepoh* this) { - AlienBehaviorInfo* substruct = &this->behaviorInfo; - - Animation_MorphToLoop(&this->skelAnime, &gCremiaWalkAnim, -6.0f); - substruct->unk26.x = 0; - substruct->unk26.y = 0; - substruct->unk26.z = 0; - substruct->unk30 = 0.1f; - substruct->unk2C = 800; - - this->behaviorInfo.unk4C = 0; - this->actionFunc = func_80B4BC4C; -} - -void func_80B4BC4C(EnInvadepoh* this, PlayState* play) { - s8 temp_v0; - s16 diff; - EnInvadepoh* temp_t6 = D_80B503F4; - s16 temp_v1_2; - s32 temp_v1; - AlienBehaviorInfo* substruct = &this->behaviorInfo; - s16 temp_a0; - s16 sp40; - - if (temp_t6 != NULL) { - temp_v0 = temp_t6->pathIndex; - if (temp_v0 == 0) { - this->xzPosAdjFactor = 40.0f; - this->unk304 = -0x8000; - this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8); - - } else if (temp_v0 < (temp_t6->endPoint - 1)) { - this->xzPosAdjFactor = 40.0f; - Math_ScaledStepToS(&this->unk304, -0x4800, 0xC8); - this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8); - } else { - Math_StepToF(&this->xzPosAdjFactor, 5.0f, 3.0f); - Math_ScaledStepToS(&this->unk304, -0x8000, 0x12C); - this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8); - } - temp_a0 = this->unk304 + temp_t6->actor.world.rot.y; - this->actor.world.pos.x = (Math_SinS(temp_a0) * this->xzPosAdjFactor) + temp_t6->actor.world.pos.x; - this->actor.world.pos.y = temp_t6->actor.world.pos.y; - this->actor.world.pos.z = (Math_CosS(temp_a0) * this->xzPosAdjFactor) + temp_t6->actor.world.pos.z; - func_800B4AEC(play, &this->actor, 50.0f); - func_80B4516C(this); - Math_StepToS(&this->behaviorInfo.unk4C, 0xBB8, 0x1F5); - if (Math3D_Vec3fDistSq(&this->actor.prevPos, &this->actor.world.pos) > SQ(0.01f)) { - Math_SmoothStepToS(&this->actor.shape.rot.y, Math_Vec3f_Yaw(&this->actor.prevPos, &this->actor.world.pos), - 3, this->behaviorInfo.unk4C, 0x1F4); - } - temp_v1 = (play->gameplayFrames + 0x14) % 128; - if ((temp_v1 & 0x40) != 0) { - sp40 = Math_Vec3f_Yaw(&this->actor.world.pos, &temp_t6->actor.world.pos); - if (temp_v1 == 64) { - this->behaviorInfo.unk4C = 0; - } - Math_StepToS(&this->behaviorInfo.unk4C, 2000, 40); - Math_SmoothStepToS(&this->actor.shape.rot.y, sp40, 6, this->behaviorInfo.unk4C, 40); - temp_v1_2 = Math_Vec3f_Pitch(&this->actor.focus.pos, &temp_t6->actor.focus.pos); - temp_v1_2 *= 0.85f; - temp_v1_2 -= this->actor.shape.rot.x; - substruct->unk26.x = CLAMP(temp_v1_2, -3000, 3000); - diff = BINANG_SUB(sp40, this->actor.shape.rot.y); - temp_v1_2 = diff; - temp_v1_2 *= 0.7f; - substruct->unk26.y = CLAMP(temp_v1_2, -8000, 8000); - } - } - - if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_40) && - (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 12.0f))) { - Actor_PlaySfx(&this->actor, NA_SE_EN_ROMANI_WALK); - } - if (gSaveContext.save.time > CLOCK_TIME(20, 15)) { - Actor_Kill(&this->actor); - } else if ((temp_t6 != NULL) && (temp_t6->actionFunc == func_80B4CB0C)) { - func_80B4C1BC(this); - } -} - -void func_80B4BFFC(EnInvadepoh* this) { - this->behaviorInfo.unk30 = 0.08f; - this->behaviorInfo.unk2C = 2000; - Animation_MorphToLoop(&this->skelAnime, &gCremiaIdleAnim, -6.0f); - this->behaviorInfo.unk4C = 0; - this->actionFunc = func_80B4C058; -} - -void func_80B4C058(EnInvadepoh* this, PlayState* play) { - AlienBehaviorInfo* substruct = &this->behaviorInfo; - Player* player = GET_PLAYER(play); - s16 temp_v1; - s16 diff; - - Math_StepToS(&this->behaviorInfo.unk4C, 2500, 450); - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, this->behaviorInfo.unk4C, 40); - temp_v1 = Math_Vec3f_Pitch(&this->actor.focus.pos, &player->actor.focus.pos); - temp_v1 *= 0.85f; - temp_v1 -= this->actor.shape.rot.x; - substruct->unk26.x = CLAMP(temp_v1, -0xBB8, 0xBB8); - - diff = BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.shape.rot.y); - temp_v1 = diff; - temp_v1 *= 0.7f; - - substruct->unk26.y = CLAMP(temp_v1, -0x1F40, 0x1F40); - - if (Actor_TextboxIsClosing(&this->actor, play)) { - func_80B4BBE0(this); - } -} - -void func_80B4C1BC(EnInvadepoh* this) { - this->behaviorInfo.unk30 = 0.08f; - this->behaviorInfo.unk2C = 2000; - Animation_MorphToLoop(&this->skelAnime, &gCremiaIdleAnim, -6.0f); - this->behaviorInfo.unk4C = 0; - this->actionFunc = func_80B4C218; -} - -void func_80B4C218(EnInvadepoh* this, PlayState* play) { - AlienBehaviorInfo* substruct = &this->behaviorInfo; - Player* player = GET_PLAYER(play); - Actor* temp_v0; - s16 temp_v1; - s16 diff; - - Math_StepToS(&this->behaviorInfo.unk4C, 2000, 200); - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 6, this->behaviorInfo.unk4C, 40); - temp_v1 = Math_Vec3f_Pitch(&this->actor.focus.pos, &player->actor.focus.pos); - temp_v1 *= 0.85f; - temp_v1 -= this->actor.shape.rot.x; - substruct->unk26.x = CLAMP(temp_v1, -0xBB8, 0xBB8); - diff = BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.shape.rot.y); - temp_v1 = diff; - temp_v1 *= 0.7f; - substruct->unk26.y = CLAMP(temp_v1, -0x1F40, 0x1F40); - - if (D_80B503F4 == NULL) { - func_80B4BBE0(this); - } else if ((D_80B503F4 != NULL) && (D_80B503F4->actionFunc != func_80B4CB0C)) { - func_80B4BBE0(this); - } -} - -void func_80B4C3A0(Actor* thisx, PlayState* play) { - EnInvadepoh* this = THIS; - - if (Object_IsLoaded(&play->objectCtx, this->bankIndex)) { - s32 pad[2]; - s32 currentTime = gSaveContext.save.time; - - this->actor.objBankIndex = this->bankIndex; - Actor_SetObjectDependency(play, &this->actor); - func_80B44FEC(); - SkelAnime_InitFlex(play, &this->skelAnime, &gCremiaSkel, &gCremiaWalkAnim, this->jointTable, this->morphTable, - CREMIA_LIMB_MAX); - func_80B45C04(&this->behaviorInfo, D_80B4EBDC, 1, D_80B4EC08, 0, &gZeroVec3s, 100, 0.03f, 0.3f, 0.03f); - this->actor.textId = 0x33CD; - if (currentTime < 0xD5A0) { - this->unk304 = -0x8000; - this->xzPosAdjFactor = 40.0f; - } else if (currentTime >= 0xD7D4) { - this->unk304 = -0x4800; - this->xzPosAdjFactor = 20.0f; - } else { - this->unk304 = -0x8000; - this->xzPosAdjFactor = 40.0f; - } - - if ((currentTime >= CLOCK_TIME(6, 0)) && (currentTime < 0xD573)) { - this->actor.update = func_80B4C568; - this->actor.draw = NULL; - } else if ((currentTime >= 0xD573) && (currentTime < CLOCK_TIME(20, 15))) { - this->actor.update = func_80B4C5C0; - this->actor.draw = func_80B4E7BC; - func_80B4BBE0(this); - } else { - Actor_Kill(&this->actor); - } - } -} - -void func_80B4C568(Actor* thisx, PlayState* play) { - EnInvadepoh* this = THIS; - - if ((gSaveContext.save.time >= 0xD573) && (gSaveContext.save.time < CLOCK_TIME(20, 15))) { - this->actor.update = func_80B4C5C0; - this->actor.draw = func_80B4E7BC; - func_80B4BBE0(this); - } -} - -void func_80B4C5C0(Actor* thisx, PlayState* play) { - s32 pad; - EnInvadepoh* this = THIS; - s32 sp2C = CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_40); - s32 isTalking = Actor_ProcessTalkRequest(&this->actor, &play->state); - - if (isTalking) { - func_80151BB4(play, 6); - func_80B4BFFC(this); - } - this->actionFunc(this, play); - if (sp2C && (this->actor.update != NULL)) { - SkelAnime_Update(&this->skelAnime); - func_80B45CE0(&this->behaviorInfo); - if ((this->actionFunc != func_80B4C058) && !isTalking && this->actor.isTargeted) { - func_800B8614(&this->actor, play, 350.0f); - } - Collider_UpdateCylinder(&this->actor, &this->collider); - CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); - } -} - -void func_80B4C6C8(EnInvadepoh* this) { - AlienBehaviorInfo* substruct = &this->behaviorInfo; - - Animation_MorphToLoop(&this->skelAnime, &gRomaniWalkAnim, -10.0f); - substruct->unk26.x = 0; - substruct->unk26.y = 0; - substruct->unk26.z = 0; - substruct->unk30 = 0.1f; - substruct->unk2C = 0x320; - this->actionFunc = func_80B4C730; -} - -void func_80B4C730(EnInvadepoh* this, PlayState* play) { - AlienBehaviorInfo* substruct = &this->behaviorInfo; - EnInvadepoh* sp68 = D_80B503F8; - s32 phi_a2; - s32 temp_v1_3; - s16 temp_v1_4; - s32 temp_v0_2; - Vec3f sp4C; - Vec3f sp40; - s16 diff; - s16 pad; - s16 sp3A; - s16 pad2; - - func_80B44700(this); - func_80B44EFC(this, play); - func_80B43E6C(this, 6, 2000, 100); - phi_a2 = ((this->pathIndex < this->endPoint) ? this->pathIndex : this->endPoint - 1); - - Math_Vec3s_ToVec3f(&sp4C, &this->pathPoints[phi_a2]); - Math_Vec3s_ToVec3f(&sp40, &this->pathPoints[phi_a2 + 1]); - Math_SmoothStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&sp4C, &sp40), 5, 0x7D0, 0x64); - if ((this->pathIndex == 0) || ((this->pathIndex + 1) == this->endPoint)) { - if (this->unk378 == 0) { - temp_v0_2 = func_800FE620(play); - if (temp_v0_2 > 0) { - temp_v0_2 = (R_TIME_SPEED * -23.0f / temp_v0_2) - 0.5f; - this->unk378 = func_80B45550(this, play, SQ(80.0f), temp_v0_2); - } - } - - this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8); - } else { - this->unk378 = 0; - this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8); - } - - temp_v1_3 = play->gameplayFrames % 128; - if ((temp_v1_3 & 0x40) != 0) { - sp3A = Math_Vec3f_Yaw(&this->actor.world.pos, &sp68->actor.world.pos); - if (temp_v1_3 == 64) { - this->behaviorInfo.unk4C = 0; - } - - Math_StepToS(&this->behaviorInfo.unk4C, 2000, 40); - Math_SmoothStepToS(&this->actor.shape.rot.y, sp3A, 6, this->behaviorInfo.unk4C, 40); - temp_v1_4 = Math_Vec3f_Pitch(&this->actor.focus.pos, &sp68->actor.focus.pos); - temp_v1_4 *= 0.85f; - temp_v1_4 -= this->actor.shape.rot.x; - substruct->unk26.x = CLAMP(temp_v1_4, -3000, 3000); - diff = BINANG_SUB(sp3A, this->actor.shape.rot.y); - temp_v1_4 = diff; - temp_v1_4 *= 0.7f; - substruct->unk26.y = CLAMP(temp_v1_4, -8000, 8000); - } - - if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_40) && - (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 7.0f))) { - Actor_PlaySfx(&this->actor, NA_SE_EN_ROMANI_WALK); - } - - if (this->clockTime >= 0.9999f) { - Actor_Kill(&this->actor); - return; - } - - if ((sp68 != NULL) && (sp68->actionFunc == func_80B4C058)) { - func_80B4CC70(this); - } -} - -void func_80B4CAB0(EnInvadepoh* this) { - this->behaviorInfo.unk30 = 0.08f; - this->behaviorInfo.unk2C = 4000; - Animation_MorphToLoop(&this->skelAnime, &gRomaniIdleAnim, -10.0f); - this->behaviorInfo.unk4C = 0; - this->actionFunc = func_80B4CB0C; -} - -void func_80B4CB0C(EnInvadepoh* this, PlayState* play) { - AlienBehaviorInfo* substruct = &this->behaviorInfo; - Player* player = GET_PLAYER(play); - s16 temp_v1; - s16 diff; - - Math_StepToS(&this->behaviorInfo.unk4C, 3000, 500); - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 6, this->behaviorInfo.unk4C, 40); - temp_v1 = (Math_Vec3f_Pitch(&this->actor.focus.pos, &player->actor.focus.pos)); - temp_v1 *= 0.85f; - temp_v1 -= this->actor.shape.rot.x; - substruct->unk26.x = CLAMP(temp_v1, -0xBB8, 0xBB8); - diff = BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.shape.rot.y); - temp_v1 = diff; - temp_v1 *= 0.7f; - substruct->unk26.y = CLAMP(temp_v1, -0x1F40, 0x1F40); - if (Actor_TextboxIsClosing(&this->actor, play)) { - func_80B4C6C8(this); - } -} - -void func_80B4CC70(EnInvadepoh* this) { - this->behaviorInfo.unk30 = 0.08f; - this->behaviorInfo.unk2C = 2000; - Animation_MorphToLoop(&this->skelAnime, &gRomaniIdleAnim, -10.0f); - this->behaviorInfo.unk4C = 0; - this->actionFunc = func_80B4CCCC; -} - -void func_80B4CCCC(EnInvadepoh* this, PlayState* play) { - AlienBehaviorInfo* substruct = &this->behaviorInfo; - Player* player = GET_PLAYER(play); - s16 temp_v1; - s16 diff; - - Math_StepToS(&this->behaviorInfo.unk4C, 2000, 200); - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 6, this->behaviorInfo.unk4C, 40); - temp_v1 = Math_Vec3f_Pitch(&this->actor.focus.pos, &player->actor.focus.pos); - temp_v1 *= 0.85f; - temp_v1 -= this->actor.shape.rot.x; - substruct->unk26.x = CLAMP(temp_v1, -0xBB8, 0xBB8); - diff = BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.shape.rot.y); - temp_v1 = diff; - temp_v1 *= 0.7f; - substruct->unk26.y = CLAMP(temp_v1, -0x1F40, 0x1F40); - if (D_80B503F8 == NULL) { - func_80B4C6C8(this); - } else if ((D_80B503F8 != NULL) && (D_80B503F8->actionFunc != func_80B4C058)) { - func_80B4C6C8(this); - } -} - -void func_80B4CE54(Actor* thisx, PlayState* play) { - s32 pad[2]; - EnInvadepoh* this = THIS; - s32 sp38; - - if (Object_IsLoaded(&play->objectCtx, this->bankIndex)) { - sp38 = gSaveContext.save.time; - - this->actor.objBankIndex = this->bankIndex; - Actor_SetObjectDependency(play, &this->actor); - func_80B44F58(); - SkelAnime_InitFlex(play, &this->skelAnime, &gRomaniSkel, &gRomaniWalkAnim, this->jointTable, this->morphTable, - ROMANI_LIMB_MAX); - func_80B45C04(&this->behaviorInfo, D_80B4EA90, 1, D_80B4EB00, 3, &gZeroVec3s, 100, 0.03f, 0.3f, 0.03f); - func_80B446D0(this, play); - this->actor.world.rot.y = this->actor.shape.rot.y; - func_80B44700(this); - func_80B44EFC(this, play); - func_80B43F0C(this); - func_80B4516C(this); - this->actor.textId = 0x33CE; - if ((sp38 >= CLOCK_TIME(6, 0)) && (sp38 < CLOCK_TIME(20, 0))) { - this->actor.update = func_80B4CFFC; - this->actor.draw = NULL; - } else if ((sp38 >= 0xD555) && (sp38 < 0xD7E1)) { - this->actor.update = func_80B4D054; - this->actor.draw = func_80B4E324; - func_80B4C6C8(this); - } else { - Actor_Kill(&this->actor); - } - } -} - -void func_80B4CFFC(Actor* thisx, PlayState* play) { - EnInvadepoh* this = THIS; - - if ((gSaveContext.save.time >= CLOCK_TIME(20, 0)) && (gSaveContext.save.time < 0xD7E1)) { - this->actor.update = func_80B4D054; - this->actor.draw = func_80B4E324; - func_80B4C6C8(this); - } -} - -void func_80B4D054(Actor* thisx, PlayState* play) { - s32 pad; - EnInvadepoh* this = THIS; - s32 sp2C = CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_40); - s32 isTalking = Actor_ProcessTalkRequest(&this->actor, &play->state); - - if (isTalking) { - func_80151BB4(play, 5); - func_80B4CAB0(this); - } - this->actionFunc(this, play); - if (sp2C && this->actor.update != NULL) { - SkelAnime_Update(&this->skelAnime); - func_80B45CE0(&this->behaviorInfo); - if ((this->actionFunc != func_80B4CB0C) && !isTalking && this->actor.isTargeted) { - func_800B8614(thisx, play, 350.0f); - } - Collider_UpdateCylinder(&this->actor, &this->collider); - CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); - } -} - -void func_80B4D15C(EnInvadepoh* this) { - s32 pad; - s32 temp_v1 = this->actor.params & 7; - unkstruct80B4EE0C* temp_v0; - - Animation_PlayLoop(&this->skelAnime, &gAlienHoldingCowAnim); - this->skelAnime.curFrame = ((this->actor.params & 7) * this->skelAnime.endFrame) * 0.25f; - this->alienAlpha = 255; - this->actor.draw = func_80B4DB14; - this->drawAlien = true; - this->drawAlienDeathEffect = false; - this->alienBeamAlpha = 255; - temp_v0 = &D_80B4EE0C[temp_v1]; - this->velocityStep = temp_v0->unk00; - this->unk304 = temp_v1 * 0x5555; - this->actor.world.pos.x = this->actor.home.pos.x + (Math_SinS(this->unk304) * 80.0f); - this->actor.world.pos.y = this->actor.home.pos.y; - this->actor.world.pos.z = this->actor.home.pos.z + (Math_CosS(this->unk304) * 80.0f); - this->actor.shape.rot.y = this->unk304 + 0x4000; - this->behaviorInfo.unk4C = temp_v0->unk04; - this->behaviorInfo.unk4E = temp_v0->unk06; - this->actionFunc = func_80B4D290; - this->actor.velocity.y = 0.0f; -} - -void func_80B4D290(EnInvadepoh* this, PlayState* play) { - Actor* temp_v1; - f32 sp28; - - if (D_80B503F0 == NULL) { - Actor_Kill(&this->actor); - return; - } - - Math_StepToF(&this->actor.velocity.y, 15.0f, this->velocityStep); - sp28 = Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 850.0f, 0.2f, this->actor.velocity.y, - 0.01f); - this->unk304 += 0x2BC; - this->actor.world.pos.x = this->actor.home.pos.x + Math_SinS(this->unk304) * 80.0f; - this->actor.world.pos.z = this->actor.home.pos.z + Math_CosS(this->unk304) * 80.0f; - this->behaviorInfo.unk4C += this->behaviorInfo.unk4E; - this->actor.shape.rot.y += this->behaviorInfo.unk4C; - temp_v1 = this->actor.child; - - if (this->actor.child != NULL) { - this->actor.child->world.pos.x = this->actor.world.pos.x; - temp_v1->world.pos.y = this->actor.world.pos.y - 38.0f; - temp_v1->world.pos.z = this->actor.world.pos.z; - temp_v1->shape.rot.y = this->actor.shape.rot.y; - } - - if (sp28 < 5.0f) { - Actor_Kill(&this->actor); - } -} - -void func_80B4D3E4(EnInvadepoh* this) { - Animation_PlayLoop(&this->skelAnime, &gAlienHoldingCowAnim); - this->skelAnime.curFrame = (this->actor.params & 7) * this->skelAnime.endFrame * 0.25f; - this->alienAlpha = 255; - this->actor.draw = NULL; - this->drawAlien = true; - this->drawAlienDeathEffect = false; - this->alienBeamAlpha = 255; - this->unk306 = 400; - this->unk304 = 0; - this->actionTimer = 200; - this->actor.velocity.y = 0.0f; - this->actionFunc = func_80B4D480; -} - -void func_80B4D480(EnInvadepoh* this, PlayState* play) { - f32 target; - s32 pad2; - s32 sp2C = false; - f32 new_var3; - - if (this->actionTimer > 0) { - this->actionTimer--; - } - - if (this->actionTimer > 160) { - this->actor.draw = NULL; - } else { - this->actor.draw = func_80B4DB14; - if (1) {} - if ((this->actionTimer < 105) && (this->actionTimer >= 100)) { - this->actor.gravity = -1.0f; - Math_SmoothStepToS(&this->actor.shape.rot.x, 0x2000, 8, 0x320, 0x28); - } else { - this->actor.gravity = 0.7f; - Math_SmoothStepToS(&this->actor.shape.rot.x, 0, 8, 0x320, 0x28); - } - - this->actor.velocity.y += this->actor.gravity; - this->actor.velocity.y *= 0.92f; - if (this->actionTimer > 80) { - this->actor.world.pos.y += this->actor.velocity.y; - } else { - target = (this->actor.home.pos.y + 850.0f); - sp2C = Math_StepToF(&this->actor.world.pos.y, target, fabsf(this->actor.velocity.y)); - } - - new_var3 = (this->unk304 * -0.06f + this->unk306); - new_var3 *= 0.98f; - this->unk306 = new_var3; - this->actor.shape.rot.y += this->unk306; - - if (this->actor.child != NULL) { - Actor* temp_v1 = this->actor.child; - - temp_v1->world.pos.x = this->actor.world.pos.x; - temp_v1->world.pos.y = this->actor.world.pos.y - 30.0f; - temp_v1->world.pos.z = this->actor.world.pos.z; - temp_v1->shape.rot.y = this->actor.shape.rot.y; - } - } - - if ((this->actionTimer <= 0) || sp2C) { - Actor_Kill(&this->actor); - } -} - -void func_80B4D670(Actor* thisx, PlayState* play) { - s32 pad; - EnInvadepoh* this = THIS; - s32 invadepohType; - - if (Object_IsLoaded(&play->objectCtx, this->bankIndex)) { - invadepohType = this->actor.params & 7; - this->actor.objBankIndex = this->bankIndex; - Actor_SetObjectDependency(play, &this->actor); - func_80B45080(); - this->actor.update = func_80B4D760; - SkelAnime_InitFlex(play, &this->skelAnime, &gAlienSkel, &gAlienHoldingCowAnim, this->jointTable, - this->morphTable, ALIEN_LIMB_MAX); - if (invadepohType < 3) { - func_80B453F4(this, play, invadepohType); - func_80B4D15C(this); - } else { - func_80B45460(this, play); - func_80B4D3E4(this); - } - } -} - -void func_80B4D760(Actor* thisx, PlayState* play) { - EnInvadepoh* this = THIS; - - this->actionFunc(this, play); - if (this->actor.update != NULL) { - SkelAnime_Update(&this->skelAnime); - func_800B9010(&this->actor, NA_SE_EN_FOLLOWERS_BEAM_PRE - SFX_FLAG); - } -} - -void func_80B4D7B8(PlayState* play) { - u32 temp_s5; - u32 temp_s6; - unkStruct80B50350* phi_s2; - s32 i; - - OPEN_DISPS(play->state.gfxCtx); - func_8012C2DC(play->state.gfxCtx); - for (phi_s2 = D_80B50350, i = 0; i < 10; phi_s2++, i++) { - if (phi_s2->unk1 > 0) { - temp_s5 = (play->gameplayFrames + ((0x10 * i) & 0xFF)) & 0x7F; - temp_s6 = (u8)(play->gameplayFrames * -0xF); - Matrix_Translate(phi_s2->unk4.x, phi_s2->unk4.y, phi_s2->unk4.z, MTXMODE_NEW); - Matrix_Scale(0.1f, 0.1f, 0.1f, MTXMODE_APPLY); - gDPPipeSync(POLY_XLU_DISP++); - gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 170, phi_s2->unk2); - gDPSetEnvColor(POLY_XLU_DISP++, 255, 50, 0, 0); - gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, temp_s5, 0, 0x20, 0x40, 1, 0, temp_s6, 0x20, 0x40)); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, &gameplay_keep_DL_02E510); - } - } - CLOSE_DISPS(play->state.gfxCtx); -} - -void func_80B4D9B4(Actor* thisx, PlayState* play) { - func_80B4D7B8(play); -} - -s32 func_80B4D9D8(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx, Gfx** gfx) { - return false; -} - -void func_80B4D9F4(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfx) { - EnInvadepoh* this = THIS; - - if ((limbIndex == 12) && (this->alienBeamAlpha != 0)) { - Matrix_Push(); - Matrix_RotateZS(-0x53ED, MTXMODE_APPLY); - Matrix_RotateYS(-0x3830, MTXMODE_APPLY); - Matrix_Scale(1.0f, 1.0f, 1.5f, MTXMODE_APPLY); - Matrix_Get(&D_80B502A0); - Matrix_Pop(); - } else if ((limbIndex == 13) && (this->alienBeamAlpha != 0)) { - Matrix_Push(); - Matrix_RotateZS(-0x53ED, MTXMODE_APPLY); - Matrix_RotateYS(-0x47D0, MTXMODE_APPLY); - Matrix_Scale(1.0f, 1.0f, 1.5f, MTXMODE_APPLY); - Matrix_Get(&D_80B502E0); - Matrix_Pop(); - } - if (limbIndex == 11) { - Matrix_MultVec3f(&D_80B4EE24, &this->actor.focus.pos); - } -} - -void func_80B4DB14(Actor* thisx, PlayState* play) { - EnInvadepoh* this = THIS; - Gfx* gfx; - GraphicsContext* spCC = play->state.gfxCtx; - - OPEN_DISPS(spCC); - func_8012C2DC(spCC); - Matrix_Push(); - if (this->drawAlien) { - Gfx* new_var6; - Gfx* spBC; - GraphicsContext* spB8; - - if (this->alienAlpha == 255) { - func_8012C28C(play->state.gfxCtx); - AnimatedMat_Draw(play, sAlienEmptyTexAnim); - Scene_SetRenderModeXlu(play, 0, 1); - gDPSetEnvColor(spCC->polyOpa.p++, 0, 0, 0, 255); - spCC->polyOpa.p = SkelAnime_DrawFlex(play, this->skelAnime.skeleton, this->skelAnime.jointTable, - this->skelAnime.dListCount, func_80B4D9D8, func_80B4D9F4, &this->actor, - spCC->polyOpa.p); - } else { - AnimatedMat_Draw(play, sAlienEmptyTexAnim); - Scene_SetRenderModeXlu(play, 1, 2); - gDPSetEnvColor(spCC->polyXlu.p++, 0, 0, 0, this->alienAlpha); - spCC->polyXlu.p = SkelAnime_DrawFlex(play, this->skelAnime.skeleton, this->skelAnime.jointTable, - this->skelAnime.dListCount, func_80B4D9D8, func_80B4D9F4, &this->actor, - spCC->polyXlu.p); - } - - if (this->alienBeamAlpha != 0) { - AnimatedMat_Draw(play, sAlienEyeBeamTexAnim); - spB8 = play->state.gfxCtx; - gfx = spBC = spB8->polyXlu.p; - gDPPipeSync(spBC++); - gDPSetPrimColor(spBC++, 0, 255, 240, 180, 100, 60); - gDPSetEnvColor(spBC++, 255, 255, 255, this->alienBeamAlpha * (150.0f / 255.0f)); - Matrix_Mult(&D_80B502A0, MTXMODE_NEW); - gSPMatrix(spBC++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(spBC++, gAlienEyeBeamDL); - Matrix_Mult(&D_80B502E0, MTXMODE_NEW); - gSPMatrix(spBC++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(spBC++, gAlienEyeBeamDL); - spB8->polyXlu.p = spBC; - } - } - - if (this->drawAlienDeathEffect) { - Matrix_SetTranslateRotateYXZ(this->actor.world.pos.x, this->actor.world.pos.y + 68.0f, this->actor.world.pos.z, - &this->actor.shape.rot); - Matrix_Scale(this->alienDeathEffectScale.x, this->alienDeathEffectScale.y, this->alienDeathEffectScale.z, - MTXMODE_APPLY); - gSPMatrix(spCC->polyXlu.p++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(spCC->polyXlu.p++, gAlienDeathFlashDL); - } - - if (this->drawAlien) { - Vec3f sp80; - Vec3f sp74; - s32 alpha2; - GraphicsContext* sp6C = play->state.gfxCtx; - u32 pad; - - gfx = sp6C->polyXlu.p; - gfx = func_8012C868(gfx); - gDPSetDither(gfx++, G_CD_NOISE); - gDPSetCombineLERP(gfx++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, - 0); - Matrix_Mult(&play->billboardMtxF, MTXMODE_NEW); - Matrix_MultVecZ(60.0f, &sp80); - sp74.x = thisx->world.pos.x + sp80.x; - sp74.y = thisx->world.pos.y + sp80.y + 68.0f; - sp74.z = thisx->world.pos.z + sp80.z; - Matrix_Translate(sp74.x, sp74.y, sp74.z, MTXMODE_NEW); - Matrix_Scale(0.25f, 0.25f, 0.25f, MTXMODE_APPLY); - alpha2 = this->alienAlpha * (100.0f / 255.0f); - gSPDisplayList(gfx++, gameplay_keep_DL_029CB0); - gDPSetPrimColor(gfx++, 0, 0, 240, 180, 100, alpha2); - gSPMatrix(gfx++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(gfx++, gameplay_keep_DL_029CF0); - sp6C->polyXlu.p = gfx; - if ((this->alienAlpha > 128) && func_80B456A8(play, &sp74)) { - func_800F9824(play, &play->envCtx, &play->view, play->state.gfxCtx, sp74, 10.0f, 9.0f, 0, 0); - } - } - - Matrix_Pop(); - CLOSE_DISPS(spCC); -} - -s32 func_80B4E120(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { - if (limbIndex == 5) { - EnInvadepoh* this = THIS; - rot->x -= this->actor.shape.rot.x; - } - return false; -} - -void func_80B4E158(Actor* thisx, PlayState* play) { - EnInvadepoh* this = THIS; - - func_8012C5B0(play->state.gfxCtx); - SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, - func_80B4E120, NULL, &this->actor); -} - -void func_80B4E1B0(Actor* thisx, PlayState* play) { - EnInvadepoh* this = THIS; - - func_8012C5B0(play->state.gfxCtx); - SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, NULL, - NULL, &this->actor); -} - -s32 func_80B4E200(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { - if (limbIndex == ROMANI_LIMB_HEAD) { - EnInvadepoh* this = THIS; // both of these needed to match - - rot->x += this->behaviorInfo.unk20.y; - rot->y += this->behaviorInfo.unk20.z; - rot->z += this->behaviorInfo.unk20.x; - } else if (limbIndex == ROMANI_LIMB_TORSO) { - EnInvadepoh* this = THIS; // both of these needed to match - - rot->x += (s16)(this->behaviorInfo.unk34 * this->behaviorInfo.unk20.y); - rot->z += this->behaviorInfo.unk40; - } - return false; -} - -void func_80B4E2AC(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { - EnInvadepoh* this = THIS; - - if (limbIndex == ROMANI_LIMB_LEFT_HAND) { - OPEN_DISPS(play->state.gfxCtx); - gSPDisplayList(POLY_OPA_DISP++, gRomaniBowDL); - CLOSE_DISPS(play->state.gfxCtx); - } else if (limbIndex == ROMANI_LIMB_HEAD) { - Matrix_MultVec3f(&D_80B4EE30, &this->actor.focus.pos); - } -} - -void func_80B4E324(Actor* thisx, PlayState* play) { - EnInvadepoh* this = THIS; - - OPEN_DISPS(play->state.gfxCtx); - func_8012C28C(play->state.gfxCtx); - gSPSegment(POLY_OPA_DISP++, 0x09, sRomaniMouthTextures[this->behaviorInfo.unk10.unkF]); - gSPSegment(POLY_OPA_DISP++, 0x08, sRomaniEyeTextures[this->behaviorInfo.unk0.unkF]); - SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, - func_80B4E200, func_80B4E2AC, &this->actor); - CLOSE_DISPS(play->state.gfxCtx); -} - -void func_80B4E3F0(Actor* thisx, PlayState* play) { - s32 pad; - EnInvadepoh* this = THIS; - Vec3f sp5C; - - Matrix_Push(); - Matrix_Mult(&play->billboardMtxF, MTXMODE_NEW); - Matrix_MultVecZ(200.0f, &sp5C); - Matrix_Pop(); - sp5C.x += thisx->world.pos.x; - sp5C.y += thisx->world.pos.y; - sp5C.z += thisx->world.pos.z; - EnInvadepoh_SetSysMatrix(&sp5C); - Matrix_ReplaceRotation(&play->billboardMtxF); - Matrix_RotateZS(this->unk304, MTXMODE_APPLY); - OPEN_DISPS(play->state.gfxCtx); - func_8012C2DC(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gDPSetPrimColor(POLY_XLU_DISP++, 0xFF, 0x80, 255, 255, 0, 180); - gDPSetEnvColor(POLY_XLU_DISP++, 255, 50, 0, 0); - gSPDisplayList(POLY_XLU_DISP++, gEffFlash1DL); - if (func_80B456A8(play, &sp5C)) { - func_800F9824(play, &play->envCtx, &play->view, play->state.gfxCtx, sp5C, 20.0f, 9.0f, 0, 0); - } - - CLOSE_DISPS(play->state.gfxCtx); -} - -s32 func_80B4E5B0(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { - if ((limbIndex == DOG_LIMB_HEAD) || (limbIndex == DOG_LIMB_RIGHT_FACE_HAIR) || - (limbIndex == DOG_LIMB_LEFT_FACE_HAIR)) { - EnInvadepoh* this = THIS; - - rot->x += this->behaviorInfo.unk20.x; - rot->y += this->behaviorInfo.unk20.y; - rot->z += this->behaviorInfo.unk20.z; - } - - return false; -} - -void func_80B4E61C(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { - EnInvadepoh* this = THIS; - - if (limbIndex == DOG_LIMB_HEAD) { - Matrix_MultVecY(20.0f, &this->actor.focus.pos); - } -} - -void func_80B4E660(Actor* thisx, PlayState* play) { - EnInvadepoh* this = THIS; - - OPEN_DISPS(play->state.gfxCtx); - func_8012C28C(play->state.gfxCtx); - gDPSetEnvColor(POLY_OPA_DISP++, 255, 255, 200, 0); - SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, - func_80B4E5B0, func_80B4E61C, &this->actor); - CLOSE_DISPS(play->state.gfxCtx); -} - -s32 func_80B4E6E4(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { - if (limbIndex == 9) { - EnInvadepoh* this = THIS; // both of these needed to match - - rot->x += this->behaviorInfo.unk20.y; - rot->y += this->behaviorInfo.unk20.z; - rot->z += this->behaviorInfo.unk20.x; - } else if (limbIndex == 2) { - EnInvadepoh* this = THIS; // both of these needed to match - - rot->x += (s16)(this->behaviorInfo.unk34 * this->behaviorInfo.unk20.y); - } - return false; -} - -void func_80B4E784(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { - EnInvadepoh* this = THIS; - - if (limbIndex == 9) { - Matrix_MultZero(&this->actor.focus.pos); - } -} - -void func_80B4E7BC(Actor* thisx, PlayState* play) { - EnInvadepoh* this = THIS; - - OPEN_DISPS(play->state.gfxCtx); - func_8012C28C(play->state.gfxCtx); - gSPSegment(POLY_OPA_DISP++, 0x09, sCremiaMouthTextures[this->behaviorInfo.unk10.unkF]); - gSPSegment(POLY_OPA_DISP++, 0x08, sCremiaEyeTextures[this->behaviorInfo.unk0.unkF]); - SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, - func_80B4E6E4, func_80B4E784, &this->actor); - CLOSE_DISPS(play->state.gfxCtx); -} +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B45980.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B459E8.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B45A4C.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B45A94.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B45B1C.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B45BB8.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B45C04.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B45CE0.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B45EC8.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B46118.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B46184.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B461DC.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4627C.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B46414.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B46520.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B465CC.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B46644.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B468B4.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B469C4.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B46A80.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/EnInvadepoh_Init.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B46BB0.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B46BC0.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B46C08.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B46C34.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B46C50.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B46C7C.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B46C94.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B46CC0.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B46CF4.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B46D28.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/EnInvadepoh_Destroy.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B46DA8.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B46DC8.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B46E20.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B46E44.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B46EC0.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B46EE8.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B46F88.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B46FA8.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B47064.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B47084.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B470E0.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B47108.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B471C0.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B471E0.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B47248.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B47268.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B47278.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B47298.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B47304.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B47324.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/EnInvadepoh_Update.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B47380.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B473E4.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B47478.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B474DC.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B47568.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B47600.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4770C.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B477B4.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B47830.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B478F4.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B47938.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B479E8.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B47BAC.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B47D30.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B47FA8.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B48060.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B481C4.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4827C.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B482D4.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B48324.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B48374.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B483CC.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4843C.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B484EC.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B48588.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B48610.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B48620.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4873C.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B487B4.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B48848.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B48948.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B48AD4.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B48DE4.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B48E4C.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B48FB0.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B490F0.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B491EC.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B49228.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B492FC.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4934C.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B49404.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B49454.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B49628.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B49670.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B497A4.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B497EC.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B49904.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4994C.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B499BC.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B49A00.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B49B1C.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B49BD0.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B49C38.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B49DA0.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B49DFC.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B49F88.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4A168.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4A1B8.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4A2C0.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4A350.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4A570.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4A5E4.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4A614.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4A67C.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4A7C0.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4A81C.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4A9C8.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4AB8C.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4ABDC.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4ACDC.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4ACF0.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4AD3C.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4AD60.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4ADB8.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4ADCC.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4AEC0.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4AEDC.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4AF80.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4AF94.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4B024.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4B048.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4B0C4.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4B218.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4B3DC.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4B430.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4B484.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4B510.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4B564.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4B724.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4B768.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4B820.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4B864.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4B8BC.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4BA30.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4BA84.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4BBE0.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4BC4C.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4BFFC.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4C058.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4C1BC.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4C218.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4C3A0.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4C568.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4C5C0.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4C6C8.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4C730.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4CAB0.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4CB0C.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4CC70.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4CCCC.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4CE54.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4CFFC.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4D054.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4D15C.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4D290.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4D3E4.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4D480.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4D670.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4D760.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4D7B8.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4D9B4.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4D9D8.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4D9F4.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4DB14.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4E120.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4E158.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4E1B0.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4E200.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4E2AC.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4E324.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4E3F0.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4E5B0.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4E61C.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4E660.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4E6E4.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4E784.s") + +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Invadepoh/func_80B4E7BC.s") diff --git a/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.h b/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.h index 061d9c326f..54253ad03f 100644 --- a/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.h +++ b/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.h @@ -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 diff --git a/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.c b/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.c index 145c0507d0..ac717641b8 100644 --- a/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.c +++ b/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.c @@ -229,6 +229,7 @@ void EnPoFusen_IncrementRomaniPop(EnPoFusen* this) { if ((parent != NULL) && (parent->id == ACTOR_EN_MA4)) { EnMa4* romani = (EnMa4*)parent; + romani->poppedBalloonCounter++; } diff --git a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c index f4a46eeae7..c41f455798 100644 --- a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c +++ b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c @@ -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") diff --git a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.h b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.h index f7ff62fa9a..4e3126e252 100644 --- a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.h +++ b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.h @@ -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 diff --git a/src/overlays/actors/ovl_Obj_Boyo/z_obj_boyo.c b/src/overlays/actors/ovl_Obj_Boyo/z_obj_boyo.c index cc5e1caf13..e5e53000a7 100644 --- a/src/overlays/actors/ovl_Obj_Boyo/z_obj_boyo.c +++ b/src/overlays/actors/ovl_Obj_Boyo/z_obj_boyo.c @@ -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") diff --git a/src/overlays/actors/ovl_Obj_Boyo/z_obj_boyo.h b/src/overlays/actors/ovl_Obj_Boyo/z_obj_boyo.h index dcff2a893a..feb95dcd13 100644 --- a/src/overlays/actors/ovl_Obj_Boyo/z_obj_boyo.h +++ b/src/overlays/actors/ovl_Obj_Boyo/z_obj_boyo.h @@ -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 diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index 5ac01aab64..01917fd8ca 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -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",), diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index 7455f7c2ce..0b44baae33 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -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), diff --git a/undefined_syms.txt b/undefined_syms.txt index 1809e16000..f0578ff167 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -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;