rework some locations to modify flow nodes instead

This commit is contained in:
gymnast86
2026-08-03 13:25:43 -07:00
parent 8220f2b8e9
commit 3ccfe81914
28 changed files with 315 additions and 319 deletions
-10
View File
@@ -15,10 +15,6 @@
#include "d/actor/d_a_horse.h"
#include "Z2AudioLib/Z2Instances.h"
#if TARGET_PC
#include "dusk/randomizer/game/randomizer_context.hpp"
#endif
#if DEBUG
#include "JSystem/JHostIO/JORFile.h"
#include "d/d_debug_viewer.h"
@@ -1749,12 +1745,6 @@ int daNpc_Aru_c::cutSpeakTo(int i_staffID) {
switch (eventId) {
case 1:
if (mItemPartnerId == fpcM_ERROR_PROCESS_ID_e) {
#if TARGET_PC
if (randomizer_IsActive()) {
itemNo = randomizer_getItemAtLocation("Herding Goats Reward");
randomizer_setTempFlagForLocation("Herding Goats Reward");
}
#endif
mItemPartnerId = fopAcM_createItemForPresentDemo(&current.pos, itemNo, 0, -1, -1, NULL, NULL);
}
-11
View File
@@ -10,11 +10,6 @@
#include "JSystem/J3DGraphBase/J3DMaterial.h"
#include <cstring>
#if TARGET_PC
#include "dusk/randomizer/game/randomizer_context.hpp"
#include "dusk/randomizer/game/verify_item_functions.h"
#endif
DUSK_GAME_DATA const daNpcAshB_HIOParam daNpcAshB_Param_c::m = {
205.0f, // attention_offset
-3.0f, // gravity
@@ -1006,12 +1001,6 @@ BOOL daNpcAshB_c::EvCut_Appear(int i_staffID) {
case '0008':
local_30[0] = 0;
if (mFlow.getEventId(local_30) == 1) {
#if TARGET_PC
if (randomizer_IsActive()) {
local_30[0] = verifyProgressiveItem(randomizer_getItemAtLocation("Ashei Sketch"));
randomizer_setTempFlagForLocation("Ashei Sketch");
}
#endif
mItemPartnerId =
fopAcM_createItemForPresentDemo(&current.pos, local_30[0], 0, -1, -1, 0, 0);
dComIfGp_event_setItemPartnerId(mItemPartnerId);
-15
View File
@@ -11,10 +11,6 @@
#include "d/d_meter2_info.h"
#include "d/d_timer.h"
#if TARGET_PC
#include "dusk/randomizer/game/randomizer_context.hpp"
#endif
enum Event {
EVT_NONE,
EVT_GAME_START,
@@ -1808,17 +1804,6 @@ int daNpcChin_c::_Evt_GameSucceed_CutMain(const int& param_0) {
itemId1 = 0;
}
#if TARGET_PC
if (randomizer_IsActive()) {
if (itemId1 == dItemNo_ARROW_LV2_e) {
itemId1 = randomizer_getItemAtLocation("STAR Prize 1");
randomizer_setTempFlagForLocation("STAR Prize 1");
} else if (itemId1 == dItemNo_ARROW_LV3_e) {
itemId1 = randomizer_getItemAtLocation("STAR Prize 2");
randomizer_setTempFlagForLocation("STAR Prize 2");
}
}
#endif
fpc_ProcID itemId2 = fopAcM_createItemForPresentDemo(&current.pos, itemId1, 0, -1, -1,
0, 0);
if (itemId2 != -1) {
-9
View File
@@ -13,7 +13,6 @@
#if TARGET_PC
#include "dusk/randomizer/game/randomizer_context.hpp"
#include "dusk/randomizer/game/verify_item_functions.h"
#endif
enum fairy_RES_File_ID {
@@ -1338,14 +1337,6 @@ void daNpc_Fairy_c::PresentDemoCall() {
item_no = 0;
}
#if TARGET_PC
// If we haven't visted this great fairy before, give the random item
if (randomizer_IsActive() && !daNpcT_chkEvtBit(505)) {
item_no = verifyProgressiveItem(randomizer_getItemAtLocation("Cave of Ordeals Great Fairy Reward"));
randomizer_setTempFlagForLocation("Cave of Ordeals Great Fairy Reward");
}
#endif
fpc_ProcID id = fopAcM_createItemForPresentDemo(&current.pos, item_no, 0, -1, -1, NULL, NULL);
if (id != fpcM_ERROR_PROCESS_ID_e) {
dComIfGp_event_setItemPartnerId(id);
-13
View File
@@ -14,11 +14,6 @@
#include "Z2AudioLib/Z2Instances.h"
#include <cstring>
#if TARGET_PC
#include "dusk/randomizer/game/randomizer_context.hpp"
#include "dusk/randomizer/game/verify_item_functions.h"
#endif
DUSK_GAME_DATA const daNpc_grA_HIOParam daNpc_grA_Param_c::m = {
{90.0f, -4.0f, 1.0f, 850.0f, 255.0f, 280.0f, 40.0f, 100.0f, 0.0f, 0.0f, 20.0f,
-20.0f, 40.0f, -30.0f, 40.0f, -40.0f, 0.4f, 12.0f, 4, 6, 6, 6,
@@ -4023,14 +4018,6 @@ BOOL daNpc_grA_c::talk(void*) {
}
if (r26 && talkProc(NULL, TRUE, NULL)) {
if (mFlow.getEventId(&sp8) == 1) {
#if TARGET_PC
if (randomizer_IsActive()) {
// Give the randomized underwater goron item
if (sp8 == dItemNo_Randomizer_BOMB_IN_BAG_e) {
sp8 = verifyProgressiveItem(randomizer_getItemAtLocation("Zoras Domain Underwater Goron"));
}
}
#endif
field_0x1480 =
fopAcM_createItemForPresentDemo(&current.pos, sp8, 0, -1, -1, NULL, NULL);
if (field_0x1480 != fpcM_ERROR_PROCESS_ID_e) {
-11
View File
@@ -13,11 +13,6 @@
#include "Z2AudioLib/Z2Instances.h"
#include <cstring>
#if TARGET_PC
#include "dusk/randomizer/game/randomizer_context.hpp"
#include "dusk/randomizer/game/verify_item_functions.h"
#endif
enum grO_RES_File_ID {
/* BCK */
/* 0x07 */ BCK_GRO_F_TALK_A = 0x7,
@@ -1686,12 +1681,6 @@ int daNpc_grO_c::talk(void* param_1) {
if (facePlayerFlag && talkProc(NULL, TRUE, NULL)) {
if (mType == TYPE_MINES) {
if (mFlow.getEventId(&itemId) == 1) {
#if TARGET_PC
if (randomizer_IsActive()) {
itemId = verifyProgressiveItem(randomizer_getItemAtLocation("Goron Mines Gor Ebizo Key Shard"));
randomizer_setTempFlagForLocation("Goron Mines Gor Ebizo Key Shard");
}
#endif
mItemID = fopAcM_createItemForPresentDemo(&current.pos, itemId, 0, -1, -1, NULL, NULL);
if (mItemID != fpcM_ERROR_PROCESS_ID_e) {
s16 eventIdx = dComIfGp_getEventManager().getEventIdx(this, "DEFAULT_GETITEM", 0xFF);
-11
View File
@@ -10,11 +10,6 @@
#include "Z2AudioLib/Z2Instances.h"
#include <cstring>
#if TARGET_PC
#include "dusk/randomizer/game/randomizer_context.hpp"
#include "dusk/randomizer/game/verify_item_functions.h"
#endif
enum grR_RES_File_ID {
/* BCK */
/* 0x06 */ BCK_GRR_AGURA_GETUP = 0x6,
@@ -1343,12 +1338,6 @@ int daNpc_grR_c::talk(void* param_1) {
if (bVar1 && talkProc(NULL, TRUE, NULL)) {
if (mType == TYPE_0) {
if (mFlow.getEventId(&i_itemNo) == 1) {
#if TARGET_PC
if (randomizer_IsActive()) {
i_itemNo = verifyProgressiveItem(randomizer_getItemAtLocation("Goron Mines Gor Liggs Key Shard"));
randomizer_setTempFlagForLocation("Goron Mines Gor Liggs Key Shard");
}
#endif
mItemID = fopAcM_createItemForPresentDemo(&current.pos, i_itemNo, 0, -1, -1, NULL, NULL);
if (mItemID != fpcM_ERROR_PROCESS_ID_e) {
-10
View File
@@ -11,10 +11,6 @@
#include "Z2AudioLib/Z2Instances.h"
#include <cstring>
#if TARGET_PC
#include "dusk/randomizer/game/randomizer_context.hpp"
#include "dusk/randomizer/game/verify_item_functions.h"
#endif
enum Event_Cut_Nums {
NUM_EVT_CUTS_e = 2,
};
@@ -1194,12 +1190,6 @@ int daNpc_grS_c::talk(void* param_0) {
if (unkFlag1 && talkProc(NULL, 1, NULL)) {
if (mType == 0) {
if (mFlow.getEventId(&unkInt2) == 1) {
#if TARGET_PC
if (randomizer_IsActive()) {
unkInt2 = verifyProgressiveItem(randomizer_getItemAtLocation("Goron Mines Gor Amato Key Shard"));
randomizer_setTempFlagForLocation("Goron Mines Gor Amato Key Shard");
}
#endif
mPresentItemId =
fopAcM_createItemForPresentDemo(&current.pos, unkInt2, 0, -1, -1, 0, 0);
-17
View File
@@ -9,11 +9,6 @@
#include "d/actor/d_a_npc.h"
#include <cstring>
#if TARGET_PC
#include "dusk/randomizer/game/randomizer_context.hpp"
#include "dusk/randomizer/game/verify_item_functions.h"
#endif
DUSK_GAME_DATA daNpcImpal_HIOParam const daNpcImpal_Param_c::m = {
135.0f, // attention_offset
-3.0f, // gravity
@@ -976,12 +971,6 @@ BOOL daNpcImpal_c::EvCut_ImpalAppear1(int i_cut_index) {
if (talkProc(NULL, 1, NULL)) {
int evt_id = 0;
if (mFlow.getEventId(&evt_id) == 1) {
#if TARGET_PC
if (randomizer_IsActive()) {
evt_id = verifyProgressiveItem(randomizer_getItemAtLocation("Ilia Charm"));
randomizer_setTempFlagForLocation("Ilia Charm");
}
#endif
mItemPartnerId =
fopAcM_createItemForPresentDemo(&current.pos, evt_id, 0, -1, -1, 0, 0);
if (mItemPartnerId != 0xffffffff) {
@@ -1071,12 +1060,6 @@ BOOL daNpcImpal_c::EvCut_CopyRod(int i_cut_index) {
case '0003':
int evt_id = 0;
if (mFlow.getEventId(&evt_id) == 1) {
#if TARGET_PC
if (randomizer_IsActive()) {
evt_id = verifyProgressiveItem(randomizer_getItemAtLocation("Skybook From Impaz"));
randomizer_setTempFlagForLocation("Skybook From Impaz");
}
#endif
mItemPartnerId =
fopAcM_createItemForPresentDemo(&current.pos, evt_id, 0, -1, -1, 0, 0);
dComIfGp_event_setItemPartnerId(mItemPartnerId);
-15
View File
@@ -9,11 +9,6 @@
#include "d/actor/d_a_e_ym.h"
#include <cstring>
#if TARGET_PC
#include "dusk/randomizer/game/randomizer_context.hpp"
#include "dusk/randomizer/game/verify_item_functions.h"
#endif
static DUSK_CONSTEXPR int l_bmdData[2][2] = {
{35, 1},
{18, 2},
@@ -1186,16 +1181,6 @@ int daNpc_Kkri_c::talk(void*) {
switch (eventId) {
case 1:
if (mItemPartnerId == fpcM_ERROR_PROCESS_ID_e) {
#if TARGET_PC
if (randomizer_IsActive()) {
if (item_no == dItemNo_OIL_BOTTLE3_e) {
item_no = verifyProgressiveItem(randomizer_getItemAtLocation("Coro Bottle"));
randomizer_setTempFlagForLocation("Coro Bottle");
} /*else if (item_no == dItemNo_SMALL_KEY_e) { // Might be Small Key 2
item_no = verifyProgressiveItem(randomizer_getItemAtLocation("Coro Gate Key"));
}*/
}
#endif
mItemPartnerId = fopAcM_createItemForPresentDemo(&current.pos, item_no, 0, -1, -1, NULL, NULL);
}
-11
View File
@@ -9,11 +9,6 @@
#include "d/actor/d_a_tag_push.h"
#include <cstring>
#if TARGET_PC
#include "dusk/randomizer/game/randomizer_context.hpp"
#include "dusk/randomizer/game/verify_item_functions.h"
#endif
enum Type {
/* 0x0 */ TYPE_0,
/* 0x1 */ TYPE_1,
@@ -1241,12 +1236,6 @@ int daNpc_Len_c::talk(void* param_0) {
switch (evt_id) {
case 1:
if (mItemPartnerId == -1) {
#if TARGET_PC
if (randomizer_IsActive()) {
local_18 = verifyProgressiveItem(randomizer_getItemAtLocation("Renados Letter"));
randomizer_setTempFlagForLocation("Renados Letter");
}
#endif
mItemPartnerId = fopAcM_createItemForPresentDemo(&current.pos, local_18,
0, -1, -1, 0, 0);
}
+1 -9
View File
@@ -17,10 +17,7 @@
#include "d/d_com_static.h"
#include "d/d_item.h"
#include "d/d_timer.h"
#if TARGET_PC
#include "dusk/randomizer/game/randomizer_context.hpp"
#include "dusk/randomizer/game/verify_item_functions.h"
#endif
#if DEBUG
#include "d/d_debug_viewer.h"
#include <cstring>
@@ -2397,11 +2394,6 @@ int daNpc_Maro_c::cutArrowTutorial(int arg0) {
switch (evt_ret) {
case 1: {
if (mItemPartnerId == -1) {
#if TARGET_PC
if (randomizer_IsActive()) {
evt_id = verifyProgressiveItem(randomizer_getItemAtLocation("Talo Sharpshooting"));
}
#endif
mItemPartnerId = fopAcM_createItemForPresentDemo(&current.pos, evt_id, 0, -1, -1, NULL, NULL);
}
-11
View File
@@ -11,11 +11,6 @@
#include "Z2AudioLib/Z2Instances.h"
#include <cstring>
#if TARGET_PC
#include "dusk/randomizer/game/randomizer_context.hpp"
#include "dusk/randomizer/game/verify_item_functions.h"
#endif
enum {
NUM_EVT_CUTS_e = 5,
};
@@ -1196,12 +1191,6 @@ int daNpc_myna2_c::ECut_gameGoalSuccess(int i_staffId) {
case 20: {
int itemNo = 0;
if (mFlow.getEventId(&itemNo) == 1) {
#if TARGET_PC
// If plumm tries giving us the heart piece, give the randomized item instead
if (randomizer_IsActive() && itemNo == dItemNo_KAKERA_HEART_e) {
itemNo = verifyProgressiveItem(randomizer_getItemAtLocation("Plumm Fruit Balloon Minigame"));
}
#endif
mItemPid = fopAcM_createItemForPresentDemo(&current.pos, itemNo, 0, -1, -1, NULL, NULL);
}
break;
+1 -19
View File
@@ -8,12 +8,6 @@
#include "d/actor/d_a_npc_pouya.h"
#include <cstring>
#if TARGET_PC
#include "dusk/randomizer/game/flags.h"
#include "dusk/randomizer/game/randomizer_context.hpp"
#include "dusk/randomizer/game/verify_item_functions.h"
#endif
DUSK_GAME_DATA const daNpc_Pouya_HIOParam daNpc_Pouya_Param_c::m = {
120.0f, // attention_offset
-3.0f, // gravity
@@ -560,8 +554,7 @@ BOOL daNpc_Pouya_c::checkChangeEvt() {
evtChange();
return TRUE;
}
// In randomizer, only get the 60 reward if we've already gotten the 20 reward
if (dComIfGs_getPohSpiritNum() >= 60 IF_DUSK(&& randomizer_IsActive() && dComIfGs_isEventBit(GOT_BOTTLE_FROM_JOVANI))) {
if (dComIfGs_getPohSpiritNum() >= 60) {
/* dSv_event_flag_c::F_0458 - Coversation with Jovani after collecting 60 ghosts
*/
if (!daNpcT_chkEvtBit(0x1CA)) {
@@ -965,17 +958,6 @@ int daNpc_Pouya_c::cutHaveFavorToAsk(int param_0) {
switch (evt_id) {
case 1:
if (mItemPartnerId == fpcM_ERROR_PROCESS_ID_e) {
#if TARGET_PC
if (randomizer_IsActive()) {
if (local_64 == dItemNo_Randomizer_DROP_BOTTLE_e) {
local_64 = verifyProgressiveItem(randomizer_getItemAtLocation("Jovani 20 Poe Soul Reward"));
randomizer_setTempFlagForLocation("Jovani 20 Poe Soul Reward");
} else if (local_64 == dItemNo_Randomizer_SILVER_RUPEE_e) {
local_64 = verifyProgressiveItem(randomizer_getItemAtLocation("Jovani 60 Poe Soul Reward"));
randomizer_setTempFlagForLocation("Jovani 60 Poe Soul Reward");
}
}
#endif
mItemPartnerId = fopAcM_createItemForPresentDemo(&current.pos, local_64, 0,
-1, -1, 0, 0);
}
-12
View File
@@ -1321,12 +1321,6 @@ bool daNpcRafrel_c::talk(void* param_0) {
OS_REPORT("会話終了時 イベントID=%d アイテムNo=%d\n", eventId, itemNo);
if (eventId == 1) {
#if TARGET_PC
if (randomizer_IsActive()) {
itemNo = verifyProgressiveItem(randomizer_getItemAtLocation("Auru Gift To Fyer"));
randomizer_setTempFlagForLocation("Auru Gift To Fyer");
}
#endif
field_0xe00 = fopAcM_createItemForPresentDemo(&current.pos, itemNo, 0, -1, -1, NULL, NULL);
if (field_0xe00 != fpcM_ERROR_PROCESS_ID_e) {
s16 eventIdx = dComIfGp_getEventManager().getEventIdx(this, "DEFAULT_GETITEM", 0xFF);
@@ -1579,12 +1573,6 @@ int daNpcRafrel_c::EvCut_Appear(int i_staffId) {
int itemNo = 0;
u16 eventId = mFlow.getEventId(&itemNo);
if (eventId == 1) {
#if TARGET_PC
if (randomizer_IsActive()) {
itemNo = verifyProgressiveItem(randomizer_getItemAtLocation("Auru Gift To Fyer"));
randomizer_setTempFlagForLocation("Auru Gift To Fyer");
}
#endif
field_0xe00 = fopAcM_createItemForPresentDemo(&current.pos, itemNo, 0, -1, -1, NULL, NULL);
dComIfGp_event_setItemPartnerId(field_0xe00);
field_0xe00 = fpcM_ERROR_PROCESS_ID_e;
-10
View File
@@ -12,11 +12,6 @@
#include "SSystem/SComponent/c_math.h"
#include <cstring>
#if TARGET_PC
#include "dusk/randomizer/game/randomizer_context.hpp"
#include "dusk/randomizer/game/verify_item_functions.h"
#endif
DUSK_GAME_DATA const daNpcThe_HIOParam daNpcThe_Param_c::m = {
220.0f, // attention_offset
-3.0f, // gravity
@@ -828,11 +823,6 @@ BOOL daNpcThe_c::talk(void* param_0) {
}
int item_no = 0;
if (mFlow.getEventId(&item_no) == 1) {
#if TARGET_PC
if (randomizer_IsActive()) {
item_no = verifyProgressiveItem(randomizer_getItemAtLocation("Telma Invoice"));
}
#endif
mItemID = fopAcM_createItemForPresentDemo(&current.pos, item_no, 0, -1, -1,
NULL, NULL);
if (mItemID != -1) {
-10
View File
@@ -10,10 +10,6 @@
#include "m_Do/m_Do_graphic.h"
#include <cstring>
#if TARGET_PC
#include "dusk/randomizer/game/randomizer_context.hpp"
#endif
DUSK_GAME_DATA const daNpc_Uri_HIOParam daNpc_Uri_Param_c::m = {
200.0f, // attention_offset
-3.0f, // gravity
@@ -1169,12 +1165,6 @@ int daNpc_Uri_c::cutEndCarryTutorial(int param_1) {
(s32)mFlow.getEventId(&local_48) == 1)
{
if (mItemPartnerId == fpcM_ERROR_PROCESS_ID_e) {
#if TARGET_PC
if (randomizer_IsActive()) {
local_48 = randomizer_getItemAtLocation("Uli Cradle Delivery");
randomizer_setTempFlagForLocation("Uli Cradle Delivery");
}
#endif
mItemPartnerId =
fopAcM_createItemForPresentDemo(&current.pos, local_48, 0, -1, -1, NULL, NULL);
}
-11
View File
@@ -2220,11 +2220,6 @@ int daNpc_ykW_c::cutEndSnowboardRace(int param_0) {
switch (eventId) {
case 1:
if (mItemPartnerId == fpcM_ERROR_PROCESS_ID_e) {
#if TARGET_PC
if (randomizer_IsActive()) {
itemId = verifyProgressiveItem(randomizer_getItemAtLocation("Snowboard Racing Prize"));
}
#endif
mItemPartnerId = fopAcM_createItemForPresentDemo(&current.pos, itemId, 0,
-1, -1, 0, 0);
}
@@ -2923,12 +2918,6 @@ int daNpc_ykW_c::talk(void* param_0) {
switch (eventId) {
case 1:
if (mItemPartnerId == fpcM_ERROR_PROCESS_ID_e) {
#if TARGET_PC
if (randomizer_IsActive()) {
itemNo = verifyProgressiveItem(randomizer_getItemAtLocation("Snowpeak Ruins Mansion Map"));
randomizer_setTempFlagForLocation("Snowpeak Ruins Mansion Map");
}
#endif
mItemPartnerId =
fopAcM_createItemForPresentDemo(&current.pos, itemNo, 0, -1, -1, 0, 0);
}
-16
View File
@@ -1,7 +1,3 @@
#if TARGET_PC
#include "dusk/randomizer/game/randomizer_context.hpp"
#endif
BOOL daNpc_zrA_c::wait(void* param_0) {
switch (mMode) {
case 0:
@@ -2613,18 +2609,6 @@ BOOL daNpc_zrA_c::ECut_thanksBlast(int i_staffID) {
case 31: {
int item_id = 0;
if (mFlow.getEventId(&item_id) == 1) {
#if TARGET_PC
if (randomizer_IsActive()) {
if (item_id == dItemNo_Randomizer_BOMB_IN_BAG_e) {
item_id = verifyProgressiveItem(randomizer_getItemAtLocation("Iza Helping Hand"));
randomizer_setTempFlagForLocation("Iza Helping Hand");
} else if (item_id == dItemNo_Randomizer_BOMB_BAG_LV2_e) {
item_id = verifyProgressiveItem(randomizer_getItemAtLocation("Iza Raging Rapids Minigame"));
randomizer_setTempFlagForLocation("Iza Raging Rapids Minigame");
}
}
#endif
mItemID = fopAcM_createItemForPresentDemo(&current.pos, item_id,
0, -1, -1, NULL, NULL);
}
-6
View File
@@ -1689,12 +1689,6 @@ BOOL daNpc_zrC_c::ECut_earringGet(int i_staffID) {
case 40: {
int item_no = 0;
if (mFlow.getEventId(&item_no) == 1) {
#if TARGET_PC
if (randomizer_IsActive()) {
item_no = verifyProgressiveItem(randomizer_getItemAtLocation("Gift From Ralis"));
randomizer_setTempFlagForLocation("Gift From Ralis");
}
#endif
mItemID = fopAcM_createItemForPresentDemo(&current.pos, item_no,
0, -1, -1, NULL, NULL);
}
-6
View File
@@ -1740,12 +1740,6 @@ BOOL daNpc_zrZ_c::ECut_clothesGet(int i_staffID) {
}
item_no = 0;
if (mFlow.getEventId(&item_no) == 1) {
#if TARGET_PC
if (randomizer_IsActive()) {
item_no = verifyProgressiveItem(randomizer_getItemAtLocation("Rutelas Blessing"));
randomizer_setTempFlagForLocation("Rutelas Blessing");
}
#endif
mItemID = fopAcM_createItemForPresentDemo(&current.pos, item_no,
0, -1, -1, NULL, NULL);
}
-7
View File
@@ -1825,13 +1825,6 @@ u16 dMsgFlow_c::query049(mesg_flow_node_branch* i_flowNode_p, fopAc_ac_c* i_spea
ret = 4;
}
#if TARGET_PC
// Split up getting both rewards in randomizer
if (randomizer_IsActive() && ret == 4 && !dComIfGs_isEventBit(GOT_BOTTLE_FROM_JOVANI)) {
ret = 3;
}
#endif
if (param_2 != 0) {
// "Collected Souls count"
OS_REPORT("\x1B[44;33m:集めた魂の数  \x1B[m|:");
-8
View File
@@ -574,14 +574,6 @@ BOOL dSv_player_item_c::checkInsectBottle() {
u8 dSv_player_item_c::checkEmptyBottle() {
u8 bottleNum = 0;
#if TARGET_PC
if (randomizer_IsActive() && getStageID() == Cave_of_Ordeals) {
// Return 1 to allow the player to collect the item from the floor 50 reward,
// as this will make the game think that the player has an empty bottle.
return 1;
}
#endif
for (int i = 0; i < BOTTLE_MAX; i++) {
if (mItems[i + SLOT_11] == dItemNo_EMPTY_BOTTLE_e) {
bottleNum++;
-6
View File
@@ -911,12 +911,6 @@ int dShopSystem_c::seq_start(fopAc_ac_c* actor, dMsgFlow_c* i_flow) {
int itemNo;
if (mFlow.getEventId(&itemNo) == 1) {
if (mItemPartnerId == fpcM_ERROR_PROCESS_ID_e) {
#if TARGET_PC
// In rando, override the cat rescue item
if (randomizer_IsActive() && itemNo == dItemNo_Randomizer_HALF_MILK_BOTTLE_e) {
itemNo = randomizer_getItemAtLocation("Ordon Cat Rescue");
}
#endif
mItemPartnerId = fopAcM_createItemForPresentDemo(&current.pos, itemNo, 0, -1,
-1, NULL, NULL);
}
+108 -55
View File
@@ -1108,6 +1108,50 @@ static std::array<u8, 20> CreateAttributeData(const YAML::Node& node, const std:
RandomizerContext WriteSeedData(randomizer::logic::world::World* world) {
RandomizerContext randoData{};
// Give custom flows and messages new indices as we read them in/create them
std::unordered_map<std::string, u16> customMessageIDs{};
std::unordered_map<std::string, u16> customFlowIDs{};
std::unordered_set<u16> usedMessageIDs{};
std::unordered_set<u16> usedFlowIDs{};
u16 curCustomMessageID = BASE_CUSTOM_MSG_AND_FLOW_ID;
u16 curCustomFlowID = BASE_CUSTOM_MSG_AND_FLOW_ID;
// Helper functions for assigning new custom flow IDs/message IDs
auto handleCustomID = [](const std::string& name, auto& customIds, auto& usedIds, u16& curCustomID) {
u16 resultIndex{};
// Check to see if we're setting a custom index
auto resultInt = randomizer::utility::str::toInt(name);
// If we have a regular index, then use that directly
if (resultInt.has_value()) {
resultIndex = resultInt.value();
} else {
// If we don't, assume we're setting the index as custom
if (customIds.contains(name)) {
resultIndex = customIds[name];
} else {
while (usedIds.contains(curCustomID)) {
++curCustomID;
}
auto newIndex = curCustomID++;
resultIndex = newIndex;
customIds[name] = newIndex;
}
}
usedIds.insert(resultIndex);
return resultIndex;
};
auto handleCustomFlowID = [&](const std::string& name) {
return handleCustomID(name, customFlowIDs, usedFlowIDs, curCustomFlowID);
};
auto handleCustomMessageID = [&](const std::string& name) {
return handleCustomID(name, customMessageIDs, usedMessageIDs, curCustomMessageID);
};
// Settings we need to check ingame
for (const auto& [setting, info] : *randomizer::seedgen::settings::GetAllSettingsInfo()) {
if (info->NeedInGame()) {
@@ -1249,6 +1293,62 @@ RandomizerContext WriteSeedData(randomizer::logic::world::World* world) {
}
}
// Items that are given by FLW events. Override the item in the existing event with the
// randomized item
if (location->HasCategories("FLW Event")) {
for (const auto& flwEventNode : metaData["FLW Event"]) {
u8 group = flwEventNode["Group"].as<u8>();
u16 index = handleCustomFlowID(flwEventNode["Index"].as<std::string>());
mesg_flow_node_event event{};
event.type = 3; // event type node
event.event_idx = 8;
event.next_node_idx = handleCustomFlowID(flwEventNode["Next Node Index"].as<std::string>());
auto params = flwEventNode["Parameters"].as<u32>();
// Zero out the spot for the item id
params &= 0xFFFFFF00;
// Put in the item id
params |= location->GetCurrentItem()->GetID();
// Set the params in the correct order
event.params[0] = (params >> 24) & 0xFF;
event.params[1] = (params >> 16) & 0xFF;
event.params[2] = (params >> 8) & 0xFF;
event.params[3] = params & 0xFF;
// If we have a location flag, construct another FLW node to set the associated
// flag right before receiving the item. This is so we set the proper flag
// associated with the location before receiving the item so that the tracker/AP
// can pick up that it happened
if (flwEventNode["Location Flag"]) {
auto newFlwIndex = handleCustomFlowID(location->GetName() + " Flag Set Node");
mesg_flow_node_event flagEvent{};
flagEvent.type = 3; // event type node
if (flwEventNode["Location Flag"]["Save Bit Label"]) {
u16 saveBitLabel = flwEventNode["Location Flag"]["Save Bit Label"].as<u16>();
flagEvent.event_idx = 0; // Event Flag ON
flagEvent.params[0] = 0;
flagEvent.params[1] = 0;
flagEvent.params[2] = (saveBitLabel >> 8) & 0xFF;
flagEvent.params[3] = saveBitLabel & 0xFF;
}
// Store the modified FLW nodes. The flag event takes the place of the original
// index we're modifying and then leads into the custom index of the event that
// sets up the item id
flagEvent.next_node_idx = newFlwIndex;
u32 key = (group << 16) | index;
randoData.mFlowPatches[key] = std::bit_cast<u64>(flagEvent);
key = (CUSTOM_BMG_GROUP << 16) | newFlwIndex;
randoData.mFlowPatches[key] = std::bit_cast<u64>(event);
} else {
// Store the modified FLW node(s)
u32 key = (group << 16) | index;
randoData.mFlowPatches[key] = std::bit_cast<u64>(event);
}
}
}
// Items that we lookup just by calling their location name
if (location->HasCategories("Name Lookup")) {
for (const auto& locationNameNode : metaData["Name Lookup"]) {
@@ -1395,49 +1495,6 @@ RandomizerContext WriteSeedData(randomizer::logic::world::World* world) {
}
}
// Give custom flows and messages new indices as we read them in
std::unordered_map<std::string, u16> customMessageIDs{};
std::unordered_map<std::string, u16> customFlowIDs{};
std::unordered_set<u16> usedMessageIDs{};
std::unordered_set<u16> usedFlowIDs{};
u16 curCustomMessageID = BASE_CUSTOM_MSG_AND_FLOW_ID;
u16 curCustomFlowID = BASE_CUSTOM_MSG_AND_FLOW_ID;
// Helper functions for assigning new custom flow IDs/message IDs
auto handleCustomID = [](const YAML::Node& node, auto& customIds, auto& usedIds, u16& curCustomID) {
u16 resultIndex{};
// Check to see if we're setting a custom index
auto resultStr = node.as<std::string>();
auto resultInt = randomizer::utility::str::toInt(resultStr);
// If we have a regular index, then use that directly
if (resultInt.has_value()) {
resultIndex = resultInt.value();
} else {
// If we don't, assume we're setting the index as custom
if (customIds.contains(resultStr)) {
resultIndex = customIds[resultStr];
} else {
while (usedIds.contains(curCustomID)) {
++curCustomID;
}
auto newIndex = curCustomID++;
resultIndex = newIndex;
customIds[resultStr] = newIndex;
}
}
usedIds.insert(resultIndex);
return resultIndex;
};
auto handleCustomFlowID = [&](const YAML::Node& node) {
return handleCustomID(node, customFlowIDs, usedFlowIDs, curCustomFlowID);
};
auto handleCustomMessageID = [&](const YAML::Node& node) {
return handleCustomID(node, customMessageIDs, usedMessageIDs, curCustomMessageID);
};
// Flow Patches
auto flowPatches = LOAD_EMBED_YAML(RANDO_DATA_PATH "flow_patches.yaml");
for (const auto& groupNode : flowPatches) {
@@ -1471,7 +1528,7 @@ RandomizerContext WriteSeedData(randomizer::logic::world::World* world) {
}
} else {
name = flowNode["name"].as<std::string>();
indices.push_back(handleCustomFlowID(flowNode["name"]));
indices.push_back(handleCustomFlowID(flowNode["name"].as<std::string>()));
}
const auto& type = flowNode["type"].as<std::string>();
@@ -1491,7 +1548,7 @@ RandomizerContext WriteSeedData(randomizer::logic::world::World* world) {
"do not match num results. (expected: {}. size: {})", name, branch->field_0x1, results.size()));
}
for (const auto& resultNode : results) {
auto resultIndex = handleCustomFlowID(resultNode);
auto resultIndex = handleCustomFlowID(resultNode.as<std::string>());
for (auto index : indices) {
u32 key = (groupNo << 16) | index;
randoData.mFlowPatchesBranchOverrides[key].push_back(resultIndex);
@@ -1503,7 +1560,7 @@ RandomizerContext WriteSeedData(randomizer::logic::world::World* world) {
auto event = reinterpret_cast<mesg_flow_node_event*>(&value);
event->type = 3;
event->event_idx = flowNode["event"].as<u8>();
event->next_node_idx = handleCustomFlowID(flowNode["next node index"]);
event->next_node_idx = handleCustomFlowID(flowNode["next node index"].as<std::string>());
u32 params = flowNode["parameters"].as<u32>();
event->params[0] = (params >> 24) & 0xFF;
event->params[1] = (params >> 16) & 0xFF;
@@ -1512,8 +1569,8 @@ RandomizerContext WriteSeedData(randomizer::logic::world::World* world) {
} else if (type == "message") {
auto message = reinterpret_cast<mesg_flow_node*>(&value);
message->type = 1;
message->msg_index = handleCustomMessageID(flowNode["inf index"]);
message->next_node_idx = handleCustomFlowID(flowNode["next flow index"]);
message->msg_index = handleCustomMessageID(flowNode["inf index"].as<std::string>());
message->next_node_idx = handleCustomFlowID(flowNode["next flow index"].as<std::string>());
// If a custom message is too long, split it up among additional flow/message nodes
if (message->msg_index >= BASE_CUSTOM_MSG_AND_FLOW_ID) {
@@ -1543,13 +1600,9 @@ RandomizerContext WriteSeedData(randomizer::logic::world::World* world) {
auto extraTextName = textName + std::to_string(i + 1);
world->AddNewText(extraTextName) = extraText[i];
// Kinda silly, but means we don't need to create another function
// to handle direct string names.
YAML::Node node{};
node["name"] = extraTextName;
// Create new Flow and Message Ids for the split text object
auto newCustomFlowIndex = handleCustomFlowID(node["name"]);
auto newCustomMessageIndex = handleCustomMessageID(node["name"]);
auto newCustomFlowIndex = handleCustomFlowID(extraTextName);
auto newCustomMessageIndex = handleCustomMessageID(extraTextName);
// Create the new flow node. We're storing its own flow index with
// itself for now, but we'll shift it back to the previous node later
@@ -1624,7 +1677,7 @@ RandomizerContext WriteSeedData(randomizer::logic::world::World* world) {
messageId = overrideNode["Message Id"].as<u16>();
} else {
// If no message id specified, assume a custom one
messageId = handleCustomMessageID(overrideNode["Name"]);
messageId = handleCustomMessageID(overrideNode["Name"].as<std::string>());
}
u32 key = (group << 16) | messageId;
for (auto language : randomizer::supportedLanguages) {
@@ -42,18 +42,21 @@
query: 6
parameters: 0x0064
next node index: 0x222
# Patch Charlo to take 100 rupees from Link instead of 30
- index: 0x34E
type: event
event: 41
parameters: 0x00000064
next node index: 0x226
# Patch Charlo to add 100 rupees to his counter instead of 30
- index: 0x357
type: event
event: 3
parameters: 0x00000064
next node index: 0x22B
# Patch Malo Mart door person to not check for time of day.
# Change from branch node that checks time of day to event node
# that does nothing.
@@ -63,6 +66,22 @@
parameters: 0x00000000
next node index: 0x10C
# Patch Jovani to skip checking whether we've received the first
# or second reward and skip straight to the second reward if we're
# talking to him for the first time with 60 souls
- index: 0x844
type: message
inf index: 0x322
next flow index: 0x851
# Patch Jovani to check if we've received the 20 reward yet at
# the end of the 60 reward sequence.
- index: 0x81F
type: event
event: 14
parameters: 0x00000063
next node index: Jovani Check 20 Reward Obtained
5: # zel_05.bmg
# Patch Yeta flow to always give the map check even if the player has obtained the Ordon Cheese
- index: 0x8
@@ -86,6 +105,13 @@
parameters: 0x00000000
next node index: 0x1AC
# Patch Cave of Ordeals Great Fairy to skip over the check
# for an empty bottle the first time
- index: 0x850
type: message
inf index: 0x25B
next flow index: 0x202
#6: # zel_06.bmg
#7: # zel_07.bmg
#8: # zel_08.bmg
@@ -277,6 +303,18 @@
parameters: 0x00000000
next node index: 0x116
# Check to see if we've obtained the 20 Poe Soul Reward.
# If we haven't then branch to giving the reward
- name: Jovani Check 20 Reward Obtained
type: branch
num results: 2
query: 1
parameters: 0x0272
next node index: 0xFFFF
results:
- 0xFFFF # Yes, we've obtained the reward, do nothing
- Jovani Give 20 Reward
#################################################
# HINT SIGNS #
#################################################
@@ -33,6 +33,13 @@
- Ordona Province
- Npc
Metadata:
FLW Event:
- Group: 1
Index: 0x18F
Next Node Index: 0x116
Parameters: 0x0001004A
Location Flag:
Save Bit Label: 0x20
Name Lookup:
- Uli Cradle Delivery
Event Flag: 0x0301
@@ -44,6 +51,11 @@
- Npc
- Ordona Province
Metadata:
FLW Event:
- Group: 1
Index: 0x6DF
Next Node Index: 0x44A
Parameters: 0x00010065
Name Lookup:
- Ordon Cat Rescue
Event Flag: 0x1408
@@ -277,6 +289,11 @@
- Npc
- Ordona Province
Metadata:
FLW Event:
- Group: 1
Index: 0x345
Next Node Index: 0x216
Parameters: 0x00010021
Name Lookup:
- Herding Goats Reward
Event Flag: 0x4240
@@ -493,6 +510,11 @@
- Faron Woods
- ARC
Metadata:
FLW Event:
- Group: 6
Index: 0x72
Next Node Index: 0x54
Parameters: 0x0001009D
Name Lookup:
- Coro Bottle
Event Flag: 0x1A08
@@ -1471,6 +1493,17 @@
- ARC
- Remote Location
Metadata:
FLW Event:
# Win the game without ever using the hawkeye
- Group: 2
Index: 0x124
Next Node Index: 0xA6
Parameters: 0x00010021
# Win the game, but have used hawkeye before
- Group: 2
Index: 0xE0
Next Node Index: 0x71
Parameters: 0x00010021
Name Lookup:
- Talo Sharpshooting
Event Flag: 0x0920
@@ -1483,6 +1516,13 @@
- Kakariko Village
- ARC
Metadata:
FLW Event:
- Group: 2
Index: 0x19A
Next Node Index: 0xF5
Parameters: 0x00010080
Location Flag:
Save Bit Label: 0x79
Name Lookup:
- Renados Letter
Event Flag: 0x0F80
@@ -1507,6 +1547,13 @@
- Kakariko Graveyard
- ARC
Metadata:
FLW Event:
- Group: 2
Index: 0x55
Next Node Index: 0x25
Parameters: 0x00010031
Location Flag:
Save Bit Label: 0x46
Name Lookup:
- Rutelas Blessing
Event Flag: 0x0804
@@ -1519,6 +1566,13 @@
- Kakariko Graveyard
- ARC
Metadata:
FLW Event:
- Group: 2
Index: 0x339
Next Node Index: 0x1ED
Parameters: 0x0001003D
Location Flag:
Save Bit Label: 0x1E0
Name Lookup:
- Gift From Ralis
Event Flag: 0x3B80
@@ -1887,6 +1941,13 @@
- ARC
- Remote Location
Metadata:
FLW Event:
- Group: 6
Index: 0x610
Next Node Index: 0x439
Parameters: 0x000100E9
Location Flag:
Save Bit Label: 0x30F
Name Lookup:
- Skybook From Impaz
Event Flag: 0x5F80
@@ -1922,6 +1983,13 @@
- Hidden Village
- ARC
Metadata:
FLW Event:
- Group: 6
Index: 0x32
Next Node Index: 0x2A
Parameters: 0x00010083
Location Flag:
Save Bit Label: 0x116
Name Lookup:
- Ilia Charm
Event Flag: 0x2280
@@ -2390,6 +2458,13 @@
- Castle Town
- ARC
Metadata:
FLW Event:
- Group: 4
Index: 0x276
Next Node Index: 0x1A5
Parameters: 0x00010055
# Location Flag: Can't be set first otherwise event flow gets messed up
# Save Bit Label: 0x122
Name Lookup:
- STAR Prize 1
Event Flag: 0x2308
@@ -2402,6 +2477,13 @@
- Castle Town
- ARC
Metadata:
FLW Event:
- Group: 4
Index: 0x269
Next Node Index: 0x1A1
Parameters: 0x00010056
# Location Flag: Can't be set first otherwise event flow gets messed up
# Save Bit Label: 0x125
Name Lookup:
- STAR Prize 2
Event Flag: 0x2301
@@ -2471,6 +2553,17 @@
- Castle Town
- ARC
Metadata:
FLW Event:
# Flow if less than 60 souls
- Group: 4
Index: 0x841
Next Node Index: 0x773
Parameters: 0x00010075
# Custom flow if 60 souls
- Group: 9
Index: Jovani Give 20 Reward
Next Node Index: 0x77E
Parameters: 0x00010075
Name Lookup:
- Jovani 20 Poe Soul Reward
Event Flag: 0x5510
@@ -2485,6 +2578,11 @@
- ARC
- Remote Location
Metadata:
FLW Event:
- Group: 4
Index: 0x852
Next Node Index: 0x781
Parameters: 0x00010007
Name Lookup:
- Jovani 60 Poe Soul Reward
Event Flag: 0x3820
@@ -2518,6 +2616,11 @@
- Castle Town
- ARC
Metadata:
FLW Event:
- Group: 4
Index: 0x14D
Next Node Index: 0xC6
Parameters: 0x00010081
Name Lookup:
- Telma Invoice
Event Flag: 0x2180
@@ -3040,6 +3143,11 @@
- Lake Hylia
- ARC
Metadata:
FLW Event:
- Group: 8
Index: 0x180
Next Node Index: 0xF7
Parameters: 0x00010090
Name Lookup:
- Auru Gift To Fyer
Event Flag: 0x2520
@@ -3564,6 +3672,11 @@
- ARC
- Remote Location
Metadata:
FLW Event:
- Group: 8
Index: 0x1FC
Next Node Index: 0x152
Parameters: 0x00010021
Name Lookup:
- Plumm Fruit Balloon Minigame
Event Flag: 0x2380
@@ -3653,6 +3766,11 @@
- ARC
- Remote Location
Metadata:
FLW Event:
- Group: 8
Index: 0x2E4
Next Node Index: 0x208
Parameters: 0x00010051
Name Lookup:
- Iza Helping Hand
Event Flag: 0x0B01
@@ -3666,6 +3784,11 @@
- ARC
- Remote Location
Metadata:
FLW Event:
- Group: 8
Index: 0x2EE
Next Node Index: 0x20F
Parameters: 0x0001004F
Name Lookup:
- Iza Raging Rapids Minigame
Event Flag: 0x5908
@@ -3898,6 +4021,11 @@
- Zoras Domain
- ARC
Metadata:
FLW Event:
- Group: 7
Index: 0x8
Next Node Index: 0x1
Parameters: 0x00010051
Name Lookup:
- Zoras Domain Underwater Goron
Event Flag: 0x3D10
@@ -3987,6 +4115,11 @@
- Snowpeak Province
- ARC
Metadata:
FLW Event:
- Group: 6
Index: 0x282
Next Node Index: 0x1C6
Parameters: 0x00010091
Name Lookup:
- Ashei Sketch
Event Flag: 0x2940
@@ -4077,6 +4210,11 @@
- ARC
- Remote Location
Metadata:
FLW Event:
- Group: 6
Index: 0x2F8
Next Node Index: 0x237
Parameters: 0x00010021
Name Lookup:
- Snowboard Racing Prize
Event Flag: 0x3B10
@@ -4724,6 +4862,11 @@
- ARC
- Remote Location
Metadata:
FLW Event:
- Group: 5
Index: 0x20A
Next Node Index: 0x18F
Parameters: 0x00010073
Name Lookup:
- Cave of Ordeals Great Fairy Reward
Event Flag: 0x3E40
@@ -4992,6 +5135,11 @@
- Big Key
- ARC
Metadata:
FLW Event:
- Group: 5
Index: 0x237
Next Node Index: 0x19B
Parameters: 0x000100F9
Name Lookup:
- Goron Mines Gor Amato Key Shard
Event Flag: 0x3008 # late
@@ -5111,6 +5259,11 @@
- Big Key
- ARC
Metadata:
FLW Event:
- Group: 5
Index: 0x259
Next Node Index: 0x1AD
Parameters: 0x000100FA
Name Lookup:
- Goron Mines Gor Ebizo Key Shard
Event Flag: 0x3702 # late
@@ -5171,6 +5324,11 @@
- Big Key
- ARC
Metadata:
FLW Event:
- Group: 5
Index: 0x248
Next Node Index: 0x1A4
Parameters: 0x000100FD
Name Lookup:
- Goron Mines Gor Liggs Key Shard
Event Flag: 0x3701 # late
@@ -5892,6 +6050,11 @@
- Dungeon Map
- ARC
Metadata:
FLW Event:
- Group: 5
Index: 0x3C8
Next Node Index: 0x265
Parameters: 0x00010023
Name Lookup:
- Snowpeak Ruins Mansion Map
Event Flag: 0x0B10 # late
@@ -635,6 +635,10 @@ namespace randomizer::logic::hints {
static void AssignHintSignHints(const location::LocationPool& hintSigns, std::vector<Hint> hints, world::World* world) {
size_t hintsPerSign = std::ceil(static_cast<double>(hints.size()) / static_cast<double>(hintSigns.size()));
// Don't bother placing hints if there are none
if (hintsPerSign == 0) {
return;
}
auto& worlds = world->GetRandomizer()->GetWorlds();
auto& hintSignHints = world->GetHintSignHints();
auto hintSignHintsOriginal = hintSignHints;