Logo Search packages:      
Sourcecode: adonthell-data version File versions  Download package


#  (C) Copyright 2001 Kai Sterker <kaisterker@linuxgames.com>
#  Part of the Adonthell Project http://adonthell.linuxgames.com
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License.
#  This program is distributed in the hope that it will be useful,
#  See the COPYING file for more details

# -- Map Event to teleport a character from the veranda into 
#    Silverhair's room

import adonthell
import events

class brn_to_silverhair:

    # Parameters:
    # smdest: destination submap
    # xdest: X position on smdest
    # ydest: Y position on smdest
    # destdir: direction where to look at after the teleport
    def __init__ (self, eventinstance, smdest, xdest, ydest, destdir):
        self.smdest = smdest
        self.xdest = xdest
        self.ydest = ydest
        self.destdir = destdir

    def run (self, submap, x, y, dir, name):
        p = adonthell.gamedata_get_character (name)
        p.set_val ("came_from_barn", 1)
        p.set_val ("on_veranda", 0)
        events.switch_submap (p, self.smdest, self.xdest, self.ydest, self.destdir)
        adonthell.audio_fade_out_background (500)

        p.stand ()
        p.go_west ()
        silverhair = adonthell.gamedata_get_character ("Imoen Silverhair")
        # -- only initiate dialogue the first time the player enters
        if silverhair.get_val ("talked_to") == 0:
            silverhair.launch_action (p)

Generated by  Doxygen 1.6.0   Back to index