public LeanMyWorldObject(ExtendedMyWorldObject myWorldObject) { ExtendedMyWorldObject = myWorldObject; EquippableSlots = myWorldObject.EquippableSlots; Coverage = myWorldObject.Coverage; ItemSetId = myWorldObject.IntValues.ContainsKey(265) ? myWorldObject.IntValues[265] : 0; ObjectClass = myWorldObject.ObjectClass; Material = myWorldObject.Material; CalcedStartingArmorLevel = myWorldObject.CalcedStartingArmorLevel; damRating = myWorldObject.DamRating; damResistRating = myWorldObject.DamResistRating; critRating = myWorldObject.CritRating; critResistRating = myWorldObject.CritResistRating; critDamRating = myWorldObject.CritDamRating; critDamResistRating = myWorldObject.CritDamResistRating; healBoostRating = myWorldObject.HealBoostRating; vitalityRating = myWorldObject.VitalityRating; }
public static List <CoverageFlags> ReductionOptions(this CoverageFlags value) { List <CoverageFlags> options = new List <CoverageFlags>(); if (value.GetTotalBitsSet() <= 1 || !value.IsBodyArmor() || value.IsRobe()) { options.Add(value); } else { if (value == (CoverageFlags.UpperArms | CoverageFlags.LowerArms)) { options.Add(CoverageFlags.UpperArms); options.Add(CoverageFlags.LowerArms); } else if (value == (CoverageFlags.UpperLegs | CoverageFlags.LowerLegs)) { options.Add(CoverageFlags.UpperLegs); options.Add(CoverageFlags.LowerLegs); } else if (value == (CoverageFlags.LowerLegs | CoverageFlags.Feet)) { options.Add(CoverageFlags.Feet); } else if (value == (CoverageFlags.Chest | CoverageFlags.Abdomen)) { options.Add(CoverageFlags.Chest); } else if (value == (CoverageFlags.Chest | CoverageFlags.Abdomen | CoverageFlags.UpperArms)) { options.Add(CoverageFlags.Chest); } else if (value == (CoverageFlags.Chest | CoverageFlags.UpperArms | CoverageFlags.LowerArms)) { options.Add(CoverageFlags.Chest); } else if (value == (CoverageFlags.Chest | CoverageFlags.UpperArms)) { options.Add(CoverageFlags.Chest); } else if (value == (CoverageFlags.Abdomen | CoverageFlags.UpperLegs | CoverageFlags.LowerLegs)) { options.Add(CoverageFlags.Abdomen); options.Add(CoverageFlags.UpperLegs); options.Add(CoverageFlags.LowerLegs); } else if (value == (CoverageFlags.Chest | CoverageFlags.Abdomen | CoverageFlags.UpperArms | CoverageFlags.LowerArms)) { options.Add(CoverageFlags.Chest); } else { throw new Exception("Unable to determine reduction paths for CoverageFlags of " + value); } } return(options); }
public static int GetTotalBitsSet(this CoverageFlags value) { int slotFlags = (int)value; int bitsSet = 0; while (slotFlags != 0) { if ((slotFlags & 1) == 1) { bitsSet++; } slotFlags >>= 1; } return(bitsSet); }
public static bool IsPants(this CoverageFlags value) { return(((int)value & 0x00000017) != 0); }
public static bool IsShirt(this CoverageFlags value) { return(((int)value & 0x00000078) != 0); }
public static bool IsUnderwear(this CoverageFlags value) { return(((int)value & 0x0000007F) != 0); }
public static bool IsRobe(this CoverageFlags value) { return((int)value == 0x00013F00); }
public static bool IsBodyArmor(this CoverageFlags value) { return(((int)value & 0x0001FF00) != 0); }
public static List <CoverageFlags> ReductionOptions(this CoverageFlags value) { List <CoverageFlags> options = new List <CoverageFlags>(); if (value.GetTotalBitsSet() <= 1 || !value.IsBodyArmor() || value.IsRobe()) { options.Add(value); } else { if (value == (CoverageFlags.UpperArms | CoverageFlags.LowerArms)) { options.Add(CoverageFlags.UpperArms); options.Add(CoverageFlags.LowerArms); } else if (value == (CoverageFlags.UpperLegs | CoverageFlags.LowerLegs)) { options.Add(CoverageFlags.UpperLegs); options.Add(CoverageFlags.LowerLegs); } else if (value == (CoverageFlags.LowerLegs | CoverageFlags.Feet)) { options.Add(CoverageFlags.Feet); } else if (value == (CoverageFlags.Chest | CoverageFlags.Abdomen)) { options.Add(CoverageFlags.Chest); } else if (value == (CoverageFlags.Chest | CoverageFlags.Abdomen | CoverageFlags.UpperArms)) { options.Add(CoverageFlags.Chest); } else if (value == (CoverageFlags.Chest | CoverageFlags.UpperArms | CoverageFlags.LowerArms)) { options.Add(CoverageFlags.Chest); } else if (value == (CoverageFlags.Chest | CoverageFlags.UpperArms)) { options.Add(CoverageFlags.Chest); } else if (value == (CoverageFlags.Abdomen | CoverageFlags.UpperLegs | CoverageFlags.LowerLegs)) { options.Add(CoverageFlags.Abdomen); options.Add(CoverageFlags.UpperLegs); options.Add(CoverageFlags.LowerLegs); } else if (value == (CoverageFlags.Chest | CoverageFlags.Abdomen | CoverageFlags.UpperArms | CoverageFlags.LowerArms)) { options.Add(CoverageFlags.Chest); } else if (value == (CoverageFlags.Abdomen | CoverageFlags.UpperLegs)) { // This is a emu piece that follows the pre-2010 retail guidelines // https://asheron.fandom.com/wiki/Announcements_-_2010/04_-_Shedding_Skin // For now, we assume only abdomen reduction options.Add(CoverageFlags.Abdomen); } else { throw new Exception("Unable to determine reduction paths for CoverageFlags of " + value); } } return(options); }