diff options
Diffstat (limited to 'rules.js')
-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 |