Cool, FindAllPossibleTargets could do the trick. By default It gives unit indexes but looking at it I think it would be relatively easy to modify to give tile indexes.
I feel stupid missing that but a lot of changes have been made in the updated version with multi tile units and I’m still following the changes.
Well It’s a little deeper than that :). To give a value of a tile to AI (which is not that hard) I’d need to get that value from somewhere first. In Jungle raid it’s based on pregenerated cover array and distance to enemy units. In my case this is where FindAllPossibleTargets (tiles?) comes in (or crudely modified Pathfinding alternative that I made). I’m checking each enemy pawn to see if it is able to attack this specific tile. If yes then danger value of the tile == the damage value of that pawn/or a sum of damage values in case multiple pawns are able to reach the tile.
The thing is my project is based on Jungle Raid but it is melee, not ranged - with different weapons equipped by pawns (each weapon activating a specific set of skills) different types of armor protecting from specific types of damage etc. And typical attack range is 1-2 tiles. So there’s a need for more complex calculations for AI to keep units in line and not rush into enemy-controlled areas with poor armor and weak weapons. Also a protection bonus comes not from the covers but from friendly pawns at adjacent tiles.