diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-05-30 17:10:09 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-05-30 19:00:19 +0200 |
commit | 80fb3b86b2372a7ca864edb86e473959c9bbf3b7 (patch) | |
tree | 671a4669551cb5f9286090ff8c360485e57e5568 /tools | |
parent | 5cabd150b3c792b6dea83d3503ae2048755ab7d1 (diff) | |
download | friedrich-80fb3b86b2372a7ca864edb86e473959c9bbf3b7.tar.gz |
TOOLS
Diffstat (limited to 'tools')
-rw-r--r-- | tools/fatecards-stroke.txt | 39 | ||||
-rw-r--r-- | tools/fatecards.ascii.txt | 239 | ||||
-rw-r--r-- | tools/genpieces.mjs | 199 | ||||
-rw-r--r-- | tools/labels.sh | 26 | ||||
-rw-r--r-- | tools/parse-cards.js | 48 |
5 files changed, 551 insertions, 0 deletions
diff --git a/tools/fatecards-stroke.txt b/tools/fatecards-stroke.txt new file mode 100644 index 0000000..fc4d916 --- /dev/null +++ b/tools/fatecards-stroke.txt @@ -0,0 +1,39 @@ + +Voltaire, Frederick’s two-faced friend, manages to print Frederick’s poems, which contain negative comments about the King of England. London society is outraged and the House of Commons votes unanimously for a reduction of subsidies. + +From now on Prussia will receive two less Tactical Cards, but always a minimum of four. + +------------------------------------------------ + +William Pitt, the main advocate of the alliance with Prussia, has lost influence. His successor Lord Bute intends to make peace with France. To achieve this, he is willing to make certain concessions: Prussia should agree to give up Upper Silesia and the County of Glatz. To support his policy, he reduces the subsidies. + +From now on Prussia will receive two less Tactical Cards, but always a minimum of four. + +------------------------------------------------ + + +Death of the Tsarina. Her successor, Peter III, is an ardent admirer of Frederick. He begs for the Prussian Black-Eagle-Medal and declares that it is more of an honour to be a Prussian General than a Russian Tsar. He then signs the peace treaty. Three months later he is assassinated and his wife, Catherine the Great, accedes to the throne. Nevertheless, the peace is kept. + +Russia quits the game! Also, Prussia has to remove any one general (other than Friedrich) permanently from the game; this general may be off-map. For Sweden eased victory conditions come into effect. If Sweden has already quit the game, the Imperial Army switches players and eased victory conditions come into effect for Austria and the Imperial Army (see rule 11). + +------------------------------------------------ + +Adolf Frederick, King of Sweden, initiates peace negotiations with Frederick the Great, who is in a mood for ridicule: “Peace? Am I then at war with Sweden? I am not, am I?” The Swedish envoys assure him that indeed he is, and so a peace treaty is signed. + +Sweden quits the game! Also, Prussia has to remove any one general (other than Friedrich) permanently from the game; this general may be off-map. If Russia has already quit the game as well, the Imperial Army switches players and eased victory conditions come into effect for Austria and the Imperial Army (see rule 11). + +------------------------------------------------ + +Robert Clive’s fantastic victory at Plassey means the complete loss of India for France. Moreover the state is on the verge of bankruptcy. Louis XV overrules Madame Pompadour and reduces spending on the war and subsidies. + +From now on Austria receives only 4 TC; France only 3 (which she may all keep). If this has already happened, then: France quits the game! Cumberland is removed permanently from the game. Hanover receives only 1 TC from now on. The Imperial Army switches players and eased victory conditions come into effect for Austria and the Imperial Army (see rule 11). + +------------------------------------------------ + +In the war for the colonies France loses a wide range of possessions along the Ohio and Mississippi rivers, and in Quebec. Tax income decreases drastically. The Duc de Choiseul advises that military expenditure and subsidies be reduced. + +From now on Austria receives only 4 TC; France only 3 (which she may all keep). If this has already happened, then: France quits the game. Cumberland is removed permanently from the game. Hanover receives only 1 TC from now on. The Imperial Army switches players and eased victory conditions come into effect for Austria and the Imperial Army (see rule 11). + +------------------------------------------------ + + diff --git a/tools/fatecards.ascii.txt b/tools/fatecards.ascii.txt new file mode 100644 index 0000000..605cd38 --- /dev/null +++ b/tools/fatecards.ascii.txt @@ -0,0 +1,239 @@ +Frederick chats with de Catt, “I cannot do without this Spanish snuff. It is a deeply rooted habit. I am befouling my face and my clothing. I look like a pig, don’t I?” De Catt, “I have to admit, Sire, that your face and your uniform are heavily coated with tobacco.” Frederick laughs. “Well, my dear, that is exactly what I call looking like a pig.”
+
+No effect.
+
+Russia founds her first mortgage bank, her first university and the Academy of the Three Noblest Arts in Petersburg. The Tsarina is generous in other areas too.
+
+Any one Russian on-map general receives a new troop for free (if possible).
+
+Tsarina Elisabeth’s furious energy shores up the crumbling Austro-Russian alliance.
+
+Austria and Russia may exchange one TC with each other.
+
+General Tottleben raids Berlin and demands 4 million Thalers of war contributions. However, when rumours of Frederick’s approach reach him, he beats a hasty retreat.
+
+Tottleben receives a new troop for free (if possible and if on-map).
+
+1
+
+------------------------------------------------
+
+Rousseau publishes The Social Contract (Du contrat social), a fundamental philosophic text for modern democracy.
+
+No effect.
+
+The Russians are roaming the Neumark, marauding and spreading devastation. Fermor gives the order to bombard Küstrin with red-hot cannonballs.
+
+If Fermor starts his move in Küstrin (H6) or in an adjacent city, he may not move next turn.
+
+A number of supposedly fainthearted generals are court-martialed on Tsarina Elisabeth’s orders. Apraxin takes this as an instruction to act even more ruthlessly towards the local population, but it is the discipline of his own troops that deteriorates.
+
+Apraxin immediately loses one troop (but not if he has to be taken off-map).
+
+Following his triumph at Kunersdorf, Pjotr S. Saltikov laments, “One more victory like this and I will have to take the message to Petersburg myself, alone and with my general’s baton in my hand.” He refuses to occupy the undefended Berlin.
+
+Next turn, Saltikov may move only 2 cities (3 on main roads).
+
+2
+
+------------------------------------------------
+
+Portugal: Following the assassination attempt on Joseph I the conspiring aristocrats are executed.
+
+No effect.
+
+The French Foreign Secretary Choiseul believes that the destruction of Prussia would not be wise. He starts peace negotiations with Frederick. They fail after only a few days.
+
+Next turn, if Prussia and France fight each other, they may not use TCs with values of 10 or more.
+
+Taken from a letter of Prince Soubise: “I believe our plan was excellent; but the enemy was not willing to give us enough time for its execution. The most important thing now is to save our nation’s honour and to lay the blame squarely on the Imperial Army.”
+
+Next turn, Soubise and Hildburghausen may not attack with the same TC-symbol.
+
+Death of Georg Friedrich Händel, the prolific composer of oratorios, operas, vocal and instrumental music. The combatants respect the funeral rites in his native city of Halle.
+
+Next turn, no general may be attacked in the city of Halle (E4) and no supply train may be eliminated in the city of Halle.
+
+3
+
+------------------------------------------------
+
+The Marquise de Pompadour, mistress of Louis XV and the de facto the ruler of France, dissuades the King from his thoughts of peace. “I prefer my lover to be a hero!” she argues.
+
+Next turn, the first TC played by France is worth an additional point.
+
+Voltaire writes, “In these seven years of war allied with Austria, France has lost more money and more men than in all the wars against Austria in the last two hundred years.”
+
+No effect.
+
+Frederick composes a verse: “This weakling on the throne / plaything of the Pompadour / with an evil love’s reward / marked for ever more.” Madame Pompadour swears revenge.
+
+France may discard any one TC for a new one from the draw deck.
+
+The Duke of Cumberland, nicknamed “the Bloody Butcher of Scotland”, falls under the spell of a Danish Pietist, who promises to stop the French army with the assistance of the Holy Ghost.
+
+Next turn, Cumberland may not move into attack position; he may not eliminate a supply train.
+
+4
+
+------------------------------------------------
+
+The Prince de Soubise is devastated when his favourite dog dies. He refuses to see anyone for three days.
+
+Next turn, Soubise may not move into attack position; he may not eliminate a supply train.
+
+Frederick to his sister, “If, in common life, three citizens took it into their heads to fall upon their neighbour, and burn his house about him, they very certainly, by sentence of tribunal, would be broken on the wheel. O tempora, o mores! Indeed, it would be better to live with tigers, leopards and foxes, than with the assassins, bandits and rascals who reign over this poor world.”
+
+No effect.
+
+The 62-year-old Duc de Richelieu is a famous fellow, having bedded more than 600 ladies, outperforming even his King, Louis XV — And right now, the lovely Marquise de Nivernais is arriving . . .
+
+Next turn, Richelieu may move 2 cities only (3 on main roads).
+
+Abbé Bernis writes, “France has no generals who can compete with Frederick the Great, and if she had, they wouldn’t be given supreme command.”
+
+If stacked, Chevert may not unstack next turn.
+
+5
+
+------------------------------------------------
+
+Gideon Ernst von Laudon had once wanted to serve in the Prussian army, but was turned down by Frederick. Perhaps the King did not like his red hair or the fact that he looked like a horse. Now Laudon turns out to be the most competent Austrian general and repeatedly manages to put the Prussians in great difficulty.
+
+Austria may move Laudon by one city immediately; Laudon may even unstack.
+
+Daun wins a brilliant victory over Frederick. And Prince Henry toasts his brother’s defeat in champagne! Also, Maria Theresa acclaims her hero.
+
+Daun receives one new troop (if possible and if on-map).
+
+Death of the composer Johann Stamitz. In Berlin, Frederick the Great founds the Royal Prussian Porcelain Manufacture KPM.
+
+No effect.
+
+Austrian hussars capture an important Prussian supply train, causing the Prussians to suffer a grave shortage of food and ammunition.
+
+Austria may flip any one Prussian general/stack in Austria or Saxony, and in doing so, set him out of supply.
+
+6
+
+------------------------------------------------
+
+“There is not a trace of what I once was left to be found. I have become a grey old man who has lost half his teeth; a man with no cheer, bereft of spirit and lacking in imagination; in one word: a shadow.”
+
+Next turn, Friedrich may not move into attack position and may not eliminate a supply train.
+
+The new reader of Prussia’s King is introduced: Henri de Catt, a 33-year old Swiss. His most important task will be sitting through Frederick’s interminable monologues.
+
+No effect.
+
+Frederick repeatedly speaks of suicide, composes a flood of poems and dreams of alliances with the Turks and the Tartars.
+
+Next turn, Friedrich may not receive any new troops.
+
+Frederick’s generals implore him to break off the battle; the enemy is bound to withdraw. But Frederick is stubborn. And that’s the way the catastrophe of Kunersdorf begins . . .
+
+If Friedrich is involved in combat next turn, Prussia must reach a positive score with the first TC(s) she plays (if possible).
+
+7
+
+------------------------------------------------
+
+Frederick demands 300,000 Thalers in war contributions from the burghers of Leipzig, some of whom are held prisoner and fed only bread and water until the money is paid.
+
+Any one Prussian on-map general receives a new troop for free (if possible).
+
+Leopold von Daun, dilatory as a matter of principle, faces the Prussians with four times their force. It takes 5 weeks of argument with the council of war in Vienna to come up with a plan of action . . .
+
+Next turn, any Prussians who are attacked by Daun may move to any empty adjacent city (before the combat is resolved); by doing so they avoid all combat.
+
+Frederick writes to his sister Wilhelmine: “What an awful slaughter! What a bloodbath! An unthinking world calls it heroism, but close up, it is always horrid.”
+
+No effect.
+
+With perfect use of the oblique battle formation, Frederick routs Charles of Lorraine (Karl von Lothringen) who outnumbers him two to one.
+
+If Friedrich attacks next turn, his first TC is worth 5 additional points.
+
+8
+
+------------------------------------------------
+
+The grain supply has gone rotten in many Russian depots, causing widespread supply problems.
+
+All Russian generals 5 or 6 cities distant from their nearest supply train are immediately out of supply; flip them.
+
+At Liegnitz, 80,000 Austrians surprisingly encircle Frederick’s 30,000 men. Improvising masterfully, the Prussian King manages to escape the trap.
+
+Next turn, Friedrich may move 4 cities, even as a stack (5 on main roads).
+
+Frederick writes, “Our troops were in complete confusion, I reassembled them three times, but finally we had to quit the field. My coat is riddled with bullets, two horses were killed under me — my misfortune is that I am still alive.”
+
+No effect.
+
+Frederick orders Austrian coinage with decreased silver content to be minted and exchanged for genuine currency. Satisfied, he states, “My enemies are financing my war efforts.”
+
+Prussia may draw randomly one TC from Austria, after first giving one TC of her choice to Austria.
+
+9
+
+------------------------------------------------
+
+Prussia is recruiting new troops. “But they are so lousy”, Frederick scoffs, “that they can be shown to the enemy only from a distance.”
+
+Next turn, every Prussian general who receives new troops may not move into attack position.
+
+After one of his generals loses a battle Frederick writes, “It was my belief that this thing was destined to fail. It is not your fault that the cowards ran away so promptly.”
+
+Any one Prussian general with 2 or more troops loses one troop immediately.
+
+Keith is deeply worried about the exposed position of the Prussian camp. “If the Austrians leave us alone here, they deserve to be hanged!” Frederick retorts, “They are more afraid of us than of the gallows.” A fatal mistake; the Austrians attack that same night.
+
+If Friedrich is attacked next turn, the first TC played by Prussia is worth nothing (0 points).
+
+By unifying the collections of Cotton, Harley and Sloane, the British Museum in London is founded.
+
+No effect.
+
+10
+
+------------------------------------------------
+
+Frederick orders Seydlitz to engage the enemy at last! Seydlitz replies, “After the battle, my head is at His Majesty’s disposal. During the battle, however, I would like to be permitted to serve my King with good use of the same.” — Seydlitz will unleash his charge at the decisive moment.
+
+Next turn, Prussia may play the 11 of spades (Seydlitz) once at double value.
+
+The British occupy Cuba, which they hope to exchange for Spanish Florida. Also, fresh troops are sent to the Electorate of Hanover.
+
+Any one Hanoverian on-map general receives a new troop (if possible).
+
+Of his brother Henry (Heinrich), Frederick states, “He is the only one of us who has not made a single mistake so far.”
+
+Next turn, Prinz Heinrich protects objectives up to 4 cities distant.
+
+Frederick: “One could assume that the Caucasus or the Cordillera is the homeland of the Austrian generals. Whenever they see a mountain, they climb it. They appear to be blindly in love with the rocks and the ravines.”
+
+No effect.
+
+11
+
+------------------------------------------------
+
+In Vienna caricatures are circulating that depict Leopold von Daun with a nightcap. His wife is pelted with horse manure on her daily drive through the city.
+
+Next turn, Daun may move only 2 cities (3 on main roads).
+
+“Hottentots” is the only name Frederick has for the Swedes. Only a poorly equipped militia is sent to fight them.
+
+If Ehrensvärd is 5 or 6 cities distant from his supply train, he is immediately out of supply; flip him.
+
+Following a major defeat, the Runaway Army, as the Imperial Army is now called, only stops retreating on reaching the Harz.
+
+If Hildburghausen has lost a battle this turn, Prussia may move him 2 cities westwards (if possible).
+
+Frederick writes of Maria Theresa, “I have to admit that this Lady is highly admirable because of her excellent morals. Only few women are her equal in this regard, most are whores. Maria Theresa abominates all whores; she has them thrown in prison, especially if she suspects them of desiring her husband.”
+
+No effect.
+
+12
+
+------------------------------------------------
diff --git a/tools/genpieces.mjs b/tools/genpieces.mjs new file mode 100644 index 0000000..40db218 --- /dev/null +++ b/tools/genpieces.mjs @@ -0,0 +1,199 @@ +import fs from "fs" +import { formatHex, parseHex, convertRgbToOklab } from 'culori' + +function make_piece_colors(base) { + let rgb = parseHex(base) + let sh1 = convertRgbToOklab(rgb); sh1.l *= 0.90; + let sh2 = convertRgbToOklab(rgb); sh2.l *= 0.85; + let sh3 = convertRgbToOklab(rgb); sh3.l *= 0.80; + let sh4 = convertRgbToOklab(rgb); sh4.l *= 0.25; + return [ base, formatHex(sh1), formatHex(sh2), formatHex(sh3), formatHex(sh4) ] +} + +const color_austria = make_piece_colors("#ffffff") +const color_hanover = make_piece_colors("#56beda") +const color_france = make_piece_colors("#ed1c24") +const color_imperial = make_piece_colors("#fff200") +const color_prussia = make_piece_colors("#00558c") +const color_russia = make_piece_colors("#157d36") +const color_sweden = make_piece_colors("#bacb32") + +// sizes used in coin +// const IMAGE_W = 42 +// const IMAGE_H = 28 +// const TALL = 18 + +const IMAGE_W = 40 +const IMAGE_H = Math.round( IMAGE_W * 3/4 ) +const TALL = 15 + +const RX = (IMAGE_W - 1) / 2 +const RY = (IMAGE_H - 1) / 2 +const SVG_W = RX * 2 + 3 +const SVG_H = RY * 2 + 3 + TALL +const CX = (RX * 2 + 3) / 2 +const CY = (RY * 2 + 3) / 2 + +console.log("CYLINDER", SVG_W, SVG_H) + +function mkarc(cx, cy, rx, ry, h) { + return [ + 'M', cx - rx, cy, + 'L', cx - rx, cy + h, + 'A', rx, ry, 0, 0, 0, cx + rx, cy + h, + 'L', cx + rx, cy, + 'z' + ].join(" ") +} + +function print_cylinder(output, icon_file, c) { + let icon = icon_file ? fs.readFileSync(icon_file).toString('base64') : null + let svg = [] + + svg.push(`<svg xmlns="http://www.w3.org/2000/svg" width="${SVG_W}" height="${SVG_H}">`) + + if (icon) + svg.push(`<clipPath id="c"><ellipse cx="${CX}" cy="${CY}" rx="${RX}" ry="${RY}"/></clipPath>`) + + if (1) { + svg.push(`<linearGradient id="g">`) + svg.push(`<stop offset="0%" stop-color="${c[1]}"/>`) + svg.push(`<stop offset="50%" stop-color="${c[2]}"/>`) + svg.push(`<stop offset="100%" stop-color="${c[3]}"/>`) + svg.push('</linearGradient>') + svg.push(`<path fill="url(#g)" stroke="${c[4]}" d="${mkarc(CX, CY, RX, RY, TALL)}"/>`) + } else { + svg.push(`<path fill="${c[1]}" stroke="${c[4]}" d="${mkarc(CX, CY, RX, RY, TALL)}"/>`) + } + + if (icon) { + svg.push(`<image preserveAspectRatio="none" href="data:image/png;base64,${icon}" clip-path="url(#c)" x="1" y="1" width="${IMAGE_W}" height="${IMAGE_H}"/>`) + svg.push(`<ellipse fill="none" stroke="${c[4]}" cx="${CX}" cy="${CY}" rx="${RX}" ry="${RY}"/>`) + } else { + svg.push(`<ellipse fill="${c[0]}" stroke="${c[4]}" cx="${CX}" cy="${CY}" rx="${RX}" ry="${RY}"/>`) + } + + svg.push('</svg>') + fs.writeFileSync(output, svg.join("\n") + "\n") +} + +const CUBE_SIDE = 20 +const CUBE_ASPECT = 3/4 +const CUBE_TALL = 15 + +const CUBE_W = Math.round( CUBE_SIDE * Math.sqrt(2) ) +const CUBE_H = Math.round( CUBE_SIDE * Math.sqrt(2) * CUBE_ASPECT ) + +const CUBE_SVG_W = CUBE_W + 3 +const CUBE_SVG_H = CUBE_TALL + CUBE_H + 3 + +console.log("CUBE", CUBE_SVG_W, CUBE_SVG_H, CUBE_W) + +function print_cube(output, c) { + let svg = [] + + // let xo = 0 + // let yo = 0 + // let ys = 1 // 2/3 + + // let w = 20 + // let d = Math.sqrt(w * w + w * w) + // let h = Math.round(w * 0.8) + + let xo = 1.5 + let yo = 1.5 + let dx = CUBE_W + let dy = CUBE_H + let h = CUBE_TALL + + let v = [ + [ xo + (dx/2), yo + (0) ], + [ xo + (dx), yo + (dy/2) ], + [ xo + (dx/2), yo + (dy) ], + [ xo + (0), yo + (dy/2) ], + ] + + let v2 = [ + [ v[1][0], v[1][1] ], + [ v[1][0], v[1][1] + h ], + [ v[2][0], v[2][1] + h ], + [ v[3][0], v[3][1] + h ], + [ v[3][0], v[3][1] ], + ] + + let v3 = [ + [ v[2][0], v[2][1] ], + [ v[2][0], v[2][1] + h ], + ] + + let f1 = [ + [ v[1][0], v[1][1] ], + [ v[1][0], v[1][1] + h ], + [ v[2][0], v[2][1] + h ], + [ v[2][0], v[2][1] ], + ] + + let f2 = [ + [ v[2][0], v[2][1] ], + [ v[2][0], v[2][1] + h ], + [ v[3][0], v[3][1] + h ], + [ v[3][0], v[3][1] ], + ] + + svg.push(`<svg xmlns="http://www.w3.org/2000/svg" width="${CUBE_SVG_W}" height="${CUBE_SVG_H}">`) + + svg.push(`<path fill="${c[0]}" d="M${v}"/>`) + svg.push(`<path fill="${c[3]}" d="M${f1}"/>`) + svg.push(`<path fill="${c[1]}" d="M${f2}"/>`) + + svg.push(`<path fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="${c[4]}" d="M${v}z M${v2} M${v3}"/>`) + + svg.push('</svg>') + fs.writeFileSync(output, svg.join("\n") + "\n") +} + +print_cylinder("images/cylinder_austria_oos.svg", null, color_austria) +print_cylinder("images/cylinder_austria_1.svg", "tools/stickers/A1.png", color_austria) +print_cylinder("images/cylinder_austria_2.svg", "tools/stickers/A2.png", color_austria) +print_cylinder("images/cylinder_austria_3.svg", "tools/stickers/A3.png", color_austria) +print_cylinder("images/cylinder_austria_4.svg", "tools/stickers/A4.png", color_austria) +print_cylinder("images/cylinder_austria_5.svg", "tools/stickers/A5.png", color_austria) + +print_cylinder("images/cylinder_france_oos.svg", null, color_france) +print_cylinder("images/cylinder_france_1.svg", "tools/stickers/F1.png", color_france) +print_cylinder("images/cylinder_france_2.svg", "tools/stickers/F2.png", color_france) +print_cylinder("images/cylinder_france_3.svg", "tools/stickers/F3.png", color_france) + +print_cylinder("images/cylinder_hanover_oos.svg", null, color_hanover) +print_cylinder("images/cylinder_hanover_1.svg", "tools/stickers/H1.png", color_hanover) +print_cylinder("images/cylinder_hanover_2.svg", "tools/stickers/H2.png", color_hanover) + +print_cylinder("images/cylinder_imperial_oos.svg", null, color_imperial) +print_cylinder("images/cylinder_imperial_1.svg", "tools/stickers/I1.png", color_imperial) + +print_cylinder("images/cylinder_prussia_oos.svg", null, color_prussia) +print_cylinder("images/cylinder_prussia_1.svg", "tools/stickers/P1.png", color_prussia) +print_cylinder("images/cylinder_prussia_2.svg", "tools/stickers/P2.png", color_prussia) +print_cylinder("images/cylinder_prussia_3.svg", "tools/stickers/P3.png", color_prussia) +print_cylinder("images/cylinder_prussia_4.svg", "tools/stickers/P4.png", color_prussia) +print_cylinder("images/cylinder_prussia_5.svg", "tools/stickers/P5.png", color_prussia) +print_cylinder("images/cylinder_prussia_6.svg", "tools/stickers/P6.png", color_prussia) +print_cylinder("images/cylinder_prussia_7.svg", "tools/stickers/P7.png", color_prussia) +print_cylinder("images/cylinder_prussia_8.svg", "tools/stickers/P8.png", color_prussia) + +print_cylinder("images/cylinder_russia_oos.svg", null, color_russia) +print_cylinder("images/cylinder_russia_1.svg", "tools/stickers/R1.png", color_russia) +print_cylinder("images/cylinder_russia_2.svg", "tools/stickers/R2.png", color_russia) +print_cylinder("images/cylinder_russia_3.svg", "tools/stickers/R3.png", color_russia) +print_cylinder("images/cylinder_russia_4.svg", "tools/stickers/R4.png", color_russia) + +print_cylinder("images/cylinder_sweden_oos.svg", null, color_sweden) +print_cylinder("images/cylinder_sweden_1.svg", "tools/stickers/S1.png", color_sweden) + +print_cube("images/cube_austria.svg", color_austria) +print_cube("images/cube_france.svg", color_france) +print_cube("images/cube_hanover.svg", color_hanover) +print_cube("images/cube_imperial.svg", color_imperial) +print_cube("images/cube_prussia.svg", color_prussia) +print_cube("images/cube_russia.svg", color_russia) +print_cube("images/cube_sweden.svg", color_sweden) diff --git a/tools/labels.sh b/tools/labels.sh new file mode 100644 index 0000000..b32a748 --- /dev/null +++ b/tools/labels.sh @@ -0,0 +1,26 @@ +IN=labels.ppm +OUT=label +pnmcut 268 281 326 325 ${IN} > ${OUT}_01_01.ppm +pnmcut 740 281 326 325 ${IN} > ${OUT}_01_02.ppm +pnmcut 1213 281 326 325 ${IN} > ${OUT}_01_03.ppm +pnmcut 1685 281 326 325 ${IN} > ${OUT}_01_04.ppm +pnmcut 268 753 326 326 ${IN} > ${OUT}_02_01.ppm +pnmcut 740 753 326 326 ${IN} > ${OUT}_02_02.ppm +pnmcut 1213 753 326 326 ${IN} > ${OUT}_02_03.ppm +pnmcut 1685 753 326 326 ${IN} > ${OUT}_02_04.ppm +pnmcut 268 1226 326 325 ${IN} > ${OUT}_03_01.ppm +pnmcut 740 1226 326 325 ${IN} > ${OUT}_03_02.ppm +pnmcut 1213 1226 326 325 ${IN} > ${OUT}_03_03.ppm +pnmcut 1685 1226 326 325 ${IN} > ${OUT}_03_04.ppm +pnmcut 268 1698 326 326 ${IN} > ${OUT}_04_01.ppm +pnmcut 740 1698 326 326 ${IN} > ${OUT}_04_02.ppm +pnmcut 1213 1698 326 326 ${IN} > ${OUT}_04_03.ppm +pnmcut 1685 1698 326 326 ${IN} > ${OUT}_04_04.ppm +pnmcut 268 2170 326 326 ${IN} > ${OUT}_05_01.ppm +pnmcut 740 2170 326 326 ${IN} > ${OUT}_05_02.ppm +pnmcut 1213 2170 326 326 ${IN} > ${OUT}_05_03.ppm +pnmcut 1685 2170 326 326 ${IN} > ${OUT}_05_04.ppm +pnmcut 268 2643 326 326 ${IN} > ${OUT}_06_01.ppm +pnmcut 740 2643 326 326 ${IN} > ${OUT}_06_02.ppm +pnmcut 1213 2643 326 326 ${IN} > ${OUT}_06_03.ppm +pnmcut 1685 2643 326 326 ${IN} > ${OUT}_06_04.ppm diff --git a/tools/parse-cards.js b/tools/parse-cards.js new file mode 100644 index 0000000..940d826 --- /dev/null +++ b/tools/parse-cards.js @@ -0,0 +1,48 @@ +const fs = require("fs") + +let fate_text = [] +let fate_effect = [] + +function parse_fate_cards_raw() { + let num = 1 + let out = [] + let buf = [] + + function flush_card() { + if (buf.length === 0) + return + if (buf.length !== 9) + throw "BAD CARD" + + let number = parseInt(buf[8]) + let x = (number - 1) * 4 + + + fate_text[x+0] = buf[0] + fate_text[x+1] = buf[2] + fate_text[x+2] = buf[4] + fate_text[x+3] = buf[6] + + fate_effect[x+0] = buf[1] + fate_effect[x+1] = buf[3] + fate_effect[x+2] = buf[5] + fate_effect[x+3] = buf[7] + } + + fs.readFileSync("tools/fatecards.ascii.txt", "utf-8").split("\n").forEach(line => { + line = line.trim() + + if (line[0] === "-") { + flush_card() + num++ + buf = [] + } else if (line.length > 0) { + buf.push(line) + } + }) +} + +parse_fate_cards_raw() + +console.log("const fate_flavor_text = " + JSON.stringify(fate_text, 0, 4)) +console.log("const fate_effect_text = " + JSON.stringify(fate_effect, 0, 4)) |