1 # class for Non-Player characters in the game
9 def __init__ (self
, charname
, row
, col
, imageleft
, imageright
, imagefront
,
10 imageback
, portrait
, position
, movement_area
=(0,0,0,0), movement_speed
= 10,
11 dialogues
=[], currentdialog
=0, is_dead
=False):
12 # name of the character
13 self
.charname
= charname
14 # row and column to appear (in level)
17 # initial row and col - to track the movement area
20 # images to represent on level
21 self
.imageleft
= imageleft
22 self
.imageright
= imageright
23 self
.imagefront
= imagefront
24 self
.imageback
= imageback
26 # portrait on dialogues
27 self
.portrait
= portrait
29 # movement area limits (left, right top, and bottom) in which the NPC can
30 # move around in the level randomly.
31 self
.leftlimit
, self
.rightlimit
, self
.toplimit
, self
.bottomlimit
= movement_area
33 # chance of movement (speed) - that is chance of movement in a turn out of 500 -lower
34 # the value lower the speed
35 self
.movement_speed
= movement_speed
37 # position of the character
38 self
.position
= position
40 # dialogue set for NPC
41 # each dialogue in the set is a path to an XML file containing the dialogue
42 self
.dialogues
= dialogues
43 # index of the current dialogue which will be initiated with the main
45 self
.currentdialog
= currentdialog
46 # whether the character is dead or alive. If dead no interaction of any
47 # kind can take place.
48 self
.is_dead
= is_dead
50 # Bulisa is Butaba's friend
52 def __init__ (self
, row
, col
, imageleft
, imageright
, imagefront
,
53 imageback
, portrait
, position
, movement_area
=(0,0,0,0),
54 dialogues
=[], currentdialog
=0):
55 NPC
.__init
__ (self
, "Bulisa", row
, col
, imageleft
, imageright
, imagefront
,
56 imageback
, portrait
, position
, movement_area
, 20, dialogues
, currentdialog
)
60 def __init__ (self
, row
, col
, imageleft
, imageright
, imagefront
,
61 imageback
, portrait
, position
, movement_area
=(0,0,0,0),
62 dialogues
=[], currentdialog
=0):
63 NPC
.__init
__ (self
, "Mayor", row
, col
, imageleft
, imageright
, imagefront
,
64 imageback
, portrait
, position
, movement_area
, 15, dialogues
, currentdialog
)