mirror of https://github.com/zeldaret/mm.git
En_wiz_brock OK and documented (#817)
* wiz brock OK * wiz_brok OK and documented * fixing text * fixing PR comments * addressing PR * fixing comma for format
This commit is contained in:
parent
8ba8780bb5
commit
3374f41d1c
|
@ -8,7 +8,7 @@
|
|||
<DList Name="object_wiz_DL_000F28" Offset="0xF28" />
|
||||
<DList Name="object_wiz_DL_000FD8" Offset="0xFD8" />
|
||||
<DList Name="object_wiz_DL_0010E0" Offset="0x10E0" />
|
||||
<DList Name="object_wiz_DL_0010E8" Offset="0x10E8" />
|
||||
<DList Name="gWizzrobePlatform" Offset="0x10E8" />
|
||||
<Texture Name="object_wiz_Tex_001198" OutName="tex_001198" Format="rgba16" Width="16" Height="32" Offset="0x1198" />
|
||||
<!-- <Blob Name="object_wiz_Blob_0015A0" Size="0x10" Offset="0x15A0" /> -->
|
||||
<Collision Name="object_wiz_Colheader_001690" Offset="0x1690" />
|
||||
|
@ -40,11 +40,11 @@
|
|||
<Texture Name="object_wiz_Tex_005230" OutName="tex_005230" Format="i4" Width="32" Height="64" Offset="0x5230" />
|
||||
<Texture Name="object_wiz_Tex_005630" OutName="tex_005630" Format="i4" Width="16" Height="16" Offset="0x5630" />
|
||||
<DList Name="object_wiz_DL_005750" Offset="0x5750" />
|
||||
<DList Name="object_wiz_DL_005870" Offset="0x5870" />
|
||||
<DList Name="gWizzrobePlatformCenter" Offset="0x5870" />
|
||||
<DList Name="object_wiz_DL_005938" Offset="0x5938" />
|
||||
<Texture Name="object_wiz_Tex_005940" OutName="tex_005940" Format="i4" Width="32" Height="32" Offset="0x5940" />
|
||||
<Texture Name="object_wiz_Tex_005B40" OutName="tex_005B40" Format="i4" Width="16" Height="32" Offset="0x5B40" />
|
||||
<TextureAnimation Name="object_wiz_Matanimheader_005C64" Offset="0x5C64" />
|
||||
<TextureAnimation Name="gWizzrobePlatformTexAnim" Offset="0x5C64" />
|
||||
<Animation Name="object_wiz_Anim_0060E8" Offset="0x60E8" />
|
||||
<Animation Name="object_wiz_Anim_0066C0" Offset="0x66C0" />
|
||||
<DList Name="object_wiz_DL_008640" Offset="0x8640" />
|
||||
|
|
3
spec
3
spec
|
@ -2837,8 +2837,7 @@ beginseg
|
|||
name "ovl_En_Wiz_Brock"
|
||||
compress
|
||||
include "build/src/overlays/actors/ovl_En_Wiz_Brock/z_en_wiz_brock.o"
|
||||
include "build/data/ovl_En_Wiz_Brock/ovl_En_Wiz_Brock.data.o"
|
||||
include "build/data/ovl_En_Wiz_Brock/ovl_En_Wiz_Brock.reloc.o"
|
||||
include "build/src/overlays/actors/ovl_En_Wiz_Brock/ovl_En_Wiz_Brock_reloc.o"
|
||||
endseg
|
||||
|
||||
beginseg
|
||||
|
|
|
@ -5,17 +5,29 @@
|
|||
*/
|
||||
|
||||
#include "z_en_wiz_brock.h"
|
||||
#include "objects/object_wiz/object_wiz.h"
|
||||
|
||||
#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_8000000)
|
||||
|
||||
#define THIS ((EnWizBrock*)thisx)
|
||||
|
||||
typedef enum {
|
||||
PLATFORM_TYPE_INACTIVE,
|
||||
PLATFORM_TYPE_FIRE,
|
||||
PLATFORM_TYPE_ICE,
|
||||
PLATFORM_TYPE_MAX,
|
||||
} PlatformType;
|
||||
|
||||
void EnWizBrock_Init(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnWizBrock_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnWizBrock_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnWizBrock_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
|
||||
#if 0
|
||||
void EnWizBrock_SetupUpdateStatus(EnWizBrock* this, GlobalContext* globalCtx);
|
||||
void EnWizBrock_UpdateStatus(EnWizBrock* this, GlobalContext* globalCtx);
|
||||
|
||||
s16 platformCount = 0;
|
||||
|
||||
const ActorInit En_Wiz_Brock_InitVars = {
|
||||
ACTOR_EN_WIZ_BROCK,
|
||||
ACTORCAT_PROP,
|
||||
|
@ -28,19 +40,106 @@ const ActorInit En_Wiz_Brock_InitVars = {
|
|||
(ActorFunc)EnWizBrock_Draw,
|
||||
};
|
||||
|
||||
#endif
|
||||
void EnWizBrock_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnWizBrock* this = THIS;
|
||||
CollisionHeader* colHeader = NULL;
|
||||
|
||||
extern UNK_TYPE D_060010E8;
|
||||
extern UNK_TYPE D_06001690;
|
||||
DynaPolyActor_Init(&this->dyna, 0);
|
||||
CollisionHeader_GetVirtual(&object_wiz_Colheader_001690, &colHeader);
|
||||
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->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->actionFunc = EnWizBrock_SetupUpdateStatus;
|
||||
this->dyna.actor.scale.x = this->dyna.actor.scale.y = this->dyna.actor.scale.z = 0.01f;
|
||||
this->alpha = 255.0f;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Wiz_Brock/EnWizBrock_Init.s")
|
||||
void EnWizBrock_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnWizBrock* this = THIS;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Wiz_Brock/EnWizBrock_Destroy.s")
|
||||
DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Wiz_Brock/func_80A490E4.s")
|
||||
void EnWizBrock_SetupUpdateStatus(EnWizBrock* this, GlobalContext* globalCtx) {
|
||||
this->actionFunc = EnWizBrock_UpdateStatus;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Wiz_Brock/func_80A490FC.s")
|
||||
/**
|
||||
* @brief Checks the platform status, when the Wizzrobe is defeated, which triggers timer to
|
||||
* count up to 30 at which point the platforms are despawned.
|
||||
*/
|
||||
void EnWizBrock_UpdateStatus(EnWizBrock* this, GlobalContext* globalCtx) {
|
||||
if (this->platformType == PLATFORM_TYPE_INACTIVE) {
|
||||
if (this->dyna.actor.colChkInfo.health != PLATFORM_TYPE_MAX) {
|
||||
this->platformType = this->dyna.actor.colChkInfo.health;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Wiz_Brock/EnWizBrock_Update.s")
|
||||
if (this->dyna.actor.colChkInfo.health == 0) {
|
||||
this->timer++;
|
||||
if (this->timer > (BREG(49) + 30)) {
|
||||
Math_ApproachZeroF(&this->dyna.actor.scale.y, (BREG(50) / 10.0f) + 0.3f, (BREG(51) / 10000.0f) + 0.003f);
|
||||
Math_ApproachZeroF(&this->alpha, (BREG(52) / 10.0f) + 1.0f, (BREG(53) / 10.0f) + 35.0f);
|
||||
Math_ApproachF(&this->dyna.actor.scale.x, (BREG(54) / 100.0f) + 0.02f, (BREG(55) / 100.0f) + 0.2f,
|
||||
(BREG(56) / 1000.0f) + 0.002f);
|
||||
this->dyna.actor.scale.z = this->dyna.actor.scale.x;
|
||||
if (this->dyna.actor.scale.y < 0.001f) {
|
||||
Actor_MarkForDeath(&this->dyna.actor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Wiz_Brock/EnWizBrock_Draw.s")
|
||||
void EnWizBrock_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnWizBrock* this = THIS;
|
||||
|
||||
this->actionFunc(this, globalCtx);
|
||||
}
|
||||
|
||||
void EnWizBrock_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
EnWizBrock* this = THIS;
|
||||
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
func_8012C2DC(globalCtx->state.gfxCtx);
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
Matrix_InsertTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z,
|
||||
MTXMODE_NEW);
|
||||
Matrix_Scale(this->dyna.actor.scale.x, this->dyna.actor.scale.y, this->dyna.actor.scale.z, MTXMODE_APPLY);
|
||||
if (this->dyna.actor.colChkInfo.health != 0) {
|
||||
Scene_SetRenderModeXlu(globalCtx, 0, 1);
|
||||
gDPPipeSync(POLY_OPA_DISP++);
|
||||
gDPSetEnvColor(POLY_OPA_DISP++, 255, 255, 255, 255);
|
||||
Gfx_DrawDListOpa(globalCtx, gWizzrobePlatform);
|
||||
|
||||
} else {
|
||||
Scene_SetRenderModeXlu(globalCtx, 1, 2);
|
||||
gDPPipeSync(POLY_XLU_DISP++);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, (s16)this->alpha);
|
||||
Gfx_DrawDListXlu(globalCtx, gWizzrobePlatform);
|
||||
}
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
if (this->platformType != PLATFORM_TYPE_INACTIVE) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&gWizzrobePlatformTexAnim));
|
||||
gDPPipeSync(POLY_XLU_DISP++);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 255, 255);
|
||||
if (this->platformType == 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(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, &gWizzrobePlatformCenter);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,10 +8,14 @@ struct EnWizBrock;
|
|||
typedef void (*EnWizBrockActionFunc)(struct EnWizBrock*, GlobalContext*);
|
||||
|
||||
typedef struct EnWizBrock {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x0144 */ char unk_144[0x5C];
|
||||
/* 0x01A0 */ EnWizBrockActionFunc actionFunc;
|
||||
/* 0x01A4 */ char unk_1A4[0xC];
|
||||
/* 0x000 */ DynaPolyActor dyna;
|
||||
/* 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
|
||||
/* 0x1AA */ s16 platformType; // Determines element type for platform (ice/fire)
|
||||
/* 0x1AC */ f32 alpha;
|
||||
} EnWizBrock; // size = 0x1B0
|
||||
|
||||
extern const ActorInit En_Wiz_Brock_InitVars;
|
||||
|
|
|
@ -10469,8 +10469,8 @@
|
|||
0x80A483B4:("EnWiz_Draw",),
|
||||
0x80A48FE0:("EnWizBrock_Init",),
|
||||
0x80A490B0:("EnWizBrock_Destroy",),
|
||||
0x80A490E4:("func_80A490E4",),
|
||||
0x80A490FC:("func_80A490FC",),
|
||||
0x80A490E4:("EnWizBrock_SetupUpdateStatus",),
|
||||
0x80A490FC:("EnWizBrock_UpdateStatus",),
|
||||
0x80A492E4:("EnWizBrock_Update",),
|
||||
0x80A49308:("EnWizBrock_Draw",),
|
||||
0x80A496A0:("EnWizFire_Init",),
|
||||
|
|
|
@ -1555,13 +1555,6 @@ D_060025F0 = 0x060025F0;
|
|||
D_060066C0 = 0x060066C0;
|
||||
D_0600B320 = 0x0600B320;
|
||||
|
||||
// ovl_En_Wiz_Brock
|
||||
|
||||
D_060010E8 = 0x060010E8;
|
||||
D_06001690 = 0x06001690;
|
||||
D_06005870 = 0x06005870;
|
||||
D_06005C64 = 0x06005C64;
|
||||
|
||||
// ovl_En_Zl4
|
||||
|
||||
D_06013328 = 0x06013328;
|
||||
|
|
Loading…
Reference in New Issue