code for proof system

This commit is contained in:
jude
2023-03-18 15:41:37 +00:00
parent 2d72cdd87b
commit 6b001d9f2c
5 changed files with 97 additions and 8 deletions

View File

@ -146,10 +146,6 @@ document.addEventListener("ACT", async (ev) => {
game.currentPlayer().endTurn();
}
}
if (game.allReinforcementsPlaced()) {
game.incrementState();
}
} else {
if (await game.currentPlayer().act(data)) {
game.currentPlayer().endTurn();
@ -161,6 +157,12 @@ document.addEventListener("ACT", async (ev) => {
}
});
document.addEventListener("endTurn", () => {
if (game.isPregame() && game.allReinforcementsPlaced()) {
game.incrementState();
}
});
document.addEventListener("gameStateUpdate", async () => {
if (game.isPregame()) {
let firstPlayerIndex = await random.get(