void Update() { if (HealthBarActive && targetType >= 2) // Actor or combatable { TargetHealthBar.value = TargetCombatable.getPercentHealth(); TargetHealthNum.text = Mathf.Round(TargetCombatable.getCurrentHealth()).ToString(); if (EnergyBarActive) { TargetEnergyBar.value = TargetActor.getPercentEnergy(); TargetEnergyNum.text = Mathf.Round(TargetActor.getCurrentEnergy()).ToString(); } } }
public override void activate(ObjectActor self, ObjectCombatable target) { float num = target.getPercentHealth(); if (num < 0.25f) { float damage = self.getStr() * 0.5f + 50.0f; target.takeSlashingDamage(damage, (ObjectInteractable)self); } else if (num < 0.5f) { float damage = self.getStr() * 0.5f + 30.0f; target.takeSlashingDamage(damage, (ObjectInteractable)self); } }
public override bool activate(ObjectActor self, ObjectCombatable target, out string message) { float num = target.getPercentHealth(); if (num < 0.25f) { float damage = self.getStr() * 0.5f + 50.0f; target.takeSlashingDamage(damage, (ObjectInteractable)self); } else if (num < 0.5f) { float damage = self.getStr() * 0.5f + 30.0f; target.takeSlashingDamage(damage, (ObjectInteractable)self); } else { message = "Target's health was not low enough."; return(true); } message = ""; return(false); }