mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-25 02:32:55 +02:00
IPVGO: Add support to netscript API for game state, current player, and alternate ways to check/wait on AI turn (#1142)
This commit is contained in:
committed by
GitHub
parent
6aaeb6b59e
commit
d81358c80f
@@ -1,7 +1,7 @@
|
||||
import type { Board, BoardState, PointState } from "../Types";
|
||||
|
||||
import { Player } from "@player";
|
||||
import { GoOpponent, GoColor } from "@enums";
|
||||
import { GoOpponent, GoColor, GoPlayType } from "@enums";
|
||||
import { newOpponentStats } from "../Constants";
|
||||
import { getAllChains, getPlayerNeighbors } from "./boardAnalysis";
|
||||
import { getKomi } from "./goAI";
|
||||
@@ -46,6 +46,13 @@ export function endGoGame(boardState: BoardState) {
|
||||
if (boardState.previousPlayer === null) {
|
||||
return;
|
||||
}
|
||||
Go.nextTurn = Promise.resolve({
|
||||
type: GoPlayType.gameOver,
|
||||
x: null,
|
||||
y: null,
|
||||
success: true,
|
||||
});
|
||||
|
||||
boardState.previousPlayer = null;
|
||||
const statusToUpdate = getOpponentStats(boardState.ai);
|
||||
statusToUpdate.favor = statusToUpdate.favor ?? 0;
|
||||
|
||||
Reference in New Issue
Block a user