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

Revision 668, 9.4 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
RevLine 
[421]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---
[668]16NPC_NAME: Helja
17AVATAR_PATH: gui/icons/quartermaster.jpg
18START_SECTION: main_dialog
[421]19SECTIONS:
[668]20-   ID: main_dialog
21    SAY: "Hello, there!  A new addition to the labor pool, I see."
22    ACTIONS:
23    -   meet:
24        - helja
25    RESPONSES:
26    -   REPLY: "What do you do around here?"
27        GOTO: expound_quartermaster
28       
29    -   REPLY: "You're the Quartermaster?  I bet you can help me with some\
30           \ requisitions?"
31        CONDITION: "quest.hasActiveQuest('beer') and not\
32           \ quest.hasFinishedQuest('beer') and\
33           \ quest['beer'].isGoalValue('beer_instructions')"
34        GOTO: pre_help_beer
35       
36    -   REPLY: "You going to help me distribute this new beer?"
37        CONDITION: "quest['beer'].getValue('beer_quality') >= 1"
38        GOTO: beer_network
39       
40    -   REPLY: "You haven't seen Pekko around lately, have you?"
41        CONDITION: "quest.hasActiveQuest('fedex') and not\
42           \ quest.hasFinishedQuest('fedex') and not\
43           \ quest['fedex'].isGoalValue('found_pekko')"
44        ACTIONS:
45        -   set_quest_value:
46                quest: fedex
47                value: true
48                variable: check_bart_left
49        GOTO: help_fedex
50       
51    -   REPLY: "Labor pool?  I forgot my suit."
52        GOTO: end
53       
54-   ID: expound_quartermaster
55    SAY: "I am the like the supply sergeant.  I am in charge of all the\
56       \ communal goods - particularly food."
57    RESPONSES:
58    -   REPLY: "Sounds like an important job.  Are you bribe-able?"
59        GOTO: bribe_comment
60       
61    -   REPLY: "Really?  Because I am looking for some items to brew some\
62           \ beer..."
63        CONDITION: "quest.hasActiveQuest('beer') and not\
64           \ quest.hasFinishedQuest('beer') and\
65           \ quest['beer'].isGoalValue('beer_instructions')"
66        GOTO: pre_help_beer
67       
68-   ID: bribe_comment
69    SAY: "Oh, funny. [narrows eyes] But I do like to help people who help\
70       \ themselves.  Like God."
71    RESPONSES:
72    -   REPLY: "So you accept burnt offerings?"
73        GOTO: main_dialog
74       
75-   ID: pre_help_beer
76    SAY: "Hey, I don't just give stuff away.  You have to have a requisition\
77       \ note from Kimmo, or at least trade something. "
78    RESPONSES:
79    -   REPLY: "Who's Kimmo?"
80        GOTO: describe_kimmo
81       
82    -   REPLY: "Well, I don't have a requisition... I am going to make some\
83           \ beer."
84        GOTO: elaborate_beer
85       
86-   ID: describe_kimmo
87    SAY: "Kimmo is the leader of our merry band.  He's my boss -- the boss of\
88       \ all of us, currently."
89    RESPONSES:
90    -   REPLY: "What do you mean, currently?"
91        GOTO: describe_rivalry
92       
93    -   REPLY: "So do you think Kimmo would let me have some stuff to make\
94           \ beer?"
95        GOTO: elaborate_beer
96       
97-   ID: elaborate_beer
98    SAY: "Beer, huh.  That might undermine Jacob's inn a bit.  Kimmo would\
99       \ probably approve of that."
100    RESPONSES:
101    -   REPLY: "So you will help me?"
102        GOTO: help_beer
103       
104    -   REPLY: "Why would Kimmo want to undermine Jacob?"
105        GOTO: describe_rivalry
106       
107-   ID: describe_rivalry
108    SAY: "Well, Jacob -- I guess you would call him Kimmmo's primary rival for\
109       \ leadership."
110    RESPONSES:
111    -   REPLY: "Do you think he'll try to take over?"
112        GOTO: elaborate_rivalry
113       
114    -   REPLY: "Interesting.  And whom do you support?"
115        GOTO: which_side
116       
117    -   REPLY: "So, Kimmo would want me to give the place another source of\
118           \ beer, right?"
119        GOTO: help_beer
120       
121    -   REPLY: "Ugh, small town politics.  Say no more."
122        GOTO: main_dialog
123       
124-   ID: which_side
125    SAY: "Well, most of us owe Kimmo our lives.  But I'm no fighter.  I've\
126       \ survived this long without getting involved in petty power struggles.\
127       \ I am good at what I do."
128    RESPONSES:
129    -   REPLY: "But you are not against a little underhanded move against\
130           \ Jacob..."
131        GOTO: help_beer
132       
133    -   REPLY: "So, playing both sides against the middle.  What if Jacob makes\
134           \ a move?"
135        GOTO: elaborate_rivalry
136       
137-   ID: elaborate_rivalry
138    SAY: "I don't think he'll make a move... as long as we stay here."
139    RESPONSES:
140    -   REPLY: "Why would you move?  This place is awesome!"
141        GOTO: why_move
142       
143-   ID: why_move
144    SAY: "Pekko's got this idea that the winters are going to get worse.  He\
145       \ says Lapland up north is already glaciated, and it's only a matter of\
146       \ time before this place is totally frozen out."
147    RESPONSES:
148    -   REPLY: "So you will help me make some beer?"
149        GOTO: help_beer
150       
151    -   REPLY: "And away from the Paatalo, Kimmo's power base is weak.  Who do\
152           \ you support?"
153        GOTO: which_side
154       
155-   ID: help_beer
156    SAY: "Well, what do you need exactly?"
157    RESPONSES:
158    -   REPLY: "I need some pure water."
159        CONDITION: "quest['fedex'].isGoalValue('found_pekko')"
160        GOTO: help_water_clean
161       
162    -   REPLY: "I need some pure water."
163        CONDITION: "not quest['fedex'].isGoalValue('found_pekko')"
164        GOTO: help_water_dirty
165       
166    -   REPLY: "The basis of the the brew is some source of sugar, like grain\
167           \ or potatoes."
168        GOTO: help_grain
169       
170    -   REPLY: "A yeast culture would really make the thing less dicey"
171        GOTO: help_yeast
172       
173    -   REPLY: "Of course, I'll need something to cook the mash in..."
174        GOTO: help_pot
175       
176    -   REPLY: "When it's all done, I'll need to put the beer in something"
177        GOTO: help_bottles
178       
179    -   REPLY: "That should about do it, thanks."
180        GOTO: back
181       
182-   ID: help_water_dirty
183    SAY: "You can have all the water you want... but people have been\
184       \ complaining about the taste lately.  It should probably be checked\
185       \ out."
186    RESPONSES:
187    -   REPLY: "Oh, that's interesting."
188        GOTO: back
189       
190-   ID: help_water_clean
191    SAY: "Water is unrestricted.  Go downstairs and draw a bucket from the\
192       \ cistern, it's filtered."
193    RESPONSES:
194    -   REPLY: "Water, check."
195        GOTO: back
196       
197-   ID: help_grain
198    SAY: "Well, food.  Now that is not easy to get.  I can't authorize you any\
199       \ grain.  But maybe there are some old potatoes around..."
200    RESPONSES:
201    -   REPLY: "Potatoes? I guess that's not too bad. Where would I find some?"
202        GOTO: help_potatoes
203       
204    -   REPLY: "Grain would really be the best... where do you get it?"
205        GOTO: help_farm
206       
207    -   REPLY: "OK, I'll see what I can scrounge up"
208        GOTO: back
209       
210-   ID: help_yeast
211    SAY: "You know... Skwisgaar is always babbling about yeast and stuff.  Good\
212       \ luck getting a straight answer out of him though."
213    RESPONSES:
214    -   REPLY: "Skwisgaar... is that the wood chopper?"
215        GOTO: wood_chopper
216       
217-   ID: help_pot
218    SAY: "Well, I got a pot.  But I can't just give it up.  What will you give\
219       \ me for it?"
220    RESPONSES:
221    -   REPLY: "Well, I got this pocket knife... would that do?"
222        ACTIONS:
223        -   give_stuff:
224            - pocket_knife
225        -   take_stuff:
226            - brew_pot
227        GOTO: trade_knife
228       
229    -   REPLY: "No deal.  I'll find my own."
230        GOTO: back
231       
232-   ID: help_bottles
233    SAY: "Junkyard.  Also unrestricted.  Help yourself."
234    RESPONSES:
235    -   REPLY: "Thanks."
236        GOTO: back
237       
238-   ID: trade_knife
239    SAY: "Let me see it. [You hand over the knife].  Humh.  A little used.\
240       \ But OK, I like you."
241    RESPONSES:
242    -   REPLY: "It's a deal then."
243        GOTO: help_beer
244       
245-   ID: wood_chopper
246    SAY: "Yeah, the wood chopper.  Came over to help us against the Russkies.\
247       \ From Sweden or something.  I don't think he's quite right in the head."
248    RESPONSES:
249    -   REPLY: "I'll keep that in mind"
250        GOTO: help_beer
251       
252-   ID: help_potatoes
253    SAY: "There should be some old ones in that storeroom back there.  Probably\
254       \ won't be missed."
255    RESPONSES:
256    -   REPLY: "Wow, thanks.  You won't regret this."
257        GOTO: back
258       
259-   ID: help_farm
260    SAY: "I'm sorry.  I can't really disclose that information.  That farm is\
261       \ our life."
262    RESPONSES:
263    -   REPLY: "Hey, it's cool.  I am not looking for trouble."
264        GOTO: back
265       
266-   ID: help_fedex
267    SAY: "He was here a couple of days ago, getting provisioned for one of his\
268       \ excursions.  He should be back by now though."
269    RESPONSES:
270    -   REPLY: "So the you last saw him, he was leaving the compound."
271        GOTO: back
272       
273-   ID: beer_network
274    SAY: "I'll think about it.  Let's see if things quiet down."
275    RESPONSES:
276    -   REPLY: "Alright, Helja."
277        GOTO: main_dialog
278       
279...
Note: See TracBrowser for help on using the repository browser.