增加难度上升机制

This commit is contained in:
2026-04-26 09:55:21 +08:00
parent 72df9d474a
commit 30ccac8cbd
5 changed files with 198 additions and 35 deletions
+12 -8
View File
@@ -223,6 +223,9 @@ void ResetPlayerStats(PlayerStats& stats, bool useRogueRules)
stats.stableStructureLevel = 0;
stats.doubleGrowthLevel = 0;
stats.gamblerLevel = 0;
stats.difficultyElapsedMs = 0;
stats.difficultyLevel = 0;
stats.lockedRows = 0;
for (int i = 0; i < 7; i++)
{
stats.pieceTuningLevels[i] = 0;
@@ -250,7 +253,7 @@ bool IsPiecePlacementValid(int pieceType, int pieceState, Point position)
int checkY = position.y + i;
int checkX = position.x + j;
if (checkX < 0 || checkX >= nGameWidth || checkY >= nGameHeight)
if (checkX < 0 || checkX >= nGameWidth || checkY >= GetRoguePlayableHeight())
{
return false;
}
@@ -288,7 +291,7 @@ bool CanMoveDown()
int nextX = point.x + j;
// 检查是否到达底部边界
if (nextY >= nGameHeight)
if (nextY >= GetRoguePlayableHeight())
{
return false;
}
@@ -511,7 +514,7 @@ void Fixing()
}
// 将当前方块在可视区域内的部分写入工作区
if (fixY >= 0 && fixY < nGameHeight && fixX >= 0 && fixX < nGameWidth)
if (fixY >= 0 && fixY < GetRoguePlayableHeight() && fixX >= 0 && fixX < nGameWidth)
{
workRegion[fixY][fixX] = currentPieceIsRainbow ? 8 : bricks[type][state][i][j];
if (currentPieceIsExplosive && explosiveCellCount < 4)
@@ -560,7 +563,7 @@ void Fixing()
for (int i = 0; i < 3; i++)
{
DeleteOneLine(nGameHeight - 1);
DeleteOneLine(GetRoguePlayableHeight() - 1);
}
SetFeedbackMessage(
@@ -643,9 +646,9 @@ void Fixing()
{
crossRow = 0;
}
if (crossRow >= nGameHeight)
if (crossRow >= GetRoguePlayableHeight())
{
crossRow = nGameHeight - 1;
crossRow = GetRoguePlayableHeight() - 1;
}
if (crossColumn < 0)
{
@@ -739,7 +742,8 @@ int DeleteLines()
int clearedLines = 0;
bool clearedWithRainbow = false;
for (int i = nGameHeight - 1; i >= 0; i--)
int playableHeight = GetRoguePlayableHeight();
for (int i = playableHeight - 1; i >= 0; i--)
{
bool fullLine = true;
@@ -782,7 +786,7 @@ int DeleteLines()
{
for (int x = centerX - 1; x <= centerX + 1; x++)
{
if (y >= 0 && y < nGameHeight && x >= 0 && x < nGameWidth && workRegion[y][x] != 0)
if (y >= 0 && y < GetRoguePlayableHeight() && x >= 0 && x < nGameWidth && workRegion[y][x] != 0)
{
workRegion[y][x] = 0;
followupCleared++;