Changeset 309:2b0494b3ce6a


Ignore:
Timestamp:
Sep 5, 2013, 10:41:14 PM (7 years ago)
Author:
Jeremy Thurgood <firxen@…>
Branch:
default
rebase_source:
bb30c33b2af9a6254dd0e3ddcb23ea55b9917e30
Message:

Werewolf form heals every second.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/protagonist.py

    r305 r309  
    6060
    6161        self.go_human()
     62        self._time = 0
    6263
    6364    def _make_physics(self, space, position):
     
    300301        if self.health_level > PROTAGONIST_HEALTH_MAX_LEVEL:
    301302            self.health_level = PROTAGONIST_HEALTH_MAX_LEVEL
     303
     304    def update(self, dt):
     305        last_secs = int(self._time)
     306        self._time += dt
     307        secs = int(self._time)
     308        if self.form == self.WOLF_FORM and secs > last_secs:
     309            self.gain_health(1)
     310        super(Protagonist, self).update(dt)
Note: See TracChangeset for help on using the changeset viewer.