# HG changeset patch # User Neil Muller # Date 1302389044 -7200 # Node ID 05d93c10e5ae4be8d4228696549f5e8fa6d5f877 # Parent 067d3d80ff2e37ed47fc55022326811f968c0485 Remove Kaneda after the deal is off diff -r 067d3d80ff2e -r 05d93c10e5ae data/game.json --- a/data/game.json Sun Apr 10 00:41:43 2011 +0200 +++ b/data/game.json Sun Apr 10 00:44:04 2011 +0200 @@ -162,9 +162,9 @@ "hattori": { "type": "Hattori", "level": "road", "pos": [37, 8], "dsm": "npcs/hattori.json", "state": "start", "block": true, "facing": "left" }, "ichiro": { "type": "Ichiro", "level": "road", "pos": [36, 8], "dsm": "npcs/ichiro.json", "state": "start", "block": true, "facing": "right" }, "sasuke": { "type": "Sasuke", "level": "road", "pos": [54, 8], "dsm": "npcs/sasuke.json", "state": "start", "present": true}, - "kaneda2": { "type": "Kaneda", "level": "tea_house", "pos": [6, 10], "dsm": "npcs/kaneda2.json", "state": "start", "facing": "right" }, + "kaneda2": { "type": "Kaneda", "level": "tea_house", "pos": [6, 10], "dsm": "npcs/kaneda2.json", "state": "start", "facing": "right", "present": true }, "tetsuo": { "type": "Tetsuo", "level": "tea_house", "pos": [9, 10], "dsm": "npcs/tetsuo.json", "state": "start", "facing": "left" }, - "kaneda": { "type": "Kaneda", "level": "geisha_room", "pos": [10, 3], "dsm": "npcs/kaneda.json", "state": "start", "facing": "left" }, + "kaneda": { "type": "Kaneda", "level": "geisha_room", "pos": [10, 3], "dsm": "npcs/kaneda.json", "state": "start", "facing": "left", "present": true }, "kumiko": { "type": "Kumiko", "level": "geisha_room", "pos": [11, 13], "dsm": "npcs/kumiko.json", "state": "start" }, "maneki": { "type": "Maneki", "level": "market", "pos": [35, 6], "dsm": "npcs/maneki.json", "state": "start" }, "fishmonger": { "type": "FishMonger", "level": "fishmonger_house", "pos": [23, 5], "dsm": "npcs/fishmonger.json", "state": "start" }, diff -r 067d3d80ff2e -r 05d93c10e5ae data/npcs/kaneda2.json --- a/data/npcs/kaneda2.json Sun Apr 10 00:41:43 2011 +0200 +++ b/data/npcs/kaneda2.json Sun Apr 10 00:44:04 2011 +0200 @@ -33,6 +33,6 @@ "auto_next": "state.gone", "on_exit" : "switch_to('tetsuo')" }, - "gone" : { + "gone" : { "on_entry": "npcs.kaneda2.present = False" } -} \ No newline at end of file +} diff -r 067d3d80ff2e -r 05d93c10e5ae skaapsteker/sprites/npcs.py --- a/skaapsteker/sprites/npcs.py Sun Apr 10 00:41:43 2011 +0200 +++ b/skaapsteker/sprites/npcs.py Sun Apr 10 00:44:04 2011 +0200 @@ -62,6 +62,14 @@ ('right', lambda x: transform.flip(x, True, False))), } + def setup(self, name, world, dsm, state, present, facing=None): + super(Kaneda, self).setup(name, world, dsm, state, facing) + + def update(self): + if not self._me.present: + self.remove() + super(Kaneda, self).update() + class Tetsuo(NPC): image_dir = 'sprites/tetsuo'