EnWiz (Wizrobe) OK and documented, EnWizFire (Wizrobe Magic) documented, object_wiz documented (#1054)

* Good start

* Limb draw stuff OK

* A ton more functions

* func_80A477E8 OK

* func_80A456A0 OK

* func_80A460A4 OK

* func_80A46990 OK

* func_80A46414 OK

* EnWiz_Update OK

* func_80A45CD8 OK
Co-authored-by: petrie911 <pmontag@PHYS-S129.iowa.uiowa.edu>

* EnWiz_Draw OK

* Use generated reloc and object symbols

* Document object stuff related to Wizzrobe itself

* Some more names

* A bunch more names

* Name even more stuff (sensing a pattern?)

* Document damage tables and damage effects

* Bunch of stuff mostly related to ghosts

* Name all struct vars and functions

* Fix WizFire build issue

* Split up dmgFlags

* Apparently it's spelled "Wizrobe" in this game

* Name all assets EXCEPT the ones used by wiz_fire

* Apparently, the blob is vertices

* Name all remaining variables

* Some function comments

* (Probably) the final touches on EnWiz docs before PR

* Name a ton of stuff in EnWizFire

* Finish naming everything in EnWizFire

* Finish documentation

* Respond to Engineer's clean-up review

* Respond to Anghelo's first review

* Use TATL_HINT_ID enum

* Enum comments for animations, and better names for some damage effects

* Fix build after merging master

* Respond to Elliptic's review

* Define INITIAL_CUR_PLATFORM_INDEX

* Drop _CUR_ from the name

* Rename one of the enum values

* Respond to Elliptic's WizFire review

* Every switch has a default
This commit is contained in:
Tom Overton
2022-10-01 08:14:06 -07:00
committed by GitHub
parent bbc8aec36a
commit c3c08e944c
12 changed files with 2178 additions and 706 deletions
+2 -2
View File
@@ -241,10 +241,10 @@ void EnFz_Destroy(Actor* thisx, PlayState* play) {
Collider_DestroyCylinder(play, &this->collider3);
if ((this->actor.parent != NULL) && (this->unk_BC4 == 0) && (this->actor.parent->id == ACTOR_EN_WIZ) &&
(this->actor.parent->update != NULL) && (((EnWiz*)this->actor.parent)->unk_448 != 0)) {
(this->actor.parent->update != NULL) && (((EnWiz*)this->actor.parent)->freezard != NULL)) {
EnWiz* wiz = (EnWiz*)this->actor.parent;
wiz->unk_448 = 0;
wiz->freezard = NULL;
}
}
File diff suppressed because it is too large Load Diff
+65 -8
View File
@@ -2,6 +2,16 @@
#define Z_EN_WIZ_H
#include "global.h"
#include "objects/object_wiz/object_wiz.h"
#define EN_WIZ_GET_SWITCHFLAG(thisx) ((thisx)->params & 0x7F)
#define EN_WIZ_GET_TYPE(thisx) (((thisx)->params >> 8) & 0xFF)
typedef enum {
/* 0 */ EN_WIZ_TYPE_FIRE,
/* 1 */ EN_WIZ_TYPE_ICE,
/* 2 */ EN_WIZ_TYPE_FIRE_NO_BGM, // does not request the mini-boss BGM
} EnWizType;
struct EnWiz;
@@ -9,15 +19,62 @@ typedef void (*EnWizActionFunc)(struct EnWiz*, PlayState*);
typedef struct EnWiz {
/* 0x000 */ Actor actor;
/* 0x144 */ char unk_144[0x268];
/* 0x144 */ SkelAnime skelAnime;
/* 0x188 */ Vec3s jointTable[WIZROBE_LIMB_MAX];
/* 0x200 */ Vec3s morphTable[WIZROBE_LIMB_MAX];
/* 0x278 */ SkelAnime ghostSkelAnime;
/* 0x2BC */ Vec3s ghostBaseJointTable[WIZROBE_LIMB_MAX];
/* 0x334 */ Vec3s ghostMorphTable[WIZROBE_LIMB_MAX];
/* 0x3AC */ EnWizActionFunc actionFunc;
/* 0x3B0 */ char unk_3B0[0xA];
/* 0x3BA */ s16 unk_3BA;
/* 0x3BC */ char unk_3BC[0x8C];
/* 0x448 */ s32 unk_448;
/* 0x44C */ char unk_44C[0x2FE];
/* 0x74A */ s16 unk_74A;
/* 0x74C */ char unk_74C[0x634];
/* 0x3B0 */ s16 action;
/* 0x3B2 */ s16 timer;
/* 0x3B4 */ s16 introCutsceneTimer;
/* 0x3B6 */ s16 fightState;
/* 0x3B8 */ s16 staffFlameScroll;
/* 0x3BA */ s16 hasActiveProjectile;
/* 0x3BC */ s16 hasRunToEveryPlatform; // used for the second phase cutscene to make sure the Wizrobe visits every platform
/* 0x3BE */ s16 unk_3BE; // unused, inferred from surrounding members
/* 0x3C0 */ s16 rotationalVelocity;
/* 0x3C2 */ s16 alpha;
/* 0x3C4 */ s16 platformLightAlpha;
/* 0x3C6 */ s16 targetPlatformLightAlpha;
/* 0x3C8 */ s16 introCutsceneCameraAngle;
/* 0x3CA */ u8 shouldStartTimer;
/* 0x3CB */ u8 introCutsceneState;
/* 0x3CC */ s32 musicStartTimer;
/* 0x3D0 */ f32 endFrame;
/* 0x3D4 */ f32 scale;
/* 0x3D8 */ Vec3f staffFlamePos;
/* 0x3E4 */ Vec3f staffFlameScale;
/* 0x3F0 */ Vec3f staffTargetFlameScale;
/* 0x3FC */ Vec3f unk_3FC; // unused, inferred from surrounding members
/* 0x408 */ Vec3f unk_408; // unused, inferred from surrounding members
/* 0x414 */ Vec3f platformLightPos;
/* 0x420 */ Actor* platforms[10];
/* 0x448 */ Actor* freezard;
/* 0x44C */ s16 animLoopCounter;
/* 0x450 */ f32 unk_450; // set to 1.0f, but never used
/* 0x454 */ ColliderJntSph ghostColliders;
/* 0x474 */ ColliderJntSphElement ghostColliderElements[10];
/* 0x6F4 */ ColliderCylinder collider;
/* 0x740 */ s32 platformCount;
/* 0x744 */ s32 nextPlatformIndex; // used for the second phase cutscene to dictate where the Wizrobe should run to next
/* 0x748 */ s16 curPlatformIndex;
/* 0x74A */ s16 type;
/* 0x74C */ s16 switchFlag;
/* 0x74E */ s16 subCamId;
/* 0x750 */ s16 isDead;
/* 0x752 */ s16 drawDmgEffTimer;
/* 0x754 */ s16 drawDmgEffType;
/* 0x758 */ f32 drawDmgEffScale;
/* 0x75C */ f32 drawDmgEffFrozenSteamScale;
/* 0x760 */ Vec3f bodyPartsPos[12];
/* 0x7F0 */ s16 bodyPartsPosIndex;
/* 0x7F2 */ s16 ghostAlpha[10];
/* 0x806 */ s16 ghostNextPlatformIndex[10];
/* 0x81C */ Vec3f ghostPos[10];
/* 0x894 */ Vec3s ghostRot[10];
/* 0x8D0 */ Vec3s ghostJointTables[10][WIZROBE_LIMB_MAX];
} EnWiz; // size = 0xD80
extern const ActorInit En_Wiz_InitVars;
@@ -1,7 +1,7 @@
/*
* File: z_en_wiz_brock.c
* Overlay: ovl_En_Wiz_Brock
* Description: Wizzrobe Warp Platform
* Description: Wizrobe Warp Platform
*/
#include "z_en_wiz_brock.h"
@@ -11,13 +11,6 @@
#define THIS ((EnWizBrock*)thisx)
typedef enum {
PLATFORM_TYPE_INACTIVE,
PLATFORM_TYPE_FIRE,
PLATFORM_TYPE_ICE,
PLATFORM_TYPE_MAX,
} PlatformType;
void EnWizBrock_Init(Actor* thisx, PlayState* play);
void EnWizBrock_Destroy(Actor* thisx, PlayState* play);
void EnWizBrock_Update(Actor* thisx, PlayState* play);
@@ -26,7 +19,7 @@ void EnWizBrock_Draw(Actor* thisx, PlayState* play);
void EnWizBrock_SetupUpdateStatus(EnWizBrock* this, PlayState* play);
void EnWizBrock_UpdateStatus(EnWizBrock* this, PlayState* play);
s16 platformCount = 0;
s16 sPlatformIndex = 0;
const ActorInit En_Wiz_Brock_InitVars = {
ACTOR_EN_WIZ_BROCK,
@@ -45,13 +38,13 @@ void EnWizBrock_Init(Actor* thisx, PlayState* play) {
CollisionHeader* colHeader = NULL;
DynaPolyActor_Init(&this->dyna, 0);
CollisionHeader_GetVirtual(&object_wiz_Colheader_001690, &colHeader);
CollisionHeader_GetVirtual(&gWizrobePlatformCol, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
this->dyna.actor.colChkInfo.mass = MASS_IMMOVABLE;
this->dyna.actor.colChkInfo.health = 3;
this->unk_1A6 = 0;
Actor_SetScale(&this->dyna.actor, 0.01f);
this->platformNum = platformCount++;
this->platformIndex = sPlatformIndex++;
this->actionFunc = EnWizBrock_SetupUpdateStatus;
this->dyna.actor.scale.x = this->dyna.actor.scale.y = this->dyna.actor.scale.z = 0.01f;
this->alpha = 255.0f;
@@ -68,12 +61,12 @@ void EnWizBrock_SetupUpdateStatus(EnWizBrock* this, PlayState* play) {
}
/**
* @brief Checks the platform status, when the Wizzrobe is defeated, which triggers timer to
* @brief Checks the platform status, when the Wizrobe is defeated, which triggers timer to
* count up to 30 at which point the platforms are despawned.
*/
void EnWizBrock_UpdateStatus(EnWizBrock* this, PlayState* play) {
if (this->platformType == PLATFORM_TYPE_INACTIVE) {
if (this->dyna.actor.colChkInfo.health != PLATFORM_TYPE_MAX) {
if (this->platformType == EN_WIZ_BROCK_PLATFORM_TYPE_INACTIVE) {
if (this->dyna.actor.colChkInfo.health != EN_WIZ_BROCK_PLATFORM_TYPE_MAX) {
this->platformType = this->dyna.actor.colChkInfo.health;
}
}
@@ -115,30 +108,30 @@ void EnWizBrock_Draw(Actor* thisx, PlayState* play) {
Scene_SetRenderModeXlu(play, 0, 1);
gDPPipeSync(POLY_OPA_DISP++);
gDPSetEnvColor(POLY_OPA_DISP++, 255, 255, 255, 255);
Gfx_DrawDListOpa(play, gWizzrobePlatform);
Gfx_DrawDListOpa(play, gWizrobePlatformDL);
} else {
Scene_SetRenderModeXlu(play, 1, 2);
gDPPipeSync(POLY_XLU_DISP++);
gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, (s16)this->alpha);
Gfx_DrawDListXlu(play, gWizzrobePlatform);
Gfx_DrawDListXlu(play, gWizrobePlatformDL);
}
CLOSE_DISPS(play->state.gfxCtx);
if (this->platformType != PLATFORM_TYPE_INACTIVE) {
if (this->platformType != EN_WIZ_BROCK_PLATFORM_TYPE_INACTIVE) {
OPEN_DISPS(play->state.gfxCtx);
AnimatedMat_Draw(play, Lib_SegmentedToVirtual(&gWizzrobePlatformTexAnim));
AnimatedMat_Draw(play, Lib_SegmentedToVirtual(&gWizrobePlatformCenterTexAnim));
gDPPipeSync(POLY_XLU_DISP++);
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 255, 255);
if (this->platformType == PLATFORM_TYPE_FIRE) {
if (this->platformType == EN_WIZ_BROCK_PLATFORM_TYPE_FIRE) {
gDPSetEnvColor(POLY_XLU_DISP++, 255, 00, 100, (s16)this->alpha);
} else {
gDPSetEnvColor(POLY_XLU_DISP++, 50, 00, 255, (s16)this->alpha);
}
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, &gWizzrobePlatformCenter);
gSPDisplayList(POLY_XLU_DISP++, &gWizrobePlatformCenterDL);
CLOSE_DISPS(play->state.gfxCtx);
}
@@ -3,6 +3,13 @@
#include "global.h"
typedef enum {
/* 0 */ EN_WIZ_BROCK_PLATFORM_TYPE_INACTIVE,
/* 1 */ EN_WIZ_BROCK_PLATFORM_TYPE_FIRE,
/* 2 */ EN_WIZ_BROCK_PLATFORM_TYPE_ICE,
/* 3 */ EN_WIZ_BROCK_PLATFORM_TYPE_MAX,
} EnWizBrockPlatformType;
struct EnWizBrock;
typedef void (*EnWizBrockActionFunc)(struct EnWizBrock*, PlayState*);
@@ -12,8 +19,8 @@ typedef struct EnWizBrock {
/* 0x15C */ UNK_TYPE1 unk_15C[0x44];
/* 0x1A0 */ EnWizBrockActionFunc actionFunc;
/* 0x1A4 */ s16 timer; // Counter for despawing blocks (Max of 37)
/* 0x1A6 */ s16 unk_1A6; // TODO: set but not used maybe used in wizzrobe?
/* 0x1A8 */ s16 platformNum; // Numeric identifier for platform
/* 0x1A6 */ s16 unk_1A6; // set to 0, but never used
/* 0x1A8 */ s16 platformIndex; // Numeric identifier for platform
/* 0x1AA */ s16 platformType; // Determines element type for platform (ice/fire)
/* 0x1AC */ f32 alpha;
} EnWizBrock; // size = 0x1B0
File diff suppressed because it is too large Load Diff
@@ -3,52 +3,65 @@
#include "global.h"
typedef enum {
/* 0 */ EN_WIZ_FIRE_TYPE_MAGIC_PROJECTILE,
/* 1 */ EN_WIZ_FIRE_TYPE_ARCING_MAGIC_PROJECTILE,
/* 2 */ EN_WIZ_FIRE_TYPE_SMALL_FLAME,
/* 3 */ EN_WIZ_FIRE_TYPE_REFLECTED_MAGIC_PROJECTILE,
/* 4 */ EN_WIZ_FIRE_TYPE_ICE_MAGIC_PROJECTILE
} EnWizFireType;
#define EN_WIZ_FIRE_GET_TYPE(thisx) ((thisx)->params)
struct EnWizFire;
typedef void (*EnWizFireActionFunc)(struct EnWizFire*, PlayState*);
typedef struct {
/* 0x00 */ u8 unk_00;
/* 0x01 */ u8 unk_01;
/* 0x00 */ u8 isEnabled;
/* 0x01 */ u8 smokeScroll;
/* 0x02 */ UNK_TYPE1 unk02[0x4];
/* 0x06 */ s16 unk_06;
/* 0x08 */ s16 unk_08;
/* 0x0A */ UNK_TYPE1 unk0A[0x2];
/* 0x0C */ f32 unk_0C;
/* 0x10 */ Vec3f unk_10;
/* 0x1C */ Vec3f unk_1C;
/* 0x28 */ Vec3f unk_28;
} EnWizFireStruct; // size = 0x34
/* 0x06 */ s16 alpha;
/* 0x08 */ s16 shouldDecreaseAlpha;
/* 0x0C */ f32 scale;
/* 0x10 */ Vec3f pos;
/* 0x1C */ Vec3f velocity;
/* 0x28 */ Vec3f accel;
} EnWizFireEffect; // size = 0x34
typedef struct EnWizFire {
/* 0x0000 */ Actor actor;
/* 0x0144 */ EnWizFireActionFunc actionFunc;
/* 0x0148 */ u8 unk_148;
/* 0x014C */ f32 unk_14C;
/* 0x0150 */ f32 unk_150;
/* 0x0154 */ f32 unk_154;
/* 0x0158 */ f32 unk_158;
/* 0x015C */ f32 unk_15C;
/* 0x0160 */ s16 unk_160;
/* 0x0162 */ s16 unk_162;
/* 0x0164 */ u8 unk_164;
/* 0x0166 */ s16 unk_166;
/* 0x0168 */ s16 unk_168;
/* 0x016A */ s16 unk_16A;
/* 0x016C */ s16 unk_16C;
/* 0x016E */ s16 unk_16E;
/* 0x0170 */ s16 unk_170;
/* 0x0172 */ s16 unk_172;
/* 0x0174 */ s8 unk_174;
/* 0x0178 */ Vec3f unk_178[10];
/* 0x01F0 */ f32 unk_1F0;
/* 0x01F4 */ f32 unk_1F4;
/* 0x01F8 */ f32 unk_1F8;
/* 0x01FC */ f32 unk_1FC;
/* 0x0200 */ f32 unk_200;
/* 0x0204 */ f32 unk_204;
/* 0x0148 */ u8 hitByIceArrow;
/* 0x014C */ f32 scale;
/* 0x0150 */ f32 targetScale;
/* 0x0154 */ Vec3f scaleMod;
/* 0x0160 */ s16 action;
/* 0x0162 */ s16 type;
/* 0x0164 */ union {
u8 shouldPoolFadeOut;
u8 hasSpawnedSmallFlame;
};
/* 0x0166 */ s16 isIceType;
/* 0x0168 */ s16 timer;
/* 0x016A */ union {
s16 poolTimer;
s16 increaseLowestUsedIndexTimer;
};
/* 0x016C */ s16 steamSpawnTimer;
/* 0x016E */ s16 lowestUsedIndex;
/* 0x0170 */ s16 smallFlameScroll;
/* 0x0172 */ s16 wallCheckTimer; // The projectile won't check for impacts with walls until this is zero
/* 0x0174 */ s8 playerHitByIceProjectile; // Set, but never used
/* 0x0178 */ Vec3f magicProjectilePos[10];
/* 0x01F0 */ f32 poolScale;
/* 0x01F4 */ f32 bigFlameScale;
/* 0x01F8 */ f32 fireSmokeScale;
/* 0x01FC */ f32 alpha;
/* 0x0200 */ f32 blendScale;
/* 0x0204 */ f32 blendScaleFrac;
/* 0x0208 */ ColliderCylinder collider;
/* 0x0254 */ EnWizFireStruct unk_254[200];
/* 0x0254 */ EnWizFireEffect effects[200];
} EnWizFire; // size = 0x2AF4
extern const ActorInit En_Wiz_Fire_InitVars;