public void UpdateWindowEquipment_Weapon(Weapon weaponItem) { bool hasElemental = false; bool hasPrimordial = false; List <string> elementalDamage = new List <string>(); List <string> primDamage = new List <string>(); MinMaxRange range; float dps; for (int i = 1; i < (int)ElementType.DIVINE; i++) { range = weaponItem.GetWeaponDamage((ElementType)i); if (!range.IsZero()) { hasElemental = true; dps = (range.min + range.max) / 2f * weaponItem.AttackSpeed; elementalDamage.Add("<b>" + LocalizationManager.BuildElementalDamageString(range.min + "-" + range.max + " (" + dps.ToString("N1") + ")", (ElementType)i) + "</b>"); } } for (int i = (int)ElementType.DIVINE; i <= (int)ElementType.VOID; i++) { range = weaponItem.GetWeaponDamage((ElementType)i); if (!range.IsZero()) { hasPrimordial = true; dps = (range.min + range.max) / 2f * weaponItem.AttackSpeed; primDamage.Add("<b>" + LocalizationManager.BuildElementalDamageString(range.min + "-" + range.max + " (" + dps.ToString("N1") + ")", (ElementType)i) + "</b>"); } } if (weaponItem.PhysicalDamage.min != 0 && weaponItem.PhysicalDamage.max != 0) { dps = (weaponItem.PhysicalDamage.min + weaponItem.PhysicalDamage.max) / 2f * weaponItem.AttackSpeed; damageText.text += "Physical Damage (DPS) \n<sprite=0><b> " + weaponItem.PhysicalDamage.min + "-" + weaponItem.PhysicalDamage.max + " (" + dps.ToString("N1") + ")</b>\n\n"; } if (hasElemental) { damageText.text += "Elemental Damage (DPS) \n" + String.Join("\n", elementalDamage) + "\n\n"; } if (hasPrimordial) { damageText.text += "Astral Damage (DPS) \n" + String.Join("\n", primDamage) + "\n\n"; } statsText.text += "Critical Chance\n<b>" + weaponItem.CriticalChance.ToString("F2") + "%</b>\n"; statsText.text += "Attacks per Second\n<b>" + weaponItem.AttackSpeed.ToString("F2") + "/s</b>\n"; statsText.text += "Range\n<b>" + weaponItem.WeaponRange.ToString("F2") + "</b>"; }
public void UpdateInfo_Weapon(Weapon weaponItem) { bool hasElemental = false; bool hasPrimordial = false; List <string> elementalDamage = new List <string>(); List <string> elementalDps = new List <string>(); List <string> primDamage = new List <string>(); List <string> primDps = new List <string>(); string physDamage = ""; MinMaxRange range; float dps; for (int i = 1; i < (int)ElementType.DIVINE; i++) { range = weaponItem.GetWeaponDamage((ElementType)i); if (!range.IsZero()) { hasElemental = true; dps = (range.min + range.max) / 2f * weaponItem.AttackSpeed; elementalDps.Add(LocalizationManager.BuildElementalDamageString(dps.ToString("F2"), (ElementType)i)); elementalDamage.Add("<nobr>" + LocalizationManager.BuildElementalDamageString(range.min + "-" + range.max, (ElementType)i) + "</nobr>"); } } for (int i = (int)ElementType.DIVINE; i <= (int)ElementType.VOID; i++) { range = weaponItem.GetWeaponDamage((ElementType)i); if (!range.IsZero()) { hasPrimordial = true; dps = (range.min + range.max) / 2f * weaponItem.AttackSpeed; primDps.Add(LocalizationManager.BuildElementalDamageString(dps.ToString("F2"), (ElementType)i)); primDamage.Add("<nobr>" + LocalizationManager.BuildElementalDamageString(range.min + "-" + range.max, (ElementType)i) + "</nobr>"); } } if (weaponItem.PhysicalDamage.min != 0 && weaponItem.PhysicalDamage.max != 0) { dps = (weaponItem.PhysicalDamage.min + weaponItem.PhysicalDamage.max) / 2f * weaponItem.AttackSpeed; leftInfo.text += "pDPS: " + dps.ToString("F2") + "\n"; physDamage = "pDmg: " + weaponItem.PhysicalDamage.min + "-" + weaponItem.PhysicalDamage.max + "\n"; } if (hasElemental) { leftInfo.text += "eDPS: " + string.Join(", ", elementalDps) + "\n"; } if (hasPrimordial) { leftInfo.text += "aDPS: " + string.Join(", ", primDps) + "\n"; } leftInfo.text += "\n"; leftInfo.text += physDamage; if (hasElemental) { leftInfo.text += "eDmg: " + string.Join(", ", elementalDamage) + "\n"; } if (hasPrimordial) { leftInfo.text += "aDmg: " + string.Join(", ", primDamage) + "\n"; } rightInfo.text += "Critical Chance\n<b>" + weaponItem.CriticalChance.ToString("F2") + "%</b>\n"; rightInfo.text += "Attacks / s\n<b>" + weaponItem.AttackSpeed.ToString("F2") + "/s</b>\n"; rightInfo.text += "Range\n<b>" + weaponItem.WeaponRange.ToString("F2") + "</b>\n"; }