1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-06 22:30:15 +00:00

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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
487 changed files with 14371 additions and 4713 deletions

View file

@ -31,12 +31,26 @@ const ActorInit Obj_Hamishi_InitVars = {
};
static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK12, 0x00, 0x0D, 0x39, 0x20, COLSHAPE_CYLINDER },
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x4FC1FFF6, 0x00, 0x00 }, 0x00, 0x01, 0x01 },
{
COLTYPE_HARD,
AT_NONE,
AC_ON | AC_HARD | AC_TYPE_PLAYER,
OC1_ON | OC1_TYPE_ALL,
OC2_TYPE_2,
COLSHAPE_CYLINDER,
},
{
ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x00 },
{ 0x4FC1FFF6, 0x00, 0x00 },
TOUCH_NONE,
BUMP_ON,
OCELEM_ON,
},
{ 50, 70, 0, { 0, 0, 0 } },
};
static CollisionCheckInfoInit sColChkInfoInit = { 0, 0xC, 0x3C, 0xFF };
static CollisionCheckInfoInit sColChkInfoInit = { 0, 12, 60, MASS_IMMOVABLE };
static s16 sEffectScales[] = {
145, 135, 115, 85, 75, 53, 45, 40, 35,
@ -54,7 +68,7 @@ void ObjHamishi_InitCollision(Actor* thisx, GlobalContext* globalCtx) {
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
Collider_CylinderUpdate(&this->actor, &this->collider);
Collider_UpdateCylinder(&this->actor, &this->collider);
}
void ObjHamishi_Shake(ObjHamishi* this) {
@ -119,11 +133,11 @@ void ObjHamishi_Break(ObjHamishi* this, GlobalContext* globalCtx) {
}
EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &this->actor.posRot.pos, gravity, phi_v0, 30, 5, 0,
sEffectScales[i], 3, 0, 70, 1, OBJECT_GAMEPLAY_FIELD_KEEP, &D_0500A5E8);
sEffectScales[i], 3, 0, 70, 1, OBJECT_GAMEPLAY_FIELD_KEEP, D_0500A5E8);
}
func_80033480(globalCtx, &this->actor.posRot, 140.0f, 6, 180, 90, 1);
func_80033480(globalCtx, &this->actor.posRot, 140.0f, 12, 80, 90, 1);
func_80033480(globalCtx, &this->actor.posRot.pos, 140.0f, 6, 180, 90, 1);
func_80033480(globalCtx, &this->actor.posRot.pos, 140.0f, 12, 80, 90, 1);
}
void ObjHamishi_Init(Actor* thisx, GlobalContext* globalCtx) {
@ -139,7 +153,7 @@ void ObjHamishi_Init(Actor* thisx, GlobalContext* globalCtx) {
}
ObjHamishi_InitCollision(&this->actor, globalCtx);
func_80061ED4(&this->actor.colChkInfo, NULL, &sColChkInfoInit);
CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit);
if (Flags_GetSwitch(globalCtx, this->actor.params & 0x3F)) {
Actor_Kill(&this->actor);
@ -162,8 +176,8 @@ void ObjHamishi_Update(Actor* thisx, GlobalContext* globalCtx) {
ObjHamishi_Shake(this);
if ((this->collider.base.acFlags & 2) && (this->collider.body.acHitItem->toucher.flags & 0x40000040)) {
this->collider.base.acFlags &= ~2;
if ((this->collider.base.acFlags & AC_HIT) && (this->collider.info.acHitInfo->toucher.dmgFlags & 0x40000040)) {
this->collider.base.acFlags &= ~AC_HIT;
this->hitCount++;
if (this->hitCount < 2) {
this->shakeFrames = 15;
@ -176,11 +190,11 @@ void ObjHamishi_Update(Actor* thisx, GlobalContext* globalCtx) {
Actor_Kill(&this->actor);
}
} else {
this->collider.base.acFlags &= ~2;
this->collider.base.acFlags &= ~AC_HIT;
if (this->actor.xzDistToLink < 600.0f) {
CollisionCheck_SetAC(globalCtx, colChkCtx, &this->collider);
CollisionCheck_SetOC(globalCtx, colChkCtx, &this->collider);
CollisionCheck_SetAC(globalCtx, colChkCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, colChkCtx, &this->collider.base);
}
}
}
@ -193,7 +207,7 @@ void ObjHamishi_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_obj_hamishi.c", 404),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 170, 130, 255);
gSPDisplayList(POLY_OPA_DISP++, &D_0500A3B8);
gSPDisplayList(POLY_OPA_DISP++, D_0500A3B8);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_obj_hamishi.c", 411);
}