home · contact · privacy
Allow toggling of map control preset drawing.
[plomrogue2] / plomrogue / commands.py
index 074cc343873a80b17e6383b604c7e109217210c6..921d6e011c498744bb64659925be7cce66ffb140 100644 (file)
@@ -396,3 +396,21 @@ def cmd_THING_DOOR_KEY(game, key_id, door_id):
         raise GameError('thing of ID %s not a door' % key_id)
     key.door = door
 cmd_THING_DOOR_KEY.argtypes = 'int:pos int:pos'
+
+def cmd_THING_CRATE_ITEM(game, crate_id, item_id):
+    crate = game.get_thing(crate_id)
+    if not crate:
+        raise GameError('thing of ID %s not found' % crate_id)
+    if crate.type_ != 'Crate':
+        raise GameError('thing of ID %s not a crate' % crate_id)
+    item = game.get_thing(item_id)
+    if not item:
+        raise GameError('thing of ID %s not found' % item_id)
+    if item.type_ == 'Crate':
+        raise GameError('thing of ID %s is a crate' % item_id)
+    crate.accept(item)
+cmd_THING_CRATE_ITEM.argtypes = 'int:pos int:pos'
+
+def cmd_MAP_CONTROL_PRESETS(game, draw_control_presets):
+    game.draw_control_presets = draw_control_presets
+cmd_MAP_CONTROL_PRESETS.argtypes = 'bool'