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:
13
world/classes/creature.toml
Normal file
13
world/classes/creature.toml
Normal 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
|
||||
13
world/classes/peasant.toml
Normal file
13
world/classes/peasant.toml
Normal 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
|
||||
40
world/races/beast.toml
Normal file
40
world/races/beast.toml
Normal file
@@ -0,0 +1,40 @@
|
||||
name = "Beast"
|
||||
description = "A wild creature driven by instinct and survival."
|
||||
metarace = "animal"
|
||||
hidden = true
|
||||
default_class = "class:creature"
|
||||
|
||||
[stats]
|
||||
strength = 0
|
||||
dexterity = 1
|
||||
constitution = 1
|
||||
intelligence = -4
|
||||
wisdom = -2
|
||||
perception = 2
|
||||
charisma = -3
|
||||
|
||||
[body]
|
||||
size = "small"
|
||||
weight = 10
|
||||
slots = []
|
||||
|
||||
[natural]
|
||||
armor = 0
|
||||
|
||||
[natural.attacks.bite]
|
||||
damage = 4
|
||||
type = "physical"
|
||||
|
||||
traits = ["feral", "keen_senses"]
|
||||
disadvantages = ["no_speech", "no_equipment"]
|
||||
|
||||
[regen]
|
||||
hp = 1.2
|
||||
mana = 0.0
|
||||
endurance = 1.5
|
||||
|
||||
[misc]
|
||||
lifespan = 15
|
||||
diet = "omnivore"
|
||||
xp_rate = 1.0
|
||||
vision = ["normal", "low_light"]
|
||||
@@ -1,5 +1,6 @@
|
||||
name = "Dwarf"
|
||||
description = "Stout and unyielding, dwarves are born of stone and stubbornness."
|
||||
default_class = "class:peasant"
|
||||
|
||||
[stats]
|
||||
strength = 1
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
name = "Elf"
|
||||
description = "Graceful and keen-eyed, elves possess an innate affinity for magic."
|
||||
default_class = "class:peasant"
|
||||
|
||||
[stats]
|
||||
strength = -1
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
name = "Halfling"
|
||||
description = "Small and nimble, halflings slip through danger with uncanny luck."
|
||||
default_class = "class:peasant"
|
||||
|
||||
[stats]
|
||||
strength = -2
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
name = "Human"
|
||||
description = "Versatile and adaptable, humans excel through sheer determination."
|
||||
default_class = "class:peasant"
|
||||
|
||||
[stats]
|
||||
strength = 0
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
name = "Orc"
|
||||
description = "Powerful and fierce, orcs channel raw fury into everything they do."
|
||||
default_class = "class:peasant"
|
||||
|
||||
[stats]
|
||||
strength = 3
|
||||
|
||||
@@ -2,6 +2,7 @@ name = "Town Guard"
|
||||
description = "A bored-looking guard in dented chainmail. He leans on his spear and watches passersby."
|
||||
room = "town:gate"
|
||||
base_attitude = "neutral"
|
||||
class = "class:warrior"
|
||||
|
||||
[dialogue]
|
||||
greeting = "Move along. Nothing to see here."
|
||||
|
||||
@@ -2,6 +2,8 @@ name = "Giant Rat"
|
||||
description = "A mangy rat the size of a small dog. Its eyes gleam with feral hunger."
|
||||
room = "town:cellar"
|
||||
base_attitude = "hostile"
|
||||
race = "race:beast"
|
||||
class = "class:creature"
|
||||
respawn_secs = 60
|
||||
|
||||
[combat]
|
||||
|
||||
@@ -3,6 +3,7 @@ description = "A cloaked figure lurking in the darkness, fingers twitching near
|
||||
room = "town:dark_alley"
|
||||
base_attitude = "aggressive"
|
||||
faction = "underworld"
|
||||
class = "class:rogue"
|
||||
respawn_secs = 90
|
||||
|
||||
[combat]
|
||||
|
||||
Reference in New Issue
Block a user