1 from plomrogue.errors import GameError
2 from plomrogue.misc import quote
9 def __init__(self, thing, args=()):
17 def get_args_string(self):
21 stringed_args += [quote(arg)]
23 raise GameError('stringifying arg type not implemented')
24 return ' '.join(stringed_args)
28 class Task_WAIT(Task):
35 class Task_MOVE(Task):
36 argtypes = 'string:direction'
39 test_pos = self.thing.world.map_.move(self.thing.position, self.args[0])
40 if self.thing.world.map_[test_pos] != '.':
41 raise GameError('%s would move into illegal terrain' % self.thing.id_)
42 for t in self.thing.world.things:
43 if t.position == test_pos:
44 raise GameError('%s would move into other thing' % self.thing.id_)
47 self.thing.position = self.thing.world.map_.move(self.thing.position,