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

Revision 668, 6.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
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: Skwisgaar the Crazy Swede
17AVATAR_PATH: gui/icons/crazy_swede.png
18START_SECTION: main_dialog
19SECTIONS:
20-   ID: main_dialog
21    SAY: "Chop!  Chop!  Chopity Chop-chop?"
22    ACTIONS:
23    -   meet:
24        - skwisgaar
25    RESPONSES:
26    -   REPLY: "Chop-chop.  Chop-choppy, choppy chop."
27        GOTO: a1
28       
29    -   REPLY: "You are the woodcutter?"
30        GOTO: a2
31       
32    -   REPLY: "Sorry, I don't speak chop."
33        GOTO: end
34       
35-   ID: a1
36    SAY: "Ah, you speak the lingo!  How long have you been chopping the good\
37       \ chop?"
38    RESPONSES:
39    -   REPLY: "Oh, me?  - These hands are not suited for manual labor."
40        GOTO: a2
41       
42    -   REPLY: "I have been known to chop-chop the wood what needs choppin' --\
43           \ if you know what I mean."
44        GOTO: b1
45       
46-   ID: a2
47    SAY: "You gots to Chop what to Chop when the Choppin' needs a Chop!!!"
48    RESPONSES:
49    -   REPLY: "Yes, my man it is only us against the wood!"
50        GOTO: b1
51       
52    -   REPLY: "Chop?  What the hell are you talking about!"
53        GOTO: b2
54       
55    -   REPLY: "Enough with the chop talk!  Do you have any yeast?"
56        CONDITION: "quest.hasActiveQuest('beer') and\
57           \ quest['beer'].isGoalValue('beer_instructions')"
58        GOTO: end
59       
60-   ID: b1
61    SAY: "Ah, so you chop the chop... but do you Chop the Chop?"
62    RESPONSES:
63    -   REPLY: "Well, that's how we did it back in Sweden!"
64        GOTO: c1
65       
66    -   REPLY: "Well, that's how we did it back in Norway!"
67        GOTO: c2
68       
69    -   REPLY: "Well, that is how we Finns get it done!"
70        GOTO: c3
71       
72-   ID: b2
73    SAY: "Chopity!!! Chop the Chop-chop!!!"
74    RESPONSES:
75    -   REPLY: "Chop?  You betcha - chop, chop!"
76        GOTO: b1
77       
78    -   REPLY: "Yeast.  Y-E-A-S-T.  For making booze.  Do you understand me?"
79        CONDITION: "quest.hasActiveQuest('beer') and\
80           \ quest['beer'].isGoalValue('beer_instructions')"
81        GOTO: end
82       
83    -   REPLY: "Screw this, you cannot argue with a Swede!"
84        GOTO: c1
85       
86    -   REPLY: "You got a problem?  Hit in the head during the war?"
87        ACTIONS:
88        -   set_quest_value: &id001
89                quest: beer
90                value: 0
91                variable: yeast_available
92        GOTO: permanent_failure
93       
94-   ID: c1
95    SAY: "Sweden!  Sweden?  Got no chops!!!"
96    RESPONSES:
97    -   REPLY: "But they told me you were from there."
98        GOTO: main_dialog
99       
100    -   REPLY: "Oh.. you aren't Swedish, are you?"
101        GOTO: end
102       
103    -   REPLY: "Did I say Sweden?  I meant Norway."
104        CONDITION: "quest['beer'].getValue('yeast_available')"
105        GOTO: c2
106       
107-   ID: c2
108    SAY: "N..n...Norway.  Norway...  NORWAY!  The FJORDS!!!! [sobs]"
109    RESPONSES:
110    -   REPLY: "Did I say Norway?  I meant Sweden."
111        GOTO: c1
112       
113    -   REPLY: "Hey, Hey - there it's OK.  We have Fjords right here in\
114           \ Finland."
115        GOTO: c3
116       
117    -   REPLY: "You are not pining, are you?"
118        GOTO: main_dialog
119       
120    -   REPLY: "Yeah, buddy.  You are a long way from home.  Be nice if we had\
121           \ a drink to toast to Norway."
122        CONDITION: "quest.hasActiveQuest('beer') and\
123           \ quest['beer'].getValue('yeast_available')"
124        GOTO: d
125       
126    -   REPLY: "Yeah, buddy.  You are a long way from home."
127        CONDITION: "quest.hasActiveQuest('beer') and not\
128           \ quest['beer'].getValue('yeast_available')"
129        GOTO: dprime
130       
131-   ID: c3
132    SAY: "FINLAND GOT NO FJORDS!!!!"
133    RESPONSES:
134    -   REPLY: "Whoa... no need to get excited there... uh... Chop?\
135           \ Choppy-Chop-Chop?"
136        GOTO: b2
137       
138    -   REPLY: "At least they know how to make booze!"
139        GOTO: end
140       
141    -   REPLY: "You are totally insane."
142        ACTIONS:
143        -   set_quest_value: *id001
144        GOTO: permanent_failure
145       
146-   ID: d
147    SAY: "Ah, a toast to the King!  The King of Norway!  [looks around\
148       \ furtively]  But the Skol!  Need the bugs for the skol! "
149    RESPONSES:
150    -   REPLY: "Bugs?  You eat bugs?"
151        GOTO: e1
152       
153    -   REPLY: "Bugs?  You mean for beer?  Little yeasties?"
154        GOTO: e2
155       
156-   ID: dprime
157    SAY: "No bugs for you!"
158    RESPONSES:
159    -   REPLY: "Nuts."
160        GOTO: end
161       
162-   ID: e1
163    SAY: "HAHAA... uncultured baboon!  Baboon- bug eater!  Don't eat the bugs!\
164       \ Ferment with the bugs! "
165    RESPONSES:
166    -   REPLY: "That's what I need!  Fermentation bugs!"
167        GOTO: end
168       
169    -   REPLY: "Ah, indeed!  A fermented beverage!  Fit for a King..."
170        GOTO: d
171       
172    -   REPLY: "YES!  The bugs!  The yeast bugs!  For the Fermentation!"
173        ACTIONS:
174        -   take_stuff:
175            - Yeast
176        -   set_quest_value:
177                quest: beer
178                value: 0
179                variable: yeast_available
180        GOTO: get_yeast
181       
182-   ID: e2
183    SAY: "Yeasties!  Belittle them not, foreign stranger!  The finest Norwegian\
184       \ yeast I have saved for 1,000 years!!"
185    RESPONSES:
186    -   REPLY: "Oh you're one to talk about Foreigers, Swede!"
187        GOTO: end
188       
189    -   REPLY: "Ah, Norwegian yeast.  Truly a permanent cultural artifact!"
190        GOTO: e1
191       
192    -   REPLY: "1000 years?"
193        ACTIONS:
194        -   set_quest_value: *id001
195        GOTO: permanent_failure
196       
197-   ID: get_yeast
198    SAY: "My precious beasties... yeasty beasties for the fermentation!  Don't\
199       \ forget to save Culture and Civilization!"
200    RESPONSES:
201    -   REPLY: "Thanks buddy!  Skol!"
202        GOTO: end
203       
204-   ID: permanent_failure
205    SAY: "[ scowls ] Chop!  Chop!  Chopity Chop-chop.  Chop."
206    RESPONSES:
207    -   REPLY: "Go ahead and chop wood until the end of your days, nutball!"
208        GOTO: end
209       
210...
Note: See TracBrowser for help on using the repository browser.