changeset 289:16ffe6f5dbb8

Add fox.shape (which can be 'fox', 'human' or 'human_with_fan') to game.json. Use fox.shape in state checks in guard.json.
author Simon Cross <hodgestar@gmail.com>
date Fri, 08 Apr 2011 21:44:39 +0200
parents ddcfc159dc2a
children c68f2f3efc7f
files data/game.json data/npcs/guard.json
diffstat 2 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/data/game.json	Fri Apr 08 21:23:00 2011 +0200
+++ b/data/game.json	Fri Apr 08 21:44:39 2011 +0200
@@ -2,6 +2,7 @@
     "fox": {
         "item": null,
         "tails" : [],
+        "shape": "fox",
         "cur_health" : 40,
         "max_health" : 40,
         "level": "temple",
--- a/data/npcs/guard.json	Fri Apr 08 21:23:00 2011 +0200
+++ b/data/npcs/guard.json	Fri Apr 08 21:44:39 2011 +0200
@@ -2,8 +2,8 @@
     "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" }
+            { "matches" : "world.fox.shape == 'human'", "next": "state.shapeshifted" },
+            { "matches" : "world.fox.shape == 'human_with_fan'", "next": "state.disguised" }
         ]
     },
     "shapeshifted" : {
@@ -14,7 +14,8 @@
             { "text": "Sayonara.", "next": "state.secondtry" }
         ],
         "events" : [
-            { "matches" : "world.fox_is_disguised", "next": "state.disguised" }
+            { "matches" : "world.fox.shape == 'human_with_fan'", "next": "state.disguised" },
+            { "matches" : "world.fox.shape == 'fox'", "next": "state.start" }
         ]
     },
     "monks" : {
@@ -34,7 +35,7 @@
     "secondtry" : {
         "text" : "The gate is locked, and it’s staying locked.",
         "events" : [
-            { "matches" : "world.fox_is_disguised", "next": "state.disguised" }
+            { "matches" : "world.fox.shape == 'human_with_fan'", "next": "state.disguised" }
         ]
     },
     "disguised" : {