Implement guild system with multi-guild, spells, and combat casting

- Guild data model: world/guilds/*.toml defines guilds with stat growth,
  resource type (mana/endurance), spell lists, level caps, and race
  restrictions. Spells are separate files in world/spells/*.toml.

- Player resources: mana and endurance pools added to PlayerStats with
  DB migration. Passive regen for mana/endurance when out of combat.

- Guild commands: guild list/info/join/leave with multi-guild support.
  spells/skills command shows available spells per guild level.

- Spell casting: cast command works in and out of combat. Offensive
  spells queue as CombatAction::Cast and resolve on tick. Heal/utility
  spells resolve immediately out of combat. Mana/endurance costs,
  cooldowns, and damage types all enforced.

- Chargen integration: classes reference a guild via TOML field. On
  character creation, player auto-joins the seeded guild at level 1.
  Class selection shows "→ joins <Guild>" hint.

- Look command: now accepts optional target argument to inspect NPCs
  (stats/attitude), objects, exits, players, or inventory items.

- 4 guilds (warriors/rogues/mages/clerics) and 16 spells created for
  the existing class archetypes.

Made-with: Cursor
This commit is contained in:
AI Agent
2026-03-14 16:13:10 -06:00
parent bdd1a85ea2
commit 598360ac95
33 changed files with 1082 additions and 48 deletions

View File

@@ -29,6 +29,14 @@ Run through these checks before every commit to ensure consistent feature covera
- [ ] On reconnect, expired effects are gone; active effects resume
- [ ] Verify with: `sqlite3 mudserver.db "SELECT * FROM players;"`
## Look Command
- [ ] `look` with no args shows the room (NPCs, objects, exits, players)
- [ ] `look <npc>` shows NPC description, stats, and attitude
- [ ] `look <object>` shows object description (floor or inventory)
- [ ] `look <exit>` shows where the exit leads
- [ ] `look <player>` shows player race, level, combat status
- [ ] `look <invalid>` shows "You don't see X here."
## Movement & Navigation
- [ ] `go north`, `n`, `south`, `s`, etc. all work
- [ ] Invalid direction shows error
@@ -93,10 +101,48 @@ Run through these checks before every commit to ensure consistent feature covera
- [ ] Negative status effects cleared on player death/respawn
- [ ] Status effects on offline players resolve by wall-clock time on next login
## Guilds
- [ ] `guild list` shows all available guilds with descriptions
- [ ] `guild info <name>` shows guild details, growth stats, and spell list
- [ ] `guild join <name>` adds player to guild at level 1
- [ ] `guild join` grants base mana/endurance from guild
- [ ] `guild leave <name>` removes guild membership
- [ ] Cannot join a guild twice
- [ ] Cannot leave a guild you're not in
- [ ] Race-restricted guilds reject restricted races
- [ ] Player level requirement enforced on `guild join`
- [ ] Multi-guild: player can be in multiple guilds simultaneously
- [ ] Guild membership persists across logout/login (stored in player_guilds table)
- [ ] `stats` shows guild memberships with levels
## Spells & Casting
- [ ] `spells` lists known spells grouped by guild with cost and cooldown
- [ ] Spells filtered by guild level (only shows spells at or below current guild level)
- [ ] `cast <spell>` out of combat: heal/utility resolves immediately
- [ ] `cast <spell>` out of combat: offensive spells blocked ("enter combat first")
- [ ] `cast <spell>` in combat: queues as CombatAction, resolves on tick
- [ ] Spell resolves: offensive deals damage to NPC, shows damage + type
- [ ] Spell resolves: heal restores HP, shows amount healed
- [ ] Spell resolves: utility applies status effect
- [ ] Mana deducted on cast; blocked if insufficient ("Not enough mana")
- [ ] Endurance deducted on cast; blocked if insufficient
- [ ] Cooldowns applied after casting; blocked if on cooldown ("X ticks remaining")
- [ ] Cooldowns tick down each server tick
- [ ] NPC can die from spell damage (awards XP, ends combat)
- [ ] Spell partial name matching works ("magic" matches "Magic Missile")
## Chargen & Guild Seeding
- [ ] Class selection shows "→ joins <Guild Name>" when class has a guild
- [ ] Creating a character with a class that references a guild auto-joins that guild
- [ ] Starting mana/endurance calculated from guild base + racial stat modifiers
- [ ] Guild membership saved to DB at character creation
## Passive Regeneration
- [ ] Players out of combat slowly regenerate HP over ticks
- [ ] Players out of combat slowly regenerate mana over ticks
- [ ] Players out of combat slowly regenerate endurance over ticks
- [ ] Regeneration does not occur while in combat
- [ ] HP does not exceed max_hp
- [ ] HP/mana/endurance do not exceed their maximums
## Tick Engine
- [ ] Tick runs at configured interval (~3 seconds)