diff options
-rw-r--r-- | cards.js | 48 | ||||
-rw-r--r-- | play.css | 4 | ||||
-rw-r--r-- | play.js | 12 | ||||
-rw-r--r-- | rules.js | 30 |
4 files changed, 54 insertions, 40 deletions
@@ -19,7 +19,7 @@ function def_pol_card(year, title, powers, flavor, effects) { def_pol_card(1741, "Swedish-Russian War", [ P_PRUSSIA, P_FRANCE, P_AUSTRIA ], - "FLAVOR", + "Filled with the hope of re-establishing her Baltic Empire, Sweden declares war on Russia. The boldness of Swedish noblemen is greatly augmented by large French subsidies.", [ "Russia -1 or +1", "Italy -1", @@ -29,7 +29,7 @@ def_pol_card(1741, def_pol_card(1741, "Military Aid", [ P_PRUSSIA, P_FRANCE, P_AUSTRIA ], - "FLAVOR", + "The Russian Regent Biron is dispossessed by the Grand Duchess Anna. Alas, it is not her will to fulfill the promise of 30,000 men to aid Austria.", [ "Russia +1", ] @@ -38,7 +38,7 @@ def_pol_card(1741, def_pol_card(1741, "Naples", [ P_FRANCE, P_AUSTRIA ], - "FLAVOR", + "The Kingdom of Naples allies itself with France and Spain, and lays claim to Austrian possessions in Italy.", [ "Italy -1", ] @@ -47,7 +47,7 @@ def_pol_card(1741, def_pol_card(1741, "Charles Emmanuel", [ P_PRUSSIA, P_FRANCE, P_AUSTRIA ], - "FLAVOR", + "Charles Emmanuel of Sardinia-Piedmont is hesitant as to which side he should take. Spain is promising Lombardy, Versailles is talking with the tongues of angels, while Maria Theresa hopes that reason will prevail.", [ "Saxony -1 if allied with Prussia", "Italy +1", @@ -57,7 +57,7 @@ def_pol_card(1741, def_pol_card(1741, "War of Jenkins' Ear", [ P_PRAGMATIC, P_FRANCE, P_AUSTRIA ], - "FLAVOR", + "Robert Jenkins, captain of a British merchant ship, exhibits his severed ear to the British Parliament. This is seen as the ultimate proof that Spain is boarding British ships. England declares war on Spain.", [ "France -1 TC this turn", "Italy -1 or +1", @@ -67,7 +67,7 @@ def_pol_card(1741, def_pol_card(1741, "Denmark", [ P_PRAGMATIC, P_FRANCE, P_AUSTRIA ], - "FLAVOR", + "The Kingdom of Denmark decides to send a contingent of troops to join the Pragmatic Army, in order to fulfill the promised Pragmatic Sanction.", [ "Pragmatic +1 TC and +3 troops", ] @@ -78,7 +78,7 @@ def_pol_card(1741, def_pol_card(1742, "Coup d'État", [ P_PRUSSIA, P_FRANCE, P_AUSTRIA ], - "FLAVOR", + "The underage Ivan VI and his mother, regent Anna Ivanovna, are dethroned in a bloodless coup d'état. Elizabeth, daughter of Peter the Great, ascends to the throne. She has a native aversion to Austria and England.", [ "Russia -1", ] @@ -87,7 +87,7 @@ def_pol_card(1742, def_pol_card(1742, "Sweden Surrenders", [ P_PRUSSIA, P_FRANCE, P_AUSTRIA ], - "FLAVOR", + "Sweden is defeated. The Tsarina insists Sweden cede southern Finland in order to fulfill the ambitions of Peter the Great. Thereafter, she plans to strengthen her position against her enemies at court and to start reforms.", [ "Saxony +1", "Russia -1", @@ -97,7 +97,7 @@ def_pol_card(1742, def_pol_card(1742, "Spain", [ P_PRUSSIA, P_FRANCE, P_AUSTRIA ], - "FLAVOR", + "The restlessly acquisitive Queen of Spain desires the Kingdom of Lombardy for her son, Don Philipp. Thinking that the one who demands a lot will at least get a little, she claims the entire Austrian inheritance.", [ "Russia -1 or +1", "Italy -2", @@ -107,7 +107,7 @@ def_pol_card(1742, def_pol_card(1742, "Sardinia-Piedmont", [ P_PRAGMATIC, P_FRANCE, P_AUSTRIA ], - "FLAVOR", + "After months of hesitating, Charles Emmanuel III of Sardinia-Piedmont realizes that a Bourbon hegemony in Italy is not favourable for him. He allies with Austria.", [ "Italy +2", ] @@ -116,7 +116,7 @@ def_pol_card(1742, def_pol_card(1742, "Hessian Mercenaries", [ P_PRAGMATIC, P_FRANCE, P_AUSTRIA ], - "FLAVOR", + "The Landgrave of Hesse-Kassel, Frederick II, places his army of mercenaries at the disposal of whoever pays him the most.", [ "Your major power +3 troops", ] @@ -125,7 +125,7 @@ def_pol_card(1742, def_pol_card(1742, "Electoral Palatinate", [ P_PRAGMATIC, P_FRANCE, P_AUSTRIA ], - "FLAVOR", + "The Electoral Palatinate openly takes the side of France and Bavaria. An alliance is signed.", [ "Mannheim to French control", "France +1 TC and +3 troops", @@ -137,7 +137,7 @@ def_pol_card(1742, def_pol_card(1743, "Lopukhna Conspiracy", [ P_PRUSSIA, P_FRANCE, P_AUSTRIA ], - "FLAVOR", + "The Lopukhin-Conspiracy is foiled. The conspirators are tortured and then banished to Siberia. The Tsarina even orders Natalya Lopukhina's tongue ripped out. The Austrian ambassador is suspected of involvement.", [ "Russia -2", ] @@ -146,7 +146,7 @@ def_pol_card(1743, def_pol_card(1743, "Alexei Bestushev", [ P_PRUSSIA, P_FRANCE, P_AUSTRIA ], - "FLAVOR", + "Tsarina Elisabeth loses interest in governing. She gives her advisors plenty of freedom - especially to Alexei Bestushev who is well-known for his corruptibility. He holds out his palm to Vienna, Berlin and Versailles.", [ "Saxony +1", "Russia -1 or +1", @@ -156,7 +156,7 @@ def_pol_card(1743, def_pol_card(1743, "Commodore Martin", [ P_PRAGMATIC, P_FRANCE, P_AUSTRIA ], - "FLAVOR", + "Commodore Martin sails with 5 ships-of-the-line into the bay of Naples, threatening to cannonade the city unless the Kingdom of Naples declares herself neutral. After one hour of consideration, the city council accepts the ultimatum.", [ "Italy -1 or +2", ] @@ -165,7 +165,7 @@ def_pol_card(1743, def_pol_card(1743, "France", [ P_PRAGMATIC, P_FRANCE, P_AUSTRIA ], - "FLAVOR", + "France promises Spain her support in the conquest of the duchies of Milan and Parma. Furthermore, England is to be forced to give back Gibraltar and Minorca. War will be waged against the British, on sea and on land, in Italy and in the Netherlands.", [ "Italy -1 or +1", ] @@ -174,7 +174,7 @@ def_pol_card(1743, def_pol_card(1743, "Frankfurt Union", [ P_PRAGMATIC, P_FRANCE, P_AUSTRIA ], - "FLAVOR", + "Frederick the Great arranges the Frankfurt Union. It consists of Hesse-Kassel, the Palatinate, France and Prussia. The former two countries raise an army to support Bavaria.", [ "France or Bavaria +2 troops", ] @@ -183,7 +183,7 @@ def_pol_card(1743, def_pol_card(1743, "Quadruple Alliance", [ P_PRUSSIA, P_AUSTRIA ], - "FLAVOR", + "England, Austria, Saxony and the Netherlands sign the Quadruple-Alliance. The goal is the reconquest of Silesia and the partitioning of Prussian possessions between Austria and Saxony.", [ "Saxony +4", "Saxony +2 troops", @@ -195,7 +195,7 @@ def_pol_card(1743, def_pol_card(1744, "Catherine", [ P_PRUSSIA, P_FRANCE, P_AUSTRIA ], - "FLAVOR", + "Frederick arranges the marriage of the Russian Imperial heir and Sophia of Anhalt-Zerbst (later to be known as Catherine the Great). The relations between Russia and Prussia reach a new level of amity.", [ "Russia -1 or +1", ] @@ -204,7 +204,7 @@ def_pol_card(1744, def_pol_card(1744, "Russia", [ P_PRUSSIA, P_AUSTRIA ], - "FLAVOR", + "Bestushew succeeds in getting the French ambassador expelled from Russia. Furthermore he gains the upper hand against his antagonist Lestoqc and convinces the Tsarina to ally with Austria.", [ "Russia -1 or +2", ] @@ -213,7 +213,7 @@ def_pol_card(1744, def_pol_card(1744, "Genoa", [ P_FRANCE, P_AUSTRIA ], - "FLAVOR", + "The Republic of Genoa joins the Bourbon Alliance and declares it will send 10,000 soldiers. The Franco-Spanish are advancing with fresh power and confidence towards Alessandria.", [ "Saxony +1", "Italy -2 or +1", @@ -223,7 +223,7 @@ def_pol_card(1744, def_pol_card(1744, "Separate Peace", [ P_PRAGMATIC, P_FRANCE, P_AUSTRIA ], - "FLAVOR", + "Charles Emmanuel is negotiating for a separate peace which could give Sardinia a wide range of possessions. However, even though the preliminaries are already signed, his mistrust of Versailles and Madrid prevails, and he stays loyal to Maria Theresa.", [ "Italy -1 or +2", ] @@ -232,7 +232,7 @@ def_pol_card(1744, def_pol_card(1744, "Jacobite Rising", [ P_PRAGMATIC, P_FRANCE ], - "FLAVOR", + "Financed by France, the Jacobites are rising in Scotland. They conquer Edinburgh. Shortly thereafter Manchester and Lancaster fall, and the rebels are only 100 miles before London. The British recall troops from Continental Europe.", [ "Pragmatic general to England", // "Pragmatic -1 TC until game end", @@ -242,7 +242,7 @@ def_pol_card(1744, def_pol_card(1744, "Carnatic War", [ P_PRAGMATIC, P_FRANCE, P_AUSTRIA ], - "FLAVOR", + "In the Carnatic War, France conquers Madras, an important British trading-base in South India. Now, the profits from the Madras trade are filling the French war chest instead of the British.", [ "Pragmatic or France +1 TC and +2 troops", ] @@ -185,7 +185,7 @@ header.your_turn.austria { background-color: var(--color-light-austria); } } .city_tip, .piece_tip, .move_tip, .card_tip { cursor: pointer; } -.card_tip { font-style: italic } +.card_tip { font-style: italic; text-decoration: underline; } .city_tip:hover, .piece_tip:hover, .move_tip:hover { text-decoration: underline; } #log .h { @@ -207,7 +207,7 @@ header.your_turn.austria { background-color: var(--color-light-austria); } #log .h.pragmatic { background-color: var(--color-light-pragmatic); } #log .h.saxony { background-color: var(--color-light-saxony); } -#log div.q { font-style: italic; padding-left: 8px; text-indent: 0px; } +#log div.q { font-style: italic; padding-left: 8px; text-indent: 12px; } #log div { padding-left: 20px; text-indent: -12px; } #log div.i { padding-left: 32px; text-indent: -12px; } @@ -1445,7 +1445,11 @@ function on_log(text) { text = text.replace(/P(\d+)/g, sub_piece) text = text.replace(/C(\d+)/g, sub_political) - if (text.startsWith("#")) { + if (text.startsWith("@")) { + p.className = "move_tip" + text = sub_path(text.substring(1).split(";")) + } + else if (text.startsWith("#")) { p.className = "h turn" text = text.substring(2) } @@ -1456,9 +1460,9 @@ function on_log(text) { else text = text.substring(2) } - else if (text.startsWith("@")) { - p.className = "move_tip" - text = sub_path(text.substring(1).split(";")) + else if (text.startsWith("%")) { + p.className = "q" + text = political_cards[text.substring(1)].flavor } p.innerHTML = text @@ -2,11 +2,12 @@ /* +TODO: confirm austria/pragmatic stacking cooperation + OPTIMIZE: fewer/smarter/smaller lists, smarter power control checks OPTIMIZE: range checks instead of set checks POLISH: check inactive prompts -POLISH: check push_undo/clear_undo for all UI: show who controls which power in player list UI: show TC modifiers in banner @@ -3766,10 +3767,11 @@ function goto_politics() { } // 25.2 Reveal 2 Political Cards - log("Political Cards") while (game.political.length < 2) { let pc = game.pol_deck.pop() - log(">C" + pc) + log("C" + pc) + log("%" + pc) + log("") if (pc === IMPERIAL_ELECTION) game.flags |= F_IMPERIAL_ELECTION else @@ -3812,6 +3814,11 @@ states.determine_trump_suit = { // 25.4 Place TCs on the political display function goto_place_tc_on_display() { + log("Place TCs on political display") + next_place_tc_on_display() +} + +function next_place_tc_on_display() { set_active_to_power(POWER_FROM_POLITICAL_STAGE[game.stage]) game.state = "place_tc_on_display" } @@ -3825,13 +3832,13 @@ states.place_tc_on_display = { }, card(c) { push_undo() - log(power_name[game.power] + " placed a TC.") + log(">" + power_name[game.power] + " placed TC") remove_card_in_hand(c) set_add(game.face_down[game.power], c) game.state = "place_tc_on_display_done" }, pass() { - log(power_name[game.power] + " passed.") + log(">" + power_name[game.power] + " passed") end_place_tc_on_display() }, } @@ -3851,7 +3858,7 @@ function end_place_tc_on_display() { if (++game.stage === 4) goto_determine_order_of_influence() else - goto_place_tc_on_display() + next_place_tc_on_display() } // 25.5 Determine order of influence @@ -3859,7 +3866,7 @@ function end_place_tc_on_display() { function goto_determine_order_of_influence() { log_br() - log("Influence") + log("Order of influence") // Turn cards face-up (and turn bluff cards face down again) for (let pow of POWER_FROM_POLITICAL_STAGE) { @@ -3918,6 +3925,7 @@ function goto_select_political_card() { } else { game.stage |= 1 << pow set_active_to_power(pow) + log("=" + game.power) game.state = "select_political_card" } } else { @@ -3936,7 +3944,7 @@ states.select_political_card = { }, political(pc) { push_undo() - log(power_name[game.power] + " chose C" + pc + ".") + log("C" + pc) // face-up TCs to discard game.face_up[game.power] = [] @@ -3961,12 +3969,13 @@ states.political_card_discard_or_execute = { }, execute() { push_undo() + log(power_name[game.power] + " executes card.") next_execute_political_card() }, discard() { push_undo() log("Discarded with no effect.") - end_execute_political_card() + game.state = "political_card_done" }, } @@ -4168,6 +4177,7 @@ function can_add_troops() { } function goto_political_troops_place() { + log(power_name[game.power] + " " + game.count + " troops.") if (can_add_troops()) game.state = "political_troops_place" else @@ -4916,7 +4926,7 @@ states.france_reduces_military_objectives = { } states.france_reduces_military_objectives_done = { - inactive: "supply", + inactive: "reduce military objectives", prompt() { prompt("Set aside " + game.vp[SET_ASIDE_FRANCE] + " victory markers.") view.actions.next = 1 |