En_Jg (Goron Elder) OK and documented. Also document object_jg (#594)

* Migrate data to C

* Init / Destroy / Update / Draw

* Functions called from Update

* Better Init match

* A few more functions

* A few more functions

* Drum-spawning function OK

* EnJg OK

* Name a few struct vars

* Name some static vars

* Name limbs

* Name limb DLs

* Name some textures

* Name all remaining textures

* First pass animation names + use object in actor file

* Add drum to XML + clean it up

* Better translations, thanks Emily!

* Some more documentation

* Improvements

* Params accessor for s_goro

* Proper object symbols for Jg_Gakki

* Delete unnecessary undefined_syms

* Text defines for my own sanity

* Some more names

* Document point/path stuff

* Name every function, even if the names are bad

* Params macro for if he's in goron shrine

* Some misc improvements

* Document EnJg_GetShrineGoronToFocusOn better

* Final cleanup before PR

* Change action name because this actor is dumb!

* Run actorfixer

* Rename some variables now that a function is named

* ProcessTalkRequest takes GameState

* Run actorfixer

* Use new actor flags

* Update text ID names to match my text ID PR

* Define the limb enum in the object

* Be consistent about where the EnumName is

* Don't name limbs after the actor

* Basic enum for drum limb

* Fix stuff after merge

* Do if/else if/else

* Remove textId defines

* Decimal weekEventReg accesses
This commit is contained in:
Tom Overton
2022-02-13 17:07:26 -08:00
committed by GitHub
parent 45cee7d8af
commit 3597e4809f
9 changed files with 1107 additions and 187 deletions
File diff suppressed because it is too large Load Diff
+30 -4
View File
@@ -2,16 +2,42 @@
#define Z_EN_JG_H
#include "global.h"
#include "objects/object_jg/object_jg.h"
#define EN_JG_IS_IN_GORON_SHRINE(thisx) ((thisx)->params & 0x1)
#define EN_JG_GET_PATH(thisx) (((thisx)->params & 0xFC00) >> 10)
struct EnJg;
typedef void (*EnJgActionFunc)(struct EnJg*, GlobalContext*);
typedef struct EnJg {
/* 0x0000 */ Actor actor;
/* 0x0144 */ char unk_144[0x98];
/* 0x01DC */ EnJgActionFunc actionFunc;
/* 0x01E0 */ char unk_1E0[0x1F4];
/* 0x000 */ Actor actor;
/* 0x144 */ Actor* shrineGoron;
/* 0x148 */ Actor* icePoly;
/* 0x14C */ ColliderCylinder collider;
/* 0x198 */ SkelAnime skelAnime;
/* 0x1DC */ EnJgActionFunc actionFunc;
/* 0x1E0 */ Path* path;
/* 0x1E4 */ s32 currentPoint;
/* 0x1E8 */ Actor* drum;
/* 0x1EC */ Vec3s unusedRotation1; // probably meant to be a head rotation to look at the player
/* 0x1F2 */ Vec3s unusedRotation2; // probably meant to be a body rotation to look at the player
/* 0x1F8 */ Vec3s jointTable[GORON_ELDER_LIMB_MAX];
/* 0x2CA */ Vec3s morphTable[GORON_ELDER_LIMB_MAX];
/* 0x39C */ s16 rootRotationWhenTalking;
/* 0x39E */ s16 animationIndex;
/* 0x3A0 */ s16 action;
/* 0x3A2 */ s16 freezeTimer;
/* 0x3A4 */ Vec3f breathPos;
/* 0x3B0 */ Vec3f breathVelocity;
/* 0x3BC */ Vec3f breathAccel;
/* 0x3C8 */ s16 cutscene;
/* 0x3CA */ u8 cutsceneAnimationIndex;
/* 0x3CB */ u8 csAction;
/* 0x3CC */ u16 flags;
/* 0x3CE */ u16 textId;
/* 0x3D0 */ u8 focusedShrineGoronParam;
} EnJg; // size = 0x3D4
extern const ActorInit En_Jg_InitVars;
@@ -1,7 +1,7 @@
/*
* File: z_en_s_goro.c
* Overlay: ovl_En_S_Goro
* Description: Goron Complaining About Crying / Bomb Shop Goron
* Description: Goron in Goron Shrine / Bomb Shop Goron
*/
#include "z_en_s_goro.h"
@@ -3,6 +3,8 @@
#include "global.h"
#define EN_S_GORO_GET_PARAM_F(thisx) ((thisx)->params & 0xF)
struct EnSGoro;
typedef void (*EnSGoroActionFunc)(struct EnSGoro*, GlobalContext*);
@@ -31,16 +31,16 @@ const ActorInit Obj_Jg_Gakki_InitVars = {
void ObjJgGakki_Init(Actor* thisx, GlobalContext* globalCtx2) {
GlobalContext* globalCtx = globalCtx2;
ObjJgGakki* this = THIS;
f32 frameCount = Animation_GetLastFrame(&gGoronElderDrumAnim);
f32 frameCount = Animation_GetLastFrame(&gGoronElderDrumTakeOutAnim);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f);
SkelAnime_Init(globalCtx, &this->skelAnime, &gGoronElderDrumSkel, NULL, NULL, NULL, 0);
if (((globalCtx->sceneNum == SCENE_SPOT00) && (gSaveContext.sceneSetupIndex == 7)) &&
(globalCtx->csCtx.unk_12 == 0)) {
Animation_Change(&this->skelAnime, &gGoronElderDrumAnim, 1.0f, frameCount, frameCount, 2, 0.0f);
Animation_Change(&this->skelAnime, &gGoronElderDrumTakeOutAnim, 1.0f, frameCount, frameCount, 2, 0.0f);
} else if ((globalCtx->sceneNum == SCENE_17SETUGEN) || (globalCtx->sceneNum == SCENE_10YUKIYAMANOMURA)) {
Animation_Change(&this->skelAnime, &gGoronElderDrumAnim, 1.0f, 0.0f, frameCount, 2, 0.0f);
Animation_Change(&this->skelAnime, &gGoronElderDrumTakeOutAnim, 1.0f, 0.0f, frameCount, 2, 0.0f);
} else {
Actor_MarkForDeath(&this->actor);
}