1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-14 03:44:34 +00:00

Decompile a bunch of objects (#603)

* Mostly done but shifted

* still messed up

* Almost OK

* OBJECT_JYA_OBJ OK, OBJECT_GR OK

* Done

* Merge master and format

* Cleanup

* Cleanup 2

* Start object MB dont merge yet

* Object_MB OK

* Object_ydan_objects OK

* General 'ydan' actor cleanup

* Forgot some small things

* Object_EC OK

* add .gitkeep and run format

* Object_sd OK but no textures cause of a zap issue

* PR fixes

* Fix object_sd

* fix ydan

* delete .gitkeep files

* OBJECT_BOX as far as it can go with current ZAP

* Fix undefined_syms

* Start child link object

* Push progress, dont merge yet

* Object_mori_objects OK

* Fixed?

* Fix conflicts again

* Seems like i missed some textures

* Extract data for BgBombwall

* More field

* ZAP YEP 2.0

* Object_Box OK

* Object_SD ok.  Ready to merge

* remove ASM and merge master

* remove ASM

* remove files wrongfully added to docs/

* Almost done

* Change comment in z_player_lib.c

* forgot some DLists in player_lib.c

* Fix conflict, run format

* Same as before but this time with Tex and TLUT

* Last few things

* fix object_GR and add limbs to object_sd

* Nane -> Name

* gChildDekuShieldMtx is now a matrix and not a blob

* PR fixes (Fig)

* add a space for comment in z_player_lib.c

* re push and new lines

* PR fixes (AngheloAlf)

* PR fixes (Roman)

* Fix Heishi2

* PR fixes (Fig)

* Replace spacing in a file

* PR fixes (Roman)
This commit is contained in:
louist103 2021-05-26 18:59:21 -04:00 committed by GitHub
parent 36fead60a0
commit 201c9ec1cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
72 changed files with 1499 additions and 1128 deletions

View file

@ -1,4 +1,5 @@
#include "global.h"
#include "objects/gameplay_field_keep/gameplay_field_keep.h"
#pragma GLOBAL_ASM("asm/non_matchings/code/z_kankyo/func_8006F0A0.s")

View file

@ -1,5 +1,6 @@
#include "global.h"
#include "objects/gameplay_keep/gameplay_keep.h"
#include "objects/object_link_child/object_link_child.h"
typedef struct {
/* 0x00 */ u8 flag;
@ -11,7 +12,7 @@ typedef struct {
/* 0x04 */ Vec3f pos;
} BowStringData; // size = 0x10
FlexSkeletonHeader* gPlayerSkelHeaders[] = { 0x060377F4, 0x0602CF6C };
FlexSkeletonHeader* gPlayerSkelHeaders[] = { 0x060377F4, &gLinkChildSkel };
s16 sBootData[PLAYER_BOOTS_MAX][17] = {
{ 200, 1000, 300, 700, 550, 270, 600, 350, 800, 600, -100, 600, 590, 750, 125, 200, 130 },
@ -44,146 +45,164 @@ u8 gPlayerModelTypes[][5] = {
};
Gfx* D_80125CE8[] = {
0x060226E0, 0x06014320, 0x06027690, 0x06016620, 0x060226E0, 0x06014440, 0x06027690, 0x06016740,
0x06022970, 0x06014320, 0x06027918, 0x06016620, 0x060241C0, 0x06014320, 0x06028B40, 0x06016620,
0x060226E0, gLinkChildRightHandClosedNearDL, 0x06027690, gLinkChildRightHandClosedFarDL,
0x060226E0, gLinkChildRightFistAndDekuShieldNearDL, 0x06027690, gLinkChildRightFistAndDekuShieldFarDL,
0x06022970, gLinkChildRightHandClosedNearDL, 0x06027918, gLinkChildRightHandClosedFarDL,
0x060241C0, gLinkChildRightHandClosedNearDL, 0x06028B40, gLinkChildRightHandClosedFarDL,
};
Gfx* D_80125D28[] = {
0x06023160, 0x06015248, 0x06027F00, 0x06017360, 0x06023160, 0x06014D68, 0x06027F00, 0x06016EE8,
0x06020A78, 0x060148A8, 0x06025FB8, 0x06016A98, 0x060211B8, 0x06015248, 0x060264F0, 0x06017360,
0x06023160, gLinkChildSwordAndSheathNearDL,
0x06027F00, gLinkChildSwordAndSheathFarDL,
0x06023160, gLinkChildDekuShieldSwordAndSheathNearDL,
0x06027F00, gLinkChildDekuShieldSwordAndSheathFarDL,
0x06020A78, gLinkChildHylianShieldSwordAndSheathNearDL,
0x06025FB8, gLinkChildHylianShieldSwordAndSheathFarDL,
0x060211B8, gLinkChildSwordAndSheathNearDL,
0x060264F0, gLinkChildSwordAndSheathFarDL,
};
Gfx* D_80125D68[] = {
NULL, NULL, NULL, NULL, NULL, 0x06022688, NULL, 0x06022688,
NULL, NULL, NULL, NULL, NULL, gLinkChildDekuShieldWithMatrixDL, NULL, gLinkChildDekuShieldWithMatrixDL,
};
Gfx* D_80125D88[] = {
0x060249D8, 0x06015408, 0x06028150, 0x06017500, 0x060249D8, 0x06015010, 0x06028150, 0x06017150,
0x06020E70, 0x06014B40, 0x060262B8, 0x06016CF8, 0x060216B0, 0x06015408, 0x06026910, 0x06017500,
NULL, NULL, NULL, NULL, 0x060249D8, 0x06022688, 0x060249D8, 0x06022688,
0x060249D8, gLinkChildSheathNearDL,
0x06028150, gLinkChildSheathFarDL,
0x060249D8, gLinkChildDekuShieldAndSheathNearDL,
0x06028150, gLinkChildDekuShieldAndSheathFarDL,
0x06020E70, gLinkChildHylianShieldAndSheathNearDL,
0x060262B8, gLinkChildHylianShieldAndSheathFarDL,
0x060216B0, gLinkChildSheathNearDL,
0x06026910, gLinkChildSheathFarDL,
NULL, NULL,
NULL, NULL,
0x060249D8, gLinkChildDekuShieldWithMatrixDL,
0x060249D8, gLinkChildDekuShieldWithMatrixDL,
};
Gfx* D_80125DE8[] = {
0x060238C8, 0x06015540, 0x060286B8, 0x06015540, 0x06023D50, 0x06015540, 0x060291E8, 0x06015540,
0x060238C8, gLinkChildLeftHandHoldingMasterSwordDL, 0x060286B8, gLinkChildLeftHandHoldingMasterSwordDL,
0x06023D50, gLinkChildLeftHandHoldingMasterSwordDL, 0x060291E8, gLinkChildLeftHandHoldingMasterSwordDL,
};
Gfx* D_80125E08[] = {
0x06021AA8,
0x06013CB0,
gLinkChildLeftHandNearDL,
0x06026C58,
0x06016280,
gLinkChildLeftHandFarDL,
};
Gfx* D_80125E18[] = {
0x06021CE8,
0x06013E18,
gLinkChildLeftFistNearDL,
0x06026DF0,
0x060163C0,
gLinkChildLeftFistFarDL,
};
Gfx* D_80125E28[] = {
0x06021F78,
0x06013F38,
gLinkChildLeftFistAndKokiriSwordNearDL,
0x06027078,
0x06017630,
gLinkChildLeftFistAndKokiriSwordFarDL,
};
Gfx* D_80125E38[] = {
0x06021F78,
0x06013F38,
gLinkChildLeftFistAndKokiriSwordNearDL,
0x06027078,
0x06017630,
gLinkChildLeftFistAndKokiriSwordFarDL,
};
Gfx* D_80125E48[] = {
0x06022498,
0x060141C0,
gLinkChildRightHandNearDL,
0x060274F8,
0x060164E0,
gLinkChildRightHandFarDL,
};
Gfx* D_80125E58[] = {
0x060226E0,
0x06014320,
gLinkChildRightHandClosedNearDL,
0x06027690,
0x06016620,
gLinkChildRightHandClosedFarDL,
};
Gfx* D_80125E68[] = {
0x06022DA8,
0x06015DF0,
gLinkChildRightHandHoldingFairySlingshotNearDL,
0x06027B88,
0x06017D38,
gLinkChildRightHandHoldingFairySlingshotFarDL,
};
Gfx* D_80125E78[] = {
0x06023160,
0x06015248,
gLinkChildSwordAndSheathNearDL,
0x06027F00,
0x06017360,
gLinkChildSwordAndSheathFarDL,
};
Gfx* D_80125E88[] = {
0x060249D8,
0x06015408,
gLinkChildSheathNearDL,
0x06028150,
0x06017500,
gLinkChildSheathFarDL,
};
Gfx* D_80125E98[] = {
0x06035330,
0x060202A8,
gLinkChildWaistNearDL,
0x0602F530,
0x0601AEC8,
gLinkChildWaistFarDL,
};
Gfx* D_80125EA8[] = {
0x06022DA8,
0x06015DF0,
gLinkChildRightHandHoldingFairySlingshotNearDL,
0x06027B88,
0x06017D38,
gLinkChildRightHandHoldingFairySlingshotFarDL,
};
Gfx* D_80125EB8[] = {
0x06024698,
0x06015BA8,
gLinkChildRightHandHoldingFairyOcarinaNearDL,
0x06028F58,
0x06017AF0,
gLinkChildRightHandHoldingFairyOcarinaFarDL,
};
Gfx* D_80125EC8[] = {
0x06024698,
0x06015958,
gLinkChildRightHandAndOOTNearDL,
0x06028F58,
0x060178A0,
gLinkChildRightHandHoldingOOTFarDL,
};
Gfx* D_80125ED8[] = {
0x06024D70,
0x060141C0,
gLinkChildRightHandNearDL,
0x06024D70,
0x060164E0,
gLinkChildRightHandFarDL,
};
Gfx* D_80125EE8[] = {
0x060233E0,
0x06013CB0,
gLinkChildLeftHandNearDL,
0x06028288,
0x06016280,
gLinkChildLeftHandFarDL,
};
Gfx* D_80125EF8[] = {
0x06021AA8,
0x06014660,
gLinkChildLeftFistAndBoomerangNearDL,
0x06026C58,
0x06016908,
gLinkChildLeftFistAndBoomerangFarDL,
};
Gfx* D_80125F08[] = {
0x06024B58,
0x06015FD0,
gLinkChildLeftHandUpNearDL,
0x06024B58,
0x06015FD0,
gLinkChildLeftHandUpNearDL,
};
Gfx* D_80125F18[] = {
@ -198,7 +217,7 @@ Gfx* D_80125F20[] = {
Gfx* D_80125F28[] = {
0x06036E58,
0x06021AE8,
gLinkChildLeftShoulderNearDL,
};
Gfx* D_80125F30[] = {
@ -208,7 +227,7 @@ Gfx* D_80125F30[] = {
Gfx* D_80125F38[] = {
0x0602A248,
0x06018048,
gLinkChildRightArmStretchedSlingshotDL,
};
// Indexed by model types (left hand, right hand, sheath or waist)
@ -599,11 +618,17 @@ u8 sEyeMouthIndexes[][2] = {
{ 7, 2 }, { 0, 2 }, { 3, 0 }, { 4, 0 }, { 2, 2 }, { 1, 1 }, { 0, 2 }, { 0, 0 },
};
u8* sEyeTextures[] = {
/**
* Link's eye and mouth textures are placed at the exact same place in adult and child Link's respective object files.
* This allows the array to only contain the symbols for one file and have it apply to both. This is a problem for
* shiftability, and changes will need to be made in the code to account for this in a modding scenario. The symbols
* from adult Link's object are used here.
*/
void* sEyeTextures[] = {
0x06000000, 0x06000800, 0x06001000, 0x06001800, 0x06002000, 0x06002800, 0x06003000, 0x06003800,
};
u8* sMouthTextures[] = {
void* sMouthTextures[] = {
0x06004000,
0x06004400,
0x06004800,
@ -677,7 +702,7 @@ void func_8008F470(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable,
}
} else {
if (Player_GetStrength() > PLAYER_STR_NONE) {
gSPDisplayList(POLY_OPA_DISP++, D_06016118);
gSPDisplayList(POLY_OPA_DISP++, gLinkChildGoronBraceletDL);
}
}
}
@ -1112,7 +1137,7 @@ f32 sSwordLengths[] = {
0.0f, 4000.0f, 3000.0f, 5500.0f, 0.0f, 2500.0f,
};
Gfx* sBottleDLists[] = { 0x0602AD58, 0x06018478 };
Gfx* sBottleDLists[] = { 0x0602AD58, gLinkChildBottleDL };
Color_RGB8 sBottleColors[] = {
{ 255, 255, 255 }, { 80, 80, 255 }, { 255, 100, 255 }, { 0, 0, 255 }, { 255, 0, 255 },
@ -1186,7 +1211,7 @@ void func_80090D20(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_player_lib.c", 2653),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, D_06006CC0);
gSPDisplayList(POLY_OPA_DISP++, gLinkChildLinkDekuStickDL);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_player_lib.c", 2656);
} else if ((this->actor.scale.y >= 0.0f) && (this->swordState != 0)) {

View file

@ -5,6 +5,7 @@
*/
#include "z_bg_bombwall.h"
#include "objects/gameplay_field_keep/gameplay_field_keep.h"
#define FLAGS 0x00400000
@ -21,10 +22,6 @@ void func_8086EDFC(BgBombwall* this, GlobalContext* globalCtx);
void func_8086EE40(BgBombwall* this, GlobalContext* globalCtx);
void func_8086EE94(BgBombwall* this, GlobalContext* globalCtx);
extern CollisionHeader D_050041B0;
extern Gfx D_05003FC0[];
extern Gfx D_05004088[];
static ColliderTrisElementInit sTrisElementsInit[3] = {
{
{
@ -92,7 +89,7 @@ void BgBombwall_InitDynapoly(BgBombwall* this, GlobalContext* globalCtx) {
CollisionHeader* colHeader = NULL;
DynaPolyActor_Init(&this->dyna, DPM_UNK);
CollisionHeader_GetVirtual(&D_050041B0, &colHeader);
CollisionHeader_GetVirtual(&gBgBombwallCol, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader);
if (this->dyna.bgId == BG_ACTOR_MAX) {
@ -176,7 +173,7 @@ void BgBombwall_Destroy(Actor* thisx, GlobalContext* globalCtx) {
BgBombwall_DestroyCollision(this, globalCtx);
}
Vec3s D_8086F010[] = {
static Vec3s D_8086F010[] = {
{ 40, 85, 21 }, { -43, 107, 14 }, { -1, 142, 14 }, { -27, 44, 27 }, { 28, 24, 20 }, { -39, 54, 21 }, { 49, 50, 20 },
};
@ -210,7 +207,7 @@ void func_8086EB5C(BgBombwall* this, GlobalContext* globalCtx) {
}
void func_8086ED50(BgBombwall* this, GlobalContext* globalCtx) {
this->dList = D_05003FC0;
this->dList = gBgBombwallNormalDL;
this->actionFunc = func_8086ED70;
}
@ -225,7 +222,7 @@ void func_8086ED70(BgBombwall* this, GlobalContext* globalCtx) {
}
void func_8086EDFC(BgBombwall* this, GlobalContext* globalCtx) {
this->dList = D_05003FC0;
this->dList = gBgBombwallNormalDL;
this->unk_2A0 = 1;
func_8086EB5C(this, globalCtx);
this->actionFunc = func_8086EE40;
@ -244,7 +241,7 @@ void func_8086EE40(BgBombwall* this, GlobalContext* globalCtx) {
}
void func_8086EE94(BgBombwall* this, GlobalContext* globalCtx) {
this->dList = D_05004088;
this->dList = gBgBombwallBrokenDL;
BgBombwall_DestroyCollision(this, globalCtx);
this->actionFunc = NULL;
}

View file

@ -5,6 +5,7 @@
*/
#include "z_bg_jya_1flift.h"
#include "objects/object_jya_obj/object_jya_obj.h"
#define FLAGS 0x00000010
@ -15,12 +16,12 @@ void BgJya1flift_Destroy(Actor* thisx, GlobalContext* globalCtx);
void BgJya1flift_Update(Actor* thisx, GlobalContext* globalCtx);
void BgJya1flift_Draw(Actor* thisx, GlobalContext* globalCtx);
void func_80892DB0(BgJya1flift* this);
void func_80892DCC(BgJya1flift* this, GlobalContext* globalCtx);
void BgJya1flift_SetupWaitForSwitch(BgJya1flift* this);
void BgJya1flift_WaitForSwitch(BgJya1flift* this, GlobalContext* globalCtx);
void BgJya1flift_DoNothing(BgJya1flift* this, GlobalContext* globalCtx);
void BgJya1flift_ChangeDirection(BgJya1flift* this);
void BgJya1flift_Move(BgJya1flift* this, GlobalContext* globalCtx);
void func_80892E0C(BgJya1flift* this);
void BgJya1flift_SetupDoNothing(BgJya1flift* this);
void BgJya1flift_ResetMoveDelay(BgJya1flift* this);
void BgJya1flift_DelayMove(BgJya1flift* this, GlobalContext* globalCtx);
@ -67,10 +68,8 @@ static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneDownward, 1200, ICHAIN_STOP),
};
extern CollisionHeader D_060004A8;
extern Gfx D_060001F0[];
void BgJya1flift_InitDynapoly(BgJya1flift* this, GlobalContext* globalCtx, CollisionHeader* collision, s32 moveFlag) {
void BgJya1flift_InitDynapoly(BgJya1flift* this, GlobalContext* globalCtx, CollisionHeader* collision,
DynaPolyMoveFlag moveFlag) {
s32 pad;
CollisionHeader* colHeader = NULL;
s32 pad2;
@ -103,13 +102,13 @@ void BgJya1flift_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_Kill(thisx);
return;
}
BgJya1flift_InitDynapoly(this, globalCtx, &D_060004A8, DPM_UNK);
BgJya1flift_InitDynapoly(this, globalCtx, &g1fliftCol, 0);
Actor_ProcessInitChain(thisx, sInitChain);
BgJya1flift_InitCollision(thisx, globalCtx);
if (Flags_GetSwitch(globalCtx, (thisx->params & 0x3F))) {
LINK_AGE_IN_YEARS == YEARS_ADULT ? BgJya1flift_ChangeDirection(this) : func_80892E0C(this);
LINK_AGE_IN_YEARS == YEARS_ADULT ? BgJya1flift_ChangeDirection(this) : BgJya1flift_SetupDoNothing(this);
} else {
func_80892DB0(this);
BgJya1flift_SetupWaitForSwitch(this);
}
thisx->room = -1;
sIsSpawned = true;
@ -126,18 +125,18 @@ void BgJya1flift_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
}
void func_80892DB0(BgJya1flift* this) {
this->actionFunc = func_80892DCC;
void BgJya1flift_SetupWaitForSwitch(BgJya1flift* this) {
this->actionFunc = BgJya1flift_WaitForSwitch;
this->dyna.actor.world.pos.y = sFinalPositions[0];
}
void func_80892DCC(BgJya1flift* this, GlobalContext* globalCtx) {
void BgJya1flift_WaitForSwitch(BgJya1flift* this, GlobalContext* globalCtx) {
if (Flags_GetSwitch(globalCtx, (this->dyna.actor.params & 0x3F))) {
BgJya1flift_ChangeDirection(this);
}
}
void func_80892E0C(BgJya1flift* this) {
void BgJya1flift_SetupDoNothing(BgJya1flift* this) {
this->actionFunc = BgJya1flift_DoNothing;
this->dyna.actor.world.pos.y = sFinalPositions[0];
}
@ -208,5 +207,5 @@ void BgJya1flift_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void BgJya1flift_Draw(Actor* thisx, GlobalContext* globalCtx) {
Gfx_DrawDListOpa(globalCtx, D_060001F0);
Gfx_DrawDListOpa(globalCtx, g1fliftDL);
}

View file

@ -5,6 +5,7 @@
*/
#include "z_bg_jya_amishutter.h"
#include "objects/object_jya_obj/object_jya_obj.h"
#define FLAGS 0x00000000
@ -15,8 +16,8 @@ void BgJyaAmishutter_Destroy(Actor* thisx, GlobalContext* globalCtx);
void BgJyaAmishutter_Update(Actor* thisx, GlobalContext* globalCtx);
void BgJyaAmishutter_Draw(Actor* thisx, GlobalContext* globalCtx);
void func_808933BC(BgJyaAmishutter* this);
void func_808933CC(BgJyaAmishutter* this);
void BgJyaAmishutter_SetupWaitForPlayer(BgJyaAmishutter* this);
void BgJyaAmishutter_WaitForPlayer(BgJyaAmishutter* this);
void func_80893428(BgJyaAmishutter* this);
void func_80893438(BgJyaAmishutter* this);
void func_808934B0(BgJyaAmishutter* this);
@ -43,13 +44,11 @@ static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_STOP),
};
extern CollisionHeader D_0600C4C8;
extern Gfx D_0600C0A0[];
void func_808932C0(BgJyaAmishutter* this, GlobalContext* globalCtx, CollisionHeader* collision, DynaPolyMoveFlag flag) {
s16 pad1;
void BgJyaAmishutter_InitDynaPoly(BgJyaAmishutter* this, GlobalContext* globalCtx, CollisionHeader* collision,
DynaPolyMoveFlag flag) {
s32 pad1;
CollisionHeader* colHeader = NULL;
s16 pad2;
s32 pad2;
DynaPolyActor_Init(&this->dyna, flag);
CollisionHeader_GetVirtual(collision, &colHeader);
@ -63,9 +62,9 @@ void func_808932C0(BgJyaAmishutter* this, GlobalContext* globalCtx, CollisionHea
void BgJyaAmishutter_Init(Actor* thisx, GlobalContext* globalCtx) {
BgJyaAmishutter* this = THIS;
func_808932C0(this, globalCtx, &D_0600C4C8, DPM_UNK);
BgJyaAmishutter_InitDynaPoly(this, globalCtx, &gAmishutterCol, DPM_UNK);
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
func_808933BC(this);
BgJyaAmishutter_SetupWaitForPlayer(this);
}
void BgJyaAmishutter_Destroy(Actor* thisx, GlobalContext* globalCtx) {
@ -74,15 +73,13 @@ void BgJyaAmishutter_Destroy(Actor* thisx, GlobalContext* globalCtx) {
DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
}
void func_808933BC(BgJyaAmishutter* this) {
this->actionFunc = func_808933CC;
void BgJyaAmishutter_SetupWaitForPlayer(BgJyaAmishutter* this) {
this->actionFunc = BgJyaAmishutter_WaitForPlayer;
}
void func_808933CC(BgJyaAmishutter* this) {
if (this->dyna.actor.xzDistToPlayer < 60.0f) {
if (fabsf(this->dyna.actor.yDistToPlayer) < 30.0f) {
func_80893428(this);
}
void BgJyaAmishutter_WaitForPlayer(BgJyaAmishutter* this) {
if ((this->dyna.actor.xzDistToPlayer < 60.0f) && (fabsf(this->dyna.actor.yDistToPlayer) < 30.0f)) {
func_80893428(this);
}
}
@ -115,7 +112,7 @@ void func_808934FC(BgJyaAmishutter* this) {
void func_8089350C(BgJyaAmishutter* this) {
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 3.0f)) {
func_808933BC(this);
BgJyaAmishutter_SetupWaitForPlayer(this);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_METALDOOR_STOP);
} else {
func_8002F974(&this->dyna.actor, NA_SE_EV_METALDOOR_SLIDE - SFX_FLAG);
@ -129,5 +126,5 @@ void BgJyaAmishutter_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void BgJyaAmishutter_Draw(Actor* thisx, GlobalContext* globalCtx) {
Gfx_DrawDListOpa(globalCtx, D_0600C0A0);
Gfx_DrawDListOpa(globalCtx, gAmishutterDL);
}

View file

@ -5,6 +5,7 @@
*/
#include "z_bg_jya_bigmirror.h"
#include "objects/object_jya_obj/object_jya_obj.h"
#define FLAGS 0x00000030
@ -41,11 +42,6 @@ static BigMirrorDataEntry sCobraSpawnData[] = {
{ { 60.0f, 1743.0f, -310.0f }, 0xFF02, 0x8000, 0xA000 },
};
extern Gfx D_0600BC70[];
extern Gfx D_0600BD80[];
extern Gfx D_0600E1B0[];
extern Gfx D_0600E2D0[];
void BgJyaBigmirror_SetRoomFlag(Actor* thisx, GlobalContext* globalCtx) {
BgJyaBigmirror* this = THIS;
@ -68,11 +64,9 @@ void BgJyaBigmirror_HandleCobra(Actor* thisx, GlobalContext* globalCtx) {
s32 i;
if (this->puzzleFlags & (BIGMIR_PUZZLE_IN_1ST_TOP_ROOM | BIGMIR_PUZZLE_IN_2ND_TOP_ROOM)) {
for (i = 0; i < 2; i++) {
curSpawnData = &sCobraSpawnData[i];
curCobraInfo = &this->cobraInfo[i];
if (curCobraInfo->cobra != NULL) {
curCobraInfo->rotY = curCobraInfo->cobra->dyna.actor.shape.rot.y;
@ -197,7 +191,7 @@ void BgJyaBigmirror_Init(Actor* thisx, GlobalContext* globalCtx) {
this->mirRayObjIndex = -1;
// jya Bigmirror
osSyncPrintf("(jya 大鏡)(arg_data 0x%04x)\n", this->actor.params, this);
osSyncPrintf("(jya 大鏡)(arg_data 0x%04x)\n", this->actor.params);
}
void BgJyaBigmirror_Destroy(Actor* thisx, GlobalContext* globalCtx) {
@ -231,7 +225,7 @@ void BgJyaBigmirror_DrawLightBeam(Actor* thisx, GlobalContext* globalCtx) {
Matrix_Scale(0.1f, (this->liftHeight * -(1.0f / 1280.0f)) + (1779.4f / 1280.0f), 0.1f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_jya_bigmirror.c", 457),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, D_0600BC70);
gSPDisplayList(POLY_XLU_DISP++, gBigMirror1DL);
if (lift != NULL) {
if (1) {}
@ -239,7 +233,7 @@ void BgJyaBigmirror_DrawLightBeam(Actor* thisx, GlobalContext* globalCtx) {
Matrix_Scale(0.1f, 0.1f, 0.1f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_jya_bigmirror.c", 467),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, D_0600BD80);
gSPDisplayList(POLY_XLU_DISP++, gBigMirror2DL);
}
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_jya_bigmirror.c", 476);
@ -249,8 +243,8 @@ void BgJyaBigmirror_Draw(Actor* thisx, GlobalContext* globalCtx) {
BgJyaBigmirror* this = THIS;
if (this->puzzleFlags & BIGMIR_PUZZLE_IN_1ST_TOP_ROOM) {
Gfx_DrawDListOpa(globalCtx, D_0600E1B0);
Gfx_DrawDListXlu(globalCtx, D_0600E2D0);
Gfx_DrawDListOpa(globalCtx, gBigMirror3DL);
Gfx_DrawDListXlu(globalCtx, gBigMirror4DL);
}
if ((this->puzzleFlags &

View file

@ -1,6 +1,6 @@
#include "z_bg_jya_bombchuiwa.h"
#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
#include "objects/object_jya_obj/object_jya_obj.h"
#define FLAGS 0x00000001
#define THIS ((BgJyaBombchuiwa*)thisx)
@ -63,12 +63,6 @@ static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_STOP),
};
extern Gfx D_0600EDC0[];
extern Gfx D_0600E8D0[];
extern Gfx D_060119B0[];
extern Gfx D_0600DC40[];
extern Gfx D_0600DB60[];
void BgJyaBombchuiwa_SetupCollider(BgJyaBombchuiwa* this, GlobalContext* globalCtx) {
s32 pad;
@ -137,7 +131,7 @@ void BgJyaBombchuiwa_Break(BgJyaBombchuiwa* this, GlobalContext* globalCtx) {
}
}
EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &pos, -300, arg5, arg6, arg7, 0, scale, 1, 15, 80,
KAKERA_COLOR_NONE, OBJECT_JYA_OBJ, D_0600EDC0);
KAKERA_COLOR_NONE, OBJECT_JYA_OBJ, gBombiwaEffectDL);
}
func_80033480(globalCtx, &this->actor.world.pos, 100.0f, 8, 100, 160, 0);
}
@ -208,7 +202,7 @@ void BgJyaBombchuiwa_DrawRock(GlobalContext* globalCtx) {
func_80093D84(globalCtx->state.gfxCtx);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_jya_bombchuiwa.c", 439),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, D_060119B0);
gSPDisplayList(POLY_XLU_DISP++, gBombchuiwa2DL);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_jya_bombchuiwa.c", 443);
}
@ -220,10 +214,10 @@ void BgJyaBombchuiwa_DrawLight(Actor* thisx, GlobalContext* globalCtx) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_jya_bombchuiwa.c", 457),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, CLAMP_MAX((u32)(this->lightRayIntensity * 153.0f), 153));
gSPDisplayList(POLY_XLU_DISP++, D_0600DC40);
gSPDisplayList(POLY_XLU_DISP++, gBombchuiwaLight1DL);
gDPPipeSync(POLY_XLU_DISP++);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, CLAMP_MAX((u32)(this->lightRayIntensity * 255.0f), 255));
gSPDisplayList(POLY_XLU_DISP++, D_0600DB60);
gSPDisplayList(POLY_XLU_DISP++, gBombchuiwaLight2DL);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_jya_bombchuiwa.c", 472);
}
@ -233,7 +227,7 @@ void BgJyaBombchuiwa_Draw(Actor* thisx, GlobalContext* globalCtx) {
BgJyaBombchuiwa* this = THIS;
if (this->drawFlags & 1) {
Gfx_DrawDListOpa(globalCtx, D_0600E8D0);
Gfx_DrawDListOpa(globalCtx, gBombchuiwaDL);
Collider_UpdateSpheres(0, &this->collider);
}

View file

@ -6,6 +6,7 @@
#include "z_bg_jya_bombiwa.h"
#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
#include "objects/object_jya_obj/object_jya_obj.h"
#include "vt.h"
#define FLAGS 0x00000000
@ -42,6 +43,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[] = {
{ 0, { { 0, 0, 0 }, 50 }, 100 },
},
};
static ColliderJntSphInit sJntSphInit = {
{
COLTYPE_NONE,
@ -54,6 +56,7 @@ static ColliderJntSphInit sJntSphInit = {
1,
sJntSphElementsInit,
};
static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneForward, 1000, ICHAIN_CONTINUE),
@ -61,17 +64,14 @@ static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_STOP),
};
extern CollisionHeader D_0600E710;
extern Gfx D_0600E490[];
extern Gfx D_0600EDC0[];
void BgJyaBombiwa_SetupDynaPoly(BgJyaBombiwa* this, GlobalContext* globalCtx, void* arg2, DynaPolyMoveFlag flag) {
void BgJyaBombiwa_SetupDynaPoly(BgJyaBombiwa* this, GlobalContext* globalCtx, CollisionHeader* collision,
DynaPolyMoveFlag flag) {
s16 pad1;
CollisionHeader* colHeader = NULL;
s16 pad2;
DynaPolyActor_Init(&this->dyna, flag);
CollisionHeader_GetVirtual(arg2, &colHeader);
CollisionHeader_GetVirtual(collision, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader);
if (this->dyna.bgId == BG_ACTOR_MAX) {
@ -99,7 +99,7 @@ void BgJyaBombiwa_Init(Actor* thisx, GlobalContext* globalCtx) {
this->dyna.actor.params & 0x3F);
osSyncPrintf(VT_RST);
}
BgJyaBombiwa_SetupDynaPoly(this, globalCtx, &D_0600E710, DPM_UNK);
BgJyaBombiwa_SetupDynaPoly(this, globalCtx, &gBombiwaCol, DPM_UNK);
BgJyaBombiwa_InitCollider(this, globalCtx);
if (Flags_GetSwitch(globalCtx, this->dyna.actor.params & 0x3F)) {
Actor_Kill(&this->dyna.actor);
@ -154,7 +154,7 @@ void BgJyaBombiwa_Break(BgJyaBombiwa* this, GlobalContext* globalCtx) {
}
}
EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &pos, -400, arg5, arg6, arg7, 0, scale, 1, 20, 80,
KAKERA_COLOR_NONE, OBJECT_JYA_OBJ, D_0600EDC0);
KAKERA_COLOR_NONE, OBJECT_JYA_OBJ, gBombiwaEffectDL);
}
pos.x = this->dyna.actor.world.pos.x;
pos.y = this->dyna.actor.world.pos.y + 70.0f;
@ -178,6 +178,6 @@ void BgJyaBombiwa_Update(Actor* thisx, GlobalContext* globalCtx) {
void BgJyaBombiwa_Draw(Actor* thisx, GlobalContext* globalCtx) {
BgJyaBombiwa* this = THIS;
Gfx_DrawDListOpa(globalCtx, D_0600E490);
Gfx_DrawDListOpa(globalCtx, gBombiwaDL);
Collider_UpdateSpheres(0, &this->collider);
}

View file

@ -1,6 +1,7 @@
#include "z_bg_jya_cobra.h"
#include "overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h"
#include "overlays/actors/ovl_Mir_Ray/z_mir_ray.h"
#include "objects/object_jya_obj/object_jya_obj.h"
#include "vt.h"
#define FLAGS 0x00000010
@ -17,11 +18,6 @@ void func_80896950(BgJyaCobra* this, GlobalContext* globalCtx);
void func_808969F8(BgJyaCobra* this, GlobalContext* globalCtx);
void func_80896ABC(BgJyaCobra* this, GlobalContext* globalCtx);
extern Gfx D_06010790[];
extern Gfx D_06010C20[];
extern UNK_TYPE D_0601167C;
extern Gfx D_060117D0[];
static Vtx sShadowVtx[4] = {
VTX(-800, 0, -800, 0, 2048, 255, 255, 255, 255),
VTX(800, 0, -800, 2048, 2048, 255, 255, 255, 255),
@ -136,13 +132,14 @@ void func_808958F0(Vec3f* dest, Vec3f* src, f32 arg2, f32 arg3) {
dest->z = (src->z * arg3) - (src->x * arg2);
}
void BgJyaCobra_InitDynapoly(BgJyaCobra* this, GlobalContext* globalCtx, void* arg2, DynaPolyMoveFlag flags) {
void BgJyaCobra_InitDynapoly(BgJyaCobra* this, GlobalContext* globalCtx, CollisionHeader* collision,
DynaPolyMoveFlag flags) {
s32 pad;
CollisionHeader* colHeader = NULL;
s32 pad2;
DynaPolyActor_Init(&this->dyna, flags);
CollisionHeader_GetVirtual(arg2, &colHeader);
CollisionHeader_GetVirtual(collision, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader);
if (this->dyna.bgId == BG_ACTOR_MAX) {
// Warning : move BG Registration Failure
@ -156,7 +153,7 @@ void BgJyaCobra_SpawnRay(BgJyaCobra* this, GlobalContext* globalCtx) {
this->dyna.actor.world.pos.y + 57.0f, this->dyna.actor.world.pos.z, 0, 0, 0, 6);
if (this->dyna.actor.child == NULL) {
osSyncPrintf(VT_FGCOL(RED));
// : Mir Ray occurrence failure
// : Mir Ray occurrence failure
osSyncPrintf(" : Mir Ray 発生失敗 (%s %d)\n", "../z_bg_jya_cobra.c", 270);
osSyncPrintf(VT_RST);
}
@ -421,7 +418,7 @@ void BgJyaCobra_UpdateShadowFromTop(BgJyaCobra* this) {
void BgJyaCobra_Init(Actor* thisx, GlobalContext* globalCtx) {
BgJyaCobra* this = THIS;
BgJyaCobra_InitDynapoly(this, globalCtx, &D_0601167C, DPM_UNK);
BgJyaCobra_InitDynapoly(this, globalCtx, &gCobraCol, DPM_UNK);
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
if (!(this->dyna.actor.params & 3) && Flags_GetSwitch(globalCtx, ((s32)this->dyna.actor.params >> 8) & 0x3F)) {
this->dyna.actor.world.rot.y = this->dyna.actor.home.rot.y = this->dyna.actor.shape.rot.y = 0;
@ -554,7 +551,7 @@ void func_80896CB4(GlobalContext* globalCtx) {
func_80093D84(globalCtx->state.gfxCtx);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_jya_cobra.c", 867),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, D_06010C20);
gSPDisplayList(POLY_XLU_DISP++, gCobra2DL);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_jya_cobra.c", 872);
}
@ -575,7 +572,7 @@ void func_80896D78(BgJyaCobra* this, GlobalContext* globalCtx) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_jya_cobra.c", 939),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (s32)(this->unk_18C * 140.0f));
gSPDisplayList(POLY_XLU_DISP++, D_060117D0);
gSPDisplayList(POLY_XLU_DISP++, gCobra3DL);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_jya_cobra.c", 947);
}
@ -629,7 +626,7 @@ void BgJyaCobra_Draw(Actor* thisx, GlobalContext* globalCtx) {
BgJyaCobra* this = THIS;
func_80896CB4(globalCtx);
Gfx_DrawDListOpa(globalCtx, D_06010790);
Gfx_DrawDListOpa(globalCtx, gCobra1DL);
if (this->unk_18C > 0.0f) {
func_80896D78(this, globalCtx);

View file

@ -5,6 +5,7 @@
*/
#include "z_bg_jya_kanaami.h"
#include "objects/object_jya_obj/object_jya_obj.h"
#define FLAGS 0x00000000
@ -40,10 +41,8 @@ static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_STOP),
};
extern Gfx D_0600F000[];
extern CollisionHeader D_0600F208;
void func_80899740(BgJyaKanaami* this, GlobalContext* globalCtx, CollisionHeader* collision, DynaPolyMoveFlag flag) {
void BgJyaKanaami_InitDynaPoly(BgJyaKanaami* this, GlobalContext* globalCtx, CollisionHeader* collision,
DynaPolyMoveFlag flag) {
s32 pad;
CollisionHeader* colHeader = NULL;
s32 pad2;
@ -60,7 +59,7 @@ void func_80899740(BgJyaKanaami* this, GlobalContext* globalCtx, CollisionHeader
void BgJyaKanaami_Init(Actor* thisx, GlobalContext* globalCtx) {
BgJyaKanaami* this = THIS;
func_80899740(this, globalCtx, &D_0600F208, 0);
BgJyaKanaami_InitDynaPoly(this, globalCtx, &gKanaamiCol, DPM_UNK);
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
if (Flags_GetSwitch(globalCtx, this->dyna.actor.params & 0x3F)) {
func_80899A08(this);
@ -100,16 +99,16 @@ void func_8089993C(BgJyaKanaami* this) {
void func_80899950(BgJyaKanaami* this, GlobalContext* globalCtx) {
s32 pad[2];
s32 var;
s32 quakeId;
this->unk_168 += 0x20;
if (Math_ScaledStepToS(&this->dyna.actor.world.rot.x, 0x4000, this->unk_168)) {
func_80899A08(this);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_TRAP_BOUND);
var = Quake_Add(ACTIVE_CAM, 3);
Quake_SetSpeed(var, 25000);
Quake_SetQuakeValues(var, 2, 0, 0, 0);
Quake_SetCountdown(var, 0x10);
quakeId = Quake_Add(ACTIVE_CAM, 3);
Quake_SetSpeed(quakeId, 25000);
Quake_SetQuakeValues(quakeId, 2, 0, 0, 0);
Quake_SetCountdown(quakeId, 16);
}
}
@ -128,5 +127,5 @@ void BgJyaKanaami_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void BgJyaKanaami_Draw(Actor* thisx, GlobalContext* globalCtx) {
Gfx_DrawDListOpa(globalCtx, D_0600F000);
Gfx_DrawDListOpa(globalCtx, gKanaamiDL);
}

View file

@ -5,6 +5,7 @@
*/
#include "z_bg_jya_lift.h"
#include "objects/object_jya_obj/object_jya_obj.h"
#define FLAGS 0x00000010
@ -44,12 +45,9 @@ static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneDownward, 2500, ICHAIN_STOP),
};
extern CollisionHeader D_0600D7E8;
extern Gfx D_0600CCE0[];
void BgJyaLift_InitDynapoly(BgJyaLift* this, GlobalContext* globalCtx, CollisionHeader* collisionHeader,
DynaPolyMoveFlag moveFlag) {
s32 pad1;
s32 pad;
CollisionHeader* colHeader = NULL;
DynaPolyActor_Init(&this->dyna, moveFlag);
@ -59,8 +57,8 @@ void BgJyaLift_InitDynapoly(BgJyaLift* this, GlobalContext* globalCtx, Collision
void BgJyaLift_Init(Actor* thisx, GlobalContext* globalCtx) {
BgJyaLift* this = THIS;
this->unk_16A = 0;
this->isSpawned = false;
if (sIsSpawned) {
Actor_Kill(thisx);
return;
@ -68,7 +66,7 @@ void BgJyaLift_Init(Actor* thisx, GlobalContext* globalCtx) {
// Goddess lift CT
osSyncPrintf("女神リフト CT\n");
BgJyaLift_InitDynapoly(this, globalCtx, &D_0600D7E8, 0);
BgJyaLift_InitDynapoly(this, globalCtx, &gLiftCol, DPM_UNK);
Actor_ProcessInitChain(thisx, sInitChain);
if (Flags_GetSwitch(globalCtx, (thisx->params & 0x3F))) {
BgJyaLift_SetFinalPosY(this);
@ -77,13 +75,13 @@ void BgJyaLift_Init(Actor* thisx, GlobalContext* globalCtx) {
}
thisx->room = -1;
sIsSpawned = true;
this->unk_16A = 1;
this->isSpawned = true;
}
void BgJyaLift_Destroy(Actor* thisx, GlobalContext* globalCtx) {
BgJyaLift* this = THIS;
if (this->unk_16A != 0) {
if (this->isSpawned) {
// Goddess Lift DT
osSyncPrintf("女神リフト DT\n");
@ -157,5 +155,5 @@ void BgJyaLift_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void BgJyaLift_Draw(Actor* thisx, GlobalContext* globalCtx) {
Gfx_DrawDListOpa(globalCtx, D_0600CCE0);
Gfx_DrawDListOpa(globalCtx, gLiftDL);
}

View file

@ -11,7 +11,7 @@ typedef struct BgJyaLift {
/* 0x000 */ DynaPolyActor dyna;
/* 0x164 */ BgJyaLiftActionFunc actionFunc;
/* 0x168 */ s16 moveDelay;
/* 0x16A */ u8 unk_16A;
/* 0x16A */ u8 isSpawned;
/* 0x16B */ u8 unk_16B;
} BgJyaLift; // size = 0x016C

View file

@ -1,5 +1,6 @@
#include "z_bg_jya_megami.h"
#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
#include "objects/object_jya_obj/object_jya_obj.h"
#define FLAGS 0x00000000
@ -15,18 +16,6 @@ void BgJyaMegami_DetectLight(BgJyaMegami* this, GlobalContext* globalCtx);
void BgJyaMegami_SetupExplode(BgJyaMegami* this);
void BgJyaMegami_Explode(BgJyaMegami* this, GlobalContext* globalCtx);
extern Gfx D_06005780[];
extern CollisionHeader D_06005C4C;
extern Gfx D_0600B9F8[];
typedef struct {
/* 0x00 */ Vec3f unk_00;
/* 0x0C */ f32 velX;
/* 0x10 */ s16 rotVelX;
/* 0x12 */ s16 rotVelY;
/* 0x14 */ s16 delay;
} BgJyaMegamiPieceInit; // size = 0x18
const ActorInit Bg_Jya_Megami_InitVars = {
ACTOR_BG_JYA_MEGAMI,
ACTORCAT_BG,
@ -66,6 +55,14 @@ static ColliderJntSphInit sJntSphInit = {
sJntSphElementsInit,
};
typedef struct {
/* 0x00 */ Vec3f unk_00;
/* 0x0C */ f32 velX;
/* 0x10 */ s16 rotVelX;
/* 0x12 */ s16 rotVelY;
/* 0x14 */ s16 delay;
} BgJyaMegamiPieceInit; // size = 0x18
static BgJyaMegamiPieceInit sPiecesInit[] = {
{ { -50.0f, -21.28f, -38.92f }, -1.6f, 0xFED4, 0xFE70, 40 },
{ { -4.32f, -13.44f, -13.76f }, 0.0f, 0x04B0, 0x0190, 42 },
@ -100,7 +97,7 @@ static s16 D_8089B17C[] = {
0x0007,
};
static Vec3f D_8089B184 = { 0.0f, 0.0f, 0.8f };
static Vec3f sVelocity = { 0.0f, 0.0f, 0.8f };
static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE),
@ -109,27 +106,12 @@ static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneDownward, 1200, ICHAIN_STOP),
};
static Vec3f sVec = { 0.0f, 0.0f, 0.0f };
static UNK_PTR sRightSideCrumbles[] = {
0x06000D00, 0x06001D00, 0x06002500, 0x06002D00, 0x06004D00,
};
static UNK_PTR sLeftSideCrumbles[] = {
0x06001500, 0x06003500, 0x06003D00, 0x06004500, 0x06000500,
};
static Gfx* sDLists[] = {
0x06009928, 0x06009AC0, 0x06009C80, 0x06009DE8, 0x06009F60, 0x0600A0A8, 0x0600A278,
0x0600A418, 0x0600A568, 0x0600A6A0, 0x0600A7E0, 0x0600A978, 0x0600AAC8,
};
void BgJyaMegami_InitDynaPoly(BgJyaMegami* this, GlobalContext* globalCtx, CollisionHeader* collision,
DynaPolyMoveFlag flags) {
DynaPolyMoveFlag flag) {
s32 pad;
CollisionHeader* colHeader = NULL;
DynaPolyActor_Init(&this->dyna, flags);
DynaPolyActor_Init(&this->dyna, flag);
CollisionHeader_GetVirtual(collision, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader);
}
@ -141,7 +123,7 @@ void BgJyaMegami_InitCollider(BgJyaMegami* this, GlobalContext* globalCtx) {
Collider_SetJntSph(globalCtx, &this->collider, &this->dyna.actor, &sJntSphInit, &this->colliderItem);
}
void func_8089A1DC(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, s32 num, s32 arg4) {
void BgJyaMegami_SpawnEffect(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, s32 num, s32 arg4) {
Vec3f spB4;
s32 i;
@ -149,7 +131,7 @@ void func_8089A1DC(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, s32 nu
s32 idx = ((s16)(Rand_ZeroOne() * 8.0f)) & D_8089B17C[arg4];
s16 arg5 = ((idx < 5) && (Rand_ZeroOne() < 0.7f)) ? 0x40 : 0x20;
EffectSsKakera_Spawn(globalCtx, pos, velocity, pos, -90, arg5, D_8089B16C[idx], 4, 0, D_8089B14C[idx], 0, 5,
D_8089B15C[idx], KAKERA_COLOR_NONE, OBJECT_JYA_OBJ, D_0600B9F8);
D_8089B15C[idx], KAKERA_COLOR_NONE, OBJECT_JYA_OBJ, gMegami2DL);
if (Rand_ZeroOne() < 0.45f) {
Math_Vec3f_Copy(&spB4, pos);
spB4.z += 25.0f;
@ -158,15 +140,15 @@ void func_8089A1DC(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, s32 nu
}
}
void func_8089A41C(BgJyaMegami* this, GlobalContext* globalCtx, f32 arg2) {
void BgJyaMegami_SetupSpawnEffect(BgJyaMegami* this, GlobalContext* globalCtx, f32 arg2) {
s32 i;
Vec3f sp50;
Vec3f pos;
for (i = 0; i < ARRAY_COUNT(this->pieces); i++) {
if (Rand_ZeroOne() < arg2) {
Math_Vec3f_Sum(&this->dyna.actor.world.pos, &sPiecesInit[i].unk_00, &sp50);
sp50.z += 15.0f;
func_8089A1DC(globalCtx, &sp50, &D_8089B184, 1, 0);
Math_Vec3f_Sum(&this->dyna.actor.world.pos, &sPiecesInit[i].unk_00, &pos);
pos.z += 15.0f;
BgJyaMegami_SpawnEffect(globalCtx, &pos, &sVelocity, 1, 0);
}
}
}
@ -174,7 +156,7 @@ void func_8089A41C(BgJyaMegami* this, GlobalContext* globalCtx, f32 arg2) {
void BgJyaMegami_Init(Actor* thisx, GlobalContext* globalCtx) {
BgJyaMegami* this = THIS;
BgJyaMegami_InitDynaPoly(this, globalCtx, &D_06005C4C, DPM_UNK);
BgJyaMegami_InitDynaPoly(this, globalCtx, &GMegamiCol, DPM_UNK);
BgJyaMegami_InitCollider(this, globalCtx);
if (Flags_GetSwitch(globalCtx, this->dyna.actor.params & 0x3F)) {
Actor_Kill(&this->dyna.actor);
@ -203,7 +185,7 @@ void BgJyaMegami_DetectLight(BgJyaMegami* this, GlobalContext* globalCtx) {
this->lightTimer++;
this->collider.base.acFlags &= ~AC_HIT;
if (globalCtx->gameplayFrames % 4 == 0) {
func_8089A41C(this, globalCtx, (this->crumbleIndex * 0.04f) + 0.05f);
BgJyaMegami_SetupSpawnEffect(this, globalCtx, (this->crumbleIndex * 0.04f) + 0.05f);
}
func_8002F974(&this->dyna.actor, NA_SE_EV_FACE_CRUMBLE_SLOW - SFX_FLAG);
} else if (this->lightTimer > 0) {
@ -242,6 +224,7 @@ void BgJyaMegami_SetupExplode(BgJyaMegami* this) {
}
void BgJyaMegami_Explode(BgJyaMegami* this, GlobalContext* globalCtx) {
static Vec3f sVec = { 0.0f, 0.0f, 0.0f };
BgJyaMegamiPiece* temp;
u32 i;
Vec3f sp8C;
@ -269,12 +252,12 @@ void BgJyaMegami_Explode(BgJyaMegami* this, GlobalContext* globalCtx) {
if (Rand_ZeroOne() < 0.067f) {
Math_Vec3f_Sum(&temp->pos, &temp2->unk_00, &sp8C);
sp8C.z += 10.0f;
func_8089A1DC(globalCtx, &sp8C, &temp->vel, 3, 2);
BgJyaMegami_SpawnEffect(globalCtx, &sp8C, &temp->vel, 3, 2);
}
} else if (this->explosionTimer == temp2->delay) {
Math_Vec3f_Sum(&temp->pos, &temp2->unk_00, &sp8C);
sp8C.z += 10.0f;
func_8089A1DC(globalCtx, &sp8C, &temp->vel, 4, 2);
BgJyaMegami_SpawnEffect(globalCtx, &sp8C, &temp->vel, 4, 2);
}
}
@ -282,8 +265,8 @@ void BgJyaMegami_Explode(BgJyaMegami* this, GlobalContext* globalCtx) {
(this->explosionTimer > 40)) {
sp8C.x = ((Rand_ZeroOne() - 0.5f) * 90.0f) + this->dyna.actor.world.pos.x;
sp8C.y = (this->dyna.actor.world.pos.y - (Rand_ZeroOne() * 80.0f)) - 20.0f;
sp8C.z = this->dyna.actor.world.pos.z - ((Rand_ZeroOne() - 0.5f) * 50.0f);
func_8089A1DC(globalCtx, &sp8C, &sVec, 1, 0);
sp8C.z = this->dyna.actor.world.pos.z - (Rand_ZeroOne() - 0.5f) * 50.0f;
BgJyaMegami_SpawnEffect(globalCtx, &sp8C, &sVec, 1, 0);
}
if (this->explosionTimer < ARRAY_COUNT(this->pieces)) {
sp8C.x = this->dyna.actor.world.pos.x;
@ -305,6 +288,16 @@ void BgJyaMegami_Update(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc(this, globalCtx);
}
static u64* sRightSideCrumbles[] = {
gMeagmiRightCrumble1Tex, gMeagmiRightCrumble2Tex, gMeagmiRightCrumble3Tex,
gMeagmiRightCrumble4Tex, gMeagmiRightCrumble5Tex,
};
static u64* sLeftSideCrumbles[] = {
gMeagmiLeftCrumble1Tex, gMeagmiLeftCrumble2Tex, gMeagmiLeftCrumble3Tex,
gMeagmiLeftCrumble4Tex, gMeagmiLeftCrumble5Tex,
};
void BgJyaMegami_DrawFace(BgJyaMegami* this, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_bg_jya_megami.c", 706);
@ -313,11 +306,17 @@ void BgJyaMegami_DrawFace(BgJyaMegami* this, GlobalContext* globalCtx) {
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(sLeftSideCrumbles[this->crumbleIndex]));
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_jya_megami.c", 716),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, D_06005780);
gSPDisplayList(POLY_OPA_DISP++, gMegami1DL);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_jya_megami.c", 720);
}
static Gfx* sDLists[] = {
gMegamiPiece1DL, gMegamiPiece2DL, gMegamiPiece3DL, gMegamiPiece4DL, gMegamiPiece5DL,
gMegamiPiece6DL, gMegamiPiece7DL, gMegamiPiece8DL, gMegamiPiece9DL, gMegamiPiece10DL,
gMegamiPiece11DL, gMegamiPiece12DL, gMegamiPiece13DL,
};
void BgJyaMegami_DrawExplode(BgJyaMegami* this, GlobalContext* globalCtx) {
s32 pad;
BgJyaMegamiPiece* piece;

View file

@ -1,10 +1,11 @@
/*
* File: z_bg_jya_zurerukabe.c
* Overlay: ovl_Bg_Jya_Zurerukabe
* Description:
* Description: Sliding, Climbable Brick Wall
*/
#include "z_bg_jya_zurerukabe.h"
#include "objects/object_jya_obj/object_jya_obj.h"
#include "vt.h"
#define FLAGS 0x00000010
@ -60,18 +61,15 @@ static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_STOP),
};
extern Gfx D_06012340[];
extern CollisionHeader D_06012508;
void func_8089B440(BgJyaZurerukabe* this, GlobalContext* globalCtx, CollisionHeader* collision, s32 flags) {
void BgJyaZurerukabe_InitDynaPoly(BgJyaZurerukabe* this, GlobalContext* globalCtx, CollisionHeader* collision,
DynaPolyMoveFlag flag) {
s32 pad;
CollisionHeader* colHeader = NULL;
s32 pad2;
DynaPolyActor_Init(&this->dyna, flags);
DynaPolyActor_Init(&this->dyna, flag);
CollisionHeader_GetVirtual(collision, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader);
if (this->dyna.bgId == BG_ACTOR_MAX) {
osSyncPrintf("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_jya_zurerukabe.c", 194,
this->dyna.actor.id, this->dyna.actor.params);
@ -86,6 +84,7 @@ void func_8089B4C8(BgJyaZurerukabe* this, GlobalContext* globalCtx) {
for (i = 0; i < ARRAY_COUNT(D_8089BA18); i++) {
f32 posY = player->actor.world.pos.y;
if ((posY >= D_8089BA18[i][0]) && (posY <= D_8089BA18[i][1])) {
break;
}
@ -114,7 +113,7 @@ void BgJyaZurerukabe_Init(Actor* thisx, GlobalContext* globalCtx) {
BgJyaZurerukabe* this = THIS;
s32 i;
func_8089B440(this, globalCtx, &D_06012508, DPM_UNK);
BgJyaZurerukabe_InitDynaPoly(this, globalCtx, &gZurerukabeCol, DPM_UNK);
Actor_ProcessInitChain(thisx, sInitChain);
for (i = 0; i < ARRAY_COUNT(D_8089B9F0); i++) {
@ -157,11 +156,9 @@ void func_8089B7C4(BgJyaZurerukabe* this, GlobalContext* globalCtx) {
void func_8089B80C(BgJyaZurerukabe* this) {
this->actionFunc = func_8089B870;
this->unk_16A = D_8089BA00[this->unk_168];
if (ABS(this->unk_16C) == 4) {
this->unk_16E = -this->unk_16E;
}
this->unk_16C += this->unk_16E;
}
@ -183,12 +180,12 @@ void BgJyaZurerukabe_Update(Actor* thisx, GlobalContext* globalCtx) {
}
this->actionFunc(this, globalCtx);
if (this->unk_168 == 0) {
func_8089B4C8(this, globalCtx);
}
}
void BgJyaZurerukabe_Draw(Actor* thisx, GlobalContext* globalCtx) {
Gfx_DrawDListOpa(globalCtx, D_06012340);
Gfx_DrawDListOpa(globalCtx, gZurerukabeDL);
}

View file

@ -5,6 +5,7 @@
*/
#include "z_bg_mori_bigst.h"
#include "objects/object_mori_objects/object_mori_objects.h"
#define FLAGS 0x00000010
@ -28,9 +29,6 @@ void BgMoriBigst_SetupStalfosPairFight(BgMoriBigst* this, GlobalContext* globalC
void BgMoriBigst_StalfosPairFight(BgMoriBigst* this, GlobalContext* globalCtx);
void BgMoriBigst_SetupDone(BgMoriBigst* this, GlobalContext* globalCtx);
extern CollisionHeader D_0600221C;
extern Gfx D_06001E50[];
const ActorInit Bg_Mori_Bigst_InitVars = {
ACTOR_BG_MORI_BIGST,
ACTORCAT_BG,
@ -78,7 +76,7 @@ void BgMoriBigst_Init(Actor* thisx, GlobalContext* globalCtx) {
Flags_GetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F),
Flags_GetTempClear(globalCtx, this->dyna.actor.room), Flags_GetClear(globalCtx, this->dyna.actor.room),
PLAYER->actor.world.pos.y);
BgMoriBigst_InitDynapoly(this, globalCtx, &D_0600221C, DPM_UNK);
BgMoriBigst_InitDynapoly(this, globalCtx, &gMoriBigstCol, DPM_UNK);
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
this->moriTexObjIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_MORI_TEX);
if (this->moriTexObjIndex < 0) {
@ -254,6 +252,6 @@ void BgMoriBigst_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_mori_bigst.c", 548),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, D_06001E50);
gSPDisplayList(POLY_OPA_DISP++, gMoriBigstDL);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_mori_bigst.c", 553);
}

View file

@ -1,4 +1,5 @@
#include "z_bg_mori_elevator.h"
#include "objects/object_mori_objects/object_mori_objects.h"
#define FLAGS 0x00000010
@ -39,9 +40,6 @@ static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP),
};
extern CollisionHeader D_060035F8;
extern Gfx D_06002AD0[];
f32 func_808A1800(f32* pValue, f32 target, f32 scale, f32 maxStep, f32 minStep) {
f32 var = (target - *pValue) * scale;
@ -105,7 +103,7 @@ void BgMoriElevator_Init(Actor* thisx, GlobalContext* globalCtx) {
this->dyna.actor.room = -1;
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
DynaPolyActor_Init(&this->dyna, DPM_PLAYER);
CollisionHeader_GetVirtual(&D_060035F8, &colHeader);
CollisionHeader_GetVirtual(&gMoriElevatorCol, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader);
BgMoriElevator_SetupWaitAfterInit(this);
break;
@ -261,7 +259,7 @@ void BgMoriElevator_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPSegment(POLY_OPA_DISP++, 0x08, globalCtx->objectCtx.status[this->moriTexObjIndex].segment);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_mori_elevator.c", 580),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, D_06002AD0);
gSPDisplayList(POLY_OPA_DISP++, gMoriElevatorDL);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_mori_elevator.c", 584);
}

View file

@ -5,6 +5,7 @@
*/
#include "z_bg_mori_hashigo.h"
#include "objects/object_mori_objects/object_mori_objects.h"
#define FLAGS 0x00000000
@ -25,10 +26,6 @@ void BgMoriHashigo_SetupLadderFall(BgMoriHashigo* this);
void BgMoriHashigo_LadderFall(BgMoriHashigo* this, GlobalContext* globalCtx);
void BgMoriHashigo_SetupLadderRest(BgMoriHashigo* this);
extern CollisionHeader D_060037D8;
extern Gfx D_060036B0[];
extern Gfx D_06004770[];
const ActorInit Bg_Mori_Hashigo_InitVars = {
ACTOR_BG_MORI_HASHIGO,
ACTORCAT_BG,
@ -142,7 +139,7 @@ s32 BgMoriHashigo_InitClasp(BgMoriHashigo* this, GlobalContext* globalCtx) {
this->dyna.actor.flags |= 1;
Actor_SetFocus(&this->dyna.actor, 55.0f);
BgMoriHashigo_InitCollider(this, globalCtx);
if ((this->dyna.actor.params == -1) && !BgMoriHashigo_SpawnLadder(this, globalCtx)) {
if ((this->dyna.actor.params == HASHIGO_CLASP) && !BgMoriHashigo_SpawnLadder(this, globalCtx)) {
return false;
} else {
return true;
@ -150,7 +147,7 @@ s32 BgMoriHashigo_InitClasp(BgMoriHashigo* this, GlobalContext* globalCtx) {
}
s32 BgMoriHashigo_InitLadder(BgMoriHashigo* this, GlobalContext* globalCtx) {
BgMoriHashigo_InitDynapoly(this, globalCtx, &D_060037D8, DPM_UNK);
BgMoriHashigo_InitDynapoly(this, globalCtx, &gMoriHashigoCol, DPM_UNK);
Actor_ProcessInitChain(&this->dyna.actor, sInitChainLadder);
return true;
}
@ -159,12 +156,12 @@ void BgMoriHashigo_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
BgMoriHashigo* this = THIS;
if (this->dyna.actor.params == -1) {
if (this->dyna.actor.params == HASHIGO_CLASP) {
if (!BgMoriHashigo_InitClasp(this, globalCtx)) {
Actor_Kill(&this->dyna.actor);
return;
}
} else if (this->dyna.actor.params == 0) {
} else if (this->dyna.actor.params == HASHIGO_LADDER) {
if (!BgMoriHashigo_InitLadder(this, globalCtx)) {
Actor_Kill(&this->dyna.actor);
return;
@ -187,10 +184,10 @@ void BgMoriHashigo_Destroy(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
BgMoriHashigo* this = THIS;
if (this->dyna.actor.params == 0) {
if (this->dyna.actor.params == HASHIGO_LADDER) {
DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
}
if (this->dyna.actor.params == -1) {
if (this->dyna.actor.params == HASHIGO_CLASP) {
Collider_DestroyJntSph(globalCtx, &this->collider);
}
}
@ -201,9 +198,9 @@ void BgMoriHashigo_SetupWaitForMoriTex(BgMoriHashigo* this) {
void BgMoriHashigo_WaitForMoriTex(BgMoriHashigo* this, GlobalContext* globalCtx) {
if (Object_IsLoaded(&globalCtx->objectCtx, this->moriTexObjIndex)) {
if (this->dyna.actor.params == -1) {
if (this->dyna.actor.params == HASHIGO_CLASP) {
BgMoriHashigo_SetupClasp(this);
} else if (this->dyna.actor.params == 0) {
} else if (this->dyna.actor.params == HASHIGO_LADDER) {
BgMoriHashigo_SetupLadderWait(this);
}
this->dyna.actor.draw = BgMoriHashigo_Draw;
@ -295,11 +292,11 @@ void BgMoriHashigo_Draw(Actor* thisx, GlobalContext* globalCtx) {
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
switch (this->dyna.actor.params) {
case -1:
gSPDisplayList(POLY_OPA_DISP++, D_06004770);
case HASHIGO_CLASP:
gSPDisplayList(POLY_OPA_DISP++, gMoriHashigoClaspDL);
break;
case 0:
gSPDisplayList(POLY_OPA_DISP++, D_060036B0);
case HASHIGO_LADDER:
gSPDisplayList(POLY_OPA_DISP++, gMoriHashigoLadderDL);
break;
}
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_mori_hashigo.c", 531);

View file

@ -18,6 +18,11 @@ typedef struct BgMoriHashigo {
/* 0x01CC */ s8 moriTexObjIndex;
} BgMoriHashigo; // size = 0x01D0
typedef enum {
/* -1 */ HASHIGO_CLASP = -1,
/* 0 */ HASHIGO_LADDER
} HasigoType;
extern const ActorInit Bg_Mori_Hashigo_InitVars;
#endif

View file

@ -5,6 +5,7 @@
*/
#include "z_bg_mori_hashira4.h"
#include "objects/object_mori_objects/object_mori_objects.h"
#define FLAGS 0x00000010
@ -22,9 +23,6 @@ void BgMoriHashira4_PillarsRotate(BgMoriHashira4* this, GlobalContext* globalCtx
void BgMoriHashira4_GateWait(BgMoriHashira4* this, GlobalContext* globalCtx);
void BgMoriHashira4_GateOpen(BgMoriHashira4* this, GlobalContext* globalCtx);
extern CollisionHeader D_06001AF8;
extern CollisionHeader D_060089E0;
const ActorInit Bg_Mori_Hashira4_InitVars = {
ACTOR_BG_MORI_HASHIRA4,
ACTORCAT_BG,
@ -44,7 +42,7 @@ static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP),
};
static Gfx* sDisplayLists[] = { 0x06001300, 0x06008840 };
static Gfx* sDisplayLists[] = { gMoriHashiraPlatformsDL, gMoriHashiraGateDL };
static s16 sUnkTimer; // seems to be unused
@ -78,9 +76,9 @@ void BgMoriHashira4_Init(Actor* thisx, GlobalContext* globalCtx) {
this->dyna.actor.params &= 0xFF;
if (this->dyna.actor.params == 0) {
BgMoriHashira4_InitDynaPoly(this, globalCtx, &D_06001AF8, DPM_UNK3);
BgMoriHashira4_InitDynaPoly(this, globalCtx, &gMoriHashira1Col, DPM_UNK3);
} else {
BgMoriHashira4_InitDynaPoly(this, globalCtx, &D_060089E0, DPM_UNK);
BgMoriHashira4_InitDynaPoly(this, globalCtx, &gMoriHashira2Col, DPM_UNK);
}
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
this->moriTexObjIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_MORI_TEX);

View file

@ -5,6 +5,7 @@
*/
#include "z_bg_mori_idomizu.h"
#include "objects/object_mori_objects/object_mori_objects.h"
#define FLAGS 0x00000030
@ -20,8 +21,6 @@ void BgMoriIdomizu_WaitForMoriTex(BgMoriIdomizu* this, GlobalContext* globalCtx)
void BgMoriIdomizu_SetupMain(BgMoriIdomizu* this);
void BgMoriIdomizu_Main(BgMoriIdomizu* this, GlobalContext* globalCtx);
extern Gfx D_060049D0[];
static s16 sIsSpawned = false;
const ActorInit Bg_Mori_Idomizu_InitVars = {
@ -180,7 +179,7 @@ void BgMoriIdomizu_Draw(Actor* thisx, GlobalContext* globalCtx) {
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0x7F - (gameplayFrames & 0x7F), gameplayFrames % 0x80, 0x20,
0x20, 1, gameplayFrames & 0x7F, gameplayFrames % 0x80, 0x20, 0x20));
gSPDisplayList(POLY_XLU_DISP++, D_060049D0);
gSPDisplayList(POLY_XLU_DISP++, gMoriIdomizuWaterDL);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_mori_idomizu.c", 382);
}

View file

@ -5,6 +5,7 @@
*/
#include "z_bg_mori_kaitenkabe.h"
#include "objects/object_mori_objects/object_mori_objects.h"
#define FLAGS 0x00000000
@ -21,9 +22,6 @@ void BgMoriKaitenkabe_Wait(BgMoriKaitenkabe* this, GlobalContext* globalCtx);
void BgMoriKaitenkabe_SetupRotate(BgMoriKaitenkabe* this);
void BgMoriKaitenkabe_Rotate(BgMoriKaitenkabe* this, GlobalContext* globalCtx);
extern CollisionHeader D_060063B8;
extern Gfx D_060056B0[];
const ActorInit Bg_Mori_Kaitenkabe_InitVars = {
ACTOR_BG_MORI_KAITENKABE,
ACTORCAT_BG,
@ -58,7 +56,7 @@ void BgMoriKaitenkabe_Init(Actor* thisx, GlobalContext* globalCtx) {
osSyncPrintf("◯◯◯森の神殿オブジェクト【回転壁(arg_data : 0x%04x)】出現 \n", this->dyna.actor.params);
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
DynaPolyActor_Init(&this->dyna, DPM_UNK);
CollisionHeader_GetVirtual(&D_060063B8, &colHeader);
CollisionHeader_GetVirtual(&gMoriKaitenkabeCol, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader);
this->moriTexObjIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_MORI_TEX);
if (this->moriTexObjIndex < 0) {
@ -172,7 +170,7 @@ void BgMoriKaitenkabe_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_mori_kaitenkabe.c", 352),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, D_060056B0);
gSPDisplayList(POLY_OPA_DISP++, gMoriKaitenkabeDL);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_mori_kaitenkabe.c", 356);
}

View file

@ -5,6 +5,7 @@
*/
#include "z_bg_mori_rakkatenjo.h"
#include "objects/object_mori_objects/object_mori_objects.h"
#define FLAGS 0x00000030
@ -26,9 +27,6 @@ void BgMoriRakkatenjo_Rest(BgMoriRakkatenjo* this, GlobalContext* globalCtx);
void BgMoriRakkatenjo_SetupRise(BgMoriRakkatenjo* this);
void BgMoriRakkatenjo_Rise(BgMoriRakkatenjo* this, GlobalContext* globalCtx);
extern CollisionHeader D_060087AC;
extern Gfx D_06007690[];
static s16 sCamSetting = 0;
const ActorInit Bg_Mori_Rakkatenjo_InitVars = {
@ -75,7 +73,7 @@ void BgMoriRakkatenjo_Init(Actor* thisx, GlobalContext* globalCtx) {
return;
}
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
CollisionHeader_GetVirtual(&D_060087AC, &colHeader);
CollisionHeader_GetVirtual(&gMoriRakkatenjoCol, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader);
BgMoriRakkatenjo_SetupWaitForMoriTex(this);
sCamSetting = 0;
@ -233,7 +231,7 @@ void BgMoriRakkatenjo_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_mori_rakkatenjo.c", 502),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, D_06007690);
gSPDisplayList(POLY_OPA_DISP++, gMoriRakkatenjoDL);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_mori_rakkatenjo.c", 506);
}

View file

@ -6,6 +6,7 @@
#include "z_bg_spot08_bakudankabe.h"
#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
#include "objects/gameplay_field_keep/gameplay_field_keep.h"
#define FLAGS 0x00400000
@ -31,7 +32,6 @@ const ActorInit Bg_Spot08_Bakudankabe_InitVars = {
(ActorFunc)BgSpot08Bakudankabe_Draw,
};
extern Gfx D_0500A880[];
extern CollisionHeader D_060039D4;
extern Gfx D_06003898[];
@ -149,7 +149,7 @@ void func_808B0324(BgSpot08Bakudankabe* this, GlobalContext* globalCtx) {
}
EffectSsKakera_Spawn(globalCtx, &burstDepthY, &burstDepthX, &burstDepthY, gravityInfluence, rotationSpeed, 0x1E,
4, 0, scale, 1, 3, 80, KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_FIELD_KEEP, D_0500A880);
4, 0, scale, 1, 3, 80, KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_FIELD_KEEP, gFieldKakeraDL);
}
for (i = 0; i < ARRAY_COUNT(D_808B08AC); i++) {

View file

@ -7,6 +7,7 @@
#include "z_bg_spot11_bakudankabe.h"
#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
#include "objects/object_spot11_obj/object_spot11_obj.h"
#include "objects/gameplay_field_keep/gameplay_field_keep.h"
#define FLAGS 0x00000030
@ -52,8 +53,6 @@ static ColliderCylinderInit sCylinderInit = {
static Vec3f D_808B272C = { 2259.0f, 108.0f, -1550.0f };
static Vec3f D_808B2738 = { 2259.0f, 108.0f, -1550.0f };
extern Gfx D_0500A880[];
void func_808B2180(BgSpot11Bakudankabe* this, GlobalContext* globalCtx) {
s32 pad;
@ -100,7 +99,7 @@ void func_808B2218(BgSpot11Bakudankabe* this, GlobalContext* globalCtx) {
rotationSpeed = 33;
}
EffectSsKakera_Spawn(globalCtx, &burstDepthY, &burstDepthX, &burstDepthY, gravityInfluence, rotationSpeed, 0x1E,
4, 0, scale, 1, 3, 80, KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_FIELD_KEEP, D_0500A880);
4, 0, scale, 1, 3, 80, KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_FIELD_KEEP, gFieldKakeraDL);
}
Math_Vec3f_Sum(&thisx->world.pos, &D_808B272C, &burstDepthY);
func_80033480(globalCtx, &burstDepthY, 70, 4, 110, 160, 1);

View file

@ -7,6 +7,7 @@
#include "z_bg_spot17_bakudankabe.h"
#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
#include "objects/object_spot17_obj/object_spot17_obj.h"
#include "objects/gameplay_field_keep/gameplay_field_keep.h"
#define FLAGS 0x00000000
@ -36,8 +37,6 @@ static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_STOP),
};
extern Gfx D_0500A880[];
void func_808B6BC0(BgSpot17Bakudankabe* this, GlobalContext* globalCtx) {
s32 pad[2];
s32 i;
@ -83,7 +82,7 @@ void func_808B6BC0(BgSpot17Bakudankabe* this, GlobalContext* globalCtx) {
rotationSpeed = 33;
}
EffectSsKakera_Spawn(globalCtx, &burstDepthY, &burstDepthX, &burstDepthY, gravityInfluence, rotationSpeed, 0x1E,
4, 0, scale, 1, 3, 80, KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_FIELD_KEEP, D_0500A880);
4, 0, scale, 1, 3, 80, KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_FIELD_KEEP, gFieldKakeraDL);
}
Math_Vec3f_Copy(&burstDepthY, &this->dyna.actor.world.pos);
func_80033480(globalCtx, &burstDepthY, 60.0f, 4, 110, 160, 1);

View file

@ -46,16 +46,16 @@ void BgYdanHasi_Init(Actor* thisx, GlobalContext* globalCtx) {
WaterBox* waterBox;
Actor_ProcessInitChain(thisx, sInitChain);
this->unk_168 = ((thisx->params >> 8) & 0x3F);
this->type = ((thisx->params >> 8) & 0x3F);
thisx->params = thisx->params & 0xFF;
waterBox = &globalCtx->colCtx.colHeader->waterBoxes[1];
DynaPolyActor_Init(&this->dyna, DPM_PLAYER);
if (thisx->params == 1) {
if (thisx->params == HASI_WATER) {
// Water the moving platform floats on in B1. Never runs in Master Quest
waterBox->ySurface = thisx->world.pos.y = thisx->home.pos.y += -5.0f;
this->actionFunc = BgYdanHasi_InitWater;
} else {
if (thisx->params == 0) {
if (thisx->params == HASI_WATER_BLOCK) {
// Moving platform on the water in B1
CollisionHeader_GetVirtual(&gDTSlidingPlatformCol, &colHeader);
thisx->scale.z = 0.15f;
@ -67,9 +67,9 @@ void BgYdanHasi_Init(Actor* thisx, GlobalContext* globalCtx) {
CollisionHeader_GetVirtual(&gDTRisingPlatformsCol, &colHeader);
thisx->draw = NULL;
this->actionFunc = BgYdanHasi_SetupThreeBlocks;
Actor_SetFocus(thisx, 40.0f);
Actor_SetFocus(&this->dyna.actor, 40.0f);
}
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader);
}
this->timer = 0;
}
@ -101,7 +101,7 @@ void BgYdanHasi_UpdateFloatingBlock(BgYdanHasi* this, GlobalContext* globalCtx)
}
void BgYdanHasi_InitWater(BgYdanHasi* this, GlobalContext* globalCtx) {
if (Flags_GetSwitch(globalCtx, this->unk_168)) {
if (Flags_GetSwitch(globalCtx, this->type)) {
this->timer = 600;
this->actionFunc = BgYdanHasi_MoveWater;
}
@ -111,8 +111,8 @@ void BgYdanHasi_MoveWater(BgYdanHasi* this, GlobalContext* globalCtx) {
WaterBox* waterBox;
if (this->timer == 0) {
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 1.0f)) {
Flags_UnsetSwitch(globalCtx, this->unk_168);
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 1.0f) != 0) {
Flags_UnsetSwitch(globalCtx, this->type);
this->actionFunc = BgYdanHasi_InitWater;
}
func_8002F948(&this->dyna.actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG);
@ -137,7 +137,7 @@ void BgYdanHasi_DecWaterTimer(BgYdanHasi* this, GlobalContext* globalCtx) {
}
void BgYdanHasi_SetupThreeBlocks(BgYdanHasi* this, GlobalContext* globalCtx) {
if (Flags_GetSwitch(globalCtx, this->unk_168)) {
if (Flags_GetSwitch(globalCtx, this->type)) {
this->timer = 260;
this->dyna.actor.draw = BgYdanHasi_Draw;
this->actionFunc = BgYdanHasi_UpdateThreeBlocks;
@ -151,18 +151,17 @@ void BgYdanHasi_UpdateThreeBlocks(BgYdanHasi* this, GlobalContext* globalCtx) {
}
if (this->timer == 0) {
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 3.0f) != 0) {
Flags_UnsetSwitch(globalCtx, this->unk_168);
Flags_UnsetSwitch(globalCtx, this->type);
this->dyna.actor.draw = NULL;
this->actionFunc = BgYdanHasi_SetupThreeBlocks;
} else {
func_8002F948(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG);
}
} else if (!Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 120.0f, 3.0f)) {
func_8002F948(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG);
} else {
if (!Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 120.0f, 3.0f)) {
func_8002F948(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG);
} else {
func_8002F994(&this->dyna.actor, this->timer);
}
func_8002F994(&this->dyna.actor, this->timer);
}
}
@ -176,7 +175,7 @@ void BgYdanHasi_Draw(Actor* thisx, GlobalContext* globalCtx) {
static Gfx* dLists[] = { gDTSlidingPlatformDL, gDTWaterPlaneDL, gDTRisingPlatformsDL };
BgYdanHasi* this = THIS;
if (this->dyna.actor.params == 0 || this->dyna.actor.params == 2) {
if (this->dyna.actor.params == HASI_WATER_BLOCK || this->dyna.actor.params == HASI_THREE_BLOCKS) {
Gfx_DrawDListOpa(globalCtx, dLists[this->dyna.actor.params]);
} else {
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_bg_ydan_hasi.c", 577);

View file

@ -11,11 +11,16 @@ typedef void (*BgYdanHasiActionFunc)(struct BgYdanHasi*, GlobalContext*);
typedef struct BgYdanHasi {
/* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ BgYdanHasiActionFunc actionFunc;
/* 0x0168 */ u8 unk_168;
/* 0x0169 */ s8 unk_169; //Unused
/* 0x0168 */ u8 type;
/* 0x016A */ s16 timer; //Also used as an offset for the water blocks Y position for a "bobbing" effect
} BgYdanHasi; // size = 0x016C
typedef enum {
/* 0 */ HASI_WATER_BLOCK,
/* 1 */ HASI_WATER,
/* 2 */ HASI_THREE_BLOCKS
} HasiType;
extern const ActorInit Bg_Ydan_Hasi_InitVars;
#endif

View file

@ -86,14 +86,14 @@ void BgYdanMaruta_Init(Actor* thisx, GlobalContext* globalCtx) {
CollisionHeader* colHeader = NULL;
ColliderTrisElementInit* triInit;
Actor_ProcessInitChain(thisx, sInitChain);
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
Collider_InitTris(globalCtx, &this->collider);
Collider_SetTris(globalCtx, &this->collider, thisx, &sTrisInit, this->elements);
Collider_SetTris(globalCtx, &this->collider, &this->dyna.actor, &sTrisInit, this->elements);
this->unk_168 = thisx->params & 0xFFFF;
thisx->params = (thisx->params >> 8) & 0xFF;
this->switchFlag = this->dyna.actor.params & 0xFFFF;
thisx->params = (thisx->params >> 8) & 0xFF; // thisx is required to match here
if (thisx->params == 0) {
if (this->dyna.actor.params == 0) {
triInit = &sTrisElementsInit[0];
this->actionFunc = func_808BEFF4;
} else {
@ -102,7 +102,7 @@ void BgYdanMaruta_Init(Actor* thisx, GlobalContext* globalCtx) {
CollisionHeader_GetVirtual(&gDTFallingLadderCol, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader);
thisx->home.pos.y += -280.0f;
if (Flags_GetSwitch(globalCtx, this->unk_168)) {
if (Flags_GetSwitch(globalCtx, this->switchFlag)) {
thisx->world.pos.y = thisx->home.pos.y;
this->actionFunc = BgYdanMaruta_DoNothing;
} else {
@ -110,20 +110,20 @@ void BgYdanMaruta_Init(Actor* thisx, GlobalContext* globalCtx) {
}
}
sinRotY = Math_SinS(thisx->shape.rot.y);
cosRotY = Math_CosS(thisx->shape.rot.y);
sinRotY = Math_SinS(this->dyna.actor.shape.rot.y);
cosRotY = Math_CosS(this->dyna.actor.shape.rot.y);
for (i = 0; i < 3; i++) {
sp4C[i].x = (triInit->dim.vtx[i].x * cosRotY) + thisx->world.pos.x;
sp4C[i].y = triInit->dim.vtx[i].y + thisx->world.pos.y;
sp4C[i].z = thisx->world.pos.z - (triInit->dim.vtx[i].x * sinRotY);
sp4C[i].x = (triInit->dim.vtx[i].x * cosRotY) + this->dyna.actor.world.pos.x;
sp4C[i].y = triInit->dim.vtx[i].y + this->dyna.actor.world.pos.y;
sp4C[i].z = this->dyna.actor.world.pos.z - (triInit->dim.vtx[i].x * sinRotY);
}
Collider_SetTrisVertices(&this->collider, 0, &sp4C[0], &sp4C[1], &sp4C[2]);
sp4C[1].x = (triInit->dim.vtx[2].x * cosRotY) + thisx->world.pos.x;
sp4C[1].y = triInit->dim.vtx[0].y + thisx->world.pos.y;
sp4C[1].z = thisx->world.pos.z - (triInit->dim.vtx[2].x * sinRotY);
sp4C[1].x = (triInit->dim.vtx[2].x * cosRotY) + this->dyna.actor.world.pos.x;
sp4C[1].y = triInit->dim.vtx[0].y + this->dyna.actor.world.pos.y;
sp4C[1].z = this->dyna.actor.world.pos.z - (triInit->dim.vtx[2].x * sinRotY);
Collider_SetTrisVertices(&this->collider, 1, &sp4C[0], &sp4C[2], &sp4C[1]);
}
@ -149,7 +149,7 @@ void func_808BEFF4(BgYdanMaruta* this, GlobalContext* globalCtx) {
void func_808BF078(BgYdanMaruta* this, GlobalContext* globalCtx) {
if (this->collider.base.acFlags & AC_HIT) {
this->unk_16A = 20;
Flags_SetSwitch(globalCtx, this->unk_168);
Flags_SetSwitch(globalCtx, this->switchFlag);
func_80078884(NA_SE_SY_CORRECT_CHIME);
this->actionFunc = func_808BF108;
OnePointCutscene_Init(globalCtx, 3010, 50, &this->dyna.actor, MAIN_CAM);

View file

@ -11,7 +11,7 @@ typedef void (*BgYdanMarutaActionFunc)(struct BgYdanMaruta*, GlobalContext*);
typedef struct BgYdanMaruta {
/* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ BgYdanMarutaActionFunc actionFunc;
/* 0x0168 */ u8 unk_168;
/* 0x0168 */ u8 switchFlag;
/* 0x016A */ s16 unk_16A;
/* 0x016C */ ColliderTris collider;
/* 0x018C */ ColliderTrisElement elements[2];

View file

@ -5,8 +5,9 @@
*/
#include "z_demo_ec.h"
#include "objects/object_zo/object_zo.h"
#include "vt.h"
#include "objects/object_zo/object_zo.h"
#include "objects/object_ec/object_ec.h"
#define FLAGS 0x00000010
@ -91,53 +92,62 @@ static s16 sAnimationObjects[] = {
OBJECT_EC, OBJECT_EC, OBJECT_EC, OBJECT_EC, OBJECT_EC, OBJECT_EC, OBJECT_GM, OBJECT_MA2,
};
// skeletons
// skeletons (all from other objects)
// Object_IN
extern FlexSkeletonHeader D_06013B88;
// Object_TA
extern FlexSkeletonHeader D_0600B7B8;
// Object_FU
extern FlexSkeletonHeader D_06006C90;
// Object_KM1, Object_KW1, Object_BJI, Objct_AHG, Object_BOB, Object_BBA, Object_ANE
extern FlexSkeletonHeader D_060000F0;
// Object_Toryo
extern FlexSkeletonHeader D_06007150;
// Object_Daiku
extern FlexSkeletonHeader D_06007958;
// Object_GE1
extern FlexSkeletonHeader D_06000330;
// Object_ZO
extern FlexSkeletonHeader D_0600BFA8;
// Object_KZ
extern FlexSkeletonHeader D_060086D0;
// Object_MD
extern FlexSkeletonHeader D_06007FB8;
// Object_Niw
extern FlexSkeletonHeader D_06002530;
// Object_DS2
extern FlexSkeletonHeader D_06004258;
// Object_OS
extern FlexSkeletonHeader D_06004658;
// Object_Fish
extern FlexSkeletonHeader D_060085F8;
// Object_RS
extern FlexSkeletonHeader D_06004868;
// Object_OF1D_MAP
extern FlexSkeletonHeader D_0600FEF0;
// Object_MA2
extern FlexSkeletonHeader D_06008D90;
// animations
extern AnimationHeader D_0600BD38;
extern AnimationHeader D_060048F4;
extern AnimationHeader D_0600196C;
extern AnimationHeader D_06005670;
extern AnimationHeader D_06005EA8;
extern AnimationHeader D_0600164C;
extern AnimationHeader D_0600164C;
extern AnimationHeader D_0600513C;
extern AnimationHeader D_06002254;
extern AnimationHeader D_0600C918;
extern AnimationHeader D_06006C40;
extern AnimationHeader D_060095DC;
extern AnimationHeader D_06009BB4;
extern AnimationHeader D_0600A07C;
extern AnimationHeader D_0600A474;
extern AnimationHeader D_06000CD8;
extern AnimationHeader D_0600AFE0;
extern AnimationHeader D_0600AFE0;
extern AnimationHeader D_06002FA0;
extern AnimationHeader D_06003A98;
extern AnimationHeader D_06002FA0;
// animations from other objects
extern AnimationHeader D_060002B8;
extern AnimationHeader D_06009EE0;
extern AnimationHeader D_06006930;
extern AnimationHeader D_06006220;
extern AnimationHeader D_06008D1C;
extern AnimationHeader D_06009234;
extern AnimationHeader D_06009EE0; // Object MA2
extern AnimationHeader D_06004390;
extern AnimationHeader D_060076C0;
extern AnimationHeader D_06005F20;
@ -368,7 +378,7 @@ void DemoEc_InitIngo(DemoEc* this, GlobalContext* globalCtx) {
DemoEc_UseDrawObject(this, globalCtx);
DemoEc_InitSkelAnime(this, globalCtx, &D_06013B88);
DemoEc_UseAnimationObject(this, globalCtx);
DemoEc_ChangeAnimation(this, &D_060048F4, 0, 0.0f, false);
DemoEc_ChangeAnimation(this, &gDemoEcIngoAnim, 0, 0.0f, false);
func_8096D64C(this, globalCtx);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
this->updateMode = EC_UPDATE_INGO;
@ -389,7 +399,7 @@ void DemoEc_InitTalon(DemoEc* this, GlobalContext* globalCtx) {
DemoEc_UseDrawObject(this, globalCtx);
DemoEc_InitSkelAnime(this, globalCtx, &D_0600B7B8);
DemoEc_UseAnimationObject(this, globalCtx);
DemoEc_ChangeAnimation(this, &D_0600BD38, 0, 0.0f, false);
DemoEc_ChangeAnimation(this, &gDemoEcTalonAnim, 0, 0.0f, false);
func_8096D64C(this, globalCtx);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
this->updateMode = EC_UPDATE_TALON;
@ -410,7 +420,7 @@ void DemoEc_InitWindmillMan(DemoEc* this, GlobalContext* globalCtx) {
DemoEc_UseDrawObject(this, globalCtx);
DemoEc_InitSkelAnime(this, globalCtx, &D_06006C90);
DemoEc_UseAnimationObject(this, globalCtx);
DemoEc_ChangeAnimation(this, &D_0600196C, 0, 0.0f, false);
DemoEc_ChangeAnimation(this, &gDemoEcWindmillManAnim, 0, 0.0f, false);
func_8096D5D4(this, globalCtx);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
this->updateMode = EC_UPDATE_WINDMILL_MAN;
@ -431,7 +441,7 @@ void DemoEc_InitKokiriBoy(DemoEc* this, GlobalContext* globalCtx) {
DemoEc_UseDrawObject(this, globalCtx);
DemoEc_InitSkelAnime(this, globalCtx, &D_060000F0);
DemoEc_UseAnimationObject(this, globalCtx);
DemoEc_ChangeAnimation(this, &D_06005670, 0, 0.0f, false);
DemoEc_ChangeAnimation(this, &gDemoEcKokiriAnim, 0, 0.0f, false);
func_8096D5D4(this, globalCtx);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
this->updateMode = EC_UPDATE_KOKIRI_BOY;
@ -442,7 +452,7 @@ void DemoEc_InitDancingKokiriBoy(DemoEc* this, GlobalContext* globalCtx) {
DemoEc_UseDrawObject(this, globalCtx);
DemoEc_InitSkelAnime(this, globalCtx, &D_060000F0);
DemoEc_UseAnimationObject(this, globalCtx);
DemoEc_ChangeAnimation(this, &D_0600513C, 0, 0.0f, false);
DemoEc_ChangeAnimation(this, &gDemoEcDancingKokiriAnim, 0, 0.0f, false);
func_8096D5D4(this, globalCtx);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
this->updateMode = EC_UPDATE_DANCING_KOKIRI_BOY;
@ -470,7 +480,7 @@ void DemoEc_InitKokiriGirl(DemoEc* this, GlobalContext* globalCtx) {
DemoEc_UseDrawObject(this, globalCtx);
DemoEc_InitSkelAnime(this, globalCtx, &D_060000F0);
DemoEc_UseAnimationObject(this, globalCtx);
DemoEc_ChangeAnimation(this, &D_06005670, 0, 0.0f, false);
DemoEc_ChangeAnimation(this, &gDemoEcKokiriAnim, 0, 0.0f, false);
func_8096D5D4(this, globalCtx);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
this->updateMode = EC_UPDATE_KOKIRI_GIRL;
@ -481,7 +491,7 @@ void DemoEc_InitDancingKokiriGirl(DemoEc* this, GlobalContext* globalCtx) {
DemoEc_UseDrawObject(this, globalCtx);
DemoEc_InitSkelAnime(this, globalCtx, &D_060000F0);
DemoEc_UseAnimationObject(this, globalCtx);
DemoEc_ChangeAnimation(this, &D_0600513C, 0, 0.0f, false);
DemoEc_ChangeAnimation(this, &gDemoEcDancingKokiriAnim, 0, 0.0f, false);
func_8096D5D4(this, globalCtx);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
this->updateMode = EC_UPDATE_DANCING_KOKIRI_GIRL;
@ -512,7 +522,7 @@ void DemoEc_InitOldMan(DemoEc* this, GlobalContext* globalCtx) {
DemoEc_UseDrawObject(this, globalCtx);
DemoEc_InitSkelAnime(this, globalCtx, &D_060000F0);
DemoEc_UseAnimationObject(this, globalCtx);
DemoEc_ChangeAnimation(this, &D_06005EA8, 0, 0.0f, false);
DemoEc_ChangeAnimation(this, &gDemoEcOldManAnim, 0, 0.0f, false);
func_8096D5D4(this, globalCtx);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
this->updateMode = EC_UPDATE_OLD_MAN;
@ -540,7 +550,7 @@ void DemoEc_InitBeardedMan(DemoEc* this, GlobalContext* globalCtx) {
DemoEc_UseDrawObject(this, globalCtx);
DemoEc_InitSkelAnime(this, globalCtx, &D_060000F0);
DemoEc_UseAnimationObject(this, globalCtx);
DemoEc_ChangeAnimation(this, &D_06005EA8, 0, 0.0f, false);
DemoEc_ChangeAnimation(this, &gDemoEcOldManAnim, 0, 0.0f, false);
func_8096D5D4(this, globalCtx);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
this->updateMode = EC_UPDATE_BEARDED_MAN;
@ -568,7 +578,7 @@ void DemoEc_InitWoman(DemoEc* this, GlobalContext* globalCtx) {
DemoEc_UseDrawObject(this, globalCtx);
DemoEc_InitSkelAnime(this, globalCtx, &D_060000F0);
DemoEc_UseAnimationObject(this, globalCtx);
DemoEc_ChangeAnimation(this, &D_06005EA8, 0, 0.0f, false);
DemoEc_ChangeAnimation(this, &gDemoEcOldManAnim, 0, 0.0f, false);
func_8096D5D4(this, globalCtx);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
this->updateMode = EC_UPDATE_WOMAN;
@ -594,7 +604,7 @@ void DemoEc_InitOldWoman(DemoEc* this, GlobalContext* globalCtx) {
DemoEc_UseDrawObject(this, globalCtx);
DemoEc_InitSkelAnime(this, globalCtx, &D_060000F0);
DemoEc_UseAnimationObject(this, globalCtx);
DemoEc_ChangeAnimation(this, &D_06005EA8, 0, 0.0f, false);
DemoEc_ChangeAnimation(this, &gDemoEcOldManAnim, 0, 0.0f, false);
func_8096D5D4(this, globalCtx);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
this->updateMode = EC_UPDATE_OLD_WOMAN;
@ -615,7 +625,7 @@ void DemoEc_InitBossCarpenter(DemoEc* this, GlobalContext* globalCtx) {
DemoEc_UseDrawObject(this, globalCtx);
DemoEc_InitSkelAnime(this, globalCtx, &D_06007150);
DemoEc_UseAnimationObject(this, globalCtx);
DemoEc_ChangeAnimation(this, &D_0600164C, 0, 0.0f, false);
DemoEc_ChangeAnimation(this, &gDemoEcCarpenterAnim, 0, 0.0f, false);
func_8096D5D4(this, globalCtx);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
this->updateMode = EC_UPDATE_BOSS_CARPENTER;
@ -636,7 +646,7 @@ void DemoEc_InitCarpenter(DemoEc* this, GlobalContext* globalCtx) {
DemoEc_UseDrawObject(this, globalCtx);
DemoEc_InitSkelAnime(this, globalCtx, &D_06007958);
DemoEc_UseAnimationObject(this, globalCtx);
DemoEc_ChangeAnimation(this, &D_0600164C, 0, 0.0f, false);
DemoEc_ChangeAnimation(this, &gDemoEcCarpenterAnim, 0, 0.0f, false);
func_8096D5D4(this, globalCtx);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
this->updateMode = EC_UPDATE_CARPENTER;
@ -709,7 +719,7 @@ void DemoEc_InitGerudo(DemoEc* this, GlobalContext* globalCtx) {
DemoEc_UseDrawObject(this, globalCtx);
DemoEc_InitSkelAnime(this, globalCtx, &D_06000330);
DemoEc_UseAnimationObject(this, globalCtx);
DemoEc_ChangeAnimation(this, &D_06002254, 0, 0.0f, false);
DemoEc_ChangeAnimation(this, &gDemoEcGerudoAnim, 0, 0.0f, false);
func_8096D5D4(this, globalCtx);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
this->updateMode = EC_UPDATE_GERUDO;
@ -760,7 +770,7 @@ void DemoEc_InitDancingZora(DemoEc* this, GlobalContext* globalCtx) {
DemoEc_UseDrawObject(this, globalCtx);
DemoEc_InitSkelAnime(this, globalCtx, &gZoraSkel);
DemoEc_UseAnimationObject(this, globalCtx);
DemoEc_ChangeAnimation(this, &D_0600C918, 0, 0.0f, false);
DemoEc_ChangeAnimation(this, &gDemoEcDancingZoraAnim, 0, 0.0f, false);
func_8096D5D4(this, globalCtx);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
this->updateMode = EC_UPDATE_DANCING_ZORA;
@ -786,7 +796,7 @@ void DemoEc_InitKingZora(DemoEc* this, GlobalContext* globalCtx) {
DemoEc_UseDrawObject(this, globalCtx);
DemoEc_InitSkelAnime(this, globalCtx, &D_060086D0);
DemoEc_UseAnimationObject(this, globalCtx);
DemoEc_ChangeAnimation(this, &D_06006C40, 0, 0.0f, false);
DemoEc_ChangeAnimation(this, &gDemoEcKingZoraAnim, 0, 0.0f, false);
func_8096D5D4(this, globalCtx);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
this->updateMode = EC_UPDATE_KING_ZORA;
@ -806,13 +816,13 @@ void func_8096F1D4(DemoEc* this) {
void func_8096F224(DemoEc* this, GlobalContext* globalCtx) {
DemoEc_UseAnimationObject(this, globalCtx);
DemoEc_ChangeAnimation(this, &D_06006930, 2, -8.0f, false);
DemoEc_ChangeAnimation(this, &gDemoEcAnim_006930, 2, -8.0f, false);
this->updateMode = EC_UPDATE_17;
}
void func_8096F26C(DemoEc* this, s32 arg1) {
if (arg1 != 0) {
DemoEc_ChangeAnimation(this, &D_06006220, 0, 0.0f, false);
DemoEc_ChangeAnimation(this, &gDemoEcAnim_006220, 0, 0.0f, false);
this->updateMode = EC_UPDATE_18;
}
}
@ -871,7 +881,7 @@ void DemoEc_InitMido(DemoEc* this, GlobalContext* globalCtx) {
DemoEc_UseDrawObject(this, globalCtx);
DemoEc_InitSkelAnime(this, globalCtx, &D_06007FB8);
DemoEc_UseAnimationObject(this, globalCtx);
DemoEc_ChangeAnimation(this, &D_060095DC, 0, 0.0f, false);
DemoEc_ChangeAnimation(this, &gDemoEcMidoAnim, 0, 0.0f, false);
func_8096D5D4(this, globalCtx);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
this->updateMode = EC_UPDATE_MIDO;
@ -881,13 +891,13 @@ void DemoEc_InitMido(DemoEc* this, GlobalContext* globalCtx) {
void func_8096F4FC(DemoEc* this, GlobalContext* globalCtx) {
DemoEc_UseAnimationObject(this, globalCtx);
DemoEc_ChangeAnimation(this, &D_06008D1C, 2, -8.0f, false);
DemoEc_ChangeAnimation(this, &gDemoEcAnim_008D1C, 2, -8.0f, false);
this->updateMode = EC_UPDATE_20;
}
void func_8096F544(DemoEc* this, s32 changeAnim) {
if (changeAnim) {
DemoEc_ChangeAnimation(this, &D_06009234, 0, 0.0f, false);
DemoEc_ChangeAnimation(this, &gDemoEcAnim_009234, 0, 0.0f, false);
}
}
@ -940,11 +950,11 @@ void DemoEc_InitCucco(DemoEc* this, GlobalContext* globalCtx) {
DemoEc_UseAnimationObject(this, globalCtx);
if (this->actor.params == 22) {
animation = &D_06009BB4;
animation = &gDemoEcJumpingCuccoAnim;
} else if (this->actor.params == 23) {
animation = &D_0600A07C;
animation = &gDemoEcJumpingCucco2Anim;
} else {
animation = &D_0600A474;
animation = &gDemoEcWalkingCuccoAnim;
}
DemoEc_ChangeAnimation(this, animation, 0, 0.0f, false);
@ -968,7 +978,7 @@ void DemoEc_InitCuccoLady(DemoEc* this, GlobalContext* globalCtx) {
DemoEc_UseDrawObject(this, globalCtx);
DemoEc_InitSkelAnime(this, globalCtx, &D_060000F0);
DemoEc_UseAnimationObject(this, globalCtx);
DemoEc_ChangeAnimation(this, &D_06000CD8, 0, 0.0f, false);
DemoEc_ChangeAnimation(this, &gDemoEcCuccoLadyAnim, 0, 0.0f, false);
func_8096D5D4(this, globalCtx);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
this->updateMode = EC_UPDATE_CUCCO_LADY;
@ -994,7 +1004,7 @@ void DemoEc_InitPotionShopOwner(DemoEc* this, GlobalContext* globalCtx) {
DemoEc_UseDrawObject(this, globalCtx);
DemoEc_InitSkelAnime(this, globalCtx, &D_06004258);
DemoEc_UseAnimationObject(this, globalCtx);
DemoEc_ChangeAnimation(this, &D_0600AFE0, 0, 0.0f, false);
DemoEc_ChangeAnimation(this, &gDemoEcPotionShopOwnerAnim, 0, 0.0f, false);
func_8096D5D4(this, globalCtx);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
this->updateMode = EC_UPDATE_POTION_SHOP_OWNER;
@ -1020,7 +1030,7 @@ void DemoEc_InitMaskShopOwner(DemoEc* this, GlobalContext* globalCtx) {
DemoEc_UseDrawObject(this, globalCtx);
DemoEc_InitSkelAnime(this, globalCtx, &D_06004658);
DemoEc_UseAnimationObject(this, globalCtx);
DemoEc_ChangeAnimation(this, &D_0600AFE0, 0, 0.0f, false);
DemoEc_ChangeAnimation(this, &gDemoEcPotionShopOwnerAnim, 0, 0.0f, false);
func_8096D5D4(this, globalCtx);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
this->updateMode = EC_UPDATE_MASK_SHOP_OWNER;
@ -1041,7 +1051,7 @@ void DemoEc_InitFishingMan(DemoEc* this, GlobalContext* globalCtx) {
DemoEc_UseDrawObject(this, globalCtx);
DemoEc_InitSkelAnime(this, globalCtx, &D_060085F8);
DemoEc_UseAnimationObject(this, globalCtx);
DemoEc_ChangeAnimation(this, &D_0600AFE0, 0, 0.0f, false);
DemoEc_ChangeAnimation(this, &gDemoEcPotionShopOwnerAnim, 0, 0.0f, false);
func_8096D5D4(this, globalCtx);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
this->updateMode = EC_UPDATE_FISHING_MAN;
@ -1076,7 +1086,7 @@ void DemoEc_InitBombchuShopOwner(DemoEc* this, GlobalContext* globalCtx) {
DemoEc_UseDrawObject(this, globalCtx);
DemoEc_InitSkelAnime(this, globalCtx, &D_06004868);
DemoEc_UseAnimationObject(this, globalCtx);
DemoEc_ChangeAnimation(this, &D_0600AFE0, 0, 0.0f, false);
DemoEc_ChangeAnimation(this, &gDemoEcPotionShopOwnerAnim, 0, 0.0f, false);
func_8096D5D4(this, globalCtx);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
this->updateMode = EC_UPDATE_BOMBCHU_SHOP_OWNER;
@ -1108,13 +1118,13 @@ void DemoEc_InitGorons(DemoEc* this, GlobalContext* globalCtx) {
DemoEc_UseAnimationObject(this, globalCtx);
if (this->actor.params == 30) {
animation = &D_06002FA0;
animation = &gDemoEcGoronAnim;
goronScale = 1.0f;
} else if (this->actor.params == 31) {
animation = &D_06003A98;
animation = &gDemoEcGoron2Anim;
goronScale = 1.0f;
} else if (this->actor.params == 32) {
animation = &D_06002FA0;
animation = &gDemoEcGoronAnim;
goronScale = 15.0f;
} else {
goronScale = 5.0f;

View file

@ -1,5 +1,6 @@
#include "z_demo_tre_lgt.h"
#include "overlays/actors/ovl_En_Box/z_en_box.h"
#include "objects/object_box/object_box.h"
#define FLAGS 0x00000010
@ -15,8 +16,6 @@ void func_80993754(DemoTreLgt* this);
void func_8099375C(DemoTreLgt* this, GlobalContext* globalCtx);
void func_809937B4(DemoTreLgt* this, GlobalContext* globalCtx, f32 currentFrame);
extern SkelCurveLimbList D_06005EB8;
typedef struct {
/* 0x00 */ f32 startFrame;
/* 0x04 */ f32 endFrame;
@ -41,7 +40,7 @@ const ActorInit Demo_Tre_Lgt_InitVars = {
(ActorFunc)DemoTreLgt_Draw,
};
static TransformUpdateIndex* sTransformUpdIdx[] = { 0x06004B60, 0x06004F70 };
static TransformUpdateIndex* sTransformUpdIdx[] = { &gTreasureChestCurveAnim_4B60, &gTreasureChestCurveAnim_4F70 };
static DemoTreLgtActionFunc sActionFuncs[] = {
func_8099375C,
@ -51,7 +50,8 @@ static DemoTreLgtActionFunc sActionFuncs[] = {
void DemoTreLgt_Init(Actor* thisx, GlobalContext* globalCtx) {
DemoTreLgt* this = THIS;
if (!SkelCurve_Init(globalCtx, &this->skelCurve, &D_06005EB8, sTransformUpdIdx[0])) {
if (!SkelCurve_Init(globalCtx, &this->skelCurve, &gTreasureChestCurveSkel, sTransformUpdIdx[0])) {
// Demo_Tre_Lgt_Actor_ct (); Construct failed
osSyncPrintf("Demo_Tre_Lgt_Actor_ct();コンストラクト失敗\n");
}

View file

@ -5,6 +5,7 @@
*/
#include "z_door_ana.h"
#include "objects/gameplay_field_keep/gameplay_field_keep.h"
#define FLAGS 0x02000000
@ -17,7 +18,7 @@ void DoorAna_Draw(Actor* thisx, GlobalContext* globalCtx);
void DoorAna_WaitClosed(DoorAna* this, GlobalContext* globalCtx);
void DoorAna_WaitOpen(DoorAna* this, GlobalContext* globalCtx);
void DoorAna_GrabLink(DoorAna* this, GlobalContext* globalCtx);
void DoorAna_GrabPlayer(DoorAna* this, GlobalContext* globalCtx);
const ActorInit Door_Ana_InitVars = {
ACTOR_DOOR_ANA,
@ -57,8 +58,6 @@ static s16 entrances[] = {
0x05B0, 0x05B4, 0x05B8, 0x05BC, 0x05C0, 0x05C4, 0x05FC,
};
extern Gfx D_05001390[];
void DoorAna_SetupAction(DoorAna* this, DoorAnaActionFunc actionFunc) {
this->actionFunc = actionFunc;
}
@ -140,7 +139,7 @@ void DoorAna_WaitOpen(DoorAna* this, GlobalContext* globalCtx) {
destinationIdx = this->actor.home.rot.z + 1;
}
globalCtx->nextEntranceIndex = entrances[destinationIdx];
DoorAna_SetupAction(this, DoorAna_GrabLink);
DoorAna_SetupAction(this, DoorAna_GrabPlayer);
} else {
if (!Player_InCsMode(globalCtx) && !(player->stateFlags1 & 0x8800000) &&
this->actor.xzDistToPlayer <= 15.0f && -50.0f <= this->actor.yDistToPlayer &&
@ -156,7 +155,7 @@ void DoorAna_WaitOpen(DoorAna* this, GlobalContext* globalCtx) {
}
// update function for after the player has triggered the grotto
void DoorAna_GrabLink(DoorAna* this, GlobalContext* globalCtx) {
void DoorAna_GrabPlayer(DoorAna* this, GlobalContext* globalCtx) {
Player* player;
if (this->actor.yDistToPlayer <= 0.0f && 15.0f < this->actor.xzDistToPlayer) {
@ -180,7 +179,7 @@ void DoorAna_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_80093D84(globalCtx->state.gfxCtx);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_door_ana.c", 446),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, D_05001390);
gSPDisplayList(POLY_XLU_DISP++, gGrottoDL);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_door_ana.c", 449);
}

View file

@ -7,6 +7,7 @@
#include "z_door_shutter.h"
#include "objects/object_demo_kekkai/object_demo_kekkai.h"
#include "overlays/actors/ovl_Boss_Goma/z_boss_goma.h"
#include "objects/object_ydan_objects/object_ydan_objects.h"
#include "objects/object_gnd/object_gnd.h"
#include "objects/object_goma/object_goma.h"
#include "objects/gameplay_keep/gameplay_keep.h"
@ -86,8 +87,8 @@ typedef struct {
} ShutterInfo;
static ShutterInfo D_80998134[] = {
{ 0x060067A0, gDoorMetalBarsDL, 130, 12, 20, 15 },
{ 0x06006910, gDoorMetalBarsDL, 130, 12, 20, 15 },
{ gDTDungeonDoor1DL, gDoorMetalBarsDL, 130, 12, 20, 15 },
{ gDTDungeonDoor2DL, gDoorMetalBarsDL, 130, 12, 20, 15 },
{ 0x060000C0, 0x060001F0, 240, 14, 70, 15 },
{ 0x06000590, 0x06006460, 0, 110, 50, 15 },
{ gPhantomGanonBarsDL, NULL, 130, 12, 50, 15 },

View file

@ -1,4 +1,5 @@
#include "z_en_box.h"
#include "objects/object_box/object_box.h"
#define FLAGS 0x00000000
@ -50,16 +51,6 @@ void EnBox_AppearAnimation(EnBox*, GlobalContext*);
void EnBox_WaitOpen(EnBox*, GlobalContext*);
void EnBox_Open(EnBox*, GlobalContext*);
extern AnimationHeader D_06000128;
extern AnimationHeader D_0600024C;
extern AnimationHeader D_0600043C;
extern Gfx D_060006F0[]; // regular chest base
extern Gfx D_06000AE8[]; // boss key chest base
extern Gfx D_060010C0[]; // regular chest top
extern Gfx D_06001678[]; // boss key chest top
extern SkeletonHeader D_060047D8;
extern CollisionHeader D_06005FC8;
const ActorInit En_Box_InitVars = {
ACTOR_EN_BOX,
ACTORCAT_CHEST,
@ -72,13 +63,14 @@ const ActorInit En_Box_InitVars = {
(ActorFunc)EnBox_Draw,
};
static AnimationHeader* D_809CA800[4] = { &D_0600024C, &D_06000128, &D_0600043C, &D_0600043C };
static AnimationHeader* sAnimations[4] = { &gTreasureChestAnim_00024C, &gTreasureChestAnim_000128,
&gTreasureChestAnim_00043C, &gTreasureChestAnim_00043C };
static InitChainEntry sInitChain[] = {
ICHAIN_U8(targetMode, 0, ICHAIN_STOP),
};
static s32 sUnused;
static UNK_TYPE sUnused;
void EnBox_SetupAction(EnBox* this, EnBoxActionFunc actionFunc) {
this->actionFunc = actionFunc;
@ -107,13 +99,13 @@ void EnBox_Init(Actor* thisx, GlobalContext* globalCtx) {
f32 endFrame;
animFrameStart = 0.0f;
anim = D_809CA800[((void)0, gSaveContext.linkAge)];
anim = sAnimations[((void)0, gSaveContext.linkAge)];
colHeader = NULL;
endFrame = Animation_GetLastFrame(anim);
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
DynaPolyActor_Init(&this->dyna, DPM_UNK);
CollisionHeader_GetVirtual(&D_06005FC8, &colHeader);
CollisionHeader_GetVirtual(&gTreasureChestCol, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx2, &globalCtx2->colCtx.dyna, &this->dyna.actor, colHeader);
func_8003ECA8(globalCtx2, &globalCtx2->colCtx.dyna, this->dyna.bgId);
@ -179,7 +171,7 @@ void EnBox_Init(Actor* thisx, GlobalContext* globalCtx) {
this->dyna.actor.world.rot.y += 0x8000;
this->dyna.actor.home.rot.z = this->dyna.actor.world.rot.z = this->dyna.actor.shape.rot.z = 0;
SkelAnime_Init(globalCtx2, &this->skelanime, &D_060047D8, anim, this->jointTable, this->morphTable, 5);
SkelAnime_Init(globalCtx2, &this->skelanime, &gTreasureChestSkel, anim, this->jointTable, this->morphTable, 5);
Animation_Change(&this->skelanime, anim, 1.5f, animFrameStart, endFrame, ANIMMODE_ONCE, 0.0f);
switch (this->type) {
@ -407,7 +399,7 @@ void EnBox_WaitOpen(EnBox* this, GlobalContext* globalCtx) {
this->movementFlags |= ENBOX_MOVE_IMMOBILE;
if (this->unk_1F4 != 0) { // unk_1F4 is modified by player code
linkAge = gSaveContext.linkAge;
anim = D_809CA800[(this->unk_1F4 < 0 ? 2 : 0) + linkAge];
anim = sAnimations[(this->unk_1F4 < 0 ? 2 : 0) + linkAge];
frameCount = Animation_GetLastFrame(anim);
Animation_Change(&this->skelanime, anim, 1.5f, 0, frameCount, ANIMMODE_ONCE, 0.0f);
EnBox_SetupAction(this, EnBox_Open);
@ -558,17 +550,17 @@ void EnBox_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
gSPMatrix((*gfx)++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_box.c", 1492),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if (this->type != ENBOX_TYPE_DECORATED_BIG) {
gSPDisplayList((*gfx)++, D_060006F0);
gSPDisplayList((*gfx)++, gTreasureChestChestFrontDL);
} else {
gSPDisplayList((*gfx)++, D_06000AE8);
gSPDisplayList((*gfx)++, gTreasureChestBossKeyChestFrontDL);
}
} else if (limbIndex == 3) {
gSPMatrix((*gfx)++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_box.c", 1502),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if (this->type != ENBOX_TYPE_DECORATED_BIG) {
gSPDisplayList((*gfx)++, D_060010C0);
gSPDisplayList((*gfx)++, gTreasureChestChestSideAndLidDL);
} else {
gSPDisplayList((*gfx)++, D_06001678);
gSPDisplayList((*gfx)++, gTreasureChestBossKeyChestSideAndTopDL);
}
}
}

View file

@ -7,6 +7,7 @@
#include "z_en_butte.h"
#include "overlays/actors/ovl_En_Elf/z_en_elf.h"
#include "objects/gameplay_keep/gameplay_keep.h"
#include "objects/gameplay_field_keep/gameplay_field_keep.h"
#define FLAGS 0x00000000
@ -82,9 +83,6 @@ static EnButteFlightParams sFollowLinkParams[] = {
{ 10, 20, 2.4f, 0.3f, 1.0f, 0 },
};
extern AnimationHeader D_05002470;
extern SkeletonHeader D_050036F0;
void EnButte_SelectFlightParams(EnButte* this, EnButteFlightParams* flightParams) {
if (this->flightParamsIdx == 0) {
if (Rand_ZeroOne() < 0.6f) {
@ -162,14 +160,15 @@ void EnButte_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.uncullZoneScale = 200.0f;
}
SkelAnime_Init(globalCtx, &this->skelAnime, &D_050036F0, &D_05002470, this->jointTable, this->morphTable, 8);
SkelAnime_Init(globalCtx, &this->skelAnime, &gButterflySkel, &gButterflyAnim, this->jointTable, this->morphTable,
8);
Collider_InitJntSph(globalCtx, &this->collider);
Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sColliderInit, this->colliderItems);
this->actor.colChkInfo.mass = 0;
this->unk_25C = Rand_ZeroOne() * 0xFFFF;
this->unk_25E = Rand_ZeroOne() * 0xFFFF;
this->unk_260 = Rand_ZeroOne() * 0xFFFF;
Animation_Change(&this->skelAnime, &D_05002470, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP_INTERP, 0.0f);
Animation_Change(&this->skelAnime, &gButterflyAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP_INTERP, 0.0f);
EnButte_SetupFlyAround(this);
this->actor.shape.rot.x -= 0x2320;
this->drawSkelAnime = true;

View file

@ -1,4 +1,5 @@
#include "z_en_cs.h"
#include "objects/object_link_child/object_link_child.h"
#define FLAGS 0x00000009
@ -16,7 +17,6 @@ s32 EnCs_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
void EnCs_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx);
extern FlexSkeletonHeader D_06008540; // Graveyard boy skeleton
extern Gfx D_0602AF70[]; // Spooky Mask in Child Link's object
const ActorInit En_Cs_InitVars = {
ACTOR_EN_CS,
@ -439,7 +439,7 @@ void EnCs_Draw(Actor* thisx, GlobalContext* globalCtx) {
mtx = Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_cs.c", 1000);
gSPSegment(POLY_OPA_DISP++, 0x06, globalCtx->objectCtx.status[childLinkObjectIndex].segment);
gSPSegment(POLY_OPA_DISP++, 0x0D, mtx - 7);
gSPDisplayList(POLY_OPA_DISP++, D_0602AF70);
gSPDisplayList(POLY_OPA_DISP++, gLinkChildSpookyMaskDL);
gSPSegment(POLY_OPA_DISP++, 0x06, globalCtx->objectCtx.status[this->actor.objBankIndex].segment);
}
}

View file

@ -6,6 +6,7 @@
#include "z_en_door.h"
#include "objects/gameplay_keep/gameplay_keep.h"
#include "objects/gameplay_field_keep/gameplay_field_keep.h"
#include "objects/object_hidan_objects/object_hidan_objects.h"
#include "objects/object_mizu_objects/object_mizu_objects.h"
@ -73,7 +74,7 @@ static Gfx* D_809FCEE4[5][2] = {
{ gFireTempleDoorWithHandleFrontDL, gFireTempleDoorWithHandleBackDL },
{ gWaterTempleDoorLeftDL, gWaterTempleDoorRightDL },
{ 0x060013B8, 0x06001420 },
{ 0x050047A0, 0x05004978 },
{ gFieldDoor1DL, gFieldDoor2DL },
};
void EnDoor_Init(Actor* thisx, GlobalContext* globalCtx2) {

View file

@ -1,4 +1,5 @@
#include "z_en_fr.h"
#include "objects/gameplay_field_keep/gameplay_field_keep.h"
#include "vt.h"
#define FLAGS 0x02000019
@ -51,8 +52,6 @@ void EnFr_SetIdle(EnFr* this, GlobalContext* globalCtx);
extern FlexSkeletonHeader D_0600B498; // Frog
extern AnimationHeader D_06001534; // Frog
extern SkeletonHeader D_050036F0; // Butterfly
extern AnimationHeader D_05002470; // Butterfly
extern AnimationHeader D_060007BC; // Frog Jumping
extern AnimationHeader D_060011C0; // Frog Landing
@ -161,8 +160,7 @@ static s16 sTimerFrogSong[] = {
40, 20, 15, 12, 12,
};
// static InitChainEntry sInitChain[]
InitChainEntry D_80A1D0BC[] = {
static InitChainEntry sInitChain[] = {
ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE),
ICHAIN_F32(targetArrowOffset, 30, ICHAIN_STOP),
};
@ -278,13 +276,13 @@ void EnFr_Update(Actor* thisx, GlobalContext* globalCtx) {
this->actor.flags &= ~0x10;
frogIndex = this->actor.params - 1;
sEnFrPointers.frogs[frogIndex] = this;
Actor_ProcessInitChain(&this->actor, D_80A1D0BC);
Actor_ProcessInitChain(&this->actor, sInitChain);
// frog
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600B498, &D_06001534, this->jointTable, this->morphTable,
24);
// butterfly
SkelAnime_Init(globalCtx, &this->skelAnimeButterfly, &D_050036F0, &D_05002470, this->jointTableButterfly,
this->morphTableButterfly, 8);
SkelAnime_Init(globalCtx, &this->skelAnimeButterfly, &gButterflySkel, &gButterflyAnim,
this->jointTableButterfly, this->morphTableButterfly, 8);
// When playing the song for the HP, the frog with the next note and the butterfly turns on its lightsource
this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo);
Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.home.pos.x, this->actor.home.pos.y,

View file

@ -5,6 +5,7 @@
*/
#include "z_en_heishi1.h"
#include "objects/object_sd/object_sd.h"
#include "vt.h"
#define FLAGS 0x00000010
@ -64,10 +65,6 @@ static s32 sCamDataIdxs[] = {
static s16 sWaypoints[] = { 0, 4, 1, 5, 2, 6, 3, 7 };
extern AnimationHeader D_06005880;
extern AnimationHeader D_06005C30;
extern SkeletonHeader D_0600BAC8;
void EnHeishi1_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
EnHeishi1* this = THIS;
@ -76,7 +73,8 @@ void EnHeishi1_Init(Actor* thisx, GlobalContext* globalCtx) {
u16 time;
Actor_SetScale(&this->actor, 0.01f);
SkelAnime_Init(globalCtx, &this->skelAnime, &D_0600BAC8, &D_06005C30, this->jointTable, this->morphTable, 17);
SkelAnime_Init(globalCtx, &this->skelAnime, &gEnHeishiSkel, &gEnHeishiIdleAnim, this->jointTable, this->morphTable,
17);
this->type = (this->actor.params >> 8) & 0xFF;
this->path = this->actor.params & 0xFF;
@ -139,9 +137,9 @@ void EnHeishi1_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
void EnHeishi1_SetupWalk(EnHeishi1* this, GlobalContext* globalCtx) {
f32 frameCount = Animation_GetLastFrame(&D_06005880);
f32 frameCount = Animation_GetLastFrame(&gEnHeishiWalkAnim);
Animation_Change(&this->skelAnime, &D_06005880, this->animSpeed, 0.0f, (s16)frameCount, ANIMMODE_LOOP,
Animation_Change(&this->skelAnime, &gEnHeishiWalkAnim, this->animSpeed, 0.0f, (s16)frameCount, ANIMMODE_LOOP,
this->transitionRate);
this->bodyTurnSpeed = 0.0f;
this->moveSpeed = 0.0f;
@ -223,9 +221,9 @@ void EnHeishi1_Walk(EnHeishi1* this, GlobalContext* globalCtx) {
}
void EnHeishi1_SetupMoveToLink(EnHeishi1* this, GlobalContext* globalCtx) {
f32 frameCount = Animation_GetLastFrame(&D_06005880);
f32 frameCount = Animation_GetLastFrame(&gEnHeishiWalkAnim);
Animation_Change(&this->skelAnime, &D_06005880, 3.0f, 0.0f, (s16)frameCount, ANIMMODE_LOOP, -3.0f);
Animation_Change(&this->skelAnime, &gEnHeishiWalkAnim, 3.0f, 0.0f, (s16)frameCount, ANIMMODE_LOOP, -3.0f);
this->bodyTurnSpeed = 0.0f;
this->moveSpeed = 0.0f;
func_8010B680(globalCtx, 0x702D, &this->actor);
@ -251,9 +249,9 @@ void EnHeishi1_MoveToLink(EnHeishi1* this, GlobalContext* globalCtx) {
void EnHeishi1_SetupWait(EnHeishi1* this, GlobalContext* globalCtx) {
s16 rand;
f32 frameCount = Animation_GetLastFrame(&D_06005C30);
f32 frameCount = Animation_GetLastFrame(&gEnHeishiIdleAnim);
Animation_Change(&this->skelAnime, &D_06005C30, this->animSpeed, 0.0f, (s16)frameCount, ANIMMODE_LOOP,
Animation_Change(&this->skelAnime, &gEnHeishiIdleAnim, this->animSpeed, 0.0f, (s16)frameCount, ANIMMODE_LOOP,
this->transitionRate);
this->headBehaviorDecided = false;
this->headDirection = Rand_ZeroFloat(1.99f);
@ -321,9 +319,9 @@ void EnHeishi1_Wait(EnHeishi1* this, GlobalContext* globalCtx) {
}
void EnHeishi1_SetupTurnTowardLink(EnHeishi1* this, GlobalContext* globalCtx) {
f32 frameCount = Animation_GetLastFrame(&D_06005C30);
f32 frameCount = Animation_GetLastFrame(&gEnHeishiIdleAnim);
Animation_Change(&this->skelAnime, &D_06005C30, 1.0f, 0.0f, (s16)frameCount, ANIMMODE_LOOP, -10.0f);
Animation_Change(&this->skelAnime, &gEnHeishiIdleAnim, 1.0f, 0.0f, (s16)frameCount, ANIMMODE_LOOP, -10.0f);
this->kickTimer = 30;
this->actionFunc = EnHeishi1_TurnTowardLink;
}
@ -343,9 +341,9 @@ void EnHeishi1_TurnTowardLink(EnHeishi1* this, GlobalContext* globalCtx) {
}
void EnHeishi1_SetupKick(EnHeishi1* this, GlobalContext* globalCtx) {
f32 frameCount = Animation_GetLastFrame(&D_06005C30);
f32 frameCount = Animation_GetLastFrame(&gEnHeishiIdleAnim);
Animation_Change(&this->skelAnime, &D_06005C30, 1.0f, 0.0f, (s16)frameCount, ANIMMODE_LOOP, -10.0f);
Animation_Change(&this->skelAnime, &gEnHeishiIdleAnim, 1.0f, 0.0f, (s16)frameCount, ANIMMODE_LOOP, -10.0f);
this->actionFunc = EnHeishi1_Kick;
}
@ -369,9 +367,9 @@ void EnHeishi1_Kick(EnHeishi1* this, GlobalContext* globalCtx) {
}
void EnHeishi1_SetupWaitNight(EnHeishi1* this, GlobalContext* globalCtx) {
f32 frameCount = Animation_GetLastFrame(&D_06005C30);
f32 frameCount = Animation_GetLastFrame(&gEnHeishiIdleAnim);
Animation_Change(&this->skelAnime, &D_06005C30, 1.0f, 0.0f, (s16)frameCount, ANIMMODE_LOOP, -10.0f);
Animation_Change(&this->skelAnime, &gEnHeishiIdleAnim, 1.0f, 0.0f, (s16)frameCount, ANIMMODE_LOOP, -10.0f);
this->actionFunc = EnHeishi1_WaitNight;
}

View file

@ -6,6 +6,8 @@
#include "vt.h"
#include "z_en_heishi2.h"
#include "objects/object_sd/object_sd.h"
#include "objects/object_link_child/object_link_child.h"
#include "overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h"
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
#include "overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.h"
@ -19,9 +21,9 @@ void EnHeishi2_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnHeishi2_Update(Actor* thisx, GlobalContext* globalCtx);
void EnHeishi2_Draw(Actor* thisx, GlobalContext* globalCtx);
void func_80A54C6C(Actor* thisx, GlobalContext* globalCtx);
void func_80A531CC(EnHeishi2* this, GlobalContext* globalCtx);
void func_80A531D8(EnHeishi2* this, GlobalContext* globalCtx);
void EnHeishi2_DrawKingGuard(Actor* thisx, GlobalContext* globalCtx);
void EnHeishi2_DoNothing1(EnHeishi2* this, GlobalContext* globalCtx);
void EnHeishi_DoNothing2(EnHeishi2* this, GlobalContext* globalCtx);
void func_80A531E4(EnHeishi2* this, GlobalContext* globalCtx);
void func_80A53278(EnHeishi2* this, GlobalContext* globalCtx);
void func_80A5344C(EnHeishi2* this, GlobalContext* globalCtx);
@ -50,12 +52,6 @@ void func_80A546DC(EnHeishi2* this, GlobalContext* globalCtx);
void func_80A541FC(EnHeishi2* this, GlobalContext* globalCtx);
void func_80A53DF8(EnHeishi2* this, GlobalContext* globalCtx);
extern AnimationHeader D_06005C30;
extern AnimationHeader D_06005500;
extern SkeletonHeader D_0600BAC8;
extern Gfx D_0602B060[]; // Keaton Mask
extern Gfx D_06002C10[]; // 2D Guard in Window
const ActorInit En_Heishi2_InitVars = {
ACTOR_EN_HEISHI2,
ACTORCAT_NPC,
@ -93,15 +89,15 @@ void EnHeishi2_Init(Actor* thisx, GlobalContext* globalCtx) {
EnHeishi2* this = THIS;
Actor_SetScale(&this->actor, 0.01f);
this->initParams = this->actor.params & 0xFF;
this->type = this->actor.params & 0xFF;
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
if ((this->initParams == 6) || (this->initParams == 9)) {
this->actor.draw = func_80A54C6C;
if ((this->type == 6) || (this->type == 9)) {
this->actor.draw = EnHeishi2_DrawKingGuard;
this->actor.flags &= -2;
Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, 6);
if (this->initParams == 6) {
this->actionFunc = func_80A531CC;
if (this->type == 6) {
this->actionFunc = EnHeishi2_DoNothing1;
} else {
osSyncPrintf("\n\n");
@ -124,7 +120,8 @@ void EnHeishi2_Init(Actor* thisx, GlobalContext* globalCtx) {
} else {
this->unk_2E0 = 60.0f;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
SkelAnime_Init(globalCtx, &this->skelAnime, &D_0600BAC8, &D_06005C30, this->jointTable, this->morphTable, 17);
SkelAnime_Init(globalCtx, &this->skelAnime, &gEnHeishiSkel, &gEnHeishiIdleAnim, this->jointTable,
this->morphTable, 17);
collider = &this->collider;
Collider_InitCylinder(globalCtx, collider);
Collider_SetCylinder(globalCtx, collider, &this->actor, &sCylinderInit);
@ -133,7 +130,7 @@ void EnHeishi2_Init(Actor* thisx, GlobalContext* globalCtx) {
this->collider.dim.height = 0x46;
this->actor.targetMode = 6;
switch (this->initParams) {
switch (this->type) {
case 2:
this->actionFunc = func_80A531E4;
@ -149,7 +146,7 @@ void EnHeishi2_Init(Actor* thisx, GlobalContext* globalCtx) {
osSyncPrintf(VT_FGCOL(GREEN) " ☆☆☆☆☆ 覗き穴奥兵士ふぃ〜 ☆☆☆☆☆ \n" VT_RST);
Collider_DestroyCylinder(globalCtx, collider);
this->actor.flags &= -0xA;
this->actionFunc = func_80A531D8;
this->actionFunc = EnHeishi_DoNothing2;
break;
}
@ -158,7 +155,7 @@ void EnHeishi2_Init(Actor* thisx, GlobalContext* globalCtx) {
// "Soldier Set 2 Completed!"
osSyncPrintf(VT_FGCOL(GREEN) " ☆☆☆☆☆ 兵士2セット完了! ☆☆☆☆☆ %d\n" VT_RST, this->actor.params);
// "Identification Completed!"
osSyncPrintf(VT_FGCOL(YELLOW) " ☆☆☆☆☆ 識別完了! ☆☆☆☆☆ %d\n" VT_RST, this->initParams);
osSyncPrintf(VT_FGCOL(YELLOW) " ☆☆☆☆☆ 識別完了! ☆☆☆☆☆ %d\n" VT_RST, this->type);
// "Message completed!"
osSyncPrintf(VT_FGCOL(PURPLE) " ☆☆☆☆☆ メッセージ完了! ☆☆☆☆☆ %x\n\n" VT_RST, (this->actor.params >> 8) & 0xF);
}
@ -172,16 +169,16 @@ void EnHeishi2_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
}
void func_80A531CC(EnHeishi2* this, GlobalContext* globalCtx) {
void EnHeishi2_DoNothing1(EnHeishi2* this, GlobalContext* globalCtx) {
}
void func_80A531D8(EnHeishi2* this, GlobalContext* globalCtx) {
void EnHeishi_DoNothing2(EnHeishi2* this, GlobalContext* globalCtx) {
}
void func_80A531E4(EnHeishi2* this, GlobalContext* globalCtx) {
f32 frameCount = Animation_GetLastFrame(&D_06005C30);
f32 frameCount = Animation_GetLastFrame(&gEnHeishiIdleAnim);
Animation_Change(&this->skelAnime, &D_06005C30, 1.0f, 0.0f, (s16)frameCount, ANIMMODE_LOOP, -10.0f);
Animation_Change(&this->skelAnime, &gEnHeishiIdleAnim, 1.0f, 0.0f, (s16)frameCount, ANIMMODE_LOOP, -10.0f);
this->actionFunc = func_80A53278;
}
@ -277,10 +274,10 @@ void func_80A53538(EnHeishi2* this, GlobalContext* globalCtx) {
}
void func_80A535BC(EnHeishi2* this, GlobalContext* globalCtx) {
f32 frameCount = Animation_GetLastFrame(&D_06005500);
f32 frameCount = Animation_GetLastFrame(&gEnHeishiSlamSpearAnim);
this->unk_2EC = frameCount;
Animation_Change(&this->skelAnime, &D_06005500, 1.0f, 0.0f, frameCount, ANIMMODE_ONCE, -10.0f);
Animation_Change(&this->skelAnime, &gEnHeishiSlamSpearAnim, 1.0f, 0.0f, frameCount, ANIMMODE_ONCE, -10.0f);
this->actionFunc = func_80A53638;
}
@ -312,9 +309,9 @@ void func_80A53638(EnHeishi2* this, GlobalContext* globalCtx) {
}
void func_80A5372C(EnHeishi2* this, GlobalContext* globalCtx) {
f32 frameCount = Animation_GetLastFrame(&D_06005C30);
f32 frameCount = Animation_GetLastFrame(&gEnHeishiIdleAnim);
Animation_Change(&this->skelAnime, &D_06005C30, 1.0f, 0.0f, (s16)frameCount, ANIMMODE_LOOP, -10.0f);
Animation_Change(&this->skelAnime, &gEnHeishiIdleAnim, 1.0f, 0.0f, (s16)frameCount, ANIMMODE_LOOP, -10.0f);
this->unk_2F2[0] = 200;
this->cameraId = Gameplay_CreateSubCamera(globalCtx);
Gameplay_ChangeCameraStatus(globalCtx, MAIN_CAM, CAM_STAT_WAIT);
@ -348,9 +345,9 @@ void func_80A53850(EnHeishi2* this, GlobalContext* globalCtx) {
}
void func_80A53908(EnHeishi2* this, GlobalContext* globalCtx) {
f32 frameCount = Animation_GetLastFrame(&D_06005C30);
f32 frameCount = Animation_GetLastFrame(&gEnHeishiIdleAnim);
Animation_Change(&this->skelAnime, &D_06005C30, 1.0f, 0.0f, (s16)frameCount, ANIMMODE_LOOP, -10.0f);
Animation_Change(&this->skelAnime, &gEnHeishiIdleAnim, 1.0f, 0.0f, (s16)frameCount, ANIMMODE_LOOP, -10.0f);
this->actionFunc = func_80A5399C;
}
@ -441,10 +438,10 @@ void func_80A53C0C(EnHeishi2* this, GlobalContext* globalCtx) {
}
void func_80A53C90(EnHeishi2* this, GlobalContext* globalCtx) {
f32 frameCount = Animation_GetLastFrame(&D_06005500);
f32 frameCount = Animation_GetLastFrame(&gEnHeishiSlamSpearAnim);
this->unk_2EC = frameCount;
Animation_Change(&this->skelAnime, &D_06005500, 1.0f, 0.0f, frameCount, ANIMMODE_ONCE, -10.0f);
Animation_Change(&this->skelAnime, &gEnHeishiSlamSpearAnim, 1.0f, 0.0f, frameCount, ANIMMODE_ONCE, -10.0f);
this->actionFunc = func_80A53D0C;
}
@ -479,9 +476,9 @@ void func_80A53D0C(EnHeishi2* this, GlobalContext* globalCtx) {
}
void func_80A53DF8(EnHeishi2* this, GlobalContext* globalCtx) {
f32 frameCount = Animation_GetLastFrame(&D_06005C30);
f32 frameCount = Animation_GetLastFrame(&gEnHeishiIdleAnim);
Animation_Change(&this->skelAnime, &D_06005C30, 1.0f, 0.0f, (s16)frameCount, ANIMMODE_LOOP, -10.0f);
Animation_Change(&this->skelAnime, &gEnHeishiIdleAnim, 1.0f, 0.0f, (s16)frameCount, ANIMMODE_LOOP, -10.0f);
this->unk_2F2[0] = 200;
this->cameraId = Gameplay_CreateSubCamera(globalCtx);
Gameplay_ChangeCameraStatus(globalCtx, MAIN_CAM, CAM_STAT_WAIT);
@ -604,10 +601,10 @@ void func_80A5427C(EnHeishi2* this, GlobalContext* globalCtx) {
}
void func_80A54320(EnHeishi2* this, GlobalContext* globalCtx) {
f32 frameCount = Animation_GetLastFrame(&D_06005500);
f32 frameCount = Animation_GetLastFrame(&gEnHeishiSlamSpearAnim);
this->unk_2EC = frameCount;
Animation_Change(&this->skelAnime, &D_06005500, 1.0f, 0.0f, frameCount, ANIMMODE_ONCE, -10.0f);
Animation_Change(&this->skelAnime, &gEnHeishiSlamSpearAnim, 1.0f, 0.0f, frameCount, ANIMMODE_ONCE, -10.0f);
this->audioFlag = 0;
this->actionFunc = func_80A543A0;
}
@ -699,28 +696,28 @@ void func_80A5475C(EnHeishi2* this, GlobalContext* globalCtx) {
if (Text_GetFaceReaction(globalCtx, 5) != 0) {
if (this->unk_30B == 0) {
if (this->initParams == 2) {
if (this->type == 2) {
this->actionFunc = func_80A53278;
return;
}
if (this->initParams == 5) {
if (this->type == 5) {
this->actionFunc = func_80A5399C;
return;
}
}
} else if (this->unk_30B != 0) {
if (this->initParams == 2) {
if (this->type == 2) {
this->actionFunc = func_80A53278;
return;
}
if (this->initParams == 5) {
if (this->type == 5) {
this->actionFunc = func_80A5399C;
return;
}
}
if (func_8002F194(&this->actor, globalCtx)) {
if (this->initParams == 2) {
if (this->type == 2) {
if (this->unk_30E == 1) {
this->actionFunc = func_80A5344C;
return;
@ -728,7 +725,7 @@ void func_80A5475C(EnHeishi2* this, GlobalContext* globalCtx) {
this->actionFunc = func_80A53278;
return;
}
} else if (this->initParams == 5) {
} else if (this->type == 5) {
if (this->unk_300 == 6) {
this->actionFunc = func_80A5399C;
}
@ -746,7 +743,7 @@ void func_80A5475C(EnHeishi2* this, GlobalContext* globalCtx) {
}
}
if (((this->initParams != 2) && (this->initParams != 5)) ||
if (((this->type != 2) && (this->type != 5)) ||
((yawDiff = ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)),
!(this->actor.xzDistToPlayer > 120.0f)) &&
(yawDiff < 0x4300))) {
@ -755,9 +752,9 @@ void func_80A5475C(EnHeishi2* this, GlobalContext* globalCtx) {
}
void func_80A54954(EnHeishi2* this, GlobalContext* globalCtx) {
f32 frameCount = Animation_GetLastFrame(&D_06005C30);
f32 frameCount = Animation_GetLastFrame(&gEnHeishiIdleAnim);
Animation_Change(&this->skelAnime, &D_06005C30, 1.0f, 0.0f, (s16)frameCount, ANIMMODE_LOOP, -10.0f);
Animation_Change(&this->skelAnime, &gEnHeishiIdleAnim, 1.0f, 0.0f, (s16)frameCount, ANIMMODE_LOOP, -10.0f);
this->actionFunc = func_80A549E8;
}
@ -766,10 +763,10 @@ void func_80A549E8(EnHeishi2* this, GlobalContext* globalCtx) {
if (this->unk_300 == func_8010BDBC(&globalCtx->msgCtx)) {
if (func_80106BC8(globalCtx) != 0) {
func_80106CCC(globalCtx);
if (this->initParams == 2) {
if (this->type == 2) {
this->actionFunc = func_80A531E4;
}
if (this->initParams == 5) {
if (this->type == 5) {
this->actionFunc = func_80A53908;
}
}
@ -782,7 +779,7 @@ void EnHeishi2_Update(Actor* thisx, GlobalContext* globalCtx) {
s32 i;
Actor_SetFocus(&this->actor, this->unk_2E0);
if ((this->initParams == 2) || (this->initParams == 5)) {
if ((this->type == 2) || (this->type == 5)) {
this->actor.focus.pos.y = 70.0f;
Actor_SetFocus(&this->actor, 70.0f);
func_80038290(globalCtx, &this->actor, &this->unk_260, &this->unk_26C, this->actor.focus.pos);
@ -797,7 +794,7 @@ void EnHeishi2_Update(Actor* thisx, GlobalContext* globalCtx) {
}
this->actionFunc(this, globalCtx);
Actor_MoveForward(&this->actor);
switch (this->initParams) {
switch (this->type) {
case 6:
break;
case 9:
@ -814,7 +811,7 @@ s32 EnHeishi2_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dL
void* thisx) {
EnHeishi2* this = THIS;
switch (this->initParams) {
switch (this->type) {
case 1:
break;
case 7:
@ -840,12 +837,12 @@ void EnHeishi2_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList
}
}
void func_80A54C6C(Actor* thisx, GlobalContext* globalCtx) {
void EnHeishi2_DrawKingGuard(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_heishi2.c", 1772);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_heishi2.c", 1774),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, &D_06002C10);
gSPDisplayList(POLY_OPA_DISP++, &gHeishiKingGuardDL);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_heishi2.c", 1777);
}
@ -861,7 +858,7 @@ void EnHeishi2_Draw(Actor* thisx, GlobalContext* globalCtx) {
SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, EnHeishi2_OverrideLimbDraw,
EnHeishi2_PostLimbDraw, this);
if ((this->initParams == 5) && (gSaveContext.infTable[7] & 0x80)) {
if ((this->type == 5) && (gSaveContext.infTable[7] & 0x80)) {
linkObjBankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_LINK_CHILD);
if (linkObjBankIndex >= 0) {
Matrix_Put(&this->mtxf_330);
@ -871,7 +868,7 @@ void EnHeishi2_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPSegment(POLY_OPA_DISP++, 0x06, globalCtx->objectCtx.status[linkObjBankIndex].segment);
gSPSegment(POLY_OPA_DISP++, 0x0D, mtx);
gSPDisplayList(POLY_OPA_DISP++, &D_0602B060);
gSPDisplayList(POLY_OPA_DISP++, gLinkChildKeatonMaskDL);
gSPSegment(POLY_OPA_DISP++, 0x06, globalCtx->objectCtx.status[this->actor.objBankIndex].segment);
}
}

View file

@ -32,7 +32,7 @@ typedef struct EnHeishi2 {
/* 0x02F0 */ u16 unk_2F0;
/* 0x02F2 */ s16 unk_2F2[0x5]; // starts counting down when guard starts to open gate.
/* 0x02FC */ s16 unk_2FC;
/* 0x02FE */ s16 initParams; // copy of actor params at init
/* 0x02FE */ s16 type; // copy of actor params at init
/* 0x0300 */ s16 unk_300; // mask related
/* 0x0302 */ char unk_302[0x6];
/* 0x0308 */ u8 audioFlag;

View file

@ -5,6 +5,7 @@
*/
#include "z_en_heishi3.h"
#include "objects/object_sd/object_sd.h"
#include "vt.h"
#define FLAGS 0x00000000
@ -24,10 +25,6 @@ void EnHeishi3_ResetAnimationToIdle(EnHeishi3* this, GlobalContext* globalCtx);
void func_80A55D00(EnHeishi3* this, GlobalContext* globalCtx);
void func_80A55BD4(EnHeishi3* this, GlobalContext* globalCtx);
extern SkeletonHeader D_0600BAC8;
extern AnimationHeader D_06005C30; // EnHeishi3_IdleAnimation
extern AnimationHeader D_06005880; // EnHeishi3_WalkAnimation
static s16 sPlayerCaught = 0;
const ActorInit En_Heishi3_InitVars = {
@ -76,7 +73,8 @@ void EnHeishi3_Init(Actor* thisx, GlobalContext* globalCtx) {
}
Actor_SetScale(&this->actor, 0.01f);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
SkelAnime_Init(globalCtx, &this->skelAnime, &D_0600BAC8, &D_06005C30, this->jointTable, this->morphTable, 17);
SkelAnime_Init(globalCtx, &this->skelAnime, &gEnHeishiSkel, &gEnHeishiIdleAnim, this->jointTable, this->morphTable,
17);
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
this->actor.targetMode = 6;
Collider_InitCylinder(globalCtx, &this->collider);
@ -96,9 +94,9 @@ void EnHeishi3_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
void EnHeishi3_SetupGuardType(EnHeishi3* this, GlobalContext* globalCtx) {
f32 frameCount = Animation_GetLastFrame(&D_06005C30);
f32 frameCount = Animation_GetLastFrame(&gEnHeishiIdleAnim);
Animation_Change(&this->skelAnime, &D_06005C30, 1.0f, 0.0f, (s16)frameCount, ANIMMODE_LOOP, -10.0f);
Animation_Change(&this->skelAnime, &gEnHeishiIdleAnim, 1.0f, 0.0f, (s16)frameCount, ANIMMODE_LOOP, -10.0f);
if (this->unk_278 == 0) {
this->actionFunc = EnHeishi3_StandSentinelInGrounds;
} else {
@ -172,9 +170,9 @@ void EnHeishi3_StandSentinelInCastle(EnHeishi3* this, GlobalContext* globalCtx)
}
void EnHeishi3_CatchStart(EnHeishi3* this, GlobalContext* globalCtx) {
f32 frameCount = Animation_GetLastFrame(&D_06005880);
f32 frameCount = Animation_GetLastFrame(&gEnHeishiWalkAnim);
Animation_Change(&this->skelAnime, &D_06005880, 1.0f, 0.0f, (s16)frameCount, ANIMMODE_LOOP, -10.0f);
Animation_Change(&this->skelAnime, &gEnHeishiWalkAnim, 1.0f, 0.0f, (s16)frameCount, ANIMMODE_LOOP, -10.0f);
this->caughtTimer = 20;
this->actionFunc = func_80A55BD4;
this->actor.speedXZ = 2.5f;
@ -195,9 +193,9 @@ void func_80A55BD4(EnHeishi3* this, GlobalContext* globalCtx) {
}
void EnHeishi3_ResetAnimationToIdle(EnHeishi3* this, GlobalContext* globalCtx) {
f32 frameCount = Animation_GetLastFrame(&D_06005C30);
f32 frameCount = Animation_GetLastFrame(&gEnHeishiIdleAnim);
Animation_Change(&this->skelAnime, &D_06005C30, 1.0f, 0.0f, (s16)frameCount, ANIMMODE_LOOP, -10.0f);
Animation_Change(&this->skelAnime, &gEnHeishiIdleAnim, 1.0f, 0.0f, (s16)frameCount, ANIMMODE_LOOP, -10.0f);
this->actionFunc = func_80A55D00;
}

View file

@ -1,4 +1,5 @@
#include "z_en_heishi4.h"
#include "objects/object_sd/object_sd.h"
#include "vt.h"
#define FLAGS 0x00000009
@ -56,12 +57,6 @@ static ColliderCylinderInit sCylinderInit = {
{ 33, 40, 0, { 0, 0, 0 } },
};
extern SkeletonHeader D_0600BAC8;
extern AnimationHeader D_0600C444;
extern AnimationHeader D_06005C30;
extern AnimationHeader D_0600C6C8;
extern AnimationHeader D_0600C374;
void EnHeishi4_Init(Actor* thisx, GlobalContext* globalCtx) {
EnHeishi4* this = THIS;
@ -73,11 +68,13 @@ void EnHeishi4_Init(Actor* thisx, GlobalContext* globalCtx) {
if (this->type == HEISHI4_AT_MARKET_DYING) {
this->height = 30.0f;
ActorShape_Init(&thisx->shape, 0.0f, NULL, 30.0f);
SkelAnime_Init(globalCtx, &this->skelAnime, &D_0600BAC8, &D_0600C444, this->jointTable, this->morphTable, 17);
SkelAnime_Init(globalCtx, &this->skelAnime, &gEnHeishiSkel, &gEnHeishiDyingGuardAnim_00C444, this->jointTable,
this->morphTable, 17);
} else {
this->height = 60.0f;
ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
SkelAnime_Init(globalCtx, &this->skelAnime, &D_0600BAC8, &D_06005C30, this->jointTable, this->morphTable, 17);
SkelAnime_Init(globalCtx, &this->skelAnime, &gEnHeishiSkel, &gEnHeishiIdleAnim, this->jointTable,
this->morphTable, 17);
}
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit);
@ -113,9 +110,9 @@ void EnHeishi4_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
void func_80A56328(EnHeishi4* this, GlobalContext* globalCtx) {
f32 frames = Animation_GetLastFrame(&D_06005C30);
f32 frames = Animation_GetLastFrame(&gEnHeishiIdleAnim);
Animation_Change(&this->skelAnime, &D_06005C30, 1.0f, 0.0f, (s16)frames, ANIMMODE_LOOP, -10.0f);
Animation_Change(&this->skelAnime, &gEnHeishiIdleAnim, 1.0f, 0.0f, (s16)frames, ANIMMODE_LOOP, -10.0f);
this->actionFunc = func_80A563BC;
}
@ -168,9 +165,9 @@ void func_80A563BC(EnHeishi4* this, GlobalContext* globalCtx) {
}
void func_80A56544(EnHeishi4* this, GlobalContext* globalCtx) {
f32 frames = Animation_GetLastFrame(&D_06005C30);
f32 frames = Animation_GetLastFrame(&gEnHeishiIdleAnim);
Animation_Change(&this->skelAnime, &D_06005C30, 1.0f, 0.0f, (s16)frames, ANIMMODE_LOOP, -10.0f);
Animation_Change(&this->skelAnime, &gEnHeishiIdleAnim, 1.0f, 0.0f, (s16)frames, ANIMMODE_LOOP, -10.0f);
if (LINK_AGE_IN_YEARS != YEARS_CHILD) {
osSyncPrintf(VT_FGCOL(GREEN) " ☆☆☆☆☆ ぎゃぁ!オトナだー ☆☆☆☆☆ \n" VT_RST);
Actor_Kill(&this->actor);
@ -224,8 +221,9 @@ void func_80A5673C(EnHeishi4* this, GlobalContext* globalCtx) {
this->unk_284 = 0;
if (gSaveContext.eventChkInf[8] & 1) {
if (!(gSaveContext.infTable[6] & 0x1000)) {
f32 frames = Animation_GetLastFrame(&D_0600C444);
Animation_Change(&this->skelAnime, &D_0600C444, 1.0f, 0.0f, (s16)frames, ANIMMODE_LOOP, -10.0f);
f32 frames = Animation_GetLastFrame(&gEnHeishiDyingGuardAnim_00C444);
Animation_Change(&this->skelAnime, &gEnHeishiDyingGuardAnim_00C444, 1.0f, 0.0f, (s16)frames, ANIMMODE_LOOP,
-10.0f);
this->actor.textId = 0x7007;
this->unk_282 = 5;
this->unk_284 = 1;
@ -258,9 +256,9 @@ void func_80A56874(EnHeishi4* this, GlobalContext* globalCtx) {
}
void func_80A56900(EnHeishi4* this, GlobalContext* globalCtx) {
f32 frames = Animation_GetLastFrame(&D_0600C6C8);
f32 frames = Animation_GetLastFrame(&gEnHeishiDyingGuardTalkAnim);
Animation_Change(&this->skelAnime, &D_0600C6C8, 1.0f, 0.0f, (s16)frames, ANIMMODE_LOOP, -10.0f);
Animation_Change(&this->skelAnime, &gEnHeishiDyingGuardTalkAnim, 1.0f, 0.0f, (s16)frames, ANIMMODE_LOOP, -10.0f);
this->actionFunc = func_80A56994;
}
@ -278,9 +276,9 @@ void func_80A56994(EnHeishi4* this, GlobalContext* globalCtx) {
}
void func_80A56A50(EnHeishi4* this, GlobalContext* globalCtx) {
f32 frames = Animation_GetLastFrame(&D_0600C374);
f32 frames = Animation_GetLastFrame(&gEnHeishiDyingGuardDieAnim);
this->unk_288 = frames;
Animation_Change(&this->skelAnime, &D_0600C374, 1.0f, 0.0f, frames, ANIMMODE_ONCE, -10.0f);
Animation_Change(&this->skelAnime, &gEnHeishiDyingGuardDieAnim, 1.0f, 0.0f, frames, ANIMMODE_ONCE, -10.0f);
this->actionFunc = func_80A56ACC;
}

View file

@ -6,6 +6,7 @@
#include "z_en_ishi.h"
#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
#include "objects/gameplay_field_keep/gameplay_field_keep.h"
#include "vt.h"
@ -29,13 +30,6 @@ void EnIshi_SpawnFragmentsLarge(EnIshi* this, GlobalContext* globalCtx);
void EnIshi_SpawnDustSmall(EnIshi* this, GlobalContext* globalCtx);
void EnIshi_SpawnDustLarge(EnIshi* this, GlobalContext* globalCtx);
extern Gfx D_0500A3B8[]; // Large gray rock
extern Gfx D_0500A5E8[]; // Large gray rock fragments
extern Gfx D_0500A880[]; // Small gray rock
typedef void (*EnIshiEffectSpawnFunc)(struct EnIshi*, GlobalContext*);
typedef void (*EnIshiDrawFunc)(struct EnIshi*, GlobalContext*);
static s16 sRotSpeedX = 0;
static s16 sRotSpeedY = 0;
@ -171,7 +165,7 @@ void EnIshi_SpawnFragmentsSmall(EnIshi* this, GlobalContext* globalCtx) {
phi_v0 = 33;
}
EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &pos, -420, phi_v0, 30, 5, 0, scales[i], 3, 10, 40,
KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_FIELD_KEEP, D_0500A880);
KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_FIELD_KEEP, gFieldKakeraDL);
}
}
@ -217,7 +211,7 @@ void EnIshi_SpawnFragmentsLarge(EnIshi* this, GlobalContext* globalCtx) {
phi_v1 = -320;
}
EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &this->actor.world.pos, phi_v1, phi_v0, 30, 5, 0, scales[i], 5,
2, 70, KAKERA_COLOR_WHITE, OBJECT_GAMEPLAY_FIELD_KEEP, D_0500A5E8);
2, 70, KAKERA_COLOR_WHITE, OBJECT_GAMEPLAY_FIELD_KEEP, gSilverRockFragmentsDL);
}
}
@ -483,7 +477,7 @@ void EnIshi_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void EnIshi_DrawSmall(EnIshi* this, GlobalContext* globalCtx) {
Gfx_DrawDListOpa(globalCtx, D_0500A880);
Gfx_DrawDListOpa(globalCtx, gFieldKakeraDL);
}
void EnIshi_DrawLarge(EnIshi* this, GlobalContext* globalCtx) {
@ -493,7 +487,7 @@ void EnIshi_DrawLarge(EnIshi* this, GlobalContext* globalCtx) {
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_ishi.c", 1055),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255);
gSPDisplayList(POLY_OPA_DISP++, D_0500A3B8);
gSPDisplayList(POLY_OPA_DISP++, gSilverRockDL);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_ishi.c", 1062);
}

View file

@ -12,6 +12,8 @@ typedef enum {
struct EnIshi;
typedef void (*EnIshiActionFunc)(struct EnIshi*, GlobalContext*);
typedef void (*EnIshiEffectSpawnFunc)(struct EnIshi*, GlobalContext*);
typedef void (*EnIshiDrawFunc)(struct EnIshi*, GlobalContext*);
typedef struct EnIshi {
/* 0x0000 */ Actor actor;

View file

@ -7,6 +7,7 @@
#include "z_en_kusa.h"
#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
#include "objects/gameplay_keep/gameplay_keep.h"
#include "objects/gameplay_field_keep/gameplay_field_keep.h"
#include "vt.h"
#define FLAGS 0x00800010
@ -490,7 +491,7 @@ void EnKusa_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void EnKusa_Draw(Actor* thisx, GlobalContext* globalCtx) {
static Gfx* dLists[] = { 0x0500B9D0, 0x06000140, 0x06000140 };
static Gfx* dLists[] = { gFieldBushDL, 0x06000140, 0x06000140 };
EnKusa* this = THIS;
if (this->actor.flags & 0x800) {

View file

@ -6,6 +6,7 @@
#include "z_en_light.h"
#include "objects/gameplay_keep/gameplay_keep.h"
#include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h"
#define FLAGS 0x00000000
@ -46,8 +47,6 @@ static FlameParams D_80A9E840[] = {
{ { 170, 255, 255, 255 }, { 0, 0, 255 }, 75 }, { { 170, 255, 255, 255 }, { 0, 150, 255 }, 75 },
};
extern Gfx D_05000440[];
void EnLight_Init(Actor* thisx, GlobalContext* globalCtx) {
EnLight* this = THIS;
s16 yOffset;
@ -180,7 +179,7 @@ void EnLight_Draw(Actor* thisx, GlobalContext* globalCtx) {
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 0, 16, 32, 1, ((this->timer * 2) & 63),
(this->timer * -6) & 127 * 1, 16, 32));
dList = D_05000440;
dList = gUnusedCandleDL;
gDPSetPrimColor(POLY_XLU_DISP++, 0xC0, 0xC0, 255, 200, 0, 0);
gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 0);
}

View file

@ -5,6 +5,7 @@
*/
#include "z_en_mb.h"
#include "objects/object_mb/object_mb.h"
#define FLAGS 0x00000015
@ -27,26 +28,6 @@ const ActorInit En_Mb_InitVars = {
(ActorFunc)EnMb_Draw,
};
extern FlexSkeletonHeader D_06008F38;
extern FlexSkeletonHeader D_06014190;
extern AnimationHeader D_060028E0;
extern AnimationHeader D_0600EBE4;
extern AnimationHeader D_060041A8;
extern AnimationHeader D_06009FC0;
extern AnimationHeader D_06002C10;
extern AnimationHeader D_06002F10;
extern AnimationHeader D_06009280;
extern AnimationHeader D_06001950;
extern AnimationHeader D_0600BE58;
extern AnimationHeader D_0600D5D4;
extern AnimationHeader D_0600E18C;
extern AnimationHeader D_0600B4BC;
extern AnimationHeader D_0600ABE0;
extern AnimationHeader D_0600095C;
extern AnimationHeader D_060016B4;
extern AnimationHeader D_060041A8;
extern AnimationHeader D_0600C44C;
void func_80AA68FC(EnMb* this, GlobalContext* globalCtx);
void func_80AA6898(EnMb* this);
void func_80AA7134(EnMb* this, GlobalContext* globalCtx);
@ -248,7 +229,7 @@ void EnMb_Init(Actor* thisx, GlobalContext* globalCtx) {
switch (this->actor.params) {
case -1:
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06008F38, &D_060028E0, this->jointTable,
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gEnMbSkel_008F38, &gEnMbStandStillAnim, this->jointTable,
this->morphTable, 28);
this->actor.colChkInfo.health = 2;
this->actor.colChkInfo.mass = MASS_HEAVY;
@ -257,7 +238,7 @@ void EnMb_Init(Actor* thisx, GlobalContext* globalCtx) {
func_80AA6830(this);
break;
case 0:
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06014190, &D_0600EBE4, this->jointTable,
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gEnMbSkel_014190, &gEnMbAnim_00EBE4, this->jointTable,
this->morphTable, 28);
this->actor.colChkInfo.health = 6;
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
@ -283,7 +264,7 @@ void EnMb_Init(Actor* thisx, GlobalContext* globalCtx) {
func_80AA6898(this);
break;
default:
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06008F38, &D_060028E0, this->jointTable,
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gEnMbSkel_008F38, &gEnMbStandStillAnim, this->jointTable,
this->morphTable, 28);
Actor_SetScale(&this->actor, 0.014f);
this->path = (thisx->params & 0xFF00) >> 8;
@ -406,7 +387,7 @@ void func_80AA66A0(EnMb* this, GlobalContext* globalCtx) {
}
void func_80AA6830(EnMb* this) {
Animation_MorphToLoop(&this->skelAnime, &D_060041A8, -4.0f);
Animation_MorphToLoop(&this->skelAnime, &gEnMbLookLeftAndRightAnim, -4.0f);
this->actor.speedXZ = 0.0f;
this->unk_32A = Rand_S16Offset(30, 50);
this->unk_320 = 6;
@ -414,7 +395,7 @@ void func_80AA6830(EnMb* this) {
}
void func_80AA6898(EnMb* this) {
Animation_PlayLoop(&this->skelAnime, &D_0600EBE4);
Animation_PlayLoop(&this->skelAnime, &gEnMbAnim_00EBE4);
this->actor.speedXZ = 0.0f;
this->unk_32A = Rand_S16Offset(30, 50);
this->unk_320 = 6;
@ -422,7 +403,7 @@ void func_80AA6898(EnMb* this) {
}
void func_80AA68FC(EnMb* this, GlobalContext* globalCtx) {
Animation_MorphToLoop(&this->skelAnime, &D_060041A8, -4.0f);
Animation_MorphToLoop(&this->skelAnime, &gEnMbLookLeftAndRightAnim, -4.0f);
this->actor.speedXZ = 0.0f;
this->unk_32A = Rand_S16Offset(40, 80);
this->unk_320 = 6;
@ -431,8 +412,8 @@ void func_80AA68FC(EnMb* this, GlobalContext* globalCtx) {
}
void func_80AA6974(EnMb* this) {
Animation_Change(&this->skelAnime, &D_06009FC0, 0.0f, 0.0f, Animation_GetLastFrame(&D_06009FC0), ANIMMODE_LOOP,
-4.0f);
Animation_Change(&this->skelAnime, &gEnMbWalkAnim, 0.0f, 0.0f, Animation_GetLastFrame(&gEnMbWalkAnim),
ANIMMODE_LOOP, -4.0f);
this->actor.speedXZ = 0.59999996f;
this->unk_32A = Rand_S16Offset(50, 70);
this->unk_332 = 1;
@ -443,20 +424,20 @@ void func_80AA6974(EnMb* this) {
void func_80AA6A18(EnMb* this) {
f32 frameCount;
frameCount = Animation_GetLastFrame(&D_06009FC0);
frameCount = Animation_GetLastFrame(&gEnMbWalkAnim);
this->actor.speedXZ = 0.59999996f;
this->unk_32A = Rand_S16Offset(50, 70);
this->unk_332 = 1;
this->unk_320 = 9;
Animation_Change(&this->skelAnime, &D_06009FC0, 0.0f, 0.0f, frameCount, ANIMMODE_LOOP_INTERP, -4.0f);
Animation_Change(&this->skelAnime, &gEnMbWalkAnim, 0.0f, 0.0f, frameCount, ANIMMODE_LOOP_INTERP, -4.0f);
EnMb_SetupAction(this, func_80AA8AEC);
}
void func_80AA6AC8(EnMb* this) {
f32 frameCount;
frameCount = Animation_GetLastFrame(&D_06002C10);
Animation_MorphToPlayOnce(&this->skelAnime, &D_06002C10, -4.0f);
frameCount = Animation_GetLastFrame(&gEnMbReadyAttackAnim);
Animation_MorphToPlayOnce(&this->skelAnime, &gEnMbReadyAttackAnim, -4.0f);
this->unk_320 = 10;
this->actor.speedXZ = 0.0f;
this->unk_32E = (s16)frameCount + 6;
@ -469,7 +450,7 @@ void func_80AA6AC8(EnMb* this) {
}
void func_80AA6B80(EnMb* this) {
Animation_PlayLoop(&this->skelAnime, &D_06002F10);
Animation_PlayLoop(&this->skelAnime, &gEnMbChargePlayerAnim);
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_ATTACK);
this->attackParams = 1;
this->unk_320 = 10;
@ -483,9 +464,9 @@ void func_80AA6BF0(EnMb* this) {
s16 yawDiff;
s32 yawDiffABS;
frames = Animation_GetLastFrame(&D_0600B4BC);
frames = Animation_GetLastFrame(&gEnMbAnim_00B4BC);
this->unk_320 = 10;
Animation_Change(&this->skelAnime, &D_0600B4BC, 3.0f, 0.0f, frames, ANIMMODE_ONCE_INTERP, 0.0f);
Animation_Change(&this->skelAnime, &gEnMbAnim_00B4BC, 3.0f, 0.0f, frames, ANIMMODE_ONCE_INTERP, 0.0f);
this->unk_32E = 1;
yawDiff = (this->actor.world.rot.y - this->actor.yawTowardsPlayer);
@ -507,7 +488,7 @@ void func_80AA6BF0(EnMb* this) {
}
void func_80AA6CC0(EnMb* this) {
Animation_PlayOnce(&this->skelAnime, &D_06009280);
Animation_PlayOnce(&this->skelAnime, &gEnMbResumePatrolAnim);
this->unk_320 = 11;
this->unk_32A = 0;
this->unk_32E = 5;
@ -516,7 +497,7 @@ void func_80AA6CC0(EnMb* this) {
}
void func_80AA6D20(EnMb* this) {
Animation_PlayOnce(&this->skelAnime, &D_06009280);
Animation_PlayOnce(&this->skelAnime, &gEnMbResumePatrolAnim);
this->unk_320 = 0xB;
this->actor.bgCheckFlags &= ~1;
this->unk_32A = 0;
@ -530,14 +511,14 @@ void func_80AA6D20(EnMb* this) {
void func_80AA6DA4(EnMb* this) {
f32 frameCount;
frameCount = Animation_GetLastFrame(&D_0600EBE4);
frameCount = Animation_GetLastFrame(&gEnMbAnim_00EBE4);
this->unk_320 = 11;
Animation_Change(&this->skelAnime, &D_0600EBE4, 5.0f, 0.0f, frameCount, ANIMMODE_ONCE_INTERP, 0.0f);
Animation_Change(&this->skelAnime, &gEnMbAnim_00EBE4, 5.0f, 0.0f, frameCount, ANIMMODE_ONCE_INTERP, 0.0f);
EnMb_SetupAction(this, func_80AA7478);
}
void func_80AA6E1C(EnMb* this) {
Animation_PlayOnce(&this->skelAnime, &D_0600C44C);
Animation_PlayOnce(&this->skelAnime, &gEnMbAnim_00C44C);
this->unk_320 = 3;
this->unk_32A = 0;
this->unk_32E = 20;
@ -548,16 +529,16 @@ void func_80AA6E1C(EnMb* this) {
void func_80AA6E7C(EnMb* this) {
f32 frames;
frames = Animation_GetLastFrame(&D_0600D5D4);
frames = Animation_GetLastFrame(&gEnMbAnim_00D5D4);
this->unk_320 = 2;
this->unk_32A = 0;
this->unk_32E = 6;
Animation_Change(&this->skelAnime, &D_0600D5D4, 1.0f, 4.0f, frames, ANIMMODE_ONCE_INTERP, 0.0f);
Animation_Change(&this->skelAnime, &gEnMbAnim_00D5D4, 1.0f, 4.0f, frames, ANIMMODE_ONCE_INTERP, 0.0f);
EnMb_SetupAction(this, func_80AA840C);
}
void func_80AA6F04(EnMb* this) {
Animation_MorphToPlayOnce(&this->skelAnime, &D_0600BE58, -4.0f);
Animation_MorphToPlayOnce(&this->skelAnime, &gEnMbAnim_00BE58, -4.0f);
this->unk_320 = 1;
this->actor.flags &= ~1;
this->collider1.dim.height = 80;
@ -576,7 +557,7 @@ void func_80AA6F8C(EnMb* this) {
this->unk_328 = 40;
} else {
if (this->actor.params != 0) {
Animation_PlayOnceSetSpeed(&this->skelAnime, &D_06001950, 0.0f);
Animation_PlayOnceSetSpeed(&this->skelAnime, &gEnMbAnim_001950, 0.0f);
}
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE);
}
@ -668,8 +649,8 @@ void func_80AA7310(EnMb* this, GlobalContext* globalCtx) {
if (this->unk_32A == 0) {
this->unk_32E--;
if (this->unk_32E == 0) {
Animation_Change(&this->skelAnime, &D_06002C10, -1.0f, Animation_GetLastFrame(&D_06002C10), 0.0f,
ANIMMODE_ONCE, 0.0f);
Animation_Change(&this->skelAnime, &gEnMbReadyAttackAnim, -1.0f,
Animation_GetLastFrame(&gEnMbReadyAttackAnim), 0.0f, ANIMMODE_ONCE, 0.0f);
this->unk_32A = 1;
this->actor.speedXZ = 0.0f;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_SPEAR_NORM);
@ -717,8 +698,9 @@ void func_80AA74BC(EnMb* this, GlobalContext* globalCtx) {
(ABS(yawDiff) <= 0x4000) && (this->actor.xzDistToPlayer <= 200.0f)) {
func_80AA6AC8(this);
} else {
endFrame = Animation_GetLastFrame(&D_06002C10);
Animation_Change(&this->skelAnime, &D_06002C10, -1.0f, endFrame, 0.0f, ANIMMODE_ONCE, 0.0f);
endFrame = Animation_GetLastFrame(&gEnMbReadyAttackAnim);
Animation_Change(&this->skelAnime, &gEnMbReadyAttackAnim, -1.0f, endFrame, 0.0f, ANIMMODE_ONCE,
0.0f);
this->actor.speedXZ = 0.0f;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_SPEAR_NORM);
}
@ -731,8 +713,9 @@ void func_80AA74BC(EnMb* this, GlobalContext* globalCtx) {
}
if (SkelAnime_Update(&this->skelAnime) != 0) {
if (this->unk_32A == 0) {
endFrame = Animation_GetLastFrame(&D_06002F10);
Animation_Change(&this->skelAnime, &D_06002F10, 0.5f, 0.0f, endFrame, ANIMMODE_LOOP_INTERP, 0.0f);
endFrame = Animation_GetLastFrame(&gEnMbChargePlayerAnim);
Animation_Change(&this->skelAnime, &gEnMbChargePlayerAnim, 0.5f, 0.0f, endFrame, ANIMMODE_LOOP_INTERP,
0.0f);
this->unk_32A = 1;
} else {
yawDiff = Math_Vec3f_Yaw(&this->actor.world.pos, &this->waypointPos) - this->actor.yawTowardsPlayer;
@ -760,7 +743,7 @@ void func_80AA77D0(EnMb* this, GlobalContext* globalCtx) {
currentFrame = this->skelAnime.curFrame;
if (SkelAnime_Update(&this->skelAnime)) {
Animation_PlayLoop(&this->skelAnime, &D_06002F10);
Animation_PlayLoop(&this->skelAnime, &gEnMbChargePlayerAnim);
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_ATTACK);
}
@ -818,8 +801,8 @@ void func_80AA7938(EnMb* this, GlobalContext* globalCtx) {
if (this->unk_32E != 0) {
this->unk_32E--;
if (this->unk_32E == 0) {
f32 pad1 = Animation_GetLastFrame(&D_0600ABE0);
Animation_Change(&this->skelAnime, &D_0600ABE0, 1.5f, 0.0f, pad1, ANIMMODE_ONCE_INTERP, 0.0f);
f32 pad1 = Animation_GetLastFrame(&gEnMbAnim_00ABE0);
Animation_Change(&this->skelAnime, &gEnMbAnim_00ABE0, 1.5f, 0.0f, pad1, ANIMMODE_ONCE_INTERP, 0.0f);
}
} else {
sp74 = this->effSpawnPos;
@ -853,7 +836,7 @@ void func_80AA7CAC(EnMb* this, GlobalContext* globalCtx) {
sp48 = !func_800339B8(&this->actor, globalCtx, 110.0f, this->actor.world.rot.y);
currentFrame = (s32)this->skelAnime.curFrame;
if (SkelAnime_Update(&this->skelAnime) != 0) {
Animation_PlayLoop(&this->skelAnime, &D_06002F10);
Animation_PlayLoop(&this->skelAnime, &gEnMbChargePlayerAnim);
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_ATTACK);
}
if (this->unk_32E != 0) {
@ -998,7 +981,7 @@ void func_80AA800C(EnMb* this, GlobalContext* globalCtx) {
void func_80AA8378(EnMb* this, GlobalContext* globalCtx) {
if (SkelAnime_Update(&this->skelAnime)) {
if (this->unk_32E != 0) {
Animation_PlayOnce(&this->skelAnime, &D_0600E18C);
Animation_PlayOnce(&this->skelAnime, &gEnMbAnim_00E18C);
this->unk_32E = 0;
func_800AA000(this->actor.xzDistToPlayer, 0xFF, 0x14, 0x96);
Camera_AddQuake(&globalCtx->mainCamera, 2, 25, 5);
@ -1016,13 +999,13 @@ void func_80AA840C(EnMb* this, GlobalContext* globalCtx) {
this->unk_32E--;
if (this->unk_32E == 0) {
if (this->unk_32A == 0) {
Animation_Change(&this->skelAnime, &D_0600E18C, 3.0f, 0.0f, Animation_GetLastFrame(&D_0600E18C),
ANIMMODE_ONCE_INTERP, 0.0f);
Animation_Change(&this->skelAnime, &gEnMbAnim_00E18C, 3.0f, 0.0f,
Animation_GetLastFrame(&gEnMbAnim_00E18C), ANIMMODE_ONCE_INTERP, 0.0f);
this->unk_32A = 1;
this->unk_32E = 6;
} else {
Animation_Change(&this->skelAnime, &D_0600E18C, 3.0f, 0.0f, Animation_GetLastFrame(&D_0600E18C),
ANIMMODE_ONCE_INTERP, 0.0f);
Animation_Change(&this->skelAnime, &gEnMbAnim_00E18C, 3.0f, 0.0f,
Animation_GetLastFrame(&gEnMbAnim_00E18C), ANIMMODE_ONCE_INTERP, 0.0f);
}
}
} else {
@ -1205,10 +1188,10 @@ void func_80AA8E88(EnMb* this) {
yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y;
yawDiffABS = ABS(yawDiff);
if (yawDiffABS <= 0x4000) {
Animation_MorphToPlayOnce(&this->skelAnime, &D_06001950, -4.0f);
Animation_MorphToPlayOnce(&this->skelAnime, &gEnMbAnim_001950, -4.0f);
this->actor.speedXZ = -8.0f;
} else {
Animation_MorphToPlayOnce(&this->skelAnime, &D_0600095C, -4.0f);
Animation_MorphToPlayOnce(&this->skelAnime, &gEnMbAnim_00095C, -4.0f);
this->actor.speedXZ = 8.0f;
}
this->unk_32A = 30;
@ -1236,10 +1219,10 @@ void func_80AA8FC8(EnMb* this) {
yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y;
yawDiffAbs = ABS(yawDiff);
if (yawDiffAbs <= 0x4000) {
Animation_MorphToPlayOnce(&this->skelAnime, &D_060016B4, -4.0f);
Animation_MorphToPlayOnce(&this->skelAnime, &gEnMbFallBackAnim, -4.0f);
this->actor.speedXZ = -8.0f;
} else {
Animation_MorphToPlayOnce(&this->skelAnime, &D_060016B4, -4.0f);
Animation_MorphToPlayOnce(&this->skelAnime, &gEnMbFallBackAnim, -4.0f);
this->actor.speedXZ = 8.0f;
}
this->actor.world.rot.y = this->actor.shape.rot.y;

View file

@ -16,7 +16,7 @@ typedef struct EnMb {
/* 0x01D0 */ Vec3s jointTable[28];
/* 0x0278 */ Vec3s morphTable[28];
/* 0x0320 */ s32 unk_320;
/* 0x0324 */ EnMbActionFunc actionFunc;
/* 0x0324 */ EnMbActionFunc actionFunc;
/* 0x0328 */ s16 unk_328;
/* 0x032A */ s16 unk_32A;
/* 0x032C */ s16 soundTimer;
@ -24,7 +24,7 @@ typedef struct EnMb {
/* 0x0330 */ s16 unk_330;
/* 0x0332 */ s16 unk_332;
/* 0x0334 */ s16 attackParams;
/* 0x0338 */ Vec3f effSpawnPos;
/* 0x0338 */ Vec3f effSpawnPos;
/* 0x0344 */ Vec3f waypointPos;
/* 0x0350 */ char unk_34A[0xC];
/* 0x035C */ s8 waypoint;

View file

@ -5,6 +5,7 @@
*/
#include "z_en_niw_girl.h"
#include "objects/object_gr/object_gr.h"
#include "vt.h"
#define FLAGS 0x00000019
@ -52,14 +53,6 @@ static ColliderCylinderInit sCylinderInit = {
{ 10, 30, 0, { 0, 0, 0 } },
};
static Vec3f sConstVec3f = { 0.2f, 0.2f, 0.2f };
static Gfx* D_80AB99D8[] = { 0x06004178, 0x06004978, 0x06005178 };
extern FlexSkeletonHeader D_06009948;
extern AnimationHeader D_06000378;
extern AnimationHeader D_06009C78;
void EnNiwGirl_Init(Actor* thisx, GlobalContext* globalCtx) {
EnNiwGirl* this = THIS;
s32 pad;
@ -67,7 +60,8 @@ void EnNiwGirl_Init(Actor* thisx, GlobalContext* globalCtx) {
Vec3f vec2;
s32 pad2;
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06009948, &D_06000378, this->jointTable, this->morphTable, 17);
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gNiwGirlSkel, &gNiwGirlRunAnim, this->jointTable, this->morphTable,
17);
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
this->actor.targetMode = 6;
@ -103,8 +97,8 @@ void EnNiwGirl_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
void EnNiwGirl_Jump(EnNiwGirl* this, GlobalContext* globalCtx) {
f32 frameCount = Animation_GetLastFrame(&D_06000378);
Animation_Change(&this->skelAnime, &D_06000378, 1.0f, 0.0f, frameCount, ANIMMODE_LOOP, -10.0f);
f32 frameCount = Animation_GetLastFrame(&gNiwGirlRunAnim);
Animation_Change(&this->skelAnime, &gNiwGirlRunAnim, 1.0f, 0.0f, frameCount, 0, -10.0f);
this->actor.flags &= ~1;
this->actionFunc = func_80AB9210;
}
@ -144,7 +138,7 @@ void func_80AB9210(EnNiwGirl* this, GlobalContext* globalCtx) {
}
void EnNiwGirl_Talk(EnNiwGirl* this, GlobalContext* globalCtx) {
Animation_Change(&this->skelAnime, &D_06009C78, 1.0f, 0.0f, Animation_GetLastFrame(&D_06009C78), ANIMMODE_LOOP,
Animation_Change(&this->skelAnime, &gNiwGirlJumpAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gNiwGirlJumpAnim), 0,
-10.0f);
this->actor.flags |= 1;
this->actor.textId = 0x7000;
@ -201,11 +195,11 @@ void EnNiwGirl_Update(Actor* thisx, GlobalContext* globalCtx) {
Actor_SetScale(&this->actor, 0.013f);
this->unkUpTimer++;
tempActionFunc = func_80AB94D0;
if (this->unk_274 == 0) {
this->unk_272++;
if (this->unk_272 >= 3) {
this->unk_272 = 0;
this->unk_274 = (s16)Rand_ZeroFloat(60.0f) + 20;
if (this->blinkTimer == 0) {
this->eyeIndex++;
if (this->eyeIndex >= 3) {
this->eyeIndex = 0;
this->blinkTimer = (s16)Rand_ZeroFloat(60.0f) + 20;
}
}
this->unk_280 = 30.0f;
@ -223,8 +217,8 @@ void EnNiwGirl_Update(Actor* thisx, GlobalContext* globalCtx) {
Math_SmoothStepToS(&this->unk_260.y, 0, 5, 3000, 0);
Math_SmoothStepToS(&this->unk_260.z, 0, 5, 3000, 0);
}
if (this->unk_274 != 0) {
this->unk_274--;
if (this->blinkTimer != 0) {
this->blinkTimer--;
}
if (this->jumpTimer != 0) {
this->jumpTimer--;
@ -250,7 +244,10 @@ s32 EnNiwGirlOverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLi
return false;
}
static Vec3f sConstVec3f = { 0.2f, 0.2f, 0.2f };
void EnNiwGirl_Draw(Actor* thisx, GlobalContext* globalCtx) {
static u64* eyeTextures[] = { gNiwGirlEyeOpenTex, gNiwGirlEyeHalfTex, gNiwGirlEyeClosedTex };
EnNiwGirl* this = THIS;
s32 pad;
Vec3f sp4C = sConstVec3f;
@ -258,7 +255,7 @@ void EnNiwGirl_Draw(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_niw_girl.c", 573);
func_80093D18(globalCtx->state.gfxCtx);
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_80AB99D8[this->unk_272]));
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(eyeTextures[this->eyeIndex]));
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
EnNiwGirlOverrideLimbDraw, NULL, this);
func_80033C30(&this->actor.world.pos, &sp4C, 255, globalCtx);

View file

@ -20,8 +20,8 @@ typedef struct EnNiwGirl {
/* 0x026C */ s16 jumpTimer; // Controls how many frames she jumps for and how long until she jumps again
/* 0x026E */ s16 unkUpTimer;
/* 0x0270 */ s16 unk_270;
/* 0x0272 */ s16 unk_272;
/* 0x0274 */ s16 unk_274;
/* 0x0272 */ s16 eyeIndex;
/* 0x0274 */ s16 blinkTimer;
/* 0x0276 */ s16 path;
/* 0x0278 */ s16 unk_278;
/* 0x027A */ s16 unk_27A;

View file

@ -534,18 +534,18 @@ void EnNy_Draw(Actor* thisx, GlobalContext* globalCtx) {
gDPPipeSync(POLY_XLU_DISP++);
gDPSetRenderMode(POLY_XLU_DISP++, G_RM_PASS, G_RM_AA_ZB_XLU_SURF2);
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, this->unk_1D8);
gSPDisplayList(POLY_XLU_DISP++, gEnNyMetalBodyDlist);
gSPDisplayList(POLY_XLU_DISP++, gEnNyMetalBodyDL);
gDPPipeSync(POLY_XLU_DISP++);
gDPSetRenderMode(POLY_XLU_DISP++, G_RM_FOG_SHADE_A, G_RM_AA_ZB_XLU_SURF2);
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, this->unk_1D4);
gSPDisplayList(POLY_XLU_DISP++, gEnNyRockBodyDlist);
gSPDisplayList(POLY_XLU_DISP++, gEnNyRockBodyDL);
if (this->unk_1E0 > 0.25f) {
Matrix_Scale(this->unk_1E0, this->unk_1E0, this->unk_1E0, MTXMODE_APPLY);
func_8002EBCC(&this->actor, globalCtx, 1);
func_80093D18(globalCtx->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_ny.c", 868),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, gEnNySpikeDlist);
gSPDisplayList(POLY_OPA_DISP++, gEnNySpikeDL);
}
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_ny.c", 872);
if (this->unk_1CA != 0) {
@ -583,7 +583,7 @@ void EnNy_DrawDeathEffect(Actor* thisx, GlobalContext* globalCtx) {
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_ny.c", 912),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, gEnNyRockBodyDlist);
gSPDisplayList(POLY_OPA_DISP++, gEnNyRockBodyDL);
}
}
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_ny.c", 919);

View file

@ -6,6 +6,7 @@
#include "z_obj_comb.h"
#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
#include "objects/gameplay_field_keep/gameplay_field_keep.h"
#define FLAGS 0x00000000
@ -67,14 +68,11 @@ static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneDownward, 900, ICHAIN_STOP),
};
extern Gfx D_050095B0[];
extern Gfx D_05009940[];
void ObjComb_Break(ObjComb* this, GlobalContext* globalCtx) {
Vec3f pos1;
Vec3f pos;
Vec3f velocity;
Gfx* dlist = D_05009940;
Gfx* dlist = gFieldBeehiveFragmentDL;
s16 scale;
s16 angle = 0;
s16 gravity;
@ -85,7 +83,7 @@ void ObjComb_Break(ObjComb* this, GlobalContext* globalCtx) {
s32 i;
for (i = 0; i < 31; i++) {
angle += 20000;
angle += 0x4E20;
rand1 = Rand_ZeroOne() * 10.0f;
pos1.x = Math_SinS(angle) * rand1;
@ -200,7 +198,7 @@ void ObjComb_Wait(ObjComb* this, GlobalContext* globalCtx) {
void ObjComb_Update(Actor* thisx, GlobalContext* globalCtx) {
ObjComb* this = THIS;
this->unk_1B2 += 12000;
this->unk_1B2 += 0x2EE0;
this->actionFunc(this, globalCtx);
this->actor.shape.rot.x = Math_SinS(this->unk_1B2) * this->unk_1B0 + this->actor.home.rot.x;
}
@ -223,7 +221,7 @@ void ObjComb_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_obj_comb.c", 394),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, D_050095B0);
gSPDisplayList(POLY_OPA_DISP++, gFieldBeehiveDL);
Collider_UpdateSpheres(0, &this->collider);

View file

@ -5,6 +5,7 @@
*/
#include "z_obj_hamishi.h"
#include "objects/gameplay_field_keep/gameplay_field_keep.h"
#define FLAGS 0x00000000
@ -15,9 +16,6 @@ void ObjHamishi_Destroy(Actor* thisx, GlobalContext* globalCtx);
void ObjHamishi_Update(Actor* thisx, GlobalContext* globalCtx);
void ObjHamishi_Draw(Actor* thisx, GlobalContext* globalCtx);
extern Gfx D_0500A3B8[];
extern Gfx D_0500A5E8[];
const ActorInit Obj_Hamishi_InitVars = {
ACTOR_OBJ_HAMISHI,
ACTORCAT_PROP,
@ -131,7 +129,7 @@ void ObjHamishi_Break(ObjHamishi* this, GlobalContext* globalCtx) {
}
EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &this->actor.world.pos, gravity, phi_v0, 30, 5, 0,
sEffectScales[i], 3, 0, 70, 1, OBJECT_GAMEPLAY_FIELD_KEEP, D_0500A5E8);
sEffectScales[i], 3, 0, 70, 1, OBJECT_GAMEPLAY_FIELD_KEEP, gSilverRockFragmentsDL);
}
func_80033480(globalCtx, &this->actor.world.pos, 140.0f, 6, 180, 90, 1);
@ -205,7 +203,7 @@ void ObjHamishi_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_obj_hamishi.c", 404),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 170, 130, 255);
gSPDisplayList(POLY_OPA_DISP++, D_0500A3B8);
gSPDisplayList(POLY_OPA_DISP++, gSilverRockDL);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_obj_hamishi.c", 411);
}

View file

@ -5,6 +5,7 @@
*/
#include "z_obj_hana.h"
#include "objects/gameplay_field_keep/gameplay_field_keep.h"
#define FLAGS 0x00000000
@ -58,9 +59,9 @@ typedef struct {
} HanaParams; // size = 0x10
static HanaParams sHanaParams[] = {
{ 0x05000500, 0.01f, 0.0f, -1, 0 },
{ 0x0500A880, 0.1f, 58.0f, 10, 18 },
{ 0x0500B9D0, 0.4f, 0.0f, 12, 44 },
{ gHanaDL, 0.01f, 0.0f, -1, 0 },
{ gFieldKakeraDL, 0.1f, 58.0f, 10, 18 },
{ gFieldBushDL, 0.4f, 0.0f, 12, 44 },
};
static InitChainEntry sInitChain[] = {

File diff suppressed because it is too large Load diff