public static bool IsAnAccessory(EquipSlotKey key) { return key == EquipSlotKey.Ears || key == EquipSlotKey.Neck || key == EquipSlotKey.Wrist || key == EquipSlotKey.Finger; }
public static bool IsAWeapon(EquipSlotKey key) { return key == EquipSlotKey.Mainhand || key == EquipSlotKey.Offhand || key == EquipSlotKey.Twohanded || key == EquipSlotKey.OneHanded; }
public ImcVariant GetVariant(Quad q, EquipSlotKey slotKey) { ImcFile imc = new ImcFile(Realm.Packs.GetFile(GetImcPath(q, slotKey))); int variantPart = SlotOffsetDictionary[slotKey]; int variantKey = IsAWeapon(slotKey) ? q.Value3 : q.Value2; return(imc.Parts.ElementAt(variantPart).Variants[variantKey]); }
public void TestImcPathsAgainstItemSheet() { foreach (Item item in ItemSheet) { EquipSlotKey eq = (EquipSlotKey)item.EquipSlotCategory.Key; if (IsAWeapon(eq) || IsAnEquipment(eq) || IsAnAccessory(eq)) { string path = PathFormatter.Instance.GetImcPath(item.ModelMain, eq); Assert.AreNotEqual(path, "", $"{item} IMC failed"); } } }
private Mesh InitEquipMesh(Tribe t, Sex s, Quad q, EquipSlotKey slotKey) { var path = PathFormatter.Instance.GetEquipmentModelPath(t, s, q, slotKey); ModelFile mf = (ModelFile)Parent.Realm.Packs.GetFile(path); Model model = mf.GetModelDefinition().GetModel(ModelQuality.High); ImcVariant variant = PathFormatter.Instance.GetVariant(q, slotKey); Mesh ret = LoadMeshWithVariant(model, variant); return(ret); }
public static bool IsAnEquipment(EquipSlotKey key) { return key == EquipSlotKey.Head || key == EquipSlotKey.Body || key == EquipSlotKey.Hands || key == EquipSlotKey.Legs || key == EquipSlotKey.Feet || key == EquipSlotKey.BodyNoHead || key == EquipSlotKey.BodyNoHandsLegsFeet || key == EquipSlotKey.LegsNoFeet || key == EquipSlotKey.BodyNoHeadHandsLegsFeet || key == EquipSlotKey.BodyNoHandsLegs || key == EquipSlotKey.BodyNoLegsFeet; }
public string[] GetWeaponSkeletonPath(Quad main, Quad sub, EquipSlotKey slotKey) { string[] ret = new string[2]; ret[0] = ""; ret[1] = ""; ret[0] = string.Format(WeaponSkeleFormat, main.Value1); if (sub.Value1 != 0) { ret[1] = string.Format(WeaponSkeleFormat, sub.Value1); } if (Realm.Packs.FileExists(ret[0])) { return(ret); } return(new[] { "", "" }); }
public string GetImcPath(Quad q, EquipSlotKey slotKey) { string imcPath = ""; if (IsAWeapon(slotKey)) { imcPath = string.Format(WeaponImcFormat, q.Value1, q.Value2); } else if (IsAnEquipment(slotKey)) { imcPath = string.Format(EquipmentImcFormat, q.Value1); } else if (IsAnAccessory(slotKey)) { imcPath = string.Format(AccessoryImcFormat, q.Value1); } return(Realm.Packs.FileExists(imcPath) ? imcPath : ""); }
public string[] GetWeaponModelPath(Quad main, Quad sub, EquipSlotKey slotKey) { string[] paths = new string[2]; string tmp = string.Format(WeaponModelFormat, main.Value1, main.Value2); if (Realm.Packs.FileExists(tmp)) { paths[0] = tmp; } if (sub.Value1 != 0) { tmp = string.Format(WeaponModelFormat, sub.Value1, sub.Value2); if (Realm.Packs.FileExists(tmp)) { paths[1] = tmp; } } return(paths); }
public string GetAccessoryModelPath(short charaCode, Quad q, EquipSlotKey slotKey) { string equipCode = SlotAbbreviationDictionary[(int)slotKey]; string modelPath = string.Format(AccessoryModelFormat, q.Value1, charaCode, equipCode); if (Realm.Packs.FileExists(modelPath)) { return(modelPath); } if (CharaIsChild(charaCode)) { modelPath = string.Format(AccessoryModelFormat, q.Value1, DEFAULT_CHILD_CODE, equipCode); } if (CharaIsMale(charaCode)) { modelPath = string.Format(AccessoryModelFormat, q.Value1, DEFAULT_MALE_CODE, equipCode); } else if (!CharaIsMale(charaCode)) { modelPath = string.Format(AccessoryModelFormat, q.Value1, DEFAULT_FEMALE_CODE, equipCode); if (Realm.Packs.FileExists(modelPath)) { return(modelPath); } modelPath = string.Format(AccessoryModelFormat, q.Value1, DEFAULT_MALE_CODE, equipCode); } if (Realm.Packs.FileExists(modelPath)) { return(modelPath); } return(""); }
public string GetAccessoryModelPath(Tribe t, Sex s, Quad q, EquipSlotKey slotKey) { short charaCode = GetKeyForCharacter(t, s); return(GetAccessoryModelPath(charaCode, q, slotKey)); }