Add auto-generated list of special node types to editor documentation

- Click one to jump directly to the description of that node.
- Back/forward buttons work thanks to history API.
- List is sorted alphabetically.
- This was also done for the page describing item abilities.
This commit is contained in:
2015-07-08 12:32:05 -04:00
parent f435be2125
commit 66a5302515
5 changed files with 70 additions and 16 deletions

View File

@@ -3,7 +3,6 @@
<head>
<title>Special Encounter Examples - BoE Scenario Editor Guide</title>
<link rel="stylesheet" type="text/css" href="../style.css">
</style>
</head>
<body>
<div class="navbar">

View File

@@ -3,6 +3,7 @@
<head>
<title>Item Abilities - BoE Scenario Editor Guide</title>
<link rel="stylesheet" type="text/css" href="../style.css">
<script src='nav.js' type='application/javascript'></script>
</head>
<body>
<div class="navbar">
@@ -72,7 +73,7 @@ and different affects (the first field is usually Ability Strength), and their v
modify the affects of the item abilities in different ways. What each ability does and how
the extra data fields and Magic Item Adjust affect it are described below.</p>
<dl>
<dl class='autolink'>
<dt>Ability 0 - No ability</dt>
<dd>The item has no special ability.</dd>
</dl>
@@ -83,7 +84,7 @@ the extra data fields and Magic Item Adjust affect it are described below.</p>
represents the strength of the ability (0 is weakest, 10 is most powerful). The Magic Item
Adjust field is ignored.</p><!-- TODO: Double-check the expected ranges -->
<dl>
<dl class='autolink'>
<dt>Ability 1 - Damaging Weapon</dt>
<dd>The weapon does extra damage of the type specified in the second extra data field. The
Ability Strength is the number of d6's of extra damage done.</dt>
@@ -145,7 +146,7 @@ Strength. (So, an ability strength of 1 has no effect.)</dd>
from 0 to 10, which represents the strength of the ability (0 is weakest, 10 is most
powerful). The Magic Item Adjust field is ignored.</p>
<dl>
<dl class='autolink'>
<dt>Ability 30 - Protection</dt>
<dd>This partially blocks damage the wielder takes. The type of damage blocked is
specified in the second extra data field. The Ability Strength determines how much damage
@@ -275,7 +276,7 @@ cured of Dumbfounding.</p>
5, and Magic Item Adjust to 3. When someone uses the item, the entire party gets 5 levels
of acid (which means the acid lasts about 5 turns).</p>
<dl>
<dl class='autolink'>
<dt>Ability 70 - Poison Weapon</dt>
<dd>This item is a weapon poison that can be applied to the user's weapon. The Magic Use
Type is ignored, and the Ability Strength is the strength of the poison. When used, the
@@ -376,7 +377,7 @@ Magic Item Adjust and Ability Strength fields are not used (except for Lockpicks
that ability can substitute for. For example, a gem with the ability Smoky Crystal can be
used to cast Mindduel.</p>
<dl>
<dl class='autolink'>
<dt>Ability 150 - Holly/Toadstool</dt>
<dd>Used for Weak Curing, Weak Poison, Clarity</dd>
<dt>Ability 151 - Comfrey Root</dt>

View File

@@ -3,6 +3,7 @@
<head>
<title>Special Encounter Node Types - BoE Scenario Editor Guide</title>
<link rel="stylesheet" type="text/css" href="../style.css">
<script src='nav.js' type='application/javascript'></script>
</head>
<body>
<div class="navbar">
@@ -45,7 +46,7 @@ specifies the next node to be called. If this value is negative, the special enc
ends. There are a few exceptions to this, which are noted in the encounter description.</dd>
</dl>
<dl>
<dl class='autolink'>
<dt>Type 0: No special</dt><dd>This is the default setting for all special nodes. It does
nothing. If the Jump To field contains a non-negative number, the encounter jumps to that
@@ -89,7 +90,6 @@ town.</p>
<dt>Extra 1a:</dt><dd>The number of the shop.</dd>
<dt>Extra 1b:</dt><dd>The item cost adjuster, a number from 0 (very cheap) to 6 (very
expensive). See chapter 11 (Dialogue) for the complete list of cost adjustments.</dd></dd>
</dl>
<dt>Type 5: Display Small Message</dt><dd>A text message is displayed on one (or two)
line(s) of the text area (in the lower right hand corner). Don't make the displayed
@@ -572,7 +572,7 @@ flag for the called node is 250, the special encounter ends and the Jump To fiel
ignored.</dd>
</dl>
<dl>
<dl class='autolink'>
<dt>Type 50: Give Item</dt><dd>An item is given to the party (specifically, to the first
character who can carry it). Gold and food can also be given. If the party cannot carry
@@ -758,7 +758,7 @@ only affects the active PC. Otherwise, it affects the whole party. (Exception to
the Do Damage node type)</dd>
<dt>Jump To:</dt><dd>All of these special node types use this field.</dd>
<dl>
<dl class='autolink'>
<dt>Type 80: Select a Target</dt><dd>Brings up a window asking the player to select a living
character. Once this is called, any Affect nodes during this special encounter only affect
@@ -1090,7 +1090,7 @@ selected in both of these fields, the Jump To special node is called.</p>
special node, either always or as an option. This will be explicitly mentioned where it
applies.</p>
<dl>
<dl class='autolink'>
<dt>Type 130: Stuff Done Flag?</dt><dd>Calls new nodes depending on the value of a given
Stuff Done flag. If the Stuff Done flag is greater than the value of Extra 1a, the special
@@ -1444,7 +1444,7 @@ special encounter, once done, each node calls the Jump To node.</p>
messages. If you don't want a message displayed, just leave these at -1.</dd></dd>
</dl>
<dl>
<dl class='autolink'>
<dt>Type 170: Town Hostile</dt><dd>When called, all friendly people in the town
immediately turn hostile. This node can also be used for other mass attitude changes.
@@ -1831,9 +1831,9 @@ instead subtracted, while 3 or 4 means the y coordinate is instead subtracted.</
creature
is repositioned.</dd></dd>
<dt>Type 204:</dt><dd>This node places a text label on the terrain screen, for example to
indicate someone speaking. The label lasts only until the screen is next updated, but you
can optionally specify a delay to ensure there is time to read it.
<dt>Type 204: Place Label</dt><dd>This node places a text label on the terrain screen, for
example to indicate someone speaking. The label lasts only until the screen is next
updated, but you can optionally specify a delay to ensure there is time to read it.
<dl>
<dt>Mess 1:</dt><dd>The number of the message to display.</dd>
<dt>Extra 1a, Extra 1b:</dt><dd>The X and Y coordinates of the location to place the
@@ -1865,7 +1865,7 @@ is called, as usual. If both are left at -1, no message is displayed.</dd>
<dt>Pict:</dt><dd>If this is 0 (the default), the entire rectangle is affected. If
non-zero, only the outside edges of the rectangle are affected.</dd>
<dl>
<dl class='autolink'>
<dt>Type 210: Place Field/Object/Sfx</dt><dd>Fills the rectangle with some sort of field,
barrier, object, or sfx. This only works in town.
@@ -1934,11 +1934,14 @@ locked terrain type).</dd>
</dl>
<h2 id='outdoor'>Outdoor Mode Specials</h2>
<p>These special nodes only have an effect in outdoor mode. If called anywhere but
outdoors, all of these nodes immediately jump to the Jump To special.</p>
<p>For all of these special types, unless the description specifically says it ends the
special encounter, once done, each node calls the Jump To node.</p>
<dl class='autolink'>
<dt>Type 225: Make Outdoor Wandering</dt><dd>A group of wandering monsters appears (at one
of the designated wandering monster sites).</dd>

