From f493bce41a2d95913d28bcdf6b57cc26fb3d53bb Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 18 Sep 2024 21:44:44 +0200 Subject: don't accidentally reveal replacement card --- rules.js | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/rules.js b/rules.js index d1c1e39..96a4f30 100644 --- a/rules.js +++ b/rules.js @@ -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) }, } -- cgit v1.2.3