Add SQLite persistence, per-player NPC attitude system, character creation, and combat

- Add trait-based DB layer (db.rs) with SQLite backend for easy future swapping
- Player state persisted to SQLite: stats, inventory, equipment, room position
- Returning players skip chargen and resume where they left off
- Replace boolean hostile flag with 5-tier attitude system (friendly/neutral/wary/aggressive/hostile)
- Per-player NPC attitudes stored in DB, shift on kills with faction propagation
- Add character creation flow (chargen.rs) with data-driven races and classes from TOML
- Add turn-based combat system (combat.rs) with XP, leveling, and NPC respawn
- Add commands: take, drop, inventory, equip, use, examine, talk, attack, flee, stats
- Add world data: 5 races, 4 classes, hostile NPCs (rat, thief), new items

Made-with: Cursor
This commit is contained in:
AI Agent
2026-03-14 13:58:22 -06:00
parent c82f57a720
commit 680f48477e
28 changed files with 1797 additions and 673 deletions

9
world/races/dwarf.toml Normal file
View File

@@ -0,0 +1,9 @@
name = "Dwarf"
description = "Stout and unyielding, dwarves are born of stone and stubbornness."
[stats]
strength = 1
dexterity = -1
constitution = 2
intelligence = 0
wisdom = 0

9
world/races/elf.toml Normal file
View File

@@ -0,0 +1,9 @@
name = "Elf"
description = "Graceful and keen-eyed, elves possess an innate affinity for magic."
[stats]
strength = -1
dexterity = 2
constitution = -1
intelligence = 2
wisdom = 0

View File

@@ -0,0 +1,9 @@
name = "Halfling"
description = "Small and nimble, halflings slip through danger with uncanny luck."
[stats]
strength = -2
dexterity = 3
constitution = 0
intelligence = 0
wisdom = 1

9
world/races/human.toml Normal file
View File

@@ -0,0 +1,9 @@
name = "Human"
description = "Versatile and adaptable, humans excel through sheer determination."
[stats]
strength = 0
dexterity = 0
constitution = 0
intelligence = 0
wisdom = 0

9
world/races/orc.toml Normal file
View File

@@ -0,0 +1,9 @@
name = "Orc"
description = "Powerful and fierce, orcs channel raw fury into everything they do."
[stats]
strength = 3
dexterity = 0
constitution = 1
intelligence = -2
wisdom = -1