changeset 461:c6d1165bb16f

Can talk your way past the guard
author Neil Muller <drnlmuller@gmail.com>
date Sat, 09 Apr 2011 20:43:29 +0200
parents 8b9b4706a4d6
children 4507910da5ed
files data/npcs/guard.json skaapsteker/sprites/base.py skaapsteker/sprites/npcs.py
diffstat 3 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/data/npcs/guard.json	Sat Apr 09 20:09:58 2011 +0200
+++ b/data/npcs/guard.json	Sat Apr 09 20:43:29 2011 +0200
@@ -69,5 +69,6 @@
         "auto_next": "state.agreed"
     },
     "agreed" : {
+       "on_entry" : "npcs.guard.block = False"
     }
-}
\ No newline at end of file
+}
--- a/skaapsteker/sprites/base.py	Sat Apr 09 20:09:58 2011 +0200
+++ b/skaapsteker/sprites/base.py	Sat Apr 09 20:43:29 2011 +0200
@@ -276,6 +276,7 @@
     def setup(self, name, world, dsm, state):
         self.name = name
         self.dsm = dialogue.DSM(name, world, dsm, state)
+        self._me = getattr(world.npcs, self.name)
 
     def player_action(self, player):
         OpenDialog.post(self)
--- a/skaapsteker/sprites/npcs.py	Sat Apr 09 20:09:58 2011 +0200
+++ b/skaapsteker/sprites/npcs.py	Sat Apr 09 20:43:29 2011 +0200
@@ -11,6 +11,11 @@
 class Guard(BlockingNPC):
     image_dir = 'sprites/guard'
 
+    def update(self):
+        if not self._me.block and self.block:
+            self.collides_with = set([])
+            self.block = False
+        super(Guard, self).update()
 
 
 class Hattori(NPC):