feat: disable hit stun frames (#2697)

* feat: disable hit stun frames

* fix: forgot speedrun reset

* fix: workaround to be able to build with randomizer et al

* fix: static shenanigans
This commit is contained in:
Giorgio Mendieta
2026-10-10 17:24:51 +02:00
committed by GitHub
parent 2c4960dcdf
commit 34a144a493
6 changed files with 19 additions and 2 deletions
+5
View File
@@ -81,7 +81,12 @@ public:
#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;
+8 -2
View File
@@ -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;
@@ -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;
}
+2
View File
@@ -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},
@@ -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);
+1
View File
@@ -226,6 +226,7 @@ struct UserSettings {
ConfigVar<bool> autoSave;
ConfigVar<bool> enhancedMapMenus;
ConfigVar<bool> aimingReticle;
ConfigVar<bool> noHitStun;
// Preferences
ConfigVar<bool> enableMirrorMode;
+1
View File
@@ -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);
+2
View File
@@ -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,