diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-09-18 21:44:44 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-09-18 21:44:44 +0200 |
commit | f493bce41a2d95913d28bcdf6b57cc26fb3d53bb (patch) | |
tree | 22a83724b7787f7fbb784233742594d1b348a851 | |
parent | 96757d842ce38f84290e628e4f3a7a5c07d2be9b (diff) | |
download | washingtons-war-f493bce41a2d95913d28bcdf6b57cc26fb3d53bb.tar.gz |
don't accidentally reveal replacement card
-rw-r--r-- | rules.js | 23 |
1 files changed, 12 insertions, 11 deletions
@@ -1513,7 +1513,7 @@ function next_strategy_card() { log_br() log("Tournament Rule!") log("British replacement card.") - set_add(game.b_hand, game.card = deal_card()) + set_add(game.b_hand, game.replacement_card = deal_card()) game.state = "draw_replacement_card_tournament" return } @@ -1564,7 +1564,7 @@ function clear_queue() { function draw_british_replacement() { if (game.b_draw > 0) { log("British replacement card.") - set_add(game.b_hand, game.card = deal_card()) + set_add(game.b_hand, game.replacement_card = deal_card()) game.b_draw-- return true } @@ -1574,7 +1574,7 @@ function draw_british_replacement() { function draw_american_replacement() { if (game.a_draw > 0) { log("American replacement card.") - set_add(game.a_hand, game.card = deal_card()) + set_add(game.a_hand, game.replacement_card = deal_card()) game.a_draw-- return true } @@ -1584,13 +1584,13 @@ function draw_american_replacement() { states.draw_replacement_card = { inactive: "to draw a replacement card", prompt() { - view.prompt = "You drew " + card_name(game.card) + "." - view.selected_card = game.card + view.prompt = "You drew " + card_name(game.replacement_card) + "." + view.selected_card = game.replacement_card view.actions.next = 1 }, next() { clear_undo() - game.card = 0 + delete game.replacement_card next_strategy_card() }, } @@ -1598,14 +1598,14 @@ states.draw_replacement_card = { states.draw_replacement_card_opponent = { inactive: "to draw a replacement card", prompt() { - view.prompt = "You drew " + card_name(game.card) + "." - view.selected_card = game.card + view.prompt = "You drew " + card_name(game.replacement_card) + "." + view.selected_card = game.replacement_card view.actions.next = 1 }, next() { clear_undo() + delete game.replacement_card game.active = ENEMY[game.active] - game.card = 0 next_strategy_card() }, } @@ -1613,12 +1613,13 @@ states.draw_replacement_card_opponent = { states.draw_replacement_card_tournament = { inactive: "to draw a replacement card", prompt() { - view.prompt = "You drew " + card_name(game.card) + "." - view.selected_card = game.card + view.prompt = "You drew " + card_name(game.replacement_card) + "." + view.selected_card = game.replacement_card view.actions.next = 1 }, next() { clear_undo() + delete game.replacement_card goto_strategy_phase(game.active) }, } |