Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor QoL Features #46

Merged
merged 14 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion src/init_save.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ void Sram_ClearHighscores(void);
void Sram_GenerateRandomSaveFields(void);
void Sram_ResetSave(void);

bool drankChateau = false;

void Sram_SetInitialWeekEvents(void) {
SET_WEEKEVENTREG(WEEKEVENTREG_15_20);
SET_WEEKEVENTREG(WEEKEVENTREG_59_04);
Expand Down Expand Up @@ -79,6 +81,12 @@ void Sram_SetInitialWeekEvents(void) {

// skip the princess prison cutscene
SET_WEEKEVENTREG(WEEKEVENTREG_ENTERED_WOODFALL_TEMPLE_PRISON);

// restore chateau romani state after cycle reset
if(drankChateau) {
SET_WEEKEVENTREG(WEEKEVENTREG_DRANK_CHATEAU_ROMANI);
drankChateau = false;
}
}

RECOMP_PATCH void Sram_InitDebugSave(void) {
Expand All @@ -94,6 +102,19 @@ RECOMP_PATCH void Sram_InitDebugSave(void) {

gSaveContext.save.hasTatl = true;

// TODO: move below to YAML options
// start with basic consumables
gSaveContext.save.saveInfo.playerData.rupees = 99;
gSaveContext.save.saveInfo.inventory.items[SLOT_DEKU_STICK] = ITEM_DEKU_STICK;
gSaveContext.save.saveInfo.inventory.ammo[SLOT_DEKU_STICK] = 10;
gSaveContext.save.saveInfo.inventory.items[SLOT_DEKU_NUT] = ITEM_DEKU_NUT;
gSaveContext.save.saveInfo.inventory.ammo[SLOT_DEKU_NUT] = 20;

gSaveContext.save.timeSpeedOffset = -2;

// TODO: hide song on quest screen + add playback text
SET_QUEST_ITEM(ITEM_SONG_SUN + QUEST_SONG_SUN);

gSaveContext.save.saveInfo.horseData.sceneId = SCENE_F01;
gSaveContext.save.saveInfo.horseData.pos.x = -1420;
gSaveContext.save.saveInfo.horseData.pos.y = 257;
Expand Down Expand Up @@ -294,7 +315,7 @@ RECOMP_PATCH void Sram_SaveEndOfCycle(PlayState* play) {
s32 i;
u8 item;

gSaveContext.save.timeSpeedOffset = 0;
// gSaveContext.save.timeSpeedOffset = 0;
gSaveContext.save.eventDayCount = 0;
gSaveContext.save.day = 0;
gSaveContext.save.time = CLOCK_TIME(6, 0) - 1;
Expand Down Expand Up @@ -343,6 +364,9 @@ RECOMP_PATCH void Sram_SaveEndOfCycle(PlayState* play) {
//Inventory_DeleteItem(ITEM_MASK_FIERCE_DEITY, SLOT(ITEM_MASK_FIERCE_DEITY));
}

// persistent chateau romani state
drankChateau = CHECK_WEEKEVENTREG(WEEKEVENTREG_DRANK_CHATEAU_ROMANI);

for (i = 0; i < ARRAY_COUNT(sPersistentCycleWeekEventRegs); i++) {
u16 isPersistentBits = sPersistentCycleWeekEventRegs[i];

Expand Down
2 changes: 2 additions & 0 deletions src/item_give.c
Original file line number Diff line number Diff line change
Expand Up @@ -1951,9 +1951,11 @@ u8 randoItemGive(u32 gi) {
return ITEM_NONE;
} else if (CUR_UPG_VALUE(UPG_WALLET) == 1) {
Inventory_ChangeUpgrade(UPG_WALLET, 2);
Rupees_ChangeBy(500);
return ITEM_NONE;
}
Inventory_ChangeUpgrade(UPG_WALLET, 1);
Rupees_ChangeBy(200);
return ITEM_NONE;

} else if (item == ITEM_DEKU_STICK_UPGRADE_20) {
Expand Down