From 5d81b4294bd8f9b20ac8a396a185f6cf9550c00f Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 25 Oct 2024 11:58:58 +0200 Subject: Update client. Fixed some spelling errors in space data table. Create tools directory and add Makefile. Add layout.svg with boxes drawn on top of locations. Add genlayout.js to create list of box locations. Add gencolors.js to create beveled marker border colors. Major rewrite of play.js and play.css with official assets. --- rules.js | 71 +++++++++++++++++++++++++++++++--------------------------------- 1 file changed, 34 insertions(+), 37 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index 877c4d8..6ce54dd 100644 --- a/rules.js +++ b/rules.js @@ -268,18 +268,13 @@ exports.view = function(state, player) { // === ACTIONS =========== function gen_action(action, argument) { -//console.log('gen_action called with ', action, ' and ', argument) if (argument === undefined) { - //console.log('argument undefined') view.actions[action] = 1 } else { - if (!(action in view.actions)) { - //console.log('push argument') + if (!(action in view.actions)) view.actions[action] = [] - } view.actions[action].push(argument) } - //console.log('view.actions: ', view.actions, 'view.actions[action]: ', view.actions[action]) } function gen_action_space(space){ @@ -9013,6 +9008,7 @@ states.vm_support_falters = { /* =================== EVENTS ================================ */ // #region GENERATED EVENT CODE + const CODE = [] CODE[1] = [ // Legacy of Martial Law* @@ -9875,43 +9871,44 @@ CODE[110] = [ // Malta Summit* [ vm_remove_opp_infl, 5 ], [ vm_return ], ] -// #endregion - -// ============= TIANANMEN SQUARE TRACK AWARDS ==================== -CODE[203] = [//Tiananmen Square space 3 award - [vm_tst_3], - [vm_return] -] -CODE[204] = [//Tiananmen Square space 4 award - [vm_valid_spaces_opponent], - [vm_tst_4], - [vm_return] +CODE[203] = [ // Tiananmen Square space 3 award + [ vm_tst_3 ], + [ vm_return ], ] -CODE[206] = [//Tiananmen Square space 6 - [vm_valid_spaces_sc], - [vm_tst_6], - [vm_return] + +CODE[204] = [ // Tiananmen Square space 4 award + [ vm_valid_spaces_opponent ], + [ vm_tst_4 ], + [ vm_return ], ] -CODE[208] = [//Tiananmen Square space 8 event - [vm_tst_8], - [vm_return] + +CODE[206] = [ // Tiananmen Square space 6 + [ vm_valid_spaces_sc ], + [ vm_tst_6 ], + [ vm_return ], ] -// ============= POWER STRUGGLE WILDCARDS ========================= +CODE[208] = [ // Tiananmen Square space 8 event + [ vm_tst_8 ], + [ vm_return ], +] -CODE[349] = [//Scare Tactics - [vm_scare_tactics], - [vm_valid_spaces_country_opp], - [vm_prompt, ()=>` from ${country_name(game.vm_active_country)}`], - [vm_remove_opp_infl, 1], - [vm_return] +CODE[349] = [ // Scare Tactics + [ vm_scare_tactics ], + [ vm_valid_spaces_country_opp ], + [ vm_prompt, ()=>` from ${country_name(game.vm_active_country)}` ], + [ vm_remove_opp_infl, 1 ], + [ vm_return ], ] -CODE[350] = [//Support Surges - [vm_support_surges], - [vm_return] + +CODE[350] = [ // Support Surges + [ vm_support_surges ], + [ vm_return ], ] -CODE[351] = [//Support Falters - [vm_support_falters], - [vm_return] + +CODE[351] = [ // Support Falters + [ vm_support_falters ], + [ vm_return ], ] +// #endregion -- cgit v1.2.3 From ea8755f9fe54ea911cdd864c5cfc01d708bdafb4 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 26 Oct 2024 00:33:08 +0200 Subject: add played power card panel --- play.html | 24 ++++++++++++++---------- play.js | 7 ++++++- rules.js | 3 ++- 3 files changed, 22 insertions(+), 12 deletions(-) (limited to 'rules.js') diff --git a/play.html b/play.html index 473be26..f510ba0 100644 --- a/play.html +++ b/play.html @@ -66,6 +66,20 @@ + +
+
Played Power Card
+
+
+
+
Ceausescu Cards
+
+
+
+
Power Struggle Hand
+
+
+
Cards on the Table
@@ -84,16 +98,6 @@
- -
-
Ceausescu Cards
-
-
-
-
Power Struggle Hand
-
-
-
Opponent Hand
diff --git a/play.js b/play.js index 4658044..770e6d5 100644 --- a/play.js +++ b/play.js @@ -40,6 +40,7 @@ const ui = { event_reminder_list: document.getElementById("event_reminder_list"), played_card: document.getElementById("played_card"), + played_power_card: document.getElementById("played_power_card"), hand: document.getElementById("hand"), power_hand: document.getElementById("power_hand"), opp_hand: document.getElementById("opp_hand"), @@ -372,6 +373,10 @@ function on_update() { if (view.played_card > 0) ui.played_card.appendChild(ui.cards[view.played_card]) + ui.played_power_card.replaceChildren() + if (view.played_power_card > 0) + ui.played_power_card.appendChild(ui.power_cards[view.played_power_card]) + ui.samizdat_card.replaceChildren() if (view.samizdat > 0) ui.samizdat_card.appendChild(ui.cards[view.samizdat]) @@ -383,7 +388,7 @@ function on_update() { ui.power_hand.replaceChildren() if (view.power_hand) for (let c of view.power_hand) - ui.hand.appendChild(ui.power_cards[c]) + ui.power_hand.appendChild(ui.power_cards[c]) ui.opp_hand.replaceChildren() if (view.opp_hand) diff --git a/rules.js b/rules.js index 6ce54dd..64d4396 100644 --- a/rules.js +++ b/rules.js @@ -192,7 +192,8 @@ exports.view = function(state, player) { } if (game.is_pwr_struggle) { - view.strategy_discard = game.power_struggle_discard + view.power_struggle_discard = game.power_struggle_discard + view.played_power_card = game.played_power_card, } else { view.strategy_discard = game.strategy_discard } -- cgit v1.2.3 From 99a6ff8112bbc47d6c2825c36328aa40c5c99384 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 26 Oct 2024 01:06:07 +0200 Subject: fix typo --- about.html | 26 +++++++++++++++++--------- rules.js | 2 +- 2 files changed, 18 insertions(+), 10 deletions(-) (limited to 'rules.js') diff --git a/about.html b/about.html index d9ba2a8..7cd0291 100644 --- a/about.html +++ b/about.html @@ -1,10 +1,18 @@

- 1989 is an exciting, fast paced game simulating the end of the Cold War in 1989. During this amazing year, a series of democratic revolutions ended the 40 year Soviet empire in Eastern Europe. 1989 simulates the political, social and economic aspects of these revolutions using a card driven system similar to Twilight Struggle. - - -

- Designer: Jason Matthews, Ted Torgerson. -
Copyright © 2012 GMT Games, LLC. -
Programming © 2024 Iain Pearce. - - \ No newline at end of file +1989 is an exciting, fast paced game simulating the end of the Cold War in +1989. During this amazing year, a series of democratic revolutions ended the 40 +year Soviet empire in Eastern Europe. 1989 simulates the political, social and +economic aspects of these revolutions using a card driven system similar to +Twilight Struggle. + +

+Designer: Jason Matthews, Ted Torgerson. +
Copyright © 2012 GMT Games, LLC. +
Programming © 2024 Iain Pearce. + +

diff --git a/rules.js b/rules.js index 64d4396..c179e9e 100644 --- a/rules.js +++ b/rules.js @@ -193,7 +193,7 @@ exports.view = function(state, player) { if (game.is_pwr_struggle) { view.power_struggle_discard = game.power_struggle_discard - view.played_power_card = game.played_power_card, + view.played_power_card = game.played_power_card } else { view.strategy_discard = game.strategy_discard } -- cgit v1.2.3