X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/static/git-favicon.png?a=blobdiff_plain;f=plomrogue%2Fcommands.py;h=921d6e011c498744bb64659925be7cce66ffb140;hb=52a97e1d01fd8541ec8993f1d680aeb56243df9d;hp=074cc343873a80b17e6383b604c7e109217210c6;hpb=5cd44408532e23648ddcd1d59004a9dae59694af;p=plomrogue2 diff --git a/plomrogue/commands.py b/plomrogue/commands.py index 074cc34..921d6e0 100644 --- a/plomrogue/commands.py +++ b/plomrogue/commands.py @@ -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'