Browse Source

Make item/spell code generic

Includes:
- Adding support for arbitrary headers in any order (order is preserved
  in rendering right now)
- Adding headers on anything that can be rendered

This significantly reduces handling code from the "fixed five for
spells" case.

The magic items of Konis are so updated, partly to test.
marches
Graham Northup 3 years ago
parent
commit
f43eff739b
Signed by untrusted user: grissess GPG Key ID: 5D000E6F539376FB
  1. 3
      Items/antimagic_artifact.txt
  2. 3
      Items/box_of_duplication.txt
  3. 3
      Items/bracers_of_dabbing.txt
  4. 3
      Items/chronomancers_ring.txt
  5. 3
      Items/diplomancers_ring.txt
  6. 3
      Items/divine_wand.txt
  7. 3
      Items/evertangling_rope.txt
  8. 3
      Items/flask_of_smells.txt
  9. 3
      Items/greater_box_of_duplication.txt
  10. 3
      Items/greater_chronomancers_ring.txt
  11. 3
      Items/leaded_restraint.txt
  12. 3
      Items/necromancers_ring.txt
  13. 3
      Items/orb_of_magic_concentration.txt
  14. 3
      Items/potion.txt
  15. 3
      Items/ring_of_greater_ring.txt
  16. 3
      Items/ring_of_greater_stamina.txt
  17. 3
      Items/ring_of_greater_true_sight.txt
  18. 3
      Items/ring_of_greatest_ring.txt
  19. 3
      Items/ring_of_lesser_ring.txt
  20. 3
      Items/ring_of_magic_detection.txt
  21. 3
      Items/ring_of_ring.txt
  22. 3
      Items/ring_of_stamina.txt
  23. 3
      Items/ring_of_true_sight.txt
  24. 3
      Items/ring_of_vorpal.txt
  25. 3
      Items/scrying_artifact.txt
  26. 3
      Items/staff_of_greater_telekinesis.txt
  27. 3
      Items/staff_of_greater_teleportation.txt
  28. 3
      Items/staff_of_telekinesis.txt
  29. 3
      Items/staff_of_teleportation.txt
  30. 3
      Items/story_stone.txt
  31. 3
      Items/sword_of_pay_to_win.txt
  32. 3
      Items/talking_stone.txt
  33. 3
      Items/teleport_artifact.txt
  34. 3
      Items/wand_of_deletion.txt
  35. 41
      app/items.py
  36. 19
      app/routes.py
  37. 37
      app/templates/index.html
  38. 33
      app/templates/listing.html

3
Items/antimagic_artifact.txt

@ -1,6 +1,9 @@
Antimagic Artifact
------------------
Rarity: Very Rare
Aura: Abjuration (Strong)
These artifacts take many forms; they may be mundane stones, precious gems, orbs, jewelry (including rings, bracelets, necklaces, etc.).
Within 10' of each such item, the magic weave is evacuated, as with Antimagic Field. Curiously, the field does not affect these items, nor does an Antimagic Field (via either the normal spell or another item) affect each other. Unable to "pull" at the weave, casters inside the field cannot cast spells unless they can reach the border. Other effects are as usual, per the Antimagic Field spell.

3
Items/box_of_duplication.txt

@ -1,6 +1,9 @@
Box of Duplication
------------------
Rarity: Legendary+
Aura: Generic (Strong)
The "box" may take the form of a chest, wardrobe, jeweler's box, etc.; importantly, the closure must have ample inside space and a closing lid, and be opaque.
When the box is opened, if it was previously empty, it remains empty; if a single non-magical item was placed in it when it was last closed, the box is filled to capacity with exact clones of that item; if the box had a single magic item in it when it was last closed, and that magic item is based on a mundane, non-magical item (an unenchanted sword, a regular ring, a normal scroll with writing), the box is filled with clones of the mundane item. The original item is also present, but jumbled randomly within the box, and it is hard to locate amongst its clones (without aid--e.g., Detect Magic for magical items).

3
Items/bracers_of_dabbing.txt

