Accepted
We have implemented spell casting (slot consumption) and concentration, but spells do not yet apply their primary effects: Damage and Healing. We need a standardized way to define and apply these effects.
We will expand the ISpell interface and CastSpellAction to handle damage and healing.
-
ISpell Interface:
IReadOnlyList<DamageFormula> Damage { get; }: A list of damage formulas (Dice + Type).string? HealingDice { get; }: Dice formula for healing (e.g., "1d8").SaveEffect SaveEffect { get; }: Enum defining effect of a successful save (None, HalfDamage, Negate).
-
CastSpellAction:
- Will be responsible for rolling the dice.
- Will iterate over targets (from
ActionContext). - Will trigger saving throws on targets if required.
- Will calculate final damage based on save result.
- Will call
target.HitPoints.TakeDamageortarget.HitPoints.Heal.
-
5e.tools Data:
- We will parse the
damagearray for damage types. - We will parse
healingentries (often inmetaor inferred from description/school, but 5e.tools usually has specific fields for scaling). Correction: 5e.tools often puts healing inentriesor specificscalingobjects. We might need to look for specific tags or just parse thedamagefield which sometimes contains healing in other schemas, but for 5e.tools it's often distinct. We will start with standarddamageparsing and look forhealingproperty if it exists in the JSON, or infer fromentriesif needed.
- We will parse the
- Positive: Spells will finally have mechanical impact on HP.
- Negative: Parsing 5e.tools healing data might be complex as it's less standardized than damage.
- Risks: Complex spells (e.g. "Ice Storm" doing bludgeoning + cold) need careful parsing.
DamageFormulastruct/class:{ string Dice, DamageType Type }.SaveEffectenum:None,Half,Negate.