fix(rules): bursts cannot affect creatures in total cover from the point of origin (SRD aiming-a-spell.md: a burst "can't affect creatures with total cover from its point of origin (in other words, its effects don't extend around corners)"; Line of Effect: a burst affects only what it has LoE to from its origin) - _area_creatures skips creatures whose occupied cells have no line of effect from the burst center
This commit is contained in:
@@ -29,7 +29,8 @@ PF1e (CRB, Magic — Aiming a Spell):
|
||||
wall between them shields everything behind it).
|
||||
|
||||
Bursts need no template here: they are circles around a center cell and are
|
||||
resolved by ``CombatEngine._creatures_in_range`` (unchanged).
|
||||
resolved by ``CombatEngine._area_creatures`` (which additionally drops
|
||||
creatures without line of effect from the burst's center).
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
@@ -7116,8 +7116,13 @@ class CombatEngine:
|
||||
) -> list[CombatantState]:
|
||||
"""Creatures intersecting the template of an area effect.
|
||||
|
||||
Burst: circle of ``radius_ft`` around the resolved center ``aim``
|
||||
(unchanged behaviour). Cone/line: the template originates at the
|
||||
Burst: circle of ``radius_ft`` around the resolved center ``aim``,
|
||||
minus every creature that has no line of effect from that center
|
||||
(PF1e CRB "Aiming a Spell" — Burst: a burst "can't affect creatures
|
||||
with total cover from its point of origin (in other words, its
|
||||
effects don't extend around corners)"; CRB "Line of Effect": a burst
|
||||
"affects only an area, creature, or object to which it has line of
|
||||
effect from its origin"). Cone/line: the template originates at the
|
||||
caster's anchor cell and opens toward ``aim`` (PF1e CRB "Aiming a
|
||||
Spell" — see ``areas.py``); a creature is affected when ANY of its
|
||||
occupied cells lies inside the template.
|
||||
@@ -7129,7 +7134,13 @@ class CombatEngine:
|
||||
"""
|
||||
span_cells = effect.radius_ft // _SQUARE_FT
|
||||
if effect.shape == "burst":
|
||||
affected = self._creatures_in_range(aim, span_cells)
|
||||
affected = [
|
||||
state
|
||||
for state in self._creatures_in_range(aim, span_cells)
|
||||
if has_line_of_effect_cells(
|
||||
self._grid, frozenset({aim}), state.occupied_cells()
|
||||
)
|
||||
]
|
||||
else:
|
||||
origin = caster.pos
|
||||
if effect.shape == "cone":
|
||||
|
||||
Reference in New Issue
Block a user