summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriainp5 <iain.pearce.ip@gmail.com>2024-10-01 13:46:28 +0100
committeriainp5 <iain.pearce.ip@gmail.com>2024-10-01 13:46:28 +0100
commit8379a9f203f7947f70cfaaa2452bd487569b1955 (patch)
tree9884331396e22a92c4aa41615580d48bcb8c3b8c
parentb894db6ba236e18018fbc76571bff56972386ef9 (diff)
download1989-dawn-of-freedom-8379a9f203f7947f70cfaaa2452bd487569b1955.tar.gz
Added game.summary, reduced game object
-rw-r--r--data.js225
-rw-r--r--play.js26
-rw-r--r--rules.js391
3 files changed, 395 insertions, 247 deletions
diff --git a/data.js b/data.js
index 71ecef2..bcd4930 100644
--- a/data.js
+++ b/data.js
@@ -74,122 +74,121 @@ const spaces = [
{name_unique: 'Varna', space_id: 72, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 1086, y: 1613}, adjacent: [63, 66, 71, , ]},
{name_unique: 'Bulgarian Writers', space_id: 73, socio: 5, stability: 2, battleground: 0, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 652, y: 1726}, adjacent: [67, , , , ]},
{name_unique: 'Plovdiv', space_id: 74, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 771, y: 1739}, adjacent: [68, 75, , , ]},
- {name_unique: 'Sliven', space_id: 75, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 894, y: 1768}, adjacent: [74, , , , ]}
-]
-
+ {name_unique: 'Sliven', space_id: 75, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 894, y: 1768}, adjacent: [74, , , , ]}
+]
const cards = [
null,
- {number: 1, period: 1, side: 'C', name: 'Legacy of Martial Law*', ops: 2, remove: 1, red: false},
- {number: 2, period: 1, side: 'D', name: 'Solidarity Legalized*', ops: 4, remove: 1, red: true},
- {number: 3, period: 1, side: 'D', name: 'Walesa*', ops: 3, remove: 1, red: false},
- {number: 4, period: 1, side: 'D', name: 'Michnik*', ops: 1, remove: 1, red: false},
- {number: 5, period: 1, side: 'D', name: 'General Strike', ops: 3, remove: 0, red: false},
- {number: 6, period: 1, side: 'C', name: 'Brought in for Questioning', ops: 3, remove: 0, red: false},
- {number: 7, period: 1, side: 'C', name: 'State Run Media*', ops: 2, remove: 1, red: false},
- {number: 8, period: 1, side: 'N', name: 'Prudence', ops: 4, remove: 0, red: false},
- {number: 9, period: 1, side: 'C', name: 'The Wall*', ops: 1, remove: 1, red: false},
- {number: 10, period: 1, side: 'C', name: 'Cult of Personality*', ops: 3, remove: 1, red: false},
- {number: 11, period: 1, side: 'C', name: 'Dissident Arrested', ops: 2, remove: 0, red: false},
- {number: 12, period: 1, side: 'C', name: 'Apparatchiks*', ops: 2, remove: 1, red: false},
- {number: 13, period: 1, side: 'C', name: 'Stasi*', ops: 1, remove: 1, red: false},
- {number: 14, period: 1, side: 'N', name: 'Gorbachev Charms the West', ops: 4, remove: 0, red: false},
- {number: 15, period: 1, side: 'C', name: 'Honecker*', ops: 3, remove: 1, red: false},
- {number: 16, period: 1, side: 'C', name: 'Nomenklatura*', ops: 2, remove: 1, red: false},
- {number: 17, period: 1, side: 'D', name: 'Roundtable Talks', ops: 3, remove: 0, red: false},
- {number: 18, period: 1, side: 'C', name: 'Poszgay Defends the Revolution*', ops: 2, remove: 1, red: false},
- {number: 19, period: 1, side: 'D', name: 'Papal Visit*', ops: 2, remove: 1, red: false},
- {number: 20, period: 1, side: 'C', name: 'Deutsche Marks*', ops: 4, remove: 1, red: false},
- {number: 21, period: 1, side: 'N', name: 'Common European Home', ops: 2, remove: 0, red: false},
- {number: 22, period: 1, side: 'N', name: 'Power Struggle - Poland', ops: 0, remove: 0, red: false},
- {number: 23, period: 1, side: 'N', name: 'Power Struggle - Hungary', ops: 0, remove: 0, red: false},
- {number: 24, period: 1, side: 'D', name: 'St. Nicholas Church*', ops: 1, remove: 1, red: true},
- {number: 25, period: 1, side: 'C', name: 'Perestroika*', ops: 3, remove: 1, red: false},
- {number: 26, period: 1, side: 'D', name: 'Helsinki Final Act*', ops: 1, remove: 1, red: true},
- {number: 27, period: 1, side: 'D', name: 'Consumerism', ops: 3, remove: 0, red: false},
- {number: 28, period: 1, side: 'C', name: 'Factory Party Cells', ops: 3, remove: 0, red: false},
- {number: 29, period: 1, side: 'D', name: 'Jan Palach Week*', ops: 1, remove: 1, red: false},
- {number: 30, period: 1, side: 'C', name: 'Tear Gas*', ops: 1, remove: 1, red: false},
- {number: 31, period: 1, side: 'D', name: 'Intelligentsia', ops: 2, remove: 0, red: false},
- {number: 32, period: 1, side: 'C', name: 'Peasant Parties*', ops: 2, remove: 1, red: false},
- {number: 33, period: 1, side: 'D', name: 'Sajudis*', ops: 2, remove: 1, red: true},
- {number: 34, period: 1, side: 'D', name: 'Fidesz*', ops: 2, remove: 1, red: false},
- {number: 35, period: 1, side: 'C', name: 'Heal Our Bleeding Wound*', ops: 3, remove: 1, red: false},
- {number: 36, period: 1, side: 'D', name: 'Dash for the West*', ops: 3, remove: 1, red: false},
- {number: 37, period: 1, side: 'C', name: 'Nagy Reburied*', ops: 3, remove: 1, red: false},
- {number: 38, period: 1, side: 'C', name: 'The July Concept*', ops: 3, remove: 1, red: false},
- {number: 39, period: 1, side: 'D', name: 'Eco-Glasnost*', ops: 2, remove: 1, red: false},
- {number: 40, period: 1, side: 'D', name: 'Hungarian Democratic Forum*', ops: 3, remove: 1, red: false},
- {number: 41, period: 2, side: 'C', name: 'Ceausescu*', ops: 3, remove: 1, red: false},
- {number: 42, period: 2, side: 'N', name: 'Power Struggle - East Germany', ops: 0, remove: 0, red: false},
- {number: 43, period: 2, side: 'N', name: 'Power Struggle - Bulgaria', ops: 0, remove: 0, red: false},
- {number: 44, period: 2, side: 'N', name: 'Inflationary Currency*', ops: 3, remove: 1, red: false},
- {number: 45, period: 2, side: 'D', name: 'Soviet Troop Withdrawals*', ops: 4, remove: 1, red: false},
- {number: 46, period: 2, side: 'D', name: 'Goodbye Lenin!*', ops: 3, remove: 1, red: false},
- {number: 47, period: 2, side: 'C', name: 'Bulgarian Turks Expelled*', ops: 3, remove: 1, red: false},
- {number: 48, period: 2, side: 'D', name: '\"We are the People!\"', ops: 3, remove: 1, red: false},
- {number: 49, period: 2, side: 'D', name: 'Foreign Currency Debt Burden', ops: 1, remove: 0, red: false},
- {number: 50, period: 2, side: 'D', name: 'The Sinatra Doctrine*', ops: 3, remove: 1, red: false},
- {number: 51, period: 2, side: 'C', name: '40th Anniversary Celebration*', ops: 2, remove: 1, red: false},
- {number: 52, period: 2, side: 'C', name: 'Normalization*', ops: 3, remove: 1, red: false},
- {number: 53, period: 2, side: 'C', name: 'Li Peng*', ops: 2, remove: 1, red: false},
- {number: 54, period: 2, side: 'D', name: 'The Crowd Turns Against Ceausescu*', ops: 3, remove: 1, red: true},
- {number: 55, period: 2, side: 'N', name: 'Power Struggle - Czechoslovakia', ops: 0, remove: 0, red: false},
- {number: 56, period: 2, side: 'D', name: 'Foreign Television*', ops: 2, remove: 1, red: false},
- {number: 57, period: 2, side: 'C', name: 'Central Committee Reshuffle*', ops: 2, remove: 1, red: false},
- {number: 58, period: 2, side: 'D', name: 'Austria-Hungary Border Reopened*', ops: 2, remove: 1, red: false},
- {number: 59, period: 2, side: 'C', name: 'GrenzTruppen*', ops: 2, remove: 1, red: false},
- {number: 60, period: 2, side: 'D', name: 'Toxic Waste*', ops: 2, remove: 1, red: false},
- {number: 61, period: 2, side: 'D', name: 'The Monday Demonstrations*', ops: 4, remove: 1, red: false},
- {number: 62, period: 2, side: 'D', name: 'Yakovlev Counsels Gorbachev*', ops: 2, remove: 1, red: false},
- {number: 63, period: 2, side: 'D', name: 'Genscher*', ops: 2, remove: 1, red: false},
- {number: 64, period: 2, side: 'D', name: 'Legacy of 1968*', ops: 4, remove: 1, red: false},
- {number: 65, period: 2, side: 'D', name: 'Presidential Visit*', ops: 3, remove: 1, red: false},
- {number: 66, period: 2, side: 'D', name: 'New Forum*', ops: 1, remove: 1, red: false},
- {number: 67, period: 2, side: 'N', name: 'Reformer Rehabilitated*', ops: 2, remove: 1, red: false},
- {number: 68, period: 2, side: 'D', name: 'Klaus and Komarek*', ops: 3, remove: 1, red: false},
- {number: 69, period: 2, side: 'C', name: 'Systematization*', ops: 3, remove: 1, red: false},
- {number: 70, period: 2, side: 'C', name: 'Securitate*', ops: 2, remove: 1, red: false},
- {number: 71, period: 2, side: 'D', name: 'Kiss of Death*', ops: 3, remove: 1, red: false},
- {number: 72, period: 2, side: 'D', name: 'Peasant Parties Revolt*', ops: 3, remove: 1, red: false},
- {number: 73, period: 2, side: 'D', name: 'Laszlo Tokes*', ops: 2, remove: 1, red: true},
- {number: 74, period: 2, side: 'D', name: 'FRG Embassies*', ops: 3, remove: 1, red: false},
- {number: 75, period: 2, side: 'D', name: 'Exit Visas*', ops: 3, remove: 1, red: false},
- {number: 76, period: 2, side: 'C', name: 'Warsaw Pact Summit*', ops: 2, remove: 1, red: false},
- {number: 77, period: 2, side: 'D', name: 'Samizdat*', ops: 1, remove: 1, red: false},
- {number: 78, period: 2, side: 'N', name: 'Workers Revolt', ops: 2, remove: 0, red: false},
- {number: 79, period: 2, side: 'C', name: 'The Third Way*', ops: 2, remove: 1, red: false},
- {number: 80, period: 2, side: 'C', name: 'Nepotism*', ops: 3, remove: 1, red: false},
- {number: 81, period: 2, side: 'D', name: 'The Baltic Way*', ops: 3, remove: 1, red: true},
- {number: 82, period: 3, side: 'C', name: 'Spitzel*', ops: 1, remove: 1, red: false},
- {number: 83, period: 3, side: 'C', name: 'Modrow*', ops: 2, remove: 1, red: false},
- {number: 84, period: 3, side: 'D', name: 'Breakaway Baltic Republics*', ops: 4, remove: 1, red: true},
- {number: 85, period: 3, side: 'N', name: 'Tank Column/Tank Man*', ops: 2, remove: 1, red: false},
- {number: 86, period: 3, side: 'D', name: '\"The Wall Must Go!\"*', ops: 3, remove: 1, red: false},
- {number: 87, period: 3, side: 'D', name: 'Kohl Proposes Reunification*', ops: 3, remove: 1, red: false},
- {number: 88, period: 3, side: 'C', name: 'Adamec*', ops: 2, remove: 1, red: false},
- {number: 89, period: 3, side: 'D', name: 'Domino Theory*', ops: 3, remove: 1, red: false},
- {number: 90, period: 3, side: 'D', name: 'Civic Forum*', ops: 4, remove: 1, red: false},
- {number: 91, period: 3, side: 'D', name: 'My First Banana*', ops: 3, remove: 1, red: false},
- {number: 92, period: 3, side: 'C', name: 'Betrayal*', ops: 3, remove: 1, red: false},
- {number: 93, period: 3, side: 'D', name: 'Shock Therapy*', ops: 3, remove: 1, red: false},
- {number: 94, period: 3, side: 'D', name: 'Union of Democratic Forces*', ops: 4, remove: 1, red: false},
- {number: 95, period: 3, side: 'N', name: 'Power Struggle - Romania', ops: 0, remove: 0, red: false},
- {number: 96, period: 3, side: 'C', name: 'The Chinese Solution*', ops: 1, remove: 1, red: false},
- {number: 97, period: 3, side: 'D', name: 'The Tyrant is Gone*', ops: 2, remove: 1, red: false},
- {number: 98, period: 3, side: 'C', name: 'Politburo Intrigue*', ops: 2, remove: 1, red: false},
- {number: 99, period: 3, side: 'C', name: 'Ligachev*', ops: 3, remove: 1, red: false},
- {number: 100, period: 3, side: 'N', name: 'Stand Fast*', ops: 3, remove: 1, red: false},
- {number: 101, period: 3, side: 'C', name: 'Elena*', ops: 1, remove: 1, red: false},
- {number: 102, period: 3, side: 'C', name: 'National Salvation Front*', ops: 3, remove: 1, red: false},
- {number: 103, period: 3, side: 'D', name: 'Government Resigns*', ops: 1, remove: 1, red: false},
- {number: 104, period: 3, side: 'C', name: 'New Year\'s Eve Party*', ops: 2, remove: 1, red: false},
- {number: 105, period: 3, side: 'D', name: 'Public Against Violence*', ops: 3, remove: 1, red: false},
- {number: 106, period: 3, side: 'C', name: 'Social Democratic Platform Adopted*', ops: 3, remove: 1, red: false},
- {number: 107, period: 3, side: 'C', name: 'Massacre in Timisoara*', ops: 3, remove: 1, red: false},
- {number: 108, period: 3, side: 'D', name: 'Army Backs Revolution*', ops: 3, remove: 1, red: false},
- {number: 109, period: 3, side: 'C', name: 'Kremlin Coup!*', ops: 3, remove: 1, red: false},
- {number: 110, period: 3, side: 'D', name: 'Malta Summit*', ops: 3, remove: 1, red: false},
+ {number: 1, period: 1, side: 'C', name: 'Legacy of Martial Law*', ops: 2, remove: 1, playable: true, red: false},
+ {number: 2, period: 1, side: 'D', name: 'Solidarity Legalized*', ops: 4, remove: 1, playable: true, red: true},
+ {number: 3, period: 1, side: 'D', name: 'Walesa*', ops: 3, remove: 1, playable: false, red: false},
+ {number: 4, period: 1, side: 'D', name: 'Michnik*', ops: 1, remove: 1, playable: true, red: false},
+ {number: 5, period: 1, side: 'D', name: 'General Strike', ops: 3, remove: 0, playable: true, red: false},
+ {number: 6, period: 1, side: 'C', name: 'Brought in for Questioning', ops: 3, remove: 0, playable: true, red: false},
+ {number: 7, period: 1, side: 'C', name: 'State Run Media*', ops: 2, remove: 1, playable: true, red: false},
+ {number: 8, period: 1, side: 'N', name: 'Prudence', ops: 4, remove: 0, playable: true, red: false},
+ {number: 9, period: 1, side: 'C', name: 'The Wall*', ops: 1, remove: 1, playable: true, red: false},
+ {number: 10, period: 1, side: 'C', name: 'Cult of Personality*', ops: 3, remove: 1, playable: true, red: false},
+ {number: 11, period: 1, side: 'C', name: 'Dissident Arrested', ops: 2, remove: 0, playable: true, red: false},
+ {number: 12, period: 1, side: 'C', name: 'Apparatchiks*', ops: 2, remove: 1, playable: true, red: false},
+ {number: 13, period: 1, side: 'C', name: 'Stasi*', ops: 1, remove: 1, playable: true, red: false},
+ {number: 14, period: 1, side: 'N', name: 'Gorbachev Charms the West', ops: 4, remove: 0, playable: true, red: false},
+ {number: 15, period: 1, side: 'C', name: 'Honecker*', ops: 3, remove: 1, playable: true, red: false},
+ {number: 16, period: 1, side: 'C', name: 'Nomenklatura*', ops: 2, remove: 1, playable: true, red: false},
+ {number: 17, period: 1, side: 'D', name: 'Roundtable Talks', ops: 3, remove: 0, playable: true, red: false},
+ {number: 18, period: 1, side: 'C', name: 'Poszgay Defends the Revolution*', ops: 2, remove: 1, playable: true, red: false},
+ {number: 19, period: 1, side: 'D', name: 'Papal Visit*', ops: 2, remove: 1, playable: true, red: false},
+ {number: 20, period: 1, side: 'C', name: 'Deutsche Marks*', ops: 4, remove: 1, playable: true, red: false},
+ {number: 21, period: 1, side: 'N', name: 'Common European Home', ops: 2, remove: 0, playable: true, red: false},
+ {number: 22, period: 1, side: 'N', name: 'Power Struggle - Poland', ops: 0, remove: 0, playable: true, red: false},
+ {number: 23, period: 1, side: 'N', name: 'Power Struggle - Hungary', ops: 0, remove: 0, playable: true, red: false},
+ {number: 24, period: 1, side: 'D', name: 'St. Nicholas Church*', ops: 1, remove: 1, playable: true, red: true},
+ {number: 25, period: 1, side: 'C', name: 'Perestroika*', ops: 3, remove: 1, playable: true, red: false},
+ {number: 26, period: 1, side: 'D', name: 'Helsinki Final Act*', ops: 1, remove: 1, playable: true, red: true},
+ {number: 27, period: 1, side: 'D', name: 'Consumerism', ops: 3, remove: 0, playable: true, red: false},
+ {number: 28, period: 1, side: 'C', name: 'Factory Party Cells', ops: 3, remove: 0, playable: true, red: false},
+ {number: 29, period: 1, side: 'D', name: 'Jan Palach Week*', ops: 1, remove: 1, playable: true, red: false},
+ {number: 30, period: 1, side: 'C', name: 'Tear Gas*', ops: 1, remove: 1, playable: true, red: false},
+ {number: 31, period: 1, side: 'D', name: 'Intelligentsia', ops: 2, remove: 0, playable: true, red: false},
+ {number: 32, period: 1, side: 'C', name: 'Peasant Parties*', ops: 2, remove: 1, playable: true, red: false},
+ {number: 33, period: 1, side: 'D', name: 'Sajudis*', ops: 2, remove: 1, playable: true, red: true},
+ {number: 34, period: 1, side: 'D', name: 'Fidesz*', ops: 2, remove: 1, playable: true, red: false},
+ {number: 35, period: 1, side: 'C', name: 'Heal Our Bleeding Wound*', ops: 3, remove: 1, playable: true, red: false},
+ {number: 36, period: 1, side: 'D', name: 'Dash for the West*', ops: 3, remove: 1, playable: true, red: false},
+ {number: 37, period: 1, side: 'C', name: 'Nagy Reburied*', ops: 3, remove: 1, playable: true, red: false},
+ {number: 38, period: 1, side: 'C', name: 'The July Concept*', ops: 3, remove: 1, playable: true, red: false},
+ {number: 39, period: 1, side: 'D', name: 'Eco-Glasnost*', ops: 2, remove: 1, playable: true, red: false},
+ {number: 40, period: 1, side: 'D', name: 'Hungarian Democratic Forum*', ops: 3, remove: 1, playable: true, red: false},
+ {number: 41, period: 2, side: 'C', name: 'Ceausescu*', ops: 3, remove: 1, playable: true, red: false},
+ {number: 42, period: 2, side: 'N', name: 'Power Struggle - East Germany', ops: 0, remove: 0, playable: true, red: false},
+ {number: 43, period: 2, side: 'N', name: 'Power Struggle - Bulgaria', ops: 0, remove: 0, playable: true, red: false},
+ {number: 44, period: 2, side: 'N', name: 'Inflationary Currency*', ops: 3, remove: 1, playable: true, red: false},
+ {number: 45, period: 2, side: 'D', name: 'Soviet Troop Withdrawals*', ops: 4, remove: 1, playable: true, red: false},
+ {number: 46, period: 2, side: 'D', name: 'Goodbye Lenin!*', ops: 3, remove: 1, playable: true, red: false},
+ {number: 47, period: 2, side: 'C', name: 'Bulgarian Turks Expelled*', ops: 3, remove: 1, playable: true, red: false},
+ {number: 48, period: 2, side: 'D', name: '\"We are the People!\"', ops: 3, remove: 1, playable: true, red: false},
+ {number: 49, period: 2, side: 'D', name: 'Foreign Currency Debt Burden', ops: 1, remove: 0, playable: true, red: false},
+ {number: 50, period: 2, side: 'D', name: 'The Sinatra Doctrine*', ops: 3, remove: 1, playable: true, red: false},
+ {number: 51, period: 2, side: 'C', name: '40th Anniversary Celebration*', ops: 2, remove: 1, playable: true, red: false},
+ {number: 52, period: 2, side: 'C', name: 'Normalization*', ops: 3, remove: 1, playable: true, red: false},
+ {number: 53, period: 2, side: 'C', name: 'Li Peng*', ops: 2, remove: 1, playable: true, red: false},
+ {number: 54, period: 2, side: 'D', name: 'The Crowd Turns Against Ceausescu*', ops: 3, remove: 1, playable: true, red: true},
+ {number: 55, period: 2, side: 'N', name: 'Power Struggle - Czechoslovakia', ops: 0, remove: 0, playable: true, red: false},
+ {number: 56, period: 2, side: 'D', name: 'Foreign Television*', ops: 2, remove: 1, playable: true, red: false},
+ {number: 57, period: 2, side: 'C', name: 'Central Committee Reshuffle*', ops: 2, remove: 1, playable: true, red: false},
+ {number: 58, period: 2, side: 'D', name: 'Austria-Hungary Border Reopened*', ops: 2, remove: 1, playable: true, red: false},
+ {number: 59, period: 2, side: 'C', name: 'GrenzTruppen*', ops: 2, remove: 1, playable: true, red: false},
+ {number: 60, period: 2, side: 'D', name: 'Toxic Waste*', ops: 2, remove: 1, playable: true, red: false},
+ {number: 61, period: 2, side: 'D', name: 'The Monday Demonstrations*', ops: 4, remove: 1, playable: false, red: false},
+ {number: 62, period: 2, side: 'D', name: 'Yakovlev Counsels Gorbachev*', ops: 2, remove: 1, playable: true, red: false},
+ {number: 63, period: 2, side: 'D', name: 'Genscher*', ops: 2, remove: 1, playable: true, red: false},
+ {number: 64, period: 2, side: 'D', name: 'Legacy of 1968*', ops: 4, remove: 1, playable: true, red: false},
+ {number: 65, period: 2, side: 'D', name: 'Presidential Visit*', ops: 3, remove: 1, playable: true, red: false},
+ {number: 66, period: 2, side: 'D', name: 'New Forum*', ops: 1, remove: 1, playable: true, red: false},
+ {number: 67, period: 2, side: 'N', name: 'Reformer Rehabilitated*', ops: 2, remove: 1, playable: false, red: false},
+ {number: 68, period: 2, side: 'D', name: 'Klaus and Komarek*', ops: 3, remove: 1, playable: true, red: false},
+ {number: 69, period: 2, side: 'C', name: 'Systematization*', ops: 3, remove: 1, playable: true, red: false},
+ {number: 70, period: 2, side: 'C', name: 'Securitate*', ops: 2, remove: 1, playable: true, red: false},
+ {number: 71, period: 2, side: 'D', name: 'Kiss of Death*', ops: 3, remove: 1, playable: true, red: false},
+ {number: 72, period: 2, side: 'D', name: 'Peasant Parties Revolt*', ops: 3, remove: 1, playable: true, red: false},
+ {number: 73, period: 2, side: 'D', name: 'Laszlo Tokes*', ops: 2, remove: 1, playable: true, red: true},
+ {number: 74, period: 2, side: 'D', name: 'FRG Embassies*', ops: 3, remove: 1, playable: true, red: false},
+ {number: 75, period: 2, side: 'D', name: 'Exit Visas*', ops: 3, remove: 1, playable: true, red: false},
+ {number: 76, period: 2, side: 'C', name: 'Warsaw Pact Summit*', ops: 2, remove: 1, playable: true, red: false},
+ {number: 77, period: 2, side: 'D', name: 'Samizdat*', ops: 1, remove: 1, playable: true, red: false},
+ {number: 78, period: 2, side: 'N', name: 'Workers Revolt', ops: 2, remove: 0, playable: true, red: false},
+ {number: 79, period: 2, side: 'C', name: 'The Third Way*', ops: 2, remove: 1, playable: true, red: false},
+ {number: 80, period: 2, side: 'C', name: 'Nepotism*', ops: 3, remove: 1, playable: true, red: false},
+ {number: 81, period: 2, side: 'D', name: 'The Baltic Way*', ops: 3, remove: 1, playable: false, red: true},
+ {number: 82, period: 3, side: 'C', name: 'Spitzel*', ops: 1, remove: 1, playable: true, red: false},
+ {number: 83, period: 3, side: 'C', name: 'Modrow*', ops: 2, remove: 1, playable: true, red: false},
+ {number: 84, period: 3, side: 'D', name: 'Breakaway Baltic Republics*', ops: 4, remove: 1, playable: false, red: true},
+ {number: 85, period: 3, side: 'N', name: 'Tank Column/Tank Man*', ops: 2, remove: 1, playable: true, red: false},
+ {number: 86, period: 3, side: 'D', name: '\"The Wall Must Go!\"*', ops: 3, remove: 1, playable: true, red: false},
+ {number: 87, period: 3, side: 'D', name: 'Kohl Proposes Reunification*', ops: 3, remove: 1, playable: true, red: false},
+ {number: 88, period: 3, side: 'C', name: 'Adamec*', ops: 2, remove: 1, playable: true, red: false},
+ {number: 89, period: 3, side: 'D', name: 'Domino Theory*', ops: 3, remove: 1, playable: true, red: false},
+ {number: 90, period: 3, side: 'D', name: 'Civic Forum*', ops: 4, remove: 1, playable: true, red: false},
+ {number: 91, period: 3, side: 'D', name: 'My First Banana*', ops: 3, remove: 1, playable: true, red: false},
+ {number: 92, period: 3, side: 'C', name: 'Betrayal*', ops: 3, remove: 1, playable: true, red: false},
+ {number: 93, period: 3, side: 'D', name: 'Shock Therapy*', ops: 3, remove: 1, playable: true, red: false},
+ {number: 94, period: 3, side: 'D', name: 'Union of Democratic Forces*', ops: 4, remove: 1, playable: true, red: false},
+ {number: 95, period: 3, side: 'N', name: 'Power Struggle - Romania', ops: 0, remove: 0, playable: true, red: false},
+ {number: 96, period: 3, side: 'C', name: 'The Chinese Solution*', ops: 1, remove: 1, playable: false, red: false},
+ {number: 97, period: 3, side: 'D', name: 'The Tyrant is Gone*', ops: 2, remove: 1, playable: false, red: false},
+ {number: 98, period: 3, side: 'C', name: 'Politburo Intrigue*', ops: 2, remove: 1, playable: true, red: false},
+ {number: 99, period: 3, side: 'C', name: 'Ligachev*', ops: 3, remove: 1, playable: true, red: false},
+ {number: 100, period: 3, side: 'N', name: 'Stand Fast*', ops: 3, remove: 1, playable: true, red: false},
+ {number: 101, period: 3, side: 'C', name: 'Elena*', ops: 1, remove: 1, playable: true, red: false},
+ {number: 102, period: 3, side: 'C', name: 'National Salvation Front*', ops: 3, remove: 1, playable: true, red: false},
+ {number: 103, period: 3, side: 'D', name: 'Government Resigns*', ops: 1, remove: 1, playable: true, red: false},
+ {number: 104, period: 3, side: 'C', name: 'New Year\'s Eve Party*', ops: 2, remove: 1, playable: true, red: false},
+ {number: 105, period: 3, side: 'D', name: 'Public Against Violence*', ops: 3, remove: 1, playable: true, red: false},
+ {number: 106, period: 3, side: 'C', name: 'Social Democratic Platform Adopted*', ops: 3, remove: 1, playable: true, red: false},
+ {number: 107, period: 3, side: 'C', name: 'Massacre in Timisoara*', ops: 3, remove: 1, playable: false, red: false},
+ {number: 108, period: 3, side: 'D', name: 'Army Backs Revolution*', ops: 3, remove: 1, playable: true, red: false},
+ {number: 109, period: 3, side: 'C', name: 'Kremlin Coup!*', ops: 3, remove: 1, playable: false, red: false},
+ {number: 110, period: 3, side: 'D', name: 'Malta Summit*', ops: 3, remove: 1, playable: true, red: false},
]
const power_cards = [
diff --git a/play.js b/play.js
index af7c57a..90eebb2 100644
--- a/play.js
+++ b/play.js
@@ -13,15 +13,7 @@ const toolbar = document.getElementById('toolbar')
const vpMarker = document.getElementById('vp')
const counters = document.getElementById('counters')
-const countries= [
- null,
- "East_Germany",
- "Poland",
- "Czechoslovakia",
- "Hungary",
- "Romania",
- "Bulgaria"
-]
+const countries= ['Poland', 'Hungary', 'East_Germany', 'Bulgaria', 'Czechoslovakia', 'Romania']
const aside_events = [
"honecker",
@@ -355,21 +347,21 @@ function on_update() {
}
// UPDATE COUNTRY MARKERS
- for (let i = 1; i < countries.length; i++) {
+ for (let i = 0; i < countries.length; i++) {
const country = countries[i];
const marker = document.getElementById(country)
const times_held = document.getElementById(`${country}_times_held`)
-
- if (view.revolutions[country]) {
+
+ if (view.revolutions[find_country_index(country)]) {
marker.classList.add('revolution')
marker.classList.remove('held')
marker.style.display = 'block'
times_held.classList.add('outlined_text')
- } else if (view.times_held[country] > 0 ) {
+ } else if (view.times_held[find_country_index(country)] > 0 ) {
//console.log('setting ', country)
marker.classList.add('held')
marker.style.display = 'block'
- times_held.innerHTML = view.times_held[country]
+ times_held.innerHTML = view.times_held[find_country_index(country)]
}
else {marker.style.display = 'none'}
}
@@ -621,7 +613,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)
+console.log('view.revolutions', view.revolutions)
}
// =========================== LOG FUNCTIONS ==============================================
@@ -703,4 +695,8 @@ function check_com_control(demInfl, comInfl, space) {
} else{ false}
}
+function find_country_index(country) {
+ return countries.indexOf(country)
+}
+
create_ui()
diff --git a/rules.js b/rules.js
index ff590ed..1a3f053 100644
--- a/rules.js
+++ b/rules.js
@@ -23,7 +23,6 @@ const all_power_cards = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
const numberless_cards = [25, 26, 27, 28, 29, 30, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52]
const auto_resolve_events = [5, 8, 9, 13, 17, 25, 26, 30, 35, 50, 53, 54, 58, 59, 62, 63, 65, 70, 72, 74, 99, 102, 108]
const switch_events = [6, 20, 71]
-const variable_events = [3, 14, 15, 21, 61, 67, 70, 81, 84, 96, 97, 107, 109]
exports.scenarios = [ "Standard" ]
@@ -36,6 +35,7 @@ exports.setup = function (seed, scenario, options) {
seed: seed,
log: [],
undo: [],
+ summary: [],
active: null,
state: "com_init",
return: '',
@@ -72,7 +72,6 @@ exports.setup = function (seed, scenario, options) {
com_tst_attempted: 0,
dem_tst_attempted_this_turn: 0,
com_tst_attempted_this_turn:0,
- tst_success: false,
tst_7: false,
tst_8: false,
vp: 0,
@@ -105,11 +104,10 @@ exports.setup = function (seed, scenario, options) {
raised_stakes: 0,
raised_stakes_round: 0,
phase: 0,
- times_held: {'East_Germany': 0, 'Poland': 0, 'Czechoslovakia': 0, 'Hungary': 0, 'Romania': 0, 'Bulgaria': 0},
- revolutions: {'East_Germany': false, 'Poland': false, 'Czechoslovakia': false, 'Hungary': false, 'Romania': false, 'Bulgaria': false},
+ times_held: [0, 0, 0, 0, 0, 0],
+ revolutions: [false, false, false, false, false, false],
remove_opponent_infl: false,
tactics_fails: '',
- warsaw_pact_summit: false,
}
log_h1("1989 Dawn of Freedom")
@@ -137,9 +135,9 @@ function start_game() {
}
})
- // Set cards were event playable status changes during the game
+ // Set variable event cards where event is playable at start of game
- game.playable_cards = [false, true, true, true, false, '', true, false, false, false, false, false, false ]
+ game.playable_cards = [14, 15, 21, 70]
//console.log('game.strategy_deck: ', game.strategy_deck[1])
draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.dem_hand_limit, game.com_hand_limit)
@@ -326,12 +324,17 @@ states.com_init = {
}
},
infl(space) {
-
add_infl(space)
},
done() {
view.prompt='Influence added.'
+
+ if (game.summary.length > 0) {
+ pop_summary()
+ log_br()
+ }
+
game.starting_infl.com_starting_infl++
if (game.starting_infl.com_starting_infl == 1){
game.available_ops = 3
@@ -344,6 +347,7 @@ states.com_init = {
valid_spaces_setup()
next_player()
} else if (game.starting_infl.com_starting_infl == 3) {
+ delete game.starting_infl
game.state = 'start_game'
}
}
@@ -370,7 +374,13 @@ states.dem_init = {
},
done() {
- view.prompt='Influence added'
+ view.prompt='Influence added.'
+
+ if (game.summary.length > 0) {
+ pop_summary()
+ log_br()
+ }
+
game.starting_infl.dem_starting_infl++
if (game.starting_infl.dem_starting_infl == 1){
game.available_ops = 3
@@ -486,11 +496,11 @@ states.play_card ={
//console.log('game.active', game.active, 'game.playable_cards[67].playable', game.playable_cards[67].playable)
- if (game.played_card === 67){
- if (game.active === DEM && game.playable_cards[find_event(67)] === DEM) {
+ if (game.played_card === 67 && game.playable_cards.includes(67)){
+ if (game.active === DEM && (game.dem_tst_position > game.com_tst_position)) {
gen_action('event')
}
- if (game.active === COM && game.playable_cards[find_event(67)] === COM) {
+ if (game.active === COM && (game.dem_tst_position < game.com_tst_position)) {
gen_action('event')
}
}
@@ -499,13 +509,13 @@ states.play_card ={
//Check if it is a card with an event which is always playable
- if (!variable_events.includes(game.played_card)) {
+ if (cards[game.played_card].playable) {
get_events(game.played_card)
}
// Resolve cards with variable events
- if (variable_events.includes(game.played_card) && game.playable_cards[find_event(game.played_card)]) {
+ if (game.playable_cards.includes(game.played_card)) {
get_events(game.played_card)
} /*
if ((game.active === DEM && cards[game.played_card].side === 'D' && game.playable_cards[game.played_card].playable === 1) || (game.active === COM && cards[game.played_card].side === 'C' && game.playable_cards[game.played_card].playable ===1) || (cards[game.played_card].side === 'N'&& game.playable_cards[game.played_card].playable ===1)) {
@@ -566,7 +576,7 @@ states.play_card ={
}
// Check if card is opponent card with event that needs to be resolved
- if (!variable_events.includes(game.played_card)|| game.playable_cards[find_event(game.played_card)]) {
+ if (cards[game.played_card].playable || game.playable_cards.includes(game.played_card)) {
if ((game.active === DEM && cards[game.played_card].side === "C" ) || (game.active === COM && cards[game.played_card].side === "D")) {
//game.phase = 1 /*Do I need this? */
game.vm_event_to_do = true
@@ -592,7 +602,7 @@ states.play_card ={
game.vm_event_to_do = true
}*/
- if (!variable_events.includes(game.played_card)|| game.playable_cards[find_event(game.played_card)]) {
+ if (cards[game.played_card].playable || game.playable_cards.includes(game.played_card)) {
if ((game.active === DEM && cards[game.played_card].side === "C" ) || (game.active === COM && cards[game.played_card].side === "D")) {
game.vm_event_to_do = true
}
@@ -703,6 +713,11 @@ states.finish_add_infl = {
add_infl(space)
},
done() {
+ if (game.summary.length > 0) {
+ pop_summary()
+ log_br()
+ }
+
end_round()
}
}
@@ -794,6 +809,11 @@ states.add_influence = {
add_infl(space)
},
done() {
+ if (game.summary.length > 0) {
+ pop_summary()
+ log_br()
+ }
+
if(game.vm_event_to_do) {
reset_austria_hungary_border_reopened()
game.state = 'resolve_opponent_event'}
@@ -805,24 +825,33 @@ states.add_influence = {
states.tiananmen_square_attempt = {
inactive: 'do Tiananmen Square Attempt.',
prompt () {
- if ((game.active === DEM && game.dem_tst_attempted_this_turn > 0 )|| (game.active === COM && game.com_tst_attempted_this_turn > 0)) {
- if (game.tst_success) {
- view.prompt = 'Tiananmen Square Track attempt successful.'
- } else {
- view.prompt = 'Tiananmen Square Track attempt failed.'
- }
- gen_action('done')
- return
- }
view.prompt = 'Tiananmen Square Track attempt: Roll a die.'
gen_action('roll')
},
roll() {
clear_undo()
do_tst_attempt ()
+ }
+}
+
+states.tiananmen_square_attempt_success = {
+ inactive: 'do Tiananmen Square Attempt.',
+ prompt () {
+ view.prompt = 'Tiananmen Square Track attempt successful.'
+ gen_action('done')
+ },
+ done () {
+ end_round()
+ }
+}
+
+states.tiananmen_square_attempt_fail = {
+ inactive: 'do Tiananmen Square Attempt.',
+ prompt () {
+ view.prompt = 'Tiananmen Square Track attempt failed.'
+ gen_action('done')
},
done () {
- game.tst_success = false
end_round()
}
}
@@ -1118,6 +1147,11 @@ states.the_crowd_turns_against_ceausescu_infl = {
vm_do_add_infl(space)
},
done() {
+ if (game.summary.length > 0) {
+ pop_summary()
+ log_br()
+ }
+
if (game.return !== game.active) {
next_player()
}
@@ -1484,6 +1518,10 @@ states.support_loss ={
}
},
done () {
+ if (game.summary.length > 0) {
+ pop_summary()
+ log_br()
+ }
next_player()
log_h3('Victory Point')
game.phase = 0
@@ -1715,9 +1753,9 @@ states.final_scoring_held = {
},
bonus() {
console.log('game.revolutions: ', game.revolutions)
- const held_countries = Object.values(game.revolutions).filter(value => value === false).length
+ const held_countries = game.revolutions.filter(value => value === false).length
let vp_gain = 4*held_countries
- log(`Communist holds ${held_countries} countries: gains ${vp_gain} VP`)
+ log(`Communist holds ${held_countries} countries: -${vp_gain} VP`)
game.vp -= 4*held_countries
game.temp = {'East_Germany': false, 'Poland': false, 'Czechoslovakia': false, 'Hungary': false, 'Romania': false, 'Bulgaria': false}
game.state = 'final_scoring'
@@ -1875,17 +1913,17 @@ states.honecker ={
states.new_years_eve_party = {
get inactive() {
- return `resolve ${cards[104].name}.`
+ return `resolve ${clean_name(cards[104].name)}.`
},
prompt() {
if (!game.is_pwr_struggle) {
view.prompt = `New Year's Eve Party: you may choose a country to have a final power struggle.`
- if (!game.revolutions['East_Germany']) {gen_action('east_germany')}
- if (!game.revolutions['Poland']) {gen_action('poland')}
- if (!game.revolutions['Czechoslovakia']) {gen_action('czechoslovakia')}
- if (!game.revolutions['Hungary']) {gen_action('hungary')}
- if (!game.revolutions['Romania']) {gen_action('romania')}
- if (!game.revolutions['Bulgaria']) {gen_action('bulgaria')}
+ if (!game.revolutions[0]) {gen_action('poland')}
+ if (!game.revolutions[1]) {gen_action('hungary')}
+ if (!game.revolutions[2]) {gen_action('east_germany')}
+ if (!game.revolutions[3]) {gen_action('bulgaria')}
+ if (!game.revolutions[4]) {gen_action('czechoslovakia')}
+ if (!game.revolutions[5]) {gen_action('romania')}
gen_action('pass')
} else {
view.prompt = `New Year's Eve Party: done.`
@@ -1998,7 +2036,7 @@ states.stasi_confirm = {
}
},
done() {
- game.playable_cards[find_event(21)] = false
+ game.playable_cards = game.playable_cards.filter( n => n !== 21)
end_stasi_choose_card()
}
}
@@ -2100,7 +2138,8 @@ function add_infl(space) {
const clicked_space = find_space_index(space)
console.log('clicked_space', clicked_space)
//console.log('at start, event', game.persistent_events['austria_hungary_border_reopened'], 'ahbr', game.austria_hungary_border_reopened, 'tracker', game.austria_hungary_border_reopened_tracker)
- log(`Added 1 influence in %${clicked_space}`)
+ //log(`Added 1 influence in %${clicked_space}`)
+ log_summary(`Added £ influence in %${clicked_space}`)
if (spaces[clicked_space].country !== 'East_Germany'){
game.austria_hungary_border_reopened_tracker = false
@@ -2167,7 +2206,8 @@ function add_infl(space) {
function remove_infl(space) {
push_undo()
const clicked_space = find_space_index(space)
- log(`Removed 1 influence from %${clicked_space}.`)
+ //log(`Removed 1 influence from %${clicked_space}.`)
+ log_summary(`Removed £ influence from %${clicked_space}.`)
if (game.remove_opponent_infl === true) {
if (game.active === COM) {
@@ -2769,23 +2809,26 @@ function do_tst_attempt() {
game.dem_tst_position++
game.dem_tst_attempted = 0
if (game.dem_tst_position === 3 && game.com_tst_position < 3) {goto_vm(203)}
- if (game.dem_tst_position === 4 && game.com_tst_position < 4) {goto_vm(204)}
+ if (game.dem_tst_position === 4 && game.com_tst_position < 4) {goto_vm(204)}
+ game.state = 'tiananmen_square_attempt_success'
} else {
log(`${dem_tst_req[game.dem_tst_position]} required: fail`)
game.dem_tst_attempted = 1
+ game.state = 'tiananmen_square_attempt_fail'
}
} else {
game.com_tst_attempted_this_turn = 1
if (roll >= com_tst_req[game.com_tst_position]) {
log(`${com_tst_req[game.com_tst_position]} required: success`)
- game.tst_success = true
game.com_tst_position++
game.com_tst_attempted = 0
if (game.com_tst_position === 3 && game.dem_tst_position < 3) {goto_vm(203)}
if (game.com_tst_position === 4 && game.dem_tst_position < 4) {goto_vm(204)}
+ game.state = 'tiananmen_square_attempt_success'
} else {
log(`${com_tst_req[game.com_tst_position]} required: fail`)
game.com_tst_attempted = 1
+ game.state = 'tiananmen_square_attempt_fail'
}
}
}
@@ -2863,14 +2906,14 @@ function battlegrounds(country) {
function take_power(country) {
log(`Democrat takes power in ${game.pwr_struggle_in}`)
- game.revolutions[country] = true
- game.times_held[country] = 1
+ game.revolutions[find_country_index(country)] = true
+ game.times_held[find_country_index(country)] = 1
}
function retain_power(country){
- game.times_held[country]++
- let vp_gain = get_value(country)*game.times_held[country]
+ game.times_held[find_country_index(country)]++
+ let vp_gain = get_value(country)*game.times_held[find_country_index(country)]
log(`Chooses to retain power`)
log(`-${vp_gain} VP`)
game.vp -= vp_gain
@@ -3088,10 +3131,10 @@ function end_stasi_choose_card() {
}
function check_reformer() {
- console.log('reformer check, dem pos:', game.dem_tst_position, 'com:', game.com_tst_position)
+ /*console.log('reformer check, dem pos:', game.dem_tst_position, 'com:', game.com_tst_position)
if (game.dem_tst_position > game.com_tst_position) {
console.log('reformer set to DEM')
- game.playable_cards[find_event(67)] = DEM
+ //game.playable_cards[find_event(67)] = DEM
}
if (game.dem_tst_position < game.com_tst_position) {
//console.log('reformer set to COM')
@@ -3104,7 +3147,7 @@ function check_reformer() {
//console.log(`reformer set to ''`)
game.playable_cards[find_event(67)] = ''
}
- //console.log('game.playable_cards[67].playable', game.playable_cards[67].playable)
+ //console.log('game.playable_cards[67].playable', game.playable_cards[67].playable) */
}
function count_scoring_cards() {
@@ -3233,7 +3276,8 @@ function end_round() {
game.return = ''
game.valid_cards = []
game.valid_spaces = []
- game.playable_cards[find_event(21)] = true
+ check_common_european_home()
+ //game.playable_cards[find_event(21)] = true
reset_austria_hungary_border_reopened() /*This should be redundant! */
@@ -3548,6 +3592,10 @@ function find_space_index(name_unique) {
return spaces.findIndex(space => space && space.name_unique === name_unique)
}
+function find_country_index(country) {
+ return countries.indexOf(country)
+}
+
function draw_deck(deck) {
return deck.filter(card => card && card.period === 1).map(card => card.number)
}
@@ -3753,6 +3801,12 @@ function check_systematization() {
}
}
+function check_common_european_home() {
+ if (!game.playable_cards.includes(21)) {
+ game.playable_cards.push(21)
+ }
+}
+
function this_card() {
return game.vm_event > 0 ? game.vm_event : game.played_card
}
@@ -3801,7 +3855,7 @@ function country_name(country) {
return country.replace(/_/g, ' ')
}
-// ======== LOG COMMANDS =============
+// ======== LOG FUNCTIONS =============
function log(msg) {
game.log.push(msg)
@@ -3857,6 +3911,58 @@ function log_sep() {
log(".hr")
}
+function log_action(msg) {
+ log_br()
+ log(msg)
+}
+
+// ============= SUMMARY FUNCTIONS =============
+
+function push_summary() {
+ if (game.summary)
+ throw "TOO MANY SUMMARIES"
+ game.summary = []
+}
+
+function log_summary(msg) {
+ for (let item of game.summary) {
+ if (item[1] === msg) {
+ item[0]++
+ return
+ }
+ }
+ game.summary.push([1, msg])
+}
+
+function pop_summary() {
+ if (game.summary.length > 0) {
+ for (let [n, msg] of game.summary) {
+ log(msg.replace("£", String(n)))
+ }
+ }
+ game.summary = []
+}
+
+function log_summary_place(p) {
+ let from = piece_space(p)
+ if (from !== AVAILABLE)
+ log_summary("% " + piece_name(p) + " from S" + from)
+ else
+ log_summary("% " + piece_name(p))
+}
+
+function log_summary_move_to_from(p, to) {
+ log_summary("% " + piece_name(p) + " to S" + to + " from S" + piece_space(p))
+}
+
+function log_summary_remove(p) {
+ log_summary("Removed % " + piece_name(p))
+}
+
+function log_summary_activated(p) {
+ log_summary("Activated % " + piece_faction_name(p))
+}
+
// ============ UNDO FUNCTIONS ==================
function clear_undo() {
@@ -4370,8 +4476,10 @@ function vm_do_add_infl(space) {
console.log('in vm_do_add_infl, space', space)
const clicked_space = find_space_index(space)
//console.log('at start, event', game.persistent_events['austria_hungary_border_reopened'], 'ahbr', game.austria_hungary_border_reopened, 'tracker', game.austria_hungary_border_reopened_tracker)
- log(`Added 1 influence in %${clicked_space}.`)
+ //log(`Added 1 influence in %${clicked_space}.`)
+ log_summary(`Added £ influence in %${clicked_space}.`)
+
if (spaces[clicked_space].country !== 'East_Germany'){
game.austria_hungary_border_reopened_tracker = false
}
@@ -4435,7 +4543,9 @@ function vm_do_add_infl(space) {
function vm_do_add_infl_free(space) {
push_undo()
const clicked_space = find_space_index(space)
- log(`Added 1 influence in %${clicked_space}.`)
+ //log(`Added 1 influence in %${clicked_space}.`)
+
+ log_summary(`Added £ influence in %${clicked_space}.`)
// Update influence values
if (game.active === COM) {
@@ -4491,7 +4601,9 @@ function vm_add_limited_infl() {
function vm_do_add_limited_infl(space, max_infl) {
push_undo()
const clicked_space = find_space_index(space)
- log(`Added 1 influence in %${clicked_space}.`)
+ //log(`Added 1 influence in %${clicked_space}.`)
+
+ log_summary(`Added £ influence in %${clicked_space}.`)
game.vm_available_ops --
if (!game.vm_influence_added) {
@@ -4539,8 +4651,8 @@ function vm_remove_x_opp_infl() {
function vm_do_remove_infl(space) {
push_undo()
const clicked_space = find_space_index(space)
- log(`Removed 1 influence from %${clicked_space}.`)
-
+ //log(`Removed 1 influence from %${clicked_space}.`)
+ log_summary(`Removed £ influence from %${clicked_space}.`)
if (!game.vm_influence_added) {
game.vm_influence_added = {};
@@ -4764,7 +4876,7 @@ function vm_army_backs_revolution() {
permanently_remove(70)
}*/
delete game.persistent_events['securitate']
- game.playable_cards[find_event(70)] = false
+ game.playable_cards = game.playable_cards.filter(n => n !== 70)
/*if (game.table_cards.includes(70)) {
permanently_remove(70)
}*/
@@ -4793,8 +4905,8 @@ function vm_breakaway_baltic_republics() {
if (check_vp()) {
return
}
- game.playable_cards[find_event(109)] = true
- game.playable_cards[find_event(14)] = false
+ game.playable_cards.push(109)
+ game.playable_cards = game.playable_cards.filter(n => n !== 14)
if (!check_dem_control(56) && game.persistent_events['systematization'] !== 56) {game.valid_spaces.push(56)}
if (!check_dem_control(70)) {game.valid_spaces.push(70)}
vm_next()
@@ -4878,7 +4990,7 @@ function vm_common_european_home() {
function vm_dash_for_the_west() {
game.valid_cards = []
for (let c of game.strategy_discard) {
- if (cards[c].side === 'D' && cards[c].remove === 1 && (!variable_events.includes(c) || game.playable_cards[find_event(c)])) {
+ if (cards[c].side === 'D' && cards[c].remove === 1 && (cards[c].playable || game.playable_cards.includes(c))) {
game.valid_cards.push(c)
}
}
@@ -5055,7 +5167,7 @@ function vm_goodbye_lenin() {
}
//Check if these cards are playabl
for (let card of game.communist_hand_red) {
- if (!variable_events.includes(card) || game.playable_cards[find_event(card)]) {
+ if (cards[card].playable || game.playable_cards.includes(card)) {
game.valid_cards.push(card)
}
}
@@ -5175,7 +5287,7 @@ function vm_kremlin_coup() {
//revolutions: {'East_Germany': false, 'Poland': false, 'Czechoslovakia': false, 'Hungary': false, 'Romania': false, 'Bulgaria': false}
game.temp = []
countries.forEach(country => {
- if (!game.revolutions[country]) {
+ if (!game.revolutions[find_country_index(country)]) {
game.temp.push(country)
}
})
@@ -5185,7 +5297,7 @@ function vm_kremlin_coup() {
function vm_laszlo_tokes() {
game.persistent_events['laszlo_tokes'] = true
- game.playable_cards[find_event(107)] = true
+ game.playable_cards.push(107)
game.state = 'vm_laszlo_tokes'
}
@@ -5226,7 +5338,7 @@ function vm_massacre_in_timisoara() {
}
function vm_modrow() {
- game.playable_cards[find_event(15)] = false
+ game.playable_cards.push(15)
game.state = 'vm_modrow'
}
@@ -5375,7 +5487,7 @@ function vm_sajudis_check() {
}
function vm_sajudis() {
- game.playable_cards[find_event(81)] = true
+ game.playable_cards.push(81)
game.stability++
log('+1 VP')
game.vp++
@@ -5406,14 +5518,14 @@ function vm_social_democratic_platform_adopted() {
function vm_solidarity_legalised() {
log_msg_gap(`C2 in effect`)
- game.playable_cards[find_event(3)] = true
+ game.playable_cards.push(3)
game.persistent_events['solidarity_legalised'] = true
vm_next()
}
function vm_st_nicholas_church () {
game.persistent_events['st_nicholas_church'] = true
- game.playable_cards[find_event(61)] = true
+ game.playable_cards.push(61)
permanently_remove(24)
vm_next()
}
@@ -5456,7 +5568,7 @@ function vm_tear_gas () {
}
function vm_the_baltic_way() {
- game.playable_cards[find_event(84)] =true
+ game.playable_cards.push(84)
game.stability++
if (!check_dem_control(56) && game.persistent_events['systematization'] !== 56) {game.valid_spaces.push(56)}
if (!check_dem_control(70) && game.persistent_events['systematization'] !== 70) {game.valid_spaces.push(70)}
@@ -5477,7 +5589,7 @@ function vm_the_crowd_turns_against_ceausescu() {
//game.persistent_events['the_crowd_turns_against_ceausescu'] = true
game.table_cards.push(54)
remove_from_discard(54)
- game.playable_cards[find_event(97)] = true
+ game.playable_cards.push(97)
vm_next()
}
@@ -5557,7 +5669,7 @@ function vm_workers_revolt() {
for (let space of spaces) {
if (!space) continue
let country = space.country
- if (!game.revolutions[`${country}`] && game.comInfl[space.space_id] > 0 && space.socio === 4) {
+ if (!game.revolutions[find_country_index(country)] && game.comInfl[space.space_id] > 0 && space.socio === 4) {
game.valid_spaces.push(space.space_id);
}
}
@@ -5565,7 +5677,7 @@ function vm_workers_revolt() {
for (let space of spaces) {
if (!space) continue
let country = space.country
- if (game.revolutions[`${country}`] && game.demInfl[space.space_id] > 0 && space.socio === 4) {
+ if (game.revolutions[find_country_index(country)] && game.demInfl[space.space_id] > 0 && space.socio === 4) {
game.valid_spaces.push(space.space_id);
}
}
@@ -5700,6 +5812,11 @@ states.vm_add_infl = {
vm_do_add_infl(space)
},
done () {
+ if (game.summary.length > 0) {
+ pop_summary()
+ log_br()
+ }
+
game.vm_event_done = true
vm_next()
}
@@ -5730,13 +5847,17 @@ states.vm_add_infl_free = {
if (game.vm_available_ops === 0 ) {
game.valid_spaces = []
game.vm_event_done = true
+ if (game.summary.length > 0) {
+ pop_summary()
+ log_br()
+ }
vm_next()
}
},
- done () {
+ /*done () {
game.vm_event_done = true
vm_next()
- }
+ }*/
}
states.vm_add_x_infl = {
@@ -5782,22 +5903,30 @@ states.vm_add_limited_infl = {
for (let space_id of game.valid_spaces) {
gen_action_infl(spaces[space_id].name_unique);
}
- } /*else {
+ } else {
view.prompt = `${clean_name(cards[this_card()].name)}: done.`
gen_action('done')
- }*/
+ }
},
infl(space) {
vm_do_add_limited_infl(space, game.vm_max_infl)
- if (game.vm_available_ops === 0 || game.valid_spaces.length === 0) {
+ /*if (game.vm_available_ops === 0 || game.valid_spaces.length === 0) {
game.vm_event_done = true
+ if (game.summary.length > 0) {
+ pop_summary()
+ log_br()
+ }
vm_next()
- }
+ }*/
},
- /*done () {
+ done () {
+ if (game.summary.length > 0) {
+ pop_summary()
+ log_br()
+ }
game.vm_event_done = true
vm_next()
- }*/
+ }
}
states.vm_remove_infl = {
@@ -5834,6 +5963,10 @@ states.vm_remove_infl = {
}*/
},
done() {
+ if (game.summary.length > 0) {
+ pop_summary()
+ log_br()
+ }
vm_next()
}
}
@@ -5888,6 +6021,10 @@ states.vm_remove_limited_infl = {
vm_do_remove_limited_infl(space, game.vm_max_infl)
if (game.vm_available_ops === 0) {
game.vm_event_done = true
+ if (game.summary.length > 0) {
+ pop_summary()
+ log_br()
+ }
vm_next()
}
},
@@ -6061,7 +6198,7 @@ states.vm_tiananmen_square_attempt = {
states.vm_adamec = {
get inactive() {
- return `resolve ${cards[88].name}.`
+ return `resolve ${clean_name(cards[88].name)}.`
},
prompt() {
view.prompt = 'Adamec: roll a die.'
@@ -6105,7 +6242,7 @@ states.vm_brought_in_for_questioning = {
discard() {
game.vm_event = discard_card(game.democrat_hand)
game.phase = 1
- if (cards[game.vm_event].side === 'C' && (!variable_events.includes(game.event) || game.playable_cards[find_event(game.vm_event)])) {
+ if (cards[game.vm_event].side === 'C' && (cards[game.vm_event].playable || game.playable_cards.includes(game.vm_event))) {
//game.return = game.active
if (!auto_resolve_events.includes(game.vm_event) && !switch_events.includes(game.vm_event)) {
next_player()
@@ -6126,16 +6263,16 @@ states.vm_brought_in_for_questioning = {
states.vm_central_committee_reshuffle = {
get inactive() {
- return `resolve ${cards[57].name}.`
+ return `resolve ${clean_name(cards[57].name)}.`
},
prompt() {
view.prompt = 'Choose a country to add SP.'
- if (!game.revolutions['East_Germany']) {gen_action('east_germany')}
- if (!game.revolutions['Poland']) {gen_action('poland')}
- if (!game.revolutions['Czechoslovakia']) {gen_action('czechoslovakia')}
- if (!game.revolutions['Hungary']) {gen_action('hungary')}
- if (!game.revolutions['Romania']) {gen_action('romania')}
- if (!game.revolutions['Bulgaria']) {gen_action('bulgaria')}
+ if (!game.revolutions[0]) {gen_action('poland')}
+ if (!game.revolutions[1]) {gen_action('hungary')}
+ if (!game.revolutions[2]) {gen_action('east_germany')}
+ if (!game.revolutions[3]) {gen_action('bulgaria')}
+ if (!game.revolutions[4]) {gen_action('czechoslovakia')}
+ if (!game.revolutions[5]) {gen_action('romania')}
},
east_germany() {
game.vm_active_country = "East_Germany"
@@ -6225,11 +6362,11 @@ states.vm_common_european_home = {
states.vm_dash_for_the_west = {
get inactive() {
- return `resolve ${cards[36].name}.`
+ return `resolve ${clean_name(cards[36].name)}.`
},
prompt() {
if (game.phase === 1) {
- view.prompt = 'Dash for The West: roll a die'
+ view.prompt = 'Dash for the West: roll a die'
gen_action('roll')
} else {
view.prompt = 'Dash for the West: roll a die. Done.'
@@ -6338,7 +6475,7 @@ states.vm_deutsche_marks = {
return `resolve ${cards[20].name}.`
},
prompt() {
- if(cards[game.vm_event].side === 'C' && (!variable_events.includes(game.vm_event) || game.playable_cards[find_event(game.vm_event)])) {
+ if(cards[game.vm_event].side === 'C' && (cards[game.vm_event].playable || game.playable_cards.includes(game.vm_event))) {
view.prompt = `Deutsche Marks: you must play ${clean_name(cards[this_card()].name)} for the event.`
gen_action('event')
} else {
@@ -6585,19 +6722,19 @@ states.vm_inflationary_currency = {
prompt() {
view.prompt = 'Inflationary Currency: choose a country where your opponent has power.'
if (game.active === DEM) {
- if (!game.revolutions['East_Germany']) {gen_action('east_germany')}
- if (!game.revolutions['Poland']) {gen_action('poland')}
- if (!game.revolutions['Czechoslovakia']) {gen_action('czechoslovakia')}
- if (!game.revolutions['Hungary']) {gen_action('hungary')}
- if (!game.revolutions['Romania']) {gen_action('romania')}
- if (!game.revolutions['Bulgaria']) {gen_action('bulgaria')}
+ if (!game.revolutions[0]) {gen_action('poland')}
+ if (!game.revolutions[1]) {gen_action('hungary')}
+ if (!game.revolutions[2]) {gen_action('east_germany')}
+ if (!game.revolutions[3]) {gen_action('bulgaria')}
+ if (!game.revolutions[4]) {gen_action('czechoslovakia')}
+ if (!game.revolutions[5]) {gen_action('romania')}
} else {
- if (game.revolutions['East_Germany']) {gen_action('east_germany')}
- if (game.revolutions['Poland']) {gen_action('poland')}
- if (game.revolutions['Czechoslovakia']) {gen_action('czechoslovakia')}
- if (game.revolutions['Hungary']) {gen_action('hungary')}
- if (game.revolutions['Romania']) {gen_action('romania')}
- if (game.revolutions['Bulgaria']) {gen_action('bulgaria')}
+ if (game.revolutions[0]) {gen_action('poland')}
+ if (game.revolutions[1]) {gen_action('hungary')}
+ if (game.revolutions[2]) {gen_action('east_germany')}
+ if (game.revolutions[3]) {gen_action('bulgaria')}
+ if (game.revolutions[4]) {gen_action('czechoslovakia')}
+ if (game.revolutions[5]) {gen_action('romania')}
}
},
east_germany() {
@@ -7150,6 +7287,10 @@ states.vm_nomenklatura_add = {
if (game.vm_available_ops === 0 ) {game.valid_spaces = []}
},
done() {
+ if (game.summary.length > 0) {
+ pop_summary()
+ log_br()
+ }
vm_next()
}
}
@@ -7211,12 +7352,12 @@ states.vm_shock_therapy = {
prompt() {
if (game.vm_active_country === '' ) {
view.prompt = 'Shock Therapy: choose a country where you hold Power:'
- if (game.revolutions['East_Germany']) {gen_action('east_germany')}
- if (game.revolutions['Poland']) {gen_action('poland')}
- if (game.revolutions['Czechoslovakia']) {gen_action('czechoslovakia')}
- if (game.revolutions['Hungary']) {gen_action('hungary')}
- if (game.revolutions['Romania']) {gen_action('romania')}
- if (game.revolutions['Bulgaria']) {gen_action('bulgaria')}
+ if (game.revolutions[0]) {gen_action('poland')}
+ if (game.revolutions[1]) {gen_action('hungary')}
+ if (game.revolutions[2]) {gen_action('east_germany')}
+ if (game.revolutions[3]) {gen_action('bulgaria')}
+ if (game.revolutions[4]) {gen_action('czechoslovakia')}
+ if (game.revolutions[5]) {gen_action('romania')}
} else if (game.phase === 2) {
view.prompt = 'Shock Therapy: done.'
gen_action('done')
@@ -7287,12 +7428,12 @@ states.vm_social_democratic_platform_adopted = {
},
prompt() {
view.prompt = 'Select a country where the Democrat holds Power.'
- if (game.revolutions['East_Germany']) {gen_action('east_germany')}
- if (game.revolutions['Poland']) {gen_action('poland')}
- if (game.revolutions['Czechoslovakia']) {gen_action('czechoslovakia')}
- if (game.revolutions['Hungary']) {gen_action('hungary')}
- if (game.revolutions['Romania']) {gen_action('romania')}
- if (game.revolutions['Bulgaria']) {gen_action('bulgaria')}
+ if (game.revolutions[0]) {gen_action('poland')}
+ if (game.revolutions[1]) {gen_action('hungary')}
+ if (game.revolutions[2]) {gen_action('east_germany')}
+ if (game.revolutions[3]) {gen_action('bulgaria')}
+ if (game.revolutions[4]) {gen_action('czechoslovakia')}
+ if (game.revolutions[5]) {gen_action('romania')}
},
east_germany() {
push_undo()
@@ -7362,12 +7503,12 @@ states.vm_the_chinese_solution = {
},
prompt() {
view.prompt = 'You may give up 3 VP to conduct support checks in a country where you hold power.'
- if (!game.revolutions['East_Germany']) {gen_action('east_germany')}
- if (!game.revolutions['Poland']) {gen_action('poland')}
- if (!game.revolutions['Czechoslovakia']) {gen_action('czechoslovakia')}
- if (!game.revolutions['Hungary']) {gen_action('hungary')}
- if (!game.revolutions['Romania']) {gen_action('romania')}
- if (!game.revolutions['Bulgaria']) {gen_action('bulgaria')}
+ if (!game.revolutions[0]) {gen_action('poland')}
+ if (!game.revolutions[1]) {gen_action('hungary')}
+ if (!game.revolutions[2]) {gen_action('east_germany')}
+ if (!game.revolutions[3]) {gen_action('bulgaria')}
+ if (!game.revolutions[4]) {gen_action('czechoslovakia')}
+ if (!game.revolutions[5]) {gen_action('romania')}
gen_action('pass')
},
east_germany() {
@@ -7619,6 +7760,10 @@ states.vm_we_are_the_people_remove = {
vm_do_remove_infl(space)
},
done() {
+ if (game.summary.length > 0) {
+ pop_summary()
+ log_br()
+ }
if (!game.vm_influence_added[6]) {
log('No influence removed')
vm_next()
@@ -7652,6 +7797,10 @@ states.vm_we_are_the_people_add = {
if (game.vm_influence_added[6] === 0 ) {game.valid_spaces = []}
},
done() {
+ if (game.summary.length > 0) {
+ pop_summary()
+ log_br()
+ }
vm_next()
}
}
@@ -7779,6 +7928,10 @@ states.vm_tst_4 = {
vm_do_remove_infl(space)
},
done() {
+ if (game.summary.length > 0) {
+ pop_summary()
+ log_br()
+ }
vm_next()
}
}