annotate pytouhou/games/eosd.py @ 199:8ec34c56fed0

Implement orbs.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Mon, 31 Oct 2011 09:38:57 -0700
parents e1bc8c4cbb1a
children 300661f2ae8a
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
199
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
21 from pytouhou.game.orb import Orb
196
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
22
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
23 from math import pi
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
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
26 class EoSDGame(Game):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
27 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
28 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
29 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
30 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
31 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
32 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
33 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
34 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
35 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
36 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
37 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
38 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
39 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
40 #TODO: hitbox
197
e1bc8c4cbb1a Do the right action when collecting an item.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 196
diff changeset
41 item_types = [ItemType(etama3, 0, 7), #Power
e1bc8c4cbb1a Do the right action when collecting an item.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 196
diff changeset
42 ItemType(etama3, 1, 8), #Point
e1bc8c4cbb1a Do the right action when collecting an item.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 196
diff changeset
43 ItemType(etama3, 2, 9), #Big power
e1bc8c4cbb1a Do the right action when collecting an item.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 196
diff changeset
44 ItemType(etama3, 3, 10), #Bomb
e1bc8c4cbb1a Do the right action when collecting an item.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 196
diff changeset
45 ItemType(etama3, 4, 11), #Full power
e1bc8c4cbb1a Do the right action when collecting an item.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 196
diff changeset
46 ItemType(etama3, 5, 12), #1up
e1bc8c4cbb1a Do the right action when collecting an item.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 196
diff changeset
47 ItemType(etama3, 6, 13)] #Star
196
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
48
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
49 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
50 players = []
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
51 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
52 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
53
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
54 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
55 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
56
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
57
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
58 class Reimu(Player):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
59 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
60 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
61 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
62
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
63 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
64
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
65
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
66 def fire(self):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
67 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
68 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
69 bullets_per_shot = 1
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
70 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
71 bullets_per_shot = 2
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
72 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
73 bullets_per_shot = 3
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
74 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
75 bullets_per_shot = 4
199
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
76 else:
196
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
77 bullets_per_shot = 5
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
78
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
79 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
80 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
81
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
82 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
83 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
84 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
85 break
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
86
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
87 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
88 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
89 (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
90 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
91 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
92
199
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
93 for orb in self.orbs:
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
94 orb.fire(orb)
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
95
196
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 class ReimuA(Reimu):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
98 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
99 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
100
199
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
101 self.bulletA_type = BulletType(self.anm_wrapper, 65, 97, 0, 0, 0, hitbox_size=4, damage=14) #TODO: verify the hitbox.
196
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
102 self.bulletA_speed = 12.
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
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
105 def fire(self):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
106 Reimu.fire(self)
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
107
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
108 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
109 return
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 else:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
112 pass #TODO
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
113
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 class ReimuB(Reimu):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
116 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
117 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
118
199
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
119 self.bulletB_type = BulletType(self.anm_wrapper, 66, 98, 0, 0, 0, hitbox_size=4, damage=12) #TODO: verify the hitbox.
196
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
120 self.bulletB_speed = 22.
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
121
199
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
122 self.orbs = [Orb(self.anm_wrapper, 128, self.state, self.orb_fire),
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
123 Orb(self.anm_wrapper, 129, self.state, self.orb_fire)]
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
124 self.orbs[0].dx = -24
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
125 self.orbs[1].dx = 24
196
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
126
199
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
127
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
128 def fire_spine(self, orb, offset_x):
196
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
129 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
130 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
131
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
132 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
133 return
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
134
199
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
135 bullets.append(Bullet((orb.x + offset_x, orb.y), self.bulletB_type, 0,
196
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
136 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
137 (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
138 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
139
199
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
140 def orb_fire(self, orb):
196
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
141 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
142 return
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
143
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
144 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
145 if self.fire_time % 15 == 0:
199
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
146 self.fire_spine(orb, 0)
196
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 < 32:
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 % 10 == 0:
199
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
150 self.fire_spine(orb, 0)
196
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
151
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
152 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
153 if self.fire_time % 8 == 0:
199
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
154 self.fire_spine(orb, 0)
196
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
155
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
156 elif self.state.power < 96:
199
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
157 if self.fire_time % 8 == 0:
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
158 self.fire_spine(orb, -8)
196
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
159 if self.fire_time % 5 == 0:
199
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
160 self.fire_spine(orb, 8)
196
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
161
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
162 elif self.state.power < 128:
199
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
163 if self.fire_time % 5 == 0:
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
164 self.fire_spine(orb, -12)
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
165 if self.fire_time % 10 == 0:
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
166 self.fire_spine(orb, 0)
196
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
167 if self.fire_time % 3 == 0:
199
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
168 self.fire_spine(orb, 12)
196
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
169
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
170 else:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
171 if self.fire_time % 3 == 0:
199
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
172 self.fire_spine(orb, -12)
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
173 self.fire_spine(orb, 12)
196
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
174 if self.fire_time % 5 == 0:
199
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
175 self.fire_spine(orb, 0)
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
176
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
177
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
178 def update(self, keystate):
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
179 Player.update(self, keystate)
196
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
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
182 class Marisa(Player):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
183 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
184 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
185 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
186
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
187 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
188
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
189
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
190 def fire(self):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
191 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
192 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
193 bullets_per_shot = 1
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
194 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
195 bullets_per_shot = 2
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
196 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
197 bullets_per_shot = 3
199
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
198 else:
196
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
199 bullets_per_shot = 5
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
200
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
201 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
202 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
203
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
204 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
205 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
206 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
207 break
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
208
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
209 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
210 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
211 (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
212 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
213 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
214
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
215
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
216 class MarisaA(Marisa):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
217 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
218 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
219
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
220 #TODO: verify the hitbox and damages.
199
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
221 self.bulletA_types = [BulletType(self.anm_wrapper, 65, 0, 0, 0, 0, hitbox_size=4, damage=40),
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
222 BulletType(self.anm_wrapper, 66, 0, 0, 0, 0, hitbox_size=4),
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
223 BulletType(self.anm_wrapper, 67, 0, 0, 0, 0, hitbox_size=4),
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
224 BulletType(self.anm_wrapper, 68, 0, 0, 0, 0, hitbox_size=4)]
196
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
225 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
226
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
227
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
228 def fire(self):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
229 Marisa.fire(self)
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
230
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
231 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
232 return
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
233
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
234 else:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
235 pass #TODO
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
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
238 class MarisaB(Marisa):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
239 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
240 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
241
199
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
242 #TODO: power damages period
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
243 # 8 240 120
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
244 # 16 390 170
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
245 # 32 480 ???
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
246 # 48 510 ???
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
247 # 64 760 ???
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
248 # 80 840 ???
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
249 # 96 1150 270
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
250 # 128 1740 330
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
251 # The duration of the laser is period - 42.
8ec34c56fed0 Implement orbs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 197
diff changeset
252 # The damages are given for one laser shot on one enemy for its entire duration.
196
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
253
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
254
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
255 def fire(self):
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
256 Marisa.fire(self)
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
257
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
258 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
259 return
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
260
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
261 else:
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
262 pass #TODO