def setHealth(self, health): prevHealth = self.health DistributedAvatarAI.setHealth(self, health) messenger.send(self.healthChangeEvent, [health, prevHealth]) if not self.isDead() or self.isDead() and self.deathTimeLeft > 0: self.d_announceHealth(0, prevHealth - self.health)
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()
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()