# HG changeset patch # User Simon Cross # Date 1302385567 -7200 # Node ID 4242066f771dfdd9e398b7d53528b96d3990dfae # Parent c7c3f55554d41978457a5e36f2f0f79521216819 Hook up if choices in haiku battle. diff -r c7c3f55554d4 -r 4242066f771d data/npcs/kitsune.json --- 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" : {