diff --git a/deadsands/content/images/blooming_wastes1.jpg b/deadsands/content/images/blooming_wastes1.jpg
new file mode 100644
index 0000000..9f915e4
Binary files /dev/null and b/deadsands/content/images/blooming_wastes1.jpg differ
diff --git a/deadsands/content/regions/blooming-wastes.md b/deadsands/content/regions/blooming-wastes.md
index 35e3cf2..6549976 100644
--- a/deadsands/content/regions/blooming-wastes.md
+++ b/deadsands/content/regions/blooming-wastes.md
@@ -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.
diff --git a/deadsands/deadsands-theme/static/deadsands/css/style.css b/deadsands/deadsands-theme/static/deadsands/css/style.css
index 70f1b20..6cb2914 100644
--- a/deadsands/deadsands-theme/static/deadsands/css/style.css
+++ b/deadsands/deadsands-theme/static/deadsands/css/style.css
@@ -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;
diff --git a/deadsands/deadsands-theme/templates/macros.html b/deadsands/deadsands-theme/templates/macros.html
index 243900e..531b9fa 100644
--- a/deadsands/deadsands-theme/templates/macros.html
+++ b/deadsands/deadsands-theme/templates/macros.html
@@ -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 %}
+
{{ l if l else "" }} |
+ {% endif %}
+{% endmacro %}
+
+{% macro table(t, headers=[]) %}
- Roll | Effect |
- {% for die in t %}
- {{ die }} | {{ t[die] }} |
+ {% for h in headers %}{% if h %}{{ h }} | {% endif %}{% endfor %}
+ {% for key in t %}
+ {{ key }} | {{ list_to_cols(t[key], headers) }}
{% endfor %}
{% endmacro %}
diff --git a/deadsands/deadsands-theme/templates/region.html b/deadsands/deadsands-theme/templates/region.html
index 22064ea..fbcb680 100644
--- a/deadsands/deadsands-theme/templates/region.html
+++ b/deadsands/deadsands-theme/templates/region.html
@@ -30,29 +30,13 @@
- Size
- {{ r.size }} sq. miles
- Terrain
- {{ r.terrain }} (walking: {{ r.size / 10 if r.terrain == 'difficult' else 20 |round }} days)
- - Skill Challenges
-
-
-
- Skill
- | DC |
- Resources |
-
- {% for (k, v) in [ ('Travel', r.travel), ('Forage', r.forage), ('Track', r.track), ('Evade', r.evade), ('Survey', r.survey) ] %}
-
- {{ k }} |
- {{ v.dc or ""}} |
- {{ v.resources or ""}} |
-
- {% endfor %}
-
-
- - Encounters (CR {{r.cr}})
- {{ macros.rolltable(r.encounters) }}
- - Regional Effects
- {{ macros.rolltable(r.regional_effects) }}
- - Weather Effects
- {{ macros.rolltable(r.weather) }}
+ - Regional Effects
- {{ macros.table(r.regional_effects) }}
+ - Skill Challenges
- {{ macros.table(r.skills, ['Skills', 'DC', 'Notes']) }}
+ - Encounters (CR {{r.cr}})
- {{ macros.table(r.encounters, ['Roll', 'Difficulty']) }}
+ - Weather Effects
- {{ macros.table(r.weather, ['Roll', None, 'Description', 'Effect']) }}
-
{% include "bottom-nav.html" %}
diff --git a/deadsands/markdown-templates/region.md b/deadsands/markdown-templates/region.md
index 186600d..6da28e3 100644
--- a/deadsands/markdown-templates/region.md
+++ b/deadsands/markdown-templates/region.md
@@ -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.
diff --git a/deadsands/pyproject.toml b/deadsands/pyproject.toml
index a030f7c..6004dfd 100644
--- a/deadsands/pyproject.toml
+++ b/deadsands/pyproject.toml
@@ -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"
diff --git a/deadsands/site_tools/content_manager.py b/deadsands/site_tools/content_manager.py
index e2cdc6d..2866326 100644
--- a/deadsands/site_tools/content_manager.py
+++ b/deadsands/site_tools/content_manager.py
@@ -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'
diff --git a/deadsands/site_tools/extensions.py b/deadsands/site_tools/extensions.py
new file mode 100644
index 0000000..48fd215
--- /dev/null
+++ b/deadsands/site_tools/extensions.py
@@ -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)
diff --git a/deadsands/sources/encounters.yaml b/deadsands/sources/encounters.yaml
new file mode 100644
index 0000000..cc3dee0
--- /dev/null
+++ b/deadsands/sources/encounters.yaml
@@ -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: