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

@ -32,8 +32,38 @@ void func_80AE5938(EnReeba* this, GlobalContext* globalCtx);
void func_80AE5A9C(EnReeba* this, GlobalContext* globalCtx);
static DamageTable sDamageTable = {
0x00, 0xE2, 0xE1, 0xE2, 0xC1, 0xE2, 0xE2, 0xD2, 0xE1, 0xE4, 0xE6, 0xE2, 0x34, 0xE2, 0xE2, 0xE2,
0xE2, 0x00, 0x34, 0x00, 0x00, 0x00, 0xE2, 0xE8, 0xE4, 0xE2, 0xE8, 0xE4, 0x10, 0x00, 0x00, 0x00,
/* Deku nut */ DMG_ENTRY(0, 0x0),
/* Deku stick */ DMG_ENTRY(2, 0xE),
/* Slingshot */ DMG_ENTRY(1, 0xE),
/* Explosive */ DMG_ENTRY(2, 0xE),
/* Boomerang */ DMG_ENTRY(1, 0xC),
/* Normal arrow */ DMG_ENTRY(2, 0xE),
/* Hammer swing */ DMG_ENTRY(2, 0xE),
/* Hookshot */ DMG_ENTRY(2, 0xD),
/* Kokiri sword */ DMG_ENTRY(1, 0xE),
/* Master sword */ DMG_ENTRY(4, 0xE),
/* Giant's Knife */ DMG_ENTRY(6, 0xE),
/* Fire arrow */ DMG_ENTRY(2, 0xE),
/* Ice arrow */ DMG_ENTRY(4, 0x3),
/* Light arrow */ DMG_ENTRY(2, 0xE),
/* Unk arrow 1 */ DMG_ENTRY(2, 0xE),
/* Unk arrow 2 */ DMG_ENTRY(2, 0xE),
/* Unk arrow 3 */ DMG_ENTRY(2, 0xE),
/* Fire magic */ DMG_ENTRY(0, 0x0),
/* Ice magic */ DMG_ENTRY(4, 0x3),
/* Light magic */ DMG_ENTRY(0, 0x0),
/* Shield */ DMG_ENTRY(0, 0x0),
/* Mirror Ray */ DMG_ENTRY(0, 0x0),
/* Kokiri spin */ DMG_ENTRY(2, 0xE),
/* Giant spin */ DMG_ENTRY(8, 0xE),
/* Master spin */ DMG_ENTRY(4, 0xE),
/* Kokiri jump */ DMG_ENTRY(2, 0xE),
/* Giant jump */ DMG_ENTRY(8, 0xE),
/* Master jump */ DMG_ENTRY(4, 0xE),
/* Unknown 1 */ DMG_ENTRY(0, 0x1),
/* Unblockable */ DMG_ENTRY(0, 0x0),
/* Hammer jump */ DMG_ENTRY(0, 0x0),
/* Unknown 2 */ DMG_ENTRY(0, 0x0),
};
const ActorInit En_Reeba_InitVars = {
@ -49,8 +79,22 @@ const ActorInit En_Reeba_InitVars = {
};
static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK5, 0x11, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER },
{ 0x00, { 0xFFCFFFFF, 0x08, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x01, 0x05, 0x01 },
{
COLTYPE_HIT5,
AT_ON | AT_TYPE_ENEMY,
AC_ON | AC_TYPE_PLAYER,
OC1_ON | OC1_TYPE_ALL,
OC2_TYPE_1,
COLSHAPE_CYLINDER,
},
{
ELEMTYPE_UNK0,
{ 0xFFCFFFFF, 0x08, 0x08 },
{ 0xFFCFFFFF, 0x00, 0x00 },
TOUCH_ON | TOUCH_SFX_NORMAL,
BUMP_ON | BUMP_HOOKABLE,
OCELEM_ON,
},
{ 20, 40, 0, { 0, 0, 0 } },
};
@ -67,7 +111,7 @@ void EnReeba_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.gravity = -3.5f;
this->actor.posRot2.pos = this->actor.posRot.pos;
SkelAnime_Init(globalCtx, &this->skelanime, &D_06001EE8, &D_060001E4, this->jointTable, this->morphTable, 18);
this->actor.colChkInfo.mass = 0xFE;
this->actor.colChkInfo.mass = MASS_HEAVY;
this->actor.colChkInfo.health = 4;
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
@ -80,8 +124,8 @@ void EnReeba_Init(Actor* thisx, GlobalContext* globalCtx) {
this->scale *= 1.5f;
osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ リーバぼす登場 ☆☆☆☆☆ %f\n" VT_RST, this->scale);
this->actor.colChkInfo.health = 20;
this->collider.body.toucher.effect = 4;
this->collider.body.toucher.damage = 16;
this->collider.info.toucher.effect = 4;
this->collider.info.toucher.damage = 16;
Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_ENEMY);
}
@ -471,8 +515,8 @@ void func_80AE5E48(EnReeba* this, GlobalContext* globalCtx) {
}
void func_80AE5EDC(EnReeba* this, GlobalContext* globalCtx) {
if (this->collider.base.acFlags & 2) {
this->collider.base.acFlags &= ~2;
if (this->collider.base.acFlags & AC_HIT) {
this->collider.base.acFlags &= ~AC_HIT;
if ((this->actionfunc != func_80AE5C38) && (this->actionfunc != func_80AE5854)) {
this->actor.shape.rot.x = this->actor.shape.rot.z = 0;
@ -562,8 +606,8 @@ void EnReeba_Update(Actor* thisx, GlobalContext* globalCtx2) {
Actor_MoveForward(&this->actor);
func_8002E4B4(globalCtx, &this->actor, 35.0f, 60.0f, 60.0f, 0x1D);
if (this->collider.base.atFlags & 4) {
this->collider.base.atFlags &= ~4;
if (this->collider.base.atFlags & AT_BOUNCED) {
this->collider.base.atFlags &= ~AT_BOUNCED;
if ((this->actionfunc == func_80AE5270) || (this->actionfunc == func_80AE53AC)) {
this->actor.speedXZ = 8.0f;
@ -574,8 +618,8 @@ void EnReeba_Update(Actor* thisx, GlobalContext* globalCtx2) {
}
}
if (this->collider.base.atFlags & 2) {
this->collider.base.atFlags &= ~2;
if (this->collider.base.atFlags & AT_HIT) {
this->collider.base.atFlags &= ~AT_HIT;
if ((this->collider.base.at == &player->actor) && !this->isBig && (this->actionfunc != func_80AE56E0)) {
this->actionfunc = func_80AE5688;
}
@ -589,7 +633,7 @@ void EnReeba_Update(Actor* thisx, GlobalContext* globalCtx2) {
this->actor.posRot2.pos.y += 30.0f;
}
Collider_CylinderUpdate(&this->actor, &this->collider);
Collider_UpdateCylinder(&this->actor, &this->collider);
if ((this->actor.shape.unk_08 >= -700.0f) && (this->actor.colChkInfo.health > 0) &&
(this->actionfunc != func_80AE56E0)) {