Example #1
0
 public static void AddSlot(Weapons.Guns gun, int slot, int slotlength)
 {
     Slots.Add(new Slot()
     {
         Gun        = gun,
         GunSlot    = slot,
         SlotLength = slotlength
     });
 }
Example #2
0
        public static void EquipGun(Weapons.Guns gun)
        {
            if (gun == Guns.Pistol)
            {
                Weapons.Gun = Weapons.Guns.Pistol;

                Weapons.Inventory.AddSlot(Weapons.Guns.Pistol, Weapons.Inventory.SlotsTaken, Weapons.Inventory.Pistol);
                Weapons.Inventory.SlotsHighlightedLength = Weapons.Inventory.Pistol;
                Weapons.Inventory.SlotsHighlighted       = 0;
                Weapons.Inventory.SlotsTaken            += Weapons.Inventory.Pistol;
            }

            if (gun == Guns.AutoPistol)
            {
                Weapons.Gun = Weapons.Guns.AutoPistol;

                Weapons.Inventory.AddSlot(Weapons.Guns.AutoPistol, Weapons.Inventory.SlotsTaken, Weapons.Inventory.AutoPistol);
                Weapons.Inventory.SlotsHighlightedLength = Weapons.Inventory.AutoPistol;
                Weapons.Inventory.SlotsHighlighted       = 0;
                Weapons.Inventory.SlotsTaken            += Weapons.Inventory.AutoPistol;
            }

            if (gun == Guns.SMG)
            {
                Weapons.Gun = Weapons.Guns.SMG;

                Weapons.Inventory.AddSlot(Weapons.Guns.SMG, Weapons.Inventory.SlotsTaken, Weapons.Inventory.SMG);
                Weapons.Inventory.SlotsHighlightedLength = Weapons.Inventory.SMG;
                Weapons.Inventory.SlotsHighlighted       = 0;
                Weapons.Inventory.SlotsTaken            += Weapons.Inventory.SMG;
            }

            if (gun == Guns.Rifle)
            {
                Weapons.Gun = Weapons.Guns.Rifle;

                Weapons.Inventory.AddSlot(Weapons.Guns.Rifle, Weapons.Inventory.SlotsTaken, Weapons.Inventory.Rifle);
                Weapons.Inventory.SlotsHighlightedLength = Weapons.Inventory.Rifle;
                Weapons.Inventory.SlotsHighlighted       = 0;
                Weapons.Inventory.SlotsTaken            += Weapons.Inventory.Rifle;
            }

            if (gun == Guns.Sniper)
            {
                Weapons.Gun = Weapons.Guns.Sniper;

                Weapons.Inventory.AddSlot(Weapons.Guns.Sniper, Weapons.Inventory.SlotsTaken, Weapons.Inventory.Sniper);
                Weapons.Inventory.SlotsHighlightedLength = Weapons.Inventory.Sniper;
                Weapons.Inventory.SlotsHighlighted       = 0;
                Weapons.Inventory.SlotsTaken            += Weapons.Inventory.Sniper;
            }

            if (gun == Guns.Launcher)
            {
                Weapons.Gun = Weapons.Guns.Launcher;

                Weapons.Inventory.AddSlot(Weapons.Guns.Launcher, Weapons.Inventory.SlotsTaken, Weapons.Inventory.Launcher);
                Weapons.Inventory.SlotsHighlightedLength = Weapons.Inventory.Launcher;
                Weapons.Inventory.SlotsHighlighted       = 0;
                Weapons.Inventory.SlotsTaken            += Weapons.Inventory.Launcher;
            }

            if (gun == Guns.MiniGun)
            {
                Weapons.Gun = Weapons.Guns.MiniGun;

                Weapons.Inventory.AddSlot(Weapons.Guns.MiniGun, Weapons.Inventory.SlotsTaken, Weapons.Inventory.MiniGun);
                Weapons.Inventory.SlotsHighlightedLength = Weapons.Inventory.MiniGun;
                Weapons.Inventory.SlotsHighlighted       = 0;
                Weapons.Inventory.SlotsTaken            += Weapons.Inventory.MiniGun;
            }

            if (gun == Guns.LaserGun)
            {
                Weapons.Gun = Weapons.Guns.LaserGun;

                Weapons.Inventory.AddSlot(Weapons.Guns.LaserGun, Weapons.Inventory.SlotsTaken, Weapons.Inventory.LaserCannon);
                Weapons.Inventory.SlotsHighlightedLength = Weapons.Inventory.LaserCannon;
                Weapons.Inventory.SlotsHighlighted       = 0;
                Weapons.Inventory.SlotsTaken            += Weapons.Inventory.LaserCannon;
            }
        }