From e43c00ffe5a00483da67898fb8abcf87cce5d419 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 10 Oct 2024 13:11:47 +0100 Subject: New logic for handling TST 7 --- play.css | 2 ++ play.html | 27 ++++++++++++++++++++++++--- play.js | 11 ++++++++++- rules.js | 12 ++++++++++++ 4 files changed, 48 insertions(+), 4 deletions(-) diff --git a/play.css b/play.css index 373904d..c6693d2 100644 --- a/play.css +++ b/play.css @@ -18,6 +18,8 @@ header.your_turn { background-color: orange; } } #deck_stat {padding-left: 5px; padding-bottom: 5px;} +#tank {margin-right: 0;} + #log { background-color: whitesmoke; } #log .h1 { font-weight: bold; padding-top:2px; padding-bottom:2px; text-align: center; } #log .h2 { padding-top:2px; padding-bottom:2px; text-align: center; } diff --git a/play.html b/play.html index aa69a76..718ee38 100644 --- a/play.html +++ b/play.html @@ -27,7 +27,7 @@
  • 🎴 Event
  • Place SPs
  • 💪 Support Check -
  • 🛤 Tiananmen Square Track +
  • Tiananmen Square Track @@ -36,7 +36,7 @@
  • 🎴 Resolve Opponent Event
  • Place SPs
  • 💪 Support Check -
  • 🛤 Tiananmen Square Track +
  • Tiananmen Square Track
  • @@ -49,6 +49,16 @@
  • 🛤 Tiananmen Square Track
  • + +
  • TITLE +
  • +
  • 🎴 Cancel Opponent Event +
  • 🎴 Resolve Opponent Event +
  • Place SPs +
  • 💪 Support Check +
  • Tiananmen Square Track +
  • +
  • TITLE
  • @@ -56,7 +66,18 @@
  • 🎴 Event
  • Place SPs
  • 💪 Support Check -
  • 🛤 Tiananmen Square Track +
  • Tiananmen Square Track +
  • + + +
  • TITLE +
  • +
  • 🎴 Cancel Opponent Event +
  • 🎴 Resolve Opponent Event +
  • 🎴 Event and Operations +
  • Place SPs +
  • 💪 Support Check +
  • Tiananmen Square Track
  • diff --git a/play.js b/play.js index 44a7d84..2c4d482 100644 --- a/play.js +++ b/play.js @@ -225,7 +225,9 @@ function hide_popup_menu() { document.getElementById("popup").style.display = "none" document.getElementById("popup_ceh_check").style.display = "none" document.getElementById("popup_opp_event").style.display = "none" + document.getElementById("popup_tst_7").style.display = "none" document.getElementById("popup_tst_8").style.display = "none" + document.getElementById("popup_tst_7_8").style.display = "none" } @@ -268,7 +270,14 @@ function on_click_card(evt) { evt.stopPropagation(); } } - //First check for TST special power + //First check for TST special powers + else if (is_card_action('card_tst_7', card)) { + if (is_card_action('card_tst_8', card)) { + show_popup_menu(evt, "popup_tst_7_8", card, cards[card].name) + } else { + show_popup_menu(evt, "popup_tst_7", card, cards[card].name) + } + } else if (is_card_action('card_tst_8', card)) { show_popup_menu(evt, "popup_tst_8", card, cards[card].name) } diff --git a/rules.js b/rules.js index e03476b..1b07a3d 100644 --- a/rules.js +++ b/rules.js @@ -440,6 +440,11 @@ states.choose_card = { //Check for Tiananmen Square Track awards special abilities + + if ((game.active === DEM && cards[card].side !== 'C' && game.dem_tst_position >= 7 && game.com_tst_position < 7 && !game.tst_7) || (game.active === COM && cards[card].side !== 'D' && game.com_tst_position >= 7 && game.dem_tst_position < 7 && !game.tst_7)){ + gen_action('card_tst_7', card) + } + console.log('game.tst_8', game.tst_8) if ((game.active === DEM && cards[card].side !== 'C' && game.dem_tst_position >= 8 && game.com_tst_position < 8 && !game.tst_8) || (game.active === COM && cards[card].side !== 'D' && game.com_tst_position >= 8 && game.dem_tst_position < 8 && !game.tst_8)){ gen_action('card_tst_8', card) @@ -595,6 +600,12 @@ states.choose_card = { game.state='support_check_prep' valid_spaces_sc() }, + card_tst_7() { + select_card(card) + game.vm_infl_to_do = true + game.tst_7 = true + game.state = 'resolve_opponent_event' + }, card_tst_8(card) { /*Play card for ops and event */ select_card(card) game.vm_event_to_do = true @@ -855,6 +866,7 @@ states.resolve_opponent_event = { } } + states.finish_add_infl = { inactive: 'add SPs.', prompt () { -- cgit v1.2.3