提高粒子特效

This commit is contained in:
2026-04-26 13:55:55 +08:00
parent 96976d7b99
commit cc69287344
4 changed files with 130 additions and 70 deletions
+65 -52
View File
@@ -85,7 +85,7 @@ static const UpgradeEntry kUpgradePool[] =
{ 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("选择一种方块,降低它之后的出现率。") },
{ UPGRADE_PIECE_TUNING, -1, 64, true, _T("方块改造"), _T("特殊"), _T("固定提高 I 方块的生成概率。") },
{ UPGRADE_GAMBLER, -1, 64, true, _T("赌徒契约"), _T("特殊"), _T("选择强化时,有概率效果翻倍,也有概率本次落空。") }
};
@@ -94,6 +94,8 @@ static constexpr int kDifficultyStepMs = 30000;
static constexpr int kDifficultySpeedStepMs = 18;
static constexpr int kMaxRogueLockedRows = 4;
static constexpr int kDifficultyLevelsPerLockedRow = 3;
static int pendingUpgradeShockwaveRows = 0;
static bool pendingEvolutionImpactShockwave = false;
static int GetUpgradeCurrentLevel(int upgradeId);
static bool IsUpgradePrerequisiteConsumed(int upgradeId);
@@ -114,6 +116,7 @@ static int GetRogueScoreByLines(int linesCleared);
static int GetRogueExpByLines(int linesCleared);
static int ApplyLevelProgress(PlayerStats& stats);
static int TriggerUpgradeShockwave(int rowsToClear);
static void ResolvePendingUpgradeShockwave();
static void FillUpgradeOptions();
static void ApplyUpgradeById(int upgradeId, int targetPieceType, int applyCount);
static void ApplyDestinyCurse();
@@ -988,13 +991,10 @@ static int RollNextPieceType()
if (currentMode == MODE_ROGUE)
{
for (int i = 0; i < 7; i++)
weights[0] += rogueStats.pieceTuningLevels[0] * 35;
if (weights[0] > 320)
{
weights[i] -= rogueStats.pieceTuningLevels[i] * 20;
if (weights[i] < 20)
{
weights[i] = 20;
}
weights[0] = 320;
}
}
@@ -1194,35 +1194,16 @@ static void FillUpgradeOptions()
if (pickedEntry.id == UPGRADE_PIECE_TUNING)
{
int targetPieceType = rand() % 7;
bool duplicatedPiece = true;
int guard = 0;
while (duplicatedPiece && guard < 16)
{
duplicatedPiece = false;
for (int optionIndex = 0; optionIndex < i; optionIndex++)
{
if (upgradeUiState.options[optionIndex].id == UPGRADE_PIECE_TUNING &&
upgradeUiState.options[optionIndex].targetPieceType == targetPieceType)
{
duplicatedPiece = true;
targetPieceType = (targetPieceType + 1) % 7;
break;
}
}
guard++;
}
int targetPieceType = 0;
upgradeUiState.options[i].targetPieceType = targetPieceType;
upgradeUiState.options[i].currentLevel = rogueStats.pieceTuningLevels[targetPieceType];
upgradeUiState.options[i].currentLevel = rogueStats.pieceTuningLevels[0];
upgradeUiState.options[i].name = _T("方块改造");
static TCHAR tuningDescriptions[6][64];
_stprintf_s(
tuningDescriptions[i],
_T("%s 块之后的出现率降低"),
GetPieceShortName(targetPieceType));
_T("%s 块的生成概率提高"),
GetPieceShortName(0));
upgradeUiState.options[i].description = tuningDescriptions[i];
}
@@ -1456,10 +1437,7 @@ static void ApplyUpgradeById(int upgradeId, int targetPieceType, int applyCount)
rogueStats.expMultiplierPercent += 15;
break;
case UPGRADE_PIECE_TUNING:
if (targetPieceType >= 0 && targetPieceType < 7)
{
rogueStats.pieceTuningLevels[targetPieceType] += applyCount;
}
rogueStats.pieceTuningLevels[0] += applyCount;
break;
case UPGRADE_GAMBLER:
rogueStats.gamblerLevel += applyCount;
@@ -1737,22 +1715,8 @@ void ApplyLineClearResult(int linesCleared)
if (shockwaveRows > 0)
{
int clearedRows = TriggerUpgradeShockwave(shockwaveRows);
TCHAR shockwaveDetail[128];
if (rogueStats.evolutionImpactLevel > 0)
{
_stprintf_s(
shockwaveDetail,
_T("进化能量爆发,清除底部 %d 行,并进入 10 秒双倍 EXP。"),
clearedRows);
SetFeedbackMessage(_T("进化冲击"), shockwaveDetail, 14);
}
else
{
_stprintf_s(shockwaveDetail, _T("灵感涌现前,冲击波清除底部 %d 行。"), clearedRows);
SetFeedbackMessage(_T("升级冲击波"), shockwaveDetail, 12);
}
pendingUpgradeShockwaveRows = shockwaveRows;
pendingEvolutionImpactShockwave = rogueStats.evolutionImpactLevel > 0;
}
TCHAR feedbackTitle[64];
@@ -1781,6 +1745,53 @@ static void ApplyDestinyCurse()
}
}
static void ResolvePendingUpgradeShockwave()
{
if (pendingUpgradeShockwaveRows <= 0)
{
return;
}
int shockwaveRows = pendingUpgradeShockwaveRows;
bool evolutionImpact = pendingEvolutionImpactShockwave;
pendingUpgradeShockwaveRows = 0;
pendingEvolutionImpactShockwave = false;
int clearedRows = TriggerUpgradeShockwave(shockwaveRows);
int effectRows[4] = {};
int effectRowCount = clearedRows;
if (effectRowCount > 4)
{
effectRowCount = 4;
}
for (int i = 0; i < effectRowCount; i++)
{
effectRows[i] = GetRoguePlayableHeight() - 1 - i;
}
TriggerLineClearEffect(effectRows, effectRowCount, clearedRows);
TCHAR shockwaveDetail[128];
if (evolutionImpact)
{
_stprintf_s(
shockwaveDetail,
_T("进化能量爆发,清除底部 %d 行,并进入 10 秒双倍 EXP。"),
clearedRows);
SetFeedbackMessage(_T("进化冲击"), shockwaveDetail, 14);
}
else
{
_stprintf_s(shockwaveDetail, _T("灵感涌现后,冲击波清除底部 %d 行。"), clearedRows);
SetFeedbackMessage(_T("升级冲击波"), shockwaveDetail, 12);
}
}
void ResetPendingRogueVisualEvents()
{
pendingUpgradeShockwaveRows = 0;
pendingEvolutionImpactShockwave = false;
}
void OpenUpgradeMenu()
{
if (currentMode != MODE_ROGUE || upgradeUiState.pendingCount <= 0)
@@ -1833,8 +1844,8 @@ void ConfirmUpgradeSelection()
{
_stprintf_s(
feedbackDetail,
_T("%s 块的出现率降低%s"),
GetPieceShortName(selectedOption.targetPieceType),
_T("%s 块的生成概率提高%s"),
GetPieceShortName(0),
gamblerSuffix);
}
else
@@ -1894,6 +1905,8 @@ void ConfirmUpgradeSelection()
upgradeUiState.picksRemaining = 0;
currentScreen = SCREEN_PLAYING;
ResolvePendingUpgradeShockwave();
PlayPendingLineClearEffect();
}
void HoldCurrentPiece()