diff --git a/assets/xml/objects/object_fz.xml b/assets/xml/objects/object_fz.xml
index 0c0b2ce2b4..1c90f5f596 100644
--- a/assets/xml/objects/object_fz.xml
+++ b/assets/xml/objects/object_fz.xml
@@ -1,12 +1,13 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_po_composer.xml b/assets/xml/objects/object_po_composer.xml
index 51b07ac7f2..d2f4488508 100644
--- a/assets/xml/objects/object_po_composer.xml
+++ b/assets/xml/objects/object_po_composer.xml
@@ -22,9 +22,9 @@
-
+
-
+
@@ -32,18 +32,20 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/include/build.h b/include/build.h
index fa86f5ceed..25afaaa811 100644
--- a/include/build.h
+++ b/include/build.h
@@ -1,8 +1,8 @@
#ifndef BUILD_H
#define BUILD_H
-extern char gBuildCreator[];
-extern char gBuildDate[];
-extern char gBuildMakeOption[];
+extern const char gBuildCreator[];
+extern const char gBuildDate[];
+extern const char gBuildMakeOption[];
#endif
diff --git a/include/z64message.h b/include/z64message.h
index 76494b8551..da4349d69f 100644
--- a/include/z64message.h
+++ b/include/z64message.h
@@ -301,7 +301,7 @@ void Message_DrawItemIcon(struct PlayState* play, Gfx** gfxP);
void Message_HandleOcarina(struct PlayState* play);
void Message_LoadItemIcon(struct PlayState* play, u16 itemId, s16 arg2);
void Message_DecodeHeader(struct PlayState* play);
-void func_801514B0(struct PlayState* play, u16 arg1, u8 arg2);
+void Message_PauseMenu_ShowDescription(struct PlayState* play, u16 textId, u8 textBoxPos);
void Message_StartTextbox(struct PlayState* play, u16 textId, struct Actor* actor);
void Message_ContinueTextbox(struct PlayState* play, u16 textId);
void Message_DisplaySceneTitleCard(struct PlayState* play, u16 textId);
diff --git a/include/z64save.h b/include/z64save.h
index 5d0f5bff57..36e9f3bae2 100644
--- a/include/z64save.h
+++ b/include/z64save.h
@@ -744,8 +744,8 @@ typedef enum {
// Attempted Cremia Cart Ride
#define WEEKEVENTREG_14_01 PACK_WEEKEVENTREG_FLAG(14, 0x01)
-#define WEEKEVENTREG_14_02 PACK_WEEKEVENTREG_FLAG(14, 0x02)
-#define WEEKEVENTREG_14_04 PACK_WEEKEVENTREG_FLAG(14, 0x04)
+#define WEEKEVENTREG_SHARP_HOSTILE_CONVERSATION PACK_WEEKEVENTREG_FLAG(14, 0x02)
+#define WEEKEVENTREG_IKANA_SPRING_RESTORED PACK_WEEKEVENTREG_FLAG(14, 0x04)
#define WEEKEVENTREG_DRANK_CHATEAU_ROMANI PACK_WEEKEVENTREG_FLAG(14, 0x08)
#define WEEKEVENTREG_WON_DEKU_PLAYGROUND_DAY_1 PACK_WEEKEVENTREG_FLAG(14, 0x10)
#define WEEKEVENTREG_WON_DEKU_PLAYGROUND_DAY_2 PACK_WEEKEVENTREG_FLAG(14, 0x20)
diff --git a/src/boot/build.c b/src/boot/build.c
index 31bb340164..87bd5df8dd 100644
--- a/src/boot/build.c
+++ b/src/boot/build.c
@@ -1,3 +1,5 @@
+#include "build.h"
+
const char gBuildCreator[] = "zelda@srd44";
const char gBuildDate[] = "00-07-31 17:04:16";
const char gBuildMakeOption[] = "";
diff --git a/src/code/z_message.c b/src/code/z_message.c
index 20ce6279e9..375491e821 100644
--- a/src/code/z_message.c
+++ b/src/code/z_message.c
@@ -3246,7 +3246,7 @@ void Message_OpenText(PlayState* play, u16 textId) {
}
}
-void func_801514B0(PlayState* play, u16 arg1, u8 arg2) {
+void Message_PauseMenu_ShowDescription(PlayState* play, u16 textId, u8 textBoxPos) {
MessageContext* msgCtx = &play->msgCtx;
Font* font = &msgCtx->font;
Player* player = GET_PLAYER(play);
@@ -3276,19 +3276,19 @@ void func_801514B0(PlayState* play, u16 arg1, u8 arg2) {
sCharTexScale = temp / msgCtx->textCharScale;
D_801F6B08 = temp / 1;
- if ((arg1 == 0x1709) && (player->transformation == 3)) {
- arg1 = 0x1705;
+ if ((textId == 0x1709) && (player->transformation == PLAYER_FORM_DEKU)) {
+ textId = 0x1705;
}
- msgCtx->currentTextId = arg1;
+ msgCtx->currentTextId = textId;
if (gSaveContext.options.language == LANGUAGE_JPN) {
- Message_FindMessage(play, arg1);
+ Message_FindMessage(play, textId);
msgCtx->msgLength = font->messageEnd;
DmaMgr_RequestSync(&font->msgBuf, SEGMENT_ROM_START(message_data_static) + font->messageStart,
font->messageEnd);
} else {
- Message_FindMessageNES(play, arg1);
+ Message_FindMessageNES(play, textId);
msgCtx->msgLength = font->messageEnd;
DmaMgr_RequestSync(&font->msgBuf, SEGMENT_ROM_START(message_data_static) + font->messageStart,
font->messageEnd);
@@ -3302,7 +3302,7 @@ void func_801514B0(PlayState* play, u16 arg1, u8 arg2) {
msgCtx->unk11F08 = font->msgBuf.wchar[msgCtx->msgBufPos];
msgCtx->unk11F18 = (msgCtx->unk11F08 & 0xF000) >> 0xC;
msgCtx->textBoxType = TEXTBOX_TYPE_9;
- msgCtx->textBoxPos = arg2;
+ msgCtx->textBoxPos = textBoxPos;
msgCtx->unk11F0C = msgCtx->unk11F08 & 0xF;
msgCtx->textUnskippable = true;
DmaMgr_RequestSync(msgCtx->textboxSegment, SEGMENT_ROM_START(message_static) + (D_801CFC78[0] * 0x1000), 0x1000);
diff --git a/src/overlays/actors/ovl_Bg_Iknv_Doukutu/z_bg_iknv_doukutu.c b/src/overlays/actors/ovl_Bg_Iknv_Doukutu/z_bg_iknv_doukutu.c
index 974de0ffb3..96d2cf9fc0 100644
--- a/src/overlays/actors/ovl_Bg_Iknv_Doukutu/z_bg_iknv_doukutu.c
+++ b/src/overlays/actors/ovl_Bg_Iknv_Doukutu/z_bg_iknv_doukutu.c
@@ -51,7 +51,8 @@ void BgIknvDoukutu_Init(Actor* thisx, PlayState* play) {
this->actionFunc = func_80BD71BC;
this->cueType = CS_CMD_ACTOR_CUE_516;
this->unk_160 = 1.0f;
- if (CHECK_WEEKEVENTREG(WEEKEVENTREG_14_04) || CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE)) {
+ if (CHECK_WEEKEVENTREG(WEEKEVENTREG_IKANA_SPRING_RESTORED) ||
+ CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE)) {
this->dyna.actor.draw = func_80BD7768;
this->actionFunc = func_80BD73D0;
play->envCtx.lightSettingOverride = 25;
@@ -67,7 +68,7 @@ void BgIknvDoukutu_Init(Actor* thisx, PlayState* play) {
DynaPolyActor_Init(&this->dyna, 0);
CollisionHeader_GetVirtual(&object_iknv_obj_Colheader_012788, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
- if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_14_04)) {
+ if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_IKANA_SPRING_RESTORED)) {
Actor_Kill(&this->dyna.actor);
}
break;
@@ -78,7 +79,7 @@ void BgIknvDoukutu_Init(Actor* thisx, PlayState* play) {
DynaPolyActor_Init(&this->dyna, 0);
CollisionHeader_GetVirtual(&object_iknv_obj_Colheader_0117C8, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
- if (CHECK_WEEKEVENTREG(WEEKEVENTREG_14_04)) {
+ if (CHECK_WEEKEVENTREG(WEEKEVENTREG_IKANA_SPRING_RESTORED)) {
this->unk_160 = 1.0f;
this->dyna.actor.world.pos.y += 68.0f;
} else {
diff --git a/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c b/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c
index e6aff53d4d..9d3c36e31b 100644
--- a/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c
+++ b/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c
@@ -127,7 +127,7 @@ s32 func_80BD7CEC(BgIknvObj* this) {
}
void BgIknvObj_UpdateWaterwheel(BgIknvObj* this, PlayState* play) {
- if (CHECK_WEEKEVENTREG(WEEKEVENTREG_14_04)) {
+ if (CHECK_WEEKEVENTREG(WEEKEVENTREG_IKANA_SPRING_RESTORED)) {
this->dyna.actor.shape.rot.z -= 0x64;
Actor_PlaySeq_FlaggedMusicBoxHouse(&this->dyna.actor);
Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_WOOD_WATER_WHEEL - SFX_FLAG);
diff --git a/src/overlays/actors/ovl_En_Door/scheduleScripts.schl b/src/overlays/actors/ovl_En_Door/scheduleScripts.schl
index ab52716182..4419a2d5cb 100644
--- a/src/overlays/actors/ovl_En_Door/scheduleScripts.schl
+++ b/src/overlays/actors/ovl_En_Door/scheduleScripts.schl
@@ -406,7 +406,7 @@ sDoorSch_RomaniRanchBedroom {
sDoorSch_IkanaCanyonMusicBoxHouse {
not if_week_event_reg (WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE) {
not if_week_event_reg (WEEKEVENTREG_75_20) {
- not if_week_event_reg (WEEKEVENTREG_14_04) {
+ not if_week_event_reg (WEEKEVENTREG_IKANA_SPRING_RESTORED) {
return_s (0x1D)
} else not if_week_event_reg (WEEKEVENTREG_59_01) {
if_week_event_reg (WEEKEVENTREG_61_02) {
diff --git a/src/overlays/actors/ovl_En_Fz/z_en_fz.c b/src/overlays/actors/ovl_En_Fz/z_en_fz.c
index ea574255fd..9f11aa8c86 100644
--- a/src/overlays/actors/ovl_En_Fz/z_en_fz.c
+++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.c
@@ -17,36 +17,37 @@ void EnFz_Destroy(Actor* thisx, PlayState* play);
void EnFz_Update(Actor* thisx, PlayState* play);
void EnFz_Draw(Actor* thisx, PlayState* play);
-void func_80932784(EnFz* this, PlayState* play);
-void func_80932AE8(EnFz* this);
-void func_80932AF4(EnFz* this);
-void func_80932BD4(EnFz* this);
-void func_809330D4(EnFz* this);
-void func_80933104(EnFz* this, PlayState* play);
-void func_80933184(EnFz* this);
-void func_809331F8(EnFz* this, PlayState* play);
-void func_80933248(EnFz* this);
-void func_80933274(EnFz* this, PlayState* play);
-void func_80933324(EnFz* this);
-void func_80933368(EnFz* this, PlayState* play);
-void func_809333A4(EnFz* this);
-void func_809333D8(EnFz* this, PlayState* play);
-void func_80933414(EnFz* this);
-void func_80933444(EnFz* this, PlayState* play);
-void func_80933480(EnFz* this, PlayState* play);
-void func_809334B8(EnFz* this, PlayState* play);
-void func_809336C0(EnFz* this, PlayState* play);
-void func_80933760(EnFz* this, PlayState* play);
-void func_80933790(EnFz* this);
-void func_809337D4(EnFz* this, PlayState* play);
-void func_8093389C(EnFz* this);
-void func_809338E0(EnFz* this, PlayState* play);
-void func_80933AF4(EnFz* this);
-void func_80933B38(EnFz* this, PlayState* play);
-void func_80934018(EnFz* this, Vec3f* a, Vec3f* b, Vec3f* c, f32 arg4);
-void func_809340BC(EnFz* this, Vec3f* a, Vec3f* b, Vec3f* c, f32 arg4, f32 arg5, s16 arg6, u8 arg7);
-void func_80934178(EnFz* this, PlayState* play);
-void func_80934464(EnFz* this, PlayState* play);
+void EnFz_UpdateTargetPos(EnFz* this, PlayState* play);
+void EnFz_SpawnMistHidden(EnFz* this);
+void EnFz_SpawnMistChanging(EnFz* this);
+void EnFz_SpawnMistFullSize(EnFz* this);
+void EnFz_SetupDisappear(EnFz* this);
+void EnFz_Disappear(EnFz* this, PlayState* play);
+void EnFz_SetupWait(EnFz* this);
+void EnFz_Wait(EnFz* this, PlayState* play);
+void EnFz_SetupAppear(EnFz* this);
+void EnFz_Appear(EnFz* this, PlayState* play);
+void EnFz_SetupAimForSkate(EnFz* this);
+void EnFz_AimForSkate(EnFz* this, PlayState* play);
+void EnFz_SetupSkateTowardPlayer(EnFz* this);
+void EnFz_SkateTowardPlayer(EnFz* this, PlayState* play);
+void EnFz_SetupSkatingAimFreeze(EnFz* this);
+void EnFz_SkatingAimFreeze(EnFz* this, PlayState* play);
+void EnFz_SetupSkatingFreeze(EnFz* this, PlayState* play);
+void EnFz_SkatingFreeze(EnFz* this, PlayState* play);
+void EnFz_SetupDie(EnFz* this, PlayState* play);
+void EnFz_Die(EnFz* this, PlayState* play);
+void EnFz_SetupMelt(EnFz* this);
+void EnFz_Melt(EnFz* this, PlayState* play);
+void EnFz_SetupIdleStationary(EnFz* this);
+void EnFz_IdleStationary(EnFz* this, PlayState* play);
+void EnFz_SetupPassive(EnFz* this);
+void EnFz_Passive(EnFz* this, PlayState* play);
+void EnFz_SpawnMistAura(EnFz* this, Vec3f* pos, Vec3f* velocity, Vec3f* accel, f32 xyScale);
+void EnFz_SpawnBreath(EnFz* this, Vec3f* pos, Vec3f* velocity, Vec3f* accel, f32 xyScale, f32 xyScaleTarget,
+ s16 primAlpha, u8 damaging);
+void EnFz_UpdateEffects(EnFz* this, PlayState* play);
+void EnFz_DrawEffects(EnFz* this, PlayState* play);
ActorProfile En_Fz_Profile = {
/**/ ACTOR_EN_FZ,
@@ -60,7 +61,7 @@ ActorProfile En_Fz_Profile = {
/**/ EnFz_Draw,
};
-static s16 D_809346F0[] = { 0, 0x2000, 0x4000, 0 };
+static s16 sTurningLimits[] = { 0, 0x2000, 0x4000, 0 };
static ColliderCylinderInitType1 sCylinderInit1 = {
{
@@ -100,6 +101,7 @@ static ColliderCylinderInitType1 sCylinderInit2 = {
{ 35, 80, 0, { 0, 0, 0 } },
};
+// Used by the breath attack
static ColliderCylinderInitType1 sCylinderInit3 = {
{
COL_MATERIAL_NONE,
@@ -110,7 +112,7 @@ static ColliderCylinderInitType1 sCylinderInit3 = {
},
{
ELEM_MATERIAL_UNK0,
- { 0x20000000, 0x02, 0x04 },
+ { 0x20000000, 0x02, 0x04 }, // DMG_UNBLOCKABLE
{ 0x00000000, 0x00, 0x00 },
ATELEM_ON | ATELEM_SFX_NORMAL,
ACELEM_NONE,
@@ -119,39 +121,48 @@ static ColliderCylinderInitType1 sCylinderInit3 = {
{ 20, 30, -15, { 0, 0, 0 } },
};
+typedef enum EnFzDamageEffect {
+ /* 0x0 */ FZ_DMGEFF_NONE,
+ /* 0x2 */ FZ_DMGEFF_FIRE = 0x2,
+ /* 0x4 */ FZ_DMGEFF_LIGHT = 0x4,
+ /* 0xD */ FZ_DMGEFF_BOUNCE = 0xD,
+ /* 0xE */ FZ_DMGEFF_E,
+ /* 0xF */ FZ_DMGEFF_CHIP
+} EnFzDamageEffect;
+
static DamageTable sDamageTable = {
- /* Deku Nut */ DMG_ENTRY(0, 0x0),
- /* Deku Stick */ DMG_ENTRY(0, 0xD),
- /* Horse trample */ DMG_ENTRY(0, 0x0),
- /* Explosives */ DMG_ENTRY(2, 0xF),
- /* Zora boomerang */ DMG_ENTRY(0, 0x0),
- /* Normal arrow */ DMG_ENTRY(0, 0xD),
- /* UNK_DMG_0x06 */ DMG_ENTRY(2, 0xF),
- /* Hookshot */ DMG_ENTRY(3, 0xF),
- /* Goron punch */ DMG_ENTRY(2, 0xF),
- /* Sword */ DMG_ENTRY(1, 0xF),
- /* Goron pound */ DMG_ENTRY(3, 0xF),
- /* Fire arrow */ DMG_ENTRY(2, 0x2),
- /* Ice arrow */ DMG_ENTRY(0, 0x0),
- /* Light arrow */ DMG_ENTRY(2, 0x4),
- /* Goron spikes */ DMG_ENTRY(1, 0xF),
- /* Deku spin */ DMG_ENTRY(0, 0x0),
- /* Deku bubble */ DMG_ENTRY(0, 0x0),
- /* Deku launch */ DMG_ENTRY(0, 0x0),
- /* UNK_DMG_0x12 */ DMG_ENTRY(0, 0x0),
- /* Zora barrier */ DMG_ENTRY(0, 0x0),
- /* Normal shield */ DMG_ENTRY(0, 0x0),
- /* Light ray */ DMG_ENTRY(0, 0xE),
- /* Thrown object */ DMG_ENTRY(1, 0xF),
- /* Zora punch */ DMG_ENTRY(1, 0xF),
- /* Spin attack */ DMG_ENTRY(1, 0xF),
- /* Sword beam */ DMG_ENTRY(0, 0x0),
- /* Normal Roll */ DMG_ENTRY(0, 0x0),
- /* UNK_DMG_0x1B */ DMG_ENTRY(0, 0x0),
- /* UNK_DMG_0x1C */ DMG_ENTRY(0, 0x0),
- /* Unblockable */ DMG_ENTRY(0, 0x0),
- /* UNK_DMG_0x1E */ DMG_ENTRY(0, 0x0),
- /* Powder Keg */ DMG_ENTRY(1, 0xF),
+ /* Deku Nut */ DMG_ENTRY(0, FZ_DMGEFF_NONE),
+ /* Deku Stick */ DMG_ENTRY(0, FZ_DMGEFF_BOUNCE),
+ /* Horse trample */ DMG_ENTRY(0, FZ_DMGEFF_NONE),
+ /* Explosives */ DMG_ENTRY(2, FZ_DMGEFF_CHIP),
+ /* Zora boomerang */ DMG_ENTRY(0, FZ_DMGEFF_NONE),
+ /* Normal arrow */ DMG_ENTRY(0, FZ_DMGEFF_BOUNCE),
+ /* UNK_DMG_0x06 */ DMG_ENTRY(2, FZ_DMGEFF_CHIP),
+ /* Hookshot */ DMG_ENTRY(3, FZ_DMGEFF_CHIP),
+ /* Goron punch */ DMG_ENTRY(2, FZ_DMGEFF_CHIP),
+ /* Sword */ DMG_ENTRY(1, FZ_DMGEFF_CHIP),
+ /* Goron pound */ DMG_ENTRY(3, FZ_DMGEFF_CHIP),
+ /* Fire arrow */ DMG_ENTRY(2, FZ_DMGEFF_FIRE),
+ /* Ice arrow */ DMG_ENTRY(0, FZ_DMGEFF_NONE),
+ /* Light arrow */ DMG_ENTRY(2, FZ_DMGEFF_LIGHT),
+ /* Goron spikes */ DMG_ENTRY(1, FZ_DMGEFF_CHIP),
+ /* Deku spin */ DMG_ENTRY(0, FZ_DMGEFF_NONE),
+ /* Deku bubble */ DMG_ENTRY(0, FZ_DMGEFF_NONE),
+ /* Deku launch */ DMG_ENTRY(0, FZ_DMGEFF_NONE),
+ /* UNK_DMG_0x12 */ DMG_ENTRY(0, FZ_DMGEFF_NONE),
+ /* Zora barrier */ DMG_ENTRY(0, FZ_DMGEFF_NONE),
+ /* Normal shield */ DMG_ENTRY(0, FZ_DMGEFF_NONE),
+ /* Light ray */ DMG_ENTRY(0, FZ_DMGEFF_E), // not coded in damage handle, not in OOT
+ /* Thrown object */ DMG_ENTRY(1, FZ_DMGEFF_CHIP),
+ /* Zora punch */ DMG_ENTRY(1, FZ_DMGEFF_CHIP),
+ /* Spin attack */ DMG_ENTRY(1, FZ_DMGEFF_CHIP),
+ /* Sword beam */ DMG_ENTRY(0, FZ_DMGEFF_NONE),
+ /* Normal Roll */ DMG_ENTRY(0, FZ_DMGEFF_NONE),
+ /* UNK_DMG_0x1B */ DMG_ENTRY(0, FZ_DMGEFF_NONE),
+ /* UNK_DMG_0x1C */ DMG_ENTRY(0, FZ_DMGEFF_NONE),
+ /* Unblockable */ DMG_ENTRY(0, FZ_DMGEFF_NONE),
+ /* UNK_DMG_0x1E */ DMG_ENTRY(0, FZ_DMGEFF_NONE),
+ /* Powder Keg */ DMG_ENTRY(1, FZ_DMGEFF_CHIP),
};
static InitChainEntry sInitChain[] = {
@@ -166,7 +177,7 @@ void EnFz_Init(Actor* thisx, PlayState* play) {
Actor_ProcessInitChain(&this->actor, sInitChain);
this->actor.colChkInfo.damageTable = &sDamageTable;
- this->actor.colChkInfo.health = 3;
+ this->actor.colChkInfo.health = 3; // decreased from 6 in OOT
Collider_InitCylinder(play, &this->collider1);
Collider_SetCylinderType1(play, &this->collider1, &this->actor, &sCylinderInit1);
@@ -180,56 +191,56 @@ void EnFz_Init(Actor* thisx, PlayState* play) {
this->actor.velocity.y = 0.0f;
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
- this->unk_BC8 = 0;
- this->unk_BCF = 0;
- this->unk_BCC = 1;
- this->unk_BCD = 0;
- this->unk_BCE = 0;
- this->unk_BD7 = 1;
- this->unk_BD8 = 0;
+ this->unusedTimer = 0;
+ this->hitCounter = 0;
+ this->isBgEnabled = true;
+ this->isMoving = false;
+ this->isColliderActive = false;
+ this->drawBody = true;
+ this->isDying = false;
this->actor.speed = 0.0f;
this->actor.cullingVolumeScale = 400.0f;
- this->unk_BAC = this->actor.world.pos.y;
- this->unk_BB4 = this->actor.world.pos.y;
- this->unk_BA8 = this->actor.world.pos.x;
- this->unk_BB0 = this->actor.world.pos.z;
+ this->originPos.x = this->actor.world.pos.x;
+ this->originPos.y = this->actor.world.pos.y;
+ this->originPos.z = this->actor.world.pos.z;
+ this->originPosY = this->actor.world.pos.y;
this->actor.velocity.y = this->actor.gravity;
- this->unk_BB8 = 135.0f;
+ this->unkBB8 = 135.0f;
- if (ENFZ_GET_8000(&this->actor)) {
- this->unk_BC0 = 0;
+ if (ENFZ_GET_TRACK_TYPE(&this->actor)) {
+ this->envAlpha = 0;
this->actor.scale.y = 0.0f;
- func_80933184(this);
+ EnFz_SetupWait(this);
} else {
- this->unk_BC0 = 255;
- if (this->actor.shape.rot.z == 0) {
- this->unk_BC6 = (s32)Rand_ZeroFloat(64.0f) + 192;
+ this->envAlpha = 255;
+ if (ENFZ_GETZ_CLOCK(thisx) == 0) {
+ this->internalClock = 192 + (s32)Rand_ZeroFloat(64.0f);
} else {
- if (this->actor.shape.rot.z < 0) {
- this->actor.shape.rot.z = 1;
- } else if (this->actor.shape.rot.z > 0x10) {
- this->actor.shape.rot.z = 0x10;
+ if (ENFZ_GETZ_CLOCK(thisx) < 0) {
+ ENFZ_GETZ_CLOCK(thisx) = 1;
+ } else if (ENFZ_GETZ_CLOCK(thisx) > 0x10) {
+ ENFZ_GETZ_CLOCK(thisx) = 0x10;
}
- this->actor.shape.rot.z += -1;
- this->unk_BC6 = this->actor.shape.rot.z * 0x10;
+ ENFZ_GETZ_CLOCK(thisx) -= 1;
+ this->internalClock = ENFZ_GETZ_CLOCK(thisx) * 0x10;
}
+ this->actor.shape.rot.z = 0; // reset after parameter use
- this->actor.shape.rot.z = 0;
- if (ENFZ_GET_4000(&this->actor)) {
- this->unk_BC0 = 0;
+ if (ENFZ_GET_APPEAR_TYPE(&this->actor)) {
+ this->envAlpha = 0;
this->actor.scale.y = 0.0f;
- func_80933184(this);
- } else if (ENFZ_GET_F(&this->actor) == ENFZ_F_3) {
- func_80933AF4(this);
+ EnFz_SetupWait(this);
+ } else if (ENFZ_GET_POWER(&this->actor) == FZ_POWER_PASSIVE) {
+ EnFz_SetupPassive(this);
} else {
- func_8093389C(this);
+ EnFz_SetupIdleStationary(this);
}
}
this->drawDmgEffTimer = 0;
this->drawDmgEffScale = 0.0f;
this->drawDmgEffAlpha = 0.0f;
- func_80932784(this, play);
+ EnFz_UpdateTargetPos(this, play);
}
void EnFz_Destroy(Actor* thisx, PlayState* play) {
@@ -239,7 +250,7 @@ void EnFz_Destroy(Actor* thisx, PlayState* play) {
Collider_DestroyCylinder(play, &this->collider2);
Collider_DestroyCylinder(play, &this->collider3);
- if ((this->actor.parent != NULL) && (this->unk_BC4 == 0) && (this->actor.parent->id == ACTOR_EN_WIZ) &&
+ if ((this->actor.parent != NULL) && (this->wizrobeFlag == 0) && (this->actor.parent->id == ACTOR_EN_WIZ) &&
(this->actor.parent->update != NULL) && (((EnWiz*)this->actor.parent)->freezard != NULL)) {
EnWiz* wiz = (EnWiz*)this->actor.parent;
@@ -247,436 +258,451 @@ void EnFz_Destroy(Actor* thisx, PlayState* play) {
}
}
-void func_80932784(EnFz* this, PlayState* play) {
- Vec3f sp5C;
- Vec3f sp50;
- Vec3f sp44;
+void EnFz_UpdateTargetPos(EnFz* this, PlayState* play) {
+ Vec3f pos;
+ Vec3f hitPos;
+ Vec3f baseVelocity;
s32 bgId;
- CollisionPoly* sp3C;
+ CollisionPoly* hitPoly;
- sp5C.x = this->actor.world.pos.x;
- sp5C.y = this->actor.world.pos.y + 20.0f;
- sp5C.z = this->actor.world.pos.z;
+ pos.x = this->actor.world.pos.x;
+ pos.y = this->actor.world.pos.y + 20.0f;
+ pos.z = this->actor.world.pos.z;
- Matrix_Translate(sp5C.x, sp5C.y, sp5C.z, MTXMODE_NEW);
+ Matrix_Translate(pos.x, pos.y, pos.z, MTXMODE_NEW);
Matrix_RotateZYX(this->actor.shape.rot.x, this->actor.shape.rot.y, this->actor.shape.rot.z, MTXMODE_APPLY);
- sp44.x = sp44.y = 0.0f;
- sp44.z = 440.0f;
+ baseVelocity.x = baseVelocity.y = 0.0f;
+ baseVelocity.z = 440.0f;
- Matrix_MultVec3f(&sp44, &this->unk_22C);
- if (BgCheck_EntityLineTest1(&play->colCtx, &sp5C, &this->unk_22C, &sp50, &sp3C, true, false, false, true, &bgId)) {
- Math_Vec3f_Copy(&this->unk_22C, &sp50);
+ Matrix_MultVec3f(&baseVelocity, &this->wallHitPos);
+ if (BgCheck_EntityLineTest1(&play->colCtx, &pos, &this->wallHitPos, &hitPos, &hitPoly, true, false, false, true,
+ &bgId)) {
+ Math_Vec3f_Copy(&this->wallHitPos, &hitPos);
}
- sp5C.x = this->actor.world.pos.x - this->unk_22C.x;
- sp5C.z = this->actor.world.pos.z - this->unk_22C.z;
- this->unk_238 = SQ(sp5C.x) + SQ(sp5C.z);
+ pos.x = this->actor.world.pos.x - this->wallHitPos.x;
+ pos.z = this->actor.world.pos.z - this->wallHitPos.z;
+ this->distToTargetSq = SQ(pos.x) + SQ(pos.z);
}
-s32 func_809328A4(EnFz* this, Vec3f* arg1) {
- f32 temp_f0 = this->actor.world.pos.x - arg1->x;
- f32 temp_f2 = this->actor.world.pos.z - arg1->z;
+s32 EnFz_ReachedTarget(EnFz* this, Vec3f* vec) {
+ f32 distX = this->actor.world.pos.x - vec->x;
+ f32 distZ = this->actor.world.pos.z - vec->z;
- if (this->unk_238 <= (SQ(temp_f0) + SQ(temp_f2))) {
+ if (this->distToTargetSq <= (SQ(distX) + SQ(distZ))) {
return true;
+ } else {
+ return false;
}
- return false;
}
-void func_809328F4(EnFz* this, PlayState* play, Vec3f* arg2, s32 arg3, f32 arg4) {
+// Spawn ice chunks on damage taken
+void EnFz_Damaged(EnFz* this, PlayState* play, Vec3f* hitPos, s32 numEffects, f32 randPosRange) {
s32 i;
- Vec3f spA8;
- Vec3f sp9C;
- Vec3f sp90;
- Color_RGBA8 sp8C;
- Color_RGBA8 sp88;
- f32 temp_f24;
- s32 temp_s1;
+ Vec3f pos;
+ Vec3f velocity;
+ Vec3f accel;
+ Color_RGBA8 primColor;
+ Color_RGBA8 envColor;
+ f32 scale;
+ s32 life;
- sp90.x = sp90.z = 0.0f;
- sp90.y = -1.0f;
- sp8C.r = 155;
- sp8C.g = 255;
- sp8C.b = 255;
- sp8C.a = 255;
- sp88.r = 200;
- sp88.g = 200;
- sp88.b = 200;
+ accel.x = accel.z = 0.0f;
+ accel.y = -1.0f;
+ primColor.r = 155;
+ primColor.g = 255;
+ primColor.b = 255;
+ primColor.a = 255;
+ envColor.r = 200;
+ envColor.g = 200;
+ envColor.b = 200;
- for (i = 0; i < arg3; i++) {
- temp_f24 = Rand_CenteredFloat(0.3f) + 0.6f;
- temp_s1 = (s32)Rand_CenteredFloat(5.0f) + 12;
- spA8.x = Rand_CenteredFloat(arg4) + arg2->x;
- spA8.y = Rand_ZeroFloat(arg4) + arg2->y;
- spA8.z = Rand_CenteredFloat(arg4) + arg2->z;
- sp9C.x = Rand_CenteredFloat(10.0f);
- sp9C.y = Rand_ZeroFloat(10.0f) + 2.0f;
- sp9C.z = Rand_CenteredFloat(10.0f);
- EffectSsEnIce_Spawn(play, &spA8, temp_f24, &sp9C, &sp90, &sp8C, &sp88, temp_s1);
+ for (i = 0; i < numEffects; i++) {
+ scale = 0.6f + Rand_CenteredFloat(0.3f);
+ life = 12 + (s32)Rand_CenteredFloat(5.0f);
+ pos.x = hitPos->x + Rand_CenteredFloat(randPosRange);
+ pos.y = hitPos->y + Rand_ZeroFloat(randPosRange);
+ pos.z = hitPos->z + Rand_CenteredFloat(randPosRange);
+ velocity.x = Rand_CenteredFloat(10.0f);
+ velocity.y = Rand_ZeroFloat(10.0f) + 2.0f;
+ velocity.z = Rand_CenteredFloat(10.0f);
+ EffectSsEnIce_Spawn(play, &pos, scale, &velocity, &accel, &primColor, &envColor, life);
}
- CollisionCheck_SpawnShieldParticles(play, arg2);
+ CollisionCheck_SpawnShieldParticles(play, hitPos);
}
-void func_80932AE8(EnFz* this) {
+void EnFz_SpawnMistHidden(EnFz* this) {
}
-void func_80932AF4(EnFz* this) {
- Vec3f sp44;
- Vec3f sp38;
- Vec3f sp2C;
+void EnFz_SpawnMistChanging(EnFz* this) {
+ Vec3f pos;
+ Vec3f velocity;
+ Vec3f accel;
- if (!(this->unk_BC6 & 0xF)) {
- sp44.x = Rand_CenteredFloat(40.0f) + this->actor.world.pos.x;
- sp44.y = Rand_CenteredFloat(40.0f) + this->actor.world.pos.y + 30.0f;
- sp44.z = Rand_CenteredFloat(40.0f) + this->actor.world.pos.z;
- sp2C.x = sp2C.z = 0.0f;
- sp2C.y = 0.1f;
- sp38.x = sp38.y = sp38.z = 0.0f;
- func_80934018(this, &sp44, &sp38, &sp2C, Rand_ZeroFloat(7.5f) + 15.0f);
+ if ((this->internalClock % 16) == 0) {
+ pos.x = this->actor.world.pos.x + Rand_CenteredFloat(40.0f);
+ pos.y = this->actor.world.pos.y + Rand_CenteredFloat(40.0f) + 30.0f;
+ pos.z = this->actor.world.pos.z + Rand_CenteredFloat(40.0f);
+ accel.x = accel.z = 0.0f;
+ accel.y = 0.1f;
+ velocity.x = velocity.y = velocity.z = 0.0f;
+ EnFz_SpawnMistAura(this, &pos, &velocity, &accel, 15.0f + Rand_ZeroFloat(7.5f));
}
}
-void func_80932BD4(EnFz* this) {
- Vec3f sp44;
- Vec3f sp38;
- Vec3f sp2C;
+void EnFz_SpawnMistFullSize(EnFz* this) {
+ Vec3f pos;
+ Vec3f velocity;
+ Vec3f accel;
- if (!(this->unk_BC6 & 3)) {
- sp44.x = Rand_CenteredFloat(40.0f) + this->actor.world.pos.x;
- sp44.y = this->unk_BB4;
- sp44.z = Rand_CenteredFloat(40.0f) + this->actor.world.pos.z;
- sp2C.x = sp2C.z = 0.0f;
- sp2C.y = 0.1f;
- sp38.x = sp38.y = sp38.z = 0.0f;
- func_80934018(this, &sp44, &sp38, &sp2C, Rand_ZeroFloat(7.5f) + 15.0f);
+ if ((this->internalClock % 4) == 0) {
+ pos.x = this->actor.world.pos.x + Rand_CenteredFloat(40.0f);
+ pos.y = this->originPosY;
+ pos.z = this->actor.world.pos.z + Rand_CenteredFloat(40.0f);
+ accel.x = accel.z = 0.0f;
+ accel.y = 0.1f;
+ velocity.x = velocity.y = velocity.z = 0.0f;
+ EnFz_SpawnMistAura(this, &pos, &velocity, &accel, Rand_ZeroFloat(7.5f) + 15.0f);
}
}
-void func_80932C98(EnFz* this, PlayState* play) {
- Vec3f sp3C;
+void EnFz_ApplyDamage(EnFz* this, PlayState* play) {
+ Vec3f currentPos;
- if (this->unk_BCD != 0) {
- if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) ||
- !Actor_TestFloorInDirection(&this->actor, play, 60.0f, this->actor.world.rot.y)) {
- this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL;
- this->unk_BCD = 0;
- this->unk_BBC = 0.0f;
- this->actor.speed = 0.0f;
- }
+ if (this->isMoving && ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) ||
+ !Actor_TestFloorInDirection(&this->actor, play, 60.0f, this->actor.world.rot.y))) {
+ this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL;
+ this->isMoving = false;
+ this->speedXZ = 0.0f;
+ this->actor.speed = 0.0f;
}
+ // Unfinished Wizrobe collaboration?
if (this->actor.parent != NULL) {
- if ((this->unk_BC4 != 5) && (this->actor.parent->id == ACTOR_EN_WIZ)) {
+ if ((this->wizrobeFlag != 5) && (this->actor.parent->id == ACTOR_EN_WIZ)) {
Actor* parent = this->actor.parent;
if ((parent->update == NULL) || (parent->colChkInfo.health <= 0)) {
this->actor.colChkInfo.health = 0;
- this->unk_BC4 = 5;
+ this->wizrobeFlag = 5;
Actor_PlaySfx(&this->actor, NA_SE_EN_FREEZAD_DEAD);
Actor_PlaySfx(&this->actor, NA_SE_EV_ICE_BROKEN);
- sp3C.x = this->actor.world.pos.x;
- sp3C.y = this->actor.world.pos.y;
- sp3C.z = this->actor.world.pos.z;
- func_809328F4(this, play, &sp3C, 30, 10.0f);
- func_809336C0(this, play);
+ currentPos.x = this->actor.world.pos.x;
+ currentPos.y = this->actor.world.pos.y;
+ currentPos.z = this->actor.world.pos.z;
+ EnFz_Damaged(this, play, ¤tPos, 30, 10.0f);
+ EnFz_SetupDie(this, play);
return;
}
- if ((this->actor.colChkInfo.health != 0) && (this->unk_BC4 == 1)) {
+ if ((this->actor.colChkInfo.health != 0) && (this->wizrobeFlag == 1)) {
this->actor.colChkInfo.health = 0;
- this->unk_BC4 = 5;
+ this->wizrobeFlag = 5;
Actor_PlaySfx(&this->actor, NA_SE_EN_FREEZAD_DEAD);
Actor_PlaySfx(&this->actor, NA_SE_EV_ICE_BROKEN);
- sp3C.x = this->actor.world.pos.x;
- sp3C.y = this->actor.world.pos.y;
- sp3C.z = this->actor.world.pos.z;
- func_809328F4(this, play, &sp3C, 30, 10.0f);
- func_809336C0(this, play);
+ currentPos.x = this->actor.world.pos.x;
+ currentPos.y = this->actor.world.pos.y;
+ currentPos.z = this->actor.world.pos.z;
+ EnFz_Damaged(this, play, ¤tPos, 30, 10.0f);
+ EnFz_SetupDie(this, play);
return;
}
}
}
- if (this->unk_BCE != 0) {
- if (ENFZ_GET_8000(&this->actor) && (this->collider1.base.atFlags & AT_HIT)) {
- this->unk_BCD = 0;
- this->unk_BBC = 0.0f;
+ if (this->isColliderActive) {
+ if (ENFZ_GET_TRACK_TYPE(&this->actor) && (this->collider1.base.atFlags & AT_HIT)) {
+ this->isMoving = false;
+ this->speedXZ = 0.0f;
this->collider1.base.acFlags &= ~AC_HIT;
this->actor.speed = 0.0f;
- this->unk_BCA = 10;
- func_809330D4(this);
+ this->mainTimer = 10;
+ EnFz_SetupDisappear(this);
} else if (this->collider2.base.acFlags & AC_BOUNCED) {
this->collider2.base.acFlags &= ~AC_BOUNCED;
this->collider1.base.acFlags &= ~AC_HIT;
} else if (this->collider1.base.acFlags & AC_HIT) {
this->collider1.base.acFlags &= ~AC_HIT;
switch (this->actor.colChkInfo.damageEffect) {
- case 4:
- this->drawDmgEffTimer = 40;
+ case FZ_DMGEFF_LIGHT:
+ this->drawDmgEffTimer = 2 * 20;
this->drawDmgEffAlpha = 1.0f;
FALLTHROUGH;
- case 15:
+ case FZ_DMGEFF_CHIP:
Actor_ApplyDamage(&this->actor);
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_XLU, 8);
if (this->actor.colChkInfo.health != 0) {
Actor_PlaySfx(&this->actor, NA_SE_EN_FREEZAD_DAMAGE);
- sp3C.x = this->actor.world.pos.x;
- sp3C.y = this->actor.world.pos.y;
- sp3C.z = this->actor.world.pos.z;
- func_809328F4(this, play, &sp3C, 10, 0.0f);
- this->unk_BCF++;
+ currentPos.x = this->actor.world.pos.x;
+ currentPos.y = this->actor.world.pos.y;
+ currentPos.z = this->actor.world.pos.z;
+ EnFz_Damaged(this, play, ¤tPos, 10, 0.0f);
+ this->hitCounter++;
break;
}
Actor_PlaySfx(&this->actor, NA_SE_EN_FREEZAD_DEAD);
Actor_PlaySfx(&this->actor, NA_SE_EV_ICE_BROKEN);
- sp3C.x = this->actor.world.pos.x;
- sp3C.y = this->actor.world.pos.y;
- sp3C.z = this->actor.world.pos.z;
- func_809328F4(this, play, &sp3C, 30, 10.0f);
- func_809336C0(this, play);
+ currentPos.x = this->actor.world.pos.x;
+ currentPos.y = this->actor.world.pos.y;
+ currentPos.z = this->actor.world.pos.z;
+ EnFz_Damaged(this, play, ¤tPos, 30, 10.0f);
+ EnFz_SetupDie(this, play);
break;
- case 2:
+ case FZ_DMGEFF_FIRE:
Actor_PlaySfx(&this->actor, NA_SE_EN_FREEZAD_DEAD);
- func_80933790(this);
+ EnFz_SetupMelt(this);
break;
}
}
}
}
-void func_80933014(EnFz* this) {
- s16 temp_a1 = this->actor.yawTowardsPlayer;
- s32 temp_a2 = ENFZ_GET_3000(&this->actor);
- s16 temp;
- s16 temp2;
- s32 temp_v1;
+void EnFz_SetYawTowardsPlayer(EnFz* this) {
+ s16 yaw = this->actor.yawTowardsPlayer;
+ s32 limitIndex = ENFZ_GET_ROTATION_LIMIT(&this->actor);
- if (!ENFZ_GET_8000(&this->actor)) {
- temp_v1 = this->actor.home.rot.y;
- if (temp_a2 != 3) {
- temp2 = temp_a1 - temp_v1;
- if (D_809346F0[temp_a2] < ABS_ALT(temp2)) {
- temp = (temp2 > 0) ? D_809346F0[temp_a2] : -D_809346F0[temp_a2];
- temp_a1 = this->actor.home.rot.y + temp;
+ if (!ENFZ_GET_TRACK_TYPE(&this->actor)) {
+ s32 homeYaw = this->actor.home.rot.y;
+
+ if (limitIndex != 3) {
+ s16 homeYawDiff = yaw - homeYaw;
+
+ if (sTurningLimits[limitIndex] < ABS_ALT(homeYawDiff)) {
+ s16 angleLimit = (homeYawDiff > 0) ? sTurningLimits[limitIndex] : -sTurningLimits[limitIndex];
+
+ yaw = this->actor.home.rot.y + angleLimit;
}
}
}
- Math_SmoothStepToS(&this->actor.shape.rot.y, temp_a1, 10, 0x7D0, 0);
+ Math_SmoothStepToS(&this->actor.shape.rot.y, yaw, 10, 0x7D0, 0);
this->actor.world.rot.y = this->actor.shape.rot.y;
}
-void func_809330D4(EnFz* this) {
- this->unk_BD6 = 2;
- this->unk_BCE = 0;
+/**
+ * Disappearing into the ground to re-appear at actor.home
+ */
+void EnFz_SetupDisappear(EnFz* this) {
+ this->state = FZ_STATE_CHANGING;
+ this->isColliderActive = false;
this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
- this->actionFunc = func_80933104;
+ this->actionFunc = EnFz_Disappear;
}
-void func_80933104(EnFz* this, PlayState* play) {
- this->unk_BC0 -= 16;
- if (this->unk_BC0 > 255) {
- this->unk_BC0 = 0;
+void EnFz_Disappear(EnFz* this, PlayState* play) {
+ this->envAlpha -= 16;
+ if (this->envAlpha > 255) {
+ this->envAlpha = 0;
}
if (Math_SmoothStepToF(&this->actor.scale.y, 0, 1.0f, 0.0005f, 0.0f) == 0.0f) {
- func_80933184(this);
+ EnFz_SetupWait(this);
}
}
-void func_80933184(EnFz* this) {
- this->unk_BD6 = 0;
- this->unk_BD2 = 0;
- this->unk_BD0 = 0;
- this->unk_BCA = 100;
+void EnFz_SetupWait(EnFz* this) {
+ this->state = FZ_STATE_HIDDEN;
+ this->unkBD2 = 0;
+ this->unkBD0 = 0;
+ this->mainTimer = 5 * 20;
- this->actor.world.pos.x = this->unk_BA8;
- this->actor.world.pos.y = this->unk_BAC;
- this->actor.world.pos.z = this->unk_BB0;
+ this->actor.world.pos.x = this->originPos.x;
+ this->actor.world.pos.y = this->originPos.y;
+ this->actor.world.pos.z = this->originPos.z;
- if (ENFZ_GET_4000(&this->actor)) {
- this->unk_BD6 = 2;
- this->unk_BCA = 10;
- this->unk_BD2 = 4000;
- this->actionFunc = func_80933274;
+ if (ENFZ_GET_APPEAR_TYPE(&this->actor)) {
+ this->state = FZ_STATE_CHANGING;
+ this->mainTimer = 10; // slightly shorter timer for EnFz_Appear
+ this->unkBD2 = 4000;
+ this->actionFunc = EnFz_Appear; // skip SetupAppear
} else {
- this->actionFunc = func_809331F8;
+ // ENFZ_GET_TRACK_TYPE
+ this->actionFunc = EnFz_Wait;
}
}
-void func_809331F8(EnFz* this, PlayState* play) {
- if ((this->unk_BCA == 0) && (this->actor.xzDistToPlayer < 400.0f)) {
- func_80933248(this);
+/**
+ * Waiting in hiding for the player go get close
+ */
+void EnFz_Wait(EnFz* this, PlayState* play) {
+ if ((this->mainTimer == 0) && (this->actor.xzDistToPlayer < 400.0f)) {
+ EnFz_SetupAppear(this);
}
}
-void func_80933248(EnFz* this) {
- this->unk_BD6 = 2;
- this->unk_BCA = 20;
- this->unk_BD2 = 4000;
- this->actionFunc = func_80933274;
+void EnFz_SetupAppear(EnFz* this) {
+ this->state = FZ_STATE_CHANGING;
+ this->mainTimer = 20;
+ this->unkBD2 = 4000;
+ this->actionFunc = EnFz_Appear;
}
-void func_80933274(EnFz* this, PlayState* play) {
- if (this->unk_BCA == 0) {
+/**
+ * Appearing out of the ground to attack player
+ */
+void EnFz_Appear(EnFz* this, PlayState* play) {
+ if (this->mainTimer == 0) {
- this->unk_BC0 += 8;
- if (this->unk_BC0 > 255) {
- this->unk_BC0 = 255;
+ this->envAlpha += 8;
+ if (this->envAlpha > 255) {
+ this->envAlpha = 255;
}
if (Math_SmoothStepToF(&this->actor.scale.y, 0.008f, 1.0f, 0.0005f, 0.0f) == 0.0f) {
- if (ENFZ_GET_4000(&this->actor)) {
- func_8093389C(this);
- } else {
- func_80933324(this);
+ if (ENFZ_GET_APPEAR_TYPE(&this->actor)) {
+ EnFz_SetupIdleStationary(this);
+ } else { // ENFZ_GET_TRACK_TYPE
+ EnFz_SetupAimForSkate(this);
}
}
}
}
-void func_80933324(EnFz* this) {
- this->unk_BD6 = 1;
- this->unk_BCA = 40;
- this->unk_BCC = 1;
- this->unk_BCE = 1;
+void EnFz_SetupAimForSkate(EnFz* this) {
+ this->state = FZ_STATE_FULLSIZE;
+ this->mainTimer = 2 * 20;
+ this->isBgEnabled = true;
+ this->isColliderActive = true;
this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED;
this->actor.gravity = -1.0f;
- this->actionFunc = func_80933368;
+ this->actionFunc = EnFz_AimForSkate;
}
-void func_80933368(EnFz* this, PlayState* play) {
- func_80933014(this);
- if (this->unk_BCA == 0) {
- func_809333A4(this);
+void EnFz_AimForSkate(EnFz* this, PlayState* play) {
+ EnFz_SetYawTowardsPlayer(this);
+ if (this->mainTimer == 0) {
+ EnFz_SetupSkateTowardPlayer(this);
}
}
-void func_809333A4(EnFz* this) {
- this->unk_BD6 = 1;
- this->unk_BCD = 1;
- this->unk_BCA = 100;
- this->unk_BBC = 4.0f;
- this->actionFunc = func_809333D8;
+void EnFz_SetupSkateTowardPlayer(EnFz* this) {
+ this->state = FZ_STATE_FULLSIZE;
+ this->isMoving = true;
+ this->mainTimer = 5 * 20;
+ this->speedXZ = 4.0f;
+ this->actionFunc = EnFz_SkateTowardPlayer;
}
-void func_809333D8(EnFz* this, PlayState* play) {
- if ((this->unk_BCA == 0) || (this->unk_BCD == 0)) {
- func_80933414(this);
+void EnFz_SkateTowardPlayer(EnFz* this, PlayState* play) {
+ // isMoving gets set false in EnFz_ApplyDamage
+ if ((this->mainTimer == 0) || !this->isMoving) {
+ EnFz_SetupSkatingAimFreeze(this);
}
}
-void func_80933414(EnFz* this) {
- this->unk_BD6 = 1;
- this->unk_BBC = 0.0f;
+void EnFz_SetupSkatingAimFreeze(EnFz* this) {
+ this->state = FZ_STATE_FULLSIZE;
+ this->speedXZ = 0.0f;
this->actor.speed = 0.0f;
- this->unk_BCA = 40;
- this->actionFunc = func_80933444;
+ this->mainTimer = 2 * 20;
+ this->actionFunc = EnFz_SkatingAimFreeze;
}
-void func_80933444(EnFz* this, PlayState* play) {
- func_80933014(this);
- if (this->unk_BCA == 0) {
- func_80933480(this, play);
+void EnFz_SkatingAimFreeze(EnFz* this, PlayState* play) {
+ EnFz_SetYawTowardsPlayer(this);
+ if (this->mainTimer == 0) {
+ EnFz_SetupSkatingFreeze(this, play);
}
}
-void func_80933480(EnFz* this, PlayState* play) {
- this->unk_BD6 = 1;
- this->unk_BCA = 80;
- this->actionFunc = func_809334B8;
- func_80932784(this, play);
+void EnFz_SetupSkatingFreeze(EnFz* this, PlayState* play) {
+ this->state = FZ_STATE_FULLSIZE;
+ this->mainTimer = 4 * 20;
+ this->actionFunc = EnFz_SkatingFreeze;
+ EnFz_UpdateTargetPos(this, play);
}
-void func_809334B8(EnFz* this, PlayState* play) {
- Vec3f sp64;
- Vec3f sp58;
- Vec3f sp4C;
- Vec3f sp40;
- u8 sp3F;
- s16 sp3C;
+void EnFz_SkatingFreeze(EnFz* this, PlayState* play) {
+ Vec3f baseVelocity;
+ Vec3f pos;
+ Vec3f velocity;
+ Vec3f accel;
- if (this->unk_BCA == 0) {
- func_809330D4(this);
+ if (this->mainTimer == 0) {
+ EnFz_SetupDisappear(this);
return;
}
- if (this->unk_BCA > 10) {
- sp3F = 0;
- sp3C = 150;
+ if (this->mainTimer > 10) {
+ u8 damaging = false;
+ s16 primAlpha = 150;
+
Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_FREEZAD_BREATH - SFX_FLAG);
- if ((this->unk_BCA - 10) < 16) {
- sp3C = (this->unk_BCA * 10) - 100;
+ if ((this->mainTimer - 10) < 16) {
+ primAlpha = (this->mainTimer * 10) - 100;
}
- sp40.x = sp40.z = 0.0f;
- sp40.y = 0.6f;
+ accel.x = accel.z = 0.0f;
+ accel.y = 0.6f;
- sp58.x = this->actor.world.pos.x;
- sp58.y = this->actor.world.pos.y + 20.0f;
- sp58.z = this->actor.world.pos.z;
+ pos.x = this->actor.world.pos.x;
+ pos.y = this->actor.world.pos.y + 20.0f;
+ pos.z = this->actor.world.pos.z;
Matrix_RotateYS(this->actor.shape.rot.y, MTXMODE_NEW);
- sp64.x = 0.0f;
- sp64.y = -2.0f;
- sp64.z = ((ENFZ_GET_F(&this->actor) == ENFZ_F_1) ? 10.0f
- : (ENFZ_GET_F(&this->actor) == ENFZ_F_2) ? 20.0f
- : 0.0f) +
- 20;
+ baseVelocity.x = 0.0f;
+ baseVelocity.y = -2.0f;
+ baseVelocity.z = ((ENFZ_GET_POWER(&this->actor) == FZ_POWER_1) ? 10.0f
+ : (ENFZ_GET_POWER(&this->actor) == FZ_POWER_2) ? 20.0f
+ : 0.0f) +
+ 20;
- Matrix_MultVec3f(&sp64, &sp4C);
+ Matrix_MultVec3f(&baseVelocity, &velocity);
- if ((this->unk_BCA & 7) == 0) {
- sp3F = 1;
+ if ((this->mainTimer % 8) == 0) {
+ damaging = true;
}
- func_809340BC(this, &sp58, &sp4C, &sp40, 2.0f, 25.0f, sp3C, sp3F);
+ EnFz_SpawnBreath(this, &pos, &velocity, &accel, 2.0f, 25.0f, primAlpha, damaging);
- sp58.x += sp4C.x * 0.5f;
- sp58.y += sp4C.y * 0.5f;
- sp58.z += sp4C.z * 0.5f;
-
- func_809340BC(this, &sp58, &sp4C, &sp40, 2.0f, 25.0f, sp3C, 0);
+ //! @bug: this does nothing, the above function already assigned all unused effects
+ pos.x += velocity.x * 0.5f;
+ pos.y += velocity.y * 0.5f;
+ pos.z += velocity.z * 0.5f;
+ EnFz_SpawnBreath(this, &pos, &velocity, &accel, 2.0f, 25.0f, primAlpha, false);
}
}
-void func_809336C0(EnFz* this, PlayState* play) {
- this->unk_BD6 = 0;
- this->unk_BBC = 0.0f;
+void EnFz_SetupDie(EnFz* this, PlayState* play) {
+ this->state = FZ_STATE_HIDDEN;
+ this->speedXZ = 0.0f;
this->actor.gravity = 0.0f;
this->actor.velocity.y = 0.0f;
this->actor.speed = 0.0f;
- this->unk_BCC = 1;
- this->unk_BCE = 0;
- this->unk_BD8 = 1;
+ this->isBgEnabled = true;
+ this->isColliderActive = false;
+ this->isDying = true;
this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
- this->unk_BD7 = 0;
- this->unk_BCA = 60;
+ this->drawBody = false;
+ this->mainTimer = 3 * 20;
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_PROP);
- Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xA0);
- this->actionFunc = func_80933760;
+ Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, (0xA << 4)); // drop table 0xA
+ this->actionFunc = EnFz_Die;
}
-void func_80933760(EnFz* this, PlayState* play) {
- if (this->unk_BCA == 0) {
+void EnFz_Die(EnFz* this, PlayState* play) {
+ if (this->mainTimer == 0) {
Actor_Kill(&this->actor);
}
}
-void func_80933790(EnFz* this) {
- this->unk_BD6 = 3;
- this->unk_BCE = 0;
- this->unk_BD8 = 1;
+/**
+ * Fire arrow specific death
+ */
+void EnFz_SetupMelt(EnFz* this) {
+ this->state = FZ_STATE_MELTING;
+ this->isColliderActive = false;
+ this->isDying = true;
this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
this->actor.speed = 0.0f;
- this->unk_BBC = 0.0f;
- this->actionFunc = func_809337D4;
+ this->speedXZ = 0.0f;
+ this->actionFunc = EnFz_Melt;
}
-void func_809337D4(EnFz* this, PlayState* play) {
+void EnFz_Melt(EnFz* this, PlayState* play) {
Math_StepToF(&this->actor.scale.y, 0.0006f, 0.0006f);
if (this->actor.scale.y < 0.006f) {
@@ -685,92 +711,98 @@ void func_809337D4(EnFz* this, PlayState* play) {
}
if (this->actor.scale.y < 0.004f) {
- this->unk_BC0 -= 20;
- if (this->unk_BC0 > 255) {
- this->unk_BC0 = 0;
+ this->envAlpha -= 20;
+ if (this->envAlpha > 255) {
+ this->envAlpha = 0;
}
}
- if (this->unk_BC0 == 0) {
- func_809336C0(this, play);
+ if (this->envAlpha == 0) {
+ EnFz_SetupDie(this, play);
}
}
-void func_8093389C(EnFz* this) {
- this->unk_BD6 = 1;
- this->unk_BCA = 40;
- this->unk_BCC = 1;
- this->unk_BCE = 1;
+void EnFz_SetupIdleStationary(EnFz* this) {
+ this->state = FZ_STATE_FULLSIZE;
+ this->mainTimer = 2 * 20;
+ this->isBgEnabled = true;
+ this->isColliderActive = true;
this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED;
this->actor.gravity = -1.0f;
- this->actionFunc = func_809338E0;
+ this->actionFunc = EnFz_IdleStationary;
}
-void func_809338E0(EnFz* this, PlayState* play) {
- Vec3f sp64;
- Vec3f sp58;
- Vec3f sp4C;
- Vec3f sp40;
- u8 sp3F;
- s16 sp3C;
+void EnFz_IdleStationary(EnFz* this, PlayState* play) {
+ Vec3f baseVelocity;
+ Vec3f pos;
+ Vec3f velocity;
+ Vec3f accel;
+ u8 damaging;
+ s16 primAlpha;
- if (this->unk_BC6 & (0x80 | 0x40)) {
- func_80933014(this);
- func_80932784(this, play);
+ if (this->internalClock & 0xC0) {
+ EnFz_SetYawTowardsPlayer(this);
+ EnFz_UpdateTargetPos(this, play);
return;
}
- sp3F = 0;
- sp3C = 150;
+ damaging = false;
+ primAlpha = 150;
Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_FREEZAD_BREATH - SFX_FLAG);
- if ((this->unk_BC6 & 0x3F) >= 0x30) {
- sp3C = 630 - ((this->unk_BC6 & 0x3F) * 10);
+ if ((this->internalClock & 0x3F) >= 0x30) {
+ primAlpha = 630 - ((this->internalClock & 0x3F) * 10);
}
- sp40.x = sp40.z = 0.0f;
- sp40.y = 0.6f;
+ accel.x = accel.z = 0.0f;
+ accel.y = 0.6f;
- sp58.x = this->actor.world.pos.x;
- sp58.y = this->actor.world.pos.y + 20.0f;
- sp58.z = this->actor.world.pos.z;
+ pos.x = this->actor.world.pos.x;
+ pos.y = this->actor.world.pos.y + 20.0f;
+ pos.z = this->actor.world.pos.z;
Matrix_RotateYS(this->actor.shape.rot.y, MTXMODE_NEW);
- sp64.x = 0.0f;
- sp64.y = -2.0f;
- sp64.z = ((ENFZ_GET_F(&this->actor) == ENFZ_F_1) ? 10.0f
- : (ENFZ_GET_F(&this->actor) == ENFZ_F_2) ? 20.0f
- : 0.0f) +
- 20;
+ baseVelocity.x = 0.0f;
+ baseVelocity.y = -2.0f;
+ baseVelocity.z = ((ENFZ_GET_POWER(&this->actor) == FZ_POWER_1) ? 10.0f
+ : (ENFZ_GET_POWER(&this->actor) == FZ_POWER_2) ? 20.0f
+ : 0.0f) +
+ 20;
- Matrix_MultVec3f(&sp64, &sp4C);
+ Matrix_MultVec3f(&baseVelocity, &velocity);
- if (!(this->unk_BC6 & 7)) {
- sp3F = 1;
+ if ((this->internalClock % 8) == 0) {
+ damaging = true;
}
- func_809340BC(this, &sp58, &sp4C, &sp40, 2.0f, 25.0f, sp3C, sp3F);
- sp58.x += sp4C.x * 0.5f;
- sp58.y += sp4C.y * 0.5f;
- sp58.z += sp4C.z * 0.5f;
- func_809340BC(this, &sp58, &sp4C, &sp40, 2.0f, 25.0f, sp3C, 0);
+ EnFz_SpawnBreath(this, &pos, &velocity, &accel, 2.0f, 25.0f, primAlpha, damaging);
+
+ //! @bug: this does nothing, the above function already assigned all unused effects
+ pos.x += velocity.x * 0.5f;
+ pos.y += velocity.y * 0.5f;
+ pos.z += velocity.z * 0.5f;
+ EnFz_SpawnBreath(this, &pos, &velocity, &accel, 2.0f, 25.0f, primAlpha, false);
}
-void func_80933AF4(EnFz* this) {
- this->unk_BD6 = 1;
- this->unk_BCA = 40;
- this->unk_BCC = 1;
- this->unk_BCE = 1;
+/**
+ * Unfinished and unused, specified by Init as separate power
+ * still spawns as a functional non-attacking variant
+ */
+void EnFz_SetupPassive(EnFz* this) {
+ this->state = FZ_STATE_FULLSIZE;
+ this->mainTimer = 2 * 20;
+ this->isBgEnabled = true;
+ this->isColliderActive = true;
this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED;
this->actor.gravity = -1.0f;
- this->actionFunc = func_80933B38;
+ this->actionFunc = EnFz_Passive;
}
-void func_80933B38(EnFz* this, PlayState* play) {
+void EnFz_Passive(EnFz* this, PlayState* play) {
}
-void func_80933B48(EnFz* this, PlayState* play) {
+void EnFz_UpdateLightArrowEffects(EnFz* this, PlayState* play) {
if (this->drawDmgEffTimer != 0) {
if (this->drawDmgEffTimer > 0) {
this->drawDmgEffTimer--;
@@ -786,32 +818,29 @@ void func_80933B48(EnFz* this, PlayState* play) {
}
void EnFz_Update(Actor* thisx, PlayState* play) {
- static EnFzUnkFunc D_809347AC[] = { func_80932AE8, func_80932AF4, func_80932BD4, func_80932BD4 };
+ static EnFzUnkFunc sMistSpawnFunctions[] = {
+ EnFz_SpawnMistHidden,
+ EnFz_SpawnMistChanging,
+ EnFz_SpawnMistFullSize,
+ EnFz_SpawnMistFullSize,
+ };
s32 pad;
EnFz* this = (EnFz*)thisx;
- this->unk_BC6++;
- if (this->unk_BC8 != 0) {
- this->unk_BC8--;
- }
-
- if (this->unk_BCA != 0) {
- this->unk_BCA--;
- }
-
- if (this->unk_BD9 != 0) {
- this->unk_BD9--;
- }
+ this->internalClock++;
+ DECR(this->unusedTimer);
+ DECR(this->mainTimer);
+ DECR(this->attackTimer);
Actor_SetFocus(&this->actor, 50.0f);
- func_80932C98(this, play);
+ EnFz_ApplyDamage(this, play);
this->actionFunc(this, play);
- if (this->unk_BD8 == 0) {
+ if (!this->isDying) {
Collider_UpdateCylinder(&this->actor, &this->collider1);
Collider_UpdateCylinder(&this->actor, &this->collider2);
- if (this->unk_BCE != 0) {
+ if (this->isColliderActive) {
if (this->actor.colorFilterTimer == 0) {
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider1.base);
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider2.base);
@@ -820,31 +849,31 @@ void EnFz_Update(Actor* thisx, PlayState* play) {
}
}
- Math_StepToF(&this->actor.speed, this->unk_BBC, 0.2f);
+ Math_StepToF(&this->actor.speed, this->speedXZ, 0.2f);
Actor_MoveWithGravity(&this->actor);
- if (this->unk_BCC != 0) {
+ if (this->isBgEnabled) {
Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 20.0f, UPDBGCHECKINFO_FLAG_1 | UPDBGCHECKINFO_FLAG_4);
}
- D_809347AC[this->unk_BD6](this);
- func_80933B48(this, play);
- func_80934178(this, play);
+ sMistSpawnFunctions[this->state](this);
+ EnFz_UpdateLightArrowEffects(this, play);
+ EnFz_UpdateEffects(this, play);
}
void EnFz_Draw(Actor* thisx, PlayState* play) {
- static Gfx* D_809347BC[] = { object_fz_DL_001130, object_fz_DL_0021A0, object_fz_DL_002CA0 };
+ static Gfx* sBodyDisplayLists[] = { gFreezardBodyIntactDL, gFreezardBodyHornBrokenDL, gFreezardBodyHeadBrokenDL };
s32 pad;
EnFz* this = (EnFz*)thisx;
- s32 sp9C = 3 - this->actor.colChkInfo.health;
+ s32 bodyDlIndex = 3 - this->actor.colChkInfo.health;
OPEN_DISPS(play->state.gfxCtx);
if (this->actor.colChkInfo.health == 0) {
- sp9C = 2;
+ bodyDlIndex = 2;
}
- if (this->unk_BD7 != 0) {
- func_800B8118(&this->actor, play, 0);
+ if (this->drawBody) {
+ func_800B8118(&this->actor, play, false);
Gfx_SetupDL25_Xlu(play->state.gfxCtx);
gSPSegment(POLY_XLU_DISP++, 0x08,
@@ -854,14 +883,14 @@ void EnFz_Draw(Actor* thisx, PlayState* play) {
gDPSetCombineLERP(POLY_XLU_DISP++, TEXEL1, PRIMITIVE, PRIM_LOD_FRAC, TEXEL0, TEXEL1, TEXEL0, PRIMITIVE, TEXEL0,
PRIMITIVE, ENVIRONMENT, COMBINED, ENVIRONMENT, COMBINED, 0, ENVIRONMENT, 0);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 155, 255, 255, 255);
- gDPSetEnvColor(POLY_XLU_DISP++, 200, 200, 200, this->unk_BC0);
- gSPDisplayList(POLY_XLU_DISP++, D_809347BC[sp9C]);
+ gDPSetEnvColor(POLY_XLU_DISP++, 200, 200, 200, this->envAlpha);
+ gSPDisplayList(POLY_XLU_DISP++, sBodyDisplayLists[bodyDlIndex]);
}
- func_80934464(this, play);
+ EnFz_DrawEffects(this, play);
if (this->drawDmgEffTimer > 0) {
- s32 pad2[6];
+ s32 pad2[6]; // what in tarnation
Vec3f bodyPartsPos[2];
s32 pad3;
@@ -876,119 +905,127 @@ void EnFz_Draw(Actor* thisx, PlayState* play) {
CLOSE_DISPS(play->state.gfxCtx);
}
-void func_80934018(EnFz* this, Vec3f* a, Vec3f* b, Vec3f* c, f32 arg4) {
+/**
+ * The rising cloud of mist coming from the Freezard's body
+ */
+void EnFz_SpawnMistAura(EnFz* this, Vec3f* pos, Vec3f* velocity, Vec3f* accel, f32 xyScale) {
s16 i;
- EnFzStruct* ptr = &this->unk_23C[0];
+ EnFzEffect* effect = &this->effects[0];
- for (i = 0; i < ARRAY_COUNT(this->unk_23C); i++, ptr++) {
- if (ptr->unk_00 == 0) {
- ptr->unk_00 = 1;
- ptr->unk_04 = *a;
- ptr->unk_10 = *b;
- ptr->unk_1C = *c;
- ptr->unk_2E = 0;
- ptr->unk_30 = arg4 / 1000.0f;
- ptr->unk_2C = 0;
- ptr->unk_01 = 0;
+ for (i = 0; i < ARRAY_COUNT(this->effects); i++, effect++) {
+ if (effect->type == FZ_EFFECT_DISABLED) {
+ effect->type = FZ_EFFECT_MIST_AURA;
+ effect->pos = *pos;
+ effect->velocity = *velocity;
+ effect->accel = *accel;
+ effect->primAlphaState = 0;
+ effect->xyScale = xyScale / 1000.0f;
+ effect->primAlpha = 0;
+ effect->timer = 0;
break;
}
}
}
-void func_809340BC(EnFz* this, Vec3f* a, Vec3f* b, Vec3f* c, f32 arg4, f32 arg5, s16 arg6, u8 arg7) {
+/**
+ * The breath attack stream is made up of small steam effects
+ */
+void EnFz_SpawnBreath(EnFz* this, Vec3f* pos, Vec3f* velocity, Vec3f* accel, f32 xyScale, f32 xyScaleTarget,
+ s16 primAlpha, u8 damaging) {
s16 i;
- EnFzStruct* ptr = &this->unk_23C[0];
+ EnFzEffect* effect = &this->effects[0];
- for (i = 0; i < ARRAY_COUNT(this->unk_23C); i++, ptr++) {
- if (ptr->unk_00 == 0) {
- ptr->unk_00 = 2;
- ptr->unk_04 = *a;
- ptr->unk_10 = *b;
- ptr->unk_1C = *c;
- ptr->unk_2E = 0;
- ptr->unk_30 = arg4 / 1000.0f;
- ptr->unk_34 = arg5 / 1000.0f;
- ptr->unk_2C = arg6;
- ptr->unk_01 = 0;
- ptr->unk_38 = arg7;
+ for (i = 0; i < ARRAY_COUNT(this->effects); i++, effect++) {
+ if (effect->type == FZ_EFFECT_DISABLED) {
+ effect->type = FZ_EFFECT_BREATH;
+ effect->pos = *pos;
+ effect->velocity = *velocity;
+ effect->accel = *accel;
+ effect->primAlphaState = 0;
+ effect->xyScale = xyScale / 1000.0f;
+ effect->xyScaleTarget = xyScaleTarget / 1000.0f;
+ effect->primAlpha = primAlpha;
+ effect->timer = 0;
+ effect->damaging = damaging;
break;
}
}
}
-void func_80934178(EnFz* this, PlayState* play) {
+void EnFz_UpdateEffects(EnFz* this, PlayState* play) {
s16 i;
- EnFzStruct* ptr = this->unk_23C;
- Vec3f sp64;
+ EnFzEffect* effect = this->effects;
+ Vec3f pos;
- for (i = 0; i < ARRAY_COUNT(this->unk_23C); i++, ptr++) {
- if (ptr->unk_00 != 0) {
- ptr->unk_04.x += ptr->unk_10.x;
- ptr->unk_04.y += ptr->unk_10.y;
- ptr->unk_04.z += ptr->unk_10.z;
+ for (i = 0; i < ARRAY_COUNT(this->effects); i++, effect++) {
+ if (effect->type != FZ_EFFECT_DISABLED) {
+ effect->pos.x += effect->velocity.x;
+ effect->pos.y += effect->velocity.y;
+ effect->pos.z += effect->velocity.z;
- ptr->unk_01++;
+ effect->timer++;
- ptr->unk_10.x += ptr->unk_1C.x;
- ptr->unk_10.y += ptr->unk_1C.y;
- ptr->unk_10.z += ptr->unk_1C.z;
+ effect->velocity.x += effect->accel.x;
+ effect->velocity.y += effect->accel.y;
+ effect->velocity.z += effect->accel.z;
- if (ptr->unk_00 == 1) {
- if (ptr->unk_2E == 0) {
- ptr->unk_2C += 10;
- if (ptr->unk_2C >= 100) {
- ptr->unk_2E++;
+ if (effect->type == FZ_EFFECT_MIST_AURA) {
+ if (effect->primAlphaState == 0) {
+ effect->primAlpha += 10;
+ if (effect->primAlpha >= 100) {
+ effect->primAlphaState++;
}
} else {
- ptr->unk_2C -= 3;
- if (ptr->unk_2C <= 0) {
- ptr->unk_2C = 0;
- ptr->unk_00 = 0;
+ effect->primAlpha -= 3;
+ if (effect->primAlpha <= 0) {
+ effect->primAlpha = 0;
+ effect->type = FZ_EFFECT_DISABLED;
}
}
- } else if (ptr->unk_00 == 2) {
- Math_ApproachF(&ptr->unk_30, ptr->unk_34, 0.1f, ptr->unk_34 / 10.0f);
- if (ptr->unk_2E == 0) {
- if (ptr->unk_01 >= 7) {
- ptr->unk_2E++;
+ } else if (effect->type == FZ_EFFECT_BREATH) {
+ Math_ApproachF(&effect->xyScale, effect->xyScaleTarget, 0.1f, effect->xyScaleTarget / 10.0f);
+ if (effect->primAlphaState == 0) {
+ if (effect->timer >= 7) {
+ effect->primAlphaState++;
}
} else {
- ptr->unk_10.x *= 0.75f;
- ptr->unk_1C.y = 2.0f;
- ptr->unk_10.z *= 0.75f;
- ptr->unk_2C -= 17;
- if (ptr->unk_2C <= 0) {
- ptr->unk_2C = 0;
- ptr->unk_00 = 0;
+ effect->velocity.x *= 0.75f;
+ effect->accel.y = 2.0f;
+ effect->velocity.z *= 0.75f;
+ effect->primAlpha -= 17;
+ if (effect->primAlpha <= 0) {
+ effect->primAlpha = 0;
+ effect->type = FZ_EFFECT_DISABLED;
}
}
- if ((this->unk_BD9 == 0) && (ptr->unk_2C > 100) && (ptr->unk_38 != 0)) {
- this->collider3.dim.pos.x = ptr->unk_04.x;
- this->collider3.dim.pos.y = ptr->unk_04.y;
- this->collider3.dim.pos.z = ptr->unk_04.z;
+ // note: attackTimer is never set, always zero
+ if ((this->attackTimer == 0) && (effect->primAlpha > 100) && effect->damaging) {
+ this->collider3.dim.pos.x = effect->pos.x;
+ this->collider3.dim.pos.y = effect->pos.y;
+ this->collider3.dim.pos.z = effect->pos.z;
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider3.base);
}
- sp64.x = ptr->unk_04.x;
- sp64.y = ptr->unk_04.y + 10.0f;
- sp64.z = ptr->unk_04.z;
+ pos.x = effect->pos.x;
+ pos.y = effect->pos.y + 10.0f;
+ pos.z = effect->pos.z;
- if ((ptr->unk_2E != 2) && func_809328A4(this, &sp64)) {
- ptr->unk_2E = 2;
- ptr->unk_10.x = 0.0f;
- ptr->unk_10.z = 0.0f;
+ if ((effect->primAlphaState != 2) && EnFz_ReachedTarget(this, &pos)) {
+ effect->primAlphaState = 2;
+ effect->velocity.x = 0.0f;
+ effect->velocity.z = 0.0f;
}
}
}
}
}
-void func_80934464(EnFz* this, PlayState* play) {
+void EnFz_DrawEffects(EnFz* this, PlayState* play) {
GraphicsContext* gfxCtx = play->state.gfxCtx;
s16 i;
- u8 flag = 0;
- EnFzStruct* ptr = this->unk_23C;
+ u8 materialLoaded = false;
+ EnFzEffect* effect = this->effects;
OPEN_DISPS(gfxCtx);
@@ -997,23 +1034,25 @@ void func_80934464(EnFz* this, PlayState* play) {
gDPSetColorDither(POLY_XLU_DISP++, G_CD_BAYER);
gDPSetAlphaDither(POLY_XLU_DISP++, G_AD_PATTERN);
- for (i = 0; i < ARRAY_COUNT(this->unk_23C); i++, ptr++) {
- if (ptr->unk_00 > 0) {
+ for (i = 0; i < ARRAY_COUNT(this->effects); i++, effect++) {
+ if (effect->type > FZ_EFFECT_DISABLED) {
gDPPipeSync(POLY_XLU_DISP++);
- if (flag == 0) {
+ if (materialLoaded == false) {
+ // surely there is a better way to make sure this only goes off if there are effects than to force
+ // another branch per loop
gSPDisplayList(POLY_XLU_DISP++, gFrozenSteamMaterialDL);
- flag++;
+ materialLoaded++;
}
- gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 195, 225, 235, ptr->unk_2C);
+ gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 195, 225, 235, effect->primAlpha);
gSPSegment(POLY_XLU_DISP++, 0x08,
- Gfx_TwoTexScroll(play->state.gfxCtx, 0, (ptr->unk_01 + (i * 3)) * 3,
- (ptr->unk_01 + (i * 3)) * 15, 0x20, 0x40, 1, 0, 0, 0x20, 0x20));
+ Gfx_TwoTexScroll(play->state.gfxCtx, 0, (effect->timer + (i * 3)) * 3,
+ (effect->timer + (i * 3)) * 15, 0x20, 0x40, 1, 0, 0, 0x20, 0x20));
- Matrix_Translate(ptr->unk_04.x, ptr->unk_04.y, ptr->unk_04.z, MTXMODE_NEW);
+ Matrix_Translate(effect->pos.x, effect->pos.y, effect->pos.z, MTXMODE_NEW);
Matrix_ReplaceRotation(&play->billboardMtxF);
- Matrix_Scale(ptr->unk_30, ptr->unk_30, 1.0f, MTXMODE_APPLY);
+ Matrix_Scale(effect->xyScale, effect->xyScale, 1.0f, MTXMODE_APPLY);
MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx);
gSPDisplayList(POLY_XLU_DISP++, gFrozenSteamModelDL);
diff --git a/src/overlays/actors/ovl_En_Fz/z_en_fz.h b/src/overlays/actors/ovl_En_Fz/z_en_fz.h
index ac1cb06485..2bce014e14 100644
--- a/src/overlays/actors/ovl_En_Fz/z_en_fz.h
+++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.h
@@ -8,66 +8,97 @@ struct EnFz;
typedef void (*EnFzActionFunc)(struct EnFz*, PlayState*);
typedef void (*EnFzUnkFunc)(struct EnFz*);
-#define ENFZ_GET_F(thisx) ((thisx)->params & 0xF)
-#define ENFZ_GET_3000(thisx) (((thisx)->params & 0x3000) >> 0xC)
-#define ENFZ_GET_4000(thisx) ((thisx)->params & 0x4000)
-#define ENFZ_GET_8000(thisx) ((thisx)->params & 0x8000)
+#define ENFZ_GET_POWER(thisx) ((thisx)->params & 0xF)
+#define ENFZ_GET_ROTATION_LIMIT(thisx) (((thisx)->params & 0x3000) >> 0xC)
+// appears out of the ground imediately
+#define ENFZ_GET_APPEAR_TYPE(thisx) ((thisx)->params & 0x4000)
+// if ENFZ_GET_TRACK_TYPE and NOT ENFZ_GET_APPEAR_TYPE (0x8000)
+// appears from the ground if player approaches, skates after them
+#define ENFZ_GET_TRACK_TYPE(thisx) ((thisx)->params & 0x8000)
+// Track and Appear have a mixed behavior if both are enabled:
+// if ENFZ_GET_TRACK_TYPE AND ENFZ_GET_APPEAR_TYPE (0xC000)
+// appears from the ground immediately, stays still,
+// but follows player to aim, while ignoring rotation limit
-typedef enum {
- /* 0 */ ENFZ_F_0,
- /* 1 */ ENFZ_F_1,
- /* 2 */ ENFZ_F_2,
- /* 3 */ ENFZ_F_3
-} EnFzParam;
+// Clock specifies where the internal clock starts, zero is random
+// used to force specific attack timing
+// used in Snowhead Temple: 0x3, 0x7, 0xD in room 02
+// causing them to breath at the bridge in series so the player has to time the jump
+// the value passed is 1/10 final value in frames
+#define ENFZ_GETZ_CLOCK(thisx) ((thisx)->shape.rot.z)
-typedef struct {
- /* 0x00 */ u8 unk_00;
- /* 0x01 */ u8 unk_01;
- /* 0x04 */ Vec3f unk_04;
- /* 0x10 */ Vec3f unk_10;
- /* 0x1C */ Vec3f unk_1C;
- /* 0x28 */ UNK_TYPE1 unk_28[0x4];
- /* 0x2C */ s16 unk_2C;
- /* 0x2E */ s16 unk_2E;
- /* 0x30 */ f32 unk_30;
- /* 0x34 */ f32 unk_34;
- /* 0x38 */ u8 unk_38;
-} EnFzStruct; // size = 0x3C
+// 0,1,2 are how powerful (distance) the attack is
+// F is treated like 0 (else case)
+typedef enum EnFzPower {
+ /* 0 */ FZ_POWER_0, // + 0
+ /* 1 */ FZ_POWER_1, // + 10
+ /* 2 */ FZ_POWER_2, // + 20
+ /* 3 */ FZ_POWER_PASSIVE, // unfinished empty actionfunc
+ /* F */ FZ_POWER_F = 0xF // snowhead map room
+} EnFzPower;
+
+typedef enum EnFzEffectType {
+ /* 0 */ FZ_EFFECT_DISABLED,
+ /* 1 */ FZ_EFFECT_MIST_AURA,
+ /* 2 */ FZ_EFFECT_BREATH
+} EnFzEffectType;
+
+typedef struct EnFzEffect {
+ /* 0x00 */ u8 type;
+ /* 0x01 */ u8 timer;
+ /* 0x04 */ Vec3f pos;
+ /* 0x10 */ Vec3f velocity;
+ /* 0x1C */ Vec3f accel;
+ /* 0x28 */ UNK_TYPE1 unk28[0x4];
+ /* 0x2C */ s16 primAlpha;
+ /* 0x2E */ s16 primAlphaState;
+ /* 0x30 */ f32 xyScale;
+ /* 0x34 */ f32 xyScaleTarget;
+ /* 0x38 */ u8 damaging;
+} EnFzEffect; // size = 0x3C
+
+// indexes the different mist functions
+typedef enum EnFzState {
+ /* 0 */ FZ_STATE_HIDDEN, // OOT, waiting for player approach, ice cavern
+ /* 1 */ FZ_STATE_FULLSIZE,
+ /* 2 */ FZ_STATE_CHANGING, // OOT, growing and disappearing, ice cavern
+ /* 3 */ FZ_STATE_MELTING, // fire arrows
+} EnFzState;
typedef struct EnFz {
/* 0x000 */ Actor actor;
/* 0x144 */ EnFzActionFunc actionFunc;
/* 0x148 */ ColliderCylinder collider1;
- /* 0x194 */ ColliderCylinder collider2;
- /* 0x1E0 */ ColliderCylinder collider3;
- /* 0x22C */ Vec3f unk_22C;
- /* 0x238 */ f32 unk_238;
- /* 0x23C */ EnFzStruct unk_23C[40];
+ /* 0x194 */ ColliderCylinder collider2; // might be hard protection ac
+ /* 0x1E0 */ ColliderCylinder collider3; // at for breath
+ /* 0x22C */ Vec3f wallHitPos;
+ /* 0x238 */ f32 distToTargetSq;
+ /* 0x23C */ EnFzEffect effects[40];
/* 0xB9C */ f32 drawDmgEffAlpha;
/* 0xBA0 */ f32 drawDmgEffScale;
/* 0xBA4 */ s16 drawDmgEffTimer;
- /* 0xBA8 */ f32 unk_BA8;
- /* 0xBAC */ f32 unk_BAC;
- /* 0xBB0 */ f32 unk_BB0;
- /* 0xBB4 */ f32 unk_BB4;
- /* 0xBB8 */ f32 unk_BB8;
- /* 0xBBC */ f32 unk_BBC;
- /* 0xBC0 */ u32 unk_BC0;
- /* 0xBC4 */ s16 unk_BC4;
- /* 0xBC6 */ s16 unk_BC6;
- /* 0xBC8 */ s16 unk_BC8;
- /* 0xBCA */ s16 unk_BCA;
- /* 0xBCC */ u8 unk_BCC;
- /* 0xBCD */ u8 unk_BCD;
- /* 0xBCE */ u8 unk_BCE;
- /* 0xBCF */ u8 unk_BCF;
- /* 0xBD0 */ s16 unk_BD0;
- /* 0xBD2 */ s16 unk_BD2;
+ /* 0xBA8 */ Vec3f originPos;
+ /* 0xBB4 */ f32 originPosY;
+ /* 0xBB8 */ f32 unkBB8; // set (135.0f), never read
+ /* 0xBBC */ f32 speedXZ;
+ /* 0xBC0 */ u32 envAlpha;
+ // we set it, and read it, but never the same value
+ // assumed unfinished shared variable with wizrobe
+ /* 0xBC4 */ s16 wizrobeFlag;
+ /* 0xBC6 */ s16 internalClock;
+ /* 0xBC8 */ s16 unusedTimer; // set (0), never read
+ /* 0xBCA */ s16 mainTimer;
+ /* 0xBCC */ u8 isBgEnabled;
+ /* 0xBCD */ u8 isMoving;
+ /* 0xBCE */ u8 isColliderActive;
+ /* 0xBCF */ u8 hitCounter; /// set, never read
+ /* 0xBD0 */ s16 unkBD0; // set (0), never read
+ /* 0xBD2 */ s16 unkBD2; // set (0,4000), never read
/* 0xBD4 */ UNK_TYPE1 unkBD4[2];
- /* 0xBD6 */ u8 unk_BD6;
- /* 0xBD7 */ u8 unk_BD7;
- /* 0xBD8 */ u8 unk_BD8;
- /* 0xBD9 */ u8 unk_BD9;
+ /* 0xBD6 */ u8 state;
+ /* 0xBD7 */ u8 drawBody;
+ /* 0xBD8 */ u8 isDying;
+ /* 0xBD9 */ u8 attackTimer; // never set, always zero
} EnFz; /* size = 0xBDC */
#endif // Z_EN_FZ_H
diff --git a/src/overlays/actors/ovl_En_Hgo/z_en_hgo.c b/src/overlays/actors/ovl_En_Hgo/z_en_hgo.c
index 9352c9d7b0..63baddd8ba 100644
--- a/src/overlays/actors/ovl_En_Hgo/z_en_hgo.c
+++ b/src/overlays/actors/ovl_En_Hgo/z_en_hgo.c
@@ -224,7 +224,7 @@ void EnHgo_HandlePlayerChoice(EnHgo* this, PlayState* play) {
break;
case 0x1590:
- if (CHECK_WEEKEVENTREG(WEEKEVENTREG_14_04)) {
+ if (CHECK_WEEKEVENTREG(WEEKEVENTREG_IKANA_SPRING_RESTORED)) {
Message_StartTextbox(play, 0x1591, &this->actor);
this->textId = 0x1591;
break;
diff --git a/src/overlays/actors/ovl_En_Jso/z_en_jso.c b/src/overlays/actors/ovl_En_Jso/z_en_jso.c
index 4d308530ad..adb560d76c 100644
--- a/src/overlays/actors/ovl_En_Jso/z_en_jso.c
+++ b/src/overlays/actors/ovl_En_Jso/z_en_jso.c
@@ -1232,28 +1232,28 @@ void EnJso_TellHint(EnJso* this, PlayState* play) {
case EN_JSO_HINT_VARIABLE_1:
textId = 0x139D; // Hint about Pamela's family being in the house with the waterwheel
- if (CHECK_WEEKEVENTREG(WEEKEVENTREG_14_04)) {
+ if (CHECK_WEEKEVENTREG(WEEKEVENTREG_IKANA_SPRING_RESTORED)) {
textId = 0x13A1; // Hint about using the Song of Healing on Pamela's father
}
break;
case EN_JSO_HINT_VARIABLE_2:
textId = 0x139E; // Hint about Pamela leaving her house to check something
- if (CHECK_WEEKEVENTREG(WEEKEVENTREG_14_04)) {
+ if (CHECK_WEEKEVENTREG(WEEKEVENTREG_IKANA_SPRING_RESTORED)) {
textId = 0x13A2; // Hint about the well being connected to Ikana Castle
}
break;
case EN_JSO_HINT_VARIABLE_3:
textId = 0x139F; // Hint about restoring the river by going into Sharp's cave
- if (CHECK_WEEKEVENTREG(WEEKEVENTREG_14_04)) {
+ if (CHECK_WEEKEVENTREG(WEEKEVENTREG_IKANA_SPRING_RESTORED)) {
textId = 0x13A3; // Hint about the Gibdos in the well wanting items
}
break;
case EN_JSO_HINT_VARIABLE_4:
textId = 0x13A0; // Hint about needing the Song of Storms to pacify Sharp
- if (CHECK_WEEKEVENTREG(WEEKEVENTREG_14_04)) {
+ if (CHECK_WEEKEVENTREG(WEEKEVENTREG_IKANA_SPRING_RESTORED)) {
textId = 0x13A4; // Hint about the items the Gibdos want being in the well
}
break;
diff --git a/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c b/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c
index 2607390655..7c6e89a05d 100644
--- a/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c
+++ b/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c
@@ -170,8 +170,9 @@ void EnPamera_Init(Actor* thisx, PlayState* play) {
func_80BD8588(this, play);
func_80BD8658(this);
- if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_14_04) || CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE) ||
- CHECK_WEEKEVENTREG(WEEKEVENTREG_75_20) || (gSaveContext.save.entrance == ENTRANCE(IKANA_CANYON, 9))) {
+ if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_IKANA_SPRING_RESTORED) ||
+ CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE) || CHECK_WEEKEVENTREG(WEEKEVENTREG_75_20) ||
+ (gSaveContext.save.entrance == ENTRANCE(IKANA_CANYON, 9))) {
Actor_Kill(&this->actor);
}
@@ -593,7 +594,7 @@ void func_80BD9840(EnPamera* this, PlayState* play) {
func_80BD9E60(this);
func_80BD9904(this);
}
- if (CHECK_WEEKEVENTREG(WEEKEVENTREG_14_04)) {
+ if (CHECK_WEEKEVENTREG(WEEKEVENTREG_IKANA_SPRING_RESTORED)) {
func_801A0204(NA_BGM_MUSIC_BOX_HOUSE);
} else {
func_801A0204(NA_BGM_INSIDE_A_HOUSE);
@@ -898,7 +899,7 @@ void func_80BDA344(Actor* thisx, PlayState* play) {
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
}
- if (CHECK_WEEKEVENTREG(WEEKEVENTREG_14_04)) {
+ if (CHECK_WEEKEVENTREG(WEEKEVENTREG_IKANA_SPRING_RESTORED)) {
play->roomCtx.unk7A[0]++;
}
}
diff --git a/src/overlays/actors/ovl_En_Po_Composer/z_en_po_composer.c b/src/overlays/actors/ovl_En_Po_Composer/z_en_po_composer.c
index bc60c0bcc2..044ee3210d 100644
--- a/src/overlays/actors/ovl_En_Po_Composer/z_en_po_composer.c
+++ b/src/overlays/actors/ovl_En_Po_Composer/z_en_po_composer.c
@@ -30,7 +30,7 @@ void EnPoComposer_Roll(EnPoComposer* this, PlayState* play);
void EnPoComposer_SetupAwaitPlayer(EnPoComposer* this);
void EnPoComposer_SetupStartCutscene(EnPoComposer* this);
void EnPoComposer_SetupStartedCutscene(EnPoComposer* this);
-void EnPoComposer_StepLightAlpha(EnPoComposer* this);
+void EnPoComposer_StepMainAlpha(EnPoComposer* this);
ActorProfile En_Po_Composer_Profile = {
/**/ ACTOR_EN_PO_COMPOSER,
@@ -93,6 +93,7 @@ static ColliderJntSphInit sJntSphInit = {
static CollisionCheckInfoInit sColChkInfoInit = { 4, 25, 50, 40 };
+// Unused. Interesting that they had planned for a fight at some point, maybe flat?
static DamageTable sDamageTable = {
/* Deku Nut */ DMG_ENTRY(0, 0x0),
/* Deku Stick */ DMG_ENTRY(2, 0x0),
@@ -120,7 +121,7 @@ static DamageTable sDamageTable = {
/* Zora punch */ DMG_ENTRY(4, 0x0),
/* Spin attack */ DMG_ENTRY(2, 0x0),
/* Sword beam */ DMG_ENTRY(2, 0x0),
- /* Normal Roll */ DMG_ENTRY(8, 0x0),
+ /* Normal Roll */ DMG_ENTRY(8, 0x0), // 8 damage? on rolling?
/* UNK_DMG_0x1B */ DMG_ENTRY(4, 0x0),
/* UNK_DMG_0x1C */ DMG_ENTRY(0, 0x0),
/* Unblockable */ DMG_ENTRY(0, 0x0),
@@ -161,9 +162,10 @@ static AnimationInfo sAnimationInfo[POE_COMPOSER_ANIM_MAX] = {
/* 12 */ { &gPoeComposerAttackAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
};
-static Color_RGBA8 sLightColorInit = { 255, 255, 210, 0 };
+// also used for robe hem base color, but it gets overridden by sSharpClothingColor2 (bug?)
+static Color_RGBA8 sEyeColor = { 255, 255, 210, 0 };
-static Color_RGBA8 sEnvColorInit = { 0, 0, 0, 255 };
+static Color_RGBA8 sLightColorInit = { 0, 0, 0, 255 };
static Color_RGBA8 sSharpClothingColor1 = { 75, 20, 25, 255 };
@@ -195,27 +197,29 @@ void EnPoComposer_Init(Actor* thisx, PlayState* play) {
Lights_PointGlowSetInfo(&this->lightInfo, this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z,
255, 255, 255, 0);
this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
+ this->eyeColor = sEyeColor;
this->lightColor = sLightColorInit;
- this->envColor = sEnvColorInit;
this->cueId = POE_COMPOSER_CUEID_NONE;
if (POE_COMPOSER_IS_FLAT(&this->actor)) {
this->sharpCsNum = 0;
this->inCutscene = true;
EnPoComposer_SetupStartedCutscene(this);
- } else if (POE_COMPOSER_4000(&this->actor)) {
+ } else if (POE_COMPOSER_SHARP_HEALED(&this->actor)) {
+ // Player spawned in the cave after music house river cutscene
if (gSaveContext.save.entrance != ENTRANCE(IKANA_CANYON, 10)) {
Actor_Kill(&this->actor);
return;
}
- this->sharpCsNum = SHARP_CS_ENCOUNTER_FIRST;
+
+ this->sharpCsNum = SHARP_CS_ENCOUNTER_HEALED_TALK;
this->inCutscene = true;
EnPoComposer_SetupStartedCutscene(this);
- } else {
+ } else { // Sharp (hostile)
s32 i;
s16 csId = this->actor.csId;
- if (CHECK_WEEKEVENTREG(WEEKEVENTREG_14_04)) {
+ if (CHECK_WEEKEVENTREG(WEEKEVENTREG_IKANA_SPRING_RESTORED)) {
Actor_Kill(&this->actor);
return;
}
@@ -228,11 +232,12 @@ void EnPoComposer_Init(Actor* thisx, PlayState* play) {
csId = CutsceneManager_GetAdditionalCsId(csId);
}
- if (CHECK_WEEKEVENTREG(WEEKEVENTREG_14_02)) {
- this->sharpCsNum = SHARP_CS_ENCOUNTER_OTHER;
+ if (CHECK_WEEKEVENTREG(WEEKEVENTREG_SHARP_HOSTILE_CONVERSATION)) {
+ this->sharpCsNum = SHARP_CS_ENCOUNTER_AGRO_TALK;
} else {
- this->sharpCsNum = SHARP_CS_ENCOUNTER_FIRST;
+ this->sharpCsNum = SHARP_CS_ENCOUNTER_HEALED_TALK;
}
+
this->inCutscene = false;
EnPoComposer_SetupAwaitPlayer(this);
}
@@ -293,6 +298,7 @@ void EnPoComposer_PlayCurse(EnPoComposer* this, PlayState* play) {
// Damage the player every second
if (this->actionTimer == 20) {
+ // Quarter heart damage (4)
func_800B8D10(play, &this->actor, 0.0f, 0, 0.0f, 1, 4);
this->actionTimer = 0;
} else {
@@ -417,7 +423,7 @@ void EnPoComposer_Roll(EnPoComposer* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_SHARP_REACTION);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, POE_COMPOSER_ANIM_ROLLING);
}
- } else if (Animation_OnFrame(&this->skelAnime, 1.0f) && (this->lightColor.a > 32)) {
+ } else if (Animation_OnFrame(&this->skelAnime, 1.0f) && (this->eyeColor.a > 32)) {
if (this->csCueTimer == 1) {
Actor_PlaySfx(&this->actor, NA_SE_EN_LAST3_DEAD_WIND2_OLD);
this->csCueTimer = 2;
@@ -429,7 +435,7 @@ void EnPoComposer_Roll(EnPoComposer* this, PlayState* play) {
}
void EnPoComposer_SharpCutsceneDone(EnPoComposer* this) {
- SET_WEEKEVENTREG(WEEKEVENTREG_14_04);
+ SET_WEEKEVENTREG(WEEKEVENTREG_IKANA_SPRING_RESTORED);
Actor_Kill(&this->actor);
}
@@ -504,7 +510,7 @@ s32 EnPoComposer_UpdateAction(EnPoComposer* this, PlayState* play) {
Cutscene_ActorTranslate(&this->actor, play, cueChannel);
}
- EnPoComposer_StepLightAlpha(this);
+ EnPoComposer_StepMainAlpha(this);
if ((this->sharpCsNum == SHARP_CS_SONG_STORMS) && (play->csCtx.curFrame == 204)) {
Audio_PlaySfx(NA_SE_SY_DIZZY_EFFECT);
@@ -521,14 +527,14 @@ s32 EnPoComposer_UpdateAction(EnPoComposer* this, PlayState* play) {
if (POE_COMPOSER_IS_FLAT(&this->actor)) {
EnPoComposer_SetupStartedCutscene(this);
- } else if (POE_COMPOSER_4000(&this->actor)) {
+ } else if (POE_COMPOSER_SHARP_HEALED(&this->actor)) {
EnPoComposer_SetupStartedCutscene(this);
- } else {
+ } else { // Sharp is hostile
this->inCutscene = false;
if (this->sharpCsNum < SHARP_CS_SONG_STORMS) {
- if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_14_02)) {
- SET_WEEKEVENTREG(WEEKEVENTREG_14_02);
+ if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_SHARP_HOSTILE_CONVERSATION)) {
+ SET_WEEKEVENTREG(WEEKEVENTREG_SHARP_HOSTILE_CONVERSATION);
}
EnPoComposer_SetupPlayCurse(this);
} else {
@@ -541,55 +547,57 @@ s32 EnPoComposer_UpdateAction(EnPoComposer* this, PlayState* play) {
return false;
}
-void EnPoComposer_StepLightAlpha(EnPoComposer* this) {
- if ((this->visible == true) && (this->lightColor.a != 255)) {
- if (this->lightColor.a > 247) {
- this->lightColor.a = 255;
+void EnPoComposer_StepMainAlpha(EnPoComposer* this) {
+ if ((this->visible == true) && (this->mainAlpha.a != 255)) {
+ if (this->mainAlpha.a > 247) {
+ this->mainAlpha.a = 255;
} else {
- this->lightColor.a += 7;
+ this->mainAlpha.a += 7;
}
- } else if (!this->visible && (this->lightColor.a != 0)) {
- if (this->lightColor.a < 8) {
- this->lightColor.a = 0;
+ } else if (!this->visible && (this->mainAlpha.a != 0)) {
+ if (this->mainAlpha.a < 8) {
+ this->mainAlpha.a = 0;
} else {
- this->lightColor.a -= 7;
+ this->mainAlpha.a -= 7;
}
}
}
-void EnPoComposer_StepLightColor(EnPoComposer* this) {
+void EnPoComposer_StepEyeColor(EnPoComposer* this) {
s16 color;
- color = this->lightColor.r + 5;
- this->lightColor.r = CLAMP_MAX(color, 255);
+ color = this->eyeColor.r + 5;
+ this->eyeColor.r = CLAMP_MAX(color, 255);
- color = this->lightColor.g + 5;
- this->lightColor.g = CLAMP_MAX(color, 255);
+ color = this->eyeColor.g + 5;
+ this->eyeColor.g = CLAMP_MAX(color, 255);
- if (this->lightColor.b > 210) {
- color = this->lightColor.b - 5;
- this->lightColor.b = CLAMP_MIN(color, 210);
+ if (this->eyeColor.b > 210) {
+ color = this->eyeColor.b - 5;
+ this->eyeColor.b = CLAMP_MIN(color, 210);
} else {
- color = this->lightColor.b + 5;
- this->lightColor.b = CLAMP_MAX(color, 210);
+ color = this->eyeColor.b + 5;
+ this->eyeColor.b = CLAMP_MAX(color, 210);
}
}
-void EnPoComposer_UpdateEnvColor(EnPoComposer* this) {
+void EnPoComposer_UpdateLightColor(EnPoComposer* this) {
if ((this->actionFunc == EnPoComposer_Appear) && (this->skelAnime.curFrame < 12.0f)) {
// Step rgb from 55 to 255 and alpha from 0 to 200 over the first 12 frames of the appear anim
- this->envColor.r = this->envColor.g = this->envColor.b = 55.0f + this->skelAnime.curFrame * 16.66f;
- this->envColor.a = this->skelAnime.curFrame * (200.0f / 12.0f);
+ this->lightColor.r = this->lightColor.g = this->lightColor.b = 55.0f + this->skelAnime.curFrame * 16.66f;
+ this->lightColor.a = this->skelAnime.curFrame * (200.0f / 12.0f);
} else {
- f32 rand = Rand_ZeroOne();
+ // Flame Flicker
+ f32 lightIntensity = Rand_ZeroOne();
- this->envColor.r = 225 + (s32)(rand * 30.0f);
- this->envColor.g = 155 + (s32)(rand * 100.0f);
- this->envColor.b = 95 + (s32)(rand * 160.0f);
- this->envColor.a = 200;
+ this->lightColor.r = 225 + (s32)(lightIntensity * 30.0f);
+ this->lightColor.g = 155 + (s32)(lightIntensity * 100.0f);
+ this->lightColor.b = 95 + (s32)(lightIntensity * 160.0f);
+ this->lightColor.a = 200;
}
- if (this->lightColor.a == 0) {
- this->envColor.a = 0;
+
+ if (this->mainAlpha.a == 0) {
+ this->lightColor.a = 0;
}
}
@@ -602,7 +610,7 @@ void EnPoComposer_UpdateCollision(EnPoComposer* this, PlayState* play) {
void EnPoComposer_Update(Actor* thisx, PlayState* play) {
EnPoComposer* this = (EnPoComposer*)thisx;
- EnPoComposer_UpdateEnvColor(this);
+ EnPoComposer_UpdateLightColor(this);
SkelAnime_Update(&this->skelAnime);
Actor_SetFocus(&this->actor, 42.0f);
@@ -617,16 +625,19 @@ s32 EnPoComposer_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, V
Gfx** gfx) {
EnPoComposer* this = (EnPoComposer*)thisx;
- if ((this->lightColor.a == 0) || (limbIndex == POE_COMPOSER_LIMB_LANTERN)) {
+ if ((this->mainAlpha.a == 0) || (limbIndex == POE_COMPOSER_LIMB_LANTERN)) {
+ // The lantern limb is never drawn because the limb only contains the lantern base for some reason
+ // Instead, the whole lantern is drawn manually in EnPoComposer_Draw
+ // This was likely done to give tighter lantern color control
*dList = NULL;
} else if (POE_COMPOSER_IS_FLAT(&this->actor) && (limbIndex == POE_COMPOSER_LIMB_HEAD)) {
*dList = gPoeComposerFlatHeadDL;
}
if (limbIndex == 19) {
- //! @bug skeleton does not have a limb 19, this is leftover from OoT Poes
+ //! @Bug skeleton does not have a limb 19, this is leftover from OoT Poes
gDPPipeSync((*gfx)++);
- gDPSetEnvColor((*gfx)++, this->lightColor.r, this->lightColor.g, this->lightColor.b, this->lightColor.a);
+ gDPSetEnvColor((*gfx)++, this->eyeColor.r, this->eyeColor.g, this->eyeColor.b, this->eyeColor.a);
}
return false;
@@ -645,39 +656,42 @@ void EnPoComposer_Draw(Actor* thisx, PlayState* play) {
EnPoComposer* this = (EnPoComposer*)thisx;
s32 pad;
Gfx* gfx;
+ // Clothing color draws on robe top, coat, hat, and the emblem on the lantern
Color_RGBA8* clothingColor;
- Color_RGBA8* var_t0;
+ // Overrides clothingColor: hat, robe top, robe hem (overrides eye color)
+ Color_RGBA8* clothingColor2;
Vec3f lightOffset;
Vec3s lightPos;
OPEN_DISPS(play->state.gfxCtx);
- EnPoComposer_StepLightColor(this);
+ EnPoComposer_StepEyeColor(this);
// Select colors
if (POE_COMPOSER_IS_FLAT(&this->actor)) {
clothingColor = &sFlatClothingColor1;
- var_t0 = &sFlatClothingColor2;
+ clothingColor2 = &sFlatClothingColor2;
} else {
clothingColor = &sSharpClothingColor1;
- var_t0 = &sSharpClothingColor2;
+ clothingColor2 = &sSharpClothingColor2;
}
// Draw skeleton
- if ((this->lightColor.a == 255) || (this->lightColor.a == 0)) {
+ if ((this->mainAlpha.a == 255) || (this->mainAlpha.a == 0)) {
Gfx_SetupDL25_Opa(play->state.gfxCtx);
- gSPSegment(POLY_OPA_DISP++, 0x08,
- Gfx_EnvColor(play->state.gfxCtx, this->lightColor.r, this->lightColor.g, this->lightColor.b,
- this->lightColor.a));
+ gSPSegment(
+ POLY_OPA_DISP++, 0x08,
+ Gfx_EnvColor(play->state.gfxCtx, this->eyeColor.r, this->eyeColor.g, this->eyeColor.b, this->eyeColor.a));
gSPSegment(
POLY_OPA_DISP++, 0x0A,
- Gfx_EnvColor(play->state.gfxCtx, clothingColor->r, clothingColor->g, clothingColor->b, this->lightColor.a));
+ Gfx_EnvColor(play->state.gfxCtx, clothingColor->r, clothingColor->g, clothingColor->b, this->mainAlpha.a));
gSPSegment(POLY_OPA_DISP++, 0x0B,
- Gfx_EnvColor(play->state.gfxCtx, var_t0->r, var_t0->g, var_t0->b, this->lightColor.a));
- gSPSegment(POLY_OPA_DISP++, 0x0C, D_801AEFA0);
+ Gfx_EnvColor(play->state.gfxCtx, clothingColor2->r, clothingColor2->g, clothingColor2->b,
+ this->mainAlpha.a));
+ gSPSegment(POLY_OPA_DISP++, 0x0C, D_801AEFA0); // empty DL
POLY_OPA_DISP =
SkelAnime_DrawFlex(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
@@ -686,25 +700,26 @@ void EnPoComposer_Draw(Actor* thisx, PlayState* play) {
Gfx_SetupDL25_Opa(play->state.gfxCtx);
Gfx_SetupDL25_Xlu(play->state.gfxCtx);
- gSPSegment(POLY_XLU_DISP++, 0x08,
- Gfx_EnvColor(play->state.gfxCtx, this->lightColor.r, this->lightColor.g, this->lightColor.b,
- this->lightColor.a));
+ gSPSegment(
+ POLY_XLU_DISP++, 0x08,
+ Gfx_EnvColor(play->state.gfxCtx, this->eyeColor.r, this->eyeColor.g, this->eyeColor.b, this->eyeColor.a));
gSPSegment(
POLY_XLU_DISP++, 0x0A,
- Gfx_EnvColor(play->state.gfxCtx, clothingColor->r, clothingColor->g, clothingColor->b, this->lightColor.a));
+ Gfx_EnvColor(play->state.gfxCtx, clothingColor->r, clothingColor->g, clothingColor->b, this->mainAlpha.a));
gSPSegment(POLY_XLU_DISP++, 0x0B,
- Gfx_EnvColor(play->state.gfxCtx, var_t0->r, var_t0->g, var_t0->b, this->lightColor.a));
- gSPSegment(POLY_XLU_DISP++, 0x0C, D_801AEF88);
+ Gfx_EnvColor(play->state.gfxCtx, clothingColor2->r, clothingColor2->g, clothingColor2->b,
+ this->mainAlpha.a));
+ gSPSegment(POLY_XLU_DISP++, 0x0C, D_801AEF88); // transparency DL
POLY_XLU_DISP =
SkelAnime_DrawFlex(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
EnPoComposer_OverrideLimbDraw, EnPoComposer_PostLimbDraw, &this->actor, POLY_XLU_DISP);
}
- if (this->lightColor.a != 0) {
+ if (this->mainAlpha.a != 0) {
// Draw lantern if visible
- if (this->lightColor.a == 255) {
+ if (this->mainAlpha.a == 255) {
Scene_SetRenderModeXlu(play, 0, 1);
gfx = POLY_OPA_DISP;
} else {
@@ -713,7 +728,8 @@ void EnPoComposer_Draw(Actor* thisx, PlayState* play) {
}
gDPPipeSync(&gfx[0]);
- gDPSetEnvColor(&gfx[1], this->envColor.r, this->envColor.g, this->envColor.b, this->lightColor.a);
+ // Light color reused for lantern glass
+ gDPSetEnvColor(&gfx[1], this->lightColor.r, this->lightColor.g, this->lightColor.b, this->mainAlpha.a);
Matrix_Put(&this->lanternMtxF);
MATRIX_FINALIZE_AND_LOAD(&gfx[2], play->state.gfxCtx);
@@ -722,10 +738,10 @@ void EnPoComposer_Draw(Actor* thisx, PlayState* play) {
gSPDisplayList(&gfx[4], gPoeComposerLanternGlassDL);
gDPPipeSync(&gfx[5]);
- gDPSetEnvColor(&gfx[6], clothingColor->r, clothingColor->g, clothingColor->b, this->lightColor.a);
+ gDPSetEnvColor(&gfx[6], clothingColor->r, clothingColor->g, clothingColor->b, this->mainAlpha.a);
gSPDisplayList(&gfx[7], gPoeComposerLanternTopDL);
- if (this->lightColor.a == 255) {
+ if (this->mainAlpha.a == 255) {
POLY_OPA_DISP = &gfx[8];
} else {
POLY_XLU_DISP = &gfx[8];
@@ -739,8 +755,8 @@ void EnPoComposer_Draw(Actor* thisx, PlayState* play) {
lightPos.y += TRUNCF_BINANG(lightOffset.y);
lightPos.z += TRUNCF_BINANG(lightOffset.z);
- Lights_PointGlowSetInfo(&this->lightInfo, lightPos.x, lightPos.y, lightPos.z, this->envColor.r, this->envColor.g,
- this->envColor.b, this->envColor.a * (200.0f / 255.0f));
+ Lights_PointGlowSetInfo(&this->lightInfo, lightPos.x, lightPos.y, lightPos.z, this->lightColor.r,
+ this->lightColor.g, this->lightColor.b, this->lightColor.a * (200.0f / 255.0f));
CLOSE_DISPS(play->state.gfxCtx);
}
diff --git a/src/overlays/actors/ovl_En_Po_Composer/z_en_po_composer.h b/src/overlays/actors/ovl_En_Po_Composer/z_en_po_composer.h
index 7033d838b8..d0a8d8b56f 100644
--- a/src/overlays/actors/ovl_En_Po_Composer/z_en_po_composer.h
+++ b/src/overlays/actors/ovl_En_Po_Composer/z_en_po_composer.h
@@ -5,7 +5,7 @@
#include "assets/objects/object_po_composer/object_po_composer.h"
#define POE_COMPOSER_IS_FLAT(thisx) ((thisx)->params & 0x8000)
-#define POE_COMPOSER_4000(thisx) ((thisx)->params & 0x4000)
+#define POE_COMPOSER_SHARP_HEALED(thisx) ((thisx)->params & 0x4000)
typedef enum {
/* 1 */ POE_COMPOSER_CUEID_IDLE = 1,
@@ -22,8 +22,8 @@ typedef enum {
} EnPoComposerCueId;
typedef enum {
- /* 0 */ SHARP_CS_ENCOUNTER_FIRST,
- /* 1 */ SHARP_CS_ENCOUNTER_OTHER,
+ /* 0 */ SHARP_CS_ENCOUNTER_HEALED_TALK,
+ /* 1 */ SHARP_CS_ENCOUNTER_AGRO_TALK,
/* 2 */ SHARP_CS_SONG_HEALING,
/* 3 */ SHARP_CS_SONG_STORMS,
/* 4 */ SHARP_CS_MAX
@@ -53,8 +53,11 @@ typedef struct EnPoComposer {
/* 0x330 */ s16 inCutscene;
/* 0x332 */ s16 visible;
/* 0x334 */ u16 cueId;
- /* 0x336 */ Color_RGBA8 lightColor;
- /* 0x33A */ Color_RGBA8 envColor;
+ /* 0x336 */ union {
+ Color_RGBA8 mainAlpha; // the alpha is used as general alpha for the whole body
+ Color_RGBA8 eyeColor; // also used for robe bottom
+ };
+ /* 0x33A */ Color_RGBA8 lightColor; // used by lantern light, and lantern glass tint
} EnPoComposer; // size = 0x340
#endif // Z_EN_PO_COMPOSER_H
diff --git a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c
index ae658e0a12..3c168c5fdd 100644
--- a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c
+++ b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c
@@ -273,7 +273,7 @@ void EnRailgibud_Init(Actor* thisx, PlayState* play) {
Collider_InitCylinder(play, &this->collider);
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
- if (CHECK_WEEKEVENTREG(WEEKEVENTREG_14_04)) {
+ if (CHECK_WEEKEVENTREG(WEEKEVENTREG_IKANA_SPRING_RESTORED)) {
Actor_Kill(&this->actor);
}
diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_collect.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_collect.c
index b2a7f98a78..f10b8e6958 100644
--- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_collect.c
+++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_collect.c
@@ -856,15 +856,19 @@ void KaleidoScope_UpdateQuestCursor(PlayState* play) {
pauseCtx->itemDescriptionOn = true;
if (pauseCtx->cursorYIndex[PAUSE_QUEST] < 2) {
if (pauseCtx->cursorItem[PAUSE_QUEST] < ITEM_REMAINS_ODOLWA) {
- func_801514B0(play, 0x1737 + pauseCtx->cursorItem[PAUSE_QUEST], 1);
+ Message_PauseMenu_ShowDescription(
+ play, 0x1737 + pauseCtx->cursorItem[PAUSE_QUEST], 1);
} else {
- func_801514B0(play, 0x173B + pauseCtx->cursorItem[PAUSE_QUEST], 3);
+ Message_PauseMenu_ShowDescription(
+ play, 0x173B + pauseCtx->cursorItem[PAUSE_QUEST], 3);
}
} else {
if (pauseCtx->cursorItem[PAUSE_QUEST] < ITEM_REMAINS_ODOLWA) {
- func_801514B0(play, 0x1737 + pauseCtx->cursorItem[PAUSE_QUEST], 1);
+ Message_PauseMenu_ShowDescription(
+ play, 0x1737 + pauseCtx->cursorItem[PAUSE_QUEST], 1);
} else {
- func_801514B0(play, 0x173B + pauseCtx->cursorItem[PAUSE_QUEST], 1);
+ Message_PauseMenu_ShowDescription(
+ play, 0x173B + pauseCtx->cursorItem[PAUSE_QUEST], 1);
}
}
}
diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_item.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_item.c
index 33444442e5..0cfa1a59e5 100644
--- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_item.c
+++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_item.c
@@ -681,9 +681,9 @@ void KaleidoScope_UpdateItemCursor(PlayState* play) {
// Give description on item through a message box
pauseCtx->itemDescriptionOn = true;
if (pauseCtx->cursorYIndex[PAUSE_ITEM] < 2) {
- func_801514B0(play, 0x1700 + pauseCtx->cursorItem[PAUSE_ITEM], 3);
+ Message_PauseMenu_ShowDescription(play, 0x1700 + pauseCtx->cursorItem[PAUSE_ITEM], 3);
} else {
- func_801514B0(play, 0x1700 + pauseCtx->cursorItem[PAUSE_ITEM], 1);
+ Message_PauseMenu_ShowDescription(play, 0x1700 + pauseCtx->cursorItem[PAUSE_ITEM], 1);
}
}
}
diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_map.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_map.c
index 6b0d42c593..1409e15600 100644
--- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_map.c
+++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_map.c
@@ -458,11 +458,11 @@ void KaleidoScope_UpdateDungeonCursor(PlayState* play) {
if (CHECK_BTN_ALL(CONTROLLER1(&play->state)->press.button, BTN_A) && (msgCtx->msgLength == 0) &&
(pauseCtx->cursorPoint[PAUSE_MAP] == DUNGEON_STRAY_FAIRIES)) {
pauseCtx->itemDescriptionOn = true;
- func_801514B0(play, 0x17AF, 1);
+ Message_PauseMenu_ShowDescription(play, 0x17AF, 1);
} else if (CHECK_BTN_ALL(CONTROLLER1(&play->state)->press.button, BTN_A) && (msgCtx->msgLength == 0) &&
CHECK_DUNGEON_ITEM(pauseCtx->cursorPoint[PAUSE_MAP], gSaveContext.dungeonSceneSharedIndex)) {
pauseCtx->itemDescriptionOn = true;
- func_801514B0(play, 0x17AC + pauseCtx->cursorPoint[PAUSE_MAP], 1);
+ Message_PauseMenu_ShowDescription(play, 0x17AC + pauseCtx->cursorPoint[PAUSE_MAP], 1);
}
}
diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_mask.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_mask.c
index 66285ac16b..349c2cc3b2 100644
--- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_mask.c
+++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_mask.c
@@ -603,9 +603,9 @@ void KaleidoScope_UpdateMaskCursor(PlayState* play) {
// Give description on item through a message box
pauseCtx->itemDescriptionOn = true;
if (pauseCtx->cursorYIndex[PAUSE_MASK] < 2) {
- func_801514B0(play, 0x1700 + pauseCtx->cursorItem[PAUSE_MASK], 3);
+ Message_PauseMenu_ShowDescription(play, 0x1700 + pauseCtx->cursorItem[PAUSE_MASK], 3);
} else {
- func_801514B0(play, 0x1700 + pauseCtx->cursorItem[PAUSE_MASK], 1);
+ Message_PauseMenu_ShowDescription(play, 0x1700 + pauseCtx->cursorItem[PAUSE_MASK], 1);
}
}
}
diff --git a/tools/disasm/n64-us/functions.txt b/tools/disasm/n64-us/functions.txt
index d3e9f42176..2fa2ed2cba 100644
--- a/tools/disasm/n64-us/functions.txt
+++ b/tools/disasm/n64-us/functions.txt
@@ -2848,7 +2848,7 @@ Message_LoadOwlWarpText = 0x8014D62C; // type:func
Message_Decode = 0x8014D7B4; // type:func
func_80150A84 = 0x80150A84; // type:func
Message_OpenText = 0x80150D08; // type:func
-func_801514B0 = 0x801514B0; // type:func
+Message_PauseMenu_ShowDescription = 0x801514B0; // type:func
Message_StartTextbox = 0x801518B0; // type:func
Message_ContinueTextbox = 0x80151938; // type:func
Message_DisplaySceneTitleCard = 0x80151A68; // type:func
@@ -7211,43 +7211,43 @@ ObjIcePoly_Update = 0x80932198; // type:func
ObjIcePoly_Draw = 0x809321BC; // type:func
EnFz_Init = 0x80932490; // type:func
EnFz_Destroy = 0x809326F4; // type:func
-func_80932784 = 0x80932784; // type:func
-func_809328A4 = 0x809328A4; // type:func
-func_809328F4 = 0x809328F4; // type:func
-func_80932AE8 = 0x80932AE8; // type:func
-func_80932AF4 = 0x80932AF4; // type:func
-func_80932BD4 = 0x80932BD4; // type:func
-func_80932C98 = 0x80932C98; // type:func
-func_80933014 = 0x80933014; // type:func
-func_809330D4 = 0x809330D4; // type:func
-func_80933104 = 0x80933104; // type:func
-func_80933184 = 0x80933184; // type:func
-func_809331F8 = 0x809331F8; // type:func
-func_80933248 = 0x80933248; // type:func
-func_80933274 = 0x80933274; // type:func
-func_80933324 = 0x80933324; // type:func
-func_80933368 = 0x80933368; // type:func
-func_809333A4 = 0x809333A4; // type:func
-func_809333D8 = 0x809333D8; // type:func
-func_80933414 = 0x80933414; // type:func
-func_80933444 = 0x80933444; // type:func
-func_80933480 = 0x80933480; // type:func
-func_809334B8 = 0x809334B8; // type:func
-func_809336C0 = 0x809336C0; // type:func
-func_80933760 = 0x80933760; // type:func
-func_80933790 = 0x80933790; // type:func
-func_809337D4 = 0x809337D4; // type:func
-func_8093389C = 0x8093389C; // type:func
-func_809338E0 = 0x809338E0; // type:func
-func_80933AF4 = 0x80933AF4; // type:func
-func_80933B38 = 0x80933B38; // type:func
-func_80933B48 = 0x80933B48; // type:func
+EnFz_UpdateTargetPos = 0x80932784; // type:func
+EnFz_ReachedTarget = 0x809328A4; // type:func
+EnFz_Damaged = 0x809328F4; // type:func
+EnFz_SpawnMistHidden = 0x80932AE8; // type:func
+EnFz_SpawnMistChanging = 0x80932AF4; // type:func
+EnFz_SpawnMistFullSize = 0x80932BD4; // type:func
+EnFz_ApplyDamage = 0x80932C98; // type:func
+EnFz_SetYawTowardsPlayer = 0x80933014; // type:func
+EnFz_SetupDisappear = 0x809330D4; // type:func
+EnFz_Disappear = 0x80933104; // type:func
+EnFz_SetupWait = 0x80933184; // type:func
+EnFz_Wait = 0x809331F8; // type:func
+EnFz_SetupAppear = 0x80933248; // type:func
+EnFz_Appear = 0x80933274; // type:func
+EnFz_SetupAimForSkate = 0x80933324; // type:func
+EnFz_AimForSkate = 0x80933368; // type:func
+EnFz_SetupSkateTowardPlayer = 0x809333A4; // type:func
+EnFz_SkateTowardPlayer = 0x809333D8; // type:func
+EnFz_SetupSkatingAimFreeze = 0x80933414; // type:func
+EnFz_SkatingAimFreeze = 0x80933444; // type:func
+EnFz_SetupSkatingFreeze = 0x80933480; // type:func
+EnFz_SkatingFreeze = 0x809334B8; // type:func
+EnFz_SetupDie = 0x809336C0; // type:func
+EnFz_Die = 0x80933760; // type:func
+EnFz_SetupMelt = 0x80933790; // type:func
+EnFz_Melt = 0x809337D4; // type:func
+EnFz_SetupIdleStationary = 0x8093389C; // type:func
+EnFz_IdleStationary = 0x809338E0; // type:func
+EnFz_SetupPassive = 0x80933AF4; // type:func
+EnFz_Passive = 0x80933B38; // type:func
+EnFz_UpdateLightArrowEffects = 0x80933B48; // type:func
EnFz_Update = 0x80933BFC; // type:func
EnFz_Draw = 0x80933D98; // type:func
-func_80934018 = 0x80934018; // type:func
-func_809340BC = 0x809340BC; // type:func
-func_80934178 = 0x80934178; // type:func
-func_80934464 = 0x80934464; // type:func
+EnFz_SpawnMistAura = 0x80934018; // type:func
+EnFz_SpawnBreath = 0x809340BC; // type:func
+EnFz_UpdateEffects = 0x80934178; // type:func
+EnFz_DrawEffects = 0x80934464; // type:func
EnKusa_ApplySway = 0x809349E0; // type:func
EnKusa_Sway = 0x80934AB4; // type:func
EnKusa_SnapToFloor = 0x80934F58; // type:func
@@ -15564,9 +15564,9 @@ EnPoComposer_SetupRoll = 0x80BC5898; // type:func
EnPoComposer_Roll = 0x80BC58E0; // type:func
EnPoComposer_SharpCutsceneDone = 0x80BC59BC; // type:func
EnPoComposer_UpdateAction = 0x80BC59EC; // type:func
-EnPoComposer_StepLightAlpha = 0x80BC5CC8; // type:func
-EnPoComposer_StepLightColor = 0x80BC5D34; // type:func
-EnPoComposer_UpdateEnvColor = 0x80BC5DEC; // type:func
+EnPoComposer_StepMainAlpha = 0x80BC5CC8; // type:func
+EnPoComposer_StepEyeColor = 0x80BC5D34; // type:func
+EnPoComposer_UpdateLightColor = 0x80BC5DEC; // type:func
EnPoComposer_UpdateCollision = 0x80BC5FE8; // type:func
EnPoComposer_Update = 0x80BC6048; // type:func
EnPoComposer_OverrideLimbDraw = 0x80BC60BC; // type:func
diff --git a/tools/overlayhelpers/mscriptdis.py b/tools/overlayhelpers/mscriptdis.py
index d82ccf7670..8369e3f8d9 100644
--- a/tools/overlayhelpers/mscriptdis.py
+++ b/tools/overlayhelpers/mscriptdis.py
@@ -174,8 +174,8 @@ week_event_reg = {
(13 << 8) | 0x40: "WEEKEVENTREG_RECEIVED_OCEANSIDE_WALLET_UPGRADE",
(13 << 8) | 0x80: "WEEKEVENTREG_OCEANSIDE_SPIDER_HOUSE_COLLECTED_REWARD",
(14 << 8) | 0x01: "WEEKEVENTREG_14_01",
- (14 << 8) | 0x02: "WEEKEVENTREG_14_02",
- (14 << 8) | 0x04: "WEEKEVENTREG_14_04",
+ (14 << 8) | 0x02: "WEEKEVENTREG_SHARP_HOSTILE_CONVERSATION",
+ (14 << 8) | 0x04: "WEEKEVENTREG_IKANA_SPRING_RESTORED",
(14 << 8) | 0x08: "WEEKEVENTREG_DRANK_CHATEAU_ROMANI",
(14 << 8) | 0x10: "WEEKEVENTREG_WON_DEKU_PLAYGROUND_DAY_1",
(14 << 8) | 0x20: "WEEKEVENTREG_WON_DEKU_PLAYGROUND_DAY_2",
diff --git a/tools/rename_sym.sh b/tools/rename_sym.sh
index 9604d6291d..5c8262feac 100755
--- a/tools/rename_sym.sh
+++ b/tools/rename_sym.sh
@@ -2,12 +2,19 @@
shopt -s globstar
+FUNCTIONS_FILES="tools/disasm/**/functions.txt"
+VARIABLES_FILES="tools/disasm/**/variables.txt"
+ASM_FILES="extracted/**/asm/**/*s"
+
if [ "$#" -ne "2" ];
then
echo "usage: $0 old_name new_name"
exit 1
fi
-#echo "Replace $1 with $2?"
-#read
-grep -rl "$1" asm/**/*.s src/**/*.{c,h} include/**/*.h assets/xml/* tools/disasm/functions.txt tools/disasm/variables.txt tools/sizes/*.csv | xargs sed -i "s/\b$1\b/$2/g"
+echo "Replacing symbol in most files ..."
+grep -rl "$1" src/**/*.{c,h} include/**/*.h assets/xml/* $FUNCTIONS_FILES $VARIABLES_FILES tools/sizes/*.csv | xargs sed -i "s/\b$1\b/$2/g"
+
+# so many files it overloads xargs, and takes much longer
+echo "Replacing symbol in asm files ..."
+grep -rl "$1" $ASM_FILES | xargs sed -i "s/\b$1\b/$2/g"
diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv
index 910c7b00ea..984d59dbc1 100644
--- a/tools/sizes/code_functions.csv
+++ b/tools/sizes/code_functions.csv
@@ -2365,7 +2365,7 @@ asm/non_matchings/code/z_message/Message_LoadOwlWarpText.s,Message_LoadOwlWarpTe
asm/non_matchings/code/z_message/Message_Decode.s,Message_Decode,0x8014D7B4,0xCB4
asm/non_matchings/code/z_message/func_80150A84.s,func_80150A84,0x80150A84,0xA1
asm/non_matchings/code/z_message/Message_OpenText.s,Message_OpenText,0x80150D08,0x1EA
-asm/non_matchings/code/z_message/func_801514B0.s,func_801514B0,0x801514B0,0x100
+asm/non_matchings/code/z_message/Message_PauseMenu_ShowDescription.s,Message_PauseMenu_ShowDescription,0x801514B0,0x100
asm/non_matchings/code/z_message/Message_StartTextbox.s,Message_StartTextbox,0x801518B0,0x22
asm/non_matchings/code/z_message/Message_ContinueTextbox.s,Message_ContinueTextbox,0x80151938,0x4C
asm/non_matchings/code/z_message/Message_DisplaySceneTitleCard.s,Message_DisplaySceneTitleCard,0x80151A68,0x53
diff --git a/tools/weekeventregconvert.py b/tools/weekeventregconvert.py
index e975f48120..2ca67f4666 100755
--- a/tools/weekeventregconvert.py
+++ b/tools/weekeventregconvert.py
@@ -117,8 +117,8 @@ weekEventReg = {
(13 << 8) | 0x40: "WEEKEVENTREG_RECEIVED_OCEANSIDE_WALLET_UPGRADE",
(13 << 8) | 0x80: "WEEKEVENTREG_OCEANSIDE_SPIDER_HOUSE_COLLECTED_REWARD",
(14 << 8) | 0x01: "WEEKEVENTREG_14_01",
- (14 << 8) | 0x02: "WEEKEVENTREG_14_02",
- (14 << 8) | 0x04: "WEEKEVENTREG_14_04",
+ (14 << 8) | 0x02: "WEEKEVENTREG_SHARP_HOSTILE_CONVERSATION",
+ (14 << 8) | 0x04: "WEEKEVENTREG_IKANA_SPRING_RESTORED",
(14 << 8) | 0x08: "WEEKEVENTREG_DRANK_CHATEAU_ROMANI",
(14 << 8) | 0x10: "WEEKEVENTREG_WON_DEKU_PLAYGROUND_DAY_1",
(14 << 8) | 0x20: "WEEKEVENTREG_WON_DEKU_PLAYGROUND_DAY_2",