static public void processProficiencyarmor(CharConverter app, String call, ref XmlNode inChar, ref XmlNode outChar, ref XmlNode targetNode) { var ApiAtributes = app.ParseApiAttributes(call); String featlist = ApiAtributes.ContainsKey("featlist") ? ApiAtributes["featlist"] : "featlist"; XmlNode node = outChar.SelectSingleNode(featlist); XmlNodeList nodelist = node.ChildNodes; XmlNode armorpro = targetNode; for (int i = nodelist.Count - 1; i >= 0; i--) { XmlNode feat = nodelist[i]; String value = app.ValueOf(feat, "value"); XmlNode target = null; if (value.Contains("Armor Proficiency")) { value = value.Split(',')[1].Substring(1); target = armorpro; } else if (value.Contains("Shield Proficiency")) { String[] valuesplit = value.Split(' '); var shsb = new StringBuilder(); foreach (String shvalue in valuesplit) { if (shvalue.Equals("Proficiency")) { break; } shsb.Append(shvalue); shsb.Append(" "); } shsb.Remove(shsb.Length - 1, 1); value = shsb.ToString(); target = armorpro; node.RemoveChild(node.ChildNodes[i]); } if (target != null) { if (app.CheckForDuplicateValue(armorpro, value)) { continue; } target.AppendChild(outChar.OwnerDocument.CreateElement(CharConverter.CreateId(target))); target.LastChild.AppendChild(CharConverter.CreateElement(outChar.OwnerDocument, "value", "string", value)); value = app.ValueOf(feat, "description"); target.LastChild.AppendChild(CharConverter.CreateElement(outChar.OwnerDocument, "description", "string", value)); } } }
static public void processSpecialabilitylist(CharConverter app, String call, ref XmlNode inChar, ref XmlNode outChar, ref XmlNode targetNode) { String value; var ApiAtributes = app.ParseApiAttributes(call); String characterClasses = "classes"; String characterName = "name"; if (ApiAtributes.ContainsKey("classes")) { characterClasses = ApiAtributes["classes"]; } if (ApiAtributes.ContainsKey("name")) { characterName = ApiAtributes["name"]; } foreach (XmlNode classnode in outChar.SelectSingleNode(characterClasses).ChildNodes) { value = app.ValueOf(classnode, "name"); //Checks for speciality if (!value.Equals(ParseClassName(value))) { app.Set(classnode, characterName, ParseClassName(value)); XmlNode spabilitylist = targetNode; XmlNode specialty = outChar.OwnerDocument.CreateElement(CharConverter.CreateId(spabilitylist)); String specialtyname = value; value = "Specialty: " + value; specialty.AppendChild(CharConverter.CreateElement(outChar.OwnerDocument, "value", "string", value)); value = "The specialty for the " + ParseClassName(specialtyname) + "class is " + specialtyname + "."; specialty.AppendChild(CharConverter.CreateElement(outChar.OwnerDocument, "description", "string", value)); if (spabilitylist.ChildNodes.Count > 0) { spabilitylist.InsertBefore(specialty, spabilitylist.ChildNodes[0]); } else { spabilitylist.AppendChild(specialty); } } } }