From 92e5fe249243e7ecc52432752922acbd8ee7867f Mon Sep 17 00:00:00 2001 From: Qi-huanye <2728290997@qq.com> Date: Sat, 25 Apr 2026 16:04:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=93=8D=E6=8E=A7=E5=A4=A7?= =?UTF-8?q?=E5=B8=88=E8=BF=9B=E5=8C=96=E5=BC=BA=E5=8C=96=E5=8F=8A=E5=85=B6?= =?UTF-8?q?Hold=E5=87=8F=E9=80=9F=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/include/Tetris.h | 2 ++ src/source/Tetris.cpp | 8 ++++++++ src/source/TetrisLogic.cpp | 36 +++++++++++++++++++++++++++++++++++- src/source/TetrisRender.cpp | 11 +++++++++++ 4 files changed, 56 insertions(+), 1 deletion(-) diff --git a/src/include/Tetris.h b/src/include/Tetris.h index ee11101..0d1b0ff 100644 --- a/src/include/Tetris.h +++ b/src/include/Tetris.h @@ -78,6 +78,8 @@ struct PlayerStats int extremeSlowTicks; int upgradeShockwaveLevel; int evolutionImpactLevel; + int controlMasterLevel; + int holdSlowTicks; int stableStructureLevel; int doubleGrowthLevel; int gamblerLevel; diff --git a/src/source/Tetris.cpp b/src/source/Tetris.cpp index 8c33020..bebb569 100644 --- a/src/source/Tetris.cpp +++ b/src/source/Tetris.cpp @@ -175,6 +175,14 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) shouldRefresh = true; } + if (currentMode == MODE_ROGUE && rogueStats.holdSlowTicks > 0) + { + rogueStats.holdSlowTicks--; + currentFallInterval = GetRogueFallInterval(); + ResetGameTimer(hWnd); + shouldRefresh = true; + } + if (currentScreen == SCREEN_PLAYING && !suspendFlag && !gameOverFlag) diff --git a/src/source/TetrisLogic.cpp b/src/source/TetrisLogic.cpp index f6777d2..cfd2a35 100644 --- a/src/source/TetrisLogic.cpp +++ b/src/source/TetrisLogic.cpp @@ -61,7 +61,8 @@ enum UpgradeId UPGRADE_TETRIS_GAMBLE = 29, UPGRADE_EXTREME_PLAYER = 30, UPGRADE_UPGRADE_SHOCKWAVE = 31, - UPGRADE_EVOLUTION_IMPACT = 32 + UPGRADE_EVOLUTION_IMPACT = 32, + UPGRADE_CONTROL_MASTER = 33 }; static const UpgradeEntry kUpgradePool[] = @@ -95,6 +96,7 @@ static const UpgradeEntry kUpgradePool[] = { UPGRADE_EXTREME_PLAYER, 1, 114, false, _T("\u6781\u9650\u73a9\u5bb6"), _T("\u8fdb\u5316"), _T("\u7ec4\u5408\u9ad8\u538b\u4e0e\u8d4c\u547d\u56db\u6d88\uff0c\u901f\u5ea6\u8fdb\u4e00\u6b65\u63d0\u9ad8\uff0c\u56db\u6d88\u540e\u77ed\u6682\u7f13\u901f\u3002") }, { UPGRADE_UPGRADE_SHOCKWAVE, 1, 106, false, _T("\u5347\u7ea7\u51b2\u51fb\u6ce2"), _T("\u8fdb\u9636"), _T("\u5373\u5c06\u5347\u7ea7\u65f6\u81ea\u52a8\u6e05\u9664\u5e95\u90e8 2 \u884c\uff0c\u5f3a\u5316\u5347\u7ea7\u8282\u594f\u53cd\u9988\u3002") }, { UPGRADE_EVOLUTION_IMPACT, 1, 118, false, _T("\u8fdb\u5316\u51b2\u51fb"), _T("\u8fdb\u5316"), _T("\u5347\u7ea7\u65f6\u6e05\u9664\u5e95\u90e8 3 \u884c\uff0c\u5e76\u83b7\u5f97 10 \u79d2\u53cc\u500d EXP\u3002") }, + { UPGRADE_CONTROL_MASTER, 1, 112, false, _T("\u64cd\u63a7\u5927\u5e08"), _T("\u8fdb\u5316"), _T("Hold \u540e\u77ed\u6682\u964d\u4f4e\u4e0b\u843d\u901f\u5ea6\uff0c\u5e76\u989d\u5916\u589e\u52a0 1 \u4e2a\u9884\u89c8\u65b9\u5757\u3002") }, { UPGRADE_STABLE_STRUCTURE, -1, 72, true, _T("\u7a33\u5b9a\u7ed3\u6784"), _T("\u7279\u6b8a"), _T("\u843d\u5730\u540e\u5c0f\u6982\u7387\u81ea\u52a8\u586b\u8865\u90bb\u8fd1\u7a7a\u6d1e\uff0c\u63d0\u9ad8\u76d8\u9762\u7ed3\u6784\u7a33\u5b9a\u6027\u3002") }, { UPGRADE_DOUBLE_GROWTH, 1, 84, false, _T("\u6210\u957f\u6838\u5fc3"), _T("\u6210\u957f"), _T("\u6c38\u4e45\u83b7\u5f97 +15% \u5f97\u5206\u4e0e +15% EXP\uff0c\u53ea\u80fd\u9009\u62e9\u4e00\u6b21\u3002") }, { UPGRADE_PIECE_TUNING, -1, 64, true, _T("\u65b9\u5757\u6539\u9020"), _T("\u7279\u6b8a"), _T("\u9009\u62e9\u4e00\u79cd\u65b9\u5757\uff0c\u964d\u4f4e\u5176\u540e\u7eed\u51fa\u73b0\u6982\u7387\u3002") }, @@ -279,6 +281,8 @@ static void ResetPlayerStats(PlayerStats& stats, bool useRogueRules) stats.extremeSlowTicks = 0; stats.upgradeShockwaveLevel = 0; stats.evolutionImpactLevel = 0; + stats.controlMasterLevel = 0; + stats.holdSlowTicks = 0; stats.stableStructureLevel = 0; stats.doubleGrowthLevel = 0; stats.gamblerLevel = 0; @@ -370,6 +374,8 @@ static int GetUpgradeCurrentLevel(int upgradeId) return rogueStats.upgradeShockwaveLevel; case UPGRADE_EVOLUTION_IMPACT: return rogueStats.evolutionImpactLevel; + case UPGRADE_CONTROL_MASTER: + return rogueStats.controlMasterLevel; case UPGRADE_STABLE_STRUCTURE: return rogueStats.stableStructureLevel; case UPGRADE_DOUBLE_GROWTH: @@ -547,6 +553,9 @@ static int GetUpgradeDynamicWeight(const UpgradeEntry& entry) case UPGRADE_EVOLUTION_IMPACT: weight += 40; break; + case UPGRADE_CONTROL_MASTER: + weight += 34; + break; case UPGRADE_STABLE_STRUCTURE: if (boardIsDangerous) { @@ -681,6 +690,13 @@ static bool IsUpgradeSelectable(const UpgradeEntry& entry) rogueStats.evolutionImpactLevel == 0; } + if (entry.id == UPGRADE_CONTROL_MASTER) + { + return rogueStats.perfectRotateLevel > 0 && + rogueStats.holdUnlocked > 0 && + rogueStats.controlMasterLevel == 0; + } + if (entry.repeatable) { return true; @@ -1177,6 +1193,11 @@ int GetRogueFallInterval() baseInterval += 180; } + if (rogueStats.holdSlowTicks > 0) + { + baseInterval += 140; + } + if (baseInterval < 120) { baseInterval = 120; @@ -1312,6 +1333,14 @@ static void ApplyUpgradeById(int upgradeId, int targetPieceType, int applyCount) case UPGRADE_EVOLUTION_IMPACT: rogueStats.evolutionImpactLevel = 1; break; + case UPGRADE_CONTROL_MASTER: + rogueStats.controlMasterLevel = 1; + if (rogueStats.previewCount < 3) + { + rogueStats.previewCount++; + } + rogueStats.previewUpgradeLevel = rogueStats.previewCount - 1; + break; case UPGRADE_STABLE_STRUCTURE: rogueStats.stableStructureLevel += applyCount; break; @@ -2410,6 +2439,11 @@ void HoldCurrentPiece() point = GetSpawnPoint(type); target = point; + if (currentMode == MODE_ROGUE && rogueStats.controlMasterLevel > 0) + { + rogueStats.holdSlowTicks = 4; + currentFallInterval = GetRogueFallInterval(); + } if (!IsPiecePlacementValid(type, state, point)) { diff --git a/src/source/TetrisRender.cpp b/src/source/TetrisRender.cpp index 44f950d..b602544 100644 --- a/src/source/TetrisRender.cpp +++ b/src/source/TetrisRender.cpp @@ -784,6 +784,13 @@ void TDrawScreen(HDC hdc, HWND hWnd) TextOut(hdc, combatRect.left + SS(18), combatRect.top + SS(722), extremeText, lstrlen(extremeText)); } + if (rogueStats.controlMasterLevel > 0) + { + TCHAR controlText[96]; + _stprintf_s(controlText, _T("\u64cd\u63a7\u5927\u5e08 Hold \u7f13\u901f\u5269\u4f59 %d"), rogueStats.holdSlowTicks); + TextOut(hdc, combatRect.left + SS(18), combatRect.top + SS(754), controlText, lstrlen(controlText)); + } + if (rogueStats.chainBlastLevel > 0) { TextOut(hdc, combatRect.left + SS(18), combatRect.top + SS(274), _T("\u8fde\u9501\u7206\u7834 \u5df2\u89e3\u9501"), lstrlen(_T("\u8fde\u9501\u7206\u7834 \u5df2\u89e3\u9501"))); @@ -958,6 +965,10 @@ void TDrawScreen(HDC hdc, HWND hWnd) { _stprintf_s(upgradeSummary + lstrlen(upgradeSummary), 512 - lstrlen(upgradeSummary), _T("\u8fdb\u5316\u51b2\u51fb Lv.1\r\n")); } + if (rogueStats.controlMasterLevel > 0) + { + _stprintf_s(upgradeSummary + lstrlen(upgradeSummary), 512 - lstrlen(upgradeSummary), _T("\u64cd\u63a7\u5927\u5e08 Lv.1\r\n")); + } if (rogueStats.stableStructureLevel > 0) { _stprintf_s(upgradeSummary + lstrlen(upgradeSummary), 512 - lstrlen(upgradeSummary), _T("\u7a33\u5b9a\u7ed3\u6784 Lv.%d\r\n"), rogueStats.stableStructureLevel);