Ejemplo n.º 1
0
    public void LoadSecondaryAmmoType(bool isSilent)
    {
        int wep16index = WeaponFire.Get16WeaponIndexFromConstIndex(weaponIndex);

        // Put bullets into the magazine
        if (WeaponAmmo.a.wepAmmoSecondary[wep16index] >= Const.a.magazinePitchCountForWeapon2[wep16index])
        {
            currentMagazineAmount2[wep16index] = Const.a.magazinePitchCountForWeapon2[wep16index];
        }
        else
        {
            currentMagazineAmount2[wep16index] = WeaponAmmo.a.wepAmmoSecondary[wep16index];
        }

        // Take bullets out of the ammo stockpile
        WeaponAmmo.a.wepAmmoSecondary[wep16index] -= currentMagazineAmount2[wep16index];

        if (!isSilent)
        {
            if (wep16index == 0 || wep16index == 3)
            {
                SFX.PlayOneShot(ReloadInStyleSFX);
            }
            else
            {
                SFX.PlayOneShot(ReloadSFX);
            }
        }

        // Update the counter on the HUD
        MFDManager.a.UpdateHUDAmmoCounts(currentMagazineAmount[wep16index]);
    }
Ejemplo n.º 2
0
 public void SetValue()
 {
     index    = WeaponFire.Get16WeaponIndexFromConstIndex(currentWeapon.weaponIndex);
     ener_min = Const.a.energyDrainLowForWeapon[index];
     ener_max = Const.a.energyDrainHiForWeapon[index];
     val      = slideS.value / 100f;
     val      = (val * (ener_max - ener_min)) + ener_min;
     currentWeapon.weaponEnergySetting[index] = val;
 }
Ejemplo n.º 3
0
    public void Reload()
    {
        int wep16index = WeaponFire.Get16WeaponIndexFromConstIndex(weaponIndex);

        if (weaponIsAlternateAmmo)
        {
            if (currentMagazineAmount2[wep16index] == Const.a.magazinePitchCountForWeapon2[wep16index])
            {
                Const.sprint("Current weapon magazine already full.", owner);
                return;
            }

            if (WeaponAmmo.a.wepAmmoSecondary[wep16index] <= 0)
            {
                Const.sprint("No more of current ammo type to load.", owner);
                return;
            }
            Unload(true);
            LoadSecondaryAmmoType(false);
        }
        else
        {
            if (currentMagazineAmount[wep16index] == Const.a.magazinePitchCountForWeapon[wep16index])
            {
                Const.sprint("Current weapon magazine already full.", owner);
                return;
            }

            if (WeaponAmmo.a.wepAmmo[wep16index] <= 0)
            {
                Const.sprint("No more of current ammo type to load.", owner);
                return;
            }

            Unload(true);
            LoadPrimaryAmmoType(false);
        }
    }
Ejemplo n.º 4
0
    public void Unload(bool isSilent)
    {
        int wep16index = WeaponFire.Get16WeaponIndexFromConstIndex(weaponIndex);

        // Take bullets out of the clip, put them back into the ammo stockpile, then zero out the clip amount, did I say clip?  I mean magazine but whatever
        if (weaponIsAlternateAmmo)
        {
            WeaponAmmo.a.wepAmmoSecondary[wep16index] += currentMagazineAmount2[wep16index];
            currentMagazineAmount2[wep16index]         = 0;
        }
        else
        {
            WeaponAmmo.a.wepAmmo[wep16index] += currentMagazineAmount[wep16index];
            currentMagazineAmount[wep16index] = 0;
        }
        if (!isSilent)
        {
            SFX.PlayOneShot(ReloadSFX);
        }

        // Update the counter on the HUD
        MFDManager.a.UpdateHUDAmmoCounts(currentMagazineAmount[wep16index]);
    }