Browse Source

Remove surges

master
Josh Gordon 3 years ago
parent
commit
6394e58646
  1. 13
      app/routes.py
  2. 6
      app/surges.txt
  3. 20
      app/templates/surges.html

13
app/routes.py

@ -229,19 +229,6 @@ def interproll():
price = lower*(1-0.01*roll) + upper*(0.01*roll)
return render_template('interp.html',price=price,roll=roll)
@app.route("/surges")
def surges():
with open("surges.txt") as f:
lines = f.readlines()
surges = list(zip(map(lambda t: t+1,range(len(lines))),lines))
return render_template('surges.html',surges=surges)
@app.route("/surges/random")
def random_surge():
with open("surges.txt") as f:
lines = f.readlines()
s = choice(lines)
return render_template('surges.html',surges=[(0,s)])
if __name__ == "__main__":

6
app/surges.txt

@ -1,6 +0,0 @@
Your hair doubles in length
You shed dim light out to 20ft for the next week
Flowers grow where you walk
You learn how to speak infernal
A random item from D&D archive appears in your hand
The world's climate changes by +4 degrees celsius

20
app/templates/surges.html

@ -1,20 +0,0 @@
{% extends "base.html" %}
{% block content %}
<h2>Magic Surge Effects</h2>
<ul class="headlist special">
<li><a href="/surges/random">Random</a></li>
</ul>
<table>
{% for (index,surge) in surges %}
<tr>
<th class="topalign">
{{index}}
</th>
<td class="monospace">
{{surge}}
</td>
</tr>
{% endfor %}
</table>
<a class="topLink" href="#">Scroll to Top</a>
{% endblock %}
Loading…
Cancel
Save