mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-07 14:50:15 +00:00
z_collision_check.c (#73)
* func_8005B280 ok * func_8005B65C OK * split out func_8005BD50 * func_8005B7C0 OK * func_8005B7F4 OK * func_8005B824 OK * func_8005B860 ok * improve sanity * func_8005B6B0 ok, ColliderInit_Actor structs added * func_8005B884 ok * func_8005BBF8 ok, split out func_8005BF50 * split more stuff out of func_8005C050.s * func_8005C050 OK * func_8005BA30 fakish OK, func_8005BAD8 real OK * func_8005BB48 OK, func_8005BA84 almost decomp'd, but type issues * func_8005BB10 Ok * func_8005BF50 OK * func_8005BE50 OK * func_8005BD50 OK * func_8005BCC8 Ok * func_8005BC28 * func_8005BB8C func_8005BBB0 func_8005BBD4 Ok * save my work commit * func_8005C2BC fake OK * func_8005C5B0 ok * func_8005C608 ok * func_8005C6C0 ok * func_8005C6F8 ok * func_8005C730 ok * func_8005C774 func_8005C798 func_8005C7BC OK * func_8005C7E0 ok, func_8005C810 split * func_8005C810 OK * func_8005C8C8 ok * func_8005C964 OK * func_8005CA88 ok * func_8005CBAC ok * func_8005C124 func_8005C1AC func_8005C234 func_8005CC98 OK * func_8005CD34 func_8005CDD0 Ok * func_8005CE6C ok * func_8005CEC4 ok * func_8005CEDC ok * func_8005CF90 Ok * standardize type names/vars more * func_8005D3BC ok * func_8005D40C OK, z64.h CollisionCheckContext * func_8005D4B4 func_8005D4C8 ok * partial data section migration * improve function documentation, OT->OC * Actor_CollisionCheck_SetOC ok * Actor_CollisionCheck_SetAT Actor_CollisionCheck_SetAC Ok * func_8005BA84 ok * func_800611A0 ok * func_80061274 ok * clean up func_80061274 * func_8006139C ok * func_8005E9C0 and dependencies OK * minor cleanup to func_8005E9C0 * func_8005EC6C OK! * func_8005E81C ok * func_8005E604 ok * func_8005E2EC func_8005E4F8 OK * func_8005DE9C OK func_8005D8AC disassembled * func_8006146C func_8006268C ok * func_8005EEE0 ok * func_8005F17C * func_8005F39C ok * func_8005F5B0 decompiled, not matching * func_8005F7D0 decomp, func_8005D218 and func_8005D324 OK * func_8005FA30 ok, split more functions * func_8005FC04 ok * func_8005FDCC k * func_8005FF90 OK OK OK * func_80060204 dead * func_800604B0 ok * func_80060704 func_80060994 ok, func_80060C2C somewhat disassembled. AT to AC matrix doneish * func_800635D0 ok, func_80062ECC not so much * OcLine oks * D_8011DF28 functions disassembled * D_8011DF5C functions OK * setAT_SAC. setAC_SAC, setOC_SAC OK * func_80061C98 decompiled, func_80061BF4, func_80061C18 OK * func_800617D4 ok, func_800614A4 disassembled * CollisionCheck_OC D_8011DFAC functions OK * func_80062530 ok * CollisionCheck_generalLineOcCheck subfunctions OK * func_800622E4 ok * after a long fought battle, func_80061F64 has fallen. * func_800628A4 disassembled * func_800627A0 func_8006285C OK * ActorCollider_Cylinder_Update, func_80062718, func_80062734 ok * func_80062CD4 decompiled, import EffShield/EffSpark types from MM * various SubActor98 struct functions OK * func_8005D4DC func_8005D62C ok * .data section migrated, more OKs, fix NON_MATCHINGs to use effect structs * func_80060C2C ok * minor code tweaks * func_80061C98 ok somehow * Attempt to fix some unknowns, move types out of z64actor, add set3 ColliderInit types * Apply changes * formatting * tweak a couple function names * krim changes, func naming * missed some things * function renames * Implement GenColliderInit.py utility * Implement pr changes, GenColliderInit.py, DamageTable.py, z_collision_btltbls.c fully matching * func_800614A4 ok * Implement Roman's fixes, name Collider unknowns, rename COLTYPE -> COLSHAPE and define new COLTYPE * collisionCheckCtx -> colChkCtx, fix small things
This commit is contained in:
parent
f9bdb1d58a
commit
aa91a7ee32
873 changed files with 6121 additions and 10660 deletions
|
@ -43,9 +43,9 @@ const ActorInit Bg_Bdan_Objects_InitVars = {
|
|||
};
|
||||
|
||||
static ColliderCylinderInit D_8086CD70 = {
|
||||
0x0A, 0x11, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0xFFCFFFFF, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00000000,
|
||||
0x09, 0x00, 0x00, 0x00, 0x00BB, 0x0050, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
{ COLTYPE_UNK10, 0x11, 0x00, 0x00, 0x20, COLSHAPE_CYLINDER },
|
||||
{ 0x00, { 0xFFCFFFFF, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x09, 0x00, 0x00 },
|
||||
{ 0x00BB, 0x0050, 0x0000, { 0 } },
|
||||
};
|
||||
|
||||
static InitChainEntry initChain[] = {
|
||||
|
@ -111,8 +111,8 @@ void BgBdanObjects_Init(BgBdanObjects* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
if (thisx->params == 0) {
|
||||
DynaPolyInfo_Alloc(&D_06008CE0, &localC);
|
||||
ActorCollider_AllocCylinder(globalCtx, &this->collider);
|
||||
ActorCollider_InitCylinder(globalCtx, &this->collider, this, &D_8086CD70);
|
||||
Collider_InitCylinder(globalCtx, &this->collider);
|
||||
Collider_SetCylinder(globalCtx, &this->collider, this, &D_8086CD70);
|
||||
thisx->posRot.pos.y = (f32)(thisx->posRot.pos.y + -79.0f);
|
||||
if (Flags_GetClear(globalCtx, thisx->room)) {
|
||||
Flags_SetSwitch(globalCtx, this->unk_168);
|
||||
|
@ -157,7 +157,7 @@ void BgBdanObjects_Destroy(BgBdanObjects* this, GlobalContext* globalCtx) {
|
|||
|
||||
DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId);
|
||||
if (thisx->params == 0) {
|
||||
ActorCollider_FreeCylinder(globalCtx, &this->collider);
|
||||
Collider_DestroyCylinder(globalCtx, &this->collider);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -296,8 +296,8 @@ void func_8086C5BC(BgBdanObjects* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void func_8086C618(BgBdanObjects* this, GlobalContext* globalCtx) {
|
||||
ActorCollider_Cylinder_Update(&this->dyna.actor, &this->collider);
|
||||
Actor_CollisionCheck_SetAT(globalCtx, &globalCtx->sub_11E60, &this->collider);
|
||||
Collider_CylinderUpdate(&this->dyna.actor, &this->collider);
|
||||
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider);
|
||||
if (Flags_GetClear(globalCtx, this->dyna.actor.room)) {
|
||||
Flags_SetSwitch(globalCtx, this->unk_168);
|
||||
this->dyna.actor.initPosRot.rot.y = (s16)(this->dyna.actor.shape.rot.y + 0x2000) & 0xC000;
|
||||
|
|
|
@ -9,7 +9,7 @@ typedef struct {
|
|||
/* 0x0164 */ ActorFunc actionFunc;
|
||||
/* 0x0168 */ u8 unk_168;
|
||||
/* 0x016A */ s16 unk_16A;
|
||||
/* 0x016C */ ColliderCylinderMain collider;
|
||||
/* 0x016C */ ColliderCylinder collider;
|
||||
/* 0x01B8 */ s32 unk_1B8;
|
||||
} BgBdanObjects; // size = 0x01BC
|
||||
|
||||
|
|
|
@ -57,10 +57,18 @@ extern UNK_PTR D_06005CF8;
|
|||
extern UNK_PTR D_060061A0;
|
||||
extern UNK_PTR D_06005A20;
|
||||
|
||||
static u32 D_8086E0A0[] = { 0x00000000, 0x00000000, 0x00000000, 0xEFC1FFFE, 0x00000000,
|
||||
0x00010100, 0x00000000, 0x00780000, 0x01720064 };
|
||||
static ColliderJntSphItemInit colliderItemsInit[] = {
|
||||
{
|
||||
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0xEFC1FFFE, 0x00, 0x00 }, 0x00, 0x01, 0x01 },
|
||||
{ 0x00, { { 0x0000, 0x0078, 0x0000 }, 370 }, 100 },
|
||||
},
|
||||
};
|
||||
|
||||
static u32 D_8086E0C4[] = { 0x0A000939, 0x20000000, 0x00000001, &D_8086E0A0 };
|
||||
static ColliderJntSphInit colliderInit = {
|
||||
{ COLTYPE_UNK10, 0x00, 0x09, 0x39, 0x20, COLSHAPE_JNTSPH },
|
||||
1,
|
||||
&colliderItemsInit,
|
||||
};
|
||||
|
||||
static InitChainEntry initChain[] = {
|
||||
ICHAIN_F32(unk_F4, 1400, ICHAIN_CONTINUE),
|
||||
|
@ -68,7 +76,7 @@ static InitChainEntry initChain[] = {
|
|||
ICHAIN_F32(unk_FC, 1200, ICHAIN_STOP),
|
||||
};
|
||||
|
||||
static u32 D_8086E0E0[] = { 0x00000000, 0x430C0000, 0x00000000, 0x00000000 };
|
||||
static Vec3f D_8086E0E0 = { 0, 140.0f, 0 };
|
||||
|
||||
void func_8086D010(BgBdanSwitch* this, GlobalContext* globalCtx, u32 collision, DynaPolyMoveFlag flag) {
|
||||
s16 pad1;
|
||||
|
@ -86,8 +94,8 @@ void func_8086D010(BgBdanSwitch* this, GlobalContext* globalCtx, u32 collision,
|
|||
|
||||
void func_8086D098(BgBdanSwitch* this, GlobalContext* globalCtx) {
|
||||
Actor* actor = &this->actor;
|
||||
func_8005BBF8(globalCtx, &this->collider, actor);
|
||||
func_8005C050(globalCtx, &this->collider, actor, &D_8086E0C4, &this->collider.unk_20);
|
||||
Collider_InitJntSph(globalCtx, &this->collider);
|
||||
Collider_SetJntSph(globalCtx, &this->collider, actor, &colliderInit, &this->colliderItems);
|
||||
}
|
||||
|
||||
void func_8086D0EC(BgBdanSwitch* this) {
|
||||
|
@ -187,7 +195,7 @@ void BgBdanSwitch_Destroy(BgBdanSwitch* this, GlobalContext* globalCtx) {
|
|||
break;
|
||||
case YELLOW_TALL_1:
|
||||
case YELLOW_TALL_2:
|
||||
func_8005BCC8(globalCtx, &this->collider);
|
||||
Collider_DestroyJntSph(globalCtx, &this->collider);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -383,14 +391,14 @@ void func_8086DB68(BgBdanSwitch* this, GlobalContext* globalCtx) {
|
|||
default:
|
||||
return;
|
||||
case YELLOW_TALL_1:
|
||||
if (((this->collider.base.collideFlags & 2) != 0) && this->unk_1D8 <= 0) {
|
||||
if (((this->collider.base.acFlags & 2) != 0) && this->unk_1D8 <= 0) {
|
||||
this->unk_1D8 = 0xA;
|
||||
func_8086DC30(this);
|
||||
func_8086D4B4(this, globalCtx);
|
||||
}
|
||||
break;
|
||||
case YELLOW_TALL_2:
|
||||
if (((this->collider.base.collideFlags & 2) != 0) && ((this->unk_1DC & 2) == 0) && this->unk_1D8 <= 0) {
|
||||
if (((this->collider.base.acFlags & 2) != 0) && ((this->unk_1DC & 2) == 0) && this->unk_1D8 <= 0) {
|
||||
this->unk_1D8 = 0xA;
|
||||
func_8086DC30(this);
|
||||
func_8086D4B4(this, globalCtx);
|
||||
|
@ -426,7 +434,7 @@ void func_8086DCE8(BgBdanSwitch* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
break;
|
||||
case YELLOW_TALL_2:
|
||||
if (((this->collider.base.collideFlags & 2) != 0) && ((this->unk_1DC & 2) == 0) && (this->unk_1D8 <= 0)) {
|
||||
if (((this->collider.base.acFlags & 2) != 0) && ((this->unk_1DC & 2) == 0) && (this->unk_1D8 <= 0)) {
|
||||
this->unk_1D8 = 0xA;
|
||||
func_8086DDA8(this);
|
||||
func_8086D548(this, globalCtx);
|
||||
|
@ -468,12 +476,12 @@ void BgBdanSwitch_Update(BgBdanSwitch* this, GlobalContext* globalCtx) {
|
|||
if (!func_8008E988(globalCtx) && this->unk_1D8 > 0) {
|
||||
this->unk_1D8 -= 1;
|
||||
}
|
||||
pad = this->collider.base.collideFlags;
|
||||
this->collider.base.collideFlags &= 0xFFFD;
|
||||
pad = this->collider.base.acFlags;
|
||||
this->collider.base.acFlags &= 0xFFFD;
|
||||
this->unk_1DC = pad;
|
||||
this->collider.unk_1C->unk_2E = this->unk_1D4 * 370.0f;
|
||||
Actor_CollisionCheck_SetAC(globalCtx, &globalCtx->sub_11E60, &this->collider);
|
||||
Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, &this->collider);
|
||||
this->collider.list[0].dim.modelSphere.radius = this->unk_1D4 * 370.0f;
|
||||
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider);
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider);
|
||||
}
|
||||
|
||||
void func_8086DF58(BgBdanSwitch* this, GlobalContext* globalCtx, UNK_TYPE arg2) {
|
||||
|
|
|
@ -13,24 +13,6 @@ typedef enum {
|
|||
/* 0x04 */ YELLOW_TALL_2
|
||||
} BgBdanSwitchType;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ char unk_00[0x2E];
|
||||
/* 0x2E */ s16 unk_2E;
|
||||
} ColliderCustomHelper;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ Collider base;
|
||||
/* 0x18 */ char unk_18[0x4];
|
||||
/* 0x1C */ ColliderCustomHelper* unk_1C;
|
||||
/* 0x20 */ s32 unk_20;
|
||||
/* 0x24 */ char unk_24[0x1C];
|
||||
// after this is a guess based on ColliderCylinderMain
|
||||
/* 0x40 */ s16 radius;
|
||||
/* 0x42 */ s16 height;
|
||||
/* 0x44 */ s16 yShift;
|
||||
/* 0x46 */ Vec3s position;
|
||||
} ColliderCustomMain; // size = 0x4C
|
||||
|
||||
typedef struct {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ u32 dynaPolyId;
|
||||
|
@ -40,8 +22,8 @@ typedef struct {
|
|||
/* 0x015C */ u32 unk_15C;
|
||||
/* 0x0160 */ u8 unk_160;
|
||||
/* 0x0164 */ ActorFunc updateFunc;
|
||||
/* 0x0168 */ ColliderCustomMain collider;
|
||||
/* 0x01B4 */ char unk_1B4[0x14];
|
||||
/* 0x0168 */ ColliderJntSph collider;
|
||||
/* 0x0188 */ ColliderJntSphItem colliderItems[1];
|
||||
/* 0x01C8 */ f32 unk_1C8;
|
||||
/* 0x01CC */ s16 unk_1CC;
|
||||
/* 0x01CE */ char unk_1CE[0x2];
|
||||
|
|
|
@ -34,11 +34,12 @@ const ActorInit Bg_Hidan_Firewall_InitVars = {
|
|||
};
|
||||
|
||||
static ColliderCylinderInit cylinderInitData = {
|
||||
0x0A, 0x11, 0x00, 0x09, 0x20, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20000000, 0x01, 0x04,
|
||||
0x00, 0x00, 0xFFCFFFFF, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x01, 0x00, 0x001E, 0x0053, 0x0000,
|
||||
{ COLTYPE_UNK10, 0x11, 0x00, 0x09, 0x20, COLSHAPE_CYLINDER },
|
||||
{ 0x00, { 0x20000000, 0x01, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x19, 0x00, 0x01 },
|
||||
{ 30, 83, 0, { 0 } },
|
||||
};
|
||||
|
||||
static Sub98Init4 actor98InitData = {
|
||||
static CollisionCheckInfoInit colChkInfoInit = {
|
||||
0x01,
|
||||
0x0050,
|
||||
0x0064,
|
||||
|
@ -62,19 +63,19 @@ void BgHidanFirewall_Init(BgHidanFirewall* this, GlobalContext* globalCtx) {
|
|||
|
||||
this->unk_150 = 0;
|
||||
|
||||
ActorCollider_AllocCylinder(globalCtx, &this->collider);
|
||||
ActorCollider_InitCylinder(globalCtx, &this->collider, &this->actor, &cylinderInitData);
|
||||
Collider_InitCylinder(globalCtx, &this->collider);
|
||||
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInitData);
|
||||
|
||||
this->collider.dim.position.y = this->actor.posRot.pos.y;
|
||||
this->collider.dim.pos.y = this->actor.posRot.pos.y;
|
||||
|
||||
func_80061ED4(&this->actor.sub_98, NULL, &actor98InitData);
|
||||
func_80061ED4(&this->actor.colChkInfo, NULL, &colChkInfoInit);
|
||||
|
||||
this->actionFunc = (ActorFunc)BgHidanFirewall_Wait;
|
||||
}
|
||||
|
||||
void BgHidanFirewall_Destroy(BgHidanFirewall* this, GlobalContext* globalCtx) {
|
||||
BgHidanFirewall* thing = this;
|
||||
ActorCollider_FreeCylinder(globalCtx, &this->collider);
|
||||
Collider_DestroyCylinder(globalCtx, &this->collider);
|
||||
}
|
||||
|
||||
s32 BgHidanFirewall_CheckProximity(BgHidanFirewall* this, GlobalContext* globalCtx) {
|
||||
|
@ -165,8 +166,8 @@ void BgHidanFirewall_ColliderFollowPlayer(BgHidanFirewall* this, GlobalContext*
|
|||
}
|
||||
sp28 = Math_Sins(this->actor.shape.rot.y);
|
||||
temp_ret = Math_Coss(this->actor.shape.rot.y);
|
||||
this->collider.dim.position.x = this->actor.posRot.pos.x + sp30.x * temp_ret + sp30.z * sp28;
|
||||
this->collider.dim.position.z = this->actor.posRot.pos.z - sp30.x * sp28 + sp30.z * temp_ret;
|
||||
this->collider.dim.pos.x = this->actor.posRot.pos.x + sp30.x * temp_ret + sp30.z * sp28;
|
||||
this->collider.dim.pos.z = this->actor.posRot.pos.z - sp30.x * sp28 + sp30.z * temp_ret;
|
||||
}
|
||||
|
||||
void BgHidanFirewall_Update(BgHidanFirewall* this, GlobalContext* globalCtx) {
|
||||
|
@ -175,16 +176,16 @@ void BgHidanFirewall_Update(BgHidanFirewall* this, GlobalContext* globalCtx) {
|
|||
|
||||
this->unk_150 = (this->unk_150 + 1) % 8;
|
||||
|
||||
if (this->collider.base.colliderFlags & 2) {
|
||||
this->collider.base.colliderFlags &= ~2;
|
||||
if (this->collider.base.atFlags & 2) {
|
||||
this->collider.base.atFlags &= ~2;
|
||||
BgHidanFirewall_Collide(this, globalCtx);
|
||||
}
|
||||
|
||||
this->actionFunc(this, globalCtx);
|
||||
if (this->actionFunc == (ActorFunc)BgHidanFirewall_Erupt) {
|
||||
BgHidanFirewall_ColliderFollowPlayer(this, globalCtx);
|
||||
Actor_CollisionCheck_SetAT(globalCtx, &globalCtx->sub_11E60, &this->collider);
|
||||
Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, &this->collider);
|
||||
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider);
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider);
|
||||
func_8002F974(&this->actor, 0x2034);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ typedef struct {
|
|||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ ActorFunc actionFunc;
|
||||
/* 0x0150 */ s16 unk_150;
|
||||
/* 0x0154 */ ColliderCylinderMain collider;
|
||||
/* 0x0154 */ ColliderCylinder collider;
|
||||
} BgHidanFirewall; // size = 0x01A0
|
||||
|
||||
#endif
|
||||
|
|
|
@ -162,11 +162,12 @@ const ActorInit Bg_Toki_Swd_InitVars = {
|
|||
};
|
||||
|
||||
static ColliderCylinderInit colliderInit = {
|
||||
0x0A, 0x00, 0x00, 0x39, 0x12, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFFCFFFFF, 0x00, 0x00,
|
||||
0x00, 0x00, 0xFFCFFFFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000, 0x0001, 0x0000, 0x000A, 0x0046, 0x0000,
|
||||
{ COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x12, COLSHAPE_CYLINDER },
|
||||
{ 0x00, { 0xFFCFFFFF, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x00, 0x01 },
|
||||
{ 10, 70, 0, { 0 } }
|
||||
};
|
||||
|
||||
static Sub98Init4 sub98Init = {
|
||||
static CollisionCheckInfoInit colChkInfoInit = {
|
||||
0x0A,
|
||||
0x0023,
|
||||
0x0064,
|
||||
|
@ -182,7 +183,7 @@ void BgTokiSwd_SetupAction(BgTokiSwd* this, ActorFunc actionFunc) {
|
|||
}
|
||||
|
||||
void BgTokiSwd_Init(BgTokiSwd* this, GlobalContext* globalCtx) {
|
||||
ColliderCylinderMain* collision;
|
||||
ColliderCylinder* collision;
|
||||
Actor* thisx = &this->actor;
|
||||
|
||||
Actor_ProcessInitChain(thisx, initChain);
|
||||
|
@ -197,15 +198,15 @@ void BgTokiSwd_Init(BgTokiSwd* this, GlobalContext* globalCtx) {
|
|||
globalCtx->unk_11D30[0] = 0xFF;
|
||||
}
|
||||
|
||||
ActorCollider_AllocCylinder(globalCtx, collision);
|
||||
ActorCollider_InitCylinder(globalCtx, collision, thisx, &colliderInit);
|
||||
ActorCollider_Cylinder_Update(thisx, collision);
|
||||
func_80061ED4(&thisx->sub_98, 0, &sub98Init);
|
||||
Collider_InitCylinder(globalCtx, collision);
|
||||
Collider_SetCylinder(globalCtx, collision, thisx, &colliderInit);
|
||||
Collider_CylinderUpdate(thisx, collision);
|
||||
func_80061ED4(&thisx->colChkInfo, 0, &colChkInfoInit);
|
||||
}
|
||||
|
||||
void BgTokiSwd_Destroy(BgTokiSwd* this, GlobalContext* globalCtx) {
|
||||
ColliderCylinderMain* collider = &this->collider;
|
||||
ActorCollider_FreeCylinder(globalCtx, collider);
|
||||
ColliderCylinder* collider = &this->collider;
|
||||
Collider_DestroyCylinder(globalCtx, collider);
|
||||
}
|
||||
|
||||
void func_808BAF40(BgTokiSwd* this, GlobalContext* globalCtx) {
|
||||
|
@ -269,7 +270,7 @@ void func_808BB128(BgTokiSwd* this, GlobalContext* globalCtx) {
|
|||
|
||||
void BgTokiSwd_Update(BgTokiSwd* this, GlobalContext* globalCtx) {
|
||||
this->actionFunc(&this->actor, globalCtx);
|
||||
Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, &this->collider);
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider);
|
||||
}
|
||||
|
||||
void BgTokiSwd_Draw(BgTokiSwd* this, GlobalContext* globalCtx) {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
typedef struct {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ ActorFunc actionFunc;
|
||||
/* 0x0150 */ ColliderCylinderMain collider;
|
||||
/* 0x0150 */ ColliderCylinder collider;
|
||||
} BgTokiSwd; // size = 0x019C
|
||||
|
||||
extern const ActorInit Bg_Toki_Swd_InitVars;
|
||||
|
|
|
@ -33,9 +33,9 @@ const ActorInit Door_Ana_InitVars = {
|
|||
|
||||
// initial collision data
|
||||
static ColliderCylinderInit colliderInit = {
|
||||
0x0A, 0x00, 0x09, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00,
|
||||
0x00, 0x00000000, 0x00, 0x00, 0x00, 0x00, 0x00000048, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x01, 0x00, 0x00, 0x0032, 0x000A, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
{ COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_CYLINDER },
|
||||
{ 0x02, { 0x00000000, 0x00, 0x00 }, { 0x00000048, 0x00, 0x00 }, 0x00, 0x01, 0x00 },
|
||||
{ 50, 10, 0, { 0 } },
|
||||
};
|
||||
|
||||
// array of entrance table entries to grotto destinations
|
||||
|
@ -53,7 +53,7 @@ void DoorAna_SetupAction(DoorAna* this, ActorFunc func) {
|
|||
}
|
||||
|
||||
void DoorAna_Init(DoorAna* this, GlobalContext* globalCtx) {
|
||||
ColliderCylinderMain* collider;
|
||||
ColliderCylinder* collider;
|
||||
|
||||
this->actor.shape.rot.z = 0;
|
||||
this->actor.shape.rot.y = this->actor.shape.rot.z;
|
||||
|
@ -62,8 +62,8 @@ void DoorAna_Init(DoorAna* this, GlobalContext* globalCtx) {
|
|||
// only allocate collider for grottos that need bombing/hammering open
|
||||
if ((this->actor.params & 0x200) != 0) {
|
||||
collider = &this->collider;
|
||||
ActorCollider_AllocCylinder(globalCtx, collider);
|
||||
ActorCollider_InitCylinder(globalCtx, collider, &this->actor, &colliderInit);
|
||||
Collider_InitCylinder(globalCtx, collider);
|
||||
Collider_SetCylinder(globalCtx, collider, &this->actor, &colliderInit);
|
||||
} else {
|
||||
this->actor.flags |= 0x10;
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ void DoorAna_Init(DoorAna* this, GlobalContext* globalCtx) {
|
|||
void DoorAna_Destroy(DoorAna* this, GlobalContext* globalCtx) {
|
||||
// free collider if it has one
|
||||
if ((this->actor.params & 0x200) != 0) {
|
||||
ActorCollider_FreeCylinder(globalCtx, &this->collider);
|
||||
Collider_DestroyCylinder(globalCtx, &this->collider);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -93,12 +93,12 @@ void DoorAna_Update_Hidden(DoorAna* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
} else {
|
||||
// bombing/hammering open a grotto
|
||||
if ((this->collider.base.collideFlags & 2) != 0) {
|
||||
if ((this->collider.base.acFlags & 2) != 0) {
|
||||
openGrotto = true;
|
||||
ActorCollider_FreeCylinder(globalCtx, &this->collider);
|
||||
Collider_DestroyCylinder(globalCtx, &this->collider);
|
||||
} else {
|
||||
ActorCollider_Cylinder_Update(&this->actor, &this->collider);
|
||||
Actor_CollisionCheck_SetAC(globalCtx, &globalCtx->sub_11E60, &this->collider);
|
||||
Collider_CylinderUpdate(&this->actor, &this->collider);
|
||||
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider);
|
||||
}
|
||||
}
|
||||
// open the grotto
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
typedef struct {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ ColliderCylinderMain collider;
|
||||
/* 0x014C */ ColliderCylinder collider;
|
||||
/* 0x0198 */ ActorFunc actionFunc;
|
||||
} DoorAna; // size = 0x019C
|
||||
|
||||
|
|
|
@ -45,8 +45,9 @@ const ActorInit En_Ani_InitVars = {
|
|||
};
|
||||
|
||||
static ColliderCylinderInit cylinderInitData = {
|
||||
0x0A, 0x00, 0x11, 0x39, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00000000, 0x00, 0x00,
|
||||
0x00, 0x00, 0xFFCFFFFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x001E, 0x0028, 0x0000,
|
||||
{ COLTYPE_UNK10, 0x00, 0x11, 0x39, 0x10, COLSHAPE_CYLINDER },
|
||||
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 },
|
||||
{ 30, 40, 0, { 0 } },
|
||||
};
|
||||
|
||||
static InitChainEntry initChain[] = {
|
||||
|
@ -76,9 +77,9 @@ void EnAni_Init(EnAni* this, GlobalContext* globalCtx) {
|
|||
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_060000F0, anim, this->limbDrawTable, this->transitionDrawTable,
|
||||
0x10);
|
||||
SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, anim);
|
||||
ActorCollider_AllocCylinder(globalCtx, &this->collider);
|
||||
ActorCollider_InitCylinder(globalCtx, &this->collider, &this->actor, &cylinderInitData);
|
||||
this->actor.sub_98.mass = 0xFF;
|
||||
Collider_InitCylinder(globalCtx, &this->collider);
|
||||
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInitData);
|
||||
this->actor.colChkInfo.mass = 0xFF;
|
||||
if (LINK_IS_CHILD) {
|
||||
EnAni_SetupAction(this, func_809B064C);
|
||||
} else {
|
||||
|
@ -91,9 +92,9 @@ void EnAni_Init(EnAni* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnAni_Destroy(EnAni* this, GlobalContext* globalCtx) {
|
||||
ColliderCylinderMain* collider;
|
||||
ColliderCylinder* collider;
|
||||
collider = &this->collider;
|
||||
ActorCollider_FreeCylinder(globalCtx, &this->collider);
|
||||
Collider_DestroyCylinder(globalCtx, &this->collider);
|
||||
}
|
||||
|
||||
s32 EnAni_SetText(EnAni* this, GlobalContext* globalCtx, u16 textId) {
|
||||
|
@ -238,13 +239,13 @@ void func_809B0A6C(EnAni* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnAni_Update(EnAni* this, GlobalContext* globalCtx) {
|
||||
ColliderCylinderMain* collider;
|
||||
ColliderCylinder* collider;
|
||||
u32 pad;
|
||||
u32 pad2;
|
||||
|
||||
collider = &this->collider;
|
||||
ActorCollider_Cylinder_Update(&this->actor, collider);
|
||||
Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, collider);
|
||||
Collider_CylinderUpdate(&this->actor, collider);
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, collider);
|
||||
Actor_MoveForward(&this->actor);
|
||||
func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4);
|
||||
if ((globalCtx->csCtx.state != 0) && (globalCtx->csCtx.actorActions[0] != NULL)) {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
typedef struct {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ ColliderCylinderMain collider;
|
||||
/* 0x014C */ ColliderCylinder collider;
|
||||
/* 0x0198 */ SkelAnime skelAnime;
|
||||
/* 0x01DC */ Vec3s limbDrawTable[16];
|
||||
/* 0x023C */ Vec3s transitionDrawTable[16];
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* File: z_en_bird.c
|
||||
* Overlay: ovl_En_Bird
|
||||
* Description: The projectile fired by deku scrubs and octaroks.
|
||||
* Description: A brown bird. Tweet tweet.
|
||||
*/
|
||||
|
||||
#include <ultra64.h>
|
||||
|
@ -70,7 +70,7 @@ void EnBird_Init(EnBird* this, GlobalContext* globalCtx) {
|
|||
this->unk_194 = 0;
|
||||
this->unk_198 = 0;
|
||||
this->unk_1C0 = 0x9C4;
|
||||
this->actor.sub_98.mass = 0;
|
||||
this->actor.colChkInfo.mass = 0;
|
||||
this->unk_1A8 = 1.5f;
|
||||
this->unk_1AC = 0.5f;
|
||||
this->unk_1A0 = 0.0f;
|
||||
|
|
|
@ -27,52 +27,10 @@ const ActorInit En_Boom_InitVars = {
|
|||
(ActorFunc)EnBoom_Draw,
|
||||
};
|
||||
|
||||
// Related to collision, should be moved somewhere else when collision_check is decompiled.
|
||||
// Seems to be made up of a bunch of substructs, but I didnt do too much digging.
|
||||
// This is probably not accurate.
|
||||
typedef struct {
|
||||
u8 unk_00;
|
||||
u8 unk_01;
|
||||
u8 unk_02;
|
||||
u8 unk_03;
|
||||
u8 unk_04;
|
||||
u8 unk_05;
|
||||
u16 pad_06;
|
||||
u8 unk_08;
|
||||
u8 pad_09;
|
||||
u8 pad_0A;
|
||||
u8 pad_0B;
|
||||
u32 unk_0C;
|
||||
u8 unk_10;
|
||||
u8 unk_11;
|
||||
u16 pad_12;
|
||||
u32 unk_14;
|
||||
u8 unk_18;
|
||||
u8 unk_19;
|
||||
u16 pad_1A;
|
||||
u8 unk_1C;
|
||||
u8 unk_1D;
|
||||
u8 unk_1E;
|
||||
u8 pad_1F;
|
||||
u32 unk_20;
|
||||
u32 unk_24;
|
||||
u32 unk_28;
|
||||
u32 unk_2C;
|
||||
u32 unk_30;
|
||||
u32 unk_34;
|
||||
u32 unk_38;
|
||||
u32 unk_3C;
|
||||
u32 unk_40;
|
||||
u32 unk_44;
|
||||
u32 unk_48;
|
||||
u32 unk_4C;
|
||||
} unkCollision; // size = 0x50
|
||||
|
||||
static unkCollision col = {
|
||||
0x0A, 0x09, 0x00, 0x00, 0x08, 0x03, 0x0000, 0x02, 0x00,
|
||||
0x00, 0x00, 0x00000010, 0x00, 0x01, 0x0000, 0xFFCFFFFF, 0x00, 0x00,
|
||||
0x0000, 0x05, 0x00, 0x00, 0x00, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
static ColliderQuadInit col = {
|
||||
{ COLTYPE_UNK10, 0x09, 0x00, 0x00, 0x08, COLSHAPE_QUAD },
|
||||
{ 0x02, { 0x00000010, 0x00, 0x01 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x05, 0x00, 0x00 },
|
||||
{ 0 },
|
||||
};
|
||||
|
||||
static InitChainEntry initChain[] = {
|
||||
|
@ -123,15 +81,15 @@ void EnBoom_Init(EnBoom* this, GlobalContext* globalCtx) {
|
|||
|
||||
Effect_Add(globalCtx, &this->effect, 1, 0, 0, &trail);
|
||||
|
||||
func_8005D018(globalCtx, &this->collider);
|
||||
func_8005D104(globalCtx, &this->collider, this, &col);
|
||||
Collider_InitQuad(globalCtx, &this->collider);
|
||||
Collider_SetQuad(globalCtx, &this->collider, this, &col);
|
||||
|
||||
EnBoom_SetupAction(this, &EnBoom_Fly);
|
||||
}
|
||||
|
||||
void EnBoom_Destroy(EnBoom* this, GlobalContext* globalCtx) {
|
||||
func_8002709C(globalCtx, this->effect);
|
||||
func_8005D060(globalCtx, &this->collider);
|
||||
Collider_DestroyQuad(globalCtx, &this->collider);
|
||||
}
|
||||
|
||||
void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) {
|
||||
|
@ -183,13 +141,13 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) {
|
|||
func_8002F974(this, 0x1010);
|
||||
|
||||
// If the boomerang collides with EnItem00 or a Skulltula token, set grabbed pointer to pick it up
|
||||
collided = (this->collider.colliderFlags & 0x2);
|
||||
collided = (this->collider.base.atFlags & 0x2);
|
||||
collided = (!!(collided));
|
||||
if (collided) {
|
||||
if (((this->collider.at->id == ACTOR_EN_ITEM00) || (this->collider.at->id == ACTOR_EN_SI))) {
|
||||
this->grabbed = this->collider.at;
|
||||
if (this->collider.at->id == ACTOR_EN_SI) {
|
||||
this->collider.at->flags |= 0x2000;
|
||||
if (((this->collider.base.at->id == ACTOR_EN_ITEM00) || (this->collider.base.at->id == ACTOR_EN_SI))) {
|
||||
this->grabbed = this->collider.base.at;
|
||||
if (this->collider.base.at->id == ACTOR_EN_SI) {
|
||||
this->collider.base.at->flags |= 0x2000;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -220,7 +178,7 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) {
|
|||
Actor_Kill(&this->actor);
|
||||
}
|
||||
} else {
|
||||
collided = (this->collider.colliderFlags & 0x2);
|
||||
collided = (this->collider.base.atFlags & 0x2);
|
||||
collided = (!!(collided));
|
||||
if (collided) {
|
||||
// Copy the position from the prevous frame to the boomerang to start the bounce back.
|
||||
|
|
|
@ -5,16 +5,15 @@
|
|||
#include <global.h>
|
||||
|
||||
typedef struct {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ Collider collider;
|
||||
/* 0x0164 */ char unk_164[0x68];
|
||||
/* 0x01CC */ Actor* moveTo; // actor boomerang moves toward
|
||||
/* 0x01D0 */ Actor* grabbed; // actor grabbed by the boomerang
|
||||
/* 0x01D4 */ u8 returnTimer; // returns to Link when 0
|
||||
/* 0x01D5 */ u8 activeTimer; // increments once every update
|
||||
/* 0x01D8 */ u32 effect; // set by Effect_Add
|
||||
/* 0x01DC */ u32 unk_1DC[0x7];
|
||||
/* 0x01F8 */ ActorFunc actionFunc;
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ ColliderQuad collider;
|
||||
/* 0x01CC */ Actor* moveTo; // actor boomerang moves toward
|
||||
/* 0x01D0 */ Actor* grabbed; // actor grabbed by the boomerang
|
||||
/* 0x01D4 */ u8 returnTimer; // returns to Link when 0
|
||||
/* 0x01D5 */ u8 activeTimer; // increments once every update
|
||||
/* 0x01D8 */ u32 effect; // set by Effect_Add
|
||||
/* 0x01DC */ u32 unk_1DC[0x7];
|
||||
/* 0x01F8 */ ActorFunc actionFunc;
|
||||
} EnBoom; // size = 0x01FC
|
||||
|
||||
extern const ActorInit En_Boom_InitVars;
|
||||
|
|
|
@ -33,12 +33,12 @@ const ActorInit En_Dog_InitVars = {
|
|||
};
|
||||
|
||||
static ColliderCylinderInit cylinderInit = {
|
||||
0x06, 0x00, 0x09, 0x39, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00000000, 0x00, 0x00, 0x00, 0x00, 0xFFCFFFFF, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x01, 0x01, 0x00, 0x0010, 0x0014, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
{ COLTYPE_UNK6, 0x00, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER },
|
||||
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 },
|
||||
{ 16, 20, 0, { 0 } },
|
||||
};
|
||||
|
||||
static Sub98Init5 sub98Data = {
|
||||
static CollisionCheckInfoInit2 colChkInfoInit = {
|
||||
0x00, // health
|
||||
0x0000, // unk_10
|
||||
0x0000, // unk_12
|
||||
|
@ -155,8 +155,8 @@ s32 EnDog_PlayAnimAndSFX(EnDog* this) {
|
|||
}
|
||||
|
||||
s8 EnDog_CanFollow(EnDog* this, GlobalContext* globalCtx) {
|
||||
if ((this->collider.base.collideFlags & 2)) {
|
||||
this->collider.base.collideFlags &= ~2;
|
||||
if (this->collider.base.acFlags & 2) {
|
||||
this->collider.base.acFlags &= ~2;
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
@ -164,7 +164,7 @@ s8 EnDog_CanFollow(EnDog* this, GlobalContext* globalCtx) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
if ((this->collider.base.maskB & 1)) {
|
||||
if (this->collider.base.maskB & 1) {
|
||||
this->collider.base.maskB &= ~1;
|
||||
if (gSaveContext.dogParams != 0) {
|
||||
return 0;
|
||||
|
@ -221,7 +221,7 @@ s32 EnDog_Orient(EnDog* this, GlobalContext* globalCtx) {
|
|||
void EnDog_Init(EnDog* this, GlobalContext* globalCtx) {
|
||||
SkelAnime* skelAnime;
|
||||
s16 followingDog;
|
||||
ColliderCylinderMain* collider;
|
||||
ColliderCylinder* collider;
|
||||
|
||||
collider = &this->collider;
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 24.0f);
|
||||
|
@ -239,9 +239,9 @@ void EnDog_Init(EnDog* this, GlobalContext* globalCtx) {
|
|||
return;
|
||||
}
|
||||
|
||||
ActorCollider_AllocCylinder(globalCtx, collider);
|
||||
ActorCollider_InitCylinder(globalCtx, collider, &this->actor, &cylinderInit);
|
||||
func_80061EFC(&this->actor.sub_98, 0, &sub98Data);
|
||||
Collider_InitCylinder(globalCtx, collider);
|
||||
Collider_SetCylinder(globalCtx, collider, &this->actor, &cylinderInit);
|
||||
func_80061EFC(&this->actor.colChkInfo, 0, &colChkInfoInit);
|
||||
Actor_SetScale(&this->actor, 0.0075f);
|
||||
this->waypoint = 0;
|
||||
this->actor.gravity = -1.0f;
|
||||
|
@ -278,8 +278,8 @@ void EnDog_Init(EnDog* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnDog_Destroy(EnDog* this, GlobalContext* globalCtx) {
|
||||
ColliderCylinderMain* collider = &this->collider;
|
||||
ActorCollider_FreeCylinder(globalCtx, collider);
|
||||
ColliderCylinder* collider = &this->collider;
|
||||
Collider_DestroyCylinder(globalCtx, collider);
|
||||
}
|
||||
|
||||
void EnDog_FollowPath(EnDog* this, GlobalContext* globalCtx) {
|
||||
|
@ -437,8 +437,8 @@ void EnDog_Update(EnDog* this, GlobalContext* globalCtx) {
|
|||
func_8002E4B4(globalCtx, &this->actor, this->collider.dim.radius, this->collider.dim.height * 0.5f, 0.0f, 5);
|
||||
Actor_MoveForward(&this->actor);
|
||||
this->actionFunc(this, globalCtx);
|
||||
ActorCollider_Cylinder_Update(&this->actor, &this->collider);
|
||||
Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, &this->collider);
|
||||
Collider_CylinderUpdate(&this->actor, &this->collider);
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider);
|
||||
}
|
||||
|
||||
s32 EnDog_Callback1(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* actor) {
|
||||
|
|
|
@ -8,7 +8,7 @@ typedef struct {
|
|||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ SkelAnime skelAnime;
|
||||
/* 0x0190 */ ActorFunc actionFunc;
|
||||
/* 0x0194 */ ColliderCylinderMain collider;
|
||||
/* 0x0194 */ ColliderCylinder collider;
|
||||
/* 0x01E0 */ Path* path;
|
||||
/* 0x01E4 */ u8 reverse;
|
||||
/* 0x01E6 */ s16 waypoint;
|
||||
|
|
|
@ -55,7 +55,7 @@ void EnDs_Init(EnDs* this, GlobalContext* globalCtx) {
|
|||
SkelAnime_InitSV(globalCtx, skelAnime, &D_06004768, &D_0600039C, &this->limbDrawTable, &this->unk_1B4, 6);
|
||||
SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_0600039C);
|
||||
|
||||
this->actor.sub_98.mass = 0xFF;
|
||||
this->actor.colChkInfo.mass = 0xFF;
|
||||
|
||||
Actor_SetScale(this, 0.013f);
|
||||
|
||||
|
|
|
@ -13,12 +13,13 @@ void EnIt_Destroy(EnIt* this, GlobalContext* globalCtx);
|
|||
void EnIt_Update(EnIt* this, GlobalContext* globalCtx);
|
||||
|
||||
static ColliderCylinderInit cylinderInitData = {
|
||||
0x0A, 0x00, 0x00, 0x05, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00000000, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00000000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000, 0x0001, 0x0000, 0x0028, 0x000A, 0x0000,
|
||||
{ COLTYPE_UNK10, 0x00, 0x00, 0x05, 0x10, COLSHAPE_CYLINDER },
|
||||
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 },
|
||||
{ 40, 10, 0, { 0 } },
|
||||
};
|
||||
|
||||
static u8 damageTblInitData[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00,
|
||||
static CollisionCheckInfoInit2 colChkInfoInit = {
|
||||
0x00, 0x0000, 0x0000, 0x0000, 0xFF,
|
||||
};
|
||||
|
||||
const ActorInit En_It_InitVars = {
|
||||
|
@ -37,21 +38,21 @@ void EnIt_Init(EnIt* this, GlobalContext* globalCtx) {
|
|||
EnIt* it = this;
|
||||
|
||||
it->actor.params = 0x0D05;
|
||||
ActorCollider_AllocCylinder(globalCtx, &it->cylinderCollider);
|
||||
ActorCollider_InitCylinder(globalCtx, &it->cylinderCollider, &it->actor, &cylinderInitData);
|
||||
func_80061EFC(&it->actor.sub_98.damageChart, 0, &damageTblInitData); // Init Damage Chart
|
||||
Collider_InitCylinder(globalCtx, &it->cylinderCollider);
|
||||
Collider_SetCylinder(globalCtx, &it->cylinderCollider, &it->actor, &cylinderInitData);
|
||||
func_80061EFC(&it->actor.colChkInfo, 0, &colChkInfoInit); // Init Damage Chart
|
||||
}
|
||||
|
||||
void EnIt_Destroy(EnIt* this, GlobalContext* globalCtx) {
|
||||
EnIt* it = this;
|
||||
|
||||
ActorCollider_FreeCylinder(globalCtx, &it->cylinderCollider);
|
||||
Collider_DestroyCylinder(globalCtx, &it->cylinderCollider);
|
||||
}
|
||||
|
||||
void EnIt_Update(EnIt* this, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
EnIt* it = this;
|
||||
|
||||
ActorCollider_Cylinder_Update(&it->actor, &it->cylinderCollider);
|
||||
Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, &it->cylinderCollider);
|
||||
Collider_CylinderUpdate(&it->actor, &it->cylinderCollider);
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &it->cylinderCollider);
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
typedef struct {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ u32 unk_14C;
|
||||
/* 0x0150 */ ColliderCylinderMain cylinderCollider;
|
||||
/* 0x0150 */ ColliderCylinder cylinderCollider;
|
||||
} EnIt; // size = 0x019C
|
||||
|
||||
extern const ActorInit En_It_InitVars;
|
||||
|
|
|
@ -50,8 +50,8 @@ void EnLightbox_Init(EnLightbox* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
thisx->posRot2.pos = thisx->posRot.pos;
|
||||
thisx->sub_98.unk_10 = 0x1E;
|
||||
thisx->sub_98.unk_12 = 0x32;
|
||||
thisx->colChkInfo.unk_10 = 0x1E;
|
||||
thisx->colChkInfo.unk_12 = 0x32;
|
||||
ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawFunc_Circle, 6.0f);
|
||||
this->dyna.unk_160 = 0;
|
||||
this->dyna.unk_15C = 0;
|
||||
|
@ -102,7 +102,7 @@ void EnLightbox_Update(EnLightbox* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
Actor_MoveForward(thisx);
|
||||
func_8002E4B4(globalCtx, thisx, thisx->sub_98.unk_12, thisx->sub_98.unk_10, thisx->sub_98.unk_10, 0x1D);
|
||||
func_8002E4B4(globalCtx, thisx, thisx->colChkInfo.unk_12, thisx->colChkInfo.unk_10, thisx->colChkInfo.unk_10, 0x1D);
|
||||
thisx->posRot2.pos = thisx->posRot.pos;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,8 +25,9 @@ const ActorInit En_M_Fire1_InitVars = {
|
|||
};
|
||||
|
||||
static ColliderCylinderInit cylinderInitData = {
|
||||
0x0A, 0x09, 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00000001, 0x00, 0x00,
|
||||
0x00, 0x00, 0xFFCFFFFF, 0x00, 0x00, 0x00, 0x00, 0x19, 0x0000, 0x0000, 0x0000, 0x00C8, 0x00C8, 0x0000,
|
||||
{ COLTYPE_UNK10, 0x09, 0x00, 0x00, 0x08, COLSHAPE_CYLINDER },
|
||||
{ 0x02, { 0x00000001, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x19, 0x00, 0x00 },
|
||||
{ 200, 200, 0, { 0 } }
|
||||
};
|
||||
|
||||
void EnMFire1_Init(EnMFire1* this, GlobalContext* globalCtx) {
|
||||
|
@ -39,13 +40,13 @@ void EnMFire1_Init(EnMFire1* this, GlobalContext* globalCtx) {
|
|||
Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &thisLocal->actor, ACTORTYPE_ITEMACTION);
|
||||
}
|
||||
|
||||
ActorCollider_AllocCylinder(globalCtx, &thisLocal->capsule);
|
||||
ActorCollider_InitCylinder(globalCtx, &thisLocal->capsule, &thisLocal->actor, &cylinderInitData);
|
||||
Collider_InitCylinder(globalCtx, &thisLocal->capsule);
|
||||
Collider_SetCylinder(globalCtx, &thisLocal->capsule, &thisLocal->actor, &cylinderInitData);
|
||||
}
|
||||
|
||||
void EnMFire1_Destroy(EnMFire1* this, GlobalContext* globalCtx) {
|
||||
ColliderCylinderMain* capsule = &this->capsule;
|
||||
ActorCollider_FreeCylinder(globalCtx, capsule);
|
||||
ColliderCylinder* capsule = &this->capsule;
|
||||
Collider_DestroyCylinder(globalCtx, capsule);
|
||||
}
|
||||
|
||||
void EnMFire1_Update(EnMFire1* this, GlobalContext* globalCtx) {
|
||||
|
@ -55,7 +56,7 @@ void EnMFire1_Update(EnMFire1* this, GlobalContext* globalCtx) {
|
|||
if (Math_ApproxF(&thisLocal->unk_0198, 1.0, 0.2)) {
|
||||
Actor_Kill(&this->actor);
|
||||
} else {
|
||||
ActorCollider_Cylinder_Update(&thisLocal->actor, &thisLocal->capsule);
|
||||
Actor_CollisionCheck_SetAT(globalCtx, &globalCtx->sub_11E60, &thisLocal->capsule);
|
||||
Collider_CylinderUpdate(&thisLocal->actor, &thisLocal->capsule);
|
||||
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &thisLocal->capsule);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
typedef struct {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ ColliderCylinderMain capsule;
|
||||
/* 0x014C */ ColliderCylinder capsule;
|
||||
/* 0x0198 */ f32 unk_0198;
|
||||
} EnMFire1; // size = 0x019C
|
||||
|
||||
|
|
|
@ -30,9 +30,10 @@ const ActorInit En_Ms_InitVars = {
|
|||
(ActorFunc)EnMs_Draw,
|
||||
};
|
||||
|
||||
static s32 unk_col_80AB0320[] = {
|
||||
0x0A000939, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0xFFCFFFFF,
|
||||
0x00000000, 0x00010100, 0x00160025, 0x00000000, 0x00000000,
|
||||
static ColliderCylinderInit_Set3 colliderInit = {
|
||||
{ COLTYPE_UNK10, 0x00, 0x09, 0x39, COLSHAPE_CYLINDER },
|
||||
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 },
|
||||
{ 22, 37, 0, { 0 } },
|
||||
};
|
||||
|
||||
static s16 prices[] = {
|
||||
|
@ -73,12 +74,12 @@ void EnMs_Init(EnMs* this, GlobalContext* globalCtx) {
|
|||
Actor_ProcessInitChain(&this->actor, initChain);
|
||||
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06003DC0, &D_060005EC, &this->unkSkelAnimeStruct, &this->unk_1C6,
|
||||
9);
|
||||
ActorCollider_AllocCylinder(globalCtx, &this->collider);
|
||||
func_8005C450(globalCtx, &this->collider, this, &unk_col_80AB0320);
|
||||
Collider_InitCylinder(globalCtx, &this->collider);
|
||||
Collider_SetCylinder_Set3(globalCtx, &this->collider, this, &colliderInit);
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 35.0f);
|
||||
Actor_SetScale(&this->actor, 0.015f);
|
||||
|
||||
this->actor.sub_98.mass = 0xFF;
|
||||
this->actor.colChkInfo.mass = 0xFF;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
this->actor.velocity.y = 0.0f;
|
||||
this->actor.gravity = -1.0f;
|
||||
|
@ -89,8 +90,8 @@ void EnMs_Init(EnMs* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnMs_Destroy(EnMs* this, GlobalContext* globalCtx) {
|
||||
ColliderCylinderMain* collider = &this->collider;
|
||||
ActorCollider_FreeCylinder(globalCtx, collider);
|
||||
ColliderCylinder* collider = &this->collider;
|
||||
Collider_DestroyCylinder(globalCtx, collider);
|
||||
}
|
||||
|
||||
void EnMs_Wait(EnMs* this, GlobalContext* globalCtx) {
|
||||
|
@ -170,8 +171,8 @@ void EnMs_Update(EnMs* this, GlobalContext* globalCtx) {
|
|||
osSyncPrintf("OOOHHHHHH %f\n", this->actor.velocity.y);
|
||||
func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4);
|
||||
}
|
||||
ActorCollider_Cylinder_Update(&this->actor, &this->collider);
|
||||
Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, &this->collider);
|
||||
Collider_CylinderUpdate(&this->actor, &this->collider);
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider);
|
||||
}
|
||||
|
||||
void EnMs_Draw(EnMs* this, GlobalContext* globalCtx) {
|
||||
|
|
|
@ -12,7 +12,7 @@ typedef struct {
|
|||
/* 0x01C6 */ s16 unk_1C6;
|
||||
/* 0x01C8 */ char unk_1C8[0x34];
|
||||
/* 0x01FC */ ActorFunc actionFunc;
|
||||
/* 0x0200 */ ColliderCylinderMain collider;
|
||||
/* 0x0200 */ ColliderCylinder collider;
|
||||
/* 0x024C */ s16 activeTimer;
|
||||
} EnMs; // size = 0x0250
|
||||
|
||||
|
|
|
@ -28,9 +28,9 @@ const ActorInit En_Nutsball_InitVars = {
|
|||
};
|
||||
|
||||
static ColliderCylinderInit cylinderInitData = {
|
||||
0x0A, 0x11, 0x09, 0x39, 0x20, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0xFFCFFFFF, 0x00, 0x08, 0x00, 0x00, 0xFFCFFFFF, 0x00, 0x00, 0x00, 0x00,
|
||||
0x11, 0x01, 0x01, 0x00, 0x000D, 0x000D, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
{ COLTYPE_UNK10, 0x11, 0x09, 0x39, 0x20, COLSHAPE_CYLINDER },
|
||||
{ 0x00, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x11, 0x01, 0x01 },
|
||||
{ 13, 13, 0, { 0 } },
|
||||
};
|
||||
|
||||
static s16 objectTbl[] = { OBJECT_DEKUNUTS, OBJECT_HINTNUTS, OBJECT_SHOPNUTS, OBJECT_DNS, OBJECT_DNK };
|
||||
|
@ -40,8 +40,8 @@ void EnNutsball_Init(EnNutsball* this, GlobalContext* globalCtx) {
|
|||
s32 pad[2];
|
||||
|
||||
ActorShape_Init(&this->actor.shape, 400.0f, ActorShadow_DrawFunc_Circle, 13.0f);
|
||||
ActorCollider_AllocCylinder(globalCtx, &this->collider);
|
||||
ActorCollider_InitCylinder(globalCtx, &this->collider, &this->actor, &cylinderInitData);
|
||||
Collider_InitCylinder(globalCtx, &this->collider);
|
||||
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInitData);
|
||||
this->objBankIndex = Object_GetIndex(&globalCtx->objectCtx, objectTbl[this->actor.params]);
|
||||
|
||||
if (this->objBankIndex < 0) {
|
||||
|
@ -52,8 +52,8 @@ void EnNutsball_Init(EnNutsball* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnNutsball_Destroy(EnNutsball* this, GlobalContext* globalCtx) {
|
||||
ColliderCylinderMain* collider = &this->collider;
|
||||
ActorCollider_FreeCylinder(globalCtx, collider);
|
||||
ColliderCylinder* collider = &this->collider;
|
||||
Collider_DestroyCylinder(globalCtx, collider);
|
||||
}
|
||||
|
||||
void func_80ABBB34(EnNutsball* this, GlobalContext* globalCtx) {
|
||||
|
@ -80,15 +80,15 @@ void func_80ABBBA8(EnNutsball* this, GlobalContext* globalCtx) {
|
|||
|
||||
this->actor.initPosRot.rot.z += 0x2AA8;
|
||||
|
||||
if ((this->actor.bgCheckFlags & 8) || (this->actor.bgCheckFlags & 1) || (this->collider.base.colliderFlags & 2) ||
|
||||
(this->collider.base.collideFlags & 2) || (this->collider.base.maskA & 2)) {
|
||||
if ((this->actor.bgCheckFlags & 8) || (this->actor.bgCheckFlags & 1) || (this->collider.base.atFlags & 2) ||
|
||||
(this->collider.base.acFlags & 2) || (this->collider.base.maskA & 2)) {
|
||||
// Checking if the player is using a shield that reflects projectiles
|
||||
// And if so, reflects the projectile on impact
|
||||
if ((player->currentShield == 1) || ((player->currentShield == 2) && LINK_IS_ADULT)) {
|
||||
if ((this->collider.base.colliderFlags & 2) && (this->collider.base.colliderFlags & 0x10) &&
|
||||
(this->collider.base.colliderFlags & 4)) {
|
||||
this->collider.base.colliderFlags &= ~0x16;
|
||||
this->collider.base.colliderFlags |= 0x08;
|
||||
if ((this->collider.base.atFlags & 2) && (this->collider.base.atFlags & 0x10) &&
|
||||
(this->collider.base.atFlags & 4)) {
|
||||
this->collider.base.atFlags &= ~0x16;
|
||||
this->collider.base.atFlags |= 0x08;
|
||||
|
||||
this->collider.body.toucher.flags = 2;
|
||||
func_800D20CC(&player->mf_A20, &sp4C, 0);
|
||||
|
@ -122,13 +122,13 @@ void EnNutsball_Update(EnNutsball* this, GlobalContext* globalCtx) {
|
|||
|
||||
Actor_MoveForward(&nutsball->actor);
|
||||
func_8002E4B4(globalCtx, &nutsball->actor, 10, cylinderInitData.dim.radius, cylinderInitData.dim.height, 5);
|
||||
ActorCollider_Cylinder_Update(&nutsball->actor, &nutsball->collider);
|
||||
Collider_CylinderUpdate(&nutsball->actor, &nutsball->collider);
|
||||
|
||||
nutsball->actor.flags |= 0x1000000;
|
||||
|
||||
Actor_CollisionCheck_SetAT(globalCtx, &globalCtx->sub_11E60, &nutsball->collider);
|
||||
Actor_CollisionCheck_SetAC(globalCtx, &globalCtx->sub_11E60, &nutsball->collider);
|
||||
Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, &nutsball->collider);
|
||||
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &nutsball->collider);
|
||||
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &nutsball->collider);
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &nutsball->collider);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ typedef struct {
|
|||
/* 0x014C */ ActorFunc actionFunc;
|
||||
/* 0x0150 */ s8 objBankIndex;
|
||||
/* 0x0152 */ s16 timer;
|
||||
/* 0x0154 */ ColliderCylinderMain collider;
|
||||
/* 0x0154 */ ColliderCylinder collider;
|
||||
} EnNutsball; // size = 0x01A0
|
||||
|
||||
extern const ActorInit En_Nutsball_InitVars;
|
||||
|
|
|
@ -48,8 +48,8 @@ void EnPubox_Init(EnPubox* this, GlobalContext* globalCtx) {
|
|||
break;
|
||||
}
|
||||
this->unk_164 = 1;
|
||||
thisx->sub_98.unk_10 = 0x14;
|
||||
thisx->sub_98.unk_12 = 0x32;
|
||||
thisx->colChkInfo.unk_10 = 0x14;
|
||||
thisx->colChkInfo.unk_12 = 0x32;
|
||||
thisx->unk_FC = 1200.0f;
|
||||
thisx->unk_F8 = 720.0f;
|
||||
ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawFunc_Circle, 6.0f);
|
||||
|
@ -78,7 +78,7 @@ void EnPubox_Update(EnPubox* this, GlobalContext* globalCtx) {
|
|||
this->dyna.unk_154 = 0.0f;
|
||||
this->dyna.unk_150 = 0.0f;
|
||||
Actor_MoveForward(thisx);
|
||||
func_8002E4B4(globalCtx, thisx, thisx->sub_98.unk_12, thisx->sub_98.unk_10, thisx->sub_98.unk_10, 0x1D);
|
||||
func_8002E4B4(globalCtx, thisx, thisx->colChkInfo.unk_12, thisx->colChkInfo.unk_10, thisx->colChkInfo.unk_10, 0x1D);
|
||||
thisx->posRot2.pos = thisx->posRot.pos;
|
||||
}
|
||||
|
||||
|
|
|
@ -68,16 +68,16 @@ void func_80AF03F4(EnRu1* this, GlobalContext* globalCtx);
|
|||
void func_80AF0400(EnRu1* this, GlobalContext* globalCtx);
|
||||
void func_80AF05D4(EnRu1* this, GlobalContext* globalCtx);
|
||||
|
||||
ColliderCylinderInit D_80AF0800 = {
|
||||
0x00, 0x00, 0x00, 0x09, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00000000, 0x00, 0x00, 0x00, 0x00, 0x00000000, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x01, 0x00, 0x0019, 0x0050, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
ColliderCylinderInit_Set3 D_80AF0800 = {
|
||||
{ COLTYPE_UNK0, 0x00, 0x00, 0x09, COLSHAPE_CYLINDER },
|
||||
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 },
|
||||
{ 25, 80, 0, { 0 } },
|
||||
};
|
||||
|
||||
ColliderCylinderInit D_80AF082C = {
|
||||
0x00, 0x09, 0x00, 0x09, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00000101, 0x00, 0x00, 0x00, 0x00, 0x00000000, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x01, 0x00, 0x0014, 0x001E, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
ColliderCylinderInit_Set3 D_80AF082C = {
|
||||
{ COLTYPE_UNK0, 0x09, 0x00, 0x09, COLSHAPE_CYLINDER },
|
||||
{ 0x00, { 0x00000101, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x01 },
|
||||
{ 20, 30, 0, { 0 } },
|
||||
};
|
||||
|
||||
u32 D_80AF0858[] = {
|
||||
|
@ -161,20 +161,20 @@ extern AnimationHeader D_06013A64;
|
|||
|
||||
void func_80AEAC10(EnRu1* this, GlobalContext* globalCtx) {
|
||||
s32 pad[4];
|
||||
ColliderCylinderMain* collider = &this->collider;
|
||||
ColliderCylinder* collider = &this->collider;
|
||||
|
||||
ActorCollider_Cylinder_Update(&this->actor, collider);
|
||||
Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, collider);
|
||||
Collider_CylinderUpdate(&this->actor, collider);
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, collider);
|
||||
}
|
||||
|
||||
void func_80AEAC54(EnRu1* this, GlobalContext* globalCtx) {
|
||||
Actor* thisx = &this->actor;
|
||||
ColliderCylinderMain* collider2 = &this->collider2;
|
||||
ColliderCylinder* collider2 = &this->collider2;
|
||||
s32 pad[3];
|
||||
|
||||
ActorCollider_Cylinder_Update(thisx, collider2);
|
||||
Collider_CylinderUpdate(thisx, collider2);
|
||||
if (this->unk_34C != 0) {
|
||||
Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, collider2);
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, collider2);
|
||||
} else if (thisx->xzDistanceFromLink > 32.0f) {
|
||||
this->unk_34C = 1;
|
||||
}
|
||||
|
@ -182,26 +182,26 @@ void func_80AEAC54(EnRu1* this, GlobalContext* globalCtx) {
|
|||
|
||||
void func_80AEACDC(EnRu1* this, GlobalContext* globalCtx) {
|
||||
s32 pad[4];
|
||||
ColliderCylinderMain* collider2 = &this->collider2;
|
||||
ColliderCylinder* collider2 = &this->collider2;
|
||||
|
||||
ActorCollider_Cylinder_Update(&this->actor, collider2);
|
||||
Actor_CollisionCheck_SetAT(globalCtx, &globalCtx->sub_11E60, collider2);
|
||||
Collider_CylinderUpdate(&this->actor, collider2);
|
||||
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, collider2);
|
||||
}
|
||||
|
||||
void func_80AEAD20(EnRu1* this, GlobalContext* globalCtx) {
|
||||
Actor* thisx = &this->actor;
|
||||
|
||||
ActorCollider_AllocCylinder(globalCtx, &this->collider);
|
||||
Collider_InitCylinder(globalCtx, &this->collider);
|
||||
if (!thisx) {} // necessary to match
|
||||
func_8005C450(globalCtx, &this->collider, thisx, &D_80AF0800);
|
||||
Collider_SetCylinder_Set3(globalCtx, &this->collider, thisx, &D_80AF0800);
|
||||
|
||||
ActorCollider_AllocCylinder(globalCtx, &this->collider2);
|
||||
func_8005C450(globalCtx, &this->collider2, thisx, &D_80AF082C);
|
||||
Collider_InitCylinder(globalCtx, &this->collider2);
|
||||
Collider_SetCylinder_Set3(globalCtx, &this->collider2, thisx, &D_80AF082C);
|
||||
}
|
||||
|
||||
void func_80AEAD98(EnRu1* this, GlobalContext* globalCtx) {
|
||||
ActorCollider_FreeCylinder(globalCtx, &this->collider);
|
||||
ActorCollider_FreeCylinder(globalCtx, &this->collider2);
|
||||
Collider_DestroyCylinder(globalCtx, &this->collider);
|
||||
Collider_DestroyCylinder(globalCtx, &this->collider2);
|
||||
}
|
||||
|
||||
void func_80AEADD8(EnRu1* this) {
|
||||
|
|
|
@ -41,8 +41,8 @@ typedef struct {
|
|||
/* 0x02AC */ s16 unk_2AC;
|
||||
/* 0x02AE */ char unk_2AE[0x2];
|
||||
/* 0x02B0 */ s32 unk_2B0;
|
||||
/* 0x02B4 */ ColliderCylinderMain collider;
|
||||
/* 0x0300 */ ColliderCylinderMain collider2;
|
||||
/* 0x02B4 */ ColliderCylinder collider;
|
||||
/* 0x0300 */ ColliderCylinder collider2;
|
||||
/* 0x034C */ s32 unk_34C;
|
||||
/* 0x0350 */ s32 unk_350;
|
||||
/* 0x0354 */ f32 unk_354;
|
||||
|
|
|
@ -42,10 +42,10 @@ void func_80AF321C(EnRu2* this, GlobalContext* globalCtx);
|
|||
|
||||
void func_80AF2AB4(EnRu2* this, GlobalContext* globalCtx);
|
||||
|
||||
static ColliderCylinderInit D_80AF40E0 = {
|
||||
0x0A, 0x00, 0x09, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00000000, 0x00, 0x00, 0x00, 0x00, 0x00000080, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x01, 0x00, 0x00, 0x001E, 0x0064, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
static ColliderCylinderInit_Set3 colliderInit = {
|
||||
{ COLTYPE_UNK10, 0x00, 0x09, 0x00, COLSHAPE_CYLINDER },
|
||||
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000080, 0x00, 0x00 }, 0x00, 0x01, 0x00 },
|
||||
{ 30, 100, 0, { 0 } },
|
||||
};
|
||||
|
||||
static u32 D_80AF410C[] = {
|
||||
|
@ -95,23 +95,23 @@ extern AnimationHeader D_0600F8B8;
|
|||
|
||||
void func_80AF2550(EnRu2* this, GlobalContext* globalCtx) {
|
||||
EnRu2* thisLocal = this;
|
||||
ActorCollider_AllocCylinder(globalCtx, &thisLocal->collider);
|
||||
func_8005C450(globalCtx, &thisLocal->collider, &this->actor, &D_80AF40E0);
|
||||
Collider_InitCylinder(globalCtx, &thisLocal->collider);
|
||||
Collider_SetCylinder_Set3(globalCtx, &thisLocal->collider, &this->actor, &colliderInit);
|
||||
}
|
||||
|
||||
void func_80AF259C(EnRu2* this, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
ColliderCylinderMain* collider = &this->collider;
|
||||
ColliderCylinder* collider = &this->collider;
|
||||
Actor* thisx = &this->actor;
|
||||
s32 pad2[2];
|
||||
|
||||
ActorCollider_Cylinder_Update(thisx, collider);
|
||||
Actor_CollisionCheck_SetAC(globalCtx, &globalCtx->sub_11E60, collider);
|
||||
Collider_CylinderUpdate(thisx, collider);
|
||||
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, collider);
|
||||
}
|
||||
|
||||
void EnRu2_Destroy(EnRu2* this, GlobalContext* globalCtx) {
|
||||
ColliderCylinderMain* collider = &this->collider;
|
||||
ActorCollider_FreeCylinder(globalCtx, collider);
|
||||
ColliderCylinder* collider = &this->collider;
|
||||
Collider_DestroyCylinder(globalCtx, collider);
|
||||
}
|
||||
|
||||
void func_80AF2608(EnRu2* this) {
|
||||
|
|
|
@ -21,7 +21,7 @@ typedef struct {
|
|||
/* 0x02C2 */ u8 unk_2C2;
|
||||
/* 0x02C3 */ u8 unk_2C3;
|
||||
/* 0x02C4 */ f32 unk_2C4;
|
||||
/* 0x02C8 */ ColliderCylinderMain collider;
|
||||
/* 0x02C8 */ ColliderCylinder collider;
|
||||
} EnRu2; // size = 0x0314
|
||||
|
||||
extern const ActorInit En_Ru2_InitVars;
|
||||
|
|
|
@ -169,12 +169,12 @@ s32 EnTkEff_CreateDflt(EnTk* this, Vec3f* pos, u8 duration, f32 size, f32 growth
|
|||
/** z_en_tk_eff.c ends here probably **/
|
||||
|
||||
static ColliderCylinderInit D_80B1D508 = {
|
||||
0x0A, 0x00, 0x00, 0x39, 0x20, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00000000, 0x00, 0x00, 0x00, 0x00, 0x00000000, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x01, 0x00, 0x001E, 0x0034, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
{ 0x0A, 0x00, 0x00, 0x39, 0x20, 0x01 },
|
||||
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 },
|
||||
{ 0x001E, 0x0034, 0x0000, { 0 } },
|
||||
};
|
||||
|
||||
static Sub98Init5 D_80B1D534 = {
|
||||
static CollisionCheckInfoInit2 colChkInfoInit = {
|
||||
0x00, 0x0000, 0x0000, 0x0000, 0xFF,
|
||||
};
|
||||
|
||||
|
@ -502,10 +502,10 @@ void EnTk_Init(EnTk* this, GlobalContext* globalCtx) {
|
|||
SkelAnime_ChangeAnim(&thisAgain->skelAnim, anim, 1.f, 0.f, SkelAnime_GetFrameCount(&D_06002F84.genericHeader), 0,
|
||||
0.f);
|
||||
|
||||
ActorCollider_AllocCylinder(globalCtx, &thisAgain->collider);
|
||||
ActorCollider_InitCylinder(globalCtx, &thisAgain->collider, &thisAgain->actor, &D_80B1D508);
|
||||
Collider_InitCylinder(globalCtx, &thisAgain->collider);
|
||||
Collider_SetCylinder(globalCtx, &thisAgain->collider, &thisAgain->actor, &D_80B1D508);
|
||||
|
||||
func_80061EFC(&thisAgain->actor.sub_98, NULL, &D_80B1D534);
|
||||
func_80061EFC(&thisAgain->actor.colChkInfo, NULL, &colChkInfoInit);
|
||||
|
||||
if (gSaveContext.dayTime <= 0xC000 || gSaveContext.dayTime >= 0xE000 || !LINK_IS_CHILD ||
|
||||
globalCtx->sceneNum != SCENE_SPOT02) {
|
||||
|
@ -524,7 +524,7 @@ void EnTk_Init(EnTk* this, GlobalContext* globalCtx) {
|
|||
|
||||
void EnTk_Destroy(EnTk* this, GlobalContext* globalCtx) {
|
||||
EnTk* thisAgain = this;
|
||||
ActorCollider_FreeCylinder(globalCtx, &thisAgain->collider);
|
||||
Collider_DestroyCylinder(globalCtx, &thisAgain->collider);
|
||||
}
|
||||
|
||||
void EnTk_Rest(EnTk* this, GlobalContext* globalCtx) {
|
||||
|
@ -672,10 +672,10 @@ void EnTk_Dig(EnTk* this, GlobalContext* globalCtx) {
|
|||
|
||||
void EnTk_Update(EnTk* this, GlobalContext* globalCtx) {
|
||||
EnTk* thisAgain = this;
|
||||
ColliderCylinderMain* collider = &thisAgain->collider;
|
||||
ColliderCylinder* collider = &thisAgain->collider;
|
||||
|
||||
ActorCollider_Cylinder_Update(&thisAgain->actor, collider);
|
||||
Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, collider);
|
||||
Collider_CylinderUpdate(&thisAgain->actor, collider);
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, collider);
|
||||
|
||||
SkelAnime_FrameUpdateMatrix(&thisAgain->skelAnim);
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ struct EnTk {
|
|||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ SkelAnime skelAnim;
|
||||
/* 0x0190 */ EnTkFunc* actionFunc;
|
||||
/* 0x0194 */ ColliderCylinderMain collider;
|
||||
/* 0x0194 */ ColliderCylinder collider;
|
||||
/* 0x01E0 */ s16 h_1E0;
|
||||
/* 0x01E2 */ char unk_1E2[0x26];
|
||||
/* 0x0208 */ u8 validDigHere;
|
||||
|
|
|
@ -19,9 +19,9 @@ void EnTuboTrap_Fly(EnTuboTrap* this, GlobalContext* globalCtx);
|
|||
#define FLAGS 0x00000010
|
||||
|
||||
static ColliderCylinderInit cylinderInitData = {
|
||||
0x0A, 0x11, 0x09, 0x00, 0x20, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0xFFCFFFFF, 0x00, 0x04, 0x00, 0x00, 0xFFCFFFFF, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x01, 0x00, 0x00, 0x0009, 0x0017, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
{ COLTYPE_UNK10, 0x11, 0x09, 0x00, 0x20, COLSHAPE_CYLINDER },
|
||||
{ 0x00, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x01, 0x01, 0x00 },
|
||||
{ 9, 23, 0, { 0 } },
|
||||
};
|
||||
|
||||
const ActorInit En_Tubo_Trap_InitVars = {
|
||||
|
@ -44,15 +44,15 @@ void EnTuboTrap_Init(EnTuboTrap* this, GlobalContext* globalCtx) {
|
|||
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 2.0f);
|
||||
osSyncPrintf("\n\n");
|
||||
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 壷トラップ ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); // "Urn Trap"
|
||||
ActorCollider_AllocCylinder(globalCtx, &this->collider);
|
||||
ActorCollider_InitCylinder(globalCtx, &this->collider, &this->actor, &cylinderInitData);
|
||||
Collider_InitCylinder(globalCtx, &this->collider);
|
||||
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInitData);
|
||||
Actor_SetScale(&this->actor, 0.1f);
|
||||
this->actionFunc = (ActorFunc)EnTuboTrap_WaitForProximity;
|
||||
}
|
||||
|
||||
void EnTuboTrap_Destroy(EnTuboTrap* this, GlobalContext* globalCtx) {
|
||||
ColliderCylinderMain* collider = &this->collider;
|
||||
ActorCollider_FreeCylinder(globalCtx, collider);
|
||||
ColliderCylinder* collider = &this->collider;
|
||||
Collider_DestroyCylinder(globalCtx, collider);
|
||||
}
|
||||
|
||||
void EnTuboTrap_DropCollectible(EnTuboTrap* this, GlobalContext* globalCtx) {
|
||||
|
@ -179,8 +179,8 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, GlobalContext* globalCtx) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (this->collider.base.colliderFlags & 4) {
|
||||
this->collider.base.colliderFlags &= ~4;
|
||||
if (this->collider.base.atFlags & 4) {
|
||||
this->collider.base.atFlags &= ~4;
|
||||
EnTuboTrap_SpawnFragments(this, globalCtx);
|
||||
Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_IT_SHIELD_REFLECT_SW);
|
||||
Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_POT_BROKEN);
|
||||
|
@ -189,8 +189,8 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, GlobalContext* globalCtx) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (this->collider.base.collideFlags & 2) {
|
||||
this->collider.base.collideFlags &= ~2;
|
||||
if (this->collider.base.acFlags & 2) {
|
||||
this->collider.base.acFlags &= ~2;
|
||||
EnTuboTrap_SpawnFragments(this, globalCtx);
|
||||
Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_EXPLOSION);
|
||||
Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_POT_BROKEN);
|
||||
|
@ -199,8 +199,8 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, GlobalContext* globalCtx) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (this->collider.base.colliderFlags & 2) {
|
||||
this->collider.base.colliderFlags &= ~2;
|
||||
if (this->collider.base.atFlags & 2) {
|
||||
this->collider.base.atFlags &= ~2;
|
||||
if (this->collider.base.at == &player->actor) {
|
||||
EnTuboTrap_SpawnFragments(this, globalCtx);
|
||||
Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_POT_BROKEN);
|
||||
|
@ -277,15 +277,15 @@ void EnTuboTrap_Fly(EnTuboTrap* this, GlobalContext* globalCtx) {
|
|||
|
||||
void EnTuboTrap_Update(EnTuboTrap* this, GlobalContext* globalCtx) {
|
||||
EnTuboTrap* tuboTrap = this;
|
||||
SubGlobalContext11E60* sub_11E60 = &globalCtx->sub_11E60;
|
||||
CollisionCheckContext* check = &globalCtx->colChkCtx;
|
||||
|
||||
tuboTrap->actionFunc(tuboTrap, globalCtx);
|
||||
Actor_MoveForward(&tuboTrap->actor);
|
||||
func_8002E4B4(globalCtx, &tuboTrap->actor, 10.0f, 10.0f, 20.0f, 0x1D);
|
||||
Actor_SetHeight(&tuboTrap->actor, 0.0f);
|
||||
ActorCollider_Cylinder_Update(&tuboTrap->actor, &tuboTrap->collider);
|
||||
Actor_CollisionCheck_SetAC(globalCtx, sub_11E60, &tuboTrap->collider);
|
||||
Actor_CollisionCheck_SetAT(globalCtx, sub_11E60, &tuboTrap->collider);
|
||||
Collider_CylinderUpdate(&tuboTrap->actor, &tuboTrap->collider);
|
||||
CollisionCheck_SetAC(globalCtx, check, &tuboTrap->collider);
|
||||
CollisionCheck_SetAT(globalCtx, check, &tuboTrap->collider);
|
||||
}
|
||||
|
||||
void EnTuboTrap_Draw(EnTuboTrap* this, GlobalContext* globalCtx) {
|
||||
|
|
|
@ -9,7 +9,7 @@ typedef struct {
|
|||
/* 0x014C */ ActorFunc actionFunc;
|
||||
/* 0x0150 */ f32 targetY;
|
||||
/* 0x0154 */ Vec3f originPos;
|
||||
/* 0x0160 */ ColliderCylinderMain collider;
|
||||
/* 0x0160 */ ColliderCylinder collider;
|
||||
} EnTuboTrap; // size = 0x01AC
|
||||
|
||||
extern const ActorInit En_Tubo_Trap_InitVars;
|
||||
|
|
|
@ -50,24 +50,22 @@ const ActorInit En_Wallmas_InitVars = {
|
|||
};
|
||||
|
||||
static ColliderCylinderInit colCylinderInit = {
|
||||
0x00, 0x00, 0x09, 0x39, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00000000, 0x00, 0x00, 0x00, 0x00, 0xFFCFFFFF, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x01, 0x01, 0x00, 0x001E, 0x0028, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
{ COLTYPE_UNK0, 0x00, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER },
|
||||
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 },
|
||||
{ 30, 40, 0, { 0 } },
|
||||
};
|
||||
|
||||
static Sub98Init4 sub98Init = {
|
||||
static CollisionCheckInfoInit colChkInfoInit = {
|
||||
0x04,
|
||||
0x001E,
|
||||
0x0028,
|
||||
0x96,
|
||||
};
|
||||
|
||||
static ActorDamageChart damageChart = { {
|
||||
{ 0x1, 0x0 }, { 0x0, 0x2 }, { 0x0, 0x1 }, { 0x0, 0x2 }, { 0x1, 0x0 }, { 0x0, 0x2 }, { 0x0, 0x2 }, { 0x1, 0x0 },
|
||||
{ 0x0, 0x1 }, { 0x0, 0x2 }, { 0x0, 0x4 }, { 0x2, 0x4 }, { 0x0, 0x2 }, { 0x4, 0x4 }, { 0x0, 0x4 }, { 0x0, 0x2 },
|
||||
{ 0x0, 0x2 }, { 0x2, 0x4 }, { 0x0, 0x0 }, { 0x4, 0x4 }, { 0x0, 0x0 }, { 0x0, 0x0 }, { 0x0, 0x1 }, { 0x0, 0x4 },
|
||||
{ 0x0, 0x2 }, { 0x0, 0x2 }, { 0x0, 0x8 }, { 0x0, 0x4 }, { 0x0, 0x0 }, { 0x0, 0x0 }, { 0x0, 0x4 }, { 0x0, 0x0 },
|
||||
} };
|
||||
static DamageTable damageTable = {
|
||||
0x10, 0x02, 0x01, 0x02, 0x10, 0x02, 0x02, 0x10, 0x01, 0x02, 0x04, 0x24, 0x02, 0x44, 0x04, 0x02,
|
||||
0x02, 0x24, 0x00, 0x44, 0x00, 0x00, 0x01, 0x04, 0x02, 0x02, 0x08, 0x04, 0x00, 0x00, 0x04, 0x00,
|
||||
};
|
||||
|
||||
static InitChainEntry initChain[] = {
|
||||
ICHAIN_S8(naviEnemyId, 0x30, 1),
|
||||
|
@ -97,9 +95,9 @@ void EnWallmas_Init(EnWallmas* this, GlobalContext* globalCtx) {
|
|||
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06008FB0, &D_06009DB0, &this->unkSkelAnimeStruct, &this->unk_22e,
|
||||
0x19);
|
||||
|
||||
ActorCollider_AllocCylinder(globalCtx, &this->colCylinder);
|
||||
ActorCollider_InitCylinder(globalCtx, &this->colCylinder, &this->actor, &colCylinderInit);
|
||||
func_80061ED4(&this->actor.sub_98, &damageChart, &sub98Init);
|
||||
Collider_InitCylinder(globalCtx, &this->colCylinder);
|
||||
Collider_SetCylinder(globalCtx, &this->colCylinder, &this->actor, &colCylinderInit);
|
||||
func_80061ED4(&this->actor.colChkInfo, &damageTable, &colChkInfoInit);
|
||||
this2->switchFlag = (u8)(this2->actor.params >> 0x8);
|
||||
this->actor.params = this->actor.params & 0xFF;
|
||||
|
||||
|
@ -118,8 +116,8 @@ void EnWallmas_Init(EnWallmas* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnWallmas_Destroy(EnWallmas* this, GlobalContext* globalCtx) {
|
||||
ColliderCylinderMain* col = &this->colCylinder;
|
||||
ActorCollider_FreeCylinder(globalCtx, col);
|
||||
ColliderCylinder* col = &this->colCylinder;
|
||||
Collider_DestroyCylinder(globalCtx, col);
|
||||
}
|
||||
|
||||
void EnWallmas_TimerInit(EnWallmas* this, GlobalContext* globalCtx) {
|
||||
|
@ -194,7 +192,7 @@ void EnWallmas_ReturnToCeilingStart(EnWallmas* this) {
|
|||
|
||||
void EnWallmas_TakeDamageStart(EnWallmas* this) {
|
||||
SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06000590, -3.0f);
|
||||
if ((this->colCylinder.body.colliding->toucher.flags & 0x1F824) != 0) {
|
||||
if ((this->colCylinder.body.acHitItem->toucher.flags & 0x1F824) != 0) {
|
||||
this->actor.posRot.rot.y = this->colCylinder.base.ac->posRot.rot.y;
|
||||
} else {
|
||||
this->actor.posRot.rot.y = func_8002DA78(&this->actor, this->colCylinder.base.ac) + 0x8000;
|
||||
|
@ -252,7 +250,7 @@ void EnWallmas_StunBegin(EnWallmas* this) {
|
|||
SkelAnime_ChangeAnim(&this->skelAnime, &D_060019CC, 1.5f, 0, 20.0f, 2, -3.0f);
|
||||
|
||||
this->actor.speedXZ = 0.0f;
|
||||
if (this->actor.sub_98.damageEffect == 4) {
|
||||
if (this->actor.colChkInfo.damageEffect == 4) {
|
||||
func_8003426C(&this->actor, -0x8000, 0xFF, 0, 0x50);
|
||||
} else {
|
||||
func_8003426C(&this->actor, 0, 0xFF, 0, 0x50);
|
||||
|
@ -365,7 +363,7 @@ void EnWallmas_ReturnToCeiling(EnWallmas* this, GlobalContext* globalCtx) {
|
|||
|
||||
void EnWallmas_TakeDamage(EnWallmas* this, GlobalContext* globalCtx) {
|
||||
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) {
|
||||
if (this->actor.sub_98.health == 0) {
|
||||
if (this->actor.colChkInfo.health == 0) {
|
||||
EnWallMas_DieBegin(this, globalCtx);
|
||||
} else {
|
||||
EnWallmas_DamageCoolDownStart(this);
|
||||
|
@ -469,7 +467,7 @@ void EnWallmas_Stun(EnWallmas* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
if (this->timer == 0) {
|
||||
if (this->actor.sub_98.health == 0) {
|
||||
if (this->actor.colChkInfo.health == 0) {
|
||||
EnWallMas_DieBegin(this, globalCtx);
|
||||
} else {
|
||||
EnWallmas_ReturnToCeilingStart(this);
|
||||
|
@ -478,27 +476,27 @@ void EnWallmas_Stun(EnWallmas* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnWallmas_ColUpdate(EnWallmas* this, GlobalContext* globalCtx) {
|
||||
if ((this->colCylinder.base.collideFlags & 2) != 0) {
|
||||
this->colCylinder.base.collideFlags &= ~2;
|
||||
if ((this->colCylinder.base.acFlags & 2) != 0) {
|
||||
this->colCylinder.base.acFlags &= ~2;
|
||||
func_80035650(&this->actor, &this->colCylinder.body, 1);
|
||||
if ((this->actor.sub_98.damageEffect != 0) || (this->actor.sub_98.damage != 0)) {
|
||||
if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) {
|
||||
if (Actor_ApplyDamage(&this->actor) == 0) {
|
||||
func_80032C7C(globalCtx, &this->actor);
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_DEAD);
|
||||
this->actor.flags &= ~1;
|
||||
} else {
|
||||
if (this->actor.sub_98.damage != 0) {
|
||||
if (this->actor.colChkInfo.damage != 0) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_DAMAGE);
|
||||
}
|
||||
}
|
||||
|
||||
if ((this->actor.sub_98.damageEffect == DAMAGE_EFFECT_STUN_WHITE) ||
|
||||
(this->actor.sub_98.damageEffect == DAMAGE_EFFECT_STUN_BLUE)) {
|
||||
if ((this->actor.colChkInfo.damageEffect == DAMAGE_EFFECT_STUN_WHITE) ||
|
||||
(this->actor.colChkInfo.damageEffect == DAMAGE_EFFECT_STUN_BLUE)) {
|
||||
if (this->actionFunc != (ActorFunc)&EnWallmas_Stun) {
|
||||
EnWallmas_StunBegin(this);
|
||||
}
|
||||
} else {
|
||||
if (this->actor.sub_98.damageEffect == DAMAGE_EFFECT_BURN) {
|
||||
if (this->actor.colChkInfo.damageEffect == DAMAGE_EFFECT_BURN) {
|
||||
func_8002A65C(globalCtx, &this->actor, &this->actor.posRot.pos, 0x28, 0x28);
|
||||
}
|
||||
|
||||
|
@ -536,12 +534,12 @@ void EnWallmas_Update(EnWallmas* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
if ((this2->actionFunc != (ActorFunc)&EnWallmas_Die) && (this2->actionFunc != (ActorFunc)&EnWallmas_Drop)) {
|
||||
ActorCollider_Cylinder_Update(&this2->actor, &this2->colCylinder);
|
||||
Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, &this2->colCylinder);
|
||||
Collider_CylinderUpdate(&this2->actor, &this2->colCylinder);
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this2->colCylinder);
|
||||
|
||||
if ((this2->actionFunc != (ActorFunc)&EnWallmas_TakeDamage) && (this2->actor.bgCheckFlags & 1) != 0 &&
|
||||
(this2->actor.freeze == 0)) {
|
||||
Actor_CollisionCheck_SetAC(globalCtx, &globalCtx->sub_11E60, &this2->colCylinder);
|
||||
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this2->colCylinder);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ typedef struct {
|
|||
/* 0x022E */ u16 unk_22e;
|
||||
/* 0x0230 */ char unk_230[0x94];
|
||||
/* 0x02C4 */ f32 unk_2c4;
|
||||
/* 0x02C8 */ ColliderCylinderMain colCylinder;
|
||||
/* 0x02C8 */ ColliderCylinder colCylinder;
|
||||
} EnWallmas; // size = 0x0314
|
||||
|
||||
extern const ActorInit En_Wallmas_InitVars;
|
||||
|
|
|
@ -29,14 +29,16 @@ const ActorInit Obj_Bombiwa_InitVars = {
|
|||
};
|
||||
|
||||
static ColliderCylinderInit colliderInit = {
|
||||
0x0C, 0x00, 0x0D, 0x39, 0x20, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00000000, 0x00, 0x00, 0x00, 0x00, 0x4FC1FFFE, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x01, 0x01, 0x00, 0x0037, 0x0046, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
{ COLTYPE_UNK12, 0x00, 0x0D, 0x39, 0x20, COLSHAPE_CYLINDER },
|
||||
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x4FC1FFFE, 0x00, 0x00 }, 0x00, 0x01, 0x01 },
|
||||
{ 55, 70, 0, { 0 } },
|
||||
};
|
||||
|
||||
static u32 damageChart[] = {
|
||||
0x0000000C,
|
||||
0x003CFF00,
|
||||
static CollisionCheckInfoInit colChkInfoInit = {
|
||||
0x00,
|
||||
0x000C,
|
||||
0x003C,
|
||||
0xFF,
|
||||
};
|
||||
|
||||
static InitChainEntry initChain[] = {
|
||||
|
@ -54,9 +56,9 @@ extern Gfx* D_060009E0; // dlist
|
|||
|
||||
void ObjBombiwa_InitCollision(ObjBombiwa* this, GlobalContext* globalCtx) {
|
||||
ObjBombiwa* thisLocal = this;
|
||||
ActorCollider_AllocCylinder(globalCtx, &thisLocal->collider);
|
||||
ActorCollider_InitCylinder(globalCtx, &thisLocal->collider, &thisLocal->actor, &colliderInit);
|
||||
ActorCollider_Cylinder_Update(&thisLocal->actor, &thisLocal->collider);
|
||||
Collider_InitCylinder(globalCtx, &thisLocal->collider);
|
||||
Collider_SetCylinder(globalCtx, &thisLocal->collider, &thisLocal->actor, &colliderInit);
|
||||
Collider_CylinderUpdate(&thisLocal->actor, &thisLocal->collider);
|
||||
}
|
||||
|
||||
void ObjBombiwa_Init(ObjBombiwa* this, GlobalContext* globalCtx) {
|
||||
|
@ -65,7 +67,7 @@ void ObjBombiwa_Init(ObjBombiwa* this, GlobalContext* globalCtx) {
|
|||
if ((Flags_GetSwitch(globalCtx, this->actor.params & 0x3F) != 0)) {
|
||||
Actor_Kill(&this->actor);
|
||||
} else {
|
||||
func_80061ED4(&this->actor.sub_98.damageChart, NULL, damageChart);
|
||||
func_80061ED4(&this->actor.colChkInfo, NULL, &colChkInfoInit);
|
||||
if (this->actor.shape.rot.y == 0) {
|
||||
s16 rand = (s16)Math_Rand_ZeroFloat(65536.0f);
|
||||
this->actor.posRot.rot.y = rand;
|
||||
|
@ -77,7 +79,7 @@ void ObjBombiwa_Init(ObjBombiwa* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void ObjBombiwa_Destroy(ObjBombiwa* this, GlobalContext* globalCtx) {
|
||||
ActorCollider_FreeCylinder(globalCtx, &this->collider);
|
||||
Collider_DestroyCylinder(globalCtx, &this->collider);
|
||||
}
|
||||
|
||||
void ObjBombiwa_Break(ObjBombiwa* this, GlobalContext* globalCtx) {
|
||||
|
@ -105,12 +107,11 @@ void ObjBombiwa_Break(ObjBombiwa* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void ObjBombiwa_Update(ObjBombiwa* this, GlobalContext* globalCtx) {
|
||||
SubGlobalContext11E60* sub_11E60;
|
||||
ColliderCylinderMain* collider;
|
||||
CollisionCheckContext* colChkCtx;
|
||||
ColliderCylinder* collider;
|
||||
|
||||
if (func_80033684(globalCtx, &this->actor) != NULL ||
|
||||
((this->collider.base.collideFlags & 2) != 0 &&
|
||||
(this->collider.body.colliding->toucher.flags & 0x40000040) != 0)) {
|
||||
((this->collider.base.acFlags & 2) != 0 && (this->collider.body.acHitItem->toucher.flags & 0x40000040) != 0)) {
|
||||
ObjBombiwa_Break(this, globalCtx);
|
||||
Flags_SetSwitch(globalCtx, this->actor.params & 0x3F);
|
||||
Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 80, NA_SE_EV_WALL_BROKEN);
|
||||
|
@ -119,12 +120,12 @@ void ObjBombiwa_Update(ObjBombiwa* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
Actor_Kill(&this->actor);
|
||||
} else {
|
||||
this->collider.base.collideFlags &= ~0x2;
|
||||
this->collider.base.acFlags &= ~0x2;
|
||||
if (this->actor.xzDistanceFromLink < 800.0f) {
|
||||
sub_11E60 = &globalCtx->sub_11E60;
|
||||
colChkCtx = &globalCtx->colChkCtx;
|
||||
collider = &this->collider;
|
||||
Actor_CollisionCheck_SetAC(globalCtx, sub_11E60, collider);
|
||||
Actor_CollisionCheck_SetOT(globalCtx, sub_11E60, collider);
|
||||
CollisionCheck_SetAC(globalCtx, colChkCtx, collider);
|
||||
CollisionCheck_SetOC(globalCtx, colChkCtx, collider);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
typedef struct {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ ColliderCylinderMain collider;
|
||||
/* 0x014C */ ColliderCylinder collider;
|
||||
} ObjBombiwa; // size = 0x0198
|
||||
|
||||
extern const ActorInit Obj_Bombiwa_InitVars;
|
||||
|
|
|
@ -30,15 +30,17 @@ const ActorInit Obj_Comb_InitVars = {
|
|||
(ActorFunc)ObjComb_Draw,
|
||||
};
|
||||
|
||||
UNK_TYPE D_80B922E0[] = {
|
||||
0x00000000, 0x00000000, 0x00000000, 0x4001FFFE, 0x00000000, 0x00010100, 0x00000000, 0x00000000, 0x000F0064,
|
||||
ColliderJntSphItemInit colliderItemsInit[1] = {
|
||||
{
|
||||
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x4001FFFE, 0x00, 0x00 }, 0x00, 0x01, 0x01 },
|
||||
{ 0x00, { { 0, 0, 0 }, 15 }, 100 },
|
||||
},
|
||||
};
|
||||
|
||||
UNK_TYPE D_80B92304[] = {
|
||||
0x0A000909,
|
||||
0x20000000,
|
||||
0x00000001,
|
||||
&D_80B922E0,
|
||||
ColliderJntSphInit colliderInit = {
|
||||
{ COLTYPE_UNK10, 0x00, 0x09, 0x09, 0x20, COLSHAPE_JNTSPH },
|
||||
1,
|
||||
&colliderItemsInit,
|
||||
};
|
||||
|
||||
static InitChainEntry initChain[] = {
|
||||
|
@ -132,13 +134,13 @@ void ObjComb_Init(ObjComb* this, GlobalContext* globalCtx) {
|
|||
s32 pad;
|
||||
|
||||
Actor_ProcessInitChain(&this->actor, &initChain);
|
||||
func_8005BBF8(globalCtx, &this->collider);
|
||||
func_8005C050(globalCtx, &this->collider, this, &D_80B92304, &this->colliderBody);
|
||||
Collider_InitJntSph(globalCtx, &this->collider);
|
||||
Collider_SetJntSph(globalCtx, &this->collider, this, &colliderInit, &this->colliderItems);
|
||||
ObjComb_SetWait(this);
|
||||
}
|
||||
|
||||
void ObjComb_Destroy(ObjComb* this, GlobalContext* globalCtx) {
|
||||
func_8005BCC8(globalCtx, &this->collider);
|
||||
Collider_DestroyJntSph(globalCtx, &this->collider);
|
||||
}
|
||||
|
||||
void ObjComb_SetWait(ObjComb* this) {
|
||||
|
@ -153,9 +155,9 @@ void ObjComb_Wait(ObjComb* this, GlobalContext* globalCtx) {
|
|||
this->unk_1B0 = 0;
|
||||
}
|
||||
|
||||
if ((this->collider.collideFlags & 0x2) != 0) {
|
||||
this->collider.collideFlags &= ~0x2;
|
||||
toucherFlags = this->colliderBodyPtr->colliding->toucher.flags;
|
||||
if ((this->collider.base.acFlags & 0x2) != 0) {
|
||||
this->collider.base.acFlags &= ~0x2;
|
||||
toucherFlags = this->collider.list->body.acHitItem->toucher.flags;
|
||||
if (toucherFlags & 0x4001F866) {
|
||||
this->unk_1B0 = 1500;
|
||||
} else {
|
||||
|
@ -164,11 +166,11 @@ void ObjComb_Wait(ObjComb* this, GlobalContext* globalCtx) {
|
|||
Actor_Kill(this);
|
||||
}
|
||||
} else {
|
||||
Actor_CollisionCheck_SetAC(globalCtx, &globalCtx->sub_11E60, &this->collider);
|
||||
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider);
|
||||
}
|
||||
|
||||
if (this->actor.update != NULL) {
|
||||
Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, &this->collider);
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,11 +7,8 @@
|
|||
typedef struct {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ ActorFunc actionFunc;
|
||||
/* 0x0150 */ Collider collider;
|
||||
/* 0x0168 */ char unk_168[0x4];
|
||||
/* 0x016C */ ColliderBody* colliderBodyPtr;
|
||||
/* 0x0170 */ ColliderBody colliderBody;
|
||||
/* 0x0198 */ char unk_198[0x18];
|
||||
/* 0x0150 */ ColliderJntSph collider;
|
||||
/* 0x0170 */ ColliderJntSphItem colliderItems[1];
|
||||
/* 0x01B0 */ s16 unk_1B0;
|
||||
/* 0x01B2 */ s16 unk_1B2;
|
||||
} ObjComb; // size = 0x01B4
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue