Debian Codegraph @

scripts/game_events/teleport.py

raw symbols SCIP
1 #
2 # (C) Copyright 2001 Alexandre Courbot <[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 for teleporting a character.
14 #
15 # Teleport the character that triggered this event to another position
16
17
18 import adonthell
19 import events
20
21 class teleport(object):
22
23 # Parameters:
24 # smdest: destination submap
25 # xdest: X position on smdest
26 # ydest: Y position on smdest
27 # destdir: direction where to look at after the teleport
28 def __init__ (self, eventinstance, smdest, xdest, ydest, destdir):
29 self.smdest = smdest
30 self.xdest = xdest
31 self.ydest = ydest
32 self.destdir = destdir
33
34 def run (self, submap, x, y, dir, name):
35 events.switch_submap (adonthell.gamedata_get_character (name),
36 self.smdest, self.xdest, self.ydest, self.destdir)