feat(combat): support multi-cell occupancy for large and larger creatures
This commit is contained in:
+8
-2
@@ -184,11 +184,17 @@ def test_sword_plus_reach_weapon_union() -> None:
|
||||
|
||||
|
||||
def test_large_creature_sword_threatens_disk_radius_2() -> None:
|
||||
"""A Large creature (natural reach 10 ft) with a 5 ft sword threatens the disk of radius 2."""
|
||||
"""A Large creature (2x2 footprint, natural reach 10 ft) with a 5 ft sword
|
||||
threatens the union of radius-2 disks around each occupied cell."""
|
||||
giant = make_combatant("giant", size="Large")
|
||||
state = make_state(giant, "players", (3, 3))
|
||||
engine = make_engine([state])
|
||||
assert engine._threatened_squares(state) == frozenset(_disk((3, 3), 2))
|
||||
footprint = state.occupied_cells()
|
||||
expected = set()
|
||||
for cell in footprint:
|
||||
expected |= _disk(cell, 2)
|
||||
expected -= footprint
|
||||
assert engine._threatened_squares(state) == frozenset(expected)
|
||||
|
||||
|
||||
def test_unknown_size_defaults_to_5ft() -> None:
|
||||
|
||||
Reference in New Issue
Block a user