changeset 634:45eff33c3dad

Increased health.
author Jeremy Thurgood <firxen@gmail.com>
date Sun, 08 Sep 2013 01:35:45 +0200
parents cf276bb2a854
children 1eed282b6dea 30d7982f43dc
files nagslang/constants.py nagslang/protagonist.py nagslang/screens/area.py
diffstat 3 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/nagslang/constants.py	Sun Sep 08 01:34:17 2013 +0200
+++ b/nagslang/constants.py	Sun Sep 08 01:35:45 2013 +0200
@@ -59,7 +59,7 @@
 ZORDER_HIGH = 3
 
 WEREWOLF_SOAK_FACTOR = 5
-PROTAGONIST_HEALTH_MAX_LEVEL = 100
+PROTAGONIST_HEALTH_MAX_LEVEL = 200
 PROTAGONIST_HEALTH_MIN_LEVEL = 0
 
 BULLET_DAMAGE = 25
--- a/nagslang/protagonist.py	Sun Sep 08 01:34:17 2013 +0200
+++ b/nagslang/protagonist.py	Sun Sep 08 01:35:45 2013 +0200
@@ -373,7 +373,7 @@
             self._go_to_next_form()
         if int(self.lifetime + dt) > int(self.lifetime):
             if self.in_wolf_form():
-                self.gain_health(1)
+                self.gain_health(2)
         super(Protagonist, self).update(dt)
 
     def force_wolf_form(self):
--- a/nagslang/screens/area.py	Sun Sep 08 01:34:17 2013 +0200
+++ b/nagslang/screens/area.py	Sun Sep 08 01:35:45 2013 +0200
@@ -10,7 +10,7 @@
 from nagslang.constants import (
     COLLISION_TYPE_WALL, COLLISION_TYPE_PLAYER, CALLBACK_COLLIDERS,
     COLLISION_TYPE_FURNITURE, COLLISION_TYPE_WEREWOLF_ATTACK,
-    CMD_TOGGLE_FORM, CMD_ACTION)
+    CMD_TOGGLE_FORM, CMD_ACTION, PROTAGONIST_HEALTH_MAX_LEVEL)
 from nagslang.events import (
     AddDrawableEvent, DeathEvent, DoorEvent, QuitEvent, ScreenChange)
 from nagslang.level import Level
@@ -295,7 +295,9 @@
             health_colour = pygame.color.THECOLORS['red']
         else:
             health_colour = pygame.color.THECOLORS['violetred3']
-        rect = pygame.Rect(5, 5, self.protagonist.get_health_level(), 30)
+        health = self.protagonist.get_health_level()
+        rect = pygame.Rect(
+            5, 5, (100 * health) / PROTAGONIST_HEALTH_MAX_LEVEL, 30)
         pygame.draw.rect(bar_surface, health_colour, rect, 0)
         bar_surface.set_alpha(192)
         y_pos = surface.get_height() - 20 - bar_surface.get_height()