From 1062874b9bd6e204db0530744efca3f65501db52 Mon Sep 17 00:00:00 2001 From: JordanLongstaff Date: Tue, 2 Dec 2025 08:33:01 -0500 Subject: [PATCH 01/17] Document `EnKendoJs` --- assets/xml/objects/object_js.xml | 10 +- include/z64player.h | 4 +- include/z64save.h | 2 +- src/code/z_parameter.c | 4 +- src/code/z_player_lib.c | 4 +- .../actors/ovl_En_Kendo_Js/z_en_kendo_js.c | 641 ++++++++++-------- .../actors/ovl_En_Kendo_Js/z_en_kendo_js.h | 16 +- .../actors/ovl_En_Maruta/z_en_maruta.c | 16 +- .../actors/ovl_En_Maruta/z_en_maruta.h | 2 +- tools/disasm/n64-us/functions.txt | 8 +- tools/overlayhelpers/mscriptdis.py | 2 +- tools/sizes/code_functions.csv | 4 +- tools/weekeventregconvert.py | 2 +- 13 files changed, 389 insertions(+), 326 deletions(-) diff --git a/assets/xml/objects/object_js.xml b/assets/xml/objects/object_js.xml index 6d93f7ac20..539c416abe 100644 --- a/assets/xml/objects/object_js.xml +++ b/assets/xml/objects/object_js.xml @@ -1,10 +1,10 @@  - - - - - + + + + + diff --git a/include/z64player.h b/include/z64player.h index 8a0f2196b7..4743ae0b39 100644 --- a/include/z64player.h +++ b/include/z64player.h @@ -1400,8 +1400,8 @@ void func_80122D44(struct PlayState* play, struct_80122D44_arg1* arg1); u8 Player_MaskIdToItemId(s32 maskIdMinusOne); s32 Player_GetCurMaskItemId(struct PlayState* play); void func_80122F28(Player* player); -bool func_80122F9C(struct PlayState* play); -bool func_80122FCC(struct PlayState* play); +bool Player_IsBackJumping(struct PlayState* play); +bool Player_IsSideJumping(struct PlayState* play); void func_8012300C(struct PlayState* play, s32 arg1); void func_8012301C(Actor* thisx, struct PlayState* play2); void func_80123140(struct PlayState* play, Player* player); diff --git a/include/z64save.h b/include/z64save.h index 5d0f5bff57..21b77eb541 100644 --- a/include/z64save.h +++ b/include/z64save.h @@ -1343,7 +1343,7 @@ typedef enum { #define WEEKEVENTREG_82_04 PACK_WEEKEVENTREG_FLAG(82, 0x04) // Related to Swordsman's log minigame -#define WEEKEVENTREG_82_08 PACK_WEEKEVENTREG_FLAG(82, 0x08) +#define WEEKEVENTREG_STARTED_SWORDSMAN_MINIGAME PACK_WEEKEVENTREG_FLAG(82, 0x08) #define WEEKEVENTREG_RECEIVED_FISHERMANS_JUMPING_GAME_HEART_PIECE PACK_WEEKEVENTREG_FLAG(82, 0x10) #define WEEKEVENTREG_82_20 PACK_WEEKEVENTREG_FLAG(82, 0x20) #define WEEKEVENTREG_82_40 PACK_WEEKEVENTREG_FLAG(82, 0x40) diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index 5a96c8a72c..5aa07706cd 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -1761,7 +1761,7 @@ void Interface_UpdateButtonsPart2(PlayState* play) { } Interface_SetHudVisibility(HUD_VISIBILITY_B); - } else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_82_08)) { + } else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_STARTED_SWORDSMAN_MINIGAME)) { // Swordsman's log minigame for (i = EQUIP_SLOT_C_LEFT; i <= EQUIP_SLOT_C_RIGHT; i++) { if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { @@ -2282,7 +2282,7 @@ void Interface_UpdateButtonsPart1(PlayState* play) { Interface_SetHudVisibility(HUD_VISIBILITY_A_B_MINIMAP); } else if ((gSaveContext.minigameStatus == MINIGAME_STATUS_ACTIVE) && CHECK_EVENTINF(EVENTINF_35)) { Interface_SetHudVisibility(HUD_VISIBILITY_B_MINIMAP); - } else if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_82_08) && + } else if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_STARTED_SWORDSMAN_MINIGAME) && (gSaveContext.minigameStatus == MINIGAME_STATUS_ACTIVE)) { Interface_SetHudVisibility(HUD_VISIBILITY_B); } else if (play->bButtonAmmoPlusOne >= 2) { diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index 85d2240106..4a28898318 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -363,13 +363,13 @@ void func_80122F28(Player* player) { } } -bool func_80122F9C(PlayState* play) { +bool Player_IsBackJumping(PlayState* play) { Player* player = GET_PLAYER(play); return (player->stateFlags2 & PLAYER_STATE2_80000) && (player->av1.actionVar1 == 2); } -bool func_80122FCC(PlayState* play) { +bool Player_IsSideJumping(PlayState* play) { Player* player = GET_PLAYER(play); return (player->stateFlags2 & PLAYER_STATE2_80000) && diff --git a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c index 53c3b823fe..1ae77eb917 100644 --- a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c +++ b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c @@ -16,25 +16,25 @@ void EnKendoJs_Destroy(Actor* thisx, PlayState* play); void EnKendoJs_Update(Actor* thisx, PlayState* play); void EnKendoJs_Draw(Actor* thisx, PlayState* play); -void func_80B26538(EnKendoJs* this); -void func_80B2654C(EnKendoJs* this, PlayState* play); -void func_80B26AE8(EnKendoJs* this); -void func_80B26AFC(EnKendoJs* this, PlayState* play); -void func_80B2701C(EnKendoJs* this); -void func_80B27030(EnKendoJs* this, PlayState* play); -void func_80B2714C(EnKendoJs* this); -void func_80B27188(EnKendoJs* this, PlayState* play); -void func_80B273D0(EnKendoJs* this); -void func_80B2740C(EnKendoJs* this, PlayState* play); -void func_80B274BC(EnKendoJs* this, PlayState* play); -void func_80B276C4(EnKendoJs* this); -void func_80B276D8(EnKendoJs* this, PlayState* play); -void func_80B27760(EnKendoJs* this); -void func_80B27774(EnKendoJs* this, PlayState* play); -void func_80B2783C(EnKendoJs* this, PlayState* play); +void EnKendoJs_SetupAwaitingTalk(EnKendoJs* this); +void EnKendoJs_AwaitTalk(EnKendoJs* this, PlayState* play); +void EnKendoJs_SetupMessageStateHandler(EnKendoJs* this); +void EnKendoJs_HandleMessageState(EnKendoJs* this, PlayState* play); +void EnKendoJs_SetupNoviceCourse(EnKendoJs* this); +void EnKendoJs_MovePlayerToStartNoviceCourse(EnKendoJs* this, PlayState* play); +void EnKendoJs_StartNoviceCourse(EnKendoJs* this); +void EnKendoJs_NoviceCourse(EnKendoJs* this, PlayState* play); +void EnKendoJs_SetupExpertCourse(EnKendoJs* this); +void EnKendoJs_MovePlayerToStartExpertCourse(EnKendoJs* this, PlayState* play); +void EnKendoJs_ExpertCourse(EnKendoJs* this, PlayState* play); +void EnKendoJs_SetupPrize(EnKendoJs* this); +void EnKendoJs_AwardPrize(EnKendoJs* this, PlayState* play); +void EnKendoJs_AfterPrizeAccepted(EnKendoJs* this); +void EnKendoJs_AwaitFinalMessage(EnKendoJs* this, PlayState* play); +void EnKendoJs_SetExpertCourseCamera(EnKendoJs* this, PlayState* play); s32 EnKendoJs_MovePlayerToPos(PlayState* play, Vec3f targetPos); -void func_80B279F0(EnKendoJs* this, PlayState* play, s32 arg2); -void func_80B27A90(EnKendoJs* this, PlayState* play); +void EnKendoJs_SpawnLog(EnKendoJs* this, PlayState* play, s32 position); +void EnKendoJs_RetractLogs(EnKendoJs* this, PlayState* play); ActorProfile En_Kendo_Js_Profile = { /**/ ACTOR_EN_KENDO_JS, @@ -71,41 +71,125 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; typedef enum EnKendoJsAnimation { - /* 0 */ ENKENDOJS_ANIM_0, - /* 1 */ ENKENDOJS_ANIM_1, - /* 2 */ ENKENDOJS_ANIM_2, - /* 3 */ ENKENDOJS_ANIM_3, - /* 4 */ ENKENDOJS_ANIM_4, + /* 0 */ ENKENDOJS_ANIM_UNUSED, + /* 1 */ ENKENDOJS_ANIM_DEFAULT, + /* 2 */ ENKENDOJS_ANIM_FLAILING, + /* 3 */ ENKENDOJS_ANIM_STOP_FLAILING, + /* 4 */ ENKENDOJS_ANIM_SCARED, /* 5 */ ENKENDOJS_ANIM_MAX } EnKendoJsAnimation; static AnimationInfo sAnimationInfo[ENKENDOJS_ANIM_MAX] = { - { &object_js_Anim_000C7C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, // ENKENDOJS_ANIM_0 - { &object_js_Anim_000F4C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, // ENKENDOJS_ANIM_1 - { &object_js_Anim_00016C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, // ENKENDOJS_ANIM_2 - { &object_js_Anim_0003DC, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, // ENKENDOJS_ANIM_3 - { &object_js_Anim_000AD4, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, // ENKENDOJS_ANIM_4 + { &object_js_Anim_Unused, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, + { &object_js_Anim_Default, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, + { &object_js_Anim_Flailing, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, + { &object_js_Anim_StopFlailing, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, + { &object_js_Anim_Scared, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, }; -s16 D_80B27CE0[][3] = { - { 0x2731, 0x2732, 0x2733 }, - { 0x2734, 0x2735, 0x2736 }, - { 0x2737, 0x2738, 0x2739 }, +typedef enum EnKendoJsMessage { + ENKENDOJS_MSG_HUMAN_INTRO_DAY1 = 0x2710, + ENKENDOJS_MSG_HUMAN_INTRO_SHORT_DAY1 = 0x2711, + ENKENDOJS_MSG_HUMAN_INTRO_DAY2 = 0x2712, + ENKENDOJS_MSG_HUMAN_INTRO_SHORT_DAY2 = 0x2713, + ENKENDOJS_MSG_HUMAN_INTRO_DAY3 = 0x2714, + ENKENDOJS_MSG_HUMAN_INTRO_SHORT_DAY3 = 0x2715, + ENKENDOJS_MSG_WHICH_COURSE = 0x2716, + ENKENDOJS_MSG_CANCEL = 0x2717, + ENKENDOJS_MSG_NOT_ENOUGH_RUPEES = 0x2718, + ENKENDOJS_MSG_NOVICE_COURSE_SELECTED = 0x2719, + ENKENDOJS_MSG_NOVICE_COURSE_START = 0x271A, + ENKENDOJS_MSG_NOVICE_COURSE_RETRY_ROUND1 = 0x271B, + ENKENDOJS_MSG_NOVICE_COURSE_PASS_ROUND1 = 0x271C, + ENKENDOJS_MSG_NOVICE_COURSE_RETRY_ROUND2 = 0x271D, + ENKENDOJS_MSG_NOVICE_COURSE_PASS_ROUND2 = 0x271E, + ENKENDOJS_MSG_NOVICE_COURSE_RETRY_ROUND3 = 0x271F, + ENKENDOJS_MSG_NOVICE_COURSE_PASS_ROUND3 = 0x2720, + ENKENDOJS_MSG_NOVICE_COURSE_RETRY_ROUND4 = 0x2721, + ENKENDOJS_MSG_NOVICE_COURSE_PASS_ROUND4 = 0x2722, + ENKENDOJS_MSG_NOVICE_COURSE_RETRY_ROUND5 = 0x2723, + ENKENDOJS_MSG_NOVICE_COURSE_PASS_ROUND5 = 0x2724, + ENKENDOJS_MSG_NOVICE_COURSE_RETRY_ROUND6 = 0x2725, + ENKENDOJS_MSG_NOVICE_COURSE_PASS_ROUND6 = 0x2726, + ENKENDOJS_MSG_NOVICE_COURSE_RETRY_ROUND7 = 0x2727, + ENKENDOJS_MSG_NOVICE_COURSE_PASS_ROUND7 = 0x2728, + ENKENDOJS_MSG_NOVICE_COURSE_WRONG = 0x2729, + ENKENDOJS_MSG_NOVICE_COURSE_SHEATH_WEAPON = 0x272A, + ENKENDOJS_MSG_NOVICE_COURSE_NO_Z_TARGET = 0x272B, + ENKENDOJS_MSG_NOVICE_COURSE_NO_SWORD = 0x272C, + ENKENDOJS_MSG_EXPERT_COURSE_PERFECT = 0x272D, + ENKENDOJS_MSG_EXPERT_COURSE_INSUFFICIENT = 0x272E, + ENKENDOJS_MSG_EXPERT_COURSE_ACCEPT_HEART_PIECE = 0x272F, + ENKENDOJS_MSG_EXPERT_COURSE_ACCEPT_RED_RUPEE = 0x2730, + ENKENDOJS_MSG_DEKU_DAY1 = 0x2731, + ENKENDOJS_MSG_DEKU_DAY2 = 0x2732, + ENKENDOJS_MSG_DEKU_DAY3 = 0x2733, + ENKENDOJS_MSG_GORON_DAY1 = 0x2734, + ENKENDOJS_MSG_GORON_DAY2 = 0x2735, + ENKENDOJS_MSG_GORON_DAY3 = 0x2736, + ENKENDOJS_MSG_ZORA_DAY1 = 0x2737, + ENKENDOJS_MSG_ZORA_DAY2 = 0x2738, + ENKENDOJS_MSG_ZORA_DAY3 = 0x2739, + ENKENDOJS_MSG_EXPERT_COURSE_SELECTED = 0x273A, + ENKENDOJS_MSG_EXPERT_COURSE_RULES = 0x273B, + ENKENDOJS_MSG_DONT_WANT_TO_DIE = 0x273C, +} EnKendoJsMessage; + +#define ENKENDOJS_MSG_MASK(play) Player_GetMask(play) + 0x273C + +#define ENKENDOJS_QUEUE_MSG(thisx, play, textId) \ + Message_StartTextbox(play, textId, &thisx->actor); \ + thisx->curTextId = textId; + +s16 sNonHumanMessages[][3] = { + { ENKENDOJS_MSG_DEKU_DAY1, ENKENDOJS_MSG_DEKU_DAY2, ENKENDOJS_MSG_DEKU_DAY3 }, + { ENKENDOJS_MSG_GORON_DAY1, ENKENDOJS_MSG_GORON_DAY2, ENKENDOJS_MSG_GORON_DAY3 }, + { ENKENDOJS_MSG_ZORA_DAY1, ENKENDOJS_MSG_ZORA_DAY2, ENKENDOJS_MSG_ZORA_DAY3 }, }; -s16 D_80B27CF4[][3] = { - { 0x2710, 0x2712, 0x2714 }, - { 0x2711, 0x2713, 0x2715 }, +s16 sHumanMessages[][3] = { + { ENKENDOJS_MSG_HUMAN_INTRO_DAY1, ENKENDOJS_MSG_HUMAN_INTRO_DAY2, ENKENDOJS_MSG_HUMAN_INTRO_DAY3 }, + { ENKENDOJS_MSG_HUMAN_INTRO_SHORT_DAY1, ENKENDOJS_MSG_HUMAN_INTRO_SHORT_DAY2, + ENKENDOJS_MSG_HUMAN_INTRO_SHORT_DAY3 }, }; -s16 D_80B27D00[] = { - 0x271C, 0x271E, 0x2720, 0x2722, 0x2724, 0x2726, 0x2728, +s16 sNoviceCourseProgressMessages[] = { + ENKENDOJS_MSG_NOVICE_COURSE_PASS_ROUND1, ENKENDOJS_MSG_NOVICE_COURSE_PASS_ROUND2, + ENKENDOJS_MSG_NOVICE_COURSE_PASS_ROUND3, ENKENDOJS_MSG_NOVICE_COURSE_PASS_ROUND4, + ENKENDOJS_MSG_NOVICE_COURSE_PASS_ROUND5, ENKENDOJS_MSG_NOVICE_COURSE_PASS_ROUND6, + ENKENDOJS_MSG_NOVICE_COURSE_PASS_ROUND7, }; -s16 D_80B27D10[] = { - 0x271B, 0x271D, 0x271F, 0x2721, 0x2723, 0x2725, 0x2727, +s16 sNoviceCourseTryAgainMessages[] = { + ENKENDOJS_MSG_NOVICE_COURSE_RETRY_ROUND1, ENKENDOJS_MSG_NOVICE_COURSE_RETRY_ROUND2, + ENKENDOJS_MSG_NOVICE_COURSE_RETRY_ROUND3, ENKENDOJS_MSG_NOVICE_COURSE_RETRY_ROUND4, + ENKENDOJS_MSG_NOVICE_COURSE_RETRY_ROUND5, ENKENDOJS_MSG_NOVICE_COURSE_RETRY_ROUND6, + ENKENDOJS_MSG_NOVICE_COURSE_RETRY_ROUND7, }; +typedef enum EnKendoJsCourseState { + /* 0 */ ENKENDOJS_COURSE_PAUSED, + /* 1 */ ENKENDOJS_COURSE_ACTIVE, + /* 2 */ ENKENDOJS_COURSE_RETRY, +} + +typedef enum EnKendoJsNoviceCourseLesson { + /* 0 */ ENKENDOJS_NOVICE_SIDE_JUMP, + /* 1 */ ENKENDOJS_NOVICE_ROLL, + /* 2 */ ENKENDOJS_NOVICE_BACKFLIP, + /* 3 */ ENKENDOJS_NOVICE_SWORD_ATTACK, + /* 4 */ ENKENDOJS_NOVICE_SWORD_TARGET, + /* 5 */ ENKENDOJS_NOVICE_SWORD_THRUST, + /* 6 */ ENKENDOJS_NOVICE_JUMP_ATTACK, + /* 7 */ ENKENDOJS_NOVICE_FINISHED, +} + +typedef enum EnKendoJsNoviceCourseActionResult { + /* 0 */ ENKENDOJS_RESULT_CORRECT, + /* 1 */ ENKENDOJS_RESULT_INCORRECT, + /* 2 */ ENKENDOJS_RESULT_PENDING, +} + void EnKendoJs_Init(Actor* thisx, PlayState* play) { s32 pad; EnKendoJs* this = (EnKendoJs*)thisx; @@ -116,7 +200,7 @@ void EnKendoJs_Init(Actor* thisx, PlayState* play) { Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit); - SkelAnime_InitFlex(play, &this->skelAnime, &object_js_Skel_006990, &object_js_Anim_000F4C, this->jointTable, + SkelAnime_InitFlex(play, &this->skelAnime, &object_js_Skel_006990, &object_js_Anim_Default, this->jointTable, this->morphTable, OBJECT_JS_LIMB_MAX); if ((CURRENT_DAY == 3) && ((CURRENT_TIME > CLOCK_TIME(23, 0)) || (CURRENT_TIME < CLOCK_TIME(6, 0)))) { @@ -126,7 +210,7 @@ void EnKendoJs_Init(Actor* thisx, PlayState* play) { this->actor.home.rot.z, 0x10); Actor_Kill(&this->actor); } else { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, ENKENDOJS_ANIM_4); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, ENKENDOJS_ANIM_SCARED); } } else if (ENKENDOJS_GET_FF(&this->actor) == ENKENDOJS_FF_1) { Actor_Kill(&this->actor); @@ -144,127 +228,116 @@ void EnKendoJs_Init(Actor* thisx, PlayState* play) { this->actor.focus.pos = this->actor.world.pos; this->actor.focus.pos.y += 30.0f; this->actor.child = NULL; - this->unk_28A = false; - this->unk_28C = 0; - this->unk_28E = 0; - this->unk_286 = 0; - func_80B26538(this); + this->hasSpoken = false; + this->numLogs = 0; + this->isSlashingLog = 0; + this->courseState = ENKENDOJS_COURSE_PAUSED; + EnKendoJs_SetupAwaitingTalk(this); } void EnKendoJs_Destroy(Actor* thisx, PlayState* play) { EnKendoJs* this = (EnKendoJs*)thisx; Collider_DestroyCylinder(play, &this->collider); - CLEAR_WEEKEVENTREG(WEEKEVENTREG_82_08); + CLEAR_WEEKEVENTREG(WEEKEVENTREG_STARTED_SWORDSMAN_MINIGAME); } -void func_80B26538(EnKendoJs* this) { - this->actionFunc = func_80B2654C; +void EnKendoJs_SetupAwaitingTalk(EnKendoJs* this) { + this->actionFunc = EnKendoJs_AwaitTalk; } -void func_80B2654C(EnKendoJs* this, PlayState* play) { - s32 phi_v0; - s32 sp30; +void EnKendoJs_AwaitTalk(EnKendoJs* this, PlayState* play) { + s32 mainIndex; + s32 dayIndex; if (Actor_TalkOfferAccepted(&this->actor, &play->state)) { if (CURRENT_DAY != 0) { - sp30 = CURRENT_DAY - 1; + dayIndex = CURRENT_DAY - 1; } else { - sp30 = 0; + dayIndex = 0; } if (ENKENDOJS_GET_FF(&this->actor) == ENKENDOJS_FF_1) { - Message_StartTextbox(play, 0x273C, &this->actor); - this->unk_288 = 0x273C; + ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_DONT_WANT_TO_DIE); } else if (GET_PLAYER_FORM != PLAYER_FORM_HUMAN) { switch (GET_PLAYER_FORM) { case PLAYER_FORM_DEKU: - phi_v0 = 0; + mainIndex = 0; break; case PLAYER_FORM_GORON: - phi_v0 = 1; + mainIndex = 1; break; case PLAYER_FORM_ZORA: - phi_v0 = 2; + mainIndex = 2; break; default: - phi_v0 = 0; + mainIndex = 0; break; } - Message_StartTextbox(play, D_80B27CE0[phi_v0][sp30], &this->actor); - this->unk_288 = D_80B27CE0[phi_v0][sp30]; + ENKENDOJS_QUEUE_MSG(this, play, sNonHumanMessages[mainIndex][dayIndex]); } else if ((Player_GetMask(play) != PLAYER_MASK_NONE) && (Player_GetMask(play) < PLAYER_MASK_GIANT)) { - u16 sp2E = Player_GetMask(play) + 0x273C; + u16 maskMessage = ENKENDOJS_MSG_MASK(play); //! FAKE: if (1) {} - Message_StartTextbox(play, sp2E, &this->actor); - this->unk_288 = sp2E; + ENKENDOJS_QUEUE_MSG(this, play, maskMessage); } else { - if (!this->unk_28A) { - this->unk_28A = true; - phi_v0 = 0; + if (!this->hasSpoken) { + this->hasSpoken = true; + mainIndex = 0; } else { - phi_v0 = 1; + mainIndex = 1; } - Message_StartTextbox(play, D_80B27CF4[phi_v0][sp30], &this->actor); - this->unk_288 = D_80B27CF4[phi_v0][sp30]; + ENKENDOJS_QUEUE_MSG(this, play, sHumanMessages[mainIndex][dayIndex]); } - func_80B26AE8(this); + EnKendoJs_SetupMessageStateHandler(this); } else { Actor_OfferTalk(&this->actor, play, 100.0f); } } -void func_80B26758(EnKendoJs* this, PlayState* play) { - if (Message_ShouldAdvance(play) && (this->unk_288 == 0x2716)) { +void EnKendoJs_HandleCourseChoice(EnKendoJs* this, PlayState* play) { + if (Message_ShouldAdvance(play) && (this->curTextId == ENKENDOJS_MSG_WHICH_COURSE)) { switch (play->msgCtx.choiceIndex) { case 0: if (GET_CUR_EQUIP_VALUE(EQUIP_TYPE_SWORD) == EQUIP_VALUE_SWORD_NONE) { Audio_PlaySfx(NA_SE_SY_ERROR); - Message_StartTextbox(play, 0x272C, &this->actor); - this->unk_288 = 0x272C; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, ENKENDOJS_ANIM_2); + ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_NOVICE_COURSE_NO_SWORD); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, ENKENDOJS_ANIM_FLAILING); } else if (gSaveContext.save.saveInfo.playerData.rupees < play->msgCtx.unk1206C) { Audio_PlaySfx(NA_SE_SY_ERROR); - Message_StartTextbox(play, 0x2718, &this->actor); - this->unk_288 = 0x2718; + ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_NOT_ENOUGH_RUPEES); } else { Audio_PlaySfx_MessageDecide(); Rupees_ChangeBy(-play->msgCtx.unk1206C); - Message_StartTextbox(play, 0x2719, &this->actor); - this->unk_288 = 0x2719; + ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_NOVICE_COURSE_SELECTED); } break; case 1: if (GET_CUR_EQUIP_VALUE(EQUIP_TYPE_SWORD) == EQUIP_VALUE_SWORD_NONE) { Audio_PlaySfx(NA_SE_SY_ERROR); - Message_StartTextbox(play, 0x272C, &this->actor); - this->unk_288 = 0x272C; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, ENKENDOJS_ANIM_2); + ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_NOVICE_COURSE_NO_SWORD); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, ENKENDOJS_ANIM_FLAILING); } else if (gSaveContext.save.saveInfo.playerData.rupees < play->msgCtx.unk12070) { Audio_PlaySfx(NA_SE_SY_ERROR); - Message_StartTextbox(play, 0x2718, &this->actor); - this->unk_288 = 0x2718; + ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_NOT_ENOUGH_RUPEES); } else { Audio_PlaySfx_MessageDecide(); Rupees_ChangeBy(-play->msgCtx.unk12070); - Message_StartTextbox(play, 0x273A, &this->actor); - this->unk_288 = 0x273A; + ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_EXPERT_COURSE_SELECTED); } break; case 2: Audio_PlaySfx_MessageCancel(); - Message_StartTextbox(play, 0x2717, &this->actor); - this->unk_288 = 0x2717; + ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_CANCEL); break; default: @@ -273,52 +346,50 @@ void func_80B26758(EnKendoJs* this, PlayState* play) { } } -void func_80B269A4(EnKendoJs* this, PlayState* play) { +void EnKendoJs_HandleEvents(EnKendoJs* this, PlayState* play) { Player* player = GET_PLAYER(play); if (!Message_ShouldAdvance(play)) { return; } - switch (this->unk_288) { - case 0x2710: - case 0x2711: - case 0x2712: - case 0x2713: - case 0x2714: - case 0x2715: - Message_StartTextbox(play, 0x2716, &this->actor); - this->unk_288 = 0x2716; + switch (this->curTextId) { + case ENKENDOJS_MSG_HUMAN_INTRO_DAY1: + case ENKENDOJS_MSG_HUMAN_INTRO_SHORT_DAY1: + case ENKENDOJS_MSG_HUMAN_INTRO_DAY2: + case ENKENDOJS_MSG_HUMAN_INTRO_SHORT_DAY2: + case ENKENDOJS_MSG_HUMAN_INTRO_DAY3: + case ENKENDOJS_MSG_HUMAN_INTRO_SHORT_DAY3: + ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_WHICH_COURSE); break; - case 0x2719: + case ENKENDOJS_MSG_NOVICE_COURSE_SELECTED: Message_CloseTextbox(play); player->stateFlags1 |= PLAYER_STATE1_20; - func_80B2701C(this); + EnKendoJs_SetupNoviceCourse(this); break; - case 0x271A: + case ENKENDOJS_MSG_NOVICE_COURSE_START: Message_CloseTextbox(play); - func_80B2714C(this); + EnKendoJs_StartNoviceCourse(this); break; - case 0x273A: - Message_StartTextbox(play, 0x273B, &this->actor); - this->unk_288 = 0x273B; + case ENKENDOJS_MSG_EXPERT_COURSE_SELECTED: + ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_EXPERT_COURSE_RULES); break; - case 0x273B: + case ENKENDOJS_MSG_EXPERT_COURSE_RULES: Message_CloseTextbox(play); Interface_InitMinigame(play); player->stateFlags1 |= PLAYER_STATE1_20; - func_80B273D0(this); + EnKendoJs_SetupExpertCourse(this); break; - case 0x272D: + case ENKENDOJS_MSG_EXPERT_COURSE_PERFECT: Message_CloseTextbox(play); gSaveContext.minigameStatus = MINIGAME_STATUS_END; - func_80B276C4(this); - func_80B276D8(this, play); + EnKendoJs_SetupPrize(this); + EnKendoJs_AwardPrize(this, play); break; default: @@ -326,34 +397,36 @@ void func_80B269A4(EnKendoJs* this, PlayState* play) { } } -void func_80B26AE8(EnKendoJs* this) { - this->actionFunc = func_80B26AFC; +void EnKendoJs_SetupMessageStateHandler(EnKendoJs* this) { + this->actionFunc = EnKendoJs_HandleMessageState; } -void func_80B26AFC(EnKendoJs* this, PlayState* play) { +void EnKendoJs_HandleMessageState(EnKendoJs* this, PlayState* play) { Player* player = GET_PLAYER(play); switch (Message_GetState(&play->msgCtx)) { case TEXT_STATE_CHOICE: - func_80B26758(this, play); + EnKendoJs_HandleCourseChoice(this, play); break; case TEXT_STATE_EVENT: - func_80B269A4(this, play); + EnKendoJs_HandleEvents(this, play); break; case TEXT_STATE_DONE: if (Message_ShouldAdvance(play)) { - if (this->unk_288 == 0x272C) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, ENKENDOJS_ANIM_3); + if (this->curTextId == ENKENDOJS_MSG_NOVICE_COURSE_NO_SWORD) { + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, ENKENDOJS_ANIM_STOP_FLAILING); } - if ((this->unk_288 == 0x272E) || (this->unk_288 == 0x272F) || (this->unk_288 == 0x2730)) { + if ((this->curTextId == ENKENDOJS_MSG_EXPERT_COURSE_INSUFFICIENT) || + (this->curTextId == ENKENDOJS_MSG_EXPERT_COURSE_ACCEPT_HEART_PIECE) || + (this->curTextId == ENKENDOJS_MSG_EXPERT_COURSE_ACCEPT_RED_RUPEE)) { gSaveContext.minigameStatus = MINIGAME_STATUS_END; } player->stateFlags1 &= ~PLAYER_STATE1_20; - func_80B26538(this); + EnKendoJs_SetupAwaitingTalk(this); } break; @@ -366,132 +439,128 @@ void func_80B26AFC(EnKendoJs* this, PlayState* play) { } } -s32 func_80B26BF8(EnKendoJs* this, PlayState* play) { +s32 EnKendoJs_GetNoviceCourseActionResult(EnKendoJs* this, PlayState* play) { Player* player = GET_PLAYER(play); - switch (this->unk_284) { - case 0: - if (func_80122FCC(play)) { - return 0; + switch (this->minigameRound) { + case ENKENDOJS_NOVICE_SIDE_JUMP: + if (Player_IsSideJumping(play)) { + return ENKENDOJS_RESULT_CORRECT; } if ((player->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) || (player->stateFlags3 & PLAYER_STATE3_8000000) || (player->stateFlags2 & PLAYER_STATE2_80000)) { - return 1; + return ENKENDOJS_RESULT_INCORRECT; } break; - case 1: + case ENKENDOJS_NOVICE_ROLL: if ((player->stateFlags3 & PLAYER_STATE3_8000000)) { - return 0; + return ENKENDOJS_RESULT_CORRECT; } if ((player->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) || (player->stateFlags2 & PLAYER_STATE2_80000)) { - return 1; + return ENKENDOJS_RESULT_INCORRECT; } break; - case 2: - if (func_80122F9C(play)) { - return 0; + case ENKENDOJS_NOVICE_BACKFLIP: + if (Player_IsBackJumping(play)) { + return ENKENDOJS_RESULT_CORRECT; } if ((player->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) || (player->stateFlags3 & PLAYER_STATE3_8000000) || (player->stateFlags2 & PLAYER_STATE2_80000)) { - return 1; + return ENKENDOJS_RESULT_INCORRECT; } - this->unk_28E = 0; + this->isSlashingLog = 0; break; - case 3: - if ((this->unk_28E == 1) && ((player->meleeWeaponAnimation == PLAYER_MWA_RIGHT_SLASH_1H) || - (player->meleeWeaponAnimation == PLAYER_MWA_RIGHT_COMBO_1H))) { - this->unk_28E = 0; - return 0; + case ENKENDOJS_NOVICE_SWORD_ATTACK: + if ((this->isSlashingLog == 1) && ((player->meleeWeaponAnimation == PLAYER_MWA_RIGHT_SLASH_1H) || + (player->meleeWeaponAnimation == PLAYER_MWA_RIGHT_COMBO_1H))) { + this->isSlashingLog = 0; + return ENKENDOJS_RESULT_CORRECT; } - if ((this->unk_28E == 1) || (player->stateFlags3 & PLAYER_STATE3_8000000) || + if ((this->isSlashingLog == 1) || (player->stateFlags3 & PLAYER_STATE3_8000000) || (player->stateFlags2 & PLAYER_STATE2_80000)) { - this->unk_28E = 0; - return 1; + this->isSlashingLog = 0; + return ENKENDOJS_RESULT_INCORRECT; } break; - case 4: - if ((this->unk_28E == 1) && ((player->meleeWeaponAnimation == PLAYER_MWA_FORWARD_SLASH_1H) || - (player->meleeWeaponAnimation == PLAYER_MWA_FORWARD_COMBO_1H))) { - this->unk_28E = 0; - return 0; + case ENKENDOJS_NOVICE_SWORD_TARGET: + if ((this->isSlashingLog == 1) && ((player->meleeWeaponAnimation == PLAYER_MWA_FORWARD_SLASH_1H) || + (player->meleeWeaponAnimation == PLAYER_MWA_FORWARD_COMBO_1H))) { + this->isSlashingLog = 0; + return ENKENDOJS_RESULT_CORRECT; } - if ((this->unk_28E == 1) || (player->stateFlags3 & PLAYER_STATE3_8000000) || + if ((this->isSlashingLog == 1) || (player->stateFlags3 & PLAYER_STATE3_8000000) || (player->stateFlags2 & PLAYER_STATE2_80000)) { - this->unk_28E = 0; - return 1; + this->isSlashingLog = 0; + return ENKENDOJS_RESULT_INCORRECT; } break; - case 5: - if ((this->unk_28E == 1) && (player->meleeWeaponAnimation == PLAYER_MWA_STAB_1H)) { - this->unk_28E = 0; - return 0; + case ENKENDOJS_NOVICE_SWORD_THRUST: + if ((this->isSlashingLog == 1) && (player->meleeWeaponAnimation == PLAYER_MWA_STAB_1H)) { + this->isSlashingLog = 0; + return ENKENDOJS_RESULT_CORRECT; } - if ((this->unk_28E == 1) || (player->stateFlags3 & PLAYER_STATE3_8000000) || + if ((this->isSlashingLog == 1) || (player->stateFlags3 & PLAYER_STATE3_8000000) || (player->stateFlags2 & PLAYER_STATE2_80000)) { - this->unk_28E = 0; - return 1; + this->isSlashingLog = 0; + return ENKENDOJS_RESULT_INCORRECT; } break; - case 6: - if ((this->unk_28E == 1) && ((player->meleeWeaponAnimation == PLAYER_MWA_JUMPSLASH_START) || - (player->meleeWeaponAnimation == PLAYER_MWA_JUMPSLASH_FINISH))) { - this->unk_28E = 0; - return 0; + case ENKENDOJS_NOVICE_JUMP_ATTACK: + if ((this->isSlashingLog == 1) && ((player->meleeWeaponAnimation == PLAYER_MWA_JUMPSLASH_START) || + (player->meleeWeaponAnimation == PLAYER_MWA_JUMPSLASH_FINISH))) { + this->isSlashingLog = 0; + return ENKENDOJS_RESULT_CORRECT; } - if ((this->unk_28E == 1) || (player->stateFlags3 & PLAYER_STATE3_8000000) || + if ((this->isSlashingLog == 1) || (player->stateFlags3 & PLAYER_STATE3_8000000) || (player->stateFlags2 & PLAYER_STATE2_80000)) { - this->unk_28E = 0; - return 1; + this->isSlashingLog = 0; + return ENKENDOJS_RESULT_INCORRECT; } break; default: break; } - return 2; + return ENKENDOJS_RESULT_PENDING; } -void func_80B26EB4(EnKendoJs* this, PlayState* play) { - Message_StartTextbox(play, D_80B27D00[this->unk_284], &this->actor); - this->unk_288 = D_80B27D00[this->unk_284]; - this->unk_284++; +void EnKendoJs_NoviceCourseProgress(EnKendoJs* this, PlayState* play) { + ENKENDOJS_QUEUE_MSG(this, play, sNoviceCourseProgressMessages[this->minigameRound]); + this->minigameRound++; } -void func_80B26F14(EnKendoJs* this, PlayState* play) { - Message_StartTextbox(play, D_80B27D10[this->unk_284], &this->actor); - this->unk_288 = D_80B27D10[this->unk_284]; +void EnKendoJs_NoviceCourseTryAgain(EnKendoJs* this, PlayState* play) { + ENKENDOJS_QUEUE_MSG(this, play, sNoviceCourseTryAgainMessages[this->minigameRound]); } -s32 func_80B26F6C(EnKendoJs* this, PlayState* play) { +s32 EnKendoJs_HasMoreAdviceToTryAgain(EnKendoJs* this, PlayState* play) { Player* player = GET_PLAYER(play); - switch (this->unk_288) { - case 0x271D: + switch (this->curTextId) { + case ENKENDOJS_MSG_NOVICE_COURSE_RETRY_ROUND2: if (Player_GetMeleeWeaponHeld(player) != PLAYER_MELEEWEAPON_NONE) { - Message_StartTextbox(play, 0x272A, &this->actor); - this->unk_288 = 0x272A; + ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_NOVICE_COURSE_SHEATH_WEAPON); return true; } break; - case 0x2721: - if (this->unk_292 != 0) { - Message_StartTextbox(play, 0x272B, &this->actor); - this->unk_288 = 0x272B; + case ENKENDOJS_MSG_NOVICE_COURSE_RETRY_ROUND4: + if (this->isPlayerLockedOn) { + ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_NOVICE_COURSE_NO_Z_TARGET); return true; } break; @@ -502,151 +571,147 @@ s32 func_80B26F6C(EnKendoJs* this, PlayState* play) { return false; } -void func_80B2701C(EnKendoJs* this) { - this->actionFunc = func_80B27030; +void EnKendoJs_SetupNoviceCourse(EnKendoJs* this) { + this->actionFunc = EnKendoJs_MovePlayerToStartNoviceCourse; } -void func_80B27030(EnKendoJs* this, PlayState* play) { +void EnKendoJs_MovePlayerToStartNoviceCourse(EnKendoJs* this, PlayState* play) { Player* player = GET_PLAYER(play); - Vec3f sp20 = this->actor.world.pos; + Vec3f startPos = this->actor.world.pos; - sp20.z += 200.0f; + startPos.z += 200.0f; - if (EnKendoJs_MovePlayerToPos(play, sp20)) { + if (EnKendoJs_MovePlayerToPos(play, startPos)) { this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; if (Actor_TalkOfferAccepted(&this->actor, &play->state)) { this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; player->stateFlags1 &= ~PLAYER_STATE1_20; - func_80B279F0(this, play, 0); - Message_StartTextbox(play, 0x271A, &this->actor); - this->unk_288 = 0x271A; - func_80B26AE8(this); + EnKendoJs_SpawnLog(this, play, 0); + ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_NOVICE_COURSE_START); + EnKendoJs_SetupMessageStateHandler(this); } else { Actor_OfferTalk(&this->actor, play, 800.0f); } } } -void func_80B2714C(EnKendoJs* this) { - SET_WEEKEVENTREG(WEEKEVENTREG_82_08); - this->unk_28C = 1; - this->unk_290 = 0; - this->unk_284 = 0; - this->unk_286 = 1; - this->actionFunc = func_80B27188; +void EnKendoJs_StartNoviceCourse(EnKendoJs* this) { + SET_WEEKEVENTREG(WEEKEVENTREG_STARTED_SWORDSMAN_MINIGAME); + this->numLogs = 1; + this->timer = 0; + this->minigameRound = ENKENDOJS_NOVICE_SIDE_JUMP; + this->courseState = ENKENDOJS_COURSE_ACTIVE; + this->actionFunc = EnKendoJs_NoviceCourse; } -void func_80B27188(EnKendoJs* this, PlayState* play) { +void EnKendoJs_NoviceCourse(EnKendoJs* this, PlayState* play) { Player* player = GET_PLAYER(play); if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) { - if (this->unk_288 == 0x2729) { - func_80B26F14(this, play); - } else if (!func_80B26F6C(this, play)) { - if (this->skelAnime.animation == &object_js_Anim_00016C) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, ENKENDOJS_ANIM_3); + if (this->curTextId == ENKENDOJS_MSG_NOVICE_COURSE_WRONG) { + EnKendoJs_NoviceCourseTryAgain(this, play); + } else if (!EnKendoJs_HasMoreAdviceToTryAgain(this, play)) { + if (this->skelAnime.animation == &object_js_Anim_Flailing) { + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, ENKENDOJS_ANIM_STOP_FLAILING); } - this->unk_286 = 2; + this->courseState = ENKENDOJS_COURSE_RETRY; Message_CloseTextbox(play); player->stateFlags1 &= ~PLAYER_STATE1_20; } - } else if (this->unk_286 == 2) { - this->unk_286 = 1; + } else if (this->courseState == ENKENDOJS_COURSE_RETRY) { + this->courseState = ENKENDOJS_COURSE_ACTIVE; } - if (this->unk_286 == 1) { - switch (func_80B26BF8(this, play)) { - case 0: - this->unk_286 = 0; + if (this->courseState == ENKENDOJS_COURSE_ACTIVE) { + switch (EnKendoJs_GetNoviceCourseActionResult(this, play)) { + case ENKENDOJS_RESULT_CORRECT: + this->courseState = ENKENDOJS_COURSE_PAUSED; Actor_PlaySfx(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); player->stateFlags1 |= PLAYER_STATE1_20; - func_80B26EB4(this, play); + EnKendoJs_NoviceCourseProgress(this, play); break; - case 1: + case ENKENDOJS_RESULT_INCORRECT: Actor_PlaySfx(&this->actor, NA_SE_SY_ERROR); - this->unk_286 = 0; + this->courseState = ENKENDOJS_COURSE_PAUSED; player->stateFlags1 |= PLAYER_STATE1_20; - Message_StartTextbox(play, 0x2729, &this->actor); - this->unk_288 = 0x2729; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, ENKENDOJS_ANIM_2); + ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_NOVICE_COURSE_WRONG); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, ENKENDOJS_ANIM_FLAILING); break; default: - if (this->unk_28C == 0) { - this->unk_290++; - if (this->unk_290 == 30) { - this->unk_290 = 0; - func_80B279F0(this, play, 0); + if (this->numLogs == 0) { + this->timer++; + if (this->timer == 30) { + this->timer = 0; + EnKendoJs_SpawnLog(this, play, 0); } } break; } - if ((this->skelAnime.animation == &object_js_Anim_0003DC) && + if ((this->skelAnime.animation == &object_js_Anim_StopFlailing) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, ENKENDOJS_ANIM_1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, ENKENDOJS_ANIM_DEFAULT); } - if (this->unk_284 == 7) { - CLEAR_WEEKEVENTREG(WEEKEVENTREG_82_08); - func_80B26AE8(this); + if (this->minigameRound == ENKENDOJS_NOVICE_FINISHED) { + CLEAR_WEEKEVENTREG(WEEKEVENTREG_STARTED_SWORDSMAN_MINIGAME); + EnKendoJs_SetupMessageStateHandler(this); } } } -void func_80B273D0(EnKendoJs* this) { - SET_WEEKEVENTREG(WEEKEVENTREG_82_08); - this->unk_290 = 120; - this->unk_284 = 0; - this->unk_286 = 1; - this->actionFunc = func_80B2740C; +void EnKendoJs_SetupExpertCourse(EnKendoJs* this) { + SET_WEEKEVENTREG(WEEKEVENTREG_STARTED_SWORDSMAN_MINIGAME); + this->timer = 120; + this->minigameRound = 0; + this->courseState = ENKENDOJS_COURSE_ACTIVE; + this->actionFunc = EnKendoJs_MovePlayerToStartExpertCourse; } -void func_80B2740C(EnKendoJs* this, PlayState* play) { +void EnKendoJs_MovePlayerToStartExpertCourse(EnKendoJs* this, PlayState* play) { Player* player = GET_PLAYER(play); - Vec3f sp18 = this->actor.world.pos; + Vec3f startPos = this->actor.world.pos; - sp18.z += 300.0f; + startPos.z += 300.0f; - if (EnKendoJs_MovePlayerToPos(play, sp18)) { - this->unk_28C = 0; + if (EnKendoJs_MovePlayerToPos(play, startPos)) { + this->numLogs = 0; player->stateFlags1 &= ~PLAYER_STATE1_20; - this->actionFunc = func_80B274BC; + this->actionFunc = EnKendoJs_ExpertCourse; } } -void func_80B274BC(EnKendoJs* this, PlayState* play) { +void EnKendoJs_ExpertCourse(EnKendoJs* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (this->unk_290 >= 140) { - if (this->unk_284 == 5) { + if (this->timer >= 140) { + if (this->minigameRound == 5) { if (gSaveContext.minigameScore == 30) { - Message_StartTextbox(play, 0x272D, &this->actor); - this->unk_288 = 0x272D; + ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_EXPERT_COURSE_PERFECT); } else { - Message_StartTextbox(play, 0x272E, &this->actor); - this->unk_288 = 0x272E; + ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_EXPERT_COURSE_INSUFFICIENT); } player->stateFlags1 |= PLAYER_STATE1_20; - CLEAR_WEEKEVENTREG(WEEKEVENTREG_82_08); - func_80B26AE8(this); + CLEAR_WEEKEVENTREG(WEEKEVENTREG_STARTED_SWORDSMAN_MINIGAME); + EnKendoJs_SetupMessageStateHandler(this); return; } Audio_PlaySfx(NA_SE_SY_FOUND); - func_80B279F0(this, play, ((u8)Rand_Next() % 3) + 1); - func_80B279F0(this, play, ((u8)Rand_Next() % 3) + 4); - this->unk_290 = 0; - this->unk_284++; - } else if (this->unk_290 == 120) { - func_80B27A90(this, play); - this->unk_290++; + EnKendoJs_SpawnLog(this, play, ((u8)Rand_Next() % 3) + 1); + EnKendoJs_SpawnLog(this, play, ((u8)Rand_Next() % 3) + 4); + this->timer = 0; + this->minigameRound++; + } else if (this->timer == 120) { + EnKendoJs_RetractLogs(this, play); + this->timer++; } else { - this->unk_290++; + this->timer++; } - if (this->unk_28E == 1) { + if (this->isSlashingLog == 1) { if ((player->meleeWeaponAnimation == PLAYER_MWA_JUMPSLASH_START) || (player->meleeWeaponAnimation == PLAYER_MWA_JUMPSLASH_FINISH)) { play->interfaceCtx.minigamePoints = 3; @@ -659,19 +724,19 @@ void func_80B274BC(EnKendoJs* this, PlayState* play) { play->interfaceCtx.minigamePoints = 1; } Actor_PlaySfx(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); - this->unk_28E = 0; + this->isSlashingLog = 0; } - func_80B2783C(this, play); + EnKendoJs_SetExpertCourseCamera(this, play); } -void func_80B276C4(EnKendoJs* this) { - this->actionFunc = func_80B276D8; +void EnKendoJs_SetupPrize(EnKendoJs* this) { + this->actionFunc = EnKendoJs_AwardPrize; } -void func_80B276D8(EnKendoJs* this, PlayState* play) { +void EnKendoJs_AwardPrize(EnKendoJs* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { this->actor.parent = NULL; - func_80B27760(this); + EnKendoJs_AfterPrizeAccepted(this); } else if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_SWORDSMANS_SCHOOL_HEART_PIECE)) { Actor_OfferGetItem(&this->actor, play, GI_HEART_PIECE, 800.0f, 100.0f); } else { @@ -679,42 +744,40 @@ void func_80B276D8(EnKendoJs* this, PlayState* play) { } } -void func_80B27760(EnKendoJs* this) { - this->actionFunc = func_80B27774; +void EnKendoJs_AfterPrizeAccepted(EnKendoJs* this) { + this->actionFunc = EnKendoJs_AwaitFinalMessage; } -void func_80B27774(EnKendoJs* this, PlayState* play) { +void EnKendoJs_AwaitFinalMessage(EnKendoJs* this, PlayState* play) { Player* player = GET_PLAYER(play); if (Actor_TalkOfferAccepted(&this->actor, &play->state)) { if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_SWORDSMANS_SCHOOL_HEART_PIECE)) { SET_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_SWORDSMANS_SCHOOL_HEART_PIECE); - Message_StartTextbox(play, 0x272F, &this->actor); - this->unk_288 = 0x272F; + ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_EXPERT_COURSE_ACCEPT_HEART_PIECE); } else { - Message_StartTextbox(play, 0x2730, &this->actor); - this->unk_288 = 0x2730; + ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_EXPERT_COURSE_ACCEPT_RED_RUPEE); } - func_80B26AE8(this); + EnKendoJs_SetupMessageStateHandler(this); player->stateFlags1 &= ~PLAYER_STATE1_20; } else { Actor_OfferTalkExchangeEquiCylinder(&this->actor, play, 1000.0f, PLAYER_IA_MINUS1); } } -void func_80B2783C(EnKendoJs* this, PlayState* play) { +void EnKendoJs_SetExpertCourseCamera(EnKendoJs* this, PlayState* play) { if (this->actor.csId != CS_ID_NONE) { Camera_ChangeActorCsCamIndex(play->cameraPtrs[CAM_ID_MAIN], CutsceneManager_GetCutsceneEntry(this->actor.csId)->csCamId); } } -void func_80B27880(EnKendoJs* this, PlayState* play) { +void EnKendoJs_KeepPlayerInTrainingArea(EnKendoJs* this, PlayState* play) { Player* player = GET_PLAYER(play); - f32 temp_f0 = this->actor.world.pos.z + 70.0f; + f32 zClamp = this->actor.world.pos.z + 70.0f; - if ((ENKENDOJS_GET_FF(&this->actor) != ENKENDOJS_FF_1) && (player->actor.world.pos.z < temp_f0)) { - player->actor.world.pos.z = temp_f0; + if ((ENKENDOJS_GET_FF(&this->actor) != ENKENDOJS_FF_1) && (player->actor.world.pos.z < zClamp)) { + player->actor.world.pos.z = zClamp; } } @@ -744,31 +807,31 @@ s32 EnKendoJs_MovePlayerToPos(PlayState* play, Vec3f targetPos) { return false; } -void func_80B279AC(EnKendoJs* this, PlayState* play) { +void EnKendoJs_UpdateCollider(EnKendoJs* this, PlayState* play) { Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); } -void func_80B279F0(EnKendoJs* this, PlayState* play, s32 arg2) { - f32 x = this->pathPoints[arg2].x; - f32 y = this->pathPoints[arg2].y; - f32 z = this->pathPoints[arg2].z; +void EnKendoJs_SpawnLog(EnKendoJs* this, PlayState* play, s32 position) { + f32 x = this->pathPoints[position].x; + f32 y = this->pathPoints[position].y; + f32 z = this->pathPoints[position].z; Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_MARUTA, x, y, z, 0, 0, 0, 0); - this->unk_28C++; + this->numLogs++; } -void func_80B27A90(EnKendoJs* this, PlayState* play) { +void EnKendoJs_RetractLogs(EnKendoJs* this, PlayState* play) { Actor* actor = play->actorCtx.actorLists[ACTORCAT_PROP].first; while (actor != NULL) { if (actor->id == ACTOR_EN_MARUTA) { - ((EnMaruta*)actor)->unk_220 = 1; + ((EnMaruta*)actor)->isRetracting = 1; } actor = actor->next; } - this->unk_28C = 0; + this->numLogs = 0; } void EnKendoJs_Update(Actor* thisx, PlayState* play) { @@ -778,8 +841,8 @@ void EnKendoJs_Update(Actor* thisx, PlayState* play) { SkelAnime_Update(&this->skelAnime); Actor_TrackPlayer(play, &this->actor, &this->headRot, &this->torsoRot, this->actor.focus.pos); - func_80B279AC(this, play); - func_80B27880(this, play); + EnKendoJs_UpdateCollider(this, play); + EnKendoJs_KeepPlayerInTrainingArea(this, play); } s32 EnKendoJs_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { diff --git a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.h b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.h index 9c00267ff2..11833222af 100644 --- a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.h +++ b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.h @@ -23,14 +23,14 @@ typedef struct EnKendoJs { /* 0x274 */ Vec3s* pathPoints; /* 0x278 */ Vec3s headRot; /* 0x27E */ Vec3s torsoRot; - /* 0x284 */ s16 unk_284; - /* 0x286 */ s16 unk_286; - /* 0x288 */ s16 unk_288; - /* 0x28A */ s16 unk_28A; - /* 0x28C */ s16 unk_28C; - /* 0x28E */ s16 unk_28E; - /* 0x290 */ s16 unk_290; - /* 0x292 */ u8 unk_292; + /* 0x284 */ s16 minigameRound; + /* 0x286 */ s16 courseState; + /* 0x288 */ s16 curTextId; + /* 0x28A */ s16 hasSpoken; + /* 0x28C */ s16 numLogs; + /* 0x28E */ s16 isSlashingLog; + /* 0x290 */ s16 timer; + /* 0x292 */ u8 isPlayerLockedOn; } EnKendoJs; // size = 0x294 #endif // Z_EN_KENDO_JS_H diff --git a/src/overlays/actors/ovl_En_Maruta/z_en_maruta.c b/src/overlays/actors/ovl_En_Maruta/z_en_maruta.c index 5bcb593c37..d53b34036c 100644 --- a/src/overlays/actors/ovl_En_Maruta/z_en_maruta.c +++ b/src/overlays/actors/ovl_En_Maruta/z_en_maruta.c @@ -19,7 +19,7 @@ void func_80B372B8(EnMaruta* this); void func_80B372CC(EnMaruta* this, PlayState* play); void func_80B37364(EnMaruta* this); void func_80B3738C(EnMaruta* this, PlayState* play); -void func_80B373F4(EnMaruta* this); +void EnMaruta_StartRetracting(EnMaruta* this); void func_80B37428(EnMaruta* this, PlayState* play); void func_80B374FC(EnMaruta* this, PlayState* play); void func_80B37590(EnMaruta* this, PlayState* play); @@ -236,7 +236,7 @@ void EnMaruta_Init(Actor* thisx, PlayState* play) { } this->unk_214 = -1; - this->unk_220 = 0; + this->isRetracting = 0; if (this->unk_210 == 0) { Collider_InitCylinder(play, &this->collider); @@ -276,14 +276,14 @@ void func_80B372CC(EnMaruta* this, PlayState* play) { this->actor.shape.rot.y -= 0x2AAA; } - if (this->unk_220 == 1) { - func_80B373F4(this); + if (this->isRetracting == 1) { + EnMaruta_StartRetracting(this); } if ((this->actor.parent != NULL) && (this->actor.parent->id == ACTOR_EN_KENDO_JS)) { EnKendoJs* kendoJs = (EnKendoJs*)this->actor.parent; - kendoJs->unk_292 = this->actor.isLockedOn; + kendoJs->isPlayerLockedOn = this->actor.isLockedOn; } } @@ -298,7 +298,7 @@ void func_80B3738C(EnMaruta* this, PlayState* play) { } } -void func_80B373F4(EnMaruta* this) { +void EnMaruta_StartRetracting(EnMaruta* this) { this->collider.base.acFlags |= AC_HIT; this->actor.velocity.y = 0.0f; this->actor.gravity = -2.0f; @@ -313,7 +313,7 @@ void func_80B37428(EnMaruta* this, PlayState* play) { if ((this->actor.parent != NULL) && (this->actor.parent->id == ACTOR_EN_KENDO_JS)) { EnKendoJs* kendoJs = (EnKendoJs*)this->actor.parent; - kendoJs->unk_28C--; + kendoJs->numLogs--; } Actor_Kill(&this->actor); } @@ -545,7 +545,7 @@ void func_80B37CA0(EnMaruta* this, PlayState* play) { EnKendoJs* kendoJs = (EnKendoJs*)this->actor.parent; kendoJs->unk_28E = 1; - kendoJs->unk_28C--; + kendoJs->numLogs--; } return; } diff --git a/src/overlays/actors/ovl_En_Maruta/z_en_maruta.h b/src/overlays/actors/ovl_En_Maruta/z_en_maruta.h index 0216ba3830..ee3c4a688f 100644 --- a/src/overlays/actors/ovl_En_Maruta/z_en_maruta.h +++ b/src/overlays/actors/ovl_En_Maruta/z_en_maruta.h @@ -24,7 +24,7 @@ typedef struct EnMaruta { /* 0x21A */ s16 unk_21A; /* 0x21C */ s16 unk_21C; /* 0x21E */ s16 unk_21E; - /* 0x220 */ s16 unk_220; + /* 0x220 */ s16 isRetracting; } EnMaruta; // size = 0x224 #endif // Z_EN_MARUTA_H diff --git a/tools/disasm/n64-us/functions.txt b/tools/disasm/n64-us/functions.txt index 775ec07368..973808ea24 100644 --- a/tools/disasm/n64-us/functions.txt +++ b/tools/disasm/n64-us/functions.txt @@ -2182,8 +2182,8 @@ func_80122D44 = 0x80122D44; // type:func Player_MaskIdToItemId = 0x80122ED8; // type:func Player_GetCurMaskItemId = 0x80122EEC; // type:func func_80122F28 = 0x80122F28; // type:func -func_80122F9C = 0x80122F9C; // type:func -func_80122FCC = 0x80122FCC; // type:func +Player_IsBackJumping = 0x80122F9C; // type:func +Player_IsSideJumping = 0x80122FCC; // type:func func_8012300C = 0x8012300C; // type:func func_8012301C = 0x8012301C; // type:func func_80123140 = 0x80123140; // type:func @@ -13299,8 +13299,8 @@ EnRacedog_PostLimbDraw = 0x80B25A90; // type:func EnRacedog_Draw = 0x80B25B14; // type:func EnKendoJs_Init = 0x80B262A0; // type:func EnKendoJs_Destroy = 0x80B264FC; // type:func -func_80B26538 = 0x80B26538; // type:func -func_80B2654C = 0x80B2654C; // type:func +EnKendoJs_SetupAwaitingTalk = 0x80B26538; // type:func +EnKendoJs_AwaitTalk = 0x80B2654C; // type:func func_80B26758 = 0x80B26758; // type:func func_80B269A4 = 0x80B269A4; // type:func func_80B26AE8 = 0x80B26AE8; // type:func diff --git a/tools/overlayhelpers/mscriptdis.py b/tools/overlayhelpers/mscriptdis.py index d82ccf7670..b3a92fc280 100644 --- a/tools/overlayhelpers/mscriptdis.py +++ b/tools/overlayhelpers/mscriptdis.py @@ -720,7 +720,7 @@ week_event_reg = { (82 << 8) | 0x01: "WEEKEVENTREG_82_01", (82 << 8) | 0x02: "WEEKEVENTREG_82_02", (82 << 8) | 0x04: "WEEKEVENTREG_82_04", - (82 << 8) | 0x08: "WEEKEVENTREG_82_08", + (82 << 8) | 0x08: "WEEKEVENTREG_STARTED_SWORDSMAN_MINIGAME", (82 << 8) | 0x10: "WEEKEVENTREG_RECEIVED_FISHERMANS_JUMPING_GAME_HEART_PIECE", (82 << 8) | 0x20: "WEEKEVENTREG_82_20", (82 << 8) | 0x40: "WEEKEVENTREG_82_40", diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv index 910c7b00ea..fe1e622daf 100644 --- a/tools/sizes/code_functions.csv +++ b/tools/sizes/code_functions.csv @@ -1699,8 +1699,8 @@ asm/non_matchings/code/z_player_lib/func_80122D44.s,func_80122D44,0x80122D44,0x6 asm/non_matchings/code/z_player_lib/Player_MaskIdToItemId.s,Player_MaskIdToItemId,0x80122ED8,0x5 asm/non_matchings/code/z_player_lib/Player_GetCurMaskItemId.s,Player_GetCurMaskItemId,0x80122EEC,0xF asm/non_matchings/code/z_player_lib/func_80122F28.s,func_80122F28,0x80122F28,0x1D -asm/non_matchings/code/z_player_lib/func_80122F9C.s,func_80122F9C,0x80122F9C,0xC -asm/non_matchings/code/z_player_lib/func_80122FCC.s,func_80122FCC,0x80122FCC,0x10 +asm/non_matchings/code/z_player_lib/Player_IsBackJumping.s,Player_IsBackJumping,0x80122F9C,0xC +asm/non_matchings/code/z_player_lib/Player_IsSideJumping.s,Player_IsSideJumping,0x80122FCC,0x10 asm/non_matchings/code/z_player_lib/func_8012300C.s,func_8012300C,0x8012300C,0x4 asm/non_matchings/code/z_player_lib/func_8012301C.s,func_8012301C,0x8012301C,0x49 asm/non_matchings/code/z_player_lib/func_80123140.s,func_80123140,0x80123140,0x86 diff --git a/tools/weekeventregconvert.py b/tools/weekeventregconvert.py index e975f48120..2259c54c79 100755 --- a/tools/weekeventregconvert.py +++ b/tools/weekeventregconvert.py @@ -663,7 +663,7 @@ weekEventReg = { (82 << 8) | 0x01: "WEEKEVENTREG_82_01", (82 << 8) | 0x02: "WEEKEVENTREG_82_02", (82 << 8) | 0x04: "WEEKEVENTREG_82_04", - (82 << 8) | 0x08: "WEEKEVENTREG_82_08", + (82 << 8) | 0x08: "WEEKEVENTREG_STARTED_SWORDSMAN_MINIGAME", (82 << 8) | 0x10: "WEEKEVENTREG_RECEIVED_FISHERMANS_JUMPING_GAME_HEART_PIECE", (82 << 8) | 0x20: "WEEKEVENTREG_82_20", (82 << 8) | 0x40: "WEEKEVENTREG_82_40", From bd66ee07ce167c59086b43adf87f629faad7a91b Mon Sep 17 00:00:00 2001 From: JordanLongstaff Date: Tue, 2 Dec 2025 09:10:10 -0500 Subject: [PATCH 02/17] Fix typedefs --- src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c index 1ae77eb917..1ce0a0188f 100644 --- a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c +++ b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c @@ -171,7 +171,7 @@ typedef enum EnKendoJsCourseState { /* 0 */ ENKENDOJS_COURSE_PAUSED, /* 1 */ ENKENDOJS_COURSE_ACTIVE, /* 2 */ ENKENDOJS_COURSE_RETRY, -} +} EnKendoJsCourseState; typedef enum EnKendoJsNoviceCourseLesson { /* 0 */ ENKENDOJS_NOVICE_SIDE_JUMP, @@ -182,13 +182,13 @@ typedef enum EnKendoJsNoviceCourseLesson { /* 5 */ ENKENDOJS_NOVICE_SWORD_THRUST, /* 6 */ ENKENDOJS_NOVICE_JUMP_ATTACK, /* 7 */ ENKENDOJS_NOVICE_FINISHED, -} +} EnKendoJsNoviceCourseLesson; typedef enum EnKendoJsNoviceCourseActionResult { /* 0 */ ENKENDOJS_RESULT_CORRECT, /* 1 */ ENKENDOJS_RESULT_INCORRECT, /* 2 */ ENKENDOJS_RESULT_PENDING, -} +} EnKendoJsNoviceCourseActionResult; void EnKendoJs_Init(Actor* thisx, PlayState* play) { s32 pad; From c49409ee5d69a65f9c496cb7c95a7b63c5f5ee04 Mon Sep 17 00:00:00 2001 From: JordanLongstaff Date: Tue, 2 Dec 2025 10:41:04 -0500 Subject: [PATCH 03/17] Fix isSlashingLog reference --- src/overlays/actors/ovl_En_Maruta/z_en_maruta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/overlays/actors/ovl_En_Maruta/z_en_maruta.c b/src/overlays/actors/ovl_En_Maruta/z_en_maruta.c index d53b34036c..20a2608618 100644 --- a/src/overlays/actors/ovl_En_Maruta/z_en_maruta.c +++ b/src/overlays/actors/ovl_En_Maruta/z_en_maruta.c @@ -544,7 +544,7 @@ void func_80B37CA0(EnMaruta* this, PlayState* play) { if ((this->actor.parent != NULL) && (this->actor.parent->id == ACTOR_EN_KENDO_JS)) { EnKendoJs* kendoJs = (EnKendoJs*)this->actor.parent; - kendoJs->unk_28E = 1; + kendoJs->isSlashingLog = 1; kendoJs->numLogs--; } return; From 8dc460256e43c0f1506b9a2b834299bf9ac86756 Mon Sep 17 00:00:00 2001 From: JordanLongstaff Date: Wed, 3 Dec 2025 10:20:42 -0500 Subject: [PATCH 04/17] Found out what that unused animation was --- assets/xml/objects/object_js.xml | 2 +- src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/xml/objects/object_js.xml b/assets/xml/objects/object_js.xml index 539c416abe..b54c319c24 100644 --- a/assets/xml/objects/object_js.xml +++ b/assets/xml/objects/object_js.xml @@ -3,7 +3,7 @@ - + diff --git a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c index 1ce0a0188f..c3ea4f4d88 100644 --- a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c +++ b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c @@ -71,7 +71,7 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; typedef enum EnKendoJsAnimation { - /* 0 */ ENKENDOJS_ANIM_UNUSED, + /* 0 */ ENKENDOJS_ANIM_SLAPPING_KNEE, // unused /* 1 */ ENKENDOJS_ANIM_DEFAULT, /* 2 */ ENKENDOJS_ANIM_FLAILING, /* 3 */ ENKENDOJS_ANIM_STOP_FLAILING, @@ -80,7 +80,7 @@ typedef enum EnKendoJsAnimation { } EnKendoJsAnimation; static AnimationInfo sAnimationInfo[ENKENDOJS_ANIM_MAX] = { - { &object_js_Anim_Unused, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, + { &object_js_Anim_SlappingKnee, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, // unused { &object_js_Anim_Default, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, { &object_js_Anim_Flailing, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, { &object_js_Anim_StopFlailing, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, From a153b2bf13abf90a4b745c0ac88679e878f85435 Mon Sep 17 00:00:00 2001 From: JordanLongstaff Date: Thu, 4 Dec 2025 10:09:04 -0500 Subject: [PATCH 05/17] Rename animation constants --- assets/xml/objects/object_js.xml | 10 +++++----- .../actors/ovl_En_Kendo_Js/z_en_kendo_js.c | 20 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/assets/xml/objects/object_js.xml b/assets/xml/objects/object_js.xml index b54c319c24..d84738f687 100644 --- a/assets/xml/objects/object_js.xml +++ b/assets/xml/objects/object_js.xml @@ -1,10 +1,10 @@  - - - - - + + + + + diff --git a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c index c3ea4f4d88..99795dcb15 100644 --- a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c +++ b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c @@ -75,16 +75,16 @@ typedef enum EnKendoJsAnimation { /* 1 */ ENKENDOJS_ANIM_DEFAULT, /* 2 */ ENKENDOJS_ANIM_FLAILING, /* 3 */ ENKENDOJS_ANIM_STOP_FLAILING, - /* 4 */ ENKENDOJS_ANIM_SCARED, + /* 4 */ ENKENDOJS_ANIM_COWERING, /* 5 */ ENKENDOJS_ANIM_MAX } EnKendoJsAnimation; static AnimationInfo sAnimationInfo[ENKENDOJS_ANIM_MAX] = { - { &object_js_Anim_SlappingKnee, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, // unused - { &object_js_Anim_Default, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, - { &object_js_Anim_Flailing, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, - { &object_js_Anim_StopFlailing, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, - { &object_js_Anim_Scared, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, + { &gSwordmasterSlappingKneeAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, // unused + { &gSwordmasterDefaultAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, + { &gSwordmasterFlailingAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, + { &gSwordmasterStopFlailingAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, + { &gSwordmasterCoweringAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, }; typedef enum EnKendoJsMessage { @@ -200,7 +200,7 @@ void EnKendoJs_Init(Actor* thisx, PlayState* play) { Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit); - SkelAnime_InitFlex(play, &this->skelAnime, &object_js_Skel_006990, &object_js_Anim_Default, this->jointTable, + SkelAnime_InitFlex(play, &this->skelAnime, &object_js_Skel_006990, &gSwordmasterDefaultAnim, this->jointTable, this->morphTable, OBJECT_JS_LIMB_MAX); if ((CURRENT_DAY == 3) && ((CURRENT_TIME > CLOCK_TIME(23, 0)) || (CURRENT_TIME < CLOCK_TIME(6, 0)))) { @@ -210,7 +210,7 @@ void EnKendoJs_Init(Actor* thisx, PlayState* play) { this->actor.home.rot.z, 0x10); Actor_Kill(&this->actor); } else { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, ENKENDOJS_ANIM_SCARED); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, ENKENDOJS_ANIM_COWERING); } } else if (ENKENDOJS_GET_FF(&this->actor) == ENKENDOJS_FF_1) { Actor_Kill(&this->actor); @@ -611,7 +611,7 @@ void EnKendoJs_NoviceCourse(EnKendoJs* this, PlayState* play) { if (this->curTextId == ENKENDOJS_MSG_NOVICE_COURSE_WRONG) { EnKendoJs_NoviceCourseTryAgain(this, play); } else if (!EnKendoJs_HasMoreAdviceToTryAgain(this, play)) { - if (this->skelAnime.animation == &object_js_Anim_Flailing) { + if (this->skelAnime.animation == &gSwordmasterFlailingAnim) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, ENKENDOJS_ANIM_STOP_FLAILING); } this->courseState = ENKENDOJS_COURSE_RETRY; @@ -650,7 +650,7 @@ void EnKendoJs_NoviceCourse(EnKendoJs* this, PlayState* play) { break; } - if ((this->skelAnime.animation == &object_js_Anim_StopFlailing) && + if ((this->skelAnime.animation == &gSwordmasterStopFlailingAnim) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, ENKENDOJS_ANIM_DEFAULT); } From 4ac3a4321c53a2728e44f51918fa5486479370d2 Mon Sep 17 00:00:00 2001 From: JordanLongstaff Date: Thu, 4 Dec 2025 10:10:20 -0500 Subject: [PATCH 06/17] Rename WEEKEVENTREG flag --- include/z64save.h | 3 +-- src/code/z_parameter.c | 4 ++-- src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c | 10 +++++----- tools/overlayhelpers/mscriptdis.py | 2 +- tools/weekeventregconvert.py | 2 +- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/include/z64save.h b/include/z64save.h index 21b77eb541..6378b013da 100644 --- a/include/z64save.h +++ b/include/z64save.h @@ -1342,8 +1342,7 @@ typedef enum { // check if already healed Kamaro the Dancing Ghost #define WEEKEVENTREG_82_04 PACK_WEEKEVENTREG_FLAG(82, 0x04) -// Related to Swordsman's log minigame -#define WEEKEVENTREG_STARTED_SWORDSMAN_MINIGAME PACK_WEEKEVENTREG_FLAG(82, 0x08) +#define WEEKEVENTREG_PLAYING_SWORDSMAN_MINIGAME PACK_WEEKEVENTREG_FLAG(82, 0x08) #define WEEKEVENTREG_RECEIVED_FISHERMANS_JUMPING_GAME_HEART_PIECE PACK_WEEKEVENTREG_FLAG(82, 0x10) #define WEEKEVENTREG_82_20 PACK_WEEKEVENTREG_FLAG(82, 0x20) #define WEEKEVENTREG_82_40 PACK_WEEKEVENTREG_FLAG(82, 0x40) diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index 5aa07706cd..578d771d3e 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -1761,7 +1761,7 @@ void Interface_UpdateButtonsPart2(PlayState* play) { } Interface_SetHudVisibility(HUD_VISIBILITY_B); - } else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_STARTED_SWORDSMAN_MINIGAME)) { + } else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_PLAYING_SWORDSMAN_MINIGAME )) { // Swordsman's log minigame for (i = EQUIP_SLOT_C_LEFT; i <= EQUIP_SLOT_C_RIGHT; i++) { if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { @@ -2282,7 +2282,7 @@ void Interface_UpdateButtonsPart1(PlayState* play) { Interface_SetHudVisibility(HUD_VISIBILITY_A_B_MINIMAP); } else if ((gSaveContext.minigameStatus == MINIGAME_STATUS_ACTIVE) && CHECK_EVENTINF(EVENTINF_35)) { Interface_SetHudVisibility(HUD_VISIBILITY_B_MINIMAP); - } else if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_STARTED_SWORDSMAN_MINIGAME) && + } else if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_PLAYING_SWORDSMAN_MINIGAME ) && (gSaveContext.minigameStatus == MINIGAME_STATUS_ACTIVE)) { Interface_SetHudVisibility(HUD_VISIBILITY_B); } else if (play->bButtonAmmoPlusOne >= 2) { diff --git a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c index 99795dcb15..4a45ef1f60 100644 --- a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c +++ b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c @@ -239,7 +239,7 @@ void EnKendoJs_Destroy(Actor* thisx, PlayState* play) { EnKendoJs* this = (EnKendoJs*)thisx; Collider_DestroyCylinder(play, &this->collider); - CLEAR_WEEKEVENTREG(WEEKEVENTREG_STARTED_SWORDSMAN_MINIGAME); + CLEAR_WEEKEVENTREG(WEEKEVENTREG_PLAYING_SWORDSMAN_MINIGAME ); } void EnKendoJs_SetupAwaitingTalk(EnKendoJs* this) { @@ -596,7 +596,7 @@ void EnKendoJs_MovePlayerToStartNoviceCourse(EnKendoJs* this, PlayState* play) { } void EnKendoJs_StartNoviceCourse(EnKendoJs* this) { - SET_WEEKEVENTREG(WEEKEVENTREG_STARTED_SWORDSMAN_MINIGAME); + SET_WEEKEVENTREG(WEEKEVENTREG_PLAYING_SWORDSMAN_MINIGAME ); this->numLogs = 1; this->timer = 0; this->minigameRound = ENKENDOJS_NOVICE_SIDE_JUMP; @@ -656,14 +656,14 @@ void EnKendoJs_NoviceCourse(EnKendoJs* this, PlayState* play) { } if (this->minigameRound == ENKENDOJS_NOVICE_FINISHED) { - CLEAR_WEEKEVENTREG(WEEKEVENTREG_STARTED_SWORDSMAN_MINIGAME); + CLEAR_WEEKEVENTREG(WEEKEVENTREG_PLAYING_SWORDSMAN_MINIGAME ); EnKendoJs_SetupMessageStateHandler(this); } } } void EnKendoJs_SetupExpertCourse(EnKendoJs* this) { - SET_WEEKEVENTREG(WEEKEVENTREG_STARTED_SWORDSMAN_MINIGAME); + SET_WEEKEVENTREG(WEEKEVENTREG_PLAYING_SWORDSMAN_MINIGAME ); this->timer = 120; this->minigameRound = 0; this->courseState = ENKENDOJS_COURSE_ACTIVE; @@ -694,7 +694,7 @@ void EnKendoJs_ExpertCourse(EnKendoJs* this, PlayState* play) { ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_EXPERT_COURSE_INSUFFICIENT); } player->stateFlags1 |= PLAYER_STATE1_20; - CLEAR_WEEKEVENTREG(WEEKEVENTREG_STARTED_SWORDSMAN_MINIGAME); + CLEAR_WEEKEVENTREG(WEEKEVENTREG_PLAYING_SWORDSMAN_MINIGAME ); EnKendoJs_SetupMessageStateHandler(this); return; } diff --git a/tools/overlayhelpers/mscriptdis.py b/tools/overlayhelpers/mscriptdis.py index b3a92fc280..e4863a2ece 100644 --- a/tools/overlayhelpers/mscriptdis.py +++ b/tools/overlayhelpers/mscriptdis.py @@ -720,7 +720,7 @@ week_event_reg = { (82 << 8) | 0x01: "WEEKEVENTREG_82_01", (82 << 8) | 0x02: "WEEKEVENTREG_82_02", (82 << 8) | 0x04: "WEEKEVENTREG_82_04", - (82 << 8) | 0x08: "WEEKEVENTREG_STARTED_SWORDSMAN_MINIGAME", + (82 << 8) | 0x08: "WEEKEVENTREG_PLAYING_SWORDSMAN_MINIGAME ", (82 << 8) | 0x10: "WEEKEVENTREG_RECEIVED_FISHERMANS_JUMPING_GAME_HEART_PIECE", (82 << 8) | 0x20: "WEEKEVENTREG_82_20", (82 << 8) | 0x40: "WEEKEVENTREG_82_40", diff --git a/tools/weekeventregconvert.py b/tools/weekeventregconvert.py index 2259c54c79..89e3842fc4 100755 --- a/tools/weekeventregconvert.py +++ b/tools/weekeventregconvert.py @@ -663,7 +663,7 @@ weekEventReg = { (82 << 8) | 0x01: "WEEKEVENTREG_82_01", (82 << 8) | 0x02: "WEEKEVENTREG_82_02", (82 << 8) | 0x04: "WEEKEVENTREG_82_04", - (82 << 8) | 0x08: "WEEKEVENTREG_STARTED_SWORDSMAN_MINIGAME", + (82 << 8) | 0x08: "WEEKEVENTREG_PLAYING_SWORDSMAN_MINIGAME ", (82 << 8) | 0x10: "WEEKEVENTREG_RECEIVED_FISHERMANS_JUMPING_GAME_HEART_PIECE", (82 << 8) | 0x20: "WEEKEVENTREG_82_20", (82 << 8) | 0x40: "WEEKEVENTREG_82_40", From fc1e51f27b4e7835ea911ca3ac761294a2c5bbfc Mon Sep 17 00:00:00 2001 From: JordanLongstaff Date: Thu, 4 Dec 2025 10:20:29 -0500 Subject: [PATCH 07/17] Remove trailing whitespaces --- src/code/z_parameter.c | 4 ++-- src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index 578d771d3e..7760378d89 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -1761,7 +1761,7 @@ void Interface_UpdateButtonsPart2(PlayState* play) { } Interface_SetHudVisibility(HUD_VISIBILITY_B); - } else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_PLAYING_SWORDSMAN_MINIGAME )) { + } else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_PLAYING_SWORDSMAN_MINIGAME)) { // Swordsman's log minigame for (i = EQUIP_SLOT_C_LEFT; i <= EQUIP_SLOT_C_RIGHT; i++) { if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { @@ -2282,7 +2282,7 @@ void Interface_UpdateButtonsPart1(PlayState* play) { Interface_SetHudVisibility(HUD_VISIBILITY_A_B_MINIMAP); } else if ((gSaveContext.minigameStatus == MINIGAME_STATUS_ACTIVE) && CHECK_EVENTINF(EVENTINF_35)) { Interface_SetHudVisibility(HUD_VISIBILITY_B_MINIMAP); - } else if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_PLAYING_SWORDSMAN_MINIGAME ) && + } else if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_PLAYING_SWORDSMAN_MINIGAME) && (gSaveContext.minigameStatus == MINIGAME_STATUS_ACTIVE)) { Interface_SetHudVisibility(HUD_VISIBILITY_B); } else if (play->bButtonAmmoPlusOne >= 2) { diff --git a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c index 4a45ef1f60..20675b589c 100644 --- a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c +++ b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c @@ -239,7 +239,7 @@ void EnKendoJs_Destroy(Actor* thisx, PlayState* play) { EnKendoJs* this = (EnKendoJs*)thisx; Collider_DestroyCylinder(play, &this->collider); - CLEAR_WEEKEVENTREG(WEEKEVENTREG_PLAYING_SWORDSMAN_MINIGAME ); + CLEAR_WEEKEVENTREG(WEEKEVENTREG_PLAYING_SWORDSMAN_MINIGAME); } void EnKendoJs_SetupAwaitingTalk(EnKendoJs* this) { @@ -596,7 +596,7 @@ void EnKendoJs_MovePlayerToStartNoviceCourse(EnKendoJs* this, PlayState* play) { } void EnKendoJs_StartNoviceCourse(EnKendoJs* this) { - SET_WEEKEVENTREG(WEEKEVENTREG_PLAYING_SWORDSMAN_MINIGAME ); + SET_WEEKEVENTREG(WEEKEVENTREG_PLAYING_SWORDSMAN_MINIGAME); this->numLogs = 1; this->timer = 0; this->minigameRound = ENKENDOJS_NOVICE_SIDE_JUMP; @@ -656,14 +656,14 @@ void EnKendoJs_NoviceCourse(EnKendoJs* this, PlayState* play) { } if (this->minigameRound == ENKENDOJS_NOVICE_FINISHED) { - CLEAR_WEEKEVENTREG(WEEKEVENTREG_PLAYING_SWORDSMAN_MINIGAME ); + CLEAR_WEEKEVENTREG(WEEKEVENTREG_PLAYING_SWORDSMAN_MINIGAME); EnKendoJs_SetupMessageStateHandler(this); } } } void EnKendoJs_SetupExpertCourse(EnKendoJs* this) { - SET_WEEKEVENTREG(WEEKEVENTREG_PLAYING_SWORDSMAN_MINIGAME ); + SET_WEEKEVENTREG(WEEKEVENTREG_PLAYING_SWORDSMAN_MINIGAME); this->timer = 120; this->minigameRound = 0; this->courseState = ENKENDOJS_COURSE_ACTIVE; @@ -694,7 +694,7 @@ void EnKendoJs_ExpertCourse(EnKendoJs* this, PlayState* play) { ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_EXPERT_COURSE_INSUFFICIENT); } player->stateFlags1 |= PLAYER_STATE1_20; - CLEAR_WEEKEVENTREG(WEEKEVENTREG_PLAYING_SWORDSMAN_MINIGAME ); + CLEAR_WEEKEVENTREG(WEEKEVENTREG_PLAYING_SWORDSMAN_MINIGAME); EnKendoJs_SetupMessageStateHandler(this); return; } From cf26ad619adf739839f3fad9c0f5f222a611d4de Mon Sep 17 00:00:00 2001 From: JordanLongstaff Date: Fri, 5 Dec 2025 13:53:52 -0500 Subject: [PATCH 08/17] Fix uses of isSlashingLog --- .../actors/ovl_En_Kendo_Js/z_en_kendo_js.c | 40 +++++++++---------- .../actors/ovl_En_Maruta/z_en_maruta.c | 2 +- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c index 20675b589c..5c1da49d08 100644 --- a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c +++ b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c @@ -230,7 +230,7 @@ void EnKendoJs_Init(Actor* thisx, PlayState* play) { this->actor.child = NULL; this->hasSpoken = false; this->numLogs = 0; - this->isSlashingLog = 0; + this->isSlashingLog = false; this->courseState = ENKENDOJS_COURSE_PAUSED; EnKendoJs_SetupAwaitingTalk(this); } @@ -474,60 +474,60 @@ s32 EnKendoJs_GetNoviceCourseActionResult(EnKendoJs* this, PlayState* play) { (player->stateFlags3 & PLAYER_STATE3_8000000) || (player->stateFlags2 & PLAYER_STATE2_80000)) { return ENKENDOJS_RESULT_INCORRECT; } - this->isSlashingLog = 0; + this->isSlashingLog = false; break; case ENKENDOJS_NOVICE_SWORD_ATTACK: - if ((this->isSlashingLog == 1) && ((player->meleeWeaponAnimation == PLAYER_MWA_RIGHT_SLASH_1H) || + if ((this->isSlashingLog == true) && ((player->meleeWeaponAnimation == PLAYER_MWA_RIGHT_SLASH_1H) || (player->meleeWeaponAnimation == PLAYER_MWA_RIGHT_COMBO_1H))) { - this->isSlashingLog = 0; + this->isSlashingLog = false; return ENKENDOJS_RESULT_CORRECT; } - if ((this->isSlashingLog == 1) || (player->stateFlags3 & PLAYER_STATE3_8000000) || + if ((this->isSlashingLog == true) || (player->stateFlags3 & PLAYER_STATE3_8000000) || (player->stateFlags2 & PLAYER_STATE2_80000)) { - this->isSlashingLog = 0; + this->isSlashingLog = false; return ENKENDOJS_RESULT_INCORRECT; } break; case ENKENDOJS_NOVICE_SWORD_TARGET: - if ((this->isSlashingLog == 1) && ((player->meleeWeaponAnimation == PLAYER_MWA_FORWARD_SLASH_1H) || + if ((this->isSlashingLog == true) && ((player->meleeWeaponAnimation == PLAYER_MWA_FORWARD_SLASH_1H) || (player->meleeWeaponAnimation == PLAYER_MWA_FORWARD_COMBO_1H))) { - this->isSlashingLog = 0; + this->isSlashingLog = false; return ENKENDOJS_RESULT_CORRECT; } - if ((this->isSlashingLog == 1) || (player->stateFlags3 & PLAYER_STATE3_8000000) || + if ((this->isSlashingLog == true) || (player->stateFlags3 & PLAYER_STATE3_8000000) || (player->stateFlags2 & PLAYER_STATE2_80000)) { - this->isSlashingLog = 0; + this->isSlashingLog = false; return ENKENDOJS_RESULT_INCORRECT; } break; case ENKENDOJS_NOVICE_SWORD_THRUST: - if ((this->isSlashingLog == 1) && (player->meleeWeaponAnimation == PLAYER_MWA_STAB_1H)) { - this->isSlashingLog = 0; + if ((this->isSlashingLog == true) && (player->meleeWeaponAnimation == PLAYER_MWA_STAB_1H)) { + this->isSlashingLog = false; return ENKENDOJS_RESULT_CORRECT; } - if ((this->isSlashingLog == 1) || (player->stateFlags3 & PLAYER_STATE3_8000000) || + if ((this->isSlashingLog == true) || (player->stateFlags3 & PLAYER_STATE3_8000000) || (player->stateFlags2 & PLAYER_STATE2_80000)) { - this->isSlashingLog = 0; + this->isSlashingLog = false; return ENKENDOJS_RESULT_INCORRECT; } break; case ENKENDOJS_NOVICE_JUMP_ATTACK: - if ((this->isSlashingLog == 1) && ((player->meleeWeaponAnimation == PLAYER_MWA_JUMPSLASH_START) || + if ((this->isSlashingLog == true) && ((player->meleeWeaponAnimation == PLAYER_MWA_JUMPSLASH_START) || (player->meleeWeaponAnimation == PLAYER_MWA_JUMPSLASH_FINISH))) { - this->isSlashingLog = 0; + this->isSlashingLog = false; return ENKENDOJS_RESULT_CORRECT; } - if ((this->isSlashingLog == 1) || (player->stateFlags3 & PLAYER_STATE3_8000000) || + if ((this->isSlashingLog == true) || (player->stateFlags3 & PLAYER_STATE3_8000000) || (player->stateFlags2 & PLAYER_STATE2_80000)) { - this->isSlashingLog = 0; + this->isSlashingLog = false; return ENKENDOJS_RESULT_INCORRECT; } break; @@ -711,7 +711,7 @@ void EnKendoJs_ExpertCourse(EnKendoJs* this, PlayState* play) { this->timer++; } - if (this->isSlashingLog == 1) { + if (this->isSlashingLog == true) { if ((player->meleeWeaponAnimation == PLAYER_MWA_JUMPSLASH_START) || (player->meleeWeaponAnimation == PLAYER_MWA_JUMPSLASH_FINISH)) { play->interfaceCtx.minigamePoints = 3; @@ -724,7 +724,7 @@ void EnKendoJs_ExpertCourse(EnKendoJs* this, PlayState* play) { play->interfaceCtx.minigamePoints = 1; } Actor_PlaySfx(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); - this->isSlashingLog = 0; + this->isSlashingLog = false; } EnKendoJs_SetExpertCourseCamera(this, play); } diff --git a/src/overlays/actors/ovl_En_Maruta/z_en_maruta.c b/src/overlays/actors/ovl_En_Maruta/z_en_maruta.c index 20a2608618..11f804e973 100644 --- a/src/overlays/actors/ovl_En_Maruta/z_en_maruta.c +++ b/src/overlays/actors/ovl_En_Maruta/z_en_maruta.c @@ -544,7 +544,7 @@ void func_80B37CA0(EnMaruta* this, PlayState* play) { if ((this->actor.parent != NULL) && (this->actor.parent->id == ACTOR_EN_KENDO_JS)) { EnKendoJs* kendoJs = (EnKendoJs*)this->actor.parent; - kendoJs->isSlashingLog = 1; + kendoJs->isSlashingLog = true; kendoJs->numLogs--; } return; From 6135dcc7f7e3d378be882548b665c3f168cf9b5c Mon Sep 17 00:00:00 2001 From: JordanLongstaff Date: Fri, 5 Dec 2025 13:55:20 -0500 Subject: [PATCH 09/17] Rename Skel object --- assets/xml/objects/object_js.xml | 2 +- src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/xml/objects/object_js.xml b/assets/xml/objects/object_js.xml index d84738f687..e8d34729f4 100644 --- a/assets/xml/objects/object_js.xml +++ b/assets/xml/objects/object_js.xml @@ -39,7 +39,7 @@ - + diff --git a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c index 5c1da49d08..c2ce829605 100644 --- a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c +++ b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c @@ -200,7 +200,7 @@ void EnKendoJs_Init(Actor* thisx, PlayState* play) { Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit); - SkelAnime_InitFlex(play, &this->skelAnime, &object_js_Skel_006990, &gSwordmasterDefaultAnim, this->jointTable, + SkelAnime_InitFlex(play, &this->skelAnime, &gSwordmasterSkel, &gSwordmasterDefaultAnim, this->jointTable, this->morphTable, OBJECT_JS_LIMB_MAX); if ((CURRENT_DAY == 3) && ((CURRENT_TIME > CLOCK_TIME(23, 0)) || (CURRENT_TIME < CLOCK_TIME(6, 0)))) { From 374040b608aabebffab516c95f3978ab96e06e2f Mon Sep 17 00:00:00 2001 From: JordanLongstaff Date: Fri, 5 Dec 2025 14:31:33 -0500 Subject: [PATCH 10/17] Deciphered FF part of params --- .../actors/ovl_En_Kendo_Js/z_en_kendo_js.c | 16 ++++++++-------- .../actors/ovl_En_Kendo_Js/z_en_kendo_js.h | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c index c2ce829605..1f78f449f8 100644 --- a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c +++ b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c @@ -204,7 +204,7 @@ void EnKendoJs_Init(Actor* thisx, PlayState* play) { this->morphTable, OBJECT_JS_LIMB_MAX); if ((CURRENT_DAY == 3) && ((CURRENT_TIME > CLOCK_TIME(23, 0)) || (CURRENT_TIME < CLOCK_TIME(6, 0)))) { - if (ENKENDOJS_GET_FF(&this->actor) != ENKENDOJS_FF_1) { + if (ENKENDOJS_GET_LOCATION(&this->actor) != ENKENDOJS_IN_BACK_ROOM) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_KANBAN, this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z - 10.0f, this->actor.home.rot.x, this->actor.home.rot.y, this->actor.home.rot.z, 0x10); @@ -212,13 +212,13 @@ void EnKendoJs_Init(Actor* thisx, PlayState* play) { } else { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, ENKENDOJS_ANIM_COWERING); } - } else if (ENKENDOJS_GET_FF(&this->actor) == ENKENDOJS_FF_1) { + } else if (ENKENDOJS_GET_LOCATION(&this->actor) == ENKENDOJS_IN_BACK_ROOM) { Actor_Kill(&this->actor); } Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_4); - if (ENKENDOJS_GET_FF(&this->actor) != ENKENDOJS_FF_1) { + if (ENKENDOJS_GET_LOCATION(&this->actor) != ENKENDOJS_IN_BACK_ROOM) { Path* path = &play->setupPathList[ENKENDOJS_GET_PATH_INDEX(&this->actor)]; this->pathPoints = Lib_SegmentedToVirtual(path->points); @@ -257,7 +257,7 @@ void EnKendoJs_AwaitTalk(EnKendoJs* this, PlayState* play) { dayIndex = 0; } - if (ENKENDOJS_GET_FF(&this->actor) == ENKENDOJS_FF_1) { + if (ENKENDOJS_GET_LOCATION(&this->actor) == ENKENDOJS_IN_BACK_ROOM) { ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_DONT_WANT_TO_DIE); } else if (GET_PLAYER_FORM != PLAYER_FORM_HUMAN) { switch (GET_PLAYER_FORM) { @@ -479,7 +479,7 @@ s32 EnKendoJs_GetNoviceCourseActionResult(EnKendoJs* this, PlayState* play) { case ENKENDOJS_NOVICE_SWORD_ATTACK: if ((this->isSlashingLog == true) && ((player->meleeWeaponAnimation == PLAYER_MWA_RIGHT_SLASH_1H) || - (player->meleeWeaponAnimation == PLAYER_MWA_RIGHT_COMBO_1H))) { + (player->meleeWeaponAnimation == PLAYER_MWA_RIGHT_COMBO_1H))) { this->isSlashingLog = false; return ENKENDOJS_RESULT_CORRECT; } @@ -493,7 +493,7 @@ s32 EnKendoJs_GetNoviceCourseActionResult(EnKendoJs* this, PlayState* play) { case ENKENDOJS_NOVICE_SWORD_TARGET: if ((this->isSlashingLog == true) && ((player->meleeWeaponAnimation == PLAYER_MWA_FORWARD_SLASH_1H) || - (player->meleeWeaponAnimation == PLAYER_MWA_FORWARD_COMBO_1H))) { + (player->meleeWeaponAnimation == PLAYER_MWA_FORWARD_COMBO_1H))) { this->isSlashingLog = false; return ENKENDOJS_RESULT_CORRECT; } @@ -520,7 +520,7 @@ s32 EnKendoJs_GetNoviceCourseActionResult(EnKendoJs* this, PlayState* play) { case ENKENDOJS_NOVICE_JUMP_ATTACK: if ((this->isSlashingLog == true) && ((player->meleeWeaponAnimation == PLAYER_MWA_JUMPSLASH_START) || - (player->meleeWeaponAnimation == PLAYER_MWA_JUMPSLASH_FINISH))) { + (player->meleeWeaponAnimation == PLAYER_MWA_JUMPSLASH_FINISH))) { this->isSlashingLog = false; return ENKENDOJS_RESULT_CORRECT; } @@ -776,7 +776,7 @@ void EnKendoJs_KeepPlayerInTrainingArea(EnKendoJs* this, PlayState* play) { Player* player = GET_PLAYER(play); f32 zClamp = this->actor.world.pos.z + 70.0f; - if ((ENKENDOJS_GET_FF(&this->actor) != ENKENDOJS_FF_1) && (player->actor.world.pos.z < zClamp)) { + if ((ENKENDOJS_GET_LOCATION(&this->actor) != ENKENDOJS_IN_BACK_ROOM) && (player->actor.world.pos.z < zClamp)) { player->actor.world.pos.z = zClamp; } } diff --git a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.h b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.h index 11833222af..2483b730d5 100644 --- a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.h +++ b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.h @@ -8,10 +8,10 @@ struct EnKendoJs; typedef void (*EnKendoJsActionFunc)(struct EnKendoJs*, PlayState*); -#define ENKENDOJS_GET_FF(thisx) ((thisx)->params & 0xFF) +#define ENKENDOJS_GET_LOCATION(thisx) ((thisx)->params & 0xFF) #define ENKENDOJS_GET_PATH_INDEX(thisx) (((thisx)->params & 0xFF00) >> 8) -#define ENKENDOJS_FF_1 1 +#define ENKENDOJS_IN_BACK_ROOM 1 typedef struct EnKendoJs { /* 0x000 */ Actor actor; From c2d003cd8fa5d59b2906eb2812cc0eba75dcce20 Mon Sep 17 00:00:00 2001 From: JordanLongstaff Date: Sat, 6 Dec 2025 21:39:40 -0500 Subject: [PATCH 11/17] Dismantle message enum --- .../actors/ovl_En_Kendo_Js/z_en_kendo_js.c | 141 ++++++------------ 1 file changed, 42 insertions(+), 99 deletions(-) diff --git a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c index 1f78f449f8..ec278248a7 100644 --- a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c +++ b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c @@ -87,54 +87,6 @@ static AnimationInfo sAnimationInfo[ENKENDOJS_ANIM_MAX] = { { &gSwordmasterCoweringAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, }; -typedef enum EnKendoJsMessage { - ENKENDOJS_MSG_HUMAN_INTRO_DAY1 = 0x2710, - ENKENDOJS_MSG_HUMAN_INTRO_SHORT_DAY1 = 0x2711, - ENKENDOJS_MSG_HUMAN_INTRO_DAY2 = 0x2712, - ENKENDOJS_MSG_HUMAN_INTRO_SHORT_DAY2 = 0x2713, - ENKENDOJS_MSG_HUMAN_INTRO_DAY3 = 0x2714, - ENKENDOJS_MSG_HUMAN_INTRO_SHORT_DAY3 = 0x2715, - ENKENDOJS_MSG_WHICH_COURSE = 0x2716, - ENKENDOJS_MSG_CANCEL = 0x2717, - ENKENDOJS_MSG_NOT_ENOUGH_RUPEES = 0x2718, - ENKENDOJS_MSG_NOVICE_COURSE_SELECTED = 0x2719, - ENKENDOJS_MSG_NOVICE_COURSE_START = 0x271A, - ENKENDOJS_MSG_NOVICE_COURSE_RETRY_ROUND1 = 0x271B, - ENKENDOJS_MSG_NOVICE_COURSE_PASS_ROUND1 = 0x271C, - ENKENDOJS_MSG_NOVICE_COURSE_RETRY_ROUND2 = 0x271D, - ENKENDOJS_MSG_NOVICE_COURSE_PASS_ROUND2 = 0x271E, - ENKENDOJS_MSG_NOVICE_COURSE_RETRY_ROUND3 = 0x271F, - ENKENDOJS_MSG_NOVICE_COURSE_PASS_ROUND3 = 0x2720, - ENKENDOJS_MSG_NOVICE_COURSE_RETRY_ROUND4 = 0x2721, - ENKENDOJS_MSG_NOVICE_COURSE_PASS_ROUND4 = 0x2722, - ENKENDOJS_MSG_NOVICE_COURSE_RETRY_ROUND5 = 0x2723, - ENKENDOJS_MSG_NOVICE_COURSE_PASS_ROUND5 = 0x2724, - ENKENDOJS_MSG_NOVICE_COURSE_RETRY_ROUND6 = 0x2725, - ENKENDOJS_MSG_NOVICE_COURSE_PASS_ROUND6 = 0x2726, - ENKENDOJS_MSG_NOVICE_COURSE_RETRY_ROUND7 = 0x2727, - ENKENDOJS_MSG_NOVICE_COURSE_PASS_ROUND7 = 0x2728, - ENKENDOJS_MSG_NOVICE_COURSE_WRONG = 0x2729, - ENKENDOJS_MSG_NOVICE_COURSE_SHEATH_WEAPON = 0x272A, - ENKENDOJS_MSG_NOVICE_COURSE_NO_Z_TARGET = 0x272B, - ENKENDOJS_MSG_NOVICE_COURSE_NO_SWORD = 0x272C, - ENKENDOJS_MSG_EXPERT_COURSE_PERFECT = 0x272D, - ENKENDOJS_MSG_EXPERT_COURSE_INSUFFICIENT = 0x272E, - ENKENDOJS_MSG_EXPERT_COURSE_ACCEPT_HEART_PIECE = 0x272F, - ENKENDOJS_MSG_EXPERT_COURSE_ACCEPT_RED_RUPEE = 0x2730, - ENKENDOJS_MSG_DEKU_DAY1 = 0x2731, - ENKENDOJS_MSG_DEKU_DAY2 = 0x2732, - ENKENDOJS_MSG_DEKU_DAY3 = 0x2733, - ENKENDOJS_MSG_GORON_DAY1 = 0x2734, - ENKENDOJS_MSG_GORON_DAY2 = 0x2735, - ENKENDOJS_MSG_GORON_DAY3 = 0x2736, - ENKENDOJS_MSG_ZORA_DAY1 = 0x2737, - ENKENDOJS_MSG_ZORA_DAY2 = 0x2738, - ENKENDOJS_MSG_ZORA_DAY3 = 0x2739, - ENKENDOJS_MSG_EXPERT_COURSE_SELECTED = 0x273A, - ENKENDOJS_MSG_EXPERT_COURSE_RULES = 0x273B, - ENKENDOJS_MSG_DONT_WANT_TO_DIE = 0x273C, -} EnKendoJsMessage; - #define ENKENDOJS_MSG_MASK(play) Player_GetMask(play) + 0x273C #define ENKENDOJS_QUEUE_MSG(thisx, play, textId) \ @@ -142,29 +94,22 @@ typedef enum EnKendoJsMessage { thisx->curTextId = textId; s16 sNonHumanMessages[][3] = { - { ENKENDOJS_MSG_DEKU_DAY1, ENKENDOJS_MSG_DEKU_DAY2, ENKENDOJS_MSG_DEKU_DAY3 }, - { ENKENDOJS_MSG_GORON_DAY1, ENKENDOJS_MSG_GORON_DAY2, ENKENDOJS_MSG_GORON_DAY3 }, - { ENKENDOJS_MSG_ZORA_DAY1, ENKENDOJS_MSG_ZORA_DAY2, ENKENDOJS_MSG_ZORA_DAY3 }, + { 0x2731, 0x2732, 0x2733 }, + { 0x2734, 0x2735, 0x2736 }, + { 0x2737, 0x2738, 0x2739 }, }; s16 sHumanMessages[][3] = { - { ENKENDOJS_MSG_HUMAN_INTRO_DAY1, ENKENDOJS_MSG_HUMAN_INTRO_DAY2, ENKENDOJS_MSG_HUMAN_INTRO_DAY3 }, - { ENKENDOJS_MSG_HUMAN_INTRO_SHORT_DAY1, ENKENDOJS_MSG_HUMAN_INTRO_SHORT_DAY2, - ENKENDOJS_MSG_HUMAN_INTRO_SHORT_DAY3 }, + { 0x2710, 0x2712, 0x2714 }, + { 0x2711, 0x2713, 0x2715 }, }; s16 sNoviceCourseProgressMessages[] = { - ENKENDOJS_MSG_NOVICE_COURSE_PASS_ROUND1, ENKENDOJS_MSG_NOVICE_COURSE_PASS_ROUND2, - ENKENDOJS_MSG_NOVICE_COURSE_PASS_ROUND3, ENKENDOJS_MSG_NOVICE_COURSE_PASS_ROUND4, - ENKENDOJS_MSG_NOVICE_COURSE_PASS_ROUND5, ENKENDOJS_MSG_NOVICE_COURSE_PASS_ROUND6, - ENKENDOJS_MSG_NOVICE_COURSE_PASS_ROUND7, + 0x271C, 0x271E, 0x2720, 0x2722, 0x2724, 0x2726, 0x2728, }; s16 sNoviceCourseTryAgainMessages[] = { - ENKENDOJS_MSG_NOVICE_COURSE_RETRY_ROUND1, ENKENDOJS_MSG_NOVICE_COURSE_RETRY_ROUND2, - ENKENDOJS_MSG_NOVICE_COURSE_RETRY_ROUND3, ENKENDOJS_MSG_NOVICE_COURSE_RETRY_ROUND4, - ENKENDOJS_MSG_NOVICE_COURSE_RETRY_ROUND5, ENKENDOJS_MSG_NOVICE_COURSE_RETRY_ROUND6, - ENKENDOJS_MSG_NOVICE_COURSE_RETRY_ROUND7, + 0x271B, 0x271D, 0x271F, 0x2721, 0x2723, 0x2725, 0x2727, }; typedef enum EnKendoJsCourseState { @@ -258,7 +203,7 @@ void EnKendoJs_AwaitTalk(EnKendoJs* this, PlayState* play) { } if (ENKENDOJS_GET_LOCATION(&this->actor) == ENKENDOJS_IN_BACK_ROOM) { - ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_DONT_WANT_TO_DIE); + ENKENDOJS_QUEUE_MSG(this, play, 0x273C); } else if (GET_PLAYER_FORM != PLAYER_FORM_HUMAN) { switch (GET_PLAYER_FORM) { case PLAYER_FORM_DEKU: @@ -303,41 +248,41 @@ void EnKendoJs_AwaitTalk(EnKendoJs* this, PlayState* play) { } void EnKendoJs_HandleCourseChoice(EnKendoJs* this, PlayState* play) { - if (Message_ShouldAdvance(play) && (this->curTextId == ENKENDOJS_MSG_WHICH_COURSE)) { + if (Message_ShouldAdvance(play) && (this->curTextId == 0x2716)) { switch (play->msgCtx.choiceIndex) { case 0: if (GET_CUR_EQUIP_VALUE(EQUIP_TYPE_SWORD) == EQUIP_VALUE_SWORD_NONE) { Audio_PlaySfx(NA_SE_SY_ERROR); - ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_NOVICE_COURSE_NO_SWORD); + ENKENDOJS_QUEUE_MSG(this, play, 0x272C); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, ENKENDOJS_ANIM_FLAILING); } else if (gSaveContext.save.saveInfo.playerData.rupees < play->msgCtx.unk1206C) { Audio_PlaySfx(NA_SE_SY_ERROR); - ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_NOT_ENOUGH_RUPEES); + ENKENDOJS_QUEUE_MSG(this, play, 0x2718); } else { Audio_PlaySfx_MessageDecide(); Rupees_ChangeBy(-play->msgCtx.unk1206C); - ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_NOVICE_COURSE_SELECTED); + ENKENDOJS_QUEUE_MSG(this, play, 0x2719); } break; case 1: if (GET_CUR_EQUIP_VALUE(EQUIP_TYPE_SWORD) == EQUIP_VALUE_SWORD_NONE) { Audio_PlaySfx(NA_SE_SY_ERROR); - ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_NOVICE_COURSE_NO_SWORD); + ENKENDOJS_QUEUE_MSG(this, play, 0x272C); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, ENKENDOJS_ANIM_FLAILING); } else if (gSaveContext.save.saveInfo.playerData.rupees < play->msgCtx.unk12070) { Audio_PlaySfx(NA_SE_SY_ERROR); - ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_NOT_ENOUGH_RUPEES); + ENKENDOJS_QUEUE_MSG(this, play, 0x2718); } else { Audio_PlaySfx_MessageDecide(); Rupees_ChangeBy(-play->msgCtx.unk12070); - ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_EXPERT_COURSE_SELECTED); + ENKENDOJS_QUEUE_MSG(this, play, 0x273A); } break; case 2: Audio_PlaySfx_MessageCancel(); - ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_CANCEL); + ENKENDOJS_QUEUE_MSG(this, play, 0x2717); break; default: @@ -354,38 +299,38 @@ void EnKendoJs_HandleEvents(EnKendoJs* this, PlayState* play) { } switch (this->curTextId) { - case ENKENDOJS_MSG_HUMAN_INTRO_DAY1: - case ENKENDOJS_MSG_HUMAN_INTRO_SHORT_DAY1: - case ENKENDOJS_MSG_HUMAN_INTRO_DAY2: - case ENKENDOJS_MSG_HUMAN_INTRO_SHORT_DAY2: - case ENKENDOJS_MSG_HUMAN_INTRO_DAY3: - case ENKENDOJS_MSG_HUMAN_INTRO_SHORT_DAY3: - ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_WHICH_COURSE); + case 0x2710: + case 0x2711: + case 0x2712: + case 0x2713: + case 0x2714: + case 0x2715: + ENKENDOJS_QUEUE_MSG(this, play, 0x2716); break; - case ENKENDOJS_MSG_NOVICE_COURSE_SELECTED: + case 0x2719: Message_CloseTextbox(play); player->stateFlags1 |= PLAYER_STATE1_20; EnKendoJs_SetupNoviceCourse(this); break; - case ENKENDOJS_MSG_NOVICE_COURSE_START: + case 0x271A: Message_CloseTextbox(play); EnKendoJs_StartNoviceCourse(this); break; - case ENKENDOJS_MSG_EXPERT_COURSE_SELECTED: - ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_EXPERT_COURSE_RULES); + case 0x273A: + ENKENDOJS_QUEUE_MSG(this, play, 0x273B); break; - case ENKENDOJS_MSG_EXPERT_COURSE_RULES: + case 0x273B: Message_CloseTextbox(play); Interface_InitMinigame(play); player->stateFlags1 |= PLAYER_STATE1_20; EnKendoJs_SetupExpertCourse(this); break; - case ENKENDOJS_MSG_EXPERT_COURSE_PERFECT: + case 0x272D: Message_CloseTextbox(play); gSaveContext.minigameStatus = MINIGAME_STATUS_END; EnKendoJs_SetupPrize(this); @@ -415,13 +360,11 @@ void EnKendoJs_HandleMessageState(EnKendoJs* this, PlayState* play) { case TEXT_STATE_DONE: if (Message_ShouldAdvance(play)) { - if (this->curTextId == ENKENDOJS_MSG_NOVICE_COURSE_NO_SWORD) { + if (this->curTextId == 0x272C) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, ENKENDOJS_ANIM_STOP_FLAILING); } - if ((this->curTextId == ENKENDOJS_MSG_EXPERT_COURSE_INSUFFICIENT) || - (this->curTextId == ENKENDOJS_MSG_EXPERT_COURSE_ACCEPT_HEART_PIECE) || - (this->curTextId == ENKENDOJS_MSG_EXPERT_COURSE_ACCEPT_RED_RUPEE)) { + if ((this->curTextId == 0x272E) || (this->curTextId == 0x272F) || (this->curTextId == 0x2730)) { gSaveContext.minigameStatus = MINIGAME_STATUS_END; } @@ -551,16 +494,16 @@ s32 EnKendoJs_HasMoreAdviceToTryAgain(EnKendoJs* this, PlayState* play) { Player* player = GET_PLAYER(play); switch (this->curTextId) { - case ENKENDOJS_MSG_NOVICE_COURSE_RETRY_ROUND2: + case 0x271D: if (Player_GetMeleeWeaponHeld(player) != PLAYER_MELEEWEAPON_NONE) { - ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_NOVICE_COURSE_SHEATH_WEAPON); + ENKENDOJS_QUEUE_MSG(this, play, 0x272A); return true; } break; - case ENKENDOJS_MSG_NOVICE_COURSE_RETRY_ROUND4: + case 0x2721: if (this->isPlayerLockedOn) { - ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_NOVICE_COURSE_NO_Z_TARGET); + ENKENDOJS_QUEUE_MSG(this, play, 0x272B); return true; } break; @@ -587,7 +530,7 @@ void EnKendoJs_MovePlayerToStartNoviceCourse(EnKendoJs* this, PlayState* play) { this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; player->stateFlags1 &= ~PLAYER_STATE1_20; EnKendoJs_SpawnLog(this, play, 0); - ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_NOVICE_COURSE_START); + ENKENDOJS_QUEUE_MSG(this, play, 0x271A); EnKendoJs_SetupMessageStateHandler(this); } else { Actor_OfferTalk(&this->actor, play, 800.0f); @@ -608,7 +551,7 @@ void EnKendoJs_NoviceCourse(EnKendoJs* this, PlayState* play) { Player* player = GET_PLAYER(play); if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) { - if (this->curTextId == ENKENDOJS_MSG_NOVICE_COURSE_WRONG) { + if (this->curTextId == 0x2729) { EnKendoJs_NoviceCourseTryAgain(this, play); } else if (!EnKendoJs_HasMoreAdviceToTryAgain(this, play)) { if (this->skelAnime.animation == &gSwordmasterFlailingAnim) { @@ -635,7 +578,7 @@ void EnKendoJs_NoviceCourse(EnKendoJs* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_SY_ERROR); this->courseState = ENKENDOJS_COURSE_PAUSED; player->stateFlags1 |= PLAYER_STATE1_20; - ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_NOVICE_COURSE_WRONG); + ENKENDOJS_QUEUE_MSG(this, play, 0x2729); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, ENKENDOJS_ANIM_FLAILING); break; @@ -689,9 +632,9 @@ void EnKendoJs_ExpertCourse(EnKendoJs* this, PlayState* play) { if (this->timer >= 140) { if (this->minigameRound == 5) { if (gSaveContext.minigameScore == 30) { - ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_EXPERT_COURSE_PERFECT); + ENKENDOJS_QUEUE_MSG(this, play, 0x272D); } else { - ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_EXPERT_COURSE_INSUFFICIENT); + ENKENDOJS_QUEUE_MSG(this, play, 0x272E); } player->stateFlags1 |= PLAYER_STATE1_20; CLEAR_WEEKEVENTREG(WEEKEVENTREG_PLAYING_SWORDSMAN_MINIGAME); @@ -754,9 +697,9 @@ void EnKendoJs_AwaitFinalMessage(EnKendoJs* this, PlayState* play) { if (Actor_TalkOfferAccepted(&this->actor, &play->state)) { if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_SWORDSMANS_SCHOOL_HEART_PIECE)) { SET_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_SWORDSMANS_SCHOOL_HEART_PIECE); - ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_EXPERT_COURSE_ACCEPT_HEART_PIECE); + ENKENDOJS_QUEUE_MSG(this, play, 0x272F); } else { - ENKENDOJS_QUEUE_MSG(this, play, ENKENDOJS_MSG_EXPERT_COURSE_ACCEPT_RED_RUPEE); + ENKENDOJS_QUEUE_MSG(this, play, 0x2730); } EnKendoJs_SetupMessageStateHandler(this); player->stateFlags1 &= ~PLAYER_STATE1_20; From 9281ba23455d5210f12d86ef3e88b49003fda6b5 Mon Sep 17 00:00:00 2001 From: JordanLongstaff Date: Sat, 6 Dec 2025 21:42:11 -0500 Subject: [PATCH 12/17] Remove mask message macro --- src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c index ec278248a7..149cbc2afa 100644 --- a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c +++ b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c @@ -87,8 +87,6 @@ static AnimationInfo sAnimationInfo[ENKENDOJS_ANIM_MAX] = { { &gSwordmasterCoweringAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, }; -#define ENKENDOJS_MSG_MASK(play) Player_GetMask(play) + 0x273C - #define ENKENDOJS_QUEUE_MSG(thisx, play, textId) \ Message_StartTextbox(play, textId, &thisx->actor); \ thisx->curTextId = textId; @@ -225,7 +223,7 @@ void EnKendoJs_AwaitTalk(EnKendoJs* this, PlayState* play) { ENKENDOJS_QUEUE_MSG(this, play, sNonHumanMessages[mainIndex][dayIndex]); } else if ((Player_GetMask(play) != PLAYER_MASK_NONE) && (Player_GetMask(play) < PLAYER_MASK_GIANT)) { - u16 maskMessage = ENKENDOJS_MSG_MASK(play); + u16 maskMessage = Player_GetMask(play) + 0x273C; //! FAKE: if (1) {} From f098c8ca26b0f030250481f9c2b853e4c3a6421e Mon Sep 17 00:00:00 2001 From: JordanLongstaff Date: Sat, 6 Dec 2025 21:42:43 -0500 Subject: [PATCH 13/17] Refactor message start macro --- .../actors/ovl_En_Kendo_Js/z_en_kendo_js.c | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c index 149cbc2afa..93a95faf62 100644 --- a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c +++ b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c @@ -87,9 +87,9 @@ static AnimationInfo sAnimationInfo[ENKENDOJS_ANIM_MAX] = { { &gSwordmasterCoweringAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, }; -#define ENKENDOJS_QUEUE_MSG(thisx, play, textId) \ - Message_StartTextbox(play, textId, &thisx->actor); \ - thisx->curTextId = textId; +#define ENKENDOJS_START_MSG(this, play, textId) \ + Message_StartTextbox(play, textId, &this->actor); \ + this->curTextId = textId; s16 sNonHumanMessages[][3] = { { 0x2731, 0x2732, 0x2733 }, @@ -201,7 +201,7 @@ void EnKendoJs_AwaitTalk(EnKendoJs* this, PlayState* play) { } if (ENKENDOJS_GET_LOCATION(&this->actor) == ENKENDOJS_IN_BACK_ROOM) { - ENKENDOJS_QUEUE_MSG(this, play, 0x273C); + ENKENDOJS_START_MSG(this, play, 0x273C); } else if (GET_PLAYER_FORM != PLAYER_FORM_HUMAN) { switch (GET_PLAYER_FORM) { case PLAYER_FORM_DEKU: @@ -221,14 +221,14 @@ void EnKendoJs_AwaitTalk(EnKendoJs* this, PlayState* play) { break; } - ENKENDOJS_QUEUE_MSG(this, play, sNonHumanMessages[mainIndex][dayIndex]); + ENKENDOJS_START_MSG(this, play, sNonHumanMessages[mainIndex][dayIndex]); } else if ((Player_GetMask(play) != PLAYER_MASK_NONE) && (Player_GetMask(play) < PLAYER_MASK_GIANT)) { u16 maskMessage = Player_GetMask(play) + 0x273C; //! FAKE: if (1) {} - ENKENDOJS_QUEUE_MSG(this, play, maskMessage); + ENKENDOJS_START_MSG(this, play, maskMessage); } else { if (!this->hasSpoken) { this->hasSpoken = true; @@ -236,7 +236,7 @@ void EnKendoJs_AwaitTalk(EnKendoJs* this, PlayState* play) { } else { mainIndex = 1; } - ENKENDOJS_QUEUE_MSG(this, play, sHumanMessages[mainIndex][dayIndex]); + ENKENDOJS_START_MSG(this, play, sHumanMessages[mainIndex][dayIndex]); } EnKendoJs_SetupMessageStateHandler(this); @@ -251,36 +251,36 @@ void EnKendoJs_HandleCourseChoice(EnKendoJs* this, PlayState* play) { case 0: if (GET_CUR_EQUIP_VALUE(EQUIP_TYPE_SWORD) == EQUIP_VALUE_SWORD_NONE) { Audio_PlaySfx(NA_SE_SY_ERROR); - ENKENDOJS_QUEUE_MSG(this, play, 0x272C); + ENKENDOJS_START_MSG(this, play, 0x272C); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, ENKENDOJS_ANIM_FLAILING); } else if (gSaveContext.save.saveInfo.playerData.rupees < play->msgCtx.unk1206C) { Audio_PlaySfx(NA_SE_SY_ERROR); - ENKENDOJS_QUEUE_MSG(this, play, 0x2718); + ENKENDOJS_START_MSG(this, play, 0x2718); } else { Audio_PlaySfx_MessageDecide(); Rupees_ChangeBy(-play->msgCtx.unk1206C); - ENKENDOJS_QUEUE_MSG(this, play, 0x2719); + ENKENDOJS_START_MSG(this, play, 0x2719); } break; case 1: if (GET_CUR_EQUIP_VALUE(EQUIP_TYPE_SWORD) == EQUIP_VALUE_SWORD_NONE) { Audio_PlaySfx(NA_SE_SY_ERROR); - ENKENDOJS_QUEUE_MSG(this, play, 0x272C); + ENKENDOJS_START_MSG(this, play, 0x272C); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, ENKENDOJS_ANIM_FLAILING); } else if (gSaveContext.save.saveInfo.playerData.rupees < play->msgCtx.unk12070) { Audio_PlaySfx(NA_SE_SY_ERROR); - ENKENDOJS_QUEUE_MSG(this, play, 0x2718); + ENKENDOJS_START_MSG(this, play, 0x2718); } else { Audio_PlaySfx_MessageDecide(); Rupees_ChangeBy(-play->msgCtx.unk12070); - ENKENDOJS_QUEUE_MSG(this, play, 0x273A); + ENKENDOJS_START_MSG(this, play, 0x273A); } break; case 2: Audio_PlaySfx_MessageCancel(); - ENKENDOJS_QUEUE_MSG(this, play, 0x2717); + ENKENDOJS_START_MSG(this, play, 0x2717); break; default: @@ -303,7 +303,7 @@ void EnKendoJs_HandleEvents(EnKendoJs* this, PlayState* play) { case 0x2713: case 0x2714: case 0x2715: - ENKENDOJS_QUEUE_MSG(this, play, 0x2716); + ENKENDOJS_START_MSG(this, play, 0x2716); break; case 0x2719: @@ -318,7 +318,7 @@ void EnKendoJs_HandleEvents(EnKendoJs* this, PlayState* play) { break; case 0x273A: - ENKENDOJS_QUEUE_MSG(this, play, 0x273B); + ENKENDOJS_START_MSG(this, play, 0x273B); break; case 0x273B: @@ -480,12 +480,12 @@ s32 EnKendoJs_GetNoviceCourseActionResult(EnKendoJs* this, PlayState* play) { } void EnKendoJs_NoviceCourseProgress(EnKendoJs* this, PlayState* play) { - ENKENDOJS_QUEUE_MSG(this, play, sNoviceCourseProgressMessages[this->minigameRound]); + ENKENDOJS_START_MSG(this, play, sNoviceCourseProgressMessages[this->minigameRound]); this->minigameRound++; } void EnKendoJs_NoviceCourseTryAgain(EnKendoJs* this, PlayState* play) { - ENKENDOJS_QUEUE_MSG(this, play, sNoviceCourseTryAgainMessages[this->minigameRound]); + ENKENDOJS_START_MSG(this, play, sNoviceCourseTryAgainMessages[this->minigameRound]); } s32 EnKendoJs_HasMoreAdviceToTryAgain(EnKendoJs* this, PlayState* play) { @@ -494,14 +494,14 @@ s32 EnKendoJs_HasMoreAdviceToTryAgain(EnKendoJs* this, PlayState* play) { switch (this->curTextId) { case 0x271D: if (Player_GetMeleeWeaponHeld(player) != PLAYER_MELEEWEAPON_NONE) { - ENKENDOJS_QUEUE_MSG(this, play, 0x272A); + ENKENDOJS_START_MSG(this, play, 0x272A); return true; } break; case 0x2721: if (this->isPlayerLockedOn) { - ENKENDOJS_QUEUE_MSG(this, play, 0x272B); + ENKENDOJS_START_MSG(this, play, 0x272B); return true; } break; @@ -528,7 +528,7 @@ void EnKendoJs_MovePlayerToStartNoviceCourse(EnKendoJs* this, PlayState* play) { this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; player->stateFlags1 &= ~PLAYER_STATE1_20; EnKendoJs_SpawnLog(this, play, 0); - ENKENDOJS_QUEUE_MSG(this, play, 0x271A); + ENKENDOJS_START_MSG(this, play, 0x271A); EnKendoJs_SetupMessageStateHandler(this); } else { Actor_OfferTalk(&this->actor, play, 800.0f); @@ -576,7 +576,7 @@ void EnKendoJs_NoviceCourse(EnKendoJs* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_SY_ERROR); this->courseState = ENKENDOJS_COURSE_PAUSED; player->stateFlags1 |= PLAYER_STATE1_20; - ENKENDOJS_QUEUE_MSG(this, play, 0x2729); + ENKENDOJS_START_MSG(this, play, 0x2729); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, ENKENDOJS_ANIM_FLAILING); break; @@ -630,9 +630,9 @@ void EnKendoJs_ExpertCourse(EnKendoJs* this, PlayState* play) { if (this->timer >= 140) { if (this->minigameRound == 5) { if (gSaveContext.minigameScore == 30) { - ENKENDOJS_QUEUE_MSG(this, play, 0x272D); + ENKENDOJS_START_MSG(this, play, 0x272D); } else { - ENKENDOJS_QUEUE_MSG(this, play, 0x272E); + ENKENDOJS_START_MSG(this, play, 0x272E); } player->stateFlags1 |= PLAYER_STATE1_20; CLEAR_WEEKEVENTREG(WEEKEVENTREG_PLAYING_SWORDSMAN_MINIGAME); @@ -695,9 +695,9 @@ void EnKendoJs_AwaitFinalMessage(EnKendoJs* this, PlayState* play) { if (Actor_TalkOfferAccepted(&this->actor, &play->state)) { if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_SWORDSMANS_SCHOOL_HEART_PIECE)) { SET_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_SWORDSMANS_SCHOOL_HEART_PIECE); - ENKENDOJS_QUEUE_MSG(this, play, 0x272F); + ENKENDOJS_START_MSG(this, play, 0x272F); } else { - ENKENDOJS_QUEUE_MSG(this, play, 0x2730); + ENKENDOJS_START_MSG(this, play, 0x2730); } EnKendoJs_SetupMessageStateHandler(this); player->stateFlags1 &= ~PLAYER_STATE1_20; From 4133fd90eae703ec3f83753df4093220e381b3df Mon Sep 17 00:00:00 2001 From: JordanLongstaff Date: Sat, 6 Dec 2025 21:43:36 -0500 Subject: [PATCH 14/17] Rename text ID arrays --- .../actors/ovl_En_Kendo_Js/z_en_kendo_js.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c index 93a95faf62..57faee5f48 100644 --- a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c +++ b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c @@ -91,22 +91,22 @@ static AnimationInfo sAnimationInfo[ENKENDOJS_ANIM_MAX] = { Message_StartTextbox(play, textId, &this->actor); \ this->curTextId = textId; -s16 sNonHumanMessages[][3] = { +s16 sNonHumanTextIds[][3] = { { 0x2731, 0x2732, 0x2733 }, { 0x2734, 0x2735, 0x2736 }, { 0x2737, 0x2738, 0x2739 }, }; -s16 sHumanMessages[][3] = { +s16 sHumanTextIds[][3] = { { 0x2710, 0x2712, 0x2714 }, { 0x2711, 0x2713, 0x2715 }, }; -s16 sNoviceCourseProgressMessages[] = { +s16 sNoviceCourseProgressTextIds[] = { 0x271C, 0x271E, 0x2720, 0x2722, 0x2724, 0x2726, 0x2728, }; -s16 sNoviceCourseTryAgainMessages[] = { +s16 sNoviceCourseTryAgainTextIds[] = { 0x271B, 0x271D, 0x271F, 0x2721, 0x2723, 0x2725, 0x2727, }; @@ -221,7 +221,7 @@ void EnKendoJs_AwaitTalk(EnKendoJs* this, PlayState* play) { break; } - ENKENDOJS_START_MSG(this, play, sNonHumanMessages[mainIndex][dayIndex]); + ENKENDOJS_START_MSG(this, play, sNonHumanTextIds[mainIndex][dayIndex]); } else if ((Player_GetMask(play) != PLAYER_MASK_NONE) && (Player_GetMask(play) < PLAYER_MASK_GIANT)) { u16 maskMessage = Player_GetMask(play) + 0x273C; @@ -236,7 +236,7 @@ void EnKendoJs_AwaitTalk(EnKendoJs* this, PlayState* play) { } else { mainIndex = 1; } - ENKENDOJS_START_MSG(this, play, sHumanMessages[mainIndex][dayIndex]); + ENKENDOJS_START_MSG(this, play, sHumanTextIds[mainIndex][dayIndex]); } EnKendoJs_SetupMessageStateHandler(this); @@ -480,12 +480,12 @@ s32 EnKendoJs_GetNoviceCourseActionResult(EnKendoJs* this, PlayState* play) { } void EnKendoJs_NoviceCourseProgress(EnKendoJs* this, PlayState* play) { - ENKENDOJS_START_MSG(this, play, sNoviceCourseProgressMessages[this->minigameRound]); + ENKENDOJS_START_MSG(this, play, sNoviceCourseProgressTextIds[this->minigameRound]); this->minigameRound++; } void EnKendoJs_NoviceCourseTryAgain(EnKendoJs* this, PlayState* play) { - ENKENDOJS_START_MSG(this, play, sNoviceCourseTryAgainMessages[this->minigameRound]); + ENKENDOJS_START_MSG(this, play, sNoviceCourseTryAgainTextIds[this->minigameRound]); } s32 EnKendoJs_HasMoreAdviceToTryAgain(EnKendoJs* this, PlayState* play) { From 6a21225be3179524c3bd8b1bd38dea756fbd249b Mon Sep 17 00:00:00 2001 From: JordanLongstaff Date: Sat, 6 Dec 2025 21:46:11 -0500 Subject: [PATCH 15/17] Use boolean values for isRetracting --- src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c | 2 +- src/overlays/actors/ovl_En_Maruta/z_en_maruta.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c index 57faee5f48..83387f14c6 100644 --- a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c +++ b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c @@ -767,7 +767,7 @@ void EnKendoJs_RetractLogs(EnKendoJs* this, PlayState* play) { while (actor != NULL) { if (actor->id == ACTOR_EN_MARUTA) { - ((EnMaruta*)actor)->isRetracting = 1; + ((EnMaruta*)actor)->isRetracting = true; } actor = actor->next; } diff --git a/src/overlays/actors/ovl_En_Maruta/z_en_maruta.c b/src/overlays/actors/ovl_En_Maruta/z_en_maruta.c index 11f804e973..4be8258d1a 100644 --- a/src/overlays/actors/ovl_En_Maruta/z_en_maruta.c +++ b/src/overlays/actors/ovl_En_Maruta/z_en_maruta.c @@ -236,7 +236,7 @@ void EnMaruta_Init(Actor* thisx, PlayState* play) { } this->unk_214 = -1; - this->isRetracting = 0; + this->isRetracting = false; if (this->unk_210 == 0) { Collider_InitCylinder(play, &this->collider); @@ -276,7 +276,7 @@ void func_80B372CC(EnMaruta* this, PlayState* play) { this->actor.shape.rot.y -= 0x2AAA; } - if (this->isRetracting == 1) { + if (this->isRetracting == true) { EnMaruta_StartRetracting(this); } From a7442cd4d9c37465c0b96aceb2b230f41d992f60 Mon Sep 17 00:00:00 2001 From: JordanLongstaff Date: Tue, 9 Dec 2025 12:16:39 -0500 Subject: [PATCH 16/17] Remove statement added by faulty merge --- src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c index e966f14d8c..e4fe06457a 100644 --- a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c +++ b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c @@ -253,7 +253,6 @@ void EnKendoJs_HandleCourseChoice(EnKendoJs* this, PlayState* play) { Audio_PlaySfx(NA_SE_SY_ERROR); ENKENDOJS_START_MSG(this, play, 0x272C); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, ENKENDOJS_ANIM_FLAILING); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, ENKENDOJS_ANIM_2); } else if (gSaveContext.save.saveInfo.playerData.rupees < play->msgCtx.firstChoicePrice) { Audio_PlaySfx(NA_SE_SY_ERROR); ENKENDOJS_START_MSG(this, play, 0x2718); From 58f3a25664cc533fe5a3c3e626b1710698fe75b0 Mon Sep 17 00:00:00 2001 From: JordanLongstaff Date: Thu, 11 Dec 2025 09:50:46 -0500 Subject: [PATCH 17/17] Rename message handler functions --- src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c index e4fe06457a..85698205d1 100644 --- a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c +++ b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c @@ -245,7 +245,7 @@ void EnKendoJs_AwaitTalk(EnKendoJs* this, PlayState* play) { } } -void EnKendoJs_HandleCourseChoice(EnKendoJs* this, PlayState* play) { +void EnKendoJs_HandleMessageChoices(EnKendoJs* this, PlayState* play) { if (Message_ShouldAdvance(play) && (this->curTextId == 0x2716)) { switch (play->msgCtx.choiceIndex) { case 0: @@ -289,7 +289,7 @@ void EnKendoJs_HandleCourseChoice(EnKendoJs* this, PlayState* play) { } } -void EnKendoJs_HandleEvents(EnKendoJs* this, PlayState* play) { +void EnKendoJs_HandleMessageEvents(EnKendoJs* this, PlayState* play) { Player* player = GET_PLAYER(play); if (!Message_ShouldAdvance(play)) { @@ -349,11 +349,11 @@ void EnKendoJs_HandleMessageState(EnKendoJs* this, PlayState* play) { switch (Message_GetState(&play->msgCtx)) { case TEXT_STATE_CHOICE: - EnKendoJs_HandleCourseChoice(this, play); + EnKendoJs_HandleMessageChoices(this, play); break; case TEXT_STATE_EVENT: - EnKendoJs_HandleEvents(this, play); + EnKendoJs_HandleMessageEvents(this, play); break; case TEXT_STATE_DONE: