summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rules.js98
1 files changed, 47 insertions, 51 deletions
diff --git a/rules.js b/rules.js
index f950ad5..c51be32 100644
--- a/rules.js
+++ b/rules.js
@@ -4632,71 +4632,24 @@ function goto_gain_legacy_provinces() {
game.end = 1
}
- goto_buy_trash_cards()
+ goto_buy_trash_discard()
}
// === BUY / TRASH CARDS ===
-function count_political_points() {
- let pp = 0
- for (let where = 0; where < 12; ++where) {
- if (is_own_province(where)) {
- pp += get_support(where)
- pp -= get_mobs(where)
- }
- }
- return pp
-}
-
-function goto_buy_trash_cards() {
+function goto_buy_trash_discard() {
log_br()
if (game.played.length > 0)
log("Played " + game.played.map(c=>card_name(c)).join(", ") + ".")
else
log("Played no cards.")
- log_br()
-
- //log_h3("Buy/Trash Cards")
-
- game.pp = count_political_points()
-
- log_h3(game.pp + " Political Points.")
- if (used_card_event(CARD_S2X)) {
- let n = Math.min(2, game.sip)
- if (n > 0) {
- log("+" + n + " for Princeps Senatus.")
- game.pp += n
- }
- }
-
- game.mip = game.sip = game.pip = 0
- for (let i = 0; i < 3; ++i) {
- if (game.killed & (1 << i)) {
- logi("+2 senate credits")
- game.sip += 2
- }
- }
- for (let i = 3; i < 6; ++i) {
- if (game.killed & (1 << i)) {
- logi("+2 military credits")
- game.mip += 2
- }
- }
-
- let discard = current_discard()
- for (let c of game.played)
- set_add(discard, c)
- game.played.length = 0
- game.used.length = 0
-
- game.count = 0
if (game.end)
goto_end_of_turn()
else if (current_hand().length > 0)
game.state = "buy_trash_discard"
else
- game.state = "buy_trash"
+ goto_buy_trash()
}
states.buy_trash_discard = {
@@ -4715,10 +4668,53 @@ states.buy_trash_discard = {
},
done() {
push_undo()
- game.state = "buy_trash"
+ goto_buy_trash()
},
}
+function count_political_points() {
+ let pp = 0
+ for (let where = 0; where < 12; ++where) {
+ if (is_own_province(where)) {
+ pp += get_support(where)
+ pp -= get_mobs(where)
+ }
+ }
+ return pp
+}
+
+function goto_buy_trash() {
+ log_br()
+
+ game.pp = count_political_points()
+ if (used_card_event(CARD_S2X))
+ game.pp += Math.min(2, game.sip)
+
+
+ game.mip = game.sip = game.pip = 0
+ for (let i = 0; i < 3; ++i)
+ if (game.killed & (1 << i))
+ game.sip += 2
+ for (let i = 3; i < 6; ++i)
+ if (game.killed & (1 << i))
+ game.mip += 2
+
+ log(game.pp + " Political Points.")
+ if (game.mip > 0)
+ log(game.mip + " military card credits.")
+ if (game.sip > 0)
+ log(game.sip + " senate card credits.")
+
+ let discard = current_discard()
+ for (let c of game.played)
+ set_add(discard, c)
+ game.played.length = 0
+ game.used.length = 0
+ game.count = 0
+
+ game.state = "buy_trash"
+}
+
function find_market_with_card(c) {
for (let m of game.market)
if (set_has(m, c))