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:
2026-09-19 14:08:24 +02:00
parent 389e160627
commit 948edc1815
3 changed files with 61 additions and 5 deletions
+14 -3
View File
@@ -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":