Changeset 587:79a9b61e12ff


Ignore:
Timestamp:
04/10/11 15:03:05 (12 years ago)
Author:
Neil Muller <drnlmuller@…>
Branch:
default
Phase:
public
Rebase:
61343966343238653436663032623237626564653362366436646462663534363166386562313463
Message:

Magical appearing and disappearing Kaneda

Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • data/game.json

    r573 r587  
    166166        "kaneda2": { "type": "Kaneda", "level": "tea_house", "pos": [6, 10], "dsm": "npcs/kaneda2.json", "state": "start", "facing": "right", "present": true },
    167167        "tetsuo": { "type": "Tetsuo", "level": "tea_house", "pos": [9, 10], "dsm": "npcs/tetsuo.json", "state": "start", "facing": "left" },
    168         "kaneda": { "type": "Kaneda", "level": "geisha_room", "pos": [10, 3], "dsm": "npcs/kaneda.json", "state": "start", "facing": "left", "present": false },
    169         "kumiko": { "type": "Kumiko", "level": "geisha_room", "pos": [11, 13], "dsm": "npcs/kumiko.json", "state": "start" },
     168        "kaneda": { "type": "Kaneda", "level": "geisha_room", "pos": [13, 13], "dsm": "npcs/kaneda.json", "state": "start", "facing": "left", "present": false },
     169        "kumiko": { "type": "Kumiko", "level": "geisha_room", "pos": [8, 13], "dsm": "npcs/kumiko.json", "state": "start", "facking": "left" },
    170170        "maneki": { "type": "Maneki", "level": "market", "pos": [35, 6], "dsm": "npcs/maneki.json", "state": "start" },
    171171        "fishmonger": { "type": "FishMonger", "level": "fishmonger_house", "pos": [23, 5], "dsm": "npcs/fishmonger.json", "state": "start" },
  • skaapsteker/sprites/npcs.py

    r583 r587  
    5858    animation_regexes = [
    5959        ("standing", r"^.*_standing.png$"),
     60        ("invisible", r"^.*_invisible.png$"),
    6061    ]
    6162
     
    6364            'standing' : (('left', None),
    6465                ('right', lambda x: transform.flip(x, True, False))),
     66            'invisible' : (('left', None),
     67                ('right', lambda x: transform.flip(x, True, False))),
    6568                }
    6669
    6770    def setup(self, name, world, dsm, state, present, facing=None):
    6871        super(Kaneda, self).setup(name, world, dsm, state, facing)
     72        if not self._me.present and self._me.level == "geisha_room":
     73            self._animation = 'invisible'
     74            self._update_image()
    6975
    7076    def player_action(self, player):
     
    7480
    7581    def update(self):
    76         super(Kaneda, self).update()
    77         if not self._me.present and self.alive and self._me.level == "tea_house":
     82        if not self._me.present and self.alive() and self._me.level == "tea_house":
    7883            self.remove()
     84        if self.world.missions.kumikos_kimono_torn and self.world.missions.fish_in_room and self.world.items.vase.broken and not self._me.present:
     85            self._me.present = True
     86            self._animation = 'standing'
     87            self._update_image()
    7988        elif self.world.missions.kumiko_disgraced and self.alive and self._me.level == 'geisha_room':
    8089            self.remove()
     90        super(Kaneda, self).update()
    8191
    8292
     
    99109    image_dir = 'sprites/geisha'
    100110
     111    wants_updates = True
     112
    101113    animation_regexes = [
    102114        ("standing", r"^.*_01.png$"),
    103115    ]
     116
     117    facings = {
     118            'standing' : (('left', None),
     119                ('right', lambda x: transform.flip(x, True, False))),
     120                }
    104121
    105122    collides_with = set([PC_LAYER])
     
    112129                    "- you've made a great big tear in my finest silk kimono."
    113130                    "What will the businessman think of a ragged dress like this?")
     131
     132    def update(self):
     133        if self.world.missions.kumikos_kimono_torn and self.world.missions.fish_in_room and self.world.items.vase.broken:
     134            self.facing = "right"
     135        super(Kumiko, self).update()
     136
    114137
    115138
Note: See TracChangeset for help on using the changeset viewer.