@ -1,6 +1,9 @@
Bracers of Dabbing
------------------
Rarity: Legendary+
Aura: Evocation (Strong)
These bracers fit comfortably around the arms of the creature for which they were sized--most tend to fit Medium sized creatures, but Small and Large ones can be found, albeit less frequently. They appear a brilliant, shiny gold, and never tend to become dirty.
While worn, when dabbing on a target creature within 15': that creature takes 1d10 force damage, 1d6 psychic damage, and, if your size or smaller, makes a DEX save, DC 15; on fail: the creature is pushed 5' back and knocked prone. This effect is accompanied by a sharp gust of wind in a 15' long, 5' wide line in the same direction, which may knock over or move loose items 5lb or less in weight.

3
Items/chronomancers_ring.txt

@ -1,6 +1,9 @@
Chronomancer's Ring
--------------------
Rarity: Very Rare
Aura: Transmutation (Strong)
This ring appears to be a nondescript precious metal band; often, it is sized for the largest finger of a medium humanoid creature, which may fit it to the smallest finger of a large humanoid creature, or on the thick thumbs of a small humanoid creature.
The ring must be worn to have effect. The wearing creature perceives time as going 3 time slower than usual; however, they are unable to move their body faster, feeling as if they are moving through water. Nonetheless, the creature can perceive faster, which grants:

3
Items/diplomancers_ring.txt

@ -1,6 +1,9 @@
Diplomancer's Ring
------------------
Rarity: Very Rare
Aura: Enchantment (Strong)
This ring appears to be an ornate precious metal ring with numerous large inset gems; often, it is sized for the largest finger of a medium humanoid creature, which may fit it to the smallest finger of a large humanoid creature, or on the thick thumbs of a small humanoid creature. The ring is extravagant enough to be noticeable from afar, if unobscured; creatures prone to greed or thievery may find themselves envious.
The wearer is granted a silver tongue, the visage of a pleasant appearance to all aesthetically-inclined creatures, and an unmatched eloquency.

3
Items/divine_wand.txt

@ -1,6 +1,9 @@
Divine Wand
-----------
Rarity: Unique
Aura: Generic (Strong)
This item may vary in appearance, taking the form of a walking stick, large twig, or even a truly ornate polished wand.
This item is attunable; the only prerequisite is being able to cast at least one spell of any kind, including as a feat. Attunement may be achieved by a meditative spell during a short rest. If left in contact with an unattuned creature during a long rest consisting of nonmagical sleep, that creature may have a bizarre dream or nightmare related to it, and in doing so become attuned.

3
Items/evertangling_rope.txt

@ -1,6 +1,9 @@
Evertangling Rope
-----------------
Rarity: Common
Aura: Transmutation
The item appears to be a normal rope.
When the rope is withdrawn from an opaque container, however, it is always horrendously tangled into a ball; it takes 1d4 times the length of the rope divided by 10' rounds to untangle into a pleasant coil.

3
Items/flask_of_smells.txt

@ -1,6 +1,9 @@
Flask of Smells
---------------
Rarity: Uncommon
Aura: Enchantment (Faint)
This item appears to be a small, opaque flask, about the size of a small potion or flask of Alchemist's Fire.
Whenever the flask is open, and a creature with a sense of smell insufflates from its mouth: roll on a table for the scent it emits at that moment. The DM chooses this table on the item's creation.

3
Items/greater_box_of_duplication.txt

@ -1,6 +1,9 @@
Greater Box of Duplication
--------------------------
Rarity: Legendary+
Aura: Generic (Strong)
This item is the same as the Box of Duplication, with the following exceptions.
This box is capable of cloning almost any non-sentient object which can fit entirely within it, including rare magic items. The cloning of a magic item is not without risk, however; at the DM's discretion, roll a d20 when opening a box after having inserted a single magical item; if 1, 2d6 magic surges centered on the box occur (with no particular caster nor target), the item is not found to be duplicated, and the box's duplication effect is defeated for 1d12 hours.

3
Items/greater_chronomancers_ring.txt

