Document Collision_Check (#468)

* Darkmeiro decompilation

Bg_Gnd_Darkmeiro decompiled, matched, and documented.

* give this a shot

* fix conflict

* one more try

* could be useful

* whoops

* some decomp

* still playing around with this

* rename functions

* ZAP again

* ZAP again

* the renaming begins

* more renaming. hopefully didn't break anything

* change all the things

* this and then merge

* and done

* one little thing

* small docs, small rename

* changed mind on cylinder and quad elements

* something

* more stuff

* more docs

* more adjustments

* Fixed some types

* more fixes

* all sorts of cleanup

* now with flags

* match!

* names and such

* update tools

* damage tables

* ColChkInfo

* one more thing

* formatting

* more formatting

* anime merge

* some stuff

* damage table

* again

* changes

* .s

* changes

* oc2 type

* a couple things

* format

* un-name magic arrows, not enough proof yet

* fix damage table script and remove old one

* EnAObj

* changes

Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain>
Co-authored-by: Fig02 <fig02srl@gmail.com>
This commit is contained in:
petrie911
2021-01-17 20:13:36 -06:00
committed by GitHub
parent f786f958bb
commit 02994f5339
487 changed files with 14371 additions and 4713 deletions
+67 -119
View File
@@ -517,7 +517,7 @@ void func_8003555C(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, Vec3f* ar
void func_800355B8(GlobalContext* globalCtx, Vec3f* arg1);
u8 func_800355E4(GlobalContext* globalCtx, Collider* collider);
u8 Actor_ApplyDamage(Actor* actor);
void func_80035650(Actor* actor, ColliderBody* colBody, s32 freezeFlag);
void func_80035650(Actor* actor, ColliderInfo* colBody, s32 freezeFlag);
void func_8003573C(Actor* actor, ColliderJntSph* colBody, s32 freezeFlag);
void func_80035844(Vec3f* arg0, Vec3f* arg1, s16* arg2, s32 arg3);
void func_800359B8(Actor* actor, s16 arg1, Vec3s* arg2);
@@ -742,99 +742,59 @@ void Camera_SetCameraData(Camera* camera, s16 setDataFlags, void* data0, void* d
UNK_TYPE arg6);
s16 func_8005B1A4(Camera* camera);
DamageTable* DamageTable_Get(s32 index);
void func_8005B280(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC);
void func_8005B2AC(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC, u8 r, u8 g, u8 b);
s32 Collider_InitBase(GlobalContext* globalCtx, Collider* collider);
s32 Collider_DestroyBase(GlobalContext* globalCtx, Collider* collider);
s32 Collider_SetBase_Actor(GlobalContext* globalCtx, Collider* collider, ColliderInit_Actor* src);
s32 Collider_SetBase_Set3(GlobalContext* globalCtx, Collider* collider, Actor* actor, ColliderInit_Set3* src);
s32 Collider_SetBase(GlobalContext* globalCtx, Collider* collider, Actor* actor, ColliderInit* src);
void Collider_BaseSetAT(GlobalContext* globalCtx, Collider* collider);
void Collider_BaseSetAC(GlobalContext* globalCtx, Collider* collider);
void Collider_BaseSetOC(GlobalContext* globalCtx, Collider* collider);
s32 Collider_InitTouch(GlobalContext* globalCtx, ColliderTouch* touch);
s32 Collider_DestroyTouch(GlobalContext* globalCtx, ColliderTouch* touch);
s32 Collider_SetTouch(GlobalContext* globalCtx, ColliderTouch* dest, ColliderTouch* src);
void Collider_BodySetAT_Unk(GlobalContext* globalCtx, ColliderBody* body);
s32 Collider_InitBump(GlobalContext* globalCtx, ColliderBump* bump);
s32 Collider_DestroyBump(GlobalContext* globalCtx, ColliderBump* bump);
s32 Collider_SetBump(GlobalContext* globalCtx, ColliderBump* bump, ColliderBumpInit* init);
s32 Collider_InitBody(GlobalContext* globalCtx, ColliderBody* body);
s32 Collider_DestroyBody(GlobalContext* globalCtx, ColliderBody* body);
s32 Collider_SetBody(GlobalContext* globalCtx, ColliderBody* body, ColliderBodyInit* bodyInit);
void Collider_BodySetAT(GlobalContext* globalCtx, ColliderBody* body);
void Collider_BodySetAC(GlobalContext* globalCtx, ColliderBody* body);
void Collider_BodySetOC(GlobalContext* globalCtx, ColliderBody* body);
s32 Collider_InitJntSphItemDim(GlobalContext* globalCtx, ColliderJntSphItemDim* dim);
s32 Collider_DestroyJntSphItemDim(GlobalContext* globalCtx, ColliderJntSphItemDim* item);
s32 Collider_SetJntSphItemDim(GlobalContext* globalCtx, ColliderJntSphItemDim* dest, ColliderJntSphItemDimInit* src);
s32 Collider_InitJntSphItem(GlobalContext* globalCtx, ColliderJntSphItem* item);
s32 Collider_DestroyJntSphItem(GlobalContext* globalCtx, ColliderJntSphItem* item);
s32 Collider_SetJntSphItem(GlobalContext* globalCtx, ColliderJntSphItem* dest, ColliderJntSphItemInit* src);
s32 Collider_JntSphItemSetAT(GlobalContext* globalCtx, ColliderJntSphItem* collider);
s32 Collider_JntSphItemSetAC(GlobalContext* globalCtx, ColliderJntSphItem* collider);
s32 Collider_JntSphItemSetOC(GlobalContext* globalCtx, ColliderJntSphItem* collider);
void DamageTable_Clear(DamageTable* table);
void Collider_DrawRedPoly(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC);
void Collider_DrawPoly(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC, u8 r, u8 g, u8 b);
s32 Collider_InitJntSph(GlobalContext* globalCtx, ColliderJntSph* collider);
s32 Collider_FreeJntSph(GlobalContext* globalCtx, ColliderJntSph* collider);
s32 Collider_DestroyJntSph(GlobalContext* globalCtx, ColliderJntSph* collider);
s32 Collider_SetJntSph_Set(GlobalContext* globalCtx, ColliderJntSph* dest, ColliderJntSphInit_Actor* src);
s32 Collider_SetJntSph_Set3(GlobalContext* globalCtx, ColliderJntSph* dest, Actor* actor, ColliderJntSphInit_Set3* src);
s32 Collider_SetJntSph_Set5(GlobalContext* globalCtx, ColliderJntSph* dest, Actor* actor, ColliderJntSphInit* src);
s32 Collider_SetJntSphToActor(GlobalContext* globalCtx, ColliderJntSph* dest, ColliderJntSphInitToActor* src);
s32 Collider_SetJntSphAllocType1(GlobalContext* globalCtx, ColliderJntSph* dest, Actor* actor,
ColliderJntSphInitType1* src);
s32 Collider_SetJntSphAlloc(GlobalContext* globalCtx, ColliderJntSph* dest, Actor* actor, ColliderJntSphInit* src);
s32 Collider_SetJntSph(GlobalContext* globalCtx, ColliderJntSph* dest, Actor* actor, ColliderJntSphInit* src,
ColliderJntSphItem* list);
s32 Collider_InitCylinderDim(GlobalContext* globalCtx, Cylinder16* dim);
s32 Collider_DestroyCylinderDim(GlobalContext* globalCtx, Cylinder16* dim);
s32 Collider_SetCylinderDim(GlobalContext* globalCtx, Cylinder16* dest, Cylinder16* src);
ColliderJntSphElement* elements);
s32 Collider_ResetJntSphAT(GlobalContext* globalCtx, Collider* collider);
s32 Collider_ResetJntSphAC(GlobalContext* globalCtx, Collider* collider);
s32 Collider_ResetJntSphOC(GlobalContext* globalCtx, Collider* collider);
s32 Collider_InitCylinder(GlobalContext* globalCtx, ColliderCylinder* collider);
s32 Collider_DestroyCylinder(GlobalContext* globalCtx, ColliderCylinder* collider);
s32 Collider_SetCylinder_Actor(GlobalContext* globalCtx, ColliderCylinder* collider, ColliderCylinderInit_Actor* arg2);
s32 Collider_SetCylinder_Set3(GlobalContext* globalCtx, ColliderCylinder* collider, Actor* actor,
ColliderCylinderInit_Set3* src);
s32 Collider_SetCylinderToActor(GlobalContext* globalCtx, ColliderCylinder* collider, ColliderCylinderInitToActor* src);
s32 Collider_SetCylinderType1(GlobalContext* globalCtx, ColliderCylinder* collider, Actor* actor,
ColliderCylinderInitType1* src);
s32 Collider_SetCylinder(GlobalContext* globalCtx, ColliderCylinder* collider, Actor* actor, ColliderCylinderInit* src);
s32 Collider_CylinderSetAT(GlobalContext* globalCtx, Collider* collider);
s32 Collider_CylinderSetAC(GlobalContext* globalCtx, Collider* collider);
s32 Collider_CylinderSetOC(GlobalContext* globalCtx, Collider* collider);
s32 Collider_InitTrisItemDim(GlobalContext* globalCtx, TriNorm* dim);
s32 Collider_DestroyTrisItemDim(GlobalContext* globalCtx, TriNorm* dim);
s32 Collider_SetTrisItemDim(GlobalContext* globalCtx, TriNorm* dest, ColliderTrisItemDimInit* src);
s32 Collider_InitTrisItem(GlobalContext* globalCtx, ColliderTrisItem* collider);
s32 Collider_DestroyTrisItem(GlobalContext* globalCtx, ColliderTrisItem* collider);
s32 Collider_SetTrisItem(GlobalContext* globalCtx, ColliderTrisItem* dest, ColliderTrisItemInit* src);
s32 Collider_TrisItemSetAT(GlobalContext* globalCtx, ColliderTrisItem* item);
s32 Collider_TrisItemSetAC(GlobalContext* globalCtx, ColliderTrisItem* item);
s32 Collider_TrisItemSetOC(GlobalContext* globalCtx, ColliderTrisItem* item);
s32 Collider_ResetCylinderAT(GlobalContext* globalCtx, Collider* collider);
s32 Collider_ResetCylinderAC(GlobalContext* globalCtx, Collider* collider);
s32 Collider_ResetCylinderOC(GlobalContext* globalCtx, Collider* collider);
s32 Collider_InitTris(GlobalContext* globalCtx, ColliderTris* tris);
s32 Collider_FreeTris(GlobalContext* globalCtx, ColliderTris* tris);
s32 Collider_DestroyTris(GlobalContext* globalCtx, ColliderTris* tris);
s32 Collider_SetTris_Set3(GlobalContext* globalCtx, ColliderTris* dest, Actor* actor, ColliderTrisInit_Set3* src);
s32 Collider_SetTris_Set5(GlobalContext* globalCtx, ColliderTris* dest, Actor* actor, ColliderTrisInit* src);
s32 Collider_SetTrisAllocType1(GlobalContext* globalCtx, ColliderTris* dest, Actor* actor, ColliderTrisInitType1* src);
s32 Collider_SetTrisAlloc(GlobalContext* globalCtx, ColliderTris* dest, Actor* actor, ColliderTrisInit* src);
s32 Collider_SetTris(GlobalContext* globalCtx, ColliderTris* dest, Actor* actor, ColliderTrisInit* src,
ColliderTrisItem* list);
s32 Collider_TrisSetAT(GlobalContext* globalCtx, Collider* collider);
s32 Collider_TrisSetAC(GlobalContext* globalCtx, Collider* collider);
s32 Collider_TrisSetOC(GlobalContext* globalCtx, Collider* collider);
s32 Collider_InitQuadDim(GlobalContext* globalCtx, ColliderQuadDim* dim);
s32 Collider_DestroyQuadDim(GlobalContext* globalCtx, ColliderQuadDim* dim);
s32 func_8005CEC4(GlobalContext* globalCtx, ColliderQuadDim* dim);
void func_8005CEDC(ColliderQuadDim* dim);
s32 Collider_SetQuadDim(GlobalContext* globalCtx, ColliderQuadDim* dest, ColliderQuadDimInit* src);
ColliderTrisElement* elements);
s32 Collider_ResetTrisAT(GlobalContext* globalCtx, Collider* collider);
s32 Collider_ResetTrisAC(GlobalContext* globalCtx, Collider* collider);
s32 Collider_ResetTrisOC(GlobalContext* globalCtx, Collider* collider);
s32 Collider_InitQuad(GlobalContext* globalCtx, ColliderQuad* collider);
s32 Collider_DestroyQuad(GlobalContext* globalCtx, ColliderQuad* collider);
s32 Collider_SetQuad_Set3(GlobalContext* globalCtx, ColliderQuad* collider, Actor* actor, ColliderQuadInit_Set3* src);
s32 Collider_SetQuadType1(GlobalContext* globalCtx, ColliderQuad* collider, Actor* actor, ColliderQuadInitType1* src);
s32 Collider_SetQuad(GlobalContext* globalCtx, ColliderQuad* collider, Actor* actor, ColliderQuadInit* src);
s32 Collider_QuadSetAT(GlobalContext* globalCtx, Collider* collider);
s32 Collider_QuadSetAC(GlobalContext* globalCtx, Collider* collider);
s32 Collider_QuadSetOC(GlobalContext* globalCtx, Collider* collider);
s32 func_8005D218(GlobalContext* globalCtx, ColliderQuad* quad, Vec3f* arg2);
s32 Collider_InitOcLine(GlobalContext* globalCtx, OcLine* line);
s32 Collider_DestroyOcLine(GlobalContext* globalCtx, OcLine* line);
void func_8005D3BC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx);
void CollisionCheck_DestroyContext(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx);
s32 Collider_ResetQuadAT(GlobalContext* globalCtx, Collider* collider);
s32 Collider_ResetQuadAC(GlobalContext* globalCtx, Collider* collider);
s32 Collider_ResetQuadOC(GlobalContext* globalCtx, Collider* collider);
s32 Collider_InitLine(GlobalContext* globalCtx, OcLine* line);
s32 Collider_DestroyLine(GlobalContext* globalCtx, OcLine* line);
s32 Collider_SetLinePoints(GlobalContext* globalCtx, OcLine* ocLine, Vec3f* a, Vec3f* b);
s32 Collider_SetLine(GlobalContext* globalCtx, OcLine* dest, OcLine* src);
s32 Collider_ResetLineOC(GlobalContext* globalCtx, OcLine* line);
void CollisionCheck_InitContext(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx);
void CollisionCheck_DestroyContext(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx);
void CollisionCheck_ClearContext(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx);
void CollisionCheck_EnableSAC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx);
void CollisionCheck_DisableSAC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx);
void func_8005D4DC(GlobalContext* globalCtx, Collider* collider);
void CollisionCheck_Draw(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx);
void Collider_Draw(GlobalContext* globalCtx, Collider* collider);
void CollisionCheck_DrawCollision(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx);
s32 CollisionCheck_SetAT(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider);
s32 CollisionCheck_SetAT_SAC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider, s32 index);
s32 CollisionCheck_SetAC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider);
@@ -842,49 +802,36 @@ s32 CollisionCheck_SetAC_SAC(GlobalContext* globalCtx, CollisionCheckContext* co
s32 CollisionCheck_SetOC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider);
s32 CollisionCheck_SetOC_SAC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider, s32 index);
s32 CollisionCheck_SetOCLine(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, OcLine* collider);
// ? func_8005DF2C(?);
// ? func_8005DF50(?);
// ? func_8005DF74(?);
void func_8005DFAC(GlobalContext* globalCtx, Collider* collider, Vec3f* pos);
void func_8005E10C(GlobalContext* globalCtx, Collider* collider, Vec3f* pos);
// ? func_8005E2EC(?);
// ? func_8005E4F8(?);
// ? func_8005E604(?);
// ? func_8005E800(?);
// ? func_8005E81C(?);
// ? func_800611A0(?);
// ? func_80061274(?);
void func_8006139C(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx);
// ? func_8006146C(?);
// ? func_800614A4(?);
// ? func_80061BF4(?);
// ? func_80061C18(?);
void CollisionCheck_BlueBlood(GlobalContext* globalCtx, Collider* collider, Vec3f* v);
void CollisionCheck_AT(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx);
void CollisionCheck_OC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx);
// ? func_80061E48(?);
void func_80061E8C(CollisionCheckInfo* info);
void func_80061EB0(CollisionCheckInfo* info, CollisionCheckInfoInit* init);
void func_80061ED4(CollisionCheckInfo* info, DamageTable* damageTable, CollisionCheckInfoInit* init);
void func_80061EFC(CollisionCheckInfo* info, DamageTable* damageTable, CollisionCheckInfoInit2* init);
// ? func_80061F64(?);
// ? func_800622E4(?);
s32 CollisionCheck_GeneralLineOcCheck(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Vec3f* camera_3C,
Vec3f* arg3, Actor** arg4, s32 arg5);
s32 func_800626B0(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Vec3f* camera_3C, Vec3f* arg3,
Actor** arg4, s32 arg5);
void Collider_CylinderUpdate(Actor* actor, ColliderCylinder* collider);
void func_80062718(ColliderCylinder* collider, Vec3s* pos);
void func_80062734(ColliderQuad* collider, Vec3f* a, Vec3f* b, Vec3f* c, Vec3f* d);
void func_800627A0(ColliderTris* collider, s32 index, Vec3f* a, Vec3f* b, Vec3f* c);
void func_800628A4(s32 arg0, ColliderJntSph* collider);
void func_80062A28(GlobalContext*, Vec3f*);
void func_80062B80(GlobalContext*, Vec3f*);
void func_80062CD4(GlobalContext* globalCtx, Vec3f* v);
void func_80062D60(GlobalContext* globalCtx, Vec3f* v);
void func_80062DAC(GlobalContext* globalCtx, Vec3f* v, Vec3f* arg2);
void func_80062DF4(GlobalContext* globalCtx, Vec3f* v);
void func_80062E14(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2);
s32 func_80062ECC(f32 radius, f32 height, f32 offset, Vec3f* actorPos, Vec3f* itemPos, Vec3f* itemProjPos, Vec3f* out1,
Vec3f* out2);
void CollisionCheck_InitInfo(CollisionCheckInfo* info);
void CollisionCheck_ResetDamage(CollisionCheckInfo* info);
void CollisionCheck_SetInfoNoDamageTable(CollisionCheckInfo* info, CollisionCheckInfoInit* init);
void CollisionCheck_SetInfo(CollisionCheckInfo* info, DamageTable* damageTable, CollisionCheckInfoInit* init);
void CollisionCheck_SetInfo2(CollisionCheckInfo* info, DamageTable* damageTable, CollisionCheckInfoInit2* init);
void CollisionCheck_SetInfoGetDamageTable(CollisionCheckInfo* info, s32 index, CollisionCheckInfoInit2* init);
void CollisionCheck_Damage(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx);
s32 CollisionCheck_LineOCCheckAll(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Vec3f* a, Vec3f* b);
s32 CollisionCheck_LineOCCheck(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Vec3f* a, Vec3f* b,
Actor** exclusions, s32 numExclusions);
void Collider_UpdateCylinder(Actor* actor, ColliderCylinder* collider);
void Collider_SetCylinderPosition(ColliderCylinder* collider, Vec3s* pos);
void Collider_SetQuadVertices(ColliderQuad* collider, Vec3f* a, Vec3f* b, Vec3f* c, Vec3f* d);
void Collider_SetTrisVertices(ColliderTris* collider, s32 index, Vec3f* a, Vec3f* b, Vec3f* c);
void Collider_SetTrisDim(GlobalContext* globalCtx, ColliderTris* collider, s32 index,
ColliderTrisElementDimInit* init);
void Collider_UpdateSpheres(s32 limb, ColliderJntSph* collider);
void CollisionCheck_SpawnRedBlood(GlobalContext* globalCtx, Vec3f* v);
void CollisionCheck_SpawnWaterDroplets(GlobalContext* globalCtx, Vec3f* v);
void CollisionCheck_SpawnShieldParticles(GlobalContext* globalCtx, Vec3f* v);
void CollisionCheck_SpawnShieldParticlesMetal(GlobalContext* globalCtx, Vec3f* v);
void CollisionCheck_SpawnShieldParticlesMetalSound(GlobalContext* globalCtx, Vec3f* v, Vec3f* actorPos);
void CollisionCheck_SpawnShieldParticlesMetal2(GlobalContext* globalCtx, Vec3f* v);
void CollisionCheck_SpawnShieldParticlesWood(GlobalContext* globalCtx, Vec3f* b, Vec3f* actorPos);
s32 CollisionCheck_CylSideVsLineSeg(f32 radius, f32 height, f32 offset, Vec3f* actorPos, Vec3f* itemPos,
Vec3f* itemProjPos, Vec3f* out1, Vec3f* out2);
u8 CollisionCheck_GetSwordDamage(s32 dmgFlags);
void SaveContext_Init(void);
// ? func_800636C0(?);
void func_8006375C(s32 arg0, s32 arg1, const char* text);
@@ -934,6 +881,7 @@ void SkelCurve_Draw(Actor* actor, GlobalContext* globalCtx, SkelAnimeCurve* skel
// ? func_8006D0EC(?);
// ? func_8006D684(?);
void func_8006DC68(GlobalContext* globalCtx, Player* player);
void func_8006DD9C(Actor* actor, Vec3f* arg1, s16 arg2);
u32 Jpeg_SendTask(JpegContext* ctx);
void Jpeg_CopyToZbuffer(u16* src, u16* zbuffer, s32 x, s32 y);
u16 Jpeg_GetU16(u8* ptr);
+8 -8
View File
@@ -667,15 +667,15 @@ typedef struct {
} RoomContext; // size = 0x74
typedef struct {
/* 0x000 */ s16 colAtCount;
/* 0x000 */ s16 colATCount;
/* 0x002 */ u16 sacFlags;
/* 0x004 */ Collider* colAt[COLLISION_CHECK_AT_MAX];
/* 0x0CC */ s32 colAcCount;
/* 0x0D0 */ Collider* colAc[COLLISION_CHECK_AC_MAX];
/* 0x1C0 */ s32 colOcCount;
/* 0x1C4 */ Collider* colOc[COLLISION_CHECK_OC_MAX];
/* 0x28C */ s32 colOcLineCount;
/* 0x290 */ OcLine* colOcLine[COLLISION_CHECK_OC_LINE_MAX];
/* 0x004 */ Collider* colAT[COLLISION_CHECK_AT_MAX];
/* 0x0CC */ s32 colACCount;
/* 0x0D0 */ Collider* colAC[COLLISION_CHECK_AC_MAX];
/* 0x1C0 */ s32 colOCCount;
/* 0x1C4 */ Collider* colOC[COLLISION_CHECK_OC_MAX];
/* 0x28C */ s32 colLineCount;
/* 0x290 */ OcLine* colLine[COLLISION_CHECK_OC_LINE_MAX];
} CollisionCheckContext; // size = 0x29C
typedef struct ListAlloc {
+2
View File
@@ -9,6 +9,8 @@
#define ACTOR_NUMBER_MAX 200
#define INVISIBLE_ACTOR_MAX 20
#define AM_FIELD_SIZE 0x27A0
#define MASS_IMMOVABLE 0xFF // Cannot be pushed by OC collisions
#define MASS_HEAVY 0xFE // Can only be pushed by OC collisions with IMMOVABLE and HEAVY objects.
struct Actor;
// From z64.h
+260 -123
View File
@@ -9,245 +9,382 @@
// From z64.h
struct Actor;
typedef enum {
COLTYPE_UNK0,
COLTYPE_UNK1,
COLTYPE_UNK2,
COLTYPE_UNK3,
COLTYPE_UNK4,
COLTYPE_UNK5,
COLTYPE_UNK6,
COLTYPE_UNK7,
COLTYPE_UNK8,
COLTYPE_METAL_SHIELD,
COLTYPE_UNK10,
COLTYPE_WOODEN_SHIELD,
COLTYPE_UNK12,
COLTYPE_UNK13
} ColliderType;
typedef enum {
COLSHAPE_JNTSPH,
COLSHAPE_CYLINDER,
COLSHAPE_TRIS,
COLSHAPE_QUAD,
COLSHAPE_INVALID
} ColliderShape;
typedef struct {
/* 0x00 */ struct Actor* actor;
/* 0x04 */ struct Actor* at;
/* 0x08 */ struct Actor* ac;
/* 0x0C */ struct Actor* oc;
/* 0x10 */ u8 atFlags; // Compared to acFlags
/* 0x11 */ u8 acFlags; // Compared to atFlags
/* 0x12 */ u8 maskA; // Bitwise-and compared to maskB
/* 0x13 */ u8 maskB; // Bitwise-and compared to maskA
/* 0x14 */ u8 type;
/* 0x15 */ u8 shape; // ColliderShape
/* 0x00 */ struct Actor* actor; // Attached actor
/* 0x04 */ struct Actor* at; // Actor attached to what it collided with as an AT collider.
/* 0x08 */ struct Actor* ac; // Actor attached to what it collided with as an AC collider.
/* 0x0C */ struct Actor* oc; // Actor attached to what it collided with as an OC collider.
/* 0x10 */ u8 atFlags; // Information flags for AT collisions.
/* 0x11 */ u8 acFlags; // Information flags for AC collisions.
/* 0x12 */ u8 ocFlags1; // Information flags for OC collisions.
/* 0x13 */ u8 ocFlags2; // Flags related to which colliders it can OC collide with.
/* 0x14 */ u8 colType; // Determines hitmarks and sound effects during AC collisions.
/* 0x15 */ u8 shape; // JntSph, Cylinder, Tris, or Quad
} Collider; // size = 0x18
typedef struct {
/* 0x00 */ u8 type;
/* 0x01 */ u8 atFlags;
/* 0x02 */ u8 acFlags;
/* 0x03 */ u8 maskA; // Bitwise-And with maskB
/* 0x04 */ u8 maskB; // Bitwise-And with maskA
/* 0x05 */ u8 shape; // ColliderShape
/* 0x00 */ u8 colType; // Determines hitmarks and sound effects during AC collisions.
/* 0x01 */ u8 atFlags; // Information flags for AT collisions.
/* 0x02 */ u8 acFlags; // Information flags for OC collisions.
/* 0x03 */ u8 ocFlags1; // Information flags for OC collisions.
/* 0x04 */ u8 ocFlags2; // Flags related to which colliders it can OC collide with.
/* 0x05 */ u8 shape; // JntSph, Cylinder, Tris, or Quad
} ColliderInit; // size = 0x06
typedef struct {
/* 0x00 */ u8 type;
/* 0x01 */ u8 atFlags;
/* 0x02 */ u8 acFlags;
/* 0x03 */ u8 maskA; // Bitwise-And with maskB
/* 0x04 */ u8 shape; // Collider Type
} ColliderInit_Set3; // size = 0x05
/* 0x00 */ u8 colType; // Determines hitmarks and sound effects during AC collisions.
/* 0x01 */ u8 atFlags; // Information flags for AT collisions.
/* 0x02 */ u8 acFlags; // Information flags for AC collisions.
/* 0x03 */ u8 ocFlags1; // Information flags for OC collisions.
/* 0x04 */ u8 shape; // JntSph, Cylinder, Tris, or Quad
} ColliderInitType1; // size = 0x05
typedef struct {
/* 0x00 */ struct Actor* actor;
/* 0x04 */ u8 atFlags; // Compared to acFlags
/* 0x05 */ u8 acFlags; // Compared to atFlags
/* 0x06 */ u8 maskA; // Bitwise-and compared to maskB
/* 0x07 */ u8 shape; // ColliderShape
} ColliderInit_Actor; // size = 0x08
/* 0x04 */ u8 atFlags; // Information flags for AT collisions.
/* 0x05 */ u8 acFlags; // Information flags for AC collisions.
/* 0x06 */ u8 ocFlags1; // Information flags for OC collisions.
/* 0x07 */ u8 shape; // JntSph, Cylinder, Tris, or Quad
} ColliderInitToActor; // size = 0x08
typedef struct {
/* 0x00 */ u32 flags; // Toucher Attack ID Flags
/* 0x04 */ u8 effect;
/* 0x00 */ u32 dmgFlags; // Toucher damage type flags.
/* 0x04 */ u8 effect; // Damage Effect (Knockback, Fire, etc.)
/* 0x05 */ u8 damage; // Damage or Stun Timer
} ColliderTouch; // size = 0x08
typedef struct {
/* 0x00 */ u32 flags; // Collision Exclusion Mask
/* 0x00 */ u32 dmgFlags; // Bumper damage type flags.
/* 0x04 */ u8 effect; // Damage Effect (Knockback, Fire, etc.)
/* 0x05 */ u8 defense; // Damage Resistance
/* 0x06 */ Vec3s unk_06;
/* 0x06 */ Vec3s hitPos; // Point of contact
} ColliderBump; // size = 0x0C
typedef struct {
/* 0x00 */ u32 flags; // Collision Exclusion Mask
/* 0x00 */ u32 dmgFlags; // Bumper exclusion mask
/* 0x04 */ u8 effect; // Damage Effect (Knockback, Fire, etc.)
/* 0x05 */ u8 defense;
/* 0x05 */ u8 defense; // Damage Resistance
} ColliderBumpInit; // size = 0x08
typedef struct ColliderBody {
/* 0x00 */ ColliderTouch toucher;
/* 0x08 */ ColliderBump bumper;
/* 0x14 */ u8 flags; // affects sfx reaction when attacked by Link
/* 0x15 */ u8 toucherFlags;
/* 0x16 */ u8 bumperFlags;
/* 0x17 */ u8 ocFlags;
/* 0x18 */ Collider* atHit; // object touching this object's AT collider
/* 0x1C */ Collider* acHit; // object touching this object's AC collider
/* 0x20 */ struct ColliderBody* atHitItem; // element that hit the AT collider
/* 0x24 */ struct ColliderBody* acHitItem; // element that hit the AC collider
} ColliderBody; // size = 0x28
typedef struct ColliderInfo {
/* 0x00 */ ColliderTouch toucher; // Damage properties when acting as an AT collider
/* 0x08 */ ColliderBump bumper; // Damage properties when acting as an AC collider
/* 0x14 */ u8 elemType; // Affects sfx reaction when attacked by Link and hookability. Full purpose unknown.
/* 0x15 */ u8 toucherFlags; // Information flags for AT collisions
/* 0x16 */ u8 bumperFlags; // Information flags for AC collisions
/* 0x17 */ u8 ocElemFlags; // Information flags for OC collisions
/* 0x18 */ Collider* atHit; // object touching this element's AT collider
/* 0x1C */ Collider* acHit; // object touching this element's AC collider
/* 0x20 */ struct ColliderInfo* atHitInfo; // element that hit the AT collider
/* 0x24 */ struct ColliderInfo* acHitInfo; // element that hit the AC collider
} ColliderInfo; // size = 0x28
typedef struct {
/* 0x00 */ u8 bodyFlags;
/* 0x04 */ ColliderTouch toucher;
/* 0x0C */ ColliderBumpInit bumper;
/* 0x14 */ u8 toucherFlags; // Attack Toucher Flags
/* 0x15 */ u8 bumperFlags; // Bumper Flags
/* 0x16 */ u8 bodyFlags2;
} ColliderBodyInit; // size = 0x18
/* 0x00 */ u8 elemType; // Affects sfx reaction when attacked by Link and hookability. Full purpose unknown.
/* 0x04 */ ColliderTouch toucher; // Damage properties when acting as an AT collider
/* 0x0C */ ColliderBumpInit bumper; // Damage properties when acting as an AC collider
/* 0x14 */ u8 toucherFlags; // Information flags for AT collisions
/* 0x15 */ u8 bumperFlags; // Information flags for AC collisions
/* 0x16 */ u8 ocElemFlags; // Information flags for OC collisions
} ColliderInfoInit; // size = 0x18
typedef struct {
/* 0x00 */ Sphere16 modelSphere; // model space sphere
/* 0x08 */ Sphere16 worldSphere; // world space sphere
/* 0x10 */ f32 scale; // world space sphere = model * scale * 0.01
/* 0x14 */ u8 joint;
} ColliderJntSphItemDim; // size = 0x18
/* 0x14 */ u8 limb; // attached limb
} ColliderJntSphElementDim; // size = 0x18
typedef struct {
/* 0x00 */ u8 joint;
/* 0x02 */ Sphere16 modelSphere;
/* 0x0A */ s16 scale;
} ColliderJntSphItemDimInit; // size = 0x0C
/* 0x00 */ u8 limb; // attached limb
/* 0x02 */ Sphere16 modelSphere; // model space sphere
/* 0x0A */ s16 scale; // world space sphere = model * scale * 0.01
} ColliderJntSphElementDimInit; // size = 0x0C
typedef struct {
/* 0x00 */ ColliderBody body;
/* 0x28 */ ColliderJntSphItemDim dim;
} ColliderJntSphItem; // size = 0x40
/* 0x00 */ ColliderInfo info;
/* 0x28 */ ColliderJntSphElementDim dim;
} ColliderJntSphElement; // size = 0x40
typedef struct {
/* 0x00 */ ColliderBodyInit body;
/* 0x18 */ ColliderJntSphItemDimInit dim;
} ColliderJntSphItemInit; // size = 0x24
/* 0x00 */ ColliderInfoInit info;
/* 0x18 */ ColliderJntSphElementDimInit dim;
} ColliderJntSphElementInit; // size = 0x24
typedef struct {
/* 0x00 */ Collider base;
/* 0x18 */ s32 count;
/* 0x1C */ ColliderJntSphItem* list;
/* 0x1C */ ColliderJntSphElement* elements;
} ColliderJntSph; // size = 0x20
typedef struct {
/* 0x00 */ ColliderInit base;
/* 0x08 */ s32 count;
/* 0x0C */ ColliderJntSphItemInit* list;
/* 0x0C */ ColliderJntSphElementInit* elements;
} ColliderJntSphInit; // size = 0x10
typedef struct {
/* 0x00 */ ColliderInit_Set3 base;
/* 0x00 */ ColliderInitType1 base;
/* 0x08 */ s32 count;
/* 0x0C */ ColliderJntSphItemInit* list;
} ColliderJntSphInit_Set3; // size = 0x10
/* 0x0C */ ColliderJntSphElementInit* elements;
} ColliderJntSphInitType1; // size = 0x10
typedef struct {
/* 0x00 */ ColliderInit_Actor base;
/* 0x00 */ ColliderInitToActor base;
/* 0x08 */ s32 count;
/* 0x0C */ ColliderJntSphItemInit* list;
} ColliderJntSphInit_Actor; // size = 0x10
/* 0x0C */ ColliderJntSphElementInit* elements;
} ColliderJntSphInitToActor; // size = 0x10
typedef struct {
/* 0x00 */ Collider base;
/* 0x18 */ ColliderBody body;
/* 0x18 */ ColliderInfo info;
/* 0x40 */ Cylinder16 dim;
} ColliderCylinder; // size = 0x4C
typedef struct {
/* 0x00 */ ColliderInit base;
/* 0x08 */ ColliderBodyInit body;
/* 0x08 */ ColliderInfoInit info;
/* 0x20 */ Cylinder16 dim;
} ColliderCylinderInit; // size = 0x2C
typedef struct {
/* 0x00 */ ColliderInit_Set3 base;
/* 0x08 */ ColliderBodyInit body;
/* 0x00 */ ColliderInitType1 base;
/* 0x08 */ ColliderInfoInit info;
/* 0x20 */ Cylinder16 dim;
} ColliderCylinderInit_Set3; // size = 0x2C
} ColliderCylinderInitType1; // size = 0x2C
typedef struct {
/* 0x00 */ ColliderInit_Actor base;
/* 0x08 */ ColliderBodyInit body;
/* 0x00 */ ColliderInitToActor base;
/* 0x08 */ ColliderInfoInit info;
/* 0x20 */ Cylinder16 dim;
} ColliderCylinderInit_Actor; // size = 0x2C
} ColliderCylinderInitToActor; // size = 0x2C
typedef struct {
/* 0x00 */ Vec3f vtx[3];
} ColliderTrisItemDimInit; // size = 0x24
} ColliderTrisElementDimInit; // size = 0x24
typedef struct {
/* 0x00 */ ColliderBody body;
/* 0x00 */ ColliderInfo info;
/* 0x28 */ TriNorm dim;
} ColliderTrisItem; // size = 0x5C
} ColliderTrisElement; // size = 0x5C
typedef struct {
/* 0x00 */ ColliderBodyInit body;
/* 0x18 */ ColliderTrisItemDimInit dim;
} ColliderTrisItemInit; // size 0x3C
/* 0x00 */ ColliderInfoInit info;
/* 0x18 */ ColliderTrisElementDimInit dim;
} ColliderTrisElementInit; // size 0x3C
typedef struct {
/* 0x00 */ Collider base;
/* 0x18 */ s32 count;
/* 0x1C */ ColliderTrisItem* list;
/* 0x1C */ ColliderTrisElement* elements;
} ColliderTris; // size = 0x20
typedef struct {
/* 0x00 */ ColliderInit base;
/* 0x08 */ s32 count;
/* 0x0C */ ColliderTrisItemInit* list;
/* 0x0C */ ColliderTrisElementInit* elements;
} ColliderTrisInit; // size = 0x10
typedef struct {
/* 0x00 */ ColliderInit_Set3 base;
/* 0x00 */ ColliderInitType1 base;
/* 0x08 */ s32 count;
/* 0x0C */ ColliderTrisItemInit* list;
} ColliderTrisInit_Set3; // size = 0x10
/* 0x0C */ ColliderTrisElementInit* elements;
} ColliderTrisInitType1; // size = 0x10
typedef struct {
/* 0x00 */ Vec3f quad[4];
/* 0x30 */ Vec3s dcMid; // midpoint of vectors d, c
/* 0x36 */ Vec3s baMid; // midpoint of vectors b, a
/* 0x3C */ f32 unk_3C;
/* 0x3C */ f32 acDist; // distance to nearest AC collision this frame.
} ColliderQuadDim; // size = 0x40
typedef struct {
/* 0x00 */ Vec3f quad[4];
} ColliderQuadDimInit; // size = 0x30
typedef struct {
/* 0x00 */ ColliderInfo info;
/* 0x24 */ ColliderQuadDim dim;
} ColliderQuadElement; // size = 0x68
typedef struct {
/* 0x00 */ Collider base;
/* 0x18 */ ColliderBody body;
/* 0x18 */ ColliderInfo info;
/* 0x40 */ ColliderQuadDim dim;
} ColliderQuad; // size = 0x80
typedef struct {
/* 0x00 */ ColliderInit base;
/* 0x08 */ ColliderBodyInit body;
/* 0x08 */ ColliderInfoInit info;
/* 0x20 */ ColliderQuadDimInit dim;
} ColliderQuadInit; // size = 0x50
typedef struct {
/* 0x00 */ ColliderInit_Set3 base;
/* 0x08 */ ColliderBodyInit body;
/* 0x00 */ ColliderInitType1 base;
/* 0x08 */ ColliderInfoInit info;
/* 0x20 */ ColliderQuadDimInit dim;
} ColliderQuadInit_Set3; // size = 0x50
} ColliderQuadInitType1; // size = 0x50
typedef struct {
/* 0x00 */ Linef line;
/* 0x18 */ u16 unk_18;
/* 0x18 */ u16 ocFlags;
} OcLine; // size = 0x1C
typedef enum {
/* 0 */ COLTYPE_HIT0, // Blue blood, white hitmark
/* 1 */ COLTYPE_HIT1, // No blood, dust hitmark
/* 2 */ COLTYPE_HIT2, // Green blood, dust hitmark
/* 3 */ COLTYPE_HIT3, // No blood, white hitmark
/* 4 */ COLTYPE_HIT4, // Water burst, no hitmark
/* 5 */ COLTYPE_HIT5, // No blood, red hitmark
/* 6 */ COLTYPE_HIT6, // Green blood, white hitmark
/* 7 */ COLTYPE_HIT7, // Red blood, white hitmark
/* 8 */ COLTYPE_HIT8, // Blue blood, red hitmark
/* 9 */ COLTYPE_METAL,
/* 10 */ COLTYPE_NONE,
/* 11 */ COLTYPE_WOOD,
/* 12 */ COLTYPE_HARD,
/* 13 */ COLTYPE_TREE
} ColliderType;
typedef enum {
/* 0 */ COLSHAPE_JNTSPH,
/* 1 */ COLSHAPE_CYLINDER,
/* 2 */ COLSHAPE_TRIS,
/* 3 */ COLSHAPE_QUAD,
/* 4 */ COLSHAPE_INVALID
} ColliderShape;
/**
* Affects the sound Link's sword makes when hitting it, hookability,
* and possibly other things. It's definitely not flags, as all checks
* are == or !=. Will probably need more actors decomped to truly
* understand what this is.
*/
typedef enum {
/* 0 */ ELEMTYPE_UNK0,
/* 1 */ ELEMTYPE_UNK1,
/* 2 */ ELEMTYPE_UNK2,
/* 3 */ ELEMTYPE_UNK3,
/* 4 */ ELEMTYPE_UNK4,
/* 5 */ ELEMTYPE_UNK5,
/* 6 */ ELEMTYPE_UNK6,
/* 7 */ ELEMTYPE_UNK7
} ElementType;
#define AT_NONE 0 // No flags set. Cannot have AT collisions when set as AT
#define AT_ON (1 << 0) // Can have AT collisions when set as AT
#define AT_HIT (1 << 1) // Had an AT collision
#define AT_BOUNCED (1 << 2) // Had an AT collision with an AC_HARD collider
#define AT_TYPE_PLAYER (1 << 3) // Has player-aligned damage
#define AT_TYPE_ENEMY (1 << 4) // Has enemy-aligned damage
#define AT_TYPE_OTHER (1 << 5) // Has non-aligned damage
#define AT_SELF (1 << 6) // Can have AT collisions with colliders attached to the same actor
#define AT_TYPE_ALL (AT_TYPE_PLAYER | AT_TYPE_ENEMY | AT_TYPE_OTHER) // Has all three damage alignments
#define AC_NONE 0 // No flags set. Cannot have AC collisions when set as AC
#define AC_ON (1 << 0) // Can have AC collisions when set as AC
#define AC_HIT (1 << 1) // Had an AC collision
#define AC_HARD (1 << 2) // Causes AT colliders to bounce off it
#define AC_TYPE_PLAYER AT_TYPE_PLAYER // Takes player-aligned damage
#define AC_TYPE_ENEMY AT_TYPE_ENEMY // Takes enemy-aligned damage
#define AC_TYPE_OTHER AT_TYPE_OTHER // Takes non-aligned damage
#define AC_NO_DAMAGE (1 << 6) // Collider does not take damage
#define AC_BOUNCED (1 << 7) // Caused an AT collider to bounce off it
#define AC_TYPE_ALL (AC_TYPE_PLAYER | AC_TYPE_ENEMY | AC_TYPE_OTHER) // Takes damage from all three alignments
#define OC1_NONE 0 // No flags set. Cannot have OC collisions when set as OC
#define OC1_ON (1 << 0) // Can have OC collisions when set as OC
#define OC1_HIT (1 << 1) // Had an OC collision
#define OC1_NO_PUSH (1 << 2) // Does not push other colliders away during OC collisions
#define OC1_TYPE_PLAYER (1 << 3) // Can have OC collisions with OC type player
#define OC1_TYPE_1 (1 << 4) // Can have OC collisions with OC type 1
#define OC1_TYPE_2 (1 << 5) // Can have OC collisions with OC type 2
#define OC1_TYPE_ALL (OC1_TYPE_PLAYER | OC1_TYPE_1 | OC1_TYPE_2) // Can have collisions with all three OC types
#define OC2_NONE 0 // No flags set. Has no OC type
#define OC2_HIT_PLAYER (1 << 0) // Had an OC collision with OC type player
#define OC2_UNK1 (1 << 1) // Prevents OC collisions with OC2_UNK2. Some horses and toki_sword have it.
#define OC2_UNK2 (1 << 2) // Prevents OC collisions with OC2_UNK1. Nothing has it.
#define OC2_TYPE_PLAYER OC1_TYPE_PLAYER // Has OC type player
#define OC2_TYPE_1 OC1_TYPE_1 // Has OC type 1
#define OC2_TYPE_2 OC1_TYPE_2 // Has OC type 2
#define OC2_FIRST_ONLY (1 << 6) // Skips AC checks on elements after the first collision. Only used by Ganon
#define TOUCH_NONE 0 // No flags set. Cannot have AT collisions
#define TOUCH_ON (1 << 0) // Can have AT collisions
#define TOUCH_HIT (1 << 1) // Had an AT collision
#define TOUCH_NEAREST (1 << 2) // If a Quad, only collides with the closest bumper
#define TOUCH_SFX_NORMAL (0 << 3) // Hit sound effect based on AC collider's type
#define TOUCH_SFX_HARD (1 << 3) // Always uses hard deflection sound
#define TOUCH_SFX_WOOD (2 << 3) // Always uses wood deflection sound
#define TOUCH_SFX_NONE (3 << 3) // No hit sound effect
#define TOUCH_AT_HITMARK (1 << 5) // Draw hitmarks for every AT collision
#define TOUCH_DREW_HITMARK (1 << 6) // Already drew hitmark for this frame
#define TOUCH_UNK7 (1 << 7) // Unknown purpose. Used by some enemy quads
#define BUMP_NONE 0 // No flags set. Cannot have AC collisions
#define BUMP_ON (1 << 0) // Can have AC collisions
#define BUMP_HIT (1 << 1) // Had an AC collision
#define BUMP_HOOKABLE (1 << 2) // Can be hooked if actor has hookability flags set.
#define BUMP_NO_AT_INFO (1 << 3) // Does not give its info to the AT collider that hit it.
#define BUMP_NO_DAMAGE (1 << 4) // Does not take damage.
#define BUMP_NO_SWORD_SFX (1 << 5) // Does not have a sound when hit by player-attached AT colliders.
#define BUMP_NO_HITMARK (1 << 6) // Skips hit effects.
#define BUMP_DRAW_HITMARK (1 << 7) // Draw hitmark for AC collision this frame.
#define OCELEM_NONE 0 // No flags set. Cannot have OC collisions
#define OCELEM_ON (1 << 0) // Can have OC collisions
#define OCELEM_HIT (1 << 1) // Had an OC collision
#define OCELEM_UNK3 (1 << 3) // Unknown purpose. Used by Dead Hand element 0 and Dodongo element 5
#define OCLINE_NONE 0 // Did not have an OcLine collision
#define OCLINE_HIT (1 << 0) // Had an OcLine collision
#define DMG_ENTRY(damage, effect) ((damage) | ((effect) << 4))
// These flags are not to be used in code until we figure out how we want to format them. They are only here for reference
#define DMG_DEKU_NUT (1 << 0x00)
#define DMG_DEKU_STICK (1 << 0x01)
#define DMG_SLINGSHOT (1 << 0x02)
#define DMG_EXPLOSIVE (1 << 0x03)
#define DMG_BOOMERANG (1 << 0x04)
#define DMG_ARROW_NORMAL (1 << 0x05)
#define DMG_HAMMER_SWING (1 << 0x06)
#define DMG_HOOKSHOT (1 << 0x07)
#define DMG_SLASH_KOKIRI (1 << 0x08)
#define DMG_SLASH_MASTER (1 << 0x09)
#define DMG_SLASH_GIANT (1 << 0x0A)
#define DMG_ARROW_FIRE (1 << 0x0B)
#define DMG_ARROW_ICE (1 << 0x0C)
#define DMG_ARROW_LIGHT (1 << 0x0D)
#define DMG_ARROW_UNK1 (1 << 0x0E)
#define DMG_ARROW_UNK2 (1 << 0x0F)
#define DMG_ARROW_UNK3 (1 << 0x10)
#define DMG_MAGIC_FIRE (1 << 0x11)
#define DMG_MAGIC_ICE (1 << 0x12)
#define DMG_MAGIC_LIGHT (1 << 0x13)
#define DMG_SHIELD (1 << 0x14)
#define DMG_MIR_RAY (1 << 0x15)
#define DMG_SPIN_KOKIRI (1 << 0x16)
#define DMG_SPIN_GIANT (1 << 0x17)
#define DMG_SPIN_MASTER (1 << 0x18)
#define DMG_JUMP_KOKIRI (1 << 0x19)
#define DMG_JUMP_GIANT (1 << 0x1A)
#define DMG_JUMP_MASTER (1 << 0x1B)
#define DMG_UNKNOWN_1 (1 << 0x1C)
#define DMG_UNBLOCKABLE (1 << 0x1D)
#define DMG_HAMMER_JUMP (1 << 0x1E)
#define DMG_UNKNOWN_2 (1 << 0x1F)
#define DMG_SLASH (DMG_SLASH_KOKIRI | DMG_SLASH_MASTER | DMG_SLASH_GIANT)
#define DMG_SPIN_ATTACK (DMG_SPIN_KOKIRI | DMG_SPIN_MASTER | DMG_SPIN_GIANT)
#define DMG_JUMP_SLASH (DMG_JUMP_KOKIRI | DMG_JUMP_MASTER | DMG_JUMP_GIANT)
#define DMG_SWORD (DMG_SLASH | DMG_SPIN_ATTACK | DMG_JUMP_SLASH)
#define DMG_HAMMER (DMG_HAMMER_SWING | DMG_HAMMER_JUMP)
#define DMG_FIRE (DMG_ARROW_FIRE | DMG_MAGIC_FIRE)
#define DMG_ARROW (DMG_ARROW_NORMAL | DMG_ARROW_FIRE | DMG_ARROW_ICE | DMG_ARROW_LIGHT | DMG_UNK_ARROW_1 | DMG_UNK_ARROW_2 | DMG_UNK_ARROW_3)
#define DMG_RANGED (DMG_ARROW | DMG_HOOKSHOT | DMG_SLINGSHOT)
#define DMG_DEFAULT ~(DMG_SHIELD | DMG_MIR_RAY)
#endif