From de679761df9494f19717de8c9c57fc754d7d0dcd Mon Sep 17 00:00:00 2001
From: Tor Andersson <tor@ccxvii.net>
Date: Thu, 23 May 2024 00:44:51 +0200
Subject: pause after discarding TC before merging with hand.

---
 play.css |  4 ++++
 play.js  |  4 ++--
 rules.js | 37 +++++++++++++++++++++++++++----------
 3 files changed, 33 insertions(+), 12 deletions(-)

diff --git a/play.css b/play.css
index b8638f0..84b2a5f 100644
--- a/play.css
+++ b/play.css
@@ -375,7 +375,11 @@ TWOD.piece.cylinder {
 
 .card.action {
 	box-shadow: 0 0 0 4px white;
+}
+
+.card.action:hover {
 	margin-top: -10px;
+	margin-bottom: 10px;
 }
 
 /*
diff --git a/play.js b/play.js
index cdb802a..606167a 100644
--- a/play.js
+++ b/play.js
@@ -204,12 +204,12 @@ function make_tc_deck(n) {
 	for (let suit = 0; suit <= 3; ++suit) {
 		for (let value = 2; value <= 13; ++value) {
 			let c = (n << 7) | (suit << 4) | value
-			ui.tc[c] = create_piece("card", c, "card tc " + suit_class[suit] + value)
+			ui.tc[c] = create_piece("card", c, "card tc deck_" + (n+1) + " " + suit_class[suit] + value)
 		}
 	}
 	for (let value = 2; value <= 3; ++value) {
 		let c = (n << 7) | (4 << 4) | value
-		ui.tc[c] = create_piece("card", c, "card tc R")
+		ui.tc[c] = create_piece("card", c, "card tc deck_" + (n+1) + " R")
 	}
 }
 
diff --git a/rules.js b/rules.js
index 01f9c7f..7d7cb3a 100644
--- a/rules.js
+++ b/rules.js
@@ -864,7 +864,10 @@ function goto_tactical_cards() {
 	else
 		log("Drew " + n + " TC.")
 
-	game.state = "tactical_cards"
+	if (should_power_discard_tc() && game.draw.length > 0)
+		game.state = "tactical_cards_discard"
+	else
+		game.state = "tactical_cards_show"
 }
 
 function should_power_discard_tc() {
@@ -875,24 +878,38 @@ function should_power_discard_tc() {
 	return false
 }
 
-states.tactical_cards = {
+states.tactical_cards_discard = {
 	prompt() {
 		view.draw = game.draw
-		if (should_power_discard_tc() && game.draw.length > 0) {
-			prompt("Drew " + game.draw.length + " TCs. Discard one of them.")
-			for (let c of game.draw)
-				gen_action_card(c)
-		} else {
-			prompt("Drew " + game.draw.length + " TCs.")
-			view.actions.end_cards = 1
-		}
+		prompt("Drew " + game.draw.length + " TCs. Discard one of them.")
+		for (let c of game.draw)
+			gen_action_card(c)
 	},
 	card(c) {
 		push_undo()
 		log("Discarded 1 TC.")
 		set_delete(game.draw, c)
+		game.state = "tactical_cards_discard_done"
+	},
+}
+
+states.tactical_cards_discard_done = {
+	prompt() {
+		view.draw = game.draw
+		prompt("Drew " + (game.draw.length+1) + " TCs. Discard one of them.")
+		view.actions.end_cards = 1
+	},
+	end_cards() {
 		end_tactical_cards()
 	},
+}
+
+states.tactical_cards_show = {
+	prompt() {
+		view.draw = game.draw
+		prompt("Drew " + game.draw.length + " TCs.")
+		view.actions.end_cards = 1
+	},
 	end_cards() {
 		end_tactical_cards()
 	},
-- 
cgit v1.2.3