source: trunk/game/dialogue/innkeeper.yaml @ 668

Revision 668, 10.7 KB checked in by technomage, 9 years ago (diff)

Ticket #269: Patch by Technomage.

  • Working prototype of the redesigned DialogueEngine? for the upcoming Techdemo2 release; major redesign of the existing DialogueEngine? and YAML dialogue file syntax.
  • Moved the redesigned DialogueEngine? class to the more descriptive dialogueengine.py module; the DialogueEngine? is now a singleton object and provides all functionality through class methods and attributes, and thus should not be instantiated
  • Abstracted the data structures used to store dialogue data away from the YAML data structures; the relevant classes are stored in the dialogue.py module
  • Abstracted the dialogue commands/actions from the DialogueEngine? code to make modifications and maintenance of dialogue logic easier; the relevant classes are stored in the dialogueactions.py module
  • The PyYAML loader has been replaced with a more robust YamlDialogueParser? class (see the dialogueparsers.py module) that interfaces with the new dialogue data structure classes and supports the new YAML dialogue file syntax; an OldYamlDialogueParser? class is provided to support reading the old Techdemo1 syntax
  • Removed the existing dialogue validator; runtime dialogue validation is not yet implemented
  • Added the convert_dialogue script, which converts dialogue files in the old Techdemo1 format to the new format; all existing dialogue files have been converted to work with the new parser
  • Added two support modules for the new classes and script: ordereddict.py, which provides a Python 2.7-like OrderedDict? class for Python versions 2.4-2.6; optionparser.py, which is a simplified command-line option parser for writing scripts as an alternative to argparse and optparse
  • Updated the dialogue_demo.py script to work with the new DialogueEngine?
  • fixes[s:trac, t:269]
  • Property svn:eol-style set to native
