Add rolltable support, fix regions
This commit is contained in:
parent
9e960cb251
commit
24a36e3096
BIN
deadsands/content/images/blooming_wastes1.jpg
Normal file
BIN
deadsands/content/images/blooming_wastes1.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.4 MiB |
|
@ -12,40 +12,51 @@ region:
|
|||
terrain: difficult
|
||||
description: |
|
||||
The Blooming Wastes stretch out before you: a mostly flat expanse of hard, cracked earth blanketed by some kind of sandy brown scrub. Small mesas dot the horizon, suggesting the possibility of shelter. As you approach you see that the scrub is covered in thick black thorns sharp enough to pierce boot leather; you will need to tread carefully.
|
||||
travel:
|
||||
dc: 10
|
||||
forage:
|
||||
dc: 10
|
||||
resources: redfoot, moon blossom (night only)
|
||||
track:
|
||||
dc: 13
|
||||
resources: shelter, water
|
||||
evade:
|
||||
dc: 2
|
||||
survey:
|
||||
dc: 13
|
||||
skills:
|
||||
travel:
|
||||
DC: 10
|
||||
Notes:
|
||||
forage:
|
||||
DC: 10
|
||||
Notes: redfoot, moon blossom (night only)
|
||||
track:
|
||||
DC: 13
|
||||
Notes: shelter, water
|
||||
evade:
|
||||
DC: 2
|
||||
Notes:
|
||||
survey:
|
||||
DC: 13
|
||||
Notes:
|
||||
cr: 4
|
||||
encounters:
|
||||
d1-d4: Easy
|
||||
d5: Dangerous
|
||||
d6: Deadly
|
||||
d7-d20: None
|
||||
d1-d4:
|
||||
Difficulty: Easy
|
||||
d5:
|
||||
Difficulty: Dangerous
|
||||
d6:
|
||||
Difficulty: Deadly
|
||||
d7-d20:
|
||||
Difficulty: No Encounter
|
||||
regional_effects:
|
||||
d1: Add 1d6 to radiant damage
|
||||
d2: Nightvision not functional
|
||||
d3: When a spell attack misses, it hits a random creature within 5 feet instead
|
||||
d4: On a spell attack critical hit or miss, roll on the Wild Magic Table
|
||||
d5: 1d4 piercing damage for every 30ft of movement during the Dash action
|
||||
d6: No Effect
|
||||
- Add 1d6 to radiant damage
|
||||
- Nightvision not functional
|
||||
- When a spell attack misses, it hits a random creature within 5 feet instead
|
||||
- On a spell attack critical hit or miss, roll on the Wild Magic Table
|
||||
- 1d4 piercing damage for every 30ft of movement during the Dash action
|
||||
weather:
|
||||
d1: Scorching Temperatures - 2x water consumption
|
||||
d2: Hail (no effect - counts as magical water if consumed)
|
||||
d3: Ghostly Wailing - Disadvantage on concentration checks
|
||||
d4: Low Oxygen - Disadvantage on STR Athletics checks and saves
|
||||
d5: Extra Gravity - Disadvantage on DEX checks and saves
|
||||
d6: Hot Metal Storm - Heat Metal spell effects for half-day
|
||||
d7: Bubble Rain - Bubbles rain upwards, obscuring vision; disadvantage on perception checks
|
||||
d8: Clear Skies (No effect)
|
||||
d1-d5:
|
||||
Description: Clear Skies
|
||||
Effect: No Effect
|
||||
d6:
|
||||
Description: Scorching Temperatures
|
||||
Effect: 2x water consumption
|
||||
d7:
|
||||
Description: Hot Metal Storm
|
||||
Effect: Heat Metal spell effects for half-day
|
||||
d8:
|
||||
Description: Bubble Rain
|
||||
Effect: Bubbles rain upwards, obscuring vision; disadvantage on perception checks
|
||||
---
|
||||
|
||||
A mostly flat expanse of hard-packed earth blanked by redfoot, a hardy, sandy-brown moss covered in sharp thorns. At night glowing clusters of moon blossoms emerge from the earth and open their petals, bathing the entire wasteland in a pale, silvery light.
|
||||
|
|
|
@ -678,6 +678,10 @@ a.disabled:hover {
|
|||
.statblock table tr td:first-of-type {
|
||||
font-weight: bold;
|
||||
}
|
||||
.statblock table tr td:first-child:nth-last-child(1) {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.statblock table tr:last-child,
|
||||
.statblock table tr:last-child {
|
||||
padding-right: 1em;
|
||||
|
|
|
@ -6,11 +6,21 @@
|
|||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro rolltable(t) %}
|
||||
{% macro list_to_cols(l, headers) %}
|
||||
{% if l is mapping %}
|
||||
{% for key in l if key in headers%}
|
||||
{{ list_to_cols(l[key], headers) }}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<td>{{ l if l else "" }}</td>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro table(t, headers=[]) %}
|
||||
<table>
|
||||
<tr><th>Roll</th><th>Effect</th></tr>
|
||||
{% for die in t %}
|
||||
<tr><td>{{ die }}</td><td>{{ t[die] }}</td></tr>
|
||||
<tr>{% for h in headers %}{% if h %}<th>{{ h }}</th>{% endif %}{% endfor %}</tr>
|
||||
{% for key in t %}
|
||||
<tr><td>{{ key }}</td>{{ list_to_cols(t[key], headers) }}</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endmacro %}
|
||||
|
|
|
@ -30,29 +30,13 @@
|
|||
<dl>
|
||||
<dt>Size</dt><dd>{{ r.size }} sq. miles </dd>
|
||||
<dt>Terrain</dt><dd>{{ r.terrain }} (walking: {{ r.size / 10 if r.terrain == 'difficult' else 20 |round }} days)</dd>
|
||||
<dt>Skill Challenges</dt><dd>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Skill</td>
|
||||
<th style='text-align: right;'>DC</th>
|
||||
<th>Resources</th>
|
||||
</tr>
|
||||
{% for (k, v) in [ ('Travel', r.travel), ('Forage', r.forage), ('Track', r.track), ('Evade', r.evade), ('Survey', r.survey) ] %}
|
||||
<tr>
|
||||
<td>{{ k }}</td>
|
||||
<td style='text-align: right;'>{{ v.dc or ""}}</td>
|
||||
<td>{{ v.resources or ""}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</dd>
|
||||
<dt>Encounters (CR {{r.cr}})</dt><dd>{{ macros.rolltable(r.encounters) }}</dd>
|
||||
<dt>Regional Effects</dt><dd>{{ macros.rolltable(r.regional_effects) }}</dd>
|
||||
<dt>Weather Effects</dt><dd>{{ macros.rolltable(r.weather) }}</dd>
|
||||
<dt>Regional Effects</dt><dd>{{ macros.table(r.regional_effects) }}</dd>
|
||||
<dt>Skill Challenges</dt><dd>{{ macros.table(r.skills, ['Skills', 'DC', 'Notes']) }}</dd>
|
||||
<dt>Encounters (CR {{r.cr}})</dt><dd>{{ macros.table(r.encounters, ['Roll', 'Difficulty']) }}</dd>
|
||||
<dt>Weather Effects</dt><dd>{{ macros.table(r.weather, ['Roll', None, 'Description', 'Effect']) }}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
{% include "bottom-nav.html" %}
|
||||
</div>
|
||||
|
|
|
@ -3,53 +3,45 @@
|
|||
|
||||
title: {{ title }}
|
||||
author: {{ author if author else 'evilchili' }}
|
||||
tags: {{ tags }}
|
||||
tags: {{ tags or 'region'}}
|
||||
{% if date %}
|
||||
date: {{ date }}
|
||||
{% endif %}
|
||||
category: regions
|
||||
template: region
|
||||
{% if summary %}
|
||||
summary: {{summary}}
|
||||
{% endif %}
|
||||
region:
|
||||
name: {{ title }}
|
||||
size: 10
|
||||
terrain: difficult
|
||||
shelter: none
|
||||
water_source: none
|
||||
name: {{ title }}
|
||||
size: 10
|
||||
terrain: difficult
|
||||
description: |
|
||||
description
|
||||
skills:
|
||||
travel:
|
||||
dc: 10
|
||||
critical_success:
|
||||
critical_fail:
|
||||
notes:
|
||||
forage:
|
||||
dc: 10
|
||||
critical_success:
|
||||
critical_fail:
|
||||
notes:
|
||||
track:
|
||||
dc: 10
|
||||
critical_success:
|
||||
critical_fail:
|
||||
notes:
|
||||
evade:
|
||||
dc: 10
|
||||
critical_success:
|
||||
critical_fail:
|
||||
notes:
|
||||
survey:
|
||||
dc: 10
|
||||
critical_success:
|
||||
critical_fail:
|
||||
encounter_chance: 5
|
||||
special:
|
||||
weather:
|
||||
d1:
|
||||
d2:
|
||||
d3:
|
||||
d4:
|
||||
d5:
|
||||
d6:
|
||||
d7:
|
||||
d8:
|
||||
notes:
|
||||
cr: 4
|
||||
encounters:
|
||||
{% rolltable ['encounters'], indent=4 %}
|
||||
weather:
|
||||
{% rolltable ['weather'], indent=4 %}
|
||||
regional_effects:
|
||||
-
|
||||
-
|
||||
status: {{ status if status else 'draft' }}
|
||||
---
|
||||
|
||||
Region description goes here.
|
||||
DM's region notes goes here.
|
||||
|
|
|
@ -16,6 +16,7 @@ typer = "latest"
|
|||
rich = "latest"
|
||||
pyyaml = "latest"
|
||||
livereload = "latest"
|
||||
jinja2-simple-tags = "latest"
|
||||
|
||||
# static website
|
||||
pelican = "^4.7.2"
|
||||
|
@ -24,9 +25,10 @@ pelican-sitemap = "^1.0.2"
|
|||
pelican-yaml-metadata = { git = "https://github.com/pR0Ps/pelican-yaml-metadata.git", branch = "cdc1b9708916410e455e8e258e3d39a9d575c7b5" }
|
||||
|
||||
# local wotsits
|
||||
dnd-rolltable = { git = "https://github.com/evilchili/dnd-rolltable", branch = 'main' }
|
||||
dnd-npcs = { git = "https://github.com/evilchili/dnd-npcs", branch = 'main' }
|
||||
elethis-cipher= { git = "https://github.com/evilchili/elethis-cipher", branch = 'main' }
|
||||
#dnd-rolltable = { git = "https://github.com/evilchili/dnd-rolltable", branch = 'main' }
|
||||
dnd-rolltable = { file = "../../dnd-rolltable/dist/dnd_rolltable-1.1.3-py3-none-any.whl" }
|
||||
|
||||
[tool.poetry.scripts]
|
||||
site = "site_tools.cli:app"
|
||||
|
|
|
@ -21,10 +21,12 @@ def create(content_type: str, title: str, template_dir: str,
|
|||
if not (template_path / template_name).exists():
|
||||
template_name = 'default.md'
|
||||
print("Not found. Using default markdown template.")
|
||||
template_source = Environment(
|
||||
env = Environment(
|
||||
loader=FileSystemLoader(template_path),
|
||||
trim_blocks=True,
|
||||
).get_template(template_name)
|
||||
)
|
||||
env.add_extension('site_tools.extensions.RollTable')
|
||||
template_source = env.get_template(template_name)
|
||||
|
||||
target_filename = _slugify(title) + '.md'
|
||||
|
||||
|
|
13
deadsands/site_tools/extensions.py
Normal file
13
deadsands/site_tools/extensions.py
Normal file
|
@ -0,0 +1,13 @@
|
|||
import textwrap
|
||||
from rolltable.tables import RollTable as _RT
|
||||
from jinja2_simple_tags import StandaloneTag
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
class RollTable(StandaloneTag):
|
||||
tags = {"rolltable"}
|
||||
|
||||
def render(self, sources, frequency='default', die=8, indent=0, **kwargs):
|
||||
rt = _RT([Path(f'sources/{s}.yaml').read_text() for s in sources],
|
||||
frequency=frequency, die=die)
|
||||
return textwrap.indent(rt.as_yaml(), ' ' * indent)
|
39
deadsands/sources/encounters.yaml
Normal file
39
deadsands/sources/encounters.yaml
Normal file
|
@ -0,0 +1,39 @@
|
|||
metadata:
|
||||
headers:
|
||||
- Difficulty
|
||||
frequencies:
|
||||
default:
|
||||
None: 0.7
|
||||
Easy: 0.1
|
||||
Difficult: 0.1
|
||||
Dangerous: 0.05
|
||||
Deadly: 0.05
|
||||
easy:
|
||||
None: 0.5
|
||||
Easy: 0.3
|
||||
Difficult: 0.1
|
||||
Dangerous: 0.05
|
||||
Deadly: 0.05
|
||||
difficult:
|
||||
None: 0.5
|
||||
Easy: 0.1
|
||||
Difficult: 0.3
|
||||
Dangerous: 0.05
|
||||
Deadly: 0.05
|
||||
dangerous:
|
||||
None: 0.5
|
||||
Easy: 0.05
|
||||
Difficult: 0.1
|
||||
Dangerous: 0.3
|
||||
Deadly: 0.05
|
||||
deadly:
|
||||
None: 0.5
|
||||
Easy: 0.05
|
||||
Difficult: 0.05
|
||||
Dangerous: 0.1
|
||||
Deadly: 0.3
|
||||
None:
|
||||
Easy:
|
||||
Difficult:
|
||||
Dangerous:
|
||||
Deadly:
|
Loading…
Reference in New Issue
Block a user