コード例 #1
0
    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)
コード例 #2
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()
コード例 #3
0
ファイル: DistributedSuitAI.py プロジェクト: coginvasion/src
 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)
コード例 #4
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()