Browse Source

Add what's new section

master
Josh Gordon 3 years ago
parent
commit
f1f49ef4fa
  1. 18
      Characters/Gruss.txt
  2. 9
      Items/manite.txt
  3. 11
      Spells/stasis.txt
  4. 16
      app/get_last_n_items.sh
  5. 21
      app/items.py
  6. 10
      app/new_content.txt
  7. 4
      app/routes.py
  8. 4
      app/templates/index.html

18
Characters/Gruss.txt

@ -10,13 +10,13 @@ Str: 7 (-2)
Dex: 20 (16 base, +2 race, +2 increase) (+5)
Con: 13 (12 base, +1 race) (+1)
Int: 8 (-1)
Wis: 12 (+1)
Wis: 14 (12 base, +2 increase) (+2)
Cha: 5 (-3)
HP: 55/83 (11/11d10 hit die)
HP: 88/92 (12/12d10 hit die)
AC: 17 (10 base, +5 dex, +2 armor)
Proficiency: +4
Saves: Wis (+6), Dex (+10), Int (+4)
Saves: Wis (+7), Dex (+10), Int (+4)
Skills: Perception, Nature, Survival
Languages: Common, Halfling, Draconic
@ -33,12 +33,13 @@ Attacks:
One more attack (Stalker's Flurry)
Ranged:
Longbow 1d20+5 hit, 1d8 damage
+2 Oathbow 1d20+7 hit, 1d8+2 damage
Speed: 25
Spells: max [4,3,3]
Known 7: used [2,3,3]
Spells: max [4,3,3] DC = 14
Known 7: used [2,3,2]
1 Hunter's Mark
2 Spike Growth
2 Rope Trick
@ -48,17 +49,18 @@ Known 7: used [2,3,3]
3 Protection From Energy
Inventory:
405 gold
305 gold
Dragonslayer Shortsword
Silvered Scimitar
Studded leather armor
+2 Oathbow
Longbow
Explorer's pack
60 dragonslayer arrows
18 arrows
Potion of Healing x10 (2d4+2 hp)
Alchemist's Fire
Robe of Stars (+1 saving throws, 5/6 5th level magic missiles, regens 1d6 per day)
Ornate Bow made of Ivory and Gold
Robe of Stars (+1 saving throws, 6/6 5th level magic missiles, regens 1d6 per day)
Dragon motif arrows x50
Ring with shield

9
Items/manite.txt

@ -0,0 +1,9 @@
Manite
------
Manite is a blue metal found in very deep mines.
It has the remarkable property that it perfectly conducts magical energy; any spell will go right through it as if it didn't exist.
A manite object is invisible if scried upon, and cannot be seen by any creature relying on magic to see.
It is very soft and malleable, and therefore makes poor weaponry (and exceptionally bad armor).

11
Spells/stasis.txt

@ -0,0 +1,11 @@
Stasis
------
Kind: Abjuration 3
Casting Time: 1 action
Duration: 1 round
Range: 30 feet
Components: V, S
You create a magic barrier around any target within 30ft, including allies and yourself, that prevents the target from taking actions.
While covered by the barrier, the target is immune to damage.

16
app/get_last_n_items.sh

@ -0,0 +1,16 @@
#!/bin/bash
PATTERN="^(Items|Spells|Places|Monsters).*txt"
LIMIT=10
X=0
rm "new_content.txt"
git log --diff-filter=A --stat | while read t; do
if [[ $t =~ $PATTERN ]]; then
echo $t | cut -d' ' -f1 >> "new_content.txt"
echo $t | cut -d' ' -f1
#echo "${BASH_REMATCH[1]}"
((X++))
fi
if [[ "$X" = "$LIMIT" ]]; then
exit 0
fi
done

21
app/items.py

@ -1,4 +1,5 @@
import glob, collections
import os
from monsters import Monster
def parse_headers(spell_text):
@ -70,3 +71,23 @@ def get_monsters():
m = Monster(fname)
monster_list.append(m)
return monster_list
def get_new_items():
os.system("./get_last_n_items.sh")
items_list = []
with open("new_content.txt") as nf:
for fname in nf.read().split("\n")[:-1]:
print("Next item: ../"+fname)
f = open("../"+fname,'r')
lines = f.read().split('\n')
title = lines[0]
lines = lines[1:]
while not (set(lines[0]) - set('-')):
lines = lines[1:]
heads, body = parse_headers('\n'.join(lines))
secs = parse_sections(body)
items_list.append((title,heads,secs))
return items_list

10
app/new_content.txt

@ -0,0 +1,10 @@
Items/ring_of_enlargement_reduction.txt
Items/ring_of_greater_enlargment_reduction.txt
Items/ring_of_the_mastermind.txt
Items/anchored_mithril.txt
Items/firestorm_quartz.txt
Items/lunar_steel.txt
Spells/antidivinity_strike.txt
Items/glass_weapon.txt
Spells/enter_mirror.txt
Spells/flesh_to_glass.txt

4
app/routes.py

@ -2,7 +2,7 @@ import sys
from flask import Flask, render_template, request, redirect
from items import get_items, get_worlds, get_monsters
from items import get_items, get_worlds, get_monsters, get_new_items
from dungeon import genGridDungeonB64
@ -30,7 +30,7 @@ def index():
featureType = choice(["Item","Place","Spell"])
item = choice(get_items("../"+featureType+"s/*"))
links = [("marches","West Marches"),("dungeon","Dungeon Generator"),("about","About")]
return render_template('index.html',featureType=featureType,featureText=item,links=links)
return render_template('index.html',featureType=featureType,featureText=item,links=links,new=get_new_items())
@app.route('/search', methods=['POST'])

4
app/templates/index.html

@ -39,4 +39,8 @@
{{ macros.itemTable([featureText]) }}
</section>
{% endif %}
<section>
<h2>What's New</h2>
{{macros.itemTable(new)}}
</section>
{% endblock %}
Loading…
Cancel
Save