mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-11 13:08:33 -04:00
fishing hole bottle check
This commit is contained in:
@@ -25,7 +25,10 @@
|
||||
#include <cmath>
|
||||
#include <cstring>
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/randomizer/game/verify_item_functions.h"
|
||||
#include "dusk/version.hpp"
|
||||
#endif
|
||||
|
||||
class dmg_rod_HIO_c : public JORReflexible {
|
||||
public:
|
||||
@@ -4031,6 +4034,17 @@ static void uki_catch(dmg_rod_class* i_this) {
|
||||
} else if (mgfish->mCaughtType == MG_CATCH_BIN) {
|
||||
i_this->msgflow.init(actor, 0x139A, 0, NULL);
|
||||
dComIfGs_onEventBit(dSv_event_flag_c::saveBitLabels[468]);
|
||||
#if TARGET_PC
|
||||
if (randomizer_IsActive()) {
|
||||
// In rando, give the player the fishing bottle randomized item. Then save
|
||||
// the itemId for later since the textbox happens after we've already given the player
|
||||
// the item. If we didn't save it and the item is progressive, then we get the wrong
|
||||
// text for the item.
|
||||
u8 itemId = verifyProgressiveItem(randomizer_getItemAtLocation("Fishing Hole Bottle"));
|
||||
g_randomizerState.mFishingBottleItemId = itemId;
|
||||
execItemGet(itemId);
|
||||
} else
|
||||
#endif
|
||||
dComIfGs_setEmptyBottle();
|
||||
} else if (mgfish->mCaughtType == MG_CATCH_KN) {
|
||||
i_this->msgflow.init(actor, 0x139C, 0, NULL);
|
||||
@@ -4297,7 +4311,8 @@ static void uki_main(dmg_rod_class* i_this) {
|
||||
}
|
||||
|
||||
if (!dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[468])) {
|
||||
if (cM_rndF(1.0f) <= 0.5f) {
|
||||
// Always succeed the rng check in rando for fishing bottle
|
||||
if (cM_rndF(1.0f) <= 0.5f IF_DUSK(|| randomizer_IsActive())) {
|
||||
cXyz bin_pos(6800.0f, 30.0f, -270.0f);
|
||||
bin_pos -= player->current.pos;
|
||||
|
||||
|
||||
@@ -511,6 +511,17 @@ int dMsgFlow_c::setNormalMsg(mesg_flow_node* i_flowNode_p, fopAc_ac_c* i_speaker
|
||||
inf_p = (BE(u16)*)getMsgDataBlock("INF1");
|
||||
msg_no = (inf_p + (var_r29->msg_index) * 10)[10];
|
||||
|
||||
#if TARGET_PC
|
||||
if (randomizer_IsActive()) {
|
||||
// If this is the fishing hole bottle message, override it
|
||||
// with the item message for the randomized item
|
||||
if (msg_no == 0x71E && g_randomizerState.mFishingBottleItemId != 0) {
|
||||
msg_no = getItemMessageID(g_randomizerState.mFishingBottleItemId);
|
||||
g_randomizerState.mFishingBottleItemId = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// "Message Set"
|
||||
OS_REPORT("\x1B[44;37mメッセ−ジセット \x1B[m|:");
|
||||
|
||||
|
||||
@@ -100,6 +100,9 @@ public:
|
||||
u8 mTimeChange{};
|
||||
u8 mEventItemQueue[EVENT_ITEM_QUEUE_SIZE];
|
||||
bool mRoomReloadingState{false};
|
||||
|
||||
// TODO: Probably a better way to handle this
|
||||
u8 mFishingBottleItemId{};
|
||||
};
|
||||
|
||||
extern RandomizerState g_randomizerState;
|
||||
|
||||
@@ -114,4 +114,14 @@ bool playerIsOnTitleScreen() {
|
||||
// Player is either on title screen movie stage (S_MV000) or on title screen map layer 10
|
||||
return strcmp(dComIfGp_getStartStageName(), "S_MV000") == 0 ||
|
||||
(strcmp(dComIfGp_getStartStageName(), "F_SP102") == 0 && dComIfG_play_c::getLayerNo(0) == 10);
|
||||
}
|
||||
|
||||
u16 getItemMessageID(u8 itemId) {
|
||||
// If heart piece, choose from the different heart piece messages
|
||||
if (itemId == dItemNo_Randomizer_KAKERA_HEART_e) {
|
||||
static u32 const heartPieceMessage[5] = {0x86, 0x9C, 0x9D, 0x9E, 0x9F};
|
||||
return heartPieceMessage[dComIfGs_getMaxLife() % 5];
|
||||
}
|
||||
|
||||
return itemId + 0x65;
|
||||
}
|
||||
@@ -13,3 +13,4 @@ int initCreatePlayerItem(u32 item, u32 flag, const cXyz* pos, int roomNo, const
|
||||
*/
|
||||
int getStageID(const char* stage = NULL);
|
||||
bool playerIsOnTitleScreen();
|
||||
u16 getItemMessageID(u8 itemId);
|
||||
|
||||
@@ -3478,7 +3478,6 @@
|
||||
- Location Name Lookup
|
||||
Metadata: Iza Raging Rapids Minigame
|
||||
|
||||
# TODO
|
||||
- Name: Fishing Hole Bottle
|
||||
Original Item: Empty Bottle
|
||||
Categories:
|
||||
@@ -3486,8 +3485,8 @@
|
||||
- Fishing Hole
|
||||
- ARC
|
||||
- REL
|
||||
Metadata:
|
||||
- None
|
||||
- Location Name Lookup
|
||||
Metadata: Fishing Hole Bottle
|
||||
|
||||
- Name: Fishing Hole Heart Piece
|
||||
Original Item: Piece of Heart
|
||||
|
||||
Reference in New Issue
Block a user