--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<conversation>
+ <dialogue id="1">
+ <speech>Hello, Butaba! So, what's up?</speech>
+ <response id="21" nextdialogue="2">Things are fine!</response>
+ <response id="22" nextdialogue="3">I am still looking for something to do</response>
+ <response id="23" nextdialogue="0">Bye!</response>
+ </dialogue>
+ <dialogue id="2">
+ <speech>That's good. I hope you had luck with that job...</speech>
+ <response id="24" nextdialogue="3">No such luck! Still looking</response>
+ <response id="25" nextdialogue="0">Bye!</response>
+ </dialogue>
+ <dialogue id="3">
+ <speech>Ah, then I think I can put you on to something. You see, the town mayor is collecting money for charity. There is
+ going to be a gala function during the Fete. He's short handed at the moment, looking for volunteers. Maybe you could help!</speech>
+ <response id="26" nextdialogue="0">Sounds like a good idea. I'll go meet him.</response>
+ <response id="27" nextdialogue="4">Oh, I'll consider it...</response>
+ </dialogue>
+ <dialogue id="4">
+ <speech>No problem. It's a good cause. Hope you can help with that!</speech>
+ <response id="28" nextdialogue="0">Bye!</response>
+ </dialogue>
+</conversation>
\ No newline at end of file
# game state switches and variables
# this is used to control the game state
-# Bulisa initial mission
+flag = {}
+# Bulisa initial mission
# drawing water from well mission
-mission_bulisa_water_from_well = False
-mission_bulisa_water_from_well_complete = False
-mission_bulisa_water_from_well_refused = False
+flag["mission_bulisa_water_from_well"] = False
+flag["mission_bulisa_water_from_well_complete"] = False
+flag["mission_bulisa_water_from_well_refused"] = False
+
+# mission to collect money for charity
+flag["mission_charity_money"] = False
[ os.path.join ("dialogues", "bulisa1.dlg"),
os.path.join ("dialogues", "bulisa2.dlg"),
os.path.join ("dialogues", "bulisa3.dlg"),
- os.path.join ("dialogues", "bulisa4.dlg") ] )
+ os.path.join ("dialogues", "bulisa4.dlg"),
+ os.path.join ("dialogues", "bulisa5.dlg") ] )
chest1.objects = [ gold50, gold25, key2, gold10 ]
# set initial response ID to none
resp_id = None
# not yet started mission drawing water from well and not refused it
- if (gamestate.mission_bulisa_water_from_well is False
- and gamestate.mission_bulisa_water_from_well_refused is False):
+ if (gamestate.flag["mission_bulisa_water_from_well"] is False
+ and gamestate.flag["mission_bulisa_water_from_well_refused"] is False):
# set the current dialogue
npc.currentdialog = 0
# get the response ID
resp_id = utility.dialogue_play (self.screen, self.img_dialogue, npc, self.butaba.portrait, 0, 90)
- if (gamestate.mission_bulisa_water_from_well_refused is True and
- gamestate.mission_bulisa_water_from_well is False):
+ if (gamestate.flag["mission_bulisa_water_from_well_refused"] is True and
+ gamestate.flag["mission_bulisa_water_from_well"] is False):
# set the current dialog
npc.currentdialog = 2
resp_id = utility.dialogue_play (self.screen, self.img_dialogue, npc, self.butaba.portrait, 0, 90)
# mission accepted but not completed - check if completed and set value
# accordingly
- elif (gamestate.mission_bulisa_water_from_well is True
- and gamestate.mission_bulisa_water_from_well_complete is False):
+ elif (gamestate.flag["mission_bulisa_water_from_well"] is True
+ and gamestate.flag["mission_bulisa_water_from_well_complete"] is False):
for invobj in self.butaba.objects:
if isinstance (invobj, gameobjects.Bucket) is True:
if invobj.liquid == "water":
- gamestate.mission_bulisa_water_from_well_complete = True
+ gamestate.flag["mission_bulisa_water_from_well_complete"] = True
self.butaba.objects.remove (invobj)
key1 = gameobjects.Key (5, 3, "a chest key", self.img_key2, constants.KEY_CHEST1)
self.butaba.objects.append (key1)
break
# water mission is not completed yet
- if gamestate.mission_bulisa_water_from_well_complete is False:
+ if gamestate.flag["mission_bulisa_water_from_well_complete"] is False:
npc.currentdialog = 1
else:
npc.currentdialog = 3
-
# get the response ID
resp_id = utility.dialogue_play (self.screen, self.img_dialogue, npc, self.butaba.portrait, 0, 90)
+ # water from well mission is completed
+ elif (gamestate.flag["mission_bulisa_water_from_well_complete"]) is True:
+ npc.currentdialog = 4
+ resp_id = utility.dialogue_play (self.screen, self.img_dialogue, npc, self.butaba.portrait, 0, 90)
# if response ID is 12, then drawing water from well mission is refused
if resp_id == "12" or resp_id == "18":
- gamestate.mission_bulisa_water_from_well_refused = True
+ gamestate.flag["mission_bulisa_water_from_well_refused"] = True
# if response ID is 13: that is accepted the drawing water from well mission begins
if resp_id == "13" or resp_id == "17":
- gamestate.mission_bulisa_water_from_well = True
+ gamestate.flag["mission_bulisa_water_from_well"] = True
# if response ID is none
elif resp_id is None:
self.status_message = "You cannot initiate a conversation with %s" % npc.charname