Debian Codegraph @

scripts/schedules/mapcharacters/alek.py

raw symbols SCIP
1 #
2 # (C) Copyright 2001/2002 Kai Sterker <[email protected]>
3 # Part of the Adonthell Project http://adonthell.linuxgames.com
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License.
7 # This program is distributed in the hope that it will be useful,
8 # but WITHOUT ANY WARRANTY.
9 #
10 # See the COPYING file for more details
11 #
12
13 # -- Movement schedule for Alek Endhelm
14 #
15 # He'll walk between his table and the bar
16
17 import adonthell
18 from schedules.mapcharacters import schedule
19 import random
20
21 def _(message): return message
22
23 class alek (schedule.speak):
24
25 def __init__ (self, mapcharacterinstance):
26 self.myself = mapcharacterinstance
27
28 # -- make random remarks
29 self.speech = [_("More Ale!"), \
30 _("I'll cut 'em open like ripe fruits."), \
31 _("They should sort out this business like real men!")]
32 self.speech_delay = (20, 40)
33 schedule.speak.__init__(self)
34
35 self.myself.set_callback (self.goal_reached)
36
37 def walk (self):
38 # -- walk to table
39 if self.myself.posx () == 1:
40 self.myself.set_goal (12, 5, adonthell.STAND_NORTH)
41 # -- walk to bar
42 else:
43 self.myself.set_goal (1, 3, adonthell.STAND_SOUTH)
44
45 def goal_reached (self):
46 delay = "%it" % random.randrange (65, 90)
47 self.myself.time_callback (delay, self.walk)