From: Ian Jackson Date: Sun, 24 Sep 2023 15:22:35 +0000 (+0100) Subject: wip with total checker etc. X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=db69637d3a740591298723fcb299faf785513afd;p=the-pointy-bits.git wip with total checker etc. --- diff --git a/Makefile b/Makefile index 00cf5fc..32b3f1a 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,10 @@ SHELL=/bin/bash CHARACTERS=kennocht fabricia all: $(addsuffix .pdf, $(CHARACTERS)) \ + $(addprefix check-, $(CHARACTERS)) \ %.pdf: %.md Makefile pandoc -Vmargin-{top,left,right,bottom}=20mm -t latex -o .tmp.$@ $< && $i + +check-%: %.md Makefile total-checker + ./total-checker <$< diff --git a/fabricia.md b/fabricia.md index 02e2554..8621807 100644 --- a/fabricia.md +++ b/fabricia.md @@ -22,9 +22,10 @@ Age at story start: 17. * **Light Touch** (minor, general) * **Venus's Blessing** * **Improved Characteristics** x1 + * **Wilderness Sense** * **Puissant Woodworking** (minor, general) - * **Puissant Ironworking** (minor, general) +// * **Puissant Ironworking** (minor, general) * **Puissant Leatherworking** (minor, general) # Flaws @@ -65,29 +66,33 @@ Int -1 -1 Per -1 -1 Com -3 -6 -``` -Total 10 (+7 plus +3 from Improved Characteristics) +total 10 +7 plus +3 from Improved Characteristics) +``` # Abilities ## Early childhood -Grew up in the neighbouring covenant. Lots of running about and +Grew up in a mountain outpost of an old (Winter) mountain covenant, +the Covenant of the Icy North. +The wizards were very ood and I had to do a lot of fending for myself. +Lots of running about and climbing the old towers and exploring the mountains and forests outside the covenant including swimming in the nearby rivers. ``` - XP + XP + +German (Swiss/Austyrian) (spoken) 5 free -German (Swiss) (spoken) 5 free +Survival (mountains) 2 15 +Athletics (climbing) 2 15 +Swim (small fast rivers) 1 5 +Awareness (searching) 1 5 +Stealth (natural areas) 1 5 -Survival (mountains) 2 15 -Athletics (climbing) 1 5 -Charm 1 5 -(XXXX name of place) lore 1 5 -Brawl (dodging) 1 5 -Swim (small fast rivers) 1 5 +total 45 ``` ### Later childhood @@ -95,20 +100,31 @@ Swim (small fast rivers) 1 5 5-17 = 12 years = 180 XP ``` - XP + XP -Craft - woodworking 3 30 -Craft - ironworking 3 30 -Craft - leatherworking 3 30 -Craft - sewing 2 15 +Craft - improvisation 3 30 +Craft - woodworking 3 30 +XXX ^ is this sensible/allowed; what happens if I improvise with wood? + +Wilderness sense (resources) 3 30 +Hunt (tracking) 2 15 +Single weapon (knife/dagger) 2 15 -Wilderness sense (resources) 3 30 -Hunt (cover tracks) 2 15 -Single weapon (knife/dagger) 2 15 +Charm (speciality: wizards) 1 5 +Faerie Lore (forests) 1 5 -Charm (speciality: wizards) 1 => 2 10 -Faerie Lore (forests) 1 5 +total 180 ``` +Brawl (dodging) 1 5 + + +? legerdemain +? stealth +? thrown weapon +Craft - ironworking 3 30 +Craft - sewing 2 15 + + XXXX is there a Farie forest nearby ? If so then that. XXXX am I allowed Wilderness Sense ? diff --git a/total-checker b/total-checker new file mode 100755 index 0000000..9ddea75 --- /dev/null +++ b/total-checker @@ -0,0 +1,37 @@ +#!/usr/bin/perl -w + +use strict; + +open L, "expand -t4 |" or die $!; +@l = ; +$?=0; $!=0; close L or die "$? $!"; + +my $block_start = 0; + +foreach my $i (0..$#l) { + $_ = $l[$i]; + if (m{^\`\`\`}) { + if (defined $block_start) { + $block_start = undef; + } else { + $block_start = $i + 1; + } + } + if (defined($block_start) && m{^(total +)(\d+)\s}) { + my ($lhs, $exp) = ($1, $2); + my $got = 0; + foreach my $i ($block_start .. ($i-1)) { + $_ = $j[$_]; + $earlier = len($lhs) - 1; + next unless length > $earlier+1; + die "$j: $_ ?" unless m{^.{$earlier} (\S+)\s}; + my $here = $1; + next unless $here =~ m{^[-+]?\d+$}; + $got += $here; + } + my $delta = $exp - $here; + if ($delta) { + print STDERR "line $i: expected $exp but got $got, delta $delta"; + } + } +}