summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-11-29 15:54:29 +0100
committerTor Andersson <tor@ccxvii.net>2024-11-29 15:57:56 +0100
commit7a5e5c79016444f69ca9515a60d0ebe19a4b8780 (patch)
tree909a84eb11f2c07d6e291c79991e28abc5e4b1b5 /rules.js
parent34290b89f1c6e09d8a67f9e9c2768b964e960bca (diff)
download1989-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.js46
1 files changed, 21 insertions, 25 deletions
diff --git a/rules.js b/rules.js
index 3437e77..4c3d701 100644
--- a/rules.js
+++ b/rules.js
@@ -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)
}