View File

@@ -0,0 +1,41 @@
/*
Gathers <dt> elements and builds a list of links to them.
*/
document.addEventListener('DOMContentLoaded', function() {
var elems = document.querySelectorAll('.autolink > dt');
var links = []
for(var i = 0; i < elems.length; i++) {
var li = document.createElement('li');
links.push(li);
var name = elems[i].innerHTML;
name = name.split(/\s*[:-]\s+/);
name = name[1] || name[0]
li.innerHTML = name;
li.addEventListener('click', (function(n) {
return function() {
//var newloc = Object.create(location)
//newloc.search = "jumpto=" + n;
history.pushState(null, null, "?jumpto=" + n);
elems[n].scrollIntoView(true);
};
})(i));
}
links.sort(function(a,b) {
if(a.innerHTML < b.innerHTML)
return -1;
if(a.innerHTML > b.innerHTML)
return 1;
return 0;
});
document.querySelector('.navbar').insertAdjacentHTML('beforeend',"<h2>Jump to:</h2>");
var nav = document.createElement('ul');
nav.classList.add('nav-jump');
for(var i = 0; i < links.length; i++)
nav.appendChild(links[i]);
document.querySelector('.navbar').appendChild(nav);
// Now check if one was requested in the query string
var dest = location.search.match(/^jumpto\=(\d)/, '');
if(dest && dest[1] >= 0 && dest[1] < elems.length)
elems[dest].scrollIntoView();
});

View File

@@ -58,3 +58,13 @@ dd dt {
font-weight: normal;
font-style: italic;
}
.nav-jump {
padding: 0px;
}
.nav-jump > li {
cursor: pointer;
color: green;
text-decoration: underline;
}