/// <summary>Generates formatted Stats text for an item, based on its Item Type.</summary> private static string GetStatsText(EquipmentItem item) { StringBuilder stats = new StringBuilder(); switch (item.itemType) { case ItemType.Armor: stats.AppendFormat("<color=#888888>ARMOR RATING: </color> <color=#00ff00>{0}{1}</color>\n", item.armorRating < 0 ? "-" : "+", Mathf.Abs(item.armorRating)); stats.AppendFormat("<color=#888888>MOVE PENALTY: </color> <color=#ff0000>{0}{1}</color>\n", "-", Mathf.Abs(item.movePenalty)); stats.AppendFormat("<color=#888888>CONCEALMENT: </color> <color=#ff0000>{0}{1}</color>\n", "-", Mathf.Abs(item.concealmentPenalty)); break; case ItemType.Weapon: stats.AppendFormat("<color=#888888>DAMAGE: </color> <color=#00ff00>{0}</color> DPS\n", item.damage); stats.AppendFormat("<color=#888888>FIRE RATE: </color> <color=#00ff00>{0}</color> per sec\n", item.rateOfFire); stats.AppendFormat("<color=#888888>CONCEALMENT: </color> <color=#ff0000>{0}{1}</color>\n", "-", Mathf.Abs(item.concealmentPenalty)); break; } return(stats.ToString()); }
/// <summary>Generates formatted Stats text for an item, based on its Item Type.</summary> private static string GetStatsText(EquipmentItem item) { StringBuilder stats = new StringBuilder(); switch (item.itemType) { case ItemType.Armor: stats.AppendFormat("<color=#888888>ARMOR RATING: </color> <color=#00ff00>{0}{1}</color>\n", item.armorRating < 0 ? "-" : "+", Mathf.Abs(item.armorRating)); stats.AppendFormat("<color=#888888>MOVE PENALTY: </color> <color=#ff0000>{0}{1}</color>\n", "-", Mathf.Abs(item.movePenalty)); stats.AppendFormat("<color=#888888>CONCEALMENT: </color> <color=#ff0000>{0}{1}</color>\n", "-", Mathf.Abs(item.concealmentPenalty)); break; case ItemType.Weapon: stats.AppendFormat("<color=#888888>DAMAGE: </color> <color=#00ff00>{0}</color> DPS\n", item.damage); stats.AppendFormat("<color=#888888>FIRE RATE: </color> <color=#00ff00>{0}</color> per sec\n", item.rateOfFire); stats.AppendFormat("<color=#888888>CONCEALMENT: </color> <color=#ff0000>{0}{1}</color>\n", "-", Mathf.Abs(item.concealmentPenalty)); break; } return stats.ToString(); }