diff options
-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 | 32 | ||||
-rw-r--r-- | play.html | 40 | ||||
-rw-r--r-- | play.js | 53 | ||||
-rw-r--r-- | rules.js | 55 |
5 files changed, 104 insertions, 76 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,8 @@ left: 660px} .event-marker.aside {
border: solid black 1.5px;
+ margin: 3px;
+ position: relative;
}
#turn_info {
@@ -439,27 +445,11 @@ left: 660px} }
-#eco_glasnost {
- position: relative;
- /*top: 1500px;
- left: 1050px;*/
-}
-
-#helsinki_final_act {
- position: relative;
- display: flex;
-}
#solidarity_legalised {
top: 216px;
left: 612px;
}
-#st_nicholas_church {
- position: relative;
- /*top: 181px;
- left: 320px;*/
-}
-
#systematization {
height: 65px;
width: 65px;
@@ -475,10 +465,6 @@ left: 660px} left: 170px;
}
-#we_are_the_people {
- position: relative;
-}
-
/* =========== CARDS ================= */
/*
@@ -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>
@@ -108,8 +98,32 @@ <!-- EVENTS IN PLAY -->
<section id = "sec_events">
<div id="events_panel" class="panel hide">
- <div id="events_header" class="panel_header">Events in Play</div>
- <div id="events" class="panel_body"></div>
+ <div id="events_header" class="panel_header">Event Markers</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="laslzo_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="table_header" class="panel_header">Cards on the Table</div>
+ <div id="table_cards" class="panel_body"></div>
</div>
</section>
@@ -23,10 +23,21 @@ const countries= [ ]
const aside_events = [
- "eco_glasnost",
- "helsinki_final_act",
+ "honecker",
"st_nicholas_church",
- "we_are_the_people"
+ "helsinki_final_act",
+ "eco_glasnost",
+ "we_are_the_people",
+ "foreign_currency_debt_burden",
+ "li_peng",
+ "austria_hungary_border_reopened",
+ "grenztruppen",
+ "presidential_visit",
+ "securitate",
+ "laslzo_tokes",
+ "stand_fast",
+ "elena",
+ "new_years_eve_party"
]
let aside_events_showing = false
let show_discard = false
@@ -239,7 +250,7 @@ let ui = { dem_hand_count: document.getElementById("role_stat_dem"),
com_hand_count: document.getElementById("role_stat_com"),
played_card: 0,
- events_panel: document.getElementById("events_panel"),
+ table_panel: document.getElementById("table_panel"),
hand_panel: document.getElementById("hand_panel"),
turn: document.getElementById("turn-tracker"),
round: document.getElementById("action-round-tracker"),
@@ -402,18 +413,18 @@ if (view.played_card > 0) { document.getElementById("played_card_panel").classList.add("hide")
}
-// EVENTS PANEL
-document.getElementById("events").replaceChildren()
+// TABLE CARDS PANEL
+document.getElementById("table_cards").replaceChildren()
if (view.table_cards.length > 0) {
- document.getElementById("events_panel").classList.remove("hide")
+ document.getElementById("table_panel").classList.remove("hide")
for (let c of view.table_cards) {
let card = ui.cards[c]
- document.getElementById("events").appendChild(card);
+ document.getElementById("table_cards").appendChild(card);
card.classList.remove("hand_card")
card.classList.add('event_card');
}
} else {
- document.getElementById("events_panel").classList.add("hide")
+ document.getElementById("table_panel").classList.add("hide")
}
// OPPONENT HAND
@@ -494,24 +505,39 @@ if (view.ceausescu_cards.length > 0 && view.is_pwr_struggle === true) { // UPDATE EVENT MARKERS
for (let id in view.persistent_events) {
- let marker = document.getElementById(id);
+ let marker = document.getElementById(id)
if (marker && view.persistent_events[id]) {
- marker.style.display = 'block';
+ marker.style.display = 'block'
} else if (marker && !view.persistent_events[id]) {
marker.style.display = 'none'
+ } else if (marker && view.persistent_events[id] !== "") {
+ marker.style.display = 'block'
+ } else if(marker && view.persistent_events[id] === '') {
+ marker.style.display = 'none'
}
}
-// CHECK WHETHER ANY EVENT MARKERS ARE SHOWING IN THE ASIDE
+// CHECK WHETHER ANY EVENT MARKERS ARE SHOWING IN THE ASIDE
+aside_events_showing = false
for (let id of aside_events) {
if (view.persistent_events[id]) {
aside_events_showing = true;
}
+
+ //Special check for events which are not true/false
+ if (view.persistent_events['foreign_currency_debt_burden'] !== '') {
+ aside_events_showing = true
+ }
+ if (view.persistent_events['stand_fast'] !== '') {
+ aside_events_showing = true
+ }
}
if (aside_events_showing) {
- document.getElementById('no_events').style.display = 'none'
+ document.getElementById('events_panel').classList.remove("hide")
+} else {
+ document.getElementById('events_panel').classList.add("hide")
}
let systematization = document.getElementById('systematization')
@@ -569,6 +595,7 @@ if (view.persistent_events['the_tyrant_is_gone'] > 0) { action_button("done", "Done")
action_button("undo", "Undo")
+ console.log('view.persistent_events', view.persistent_events)
}
@@ -83,7 +83,7 @@ exports.setup = function (seed, scenario, options) { discard: false,
view_opp_hand: false,
strategy_removed: [],
- persistent_events: {austria_hungary_border_reopened: false, civic_forum: false, eco_glasnost: false, elena: false, foreign_currency_debt_burden: '', frg_embassies: false, general_strike: false, genscher: false, grenztruppen: false, helsinki_final_act: false, honecker: false, li_peng: false, ligachev: false, national_salvation_front: false, perestroika: false, presidential_visit: false, prudence: '', roundtable_talks: false, securitate: false, sinatra_doctrine: false, solidarity_legalised: false, stand_fast: '', stasi: false, st_nicholas_church: false, systematization: 0, tear_gas: false, the_crowd_turns_against_ceausescu: false, the_tyrant_is_gone: 0, the_wall: false, the_wall_must_go: false, we_are_the_people: false, yakovlev: false},
+ persistent_events: {austria_hungary_border_reopened: false, civic_forum: false, eco_glasnost: false, elena: false, foreign_currency_debt_burden: '', frg_embassies: false, general_strike: false, genscher: false, grenztruppen: false, helsinki_final_act: false, honecker: false, laszlo_tokes: false, li_peng: false, ligachev: false, national_salvation_front: false, perestroika: false, presidential_visit: false, prudence: '', roundtable_talks: false, securitate: false, sinatra_doctrine: false, solidarity_legalised: false, stand_fast: '', stasi: false, st_nicholas_church: false, systematization: 0, tear_gas: false, the_crowd_turns_against_ceausescu: false, the_tyrant_is_gone: 0, the_wall: false, the_wall_must_go: false, we_are_the_people: false, yakovlev: false},
power_struggle_deck: [],
power_struggle_discard: [],
dem_hand_limit: 8,
@@ -994,8 +994,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 {
@@ -1007,8 +1009,7 @@ states.draw_power_cards = { game.com_pwr_hand_limit = 0
}
// Events which affect cards drawn
-
- if (game.persistent_events['roundtable_talks'] && game.com_pwr_hand_limit > 2) {
+ 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
@@ -1016,23 +1017,15 @@ states.draw_power_cards = { game.persistent_events['roundtable_talks'] = false
}
- if (game.persistent_events['peasant_parties_revolt'] && game.com_pwr_hand_limit > 1) {
- let farmer_check = false
- for (let space of spaces) {
- if (space && space.country === game.pwr_struggle_in && game.socio === 3 && space.demCtrl === 1) {
- farmer_check = true
- }
- }
- if (farmer_check) {
- log('Democrat receives 1 card from Communist due to C72')
- game.dem_pwr_hand_limit += 1
- game.com_pwr_hand_limit -= 1
- permanently_remove(72)
- game.persistent_events['peasant_parties_revolt'] = false
- }
+ if (game.persistent_events['peasant_parties_revolt'] && game.com_pwr_hand_limit >=1) {
+ log('Democrat receives 1 cards from Communist due to C72')
+ game.dem_pwr_hand_limit += 1
+ game.com_pwr_hand_limit -= 1
+ discard_from_table(72)
+ game.persistent_events['peasant_parties_revolt'] = false
}
- if (game.persistent_events['national_salvation_front'] && (game.pwr_struggle_in === 'Romania' || game.pwr_struggle_in === 'Bulgaria') && game.dem_pwr_hand_limit > 2) {
+ 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
@@ -1042,6 +1035,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
@@ -1089,7 +1083,7 @@ states.the_crowd_turns_against_ceausescu = { return `resolve ${cards[54].name}.`
},
prompt() {
- view.prompt = `You have ${game.vm_available_ops} influence points. Play for:`
+ view.prompt = `You have ${game.vm_available_ops} operations points. Play for:`
gen_action('influence')
gen_action('support_check')
},
@@ -3273,12 +3267,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 ---')
@@ -3289,16 +3283,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) {
@@ -4851,6 +4845,7 @@ function vm_kremlin_coup() { }
function vm_laszlo_tokes() {
+ game.persistent_events['laszlo_tokes'] = true
game.playable_cards[107].playable = 1
game.state = 'vm_laszlo_tokes'
}
@@ -4884,6 +4879,11 @@ function vm_malta_summit() { game.state = 'vm_malta_summit'
}
+function vm_massacre_in_timisoara() {
+ game.persistent_events['laszlo_tokes'] = false
+ vm_next()
+}
+
function vm_modrow() {
game.playable_cards[15].playable = 0
game.state = 'vm_modrow'
@@ -8346,6 +8346,7 @@ CODE[105] = [ // Public Against Violence* CODE[106] = [ // Social Democratic Platform Adopted*
[ vm_social_democratic_platform_adopted ],
[ vm_valid_spaces_country ],
+ [ vm_prompt, ()=>`${country_name(game.vm_active_country)}`],
[ vm_add_infl_free, 2 ],
[ vm_valid_spaces_country_sc ],
[ vm_prompt, ()=>`make a Support Check in ${country_name(game.vm_active_country)}` ],
|