annotate skaapsteker/sprites/npcs.py @ 583:194f71cc0689

don't remove kaneda from the geisha room too early (looks weird, but fixes crash)
author Neil Muller <drnlmuller@gmail.com>
date Sun, 10 Apr 2011 15:59:59 +0200
parents 1ccb90397c4a
children 79a9b61e12ff
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
551
40a104ca0a69 Tear kimono
Neil Muller <drnlmuller@gmail.com>
parents: 550
diff changeset
1 from .base import NPC, BlockingNPC, PC_LAYER, notify
475
18427edff33a Add facing support to npcs
Neil Muller <drnlmuller@gmail.com>
parents: 468
diff changeset
2 from pygame import transform
189
9d08f99b5ddf Add npcs to gamestate. Update gamestate. Pass world around a bit. Some other stuff.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
3
9d08f99b5ddf Add npcs to gamestate. Update gamestate. Pass world around a bit. Some other stuff.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
4
9d08f99b5ddf Add npcs to gamestate. Update gamestate. Pass world around a bit. Some other stuff.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
5 class Monk(NPC):
213
c5c4306593d8 Attempt to animate NPCs a bit.
Simon Cross <hodgestar@gmail.com>
parents: 197
diff changeset
6 image_dir = 'sprites/monk'
c5c4306593d8 Attempt to animate NPCs a bit.
Simon Cross <hodgestar@gmail.com>
parents: 197
diff changeset
7 animation_regexes = [
c5c4306593d8 Attempt to animate NPCs a bit.
Simon Cross <hodgestar@gmail.com>
parents: 197
diff changeset
8 ("meditating", "monk.png"),
c5c4306593d8 Attempt to animate NPCs a bit.
Simon Cross <hodgestar@gmail.com>
parents: 197
diff changeset
9 ]
189
9d08f99b5ddf Add npcs to gamestate. Update gamestate. Pass world around a bit. Some other stuff.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
10
9d08f99b5ddf Add npcs to gamestate. Update gamestate. Pass world around a bit. Some other stuff.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
11
460
8b9b4706a4d6 Blocking NPC's block
Neil Muller <drnlmuller@gmail.com>
parents: 451
diff changeset
12 class Guard(BlockingNPC):
213
c5c4306593d8 Attempt to animate NPCs a bit.
Simon Cross <hodgestar@gmail.com>
parents: 197
diff changeset
13 image_dir = 'sprites/guard'
197
6696ffd51ac2 Hordes of NPCs.
Simon Cross <hodgestar@gmail.com>
parents: 189
diff changeset
14
461
c6d1165bb16f Can talk your way past the guard
Neil Muller <drnlmuller@gmail.com>
parents: 460
diff changeset
15 def update(self):
c6d1165bb16f Can talk your way past the guard
Neil Muller <drnlmuller@gmail.com>
parents: 460
diff changeset
16 if not self._me.block and self.block:
c6d1165bb16f Can talk your way past the guard
Neil Muller <drnlmuller@gmail.com>
parents: 460
diff changeset
17 self.collides_with = set([])
c6d1165bb16f Can talk your way past the guard
Neil Muller <drnlmuller@gmail.com>
parents: 460
diff changeset
18 self.block = False
c6d1165bb16f Can talk your way past the guard
Neil Muller <drnlmuller@gmail.com>
parents: 460
diff changeset
19 super(Guard, self).update()
197
6696ffd51ac2 Hordes of NPCs.
Simon Cross <hodgestar@gmail.com>
parents: 189
diff changeset
20
460
8b9b4706a4d6 Blocking NPC's block
Neil Muller <drnlmuller@gmail.com>
parents: 451
diff changeset
21
468
73868503c470 Make road Samuri blocking
Neil Muller <drnlmuller@gmail.com>
parents: 461
diff changeset
22 class Hattori(BlockingNPC):
213
c5c4306593d8 Attempt to animate NPCs a bit.
Simon Cross <hodgestar@gmail.com>
parents: 197
diff changeset
23 image_dir = 'sprites/hattori'
475
18427edff33a Add facing support to npcs
Neil Muller <drnlmuller@gmail.com>
parents: 468
diff changeset
24 facings = {
18427edff33a Add facing support to npcs
Neil Muller <drnlmuller@gmail.com>
parents: 468
diff changeset
25 'running' : (('left', None),
18427edff33a Add facing support to npcs
Neil Muller <drnlmuller@gmail.com>
parents: 468
diff changeset
26 ('right', lambda x: transform.flip(x, True, False))),
18427edff33a Add facing support to npcs
Neil Muller <drnlmuller@gmail.com>
parents: 468
diff changeset
27 'standing' : (('left', None),
18427edff33a Add facing support to npcs
Neil Muller <drnlmuller@gmail.com>
parents: 468
diff changeset
28 ('right', lambda x: transform.flip(x, True, False))),
18427edff33a Add facing support to npcs
Neil Muller <drnlmuller@gmail.com>
parents: 468
diff changeset
29 }
18427edff33a Add facing support to npcs
Neil Muller <drnlmuller@gmail.com>
parents: 468
diff changeset
30
501
9a16483e49cb Remove 1st set of blocking samuri
Neil Muller <drnlmuller@gmail.com>
parents: 475
diff changeset
31 def update(self):
9a16483e49cb Remove 1st set of blocking samuri
Neil Muller <drnlmuller@gmail.com>
parents: 475
diff changeset
32 if not self._me.block:
9a16483e49cb Remove 1st set of blocking samuri
Neil Muller <drnlmuller@gmail.com>
parents: 475
diff changeset
33 self.remove()
9a16483e49cb Remove 1st set of blocking samuri
Neil Muller <drnlmuller@gmail.com>
parents: 475
diff changeset
34
9a16483e49cb Remove 1st set of blocking samuri
Neil Muller <drnlmuller@gmail.com>
parents: 475
diff changeset
35
197
6696ffd51ac2 Hordes of NPCs.
Simon Cross <hodgestar@gmail.com>
parents: 189
diff changeset
36
6696ffd51ac2 Hordes of NPCs.
Simon Cross <hodgestar@gmail.com>
parents: 189
diff changeset
37
468
73868503c470 Make road Samuri blocking
Neil Muller <drnlmuller@gmail.com>
parents: 461
diff changeset
38 class Ichiro(BlockingNPC):
213
c5c4306593d8 Attempt to animate NPCs a bit.
Simon Cross <hodgestar@gmail.com>
parents: 197
diff changeset
39 image_dir = 'sprites/ichiro'
475
18427edff33a Add facing support to npcs
Neil Muller <drnlmuller@gmail.com>
parents: 468
diff changeset
40 facings = {
18427edff33a Add facing support to npcs
Neil Muller <drnlmuller@gmail.com>
parents: 468
diff changeset
41 'running' : (('left', None),
18427edff33a Add facing support to npcs
Neil Muller <drnlmuller@gmail.com>
parents: 468
diff changeset
42 ('right', lambda x: transform.flip(x, True, False))),
18427edff33a Add facing support to npcs
Neil Muller <drnlmuller@gmail.com>
parents: 468
diff changeset
43 'standing' : (('left', None),
18427edff33a Add facing support to npcs
Neil Muller <drnlmuller@gmail.com>
parents: 468
diff changeset
44 ('right', lambda x: transform.flip(x, True, False))),
18427edff33a Add facing support to npcs
Neil Muller <drnlmuller@gmail.com>
parents: 468
diff changeset
45 }
18427edff33a Add facing support to npcs
Neil Muller <drnlmuller@gmail.com>
parents: 468
diff changeset
46
501
9a16483e49cb Remove 1st set of blocking samuri
Neil Muller <drnlmuller@gmail.com>
parents: 475
diff changeset
47 def update(self):
9a16483e49cb Remove 1st set of blocking samuri
Neil Muller <drnlmuller@gmail.com>
parents: 475
diff changeset
48 if not self._me.block:
9a16483e49cb Remove 1st set of blocking samuri
Neil Muller <drnlmuller@gmail.com>
parents: 475
diff changeset
49 self.remove()
9a16483e49cb Remove 1st set of blocking samuri
Neil Muller <drnlmuller@gmail.com>
parents: 475
diff changeset
50
197
6696ffd51ac2 Hordes of NPCs.
Simon Cross <hodgestar@gmail.com>
parents: 189
diff changeset
51
6696ffd51ac2 Hordes of NPCs.
Simon Cross <hodgestar@gmail.com>
parents: 189
diff changeset
52
6696ffd51ac2 Hordes of NPCs.
Simon Cross <hodgestar@gmail.com>
parents: 189
diff changeset
53 class Kaneda(NPC):
213
c5c4306593d8 Attempt to animate NPCs a bit.
Simon Cross <hodgestar@gmail.com>
parents: 197
diff changeset
54 image_dir = 'sprites/kaneda'
197
6696ffd51ac2 Hordes of NPCs.
Simon Cross <hodgestar@gmail.com>
parents: 189
diff changeset
55
559
c4b14a517500 Parital geisha mission
Neil Muller <drnlmuller@gmail.com>
parents: 551
diff changeset
56 wants_updates = True
c4b14a517500 Parital geisha mission
Neil Muller <drnlmuller@gmail.com>
parents: 551
diff changeset
57
544
badc218d1eba Make business standing
Neil Muller <drnlmuller@gmail.com>
parents: 536
diff changeset
58 animation_regexes = [
badc218d1eba Make business standing
Neil Muller <drnlmuller@gmail.com>
parents: 536
diff changeset
59 ("standing", r"^.*_standing.png$"),
badc218d1eba Make business standing
Neil Muller <drnlmuller@gmail.com>
parents: 536
diff changeset
60 ]
badc218d1eba Make business standing
Neil Muller <drnlmuller@gmail.com>
parents: 536
diff changeset
61
516
9a1f8925d227 added facings for kaneda and tetsuo
Adrianna Pińska <adrianna.pinska@gmail.com>
parents: 514
diff changeset
62 facings = {
9a1f8925d227 added facings for kaneda and tetsuo
Adrianna Pińska <adrianna.pinska@gmail.com>
parents: 514
diff changeset
63 'standing' : (('left', None),
9a1f8925d227 added facings for kaneda and tetsuo
Adrianna Pińska <adrianna.pinska@gmail.com>
parents: 514
diff changeset
64 ('right', lambda x: transform.flip(x, True, False))),
9a1f8925d227 added facings for kaneda and tetsuo
Adrianna Pińska <adrianna.pinska@gmail.com>
parents: 514
diff changeset
65 }
9a1f8925d227 added facings for kaneda and tetsuo
Adrianna Pińska <adrianna.pinska@gmail.com>
parents: 514
diff changeset
66
546
05d93c10e5ae Remove Kaneda after the deal is off
Neil Muller <drnlmuller@gmail.com>
parents: 544
diff changeset
67 def setup(self, name, world, dsm, state, present, facing=None):
05d93c10e5ae Remove Kaneda after the deal is off
Neil Muller <drnlmuller@gmail.com>
parents: 544
diff changeset
68 super(Kaneda, self).setup(name, world, dsm, state, facing)
05d93c10e5ae Remove Kaneda after the deal is off
Neil Muller <drnlmuller@gmail.com>
parents: 544
diff changeset
69
550
ebd51cb1d672 Work on geisha room
Neil Muller <drnlmuller@gmail.com>
parents: 549
diff changeset
70 def player_action(self, player):
546
05d93c10e5ae Remove Kaneda after the deal is off
Neil Muller <drnlmuller@gmail.com>
parents: 544
diff changeset
71 if not self._me.present:
550
ebd51cb1d672 Work on geisha room
Neil Muller <drnlmuller@gmail.com>
parents: 549
diff changeset
72 return
ebd51cb1d672 Work on geisha room
Neil Muller <drnlmuller@gmail.com>
parents: 549
diff changeset
73 super(Kaneda, self).player_action(player)
ebd51cb1d672 Work on geisha room
Neil Muller <drnlmuller@gmail.com>
parents: 549
diff changeset
74
ebd51cb1d672 Work on geisha room
Neil Muller <drnlmuller@gmail.com>
parents: 549
diff changeset
75 def update(self):
583
194f71cc0689 don't remove kaneda from the geisha room too early (looks weird, but fixes crash)
Neil Muller <drnlmuller@gmail.com>
parents: 568
diff changeset
76 super(Kaneda, self).update()
194f71cc0689 don't remove kaneda from the geisha room too early (looks weird, but fixes crash)
Neil Muller <drnlmuller@gmail.com>
parents: 568
diff changeset
77 if not self._me.present and self.alive and self._me.level == "tea_house":
568
1ccb90397c4a Kanede vanishes again
Neil Muller <drnlmuller@gmail.com>
parents: 559
diff changeset
78 self.remove()
583
194f71cc0689 don't remove kaneda from the geisha room too early (looks weird, but fixes crash)
Neil Muller <drnlmuller@gmail.com>
parents: 568
diff changeset
79 elif self.world.missions.kumiko_disgraced and self.alive and self._me.level == 'geisha_room':
546
05d93c10e5ae Remove Kaneda after the deal is off
Neil Muller <drnlmuller@gmail.com>
parents: 544
diff changeset
80 self.remove()
05d93c10e5ae Remove Kaneda after the deal is off
Neil Muller <drnlmuller@gmail.com>
parents: 544
diff changeset
81
197
6696ffd51ac2 Hordes of NPCs.
Simon Cross <hodgestar@gmail.com>
parents: 189
diff changeset
82
297
2844edb6c1cc Hook up maneki, kaneda2 and the fishmonger who were hiding in limbo (i.e. not in game.json).
Simon Cross <hodgestar@gmail.com>
parents: 224
diff changeset
83 class Tetsuo(NPC):
2844edb6c1cc Hook up maneki, kaneda2 and the fishmonger who were hiding in limbo (i.e. not in game.json).
Simon Cross <hodgestar@gmail.com>
parents: 224
diff changeset
84 image_dir = 'sprites/tetsuo'
2844edb6c1cc Hook up maneki, kaneda2 and the fishmonger who were hiding in limbo (i.e. not in game.json).
Simon Cross <hodgestar@gmail.com>
parents: 224
diff changeset
85
544
badc218d1eba Make business standing
Neil Muller <drnlmuller@gmail.com>
parents: 536
diff changeset
86 animation_regexes = [
badc218d1eba Make business standing
Neil Muller <drnlmuller@gmail.com>
parents: 536
diff changeset
87 ("standing", r"^.*_standing.png$"),
badc218d1eba Make business standing
Neil Muller <drnlmuller@gmail.com>
parents: 536
diff changeset
88 ]
badc218d1eba Make business standing
Neil Muller <drnlmuller@gmail.com>
parents: 536
diff changeset
89
badc218d1eba Make business standing
Neil Muller <drnlmuller@gmail.com>
parents: 536
diff changeset
90
516
9a1f8925d227 added facings for kaneda and tetsuo
Adrianna Pińska <adrianna.pinska@gmail.com>
parents: 514
diff changeset
91 facings = {
9a1f8925d227 added facings for kaneda and tetsuo
Adrianna Pińska <adrianna.pinska@gmail.com>
parents: 514
diff changeset
92 'standing' : (('left', None),
9a1f8925d227 added facings for kaneda and tetsuo
Adrianna Pińska <adrianna.pinska@gmail.com>
parents: 514
diff changeset
93 ('right', lambda x: transform.flip(x, True, False))),
9a1f8925d227 added facings for kaneda and tetsuo
Adrianna Pińska <adrianna.pinska@gmail.com>
parents: 514
diff changeset
94 }
9a1f8925d227 added facings for kaneda and tetsuo
Adrianna Pińska <adrianna.pinska@gmail.com>
parents: 514
diff changeset
95
9a1f8925d227 added facings for kaneda and tetsuo
Adrianna Pińska <adrianna.pinska@gmail.com>
parents: 514
diff changeset
96
297
2844edb6c1cc Hook up maneki, kaneda2 and the fishmonger who were hiding in limbo (i.e. not in game.json).
Simon Cross <hodgestar@gmail.com>
parents: 224
diff changeset
97
197
6696ffd51ac2 Hordes of NPCs.
Simon Cross <hodgestar@gmail.com>
parents: 189
diff changeset
98 class Kumiko(NPC):
213
c5c4306593d8 Attempt to animate NPCs a bit.
Simon Cross <hodgestar@gmail.com>
parents: 197
diff changeset
99 image_dir = 'sprites/geisha'
197
6696ffd51ac2 Hordes of NPCs.
Simon Cross <hodgestar@gmail.com>
parents: 189
diff changeset
100
550
ebd51cb1d672 Work on geisha room
Neil Muller <drnlmuller@gmail.com>
parents: 549
diff changeset
101 animation_regexes = [
ebd51cb1d672 Work on geisha room
Neil Muller <drnlmuller@gmail.com>
parents: 549
diff changeset
102 ("standing", r"^.*_01.png$"),
ebd51cb1d672 Work on geisha room
Neil Muller <drnlmuller@gmail.com>
parents: 549
diff changeset
103 ]
ebd51cb1d672 Work on geisha room
Neil Muller <drnlmuller@gmail.com>
parents: 549
diff changeset
104
551
40a104ca0a69 Tear kimono
Neil Muller <drnlmuller@gmail.com>
parents: 550
diff changeset
105 collides_with = set([PC_LAYER])
40a104ca0a69 Tear kimono
Neil Muller <drnlmuller@gmail.com>
parents: 550
diff changeset
106
40a104ca0a69 Tear kimono
Neil Muller <drnlmuller@gmail.com>
parents: 550
diff changeset
107 def damage(self, damage):
40a104ca0a69 Tear kimono
Neil Muller <drnlmuller@gmail.com>
parents: 550
diff changeset
108 """Destroy the kimono"""
40a104ca0a69 Tear kimono
Neil Muller <drnlmuller@gmail.com>
parents: 550
diff changeset
109 if not self.world.missions.kumikos_kimono_torn:
40a104ca0a69 Tear kimono
Neil Muller <drnlmuller@gmail.com>
parents: 550
diff changeset
110 self.world.missions.kumikos_kimono_torn = True
40a104ca0a69 Tear kimono
Neil Muller <drnlmuller@gmail.com>
parents: 550
diff changeset
111 notify("Shoo, dirty fox! Oh, look what you've done"
559
c4b14a517500 Parital geisha mission
Neil Muller <drnlmuller@gmail.com>
parents: 551
diff changeset
112 "- you've made a great big tear in my finest silk kimono."
c4b14a517500 Parital geisha mission
Neil Muller <drnlmuller@gmail.com>
parents: 551
diff changeset
113 "What will the businessman think of a ragged dress like this?")
551
40a104ca0a69 Tear kimono
Neil Muller <drnlmuller@gmail.com>
parents: 550
diff changeset
114
197
6696ffd51ac2 Hordes of NPCs.
Simon Cross <hodgestar@gmail.com>
parents: 189
diff changeset
115
297
2844edb6c1cc Hook up maneki, kaneda2 and the fishmonger who were hiding in limbo (i.e. not in game.json).
Simon Cross <hodgestar@gmail.com>
parents: 224
diff changeset
116 class FishMonger(NPC):
2844edb6c1cc Hook up maneki, kaneda2 and the fishmonger who were hiding in limbo (i.e. not in game.json).
Simon Cross <hodgestar@gmail.com>
parents: 224
diff changeset
117 image_dir = 'sprites/fishmonger'
2844edb6c1cc Hook up maneki, kaneda2 and the fishmonger who were hiding in limbo (i.e. not in game.json).
Simon Cross <hodgestar@gmail.com>
parents: 224
diff changeset
118 animation_regexes = [
2844edb6c1cc Hook up maneki, kaneda2 and the fishmonger who were hiding in limbo (i.e. not in game.json).
Simon Cross <hodgestar@gmail.com>
parents: 224
diff changeset
119 ("standing", r"^.*_standing.png$"),
2844edb6c1cc Hook up maneki, kaneda2 and the fishmonger who were hiding in limbo (i.e. not in game.json).
Simon Cross <hodgestar@gmail.com>
parents: 224
diff changeset
120 ]
2844edb6c1cc Hook up maneki, kaneda2 and the fishmonger who were hiding in limbo (i.e. not in game.json).
Simon Cross <hodgestar@gmail.com>
parents: 224
diff changeset
121
549
b7f912705adb Fishmonger now mongers fish.
Jeremy Thurgood <firxen@gmail.com>
parents: 546
diff changeset
122 def setup(self, **opts):
b7f912705adb Fishmonger now mongers fish.
Jeremy Thurgood <firxen@gmail.com>
parents: 546
diff changeset
123 super(FishMonger, self).setup(**opts)
b7f912705adb Fishmonger now mongers fish.
Jeremy Thurgood <firxen@gmail.com>
parents: 546
diff changeset
124 self.world.missions.fishmonger_demons_killed = 0
b7f912705adb Fishmonger now mongers fish.
Jeremy Thurgood <firxen@gmail.com>
parents: 546
diff changeset
125
297
2844edb6c1cc Hook up maneki, kaneda2 and the fishmonger who were hiding in limbo (i.e. not in game.json).
Simon Cross <hodgestar@gmail.com>
parents: 224
diff changeset
126
2844edb6c1cc Hook up maneki, kaneda2 and the fishmonger who were hiding in limbo (i.e. not in game.json).
Simon Cross <hodgestar@gmail.com>
parents: 224
diff changeset
127 class Maneki(NPC):
436
32df272a163a maneki neko and fisherman's house
Adrianna Pińska <adrianna.pinska@gmail.com>
parents: 418
diff changeset
128 image_dir = 'sprites/maneki neko'
297
2844edb6c1cc Hook up maneki, kaneda2 and the fishmonger who were hiding in limbo (i.e. not in game.json).
Simon Cross <hodgestar@gmail.com>
parents: 224
diff changeset
129 animation_regexes = [
436
32df272a163a maneki neko and fisherman's house
Adrianna Pińska <adrianna.pinska@gmail.com>
parents: 418
diff changeset
130 ("standing", r"^.*_standing.png$"),
297
2844edb6c1cc Hook up maneki, kaneda2 and the fishmonger who were hiding in limbo (i.e. not in game.json).
Simon Cross <hodgestar@gmail.com>
parents: 224
diff changeset
131 ]
2844edb6c1cc Hook up maneki, kaneda2 and the fishmonger who were hiding in limbo (i.e. not in game.json).
Simon Cross <hodgestar@gmail.com>
parents: 224
diff changeset
132
2844edb6c1cc Hook up maneki, kaneda2 and the fishmonger who were hiding in limbo (i.e. not in game.json).
Simon Cross <hodgestar@gmail.com>
parents: 224
diff changeset
133
197
6696ffd51ac2 Hordes of NPCs.
Simon Cross <hodgestar@gmail.com>
parents: 189
diff changeset
134 class Actor(NPC):
418
c6e9b3006ef9 stuff in theatre
Adrianna Pińska <adrianna.pinska@gmail.com>
parents: 297
diff changeset
135 image_dir = 'sprites/fishmonger'
224
5d37c73d46e2 Fix actor sprite a bit. Add evil kitsune sprite.
Simon Cross <hodgestar@gmail.com>
parents: 213
diff changeset
136 animation_regexes = [
418
c6e9b3006ef9 stuff in theatre
Adrianna Pińska <adrianna.pinska@gmail.com>
parents: 297
diff changeset
137 ("standing", r"^.*_standing.png$"),
224
5d37c73d46e2 Fix actor sprite a bit. Add evil kitsune sprite.
Simon Cross <hodgestar@gmail.com>
parents: 213
diff changeset
138 ]
197
6696ffd51ac2 Hordes of NPCs.
Simon Cross <hodgestar@gmail.com>
parents: 189
diff changeset
139
297
2844edb6c1cc Hook up maneki, kaneda2 and the fishmonger who were hiding in limbo (i.e. not in game.json).
Simon Cross <hodgestar@gmail.com>
parents: 224
diff changeset
140
509
c85363a8ff56 Make Sasuke non-blocking again
Neil Muller <drnlmuller@gmail.com>
parents: 501
diff changeset
141 class Sasuke(NPC):
213
c5c4306593d8 Attempt to animate NPCs a bit.
Simon Cross <hodgestar@gmail.com>
parents: 197
diff changeset
142 image_dir = 'sprites/sasuke'
224
5d37c73d46e2 Fix actor sprite a bit. Add evil kitsune sprite.
Simon Cross <hodgestar@gmail.com>
parents: 213
diff changeset
143
525
8087e95ade2f More cannon stuff
Neil Muller <drnlmuller@gmail.com>
parents: 516
diff changeset
144 def setup(self, name, world, dsm, state, present, facing=None):
514
dbf99f763060 Make Sasuke standing
Neil Muller <drnlmuller@gmail.com>
parents: 509
diff changeset
145 self._animation = 'standing'
dbf99f763060 Make Sasuke standing
Neil Muller <drnlmuller@gmail.com>
parents: 509
diff changeset
146 super(Sasuke, self).setup(name, world, dsm, state, facing)
dbf99f763060 Make Sasuke standing
Neil Muller <drnlmuller@gmail.com>
parents: 509
diff changeset
147
525
8087e95ade2f More cannon stuff
Neil Muller <drnlmuller@gmail.com>
parents: 516
diff changeset
148 def update(self):
8087e95ade2f More cannon stuff
Neil Muller <drnlmuller@gmail.com>
parents: 516
diff changeset
149 if not self._me.present:
8087e95ade2f More cannon stuff
Neil Muller <drnlmuller@gmail.com>
parents: 516
diff changeset
150 self.remove()
526
5613f7b61b23 Stop Sasuke falling off the world
Neil Muller <drnlmuller@gmail.com>
parents: 525
diff changeset
151 super(Sasuke, self).update()
224
5d37c73d46e2 Fix actor sprite a bit. Add evil kitsune sprite.
Simon Cross <hodgestar@gmail.com>
parents: 213
diff changeset
152
5d37c73d46e2 Fix actor sprite a bit. Add evil kitsune sprite.
Simon Cross <hodgestar@gmail.com>
parents: 213
diff changeset
153 class Kitsune(NPC):
5d37c73d46e2 Fix actor sprite a bit. Add evil kitsune sprite.
Simon Cross <hodgestar@gmail.com>
parents: 213
diff changeset
154 image_dir = 'sprites'
5d37c73d46e2 Fix actor sprite a bit. Add evil kitsune sprite.
Simon Cross <hodgestar@gmail.com>
parents: 213
diff changeset
155 animation_regexes = [
451
7f198761a7be boss kitsune
Adrianna Pińska <adrianna.pinska@gmail.com>
parents: 436
diff changeset
156 ("being_evil", "boss_kitsune.png"),
224
5d37c73d46e2 Fix actor sprite a bit. Add evil kitsune sprite.
Simon Cross <hodgestar@gmail.com>
parents: 213
diff changeset
157 ]