Debian Codegraph @

scripts/schedules/audio/in_game.py

raw symbols SCIP
1 #
2 # $Id$
3 #
4 # (C) Copyright 2001 Kai Sterker <[email protected]>
5 # Part of the Adonthell Project http://adonthell.linuxgames.com
6 #
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY.
11 #
12 # See the COPYING file for more details
13 #
14
15 # -- Schedule for the in game music
16
17 import adonthell
18
19 class in_game(object):
20 def __init__ (self):
21 pass
22
23 # -- method called everytime a song has finished playing
24 # load song before playing, as the mixer seems to discard it
25 # after it's been played once
26 def music_finished (self, song):
27 music = adonthell.gamedata_get_quest ("demo").get_val ("music")
28
29 # -- if we're in Silverhair's room, play special tune
30 if adonthell.gamedata_player ().submap () == 13:
31 adonthell.audio_load_background (2, "audio/at-demo-7.ogg")
32 adonthell.audio_play_background (2)
33
34 # -- otherwise
35 elif music == 0:
36 adonthell.gamedata_get_quest ("demo").set_val ("music", 1)
37 adonthell.audio_load_background (1, "audio/at-demo-6.ogg")
38 adonthell.audio_play_background (1)
39
40 else:
41 adonthell.gamedata_get_quest ("demo").set_val ("music", 0)
42 adonthell.audio_load_background (0, "audio/at-demo-5.ogg")
43 adonthell.audio_play_background (0)
44