1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-03 06:24:30 +00:00

Decompile object_gol (gohma actor) (#871)

* Decompile object_gol

* Update src/overlays/actors/ovl_En_Goma/z_en_goma.h

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>

Co-authored-by: fig02 <fig02srl@gmail.com>
Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>
This commit is contained in:
Dragorn421 2021-08-11 19:29:57 +02:00 committed by GitHub
parent d95639b993
commit 1b1487a504
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 111 additions and 100 deletions

View file

@ -1,5 +1,6 @@
#include "z_en_goma.h"
#include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h"
#include "objects/object_gol/object_gol.h"
#include "overlays/actors/ovl_Boss_Goma/z_boss_goma.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
@ -43,17 +44,6 @@ void EnGoma_SetupLand(EnGoma* this);
void EnGoma_SetupJump(EnGoma* this);
void EnGoma_SetupStunned(EnGoma* this, GlobalContext* globalCtx);
extern AnimationHeader D_0600017C;
extern AnimationHeader D_06000334;
extern AnimationHeader D_06000544;
extern AnimationHeader D_06000838;
extern AnimationHeader D_06000B78;
extern AnimationHeader D_06000E4C;
extern AnimationHeader D_06001548;
extern Gfx D_06002A70[]; // Egg DL
extern SkeletonHeader D_06003B40;
extern AnimationHeader D_06003D78;
const ActorInit En_Goma_InitVars = {
ACTOR_BOSS_GOMA,
ACTORCAT_ENEMY,
@ -148,8 +138,9 @@ void EnGoma_Init(Actor* thisx, GlobalContext* globalCtx) {
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.0f);
} else { // Egg
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 40.0f);
SkelAnime_Init(globalCtx, &this->skelanime, &D_06003B40, &D_06001548, this->jointTable, this->morphTable, 24);
Animation_PlayLoop(&this->skelanime, &D_06001548);
SkelAnime_Init(globalCtx, &this->skelanime, &gObjectGolSkel, &gObjectGolStandAnim, this->jointTable,
this->morphTable, GOMA_LIMB_MAX);
Animation_PlayLoop(&this->skelanime, &gObjectGolStandAnim);
this->actor.colChkInfo.health = 2;
if (this->actor.params < 3) { // Spawned by boss
@ -190,8 +181,8 @@ void EnGoma_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
void EnGoma_SetupFlee(EnGoma* this) {
Animation_Change(&this->skelanime, &D_06003D78, 2.0f, 0.0f, Animation_GetLastFrame(&D_06003D78), ANIMMODE_LOOP,
-2.0f);
Animation_Change(&this->skelanime, &gObjectGolRunningAnim, 2.0f, 0.0f,
Animation_GetLastFrame(&gObjectGolRunningAnim), ANIMMODE_LOOP, -2.0f);
this->actionFunc = EnGoma_Flee;
this->actionTimer = 20;
@ -306,8 +297,8 @@ void EnGoma_Egg(EnGoma* this, GlobalContext* globalCtx) {
}
void EnGoma_SetupHatch(EnGoma* this, GlobalContext* globalCtx) {
Animation_Change(&this->skelanime, &D_06000544, 1.0f, 0.0f, Animation_GetLastFrame(&D_06000544), ANIMMODE_ONCE,
0.0f);
Animation_Change(&this->skelanime, &gObjectGolJumpHeadbuttAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gObjectGolJumpHeadbuttAnim), ANIMMODE_ONCE, 0.0f);
this->actionFunc = EnGoma_Hatch;
Actor_SetScale(&this->actor, 0.005f);
this->gomaType = ENGOMA_NORMAL;
@ -327,8 +318,8 @@ void EnGoma_Hatch(EnGoma* this, GlobalContext* globalCtx) {
}
void EnGoma_SetupHurt(EnGoma* this, GlobalContext* globalCtx) {
Animation_Change(&this->skelanime, &D_06000838, 1.0f, 0.0f, Animation_GetLastFrame(&D_06000838), ANIMMODE_ONCE,
-2.0f);
Animation_Change(&this->skelanime, &gObjectGolDamagedAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gObjectGolDamagedAnim), ANIMMODE_ONCE, -2.0f);
this->actionFunc = EnGoma_Hurt;
if ((s8)this->actor.colChkInfo.health <= 0) {
@ -364,8 +355,8 @@ void EnGoma_Hurt(EnGoma* this, GlobalContext* globalCtx) {
}
void EnGoma_SetupDie(EnGoma* this) {
Animation_Change(&this->skelanime, &D_06000B78, 1.0f, 0.0f, Animation_GetLastFrame(&D_06000B78), ANIMMODE_ONCE,
-2.0f);
Animation_Change(&this->skelanime, &gObjectGolDeathAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gObjectGolDeathAnim),
ANIMMODE_ONCE, -2.0f);
this->actionFunc = EnGoma_Die;
this->actionTimer = 30;
@ -400,8 +391,8 @@ void EnGoma_Die(EnGoma* this, GlobalContext* globalCtx) {
}
void EnGoma_SetupDead(EnGoma* this) {
Animation_Change(&this->skelanime, &D_06000334, 1.0f, 0.0f, Animation_GetLastFrame(&D_06000334), ANIMMODE_LOOP,
-2.0f);
Animation_Change(&this->skelanime, &gObjectGolDeadTwitchingAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gObjectGolDeadTwitchingAnim), ANIMMODE_LOOP, -2.0f);
this->actionFunc = EnGoma_Dead;
this->actionTimer = 3;
}
@ -437,23 +428,23 @@ void EnGoma_Dead(EnGoma* this, GlobalContext* globalCtx) {
void EnGoma_SetupStand(EnGoma* this) {
f32 lastFrame;
lastFrame = Animation_GetLastFrame(&D_06001548);
lastFrame = Animation_GetLastFrame(&gObjectGolStandAnim);
this->actionTimer = Rand_S16Offset(10, 30);
Animation_Change(&this->skelanime, &D_06001548, 1.0f, 0.0f, lastFrame, ANIMMODE_LOOP, -5.0f);
Animation_Change(&this->skelanime, &gObjectGolStandAnim, 1.0f, 0.0f, lastFrame, ANIMMODE_LOOP, -5.0f);
this->actionFunc = EnGoma_Stand;
this->gomaType = ENGOMA_NORMAL;
}
void EnGoma_SetupChasePlayer(EnGoma* this) {
Animation_Change(&this->skelanime, &D_06003D78, 1.0f, 0.0f, Animation_GetLastFrame(&D_06003D78), ANIMMODE_LOOP,
-5.0f);
Animation_Change(&this->skelanime, &gObjectGolRunningAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gObjectGolRunningAnim), ANIMMODE_LOOP, -5.0f);
this->actionFunc = EnGoma_ChasePlayer;
this->actionTimer = Rand_S16Offset(70, 110);
}
void EnGoma_SetupPrepareJump(EnGoma* this) {
Animation_Change(&this->skelanime, &D_06000E4C, 1.0f, 0.0f, Animation_GetLastFrame(&D_06000E4C), ANIMMODE_ONCE,
-5.0f);
Animation_Change(&this->skelanime, &gObjectGolPrepareJumpAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gObjectGolPrepareJumpAnim), ANIMMODE_ONCE, -5.0f);
this->actionFunc = EnGoma_PrepareJump;
this->actionTimer = 30;
}
@ -475,8 +466,8 @@ void EnGoma_PrepareJump(EnGoma* this, GlobalContext* globalCtx) {
}
void EnGoma_SetupLand(EnGoma* this) {
Animation_Change(&this->skelanime, &D_0600017C, 1.0f, 0.0f, Animation_GetLastFrame(&D_0600017C), ANIMMODE_ONCE,
0.0f);
Animation_Change(&this->skelanime, &gObjectGolLandFromJumpAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gObjectGolLandFromJumpAnim), ANIMMODE_ONCE, 0.0f);
this->actionFunc = EnGoma_Land;
this->actionTimer = 10;
}
@ -493,8 +484,8 @@ void EnGoma_Land(EnGoma* this, GlobalContext* globalCtx) {
}
void EnGoma_SetupJump(EnGoma* this) {
Animation_Change(&this->skelanime, &D_06000544, 1.0f, 0.0f, Animation_GetLastFrame(&D_06000544), ANIMMODE_ONCE,
0.0f);
Animation_Change(&this->skelanime, &gObjectGolJumpHeadbuttAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gObjectGolJumpHeadbuttAnim), ANIMMODE_ONCE, 0.0f);
this->actionFunc = EnGoma_Jump;
this->actor.velocity.y = 8.0f;
@ -557,7 +548,7 @@ void EnGoma_ChasePlayer(EnGoma* this, GlobalContext* globalCtx) {
void EnGoma_SetupStunned(EnGoma* this, GlobalContext* globalCtx) {
this->actionFunc = EnGoma_Stunned;
this->stunTimer = 100;
Animation_MorphToLoop(&this->skelanime, &D_06001548, -5.0f);
Animation_MorphToLoop(&this->skelanime, &gObjectGolStandAnim, -5.0f);
this->actionTimer = (s16)Rand_ZeroFloat(15.0f) + 3;
if (this->actor.params < 6) {
@ -759,10 +750,10 @@ s32 EnGoma_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList
gDPSetEnvColor(POLY_OPA_DISP++, (s16)this->eyeEnvColor[0], (s16)this->eyeEnvColor[1], (s16)this->eyeEnvColor[2],
255);
if (limbIndex == 7) {
if (limbIndex == GOMA_LIMB_EYE_IRIS_ROOT1) {
rot->x += this->eyePitch;
rot->y += this->eyeYaw;
} else if (limbIndex == 3 && this->hurtTimer != 0) {
} else if (limbIndex == GOMA_LIMB_BODY && this->hurtTimer != 0) {
gDPSetEnvColor(POLY_OPA_DISP++, (s16)(Rand_ZeroOne() * 255.0f), (s16)(Rand_ZeroOne() * 255.0f),
(s16)(Rand_ZeroOne() * 255.0f), 255);
}
@ -825,7 +816,7 @@ void EnGoma_Draw(Actor* thisx, GlobalContext* globalCtx) {
Matrix_RotateX(this->eggPitch, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_goma.c", 2101),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, D_06002A70);
gSPDisplayList(POLY_OPA_DISP++, gObjectGolEggDL);
Matrix_Pop();
break;

View file

@ -15,6 +15,34 @@ struct EnGoma;
typedef void (*EnGomaActionFunc)(struct EnGoma*, GlobalContext*);
typedef enum {
/* 0 */ GOMA_LIMB_NONE,
/* 1 */ GOMA_LIMB_ROOT1,
/* 2 */ GOMA_LIMB_ROOT2,
/* 3 */ GOMA_LIMB_BODY,
/* 4 */ GOMA_LIMB_ANTENNA_ROOT1,
/* 5 */ GOMA_LIMB_ANTENNA_ROOT2,
/* 6 */ GOMA_LIMB_ANTENNA,
/* 7 */ GOMA_LIMB_EYE_IRIS_ROOT1,
/* 8 */ GOMA_LIMB_EYE_IRIS_ROOT2,
/* 9 */ GOMA_LIMB_EYE_IRIS,
/* 10 */ GOMA_LIMB_L_LEG_ROOT1,
/* 11 */ GOMA_LIMB_L_LEG_ROOT2,
/* 12 */ GOMA_LIMB_L_SHIN_ROOT,
/* 13 */ GOMA_LIMB_L_FOOT_ROOT,
/* 14 */ GOMA_LIMB_L_FOOT,
/* 15 */ GOMA_LIMB_L_SHIN,
/* 16 */ GOMA_LIMB_L_THIGH,
/* 17 */ GOMA_LIMB_R_LEG_ROOT1,
/* 18 */ GOMA_LIMB_R_LEG_ROOT2,
/* 19 */ GOMA_LIMB_R_SHIN_ROOT,
/* 20 */ GOMA_LIMB_R_FOOT_ROOT,
/* 21 */ GOMA_LIMB_R_FOOT,
/* 22 */ GOMA_LIMB_R_SHIN,
/* 23 */ GOMA_LIMB_R_THIGH,
/* 24 */ GOMA_LIMB_MAX
} EnGomaLimb;
typedef struct EnGoma {
/* 0x000 */ Actor actor;
/* 0x14C */ SkelAnime skelanime;