diff data/npcs/monk.json @ 153:704d23022f09

Start of dialogue tree / NPC state machine support.
author Simon Cross <hodgestar@gmail.com>
date Tue, 05 Apr 2011 22:18:26 +0200
parents
children 4e7ca5cf57fa
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/data/npcs/monk.json	Tue Apr 05 22:18:26 2011 +0200
@@ -0,0 +1,31 @@
+{
+    "start" : {
+        "text" : "Oh poor thing, a tailless fox! What happened to you, little one?",
+        "choices" : [
+            { "text": "Yip!" },
+            { "text": "Grrrr...", "next": "state.unfortunate" }
+        ]
+    },
+    "unfortunate" : {
+        "text" : "Unfortunate, I’m sure. That’s why I keep my lucky fox tail handy.",
+        "choices" : [
+            { "text": "Yip yip!", "next": "state.you_dont_speak" }
+        ]
+    },
+    "you_dont_speak" : {
+        "text" : "You don’t speak, of course. Forgive a silly old man. I lose my senses when I haven’t had my tea! Mmm, a fine brew of oolong! But there’s a demon in the attic and I’m too scared to fetch the tea leaves. Pity you don’t understand me, or you could get me a cup!",
+        "auto_next": "state.no_tea"
+    },
+    "no_tea" : {
+        "text" : "Oh, what I wouldn’t do for a cup of tea.",
+        "events" : [
+            { "matches" : "world.fox_has_tea()", "next": "state.got_tea" }
+        ]
+    },
+    "got_tea" : {
+        "text" : "My tea! Oh, heavenly! Such aroma, what a taste... Just what I need. Mmm...",
+        "auto_next": "state.distracted"
+    },
+    "distracted" : {
+    }
+}