From 3d4c22c7b1d3ec35af06386808f3fe4e16aa7cb7 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 4 Nov 2024 17:01:19 +0000 Subject: Fix tactics fails and leaders --- rules.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/rules.js b/rules.js index 8b93ac5..0cdda62 100644 --- a/rules.js +++ b/rules.js @@ -489,7 +489,6 @@ states.place_starting_infl = { view.prompt = 'Place starting SPs: done.'; gen_action("done"); return; - } else if (game.temp > 2) { } else if (game.temp > 2) { view.prompt = `Place your last ${pluralize(game.available_ops,'starting SP')}.` } else { @@ -1299,6 +1298,8 @@ states.power_struggle = { } }, power_card(card) { + console.log('game.phase', game.phase, 'game.played_power_card', game.played_power_card) + if(game.proxy_power_card) {console.log('game.proxy_power_card', game.proxy_power_card)} push_undo() discard(card) if (game.phase === 0) { @@ -1312,7 +1313,11 @@ states.power_struggle = { game.return_state = 'power_struggle' if (game.phase === 0) {delete game.proxy_power_card} if (card === PC_TACTIC_FAILS) { - log_gap(`Played P${PC_TACTIC_FAILS}: P${game.played_power_card} no longer playable`) + if (game.proxy_power_card) { + log_gap(`Played P${PC_TACTIC_FAILS}: ${game.proxy_power_card} no longer playable`) + } else { + log_gap(`Played P${PC_TACTIC_FAILS}: P${game.played_power_card} no longer playable`) + } } else { if (game.phase === 0 && leader_cards.includes(card)) {} /* Log nothing. Probably a better way to do this */ else if (numberless_cards.includes(card)) { @@ -1346,7 +1351,11 @@ states.power_struggle = { } } else if (game.phase === 1) { if (card === PC_TACTIC_FAILS) { - game.tactics_fails = power_cards[game.played_power_card].name + if (game.proxy_power_card) { + game.tactics_fails = game.proxy_power_card + } else { + game.tactics_fails = power_cards[game.played_power_card].name + } game.phase = 0 next_player() do_valid_cards() @@ -1360,6 +1369,7 @@ states.power_struggle = { } }, roll () { + clear_undo() let roll = roll_d6() log(`Roll: D${roll}`) if (roll >= power_cards[game.played_power_card].value) { @@ -2398,7 +2408,9 @@ function valid_spaces_infl() { function valid_cards(player_hand, presence) { const valid_cards_set = new Set() + console.log('game.phase', game.phase, 'game.tactics_fails', game.tactics_fails) if (game.phase === 0) { + for (let c of player_hand) { let card = power_cards[c] // Never add tactics fails -- cgit v1.2.3