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:
12
world/classes/cleric.toml
Normal file
12
world/classes/cleric.toml
Normal file
@@ -0,0 +1,12 @@
|
||||
name = "Cleric"
|
||||
description = "Devout healers and protectors, clerics channel divine power to mend and shield."
|
||||
|
||||
[base_stats]
|
||||
max_hp = 100
|
||||
attack = 10
|
||||
defense = 14
|
||||
|
||||
[growth]
|
||||
hp_per_level = 12
|
||||
attack_per_level = 2
|
||||
defense_per_level = 3
|
||||
12
world/classes/mage.toml
Normal file
12
world/classes/mage.toml
Normal file
@@ -0,0 +1,12 @@
|
||||
name = "Mage"
|
||||
description = "Wielders of arcane power, mages trade resilience for devastating force."
|
||||
|
||||
[base_stats]
|
||||
max_hp = 70
|
||||
attack = 18
|
||||
defense = 6
|
||||
|
||||
[growth]
|
||||
hp_per_level = 8
|
||||
attack_per_level = 4
|
||||
defense_per_level = 1
|
||||
12
world/classes/rogue.toml
Normal file
12
world/classes/rogue.toml
Normal file
@@ -0,0 +1,12 @@
|
||||
name = "Rogue"
|
||||
description = "Quick and cunning, rogues strike from the shadows with lethal precision."
|
||||
|
||||
[base_stats]
|
||||
max_hp = 85
|
||||
attack = 16
|
||||
defense = 8
|
||||
|
||||
[growth]
|
||||
hp_per_level = 10
|
||||
attack_per_level = 4
|
||||
defense_per_level = 1
|
||||
12
world/classes/warrior.toml
Normal file
12
world/classes/warrior.toml
Normal file
@@ -0,0 +1,12 @@
|
||||
name = "Warrior"
|
||||
description = "Masters of arms and armor, warriors lead the charge and hold the line."
|
||||
|
||||
[base_stats]
|
||||
max_hp = 120
|
||||
attack = 14
|
||||
defense = 12
|
||||
|
||||
[growth]
|
||||
hp_per_level = 15
|
||||
attack_per_level = 3
|
||||
defense_per_level = 2
|
||||
9
world/races/dwarf.toml
Normal file
9
world/races/dwarf.toml
Normal 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
9
world/races/elf.toml
Normal 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
|
||||
9
world/races/halfling.toml
Normal file
9
world/races/halfling.toml
Normal 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
9
world/races/human.toml
Normal 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
9
world/races/orc.toml
Normal 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
|
||||
@@ -1,4 +1,7 @@
|
||||
name = "Grizzled Barkeep"
|
||||
description = "A weathered man with thick forearms and a permanent scowl. He polishes the same mug endlessly."
|
||||
room = "town:tavern"
|
||||
dialogue = "Welcome to The Rusty Tankard. We've got ale, and we've got stronger ale. Pick one."
|
||||
base_attitude = "friendly"
|
||||
|
||||
[dialogue]
|
||||
greeting = "Welcome to The Rusty Tankard. We've got ale, and we've got stronger ale."
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
name = "Town Guard"
|
||||
description = "A bored-looking guard in dented chainmail. He leans on his spear and watches passersby."
|
||||
room = "town:gate"
|
||||
dialogue = "Move along. Nothing to see here."
|
||||
base_attitude = "neutral"
|
||||
|
||||
[dialogue]
|
||||
greeting = "Move along. Nothing to see here."
|
||||
|
||||
11
world/town/npcs/rat.toml
Normal file
11
world/town/npcs/rat.toml
Normal file
@@ -0,0 +1,11 @@
|
||||
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"
|
||||
respawn_secs = 60
|
||||
|
||||
[combat]
|
||||
max_hp = 25
|
||||
attack = 6
|
||||
defense = 2
|
||||
xp_reward = 15
|
||||
12
world/town/npcs/thief.toml
Normal file
12
world/town/npcs/thief.toml
Normal file
@@ -0,0 +1,12 @@
|
||||
name = "Shadowy Thief"
|
||||
description = "A cloaked figure lurking in the darkness, fingers twitching near a concealed blade."
|
||||
room = "town:dark_alley"
|
||||
base_attitude = "aggressive"
|
||||
faction = "underworld"
|
||||
respawn_secs = 90
|
||||
|
||||
[combat]
|
||||
max_hp = 45
|
||||
attack = 12
|
||||
defense = 6
|
||||
xp_reward = 35
|
||||
5
world/town/objects/gold_coin.toml
Normal file
5
world/town/objects/gold_coin.toml
Normal file
@@ -0,0 +1,5 @@
|
||||
name = "Gold Coin"
|
||||
description = "A single gold coin stamped with the crest of Thornwall."
|
||||
room = "town:market"
|
||||
kind = "treasure"
|
||||
takeable = true
|
||||
@@ -2,3 +2,7 @@ name = "Healing Potion"
|
||||
description = "A small glass vial filled with a shimmering red liquid."
|
||||
room = "town:temple"
|
||||
kind = "consumable"
|
||||
takeable = true
|
||||
|
||||
[stats]
|
||||
heal_amount = 30
|
||||
|
||||
8
world/town/objects/iron_shield.toml
Normal file
8
world/town/objects/iron_shield.toml
Normal file
@@ -0,0 +1,8 @@
|
||||
name = "Iron Shield"
|
||||
description = "A dented but serviceable round shield bearing the blacksmith's mark."
|
||||
room = "town:forge"
|
||||
kind = "armor"
|
||||
takeable = true
|
||||
|
||||
[stats]
|
||||
armor = 4
|
||||
@@ -2,3 +2,7 @@ name = "Rusty Sword"
|
||||
description = "A battered iron blade with a cracked leather grip. It's seen better days."
|
||||
room = "town:cellar"
|
||||
kind = "weapon"
|
||||
takeable = true
|
||||
|
||||
[stats]
|
||||
damage = 5
|
||||
|
||||
Reference in New Issue
Block a user