X-Git-Url: https://harishankar.org/repos/?p=butaba-adventures.git;a=blobdiff_plain;f=maingame.py;fp=maingame.py;h=afeeb7cc8bcfee5f2b360ca0bbef3326e7f2efee;hp=4529e9a575f6603875ba0749aa6d03989155be44;hb=93544bdd97d65c88d0bc4b3f74f43f9689fb3918;hpb=667ea7c15261100aae75b61de8664863b58f01e4 diff --git a/maingame.py b/maingame.py index 4529e9a..afeeb7c 100644 --- a/maingame.py +++ b/maingame.py @@ -119,7 +119,8 @@ class MainGame: [ 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 ] @@ -309,45 +310,48 @@ class MainGame: # 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