From 00470eddc34eeaab26209197d9e92995fbf12498 Mon Sep 17 00:00:00 2001 From: Harishankar Date: Sat, 15 Oct 2011 17:44:58 +0530 Subject: [PATCH] Added dialogues for the mayor Added dialogues for the mayor in game. More to come regarding the "mayor" mission --- dialogues/bulisa6.dlg | 4 ++-- dialogues/bulisa7.dlg | 13 +++++++++++++ dialogues/mayor1.dlg | 18 ++++++++++++++++++ dialogues/mayor2.dlg | 19 +++++++++++++++++++ dialogues/mayor3.dlg | 7 +++++++ gamestate.py | 1 + maingame.py | 42 +++++++++++++++++++++++++++++++++++++++--- 7 files changed, 99 insertions(+), 5 deletions(-) create mode 100644 dialogues/bulisa7.dlg create mode 100644 dialogues/mayor1.dlg create mode 100644 dialogues/mayor2.dlg create mode 100644 dialogues/mayor3.dlg diff --git a/dialogues/bulisa6.dlg b/dialogues/bulisa6.dlg index 819c950..2b0f5bd 100644 --- a/dialogues/bulisa6.dlg +++ b/dialogues/bulisa6.dlg @@ -10,10 +10,10 @@ but he is a good, honest, decent man. And... well, not to be immodest or anything, my word... ahem... carries a lot of weight with important people... Thanks so much, Bulisa. - Bye! + Bye! Good. See you later! - Bye! + Bye! \ No newline at end of file diff --git a/dialogues/bulisa7.dlg b/dialogues/bulisa7.dlg new file mode 100644 index 0000000..c69e65a --- /dev/null +++ b/dialogues/bulisa7.dlg @@ -0,0 +1,13 @@ + + + + Ah, Butaba! Good to see you again. What can I help you with? + I saw the mayor and got the job. + Oh, nothing at all. Thanks and bye! + + + + Excellent. Didn't I tell you, my word -does- carry weight in these parts! + It does indeed! Thanks and bye! + + \ No newline at end of file diff --git a/dialogues/mayor1.dlg b/dialogues/mayor1.dlg new file mode 100644 index 0000000..023cd77 --- /dev/null +++ b/dialogues/mayor1.dlg @@ -0,0 +1,18 @@ + + + + And just who might you be, young man? + My name is Butaba and... + Bye! + + + It doesn't really matter who you are. Can't you see I'm busy? Go away and play with your toys. I've got a lot of work +to do! + But, I... + Sorry, didn't mean to disturb you, sir. + + + Just go away before I lose my temper, you impertinent fellow. + Uh... sorry! + + \ No newline at end of file diff --git a/dialogues/mayor2.dlg b/dialogues/mayor2.dlg new file mode 100644 index 0000000..b67db17 --- /dev/null +++ b/dialogues/mayor2.dlg @@ -0,0 +1,19 @@ + + + + Well? Are you the young man Bulisa told me about? + Yes, sir + No, not I! + Bye! + + + OK, well... I -am- short handed at the moment and need help. Go around town and visit people and collect as much money +as you can and report back to me. You are doing a noble service. Be proud that I've entrusted you with such a responsibility... +Now go! I have no time to chat... + Yes, sir! + + + Then go away and stop bothering me! Can't you see I'm busy? Children! + Bye! + + \ No newline at end of file diff --git a/dialogues/mayor3.dlg b/dialogues/mayor3.dlg new file mode 100644 index 0000000..2d71b89 --- /dev/null +++ b/dialogues/mayor3.dlg @@ -0,0 +1,7 @@ + + + + Well, what are you doing here again? Disturbing me needlessly! + Uh... sorry! + + \ No newline at end of file diff --git a/gamestate.py b/gamestate.py index 013deb4..9381d20 100644 --- a/gamestate.py +++ b/gamestate.py @@ -11,4 +11,5 @@ flag["mission_bulisa_water_from_well_refused"] = False # mission to collect money for charity flag["mission_charity_informed"] = False +flag["mission_charity_informed_mayor"] = False flag["mission_charity_money"] = False diff --git a/maingame.py b/maingame.py index 931e993..9efc5cd 100644 --- a/maingame.py +++ b/maingame.py @@ -134,12 +134,16 @@ class MainGame: os.path.join ("dialogues", "bulisa3.dlg"), os.path.join ("dialogues", "bulisa4.dlg"), os.path.join ("dialogues", "bulisa5.dlg"), - os.path.join ("dialogues", "bulisa6.dlg") ] ) + os.path.join ("dialogues", "bulisa6.dlg"), + os.path.join ("dialogues", "bulisa7.dlg") ] ) npc_mayor = npcs.Mayor (5, 4, self.img_mayorleft, self.img_mayorright, self.img_mayorfront, self.img_mayorback, self.img_mayor_portrait, constants.FRONT, - (2, 2, 2, 2)) + (2, 2, 2, 2), + [ os.path.join ("dialogues", "mayor1.dlg"), + os.path.join ("dialogues", "mayor2.dlg"), + os.path.join ("dialogues", "mayor3.dlg") ]) chest1.objects = [ gold50, gold25, key2, gold10 ] @@ -356,6 +360,31 @@ class MainGame: if isinstance (npc, npcs.Bulisa): # interact with Bulisa self.interact_npc_bulisa (npc) + elif isinstance (npc, npcs.Mayor): + # interact with the Mayor + self.interact_npc_mayor (npc) + + # interact with the mayor + def interact_npc_mayor (self, npc): + resp_id = None + + if gamestate.flag["mission_charity_money"] is True: + npc.currentdialog = 2 + resp_id = utility.dialogue_play (self.screen, self.img_dialogue, npc, self.butaba.portrait, 0, 90) + elif gamestate.flag["mission_charity_informed_mayor"] is True: + npc.currentdialog = 1 + resp_id = utility.dialogue_play (self.screen, self.img_dialogue, npc, self.butaba.portrait, 0, 90) + else: + npc.currentdialog = 0 + resp_id = utility.dialogue_play (self.screen, self.img_dialogue, npc, self.butaba.portrait, 0, 90) + + + # deal with the respnses + if resp_id == "missioncharityaccepted": + gamestate.flag["mission_charity_money"] = True + # response ID is none + elif resp_id is None: + self.status_message = "You cannot initiate a conversation with %s" % npc.charname # interact with NPC Bulisa def interact_npc_bulisa (self, npc): @@ -364,8 +393,12 @@ class MainGame: # check for global game states (starting from later flags to earlier ones + # whether butaba is doing the mayor charity mission + if gamestate.flag["mission_charity_money"] is True: + npc.currentdialog = 6 + resp_id = utility.dialogue_play (self.screen, self.img_dialogue, npc, self.butaba.portrait, 0, 90) # whether the drawing water from well mission completed - if gamestate.flag["mission_charity_informed"] is True: + elif gamestate.flag["mission_charity_informed"] is True: npc.currentdialog = 5 resp_id = utility.dialogue_play (self.screen, self.img_dialogue, npc, self.butaba.portrait, 0, 90) elif gamestate.flag['mission_bulisa_water_from_well_complete'] is True: @@ -413,6 +446,9 @@ class MainGame: # Butaba is informed about the mayor's charity elif resp_id == "informedcharitymission": gamestate.flag["mission_charity_informed"] = True + # if mayor has been told about Butaba + elif resp_id == "mayortoldaboutbutaba": + gamestate.flag["mission_charity_informed_mayor"] = True # if response ID is none elif resp_id is None: self.status_message = "You cannot initiate a conversation with %s" % npc.charname -- 2.20.1