Draw new cards for a team when the spirit selects a card to answer rather than right when the medium sends the card to the spirit.
This commit is contained in:
parent
d428d1160b
commit
ee16218c18
1 changed files with 9 additions and 2 deletions
|
|
@ -20,8 +20,11 @@ export default (io: Server, socket: Socket, data: SendCard) => {
|
||||||
|
|
||||||
// The writer is answering
|
// The writer is answering
|
||||||
if (data.from === "writer") {
|
if (data.from === "writer") {
|
||||||
game.log.debug(` Writer selected question to answer.`);
|
game.log.debug(`Writer selected question to answer.`);
|
||||||
|
|
||||||
|
// Draw new cards for team
|
||||||
deck.discard(data.text);
|
deck.discard(data.text);
|
||||||
|
team.addCardsToHand(game.questions.draw(conf.game.hand_size - team.hand.length));
|
||||||
team.selectQuestion(data.text);
|
team.selectQuestion(data.text);
|
||||||
|
|
||||||
socket.emit(`UpdateHand`, {
|
socket.emit(`UpdateHand`, {
|
||||||
|
|
@ -29,6 +32,11 @@ export default (io: Server, socket: Socket, data: SendCard) => {
|
||||||
mode: "replace",
|
mode: "replace",
|
||||||
questions: []
|
questions: []
|
||||||
});
|
});
|
||||||
|
io.to(`${game.id}:${team.id}:guesser`).emit(`UpdateHand`, {
|
||||||
|
status: 200,
|
||||||
|
mode: "replace",
|
||||||
|
questions: team.hand
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -38,7 +46,6 @@ export default (io: Server, socket: Socket, data: SendCard) => {
|
||||||
|
|
||||||
// Update the team's hand
|
// Update the team's hand
|
||||||
team.removeCard(data.text);
|
team.removeCard(data.text);
|
||||||
team.addCardsToHand(game.questions.draw(conf.game.hand_size - team.hand.length));
|
|
||||||
|
|
||||||
// send the question text to the writer player
|
// send the question text to the writer player
|
||||||
io.to(`${game.id}:${team.id}:writer`).emit(`UpdateHand`, {
|
io.to(`${game.id}:${team.id}:writer`).emit(`UpdateHand`, {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue