Beispiel #1
0
    public void AddMachinegunAmmo()
    {
        if (guns[GunsConstants.MachinegunGunType()].AmmunitionLeft == GunsConstants.EmptyMagazine() && guns[GunsConstants.MachinegunGunType()].Ammunition == GunsConstants.EmptyMagazine())
        {
            guns[GunsConstants.MachinegunGunType()].Ammunition     = GunsConstants.MachinegunMagazineCapacity();
            guns[GunsConstants.MachinegunGunType()].AmmunitionLeft = GunsConstants.MachineStartAmmunitionLeftQuantity();
        }
        else if (guns[GunsConstants.MachinegunGunType()].Ammunition == GunsConstants.EmptyMagazine())
        {
            guns[GunsConstants.MachinegunGunType()].Ammunition     += GunsConstants.MachinegunMagazineCapacity();
            guns[GunsConstants.MachinegunGunType()].AmmunitionLeft += GunsConstants.MachinegunMagazineCapacity();
        }
        else
        {
            guns[GunsConstants.MachinegunGunType()].AmmunitionLeft += GunsConstants.MachineStartAmmunitionLeftQuantity();
        }

        if (guns[GunsConstants.MachinegunGunType()].Ammunition > GunsConstants.MachinegunMagazineCapacity())
        {
            guns[GunsConstants.MachinegunGunType()].Ammunition = GunsConstants.MachinegunMagazineCapacity();
        }

        if (guns[GunsConstants.MachinegunGunType()].AmmunitionLeft > GunsConstants.MachinegunTotalAmmunitionCapacity())
        {
            guns[GunsConstants.MachinegunGunType()].AmmunitionLeft = GunsConstants.MachinegunTotalAmmunitionCapacity();
        }
    }