comparison data/npcs/guard.json @ 292:93352ab52f2e

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).
author Simon Cross <hodgestar@gmail.com>
date Fri, 08 Apr 2011 21:59:42 +0200
parents 16ffe6f5dbb8
children c6d1165bb16f
comparison
equal deleted inserted replaced
291:04be4219742b 292:93352ab52f2e
9 "shapeshifted" : { 9 "shapeshifted" : {
10 "text" : "Excuse me, ma’am. The gate is closed.", 10 "text" : "Excuse me, ma’am. The gate is closed.",
11 "choices" : [ 11 "choices" : [
12 { "text": "Why is that?", "next": "state.monks" }, 12 { "text": "Why is that?", "next": "state.monks" },
13 { "text": "Let me out now!", "next": "state.staycalm" }, 13 { "text": "Let me out now!", "next": "state.staycalm" },
14 { "text": "Sayonara.", "next": "state.secondtry" } 14 { "text": "Sayonara.", "next": "state.secondtry_human" }
15 ], 15 ],
16 "events" : [ 16 "events" : [
17 { "matches" : "world.fox.shape == 'human_with_fan'", "next": "state.disguised" }, 17 { "matches" : "world.fox.shape == 'human_with_fan'", "next": "state.disguised" },
18 { "matches" : "world.fox.shape == 'fox'", "next": "state.start" } 18 { "matches" : "world.fox.shape == 'fox'", "next": "state.start" }
19 ] 19 ]
20 }, 20 },
21 "monks" : { 21 "monks" : {
22 "text" : "The monks have asked us not to let anybody out.", 22 "text" : "The monks have asked us not to let anybody out.",
23 "choices" : [ 23 "auto_next" : "state.noexceptions",
24 { "text": "Pretty please?", "next": "state.noexceptions" } 24 "auto_next_text" : "Pretty please?"
25 ]
26 }, 25 },
27 "noexceptions" : { 26 "noexceptions" : {
28 "text" : "Sorry, no exceptions.", 27 "text" : "Sorry, no exceptions.",
29 "auto_next": "state.secondtry" 28 "auto_next": "state.secondtry_human"
30 }, 29 },
31 "staycalm" : { 30 "staycalm" : {
32 "text" : "Please stay calm. Perhaps you should go meditate?", 31 "text" : "Please stay calm. Perhaps you should go meditate?",
33 "auto_next": "state.secondtry" 32 "auto_next": "state.secondtry_human"
34 }, 33 },
35 "secondtry" : { 34 "secondtry_fox" : {
35 "text" : "Shoo!",
36 "events" : [
37 { "matches" : "world.fox.shape == 'human_with_fan'", "next": "state.disguised" },
38 { "matches" : "world.fox.shape == 'human'", "next": "state.secondtry_human" }
39 ]
40 },
41 "secondtry_human" : {
36 "text" : "The gate is locked, and it’s staying locked.", 42 "text" : "The gate is locked, and it’s staying locked.",
37 "events" : [ 43 "events" : [
38 { "matches" : "world.fox.shape == 'human_with_fan'", "next": "state.disguised" } 44 { "matches" : "world.fox.shape == 'human_with_fan'", "next": "state.disguised" },
45 { "matches" : "world.fox.shape == 'fox'", "next": "state.secondtry_fox" }
39 ] 46 ]
40 }, 47 },
41 "disguised" : { 48 "disguised" : {
42 "text" : "Ah, good evening, young lady! I’m afraid the gate is still closed for the night...", 49 "text" : "Ah, good evening, young lady! I’m afraid the gate is still closed for the night...",
43 "choices" : [ 50 "choices" : [