home
·
contact
·
privacy
projects
/
plomrogue2-experiments
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Whitespace riddance and some quote bug fixes.
[plomrogue2-experiments]
/
new2
/
plomrogue
/
game.py
diff --git
a/new2/plomrogue/game.py
b/new2/plomrogue/game.py
index e871d59401f1a9418ccc97c5f6c7fd5a055dd58a..c89d2c6cfddf80c3d30bca0abbe9dbabaa9e1d16 100755
(executable)
--- a/
new2/plomrogue/game.py
+++ b/
new2/plomrogue/game.py
@@
-6,7
+6,7
@@
from plomrogue.commands import (cmd_ALL, cmd_LOGIN, cmd_QUERY, cmd_PING,
cmd_ANNOTATE, cmd_PORTAL, cmd_GET_GAMESTATE)
from plomrogue.io import GameIO
from plomrogue.misc import quote
cmd_ANNOTATE, cmd_PORTAL, cmd_GET_GAMESTATE)
from plomrogue.io import GameIO
from plomrogue.misc import quote
-from plomrogue.things import Thing, ThingPlayer
+from plomrogue.things import Thing, ThingPlayer
from plomrogue.mapping import YX, MapGeometrySquare, Map
from plomrogue.mapping import YX, MapGeometrySquare, Map
@@
-14,7
+14,6
@@
from plomrogue.mapping import YX, MapGeometrySquare, Map
class GameBase:
def __init__(self):
class GameBase:
def __init__(self):
- pass
self.turn = 0
self.things = []
self.turn = 0
self.things = []
@@
-86,13
+85,16
@@
class Game(GameBase):
def send_thing(thing):
self.io.send('THING_POS %s %s' % (thing.id_, t.position))
def send_thing(thing):
self.io.send('THING_POS %s %s' % (thing.id_, t.position))
+ if hasattr(thing, 'nickname'):
+ self.io.send('THING_NAME %s %s' % (thing.id_, quote(t.nickname)))
+
self.io.send('TURN ' + str(self.turn))
for t in self.things:
send_thing(t)
self.io.send('MAP %s %s' % (self.map_geometry.size, quote(self.map.terrain)))
for yx in self.portals:
self.io.send('TURN ' + str(self.turn))
for t in self.things:
send_thing(t)
self.io.send('MAP %s %s' % (self.map_geometry.size, quote(self.map.terrain)))
for yx in self.portals:
- self.io.send('PORTAL %s %s' % (yx,
self.portals[yx]
))
+ self.io.send('PORTAL %s %s' % (yx,
quote(self.portals[yx])
))
self.io.send('GAME_STATE_COMPLETE')
def run_tick(self):
self.io.send('GAME_STATE_COMPLETE')
def run_tick(self):