| 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 the barn onto |
| 14 | # the veranda |
| 15 | |
| 16 | import adonthell |
| 17 | import events |
| 18 | |
| 19 | class vnd_to_lft(object): |
| 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 | p = adonthell.gamedata_get_character (name) |
| 33 | p.set_val ("on_veranda", 0) |
| 34 | |
| 35 | events.switch_submap (p, self.smdest, self.xdest, self.ydest, self.destdir) |