feat(rules): magic subsystem — spells, spell strength, LLW spell selection#4
Merged
Conversation
…ction Adds the magic layer that makes the Ley Line Walker a real caster. - schema/spells.ts + content/spells/spells.json — 29 spells across levels 1-4, transcribed from RUE Magic Spells (Range/Duration/Saving Throw/P.P.E./effect), each page-stamped. Includes Armor of Ithan, Energy Bolt, Globe of Daylight, etc. - engine/spells.ts — validated spell book with id/name indexes (collision-checked), spellsByLevel, canCast (P.P.E. affordability), and Spell Strength (RUE p.187: base 12, +1 at each O.C.C. increment level; the d20 a victim must beat to save). - Integrates with the LLW: occSpellStrength() reads its spellStrength bonus (12 at L1 -> 16 by L13), and initialSpellChoices() realizes "3 spells from each of levels 1-4" against the actual spell list. 59 tests pass; `vp check` clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018ur5Eu6dC17feVQH5smrFw
There was a problem hiding this comment.
1 issue found across 5 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Cubic flagged that occSpellStrength ignored a spellStrength bonus that has a `value` but no `atLevels` (base + 0*value). Extract spellStrengthFromBonus(): level-gated bonuses increment per level reached; a flat bonus (no atLevels) is applied once at every level. Tests cover flat, level-gated, and no-bonus cases. 61 tests pass; `vp check` clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018ur5Eu6dC17feVQH5smrFw
There was a problem hiding this comment.
0 issues found across 2 files (changes from recent commits).
Auto-approved: Adds new magic subsystem: spells schema/content (29 spells), spell strength calculus, and Ley Line Walker initial selection. Low-risk additive change with tests.
Re-trigger cubic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the magic layer — the defining Ley Line Walker capability, and the last major LLW-specific subsystem.
What's included
schema/spells.ts+content/spells/spells.json— 29 spells across levels 1–4, transcribed from RUE Magic Spells (Range / Duration / Saving Throw / P.P.E. / effect), each page-stamped. Covers the iconic ones: Armor of Ithan (10 M.D.C./level), Energy Bolt (4D6, dodge 18+), Globe of Daylight, See the Invisible, Charismatic Aura, …engine/spells.ts:spellsByLevel,canCast(P.P.E. affordability),getSpell/getSpellByNameoccSpellStrength()derives it from the LLW's ownspellStrengthbonus: 12 at L1 → 13/14/15/16 at L3/7/10/13initialSpellChoices()realizes the LLW's "3 spells from each of levels 1–4" against the real spell listVerification
vp run rules#test→ 59 tests pass (8 new spell tests)vp run rules#check→ format + lint + typecheck cleanWith this, the Ley Line Walker vertical slice is essentially complete end-to-end (attributes → O.C.C. → P.P.E. → combat/HP → skills → spells). Next up: the Convex backend to seed + serve the validated content and persist built characters.
Summary by cubic
Adds the magic subsystem for Ley Line Walkers: a validated spell book (29 spells, levels 1–4), Spell Strength, and initial spell selection (3 per level). Also fixes how flat O.C.C. Spell Strength bonuses are applied.
New Features
content/spells/spells.json.schema/spells.tsZod types for spells/book, plusspellStrengthBase(12) andritualSaveTarget(16).engine/spells.tswith id/name indexes,getSpell/getSpellByName,spellsByLevel,canCast, Spell Strength viaoccSpellStrength(+1 at LLW 3/7/10/13),saveTargetVsSpell, andinitialSpellChoicesfor "3 from each level 1–4".index.tsexposes the schema and engine.Bug Fixes
spellStrengthbonuses usingspellStrengthFromBonus; level-gated bonuses still increment per listed levels.Written for commit cceeefc. Summary will update on new commits.