raise GameError('thing of ID %s not bottle' % thing_id)
t.empty()
cmd_THING_BOTTLE_EMPTY.argtypes = 'int:pos'
+
+def cmd_THING_INSTALLED(game, thing_id):
+ t = game.get_thing(thing_id)
+ if not t:
+ raise GameError('thing of ID %s not found' % thing_id)
+ if not hasattr(t, 'installable'):
+ raise GameError('thing of ID %s not installable' % thing_id)
+ t.install()
+cmd_THING_INSTALLED.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 hasattr(t, 'installable') and (not t.portable):
+ write(f, 'THING_INSTALLED %s' % t.id_)
if t.type_ == 'Door' and t.blocking:
write(f, 'THING_DOOR_CLOSED %s' % t.id_)
elif t.type_ == 'MusicPlayer':
#!/usr/bin/env python3
from plomrogue.game import Game
from plomrogue.commands import (cmd_ALL, cmd_LOGIN, cmd_NICK, cmd_PING, cmd_THING,
- cmd_MAP, cmd_TURN, cmd_MAP_LINE,
+ cmd_MAP, cmd_TURN, cmd_MAP_LINE, cmd_THING_INSTALLED,
cmd_ANNOTATE, cmd_PORTAL, cmd_GET_GAMESTATE,
cmd_TASKS, cmd_MAP_CONTROL_LINE, cmd_MAP_CONTROL_PW,
cmd_GOD_ANNOTATE, cmd_GOD_PORTAL, cmd_THING_TYPES,
game.register_command(cmd_GOD_THING_PROTECTION)
game.register_command(cmd_THING_NAME)
game.register_command(cmd_THING_DOOR_CLOSED)
+game.register_command(cmd_THING_INSTALLED)
game.register_command(cmd_GOD_THING_NAME)
game.register_command(cmd_ADMIN_PASSWORD)
game.register_command(cmd_SET_TILE_CONTROL)