Treat dream wolves as minions until they convert

This commit is contained in:
Alec Maier
2020-04-11 14:29:02 -04:00
parent 49ab315566
commit 9ada0a4d6f
4 changed files with 38 additions and 31 deletions

View File

@@ -17,13 +17,14 @@ class Card {
}
class Game {
constructor(accessCode, size, deck, time) {
constructor(accessCode, size, deck, time, hasDreamWolf) {
this.accessCode = accessCode;
this.size = size;
this.deck = deck;
this.time = time;
this.players = [];
this.status = "lobby";
this.hasDreamWolf = hasDreamWolf;
this.endTime = null;
}
}
@@ -230,11 +231,13 @@ function createGame() {
// send a new game to the server, and then join it
const playerInfo = {name: document.getElementById("name").value, code: code, id: id};
let gameDeck = buildDeckFromQuantities();
const game = new Game(
code,
gameSize,
buildDeckFromQuantities(),
Math.ceil(document.getElementById("time").value)
gameDeck,
Math.ceil(document.getElementById("time").value),
gameDeck.find((card) => card.role === "Dream Wolf") !== undefined
);
socket.emit('newGame', game, function() {
socket.emit('joinGame', playerInfo);