示例#1
0
        public static CustomAmmoCategory getWeaponCustomAmmoCategory(Weapon weapon)
        {
            WeaponMode mode = CustomAmmoCategories.getWeaponMode(weapon);

            if (mode.AmmoCategory == null)
            {
                ExtWeaponDef extWeapon = CustomAmmoCategories.getExtWeaponDef(weapon.defId);
                if (extWeapon.AmmoCategory.BaseCategory != weapon.AmmoCategory)
                {
                    return(CustomAmmoCategories.find(weapon.AmmoCategory.ToString()));
                }
                return(extWeapon.AmmoCategory);
            }
            return(mode.AmmoCategory);
        }
示例#2
0
        public static float getWeaponEvasivePipsIgnored(Weapon weapon)
        {
            float result = weapon.weaponDef.EvasivePipsIgnored;

            //CustomAmmoCategoriesLog.Log.LogWrite("getWeaponEvasivePipsIgnored " + weapon.UIName + "\n");
            if (CustomAmmoCategories.checkExistance(weapon.StatCollection, CustomAmmoCategories.AmmoIdStatName) == true)
            {
                string           ammoId  = weapon.StatCollection.GetStatistic(CustomAmmoCategories.AmmoIdStatName).Value <string>();
                ExtAmmunitionDef extAmmo = CustomAmmoCategories.findExtAmmo(ammoId);
                result += extAmmo.EvasivePipsIgnored;
            }
            if (CustomAmmoCategories.checkExistance(weapon.StatCollection, CustomAmmoCategories.WeaponModeStatisticName) == true)
            {
                result += CustomAmmoCategories.getWeaponMode(weapon).EvasivePipsIgnored;
            }
            //CustomAmmoCategoriesLog.Log.LogWrite("  modified EvasivePipsIgnored\n");
            return(result);
        }
示例#3
0
 public static int getWeaponCooldown(Weapon weapon)
 {
     return(CustomAmmoCategories.getWeaponMode(weapon).Cooldown);
 }