CleverRaven/Cataclysm-DDA — pull request #9984 by BevapDin (2014-11-11 17:39:24+00:00)
Title: List npcs and monsters in the monsters list.

Implements a `attitude_to` function in the Creature class, it's basically a wrapper to the attitude functions of the npc and monster class. Because both of those wrapped function return different things (`monster_attitude`/`npc_attitude`), the function returns only a common subset of those: hostile, neutral, friendly, but this can be extended. Ideally the monster and npc specific attitude functions / enums can be merged into on Creature attitude system.

This allows some checks to be reduced to Creature functions, instead of handling monsters and npc separately:

- When targeting, sorting creatures by their attitude first (hostile, neutral, friendly) and by distance if the attitude is the same. This will sort nearby friendly creatures *behind* further away hostile creatures. The list still includes all creatures in range.
- When burst firing selects new targets, friendly creatures are excluded, neutral creatures are still include. With trigger happy there is a 10 % chance for each friendly creature that it is included. Note that the new target is selected randomly from that list, so it's still pretty unlikely to target a friendly creature. Only if there are much more friendly, than non-friendly creatures around, it becomes likely to target them.
- Getting npcs and monsters via `player::get_visible_creatures()` and displaying them in the nearby monsters list.