# HG changeset patch # User Adrianna Pińska # Date 1302112370 -7200 # Node ID 7ccf365e28ea7fdadbcd3ada8040c38849b18452 # Parent a7cdf8458eddd694634e3cea0733c03887452c6a Sasuke diff -r a7cdf8458edd -r 7ccf365e28ea data/npcs/sasuke.json --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/npcs/sasuke.json Wed Apr 06 19:52:50 2011 +0200 @@ -0,0 +1,17 @@ +{ + "start" : { + "text" : "Grumble... “Sasuke, fetch this! Sasuke, get that!” What do they think I am, some sort of servant? I’m a samurai in my own right! And this cannon is so heavy! Not like those two would lend a hand – they’re probably taking a nap. Speaking of which... yaaawn... maybe forty winks wouldn’t be a bad idea. If I’m lucky, this cannon will just roll down the path and off the cliff. Good riddance...", + "auto_next": "state.napping" + }, + "napping" : { + "events" : [ + { "matches" : "world.cannon_destroyed()", "next": "state.huh" } + ] + }, + "huh" : { + "text" : "Huh? What was that noise? Did I hear a- AI! What’s this? My cannon – destroyed! When Hattori hears about this, he’s going to be livid. Erm, it might be best if I, uh, hide out for a bit...", + "auto_next": "state.gone", + }, + "gone" : { + } +} diff -r a7cdf8458edd -r 7ccf365e28ea skaapsteker/dialogue.py --- a/skaapsteker/dialogue.py Wed Apr 06 19:39:46 2011 +0200 +++ b/skaapsteker/dialogue.py Wed Apr 06 19:52:50 2011 +0200 @@ -126,9 +126,13 @@ self._fox_is_disguised = False self._fire_started = False + self._cannon_destroyed = False self.npcs = {} + def npc_is(self, npc_name, state): + return self.npcs[npc_name].state == state + def fox_has_tea(self): return self._fox_has_tea @@ -141,5 +145,5 @@ def fire_started(self): return self._fire_started - def npc_is(self, npc_name, state): - return self.npcs[npc_name].state == state + def cannon_destroyed(self): + return self._cannon_destroyed