public void UpdateInfo() { // Text HealthText.text = Numbers.Abbreviate(Raider.Health); // Health Bar HealthBar.value = Mathf.Lerp(HealthBar.value, Raider.Health, HealthLerpConstant); // Heal predict HealPredict.value = Mathf.Lerp(HealPredict.value, Raider.Health + Raider.HealPredict, HealthLerpConstant); // Cast Bar if (!Raider.IsCasting) { CastBar.gameObject.SetActive(false); } else { CastBar.gameObject.SetActive(true); CastBar.value = Raider.CurrentAbility.CastProgress; } // Dead state if (Raider.IsDead) { UnSelect(); SetAlpha(Background, 0.1f); SetAlpha(NameText, 0.5f); HealthText.text = "Dead"; HealPredict.gameObject.SetActive(false); CastBar.gameObject.SetActive(false); } }
private void Update() { if (TotalDamage == 0) { return; } SetTime += Time.deltaTime; if (Time.time >= NextUpdate) { NextUpdate = Time.time + UpdateDelay; // Update Raid DPS RaidDpsText.text = string.Format("Raid DPS: {0}", Numbers.Abbreviate(SetDamage / SetTime)); if (SetTime >= SetDuration) { SetDamage = SetDamage / SetTime; SetTime = 1.0f; } // Update Damage Bars if (ShowBars) { float highestDamage = DamageTable.Max(d => d.Value); foreach (var damageBar in DamageBars.Values) { UpdateDamageBar(damageBar, highestDamage); } SortBars(); } } }
protected string CreateAbilityMessage(Entity user, Entity target, Ability ability) { var sb = new StringBuilder(); float magnitude = user.AbilityPower * ability.PowerCoefficient; sb.Append(GetNameString(user)); sb.Append(ability.Name + " "); sb.Append(GetNameString(target)); sb.Append(GetColoredText(Numbers.Abbreviate(magnitude), "yellow")); return(sb.ToString()); }
public void UpdateInfo() { HealthText.text = Numbers.Abbreviate(Boss.Health); HealthPText.text = string.Format("{0}%", Boss.HealthPercent.ToString("G3")); HealthBar.value = Mathf.Lerp(HealthBar.value, Boss.Health, HealthLerpConstant); if (Boss.IsEnraged) { HealthBarFill.color = Color.white; NameText.color = Color.red; } }
public void UpdateInfo(float damage, float highestDamage, float fightDuration) { DamageText.text = string.Format(DamageTextFormat, Numbers.Abbreviate(damage), Numbers.Abbreviate(damage / fightDuration)); TargetBarValue = damage / highestDamage; }