mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-16 06:18:42 +02:00
IPVGO: ensure offline nodes 2: electric boogaloo (#2072)
This commit is contained in:
committed by
GitHub
parent
3691e4b8d8
commit
ab0bacaf63
@@ -33,6 +33,8 @@ export function addObstacles(boardState: BoardState) {
|
||||
|
||||
boardState.board = addDeadNodesToEdge(boardState.board, random, edgeDeadCount);
|
||||
|
||||
boardState.board = ensureOfflineNodes(boardState.board);
|
||||
|
||||
boardState.board = resetCoordinates(boardState.board);
|
||||
}
|
||||
|
||||
@@ -112,6 +114,14 @@ function addCenterBreak(board: Board, random: rand) {
|
||||
return randomizeRotation(board, random);
|
||||
}
|
||||
|
||||
function ensureOfflineNodes(board: Board) {
|
||||
if (board.flat().some((point) => !point)) {
|
||||
return board;
|
||||
}
|
||||
board[0][0] = null;
|
||||
return board;
|
||||
}
|
||||
|
||||
function randomizeRotation(board: Board, random: rand) {
|
||||
return rotateNTimes(board, random(0, 3));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user