From aa477e7ad06389d85be87e8c9328d0a6b7f6a38b Mon Sep 17 00:00:00 2001 From: Catobat <69204835+Catobat@users.noreply.github.com> Date: Thu, 27 Apr 2023 02:29:50 +0200 Subject: [PATCH] Gold Kinstone Fusion names --- data/scripts/unused/script_08016384.inc | 2 +- data/scripts/unused/script_08016482.inc | 2 +- ...pt_MinishVillageObjectLeftStoneOpening.inc | 2 +- ...t_MinishVillageObjectRightStoneOpening.inc | 2 +- .../veilFalls/script_NPC4ESourceOfTheFlow.inc | 6 +++--- include/kinstone.h | 17 +++++++++------ src/kinstone.c | 2 +- src/npc/npc4E.c | 21 ++++++++++--------- 8 files changed, 30 insertions(+), 24 deletions(-) diff --git a/data/scripts/unused/script_08016384.inc b/data/scripts/unused/script_08016384.inc index b1975a48..0a5eeacf 100644 --- a/data/scripts/unused/script_08016384.inc +++ b/data/scripts/unused/script_08016384.inc @@ -27,7 +27,7 @@ SCRIPT_START script_08016384 FacePlayerAndCheckDist HasRupees 200 CheckTextboxResult - CheckKinstoneFused KINSTONE_1 + CheckKinstoneFused KINSTONE_MYSTERIOUS_CLOUD_TOP_RIGHT BuyItem ITEM_BOMBS10, 0x0000 CheckBottleContaining ITEM_BOTTLE_EMPTY VariableBitSet 0x00000000 diff --git a/data/scripts/unused/script_08016482.inc b/data/scripts/unused/script_08016482.inc index be00febe..70f9b944 100644 --- a/data/scripts/unused/script_08016482.inc +++ b/data/scripts/unused/script_08016482.inc @@ -28,7 +28,7 @@ SCRIPT_START script_08016482 _0807E9D4 _0807E9DC _0807E9E4 0x0000 - _0807EA88 0x0001 + _0807EA88 KINSTONE_MYSTERIOUS_CLOUD_TOP_RIGHT WaitUntilTextboxCloses MessageFromTarget TEXT_LOCATIONS, 0x01 MessageNoOverlap 0x0601 diff --git a/data/scripts/veilFalls/script_MinishVillageObjectLeftStoneOpening.inc b/data/scripts/veilFalls/script_MinishVillageObjectLeftStoneOpening.inc index 3d552cdb..3f5ac7fb 100644 --- a/data/scripts/veilFalls/script_MinishVillageObjectLeftStoneOpening.inc +++ b/data/scripts/veilFalls/script_MinishVillageObjectLeftStoneOpening.inc @@ -1,7 +1,7 @@ @ Waterfalls MINISH_VILLAGE_OBJECT during kinstone cutscene? SCRIPT_START script_MinishVillageObjectLeftStoneOpening BeginBlock - CheckKinstoneFused KINSTONE_9 + CheckKinstoneFused KINSTONE_SOURCE_FLOW JumpIf script_MinishVillageObjectLeftStone EndBlock WaitForSyncFlagAndClear 0x00000001 diff --git a/data/scripts/veilFalls/script_MinishVillageObjectRightStoneOpening.inc b/data/scripts/veilFalls/script_MinishVillageObjectRightStoneOpening.inc index f5194dff..76ea1d57 100644 --- a/data/scripts/veilFalls/script_MinishVillageObjectRightStoneOpening.inc +++ b/data/scripts/veilFalls/script_MinishVillageObjectRightStoneOpening.inc @@ -1,7 +1,7 @@ @ Waterfalls MINISH_VILLAGE_OBJECT during kinstone cutscene? SCRIPT_START script_MinishVillageObjectRightStoneOpening BeginBlock - CheckKinstoneFused KINSTONE_9 + CheckKinstoneFused KINSTONE_SOURCE_FLOW JumpIf script_MinishVillageObjectRightStone EndBlock WaitForSyncFlagAndClear 0x00000002 diff --git a/data/scripts/veilFalls/script_NPC4ESourceOfTheFlow.inc b/data/scripts/veilFalls/script_NPC4ESourceOfTheFlow.inc index 6bac4d40..efda3b1e 100644 --- a/data/scripts/veilFalls/script_NPC4ESourceOfTheFlow.inc +++ b/data/scripts/veilFalls/script_NPC4ESourceOfTheFlow.inc @@ -2,9 +2,9 @@ SCRIPT_START script_NPC4ESourceOfTheFlow BeginBlock Call sub_0806DB84 - CheckKinstoneFused KINSTONE_9 + CheckKinstoneFused KINSTONE_SOURCE_FLOW JumpIf script_08016028 - _0807EA88 0x0009 + _0807EA88 KINSTONE_SOURCE_FLOW CallWithArg sub_0806DA04, 0x00000007 DoPostScriptAction 0x000a EndBlock @@ -12,7 +12,7 @@ script_08015FE4: _0807EA4C _0807E9F0 SetPlayerIdle - CheckKinstoneFused KINSTONE_9 + CheckKinstoneFused KINSTONE_SOURCE_FLOW JumpIf script_08015FFE Call EnablePauseMenu EnablePlayerControl diff --git a/include/kinstone.h b/include/kinstone.h index a5c20d44..e05c815e 100644 --- a/include/kinstone.h +++ b/include/kinstone.h @@ -36,15 +36,15 @@ extern const KinstoneWorldEvent gKinstoneWorldEvents[]; typedef enum { KINSTONE_0, - KINSTONE_1, - KINSTONE_2, - KINSTONE_3, - KINSTONE_4, - KINSTONE_5, + KINSTONE_MYSTERIOUS_CLOUD_TOP_RIGHT, + KINSTONE_MYSTERIOUS_CLOUD_BOTTOM_LEFT, + KINSTONE_MYSTERIOUS_CLOUD_TOP_LEFT, + KINSTONE_MYSTERIOUS_CLOUD_MIDDLE, + KINSTONE_MYSTERIOUS_CLOUD_BOTTOM_RIGHT, KINSTONE_CASTOR_WILDS_STATUE_LEFT, KINSTONE_CASTOR_WILDS_STATUE_MIDDLE, KINSTONE_CASTOR_WILDS_STATUE_RIGHT, - KINSTONE_9, + KINSTONE_SOURCE_FLOW, KINSTONE_A, KINSTONE_B, KINSTONE_C, @@ -131,6 +131,11 @@ typedef enum { KINSTONE_5D, KINSTONE_5E, KINSTONE_5F, + KINSTONE_60, + KINSTONE_61, + KINSTONE_62, + KINSTONE_63, + KINSTONE_64, } KinstoneId; typedef struct { diff --git a/src/kinstone.c b/src/kinstone.c index 1be80aa3..e6b8f054 100644 --- a/src/kinstone.c +++ b/src/kinstone.c @@ -110,7 +110,7 @@ const struct_gUnk_080B3D20 gUnk_080B3D20[] = { { CHECK_ITEM, ITEM_BLUE_SWORD, 4, 1 }, { LOCAL_BANK_3, LV4_HAKA_08_CAP_0, 4, 2 }, { LOCAL_BANK_3, OUBO_KAKERA, 4, 3 }, - { CHECK_KINSTONE, KINSTONE_9, 4, 4 }, + { CHECK_KINSTONE, KINSTONE_SOURCE_FLOW, 4, 4 }, { LOCAL_BANK_0, TATSUMAKI, 4, 5 }, { LOCAL_BANK_2, SORA_YAKATA_ENTER, 4, 6 }, { LOCAL_BANK_2, SORA_CHIEF_TALK, 4, 7 }, diff --git a/src/npc/npc4E.c b/src/npc/npc4E.c index 42c3b02d..8baf84d3 100644 --- a/src/npc/npc4E.c +++ b/src/npc/npc4E.c @@ -4,6 +4,7 @@ #include "game.h" #include "hitbox.h" #include "item.h" +#include "kinstone.h" #include "npc.h" #include "object.h" #include "save.h" @@ -53,30 +54,30 @@ void NPC4E_DoScreenTransition(Entity* this, ScriptExecutionContext* context) { } // Returns the kinstone id? -u8 sub_0806DA3C(Entity* this) { +u8 NPC4E_GetKinstoneId(Entity* this) { u32 result; switch (this->type) { default: - result = 0; + result = KINSTONE_0; break; case 1: - result = 1; + result = KINSTONE_MYSTERIOUS_CLOUD_TOP_RIGHT; break; case 2: - result = 2; + result = KINSTONE_MYSTERIOUS_CLOUD_BOTTOM_LEFT; break; case 3: - result = 3; + result = KINSTONE_MYSTERIOUS_CLOUD_TOP_LEFT; break; case 4: - result = 4; + result = KINSTONE_MYSTERIOUS_CLOUD_MIDDLE; break; case 5: - result = 5; + result = KINSTONE_MYSTERIOUS_CLOUD_BOTTOM_RIGHT; break; case 11: - result = 9; + result = KINSTONE_SOURCE_FLOW; break; case 6: case 7: @@ -91,13 +92,13 @@ u8 sub_0806DA3C(Entity* this) { // Check whether a kinstone fusion is possible and store the result somewhere in param_2? void sub_0806DAAC(Entity* this, ScriptExecutionContext* context) { - context->condition = CheckKinstoneFused(sub_0806DA3C(this)); + context->condition = CheckKinstoneFused(NPC4E_GetKinstoneId(this)); gActiveScriptInfo.flags |= 1; } // maybe actually execute the kinstone fusion? void sub_0806DAD0(Entity* this) { - sub_08078790(this, sub_0806DA3C(this)); + sub_08078790(this, NPC4E_GetKinstoneId(this)); } void sub_0806DAE8(Entity* this) {