def setHealth(self, health): if health > self.health: # We got an hp boost. Flash green. flashColor = VBase4(0, 1, 0, 1) elif health < self.health: # We got an hp loss. Flash red. flashColor = VBase4(1, 0, 0, 1) DistributedAvatar.setHealth(self, health) def doBossFlash(): if not self.isEmpty(): LerpColorScaleInterval(self, 0.2, flashColor).start() def clearBossFlash(): if not self.isEmpty(): self.clearColorScale() if self.isDead(): self.setChaseTarget(0) base.taskMgr.remove(self.uniqueName('monitorLocalAvDistance')) if self.isInRange: messenger.send(PCTMM.getCogOutOfRangeEvent()) self.isInRange = False self.interruptAttack() if self.getLevel() > 12: if self.hpFlash: self.hpFlash.finish() self.hpFlash = None self.hpFlash = Sequence(Func(doBossFlash), Wait(0.2), Func(clearBossFlash)) self.hpFlash.start() self.updateHealthBar(health)
def setHealth(self, health): if health > self.health: flashColor = VBase4(0, 1, 0, 1) else: if health < self.health: flashColor = VBase4(1, 0, 0, 1) DistributedAvatar.setHealth(self, health) def doBossFlash(): if not self.isEmpty(): LerpColorScaleInterval(self, 0.2, flashColor).start() def clearBossFlash(): if not self.isEmpty(): self.clearColorScale() if self.isDead(): self.interruptAttack() if self.getLevel() > 12: if self.hpFlash: self.hpFlash.finish() self.hpFlash = None self.hpFlash = Sequence(Func(doBossFlash), Wait(0.2), Func(clearBossFlash)) self.hpFlash.start() self.updateHealthBar(health) return
def setHealth(self, hp): DistributedAvatar.setHealth(self, hp) if self.isLocal(): base.localAvatar.getMyBattle().getTurretManager().updateTurretGui()
def setHealth(self, health): DistributedAvatar.setHealth(self, health) self.updateHealthBar(health)