将炸弹方块改为每10块固定生成一次
This commit is contained in:
@@ -54,6 +54,7 @@ struct PlayerStats
|
||||
int sweeperLevel;
|
||||
int sweeperCharge;
|
||||
int explosiveLevel;
|
||||
int explosivePieceCounter;
|
||||
int chainBlastLevel;
|
||||
int chainBombLevel;
|
||||
int laserLevel;
|
||||
|
||||
@@ -271,6 +271,7 @@ static void ResetPlayerStats(PlayerStats& stats, bool useRogueRules)
|
||||
stats.sweeperLevel = 0;
|
||||
stats.sweeperCharge = 0;
|
||||
stats.explosiveLevel = 0;
|
||||
stats.explosivePieceCounter = 0;
|
||||
stats.chainBlastLevel = 0;
|
||||
stats.chainBombLevel = 0;
|
||||
stats.laserLevel = 0;
|
||||
@@ -851,13 +852,18 @@ static bool RollExplosivePiece()
|
||||
return false;
|
||||
}
|
||||
|
||||
int chancePercent = 12 + (rogueStats.explosiveLevel - 1) * 8;
|
||||
if (chancePercent > 40)
|
||||
if (rogueStats.explosivePieceCounter < 10)
|
||||
{
|
||||
chancePercent = 40;
|
||||
rogueStats.explosivePieceCounter++;
|
||||
}
|
||||
|
||||
return (rand() % 100) < chancePercent;
|
||||
if (rogueStats.explosivePieceCounter < 10)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
rogueStats.explosivePieceCounter = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool RollLaserPiece()
|
||||
|
||||
@@ -712,12 +712,11 @@ void TDrawScreen(HDC hdc, HWND hWnd)
|
||||
if (rogueStats.explosiveLevel > 0)
|
||||
{
|
||||
TCHAR explosiveText[96];
|
||||
int explosiveChance = 12 + (rogueStats.explosiveLevel - 1) * 8;
|
||||
if (explosiveChance > 40)
|
||||
{
|
||||
explosiveChance = 40;
|
||||
}
|
||||
_stprintf_s(explosiveText, _T("\u7206\u7834\u6982\u7387 %d%% %s"), explosiveChance, currentPieceIsExplosive ? _T("\u672c\u5757\u5df2\u7206\u7834") : _T("\u672c\u5757\u666e\u901a"));
|
||||
_stprintf_s(
|
||||
explosiveText,
|
||||
_T("\u7206\u7834\u8ba1\u6570 %d / 10 %s"),
|
||||
rogueStats.explosivePieceCounter,
|
||||
currentPieceIsExplosive ? _T("\u672c\u5757\u5df2\u7206\u7834") : _T("\u672c\u5757\u666e\u901a"));
|
||||
TextOut(hdc, combatRect.left + SS(18), combatRect.top + SS(146), explosiveText, lstrlen(explosiveText));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user