升级多选优化

This commit is contained in:
2026-04-26 14:57:21 +08:00
parent 24c24acf44
commit cbf7bac239
5 changed files with 173 additions and 9 deletions
+103
View File
@@ -1219,6 +1219,11 @@ static void FillUpgradeOptions()
upgradeUiState.optionCount = optionCount;
upgradeUiState.selectedIndex = 0;
upgradeUiState.picksRemaining = (rogueStats.dualChoiceLevel > 0 || rogueStats.destinyWheelLevel > 0) ? 2 : 1;
upgradeUiState.markedCount = 0;
for (int i = 0; i < 6; i++)
{
upgradeUiState.marked[i] = false;
}
for (int i = 0; i < optionCount; i++)
{
@@ -2003,6 +2008,103 @@ void ConfirmUpgradeSelection()
return;
}
if (upgradeUiState.picksRemaining > 1)
{
if (upgradeUiState.markedCount != upgradeUiState.picksRemaining)
{
SetFeedbackMessage(_T("选择未完成"), _T("请先标记足够的强化,再按 Enter 确认。"), 10);
return;
}
TCHAR feedbackTitle[64] = _T("获得强化");
TCHAR feedbackDetail[128] = _T("");
int appliedSelections = 0;
for (int optionIndex = 0; optionIndex < upgradeUiState.optionCount; optionIndex++)
{
if (!upgradeUiState.marked[optionIndex])
{
continue;
}
UpgradeOption selectedOption = upgradeUiState.options[optionIndex];
int applyCount = 1;
TCHAR gamblerSuffix[64] = _T("");
if (currentMode == MODE_ROGUE && rogueStats.gamblerLevel > 0)
{
int gamblerChance = 20 + (rogueStats.gamblerLevel - 1) * 5;
if (gamblerChance > 40)
{
gamblerChance = 40;
}
int roll = rand() % 100;
if (roll < gamblerChance)
{
applyCount = 2;
_stprintf_s(gamblerSuffix, _T("(翻倍)"));
}
else if (roll >= 100 - gamblerChance)
{
applyCount = 0;
_stprintf_s(gamblerSuffix, _T("(落空)"));
}
}
ApplyUpgradeById(selectedOption.id, selectedOption.targetPieceType, applyCount);
upgradeUiState.totalChosenCount++;
if (selectedOption.cursed)
{
ApplyDestinyCurse();
}
if (appliedSelections == 0)
{
_stprintf_s(feedbackTitle, _T("获得强化:%s"), selectedOption.name);
}
else
{
_stprintf_s(feedbackTitle, _T("获得强化 x%d"), appliedSelections + 1);
}
if (lstrlen(feedbackDetail) > 0)
{
_stprintf_s(feedbackDetail + lstrlen(feedbackDetail), 128 - lstrlen(feedbackDetail), _T(""));
}
_stprintf_s(
feedbackDetail + lstrlen(feedbackDetail),
128 - lstrlen(feedbackDetail),
_T("%s%s%s"),
selectedOption.name,
gamblerSuffix,
selectedOption.cursed ? _T(" [诅咒]") : _T(""));
appliedSelections++;
}
SetFeedbackMessage(feedbackTitle, feedbackDetail, 12);
if (upgradeUiState.pendingCount > 0)
{
upgradeUiState.pendingCount--;
}
if (upgradeUiState.pendingCount > 0)
{
FillUpgradeOptions();
currentScreen = SCREEN_UPGRADE;
return;
}
upgradeUiState.optionCount = 0;
upgradeUiState.picksRemaining = 0;
upgradeUiState.markedCount = 0;
currentScreen = SCREEN_PLAYING;
ResolvePendingUpgradeShockwave();
PlayPendingLineClearEffect();
return;
}
UpgradeOption selectedOption = upgradeUiState.options[upgradeUiState.selectedIndex];
int applyCount = 1;
TCHAR gamblerSuffix[64] = _T("");
@@ -2096,6 +2198,7 @@ void ConfirmUpgradeSelection()
upgradeUiState.optionCount = 0;
upgradeUiState.picksRemaining = 0;
upgradeUiState.markedCount = 0;
currentScreen = SCREEN_PLAYING;
ResolvePendingUpgradeShockwave();