Debian Codegraph @

scripts/game_events/silverhair_to_fst.py

raw symbols SCIP
1 #
2 # (C) Copyright 2001 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 # -- Map Event to teleport a character from Silverhair's room, if allowed.
14
15 import adonthell
16 import events
17
18 def _(message): return message
19
20 class silverhair_to_fst(object):
21
22 # Parameters:
23 # smdest: destination submap
24 # xdest: X position on smdest
25 # ydest: Y position on smdest
26 # destdir: direction where to look at after the teleport
27 def __init__ (self, eventinstance, smdest, xdest, ydest, destdir):
28 self.smdest = smdest
29 self.xdest = xdest
30 self.ydest = ydest
31 self.destdir = destdir
32
33 def run (self, submap, x, y, dir, name):
34 p = adonthell.gamedata_get_character (name)
35 free = adonthell.gamedata_get_quest ("demo").get_val("silverhair_free")
36
37 # -- Jelom not convinced of Silverhair's innocence
38 if p.get_val ("came_from_barn") == 1 and not free:
39 p.stand ()
40 p.go_south ()
41 p.speak (_("I better leave the way I came."))
42 else:
43 events.switch_submap (p, self.smdest, self.xdest, self.ydest, self.destdir)
44 adonthell.audio_fade_out_background (500)