Example #1
0
 def setHealth(self, hp):
     DistributedAvatarAI.setHealth(self, hp)
     if hp < 1:
         self.getManager().sendUpdateToAvatarId(self.getOwner(), 'yourTurretIsDead', [])
         self.sendUpdate('die', [])
         Sequence(Wait(2.0), Func(self.getManager().killTurret, self.doId)).start()
Example #2
0
    def setHealth(self, health):
        prevHealth = self.health
        DistributedAvatarAI.setHealth(self, health)

        if not self.isDead() or self.isDead() and self.deathTimeLeft > 0:
            self.d_announceHealth(0, prevHealth - self.health)