summaryrefslogtreecommitdiff
path: root/rules.ts
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2025-03-23 12:41:35 +0100
committerTor Andersson <tor@ccxvii.net>2025-03-23 12:41:35 +0100
commite017dd5f28576a31df6a767907f1dfa28472c4b0 (patch)
tree6fc52acea6a9297a48167c89b86188d42c42d0c3 /rules.ts
parent132d8e5f7a39247aaa64cea18947a38d932b77b8 (diff)
downloadland-and-freedom-e017dd5f28576a31df6a767907f1dfa28472c4b0.tar.gz
Log discarded end of year cards.
Diffstat (limited to 'rules.ts')
-rw-r--r--rules.ts20
1 files changed, 14 insertions, 6 deletions
diff --git a/rules.ts b/rules.ts
index d11e9dc..5867403 100644
--- a/rules.ts
+++ b/rules.ts
@@ -1589,12 +1589,6 @@ states.end_of_year_discard = {
}
game.discard[faction_id].push(c);
- if (
- game.hands[faction_id].length <= get_hand_limit(faction_id) &&
- game.tableaus[faction_id].length <= game.year
- ) {
- log(`${player} discarded cards.`);
- }
},
undo(_, player: Player) {
const faction_id = player_faction_map[player];
@@ -1609,6 +1603,20 @@ states.end_of_year_discard = {
}
},
confirm(_, player: Player) {
+ const faction_id = player_faction_map[player]
+ const {d: discarded} = get_active_node_args<EndOfYearDiscardArgs>();
+ log_br()
+ log(player + " discarded:")
+ for (let c of discarded[faction_id].t)
+ log(">C" + c)
+ const n = discarded[faction_id].h.length
+ if (n === 1)
+ log(">" + n + " card from hand")
+ else if (n > 1)
+ log(">" + n + " cards from hand")
+ else
+ log(">No cards from hand")
+
set_delete(game.active as Player[], player);
if (game.active.length === 0) {
resolve_active_and_proceed();