Skip to content
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
5 changes: 5 additions & 0 deletions include/d/d_s_play.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ class dScnPly_c : public scene_class {
#else
static s8 isPause() { return pauseTimer; }
#endif

#if TARGET_PC
static void setPauseTimer(s8 time);
#else
static void setPauseTimer(s8 time) { nextPauseTimer = time; }
#endif

static DUSK_GAME_DATA s8 pauseTimer;
static DUSK_GAME_DATA s8 nextPauseTimer;
Expand Down
10 changes: 8 additions & 2 deletions src/d/d_s_play.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,12 @@ void dScnPly_c::offReset() {
}
}

#ifdef TARGET_PC
void dScnPly_c::setPauseTimer(s8 time) {
nextPauseTimer = dusk::getSettings().game.noHitStun ? 0 : time;
}
#endif

static int phase_00(dScnPly_c* i_this) {
if (!i_this->resetGame()) {
return cPhs_INIT_e;
Expand Down Expand Up @@ -1585,12 +1591,12 @@ static int phase_5(dScnPly_c* i_this) {

OS_REPORT("\x1b[32mリソースプリロード %d/%d\n\x1b[m", goodLoads, loadNum);
}

if (phase_state == cPhs_COMPLEATE_e) {
resPreLoadTime1 = OSGetTime();
OS_REPORT("\x1b[32mリソースプリロード %lld ms\n\x1b[m", OSTicksToMilliseconds(resPreLoadTime1 - resPreLoadTime0));
}

return phase_state;
}

Expand Down
2 changes: 2 additions & 0 deletions src/dusk/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ UserSettings g_userSettings = {
.autoSave {"game.autoSave", false},
.enhancedMapMenus {"game.enhancedMapMenus", false},
.aimingReticle {"game.aimingReticle", false},
.noHitStun {"game.noHitStun", false},

// Preferences
.enableMirrorMode {"game.enableMirrorMode", false},
Expand Down Expand Up @@ -295,6 +296,7 @@ void registerSettings() {
Register(g_userSettings.game.autoSave);
Register(g_userSettings.game.enhancedMapMenus);
Register(g_userSettings.game.aimingReticle);
Register(g_userSettings.game.noHitStun);
Register(g_userSettings.game.enableMirrorMode);
Register(g_userSettings.game.invertCameraXAxis);
Register(g_userSettings.game.invertCameraYAxis);
Expand Down
1 change: 1 addition & 0 deletions src/dusk/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ struct UserSettings {
ConfigVar<bool> autoSave;
ConfigVar<bool> enhancedMapMenus;
ConfigVar<bool> aimingReticle;
ConfigVar<bool> noHitStun;

// Preferences
ConfigVar<bool> enableMirrorMode;
Expand Down
1 change: 1 addition & 0 deletions src/dusk/speedrun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ void resetForSpeedrunMode() {
getSettings().game.invincibleEnemies.setSpeedrunValue(false);
getSettings().game.easyQuickSpin.setSpeedrunValue(false);
getSettings().game.infiniteEponaStamina.setSpeedrunValue(false);
getSettings().game.noHitStun.setSpeedrunValue(false);

getSettings().game.pauseOnFocusLost.setSpeedrunValue(false);

Expand Down
2 changes: 2 additions & 0 deletions src/dusk/ui/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1302,6 +1302,8 @@ SettingsWindow::SettingsWindow(bool prelaunch) : mPrelaunch(prelaunch) {
"Transform instantly by pressing R and Y simultaneously.");
addOption("Aiming Reticle", getSettings().game.aimingReticle,
"Shows the aiming reticle for bow and slingshot.");
addOption("No Hit Stun", getSettings().game.noHitStun,
"Disables hit stun frames after attacks.");

leftPane.add_section("Speedrunning");
config_bool_select(leftPane, rightPane, getSettings().game.speedrunMode,
Expand Down
Loading