Update test checklist for tick-based combat and status effect systems

Add test cases for: tick engine lifecycle, tick-based combat resolution,
NPC AI auto-engage, defend command, queued flee/use, status effects
(poison, regen, expiration), passive HP regen, combat RNG variance,
and movement lockout during combat. Update smoke test with tick-timing test.

Made-with: Cursor
This commit is contained in:
AI Agent
2026-03-14 14:34:00 -06:00
parent e7aac6d1dd
commit 1d344225d3

View File

@@ -10,6 +10,7 @@ Run through these checks before every commit to ensure consistent feature covera
- [ ] Server starts: `RUST_LOG=info ./target/debug/mudserver` - [ ] Server starts: `RUST_LOG=info ./target/debug/mudserver`
- [ ] World loads all rooms, NPCs, objects, races, classes (check log output) - [ ] World loads all rooms, NPCs, objects, races, classes (check log output)
- [ ] Database opens (or creates) successfully - [ ] Database opens (or creates) successfully
- [ ] Tick engine starts and logs tick rate
## Character Creation ## Character Creation
- [ ] New player SSH → gets chargen flow (race + class selection) - [ ] New player SSH → gets chargen flow (race + class selection)
@@ -20,12 +21,14 @@ Run through these checks before every commit to ensure consistent feature covera
## Player Persistence ## Player Persistence
- [ ] Reconnecting player skips chargen, sees "Welcome back!" - [ ] Reconnecting player skips chargen, sees "Welcome back!"
- [ ] Room, stats, inventory, equipment all restored from DB - [ ] Room, stats, inventory, equipment all restored from DB
- [ ] Status effects do NOT persist across sessions (cleared on login)
- [ ] Verify with: `sqlite3 mudserver.db "SELECT * FROM players;"` - [ ] Verify with: `sqlite3 mudserver.db "SELECT * FROM players;"`
## Movement & Navigation ## Movement & Navigation
- [ ] `go north`, `n`, `south`, `s`, etc. all work - [ ] `go north`, `n`, `south`, `s`, etc. all work
- [ ] Invalid direction shows error - [ ] Invalid direction shows error
- [ ] Room view shows: NPCs (colored by attitude), objects, exits, other players - [ ] Room view shows: NPCs (colored by attitude), objects, exits, other players
- [ ] Cannot move while in combat (combat lockout)
## NPC Interaction ## NPC Interaction
- [ ] `examine <npc>` shows description, stats, attitude label - [ ] `examine <npc>` shows description, stats, attitude label
@@ -33,23 +36,61 @@ Run through these checks before every commit to ensure consistent feature covera
- [ ] `talk <hostile>` shows snarl message - [ ] `talk <hostile>` shows snarl message
- [ ] Dead NPCs don't appear in room view - [ ] Dead NPCs don't appear in room view
## Combat ## Combat - Tick-Based
- [ ] `attack <aggressive/hostile npc>` initiates combat - [ ] `attack <aggressive/hostile npc>` enters combat state
- [ ] Can't attack friendly/neutral NPCs - [ ] Can't attack friendly/neutral NPCs
- [ ] Combat rounds show damage dealt and received - [ ] Combat rounds resolve automatically on server ticks (not on command)
- [ ] Player receives tick-by-tick combat output (damage dealt, damage taken)
- [ ] Default combat action is "attack" if no other action queued
- [ ] `defend` / `def` sets defensive stance (reduced incoming damage next tick)
- [ ] NPC death: awards XP, shifts attitude -10, shifts faction -5 - [ ] NPC death: awards XP, shifts attitude -10, shifts faction -5
- [ ] Player death: respawns at spawn room with full HP - [ ] Player death: respawns at spawn room with full HP, combat cleared
- [ ] NPCs respawn after configured time - [ ] NPCs respawn after configured time
- [ ] Combat lockout: can only attack/flee/look/quit during combat - [ ] Combat lockout: can only attack/defend/flee/look/use/quit during combat
- [ ] `flee` exits combat - [ ] `flee` queues escape attempt — may fail based on stats
- [ ] `use <item>` in combat queues item use for next tick
- [ ] Multiple ticks of combat resolve correctly without player input
- [ ] Combat ends when NPC dies (player exits combat state)
- [ ] Combat ends when player flees successfully
## Combat - NPC AI
- [ ] Hostile NPCs auto-engage players who enter their room
- [ ] Aggressive NPCs do NOT auto-engage (only attackable, not initiating)
- [ ] NPC attacks resolve on tick alongside player attacks
- [ ] NPCs in combat continue attacking even if player sends no commands
## Combat - RNG
- [ ] Damage varies between hits (not identical each time)
- [ ] Multiple rapid attacks produce different damage values
## Items ## Items
- [ ] `take <item>` picks up takeable objects - [ ] `take <item>` picks up takeable objects
- [ ] `drop <item>` places item in room - [ ] `drop <item>` places item in room
- [ ] `equip <weapon/armor>` works, old gear returns to inventory - [ ] `equip <weapon/armor>` works, old gear returns to inventory
- [ ] `use <consumable>` heals and removes item - [ ] `use <consumable>` heals and removes item (immediate out of combat)
- [ ] `use <consumable>` in combat queues for next tick
- [ ] `inventory` shows equipped + bag items - [ ] `inventory` shows equipped + bag items
## Status Effects
- [ ] Poison deals damage each tick, shows message to player
- [ ] Regeneration heals each tick, shows message to player
- [ ] Status effects expire after their duration (in ticks)
- [ ] `stats` command shows active status effects and remaining duration
- [ ] Multiple status effects can be active simultaneously
- [ ] Status effects cleared on player death/respawn
## Passive Regeneration
- [ ] Players out of combat slowly regenerate HP over ticks
- [ ] Regeneration does not occur while in combat
- [ ] HP does not exceed max_hp
## Tick Engine
- [ ] Tick runs at configured interval (~2 seconds)
- [ ] Tick processes: NPC AI → combat rounds → status effects → respawns → regen
- [ ] Tick output is delivered to players promptly
- [ ] Server remains responsive to immediate commands between ticks
- [ ] Multiple players in separate combats are processed independently per tick
## Attitude System ## Attitude System
- [ ] Per-player NPC attitudes stored in DB - [ ] Per-player NPC attitudes stored in DB
- [ ] `examine` shows attitude label per-player - [ ] `examine` shows attitude label per-player
@@ -150,6 +191,24 @@ ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p 2222 newplaye
quit quit
EOF EOF
# Test 6: Tick-based combat (connect and wait for ticks)
./target/debug/mudtool settings set registration_open true
./target/debug/mudtool players delete smoketest
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p 2222 smoketest@localhost <<'EOF'
1
1
go south
go south
attack thief
EOF
# Wait for several combat ticks to resolve
sleep 8
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p 2222 smoketest@localhost <<'EOF'
stats
quit
EOF
# Verify XP changed (combat happened via ticks)
# Cleanup # Cleanup
./target/debug/mudtool settings set registration_open true ./target/debug/mudtool settings set registration_open true
./target/debug/mudtool players delete smoketest ./target/debug/mudtool players delete smoketest