进一步补充详细注释
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
*/
|
||||
static void GetBrickBounds(int brickType, int brickState, int& minRow, int& maxRow, int& minCol, int& maxCol)
|
||||
{
|
||||
// 初始值设置在矩阵之外,遍历到第一个非空格后会被收缩到真实边界。
|
||||
minRow = 4;
|
||||
maxRow = -1;
|
||||
minCol = 4;
|
||||
@@ -69,6 +70,7 @@ Point GetSpawnPoint(int brickType)
|
||||
int minRow, maxRow, minCol, maxCol;
|
||||
GetBrickBounds(brickType, 0, minRow, maxRow, minCol, maxCol);
|
||||
|
||||
// 只使用初始状态的包围盒计算出生点,保持每种方块生成位置稳定。
|
||||
int brickWidth = maxCol - minCol + 1;
|
||||
int brickHeight = maxRow - minRow + 1;
|
||||
Point spawnPoint;
|
||||
@@ -147,6 +149,7 @@ bool ResolveFixingOverflow(bool overflowTop)
|
||||
return true;
|
||||
}
|
||||
|
||||
// 终末清场优先级高于普通最后一搏,会消耗一次最后一搏和一枚清屏炸弹。
|
||||
if (currentMode == MODE_ROGUE && rogueStats.terminalClearLevel > 0 && rogueStats.lastChanceCount > 0 && rogueStats.screenBombCount > 0)
|
||||
{
|
||||
rogueStats.lastChanceCount--;
|
||||
@@ -165,6 +168,7 @@ bool ResolveFixingOverflow(bool overflowTop)
|
||||
return true;
|
||||
}
|
||||
|
||||
// 最后一搏只清理底部三行,让顶部溢出的局面获得一次继续机会。
|
||||
if (currentMode == MODE_ROGUE && rogueStats.lastChanceCount > 0)
|
||||
{
|
||||
rogueStats.lastChanceCount--;
|
||||
@@ -212,6 +216,7 @@ int ScanAndDeleteFullLines(int clearedRows[], int& clearedRowCount)
|
||||
int clearedLines = 0;
|
||||
clearedRowCount = 0;
|
||||
|
||||
// 从底向上扫描,删除后 i++ 让当前位置继续检查新落下来的行。
|
||||
int playableHeight = GetRoguePlayableHeight();
|
||||
for (int i = playableHeight - 1; i >= 0; i--)
|
||||
{
|
||||
@@ -267,6 +272,7 @@ void DispatchLineClearEffect(const int clearedRows[], int clearedRowCount, int c
|
||||
*/
|
||||
void ResolveChainBombFollowup(int clearedLines)
|
||||
{
|
||||
// 没有标准消行时,连环炸弹追加爆破不触发,并清掉挂起标记。
|
||||
if (!pendingChainBombFollowup || clearedLines <= 0)
|
||||
{
|
||||
pendingChainBombFollowup = false;
|
||||
@@ -275,6 +281,7 @@ void ResolveChainBombFollowup(int clearedLines)
|
||||
|
||||
pendingChainBombFollowup = false;
|
||||
|
||||
// 追加爆破以第一次爆破落地点为中心,只执行一次 3x3 清除。
|
||||
int followupCleared = 0;
|
||||
int centerY = pendingChainBombCenter.y;
|
||||
int centerX = pendingChainBombCenter.x;
|
||||
|
||||
Reference in New Issue
Block a user