修改特殊方块消行逻辑 以及增强彩虹方块

This commit is contained in:
2026-04-26 18:17:45 +08:00
parent 93045cc2d3
commit 23d0fa63b6
4 changed files with 95 additions and 36 deletions
+41 -24
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("更高概率生成彩虹方块。落地后覆盖行中清除数量最多的一种颜色,形成棱彩爆发") },
{ 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;
}
/**