From a16e24c705fd1f98caf4332b734ff9d616705f4f Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 21 Sep 2024 19:13:16 +0100 Subject: Updates to new visuals --- images/Event_Marker_Hasselhoff.gif | Bin 5383 -> 0 bytes images/Event_Marker_NYE_Party.gif | Bin 0 -> 5383 bytes play.css | 11 ++++++++--- play.html | 35 +++++++++++++++++++++-------------- play.js | 6 +++--- rules.js | 25 ++++++++++++++----------- 6 files changed, 46 insertions(+), 31 deletions(-) delete mode 100644 images/Event_Marker_Hasselhoff.gif create mode 100644 images/Event_Marker_NYE_Party.gif diff --git a/images/Event_Marker_Hasselhoff.gif b/images/Event_Marker_Hasselhoff.gif deleted file mode 100644 index b2a91d2..0000000 Binary files a/images/Event_Marker_Hasselhoff.gif and /dev/null differ diff --git a/images/Event_Marker_NYE_Party.gif b/images/Event_Marker_NYE_Party.gif new file mode 100644 index 0000000..b2a91d2 Binary files /dev/null and b/images/Event_Marker_NYE_Party.gif differ diff --git a/play.css b/play.css index f70fc16..b92274d 100644 --- a/play.css +++ b/play.css @@ -4,12 +4,12 @@ header.your_turn { background-color: orange; } #role_Dem { background-color: hsl(210,30%,80%); } #role_Com { background-color: hsl(35,40%,80%); } #turn_info { background-color: white; } -.aside_events { +/*.aside_events { font-family: "Source Sans"; font-style: normal; font-size: 16px; line-height: 1.5; -} +}*/ #log { background-color: whitesmoke; } #log .h1 { font-weight: bold; padding-top:2px; padding-bottom:2px; text-align: center; } @@ -115,7 +115,7 @@ header.your_turn { background-color: orange; } padding: 3px 1em; } -#events_panel, #played_card_panel { +#events_panel, #played_card_panel, #table_panel { min-width: 200px; width: auto; display: inline-block; @@ -123,6 +123,10 @@ header.your_turn { background-color: orange; } border-radius: 5px; } +#events { + display: flex; +} + #discard_panel { min-width: 200px; width: auto; @@ -420,6 +424,7 @@ left: 660px} .event-marker.aside { border: solid black 1.5px; + margin: 3px; } #turn_info { diff --git a/play.html b/play.html index 3ce179a..b9a53b6 100644 --- a/play.html +++ b/play.html @@ -47,17 +47,7 @@
Communist
0 cards in hand
-
- -
-
Active Event Markers:
-
None
-
- - - - -
-
+
@@ -109,14 +99,31 @@
Event Markers
-
+
+ + + + + + + + + + + + + + + +
+
-
Cards on the Table
-
+
Cards on the Table
+
diff --git a/play.js b/play.js index 162fdac..1220b41 100644 --- a/play.js +++ b/play.js @@ -403,7 +403,7 @@ if (view.played_card > 0) { } // TABLE CARDS PANEL -document.getElementById("events").replaceChildren() +document.getElementById("table_cards").replaceChildren() if (view.table_cards.length > 0) { document.getElementById("table_panel").classList.remove("hide") for (let c of view.table_cards) { @@ -503,7 +503,7 @@ for (let id in view.persistent_events) { } // CHECK WHETHER ANY EVENT MARKERS ARE SHOWING IN THE ASIDE - +/* for (let id of aside_events) { if (view.persistent_events[id]) { aside_events_showing = true; @@ -512,7 +512,7 @@ for (let id of aside_events) { if (aside_events_showing) { document.getElementById('no_events').style.display = 'none' -} +}*/ let systematization = document.getElementById('systematization') if (view.persistent_events['systematization'] > 0) { diff --git a/rules.js b/rules.js index ab50255..1265b8d 100644 --- a/rules.js +++ b/rules.js @@ -979,8 +979,10 @@ states.draw_power_cards = { }, draw() { push_undo() - console.log('called draw cards, game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) + console.log('called draw cards, country', game.pwr_struggle_in, 'game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) + console.log('test3') let presence = check_presence(game.pwr_struggle_in) + console.log('test2') if (presence.dem_spaces > 0) { game.dem_pwr_hand_limit = 6 + 2*(presence.dem_spaces - 1) } else { @@ -992,8 +994,8 @@ states.draw_power_cards = { game.com_pwr_hand_limit = 0 } // Events which affect cards drawn - - if (game.persistent_events['roundtable_talks']) { + console.log('test') + if (game.persistent_events['roundtable_talks'] && game.com_pwr_hand_limit >= 2) { log('Democrat receives 2 cards from Communist due to C17') game.dem_pwr_hand_limit += 2 game.com_pwr_hand_limit -= 2 @@ -1001,7 +1003,7 @@ states.draw_power_cards = { game.persistent_events['roundtable_talks'] = false } - if (game.persistent_events['national_salvation_front'] && (game.pwr_struggle_in === 'Romania' || game.pwr_struggle_in === 'Bulgaria')) { + if (game.persistent_events['national_salvation_front'] && game.dem_pwr_hand_limit >=2 && (game.pwr_struggle_in === 'Romania' || game.pwr_struggle_in === 'Bulgaria')) { log('Communist receives 2 cards from Democrat due to C102') game.dem_pwr_hand_limit -= 2 game.com_pwr_hand_limit += 2 @@ -1011,6 +1013,7 @@ states.draw_power_cards = { //Draw Power Cards game.is_pwr_struggle = true + console.log('game.dem_pwr_hand_limit', game.dem_pwr_hand_limit, 'game.com_pwr_hand_limit', game.com_pwr_hand_limit) draw_cards(game.power_struggle_deck, game.dem_pwr_hand, game.com_pwr_hand, game.dem_pwr_hand_limit, game.com_pwr_hand_limit) game.valid_cards = all_power_cards @@ -3225,12 +3228,12 @@ function draw_deck(deck) { } function draw_cards(deck, democrat_hand, communist_hand, dem_hand_limit, com_hand_limit) { - //console.log('game.valid_cards at start of draw cards: ', game.valid_cards) + console.log('game.valid_cards at start of draw cards: ', game.valid_cards) let turn = 'communist'; // Start with the communist player - //console.log('game.strategy_deck', game.strategy_deck) - //console.log('deck', deck, 'democrat_hand', democrat_hand, 'communist_hand', communist_hand, 'dem_hand_limit', dem_hand_limit, 'com_hand_limit', com_hand_limit) + console.log('game.strategy_deck', game.strategy_deck) + console.log('deck', deck, 'democrat_hand', democrat_hand, 'communist_hand', communist_hand, 'dem_hand_limit', dem_hand_limit, 'com_hand_limit', com_hand_limit) while (democrat_hand.length < dem_hand_limit || communist_hand.length < com_hand_limit) { - //console.log('deck.length: ', deck.length) + console.log('deck.length: ', deck.length) //console.log('discard.length', game.strategy_discard ) if (deck.length === 0) { log_h3('--- Reshuffle ---') @@ -3241,16 +3244,16 @@ function draw_cards(deck, democrat_hand, communist_hand, dem_hand_limit, com_han else if (turn === 'communist' && communist_hand.length < com_hand_limit) { communist_hand.push(draw_card(deck)); - //console.log('game.valid_cards after communist draw: ', JSON.stringify(game.valid_cards)); + console.log('game.valid_cards after communist draw: ', JSON.stringify(game.valid_cards)); turn = 'democrat'; } else if(turn === 'communist' && communist_hand.length === com_hand_limit) { turn = 'democrat'; } else if (turn === 'democrat' && democrat_hand.length < dem_hand_limit) { democrat_hand.push(draw_card(deck)); - //console.log('democrat_hand: ', democrat_hand) + console.log('democrat_hand: ', democrat_hand) - //console.log('game.valid_cards after democrat draw: ', JSON.stringify(game.valid_cards)); + console.log('game.valid_cards after democrat draw: ', JSON.stringify(game.valid_cards)); turn = 'communist'; } else if (turn === 'democrat' && democrat_hand.length === dem_hand_limit) { -- cgit v1.2.3