Visibility and Cover
Some of the last combat related mechanics we needed to implement were visibility and cover. These mechanics expand the combat by introducing more tactical options for the player.
Visibility restricts the locations & targets where an ability can be used (no more shooting around corners in this game!). Cover allows for units to safeguard themselves even when they are visible.
Visibility
To detect visible tiles we perform a check from each tile corner to the target tile. If any of the corners have an unobstructed line of sight to the target tiles corner then the target tile is visible.
Here's what that looks like in practice. The tiles highlighted blue are visible to the blue unit. The tiles without a highlight can't be used as a target for most abilities in the game.
Cover
A unit gets cover in a 180 degree arc when they are partially visibile.
There are two types of cover: partial/half and full. Partial cover negates one damage while full cover mitigates two.