Line 
1#   This file is part of PARPG.
2
3#   PARPG is free software: you can redistribute it and/or modify
4#   it under the terms of the GNU General Public License as published by
5#   the Free Software Foundation, either version 3 of the License, or
6#   (at your option) any later version.
7
8#   PARPG is distributed in the hope that it will be useful,
9#   but WITHOUT ANY WARRANTY; without even the implied warranty of
10#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11#   GNU General Public License for more details.
12
13#   You should have received a copy of the GNU General Public License
14#   along with PARPG.  If not, see <http://www.gnu.org/licenses/>.
15---
16NPC_NAME: Jacob
17AVATAR_PATH: gui/icons/innkeeper.png
18START_SECTION: main_dialog
19SECTIONS:
20-   ID: main_dialog
21    SAY: "Hi there, Stranger!  Welcome to Jacob's.  How can I help you?"
22    ACTIONS:
23    -   meet:
24        - jacob
25    RESPONSES:
26    -   REPLY: "I'd like a drink."
27        GOTO: buy_drink
28       
29    -   REPLY: "Nice place you got here.  What's your story?"
30        GOTO: inn_background
31       
32    -   REPLY: "Who are those two women over there?"
33        GOTO: loose_women
34       
35    -   REPLY: "I'm the bastard that's going to put you out of business!"
36        CONDITION: "quest['beer'].getValue('beer_quality') >= 1"
37        GOTO: ungratitude
38       
39    -   REPLY: "I'm looking for Pekko, you seen him?"
40        CONDITION: "quest.hasActiveQuest('fedex') and not\
41           \ quest.hasFinishedQuest('fedex') and not\
42           \ quest['fedex'].isGoalValue('found_pekko')"
43        GOTO: help_fedex
44       
45    -   REPLY: "Pekko's dead.  I found his body."
46        CONDITION: "quest['fedex'].isGoalValue('found_pekko')"
47        GOTO: pekko_dead
48       
49    -   REPLY: "Nothing for me, thanks."
50        GOTO: end
51       
52-   ID: buy_drink
53    SAY: "Doesn't look like you got much to trade for any of my premium booze.\
54       \ Come back later when you can pay."
55    RESPONSES:
56    -   REPLY: "Alright, I'll scrounge something up."
57        GOTO: back
58       
59    -   REPLY: "Can't I run up a tab?"
60        GOTO: credit_check
61       
62-   ID: credit_check
63    SAY: "Your credit is no good here.  Now, get out before I have Dig run you\
64       \ out."
65    RESPONSES:
66    -   REPLY: "OK, OK, I was just asking."
67        GOTO: main_dialog
68       
69-   ID: inn_background
70    SAY: "Well... Dig, Enoch and I found this place some years back.  Kimmo and\
71       \ Pekko were here first, of course, but they obviously needed our help.\
72       \ The girls took a liking to it, and with the improvements we made, it\
73       \ seemed like a good place as any to set up shop. "
74    RESPONSES:
75    -   REPLY: "Who's Enoch?"
76        GOTO: explain_enoch
77       
78    -   REPLY: "Who's Dig?"
79        GOTO: explain_dig
80       
81    -   REPLY: "What improvements do you mean?"
82        GOTO: explain_steam
83       
84    -   REPLY: "What girls?"
85        GOTO: explain_girls
86       
87    -   REPLY: "Cool, this is probably the best bar in about 500 km."
88        GOTO: back
89       
90-   ID: explain_enoch
91    SAY: "Enoch was my engineer.  He worked for me before the war.  He\
92       \ outfitted this place with the steam heating system."
93    RESPONSES:
94    -   REPLY: "Oh wow, steam heat?  How does that work?"
95        GOTO: explain_steam
96       
97    -   REPLY: "Where is Enoch now?  Can I meet him?"
98        GOTO: enochs_demise
99       
100-   ID: enochs_demise
101    SAY: "Alas, he's no longer with us.  He met with an unfortunate accident.\
102       \ Luckily, he taught me how to keep the system up and running."
103    RESPONSES:
104    -   REPLY: "Accident?"
105        GOTO: enochs_accident
106       
107    -   REPLY: "So you are the only one who can maintain the steam system?"
108        GOTO: steam_maintainance
109       
110-   ID: enochs_accident
111    SAY: "Oh, you know.  Just one of those things.  Dangerous world."
112    RESPONSES:
113    -   REPLY: "Uh, I see."
114        GOTO: back
115       
116-   ID: explain_steam
117    SAY: "Well it's pretty simple in principal.  We just have a big wood fire\
118       \ melting snow.  Some of it becomes drinking water, the rest gets\
119       \ vaporized and sent around in all these steam pipes.  The each have\
120       \ little radiator attachments.  As long as we have wood, the whole place\
121       \ stays quite cozy.  It's kind of a pain to keep up though."
122    RESPONSES:
123    -   REPLY: "Can anyone just go get water there?"
124        CONDITION: "quest.hasActiveQuest('beer') and\
125           \ quest.hasActiveQuest('fedex') and not\
126           \ quest['fedex'].isGoalValue('found_pekko')"
127        GOTO: help_water
128       
129    -   REPLY: "But you can keep it running indefinitely... and no one else\
130           \ knows how it works?"
131        GOTO: steam_maintainance
132       
133    -   REPLY: "Pretty nifty."
134        GOTO: inn_background
135       
136-   ID: help_water
137    SAY: "Sure, doesn't cost us a thing.  No shortage of snow.  But I'll warn\
138       \ you, the water's been tasting a little funny lately"
139    RESPONSES:
140    -   REPLY: "Thanks for the tip."
141        GOTO: back
142       
143-   ID: steam_maintainance
144    SAY: "Yeah, just me.  I call it job security.  Like I said, it's a\
145       \ dangerous world."
146    RESPONSES:
147    -   REPLY: "That must make you pretty popular around here."
148        GOTO: popularity
149       
150    -   REPLY: "Interesting."
151        GOTO: inn_background
152       
153-   ID: popularity
154    SAY: "Ha, Ha, very funny.  Let's just say it's our own version of\
155       \ checks-and-balances with Fearless Leader Kimmo over there."
156    RESPONSES:
157    -   REPLY: "Well, we all do what we have to."
158        GOTO: inn_background
159       
160-   ID: explain_girls
161    SAY: "My daughters: Camilla and Synnove.  They were just little girls when\
162       \ the whole world went to hell.  I hope they can still have some kind of\
163       \ life."
164    RESPONSES:
165    -   REPLY: "Can I talk to Camilla?"
166        GOTO: talk_camilla
167       
168    -   REPLY: "Can I talk to Synnove?"
169        GOTO: talk_synnove
170       
171    -   REPLY: "At least you still have someone to call family.  Better than\
172           \ most of us."
173        GOTO: back
174       
175-   ID: talk_camilla
176    SAY: "Can you talk to her?  Listen to her, more likely.  She's right over\
177       \ there and is usually handling the bar when I am busy."
178    RESPONSES:
179    -   REPLY: "Oh, that's her?"
180        GOTO: back
181       
182-   ID: talk_synnove
183    SAY: "Synnove?  Maybe you can talk some sense into her.  I know, she's been\
184       \ through a lot - but haven't we all.  She's wandering around somewhere."
185    RESPONSES:
186    -   REPLY: "Alright, I will look around for her."
187        GOTO: back
188       
189-   ID: explain_dig
190    SAY: "Dig and I go way back.  We owe each other our lives more times than\
191       \ we can count.  He takes care of 'difficulties' for me."
192    RESPONSES:
193    -   REPLY: "Ah, I will stay out his way then."
194        GOTO: back
195       
196-   ID: loose_women
197    SAY: "Candi and Kalli?  They're the hospitality squad.  Harmless fun, if\
198       \ you buy them a drink."
199    RESPONSES:
200    -   REPLY: "Ah, I see."
201        GOTO: back
202       
203-   ID: pekko_dead
204    SAY: "Dead, huh.  That's a shame.  A damn shame.  He was a positive force\
205       \ around here.  How did he die?"
206    RESPONSES:
207    -   REPLY: "I am not sure, I found his body in the cistern."
208        GOTO: body_found
209       
210    -   REPLY: "Someone murdered him, and shoved his body in the cistern."
211        CONDITION: "quest['fedex'].getValue('accused_of_murder') != ''"
212        GOTO: discuss_murder
213       
214-   ID: body_found
215    SAY: "Well, if you ask me, that's a funny place to have an accident.  Enoch\
216       \ and I worked for a couple of weeks on that system.  There's really no\
217       \ way you could just fall in.  And Pekko's not the suicidal type."
218    RESPONSES:
219    -   REPLY: "So you think someone killed him?"
220        GOTO: discuss_murder
221       
222    -   REPLY: "No, I am sure it was an accident."
223        GOTO: main_dialog
224       
225-   ID: discuss_murder
226    SAY: "Damn if doesn't look like it.  I know some folks were mad at him for\
227       \ stirring up trouble, but I didn't they were the type to just snuff him\
228       \ like that.  It's a cold world, alright."
229    RESPONSES:
230    -   REPLY: "Who do you think killed him?"
231        GOTO: discuss_suspects
232       
233    -   REPLY: "I think Bart, the drunkard killed him."
234        ACTIONS:
235        -   set_quest_value:
236                quest: fedex
237                value: bart
238                variable: accused_of_murder
239        GOTO: accuse_bart
240       
241    -   REPLY: "I think that dim-witted Matti killed him."
242        ACTIONS:
243        -   set_quest_value:
244                quest: fedex
245                value: matti
246                variable: accused_of_murder
247        GOTO: accuse_matti
248       
249    -   REPLY: "Bart killed him, and Kimmo put him up to it."
250        CONDITION: "quest['fedex'].isGoalValue('drunkard_confesses')"
251        GOTO: accuse_kimmo
252       
253-   ID: discuss_suspects
254    SAY: "I have my theories.  But I'll be keeping them to myself.  And if I\
255       \ were you, I would drop the subject."
256    RESPONSES:
257    -   REPLY: "Really?"
258        GOTO: back
259       
260-   ID: accuse_bart
261    SAY: "Bart, huh?  Why? What's in it for him?"
262    RESPONSES:
263    -   REPLY: "I guess I should look into it more."
264        GOTO: back
265       
266    -   REPLY: "Camilla said that she saw the two of them together out in the\
267           \ parking lot the night he disappeared."
268        CONDITION: "quest['fedex'].isGoalValue('drunkard_evidence')"
269        GOTO: back
270       
271-   ID: accuse_matti
272    SAY: "You are barking up the wrong tree."
273    RESPONSES:
274    -   REPLY: "Is that what you think?  Why won't you talk about it?"
275        GOTO: back
276       
277-   ID: accuse_kimmo
278    SAY: "So.  You figured it out, huh.  Big hero, proves the Fearless Leader\
279       \ himself had his own brother killed.  Did you ever stop to think that\
280       \ revealing this information could do even further damage?"
281    RESPONSES:
282    -   REPLY: "So, this news doesn't shock you?"
283        GOTO: murder_fallout
284       
285    -   REPLY: "I never thought of it that way before..."
286        GOTO: main_dialog
287       
288-   ID: murder_fallout
289    SAY: "Survival in this world is bigger than the life of any one man; even\
290       \ an innocent man.  Justice is not my - or anyone's - primary concern."
291    RESPONSES:
292    -   REPLY: "Without justice, is survival worth anything at all?"
293        GOTO: main_dialog
294       
295-   ID: help_fedex
296    SAY: "Ah, adventure boy.  Nope, haven't seem him in a couple of days.\
297       \ Maybe check with one of the girls?"
298    RESPONSES:
299    -   REPLY: "Girls?"
300        GOTO: explain_girls
301       
302    -   REPLY: "Hmmm... no one seems to have seen him."
303        GOTO: back
304       
305-   ID: ungratitude
306    SAY: "Well aren't you just a thick slice of awesome."
307    RESPONSES:
308    -   REPLY: "I try, I try."
309        GOTO: main_dialog
310       
311...
Note: See TracBrowser for help on using the repository browser.