CleverRaven/Cataclysm-DDA — pull request #4442 by atomicdryad (2013-11-17 17:14:18+00:00)
Title: [WIP] set mapgen function(s) via json, allow terrain to have a list of possible c++, lua, or json-based mapgen functions.

This will eventually allow drop-in mods to add to a pool of possible variations. Example;
"house" currently has 3 mapgen_function_builtin entries;
"type" : "overmap_terrain",
"id" : "house", (snip)
"mapgen": [
{ "type": "builtin", "name": "house_generic_boxy" },
{ "type": "builtin", "name": "house_generic_big_livingroom" },
{ "type": "builtin", "name": "house_generic_center_hallway" }
]

A mod may add to this:
{ "type": "json", "object": { bunch-o-json-stuff-here },
or
{ "type": "lua", "script": "bunch-o-lua-code-here" },

During mapgen, the game picks randomly from the above, for a 1-in-5 chance.

TODO:
* Move mapgen if-else-zomg-stuff into mapgen_function_builtins
* mapgen_draw_lua(...)
* mapgen_draw_json( ...)
* data/mod/whatever.json: "type": "mapgen", "terrains": [ "house", "house_basement" ], "type": "whatever", ....}
The latter should allow uses to throw in any number of hey_look_I_made_a_mapgen_for_whatever_overmap_terrain_type.jsons into the mod directory

TODO later
* "weight": 1-1000 * modify chance of roll success
* "unique_name": "something", "unique_max": 1 * for mods that add a single unique type of whatever (this might be better as an oter_t)
* Pass region data to function, when region data is done (ie, this neck of the woods has a spider infestation, or this is a desert so the swimming pool is dried up)