Ignore:
Timestamp:
09/06/13 08:49:19 (8 years ago)
Author:
Jeremy Thurgood <firxen@…>
Branch:
default
Phase:
public
Message:

Better wolf claw attack.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/protagonist.py

    r313 r333  
    77    COLLISION_TYPE_PLAYER, ZORDER_MID, WEREWOLF_SOAK_FACTOR,
    88    PROTAGONIST_HEALTH_MIN_LEVEL, PROTAGONIST_HEALTH_MAX_LEVEL,
    9     NON_GAME_OBJECT_COLLIDERS, COLLISION_TYPE_WEREWOLF_ATTACK)
     9    NON_GAME_OBJECT_COLLIDERS, BULLET_DAMAGE, CLAW_DAMAGE)
    1010from nagslang.events import FireEvent, ClawEvent
    1111from nagslang.game_object import GameObject, Physicser, make_body
     
    6060
    6161        self.go_human()
    62         self._time = 0
    6362
    6463    def _make_physics(self, space, position):
     
    263262        vec.angle = self.angle
    264263        vec.length = 1000
    265         FireEvent.post(self.physicser.position, vec, 10, COLLISION_TYPE_PLAYER)
     264        FireEvent.post(
     265            self.physicser.position, vec, BULLET_DAMAGE, COLLISION_TYPE_PLAYER)
    266266
    267267    def claw(self):
    268268        vec = Vec2d.unit()
    269269        vec.angle = self.angle
    270         vec.length = 100
    271         ClawEvent.post(self.physicser.position, vec,
    272                        COLLISION_TYPE_WEREWOLF_ATTACK)
    273         print "Claw", self.physicser.position, vec
     270        vec.length = 30
     271        ClawEvent.post(self.physicser.position, vec, CLAW_DAMAGE)
    274272
    275273    def in_wolf_form(self):
     
    311309
    312310    def update(self, dt):
    313         last_secs = int(self._time)
    314         self._time += dt
    315         secs = int(self._time)
    316         if self.form == self.WOLF_FORM and secs > last_secs:
    317             self.gain_health(1)
     311        if int(self.lifetime + dt) > int(self.lifetime):
     312            if self.form == self.WOLF_FORM:
     313                self.gain_health(1)
    318314        super(Protagonist, self).update(dt)
Note: See TracChangeset for help on using the changeset viewer.