完善彩虹方块逻辑 游戏帮助描述

This commit is contained in:
2026-04-26 17:24:41 +08:00
parent 0485cd30fe
commit 30fb10b66c
3 changed files with 35 additions and 24 deletions
+13 -7
View File
@@ -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("更高概率生成彩虹方块。落地后补齐覆盖行中 1~2 个缺口,更容易达成消行。") },
{ 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;每局只能选择一次。") },
@@ -955,7 +955,7 @@ int ClearRowAt(int row)
}
/**
* @brief 让彩虹方块尝试补齐其覆盖行内的空缺格。
* @brief 让彩虹方块尝试补齐其覆盖行内的少量空缺格。
*/
int TriggerRainbowRowCompletion(int minRow, int maxRow)
{
@@ -973,15 +973,18 @@ int TriggerRainbowRowCompletion(int minRow, int maxRow)
for (int row = minRow; row <= maxRow; row++)
{
int emptyCount = 0;
int emptyColumn = -1;
int emptyColumns[2] = {};
bool hasRainbowCell = false;
for (int x = 0; x < nGameWidth; x++)
{
if (workRegion[row][x] == 0)
{
if (emptyCount < 2)
{
emptyColumns[emptyCount] = x;
}
emptyCount++;
emptyColumn = x;
}
else if (IsRainbowBoardCell(workRegion[row][x]))
{
@@ -989,10 +992,13 @@ int TriggerRainbowRowCompletion(int minRow, int maxRow)
}
}
if (hasRainbowCell && emptyCount == 1 && emptyColumn >= 0)
if (hasRainbowCell && emptyCount > 0 && emptyCount <= 2)
{
workRegion[row][emptyColumn] = 8;
filledCellCount++;
for (int i = 0; i < emptyCount; i++)
{
workRegion[row][emptyColumns[i]] = 8;
filledCellCount++;
}
}
}