public static short GetClipSize(this ItemSpec item) { var prop = item.GetProperty(ItemSpecPropertyEnum.ClipSize); if (prop == null) { return(0); } return(item.GetProperty(ItemSpecPropertyEnum.ClipSize).ShortValue); }
public static WeaponTypes?GetWeaponType(this ItemSpec item) { var prop = item.GetProperty(ItemSpecPropertyEnum.WeaponType); if (prop == null) { return(null); } return((WeaponTypes)prop.ShortValue); }
/****/ public static byte GetResourceAmount(this ItemSpec item) { var prop = item.GetProperty(ItemSpecPropertyEnum.ResourceAmount); if (prop == null) { return(0); } return(prop.ByteValue); }
/****/ public static short GetBaseUsageTime(this ItemSpec item) { var prop = item.GetProperty(ItemSpecPropertyEnum.BaseUsageTime); if (prop == null) { return(-1); } return(prop.ShortValue); }
/**/ public static short GetStartReloadTime(this ItemSpec item) { return(item.GetProperty(ItemSpecPropertyEnum.StartReloadTime).ShortValue); } public static void SetStartReloadTime(this ItemSpec item, short value) { item.SetProperty(new ItemSpecProperty(ItemSpecPropertyEnum.StartReloadTime, value)); } public static short GetReloadTime(this ItemSpec item) { return(item.GetProperty(ItemSpecPropertyEnum.ReloadTime).ShortValue); } public static void SetReloadTime(this ItemSpec item, short value) { item.SetProperty(new ItemSpecProperty(ItemSpecPropertyEnum.ReloadTime, value)); } public static short GetStopReloadTime(this ItemSpec item) { return(item.GetProperty(ItemSpecPropertyEnum.StopReloadTime).ShortValue); } public static void SetStopReloadTime(this ItemSpec item, short value) { item.SetProperty(new ItemSpecProperty(ItemSpecPropertyEnum.StopReloadTime, value)); } /****/ public static uint GetWeaponDelay(this ItemSpec item) { var prop = item.GetProperty(ItemSpecPropertyEnum.UsageDelay); if (prop == null) { return(0); } return((uint)prop.IntValue); }
/****/ public static ResourceType GetResourceType(this ItemSpec item) { var prop = item.GetProperty(ItemSpecPropertyEnum.ResouceType); if (prop == null) { return(ResourceType.None); } return((ResourceType)prop.ShortValue); }
public static AmmoType?GetAmmoType(this ItemSpec item) { var prop = item.GetProperty(ItemSpecPropertyEnum.AmmoType); if (prop == null) { return(null); } return((AmmoType)prop.ShortValue); }
/****/ public static float GetWeaponNoiseDistance(this ItemSpec item) { var prop = item.GetProperty(ItemSpecPropertyEnum.NoiseRange); if (prop == null) { return(0); } return(prop.FloatValue); }
/****/ public static short GetHealAmount(this ItemSpec item) { var prop = item.GetProperty(ItemSpecPropertyEnum.HealAmount); if (prop == null) { return(0); } return(prop.ShortValue); }
public static bool CanBeWornOnLocation(this ItemSpec item, ArmourWearLocation target) { var prop = item.GetProperty(ItemSpecPropertyEnum.ArmourType); if (prop == null) { return(false); } return((prop.ShortValue & (short)target) != 0); }
/****/ public static void AddArmourType(this ItemSpec item, ArmourWearLocation type) { var prop = item.GetProperty(ItemSpecPropertyEnum.ArmourType); if (prop == null) { item.SetProperty(new ItemSpecProperty(ItemSpecPropertyEnum.ArmourType, (short)type)); } else { var value = prop.ShortValue | (short)type; item.SetProperty(new ItemSpecProperty(ItemSpecPropertyEnum.ArmourType, value)); } }
/****/ public static void SetDefenceMultiplier(this ItemSpec item, DamageTypeEnum damageType, float value) { var prop = item.GetProperty(ItemSpecPropertyEnum.DefenceValues); Dictionary <DamageTypeEnum, float> map; if (prop == null) { map = new Dictionary <DamageTypeEnum, float>(); } else { map = (Dictionary <DamageTypeEnum, float>)(prop.ObjectValue); } map[damageType] = value; item.SetDefenceMultipliers(map); }
public static float GetDefenceMultiplier(this ItemSpec item, DamageTypeEnum damageType) { var prop = item.GetProperty(ItemSpecPropertyEnum.DefenceValues); if (prop == null) { return(0); } var map = (Dictionary <DamageTypeEnum, float>)(prop.ObjectValue); if (!map.ContainsKey(damageType)) { return(0); } return(map[damageType]); }
/****/ public static float GetBulletSpread(this ItemSpec item) { return(item.GetProperty(ItemSpecPropertyEnum.BulletSpread).FloatValue); }
public static DamageTypeEnum GetDamageType(this ItemSpec item) { return((DamageTypeEnum)(item.GetProperty(ItemSpecPropertyEnum.DamageType).ShortValue)); }
/**/ public static byte GetStackMax(this ItemSpec item) { return(item.GetProperty(ItemSpecPropertyEnum.StackMax).ByteValue); } public static void SetStackMax(this ItemSpec item, byte value) { var spec = new ItemSpecProperty((short)ItemSpecPropertyEnum.StackMax, value); item.SetProperty(spec); } /**/ public static short GetDurabilityMax(this ItemSpec item) { return(item.GetProperty(ItemSpecPropertyEnum.DurabilityMax).ShortValue); }
/**/ public static string GetImageName(this ItemSpec item) { return(item.GetProperty(ItemSpecPropertyEnum.ImageName).StringValue); } public static void SetImageName(this ItemSpec item, string value) { var spec = new ItemSpecProperty((short)ItemSpecPropertyEnum.ImageName, value); item.SetProperty(spec); } /**/ public static int GetCost(this ItemSpec item) { return(item.GetProperty(ItemSpecPropertyEnum.Cost).IntValue); }
public static short GetReloadClipSize(this ItemSpec item) { return(item.GetProperty(ItemSpecPropertyEnum.ReloadClipSize).ShortValue); }
/****/ public static bool IsWeapon(this ItemSpec item) { return(item.GetProperty(ItemSpecPropertyEnum.WeaponType) != null); }
/****/ public static float GetMeleeRange(this ItemSpec item) { return(item.GetProperty(ItemSpecPropertyEnum.MeleeRange).FloatValue); }
public static string GetDescription(this ItemSpec item) { return(item.GetProperty(ItemSpecPropertyEnum.Description).StringValue); }
public static float GetDamageMax(this ItemSpec item) { return(item.GetProperty(ItemSpecPropertyEnum.DamageMax).FloatValue); }
public static bool HasDurability(this ItemSpec item) { return(item.GetProperty(ItemSpecPropertyEnum.DurabilityMax) != null); }
/**/ public static string GetName(this ItemSpec item) { return(item.GetProperty(ItemSpecPropertyEnum.Name).StringValue); } public static void SetName(this ItemSpec item, string value) { var spec = new ItemSpecProperty((short)ItemSpecPropertyEnum.Name, value); item.SetProperty(spec); } /**/ public static string GetModelName(this ItemSpec item) { return(item.GetProperty(ItemSpecPropertyEnum.ModelName).StringValue); }