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

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
+7 -2
View File
@@ -40,9 +40,9 @@ bool IsRainbowBoardCell(int cellValue);
int TriggerMiniBlackHole(int maxCellsToClear); int TriggerMiniBlackHole(int maxCellsToClear);
/** /**
* @brief 触发彩虹方块棱彩复制效果并返回变色格数。 * @brief 触发彩虹方块棱彩爆发效果并返回清除格数。
*/ */
int TriggerRainbowPrismCopy(int minRow, int maxRow); int TriggerRainbowPrismBurst(int minRow, int maxRow);
/** /**
* @brief 引爆清屏炸弹并返回清除格数。 * @brief 引爆清屏炸弹并返回清除格数。
@@ -59,6 +59,11 @@ int ClearExplosiveAreaAt(int centerY, int centerX);
*/ */
int ClearColumnAt(int column); int ClearColumnAt(int column);
/**
* @brief 使用指定颜色特效清除指定列并返回清除格数。
*/
int ClearColumnAtWithColor(int column, COLORREF flashColor);
/** /**
* @brief 清除指定行并返回清除格数。 * @brief 清除指定行并返回清除格数。
*/ */
+46 -9
View File
@@ -382,9 +382,11 @@ void DropDown()
void Fixing() void Fixing()
{ {
bool overflowTop = false; bool overflowTop = false;
Point fixedCells[4] = {};
int fixedCellCount = 0;
Point explosiveCells[4] = {}; Point explosiveCells[4] = {};
int explosiveCellCount = 0; int explosiveCellCount = 0;
int rainbowCopiedCount = 0; int rainbowClearedCount = 0;
pendingChainBombFollowup = false; pendingChainBombFollowup = false;
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
@@ -406,6 +408,12 @@ void Fixing()
if (fixY >= 0 && fixY < GetRoguePlayableHeight() && fixX >= 0 && fixX < nGameWidth) if (fixY >= 0 && fixY < GetRoguePlayableHeight() && fixX >= 0 && fixX < nGameWidth)
{ {
workRegion[fixY][fixX] = currentPieceIsRainbow ? 8 : bricks[type][state][i][j]; 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) if (currentPieceIsExplosive && explosiveCellCount < 4)
{ {
explosiveCells[explosiveCellCount].x = fixX; explosiveCells[explosiveCellCount].x = fixX;
@@ -419,15 +427,23 @@ void Fixing()
if (!overflowTop && currentPieceIsRainbow) if (!overflowTop && currentPieceIsRainbow)
{ {
rainbowCopiedCount = TriggerRainbowPrismCopy(point.y, point.y + 3); rainbowClearedCount = TriggerRainbowPrismBurst(point.y, point.y + 3);
TCHAR rainbowDetail[128]; int rainbowScore = 0;
if (rainbowCopiedCount > 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 else
{ {
_stprintf_s(rainbowDetail, _T("覆盖行没有可复制的主色,彩虹能量保留为特殊固定块。")); _stprintf_s(rainbowDetail, _T("覆盖行没有可爆发的主色,彩虹能量保留为特殊固定块。"));
} }
SetFeedbackMessage(_T("彩虹方块"), rainbowDetail, 10); SetFeedbackMessage(_T("彩虹方块"), rainbowDetail, 10);
} }
@@ -507,6 +523,15 @@ void Fixing()
if (currentPieceIsLaser) if (currentPieceIsLaser)
{ {
int laserColumn = point.x + 1; 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) if (laserColumn < 0)
{ {
laserColumn = 0; laserColumn = 0;
@@ -525,7 +550,7 @@ void Fixing()
ApplyBoardGravity(); ApplyBoardGravity();
TCHAR laserDetail[128]; 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); SetFeedbackMessage(_T("棱镜激光"), laserDetail, 12);
} }
} }
@@ -534,6 +559,18 @@ void Fixing()
{ {
int crossRow = point.y + 1; int crossRow = point.y + 1;
int crossColumn = point.x + 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) if (crossRow < 0)
{ {
crossRow = 0; crossRow = 0;
@@ -552,7 +589,7 @@ void Fixing()
} }
int crossCellsCleared = ClearRowAt(crossRow); int crossCellsCleared = ClearRowAt(crossRow);
int columnCellsCleared = ClearColumnAt(crossColumn); int columnCellsCleared = ClearColumnAtWithColor(crossColumn, RGB(196, 255, 132));
if (workRegion[crossRow][crossColumn] == 0 && columnCellsCleared > 0) if (workRegion[crossRow][crossColumn] == 0 && columnCellsCleared > 0)
{ {
// center cell may already be counted by row clear // center cell may already be counted by row clear
@@ -567,7 +604,7 @@ void Fixing()
ApplyBoardGravity(); ApplyBoardGravity();
TCHAR crossDetail[128]; 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); SetFeedbackMessage(_T("十字方块"), crossDetail, 12);
} }
} }
+1 -1
View File
@@ -698,7 +698,7 @@ void TDrawScreen(HDC hdc, HWND hWnd)
_T("赏金纹章:得分+20%,可叠加\r\n成长印记:EXP+25%,可叠加\r\n缓坠羽翼:自然下落变慢\r\n连击律动:连续消行追加奖励\r\n先见之眼:下一方块预览+1"), _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("最后一搏:首次濒死清底3行\r\n备用仓:C / Shift 暂存方块\r\n完美旋转:旋转受阻时左右修正\r\n时间缓流:高堆叠自动减速\r\n空中换形:V 将当前方块变 I"),
_T("卸压清场:立刻清最高占用行\r\n底线清道夫:消行充能后清底\r\n清屏炸弹:X 清底5行,消行充能\r\n黑洞奇点:Z 吞噬数量最多的方块"), _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("连锁火花:消行后追加随机破坏\r\n连环炸弹:爆破扩大为 5x5\r\n雷霆四消:三消/四消额外轰击\r\n雷霆棱镜:三消/四消追加激光"),
_T("狂热节拍:累计12行进入狂热\r\n怒火连段:连击越高倍率越高\r\n无尽狂热:狂热中消行延时\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%"), _T("双重抉择:升级可多选1个\r\n命运轮盘:6选2但含诅咒\r\n升级冲击波:升级后清底2行\r\n进化冲击:升级后清底3行\r\n成长核心:永久得分/EXP +15%"),
+32 -15
View File
@@ -89,7 +89,7 @@ static const UpgradeEntry kUpgradePool[] =
{ UPGRADE_CROSS_PIECE, -1, 84, true, _T("十字方块"), _T("爆发"), _T("大幅提高十字方块出现率。十字方块落地后清除所在行与所在列。") }, { UPGRADE_CROSS_PIECE, -1, 84, true, _T("十字方块"), _T("爆发"), _T("大幅提高十字方块出现率。十字方块落地后清除所在行与所在列。") },
{ UPGRADE_BLACK_HOLE, 1, 88, false, _T("黑洞奇点"), _T("特殊"), _T("获得 2 次黑洞。按 Z 吞噬棋盘上数量最多的一种固定方块。") }, { UPGRADE_BLACK_HOLE, 1, 88, false, _T("黑洞奇点"), _T("特殊"), _T("获得 2 次黑洞。按 Z 吞噬棋盘上数量最多的一种固定方块。") },
{ UPGRADE_AIR_RESHAPE, 1, 82, false, _T("空中换形"), _T("操作"), _T("获得 2 次换形。按 V 将正在下落的方块重塑为 I 块。") }, { 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_VOID_CORE, 1, 112, false, _T("虚空核心"), _T("进化"), _T("黑洞后额外生成 1 个彩虹方块;彩虹消行时撕开小型黑洞。") },
{ UPGRADE_STABLE_STRUCTURE, -1, 72, true, _T("稳定结构"), _T("特殊"), _T("落地后有小概率填补邻近空洞,让阵型更加稳固。") }, { UPGRADE_STABLE_STRUCTURE, -1, 72, true, _T("稳定结构"), _T("特殊"), _T("落地后有小概率填补邻近空洞,让阵型更加稳固。") },
{ UPGRADE_DOUBLE_GROWTH, 1, 84, false, _T("成长核心"), _T("成长"), _T("永久获得 +15% 得分与 +15% EXP;每局只能选择一次。") }, { UPGRADE_DOUBLE_GROWTH, 1, 84, false, _T("成长核心"), _T("成长"), _T("永久获得 +15% 得分与 +15% EXP;每局只能选择一次。") },
@@ -746,7 +746,7 @@ static bool RollCrossPiece()
} }
/** /**
* @brief * @brief
*/ */
static bool RollRainbowPiece() static bool RollRainbowPiece()
{ {
@@ -896,6 +896,14 @@ int ClearExplosiveAreaAt(int centerY, int centerX)
* @brief * @brief
*/ */
int ClearColumnAt(int column) int ClearColumnAt(int column)
{
return ClearColumnAtWithColor(column, RGB(120, 232, 255));
}
/**
* @brief 使
*/
int ClearColumnAtWithColor(int column, COLORREF flashColor)
{ {
int clearedCellCount = 0; int clearedCellCount = 0;
Point clearedCells[20] = {}; 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; 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) if (minRow < 0)
{ {
@@ -972,10 +982,6 @@ int TriggerRainbowPrismCopy(int minRow, int maxRow)
for (int row = minRow; row <= maxRow; row++) for (int row = minRow; row <= maxRow; row++)
{ {
int colorCounts[8] = {};
int targetColor = 0;
int targetColorCount = 0;
for (int x = 0; x < nGameWidth; x++) for (int x = 0; x < nGameWidth; x++)
{ {
int cell = workRegion[row][x]; int cell = workRegion[row][x];
@@ -984,7 +990,10 @@ int TriggerRainbowPrismCopy(int minRow, int maxRow)
colorCounts[cell]++; colorCounts[cell]++;
} }
} }
}
int targetColor = 0;
int targetColorCount = 0;
for (int cell = 1; cell <= 7; cell++) for (int cell = 1; cell <= 7; cell++)
{ {
if (colorCounts[cell] > targetColorCount) if (colorCounts[cell] > targetColorCount)
@@ -996,20 +1005,28 @@ int TriggerRainbowPrismCopy(int minRow, int maxRow)
if (targetColor == 0) if (targetColor == 0)
{ {
continue; return 0;
} }
for (int row = minRow; row <= maxRow; row++)
{
for (int x = 0; x < nGameWidth; x++) for (int x = 0; x < nGameWidth; x++)
{ {
if (IsRainbowBoardCell(workRegion[row][x])) if (workRegion[row][x] == targetColor)
{ {
workRegion[row][x] = targetColor; if (clearedCellCount < 40)
copiedCellCount++; {
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;
} }
/** /**