Exemplo n.º 1
0
        public IEnumerable <Feature> CollectOnUse(int level, IChoiceProvider provider)
        {
            List <Feature> result = new List <Feature>();

            foreach (string mp in MagicProperties)
            {
                result.AddRange(MagicProperty.Get(mp, null).CollectOnUse(level, provider, Attuned));
            }
            return(result);
        }
Exemplo n.º 2
0
        public IEnumerable <Feature> Collect(int level, IChoiceProvider provider, bool pretendEquipped = false)
        {
            List <Feature> result = new List <Feature>();
            bool           equip  = !EquipSlot.None.Equals(Equipped, StringComparison.InvariantCultureIgnoreCase);

            foreach (string mp in MagicProperties)
            {
                result.AddRange(MagicProperty.Get(mp, null).Collect(level, equip || pretendEquipped, Attuned, provider));
            }
            return(result);
        }
Exemplo n.º 3
0
        public override string ToString()
        {
            string name = Name;

            if (name == null || name == "")
            {
                name = Item.Get(BaseItem, null).Name;
            }
            foreach (string mp in MagicProperties)
            {
                name = MagicProperty.Get(mp, null).getName(name);
            }
            if (Count > 1)
            {
                name = name + " (" + Count + (Item != null && Item.Unit != null ? " " + Item.Unit : "") + ")";
            }
            else if (Count == 1 && Item != null && Item.SingleUnit != null)
            {
                name = name + " (" + Item.SingleUnit + ")";
            }
            else if (Count == 1 && Item != null && Item.Unit != null)
            {
                name = name + "(" + Count + " " + Item.Unit + ")";
            }
            if (Count == 0)
            {
                name = name + " (lost)";
            }
            if (Attuned)
            {
                name = name + " (attuned)";
            }
            if (string.Equals(Equipped, EquipSlot.Armor, StringComparison.InvariantCultureIgnoreCase))
            {
                name = name + " (worn)";
            }
            else if (string.Equals(Equipped, EquipSlot.MainHand, StringComparison.InvariantCultureIgnoreCase))
            {
                name = name + " (main hand)";
            }
            else if (string.Equals(Equipped, EquipSlot.OffHand, StringComparison.InvariantCultureIgnoreCase))
            {
                name = name + " (off hand)";
            }
            else if (!string.Equals(Equipped, EquipSlot.None, StringComparison.InvariantCultureIgnoreCase))
            {
                name = name + " (" + Equipped + ")";
            }
            if (ChargesUsed > 0)
            {
                name = name + " (" + ChargesUsed + " charges used)";
            }
            return(name);
        }