Add templates for messages

Implement a template syntax with a nom parser, and a formatter to render
templates to strings.
This commit is contained in:
Griffin Smith 2019-07-19 11:54:31 -04:00
parent bc93999cf3
commit e2d13bd76b
9 changed files with 549 additions and 102 deletions

View file

@ -2,5 +2,10 @@
welcome = "Welcome to Xanthous! It's dangerous out there, why not stay inside?"
[combat]
attack = "You attack the {{creature_name}}."
killed = "You killed the {{creature_name}}."
attack = "You attack the {{creature.name}}."
killed = [
"You've killed the {{creature.name}}.",
"The {{creature.name}} dies.",
"The {{creature.name}} kicks it.",
"The {{creature.name}} beefs it."
]