feat(rules): SRD Mage Armor spell + non-stacking armor bonus type
SRD spells/mage-armor.md: 'An invisible but tangible field of force surrounds the subject of a mage armor spell, providing a +4 armor bonus to AC' - 'School conjuration (creation) [force]', level 1, 'Casting Time 1 standard action', 'Range touch', 'Duration 1 hour/level (D)', 'Spell Resistance no'. - data/spells/mage_armor.json: buff +4 armor to AC, 600 rounds (1 hour/level modeled fixed, the shield.json convention). Description documents the known simplification: the engine bakes worn armor into the AC total and cannot see it, so the armor bonus stacks additively with that baked value (two mage armors still do not stack). - effects.py: 'armor' added to BonusType; absent from _STACKING_TYPES it behaves as a keep-the-highest type (verified by resolve_modifiers tests). - Spell-count pins 107 -> 108 (test_runner_spells, batch3, test_spells) and the README references. - Golden transcript untouched (buff branch only fires when no offensive spell is selected; the lich still opens with Magic Missile).
This commit is contained in:
@@ -3,7 +3,8 @@
|
||||
Given: the registry directory with the 11 original spells plus batches 1-2 (75)
|
||||
When: load_spell_registry / load_spell is called
|
||||
Then: every batch-3 spell loads with the expected level/school/range/save,
|
||||
the registry reaches exactly 107 (11 + 96), every effect validates against the
|
||||
the registry reaches exactly 108 (11 + 96 + the SRD-conformance mage armor),
|
||||
every effect validates against the
|
||||
schema (parsing raises on any unknown field value or condition), and the
|
||||
registry covers EVERY spell name referenced by data/pcs/*.json (no missing
|
||||
spell remains).
|
||||
@@ -113,9 +114,11 @@ class TestBatch3Loading:
|
||||
assert spell.base_dc == 10
|
||||
assert spell.description
|
||||
|
||||
def test_registry_reaches_107(self) -> None:
|
||||
def test_registry_reaches_108(self) -> None:
|
||||
reg = load_spell_registry(_SPELLS_DIR)
|
||||
assert len(reg) == _BATCH2_COUNT + 32 == 107
|
||||
# +1: mage_armor.json, added by the SRD conformance pass (not a
|
||||
# batch-3 PC-sheet spell).
|
||||
assert len(reg) == _BATCH2_COUNT + 32 + 1 == 108
|
||||
assert set(_BATCH3) <= set(reg)
|
||||
|
||||
def test_every_effect_validates(self) -> None:
|
||||
|
||||
Reference in New Issue
Block a user