Accepted
Attacks currently do not validate range. With the Grid System in place, we can now enforce range restrictions.
We will add a Range property (in feet) to AttackAction and MonsterAttackAction.
When executing an attack:
- If an
IGridManageris available in theIActionContext:- Retrieve the positions of the source and target creatures.
- Calculate the distance between them using the Grid's distance metric (Chebyshev).
- If the distance exceeds the
Range, the action fails.
- If no Grid is available, range validation is skipped (or assumed successful).
- Positive: Enforces spatial rules. Prevents melee attacks from across the map.
- Negative: Requires updating action constructors. Requires Grid for validation (fallback is lenient).