diff options
author | iainp5 <iain.pearce.ip@gmail.com> | 2024-10-10 13:11:47 +0100 |
---|---|---|
committer | iainp5 <iain.pearce.ip@gmail.com> | 2024-10-10 13:11:47 +0100 |
commit | e43c00ffe5a00483da67898fb8abcf87cce5d419 (patch) | |
tree | b5109b04e9cc93acca2d2872b957accbbe995e5a | |
parent | 89c9aa28c304a17b3a9478bd426031e17303b6a6 (diff) | |
download | 1989-dawn-of-freedom-e43c00ffe5a00483da67898fb8abcf87cce5d419.tar.gz |
New logic for handling TST 7
-rw-r--r-- | play.css | 2 | ||||
-rw-r--r-- | play.html | 27 | ||||
-rw-r--r-- | play.js | 11 | ||||
-rw-r--r-- | rules.js | 12 |
4 files changed, 48 insertions, 4 deletions
@@ -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; }
@@ -27,7 +27,7 @@ <li data-action="card_event"><span>🎴</span> Event
<li data-action="card_influence"><span>⭐</span> Place SPs
<li data-action="card_support_check"><span>💪</span> Support Check
- <li data-action="card_tst"><span>🛤</span> Tiananmen Square Track
+ <li data-action="card_tst"><span><img id = "tank" src="images/tank2.png" style="width:20px; height: 30px; vertical-align: middle;"></span> Tiananmen Square Track
</menu>
<menu id="popup_opp_event" class="popup">
@@ -36,7 +36,7 @@ <li data-action="card_opp_event"><span>🎴</span> Resolve Opponent Event
<li data-action="card_influence"><span>⭐</span> Place SPs
<li data-action="card_support_check"><span>💪</span> Support Check
- <li data-action="card_tst"><span>🛤</span> Tiananmen Square Track
+ <li data-action="card_tst"><span><img src="images/tank1.png" style="width:16px; height: 16px; vertical-align: middle;"></span> Tiananmen Square Track
</menu>
<menu id="popup_ceh_check" class="popup">
@@ -49,6 +49,16 @@ <li data-action="card_tst"><span>🛤</span> Tiananmen Square Track
</menu>
+<menu id="popup_tst_7" class="popup">
+ <li class="title">TITLE
+ <li class="separator">
+ <li data-action="card_tst_7"><span>🎴</span> Cancel Opponent Event
+ <li data-action="card_opp_event"><span>🎴</span> Resolve Opponent Event
+ <li data-action="card_influence"><span>⭐</span> Place SPs
+ <li data-action="card_support_check"><span>💪</span> Support Check
+ <li data-action="card_tst"><span><img src="images/tank1.png" style="width:16px; height: 16px; vertical-align: middle;"></span> Tiananmen Square Track
+</menu>
+
<menu id="popup_tst_8" class="popup">
<li class="title">TITLE
<li class="separator">
@@ -56,7 +66,18 @@ <li data-action="card_event"><span>🎴</span> Event
<li data-action="card_influence"><span>⭐</span> Place SPs
<li data-action="card_support_check"><span>💪</span> Support Check
- <li data-action="card_tst"><span>🛤</span> Tiananmen Square Track
+ <li data-action="card_tst"><span><img src="images/tank1.png" style="width:16px; height: 16px; vertical-align: middle;"></span> Tiananmen Square Track
+</menu>
+
+<menu id="popup_tst_7_8" class="popup">
+ <li class="title">TITLE
+ <li class="separator">
+ <li data-action="card_tst_7"><span>🎴</span> Cancel Opponent Event
+ <li data-action="card_opp_event"><span>🎴</span> Resolve Opponent Event
+ <li data-action="card_tst_8"><span>🎴</span> Event and Operations
+ <li data-action="card_influence"><span>⭐</span> Place SPs
+ <li data-action="card_support_check"><span>💪</span> Support Check
+ <li data-action="card_tst"><span><img src="images/tank1.png" style="width:16px; height: 16px; vertical-align: middle;"></span> Tiananmen Square Track
</menu>
<header>
@@ -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)
}
@@ -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 () {
|