tgstation/-tg-station — pull request #2480 by Ergovisavi (2014-01-22 07:22:56+00:00)
Title: Hostile mobs behavior overhaul, 4 new mobs, Protokinetic Gun

Throwing this up here because it definitely needs review; All of this is working as is.

Hostile Mobs Overhaul:
Added new vars for the following functionality:

Aggro vision ranges: Hostile mobs now have an idle and aggro vision range, by default these are both 9, to keep in compliance with old simple mob functionality. When a mob is idle, it uses idle_vision_range, when angry, aggro_vision_range. It goes back to idle if it loses a target.

Target swapping: Hostile mobs have a chance to swap targets when they've been injured, if they find one that's closer, so you can't just keep hitting that space bear in the back with a circular saw while it ignores you and chases someone.

Ranged mobs: Ranged mobs no longer drop their target every time they fire, and will now instead chase targets down to shoot them, while maintaining distance.

Minimum_distance and retreat_distance: minimum_distance sets the minimum amount of distance a hostile mob attempts to close in on a target, retreat_distance sets the amount of tiles they attempt to retreat from their target should they approach.

Search Objects and wanted_objects: Hostile mobs can now search for objects in addition to mobs; This is disabled by default so we don't waste time computing AI searching objects for no raisins. When search_objects = 1, they look for items in their wanted_objects list, and if they find one, treat it like any other target and attempt to follow their normal AI and use the object's attack_animal() when they get close to it. If search_objects == 2, the same behavior above applies, but the mob ignores other mobs until harmed. If search_objects == 3, searching for mobs is disabled and it only searches for objects to attack.

Execute: If execute is set to 1, the mob will attempt to finish off unconscious mobs, if set to 2, it will attempt to attack dead mobs, should you want something to do so.

Attack_self: Attack_self has been expanded, if set to 2, it will only attack mobs that have the SAME faction as the mob.

Hostile mobs will now properly wallsmash their environment, should they have wall_smash set to 1. If set to 2, they can break down rwalls.

4 new mobs & Kinetic gun: These are meant to be fought on the asteroid with the kinetic accelerator, but are ready to go in as is, please see http://www.ss13.eu/phpbb/viewtopic.php?f=13&t=3197 for explanations on what each does.