Added loci, and made dialog processing internal to the engine.

This commit is contained in:
Patrick Marsee 2019-10-11 14:35:39 -04:00
parent 5010042430
commit 9cda61a895
11 changed files with 1860 additions and 1269 deletions

View file

@ -63,30 +63,41 @@ class NoOpEvent(GameEvent):
class GoEvent(GameEvent):
def __init__(self, actor, x, y):
def __init__(self, actor, path, speed, action = None, locus = None, timeTaken = 0):
super(GoEvent, self).__init__('go')
self.actor = actor
self.x = x
self.y = y
self.path = path
self.speed = speed
self.action = action
self.locus = locus
self.timeTaken = timeTaken
@property
def pos(self):
return self.path[0]
class ArriveEvent(GameEvent):
def __init__(self, actor, x, y, t):
def __init__(self, actor, pos, speed, action = None, locus = None, timeTaken = 0):
super(ArriveEvent, self).__init__('arrive')
self.actor = actor
self.x = x
self.y = y
self.t = t
self.pos = pos
self.speed = speed
self.action = action
self.locus = locus
self.timeTaken = timeTaken
class UseEvent(GameEvent):
def __init__(self, thing, args):
def __init__(self, actor, thing, args):
super(UseEvent, self).__init__('use')
self.actor = actor
self.thing = thing
self.args = args
class UseOnEvent(GameEvent):
def __init__(self, item, thing, args):
def __init__(self, actor, item, thing, args):
super(UseOnEvent, self).__init__('useon')
self.actor = actor
self.thing = thing # thing can be a coordinate pair?
self.item = item
self.args = args