@ -1,6 +1,9 @@
Greater Chronomancer's Ring
---------------------------
Rarity: Legendary
Aura: Transmutation (Strong)
This item is the same as the Chronomancer's Ring, with the following exceptions.
While wearing the ring, a creature can move their body at the same speed they would while not wearing the ring, but while the world moves 3 times as slow around them. In addition the the Chronomancer's Ring effects, this further grants them:

3
Items/leaded_restraint.txt

@ -1,6 +1,9 @@
Leaded Restraint
----------------
Rarity: Uncommon (usually)
Aura: Undetectable, even if magical
This is a template for various restraints where lead has been added as an integral component, a plating, or substantial layer of some kind.
Lead has an ability to block the effects of many spells, including but not limited to divination. A leaded restraint appears nonmagical, even if it is, and has no aura via Detect Magic.

3
Items/necromancers_ring.txt

@ -1,6 +1,9 @@
Necromancer's Ring
------------------
Rarity: Legendary
Aura: Necromancy (Strong)
This ring appears to be a nondescript precious metal band; often, it is sized for the largest finger of a medium humanoid creature, which may fit it to the smallest finger of a large humanoid creature, or on the thick thumbs of a small humanoid creature.
When applied to the digits of a living creature, nothing immediately happens (but see below). However, when applied to the digits of a deceased creature, as long as such a recognizeable digit is available, that creature is resurrected, as if by the Resurrection spell. The DM decides how to restore missing body parts--closer ones may move together and merge, while irrecoverable ones may be regrown, for example.

3
Items/orb_of_magic_concentration.txt

@ -1,6 +1,9 @@
Orb of Magic Concentration
--------------------------
Rarity: Legendary
Aura: Generic (Strong)
This palm-sized blue orb appears to be a crystal ball, but emits a blue glow, and tingles in the grasp of or contact with any creature that holds or touches it, regardless of size or scale, as long as that creature can feel.
This powerfully-magic orb attracts the magic weave as if by a magnet, granting its holder incredible power to manipulate it to their will. For the touching creature: all positive (conducive) quantities (such as damage, bonuses, saving DCs, durations, ranges, etc.) for a cast have their effect multiplied by 6 within their full range, and all negative (counterconducive) quantities (such as cooldowns, delays, penalties, etc.) divided by 6. For each range increment (of the full range of the original spell), the factor/quotient decreases by 1, up to a maximum of 5 increments (granting 6 times the range to the spell with "normal" effect at the fringe). A range of "Self" or "Touch" implies an increment of 0 (there is no range increase). This effect is unconditional, not "at will", for any creature touching the orb.

3
Items/potion.txt

@ -1,6 +1,9 @@
Potion
------
Rarity: Depends on spell level
Aura: Depends on spell school
These potions can convert any spell into a ranged attack, or magic item consumable. Spells which target a point in range (such as a conjuration) or at least a single object or creature can be prepared this way. When made into a potion, such spells cannot target more than one creature--if targeting more than one is mandatory, the potion creation fails. (Spells which create areas-of-effect work as expected.)
To use targeting a creature, for the attack action: make a ranged attack roll, 20' normal, 60' long. If you succeed, instead of damage, apply the effects of the spell contained within the potion. If the spell is concentration, you must begin concentrating on it from this point forward for effect; if you can't, no effect occurs. Interruption of concentration from this point on is handled the usual way.

3
Items/ring_of_greater_ring.txt

@ -1,6 +1,9 @@
Ring of Greater Ring
--------------------
Rarity: Legendary+
Aura: Enchantment (Very Strong)
This ring appears to be a nondescript precious metal band; often, it is sized for the largest finger of a medium humanoid creature, which may fit it to the smallest finger of a large humanoid creature, or on the thick thumbs of a small humanoid creature.
When equipped: the wearer equips as many rings as were equipped previously, plus one. This counter starts at 1 per ring.

3
Items/ring_of_greater_stamina.txt

