annotate pytouhou/games/eosd.py @ 196:1e501e3b6645

Add a subclass for each character, and implement player attacks.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 29 Oct 2011 14:21:42 -0700
parents
children e1bc8c4cbb1a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
196
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
1 # -*- encoding: utf-8 -*-
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
2 ##
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
3 ## Copyright (C) 2011 Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
4 ##
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
5 ## This program is free software; you can redistribute it and/or modify
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
6 ## it under the terms of the GNU General Public License as published
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
7 ## by the Free Software Foundation; version 3 only.
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
8 ##
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
9 ## This program is distributed in the hope that it will be useful,
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
12 ## GNU General Public License for more details.
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
13 ##
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
14
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
15
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
16 from pytouhou.game.game import Game
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
17 from pytouhou.game.bullettype import BulletType
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
18 from pytouhou.game.itemtype import ItemType
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
19 from pytouhou.game.player import Player
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
20 from pytouhou.game.bullet import Bullet
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
21
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
22 from math import pi
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
23
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
24
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
25 class EoSDGame(Game):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
26 def __init__(self, resource_loader, player_states, stage, rank, difficulty, **kwargs):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
27 etama3 = resource_loader.get_anm_wrapper(('etama3.anm',))
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
28 etama4 = resource_loader.get_anm_wrapper(('etama4.anm',))
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
29 bullet_types = [BulletType(etama3, 0, 11, 14, 15, 16, hitbox_size=4),
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
30 BulletType(etama3, 1, 12, 17, 18, 19, hitbox_size=6),
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
31 BulletType(etama3, 2, 12, 17, 18, 19, hitbox_size=4),
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
32 BulletType(etama3, 3, 12, 17, 18, 19, hitbox_size=6),
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
33 BulletType(etama3, 4, 12, 17, 18, 19, hitbox_size=5),
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
34 BulletType(etama3, 5, 12, 17, 18, 19, hitbox_size=4),
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
35 BulletType(etama3, 6, 13, 20, 20, 20, hitbox_size=16),
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
36 BulletType(etama3, 7, 13, 20, 20, 20, hitbox_size=11),
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
37 BulletType(etama3, 8, 13, 20, 20, 20, hitbox_size=9),
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
38 BulletType(etama4, 0, 1, 2, 2, 2, hitbox_size=32)]
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
39 #TODO: hitbox
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
40 item_types = [ItemType(etama3, 0, 7, hitbox_size=42, score=10), #Power
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
41 ItemType(etama3, 1, 8, hitbox_size=42, score=100000), #Point, TODO: changes for hard, lunatic and poc
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
42 ItemType(etama3, 2, 9, hitbox_size=42, score=10), #Big power
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
43 ItemType(etama3, 3, 10, hitbox_size=42), #Bomb
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
44 ItemType(etama3, 4, 11, hitbox_size=42, score=1000), #Full power
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
45 ItemType(etama3, 5, 12, hitbox_size=42), #1up
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
46 ItemType(etama3, 6, 13, hitbox_size=42, score=500)] #Star
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
47
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
48 eosd_characters = [ReimuA, ReimuB, MarisaA, MarisaB]
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
49 players = []
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
50 for player in player_states:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
51 players.append(eosd_characters[player.character](player, self, resource_loader))
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
52
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
53 Game.__init__(self, resource_loader, players, stage, rank, difficulty,
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
54 bullet_types, item_types, nb_bullets_max=640, **kwargs)
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
55
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
56
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
57 class Reimu(Player):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
58 def __init__(self, state, game, resource_loader):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
59 anm_wrapper = resource_loader.get_anm_wrapper(('player00.anm',))
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
60 self.bullet_angle = pi/30 #TODO: check
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
61
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
62 Player.__init__(self, state, game, anm_wrapper, speed=4.)
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
63
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
64
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
65 def fire(self):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
66 if self.fire_time % self.bullet_launch_interval == 0:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
67 if self.state.power < 16:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
68 bullets_per_shot = 1
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
69 elif self.state.power < 48:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
70 bullets_per_shot = 2
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
71 elif self.state.power < 96:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
72 bullets_per_shot = 3
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
73 elif self.state.power < 128:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
74 bullets_per_shot = 4
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
75 elif self.state.power >= 128:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
76 bullets_per_shot = 5
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
77
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
78 bullets = self._game.players_bullets
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
79 nb_bullets_max = self._game.nb_bullets_max
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
80
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
81 bullet_angle = self.bullet_launch_angle - self.bullet_angle * (bullets_per_shot - 1) / 2.
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
82 for bullet_nb in range(bullets_per_shot):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
83 if nb_bullets_max is not None and len(bullets) == nb_bullets_max:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
84 break
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
85
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
86 bullets.append(Bullet((self.x, self.y), self.bullet_type, 0,
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
87 bullet_angle, self.bullet_speed,
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
88 (0, 0, 0, 0, 0., 0., 0., 0.),
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
89 0, self, self._game, player_bullet=True))
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
90 bullet_angle += self.bullet_angle
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
91
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
92
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
93 class ReimuA(Reimu):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
94 def __init__(self, state, game, resource_loader):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
95 Reimu.__init__(self, state, game, resource_loader)
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
96
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
97 self.bulletA_type = BulletType(self.anm_wrapper, 65, 97, 0, 0, 0, hitbox_size=4, damage=48) #TODO: verify the hitbox and damages.
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
98 self.bulletA_speed = 12.
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
99
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
100
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
101 def fire(self):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
102 Reimu.fire(self)
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
103
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
104 if self.state.power < 8:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
105 return
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
106
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
107 else:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
108 pass #TODO
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
109
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
110
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
111 class ReimuB(Reimu):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
112 def __init__(self, state, game, resource_loader):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
113 Reimu.__init__(self, state, game, resource_loader)
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
114
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
115 self.bulletB_type = BulletType(self.anm_wrapper, 66, 98, 0, 0, 0, hitbox_size=4, damage=48) #TODO: verify the hitbox and damages.
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
116 self.bulletB_speed = 22.
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
117
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
118
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
119 def fire_spine(self, offset_x):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
120 bullets = self._game.players_bullets
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
121 nb_bullets_max = self._game.nb_bullets_max
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
122
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
123 if nb_bullets_max is not None and len(bullets) == nb_bullets_max:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
124 return
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
125
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
126 bullets.append(Bullet((self.x + offset_x, self.y), self.bulletB_type, 0,
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
127 self.bullet_launch_angle, self.bulletB_speed,
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
128 (0, 0, 0, 0, 0., 0., 0., 0.),
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
129 0, self, self._game, player_bullet=True))
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
130
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
131
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
132 def fire(self):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
133 Reimu.fire(self)
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
134
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
135 if self.state.power < 8:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
136 return
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
137
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
138 elif self.state.power < 16:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
139 if self.fire_time % 15 == 0:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
140 for offset in (-24, 24):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
141 self.fire_spine(offset)
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
142
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
143 elif self.state.power < 32:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
144 if self.fire_time % 10 == 0:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
145 for offset in (-24, 24):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
146 self.fire_spine(offset)
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
147
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
148 elif self.state.power < 48:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
149 if self.fire_time % 8 == 0:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
150 for offset in (-24, 24):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
151 self.fire_spine(offset)
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
152
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
153 elif self.state.power < 96:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
154 if self.fire_time % 5 == 0:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
155 for offset in (-16, 32):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
156 self.fire_spine(offset)
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
157 if self.fire_time % 8 == 0:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
158 for offset in (-32, 16):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
159 self.fire_spine(offset)
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
160
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
161 elif self.state.power < 128:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
162 if self.fire_time % 3 == 0:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
163 for offset in (-12, 36):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
164 self.fire_spine(offset)
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
165 if self.fire_time % 5 == 0:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
166 for offset in (-36, 12):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
167 self.fire_spine(offset)
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
168 if self.fire_time % 10 == 0:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
169 for offset in (-24, 24):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
170 self.fire_spine(offset)
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
171
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
172 else:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
173 if self.fire_time % 3 == 0:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
174 for offset in (-36, -12, 12, 36):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
175 self.fire_spine(offset)
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
176 if self.fire_time % 5 == 0:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
177 for offset in (-24, 24):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
178 self.fire_spine(offset)
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
179
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
180
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
181 class Marisa(Player):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
182 def __init__(self, state, game, resource_loader):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
183 anm_wrapper = resource_loader.get_anm_wrapper(('player01.anm',))
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
184 self.bullet_angle = pi/40 #TODO: check
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
185
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
186 Player.__init__(self, state, game, anm_wrapper, speed=5.)
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
187
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
188
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
189 def fire(self):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
190 if self.fire_time % self.bullet_launch_interval == 0:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
191 if self.state.power < 32:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
192 bullets_per_shot = 1
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
193 elif self.state.power < 96:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
194 bullets_per_shot = 2
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
195 elif self.state.power < 128:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
196 bullets_per_shot = 3
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
197 elif self.state.power >= 128:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
198 bullets_per_shot = 5
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
199
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
200 bullets = self._game.players_bullets
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
201 nb_bullets_max = self._game.nb_bullets_max
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
202
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
203 bullet_angle = self.bullet_launch_angle - self.bullet_angle * (bullets_per_shot - 1) / 2.
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
204 for bullet_nb in range(bullets_per_shot):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
205 if nb_bullets_max is not None and len(bullets) == nb_bullets_max:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
206 break
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
207
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
208 bullets.append(Bullet((self.x, self.y), self.bullet_type, 0,
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
209 bullet_angle, self.bullet_speed,
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
210 (0, 0, 0, 0, 0., 0., 0., 0.),
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
211 0, self, self._game, player_bullet=True))
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
212 bullet_angle += self.bullet_angle
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
213
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
214
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
215 class MarisaA(Marisa):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
216 def __init__(self, state, game, resource_loader):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
217 Marisa.__init__(self, state, game, resource_loader)
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
218
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
219 #TODO: verify the hitbox and damages.
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
220 self.bulletA_types = [BulletType(self.anm_wrapper, 65, 0, 0, 0, 0, hitbox_size=4, damage=48),
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
221 BulletType(self.anm_wrapper, 66, 0, 0, 0, 0, hitbox_size=4, damage=48),
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
222 BulletType(self.anm_wrapper, 67, 0, 0, 0, 0, hitbox_size=4, damage=48),
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
223 BulletType(self.anm_wrapper, 68, 0, 0, 0, 0, hitbox_size=4, damage=48)]
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
224 self.bulletA_speed_interpolator = None
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
225
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
226
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
227 def fire(self):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
228 Marisa.fire(self)
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
229
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
230 if self.state.power < 8:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
231 return
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
232
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
233 else:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
234 pass #TODO
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
235
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
236
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
237 class MarisaB(Marisa):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
238 def __init__(self, state, game, resource_loader):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
239 Marisa.__init__(self, state, game, resource_loader)
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
240
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
241 self.laser_type = None
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
242
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
243
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
244 def fire(self):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
245 Marisa.fire(self)
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
246
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
247 if self.state.power < 8:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
248 return
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
249
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
250 else:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
251 pass #TODO