feat(spells): heal (GHY REN) + readability + test scaffolding #82

Merged
marco merged 3 commits from feat/spell-heal into main 2026-07-19 11:13:33 +02:00
Owner

Slice 2b, part 1 — the heal form, plus two things that came up while testing it.

Heal (GHY REN)

Self-only HP restore: HealBase + Magery bonus, capped at MaxHits. Water is the restorative element, so fire + heal is an invalid combination. The catalog now distinguishes a known form with the wrong element (InvalidCombination"Those words dont combine.") from a form nothing casts yet (SpellNotImplemented).

  • HealSpell + catalog entry + SpellCatalog.KnowsForm
  • SpellCastResult.Healed carries the amount; WorldTick broadcasts a new Healed message in AoI
  • Client: key 5 = REN, self forms cast without a target, green +N floats over the caster
  • SpellOptions/GameOptions.HealBase; docs/spells.md updated
  • Heal sparkle VFX is a follow-up (#80) — for now the number is the feedback

Readability

The HUD font is already bold (#78); the floating combat numbers were still washed out because — unlike the power words — they had no outline. Added the same black outline to damage/heal/miss numbers.

Test scaffolding (DRY)

Every gameplay test re-declared the same 11-line open map + spawn + new World(...) shell. Extracted a single TestWorld helper (OpenMap + Spawn + an Open() factory mirroring the ctor) and routed the tests through it.

Definition of Done

  • Casting 2 → 5 (GHY REN) heals the caster; a green +N shows when below max, nothing when full.
  • 1 → 5 (fire + heal) fizzles with "Those words dont combine."; shield still reads "not implemented."
  • Damage/heal/miss numbers are legible (outlined) over the world.
  • No gameplay test declares its own open-map string; all use TestWorld.
  • Suite green, whole solution builds, zero warnings.
Slice 2b, part 1 — the **heal** form, plus two things that came up while testing it. ### Heal (GHY REN) Self-only HP restore: `HealBase` + Magery bonus, capped at MaxHits. Water is the restorative element, so **fire + heal is an invalid combination**. The catalog now distinguishes a known form with the wrong element (`InvalidCombination` — _"Those words dont combine."_) from a form nothing casts yet (`SpellNotImplemented`). - `HealSpell` + catalog entry + `SpellCatalog.KnowsForm` - `SpellCastResult.Healed` carries the amount; `WorldTick` broadcasts a new `Healed` message in AoI - Client: **key 5 = REN**, self forms cast without a target, green **+N** floats over the caster - `SpellOptions`/`GameOptions.HealBase`; `docs/spells.md` updated - Heal sparkle VFX is a follow-up (#80) — for now the number is the feedback ### Readability The HUD font is already bold (#78); the floating combat numbers were still washed out because — unlike the power words — they had no outline. Added the same black outline to damage/heal/miss numbers. ### Test scaffolding (DRY) Every gameplay test re-declared the same 11-line open map + spawn + `new World(...)` shell. Extracted a single `TestWorld` helper (`OpenMap` + `Spawn` + an `Open()` factory mirroring the ctor) and routed the tests through it. ## Definition of Done - [ ] Casting **2 → 5** (GHY REN) heals the caster; a green **+N** shows when below max, nothing when full. - [ ] **1 → 5** (fire + heal) fizzles with _"Those words dont combine."_; **shield** still reads _"not implemented."_ - [ ] Damage/heal/miss numbers are legible (outlined) over the world. - [ ] No gameplay test declares its own open-map string; all use `TestWorld`. - [ ] Suite green, whole solution builds, zero warnings.
The heal form restores the caster's own HP (self-only, no target/LOS): HealBase
plus a Magery bonus, capped at MaxHits. Water is the restorative element, so
fire + heal is an invalid combination — the catalog distinguishes a known form
with the wrong element (InvalidCombination) from a form nothing casts yet
(SpellNotImplemented).

- HealSpell + catalog entry + SpellCatalog.KnowsForm
- SpellCastResult.Healed carries the amount; WorldTick broadcasts Healed in AoI
- Client: key 5 = REN, self forms cast without a target, green +N over the caster
- SpellOptions/GameOptions.HealBase; docs/spells.md updated

FX is the floating amount for now; the UO heal sparkle art is a follow-up.
Damage/heal/miss numbers were drawn plain and washed out over the scene, unlike
the outlined power words. Draw them with the same black outline so they stay
legible on any background (the HUD font is already bold).
test: extract shared TestWorld scaffolding
All checks were successful
ci / Lint & Test (pull_request) Successful in 1m58s
b8c86403ba
Every gameplay test re-declared the same 11-line open map, spawn point and a
`new World(...)` shell. Move them to a single TestWorld helper (OpenMap + Spawn
+ an Open() factory mirroring the World constructor with the map defaulted) and
route the tests through it. No behaviour change.
marco merged commit 2186b3fe76 into main 2026-07-19 11:13:33 +02:00
marco deleted branch feat/spell-heal 2026-07-19 11:13:33 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
marco/IsoMmo!82
No description provided.