@ -1,6 +1,9 @@
Ring of Greater Stamina
-----------------------
Rarity: Legendary
Aura: Enchantment (strong)
This item is the same as the Ring of Stamina, with the following exceptions.
When worn: all limits or capacities of effects which have a limited number of uses before a rest of any kind (such as spell slots, bardic inspiration, channel divinity, the lucky feat, etc.) have their capacity tripled, in addition to possibly not expending them on use (see the Ring of Stamina). Additionally, the wearer can go any amount of time before rests without accruing levels of exhaustion (they must still eat and drink normally), though a rest of some kind is still required to restore said effects or reduce levels of exhaustion acquired through other means, as usual. The wearer has advantage on any saving throw against an effect which would cause them to sleep, or become fatigued or exhausted.

3
Items/ring_of_greater_true_sight.txt

@ -1,6 +1,9 @@
Ring of Greater True Sight
--------------------------
Rarity: Legendary
Aura: Divination (Strong)
This item is the same as the Ring of True Sight, with the following exceptions:
The range of truesight is unlimited. The wearer's vision may be obscured by opaque objects, but it can see into all non-occluded darkness, and witness indefinitely into the ethereal plane, so long as nothing impedes line of sight.

3
Items/ring_of_greatest_ring.txt

@ -1,6 +1,9 @@
Ring of Greatest Ring
---------------------
Rarity: Legendary+
Aura: Bullshit (Very Strong)
This ring appears to be a nondescript precious metal band; often, it is sized for the largest finger of a medium humanoid creature, which may fit it to the smallest finger of a large humanoid creature, or on the thick thumbs of a small humanoid creature.
When equipped: the wearer equips as many rings as are presently equipped.

3
Items/ring_of_lesser_ring.txt

@ -1,6 +1,9 @@
Ring of Lesser Ring
-------------------
Rarity: Legendary+
Aura: Enchantment
This ring appears to be a nondescript precious metal band; often, it is sized for the largest finger of a medium humanoid creature, which may fit it to the smallest finger of a large humanoid creature, or on the thick thumbs of a small humanoid creature.
When equipped: the ring is unequipped.

3
Items/ring_of_magic_detection.txt

@ -1,6 +1,9 @@
Ring of Magic Detection
-----------------------
Rarity: Rare
Aura: Divination
This ring appears to be a nondescript precious metal band; often, it is sized for the largest finger of a medium humanoid creature, which may fit it to the smallest finger of a large humanoid creature, or on the thick thumbs of a small humanoid creature.
While worn, the wearer can see a glow around magic auras, and learns the school of magic, if any, except where obscured, as with Detect Magic. Maintaining the spell requires no concentration.

3
Items/ring_of_ring.txt

@ -1,6 +1,9 @@
Ring of Ring
------------
Rarity: Legendary+
Aura: Enchantment (Strong)
This ring appears to be a nondescript precious metal band; often, it is sized for the largest finger of a medium humanoid creature, which may fit it to the smallest finger of a large humanoid creature, or on the thick thumbs of a small humanoid creature.
When equipped: the wearer equips 1 additional Ring of Ring.

3
Items/ring_of_stamina.txt

@ -1,6 +1,9 @@
Ring of Stamina
---------------
Rarity: Rare
Aura: Enchantment (Strong)
This ring appears to be a nondescript precious metal band; often, it is sized for the largest finger of a medium humanoid creature, which may fit it to the smallest finger of a large humanoid creature, or on the thick thumbs of a small humanoid creature.
The wearer feels more rejuvenated and vivacious than usual.

3
Items/ring_of_true_sight.txt

@ -1,6 +1,9 @@
Ring of True Sight
------------------
Rarity: Very Rare
Aura: Divination (Strong)
This ring appears to be a nondescript precious metal band; often, it is sized for the largest finger of a medium humanoid creature, which may fit it to the smallest finger of a large humanoid creature, or on the thick thumbs of a small humanoid creature.
When worn: the wearer has truesight out to 120 feet. [That creature can see into darkness, natural and magical, automatically discern illusions, perceive the original form of a shapeshifter, see invisibility, and perceive into the ethereal plane within the specified range.] This effect occurs regardless of whether or not the wearer has the appropriate, functional sensory organs.

3
Items/ring_of_vorpal.txt

