1 from plomrogue.errors import GameError
2 from plomrogue.misc import quote
9 def __init__(self, thing, args=()):
17 class_name = self.__class__.__name__
18 return class_name[len(prefix):]
23 def get_args_string(self):
27 stringed_args += [quote(arg)]
29 raise GameError('stringifying arg type not implemented')
30 return ' '.join(stringed_args)
34 class Task_WAIT(Task):
41 class Task_MOVE(Task):
42 argtypes = 'string:direction'
45 test_pos = self.thing.world.map_.move(self.thing.position, self.args[0])
46 if self.thing.world.map_[test_pos] != '.':
47 raise GameError('%s would move into illegal terrain' % self.thing.id_)
48 for t in self.thing.world.things:
49 if t.position == test_pos:
50 raise GameError('%s would move into other thing' % self.thing.id_)
53 self.thing.position = self.thing.world.map_.move(self.thing.position,