Began working on NPC code
[butaba-adventures.git] / npcs.py
1 # class for Non-Player characters in the game
2
3 import os.path
4
5 # NPC base class
6
7 class NPC:
8 # initalize the NPC
9 def __init__ (self, charname, row, col, image=None, portrait=None, dialogue_set=set(),
10 currentdialog=0, is_dead=False):
11 # name of the character
12 self.charname = charname
13 # row and column to appear (in level)
14 self.row = row
15 self.col = col
16 # image to represent on level
17 self.image = image
18 # portrait on dialogues
19 self.portrait = portrait
20 # dialogue set for NPC
21 # each dialogue in the set is a path to an XML file containing the dialogue
22 self.dialogue_set = dialogue_set
23 # index of the current dialogue which will be initiated with the main
24 # character
25 self.currentdialog = currentdialog
26 # whether the character is dead or alive. If dead no interaction of any
27 # kind can take place.
28 self.is_dead = is_dead
29
30 # Bulisa is Butaba's friend
31 class Bulisa (NPC):
32 def __init__ (self, row, col, image, portrait, dialogue_set=set(), currentdialog=0):
33 NPC.__init__ (self, "Bulisa", row, col, image, portrait, dialogue_set, currentdialog)
34