raise GameError('thing of ID %s not found' % thing_id)
t.protection = protection_char
cmd_GOD_THING_PROTECTION.argtypes = 'int:pos char'
+
+def cmd_THING_DOOR_CLOSED(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_ == 'Door':
+ raise GameError('thing of ID %s not door' % thing_id)
+ t.blocking = True
+ t.portable = False
+ t.thing_char = '#'
+cmd_THING_DOOR_CLOSED.argtypes = 'int:pos'
write(f, 'GOD_THING_PROTECTION %s %s' % (t.id_, quote(t.protection)))
if hasattr(t, 'name'):
write(f, 'GOD_THING_NAME %s %s' % (t.id_, quote(t.name)))
+ if t.type_ == 'Door' and t.blocking:
+ write(f, 'THING_DOOR_CLOSED %s' % t.id_)
write(f, 'SPAWN_POINT %s %s' % (self.spawn_point[0],
self.spawn_point[1]))
cmd_GOD_ANNOTATE, cmd_GOD_PORTAL, cmd_THING_TYPES,
cmd_THING_NAME, cmd_TERRAINS, cmd_ADMIN_PASSWORD,
cmd_BECOME_ADMIN, cmd_SET_TILE_CONTROL,
- cmd_GOD_THING_NAME,
+ cmd_GOD_THING_NAME, cmd_THING_DOOR_CLOSED,
cmd_GOD_THING_PROTECTION, cmd_THING_PROTECTION,
cmd_SET_MAP_CONTROL_PASSWORD, cmd_SPAWN_POINT)
from plomrogue.tasks import (Task_WAIT, Task_MOVE, Task_WRITE, Task_PICK_UP,
game.register_command(cmd_THING_PROTECTION)
game.register_command(cmd_GOD_THING_PROTECTION)
game.register_command(cmd_THING_NAME)
+game.register_command(cmd_THING_DOOR_CLOSED)
game.register_command(cmd_GOD_THING_NAME)
game.register_command(cmd_ADMIN_PASSWORD)
game.register_command(cmd_SET_TILE_CONTROL)