From c24c61a31d20df2eacf6433d4c17858bcefb602c Mon Sep 17 00:00:00 2001 From: Barinade Date: Thu, 25 Aug 2022 19:29:05 -0500 Subject: [PATCH] stop changing hold timing windows thanks --- Themes/_fallback/base._ini | 1 - Themes/_fallback/metrics.ini | 1 - src/Etterna/Actor/Gameplay/Player.cpp | 38 +++++++++++++++------ src/Etterna/Actor/Gameplay/Player.h | 2 ++ src/Etterna/Actor/Gameplay/PlayerReplay.cpp | 2 +- 5 files changed, 30 insertions(+), 14 deletions(-) diff --git a/Themes/_fallback/base._ini b/Themes/_fallback/base._ini index 9e3d31376e..da6502814b 100644 --- a/Themes/_fallback/base._ini +++ b/Themes/_fallback/base._ini @@ -2069,7 +2069,6 @@ HoldCheckpoints=false ImmediateHoldLetGo=true RequireStepOnHoldHeads=true CheckpointsUseTimeSignatures=false -InitialHoldLife=1 RollBodyIncrementsCombo=true CheckpointsTapsSeparateJudgment=true diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini index b513d77ec1..4996b62fc2 100644 --- a/Themes/_fallback/metrics.ini +++ b/Themes/_fallback/metrics.ini @@ -700,7 +700,6 @@ CheckpointsFlashOnHold=false ImmediateHoldLetGo=true ComboBreakOnImmediateHoldLetGo=false RequireStepOnHoldHeads=true -InitialHoldLife=1 RollBodyIncrementsCombo=false ScoreMissedHoldsAndRolls=false PercentUntilColorCombo=0.25 diff --git a/src/Etterna/Actor/Gameplay/Player.cpp b/src/Etterna/Actor/Gameplay/Player.cpp index c29b458af7..129f5f6f76 100644 --- a/src/Etterna/Actor/Gameplay/Player.cpp +++ b/src/Etterna/Actor/Gameplay/Player.cpp @@ -112,8 +112,6 @@ static ThemeMetric DRAW_DISTANCE_BEFORE_TARGET_PIXELS; static ThemeMetric ROLL_BODY_INCREMENTS_COMBO; static ThemeMetric COMBO_BREAK_ON_IMMEDIATE_HOLD_LET_GO; -/** @brief How much life is in a hold note when you start on it? */ -ThemeMetric INITIAL_HOLD_LIFE("Player", "InitialHoldLife"); ThemeMetric PENALIZE_TAP_SCORE_NONE("Player", "PenalizeTapScoreNone"); ThemeMetric CHECKPOINTS_FLASH_ON_HOLD( "Player", @@ -188,28 +186,46 @@ JudgedRows::Resize(size_t iMin) auto Player::GetWindowSeconds(TimingWindow tw) -> float { - // mines should have a static hit window across all judges to be - // logically consistent with the idea that increasing judge should - // not make any elementof the game easier, so now they do - if (tw == TW_Mine) { - return 0.075F; // explicit return until i remove this stuff from + switch (tw) { + // mines should have a static hit window across all judges to be + // logically consistent with the idea that increasing judge should + // not make any elementof the game easier, so now they do + case TW_Mine: + return 0.075F; + case TW_Hold: + return 0.25F * m_fTimingWindowScale; + case TW_Roll: + return 0.5F * m_fTimingWindowScale; + default: + break; } - // prefs.ini float fSecs = m_fTimingWindowSeconds[tw]; fSecs *= m_fTimingWindowScale; + fSecs = std::clamp(fSecs, 0.F, 0.18F); return fSecs; } auto Player::GetWindowSecondsCustomScale(TimingWindow tw, float timingScale) -> float { - if (tw == TW_Mine) { - return 0.075F; + switch (tw) { + // mines should have a static hit window across all judges to be + // logically consistent with the idea that increasing judge should + // not make any elementof the game easier, so now they do + case TW_Mine: + return 0.075F; + case TW_Hold: + return 0.25F * m_fTimingWindowScale; + case TW_Roll: + return 0.5F * m_fTimingWindowScale; + default: + break; } float fSecs = m_fTimingWindowSeconds[tw]; fSecs *= timingScale; + fSecs = std::clamp(fSecs, 0.F, 0.18F); return fSecs; } @@ -2366,7 +2382,7 @@ Player::CrossedRows(int iLastRowCrossed, const auto iTrack = iter.Track(); switch (tn.type) { case TapNoteType_HoldHead: { - tn.HoldResult.fLife = INITIAL_HOLD_LIFE; + tn.HoldResult.fLife = initialHoldLife; if (!REQUIRE_STEP_ON_HOLD_HEADS) { const auto pn = m_pPlayerState->m_PlayerNumber; std::vector GameI; diff --git a/src/Etterna/Actor/Gameplay/Player.h b/src/Etterna/Actor/Gameplay/Player.h index f60c18c0b5..a0d0ed5445 100644 --- a/src/Etterna/Actor/Gameplay/Player.h +++ b/src/Etterna/Actor/Gameplay/Player.h @@ -33,6 +33,8 @@ AutoScreenMessage(SM_1000Combo); AutoScreenMessage(SM_ComboStopped); AutoScreenMessage(SM_ComboContinuing); +constexpr float initialHoldLife = 1.F; + /** @brief Accepts input, knocks down TapNotes that were stepped on, and keeps * score for the player. */ class Player : public ActorFrame diff --git a/src/Etterna/Actor/Gameplay/PlayerReplay.cpp b/src/Etterna/Actor/Gameplay/PlayerReplay.cpp index a087682548..ad716d63d6 100644 --- a/src/Etterna/Actor/Gameplay/PlayerReplay.cpp +++ b/src/Etterna/Actor/Gameplay/PlayerReplay.cpp @@ -281,7 +281,7 @@ PlayerReplay::CrossedRows(int iLastRowCrossed, const auto iTrack = iter.Track(); switch (tn.type) { case TapNoteType_HoldHead: { - tn.HoldResult.fLife = 1; + tn.HoldResult.fLife = initialHoldLife; break; } default: