From 12e70756fab6e3745aa153e7e2a9230e08df278f Mon Sep 17 00:00:00 2001 From: Joe Wreschnig Date: Mon, 25 Aug 2014 17:53:18 +0200 Subject: [PATCH] Event reference. --- allevents.html | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++ heroik.css | 5 +++++ heroik.html | 5 +++-- scenario.html | 2 +- scenarios.js | 40 ++++++++++++++++++++++++++++++------- 5 files changed, 95 insertions(+), 10 deletions(-) create mode 100644 allevents.html diff --git a/allevents.html b/allevents.html new file mode 100644 index 0000000..5fe2664 --- /dev/null +++ b/allevents.html @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + Scenario Events - Hero: Immortal King + + + +
+
+ +

Fate Chart Events

+

Canonical

+ +
+

Non-Canonical

+ +
+
+ + diff --git a/heroik.css b/heroik.css index 6d827ac..d3e9009 100644 --- a/heroik.css +++ b/heroik.css @@ -101,6 +101,11 @@ table { max-width: 25em; } +table.tall td { + padding-top: 0.125em; + padding-bottom: 0.125em; +} + thead { font-size: 0.8em; font-variant: small-caps; diff --git a/heroik.html b/heroik.html index c04ac79..182f0fd 100644 --- a/heroik.html +++ b/heroik.html @@ -61,10 +61,11 @@

Information

-

Rules

+

Reference

+ Variants & Suggestions Special Abilities - Suggestions & Variants + Fate Chart Events

Acknowledgments

diff --git a/scenario.html b/scenario.html index 259aaa4..9d70e63 100644 --- a/scenario.html +++ b/scenario.html @@ -29,7 +29,7 @@ - Hero: Immortal King - +
diff --git a/scenarios.js b/scenarios.js index 315cba8..25baf66 100644 --- a/scenarios.js +++ b/scenarios.js @@ -59,7 +59,7 @@ var EVENTS = [ // Events from Sean Allen's random scenario generator. // http://boardgamegeek.com/filepage/57107/random-scenario-generator { name: "Fire from above.", - effect: "Dragons gains a bonus of +1 Strength.", + effect: "Dragons gain a bonus of +1 Strength.", requires: ["dragons", "noncanonical"], unique: true }, { name: "Bad dreams.", @@ -67,14 +67,14 @@ var EVENTS = [ requires: ["noncanonical"], unique: true }, { name: "Backs against the wall.", - effect: "Any monster with a Tenacity token is also Fierce.", + effect: "Any monster with a Tenacity token is also Fierce.", requires: ["noncanonical"], unique: true }, { name: "Dead end.", action: "Shuffle the remaining corridors together and redistribute the cards as if you were setting up the game.", requires: ["noncanonical"] }, { name: "Surrounded.", - effect: "All monsters have Supremacy.", + effect: "All monsters have Supremacy.", requires: ["noncanonical"], unique: true }, @@ -115,7 +115,7 @@ var EVENTS = [ action: "Randomly discard four of your defeated dungeon cards.", requires: ["noncanonical"] }, { name: "Adamantine armor.", - effect: "All monsters gain Immunity 1.", + effect: "All monsters gain Immunity 1.", requires: ["noncanonical"], unique: true }, { name: "Normative assumptions.", @@ -123,7 +123,7 @@ var EVENTS = [ requires: ["noncanonical"], unique: true }, { name: "Infighting.", - effect: "Greenskins have Undead +1 and Demons -1. Demons have Greenskins +1 and Undead -1. Undead have Greenskins -1 and Demons +1.", + effect: "Greenskins have Undead +1, Demons -1. Demons have Greenskins +1, Undead -1. Undead have Demons +1, Greenskins -1.", requires: ["noncanonical"], unique: true }, ]; @@ -192,13 +192,39 @@ function randomizeName () { var events = []; var style; -window.addEventListener('DOMContentLoaded', function () { + +function generateScenario () { var parts = location.hash.slice(1).split(','); events = generate(parts, parts.shift() | 0, parts.shift() | 0); style = document.createElement("style"); document.head.appendChild(style); randomizeName(); -}); +} + +function getEvents (matcher) { + return EVENTS.filter(matcher); +} + +function wrapRow (row) { + return "" + row + ""; +} + +function iscanonical (event) { + return !isnoncanonical(event); +} +function isnoncanonical (event) { + return ~(event.requires || []).indexOf('noncanonical'); +} + +function canonicalToHTML (sender) { + sender.innerHTML = EVENTS.filter(iscanonical) + .map(toHTML).sort().map(wrapRow).join(''); +} + +function noncanonicalToHTML (sender) { + sender.innerHTML = EVENTS.filter(isnoncanonical) + .map(toHTML).sort().map(wrapRow).join(''); +} function nextEvent (sender) { if (!events.length) { -- 2.20.1