Debian Codegraph @

scripts/game_events/character_speak.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 to make a character say something.
14
15 import adonthell
16
17 class character_speak(object):
18
19 # Parameters:
20 # name: name of the character that should speak when the event is triggered
21 # sentence: sentence to say when the event is triggered
22 def __init__ (self, eventinstance, name, sentence):
23 self.myself = eventinstance
24 self.mapchar = adonthell.gamedata_get_character (name)
25 self.sentence = sentence
26
27 def run (self, submap, x, y, dir, name):
28 self.mapchar.speak (self.sentence)
29 if submap == 4:
30 if x == 7 and y == 3:
31 adonthell.achievements.update(1, 11)
32 if x == 7 and y == 5:
33 adonthell.achievements.update(1, 21)
34 if x == 8 and y == 4:
35 adonthell.achievements.update(1, 31)