新增赌徒强化和方块改运并接入收益波动机制
This commit is contained in:
@@ -37,7 +37,9 @@ enum UpgradeId
|
||||
UPGRADE_SWEEPER = 8,
|
||||
UPGRADE_EXPLOSIVE_PIECE = 9,
|
||||
UPGRADE_STABLE_STRUCTURE = 10,
|
||||
UPGRADE_DOUBLE_GROWTH = 11
|
||||
UPGRADE_DOUBLE_GROWTH = 11,
|
||||
UPGRADE_LUCKY_ROLL = 12,
|
||||
UPGRADE_GAMBLER = 13
|
||||
};
|
||||
|
||||
static const UpgradeEntry kUpgradePool[] =
|
||||
@@ -53,7 +55,9 @@ static const UpgradeEntry kUpgradePool[] =
|
||||
{ UPGRADE_SWEEPER, -1, true, _T("\u6e05\u626b\u8005"), _T("\u7279\u6b8a"), _T("\u7d2f\u8ba1\u6d88\u884c\u5145\u80fd\uff0c\u6536\u6ee1\u540e\u81ea\u52a8\u6e05\u9664\u5e95\u90e8 1 \u884c\u3002") },
|
||||
{ UPGRADE_EXPLOSIVE_PIECE, -1, true, _T("\u7206\u7834\u65b9\u5757"), _T("\u7279\u6b8a"), _T("\u63d0\u9ad8\u7206\u7834\u65b9\u5757\u51fa\u73b0\u6982\u7387\uff0c\u843d\u5730\u65f6\u89e6\u53d1 3x3 \u6e05\u9664\u3002") },
|
||||
{ UPGRADE_STABLE_STRUCTURE, -1, true, _T("\u7a33\u5b9a\u7ed3\u6784"), _T("\u7279\u6b8a"), _T("\u843d\u5730\u540e\u5c0f\u6982\u7387\u81ea\u52a8\u586b\u8865\u90bb\u8fd1\u7a7a\u6d1e\uff0c\u63d0\u9ad8\u76d8\u9762\u7ed3\u6784\u7a33\u5b9a\u6027\u3002") },
|
||||
{ UPGRADE_DOUBLE_GROWTH, -1, true, _T("\u53cc\u500d\u6210\u957f"), _T("\u7279\u6b8a"), _T("\u989d\u5916\u63d0\u9ad8\u6d88\u884c\u5f97\u5206\u4e0e EXP \u6536\u76ca\uff0c\u6bcf\u5c42\u518d\u8ffd\u52a0 15%\u3002") }
|
||||
{ UPGRADE_DOUBLE_GROWTH, -1, true, _T("\u53cc\u500d\u6210\u957f"), _T("\u7279\u6b8a"), _T("\u989d\u5916\u63d0\u9ad8\u6d88\u884c\u5f97\u5206\u4e0e EXP \u6536\u76ca\uff0c\u6bcf\u5c42\u518d\u8ffd\u52a0 15%\u3002") },
|
||||
{ UPGRADE_LUCKY_ROLL, -1, true, _T("\u65b9\u5757\u6539\u8fd0"), _T("\u7279\u6b8a"), _T("\u4f18\u5316 Next \u961f\u5217\uff0c\u964d\u4f4e\u8fde\u7eed\u91cd\u590d\u65b9\u5757\u51fa\u73b0\u7684\u6982\u7387\u3002") },
|
||||
{ UPGRADE_GAMBLER, -1, true, _T("\u8d4c\u5f92"), _T("\u7279\u6b8a"), _T("\u6d88\u884c\u6536\u76ca\u4f1a\u989d\u5916\u968f\u673a\u6ce2\u52a8\uff0c\u5c42\u6570\u8d8a\u9ad8\u6ce2\u52a8\u8d8a\u5927\u3002") }
|
||||
};
|
||||
|
||||
static constexpr int kUpgradePoolSize = sizeof(kUpgradePool) / sizeof(kUpgradePool[0]);
|
||||
@@ -211,6 +215,8 @@ static void ResetPlayerStats(PlayerStats& stats, bool useRogueRules)
|
||||
stats.explosiveLevel = 0;
|
||||
stats.stableStructureLevel = 0;
|
||||
stats.doubleGrowthLevel = 0;
|
||||
stats.luckyRollLevel = 0;
|
||||
stats.gamblerLevel = 0;
|
||||
}
|
||||
|
||||
static int GetNextPreviewLimit()
|
||||
@@ -261,6 +267,10 @@ static int GetUpgradeCurrentLevel(int upgradeId)
|
||||
return rogueStats.stableStructureLevel;
|
||||
case UPGRADE_DOUBLE_GROWTH:
|
||||
return rogueStats.doubleGrowthLevel;
|
||||
case UPGRADE_LUCKY_ROLL:
|
||||
return rogueStats.luckyRollLevel;
|
||||
case UPGRADE_GAMBLER:
|
||||
return rogueStats.gamblerLevel;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
@@ -378,6 +388,46 @@ static int ClearExplosiveAreaAt(int centerY, int centerX)
|
||||
return clearedCellCount;
|
||||
}
|
||||
|
||||
static int RollNextPieceType()
|
||||
{
|
||||
int candidate = rand() % 7;
|
||||
|
||||
if (currentMode != MODE_ROGUE || rogueStats.luckyRollLevel <= 0)
|
||||
{
|
||||
return candidate;
|
||||
}
|
||||
|
||||
int rerollCount = rogueStats.luckyRollLevel;
|
||||
if (rerollCount > 3)
|
||||
{
|
||||
rerollCount = 3;
|
||||
}
|
||||
|
||||
for (int attempt = 0; attempt < rerollCount; attempt++)
|
||||
{
|
||||
bool matchesCurrent = (candidate == type);
|
||||
bool matchesQueue = false;
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
if (nextTypes[i] == candidate)
|
||||
{
|
||||
matchesQueue = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!matchesCurrent && !matchesQueue)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
candidate = rand() % 7;
|
||||
}
|
||||
|
||||
return candidate;
|
||||
}
|
||||
|
||||
static int TryStabilizeBoard()
|
||||
{
|
||||
if (currentMode != MODE_ROGUE || rogueStats.stableStructureLevel <= 0)
|
||||
@@ -429,7 +479,7 @@ static void ResetNextQueue()
|
||||
{
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
nextTypes[i] = rand() % 7;
|
||||
nextTypes[i] = RollNextPieceType();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -438,7 +488,7 @@ static int ConsumeNextType()
|
||||
int nextType = nextTypes[0];
|
||||
nextTypes[0] = nextTypes[1];
|
||||
nextTypes[1] = nextTypes[2];
|
||||
nextTypes[2] = rand() % 7;
|
||||
nextTypes[2] = RollNextPieceType();
|
||||
return nextType;
|
||||
}
|
||||
|
||||
@@ -584,6 +634,14 @@ static void ApplyUpgradeById(int upgradeId)
|
||||
rogueStats.doubleGrowthLevel++;
|
||||
SetFeedbackMessage(_T("\u53cc\u500d\u6210\u957f\u5df2\u53e0\u52a0"), _T("\u540e\u7eed\u6d88\u884c\u7684\u5f97\u5206\u548c EXP \u6536\u76ca\u4f1a\u66f4\u9ad8\u3002"), 12);
|
||||
break;
|
||||
case UPGRADE_LUCKY_ROLL:
|
||||
rogueStats.luckyRollLevel++;
|
||||
SetFeedbackMessage(_T("\u65b9\u5757\u6539\u8fd0\u5df2\u5f3a\u5316"), _T("Next \u961f\u5217\u4f1a\u66f4\u5c11\u51fa\u73b0\u8fde\u7eed\u91cd\u590d\u5757\u578b\u3002"), 12);
|
||||
break;
|
||||
case UPGRADE_GAMBLER:
|
||||
rogueStats.gamblerLevel++;
|
||||
SetFeedbackMessage(_T("\u8d4c\u5f92\u5df2\u53e0\u52a0"), _T("\u540e\u7eed\u6d88\u884c\u7684\u5206\u6570\u548c EXP \u4f1a\u989d\u5916\u968f\u673a\u6ce2\u52a8\u3002"), 12);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -621,6 +679,20 @@ static void ApplyLineClearResult(int linesCleared)
|
||||
expGain = expGain * growthMultiplierPercent / 100;
|
||||
}
|
||||
|
||||
int gamblerBonusPercent = 0;
|
||||
if (rogueStats.gamblerLevel > 0)
|
||||
{
|
||||
int variance = 20 + (rogueStats.gamblerLevel - 1) * 10;
|
||||
if (variance > 50)
|
||||
{
|
||||
variance = 50;
|
||||
}
|
||||
|
||||
gamblerBonusPercent = (rand() % (variance * 2 + 1)) - variance;
|
||||
scoreGain = scoreGain * (100 + gamblerBonusPercent) / 100;
|
||||
expGain = expGain * (100 + gamblerBonusPercent) / 100;
|
||||
}
|
||||
|
||||
rogueStats.comboChain++;
|
||||
if (rogueStats.comboBonusStacks > 0 && rogueStats.comboChain > 1)
|
||||
{
|
||||
@@ -679,6 +751,10 @@ static void ApplyLineClearResult(int linesCleared)
|
||||
rogueStats.sweeperCharge,
|
||||
GetSweeperThreshold());
|
||||
}
|
||||
else if (rogueStats.gamblerLevel > 0)
|
||||
{
|
||||
_stprintf_s(feedbackDetail, _T("\u6d88\u884c %d \u8d4c\u5f92\u6ce2\u52a8 %+d%%"), linesCleared, gamblerBonusPercent);
|
||||
}
|
||||
else
|
||||
{
|
||||
_stprintf_s(feedbackDetail, _T("\u6d88\u884c %d \u8fde\u51fb %d"), linesCleared, rogueStats.comboChain);
|
||||
|
||||
Reference in New Issue
Block a user