Changeset 265:8a695b8ecd6c for nagslang


Ignore:
Timestamp:
Sep 4, 2013, 10:37:48 PM (7 years ago)
Author:
David Sharpe
Branch:
default
rebase_source:
aaa3a8f164e48a7fcb799b6d2017c5ab48ae98a6
Message:

Correcting damage application

Location:
nagslang
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • nagslang/constants.py

    r261 r265  
    1717COLLISION_TYPE_DOOR = 6
    1818COLLISION_TYPE_PROJECTILE = 7
     19COLLISION_TYPE_WEREWOLF_ATTACK = 8
    1920
    2021SWITCH_PUSHERS = [COLLISION_TYPE_PLAYER, COLLISION_TYPE_BOX]
  • nagslang/enemies.py

    r259 r265  
    128128
    129129    def collide_with_protagonist(self, protagonist):
    130         return 5
     130        protagonist.lose_health(15)
    131131
    132132    @classmethod
  • nagslang/protagonist.py

    r261 r265  
    220220        """Attempt to hurt something.
    221221        """
    222         vec = Vec2d.unit()
    223         vec.angle = self.angle
    224         vec.length = 100
    225         FireEvent.post(self.physicser.position, vec)
    226         print "Biff", self.physicser.position, vec
     222        if self.in_wolf_form():
     223            pass
     224        else:
     225            vec = Vec2d.unit()
     226            vec.angle = self.angle
     227            vec.length = 100
     228            FireEvent.post(self.physicser.position, vec)
     229            print "Biff", self.physicser.position, vec
    227230
    228231    def in_wolf_form(self):
  • nagslang/screens/area.py

    r261 r265  
    8787        gobj = arbiter.shapes[1].physicser.game_object
    8888        result = gobj.collide_with_protagonist(self.protagonist)
    89         if arbiter.shapes[1].collision_type == COLLISION_TYPE_ENEMY:
    90             self.protagonist.lose_health(15)
    9189        # The collision handler must return `True` or `False`. We don't want to
    9290        # accidentally reject collisions from handlers that return `None`, so
Note: See TracChangeset for help on using the changeset viewer.