Пример #1
0
 protected ApLegWeaponBase(string name, double burstSeconds, string recognizedName, WeaponAL weaponType) // recognized name is for test purpose
 {
     _recognizedName = recognizedName;
     WeaponType      = weaponType;
     ShotsPerBurst   = ShotsPerSecond * burstSeconds;
     Name            = name;
 }
Пример #2
0
        internal static string GetWeaponName(this WeaponAL weapon)
        {
            var type    = typeof(WeaponAL);
            var memInfo = type.GetMember(weapon.ToString());

            if (memInfo[0].GetCustomAttributes(typeof(WeaponNameAttribute), false).FirstOrDefault() is WeaponNameAttribute attribute)
            {
                return(attribute.Name);
            }

            return("");
        }
Пример #3
0
        public void Add(int _itemid, GameObject _item)
        {
            WeaponInfo info = (WeaponInfo)AllObjectInfos.instance.GetObject(_itemid);
            PosOfBody  pos  = WeaponAL.GetPosOfBody(info.PosOfBody);

            if (WeaponAL.GetWeaponType(info.Type) == ObjectType.Weapon)
            {
                if (pos == PosOfBody.Armor && ArmorSlot.GetComponent <EquipSlot>().ItemID != -1)
                {
                    // 添加物体
                    ArmorSlot.GetComponent <EquipSlot>().Add(_itemid, _item);
                    return;
                }

                if (pos == PosOfBody.Der && Der1Slot.GetComponent <EquipSlot>().ItemID != -1)
                {
                    // 添加物体
                    Der1Slot.GetComponent <EquipSlot>().Add(_itemid, _item);
                    return;
                }

                if (pos == PosOfBody.Der && Der2Slot.GetComponent <EquipSlot>().ItemID != -1)
                {
                    // 添加物体
                    ArmorSlot.GetComponent <EquipSlot>().Add(_itemid, _item);
                    return;
                }

                if (pos == PosOfBody.Head && HeadSlot.GetComponent <EquipSlot>().ItemID != -1)
                {
                    // 添加物体
                    HeadSlot.GetComponent <EquipSlot>().Add(_itemid, _item);
                    return;
                }

                if (pos == PosOfBody.OneHandL && WeaponSlot.GetComponent <EquipSlot>().ItemID != -1)
                {
                    // 添加物体
                    WeaponSlot.GetComponent <EquipSlot>().Add(_itemid, _item);
                    return;
                }

                if (pos == PosOfBody.OneHandR && WeaponSlot.GetComponent <EquipSlot>().ItemID != -1)
                {
                    // 添加物体
                    WeaponSlot.GetComponent <EquipSlot>().Add(_itemid, _item);
                    return;
                }
            }
        }
Пример #4
0
 public static bool HasFlagFast(this WeaponAL value, WeaponAL flag)
 {
     return((value & flag) != 0);
 }
Пример #5
0
 protected override void Start()
 {
     //Debug.Log(ID);
     base.Start();
     type = WeaponAL.GetWeaponType(AllObjectInfos.instance.GetObject(ID).Type);
 }
Пример #6
0
 public NonAdjustableWeapon(string name, double burstSeconds, string recognizedName, WeaponAL type)
     : base(name, burstSeconds, recognizedName, type)
 {
     AdjustmentCoefficient = 0;
 }
 public RegularAdjustmentWeapon(string name, double burstSeconds, string recognizedName, WeaponAL type)
     : base(name, burstSeconds, recognizedName, type)
 {
     if (Name == String.Empty)
     {
         Name = "Default";
     }
 }
Пример #8
0
 protected UniqueLogicWeapon(string name, double burstSeconds, string recognizedName, WeaponAL type)
     : base(name, burstSeconds, recognizedName, type)
 {
 }