diff options
author | Nguyễn Gia Phong <vn.mcsinyx@gmail.com> | 2018-07-01 21:53:14 +0700 |
---|---|---|
committer | Nguyễn Gia Phong <vn.mcsinyx@gmail.com> | 2018-07-02 11:04:46 +0700 |
commit | ffe6ba9855433502fc1fde8125a86bc81080ad09 (patch) | |
tree | 45a63181d20bb04c35ce86810b169e4ceb45800d /brutalmaze/maze.py | |
parent | fc05e0ccee392985d67872507bc5476a5775142c (diff) | |
download | brutalmaze-ffe6ba9855433502fc1fde8125a86bc81080ad09.tar.gz |
Chocolate gets you high
Diffstat (limited to 'brutalmaze/maze.py')
-rw-r--r-- | brutalmaze/maze.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/brutalmaze/maze.py b/brutalmaze/maze.py index ef1c2fb..6a5f139 100644 --- a/brutalmaze/maze.py +++ b/brutalmaze/maze.py @@ -232,12 +232,17 @@ class Maze: if self.enemy_weights[color] + wound < MAXW: self.enemy_weights[color] += wound if color == 'Orange': + # If called by close-range attack, this is FPS-dependant, although + # in playable FPS (24 to infinity), the difference within 2%. self.hero.next_heal = abs(self.hero.next_heal * (1 - wound)) elif (uniform(0, sum(self.enemy_weights.values())) < self.enemy_weights[color]): self.hero.next_heal = -1.0 # what doesn't kill you heals you if color == 'Butter' or color == 'ScarletRed': wound *= ENEMY_HP + elif color == 'Chocolate': + self.hero.highness += wound + wound = 0 elif color == 'SkyBlue': self.next_move = max(self.next_move, 0) + wound*1000 wound = 0 @@ -266,12 +271,7 @@ class Maze: def track_bullets(self): """Handle the bullets.""" - if (self.hero.firing and not self.hero.slashing - and self.hero.next_strike <= 0): - self.hero.next_strike = ATTACK_SPEED - self.bullets.append(Bullet(self.surface, self.x, self.y, - self.hero.angle, 'Aluminium')) - + self.bullets.extend(self.hero.get_shots()) fallen = [] block = (self.hero.spin_queue and self.hero.next_heal < 0 and self.hero.next_strike > self.hero.spin_queue / self.fps) @@ -447,6 +447,7 @@ class Maze: self.next_move = self.next_slashfx = self.hero.next_strike = 0.0 self.hero.next_heal = -1.0 + self.hero.highness = 0.0 self.hero.slashing = self.hero.firing = self.hero.dead = False self.hero.spin_queue = self.hero.wound = 0.0 self.hero.wounds = deque([0.0]) |