Debian Codegraph @

scripts/schedules/mapcharacters/janesta.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 Janesta Skywind
14 #
15 # She'll busy herself in Silverhair's room
16
17 import adonthell
18 from schedules.mapcharacters import schedule
19 import random
20
21 def _(message): return message
22
23 class janesta (schedule.speak):
24
25 def __init__ (self, mapcharacterinstance):
26 self.myself = mapcharacterinstance
27
28 # -- make random remarks
29 self.speech = [_("Oh, dear. Oh, dear."), \
30 _("What will happen to us if they take the Mistress?"), \
31 _("I must do something about this awful room."), \
32 _("Oh, how do they expect us to live decently in a place like this?")]
33 self.speech_delay = (25, 45)
34 schedule.speak.__init__(self)
35
36 self.coords = [(1, 3, adonthell.STAND_NORTH), \
37 (6, 3, adonthell.STAND_NORTH), \
38 (1, 5, adonthell.STAND_SOUTH), \
39 (4, 2, adonthell.STAND_WEST)]
40
41 self.myself.set_callback (self.goal_reached)
42
43 def walk (self):
44 x, y, dir = self.coords[random.randrange (0, 4)]
45 self.myself.set_goal (x, y, dir)
46
47 def goal_reached (self):
48 delay = "%it" % random.randrange (10, 30)
49 self.myself.time_callback (delay, self.walk)