~ubuntu-branches/debian/sid/adonthell-data/sid

« back to all changes in this revision

Viewing changes to scripts/game_events/brn_to_silverhair.py

  • Committer: Bazaar Package Importer
  • Author(s): Gordon Fraser
  • Date: 2003-10-22 17:48:49 UTC
  • Revision ID: james.westby@ubuntu.com-20031022174849-m3mhj4t98md8zrjf
Tags: upstream-0.3.3
ImportĀ upstreamĀ versionĀ 0.3.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
#  (C) Copyright 2001 Kai Sterker <kaisterker@linuxgames.com>
 
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 veranda into 
 
14
#    Silverhair's room
 
15
 
 
16
import adonthell
 
17
import events
 
18
 
 
19
class brn_to_silverhair:
 
20
 
 
21
    # Parameters:
 
22
    # smdest: destination submap
 
23
    # xdest: X position on smdest
 
24
    # ydest: Y position on smdest
 
25
    # destdir: direction where to look at after the teleport
 
26
    def __init__ (self, eventinstance, smdest, xdest, ydest, destdir):
 
27
        self.smdest = smdest
 
28
        self.xdest = xdest
 
29
        self.ydest = ydest
 
30
        self.destdir = destdir
 
31
 
 
32
    def run (self, submap, x, y, dir, name):
 
33
        p = adonthell.gamedata_get_character (name)
 
34
        p.set_val ("came_from_barn", 1)
 
35
        p.set_val ("on_veranda", 0)
 
36
         
 
37
        events.switch_submap (p, self.smdest, self.xdest, self.ydest, self.destdir)
 
38
        adonthell.audio_fade_out_background (500)
 
39
 
 
40
        p.stand ()
 
41
        p.go_west ()
 
42
        
 
43
        silverhair = adonthell.gamedata_get_character ("Imoen Silverhair")
 
44
        
 
45
        # -- only initiate dialogue the first time the player enters
 
46
        if silverhair.get_val ("talked_to") == 0:
 
47
            silverhair.launch_action (p)