I tested a bucket-load of different configurations for this and it appears to be rock solid, I was unable to find fault.
* Correctly deals with multiple decoys according to my understanding of how it breaks ties with them (closest distance by number of squares, then by pythagoras, then by movement order).
* Correctly deals with stealth (doesn't detect player), including working correctly when a timeclone breaks stealth and then vanishes, leaving a stealthed player.
* Correctly deals with invisibility and timeclones including shallow water or via previously collected potion.
* Correctly deals with stalwarts / soldiers, breaking ties in the same way as it does with decoys, except always preferring a stalwart / soldier over the player in a tie between those two (actually, I don't know if this is correct because I don't know what's supposed to happen in this case).
* Correctly deals with decoys being chosen if they are in range and no other target is within 5 squares.
... And a bunch more basic and trivial stuff that doesn't seem worth listing. Nice one
[Last edited by kieranmillar at 11-17-2015 07:29 AM]