# HG changeset patch # User Simon Cross # Date 1302292782 -7200 # Node ID 93352ab52f2e257a2787ed62535ade484f7a1456 # Parent 04be4219742b4eb2a353034816c7edd7b0697291 Fix up possible inconsistencies in guard state machine fox shape handling by making liberal use of auto_next and splitting a state in two (one for the fox, one for the human). diff -r 04be4219742b -r 93352ab52f2e data/npcs/guard.json --- a/data/npcs/guard.json Fri Apr 08 21:58:35 2011 +0200 +++ b/data/npcs/guard.json Fri Apr 08 21:59:42 2011 +0200 @@ -11,7 +11,7 @@ "choices" : [ { "text": "Why is that?", "next": "state.monks" }, { "text": "Let me out now!", "next": "state.staycalm" }, - { "text": "Sayonara.", "next": "state.secondtry" } + { "text": "Sayonara.", "next": "state.secondtry_human" } ], "events" : [ { "matches" : "world.fox.shape == 'human_with_fan'", "next": "state.disguised" }, @@ -20,22 +20,29 @@ }, "monks" : { "text" : "The monks have asked us not to let anybody out.", - "choices" : [ - { "text": "Pretty please?", "next": "state.noexceptions" } - ] + "auto_next" : "state.noexceptions", + "auto_next_text" : "Pretty please?" }, "noexceptions" : { "text" : "Sorry, no exceptions.", - "auto_next": "state.secondtry" + "auto_next": "state.secondtry_human" }, "staycalm" : { "text" : "Please stay calm. Perhaps you should go meditate?", - "auto_next": "state.secondtry" + "auto_next": "state.secondtry_human" }, - "secondtry" : { + "secondtry_fox" : { + "text" : "Shoo!", + "events" : [ + { "matches" : "world.fox.shape == 'human_with_fan'", "next": "state.disguised" }, + { "matches" : "world.fox.shape == 'human'", "next": "state.secondtry_human" } + ] + }, + "secondtry_human" : { "text" : "The gate is locked, and it’s staying locked.", "events" : [ - { "matches" : "world.fox.shape == 'human_with_fan'", "next": "state.disguised" } + { "matches" : "world.fox.shape == 'human_with_fan'", "next": "state.disguised" }, + { "matches" : "world.fox.shape == 'fox'", "next": "state.secondtry_fox" } ] }, "disguised" : {