Added dialogues for the mayor master
authorHarishankar <v.harishankar@gmail.com>
Sat, 15 Oct 2011 12:14:58 +0000 (17:44 +0530)
committerHarishankar <v.harishankar@gmail.com>
Sat, 15 Oct 2011 12:14:58 +0000 (17:44 +0530)
Added dialogues for the mayor in game. More to come
regarding the "mayor" mission

dialogues/bulisa6.dlg
dialogues/bulisa7.dlg [new file with mode: 0644]
dialogues/mayor1.dlg [new file with mode: 0644]
dialogues/mayor2.dlg [new file with mode: 0644]
dialogues/mayor3.dlg [new file with mode: 0644]
gamestate.py
maingame.py

index 819c950..2b0f5bd 100644 (file)
 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...</speech>
     <response id="29" nextdialogue="3">Thanks so much, Bulisa.</response>
-    <response id="30" nextdialogue="0">Bye!</response>
+    <response id="mayortoldaboutbutaba" nextdialogue="0">Bye!</response>
   </dialogue>
   <dialogue id="3">
     <speech>Good. See you later!</speech>
-    <response id="31" nextdialogue="0">Bye!</response>
+    <response id="mayortoldaboutbutaba" nextdialogue="0">Bye!</response>
   </dialogue>
 </conversation>
\ No newline at end of file
diff --git a/dialogues/bulisa7.dlg b/dialogues/bulisa7.dlg
new file mode 100644 (file)
index 0000000..c69e65a
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<conversation>
+  <dialogue id="1">
+    <speech>Ah, Butaba! Good to see you again. What can I help you with?</speech>
+    <response id="30" nextdialogue="2">I saw the mayor and got the job.</response>
+    <response id="31" nextdialogue="0">Oh, nothing at all. Thanks and bye!</response>
+  </dialogue>
+  
+  <dialogue id="2">
+    <speech>Excellent. Didn't I tell you, my word -does- carry weight in these parts!</speech>
+    <response id="32" nextdialogue="0">It does indeed! Thanks and bye!</response>
+  </dialogue>
+</conversation>
\ No newline at end of file
diff --git a/dialogues/mayor1.dlg b/dialogues/mayor1.dlg
new file mode 100644 (file)
index 0000000..023cd77
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<conversation>
+  <dialogue id="1">
+    <speech>And just who might you be, young man?</speech>
+    <response id="1" nextdialogue="2">My name is Butaba and...</response>
+    <response id="2" nextdialogue="0">Bye!</response>
+  </dialogue>
+  <dialogue id="2">
+    <speech>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!</speech>
+    <response id="3" nextdialogue="3">But, I...</response>
+    <response id="4" nextdialogue="0">Sorry, didn't mean to disturb you, sir.</response>  
+  </dialogue>
+  <dialogue id="3">
+    <speech>Just go away before I lose my temper, you impertinent fellow.</speech>
+    <response id="5" nextdialogue="0">Uh... sorry!</response>
+  </dialogue>
+</conversation>
\ No newline at end of file
diff --git a/dialogues/mayor2.dlg b/dialogues/mayor2.dlg
new file mode 100644 (file)
index 0000000..b67db17
--- /dev/null
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<conversation>
+  <dialogue id="1">
+    <speech>Well? Are you the young man Bulisa told me about?</speech>
+    <response id="1" nextdialogue="2">Yes, sir</response>
+    <response id="2" nextdialogue="3">No, not I!</response>
+    <response id="3" nextdialogue="0">Bye!</response>
+  </dialogue>
+  <dialogue id="2">
+    <speech>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...</speech>
+    <response id="missioncharityaccepted" nextdialogue="0">Yes, sir!</response>
+  </dialogue>
+  <dialogue id="3">
+    <speech>Then go away and stop bothering me! Can't you see I'm busy? Children!</speech>
+    <response id="4">Bye!</response>
+  </dialogue>
+</conversation>
\ No newline at end of file
diff --git a/dialogues/mayor3.dlg b/dialogues/mayor3.dlg
new file mode 100644 (file)
index 0000000..2d71b89
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<conversation>
+  <dialogue id="1">
+    <speech>Well, what are you doing here again? Disturbing me needlessly!</speech>
+    <response id="5" nextdialogue="0">Uh... sorry!</response>
+  </dialogue>
+</conversation>
\ No newline at end of file
index 013deb4..9381d20 100644 (file)
@@ -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
index 931e993..9efc5cd 100644 (file)
@@ -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