summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rules.js22
1 files changed, 11 insertions, 11 deletions
diff --git a/rules.js b/rules.js
index 983749d..bac424f 100644
--- a/rules.js
+++ b/rules.js
@@ -225,7 +225,7 @@ function deal_cards(deck, n) {
if (events < max_events || deck[c] > 7) {
if (deck[c] <= 7)
++events
- hand.push(deck[c])
+ set_add(hand, deck[c])
deck.splice(c, 1)
}
}
@@ -957,35 +957,35 @@ states.discard_and_play_card = {
game.c_discard = c
else
game.c_card = c
- remove_from_array(game.c_hand, c)
+ set_delete(game.c_hand, c)
}
if (current === POMPEIUS) {
if (!game.p_discard)
game.p_discard = c
else
game.p_card = c
- remove_from_array(game.p_hand, c)
+ set_delete(game.p_hand, c)
}
resume_discard_and_play_card()
},
undo: function (_, current) {
if (current === CAESAR) {
if (game.c_discard) {
- game.c_hand.push(game.c_discard)
+ set_add(game.c_hand, game.c_discard)
game.c_discard = 0
}
if (game.c_card) {
- game.c_hand.push(game.c_card)
+ set_add(game.c_hand, game.c_card)
game.c_card = 0
}
}
if (current === POMPEIUS) {
if (game.p_discard) {
- game.p_hand.push(game.p_discard)
+ set_add(game.p_hand, game.p_discard)
game.p_discard = 0
}
if (game.p_card) {
- game.p_hand.push(game.p_card)
+ set_add(game.p_hand, game.p_card)
game.p_card = 0
}
}
@@ -1067,11 +1067,11 @@ states.play_card = {
},
card: function (card, current) {
if (current === CAESAR) {
- remove_from_array(game.c_hand, card)
+ set_delete(game.c_hand, card)
game.c_card = card
}
if (current === POMPEIUS) {
- remove_from_array(game.p_hand, card)
+ set_delete(game.p_hand, card)
game.p_card = card
}
resume_play_card()
@@ -1079,13 +1079,13 @@ states.play_card = {
undo: function (_, current) {
if (current === CAESAR) {
if (game.c_card) {
- game.c_hand.push(game.c_card)
+ set_add(game.c_hand, game.c_card)
game.c_card = 0
}
}
if (current === POMPEIUS) {
if (game.p_card) {
- game.p_hand.push(game.p_card)
+ set_add(game.p_hand, game.p_card)
game.p_card = 0
}
}