X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;f=plomrogue%2Fcommands.py;h=8732bf3f02eca9ccff649ec98d4316ab7e99153b;hb=06c3b773099e2264831d5f4b4650eadb9290b296;hp=3b2464b42baa6d7c429832ea34138c970d00570d;hpb=2ce340a97606c970eb1d6dd8cccee7a2d12c6c05;p=plomrogue2 diff --git a/plomrogue/commands.py b/plomrogue/commands.py index 3b2464b..8732bf3 100644 --- a/plomrogue/commands.py +++ b/plomrogue/commands.py @@ -211,3 +211,10 @@ def cmd_THING(game, yx, thing_type, thing_id): game.things += [t_new] game.changed = True cmd_THING.argtypes = 'yx_tuple:nonneg string:thing_type int:nonneg' + +def cmd_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_THING_NAME.argtypes = 'int:pos string'