public AttributesData(AttributesData data) { m_Inc_MaxHP = data.m_Inc_MaxHP; m_Inc_PDEF = data.m_Inc_PDEF; m_Inc_MDEF = data.m_Inc_MDEF; m_Inc_PATK = data.m_Inc_PATK; m_Inc_MATK = data.m_Inc_MATK; m_MaxHP = data.m_MaxHP; m_PDEF = data.m_PDEF; m_PATK = data.m_PATK; m_MDEF = data.m_MDEF; m_MATK = data.m_MATK; m_Speed = data.m_Speed; m_Stun = data.m_Stun; m_Critical = data.m_Critical; m_CriticalHit = data.m_CriticalHit; m_Penetration = data.m_Penetration; m_Damage_Reduction = data.m_Damage_Reduction; m_Heal_Recover = data.m_Heal_Recover; m_Spell_Penetration = data.m_Spell_Penetration; m_Dodge_Rating = data.m_Dodge_Rating; m_Threaten = data.m_Threaten; m_Anti_Mu_Rating = data.m_Anti_Mu_Rating; m_Anti_Jin_Rating = data.m_Anti_Jin_Rating; m_Anti_Shui_Rating = data.m_Anti_Shui_Rating; m_Anti_Huo_Rating = data.m_Anti_Huo_Rating; m_Anti_Tu_Rating = data.m_Anti_Tu_Rating; m_Training_MaxHP = data.m_Training_MaxHP; m_Training_PATK = data.m_Training_PATK; m_Training_PDEF = data.m_Training_PDEF; m_Training_MATK = data.m_Training_MATK; m_Training_MDEF = data.m_Training_MDEF; }
public void Add(AttributesData data) { m_Inc_MaxHP += data.m_Inc_MaxHP; m_Inc_PDEF += data.m_Inc_PDEF; m_Inc_MDEF += data.m_Inc_MDEF; m_Inc_PATK += data.m_Inc_PATK; m_Inc_MATK += data.m_Inc_MATK; m_MaxHP += data.m_MaxHP; m_PDEF += data.m_PDEF; m_PATK += data.m_PATK; m_MDEF += data.m_MDEF; m_MATK += data.m_MATK; m_Speed += data.m_Speed; m_Stun += data.m_Stun; m_Critical += data.m_Critical; m_CriticalHit += data.m_CriticalHit; m_Penetration += data.m_Penetration; m_Damage_Reduction += data.m_Damage_Reduction; m_Heal_Recover += data.m_Heal_Recover; m_Spell_Penetration += data.m_Spell_Penetration; m_Dodge_Rating += data.m_Dodge_Rating; m_Threaten += data.m_Threaten; m_Anti_Mu_Rating += data.m_Anti_Mu_Rating; m_Anti_Jin_Rating += data.m_Anti_Jin_Rating; m_Anti_Shui_Rating += data.m_Anti_Shui_Rating; m_Anti_Huo_Rating += data.m_Anti_Huo_Rating; m_Anti_Tu_Rating += data.m_Anti_Tu_Rating; m_Training_MaxHP += data.m_Training_MaxHP; m_Training_PATK += data.m_Training_PATK; m_Training_PDEF += data.m_Training_PDEF; m_Training_MATK += data.m_Training_MATK; m_Training_MDEF += data.m_Training_MDEF; }
public static void GetTraningAttriButsByBuddyInventoryID(string dataID, AttributesData attData) { //判定角色类型 IDictionary trainingdata; if (!DataLookupsCache.Instance.SearchDataByID <IDictionary>(dataID + ".stat.training", out trainingdata)) { return; } else { int patk_level = 0; int matk_level = 0; int maxhp_level = 0; int mdef_level = 0; int pdef_level = 0; patk_level = EB.Dot.Integer("PATK.level", trainingdata, 0); matk_level = EB.Dot.Integer("MATK.level", trainingdata, 0); maxhp_level = EB.Dot.Integer("MaxHP.level", trainingdata, 0); mdef_level = EB.Dot.Integer("MDEF.level", trainingdata, 0); pdef_level = EB.Dot.Integer("PDEF.level", trainingdata, 0); attData.m_PATK += attData.m_Training_PATK * patk_level; attData.m_MATK += attData.m_Training_MATK * matk_level; attData.m_MaxHP += attData.m_Training_MaxHP * maxhp_level; attData.m_MDEF += attData.m_Training_MDEF * mdef_level; attData.m_PDEF += attData.m_Training_PDEF * pdef_level; } }
public static void GetStarAttriButsByBuddyInventoryID(string dataID, AttributesData attData, int star) { attData.m_PATK = attData.m_PATK * star_R[star]; attData.m_MATK = attData.m_MATK * star_R[star]; attData.m_MaxHP = attData.m_MaxHP * star_R[star]; attData.m_MDEF = attData.m_MDEF * star_R[star]; attData.m_PDEF = attData.m_PDEF * star_R[star]; }
/// <summary> /// /// </summary> /// <param name="dataID"> heroStats.11111</param> /// <param name="ishero"></param> /// <returns></returns> public static AttributesData GetAttributsByBuddyInventoryID(string dataID, bool ishero, int star = -1) { //通过dataID 获取角色配表id和等线 string buddyid; int level; //通过配表id获取所有的属怿 //获取计算结果 AttributesData attData = new AttributesData(); //通过dataID 获取角色配表id和等线 IDictionary inventorydata; if (!DataLookupsCache.Instance.SearchDataByID <IDictionary>(dataID, out inventorydata)) { return(null); } else { buddyid = inventorydata["template_id"].ToString(); if (!ishero) { level = EB.Dot.Integer("stat.level", inventorydata, 1); } else { if (!DataLookupsCache.Instance.SearchIntByID("level", out level)) { level = 1; } } if (star < 0) { star = 0; star = EB.Dot.Integer("star", inventorydata, 0); } } //通过配表id获取所有的属怿 Hotfix_LT.Data.HeroStatTemplate hero = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroStat(buddyid); if (hero == null) { } else { SetBaseAttribute(hero, star, level, ref attData); //将修为的数据计算进去 GetTraningAttriButsByBuddyInventoryID(dataID, attData); } //计算升星 { GetStarAttriButsByBuddyInventoryID(dataID, attData, star); } return(attData); }
/// <summary> /// 基础属性和升星有关 /// </summary> /// <param name="hero"></param> /// <param name="star"></param> /// <param name="level"></param> /// <param name="attData"></param> public static void SetBaseAttribute(Hotfix_LT.Data.HeroStatTemplate hero, int star, int level, ref AttributesData attData) { attData.SetDataByBuddy(hero); //获取计算结果 attData.m_MaxHP = CalcBaseAttribute(attData.m_MaxHP * star_BR[star], attData.m_Inc_MaxHP, level); attData.m_PATK = CalcBaseAttribute(attData.m_PATK * star_BR[star], attData.m_Inc_PATK, level); attData.m_MATK = CalcBaseAttribute(attData.m_MATK * star_BR[star], attData.m_Inc_MATK, level); attData.m_PDEF = CalcBaseAttribute(attData.m_PDEF * star_BR[star], attData.m_Inc_PDEF, level); attData.m_MDEF = CalcBaseAttribute(attData.m_MDEF * star_BR[star], attData.m_Inc_MDEF, level); }