allow keeping ooccoo jr through dungeon exits

This commit is contained in:
gymnast86
2026-05-05 05:13:26 -07:00
parent f6e526b187
commit 3e99420527
4 changed files with 27 additions and 33 deletions
+4
View File
@@ -680,10 +680,14 @@ public:
void onDungeonItemBossKey() { onDungeonItem(BOSS_KEY); }
void offDungeonItemBossKey() { offDungeonItem(BOSS_KEY); }
s32 isDungeonItemBossKey() const { return isDungeonItem(BOSS_KEY); }
#if TARGET_PC
void onStageBossEnemy();
#else
void onStageBossEnemy() {
onDungeonItem(STAGE_BOSS_ENEMY);
onDungeonItem(OOCCOO_NOTE);
}
#endif
void offStageBossEnemy() { offDungeonItem(STAGE_BOSS_ENEMY); }
s32 isStageBossEnemy() const { return isDungeonItem(STAGE_BOSS_ENEMY); }
void onStageLife() { onDungeonItem(STAGE_LIFE); }
+7
View File
@@ -4842,6 +4842,13 @@ int daAlink_c::procCoWarpInit(int param_0, int param_1) {
(checkItemGet(dItemNo_DUNGEON_BACK_e, 1) &&
strcmp(stageName, dComIfGs_getWarpStageName()) == 0))
{
#if TARGET_PC
// In rando, only clear the Ooccoo slot if Ooccoo is in it
u8 ooccooSlot = dComIfGs_getItem(SLOT_18, false);
if (!randomizer_IsActive() || ooccooSlot == dItemNo_Randomizer_DUNGEON_EXIT_e ||
ooccooSlot == dItemNo_Randomizer_DUNGEON_EXIT_2_e ||
ooccooSlot == dItemNo_Randomizer_LV7_DUNGEON_EXIT_e)
#endif
dComIfGs_setItem(SLOT_18, dItemNo_NONE_e);
dComIfGs_resetLastWarpAcceptStage();
}
+6
View File
@@ -156,6 +156,12 @@ int dGameover_c::_create() {
if (!strcmp(dComIfGp_getLastPlayStageName(), "D_MN10A")) {
// Last stage was Stallord Arena
// Remove Ooccoo from inventory
#if TARGET_PC
// In rando, only clear the Ooccoo slot if Ooccoo is in it
u8 ooccooSlot = dComIfGs_getItem(SLOT_18, false);
if (!randomizer_IsActive() || ooccooSlot == dItemNo_Randomizer_DUNGEON_EXIT_e ||
ooccooSlot == dItemNo_Randomizer_DUNGEON_EXIT_2_e)
#endif
dComIfGs_setItem(SLOT_18, dItemNo_NONE_e);
dComIfGs_resetLastWarpAcceptStage();
}
+10 -33
View File
@@ -1243,39 +1243,6 @@ void dSv_memBit_c::onDungeonItem(int i_no) {
if (i_no == STAGE_LIFE) {
return;
}
switch(i_no)
{
case STAGE_BOSS_ENEMY:
{
// Start at 1 because we haven't set the current dungeon's flag yet.
int numCompletedDungeons = 1;
for (int i = 0x10; i < 0x18; i++)
{
if (dComIfGs_isStageBossEnemy(i))
{
numCompletedDungeons++;
}
}
/*
Pasting rando code for the time being until the framework is built:
// Check if we have completed enough dungeons to break the barrier.
randoPtr->checkSetHCBarrierFlag(rando::HC_Dungeons, numDungeons);
// Check if we have completed enough dungeons to unlock the BK check.
randoPtr->checkSetHCBkFlag(rando::HC_BK_Dungeons, numDungeons);
*/
if (i_no == 0x13) // Stallord
{
/*
const uint32_t agDungeonReward = randoPtr->getEventItem(rando::customItems::Mirror_Piece_1);
randoPtr->addItemToEventQueue(agDungeonReward);
*/
}
break;
}
}
}
#endif
mDungeonItem |= (u8)(1 << i_no);
@@ -1355,6 +1322,16 @@ s32 dSv_memBit_c::isDungeonItem(int i_no) const {
return mDungeonItem & (u8)(1 << i_no) ? TRUE : FALSE;
}
#if TARGET_PC
void dSv_memBit_c::onStageBossEnemy() {
onDungeonItem(STAGE_BOSS_ENEMY);
// Don't turn Ooccoo into the note when defeating a boss
if (!randomizer_IsActive()) {
onDungeonItem(OOCCOO_NOTE);
}
}
#endif
void dSv_event_c::init() {
int i;
for (i = 0; i < MAX_EVENTS; i++) {