Skip to content

Commit

Permalink
Switch _ for - in idents
Browse files Browse the repository at this point in the history
  • Loading branch information
solomonhawk committed Nov 1, 2024
1 parent 01e0f5b commit 757c42f
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion packages/engine/src/nom_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ fn literal(input: Span) -> IResult<Span, Span, ErrorTree<Span>> {
}

fn ident(input: Span) -> IResult<Span, Span, ErrorTree<Span>> {
take_while1(|c: char| c.is_alphanumeric() || c == '_')
take_while1(|c: char| c.is_alphanumeric() || c == '_' || c == '-')
.context("Invalid identifier, only alphanumeric characters and `_` are allowed")
.parse(input)
}
26 changes: 13 additions & 13 deletions packages/engine/src/tables/npc.tbl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Mono Races
id: mono_race
id: mono-race
---
1: Human
1: Elf
Expand All @@ -12,8 +12,8 @@ id: mono_race
title: Races
id: race
---
1: {{mono_race}}
1: Half-{{mono_race}}
1: {{mono-race}}
1: Half-{{mono-race}}

---
title: Classes
Expand Down Expand Up @@ -48,7 +48,7 @@ id: alignment

---
title: First Names
id: first_name
id: first-name
---
1: Frodo
1: Bilbo
Expand All @@ -63,7 +63,7 @@ id: first_name

---
title: Last Names
id: last_name
id: last-name
---
1: Baggins
1: the Grey
Expand All @@ -80,9 +80,9 @@ id: last_name
title: Birthplace
id: birthplace
---
10: a large {{geographic_feature}} city
5: a small {{economic_pursuit}} village outside {{city}}
5: a small {{geographic_feature}} city
10: a large {{geographic-feature}} city
5: a small {{economic-pursuit}} village outside {{city}}
5: a small {{geographic-feature}} city
1: the wilds outside {{city}}

---
Expand All @@ -102,7 +102,7 @@ id: city

---
title: Geographic Features
id: geographic_feature
id: geographic-feature
---
1: coastal
1: mountain
Expand All @@ -115,7 +115,7 @@ id: geographic_feature

---
title: Economic Pursuits
id: economic_pursuit
id: economic-pursuit
---
1: farming
1: fishing
Expand Down Expand Up @@ -181,7 +181,7 @@ id: profession

---
title: Skill Levels
id: skill_level
id: skill-level
---
5: novice
7: apprentice
Expand All @@ -195,5 +195,5 @@ title: NPC
id: npc
export: true
---
1: {{first_name}} {{last_name}} is {{alignment|indefinite}} {{race}} {{class}} originally from {{birthplace}}, known as {{reputation|indefinite}} {{skill_level}} {{profession}}.
3: {{first_name}} {{last_name}} is a commoner from {{birthplace}}, known as {{skill_level|indefinite}} {{profession}}.
1: {{first-name}} {{last-name}} is {{alignment|indefinite}} {{race}} {{class}} originally from {{birthplace}}, known as {{reputation|indefinite}} {{skill-level}} {{profession}}.
3: {{first-name}} {{last-name}} is a commoner from {{birthplace}}, known as {{skill-level|indefinite}} {{profession}}.
48 changes: 24 additions & 24 deletions packages/engine/src/tables/potion.tbl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Potion
id: potion
export: true
---
1: {{potion_descriptor|indefinite|capitalize}} {{color}} {{potion_substance}} {{containment}} {{container_descriptor|indefinite}} {{container_shape}} {{container_material}} {{container_type}}. It smells like {{smell}} and {{potion_attribute}}. {{potion_effect}}
1: {{potion-descriptor|indefinite|capitalize}} {{color}} {{potion-substance}} {{containment}} {{container-descriptor|indefinite}} {{container-shape}} {{container-material}} {{container-type}}. It smells like {{smell}} and {{potion-attribute}}. {{potion-effect}}

---
title: Containment
Expand All @@ -22,7 +22,7 @@ id: containment

