diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-02-19 19:22:35 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-02-18 11:54:52 +0100 |
commit | 632d3262d78fbc64a3e737f632c3beea7d41613e (patch) | |
tree | 55895ebf7fc73ccb72b4a3b59c0dd81780f185cb | |
parent | f92474517f34250f6fd81ce2beefd0ae80a39ab5 (diff) | |
download | wilderness-war-632d3262d78fbc64a3e737f632c3beea7d41613e.tar.gz |
List possible attack battle response events.
-rw-r--r-- | rules.js | 37 |
1 files changed, 32 insertions, 5 deletions
@@ -3962,23 +3962,50 @@ function goto_battle_defender_events() { states.attacker_events = { prompt() { + let have = []; + let dont_have = []; view.prompt = "Attacker may play battle response cards."; if (can_play_ambush_in_attack()) { - if (player.hand.includes(AMBUSH_1)) + if (player.hand.includes(AMBUSH_1)) { gen_action('play_event', AMBUSH_1); - if (player.hand.includes(AMBUSH_2)) + have.push('"Ambush"'); + } else { + dont_have.push('"Ambush"'); + } + if (player.hand.includes(AMBUSH_2)) { gen_action('play_event', AMBUSH_2); + have.push('"Ambush"'); + } else { + dont_have.push('"Ambush"'); + } } if (can_play_coehorns_in_attack()) { - if (player.hand.includes(COEHORNS)) + if (player.hand.includes(COEHORNS)) { gen_action('play_event', COEHORNS); + have.push('"Coehorns"'); + } else { + dont_have.push('"Coehorns"'); + } } if (can_play_fieldworks_in_attack()) { - if (player.hand.includes(FIELDWORKS_1)) + if (player.hand.includes(FIELDWORKS_1)) { gen_action('play_event', FIELDWORKS_1); - if (player.hand.includes(FIELDWORKS_2)) + have.push('"Fieldworks"'); + } else { + dont_have.push('"Fieldworks"'); + } + if (player.hand.includes(FIELDWORKS_2)) { gen_action('play_event', FIELDWORKS_2); + have.push('"Fieldworks"'); + } else { + dont_have.push('"Fieldworks"'); + } } + view.prompt = "Attack."; + if (have.length > 0) + view.prompt += " You may play " + have.join(" or ") + "."; + if (dont_have.length > 0) + view.prompt += " You don't have " + have.join(" and ") + "."; gen_action_next(); }, play_event(c) { |