CleverRaven/Cataclysm-DDA — pull request #10601 by Coolthulhu (2014-12-22 23:24:45+00:00)
Title: Automatic aim ai rework

Changes quite significantly the behavior of some hacked bots (tested on tanks, chickens and skitterbots) and turrets with area of effect attacks.

Hacked bots will no longer depend on distance from player to pick an attack and will not skip turns if they can't see the player. Before, they'd attack zombies with the same attack they'd use to attack the player.

Bots (skitters, tanks and chickens) can now zap enemies when hacked. Currently this is always successful when attempted (because player can only dodge tazing with uncanny_dodge). Stun times and damage copied from iuse::tazer.

Made mutant-ignoring turrets attack mutants driving vehicles, because weird animals don't drive vehicles.

Moved range setting of turrets from hardcoded to a json member.

Made turrets consider area of effect of their projectiles. They will ignore any target too close to attack without risking including self in the area of effect.

During my testing it worked nicely, so it's probably fully or at least mostly functional.
I changed the structure of monattack.cpp quite significantly. I moved aiming from functions like frag_tur up to the functions that use them, like multi_robot and chickenbot (otherwise hacked chickens and tanks would aim twice per attack).

I sent a conflicting PR yesterday (manual turrets - conflicting on incredibly minor things, but still), so this is more for a review right now.