增强彩虹方块 重新设计效果

This commit is contained in:
2026-04-26 18:29:58 +08:00
parent 23d0fa63b6
commit 667d657ee1
4 changed files with 126 additions and 64 deletions
+79 -30
View File
@@ -89,8 +89,8 @@ 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_VOID_CORE, 1, 112, false, _T("虚空核心"), _T("进化"), _T("黑洞后额外生成 1 个彩虹方块;彩虹消行时撕开小型黑洞。") },
{ 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;每局只能选择一次。") },
{ UPGRADE_PIECE_TUNING, -1, 64, true, _T("方块改造"), _T("特殊"), _T("固定提高 I 方块的生成概率。") },
@@ -746,7 +746,7 @@ static bool RollCrossPiece()
}
/**
* @brief 根据彩虹强化等级随机判定当前方块是否获得棱彩爆发特性。
* @brief 根据彩虹强化等级随机判定当前方块是否获得行清除与染色特性。
*/
static bool RollRainbowPiece()
{
@@ -963,14 +963,23 @@ int ClearRowAt(int row)
}
/**
* @brief 彩虹方块清除覆盖行内最常见的固定方块颜色
* @brief 触发彩虹方块清除覆盖行染色效果
*/
int TriggerRainbowPrismBurst(int minRow, int maxRow)
int TriggerRainbowColorShift(int anchorRow, int minRow, int maxRow, int& recoloredCount)
{
int colorCounts[8] = {};
recoloredCount = 0;
int clearedCellCount = 0;
Point clearedCells[40] = {};
Point clearedCells[10] = {};
Point recoloredCells[40] = {};
if (anchorRow < 0)
{
anchorRow = 0;
}
if (anchorRow >= GetRoguePlayableHeight())
{
anchorRow = GetRoguePlayableHeight() - 1;
}
if (minRow < 0)
{
minRow = 0;
@@ -980,52 +989,92 @@ int TriggerRainbowPrismBurst(int minRow, int maxRow)
maxRow = GetRoguePlayableHeight() - 1;
}
for (int row = minRow; row <= maxRow; row++)
int rowColorCounts[8] = {};
for (int x = 0; x < nGameWidth; x++)
{
for (int x = 0; x < nGameWidth; x++)
int cell = workRegion[anchorRow][x];
if (cell >= 1 && cell <= 7)
{
int cell = workRegion[row][x];
if (cell >= 1 && cell <= 7)
{
colorCounts[cell]++;
}
rowColorCounts[cell]++;
}
}
int targetColor = 0;
int targetColorCount = 0;
int rowTargetColor = 0;
int rowTargetCount = 0;
for (int cell = 1; cell <= 7; cell++)
{
if (colorCounts[cell] > targetColorCount)
if (rowColorCounts[cell] > rowTargetCount)
{
targetColor = cell;
targetColorCount = colorCounts[cell];
rowTargetColor = cell;
rowTargetCount = rowColorCounts[cell];
}
}
if (targetColor == 0)
{
return 0;
}
for (int row = minRow; row <= maxRow; row++)
if (rowTargetColor > 0)
{
for (int x = 0; x < nGameWidth; x++)
{
if (workRegion[row][x] == targetColor)
if (workRegion[anchorRow][x] == rowTargetColor)
{
if (clearedCellCount < 40)
if (clearedCellCount < 10)
{
clearedCells[clearedCellCount].x = x;
clearedCells[clearedCellCount].y = row;
clearedCells[clearedCellCount].y = anchorRow;
}
workRegion[row][x] = 0;
workRegion[anchorRow][x] = 0;
clearedCellCount++;
}
}
}
TriggerColoredCellClearEffect(clearedCells, clearedCellCount < 40 ? clearedCellCount : 40, RGB(186, 126, 255), true);
int boardColorCounts[8] = {};
for (int y = 0; y < GetRoguePlayableHeight(); y++)
{
for (int x = 0; x < nGameWidth; x++)
{
int cell = workRegion[y][x];
if (cell >= 1 && cell <= 7)
{
boardColorCounts[cell]++;
}
}
}
int boardTargetColor = 0;
int boardTargetCount = 0;
for (int cell = 1; cell <= 7; cell++)
{
if (boardColorCounts[cell] > boardTargetCount)
{
boardTargetColor = cell;
boardTargetCount = boardColorCounts[cell];
}
}
if (boardTargetColor == 0)
{
boardTargetColor = rowTargetColor > 0 ? rowTargetColor : 1;
}
for (int y = minRow; y <= maxRow; y++)
{
for (int x = 0; x < nGameWidth; x++)
{
if (workRegion[y][x] != 0 && workRegion[y][x] != boardTargetColor)
{
workRegion[y][x] = boardTargetColor;
if (recoloredCount < 40)
{
recoloredCells[recoloredCount].x = x;
recoloredCells[recoloredCount].y = y;
}
recoloredCount++;
}
}
}
TriggerColoredCellClearEffect(clearedCells, clearedCellCount, RGB(186, 126, 255), true);
TriggerColoredCellClearEffect(recoloredCells, recoloredCount < 40 ? recoloredCount : 40, RGB(218, 178, 255), false);
return clearedCellCount;
}