diff options
author | iainp5 <iain.pearce.ip@gmail.com> | 2024-09-21 19:13:16 +0100 |
---|---|---|
committer | iainp5 <iain.pearce.ip@gmail.com> | 2024-09-21 19:13:16 +0100 |
commit | a16e24c705fd1f98caf4332b734ff9d616705f4f (patch) | |
tree | 21e5fcf6492f878b4d9ada1d98cb2a2fca2a3ee6 | |
parent | 49ddeaffa0db635136f00b31b94c57c1459b3d6e (diff) | |
download | 1989-dawn-of-freedom-a16e24c705fd1f98caf4332b734ff9d616705f4f.tar.gz |
Updates to new visuals
-rw-r--r-- | images/Event_Marker_NYE_Party.gif (renamed from images/Event_Marker_Hasselhoff.gif) | bin | 5383 -> 5383 bytes | |||
-rw-r--r-- | play.css | 11 | ||||
-rw-r--r-- | play.html | 35 | ||||
-rw-r--r-- | play.js | 6 | ||||
-rw-r--r-- | rules.js | 25 |
5 files changed, 46 insertions, 31 deletions
diff --git a/images/Event_Marker_Hasselhoff.gif b/images/Event_Marker_NYE_Party.gif Binary files differindex b2a91d2..b2a91d2 100644 --- a/images/Event_Marker_Hasselhoff.gif +++ b/images/Event_Marker_NYE_Party.gif @@ -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 {
@@ -47,17 +47,7 @@ <div class="role_name">Communist</div>
<div class="role_stat" id="role_stat_com">0 cards in hand</div>
<div class="role_user">-</div>
- </div>
- <div id="turn_info">
- <div class = "aside_events" id="events_info">Active Event Markers:</div>
- <div class = "aside_events" id="no_events">None</div>
- <div>
- <img id="eco_glasnost" class="event-marker aside" src = "images/Event_Marker_Eco_Glasnost.gif">
- <img id="helsinki_final_act" class="event-marker aside" src="images/Event_Marker_Helsinki.gif">
- <img id="st_nicholas_church" class="event-marker aside" src="images/Event_Marker_St_Nicholas.gif">
- <img id="we_are_the_people" class="event-marker aside" src="images/Event_Marker_We_are_the_Peo.gif">
- </div>
- </div>
+ </div>
</div>
<div id="log"></div>
</aside>
@@ -109,14 +99,31 @@ <section id = "sec_events">
<div id="events_panel" class="panel hide">
<div id="events_header" class="panel_header">Event Markers</div>
- <div id="events" class="panel_body"></div>
+ <div id="events" class="panel_body">
+ <img id="honecker" class="event-marker aside" src="images/Event_Marker_Honecker.gif">
+ <img id="st_nicholas_church" class="event-marker aside" src="images/Event_Marker_St_Nicholas.gif">
+ <img id="helsinki_final_act" class="event-marker aside" src="images/Event_Marker_Helsinki.gif">
+ <img id="eco_glasnost" class="event-marker aside" src = "images/Event_Marker_Eco_Glasnost.gif">
+ <img id="we_are_the_people" class="event-marker aside" src="images/Event_Marker_We_are_the_Peo.gif">
+ <img id="foreign_currency_debt_burden" class="event-marker aside" src="images/Event_Marker_Foreign_Curren.gif">
+ <img id="li_peng" class="event-marker aside" src="images/Event_Marker_Li_Peng_.gif">
+ <img id="austria_hungary_border_reopened" class="event-marker aside" src="images/Event_Marker_Austria_Hungar.gif">
+ <img id="grenztruppen" class="event-marker aside" src="images/Event_Marker_Grenz_Truppen.gif">
+ <img id="presidential_visit" class="event-marker aside" src="images/Event_Marker_Pres_Visit.gif">
+ <img id="securitate" class="event-marker aside" src="images/Event_Marker_Securitate.gif">
+ <img id="laszo_tokes" class="event-marker aside" src="images/Event_Marker_Laszlo.gif">
+ <img id="stand_fast" class="event-marker aside" src="images/Event_Marker_Stand_Fast.gif">
+ <img id="elena" class="event-marker aside" src="images/Event_Marker_Elena.gif">
+ <img id="new_years_eve_party" class="event-marker aside" src="images/Event_Marker_NYE_Party.gif">
+ </div>
</div>
</section>
+<!-- EVENTS ON THE TABLE -->
<section id = "sec_table_cards">
<div id="table_panel" class="panel hide">
- <div id="events_header" class="panel_header">Cards on the Table</div>
- <div id="events" class="panel_body"></div>
+ <div id="table_header" class="panel_header">Cards on the Table</div>
+ <div id="table_cards" class="panel_body"></div>
</div>
</section>
@@ -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) {
@@ -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) {
|