X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/calendar?a=blobdiff_plain;f=plomrogue%2Fcommands.py;h=373d32931beaa587dc3bd8f453e4274c5fdf6f60;hb=875642f0ff9420b94f6399b05bb849b12118f6e2;hp=07bfae0e1b905f8141fe281d1c475b44fcd400e0;hpb=b011e37d62013a92db46b89633ba7217aff98998;p=plomrogue2 diff --git a/plomrogue/commands.py b/plomrogue/commands.py index 07bfae0..373d329 100644 --- a/plomrogue/commands.py +++ b/plomrogue/commands.py @@ -304,3 +304,12 @@ def cmd_THING_BOTTLE_EMPTY(game, thing_id): raise GameError('thing of ID %s not bottle' % thing_id) t.empty() cmd_THING_BOTTLE_EMPTY.argtypes = 'int:pos' + +def cmd_THING_INSTALLED(game, thing_id): + t = game.get_thing(thing_id) + if not t: + raise GameError('thing of ID %s not found' % thing_id) + if not hasattr(t, 'installable'): + raise GameError('thing of ID %s not installable' % thing_id) + t.install() +cmd_THING_INSTALLED.argtypes = 'int:pos'