From: Christian Heller Date: Wed, 24 Feb 2016 21:45:30 +0000 (+0100) Subject: Server: Add terrain description to things_here command. X-Git-Tag: tce~161 X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/%7B%7Bdb.prefix%7D%7D/%7B%7Bprefix%7D%7D/static/process?a=commitdiff_plain;h=8c32a319ac3378e5c07f4d2cc34d671f5efdb1d1;p=plomrogue Server: Add terrain description to things_here command. --- diff --git a/server/commands.py b/server/commands.py index 3717202..d002ab3 100644 --- a/server/commands.py +++ b/server/commands.py @@ -49,6 +49,9 @@ def command_thingshere(str_y, str_x): if None != y and None != x and y < length and x < length: pos = (y * world_db["MAP_LENGTH"]) + x strong_write(io_db["file_out"], "THINGS_HERE START\n") + terrain = chr(world_db["Things"][0]["T_MEMMAP"][pos]) + terrain_name = world_db["terrain_names"][terrain] + strong_write(io_db["file_out"], "terrain: " + terrain_name + "\n") if "v" == chr(world_db["Things"][0]["fovmap"][pos]): for id in [id for tid in sorted(list(world_db["ThingTypes"])) for id in world_db["Things"] diff --git a/server/config/world_data.py b/server/config/world_data.py index 97725a3..ec1e9b1 100644 --- a/server/config/world_data.py +++ b/server/config/world_data.py @@ -13,7 +13,13 @@ world_db = { "PLUGIN": [], "ThingActions": {}, "ThingTypes": {}, - "Things": {} + "Things": {}, + "terrain_names": { + " ": "UNKNOWN", + "X": "TREE", + "~": "SEA", + ".": "EARTH" + } } """Mapping of direction names to internal direction chars."""