提高粒子特效
This commit is contained in:
@@ -32,6 +32,10 @@ bool currentPieceIsCross = false;
|
||||
bool currentPieceIsRainbow = false;
|
||||
Point pendingChainBombCenter = { 0, 0 };
|
||||
bool pendingChainBombFollowup = false;
|
||||
static int pendingLineClearEffectTicks = 0;
|
||||
static int pendingLineClearEffectRows[8] = {};
|
||||
static int pendingLineClearEffectRowCount = 0;
|
||||
static int pendingLineClearEffectLineCount = 0;
|
||||
|
||||
int bricks[7][4][4][4] =
|
||||
{
|
||||
@@ -386,6 +390,43 @@ static void AddBurstParticles(int boardX, int boardY, COLORREF baseColor, bool s
|
||||
}
|
||||
}
|
||||
|
||||
static void QueueLineClearEffect(const int* rows, int rowCount, int linesCleared)
|
||||
{
|
||||
if (rows == nullptr || rowCount <= 0 || linesCleared <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (rowCount > 8)
|
||||
{
|
||||
rowCount = 8;
|
||||
}
|
||||
|
||||
pendingLineClearEffectTicks = 1;
|
||||
pendingLineClearEffectRowCount = rowCount;
|
||||
pendingLineClearEffectLineCount = linesCleared;
|
||||
for (int i = 0; i < rowCount; i++)
|
||||
{
|
||||
pendingLineClearEffectRows[i] = rows[i];
|
||||
}
|
||||
}
|
||||
|
||||
void PlayPendingLineClearEffect()
|
||||
{
|
||||
if (pendingLineClearEffectTicks <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
pendingLineClearEffectTicks = 0;
|
||||
TriggerLineClearEffect(
|
||||
pendingLineClearEffectRows,
|
||||
pendingLineClearEffectRowCount,
|
||||
pendingLineClearEffectLineCount);
|
||||
pendingLineClearEffectRowCount = 0;
|
||||
pendingLineClearEffectLineCount = 0;
|
||||
}
|
||||
|
||||
void TriggerLineClearEffect(const int* rows, int rowCount, int linesCleared)
|
||||
{
|
||||
if (rows == nullptr || rowCount <= 0 || linesCleared <= 0)
|
||||
@@ -981,7 +1022,14 @@ int DeleteLines()
|
||||
}
|
||||
|
||||
ApplyLineClearResult(clearedLines);
|
||||
TriggerLineClearEffect(clearedRows, clearedRowCount, clearedLines);
|
||||
if (currentScreen == SCREEN_UPGRADE)
|
||||
{
|
||||
QueueLineClearEffect(clearedRows, clearedRowCount, clearedLines);
|
||||
}
|
||||
else
|
||||
{
|
||||
TriggerLineClearEffect(clearedRows, clearedRowCount, clearedLines);
|
||||
}
|
||||
|
||||
if (pendingChainBombFollowup && clearedLines > 0)
|
||||
{
|
||||
@@ -1107,7 +1155,11 @@ void Restart()
|
||||
feedbackState.visibleTicks = 0;
|
||||
feedbackState.title[0] = _T('\0');
|
||||
feedbackState.detail[0] = _T('\0');
|
||||
ResetPendingRogueVisualEvents();
|
||||
ResetVisualEffects();
|
||||
pendingLineClearEffectTicks = 0;
|
||||
pendingLineClearEffectRowCount = 0;
|
||||
pendingLineClearEffectLineCount = 0;
|
||||
holdType = -1;
|
||||
holdUsedThisTurn = false;
|
||||
RollCurrentPieceSpecialFlags(false);
|
||||
@@ -1140,6 +1192,10 @@ void ReturnToMainMenu()
|
||||
suspendFlag = false;
|
||||
gameOverFlag = false;
|
||||
ResetVisualEffects();
|
||||
ResetPendingRogueVisualEvents();
|
||||
pendingLineClearEffectTicks = 0;
|
||||
pendingLineClearEffectRowCount = 0;
|
||||
pendingLineClearEffectLineCount = 0;
|
||||
menuState.optionCount = 3;
|
||||
upgradeUiState.pendingCount = 0;
|
||||
upgradeUiState.picksRemaining = 0;
|
||||
|
||||
Reference in New Issue
Block a user