Event reference.
authorJoe Wreschnig <joe.wreschnig@gmail.com>
Mon, 25 Aug 2014 15:53:18 +0000 (17:53 +0200)
committerJoe Wreschnig <joe.wreschnig@gmail.com>
Mon, 25 Aug 2014 15:53:18 +0000 (17:53 +0200)
allevents.html [new file with mode: 0644]
heroik.css
heroik.html
scenario.html
scenarios.js

diff --git a/allevents.html b/allevents.html
new file mode 100644 (file)
index 0000000..5fe2664
--- /dev/null
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<html manifest=heroik.appcache>
+  <!--
+  The person who associated a work with this deed has dedicated the work
+  to the public domain by waiving all of his or her rights to the work
+  worldwide under copyright law, including all related and neighboring
+  rights, to the extent allowed by law.
+
+  You can copy, modify, distribute and perform the work, even for
+  commercial purposes, all without asking permission.
+
+  See https://creativecommons.org/publicdomain/zero/1.0/ for details.
+  -->
+  <head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
+    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
+    <meta name="apple-mobile-web-app-capable" content="yes">
+    <meta name="apple-mobile-web-app-title" content="Hero: IK">
+    <meta name="mobile-web-app-capable" content="yes">
+    <link rel="apple-touch-icon" href="favicon_192.png">
+    <link rel=icon type="image/png" sizes="32x32" href="favicon_32.png">
+    <link rel=icon type="image/png" sizes="192x192" href="favicon_192.png">
+    <link rel=icon type="image/png" sizes="256x256" href="favicon_256.png">
+    <link rel=stylesheet href="heroik.css" type="text/css">
+    <script src="fastclick.js" type="text/javascript"></script>
+    <script src="heroik.js" type="text/javascript"></script>
+    <script src="names.js" type="text/javascript"></script>
+    <script src="scenarios.js" type="text/javascript"></script>
+    <title>Scenario Events - Hero: Immortal King</title>
+  </head>
+  <body onload="
+        canonicalToHTML(document.getElementById('canonical'));
+        noncanonicalToHTML(document.getElementById('noncanonical'))">
+                               
+    <div id=statusbar></div>
+    <main>
+    <div style="height: 3em" class="no-print">
+      <a class=button style="float: left; text-align: left"
+         href="heroik.html">
+        ◄ Finished!
+      </a>
+    </div>
+    <h1>Fate Chart Events</h1>
+    <h2>Canonical</h2>
+    <table id=canonical class=tall>
+    </table>
+    <h2 style="margin-top: 1em">Non-Canonical</h2>
+    <table id=noncanonical class=tall>
+    </table>
+    </main>
+  </body>
+</html>
index 6d827ac..d3e9009 100644 (file)
@@ -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;
index c04ac79..182f0fd 100644 (file)
 
     <h1>Information</h1>
 
-    <h2>Rules</h2>
+    <h2>Reference</h2>
     <div>
+      <a class="big button" href="variants.html">Variants &amp; Suggestions</a>
       <a class="big button" href="abilities.html">Special Abilities</a>
-      <a class="big button" href="variants.html">Suggestions &amp; Variants</a>
+      <a class="big button" href="allevents.html">Fate Chart Events</a>
     </div>
     <h2>Acknowledgments</h2>
     <div style="font-size: 0.9em">
index 259aaa4..9d70e63 100644 (file)
@@ -29,7 +29,7 @@
     <script src="scenarios.js" type="text/javascript"></script>
     <title>- Hero: Immortal King</title>
   </head>
-  <body>
+  <body onload="generateScenario()">
     <div id=statusbar></div>
     <main>
     <div style="height: 3em" class="no-print">
index 315cba8..25baf66 100644 (file)
@@ -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 <strong>Fierce</strong>.",
       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 <strong>Supremacy</strong>.",
       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&nbsp;1.",
+      effect: "All monsters gain <strong>Immunity&nbsp;1</strong>.",
       requires: ["noncanonical"],
       unique: true },
     { name: "Normative assumptions.",
@@ -123,7 +123,7 @@ var EVENTS = [
       requires: ["noncanonical"],
       unique: true },
     { name: "Infighting.",
-      effect: "Greenskins have <strong>Undead +1</strong> and <strong>Demons -1</strong>. Demons have <strong>Greenskins +1</strong> and <strong>Undead -1</strong>. Undead have <strong>Greenskins -1</strong> and <strong>Demons +1</strong>.",
+      effect: "Greenskins have <strong>Undead&nbsp;+1</strong>, <strong>Demons&nbsp;-1</strong>. Demons have <strong>Greenskins&nbsp;+1</strong>, <strong>Undead&nbsp;-1</strong>. Undead have <strong>Demons&nbsp;+1</strong>, <strong>Greenskins&nbsp;-1</strong>.",
       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 "<tr><td>" + row + "</td></tr>";
+}
+
+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) {