home
·
contact
·
privacy
projects
/
plomrogue2
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
4610864
)
Use separate commands for god mode and non-god mode.
author
Christian Heller
<c.heller@plomlompom.de>
Tue, 10 Nov 2020 10:47:59 +0000
(11:47 +0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Tue, 10 Nov 2020 10:47:59 +0000
(11:47 +0100)
plomrogue/commands.py
patch
|
blob
|
history
diff --git
a/plomrogue/commands.py
b/plomrogue/commands.py
index 85ec5d31b2d4c3c40ae1bf0ee0a3f9e877e00167..fd0863284f04c550fb623dd936070bc65f63ba79 100644
(file)
--- 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'
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:
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'
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:
raise GameError('wrong password for tile')
if msg == ' ':
if yx in game.portals:
@@
-94,6
+94,16
@@
def cmd_PORTAL(game, yx, msg, pw=None, connection_id=None):
game.changed = True
cmd_PORTAL.argtypes = 'yx_tuple:nonneg string string'
game.changed = True
cmd_PORTAL.argtypes = 'yx_tuple:nonneg string string'
+def cmd_GOD_ANNOTATE(game, yx, msg):
+ game.annotations[yx] = msg
+ game.changed = True
+cmd_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)';
if yx in game.annotations:
def cmd_GET_ANNOTATION(game, yx, connection_id):
annotation = '(none)';
if yx in game.annotations: