Mercurial > skaapsteker
view skaapsteker/sprites/npcs.py @ 549:b7f912705adb
Fishmonger now mongers fish.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Sun, 10 Apr 2011 01:14:14 +0200 |
parents | 05d93c10e5ae |
children | ebd51cb1d672 |
line wrap: on
line source
from .base import NPC, BlockingNPC from pygame import transform class Monk(NPC): image_dir = 'sprites/monk' animation_regexes = [ ("meditating", "monk.png"), ] 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(BlockingNPC): image_dir = 'sprites/hattori' facings = { 'running' : (('left', None), ('right', lambda x: transform.flip(x, True, False))), 'standing' : (('left', None), ('right', lambda x: transform.flip(x, True, False))), } def update(self): if not self._me.block: self.remove() class Ichiro(BlockingNPC): image_dir = 'sprites/ichiro' facings = { 'running' : (('left', None), ('right', lambda x: transform.flip(x, True, False))), 'standing' : (('left', None), ('right', lambda x: transform.flip(x, True, False))), } def update(self): if not self._me.block: self.remove() class Kaneda(NPC): image_dir = 'sprites/kaneda' animation_regexes = [ ("standing", r"^.*_standing.png$"), ] facings = { 'standing' : (('left', None), ('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' animation_regexes = [ ("standing", r"^.*_standing.png$"), ] facings = { 'standing' : (('left', None), ('right', lambda x: transform.flip(x, True, False))), } class Kumiko(NPC): image_dir = 'sprites/geisha' class FishMonger(NPC): image_dir = 'sprites/fishmonger' animation_regexes = [ ("standing", r"^.*_standing.png$"), ] def setup(self, **opts): super(FishMonger, self).setup(**opts) self.world.missions.fishmonger_demons_killed = 0 class Maneki(NPC): image_dir = 'sprites/maneki neko' animation_regexes = [ ("standing", r"^.*_standing.png$"), ] class Actor(NPC): image_dir = 'sprites/fishmonger' animation_regexes = [ ("standing", r"^.*_standing.png$"), ] class Sasuke(NPC): image_dir = 'sprites/sasuke' def setup(self, name, world, dsm, state, present, facing=None): self._animation = 'standing' super(Sasuke, self).setup(name, world, dsm, state, facing) def update(self): if not self._me.present: self.remove() super(Sasuke, self).update() class Kitsune(NPC): image_dir = 'sprites' animation_regexes = [ ("being_evil", "boss_kitsune.png"), ]