@ -1,6 +1,9 @@
Ring of Vorpal
--------------
Rarity: Legendary+
Aura: Enchantment (Strong)
This ring appears to be a nondescript precious metal band; often, it is sized for the largest finger of a medium humanoid creature, which may fit it to the smallest finger of a large humanoid creature, or on the thick thumbs of a small humanoid creature.
When worn: at will, the wearer can designate any bladed weapon to gain the magical "vorpal" effect once per turn, and become a magic weapon if it isn't already. [The "vorpal" effect causes the weapon to become magic if it isn't already with +3 to hit, and decapitate a hit creature on a critical hit, generally causing instant death--or, at the DM's discretion, 6d8 unblockable slashing damage if the blade is poorly situated to perform decapitation.]

3
Items/scrying_artifact.txt

@ -1,6 +1,9 @@
Scrying Artifact
----------------
Rarity: Very Rare
Aura: Divination (Perception DC 30 in normal light, or DC 25 in dim or dark light)
These artifacts take many forms; they may be mundane stones, precious gems, orbs, jewelry (including rings, bracelets, necklaces, etc.).
The item must be attuned, which can occur with a meditation with the item, or intense study of its properties. When it attunes to a creature, any other creature it may have been attuned to is no longer attuned. If the previously attuned creature was scrying through this artifact, that spell is immediately cancelled.

3
Items/staff_of_greater_telekinesis.txt

@ -1,6 +1,9 @@
Staff of Greater Telekinesis
----------------------------
Rarity: Legendary
Aura: Transmutation (Strong)
This item is the same as the Staff of Telekinesis, with the following exception.
When casting Telekinesis using this staff, it doesn't count as a concentration spell, and you can have up to five objects or creatures affected simultaneously. When you stop focusing on moving an object or creature, it remains in place until you cancel the effect or move out of range. If the object or creature changes weight (not mass--this includes effects that alter gravity), and the new weight is greater than the Telekinesis limit of the caster, that cast ends.

3
Items/staff_of_greater_teleportation.txt

@ -1,6 +1,9 @@
Staff of Greater Teleportation
------------------------------
Rarity: Legendary
Aura: Conjuration (Strong)
This item is the same as the Staff of Teleportation, with the following exceptions.
When casting Teleport using the ability of this staff: if a mishap would occur, the spell simply fails instead. If the result would be off-target, it is instead on-target. Similar location results still occur.

3
Items/staff_of_telekinesis.txt

@ -1,6 +1,9 @@
Staff of Telekinesis
--------------------
Rarity: Very Rare
Aura: Transmutation (Strong)
This item appears to be a staff, often knotted and gnarly, about the size of a walking stick for a medium creature. It is a bit small for a large creature, and a tad cumbersome for a small creature.
The holder of the staff can use the Telekinesis spell at will, without expending a spell slot and without a verbal component (a somatic component to gesture with the staff is still required).

3
Items/staff_of_teleportation.txt

@ -1,6 +1,9 @@
Staff of Teleportation
----------------------
Rarity: Very Rare
Aura: Conjuration (Strong)
This item appears to be a staff, often knotted and gnarly, about the size of a walking stick for a medium creature. It is a bit small for a large creature, and a tad cumbersome for a small creature.
The holder of the staff can use Teleport at will, without expending a spell slot, and without a verbal component (but with a somatic component to gesture with the staff).

3
Items/story_stone.txt

@ -1,6 +1,9 @@
Story Stone
-----------
Rarity: Unique
Aura: Divination (Strong)
This unique artifact has the visage of a stone, but may be either rough or polished, or even a gemstone. It may be bracketed and worn as a pendant, or as a setting on other jewelry, but its typical size (about palm-sized) precludes this use.
While held, or worn if in a setting: once per day, as a full round action, the holder can automatically pass a History check, as if by critical success. On doing so, that creature may perceive, with all of its senses, important or related events which answer or explain the check, usually in some form of narrative, and in an ethereal or dreamlike manner. (The DM is at liberty to be as detailed or terse as they see fit, so long as the depictions are accurate, relevant, and faithful to the purpose of the check.) While doing so, unless the holder has blindsight or truesight, it can no longer sense its own surroundings. Regardless of the perceived length, the duration is still one round.

