示例#1
0
        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);
        }
示例#2
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));
            }
        }