1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-03 14:34:32 +00:00

EnDekubaba OK and documented, object_dekubaba documented (#864)

* 13 functions left, data imported

* 2 left

* 1 left

* OK

* Begin naming

* sfx rename

* spec

* Begin naming, add LINK_IS_CHILD to EnDu

* Fix spelling of its/it's

* Document most of object_dekubaba, import symbols

* Document draw functions, begin on actionfuncs

* New actor function names, some float constants

* Name almost everything

* Delete asm

* Name size, format

* Review changes

* Review changes

* Brackets, format
This commit is contained in:
EllipticEllipsis 2021-07-07 18:26:09 +01:00 committed by GitHub
parent 8e4d1ccd3f
commit e632b9a120
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
54 changed files with 1239 additions and 4203 deletions

View file

@ -712,7 +712,7 @@ void DemoEffect_InitTimeWarp(DemoEffect* this, GlobalContext* globalCtx) {
/**
* Update function for the Timewarp Actor that is used when Link pulls the Mastersword
* It changes the Background Music and updates it's SkelCurve animation.
* It changes the Background Music and updates its SkelCurve animation.
*/
void DemoEffect_UpdateTimeWarpPullMasterSword(DemoEffect* this, GlobalContext* globalCtx) {
if (Flags_GetEnv(globalCtx, 1)) {

View file

@ -462,7 +462,7 @@ void EnClearTag_Update(Actor* thisx, GlobalContext* globalCtx2) {
Math_ApproachS(&this->actor.world.rot.z, 0, 15, this->targetDirection.z);
Math_ApproachF(&this->targetDirection.z, 0x500, 1.0f, 0x100);
// Check if the Arwing should fire it's laser.
// Check if the Arwing should fire its laser.
if ((this->frameCounter % 4) == 0 && (Rand_ZeroOne() < 0.75f) &&
(this->state == CLEAR_TAG_STATE_TARGET_LOCKED)) {
this->shouldShootLaser = true;
@ -812,7 +812,7 @@ void EnClearTag_UpdateEffects(GlobalContext* globalCtx) {
effect->velocity.y *= -0.5f;
effect->timer = ((s16)Rand_ZeroFloat(20)) + 25;
} else {
// The Debris effect is done bounding. Set it's velocity and acceleration to 0.
// The Debris effect is done bouncing. Set its velocity and acceleration to 0.
effect->velocity.x = effect->velocity.z = effect->acceleration.y = effect->velocity.y =
0.0f;
}

File diff suppressed because it is too large Load diff

View file

@ -6,9 +6,28 @@
struct EnDekubaba;
typedef void (*EnDekubabaActionFunc)(struct EnDekubaba*, GlobalContext*);
typedef enum {
/* 0 */ DEKUBABA_NORMAL,
/* 1 */ DEKUBABA_BIG
} DekuBabaType;
typedef struct EnDekubaba {
/* 0x0000 */ Actor actor;
/* 0x014C */ char unk_14C[0x2CC];
/* 0x014C */ Vec3f bodyPartsPos[4];
/* 0x017C */ SkelAnime skelAnime;
/* 0x01C0 */ EnDekubabaActionFunc actionFunc;
/* 0x01C4 */ char pad[0x2];
/* 0x01C6 */ s16 timer;
/* 0x01C8 */ s16 targetSwayAngle;
/* 0x01CA */ s16 stemSectionAngle[3]; // Used to calculate the position of the stem sections and head with spherical trigonometry
/* 0x01D0 */ Vec3s jointTable[8];
/* 0x0200 */ Vec3s morphTable[8];
/* 0x0230 */ f32 size; // Used everywhere to rescale offsets etc. for Big ones
/* 0x0234 */ CollisionPoly* boundFloor;
/* 0x0238 */ ColliderJntSph collider;
/* 0x0258 */ ColliderJntSphElement colliderElements[7];
} EnDekubaba; // size = 0x0418
extern const ActorInit En_Dekubaba_InitVars;

View file

@ -277,7 +277,7 @@ void EnDu_Init(Actor* thisx, GlobalContext* globalCtx) {
EnDu_SetupAction(this, func_809FE890);
} else if (globalCtx->sceneNum == 4) {
EnDu_SetupAction(this, func_809FE638);
} else if (gSaveContext.linkAge != 0) {
} else if (LINK_IS_CHILD) {
EnDu_SetupAction(this, func_809FE3C0);
} else {
EnDu_SetupAction(this, func_809FE3B4);

View file

@ -628,7 +628,7 @@ void EnFd_Run(EnFd* this, GlobalContext* globalCtx) {
}
/**
* En_Fw will set `this` params when it is done with it's action.
* En_Fw will set `this` params when it is done with its action.
* It will set FLG_COREDONE when the core has returned to `this`'s initial
* position, and FLG_COREDEAD when there is no health left
*/

View file

@ -5,8 +5,9 @@
*/
#include "z_en_karebaba.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
#include "objects/object_dekubaba/object_dekubaba.h"
#include "objects/gameplay_keep/gameplay_keep.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
#define FLAGS 0x00000005
@ -90,20 +91,13 @@ static InitChainEntry sInitChain[] = {
ICHAIN_S8(naviEnemyId, 9, ICHAIN_STOP),
};
extern SkeletonHeader D_06002A40;
extern AnimationHeader D_060002B8;
extern Gfx D_06003070[]; // deku stick drop
extern Gfx D_060010F0[]; // leaf base
extern Gfx D_06001828[]; // upper third of stem
extern Gfx D_06001330[]; // mid third of stem
extern Gfx D_06001628[]; // lower third of stem
void EnKarebaba_Init(Actor* thisx, GlobalContext* globalCtx) {
EnKarebaba* this = THIS;
Actor_ProcessInitChain(&this->actor, sInitChain);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 22.0f);
SkelAnime_Init(globalCtx, &this->skelAnime, &D_06002A40, &D_060002B8, this->jointTable, this->morphTable, 8);
SkelAnime_Init(globalCtx, &this->skelAnime, &gDekuBabaSkel, &gDekuBabaFastChompAnim, this->jointTable,
this->morphTable, 8);
Collider_InitCylinder(globalCtx, &this->bodyCollider);
Collider_SetCylinder(globalCtx, &this->bodyCollider, &this->actor, &sBodyColliderInit);
Collider_UpdateCylinder(&this->actor, &this->bodyCollider);
@ -152,8 +146,8 @@ void EnKarebaba_SetupIdle(EnKarebaba* this) {
}
void EnKarebaba_SetupAwaken(EnKarebaba* this) {
Animation_Change(&this->skelAnime, &D_060002B8, 4.0f, 0.0f, Animation_GetLastFrame(&D_060002B8), ANIMMODE_LOOP,
-3.0f);
Animation_Change(&this->skelAnime, &gDekuBabaFastChompAnim, 4.0f, 0.0f,
Animation_GetLastFrame(&gDekuBabaFastChompAnim), ANIMMODE_LOOP, -3.0f);
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DUMMY482);
this->actionFunc = EnKarebaba_Awaken;
}
@ -203,14 +197,14 @@ void EnKarebaba_SetupDeadItemDrop(EnKarebaba* this, GlobalContext* globalCtx) {
}
void EnKarebaba_SetupRetract(EnKarebaba* this) {
Animation_Change(&this->skelAnime, &D_060002B8, -3.0f, Animation_GetLastFrame(&D_060002B8), 0.0f, ANIMMODE_ONCE,
-3.0f);
Animation_Change(&this->skelAnime, &gDekuBabaFastChompAnim, -3.0f, Animation_GetLastFrame(&gDekuBabaFastChompAnim),
0.0f, ANIMMODE_ONCE, -3.0f);
EnKarebaba_ResetCollider(this);
this->actionFunc = EnKarebaba_Retract;
}
void EnKarebaba_SetupDead(EnKarebaba* this) {
Animation_Change(&this->skelAnime, &D_060002B8, 0.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f);
Animation_Change(&this->skelAnime, &gDekuBabaFastChompAnim, 0.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f);
EnKarebaba_ResetCollider(this);
this->actor.shape.rot.x = -0x4000;
this->actor.params = 200;
@ -447,7 +441,7 @@ void EnKarebaba_Update(Actor* thisx, GlobalContext* globalCtx) {
}
}
void EnKarebaba_DrawCenterShadow(EnKarebaba* this, GlobalContext* globalCtx) {
void EnKarebaba_DrawBaseShadow(EnKarebaba* this, GlobalContext* globalCtx) {
MtxF mf;
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_karebaba.c", 1013);
@ -467,11 +461,11 @@ void EnKarebaba_DrawCenterShadow(EnKarebaba* this, GlobalContext* globalCtx) {
void EnKarebaba_Draw(Actor* thisx, GlobalContext* globalCtx) {
static Color_RGBA8 black = { 0, 0, 0, 0 };
static Gfx* dLists[] = { D_06001330, D_06001628, D_06001828 };
static Gfx* stemDLists[] = { gDekuBabaStemTopDL, gDekuBabaStemMiddleDL, gDekuBabaStemBaseDL };
static Vec3f zeroVec = { 0.0f, 0.0f, 0.0f };
EnKarebaba* this = THIS;
s32 i;
s32 numDLists;
s32 stemSections;
f32 scale;
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_karebaba.c", 1056);
@ -483,7 +477,7 @@ void EnKarebaba_Draw(Actor* thisx, GlobalContext* globalCtx) {
Matrix_Translate(0.0f, 0.0f, 200.0f, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_karebaba.c", 1066),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, D_06003070);
gSPDisplayList(POLY_OPA_DISP++, gDekuBabaStickDropDL);
}
} else if (this->actionFunc != EnKarebaba_Dead) {
func_80026230(globalCtx, &black, 1, 2);
@ -500,16 +494,16 @@ void EnKarebaba_Draw(Actor* thisx, GlobalContext* globalCtx) {
Matrix_RotateRPY(this->actor.shape.rot.x, this->actor.shape.rot.y, 0, MTXMODE_APPLY);
if (this->actionFunc == EnKarebaba_Dying) {
numDLists = 2;
stemSections = 2;
} else {
numDLists = 3;
stemSections = 3;
}
for (i = 0; i < numDLists; i++) {
for (i = 0; i < stemSections; i++) {
Matrix_Translate(0.0f, 0.0f, -2000.0f, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_karebaba.c", 1116),
G_MTX_LOAD | G_MTX_NOPUSH | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, dLists[i]);
gSPDisplayList(POLY_OPA_DISP++, stemDLists[i]);
if (i == 0 && this->actionFunc == EnKarebaba_Dying) {
Matrix_MultVec3f(&zeroVec, &this->actor.focus.pos);
@ -530,13 +524,13 @@ void EnKarebaba_Draw(Actor* thisx, GlobalContext* globalCtx) {
Matrix_RotateY(this->actor.home.rot.y * (M_PI / 0x8000), MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_karebaba.c", 1144),
G_MTX_LOAD | G_MTX_NOPUSH | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, D_060010F0);
gSPDisplayList(POLY_OPA_DISP++, gDekuBabaBaseLeavesDL);
if (this->actionFunc == EnKarebaba_Dying) {
Matrix_RotateRPY(-0x4000, (s16)(this->actor.shape.rot.y - this->actor.home.rot.y), 0, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_karebaba.c", 1155),
G_MTX_LOAD | G_MTX_NOPUSH | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, D_06001828);
gSPDisplayList(POLY_OPA_DISP++, gDekuBabaStemBaseDL);
}
func_80026608(globalCtx);
@ -544,6 +538,6 @@ void EnKarebaba_Draw(Actor* thisx, GlobalContext* globalCtx) {
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_karebaba.c", 1163);
if (this->boundFloor != NULL) {
EnKarebaba_DrawCenterShadow(this, globalCtx);
EnKarebaba_DrawBaseShadow(this, globalCtx);
}
}

View file

@ -878,7 +878,7 @@ void EnTite_CheckDamage(Actor* thisx, GlobalContext* globalCtx) {
if (thisx->colChkInfo.health == 0) {
EnTite_SetupDeathCry(this);
} else {
// Flip tektite back up if it's on it's back
// Flip tektite back up if it's on its back
Audio_PlayActorSound2(thisx, NA_SE_EN_TEKU_DAMAGE);
if (this->flipState != TEKTITE_FLIPPED) {
EnTite_SetupRecoil(this);