private Partner LoadPartnerFromXml(SecurityElement element) { Partner partner = new Partner { PartnerId = StrParser.ParseHexInt(element.Attribute("PartnerId"), 0), RequirePlayerLevel = StrParser.ParseDecInt(element.Attribute("RequirePlayerLevel"), 0), RequireVipLevel = StrParser.ParseDecInt(element.Attribute("RequireVipLevel"), 0), IsOpen = StrParser.ParseBool(element.Attribute("IsOpen"), false), AffectType = TypeNameContainer <PositionConfig._EmBattleType> .Parse(element.Attribute("AffectType"), 0), PartnerPowerPercent = StrParser.ParseFloat(element.Attribute("PartnerPowerPercent"), 0f) }; if (element.Children != null) { foreach (SecurityElement element2 in element.Children) { if (element2.Tag == "Cost") { Cost item = Cost.LoadFromXml(element2); partner.Costs.Add(item); } if (element2.Tag == "Modifier") { PropertyModifier modifier = PropertyModifier.LoadFromXml(element2); partner.Modifiers.Add(modifier); } } } return(partner); }
private Illusion LoadIllusionFromXml(SecurityElement element) { Illusion illusion = new Illusion { Id = StrParser.ParseHexInt(element.Attribute("Id"), 0), ContinueTime = StrParser.ParseDecInt(element.Attribute("ContinueTime"), 0), ModelId = StrParser.ParseHexInt(element.Attribute("ModelId"), 0), GetWay = StrParser.ParseStr(element.Attribute("GetWay"), ""), ModifierSetDesc = StrParser.ParseStr(element.Attribute("ModifierSetDesc"), "", true), SortIndex = StrParser.ParseDecInt(element.Attribute("SortIndex"), 0), IllusionPower = StrParser.ParseFloat(element.Attribute("IllusionPower"), 0f) }; if (element.Children != null) { foreach (SecurityElement element2 in element.Children) { PropertyModifier modifier; string tag = element2.Tag; if (tag != null) { if (tag != "Cost") { if (tag == "PropertyModifier") { goto Label_011E; } if (tag == "DanAttributeId") { goto Label_0133; } } else { illusion.ActivateCost = Cost.LoadFromXml(element2); } } continue; Label_011E: modifier = PropertyModifier.LoadFromXml(element2); illusion.IllusionModifers.Add(modifier); continue; Label_0133: illusion.DanAttributeIds.Add(StrParser.ParseHexInt(element2.Text, 0)); } } return(illusion); }
public static PropertyModifierSet LoadFromXml(SecurityElement element) { PropertyModifierSet set = new PropertyModifierSet { levelFilter = StrParser.ParseDecInt(element.Attribute("LevelFilter"), 0) }; if (element.Children != null) { foreach (SecurityElement element2 in element.Children) { if (element2.Tag == "Modifier") { set.modifiers.Add(PropertyModifier.LoadFromXml(element2)); } } } return(set); }
private EmBattleAttribute LoadAdditionsFromXml(SecurityElement element) { EmBattleAttribute attribute = new EmBattleAttribute { type = TypeNameContainer <PositionConfig._EmBattleType> .Parse(element.Attribute("AffectType"), 0), name = StrParser.ParseStr(element.Attribute("Name"), null), desc = StrParser.ParseStr(element.Attribute("Desc"), null) }; if (element.Children != null) { foreach (SecurityElement element2 in element.Children) { if (element2.Tag == "PropertyModifier") { PropertyModifier item = PropertyModifier.LoadFromXml(element2); attribute.modifiers.Add(item); } } } return(attribute); }
private EmBattleAttribute LoadEmBattleAttributeFromXml(SecurityElement element) { EmBattleAttribute attribute = new EmBattleAttribute { type = TypeNameContainer <_EmBattleType> .Parse(element.Attribute("Type"), 0), desc = StrParser.ParseStr(element.Attribute("Desc"), "", true) }; if (element.Children != null) { foreach (SecurityElement element2 in element.Children) { string str; if (((str = element2.Tag) != null) && (str == "PropertyModifier")) { PropertyModifier item = PropertyModifier.LoadFromXml(element2); attribute.modifiers.Add(item); } } } return(attribute); }