death #539

Merged
scion merged 7 commits from death into master 2026-06-13 12:36:38 -07:00
Owner

When someone is killed in a fight, create a corpse and transfer their items into it. Teleport them back to spawn and reset them to full HP.

When someone is killed in a fight, create a corpse and transfer their items into it. Teleport them back to spawn and reset them to full HP.
- Move commService calls inside the fight guard so empty outputs are never sent
- When either combatant is already dead (HP <= 0 at tick start), skip all combat
  and let only the resurrection logic run
- Add testResurrectionFilterOnlyIncludesDeadCharacters to verify the filter
  predicate (c.getCharacter().getHitPoints() <= 0) correctly selects only
  dead characters, killing all three surviving Pitest mutations:
    - changed conditional boundary (<= -1)
    - negated conditional (> 0)
    - replaced boolean return with true
- Fix testFightAttackerDead and testFightDefenderDead to expect 0 hits
  when a combatant is already dead
When a character dies in combat, all items they were holding are moved
into the corpse. The transfer clears worn slots and held references so
items report correctly while inside the corpse container. Uses saveAll()
for bulk persistence.
set corpse short/long descriptions based on dead character name
All checks were successful
CI Build & Test / build-and-test (pull_request) Successful in 4m39s
42ead96dc2
The corpse's short description is "<name>'s corpse" and long
description is "<Name>'s corpse is lying on the ground." — with the
first letter of the name capitalized for NPC corpses (e.g. "A kobold's
corpse..." instead of "a kobold's corpse...").
separate player vs NPC death handling
All checks were successful
CI Build & Test / build-and-test (pull_request) Successful in 4m13s
1bd0ed6a47
- NPCs: after creating corpse and transferring items, delete the MudCharacter permanently (no resurrection)
- Players: keep the character entity for later resurrection logic
- Removed redundant save() call at end of doHit to prevent double-saves
- Added test verifying NPC characters are deleted via repository.delete()
scion force-pushed death from 1bd0ed6a47
All checks were successful
CI Build & Test / build-and-test (pull_request) Successful in 4m13s
to 4cad4d04cf
All checks were successful
CI Build & Test / build-and-test (pull_request) Successful in 4m36s
2026-06-13 12:24:14 -07:00
Compare
scion self-assigned this 2026-06-13 12:24:29 -07:00
Author
Owner

Closes #443

Closes #443
scion merged commit 66998b477a into master 2026-06-13 12:36:38 -07:00
scion deleted branch death 2026-06-13 12:36:38 -07:00
Sign in to join this conversation.
No description provided.