public void ResetUnitHealthToMax() { // this is done on lvl up LPartyUnit.UnitHealthCurr = LPartyUnit.GetUnitEffectiveMaxHealth(); // update Health panel UpdateUnitHealthInfo(); }
//public void ApplyDestructiveAbility(int damageDealt) //{ // int healthAfterDamage = LPartyUnit.UnitHealthCurr + damageDealt; // Note: damageDealt is negative normally // // make sure that we do not set health less then 0 // if (healthAfterDamage <= 0) // { // healthAfterDamage = 0; // } // LPartyUnit.UnitHealthCurr = healthAfterDamage; // // update current health in UI // Text currentHealth = GetUnitCurrentHealthText(); // currentHealth.text = healthAfterDamage.ToString(); // // verify if unit is dead // if (0 == healthAfterDamage) // { // // set unit is dead attribute // LPartyUnit.UnitStatus = UnitStatus.Dead; // } // // display damage dealt in info panel // UnitInfoPanelText.text = damageDealt.ToString() + " health"; // UnitInfoPanelText.color = Color.red; //} //public void RemoveAllBuffs() //{ // //Debug.Log("RemoveAllBuffs"); // // in unit properties // for (int i = 0; i < LPartyUnit.UnitBuffs.Length; i++) // { // LPartyUnit.UnitBuffs[i] = UnitBuff.None; // } // // in UI // UnitBuffIndicator[] allBuffs = GetUnitBuffsPanel().GetComponentsInChildren<UnitBuffIndicator>(); // foreach (UnitBuffIndicator buff in allBuffs) // { // Destroy(buff.gameObject); // } //} //public void RemoveAllDebuffs() //{ // // in unit properties // for (int i = 0; i < LPartyUnit.UnitDebuffs.Length; i++) // { // LPartyUnit.UnitDebuffs[i] = UnitDebuff.None; // } // // in UI // UnitDebuffIndicator[] allDebuffs = GetUnitDebuffsPanel().GetComponentsInChildren<UnitDebuffIndicator>(); // foreach (UnitDebuffIndicator buff in allDebuffs) // { // Destroy(buff.gameObject); // } //} public void RemoveAllBuffsAndDebuffs() { // RemoveAllBuffs(); // RemoveAllDebuffs(); LPartyUnit.RemoveAppliedUnitUniquePowerModifiers(); // process both buffs and debuffs }
void UpdateUnitMaxHealthInfo() { Debug.Log("Updating " + LPartyUnit.UnitName + " unit max health"); transform.Find("HPPanel/HPmax").GetComponent <Text>().text = LPartyUnit.GetUnitEffectiveMaxHealth().ToString(); }
void SetUnitNameUI() { // set Name transform.Find("Name").GetComponent <Text>().text = LPartyUnit.GetUnitDisplayName(); }