Пример #1
0
        public override int CompareTo(WeaponPrimitiveBase other)
        {
            int diff = base.CompareTo(other);

            var otherMeleeWeapon = other as MeleeWeaponPrimitiveBase;

            if (otherMeleeWeapon == null)
            {
                return(diff);
            }

            if (SharpnessId != otherMeleeWeapon.SharpnessId)
            {
                diff++;
            }
            if (Handicraft != otherMeleeWeapon.Handicraft)
            {
                diff++;
            }
            if (Weapon1Id != otherMeleeWeapon.Weapon1Id)
            {
                diff++;
            }
            if (Weapon2Id != otherMeleeWeapon.Weapon2Id)
            {
                diff++;
            }

            return(diff);
        }
Пример #2
0
 private void ProcessRangeWeapons(Reader reader, uint numEntries, WeaponType weaponType)
 {
     for (uint i = 0; i < numEntries; i++)
     {
         WeaponPrimitiveBase weapon = RangeWeaponPrimitiveBase.Read(weaponType, reader);
         TryAddWeapon(weapon);
     }
 }
Пример #3
0
        private void TryAddWeapon(WeaponPrimitiveBase weaponToAdd)
        {
            Dictionary <uint, WeaponPrimitiveBase> weapons = GetOrAddWeaponMap(weaponToAdd.WeaponType);

            if (weapons.ContainsKey(weaponToAdd.Id) == false)
            {
                weapons.Add(weaponToAdd.Id, weaponToAdd);
            }
        }
Пример #4
0
        public static int[] CreateSlotsArray(WeaponPrimitiveBase weapon)
        {
            int[] slots = new int[weapon.GemSlots];

            if (slots.Length > 0)
            {
                slots[0] = weapon.GemSlot1;
                if (slots.Length > 1)
                {
                    slots[1] = weapon.GemSlot2;
                    if (slots.Length > 2)
                    {
                        slots[2] = weapon.GemSlot3;
                    }
                }
            }

            return(slots);
        }
        public override int CompareTo(WeaponPrimitiveBase other)
        {
            int diff = base.CompareTo(other);

            var otherRangeWeapon = other as RangeWeaponPrimitiveBase;

            if (otherRangeWeapon == null)
            {
                return(diff);
            }

            if (MuzzelType != otherRangeWeapon.MuzzelType)
            {
                diff++;
            }
            if (BarrelType != otherRangeWeapon.BarrelType)
            {
                diff++;
            }
            if (MagazineType != otherRangeWeapon.MagazineType)
            {
                diff++;
            }
            if (ScopeType != otherRangeWeapon.ScopeType)
            {
                diff++;
            }
            if (ShellTableId != otherRangeWeapon.ShellTableId)
            {
                diff++;
            }
            if (Deviation != otherRangeWeapon.Deviation)
            {
                diff++;
            }
            if (SpecialAmmoId != otherRangeWeapon.SpecialAmmoId)
            {
                diff++;
            }

            return(diff);
        }