---
title: Potion Descriptor
id: potion_descriptor
id: potion-descriptor
---
1: fresh
1: ripe
Expand Down Expand Up @@ -103,7 +103,7 @@ id: color

---
title: Potion Substance
id: potion_substance
id: potion-substance
---
5: liquid
2: gelatin
Expand All @@ -116,7 +116,7 @@ id: potion_substance

---
title: Container Descriptor
id: container_descriptor
id: container-descriptor
---
1: twisted
1: jagged
Expand All @@ -135,7 +135,7 @@ id: container_descriptor

---
title: Container Material
id: container_material
id: container-material
---
5: glass
2: crystal
Expand All @@ -148,7 +148,7 @@ id: container_material

---
title: Container Shape
id: container_shape
id: container-shape
---
1: round
1: spherical
Expand All @@ -166,7 +166,7 @@ id: container_shape

---
title: Container Type
id: container_type
id: container-type
---
1: vial
1: bottle
Expand Down Expand Up @@ -222,11 +222,11 @@ id: smell
1: vanilla
1: sandalwood
1: lemon
1: {{root_material}}root
1: {{root-material}}root

---
title: Root Material
id: root_material
id: root-material
---
1: pine
1: oak
Expand All @@ -239,7 +239,7 @@ id: root_material

---
title: Attribute
id: potion_attribute
id: potion-attribute
---
1: glows with a dim {{color}} light
1: it shimmers and swirls curiously
Expand Down Expand Up @@ -288,18 +288,18 @@ id: emotion

---
title: Potion Effect
id: potion_effect
id: potion-effect
---
1: Regular with a slight side effect. {{effect}}. {{side_effect}}.
1: Regular with a slight side effect. {{effect}}. {{side-effect}}.
1: Regular with no side effect. {{effect}}.
1: Regular with a strong side effect, {{effect}}. {{side_effect}}. {{side_effect}}.
1: Minor with a strong side effect. {{effect}}. {{side_effect}}. {{side_effect}}.
1: Minor with a slight side effect. {{effect}}. {{side_effect}}.
1: Major with a strong side effect. {{effect}}. {{side_effect}}. {{side_effect}}.
1: Major with a small side effect. {{effect}}. {{side_effect}}.
1: A poison - almost no positive affect all side effect. {{side_effect}}, {{side_effect}}
1: Temporary but strong and wears off quickly. {{effect}}. {{side_effect}}.
0.1: Seemingly permanent. {{effect}}. {{side_effect}}.
1: Regular with a strong side effect, {{effect}}. {{side-effect}}. {{side-effect}}.
1: Minor with a strong side effect. {{effect}}. {{side-effect}}. {{side-effect}}.
1: Minor with a slight side effect. {{effect}}. {{side-effect}}.
1: Major with a strong side effect. {{effect}}. {{side-effect}}. {{side-effect}}.
1: Major with a small side effect. {{effect}}. {{side-effect}}.
1: A poison - almost no positive affect all side effect. {{side-effect}}, {{side-effect}}
1: Temporary but strong and wears off quickly. {{effect}}. {{side-effect}}.
0.1: Seemingly permanent. {{effect}}. {{side-effect}}.

---
title: Effect
Expand Down Expand Up @@ -408,7 +408,7 @@ id: effect

---
title: Side Effect
id: side_effect
id: side-effect
---
1: Nothing bad at all
1: Puts the user to sleep
Expand Down Expand Up @@ -456,7 +456,7 @@ id: side_effect
1: Loss of a random item
1: Curses
1: Damage
1: Weakness to a {{magical_damage_type}}
1: Weakness to a {{magical-damage-type}}
1: Weakness to physical damage
1: Feelings of Guilt
1: Feelings of Anxiety
Expand Down Expand Up @@ -513,7 +513,7 @@ id: side_effect

---
title: Magical Damage Types
id: magical_damage_type
id: magical-damage-type
---
1: acid
1: bludgeoning
Expand All @@ -527,4 +527,4 @@ id: magical_damage_type
1: psychic
1: radiant
1: slashing
1: thunder
1: thunder

0 comments on commit 757c42f

Please sign in to comment.