+ offset_pos = (thing.position[1][0] - offset[0],
+ thing.position[1][1] - offset[1])
+ self.io.send('THING_TYPE %s %s' % (thing.id_, thing.type_))
+ self.io.send('THING_POS %s %s %s' % (thing.id_,
+ stringify_yx(thing.position[0]),
+ stringify_yx(offset_pos)))
+ if hasattr(thing, 'health'):
+ self.io.send('THING_HEALTH %s %s' % (thing.id_,
+ thing.health))
+ if len(self.world.player.inventory) > 0:
+ self.io.send('PLAYER_INVENTORY %s' %
+ ','.join([str(i) for i in self.world.player.inventory]))
+ else:
+ self.io.send('PLAYER_INVENTORY ,')
+ for id_ in self.world.player.inventory:
+ thing = self.world.get_thing(id_)