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); }
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); }
public static int getWeaponCooldown(Weapon weapon) { return(CustomAmmoCategories.getWeaponMode(weapon).Cooldown); }