public override string GetDescription() { string desc = Name + "\n"; desc += WeaponSubType + " - " + WeaponType + " - " + ItemRarity.ToString() + "\n"; desc += "Gold: " + Value + " - " + EquipSlot.ToString() + "\n"; desc += Description + "\n\n"; desc += ModPackage.GetStatInfo(); return(desc); }
public string GetTooltip() { var color = GetColorByRarity(Rarity); var tooltip = $"<color={color}>"; tooltip += $"\n\n{Rarity.ToString()}"; foreach (var effect in Effects) { tooltip += $"\n{GetEffectText(effect)}"; } tooltip += "</color>"; return(tooltip); }
//get item rare from type name public static ItemRarity GetRareFromString(string typeName) { ItemRarity resultType = ItemRarity.common; foreach (ItemRarity itemRare in GetTypeValues <ItemRarity>()) { if (itemRare.ToString() == typeName) { resultType = itemRare; break; } } return(resultType); }
public string[] ItemInfo() { string[] newInfo; if (myStats != null) { newInfo = new string[] { RarityInfo(), "Item level: <color=#00A8FF>" + itemLevel.ToString(), "Stamina: <color=#00A8FF>" + myStats.stamina.ToString(), "Strength: <color=#00A8FF>" + myStats.strength.ToString(), "Agility: <color=#00A8FF>" + myStats.agility.ToString(), "WillPower: <color=#00A8FF>" + myStats.willpower.ToString(), "Defence: <color=#00A8FF>" + myStats.defense.ToString() }; } else if (this is Potion) { newInfo = new string[] { "<color=white>" + itemName, itemRarity.ToString(), Database.hostInstance.potionDiscription[PotionNum()] }; } else { NotificationManager.instance.NewNotification(itemName); newInfo = new string[] { RarityInfo(), "Item level: <color=#00A8FF>" + itemLevel.ToString() }; } return(newInfo); }
public static string GetDisplayName(this ItemRarity rarity, bool inColor) { string output; switch (rarity) { case ItemRarity.UltraRare: output = "Ultra Rare"; break; default: output = rarity.ToString(); break; } if (!inColor) { return(output); } else { return(output.InColor(rarity.GetColor() * 5f)); } }
private void Start() { boardController = GetComponentInParent <BoardController>(); playerController = GetComponentInParent <PlayerController>(); int RarityRoll = UnityEngine.Random.Range(0, 101); ItemRarity rolledRarity = ItemRarity.Trash; if (RarityRoll >= 60 && RarityRoll < 90) { rolledRarity = ItemRarity.Common; } else if (RarityRoll >= 90 && RarityRoll < 99) { rolledRarity = ItemRarity.Rare; } else if (RarityRoll >= 99) { rolledRarity = ItemRarity.Artifact; } Debug.Log("Rolled: " + RarityRoll + " and getting a random item of rarity: " + rolledRarity.ToString()); List <ItemName> possibleDrops; playerController.ITEM_RARITY_DATA.TryGetValue(rolledRarity, out possibleDrops); // get a list of all units of our possible item drops Debug.Log("Possible drops count: " + possibleDrops.Count); int possibleDropIndex = UnityEngine.Random.Range(0, possibleDrops.Count); ItemName itemName = possibleDrops[possibleDropIndex]; Item rngItem = new Item(itemName); ItemDroppedInChest = rngItem; Debug.Log("Generated Item: " + rngItem.ItemName.ToString() + " for Treasure Drop"); }
/// <summary> /// Returns the rarity color of the given item. /// </summary> /// <param name="item">Item to examine.</param> public Color RarityColor() { float opaqueness = 1.0f; Color commonColor = new Color(1f, 1f, 1f, opaqueness); switch (rarity) { case ItemRarity.COMMON: return(commonColor); case ItemRarity.UNCOMMON: return(new Color(167f / 255f, 1f, 215f / 255f, opaqueness)); case ItemRarity.RARE: return(new Color(21f / 255f, 1f, 231f / 255f, opaqueness)); case ItemRarity.EPIC: return(new Color(51f / 255f, 60f / 255f, 1f, opaqueness)); case ItemRarity.LEGENDARY: return(new Color(1f, 11f / 255f, 253f / 255f, opaqueness)); default: Debug.Log("GameItem.RarityColor: Please add another color for rarity '" + rarity.ToString("G") + "'"); return(commonColor); } }