Exemple #1
0
 def get_command(self):
     self.ohno.logger.action('[walk] Getting path to %r..' % self.tile)
     path = self.ohno.ai.pathing.get_path(self.tile)
     next = path.next()
     self.next = next
     delta = next.idx - self.ohno.dungeon.curtile.idx
     self.ohno.logger.action('[walk] next tile is %r (%d)' % (next, delta))
     assert abs(delta) in (1, 79, 80, 81)
     self._last_hero_tile = self.ohno.dungeon.curtile
     self._last_delta = delta
     return util.delta2vi(delta)
Exemple #2
0
 def get_command(self):
     self.ohno.logger.action('[open] Getting command to open %r..' % self.tile)
     delta = self.tile.idx - self.ohno.dungeon.curtile.idx
     self.ohno.logger.action('[open] .. and the delta is %d' % delta)
     assert abs(delta) in (1, 79, 80, 81)
     return 'o' + util.delta2vi(delta)