home · contact · privacy
Save thing installation status.
[plomrogue2] / plomrogue / commands.py
index 07bfae0e1b905f8141fe281d1c475b44fcd400e0..373d32931beaa587dc3bd8f453e4274c5fdf6f60 100644 (file)
@@ -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'