Debian Codegraph @

scripts/game_events/silverhair_to_brn.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 # -- Map Event to teleport a character from Silverhair's room onto veranda
14
15 import adonthell
16 import events
17
18 class silverhair_to_brn(object):
19
20 # Parameters:
21 # smdest: destination submap
22 # xdest: X position on smdest
23 # ydest: Y position on smdest
24 # destdir: direction where to look at after the teleport
25 def __init__ (self, eventinstance, smdest, xdest, ydest, destdir):
26 self.smdest = smdest
27 self.xdest = xdest
28 self.ydest = ydest
29 self.destdir = destdir
30
31 def run (self, submap, x, y, dir, name):
32 # -- just arrived -> do nothing
33 if dir == adonthell.STAND_WEST: return
34
35 p = adonthell.gamedata_get_character (name)
36
37 if p.get_val ("came_from_barn") == 1:
38 p.set_val ("came_from_barn", 0)
39 p.set_val ("on_veranda", 1)
40
41 events.switch_submap (p, self.smdest, self.xdest, self.ydest, self.destdir)
42 adonthell.audio_fade_out_background (500)