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

Revision 668, 6.0 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: Farmer Manslow
17AVATAR_PATH: gui/icons/farmer.png
18START_SECTION: main_dialog
19SECTIONS:
20-   ID: main_dialog
21    SAY: "Who the hell are you??"
22    ACTIONS:
23    -   meet:
24        - manslow
25    RESPONSES:
26    -   REPLY: "I'm looking for stuff to make beer with "
27        CONDITION: "quest.hasActiveQuest('beer') and\
28           \ quest['beer'].isGoalValue('beer_instructions') and not\
29           \ quest.hasFinishedQuest('beer') and not\
30           \ quest['beer'].isGoalValue('farmer_beer_convinced')"
31        GOTO: convince_farmer
32       
33    -   REPLY: "You can help me with the beer, thing, right?"
34        CONDITION: "quest.hasActiveQuest('beer') and\
35           \ quest['beer'].isGoalValue('beer_instructions') and not\
36           \ quest.hasFinishedQuest('beer') and\
37           \ quest['beer'].isGoalValue('farmer_beer_convinced')"
38        ACTIONS:
39        -   set_quest_value: &id001
40                quest: beer
41                value: 1
42                variable: farmer_beer_convinced
43        GOTO: help_beer
44       
45    -   REPLY: "Hey, that wheat you gave me really made the brew work."
46        CONDITION: "quest['beer'].getValue('beer_quality') > 3"
47        GOTO: gratitude
48       
49    -   REPLY: "Have you tried my beer?"
50        CONDITION: "quest['beer'].getValue('beer_quality') !=0 and\
51           \ quest['beer'].getValue('beer_quality') <= 3"
52        GOTO: grumpitude
53       
54    -   REPLY: "I'm looking for Pekko, you seen him?"
55        CONDITION: "quest.hasActiveQuest('fedex') and not\
56           \ quest.hasFinishedQuest('fedex')"
57        GOTO: help_fedex
58       
59    -   REPLY: "This is quite a nice farm you have here, can you tell me about\
60           \ it?"
61        GOTO: chat_farm
62       
63    -   REPLY: "Hey, relax there old timer!"
64        GOTO: leave
65       
66-   ID: convince_farmer
67    SAY: "Never touch the stuff."
68    RESPONSES:
69    -   REPLY: "Come on -- have a heart.  Man cannot live on bread alone!"
70        GOTO: leave
71       
72    -   REPLY: "Well to be honest... we are trying to undermine Jacob's\
73           \ stranglehold on the booze in this town."
74        GOTO: inn_explain
75       
76-   ID: inn_explain
77    SAY: "Really.  What makes you think I'll help you."
78    RESPONSES:
79    -   REPLY: "Well, you know, Bart, he's a good guy..."
80        GOTO: leave
81       
82    -   REPLY: "Because Jacob is the only guy here grumpier than you!"
83        ACTIONS:
84        -   set_quest_value: *id001
85        GOTO: help_beer
86       
87-   ID: help_beer
88    SAY: "He is a right old bastard, that Jacob... What are you looking for?"
89    RESPONSES:
90    -   REPLY: "First, I need some water."
91        GOTO: help_water
92       
93    -   REPLY: "What I really need is some kind of grain, or fruit or\
94           \ something."
95        CONDITION: "not quest['beer'].isGoalValue('grain_available')"
96        ACTIONS:
97        -   take_stuff:
98            - Grain
99        -   set_quest_value:
100                quest: beer
101                value: 0
102                variable: grain_available
103        GOTO: help_grain
104       
105    -   REPLY: "You wouldn't happen to know where I can find some yeast?"
106        GOTO: help_yeast
107       
108    -   REPLY: "Well, I need a big pot to cook the mash in."
109        GOTO: help_pot
110       
111    -   REPLY: "The final step is some thing to hold the final product in."
112        GOTO: help_bottles
113       
114    -   REPLY: "You are the grumpiest old man ever."
115        GOTO: leave
116       
117-   ID: help_water
118    SAY: "What are you an idiot?  We're surrounded by SNOW."
119    RESPONSES:
120    -   REPLY: "Sorry, no need to be a jerk about it..."
121        GOTO: leave
122       
123-   ID: help_grain
124    SAY: "Well, that is my department.  I'll give you a bushel if you promise\
125       \ to use your brew to cause Jacob trouble."
126    RESPONSES:
127    -   REPLY: "Deal."
128        GOTO: back
129       
130-   ID: help_yeast
131    SAY: "Yeast.  You really think someone is keeping around some kind of\
132       \ starter culture?"
133    RESPONSES:
134    -   REPLY: "Uh... yeah?  Hey, how do you know so much about brewing if you\
135           \ don't even drink!"
136        GOTO: leave
137       
138-   ID: help_pot
139    SAY: "Is there anything that you HAVE to make beer with?"
140    RESPONSES:
141    -   REPLY: "Well, I have these instructions..."
142        GOTO: back
143       
144-   ID: help_bottles
145    SAY: "Junkyard."
146    RESPONSES:
147    -   REPLY: "Where's the junkyard?"
148        GOTO: explain_junkyard
149       
150-   ID: explain_junkyard
151    SAY: "Downstairs.  Near the woodpile and the garbage dump."
152    RESPONSES:
153    -   REPLY: "Wow, that was kind of helpful... maybe you aren't so bad after\
154           \ all! "
155        GOTO: leave
156       
157-   ID: help_fedex
158    SAY: "Pekko... I thought he was out scouting?  Did you try the Inn?"
159    RESPONSES:
160    -   REPLY: "OK, the Inn, thanks."
161        GOTO: back
162       
163-   ID: gratitude
164    SAY: "I still think it's a waste of grain.  But anything that screws that\
165       \ bastard Jacob is OK by me."
166    RESPONSES:
167    -   REPLY: "Couldn't have done it without you."
168        GOTO: leave
169       
170-   ID: grumpitude
171    SAY: "At least you didn't waste any of my grain on it.  Awful stuff."
172    RESPONSES:
173    -   REPLY: "No thanks, to you old man."
174        GOTO: leave
175       
176-   ID: chat_farm
177    SAY: "I don't have time for chit chat.  Talk to my assistants."
178    RESPONSES:
179    -   REPLY: "OK, I'll do that."
180        GOTO: back
181       
182-   ID: leave
183    SAY: "Get off mah land!"
184    RESPONSES:
185    -   REPLY: "Bye!"
186        GOTO: end
187       
188...
Note: See TracBrowser for help on using the repository browser.