summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--play.js8
-rw-r--r--rules.js58
2 files changed, 23 insertions, 43 deletions
diff --git a/play.js b/play.js
index 3c6b1af..9e00d94 100644
--- a/play.js
+++ b/play.js
@@ -505,7 +505,7 @@ function layout_stability_marker() {
ui.stability.style.top = y - 25 + "px"
}
-let TST_X = [ 53, 53 + 69, 53 + 69 * 2, 53 + 69 * 3, 53 + 69 * 4, 53 + 69 * 5, 53 + 69 * 6, 556 ]
+let TST_X = [ 0, 53, 53 + 69, 53 + 69 * 2, 53 + 69 * 3, 53 + 69 * 4, 53 + 69 * 5, 53 + 69 * 6, 556 ]
let TST_Y = [ 2128, 2257 ]
function layout_tst_marker(e, v, top) {
@@ -666,9 +666,9 @@ function on_update() {
if (view.power_hand)
for (let c of view.power_hand)
ui.power_hand.appendChild(ui.power_cards[c])
-
+
ui.opp_hand.replaceChildren()
- if (view.opp_hand)
+ if (view.show_opp_hand && view.opp_hand)
for (let c of view.opp_hand)
ui.opp_hand.appendChild(ui.cards[c])
@@ -812,7 +812,7 @@ function on_log(text) {
p.className = "h3"
}
- text = text.replace(/\*/g, "")
+ text = text.replace(/([a-zA-Z])\*/g, "")
p.innerHTML = text
return p
}
diff --git a/rules.js b/rules.js
index 34d8364..48b34af 100644
--- a/rules.js
+++ b/rules.js
@@ -1421,7 +1421,6 @@ states.raise_stakes_1 = {
inactive: 'raise the stakes.',
prompt () {
- console.log('raise stakes 1 - com hand', game.com_pwr_hand, 'dem hand', game.dem_pwr_hand)
if ((game.active === DEM && game.dem_pwr_hand < 3) || (game.active === COM && game.com_pwr_hand < 3)) {
view.prompt = 'Raise the stakes: you must pass.'
gen_action('pass')
@@ -1518,38 +1517,17 @@ states.raise_stakes_2 = {
},
pass() {
log('Did not raise the stakes')
- game.raised_stakes_discard = 0
- game.valid_cards = []
- log_h2('Play Cards')
- next_player()
- game.state = 'begin_power_struggle'
+ goto_struggle()
},
done () {
log_gap('Raised the stakes')
- game.raised_stakes_discard = 0
- game.valid_cards = []
- log_h2('Play Cards')
- next_player()
- game.state = 'begin_power_struggle'
+ goto_struggle()
},
}
-states.begin_power_struggle = {
- inactive: 'begin power struggle.',
- prompt() {
- view.prompt = 'Begin power struggle.'
- gen_action('struggle')
- },
- struggle () {
- do_valid_cards()
- game.state = 'power_struggle'
- }
-}
-
states.power_struggle = {
inactive: 'play a card.',
prompt () {
- console.log('game.vm_event', game.vm_event)
if (game.phase === 0) {
if (game.valid_cards.length > 0) {
view.prompt = "Play a card."
@@ -2047,23 +2025,11 @@ states.end_turn_4_5_4 = {
game.state = 'final_scoring_held'
} else {
- game.return_state = ''
- game.state = 'end_turn'
+ new_turn()
}
}
}
-states.end_turn = {
- inactive: 'end the turn.',
- prompt() {
- view.prompt = 'End Turn: done.'
- gen_action('done')
- },
- done() {
- new_turn()
- }
-}
-
states.final_scoring_held = {
inactive: 'resolve final scoring.',
prompt() {
@@ -3305,6 +3271,15 @@ function goto_game_over(result, victory) {
}
+function goto_struggle(){
+ game.raised_stakes_discard = 0
+ game.valid_cards = []
+ log_h2('Play Cards')
+ next_player()
+ game.state = 'power_struggle'
+ do_valid_cards()
+}
+
function reset_austria_hungary_border_reopened() {
game.austria_hungary_border_reopened_tracker = false
}
@@ -7170,7 +7145,6 @@ states.vm_kiss_of_death_finish = {
prompt() {
if (game.vm_event > 0 && game.vm_event !== C_COMMON_EUROPEAN_HOME && (cards[game.vm_event].side === 'D' || cards[game.vm_event].side === 'N')) {
view.prompt = `Play ${clean_name(cards[game.vm_event].name)} for the event.`
- console.log('kiss of death before event button: game.stategy_discard', game.strategy_discard)
gen_action('event')
} else {
view.prompt = 'Event does not occur.'
@@ -8398,8 +8372,14 @@ states.vm_support_surges_2 = {
states.vm_support_surges_3 = {
inactive: 'draw cards.',
prompt() {
- if (numberless_cards.includes(game.temp)) {
+ if (wildcards.includes(game.temp)) {
view.prompt = `Support Surges: you drew ${power_cards[game.temp].name}. Done.`
+ }
+ else if (elite_leaders.includes(game.temp)) {
+ view.prompt = `Support Surges: you drew an ${power_cards[game.temp].name}. Done.`
+ }
+ else if (numberless_cards.includes(game.temp)) {
+ view.prompt = `Support Surges: you drew a ${power_cards[game.temp].name}. Done.`
} else {
view.prompt = `Support Surges: you drew a ${power_cards[game.temp].name} ${power_cards[game.temp].value}. Done.`
}