From 393be54dbfd5897574cb8f3f38020138194274ff Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 9 May 2024 18:40:55 +0200 Subject: remove british cu event --- rules.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/rules.js b/rules.js index e68d51f..b00798d 100644 --- a/rules.js +++ b/rules.js @@ -2491,6 +2491,29 @@ function gen_remove_american_cu() { } } +events.remove_british_cu = function (c, card) { + play_card(c); + game.state = 'remove_british_cu'; + game.count = card.count +} + +states.remove_british_cu = { + prompt: function (current) { + view.prompt = "Remove " + game.count + " British CU from any space."; + gen_pass(); + gen_remove_british_cu(); + }, + remove_cu: function (where) { + let cu = find_british_cu(where) + remove_cu(cu.owner, where, 1); + if (--game.count === 0) + end_strategy_card(); + }, + pass: function () { + end_strategy_card(); + }, +} + function gen_remove_british_cu() { for (let space in SPACES) { if (has_british_cu(space)) -- cgit v1.2.3