Skip to content

Living vitals: current vs. max — P.P.E. spend on cast, damage tracking, recovery #38

Description

@StreamDemon

Noticed post-#10: the P.P.E. bar is live (streams from Convex) but casting a spell doesn''t spend — the cast only prints to the telemetry log. Deferred from PR #37.

Root cause: there is no current vitals state anywhere. The schema stores only rolled (the maximums); the bars always render full.

Proposed shape

  • Persistent current vitals on the character document (current: { hitPoints?, sdc?, ppe? }), defaulting to the rolled maximums when absent. Persistent (not client state) so it survives refresh, syncs across devices, and becomes shared table state for the future VTT.
  • Mutations: spendPpe (cast decrements by the spell''s cost, floor 0, reject when insufficient — the sheet should refuse a cast you can''t afford), applyDamage (S.D.C. depletes before H.P., per RUE), heal/restore.
  • Sheet: bars fill by current / max; cast click spends and logs > CAST :: ENERGY BOLT — 5 P.P.E. [79/84]; insufficient P.P.E. renders the spell row dead-steel.
  • Recovery (rules layer, page-stamped): P.P.E. regeneration at rest/sleep rates and ley-line/nexus draw per RUE — needs rulebook extraction; H.P./S.D.C. recovery likewise. Can land as a follow-up to the plumbing.

Out of scope

M.D.C. armor, temporary P.P.E. batteries, death/coma state machine (the -P.E. floor already displays).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions