X-Git-Url: https://plomlompom.com/repos/berlin_corona.txt?a=blobdiff_plain;f=plomrogue%2Fcommands.py;h=9cdab97a20963109c70460b6135c610b8cf94aaf;hb=7c03e8e8e4ed15f01e29dd331596719058af9f07;hp=c86aebe402ad5c1c6d5fadc776ad6e429d5092ed;hpb=509d9ca8e54529b5d728b1635df4ba4bbb0bcc23;p=plomrogue2 diff --git a/plomrogue/commands.py b/plomrogue/commands.py index c86aebe..9cdab97 100644 --- a/plomrogue/commands.py +++ b/plomrogue/commands.py @@ -410,3 +410,21 @@ def cmd_THING_CRATE_ITEM(game, crate_id, item_id): 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' + +def cmd_THING_SPAWNPOINT_CREATED(game, spawnpoint_id, timestamp): + import datetime + spawnpoint = game.get_thing(spawnpoint_id) + if not spawnpoint: + raise GameError('thing of ID %s not found' % spawnpoint_id) + if spawnpoint.type_ != 'SpawnPoint': + raise GameError('thing of ID %s not a SpawnPoint' % spawnpoint_id) + if timestamp == 0: + spawnpoint.temporary = False + else: + spawnpoint.temporary = True + spawnpoint.created_at = datetime.datetime.fromtimestamp(timestamp) +cmd_THING_SPAWNPOINT_CREATED.argtypes = 'int:pos int:nonneg'