Debian Codegraph @

scripts/schedules/mapcharacters/jelom.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 Jelom Rasgar
14 #
15 # He guards the door to Lady Silverhair's room
16
17 import adonthell
18 from schedules.mapcharacters import schedule
19 import random
20
21 # -- pygettext support
22 def _(message): return message
23
24 class jelom (schedule.speak):
25
26 def __init__ (self, mapcharacterinstance):
27 self.myself = mapcharacterinstance
28
29 # -- make random remarks
30 self.speech = [_("Someone fetch me a drink!"), \
31 _("That'll teach them fancy Elves a lesson!"), \
32 _("Send them to the cursed island, I say!")]
33 self.speech_delay = (30, 60)
34 schedule.speak.__init__(self)
35
36 self.myself.set_callback (self.goal_reached)
37
38 def walk (self):
39 if self.myself.posy () == 3:
40 self.myself.set_goal (2, 6, adonthell.STAND_NORTH)
41 else:
42 self.myself.set_goal (2, 3, adonthell.STAND_SOUTH)
43
44 def goal_reached (self):
45 delay = "%it" % random.randrange (20, 65)
46 self.myself.time_callback (delay, self.walk)
47
48 def start_talking (self):
49 self.myself.launch_action (adonthell.gamedata_player ())
50 adonthell.gamedata_get_character ("Erek Stonebreaker").pause ()
51 adonthell.gamedata_get_quest ("demo").set_val ("convince_jelom", 3)