mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-08 12:16:17 -04:00
charlo donation check
This commit is contained in:
@@ -7,6 +7,9 @@
|
||||
|
||||
#include "d/actor/d_a_npc_prayer.h"
|
||||
#include "d/d_com_inf_game.h"
|
||||
#if TARGET_PC
|
||||
#include "dusk/randomizer/game/verify_item_functions.h"
|
||||
#endif
|
||||
|
||||
static NPC_PRAY_HIO_CLASS l_HIO;
|
||||
|
||||
@@ -720,6 +723,12 @@ fpc_ProcID daNpcPray_c::createHeart() {
|
||||
mDoMtx_stack_c::ZXYrotS(rot);
|
||||
mDoMtx_stack_c::multVec(&offset, &offset);
|
||||
pos += offset;
|
||||
#if TARGET_PC
|
||||
if (randomizer_IsActive()) {
|
||||
u8 itemId = verifyProgressiveItem(randomizer_getItemAtLocation("Charlo Donation Blessing"));
|
||||
return fopAcM_createItemForBoss(&pos, itemId, fopAcM_GetRoomNo(this), &rot, &size, 0.0f, 0.0f, 0);
|
||||
}
|
||||
#endif
|
||||
return fopAcM_createItemForBoss(&pos, dItemNo_KAKERA_HEART_e, fopAcM_GetRoomNo(this), &rot, &size, 0.0f, 0.0f, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,9 @@
|
||||
#include "d/d_s_play.h"
|
||||
#include "SSystem/SComponent/c_counter.h"
|
||||
#include <cstring>
|
||||
#if TARGET_PC
|
||||
#include "dusk/randomizer/game/verify_item_functions.h"
|
||||
#endif
|
||||
|
||||
#if DEBUG
|
||||
static dEvM_HIO_c l_HIO;
|
||||
@@ -333,6 +336,12 @@ bool dEvent_manager_c::setObjectArchive(char* arcname) {
|
||||
|
||||
if (arcname != NULL) {
|
||||
rt = dComIfG_getObjectRes(arcname, DataFileName);
|
||||
#if TARGET_PC
|
||||
// Pretty hacky, but change the itemId for the event of charlo giving us the heart piece
|
||||
if (randomizer_IsActive() && strcmp(arcname, "Prayer") == 0) {
|
||||
static_cast<u8*>(rt)[0x927] = verifyProgressiveItem(randomizer_getItemAtLocation("Charlo Donation Blessing"));
|
||||
}
|
||||
#endif
|
||||
int base_status = mEventList[BASE_ACTOR].init((char*)rt, -1);
|
||||
|
||||
#if DEBUG
|
||||
|
||||
@@ -657,6 +657,15 @@ int dMsgFlow_c::branchNodeProc(fopAc_ac_c* i_speaker_p, fopAc_ac_c** i_talkPartn
|
||||
int dMsgFlow_c::eventNodeProc(fopAc_ac_c* i_speaker_p, fopAc_ac_c** i_talkPartners) {
|
||||
mesg_flow_node_event* node = NULL;
|
||||
node = &mFlowNodeTBL[mNodeIdx].event;
|
||||
#if TARGET_PC
|
||||
// Overwrite this node if we have a patch for it
|
||||
if (randomizer_IsActive()) {
|
||||
u32 key = (dMsgObject_getGroupID() << 16) | mNodeIdx;
|
||||
if (randomizer_GetContext().mFlowPatches.contains(key)) {
|
||||
node = reinterpret_cast<mesg_flow_node_event*>(&randomizer_GetContext().mFlowPatches[key]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
int proc_status = (this->*mEventList[node->event_idx])(node, i_speaker_p);
|
||||
|
||||
switch (node->event_idx) {
|
||||
|
||||
@@ -867,6 +867,17 @@ void GenerateAndWriteSeed(std::string& generationStatusMsg) {
|
||||
branch->param = flowNode["parameters"].as<u16>();
|
||||
branch->next_node_idx = flowNode["next node index"].as<u16>();
|
||||
}
|
||||
else if (type == "event") {
|
||||
auto event = reinterpret_cast<mesg_flow_node_event*>(&value);
|
||||
event->type = 3;
|
||||
event->event_idx = flowNode["event"].as<u8>();
|
||||
event->next_node_idx = flowNode["next node index"].as<u16>();
|
||||
u32 params = flowNode["parameters"].as<u32>();
|
||||
event->params[0] = (params >> 24) & 0xFF;
|
||||
event->params[1] = (params >> 16) & 0xFF;
|
||||
event->params[2] = (params >> 8) & 0xFF;
|
||||
event->params[3] = params & 0xFF;
|
||||
}
|
||||
|
||||
u32 key = (groupNo << 16) | index;
|
||||
randoData.mFlowPatches[key] = value;
|
||||
|
||||
@@ -15,7 +15,26 @@
|
||||
next node index: 0x340
|
||||
|
||||
#3: # zel_03.bmg
|
||||
#4: # zel_04.bmg
|
||||
4: # zel_04.bmg - Castle Town
|
||||
# Patch Charlo to check for 100 rupees instead of 30
|
||||
- index: 0x34A
|
||||
type: branch
|
||||
num results: 2
|
||||
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
|
||||
#5: # zel_05.bmg
|
||||
#6: # zel_06.bmg
|
||||
#7: # zel_07.bmg
|
||||
|
||||
@@ -2242,7 +2242,6 @@
|
||||
- Flag: 0x49
|
||||
Stage: 57
|
||||
|
||||
# TODO
|
||||
- Name: Charlo Donation Blessing
|
||||
Original Item: Piece of Heart
|
||||
Categories:
|
||||
@@ -2251,8 +2250,8 @@
|
||||
- Castle Town
|
||||
- ObjectARC
|
||||
- Boss
|
||||
Metadata:
|
||||
- None
|
||||
- Location Name Lookup
|
||||
Metadata: Charlo Donation Blessing
|
||||
|
||||
# TODO
|
||||
- Name: STAR Prize 1
|
||||
|
||||
Reference in New Issue
Block a user