summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriainp5 <iain.pearce.ip@gmail.com>2024-11-04 17:01:19 +0000
committeriainp5 <iain.pearce.ip@gmail.com>2024-11-04 17:01:19 +0000
commit3d4c22c7b1d3ec35af06386808f3fe4e16aa7cb7 (patch)
tree301cf78878b45b5c2bb947945b5910618206e331
parent6b56c2472e7c234e16c05425a61bd02ca2729fb4 (diff)
download1989-dawn-of-freedom-3d4c22c7b1d3ec35af06386808f3fe4e16aa7cb7.tar.gz
Fix tactics fails and leaders
-rw-r--r--rules.js18
1 files changed, 15 insertions, 3 deletions
diff --git a/rules.js b/rules.js
index 8b93ac5..0cdda62 100644
--- a/rules.js
+++ b/rules.js
@@ -490,7 +490,6 @@ states.place_starting_infl = {
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 {
view.prompt = `Place ${pluralize(game.available_ops,'starting SP')}.`
@@ -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