changeset 171:13e10b877f6c

dialogue tree for temple guard
author Adrianna Pińska <adrianna.pinska@gmail.com>
date Wed, 06 Apr 2011 01:04:43 +0200
parents aa154c4086cb
children bf144d817113
files data/npcs/guard.json skaapsteker/dialogue.py
diffstat 2 files changed, 74 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/data/npcs/guard.json	Wed Apr 06 01:04:43 2011 +0200
@@ -0,0 +1,65 @@
+{
+    "start" : {
+        "text" : "Shoo, filthy fox! How did you get in here?",
+        "events" : [
+            { "matches" : "world.fox_is_shapeshifted()", "next": "state.shapeshifted" },
+            { "matches" : "world.fox_is_disguised()", "next": "state.disguised" }
+        ]
+    },
+    "shapeshifted" : {
+        "text" : "Excuse me, ma’am. The gate is closed.",
+        "choices" : [
+            { "text": "Why is that?", "next": "state.monks" },
+            { "text": "Let me out now!", "next": "state.staycalm" },
+            { "text": "Sayonara.", "next": "state.secondtry" }
+        ],
+        "events" : [
+            { "matches" : "world.fox_is_disguised()", "next": "state.disguised" }
+        ]
+    },
+    "monks" : {
+        "text" : "The monks have asked us not to let anybody out.",
+        "choices" : [
+            { "text": "Pretty please?", "next": "state.noexceptions" }
+        ]
+    },
+    "noexceptions" : {
+        "text" : "Sorry, no exceptions.",
+        "auto_next": "state.secondtry"
+    },
+    "staycalm" : {
+        "text" : "Please stay calm. Perhaps you should go meditate?",
+        "auto_next": "state.secondtry"
+    },
+    "secondtry" : {
+        "text" : "The gate is locked, and it’s staying locked.",
+        "events" : [
+            { "matches" : "world.fox_is_disguised()", "next": "state.disguised" }
+        ]
+    },
+    "disguised" : {
+        "text" : "Ah, good evening, young lady! I’m afraid the gate is still closed for the night...",
+        "choices" : [
+            { "text": "Even for me?", "next": "state.notsafe" },
+            { "text": "Sayonara." }
+        ]
+    },
+    "notsafe" : {
+        "text" : "Ah, well, it isn’t safe for pretty young women to be wandering around alone.",
+        "choices" : [
+            { "text": "It’s only for a moment. My house is just across the road.", "next": "state.hmm" }
+        ]
+    },
+    "hmm" : {
+        "text" : "Hmm...",
+        "choices" : [
+            { "text": "You could come join me for some sake later.", "next": "state.okay" }
+        ]
+    },
+    "okay" : {
+        "text" : "Ah, well, okay! I guess I could make an exception, just this once... Just across the road, you say...",
+        "auto_next": "state.agreed"
+    },
+    "agreed" : {
+    }
+}
\ No newline at end of file
--- a/skaapsteker/dialogue.py	Wed Apr 06 00:49:16 2011 +0200
+++ b/skaapsteker/dialogue.py	Wed Apr 06 01:04:43 2011 +0200
@@ -121,6 +121,15 @@
 
     def __init__(self):
         self._fox_has_tea = False
+        self._fox_is_shapeshifted = False
+        self._fox_is_disguised = False
 
     def fox_has_tea(self):
         return self._fox_has_tea
+
+    def fox_is_shapeshifted(self):
+        return self._fox_is_shapeshifted
+
+    def fox_is_disguised(self):
+        return self._fox_is_disguised
+