补充清除逻辑
This commit is contained in:
+59
-42
@@ -480,6 +480,25 @@ void TriggerLineClearEffect(const int* rows, int rowCount, int linesCleared)
|
||||
AddFloatingText(nGameWidth * 50, (rowSum * 100 / rowCount) - 20, text, linesCleared >= 4 ? RGB(255, 232, 120) : RGB(255, 250, 252));
|
||||
}
|
||||
|
||||
void TriggerCellClearEffect(const Point* cells, int cellCount, bool strongBurst)
|
||||
{
|
||||
if (cells == nullptr || cellCount <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < cellCount; i++)
|
||||
{
|
||||
if (cells[i].x < 0 || cells[i].x >= nGameWidth || cells[i].y < 0 || cells[i].y >= nGameHeight)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
COLORREF particleColor = BrickColor[(cells[i].x + cells[i].y) % 7];
|
||||
AddBurstParticles(cells[i].x * 100 + 50, cells[i].y * 100 + 50, particleColor, strongBurst);
|
||||
}
|
||||
}
|
||||
|
||||
bool IsPiecePlacementValid(int pieceType, int pieceState, Point position)
|
||||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
@@ -821,26 +840,28 @@ void Fixing()
|
||||
|
||||
if (currentPieceIsExplosive)
|
||||
{
|
||||
int explosiveScoreGain = 0;
|
||||
int explosiveCellsCleared = 0;
|
||||
|
||||
for (int i = 0; i < explosiveCellCount; i++)
|
||||
{
|
||||
explosiveScoreGain += ClearExplosiveAreaAt(explosiveCells[i].y, explosiveCells[i].x);
|
||||
explosiveCellsCleared += ClearExplosiveAreaAt(explosiveCells[i].y, explosiveCells[i].x);
|
||||
}
|
||||
|
||||
if (currentMode == MODE_ROGUE && explosiveScoreGain > 0)
|
||||
int explosiveScoreGain = 0;
|
||||
int explosiveExpGain = 0;
|
||||
if (currentMode == MODE_ROGUE && explosiveCellsCleared > 0)
|
||||
{
|
||||
explosiveScoreGain = explosiveScoreGain * rogueStats.scoreMultiplierPercent / 100;
|
||||
rogueStats.score += explosiveScoreGain;
|
||||
tScore = rogueStats.score;
|
||||
AwardRogueSkillClearRewards(explosiveCellsCleared, explosiveScoreGain, explosiveExpGain, false);
|
||||
ApplyBoardGravity();
|
||||
}
|
||||
|
||||
TCHAR explosiveDetail[128];
|
||||
_stprintf_s(
|
||||
explosiveDetail,
|
||||
_T("爆破清除 %d 格 +%d 分"),
|
||||
explosiveScoreGain > 0 ? explosiveScoreGain * 100 / rogueStats.scoreMultiplierPercent : 0,
|
||||
explosiveScoreGain);
|
||||
_T("爆破清除 %d 格 +%d 分 +%d EXP"),
|
||||
explosiveCellsCleared,
|
||||
explosiveScoreGain,
|
||||
explosiveExpGain);
|
||||
SetFeedbackMessage(_T("爆破核心"), explosiveDetail, 12);
|
||||
|
||||
if (rogueStats.chainBombLevel > 0 && explosiveCellCount > 0)
|
||||
@@ -865,16 +886,13 @@ void Fixing()
|
||||
int laserCellsCleared = ClearColumnAt(laserColumn);
|
||||
if (currentMode == MODE_ROGUE && laserCellsCleared > 0)
|
||||
{
|
||||
int laserScore = laserCellsCleared * rogueStats.scoreMultiplierPercent / 100;
|
||||
if (laserScore < laserCellsCleared)
|
||||
{
|
||||
laserScore = laserCellsCleared;
|
||||
}
|
||||
rogueStats.score += laserScore;
|
||||
tScore = rogueStats.score;
|
||||
int laserScore = 0;
|
||||
int laserExp = 0;
|
||||
AwardRogueSkillClearRewards(laserCellsCleared, laserScore, laserExp, false);
|
||||
ApplyBoardGravity();
|
||||
|
||||
TCHAR laserDetail[128];
|
||||
_stprintf_s(laserDetail, _T("激光贯穿一列,清除 %d 格 +%d 分"), laserCellsCleared, laserScore);
|
||||
_stprintf_s(laserDetail, _T("激光贯穿一列,清除 %d 格 +%d 分 +%d EXP"), laserCellsCleared, laserScore, laserExp);
|
||||
SetFeedbackMessage(_T("棱镜激光"), laserDetail, 12);
|
||||
}
|
||||
}
|
||||
@@ -910,16 +928,13 @@ void Fixing()
|
||||
|
||||
if (currentMode == MODE_ROGUE && totalCrossCleared > 0)
|
||||
{
|
||||
int crossScore = totalCrossCleared * rogueStats.scoreMultiplierPercent / 100;
|
||||
if (crossScore < totalCrossCleared)
|
||||
{
|
||||
crossScore = totalCrossCleared;
|
||||
}
|
||||
rogueStats.score += crossScore;
|
||||
tScore = rogueStats.score;
|
||||
int crossScore = 0;
|
||||
int crossExp = 0;
|
||||
AwardRogueSkillClearRewards(totalCrossCleared, crossScore, crossExp, false);
|
||||
ApplyBoardGravity();
|
||||
|
||||
TCHAR crossDetail[128];
|
||||
_stprintf_s(crossDetail, _T("十字冲击清除 %d 格 +%d 分"), totalCrossCleared, crossScore);
|
||||
_stprintf_s(crossDetail, _T("十字冲击清除 %d 格 +%d 分 +%d EXP"), totalCrossCleared, crossScore, crossExp);
|
||||
SetFeedbackMessage(_T("十字方块"), crossDetail, 12);
|
||||
}
|
||||
}
|
||||
@@ -1038,6 +1053,7 @@ int DeleteLines()
|
||||
int followupCleared = 0;
|
||||
int centerY = pendingChainBombCenter.y;
|
||||
int centerX = pendingChainBombCenter.x;
|
||||
Point followupCells[9] = {};
|
||||
|
||||
for (int y = centerY - 1; y <= centerY + 1; y++)
|
||||
{
|
||||
@@ -1045,6 +1061,11 @@ int DeleteLines()
|
||||
{
|
||||
if (y >= 0 && y < GetRoguePlayableHeight() && x >= 0 && x < nGameWidth && workRegion[y][x] != 0)
|
||||
{
|
||||
if (followupCleared < 9)
|
||||
{
|
||||
followupCells[followupCleared].x = x;
|
||||
followupCells[followupCleared].y = y;
|
||||
}
|
||||
workRegion[y][x] = 0;
|
||||
followupCleared++;
|
||||
}
|
||||
@@ -1053,20 +1074,19 @@ int DeleteLines()
|
||||
|
||||
if (currentMode == MODE_ROGUE && followupCleared > 0)
|
||||
{
|
||||
int followupScore = followupCleared * rogueStats.scoreMultiplierPercent / 100;
|
||||
if (followupScore < followupCleared)
|
||||
{
|
||||
followupScore = followupCleared;
|
||||
}
|
||||
rogueStats.score += followupScore;
|
||||
tScore = rogueStats.score;
|
||||
TriggerCellClearEffect(followupCells, followupCleared < 9 ? followupCleared : 9, true);
|
||||
int followupScore = 0;
|
||||
int followupExp = 0;
|
||||
AwardRogueSkillClearRewards(followupCleared, followupScore, followupExp, false);
|
||||
ApplyBoardGravity();
|
||||
|
||||
TCHAR followupDetail[128];
|
||||
_stprintf_s(
|
||||
followupDetail,
|
||||
_T("追加爆炸清除 %d 格 +%d 分"),
|
||||
_T("追加爆炸清除 %d 格 +%d 分 +%d EXP"),
|
||||
followupCleared,
|
||||
followupScore);
|
||||
followupScore,
|
||||
followupExp);
|
||||
SetFeedbackMessage(_T("连环炸弹"), followupDetail, 12);
|
||||
}
|
||||
}
|
||||
@@ -1080,16 +1100,13 @@ int DeleteLines()
|
||||
int miniBlackHoleCleared = TriggerMiniBlackHole(5);
|
||||
if (miniBlackHoleCleared > 0)
|
||||
{
|
||||
int miniScore = miniBlackHoleCleared * rogueStats.scoreMultiplierPercent / 100;
|
||||
if (miniScore < miniBlackHoleCleared)
|
||||
{
|
||||
miniScore = miniBlackHoleCleared;
|
||||
}
|
||||
rogueStats.score += miniScore;
|
||||
tScore = rogueStats.score;
|
||||
int miniScore = 0;
|
||||
int miniExp = 0;
|
||||
AwardRogueSkillClearRewards(miniBlackHoleCleared, miniScore, miniExp, false);
|
||||
ApplyBoardGravity();
|
||||
|
||||
TCHAR miniDetail[128];
|
||||
_stprintf_s(miniDetail, _T("彩虹消行撕开小型黑洞,清除 %d 格 +%d 分"), miniBlackHoleCleared, miniScore);
|
||||
_stprintf_s(miniDetail, _T("彩虹消行撕开小型黑洞,清除 %d 格 +%d 分 +%d EXP"), miniBlackHoleCleared, miniScore, miniExp);
|
||||
SetFeedbackMessage(_T("虚空核心"), miniDetail, 12);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user