From 3f0b0406a2e121e0f6fdb064d1dd4236d8f07b97 Mon Sep 17 00:00:00 2001 From: Qi-huanye <2728290997@qq.com> Date: Sat, 25 Apr 2026 15:45:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=88=90=E9=95=BF=E6=A0=B8?= =?UTF-8?q?=E5=BF=83=E3=80=81=E5=8D=87=E7=BA=A7=E5=86=B2=E5=87=BB=E6=B3=A2?= =?UTF-8?q?=E5=92=8C=E8=BF=9B=E5=8C=96=E5=86=B2=E5=87=BB=E5=BC=BA=E5=8C=96?= =?UTF-8?q?=E9=93=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/include/Tetris.h | 2 + src/source/TetrisLogic.cpp | 96 +++++++++++++++++++++++++++++++++++-- src/source/TetrisRender.cpp | 12 ++++- 3 files changed, 105 insertions(+), 5 deletions(-) diff --git a/src/include/Tetris.h b/src/include/Tetris.h index ebd3daa..ee11101 100644 --- a/src/include/Tetris.h +++ b/src/include/Tetris.h @@ -76,6 +76,8 @@ struct PlayerStats int tetrisGambleLevel; int extremePlayerLevel; int extremeSlowTicks; + int upgradeShockwaveLevel; + int evolutionImpactLevel; int stableStructureLevel; int doubleGrowthLevel; int gamblerLevel; diff --git a/src/source/TetrisLogic.cpp b/src/source/TetrisLogic.cpp index 825cead..f6777d2 100644 --- a/src/source/TetrisLogic.cpp +++ b/src/source/TetrisLogic.cpp @@ -59,7 +59,9 @@ enum UpgradeId UPGRADE_TIME_DILATION = 27, UPGRADE_HIGH_PRESSURE = 28, UPGRADE_TETRIS_GAMBLE = 29, - UPGRADE_EXTREME_PLAYER = 30 + UPGRADE_EXTREME_PLAYER = 30, + UPGRADE_UPGRADE_SHOCKWAVE = 31, + UPGRADE_EVOLUTION_IMPACT = 32 }; static const UpgradeEntry kUpgradePool[] = @@ -91,8 +93,10 @@ static const UpgradeEntry kUpgradePool[] = { UPGRADE_HIGH_PRESSURE, 1, 70, false, _T("\u9ad8\u538b\u5956\u52b1"), _T("\u98ce\u9669"), _T("\u4e0b\u843d\u901f\u5ea6\u63d0\u9ad8 15%\uff0c\u4f46\u5f97\u5206\u4e0e EXP \u989d\u5916\u63d0\u9ad8 50%\u3002") }, { UPGRADE_TETRIS_GAMBLE, 1, 78, false, _T("\u8d4c\u547d\u56db\u6d88"), _T("\u98ce\u9669"), _T("\u666e\u901a 1~3 \u6d88\u6536\u76ca\u964d\u4f4e\uff0c\u4f46 4 \u6d88\u6536\u76ca\u66b4\u589e\u3002") }, { 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_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, 86, true, _T("\u53cc\u500d\u6210\u957f"), _T("\u7279\u6b8a"), _T("\u989d\u5916\u63d0\u9ad8\u6d88\u884c\u5f97\u5206\u4e0e EXP \u6536\u76ca\uff0c\u6bcf\u5c42\u518d\u8ffd\u52a0 15%\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") }, { UPGRADE_GAMBLER, -1, 64, true, _T("\u8d4c\u5f92"), _T("\u7279\u6b8a"), _T("\u9009\u62e9\u5f3a\u5316\u65f6\uff0c\u6709\u6982\u7387\u53cc\u500d\u751f\u6548\uff0c\u4e5f\u6709\u6982\u7387\u5b8c\u5168\u843d\u7a7a\u3002") } }; @@ -273,6 +277,8 @@ static void ResetPlayerStats(PlayerStats& stats, bool useRogueRules) stats.tetrisGambleLevel = 0; stats.extremePlayerLevel = 0; stats.extremeSlowTicks = 0; + stats.upgradeShockwaveLevel = 0; + stats.evolutionImpactLevel = 0; stats.stableStructureLevel = 0; stats.doubleGrowthLevel = 0; stats.gamblerLevel = 0; @@ -360,6 +366,10 @@ static int GetUpgradeCurrentLevel(int upgradeId) return rogueStats.tetrisGambleLevel; case UPGRADE_EXTREME_PLAYER: return rogueStats.extremePlayerLevel; + case UPGRADE_UPGRADE_SHOCKWAVE: + return rogueStats.upgradeShockwaveLevel; + case UPGRADE_EVOLUTION_IMPACT: + return rogueStats.evolutionImpactLevel; case UPGRADE_STABLE_STRUCTURE: return rogueStats.stableStructureLevel; case UPGRADE_DOUBLE_GROWTH: @@ -531,6 +541,12 @@ static int GetUpgradeDynamicWeight(const UpgradeEntry& entry) case UPGRADE_EXTREME_PLAYER: weight += 36; break; + case UPGRADE_UPGRADE_SHOCKWAVE: + weight += 34; + break; + case UPGRADE_EVOLUTION_IMPACT: + weight += 40; + break; case UPGRADE_STABLE_STRUCTURE: if (boardIsDangerous) { @@ -650,6 +666,21 @@ static bool IsUpgradeSelectable(const UpgradeEntry& entry) return rogueStats.highPressureLevel > 0 && rogueStats.tetrisGambleLevel > 0 && rogueStats.extremePlayerLevel == 0; } + if (entry.id == UPGRADE_UPGRADE_SHOCKWAVE) + { + return rogueStats.scoreUpgradeLevel > 0 && + rogueStats.expUpgradeLevel > 0 && + rogueStats.pressureReliefLevel > 0 && + rogueStats.upgradeShockwaveLevel == 0; + } + + if (entry.id == UPGRADE_EVOLUTION_IMPACT) + { + return rogueStats.upgradeShockwaveLevel > 0 && + rogueStats.doubleGrowthLevel > 0 && + rogueStats.evolutionImpactLevel == 0; + } + if (entry.repeatable) { return true; @@ -996,6 +1027,19 @@ static int ApplyLevelProgress(PlayerStats& stats) return levelUps; } +static int TriggerUpgradeShockwave(int rowsToClear) +{ + int clearedRows = 0; + + for (int i = 0; i < rowsToClear; i++) + { + DeleteOneLine(nGameHeight - 1); + clearedRows++; + } + + return clearedRows; +} + static void FillUpgradeOptions() { int selectableIndexes[kUpgradePoolSize] = { 0 }; @@ -1262,11 +1306,19 @@ static void ApplyUpgradeById(int upgradeId, int targetPieceType, int applyCount) rogueStats.extremePlayerLevel = 1; currentFallInterval = GetRogueFallInterval(); break; + case UPGRADE_UPGRADE_SHOCKWAVE: + rogueStats.upgradeShockwaveLevel = 1; + break; + case UPGRADE_EVOLUTION_IMPACT: + rogueStats.evolutionImpactLevel = 1; + break; case UPGRADE_STABLE_STRUCTURE: rogueStats.stableStructureLevel += applyCount; break; case UPGRADE_DOUBLE_GROWTH: - rogueStats.doubleGrowthLevel += applyCount; + rogueStats.doubleGrowthLevel = 1; + rogueStats.scoreMultiplierPercent += 15; + rogueStats.expMultiplierPercent += 15; break; case UPGRADE_PIECE_TUNING: if (targetPieceType >= 0 && targetPieceType < 7) @@ -1535,6 +1587,44 @@ static void ApplyLineClearResult(int linesCleared) upgradeUiState.pendingCount += levelUps; tScore = rogueStats.score; + if (levelUps > 0) + { + int shockwaveRows = 0; + if (rogueStats.evolutionImpactLevel > 0) + { + shockwaveRows = 3; + rogueStats.feverTicks = 10; + currentFallInterval = GetRogueFallInterval(); + } + else if (rogueStats.upgradeShockwaveLevel > 0) + { + shockwaveRows = 2; + } + + if (shockwaveRows > 0) + { + int clearedRows = TriggerUpgradeShockwave(shockwaveRows); + TCHAR shockwaveDetail[128]; + + if (rogueStats.evolutionImpactLevel > 0) + { + _stprintf_s( + shockwaveDetail, + _T("\u5347\u7ea7\u6e05\u9664\u5e95\u90e8 %d \u884c\uff0c\u5e76\u83b7\u5f97 10 \u79d2\u53cc\u500d EXP\u3002"), + clearedRows); + SetFeedbackMessage(_T("\u8fdb\u5316\u51b2\u51fb\u89e6\u53d1"), shockwaveDetail, 14); + } + else + { + _stprintf_s( + shockwaveDetail, + _T("\u5347\u7ea7\u6e05\u9664\u5e95\u90e8 %d \u884c\uff0c\u89e6\u53d1\u5347\u7ea7\u51b2\u51fb\u6ce2\u3002"), + clearedRows); + SetFeedbackMessage(_T("\u5347\u7ea7\u51b2\u51fb\u6ce2\u89e6\u53d1"), shockwaveDetail, 12); + } + } + } + TCHAR feedbackTitle[64]; TCHAR feedbackDetail[128]; if (feedbackState.visibleTicks <= 0) diff --git a/src/source/TetrisRender.cpp b/src/source/TetrisRender.cpp index be3f0df..44f950d 100644 --- a/src/source/TetrisRender.cpp +++ b/src/source/TetrisRender.cpp @@ -797,7 +797,7 @@ void TDrawScreen(HDC hdc, HWND hWnd) if (rogueStats.doubleGrowthLevel > 0) { TCHAR growthText[96]; - _stprintf_s(growthText, _T("\u53cc\u500d\u6210\u957f +%d%%"), rogueStats.doubleGrowthLevel * 15); + _stprintf_s(growthText, _T("\u6210\u957f\u6838\u5fc3 +15%% Score / +15%% EXP")); TextOut(hdc, combatRect.left + SS(18), combatRect.top + SS(178), growthText, lstrlen(growthText)); } @@ -950,13 +950,21 @@ void TDrawScreen(HDC hdc, HWND hWnd) { _stprintf_s(upgradeSummary + lstrlen(upgradeSummary), 512 - lstrlen(upgradeSummary), _T("\u6781\u9650\u73a9\u5bb6 Lv.1\r\n")); } + if (rogueStats.upgradeShockwaveLevel > 0) + { + _stprintf_s(upgradeSummary + lstrlen(upgradeSummary), 512 - lstrlen(upgradeSummary), _T("\u5347\u7ea7\u51b2\u51fb\u6ce2 Lv.1\r\n")); + } + if (rogueStats.evolutionImpactLevel > 0) + { + _stprintf_s(upgradeSummary + lstrlen(upgradeSummary), 512 - lstrlen(upgradeSummary), _T("\u8fdb\u5316\u51b2\u51fb 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); } if (rogueStats.doubleGrowthLevel > 0) { - _stprintf_s(upgradeSummary + lstrlen(upgradeSummary), 512 - lstrlen(upgradeSummary), _T("\u53cc\u500d\u6210\u957f Lv.%d\r\n"), rogueStats.doubleGrowthLevel); + _stprintf_s(upgradeSummary + lstrlen(upgradeSummary), 512 - lstrlen(upgradeSummary), _T("\u6210\u957f\u6838\u5fc3 Lv.1\r\n")); } int tunedPieceCount = 0; for (int pieceType = 0; pieceType < 7; pieceType++)