# HG changeset patch # User Neil Muller # Date 1302374609 -7200 # Node ID c6d1165bb16fd3ed38fdff4c592b408c8ecb49ed # Parent 8b9b4706a4d6ff0ba9ec5149da4589b93a1e3ad8 Can talk your way past the guard diff -r 8b9b4706a4d6 -r c6d1165bb16f data/npcs/guard.json --- 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 +} diff -r 8b9b4706a4d6 -r c6d1165bb16f skaapsteker/sprites/base.py --- 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) diff -r 8b9b4706a4d6 -r c6d1165bb16f skaapsteker/sprites/npcs.py --- 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):