diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-11-29 15:54:29 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-11-29 15:57:56 +0100 |
commit | 7a5e5c79016444f69ca9515a60d0ebe19a4b8780 (patch) | |
tree | 909a84eb11f2c07d6e291c79991e28abc5e4b1b5 /rules.js | |
parent | 34290b89f1c6e09d8a67f9e9c2768b964e960bca (diff) | |
download | 1989-dawn-of-freedom-7a5e5c79016444f69ca9515a60d0ebe19a4b8780.tar.gz |
Show disabled "Event" buttons for events that cannot be played.
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 46 |
1 files changed, 21 insertions, 25 deletions
@@ -659,7 +659,25 @@ states.play_card = { } // Continue with normal logic - get_events(game.played_card) + if (cards[game.played_card].side === 'D') { + if (game.active === DEM) view.actions.event = 1 + if (game.active === COM) view.actions.opp_event = 1 + } else if (cards[game.played_card].side === 'C') { + if (game.active === COM) view.actions.event = 1 + if (game.active === DEM) view.actions.opp_event = 1 + } else { + view.actions.event = 1 + } + } else { + if (cards[game.played_card].side === 'D') { + if (game.active === DEM) view.actions.event = 0 + if (game.active === COM) view.actions.opp_event = 0 + } else if (cards[game.played_card].side === 'C') { + if (game.active === COM) view.actions.event = 0 + if (game.active === DEM) view.actions.opp_event = 0 + } else { + view.actions.event = 0 + } } gen_action('influence') @@ -3359,28 +3377,6 @@ function is_auto_resolve(card) { } } -function get_events(card) { - if (event_is_playable(card)) { - if (cards[card].side === 'D') { - if (game.active === DEM) { - gen_action('event') - } - if (game.active === COM) { - gen_action('opp_event') - } - } else if (cards[card].side === 'C') { - if (game.active === COM) { - gen_action('event') - } - if (game.active === DEM) { - gen_action('opp_event') - } - } else { - gen_action('event') - } - } -} - function event_is_playable(card) { // Reformer never playable here if (card === C_REFORMER_REHABILITATED) { @@ -3540,8 +3536,8 @@ function finish_play_card() { return } } - // Check if card is opponent card with event that needs to be resolved + // Check if card is opponent card with event that needs to be resolved if (cards[game.played_card].playable || game.playable_cards.includes(game.played_card)) { if ( (game.active === DEM && cards[game.played_card].side === 'C') || @@ -7377,7 +7373,7 @@ states.vm_nomenklatura_remove = { states.vm_nomenklatura_add = { prompt() { - view.prompt = `Nomenklatura: Place ${pluralize(game.vm_available_ops, 'SP') in any Elite space(s).` + view.prompt = `Nomenklatura: Place ${pluralize(game.vm_available_ops, 'SP')} in any Elite space(s).` for (let space_id of game.valid_spaces) { gen_action_space(space_id) } |