home · contact · privacy
Turn Consumable into Bottle that may be full or empty.
[plomrogue2] / plomrogue / commands.py
index 0638cb86e7517445511873a678feed95ad89d368..dea4b63d4c4c69e0d42b8abc90a7c345c2945312 100644 (file)
@@ -305,3 +305,12 @@ def cmd_THING_MUSICPLAYER_PLAYLIST_ITEM(game, thing_id, title, length):
         raise GameError('thing of ID %s not music player' % thing_id)
     t.playlist += [(title, length)]
 cmd_THING_MUSICPLAYER_PLAYLIST_ITEM.argtypes = 'int:pos string int:pos'
+
+def cmd_THING_BOTTLE_EMPTY(game, thing_id):
+    t = game.get_thing(thing_id)
+    if not t:
+        raise GameError('thing of ID %s not found' % thing_id)
+    if not t.type_ == 'Bottle':
+        raise GameError('thing of ID %s not bottle' % thing_id)
+    t.full = False
+cmd_THING_BOTTLE_EMPTY.argtypes = 'int:pos'