refactor(gameserver): Spell hierarchy + SpellCatalog #79
No reviewers
Labels
No labels
alpha:wave-0
alpha:wave-1
alpha:wave-2
alpha:wave-3
area:assets
area:combat
area:ecology
area:infra
area:render
area:scripting
area:ui
area:world
enhancement
epic
migration
post-alpha
roadmap
tech-debt
type:bug
type:chore
type:design
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
marco/IsoMmo!79
Loading…
Reference in a new issue
No description provided.
Delete branch "refactor/spell-catalog"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pulls spell resolution out of the incantation FSM into a small class hierarchy, as agreed ("una classe per Spell, come per i mobiles"). Zero behaviour change — the existing
IncantationTests+TrainingDummyTestsare the regression net and stay green.Before
SpellSystem.Resolveswitched on the form, hard-coded the bolt (target/LOS/range/damage) and held theBoltDamageformula.After
Gameplay/Spells/(new namespace, one type per file):Spell(abstract:Element,Form,Resolve),BoltSpell(the shared bolt logic),FireBolt/WaterBolt(element + base damage only),SpellCatalog((element,form) -> Spell),SpellContext(resolution inputs bundled).SpellSystem.Resolvenow: train Magery →catalog.TryGet(element, form)→ miss ⇒SpellNotImplementedfizzle (identical to before), hit ⇒spell.Resolve(ctx). No per-form switch, no bolt formula in the FSM.This is the seam for slice 2b: shield (KOR) and heal (REN) become a new
Spellsubclass + one catalog entry each, and invalid pairings (e.g. fire+heal) fall out of theTryGetmiss.No protocol / client / persistence change.
Definition of Done
SpellSystemcontains no bolt damage/target/LOS/range logic — it delegates to aSpellfrom the catalog.Spellsubclass + oneSpellCatalogentry (no edit to the FSM resolve path).IncantationTests+TrainingDummyTestspass unchanged (fire & water bolt still land with the same damage; unknown forms still fizzle as not-implemented).7e44741c976a77dbf385