diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-06-23 18:06:56 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-07-07 18:39:37 +0200 |
commit | 55578bb49831b1636e0a3ec6826d5a0844b953b0 (patch) | |
tree | 42ea45ef8f8ee1591494d5acf3a23af694ac171e | |
parent | a479d98378de71855f9cd38e2da8204aef0158b8 (diff) | |
download | time-of-crisis-55578bb49831b1636e0a3ec6826d5a0844b953b0.tar.gz |
Pax Deorum.
-rw-r--r-- | rules.js | 33 |
1 files changed, 29 insertions, 4 deletions
@@ -1,12 +1,10 @@ "use strict" - /* TODO ---- [ ] cut holes for capital in region svg -[ ] crisis pax deorum [ ] combat battle screen - splay stack / dialog for watching contents and taking hits [ ] killed leader stash for buy/trash phase @@ -616,6 +614,10 @@ function next_player() { return (game.current + 1) % game.legacy.length } +function prev_player() { + return (game.current + game.legacy.length - 1) % game.legacy.length +} + function find_unused_legion() { for (let ix = 0; ix < LEGION_COUNT; ++ix) if (get_legion_location(ix) === AVAILABLE) @@ -1257,8 +1259,31 @@ states.ira_deorum = { function goto_pax_deorum() { logi("Pax Deorum") - logi("TODO") - goto_take_actions() + + game.count = game.current + + for (let p = 0; p < game.legacy.length; ++p) + if (game.draw[p].length === 0) + flip_discard_to_available(p) + + game.current = prev_player() + game.state = "pax_deorum" +} + +states.pax_deorum = { + prompt(player) { + prompt("Pax Deorum: Draw one card.") + for (let c of game.draw[player]) + gen_action_card(c) + }, + card(c, player) { + set_add(game.hand[player], c) + set_delete(game.draw[player], c) + if (game.current === game.count) + goto_take_actions() + else + game.current = prev_player() + }, } // CRISIS: BARBARIAN INVASION |