3
Items/sword_of_pay_to_win.txt

@ -1,6 +1,9 @@
Sword of Pay to Win
-------------------
Rarity: Common
Aura: Conjuration (Faint) and Divination (Faint) on hilt only
This item appears to be a standard steel longsword, but it has a slot in the hilt, large enough to fit all common denominations of currency.
The base damage of the sword is 1d4. However, if a coin is inserted, for the next hour, the damage changes according to the denomination of the coin:

3
Items/talking_stone.txt

@ -1,6 +1,9 @@
Talking Stone
-------------
Rarity: Uncommon
Aura: Illusion
These artifacts usually take the form of palm-sized stones or other mineral materials of a similar size. Not all such stones can accept this spell, but more precious gemstones tend to work more reliably.
A creature holding the stone which knows at least one language can, as a free action: speak to the stone, or clear the message.

3
Items/teleport_artifact.txt

@ -1,6 +1,9 @@
Teleport Artifact
-----------------
Rarity: Very Rare
Aura: Conjuration (Strong) but, if combined into a Scrying Artifact, becomes as faint as the latter's Divination aura
These artifacts take many forms; they may be mundane stones, precious gems, orbs, jewelry (including rings, bracelets, necklaces, etc.).
As an action, the creator of this artifact can summon it back to a location within 60' that they can see. As with Teleport, up to 8 creatures within 10' of the artifact (including whichever may be carrying it) may also teleport, either if they are willing, or fail a WIS save against the spellcaster's spell DC. This can only be done once: when this effect is used, the enchantment from the artifact is lifted, and it becomes a mundane item again (or merely a Scrying Artifact if it is a combined artifact; see below).

3
Items/wand_of_deletion.txt

@ -1,6 +1,9 @@
Wand of Deletion
----------------
Rarity: Legendary+
Aura: Abjuration (Strong)
"delet this" - Anonymous ancient scholar
This item may vary in appearance, taking the form of a walking stick, large twig, or even a truly ornate polished wand.

41
app/items.py

@ -1,22 +1,23 @@
import glob
def spell_parse(spell_text):
def parse_headers(spell_text):
"""Takes in the 'tail' part of a spell file"""
lines = spell_text.split("\n")
while len(lines[0].strip()) == 0:
lines = lines[1:]
kind = lines[0].partition(':')
time = lines[1].partition(':')
rang = lines[2].partition(':')
comp = lines[3].partition(':')
dura = lines[4].partition(':')
return kind,time,rang,comp,dura,'\n'.join(lines[5:])
heads = []
while lines:
hd, col, val = lines[0].partition(':')
if not col:
return heads,'\n'.join(lines)
heads.append((hd.strip(), val.strip()))
lines = lines[1:]
return heads, '\n'.join(lines) # Should be empty, but :shrug:
def test_spell_parse():
f = open("../Spells/deceptive_sending.txt",'r')
text = '\n'.join(f.read().split("\n")[2:])
print(spell_parse(text))
print(parse_headers(text))
def get_items(items_dir):
items_list = []
@ -24,23 +25,13 @@ def get_items(items_dir):
f = open(fname,'r')
lines = f.read().split('\n')
header = lines[0]
tail = '\n'.join(lines[2:])
items_list.append((header,tail))
items_list.sort(key=lambda pair: pair[0])
return items_list
def get_spells():
items_list = []
for fname in glob.glob("../Spells/*"):
f = open(fname,'r')
lines = f.read().split('\n')
header = lines[0]
kind,time,rang,comp,dura,tail = spell_parse('\n'.join(lines[2:]))
title = lines[0]
lines = lines[1:]
while not (set(lines[0]) - set('-')):
lines = lines[1:]
heads, body= parse_headers('\n'.join(lines))
items_list.append((header,(kind,time,rang,comp,dura),tail))
items_list.append((title,heads,body))
items_list.sort(key = lambda data: data[0])
return items_list

19
app/routes.py

