summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js24
1 files changed, 22 insertions, 2 deletions
diff --git a/rules.js b/rules.js
index b905027..b7b4dfb 100644
--- a/rules.js
+++ b/rules.js
@@ -98,6 +98,7 @@ exports.view = function (state, role) {
deck: [ this_card, deck_size, game.of_gods_and_kings ],
cylinder: game.cylinder,
pieces: game.pieces,
+ tributary: game.tributary,
}
if (game.result) {
@@ -452,9 +453,9 @@ states.conscript = {
prompt() {
view.prompt = "Conscript: Select Tributaries, Qasbah or Dehli to place troops."
- if (can_select_cmd_space(1)) {
+ if (can_select_cmd_space(1) && can_conscript()) {
for (let s = first_space; s <= last_space; ++s) {
- if (!is_selected_cmd_space(s))
+ if (!is_selected_cmd_space(s) && can_conscript_in_space(s))
gen_action_space(s)
}
}
@@ -528,6 +529,11 @@ function can_conscript() {
return true
}
+function can_conscript_in_space(s) {
+ if (s === S_DELHI || has_piece(s, DS, DISC) || is_tributary(s))
+ return true
+}
+
function conscript_count() {
if (game.op.where === S_DELHI)
return 5
@@ -555,6 +561,20 @@ function end_command() {
resume_event_card()
}
+/* TOKENS */
+
+function add_tributary(s) {
+ game.tributary |= (1 << s)
+}
+
+function is_tributary(s) {
+ return game.tributary & (1 << s)
+}
+
+function remove_tributary(s) {
+ game.tributary &= ~(1 << s)
+}
+
/* MISC SPACE + PIECE QUERIES */
function has_piece(s, faction, type) {