source: trunk/game/dialogue/bouncer.yaml @ 684

Revision 668, 5.5 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: Dig
17AVATAR_PATH: gui/icons/bouncer.png
18START_SECTION: main_dialog
19SECTIONS:
20-   ID: main_dialog
21    SAY: "What do you want?  Can't you see I'm drinking here?"
22    ACTIONS:
23    -   meet:
24        - dig
25    RESPONSES:
26    -   REPLY: "I'm looking for stuff to make beer with."
27        CONDITION: "quest.hasActiveQuest('beer') and not\
28           \ quest.hasFinishedQuest('beer') and\
29           \ quest['beer'].isGoalValue('beer_instructions')"
30        GOTO: help_beer
31       
32    -   REPLY: "Do you know Jacob?"
33        GOTO: explain_jacob
34       
35    -   REPLY: "Do you work here?"
36        GOTO: inn_background
37       
38    -   REPLY: "Are you going to kick my ass?"
39        GOTO: ass_kicking
40       
41    -   REPLY: "Was Camillia with you in the bar here two nights ago?"
42        CONDITION: "quest['fedex'].isGoalValue('drunkard_evidence')"
43        GOTO: check_alibi
44       
45    -   REPLY: "Who are those two women over there?"
46        GOTO: loose_women
47       
48    -   REPLY: "Why is Camilla such a bitch?"
49        CONDITION: "pc.met('camilla')"
50        GOTO: explain_camilla
51       
52    -   REPLY: "What is up with Synnove?"
53        CONDITION: "pc.met('synnove')"
54        GOTO: explain_synnove
55       
56    -   REPLY: "Your boss's booze monopoly is over!!"
57        CONDITION: "quest['beer'].getValue('beer_quality') >= 1"
58        GOTO: ungratitude
59       
60    -   REPLY: "I'm looking for Pekko, you seen him?"
61        CONDITION: "quest.hasActiveQuest('fedex') and not\
62           \ quest.hasFinishedQuest('fedex') and not\
63           \ quest['fedex'].isGoalValue('found_pekko')"
64        GOTO: help_fedex
65       
66    -   REPLY: "Hey, back off.  Just making small talk."
67        GOTO: parting_shot
68       
69-   ID: explain_camilla
70    SAY: "Well, it's probably because she gets hit on by greasy layabouts all\
71       \ hours of the day.  Maybe you should cut her some slack."
72    RESPONSES:
73    -   REPLY: "Hmmm... Can you confirm that she was here all night with you\
74           \ two days ago?"
75        CONDITION: "quest['fedex'].isGoalValue('drunkard_evidence')"
76        GOTO: check_alibi
77       
78    -   REPLY: "I suppose that's not unreasonable."
79        GOTO: back
80       
81-   ID: check_alibi
82    SAY: "Huh?  You're not her boyfriend.  And I'm not her babysitter.  Why do\
83       \ you care?"
84    RESPONSES:
85    -   REPLY: "I'm investigating a murder"
86        GOTO: investigate
87       
88    -   REPLY: "No reason.  No reason at all."
89        GOTO: main_dialog
90       
91-   ID: investigate
92    SAY: "Oh, in that case officer, she was with me the whole time. [rolls\
93       \ eyes]"
94    RESPONSES:
95    -   REPLY: "I get the sense that you are not taking this very seriously."
96        GOTO: main_dialog
97       
98-   ID: ass_kicking
99    SAY: "Not today.  I'm off duty.  But watch yourself all the same."
100    RESPONSES:
101    -   REPLY: "I'll do that."
102        GOTO: back
103       
104-   ID: explain_jacob
105    SAY: "I'm Jacob's guy.  You got a problem with him - or his family - you\
106       \ got a problem with me.  So do you have a problem?"
107    RESPONSES:
108    -   REPLY: "Nope.  No problem at all."
109        GOTO: back
110       
111-   ID: explain_synnove
112    SAY: "OK, she's a little weird.  She was 5 when she saw what those Russians\
113       \ bastards did to her mother.  She'd have been next if Jacob and I hadn't\
114       \ shown up in time."
115    RESPONSES:
116    -   REPLY: "Oh, I had no idea.  Gruesome."
117        GOTO: back
118       
119-   ID: inn_background
120    SAY: "If you call sittin' here and bullshitting `working`.  But I do solve\
121       \ problems for Jacob.  You're not a problem, are ya?"
122    RESPONSES:
123    -   REPLY: "No sir, no problem here."
124        GOTO: back
125       
126-   ID: help_beer
127    SAY: "Now you are just trying to be funny.  And failing.   Get out of here\
128       \ before I decide to throw you out."
129    RESPONSES:
130    -   REPLY: "Yeah, well maybe I'll find my own bouncer, too!"
131        GOTO: parting_shot
132       
133-   ID: loose_women
134    SAY: "Buy 'em a drink and find out."
135    RESPONSES:
136    -   REPLY: "I would do that if I could afford the booze in this place."
137        GOTO: back
138       
139-   ID: help_fedex
140    SAY: "I dunno.  Dude's in here all the time."
141    RESPONSES:
142    -   REPLY: "Was he here talking to Bart a couple nights ago?"
143        CONDITION: "quest['fedex'].isGoalValue('drunkard_evidence')"
144        GOTO: pekko_check
145       
146    -   REPLY: "Lot of help you are."
147        GOTO: parting_shot
148       
149-   ID: pekko_check
150    SAY: "Buy 'em a drink and find out."
151    RESPONSES:
152    -   REPLY: "I would do that if I could afford the booze in this place."
153        GOTO: back
154       
155-   ID: parting_shot
156    SAY: "Watch yourself, Bub.  I don't want to get out this chair."
157    RESPONSES:
158    -   REPLY: "Ulp."
159        GOTO: end
160       
161-   ID: ungratitude
162    SAY: "Oh, a wise guy huh??? [gets out of chair]"
163    RESPONSES:
164    -   REPLY: "I'm out of here!"
165        GOTO: end
166       
167...
Note: See TracBrowser for help on using the repository browser.