@ -1,11 +1,8 @@
import sys
from flask import Flask
from flask import render_template
from flask import request
from flask import Flask, render_template, request
from items import get_items
from items import get_spells
from random import choice
@ -23,29 +20,25 @@ def style():
@app.route('/')
def index():
featureType = choice(["Item","Place","Spell"])
item = None
if(featureType == "Spell"):
item = choice(get_spells())
else:
item = choice(get_items("../"+featureType+"s/*"))
item = choice(get_items("../"+featureType+"s/*"))
return render_template('index.html',featureType=featureType,featureText=item)
@app.route('/items')
def items():
return render_template('items.html',title="Items",items=get_items("../Items/*"))
return render_template('listing.html',title="Items",items=get_items("../Items/*"))
@app.route('/places')
def places():
return render_template('items.html',title="Places",items=get_items("../Places/*"))
return render_template('listing.html',title="Places",items=get_items("../Places/*"))
@app.route('/characters')
def characters():
return render_template('items.html',title="Characters",items=get_items("../Characters/*"))
return render_template('listing.html',title="Characters",items=get_items("../Characters/*"))
@app.route('/spells')
def spells():
return render_template('spells.html',title="spells",spells=get_spells())
return render_template('listing.html',title="spells",spells=get_items("../Spells/*"))
if __name__ == "__main__":
app.run()

37
app/templates/index.html

@ -17,30 +17,19 @@
</nav>
<section>
<h2>Featured {{featureType}}:</h2>
{% if featureType == "Spell" %}
<table>
<tr>
<th class="topalign">
{{featureText[0]}}
<table class="props">
<tr><th> {{featureText[1][0][0]}}</th><td> {{featureText[1][0][2]}}</td>
<tr><th> {{featureText[1][1][0]}}</th><td> {{featureText[1][1][2]}}</td>
<tr><th> {{featureText[1][2][0]}}</th><td> {{featureText[1][2][2]}}</td>
<tr><th> {{featureText[1][3][0]}}</th><td> {{featureText[1][3][2]}}</td>
<tr><th> {{featureText[1][4][0]}}</th><td> {{featureText[1][4][2]}}</td>
</table>
</th>
<td class="freeform monospace"> {{featureText[2]}}</td>
</tr>
</table>
{% else %}
<table>
<tr>
<th class="topalign">{{featureText[0]}}</th>
<td class="freeform monospace">{{featureText[1]}}</td>
</tr>
</table>
{% endif %}
<table>
<tr>
<th class="topalign" id="{{name}}">
{{featureText[0]}}
<table class="props">
{% for (key, value) in featureText[1] %}
<tr><th> {{key}} </th><td> {{value}} </td></tr>
{% endfor %}
</table>
</th>
<td class="freeform monospace"> {{featureText[2]}} </td>
</tr>
</table>
</section>
</body>
</html>

33
app/templates/listing.html

@ -0,0 +1,33 @@
<html>
<head>
<meta charset='utf-8'>
<link rel="stylesheet" type="text/css" href="style.css">
<link href="https://fonts.googleapis.com/css?family=IBM+Plex+Mono|IBM+Plex+Sans|IBM+Plex+Sans+Condensed" rel="stylesheet">
<title>{{ title }} - COSI D&D Archive</title>
</head>
<body class="content">
<h1><a href="/">COSI D&D Archive</a></h1>
<h2>{{title}}</h2>
<ul class="headlist">
{% for (name,_,_) in items %}
<li><a href="#{{name}}"> {{name}} </a> {% if not loop.last %} &middot; {% endif %} </li>
{% endfor %}
</ul>
<table>
{% for (name,heads,text) in items %}
<tr>
<th class="topalign" id="{{name}}">
{{name}}
<table class="props">
{% for (key, value) in heads %}
<tr><th> {{key}} </th><td> {{value}} </td></tr>
{% endfor %}
</table>
</th>
<td class="freeform monospace"> {{text}} </td>
</tr>
{% endfor %}
</table>
<a class="topLink" href="#">Scroll to Top</a>
</body>
</html>
Loading…
Cancel
Save