1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-07 14:50: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

@ -43,14 +43,58 @@ const ActorInit En_Rd_InitVars = {
};
static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK0, 0x00, 0x09, 0x09, 0x10, COLSHAPE_CYLINDER },
{ 0x01, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x05, 0x01 },
{
COLTYPE_HIT0,
AT_NONE,
AC_ON | AC_TYPE_PLAYER,
OC1_ON | OC1_TYPE_PLAYER,
OC2_TYPE_1,
COLSHAPE_CYLINDER,
},
{
ELEMTYPE_UNK1,
{ 0x00000000, 0x00, 0x00 },
{ 0xFFCFFFFF, 0x00, 0x00 },
TOUCH_NONE,
BUMP_ON | BUMP_HOOKABLE,
OCELEM_ON,
},
{ 20, 70, 0, { 0, 0, 0 } },
};
static DamageTable sDamageTable = {
0x00, 0xF2, 0x00, 0x00, 0x00, 0x00, 0xF2, 0x10, 0xF1, 0xF2, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xE4, 0x60, 0xD3, 0x00, 0x00, 0xF1, 0xF4, 0xF2, 0xF2, 0xF8, 0xF4, 0x00, 0x00, 0xF4, 0x00,
/* Deku nut */ DMG_ENTRY(0, 0x0),
/* Deku stick */ DMG_ENTRY(2, 0xF),
/* Slingshot */ DMG_ENTRY(0, 0x0),
/* Explosive */ DMG_ENTRY(0, 0x0),
/* Boomerang */ DMG_ENTRY(0, 0x0),
/* Normal arrow */ DMG_ENTRY(0, 0x0),
/* Hammer swing */ DMG_ENTRY(2, 0xF),
/* Hookshot */ DMG_ENTRY(0, 0x1),
/* Kokiri sword */ DMG_ENTRY(1, 0xF),
/* Master sword */ DMG_ENTRY(2, 0xF),
/* Giant's Knife */ DMG_ENTRY(4, 0xF),
/* Fire arrow */ DMG_ENTRY(0, 0x0),
/* Ice arrow */ DMG_ENTRY(0, 0x0),
/* Light arrow */ DMG_ENTRY(0, 0x0),
/* Unk arrow 1 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 2 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 3 */ DMG_ENTRY(0, 0x0),
/* Fire magic */ DMG_ENTRY(4, 0xE),
/* Ice magic */ DMG_ENTRY(0, 0x6),
/* Light magic */ DMG_ENTRY(3, 0xD),
/* Shield */ DMG_ENTRY(0, 0x0),
/* Mirror Ray */ DMG_ENTRY(0, 0x0),
/* Kokiri spin */ DMG_ENTRY(1, 0xF),
/* Giant spin */ DMG_ENTRY(4, 0xF),
/* Master spin */ DMG_ENTRY(2, 0xF),
/* Kokiri jump */ DMG_ENTRY(2, 0xF),
/* Giant jump */ DMG_ENTRY(8, 0xF),
/* Master jump */ DMG_ENTRY(4, 0xF),
/* Unknown 1 */ DMG_ENTRY(0, 0x0),
/* Unblockable */ DMG_ENTRY(0, 0x0),
/* Hammer jump */ DMG_ENTRY(4, 0xF),
/* Unknown 2 */ DMG_ENTRY(0, 0x0),
};
static InitChainEntry sInitChain[] = {
@ -101,7 +145,7 @@ void EnRd_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_310 = this->unk_30E = 0;
thisx->posRot2.pos = thisx->posRot.pos;
thisx->posRot2.pos.y += 50.0f;
thisx->colChkInfo.mass = 0xFE;
thisx->colChkInfo.mass = MASS_HEAVY;
thisx->colChkInfo.health = 8;
this->unk_314 = this->unk_31D = 0xFF;
this->unk_312 = (thisx->params & 0xFF00) >> 8;
@ -713,12 +757,12 @@ void func_80AE4114(EnRd* this, GlobalContext* globalCtx) {
return;
}
if (this->collider.base.acFlags & 2) {
this->collider.base.acFlags &= ~2;
if (this->collider.base.acFlags & AC_HIT) {
this->collider.base.acFlags &= ~AC_HIT;
this->unk_31C = this->actor.colChkInfo.damageEffect;
if (this->unk_31B != 11) {
func_80035650(&this->actor, &this->collider.body, 1);
func_80035650(&this->actor, &this->collider.info, 1);
if (player->unk_844 != 0) {
this->unk_31D = player->unk_845;
}
@ -754,10 +798,10 @@ void func_80AE4114(EnRd* this, GlobalContext* globalCtx) {
}
void EnRd_Update(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
EnRd* this = THIS;
CollisionCheckContext* colChkCtx = &globalCtx->colChkCtx;
Player* player = PLAYER;
ColliderCylinder* collider = &this->collider;
s32 pad2;
func_80AE4114(this, globalCtx);
@ -788,10 +832,10 @@ void EnRd_Update(Actor* thisx, GlobalContext* globalCtx) {
this->actor.posRot2.pos.y += 50.0f;
if ((this->actor.colChkInfo.health > 0) && (this->unk_31B != 8)) {
Collider_CylinderUpdate(&this->actor, collider);
CollisionCheck_SetOC(globalCtx, colChkCtx, &collider->base);
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
if ((this->unk_31B != 9) || ((player->unk_844 != 0) && (player->unk_845 != this->unk_31D))) {
CollisionCheck_SetAC(globalCtx, colChkCtx, &collider->base);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
}
}