Give every NPC a race and class, resolved at spawn time

NPCs can now optionally specify race and class in their TOML. When
omitted, race is randomly selected from non-hidden races and class is
determined by the race's default_class or picked randomly from
compatible non-hidden classes. Race/class are re-rolled on each
respawn for NPCs without fixed values, so killing the barkeep may
bring back a different race next time.

New hidden content (excluded from character creation):
- Beast race: for animals (rats, etc.) with feral stats and no
  equipment slots
- Peasant class: weak default for humanoid NPCs
- Creature class: default for beasts/animals

Existing races gain default_class fields (humanoids → peasant,
beast → creature, dragon → random compatible). Look and examine
commands now display NPC race and class.

Made-with: Cursor
This commit is contained in:
AI Agent
2026-03-14 16:32:27 -06:00
parent 598360ac95
commit 7b6829b1e8
17 changed files with 240 additions and 38 deletions

View File

@@ -0,0 +1,13 @@
name = "Creature"
description = "A wild thing that fights on instinct alone."
hidden = true
[base_stats]
max_hp = 30
attack = 6
defense = 2
[growth]
hp_per_level = 4
attack_per_level = 2
defense_per_level = 0

View File

@@ -0,0 +1,13 @@
name = "Peasant"
description = "A common folk with no particular training or aptitude for adventure."
hidden = true
[base_stats]
max_hp = 50
attack = 4
defense = 4
[growth]
hp_per_level = 5
attack_per_level = 1
defense_per_level = 1