/** * @brief 提取数据 * * @param node * * @return */ public bool CollectDataFromDBC(DBC_Row node) { ImpactId = DBCUtil.ExtractNumeric <int>(node, "Id", -1, true); ImpactLogicId = DBCUtil.ExtractNumeric <int>(node, "LogicId", -1, true); ImpactDescription = DBCUtil.ExtractString(node, "Description", "", false); ImpactType = DBCUtil.ExtractNumeric <int>(node, "ImpactType", -1, true); ImpactTime = DBCUtil.ExtractNumeric <int>(node, "ImpactTime", -1, true); BuffDataId = DBCUtil.ExtractNumeric <int>(node, "BuffDataId", -1, false); MaxRank = DBCUtil.ExtractNumeric <int>(node, "MaxRank", -1, false); Effect = DBCUtil.ExtractString(node, "Effect", "", false); ActionId = DBCUtil.ExtractNumeric <int>(node, "ActionId", -1, false); IsDeadDisappear = DBCUtil.ExtractBool(node, "IsDeadDisappear", false, false); CanBeCancel = DBCUtil.ExtractBool(node, "CanBeCancel", false, false); IsAbsorbHurt = DBCUtil.ExtractBool(node, "IsAbsorbHurt", false, false); IsReflect = DBCUtil.ExtractBool(node, "IsReflect", false, false); IsDamageDisappear = DBCUtil.ExtractBool(node, "IsDamageDisappear", false, false); IsFightDisappear = DBCUtil.ExtractBool(node, "IsFightDisappear", false, false); IsShootDisappear = DBCUtil.ExtractBool(node, "IsShootDisappear", false, false); IsSkillDisappear = DBCUtil.ExtractBool(node, "IsSkillDisappear", false, false); ParamNum = DBCUtil.ExtractNumeric <int>(node, "ParamNum", 0, false); ExtraParams.Clear(); if (ParamNum > 0) { for (int i = 0; i < ParamNum; ++i) { string key = "Param" + i.ToString(); ExtraParams.Insert(i, DBCUtil.ExtractString(node, key, "", false)); } } return(true); }
/** * @brief 提取数据 * * @param node * * @return */ public bool CollectDataFromDBC(DBC_Row node) { m_Id = DBCUtil.ExtractNumeric <int>(node, "Id", 0, true); m_LinkId = DBCUtil.ExtractNumeric <int>(node, "LinkId", 0, true); m_CampId = DBCUtil.ExtractNumeric <int>(node, "CampId", 0, true); m_Pos = Converter.ConvertVector3D(DBCUtil.ExtractString(node, "Pos", "0.0,0.0,0.0", true)); m_RotAngle = DBCUtil.ExtractNumeric <float>(node, "RotAngle", 0.0f, true) * (float)Math.PI / 180; m_IsEnable = DBCUtil.ExtractBool(node, "IsEnable", false, true); m_AiLogic = DBCUtil.ExtractNumeric <int>(node, "AiLogic", 0, false); for (int i = 0; i < c_MaxAiParamNum; ++i) { m_AiParam[i] = DBCUtil.ExtractString(node, "AiParam" + i, "", false); } return(true); }
/** * @brief 提取数据 * * @param node * * @return */ public bool CollectDataFromDBC(DBC_Row node) { ActionId = DBCUtil.ExtractNumeric <int>(node, "Id", 0, true); ActionLogicId = DBCUtil.ExtractNumeric <int>(node, "LogicId", 0, true); BreakLevel = DBCUtil.ExtractNumeric <int>(node, "BreakLevel", 0, true); CallbackSection = DBCUtil.ExtractNumeric <int>(node, "CallbackSection", 0, true); CallbackPoint = DBCUtil.ExtractNumeric <float>(node, "CallbackPoint", 0, true); SectionNumber = DBCUtil.ExtractNumeric <int>(node, "SectionNum", 0, true); EffectNum = DBCUtil.ExtractNumeric <int>(node, "EffectNum", 0, true); EffectList.Clear(); for (int i = 0; i < EffectNum; i++) { string keySuffix = i.ToString(); ActionEffectInfo effect_info = new ActionEffectInfo(); effect_info.EffectTime = DBCUtil.ExtractNumeric <float>(node, "EffectTime" + keySuffix, 0, false); effect_info.SkeletonNodeName = DBCUtil.ExtractString(node, "SkeletonNodeName" + keySuffix, "", false); effect_info.EffectName = DBCUtil.ExtractString(node, "EffectName" + keySuffix, "", false); EffectList.Insert(i, effect_info); } for (int i = 0; i < SectionNumber; i++) { string keySuffix = i.ToString(); ActionSection actionSection = new ActionSection(); actionSection.ActionType = DBCUtil.ExtractNumeric <int>(node, "ActionType" + keySuffix, -1, true); actionSection.WapMode = DBCUtil.ExtractString(node, "WapMode" + keySuffix, "ONCE", false); actionSection.IsUpperBody = DBCUtil.ExtractBool(node, "IsUpperBody" + keySuffix, false, false); actionSection.PlaySpeed = DBCUtil.ExtractNumeric <float>(node, "PlaySpeed" + keySuffix, 1.0f, false); actionSection.PlayTime = DBCUtil.ExtractNumeric <float>(node, "PlayTime" + keySuffix, 0, false); actionSection.MoveSpeed = DBCUtil.ExtractNumeric <float>(node, "MoveSpeed" + keySuffix, 0, false); actionSection.MoveTowards = DBCUtil.ExtractNumeric <int>(node, "MoveTowards" + keySuffix, 0, false); SectionList.Insert(i, actionSection); } ParamNum = DBCUtil.ExtractNumeric <int>(node, "ParamNum", 0, false); if (ParamNum > 0) { for (int i = 0; i < ParamNum; ++i) { string key = "Param" + i.ToString(); ExtraParams.Insert(i, DBCUtil.ExtractString(node, key, "", false)); } } return(true); }
/** * @brief 提取数据 * * @param node * * @return */ public bool CollectDataFromDBC(DBC_Row node) { Id = DBCUtil.ExtractNumeric <int>(node, "Id", -1, true); Name = DBCUtil.ExtractString(node, "Name", "", true); IsMusic = DBCUtil.ExtractBool(node, "IsMusic", false, true); Priority = DBCUtil.ExtractNumeric <int>(node, "Priority", 1, false); Volume = DBCUtil.ExtractNumeric <float>(node, "Volume", 1.0f, false); IsLoop = DBCUtil.ExtractBool(node, "IsLoop", false, false); Position = Converter.ConvertVector3D(DBCUtil.ExtractString(node, "Position", "0,0,0", false)); ParamNum = DBCUtil.ExtractNumeric <int>(node, "ParamNum", 0, false); ExtraParams.Clear(); if (ParamNum > 0) { for (int i = 0; i < ParamNum; ++i) { string key = "Param" + i.ToString(); ExtraParams.Insert(i, DBCUtil.ExtractString(node, key, "", false)); } } return(true); }
public bool CollectDataFromDBC(DBC_Row node) { m_ItemId = DBCUtil.ExtractNumeric <int>(node, "ItemId", 0, true); m_ItemName = DBCUtil.ExtractString(node, "ItemName", "", true); m_ItemTrueName = DBCUtil.ExtractString(node, "ItemTrueName", "", true); m_ItemType = DBCUtil.ExtractString(node, "ItemType", "", true); m_IsLobbyItem = DBCUtil.ExtractBool(node, "IsLobbyItem", false, true); m_Grade = DBCUtil.ExtractNumeric <int>(node, "Grade", 0, true); m_UseLogicId = DBCUtil.ExtractNumeric <int>(node, "UseLogicId", 0, true); List <string> strList = DBCUtil.ExtractStringList(node, "UseResultData", "", true); if (strList.Count > 0) { m_UseResultData = strList.ToArray(); } List <int> list = DBCUtil.ExtractNumericList <int>(node, "AddBuffOnEquiping", 0, true); if (list.Count > 0) { m_AddBuffOnEquiping = list.ToArray(); } list = DBCUtil.ExtractNumericList <int>(node, "AddSkillOnEquiping", 0, true); if (list.Count > 0) { m_AddSkillOnEquiping = list.ToArray(); } m_ShowInShop = (0 != DBCUtil.ExtractNumeric <int>(node, "ShowInShop", 0, true)); m_Model = DBCUtil.ExtractString(node, "Model", "", true); m_UiModel = DBCUtil.ExtractString(node, "UiModel", "", true); m_MaxStack = DBCUtil.ExtractNumeric <int>(node, "MaxStack", 1, true); list = DBCUtil.ExtractNumericList <int>(node, "ConsumeItems", 0, true); if (list.Count > 0) { m_ConsumeItems = list.ToArray(); } else { m_ConsumeItems = new int[] { 0, 0, 0 }; } m_ConsumeMoney = DBCUtil.ExtractNumeric <int>(node, "ConsumeMoney", 0, true); list = DBCUtil.ExtractNumericList <int>(node, "PropertyRank", 0, true); if (list.Count > 0) { m_PropertyRank = list.ToArray(); } else { m_PropertyRank = new int[] { 0, 0, 0, 0, 0 }; } m_AddExp = DBCUtil.ExtractNumeric <int>(node, "AddExp", 0, true); m_AddMoney = DBCUtil.ExtractNumeric <int>(node, "AddMoney", 0, true); m_AddBuff = DBCUtil.ExtractNumeric <int>(node, "AddBuffer", 0, true); m_Introduce = DBCUtil.ExtractString(node, "Introduce", "", true); m_ItemSkillFirst = DBCUtil.ExtractNumeric <int>(node, "ItemSkillFirst", 0, true); m_ItemSkillSecond = DBCUtil.ExtractNumeric <int>(node, "ItemSkillSecond", 0, true); m_ItemSkillThird = DBCUtil.ExtractNumeric <int>(node, "ItemSkillThird", 0, true); m_NormalIcon = DBCUtil.ExtractString(node, "NormalIcon", "", true); m_BigIcon = DBCUtil.ExtractString(node, "BigIcon", "", true); m_AttrData.CollectDataFromDBC(node); return(true); }
/** * @brief 提取数据 * * @param node * * @return */ public bool CollectDataFromDBC(DBC_Row node) { m_Id = DBCUtil.ExtractNumeric <int>(node, "Id", 0, true); m_Name = DBCUtil.ExtractString(node, "Name", "", true); m_NpcType = DBCUtil.ExtractNumeric <int>(node, "NpcType", 0, true); m_Level = DBCUtil.ExtractNumeric <int>(node, "Level", 0, true); m_Scale = DBCUtil.ExtractNumeric <float>(node, "Scale", 1.0f, true); m_DropCount = DBCUtil.ExtractNumeric <int>(node, "DropCount", 0, false); m_DropExp = DBCUtil.ExtractNumeric <int>(node, "DropExp", 0, false); m_DropMoney = DBCUtil.ExtractNumeric <int>(node, "DropMoney", 0, false); List <int> list = DBCUtil.ExtractNumericList <int>(node, "DropProbabilities", 0, false); if (list.Count > 0) { m_DropProbabilities = list.ToArray(); } list = DBCUtil.ExtractNumericList <int>(node, "DropNpcs", 0, false); if (list.Count > 0) { m_DropNpcs = list.ToArray(); } list = DBCUtil.ExtractNumericList <int>(node, "InteractSourceActions", 0, false); if (list.Count > 0) { m_InteractSourceActions = list.ToArray(); } else { m_InteractSourceActions = new int[] { 0, 0 }; } list = DBCUtil.ExtractNumericList <int>(node, "InteractTargetActions", 0, false); if (list.Count > 0) { m_InteractTargetActions = list.ToArray(); } else { m_InteractTargetActions = new int[] { 0, 0 }; } m_InteractionLogic = DBCUtil.ExtractNumeric <int>(node, "InteractionLogic", 0, false); List <string> strList = DBCUtil.ExtractStringList(node, "InteractResultData", "", false); if (strList.Count > 0) { m_InteractResultData = strList.ToArray(); } m_AttrData.CollectDataFromDBC(node); m_ViewRange = DBCUtil.ExtractNumeric <float>(node, "ViewRange", -1, true); m_GohomeRange = DBCUtil.ExtractNumeric <float>(node, "GohomeRange", -1, true); m_ReleaseTime = DBCUtil.ExtractNumeric <long>(node, "ReleaseTime", 0, true); m_HeadUiPos = DBCUtil.ExtractNumeric <int>(node, "HeadUiPos", 0, true); m_SkillList = DBCUtil.ExtractNumericList <int>(node, "SkillList", 0, false); m_ActionList = DBCUtil.ExtractNumericList <int>(node, "ActionId", 0, false); m_Model = DBCUtil.ExtractString(node, "Model", "", false); m_DeathModel = DBCUtil.ExtractString(node, "DeathModel", "", false); m_DeathEffect = DBCUtil.ExtractString(node, "DeathEffect", "", false); m_DeathSound = DBCUtil.ExtractString(node, "DeathSound", "", false); m_DeadType = DBCUtil.ExtractNumeric <int>(node, "DeadType", 0, false); m_Barrage = DBCUtil.ExtractNumeric <int>(node, "Barrage", 0, false); m_AvoidanceRadius = DBCUtil.ExtractNumeric <int>(node, "AvoidanceRadius", 1, false); m_CanMove = DBCUtil.ExtractBool(node, "CanMove", false, false); m_CanRotate = DBCUtil.ExtractBool(node, "CanRotate", true, false); m_IsRange = DBCUtil.ExtractBool(node, "IsRange", false, false); m_IsShine = DBCUtil.ExtractBool(node, "IsShine", false, false); m_isBlaze = DBCUtil.ExtractBool(node, "IsBlaze", false, false); m_IsHurtComa = DBCUtil.ExtractBool(node, "IsHurtComa", false, false); m_BornTimeMs = DBCUtil.ExtractNumeric <int>(node, "BornTimeMs", 0, false); m_BornEffect = DBCUtil.ExtractString(node, "BornEffect", "", false); m_IsAttachControler = DBCUtil.ExtractBool(node, "IsAttachControler", false, false); m_AttachNodeName = DBCUtil.ExtractString(node, "AttachNodeName", "", false); m_GunEndRelativePos = Converter.ConvertVector3D(DBCUtil.ExtractString(node, "GunEndRelativePos", "0.0,0.0,0.0", false)); m_WeaponList = DBCUtil.ExtractNumericList <int>(node, "WeaponId", 0, false); string shapeType = DBCUtil.ExtractString(node, "ShapeType", "", true); int shapeParamNum = DBCUtil.ExtractNumeric <int>(node, "ShapeParamNum", 0, true); if (shapeParamNum > 0) { string[] shapeParams = new string[shapeParamNum]; for (int i = 0; i < shapeParamNum; ++i) { shapeParams[i] = DBCUtil.ExtractString(node, "ShapeParam" + i, "", false); } if (0 == string.Compare("Circle", shapeType, true)) { m_Shape = new Circle(new Vector3(0, 0, 0), float.Parse(shapeParams[0])); } else if (0 == string.Compare("Line", shapeType, true)) { Vector3 start = Converter.ConvertVector3D(shapeParams[0]); Vector3 end = Converter.ConvertVector3D(shapeParams[1]); m_Shape = new Line(start, end); } else if (0 == string.Compare("Rect", shapeType, true)) { float width = float.Parse(shapeParams[0]); float height = float.Parse(shapeParams[1]); m_Shape = new Rect(width, height); } else if (0 == string.Compare("Polygon", shapeType, true)) { Polygon polygon = new Polygon(); foreach (string s in shapeParams) { Vector3 pt = Converter.ConvertVector3D(s); polygon.AddVertex(pt); } m_Shape = polygon; } } return(true); }
/** * @brief 提取数据 * * @param node * * @return */ public bool CollectDataFromDBC(DBC_Row node) { m_ModelId = DBCUtil.ExtractNumeric <int>(node, "ModelId", 0, true); m_AnimSetType = DBCUtil.ExtractNumeric <int>(node, "AnimSetType", 0, false); m_NoGunStdSpeed = DBCUtil.ExtractNumeric <float>(node, "NoGunStdSpeed", 3.0f, false); m_ForwardStdSpeed = DBCUtil.ExtractNumeric <float>(node, "ForwardStdSpeed", 3.0f, true); m_BackStdSpeed = DBCUtil.ExtractNumeric <float>(node, "BackStdSpeed", 3.0f, true); m_LeftRightStdSpeed = DBCUtil.ExtractNumeric <float>(node, "LeftRightStdSpeed", 3.0f, true); m_LeftRightForwardStdSpeed = DBCUtil.ExtractNumeric <float>(node, "LeftRightForwardStdSpeed", 3.0f, true); m_LeftRightBackStdSpeed = DBCUtil.ExtractNumeric <float>(node, "LeftRightBackStdSpeed", 3.0f, true); m_SlowStdSpeed = DBCUtil.ExtractNumeric <float>(node, "SlowStdSpeed", 3.0f, false); m_FastStdSpeed = DBCUtil.ExtractNumeric <float>(node, "FastStdSpeed", 3.0f, false); m_IsUpperDepart = DBCUtil.ExtractBool(node, "IsUpperDepart", false, false); m_ActionPrefix = DBCUtil.ExtractString(node, "ActionPrefix", "", false); m_ActionContainer = new Dictionary <Animation_Type, List <Data_ActionInfo> >(); m_ActionContainer[Animation_Type.AT_SLEEP] = ExtractAction(node, "Sleep"); m_ActionContainer[Animation_Type.AT_Stand] = ExtractAction(node, "Stand_0"); m_ActionContainer[Animation_Type.AT_Hold] = ExtractAction(node, "Hold_0"); m_ActionContainer[Animation_Type.AT_RIDE] = ExtractAction(node, "Ride_0"); m_ActionContainer[Animation_Type.AT_Idle0] = ExtractAction(node, "Idle_0"); m_ActionContainer[Animation_Type.AT_Idle1] = ExtractAction(node, "Idle_1"); m_ActionContainer[Animation_Type.AT_Idle2] = ExtractAction(node, "Idle_2"); m_ActionContainer[Animation_Type.AT_SlowMove] = ExtractAction(node, "SlowMove"); m_ActionContainer[Animation_Type.AT_FastMove] = ExtractAction(node, "FastMove"); m_ActionContainer[Animation_Type.AT_NoGunRun] = ExtractAction(node, "NoGunRun"); m_ActionContainer[Animation_Type.AT_NoGunStand] = ExtractAction(node, "NoGunStand"); m_ActionContainer[Animation_Type.AT_RunForward] = ExtractAction(node, "RunForward_0"); m_ActionContainer[Animation_Type.AT_RunBackward] = ExtractAction(node, "RunBackward_0"); m_ActionContainer[Animation_Type.AT_RunLeft] = ExtractAction(node, "RunLeft_0"); m_ActionContainer[Animation_Type.AT_RunRight] = ExtractAction(node, "RunRight_0"); m_ActionContainer[Animation_Type.AT_RunForwardLeft] = ExtractAction(node, "RunForwardLeft_0"); m_ActionContainer[Animation_Type.AT_RunForwardRight] = ExtractAction(node, "RunForwardRight_0"); m_ActionContainer[Animation_Type.AT_RunBackwardLeft] = ExtractAction(node, "RunBackwardLeft_0"); m_ActionContainer[Animation_Type.AT_RunBackwardRight] = ExtractAction(node, "RunBackwardRight_0"); m_ActionContainer[Animation_Type.AT_EquipWeapon] = ExtractAction(node, "EquipWeapon"); m_ActionContainer[Animation_Type.AT_UnequipWeapon] = ExtractAction(node, "UnequipWeapon"); m_ActionContainer[Animation_Type.AT_Reload] = ExtractAction(node, "Reload"); m_ActionContainer[Animation_Type.AT_JumpBegin] = ExtractAction(node, "JumpBegin"); m_ActionContainer[Animation_Type.AT_Jumping] = ExtractAction(node, "Jumping"); m_ActionContainer[Animation_Type.AT_JumpEnd] = ExtractAction(node, "JumpEnd"); m_ActionContainer[Animation_Type.AT_Born] = ExtractAction(node, "Born"); m_ActionContainer[Animation_Type.AT_Attack] = ExtractAction(node, "Attack_"); m_ActionContainer[Animation_Type.AT_Hurt] = ExtractAction(node, "Hurt"); m_ActionContainer[Animation_Type.AT_Dead] = ExtractAction(node, "Dead"); m_ActionContainer[Animation_Type.AT_PostDead] = ExtractAction(node, "PostDead"); m_ActionContainer[Animation_Type.AT_HitHigh] = ExtractAction(node, "HitHigh"); m_ActionContainer[Animation_Type.AT_GetUp1] = ExtractAction(node, "GetUp_0"); m_ActionContainer[Animation_Type.AT_GetUp2] = ExtractAction(node, "GetUp_1"); m_ActionContainer[Animation_Type.AT_SkillSection1] = ExtractAction(node, "SkillSection01"); m_ActionContainer[Animation_Type.AT_SkillSection2] = ExtractAction(node, "SkillSection02"); m_ActionContainer[Animation_Type.AT_SkillSection3] = ExtractAction(node, "SkillSection03"); m_ActionContainer[Animation_Type.AT_SkillSection4] = ExtractAction(node, "SkillSection04"); m_ActionContainer[Animation_Type.AT_SkillSection5] = ExtractAction(node, "SkillSection05"); m_ActionContainer[Animation_Type.AT_SkillSection6] = ExtractAction(node, "SkillSection06"); m_ActionContainer[Animation_Type.AT_SkillSection7] = ExtractAction(node, "SkillSection07"); m_ActionContainer[Animation_Type.AT_SkillSection8] = ExtractAction(node, "SkillSection08"); m_ActionContainer[Animation_Type.AT_SkillSection9] = ExtractAction(node, "SkillSection09"); m_ActionContainer[Animation_Type.AT_SkillSection10] = ExtractAction(node, "SkillSection10"); m_ActionContainer[Animation_Type.AT_SkillSection11] = ExtractAction(node, "SkillSection11"); m_ActionContainer[Animation_Type.AT_SkillSection12] = ExtractAction(node, "SkillSection12"); m_ActionContainer[Animation_Type.AT_SkillSection13] = ExtractAction(node, "SkillSection13"); m_ActionContainer[Animation_Type.AT_SkillSection14] = ExtractAction(node, "SkillSection14"); m_ActionContainer[Animation_Type.AT_SkillSection15] = ExtractAction(node, "SkillSection15"); m_ActionContainer[Animation_Type.AT_SkillSection16] = ExtractAction(node, "SkillSection16"); m_ActionContainer[Animation_Type.AT_SkillSection17] = ExtractAction(node, "SkillSection17"); m_ActionContainer[Animation_Type.AT_SkillSection18] = ExtractAction(node, "SkillSection18"); m_ActionContainer[Animation_Type.AT_SkillSection19] = ExtractAction(node, "SkillSection19"); m_ActionContainer[Animation_Type.AT_SkillSection20] = ExtractAction(node, "SkillSection20"); return(true); }