Ejemplo n.º 1
0
        public void EquipArmor(Armor a)
        {

            if (inventory.Contains(a))
            {
                if (equippedArmor.FindAll(x => x.armorType == a.armorType).Count == 0)
                {
                    inventory.Remove(a);
                    equippedArmor.Add(a);
                    if (a.passiveEffects != null)
                    {
                        foreach (var pe in a.passiveEffects)
                        {
                            AddPassiveEffect(pe);
                        }
                    }

                }
            }
        }
Ejemplo n.º 2
0
        public void RemoveArmor(Armor a)
        {
            if (equippedArmor.Contains(a))
            {
                equippedArmor.Remove(a);
                inventory.Add(a);
                if (a.passiveEffects != null)
                {
                    foreach (var pe in a.passiveEffects)
                    {
                        RemovePassiveEffect(pe);
                    }
                }

            }
        }
Ejemplo n.º 3
0
        public static Armor getArmorFromArmorData(ArmorData data, Dictionary<long, AbilityData> abilityDataDictionary, Dictionary<long, EffectData> effectDataDictionary)
        {
            Item i = getItemFromItemData(data, abilityDataDictionary, effectDataDictionary);

            Armor a = new Armor()
            {
                activeEffects = i.activeEffects,
                armor = data.armor,
                armorType = data.armorType,
                ID = i.ID,
                name = i.name,
                passiveEffects = i.passiveEffects,
                sheetname = i.sheetname,
                spriteindex = i.spriteindex,
                type = i.type,
                price = data.price
            };
           
            return a;
        }