X-Git-Url: https://plomlompom.com/repos/pick_tasks?a=blobdiff_plain;f=plomrogue%2Fcommands.py;h=a2f98ed1bf989d3195096cf84456815e7da8fc0d;hb=800aca691b359f448599160ba3d8aef28174596d;hp=65b054019b0f38dbb6d492803ec72e821baff28f;hpb=df9a8d0a788b29913dae3eec4ef8113e2d8e9a41;p=plomrogue2 diff --git a/plomrogue/commands.py b/plomrogue/commands.py index 65b0540..a2f98ed 100644 --- a/plomrogue/commands.py +++ b/plomrogue/commands.py @@ -237,7 +237,10 @@ def cmd_MAP_LINE(game, big_yx, y, line): cmd_MAP_LINE.argtypes = 'yx_tuple int:nonneg string' def cmd_MAP(game, geometry, size): - map_geometry_class = globals()['MapGeometry' + geometry] + from plomrogue.mapping import MapGeometryHex, MapGeometrySquare + map_geometry_class = MapGeometrySquare + if geometry == 'Hex': + map_geometry_class = MapGeometryHex game.new_world(map_geometry_class(size)) cmd_MAP.argtypes = 'string:map_geometry yx_tuple:pos' @@ -266,9 +269,17 @@ def cmd_THING(game, big_yx, little_yx, thing_type, thing_id): game.changed = True cmd_THING.argtypes = 'yx_tuple yx_tuple:nonneg string:thing_type int:nonneg' -def cmd_THING_NAME(game, thing_id, name): +def cmd_THING_NAME(game, thing_id, name, connection_id): t = game.get_thing(thing_id) if not t: raise GameError('thing of ID %s not found' % thing_id) t.name = name + game.changed = True cmd_THING_NAME.argtypes = 'int:pos string' + +def cmd_GOD_THING_NAME(game, thing_id, name): + t = game.get_thing(thing_id) + if not t: + raise GameError('thing of ID %s not found' % thing_id) + t.name = name +cmd_GOD_THING_NAME.argtypes = 'int:pos string'