Esempio n. 1
0
        public void EquipWeapon(Weapon w)
        {
            if (inventory.Contains(w))
            {
                inventory.Remove(w);
                this.weapon = w;

                

                if (w.passiveEffects != null)
                {
                    foreach (var pe in w.passiveEffects)
                    {
                        AddPassiveEffect(pe);
                    }
                }
            }
        }
Esempio n. 2
0
        public void RemoveWeapon(Weapon w)
        {
            if (w != null)
            {
                if (weapon == w)
                {
                    weapon = null;

                    inventory.Add(w);

                    if (w.passiveEffects != null)
                    {
                        foreach (var pe in w.passiveEffects)
                        {
                            RemovePassiveEffect(pe);
                        }
                    }
                }
            }
        }
Esempio n. 3
0
        public static Weapon getWeaponFromWeaponData(WeaponData data, Dictionary<long, AbilityData> abilityDataDictionary, Dictionary<long, EffectData> effectDataDictionary)
        {
            Item i = getItemFromItemData(data, abilityDataDictionary, effectDataDictionary);

            Weapon w = new Weapon()
            {
                actionPoints = data.AP,
                activeEffects = i.activeEffects,
                ID = i.ID,
                maxDamage = data.maxDamage,
                minDamage = data.minDamage,
                name = i.name,
                passiveEffects = i.passiveEffects,
                sheetname = i.sheetname,
                spriteindex = i.spriteindex,
                type = i.type,
                weaponType = data.weaponType,
                price = data.price

            };
          

            return w;
        }