X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/copy_free?a=blobdiff_plain;f=plomrogue%2Fcommands.py;h=c51dcc9051d9d905f93a256f2dcd3db66cd3aff0;hb=b77d7b68103aa6c0d5787c4cb1d1d7b1874d9000;hp=85ec5d31b2d4c3c40ae1bf0ee0a3f9e877e00167;hpb=46108644f062458df5b0540f806abffab650683f;p=plomrogue2 diff --git a/plomrogue/commands.py b/plomrogue/commands.py index 85ec5d3..c51dcc9 100644 --- a/plomrogue/commands.py +++ b/plomrogue/commands.py @@ -72,8 +72,8 @@ def cmd_TURN(game, n): game.turn = n cmd_TURN.argtypes = 'int:nonneg' -def cmd_ANNOTATE(game, yx, msg, pw=None, connection_id=None): - if connection_id and not game.can_do_tile_with_pw(yx, pw): +def cmd_ANNOTATE(game, yx, msg, pw, connection_id): + if not game.can_do_tile_with_pw(yx, pw): raise GameError('wrong password for tile') if msg == ' ': if yx in game.annotations: @@ -83,8 +83,8 @@ def cmd_ANNOTATE(game, yx, msg, pw=None, connection_id=None): game.changed = True cmd_ANNOTATE.argtypes = 'yx_tuple:nonneg string string' -def cmd_PORTAL(game, yx, msg, pw=None, connection_id=None): - if connection_id and not game.can_do_tile_with_pw(yx, pw): +def cmd_PORTAL(game, yx, msg, pw, connection_id): + if not game.can_do_tile_with_pw(yx, pw): raise GameError('wrong password for tile') if msg == ' ': if yx in game.portals: @@ -92,7 +92,17 @@ def cmd_PORTAL(game, yx, msg, pw=None, connection_id=None): else: game.portals[yx] = msg game.changed = True -cmd_PORTAL.argtypes = 'yx_tuple:nonneg string string' +cmd_GOD_PORTAL.argtypes = 'yx_tuple:nonneg string string' + +def cmd_GOD_ANNOTATE(game, yx, msg): + game.annotations[yx] = msg + game.changed = True +cmd_GOD_ANNOTATE.argtypes = 'yx_tuple:nonneg string' + +def cmd_GOD_PORTAL(game, yx, msg): + game.portals[yx] = msg + game.changed = True +cmd_PORTAL.argtypes = 'yx_tuple:nonneg string' def cmd_GET_ANNOTATION(game, yx, connection_id): annotation = '(none)';