summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-07-01 13:08:00 +0200
committerTor Andersson <tor@ccxvii.net>2022-11-16 19:08:56 +0100
commit76bc773610ef4f2bc942fda4cf2e0f68fe20f1d5 (patch)
tree5789ea528f127739c5306c28d9c0fb870a783574 /rules.js
parent5268425a6e0636d21c6f9e76e504b8ebc9d75f83 (diff)
downloadjulius-caesar-76bc773610ef4f2bc942fda4cf2e0f68fe20f1d5.tar.gz
caesar: Use const for BOTH.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/rules.js b/rules.js
index 9bbc975..1e48f53 100644
--- a/rules.js
+++ b/rules.js
@@ -11,6 +11,7 @@ const { CARDS, SPACES, EDGES, BLOCKS } = require('./data');
const APOLLO = 1;
+const BOTH = "Both";
const CAESAR = "Caesar";
const POMPEIUS = "Pompeius";
const CLEOPATRA = "Cleopatra";
@@ -98,11 +99,11 @@ function print_turn_log(verb) {
}
function is_active_player(current) {
- return (current == game.active) || (game.active == "Both" && (current == CAESAR || current == POMPEIUS));
+ return (current == game.active) || (game.active == BOTH && (current == CAESAR || current == POMPEIUS));
}
function is_inactive_player(current) {
- return current == "Observer" || (game.active != current && game.active != "Both");
+ return current == "Observer" || (game.active != current && game.active != BOTH);
}
function remove_from_array(array, item) {
@@ -800,7 +801,7 @@ function start_year() {
game.p_card = 0;
game.c_discard = 0;
game.p_discard = 0;
- game.active = "Both";
+ game.active = BOTH;
game.state = 'discard_and_play_card';
game.show_cards = false;
}
@@ -813,7 +814,7 @@ function resume_discard_and_play_card() {
else if (game.p_card)
game.active = CAESAR;
else
- game.active = "Both";
+ game.active = BOTH;
}
states.discard_and_play_card = {
@@ -914,7 +915,7 @@ function start_turn() {
game.reserves = [];
game.c_card = 0;
game.p_card = 0;
- game.active = "Both";
+ game.active = BOTH;
game.state = 'play_card';
game.show_cards = false;
game.surprise = 0;
@@ -930,7 +931,7 @@ function resume_play_card() {
else if (game.p_card)
game.active = CAESAR;
else
- game.active = "Both";
+ game.active = BOTH;
}
states.play_card = {