修改彩虹方块效果

This commit is contained in:
2026-04-26 18:02:20 +08:00
parent 8e68d9c712
commit 93045cc2d3
4 changed files with 39 additions and 32 deletions
+30 -23
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("更高概率生成彩虹方块。落地后补齐覆盖行中 1~2 个缺口,更容易达成消行") },
{ 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()
{
@@ -955,11 +955,11 @@ int ClearRowAt(int row)
}
/**
* @brief 让彩虹方块尝试补齐其覆盖行内的少量空缺格
* @brief 让彩虹方块复制覆盖行内最常见的固定方块颜色
*/
int TriggerRainbowRowCompletion(int minRow, int maxRow)
int TriggerRainbowPrismCopy(int minRow, int maxRow)
{
int filledCellCount = 0;
int copiedCellCount = 0;
if (minRow < 0)
{
@@ -972,37 +972,44 @@ int TriggerRainbowRowCompletion(int minRow, int maxRow)
for (int row = minRow; row <= maxRow; row++)
{
int emptyCount = 0;
int emptyColumns[2] = {};
bool hasRainbowCell = false;
int colorCounts[8] = {};
int targetColor = 0;
int targetColorCount = 0;
for (int x = 0; x < nGameWidth; x++)
{
if (workRegion[row][x] == 0)
int cell = workRegion[row][x];
if (cell >= 1 && cell <= 7)
{
if (emptyCount < 2)
{
emptyColumns[emptyCount] = x;
}
emptyCount++;
}
else if (IsRainbowBoardCell(workRegion[row][x]))
{
hasRainbowCell = true;
colorCounts[cell]++;
}
}
if (hasRainbowCell && emptyCount > 0 && emptyCount <= 2)
for (int cell = 1; cell <= 7; cell++)
{
for (int i = 0; i < emptyCount; i++)
if (colorCounts[cell] > targetColorCount)
{
workRegion[row][emptyColumns[i]] = 8;
filledCellCount++;
targetColor = cell;
targetColorCount = colorCounts[cell];
}
}
if (targetColor == 0)
{
continue;
}
for (int x = 0; x < nGameWidth; x++)
{
if (IsRainbowBoardCell(workRegion[row][x]))
{
workRegion[row][x] = targetColor;
copiedCellCount++;
}
}
}
return filledCellCount;
return copiedCellCount;
}
/**