From 23d0fa63b6a68510f88f3639d7134bf7452a8049 Mon Sep 17 00:00:00 2001 From: Qi-huanye <2728290997@qq.com> Date: Sun, 26 Apr 2026 18:17:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=B9=E6=AE=8A=E6=96=B9?= =?UTF-8?q?=E5=9D=97=E6=B6=88=E8=A1=8C=E9=80=BB=E8=BE=91=20=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E5=A2=9E=E5=BC=BA=E5=BD=A9=E8=99=B9=E6=96=B9=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/include/TetrisLogicInternal.h | 9 ++++- src/source/TetrisLogic.cpp | 55 +++++++++++++++++++++----- src/source/TetrisRender.cpp | 2 +- src/source/TetrisRogue.cpp | 65 +++++++++++++++++++------------ 4 files changed, 95 insertions(+), 36 deletions(-) diff --git a/src/include/TetrisLogicInternal.h b/src/include/TetrisLogicInternal.h index c010260..4a73210 100644 --- a/src/include/TetrisLogicInternal.h +++ b/src/include/TetrisLogicInternal.h @@ -40,9 +40,9 @@ bool IsRainbowBoardCell(int cellValue); int TriggerMiniBlackHole(int maxCellsToClear); /** - * @brief 触发彩虹方块棱彩复制效果并返回变色格数。 + * @brief 触发彩虹方块棱彩爆发效果并返回清除格数。 */ -int TriggerRainbowPrismCopy(int minRow, int maxRow); +int TriggerRainbowPrismBurst(int minRow, int maxRow); /** * @brief 引爆清屏炸弹并返回清除格数。 @@ -59,6 +59,11 @@ int ClearExplosiveAreaAt(int centerY, int centerX); */ int ClearColumnAt(int column); +/** + * @brief 使用指定颜色特效清除指定列并返回清除格数。 + */ +int ClearColumnAtWithColor(int column, COLORREF flashColor); + /** * @brief 清除指定行并返回清除格数。 */ diff --git a/src/source/TetrisLogic.cpp b/src/source/TetrisLogic.cpp index ce67a84..4d00d73 100644 --- a/src/source/TetrisLogic.cpp +++ b/src/source/TetrisLogic.cpp @@ -382,9 +382,11 @@ void DropDown() void Fixing() { bool overflowTop = false; + Point fixedCells[4] = {}; + int fixedCellCount = 0; Point explosiveCells[4] = {}; int explosiveCellCount = 0; - int rainbowCopiedCount = 0; + int rainbowClearedCount = 0; pendingChainBombFollowup = false; for (int i = 0; i < 4; i++) @@ -406,6 +408,12 @@ void Fixing() if (fixY >= 0 && fixY < GetRoguePlayableHeight() && fixX >= 0 && fixX < nGameWidth) { workRegion[fixY][fixX] = currentPieceIsRainbow ? 8 : bricks[type][state][i][j]; + if (fixedCellCount < 4) + { + fixedCells[fixedCellCount].x = fixX; + fixedCells[fixedCellCount].y = fixY; + fixedCellCount++; + } if (currentPieceIsExplosive && explosiveCellCount < 4) { explosiveCells[explosiveCellCount].x = fixX; @@ -419,15 +427,23 @@ void Fixing() if (!overflowTop && currentPieceIsRainbow) { - rainbowCopiedCount = TriggerRainbowPrismCopy(point.y, point.y + 3); - TCHAR rainbowDetail[128]; - if (rainbowCopiedCount > 0) + rainbowClearedCount = TriggerRainbowPrismBurst(point.y, point.y + 3); + int rainbowScore = 0; + int rainbowExp = 0; + if (currentMode == MODE_ROGUE && rainbowClearedCount > 0) { - _stprintf_s(rainbowDetail, _T("棱彩共鸣,%d 格复制为覆盖行中的主色方块。"), rainbowCopiedCount); + AwardRogueSkillClearRewards(rainbowClearedCount, rainbowScore, rainbowExp, false); + ApplyBoardGravity(); + } + + TCHAR rainbowDetail[128]; + if (rainbowClearedCount > 0) + { + _stprintf_s(rainbowDetail, _T("棱彩爆发清除覆盖行主色 %d 格 +%d 分 +%d EXP"), rainbowClearedCount, rainbowScore, rainbowExp); } else { - _stprintf_s(rainbowDetail, _T("覆盖行没有可复制的主色,彩虹能量保留为特殊固定块。")); + _stprintf_s(rainbowDetail, _T("覆盖行没有可爆发的主色,彩虹能量保留为特殊固定块。")); } SetFeedbackMessage(_T("彩虹方块"), rainbowDetail, 10); } @@ -507,6 +523,15 @@ void Fixing() if (currentPieceIsLaser) { int laserColumn = point.x + 1; + if (fixedCellCount > 0) + { + int xSum = 0; + for (int i = 0; i < fixedCellCount; i++) + { + xSum += fixedCells[i].x; + } + laserColumn = (xSum + fixedCellCount / 2) / fixedCellCount; + } if (laserColumn < 0) { laserColumn = 0; @@ -525,7 +550,7 @@ void Fixing() ApplyBoardGravity(); TCHAR laserDetail[128]; - _stprintf_s(laserDetail, _T("激光贯穿一列,清除 %d 格 +%d 分 +%d EXP"), laserCellsCleared, laserScore, laserExp); + _stprintf_s(laserDetail, _T("激光贯穿第 %d 列,清除 %d 格 +%d 分 +%d EXP"), laserColumn + 1, laserCellsCleared, laserScore, laserExp); SetFeedbackMessage(_T("棱镜激光"), laserDetail, 12); } } @@ -534,6 +559,18 @@ void Fixing() { int crossRow = point.y + 1; int crossColumn = point.x + 1; + if (fixedCellCount > 0) + { + int xSum = 0; + int ySum = 0; + for (int i = 0; i < fixedCellCount; i++) + { + xSum += fixedCells[i].x; + ySum += fixedCells[i].y; + } + crossColumn = (xSum + fixedCellCount / 2) / fixedCellCount; + crossRow = (ySum + fixedCellCount / 2) / fixedCellCount; + } if (crossRow < 0) { crossRow = 0; @@ -552,7 +589,7 @@ void Fixing() } int crossCellsCleared = ClearRowAt(crossRow); - int columnCellsCleared = ClearColumnAt(crossColumn); + int columnCellsCleared = ClearColumnAtWithColor(crossColumn, RGB(196, 255, 132)); if (workRegion[crossRow][crossColumn] == 0 && columnCellsCleared > 0) { // center cell may already be counted by row clear @@ -567,7 +604,7 @@ void Fixing() ApplyBoardGravity(); TCHAR crossDetail[128]; - _stprintf_s(crossDetail, _T("十字冲击清除 %d 格 +%d 分 +%d EXP"), totalCrossCleared, crossScore, crossExp); + _stprintf_s(crossDetail, _T("十字冲击第 %d 行 / 第 %d 列,清除 %d 格 +%d 分 +%d EXP"), crossRow + 1, crossColumn + 1, totalCrossCleared, crossScore, crossExp); SetFeedbackMessage(_T("十字方块"), crossDetail, 12); } } diff --git a/src/source/TetrisRender.cpp b/src/source/TetrisRender.cpp index f5812dc..4f41142 100644 --- a/src/source/TetrisRender.cpp +++ b/src/source/TetrisRender.cpp @@ -698,7 +698,7 @@ void TDrawScreen(HDC hdc, HWND hWnd) _T("赏金纹章:得分+20%,可叠加\r\n成长印记:EXP+25%,可叠加\r\n缓坠羽翼:自然下落变慢\r\n连击律动:连续消行追加奖励\r\n先见之眼:下一方块预览+1"), _T("最后一搏:首次濒死清底3行\r\n备用仓:C / Shift 暂存方块\r\n完美旋转:旋转受阻时左右修正\r\n时间缓流:高堆叠自动减速\r\n空中换形:V 将当前方块变 I"), _T("卸压清场:立刻清最高占用行\r\n底线清道夫:消行充能后清底\r\n清屏炸弹:X 清底5行,消行充能\r\n黑洞奇点:Z 吞噬数量最多的方块"), - _T("爆破核心:橙红边框,落地清 3x3\r\n棱镜激光:青色边框,落地清整列\r\n十字方块:绿色边框,落地清行列\r\n彩虹方块:紫色边框,复制覆盖行主色\r\n方块改造:提高 I 块生成概率"), + _T("爆破核心:橙红边框,落地清 3x3\r\n棱镜激光:青色边框,按落地中心清整列\r\n十字方块:绿色边框,按落地中心清行列\r\n彩虹方块:紫色边框,清覆盖行主色\r\n方块改造:提高 I 块生成概率"), _T("连锁火花:消行后追加随机破坏\r\n连环炸弹:爆破扩大为 5x5\r\n雷霆四消:三消/四消额外轰击\r\n雷霆棱镜:三消/四消追加激光"), _T("狂热节拍:累计12行进入狂热\r\n怒火连段:连击越高倍率越高\r\n无尽狂热:狂热中消行延时\r\n高压悬赏:更快但收益更高\r\n豪赌四消 / 极限玩家:偏向四消爆发"), _T("双重抉择:升级可多选1个\r\n命运轮盘:6选2但含诅咒\r\n升级冲击波:升级后清底2行\r\n进化冲击:升级后清底3行\r\n成长核心:永久得分/EXP +15%"), diff --git a/src/source/TetrisRogue.cpp b/src/source/TetrisRogue.cpp index a0be28b..c14b337 100644 --- a/src/source/TetrisRogue.cpp +++ b/src/source/TetrisRogue.cpp @@ -89,7 +89,7 @@ static const UpgradeEntry kUpgradePool[] = { UPGRADE_CROSS_PIECE, -1, 84, true, _T("十字方块"), _T("爆发"), _T("大幅提高十字方块出现率。十字方块落地后清除所在行与所在列。") }, { UPGRADE_BLACK_HOLE, 1, 88, false, _T("黑洞奇点"), _T("特殊"), _T("获得 2 次黑洞。按 Z 吞噬棋盘上数量最多的一种固定方块。") }, { UPGRADE_AIR_RESHAPE, 1, 82, false, _T("空中换形"), _T("操作"), _T("获得 2 次换形。按 V 将正在下落的方块重塑为 I 块。") }, - { UPGRADE_RAINBOW_PIECE, 1, 84, false, _T("彩虹方块"), _T("爆发"), _T("更高概率生成彩虹方块。落地后复制覆盖行中最常见的方块颜色,形成棱彩共鸣。") }, + { UPGRADE_RAINBOW_PIECE, 1, 84, false, _T("彩虹方块"), _T("爆发"), _T("更高概率生成彩虹方块。落地后在覆盖行中清除数量最多的一种颜色,形成棱彩爆发。") }, { UPGRADE_VOID_CORE, 1, 112, false, _T("虚空核心"), _T("进化"), _T("黑洞后额外生成 1 个彩虹方块;彩虹消行时撕开小型黑洞。") }, { UPGRADE_STABLE_STRUCTURE, -1, 72, true, _T("稳定结构"), _T("特殊"), _T("落地后有小概率填补邻近空洞,让阵型更加稳固。") }, { UPGRADE_DOUBLE_GROWTH, 1, 84, false, _T("成长核心"), _T("成长"), _T("永久获得 +15% 得分与 +15% EXP;每局只能选择一次。") }, @@ -746,7 +746,7 @@ static bool RollCrossPiece() } /** - * @brief 根据彩虹强化等级随机判定当前方块是否获得棱彩复制特性。 + * @brief 根据彩虹强化等级随机判定当前方块是否获得棱彩爆发特性。 */ static bool RollRainbowPiece() { @@ -896,6 +896,14 @@ int ClearExplosiveAreaAt(int centerY, int centerX) * @brief 清除指定列中的所有固定方块并返回清除数量。 */ int ClearColumnAt(int column) +{ + return ClearColumnAtWithColor(column, RGB(120, 232, 255)); +} + +/** + * @brief 使用指定颜色特效清除指定列并返回清除数量。 + */ +int ClearColumnAtWithColor(int column, COLORREF flashColor) { int clearedCellCount = 0; Point clearedCells[20] = {}; @@ -919,7 +927,7 @@ int ClearColumnAt(int column) } } - TriggerColoredCellClearEffect(clearedCells, clearedCellCount, RGB(120, 232, 255), false); + TriggerColoredCellClearEffect(clearedCells, clearedCellCount, flashColor, false); return clearedCellCount; } @@ -955,11 +963,13 @@ int ClearRowAt(int row) } /** - * @brief 让彩虹方块复制覆盖行内最常见的固定方块颜色。 + * @brief 让彩虹方块清除覆盖行内最常见的固定方块颜色。 */ -int TriggerRainbowPrismCopy(int minRow, int maxRow) +int TriggerRainbowPrismBurst(int minRow, int maxRow) { - int copiedCellCount = 0; + int colorCounts[8] = {}; + int clearedCellCount = 0; + Point clearedCells[40] = {}; if (minRow < 0) { @@ -972,10 +982,6 @@ int TriggerRainbowPrismCopy(int minRow, int maxRow) for (int row = minRow; row <= maxRow; row++) { - int colorCounts[8] = {}; - int targetColor = 0; - int targetColorCount = 0; - for (int x = 0; x < nGameWidth; x++) { int cell = workRegion[row][x]; @@ -984,32 +990,43 @@ int TriggerRainbowPrismCopy(int minRow, int maxRow) colorCounts[cell]++; } } + } - for (int cell = 1; cell <= 7; cell++) + int targetColor = 0; + int targetColorCount = 0; + for (int cell = 1; cell <= 7; cell++) + { + if (colorCounts[cell] > targetColorCount) { - if (colorCounts[cell] > targetColorCount) - { - targetColor = cell; - targetColorCount = colorCounts[cell]; - } + targetColor = cell; + targetColorCount = colorCounts[cell]; } + } - if (targetColor == 0) - { - continue; - } + if (targetColor == 0) + { + return 0; + } + for (int row = minRow; row <= maxRow; row++) + { for (int x = 0; x < nGameWidth; x++) { - if (IsRainbowBoardCell(workRegion[row][x])) + if (workRegion[row][x] == targetColor) { - workRegion[row][x] = targetColor; - copiedCellCount++; + if (clearedCellCount < 40) + { + clearedCells[clearedCellCount].x = x; + clearedCells[clearedCellCount].y = row; + } + workRegion[row][x] = 0; + clearedCellCount++; } } } - return copiedCellCount; + TriggerColoredCellClearEffect(clearedCells, clearedCellCount < 40 ? clearedCellCount : 40, RGB(186, 126, 255), true); + return clearedCellCount; } /**