Skip to content

feat(healer): vitality healing, spell slot mutex, dead detection#7330

Open
MahtraDR wants to merge 14 commits intoelanthia-online:mainfrom
MahtraDR:feat/healer-vitality-healing
Open

feat(healer): vitality healing, spell slot mutex, dead detection#7330
MahtraDR wants to merge 14 commits intoelanthia-online:mainfrom
MahtraDR:feat/healer-vitality-healing

Conversation

@MahtraDR
Copy link
Copy Markdown
Collaborator

@MahtraDR MahtraDR commented Mar 17, 2026

Summary

  • Complete rewrite of healer.lic with parallel patient processing and non-blocking spell slot state machines
  • Non-blocking queue via DownstreamHook: line monitor fires for every game line before it reaches the script buffer, so arrival/whisper/gesture triggers are never consumed by blocking bput/fput calls during patient processing
  • Wounds before vitality: bleeding causes vitality loss, so wound transfer always takes priority over VH -- no more early VH claim while patient is still wounded
  • Vitality Healing via VH spell (configurable vh waggle_set), with prep-first approach and reactive VH casting
  • Spell slot mutex: FP, CD, and VH block each other (one at a time), while wound transfers interleave freely for other patients
  • Dead patient detection: blocking heal via basic empathic link (no Unity), transfers all wounds in a loop with self-healing between rounds
  • Emergency fall safety: if own vitality drops below 30%, fall to break all Unity links, enter recovery mode, resume when healthy
  • Parasite/leech tending from perceived parasites (no spell needed, interleaves with wounds)
  • Link Unity validation at startup via silent issue_command -- hard exit if not available
  • VH waggle validation at startup -- prints example YAML config if vh waggle_set is missing
  • Self-vitality floor (60%) safety net prevents taking vit when own health is dangerously low
  • Spell slot timeout (45s) prevents permanent lock from stuck game state
  • Friends-only filtering, moongate/arrival/gesture/lean/offer triggers
  • Passive self-healing via Heal/Regenerate (30s max wait, spell-conflict-safe)

Architecture

DownstreamHook (IO thread)          Main loop (script thread)
  |                                   |
  v                                   v
queue_from_line(line)               drain buffer (gets?)
  |                                   |
  +-- match triggers? -> add_patient  process_queue()
  |                                     |
  +-- pass line through unchanged       +-- emergency check
                                        +-- spell slot processing (FP/CD/VH)
                                        +-- wound/patient processing
                                        +-- heal_self

The hook fires for every game line before it reaches the script buffer. Blocking operations in process_queue (bput, perceive_health_other, wait_for_passive_healing) consume lines from the buffer but can never consume trigger lines because the hook already processed them.

Settings

friends: [Tenuk, Navesi, Emeshest]
healer_waggle_set: healme
cambrinth: cambrinth ring
waggle_sets:
  vh:
    Vitality Healing:
      mana: 5
      cambrinth:
        - 5
      prep_time: 3

Test plan

  • 65 RSpec examples pass (queue, spell slot, dead detection, triggers, parasites, VH state machine, afflictions, health checks, timeouts)
  • Live test: patients no longer missed when healer is busy with other patients (DownstreamHook fix)
  • Live test: wound healing, disease transfer, vitality healing end-to-end (Emeshest session)
  • Live test: verify dead patient blocking heal cycle
  • Live test: verify emergency fall recovery
  • Live test: verify spell slot timeout recovery

🤖 Generated with Claude Code

MahtraDR and others added 14 commits March 17, 2026 14:29
…etection

Complete rewrite of the healer script with parallel patient processing,
non-blocking spell slot state machines for FP/CD/VH, dead patient
detection, parasite tending, and comprehensive test coverage.

New features:
- Vitality Healing via VH spell (non-blocking state machine)
- Spell slot mutex: FP/CD/VH block each other, wounds interleave freely
- Dead patient detection (checks HealthResult.dead, whispers to get cleric)
- Parasite/leech tending from perceive_health parasites
- Link Unity validation at startup (fail-fast)
- VH waggle_set validation with example YAML on missing config
- Touch-based vitality check after wounds clear
- Self-vit floor (60%) safety net for vit transfers
- Spell slot timeout (45s) prevents permanent lock
- Friends-only filtering, moongate/arrival/gesture triggers
- Passive self-healing via Heal/Regenerate (30s max wait)
- Familiar window logging, scholarship teaching

65 RSpec examples covering queue management, spell slot mutex,
dead detection, trigger patterns, parasites, vitality state machine,
affliction processing, health checks, and timeout behavior.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ty fix

- Add DownstreamHook line monitor so arrival/whisper/gesture triggers are
  never consumed by blocking bput/fput calls during patient processing
- Defer teaching to heal_patient via needs_teach flag (hooks can't fput)
- scan_room_for_patients at startup catches pre-existing room occupants
- Remove early VH claim -- wounds always healed before vitality (bleeding
  causes vit loss, so stopping the bleed is higher priority)
- Add emergency fall safety (break all links if vitality < 30%)
- Add dead patient blocking heal (massive wounds via basic empathic link)
- Add spell_conflict? helper, case-insensitive spell slot matching
- Fix patient_ready? returning true for unknown patients

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant