X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/day?a=blobdiff_plain;f=plomrogue%2Fgame.py;h=5e206b9c8c289155a59aa7700dd9306ea4e05e79;hb=4d2cf315344ec4a376ffb3f49f02674e4b5facb6;hp=017580f24e4cb28ef98062f4d11026b2a02894ca;hpb=c7a3af00680ba0449310bbb7336a187dd4ed6bcf;p=plomrogue2 diff --git a/plomrogue/game.py b/plomrogue/game.py index 017580f..5e206b9 100755 --- a/plomrogue/game.py +++ b/plomrogue/game.py @@ -122,6 +122,7 @@ class Game(GameBase): self.thing_types = {} self.sessions = {} self.faces = {} + self.hats = {} self.maps = {} self.map_controls = {} self.map_control_passwords = {} @@ -246,6 +247,9 @@ class Game(GameBase): c_id) if hasattr(t, 'name'): self.io.send('THING_NAME %s %s' % (t.id_, quote(t.name)), c_id) + if t.type_ == 'Player' and t.name in self.hats: + hat = self.hats[t.name] + self.io.send('THING_HAT %s %s' % (t.id_, quote(hat)), c_id) face = self.get_face(t) if face: self.io.send('THING_FACE %s %s' % (t.id_, quote(face)), c_id) @@ -386,6 +390,9 @@ class Game(GameBase): for name in self.faces: write(f, 'GOD_PLAYER_FACE %s %s' % (quote(name), quote(self.faces[name]))) + for name in self.hats: + write(f, 'GOD_PLAYER_HAT %s %s' % (quote(name), + quote(self.hats[name]))) for t in [t for t in self.things if not t.type_ == 'Player']: write(f, 'THING %s %s %s %s' % (t.position[0], t.position[1], t.type_, t.id_)) @@ -396,6 +403,9 @@ class Game(GameBase): 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_ == 'Hat': + write(f, 'THING_HAT_DESIGN %s %s' % (t.id_, + quote(t.design))) elif t.type_ == 'MusicPlayer': write(f, 'THING_MUSICPLAYER_SETTINGS %s %s %s %s' % (t.id_, int(t.playing), t.playlist_index, int(t.repeat)))