private Animation LoadAnimationFromXml(SecurityElement element) { Animation animation = new Animation { name = StrParser.ParseStr(element.Attribute("Name"), ""), assetName = StrParser.ParseStr(element.Attribute("AssetName"), ""), startFrame = StrParser.ParseDecInt(element.Attribute("StartFrame"), 0), endFrame = StrParser.ParseDecInt(element.Attribute("EndFrame"), 0), moveStartFrame = StrParser.ParseDecInt(element.Attribute("MoveStartFrame"), 0), moveEndFrame = StrParser.ParseDecInt(element.Attribute("MoveEndFrame"), 0), speed = StrParser.ParseFloat(element.Attribute("Speed"), 1f) }; if (element.Children != null) { foreach (SecurityElement element2 in element.Children) { if (element2.Tag == "Event") { Event item = new Event { id = StrParser.ParseDecInt(element2.Attribute("Id"), 0), keyFrame = StrParser.ParseDecInt(element2.Attribute("KeyFrame"), 0) }; animation.events.Add(item); } } } return(animation); }
public static RewardGroup LoadXml(SecurityElement element) { RewardGroup group = new RewardGroup { possibility = StrParser.ParseFloat(element.Attribute("Possibility"), 1f), rewardGroupId = StrParser.ParseHexInt(element.Attribute("Id"), 0) }; if (element.Children != null) { foreach (SecurityElement element2 in element.Children) { string tag = element2.Tag; if (tag != null) { if (tag == "RewardTypeCount") { group.rewardTypeCounts.Add(RewardTypeCount.LoadFromXml(element2)); } else if (tag == "Reward") { goto Label_0096; } } continue; Label_0096: group.rewards.Add(Reward.LoadFromXml(element2)); } } return(group); }
public static rect LoadFromXml(string value) { if (string.IsNullOrEmpty(value)) { return(null); } float num = 0f; float num2 = 0f; float num3 = 1f; float num4 = 1f; string[] strArray = value.Split(StrParser.splitter); if (strArray.Length >= 4) { num = StrParser.ParseFloat(strArray[0], 0f); num2 = StrParser.ParseFloat(strArray[1], 0f); num3 = StrParser.ParseFloat(strArray[2], 1f); num4 = StrParser.ParseFloat(strArray[3], 1f); } if (((num == 0f) && (num2 == 0f)) && ((num3 == 1f) && (num4 == 1f))) { return(null); } return(new rect { _x = num, _y = num2, _xMax = num3, _yMax = num4 }); }
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); }
public static PowerAttribute LoadFromXml(SecurityElement element) { return(new PowerAttribute { baseValue = StrParser.ParseFloat(element.Attribute("Base"), 0f), deltaValue = StrParser.ParseFloat(element.Attribute("Delta"), 0f) }); }
public AvatarAction.Effect LoadEffectFromXml(SecurityElement element) { AvatarAction.Effect effect = new AvatarAction.Effect(); effect.type = TypeNameContainer <AvatarAction.Effect._Type> .Parse(element.Attribute("Type"), effect.type); effect.isGetHitFX = StrParser.ParseBool(element.Attribute("IsGetHitFX"), effect.isGetHitFX); effect.pfx_PlayOnTarget = StrParser.ParseBool(element.Attribute("PlayOnTarget"), effect.pfx_PlayOnTarget); effect.pfx_PlayTargetType = TypeNameContainer <AvatarAction.Effect._PlayTargetType> .Parse(element.Attribute("PlayTargetType"), effect.pfx_PlayTargetType); effect.pfx_Model = StrParser.ParseStr(element.Attribute("Model"), effect.pfx_Model); effect.pfx_ModelBone = StrParser.ParseStr(element.Attribute("ModelBone"), effect.pfx_ModelBone); effect.pfx_Bone = StrParser.ParseStr(element.Attribute("Bone"), effect.pfx_Bone); effect.pfx_Offset = vector3.LoadFromXml(element.Attribute("Offset")); effect.pfx_Rotate = vector3.LoadFromXml(element.Attribute("Rotate")); effect.pfx_BoneFollow = StrParser.ParseBool(element.Attribute("BoneFollow"), effect.pfx_BoneFollow); effect.pfx_Curve = StrParser.ParseStr(element.Attribute("Curve"), effect.pfx_Curve); effect.pfx_Curve_Miss = StrParser.ParseStr(element.Attribute("Curve_Miss"), effect.pfx_Curve_Miss); effect.pfx_CurveToTarget = StrParser.ParseBool(element.Attribute("CurveToTarget"), effect.pfx_CurveToTarget); effect.pfx_CurveTargetBone = StrParser.ParseStr(element.Attribute("CurveTargetBone"), effect.pfx_CurveTargetBone); effect.pfx_CurveTargetOffset = vector3.LoadFromXml(element.Attribute("CurveTargetOffset")); effect.pfx_CurveSpeed = StrParser.ParseFloat(element.Attribute("CurveSpeed"), 1f); effect.pfx_CurveTranslateSpeed = StrParser.ParseFloat(element.Attribute("CurveTranslateSpeed"), 1f); effect.pfx_DestroyType = TypeNameContainer <AvatarAction.Effect._DestroyType> .Parse(element.Attribute("DestroyType"), effect.pfx_DestroyType); effect.sfx_Sound = StrParser.ParseStr(element.Attribute("Sound"), effect.sfx_Sound); effect.sfx_Loop = StrParser.ParseBool(element.Attribute("Loop"), effect.sfx_Loop); effect.sfx_Volume = StrParser.ParseFloat(element.Attribute("Volume"), 0f); effect.cfx_Intensity = StrParser.ParseFloat(element.Attribute("Intensity"), 0f); effect.cfx_Duration = StrParser.ParseFloat(element.Attribute("Duration"), 0f); effect.cfx_Interval = StrParser.ParseFloat(element.Attribute("Interval"), 0f); effect.tfx_Scale = StrParser.ParseFloat(element.Attribute("Scale"), 0f); effect.tfx_Duration = StrParser.ParseFloat(element.Attribute("Duration"), 0f); return(effect); }
public static PropertyModifier LoadFromXml(SecurityElement element) { PropertyModifier modifier = new PropertyModifier(); modifier._type = TypeNameContainer <_Type> .Parse(element.Attribute("Type"), modifier.type); modifier._modifyType = TypeNameContainer <_ValueModifyType> .Parse(element.Attribute("ModifyType"), modifier.modifyType); modifier._buffType = TypeNameContainer <ClientServerCommon.Buff._BuffType> .Parse(element.Attribute("BuffType"), 1); switch (modifier.type) { case 1: modifier._attributeType = TypeNameContainer <_AvatarAttributeType> .Parse(element.Attribute("AttributeType"), modifier.attributeType); modifier._attributeValue = StrParser.ParseFloat(element.Attribute("Value"), 0f); modifier._attributeIncrease = StrParser.ParseFloat(element.Attribute("Increase"), 0f); return(modifier); case 2: modifier._color = ClientServerCommon.color.LoadFromXml(element.Attribute("Color")); return(modifier); case 3: modifier._abilityType = TypeNameContainer <_AvatarAbilityType> .Parse(element.Attribute("AbilityType"), modifier._abilityType); if (modifier._abilityType == 1) { modifier._abilityValue = TypeNameContainer <ClientServerCommon.Buff._BuffType> .ParseBitList(element.Attribute("AbilityValue"), 0); } return(modifier); } modifier._attributeValue = StrParser.ParseFloat(element.Attribute("Value"), 0f); return(modifier); }
public static IncreaseFloat LoadFromXml(SecurityElement element) { return(new IncreaseFloat { _value = StrParser.ParseFloat(element.Attribute("Value"), 0f), _fromStep = StrParser.ParseDecInt(element.Attribute("FromStep"), 0), _increase = StrParser.ParseFloat(element.Attribute("Increase"), 0f) }); }
public static SpecialSkill LoadFromXml(SecurityElement element) { return(new SpecialSkill { skillId = StrParser.ParseHexInt(element.Attribute("Id"), 0), type = TypeNameContainer <SpecialSkillType> .Parse(element.Attribute("Type"), 0), rate = StrParser.ParseFloat(element.Attribute("Rate"), 0f) }); }
public static GrowthAttribute LoadFromXml(SecurityElement element) { return(new GrowthAttribute { type = TypeNameContainer <_AvatarAttributeType> .Parse(element.Attribute("Type"), 0), baseValue = StrParser.ParseFloat(element.Attribute("Base"), 0f), deltaValue = StrParser.ParseFloat(element.Attribute("Delta"), 0f) }); }
private DomineerLevel LoadDomineerLevelFromXml(SecurityElement element) { return(new DomineerLevel { Level = StrParser.ParseDecInt(element.Attribute("Level"), 0), Desc = StrParser.ParseStr(element.Attribute("Desc"), string.Empty), DomineerPower = StrParser.ParseFloat(element.Attribute("DomineerPower"), 0f) }); }
public static RewardTypeCount LoadFromXml(SecurityElement element) { RewardTypeCount count = new RewardTypeCount { possibility = StrParser.ParseFloat(element.Attribute("Possibility"), 1f) }; count.count = StrParser.ParseDecInt(element.Attribute("Count"), count.count); return(count); }
public static ClientServerCommon.Npc LoadNpcFromXml(SecurityElement element) { return(new ClientServerCommon.Npc { npcId = StrParser.ParseHexInt(element.Attribute("Id"), 0), npcType = TypeNameContainer <_NpcType> .Parse(element.Attribute("NpcType"), 1), scale = StrParser.ParseFloat(element.Attribute("Scale"), 1f), battlePosition = SceneConfig.ComposeBattlePosition(StrParser.ParseDecInt(element.Attribute("BattleRow"), 0), StrParser.ParseDecInt(element.Attribute("BattleColumn"), 0)), talentId = StrParser.ParseHexInt(element.Attribute("TalentId"), 0) }); }
private AssembleSetting.Assemble LoadSuiteAssembleFromXml(SecurityElement element) { return(new AssembleSetting.Assemble { RequiredCount = StrParser.ParseDecInt(element.Attribute("RequiredCount"), 0), AssembleEffectDesc = StrParser.ParseStr(element.Attribute("AssembleEffectDesc"), string.Empty, true), ModifierSet = PropertyModifierSet.LoadFromXml(element.SearchForChildByTag("ModifierSet")), AssemblePower = StrParser.ParseDecInt(element.Attribute("AssemblePower"), 0), AssemblePowerPercent = StrParser.ParseFloat(element.Attribute("AssemblePowerPercent"), 0f) }); }
private Npc LoadNpcFromXml(SecurityElement element) { Npc npc = new Npc { id = StrParser.ParseHexInt(element.Attribute("Id"), 0), level = StrParser.ParseDecInt(element.Attribute("Level"), 1), avatarId = StrParser.ParseHexInt(element.Attribute("AvatarId"), 0), breakthroughLevel = StrParser.ParseDecInt(element.Attribute("BreakthroughLevel"), 0), name = StrParser.ParseStr(element.Attribute("Name"), "NPCNAME") }; npc.evaluation = StrParser.ParseDecInt(element.Attribute("Evaluation"), npc.evaluation); npc.avatarDefaultSkillId = StrParser.ParseHexInt(element.Attribute("AvatarDefaultSkillId"), npc.avatarDefaultSkillId); npc.avatarDefaultSkillLevel = StrParser.ParseDecInt(element.Attribute("AvatarDefaultSkillLevel"), npc.avatarDefaultSkillLevel); npc.breakthroughLevel = StrParser.ParseDecInt(element.Attribute("BreakthroughLevel"), 0); npc.scale = StrParser.ParseFloat(element.Attribute("Scale"), 0f); if (element.Children != null) { foreach (SecurityElement element2 in element.Children) { string tag = element2.Tag; if (tag != null) { if (tag != "Equipment") { if (tag == "Attribute") { goto Label_017F; } if (tag == "Skill") { goto Label_0192; } if (tag == "ModifierSet") { goto Label_01A6; } } else { npc.equipments.Add(this.LoadEquipmentFromXml(element2)); } } continue; Label_017F: npc.attribs.Add(ClientServerCommon.Attribute.LoadFromXml(element2)); continue; Label_0192: npc.skills.Add(this.LoadSkillFromXml(element2)); continue; Label_01A6: npc.modifierSet = PropertyModifierSet.LoadFromXml(element2); } } return(npc); }
public static Reward LoadFromXml(SecurityElement element) { return(new Reward { id = StrParser.ParseHexInt(element.Attribute("Id"), 0), level = StrParser.ParseDecInt(element.Attribute("Level"), 1), breakthoughtLevel = StrParser.ParseDecInt(element.Attribute("BreakthoughtLevel"), 0), count = StrParser.ParseDecInt(element.Attribute("Count"), 0), increase = StrParser.ParseDecInt(element.Attribute("Increase"), 0), possibility = StrParser.ParseFloat(element.Attribute("Possibility"), 1f), attributeAlgorithmId = StrParser.ParseHexInt(element.Attribute("AttributeAlgorithmId"), 0) }); }
private Stage LoadStageFromXml(SecurityElement element) { Stage stage = new Stage { StageId = StrParser.ParseHexInt(element.Attribute("StageId"), 0), StageName = StrParser.ParseStr(element.Attribute("StageName"), ""), StageSequence = StrParser.ParseDecInt(element.Attribute("StageSequence"), 0), IsUseRobot = StrParser.ParseBool(element.Attribute("IsUseRobot"), false), EnemyRecoverHp = StrParser.ParseFloat(element.Attribute("EnemyRecoverHp"), 0f), RobotName = StrParser.ParseStr(element.Attribute("RobotName"), "") }; if (element.Children != null) { foreach (SecurityElement element2 in element.Children) { string tag = element2.Tag; if (tag != null) { if (tag == "PassRewards") { if (element2.Children != null) { foreach (SecurityElement element3 in element2.Children) { Reward item = Reward.LoadFromXml(element3); stage.PassRewards.Add(item); } } } else if (tag == "FirstPassRewards") { goto Label_014F; } } continue; Label_014F: if (element2.Children != null) { foreach (SecurityElement element4 in element2.Children) { Reward reward2 = Reward.LoadFromXml(element4); stage.FirstPassRewards.Add(reward2); } } } } return(stage); }
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 CombatTurn LoadCombatTurnFromXml(SecurityElement element) { if (element.Tag != "CombatTurn") { return(null); } CombatTurn turn = new CombatTurn(); turn.id = StrParser.ParseHexInt(element.Attribute("Id"), turn.id); turn.type = TypeNameContainer <CombatTurn._Type> .Parse(element.Attribute("Type"), turn.type); turn.costSkillPower = StrParser.ParseDecInt(element.Attribute("CostSkillPower"), turn.costSkillPower); turn.castRate = StrParser.ParseFloat(element.Attribute("CastRate"), turn.castRate); if (element.Children != null) { foreach (SecurityElement element2 in element.Children) { CombatTurn.Stage stage; string tag = element2.Tag; if (tag != null) { if (tag == "TestType") { int num = TypeNameContainer <CombatTurn._TestType> .Parse(element2.Text, 0); if (num != 0) { turn.testType |= num; } } else if (tag == "Stage") { goto Label_00FA; } } continue; Label_00FA: stage = this.LoadStageFromXml(element2, turn.id); if (stage != null) { turn.stages.Add(stage); } } } return(turn); }
public static vector2 LoadFromXml(string value) { vector2 vector = new vector2 { _x = 0f, _y = 0f }; if (value != null) { string[] strArray = value.Split(StrParser.splitter); if (strArray.Length >= 2) { vector._x = StrParser.ParseFloat(strArray[0], 0f); vector._y = StrParser.ParseFloat(strArray[1], 0f); } } return(vector); }
public static color LoadFromXml(string value) { color color = new color { _a = 1f, _r = 1f, _g = 1f, _b = 1f }; if (value != null) { string[] strArray = value.Split(StrParser.splitter); if (strArray.Length >= 4) { color._r = StrParser.ParseFloat(strArray[0], 1f); color._g = StrParser.ParseFloat(strArray[1], 1f); color._b = StrParser.ParseFloat(strArray[2], 1f); color._a = StrParser.ParseFloat(strArray[3], 1f); } } return(color); }
private void LoadFriendCombatInfoFromXml(SecurityElement element) { FriendCombatInfo info = new FriendCombatInfo { MaxGetCombatRewardCount = StrParser.ParseDecInt(element.Attribute("MaxGetCombatRewardCount"), 0), GetCombatRewardPercent = StrParser.ParseFloat(element.Attribute("GetCombatRewardPercent"), 0f), MaxCombatRound = StrParser.ParseDecInt(element.Attribute("MaxCombatRound"), 0), MaxRoundWhoWin = TypeNameContainer <ClientServerCommon._CampType> .Parse(element.Attribute("MaxRoundWhoWin"), 0), SenceId = StrParser.ParseHexInt(element.Attribute("SenceId"), 0) }; if (element.Children != null) { foreach (SecurityElement element2 in element.Children) { string str; if (((str = element2.Tag) != null) && (str == "FriendCombatReward")) { info.FriendCombatRewards.Add(this.LoadFriendCombatRewardFromXml(element2)); } } } this._friendCombat = info; }
private Meridian LoadMeridianFromXml(SecurityElement element) { Meridian meridian = new Meridian { id = StrParser.ParseHexInt(element.Attribute("Id"), 0), name = StrParser.ParseStr(element.Attribute("Name"), ""), level = StrParser.ParseDecInt(element.Attribute("Level"), 1), preMeridianId = StrParser.ParseHexInt(element.Attribute("PreMeridianId"), 0), buffAddition = StrParser.ParseFloat(element.Attribute("BuffAddition"), 0f) }; if (element.Children != null) { foreach (SecurityElement element2 in element.Children) { MeridianBuff buff; string tag = element2.Tag; if (tag != null) { if (tag == "IncreaseCost") { meridian.increaseCosts.Add(IncreaseCost.LoadFromXml(element2)); } else if (tag == "Buff") { goto Label_00E5; } } continue; Label_00E5: buff = new MeridianBuff(); buff.id = StrParser.ParseHexInt(element2.Attribute("BuffId"), 0); buff.weight = StrParser.ParseDecInt(element2.Attribute("Weight"), 1); meridian.meridianBuffs.Add(buff); } } return(meridian); }
private Buff LoadBuffFromXml(SecurityElement element) { Buff buff = new Buff { id = StrParser.ParseHexInt(element.Attribute("Id"), 0), meridianPowerPercent = StrParser.ParseFloat(element.Attribute("MeridianPowerPercent"), 0f) }; if (element.Children != null) { foreach (SecurityElement element2 in element.Children) { string str; if (((str = element2.Tag) != null) && (str == "ModifierSet")) { PropertyModifierSet set = PropertyModifierSet.LoadFromXml(element2); if (buff.modifierSet == null) { buff.modifierSet = set; } } } } return(buff); }
public AvatarAction.Event LoadEventFromXml(SecurityElement element, int eventIdx, int sourceTurnID) { AvatarAction.Event event2 = new AvatarAction.Event { sourceTurnId = sourceTurnID, index = eventIdx }; event2.keyFrameId = StrParser.ParseDecInt(element.Attribute("KeyFrameId"), event2.keyFrameId); event2.eventType = TypeNameContainer <AvatarAction.Event._Type> .Parse(element.Attribute("Type"), 0); event2.delay = StrParser.ParseFloat(element.Attribute("Delay"), 0f); event2.loop = StrParser.ParseBool(element.Attribute("Loop"), event2.loop); event2.playOnAllTarget = StrParser.ParseBool(element.Attribute("PlayOnAllTarget"), event2.playOnAllTarget); event2.weaponId = StrParser.ParseHexInt(element.Attribute("WeaponId"), 0); event2.boneName = StrParser.ParseStr(element.Attribute("BoneName"), ""); event2.buffType = TypeNameContainer <ClientServerCommon.Buff._BuffType> .ParseBitList(element.Attribute("BuffType"), 0); event2.modifyType = TypeNameContainer <PropertyModifier._ValueModifyType> .Parse(element.Attribute("ModifyType"), 2); if (element.Children != null) { foreach (SecurityElement element2 in element.Children) { int num; string tag = element2.Tag; if (tag != null) { if (tag != "Effect") { if (tag == "Buff") { goto Label_017E; } if (tag == "ModifierSet") { goto Label_0193; } if (tag == "TestType") { goto Label_01A6; } } else { event2.effects.Add(this.LoadEffectFromXml(element2)); } } continue; Label_017E: this.buffs.Add(this.LoadBuffFromXml(element2, sourceTurnID)); continue; Label_0193: event2.modifierSets.Add(PropertyModifierSet.LoadFromXml(element2)); continue; Label_01A6: num = TypeNameContainer <CombatTurn._TestType> .Parse(element2.Text, 0); if (num != 0) { event2.testType |= num; } } } event2.buffId = StrParser.ParseHexInt(element.Attribute("BuffId"), 0); return(event2); }