CleverRaven/Cataclysm-DDA — pull request #6012 by BevapDin (2014-02-07 20:16:23+00:00)
Title: Add a blacklist & whitelist for monsters, whitelist for items

This extends the previous PR.

Rivet suggested a whitelist, which first sounded like a terrible complicated thing, but actually isn't, because it's just an inverted blacklist. At the time the blacklist/whitelist get applied, the game already knows all things and can simply put everything that is not on the whitelist into the blacklist.

Item whitelist: any item not in the white list is removed as if it were in a blacklist. Blacklist takes precedence (items in both lists are removed).

This works the same for monsters. The format is the similar, too:
```
{
"type": "MONSTER_WHITELIST",
"monsters": ["mon_zombie", "mon_zombie_dog"]
},
{
"type": "MONSTER_BLACKLIST",
"monsters": ["mon_boomer"]
},
{
"type": "ITEM_WHITELIST",
"items": ["2x4","rock","hammer"]
}
```

My testing indicates that it's working as expected: putting only mon_zombie into the whitelist results in only normal zombies in cities, no wild animals. Going to an anthill: no ants, even inside of the anthill are only some ant larvae, which are spawned in mapgen.cpp directly without going through a monster group. Some other monsters (web spiders) are also contained in the code directly.

Blacklist/whitelist of monster species is complicated: monster might have several species, what than? Monster x has species A and B, A is on whitelist, B on blacklist?

Also death drops or in C++ coded item creation can lead to situations were the player has some item but can't use it, as all recipe that used the item have been changed to exclude that item.

Another note: monster groups without any monster are possible and do not harm the game. This is not true for item groups. It will spawn debug messages effectively saying that the item group is empty, perhaps this should be changed?

Btw. several json entries of blacklist/whitelist type are combined:
```
{ "type": "ITEM_WHITELIST", "items": ["rock"] },
{ "type": "ITEM_WHITELIST", "items": ["2x4"] }
```
is equal to
```
{ "type": "ITEM_WHITELIST", "items": ["rock", "2x4"] }
```

Furniture/terrain should generally not be disabled, it is essentially for mapgen.
Doing this for overmap terrain sounds doable, but this should go into a general move-to-json approach.

Also fixes a bug where the construction had not been removed from all data structures using it.

The whole recipe_map/recipe_names/craft_cat/... should be moved into a class with proper access functions to ensure there are no dangling pointers.