fix(combat): correct spell DC formula

This commit is contained in:
ctan
2026-08-29 20:26:00 +02:00
parent 8b5ba12f46
commit 5c393ec66c
11 changed files with 40 additions and 10 deletions
+5 -2
View File
@@ -834,8 +834,11 @@ class CombatEngine:
f"round {self._current_round} {caster.combatant.id}: "
f"cast {spell_name} -> NO LINE OF EFFECT"
)
return
dc = spell.base_dc + caster.combatant.level
# DC = 10 + spell level + caster's casting ability modifier
ability_name = caster.combatant.casting_ability.lower()
ability_score = getattr(caster.combatant.abilities, f"{ability_name}_score")
ability_mod = (ability_score - 10) // 2
dc = 10 + spell.level + ability_mod
save_result = (
self.resolve_save(target, spell.save, dc) if spell.save != "none" else None
)