I’ve attached a grid here to explain what I’m looking for here. Basically I need to first check if a unit is in full cover. If they are, I need to rerun their range trace from the yellow squares. So, from the unit’s location I need to be able to detect the north/south/west/east squares (not diagonal ones for this) from the unit’s position. If any of those are full cover, then I need to recheck the range trace from the 2 appropriate squares. I could have an array of the 3 squares, remove the one that is opposite the one with full cover, and rerun the range trace from the remaining two and store units that can be hit from those traces in a different array (I need to keep a record of this so that I know which square to animate my unit to step out into to fire).
On the opposite side of things. If a unit is in full cover, I should have it “occupy” the squares around it (red and yellow) so that when a range trace is done it returns that the unit can be fired at. I’ll need to change all my full cover things to block range for this to work properly I believe, which is why I need to do additional traces and cover additional tiles. Do any of these functions which returns tiles return them in a way that I can sort of “see” the grid around me? Like Can I return only the north/west/south/east tiles on a square grid and know which direction they are?