changeset 524:4242066f771d

Hook up if choices in haiku battle.
author Simon Cross <hodgestar@gmail.com>
date Sat, 09 Apr 2011 23:46:07 +0200
parents c7c3f55554d4
children 8087e95ade2f
files data/npcs/kitsune.json
diffstat 1 files changed, 16 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/data/npcs/kitsune.json	Sat Apr 09 23:45:00 2011 +0200
+++ b/data/npcs/kitsune.json	Sat Apr 09 23:46:07 2011 +0200
@@ -12,7 +12,7 @@
         "text" : "But now we are here, face to face. How could you ever hope to defeat me?",
         "choices" : [
             { "text": "In battle!", "next": "state.battle_start" },
-            { "text": "In a haiku competition.", "next": "state.haiku_start" }
+            { "text": "In a haiku competition.", "next": "state.haiku_start", "if": "len(world.fox.scrolls) > 0" }
         ]
     },
     "battle_start" : {
@@ -32,31 +32,31 @@
     "haiku1" : {
         "text" : "Over the wintry\nforest, winds howl in rage\n...?",
         "choices" : [
-            { "text": "remaining in it?", "next": "state.haiku_wrong" },
-            { "text": "the end of autumn.", "next": "state.haiku_wrong" },
-            { "text": "with no leaves to blow.", "next": "state.haiku_right" },
-            { "text": "the Galaxy.", "next": "state.haiku_wrong" },
-            { "text": "and it passes by.", "next": "state.haiku_wrong" }
+            { "text": "remaining in it?", "next": "state.haiku_wrong", "if": "'remaining in it?' in world.fox.scrolls" },
+            { "text": "the end of autumn.", "next": "state.haiku_wrong", "if": "'the end of autumn.' in world.fox.scrolls"  },
+            { "text": "with no leaves to blow.", "next": "state.haiku_right", "if": "'with no leaves to blow.' in world.fox.scrolls" },
+            { "text": "the Galaxy.", "next": "state.haiku_wrong", "if": "'the Galaxy.' in world.fox.scrolls" },
+            { "text": "and it passes by.", "next": "state.haiku_wrong", "if": "'and it passes by.' in world.fox.scrolls" }
         ]
     },
     "haiku2" : {
         "text" : "A dead chrysanthemum\nand yet - isn't there still something\n...?",
         "choices" : [
-            { "text": "remaining in it?", "next": "state.haiku_right" },
-            { "text": "the end of autumn.", "next": "state.haiku_wrong" },
-            { "text": "with no leaves to blow.", "next": "state.haiku_wrong" },
-            { "text": "the Galaxy.", "next": "state.haiku_wrong" },
-            { "text": "and it passes by.", "next": "state.haiku_wrong" }
+            { "text": "remaining in it?", "next": "state.haiku_right", "if": "'remaining in it?' in world.fox.scrolls" },
+            { "text": "the end of autumn.", "next": "state.haiku_wrong", "if": "'the end of autumn.' in world.fox.scrolls" },
+            { "text": "with no leaves to blow.", "next": "state.haiku_wrong", "if": "'with no leaves to blow.' in world.fox.scrolls" },
+            { "text": "the Galaxy.", "next": "state.haiku_wrong", "if": "'the Galaxy.' in world.fox.scrolls" },
+            { "text": "and it passes by.", "next": "state.haiku_wrong", "if": "'and it passes by.' in world.fox.scrolls" }
         ]
     },
     "haiku3" : {
         "text" : "First day of spring--\nI keep thinking about\n...?",
         "choices" : [
-            { "text": "remaining in it?", "next": "state.haiku_wrong" },
-            { "text": "the end of autumn.", "next": "state.haiku_right" },
-            { "text": "with no leaves to blow.", "next": "state.haiku_wrong" },
-            { "text": "the Galaxy.", "next": "state.haiku_wrong" },
-            { "text": "and it passes by.", "next": "state.haiku_wrong" }
+            { "text": "remaining in it?", "next": "state.haiku_wrong", "if": "'remaining in it?' in world.fox.scrolls" },
+            { "text": "the end of autumn.", "next": "state.haiku_right", "if": "'the end of autumn.' in world.fox.scrolls" },
+            { "text": "with no leaves to blow.", "next": "state.haiku_wrong", "if": "'with no leaves to blow.' in world.fox.scrolls" },
+            { "text": "the Galaxy.", "next": "state.haiku_wrong" , "if": "'the Galaxy.' in world.fox.scrolls"},
+            { "text": "and it passes by.", "next": "state.haiku_wrong", "if": "'and it passes by.' in world.fox.scrolls" }
         ]
     },
     "haiku_right" : {