From 02e13cfa81063db800cad02c8ba8932bfba2e6fe Mon Sep 17 00:00:00 2001
From: lcy <1459594991@qq.com>
Date: 星期四, 28 五月 2026 19:33:34 +0800
Subject: [PATCH] 666 新增代金券 修复商城货币框代币显示问题
---
Main/System/Main/FightPowerManager.cs | 803 ++++++++++++++++++++++++++++++++++++---------------------
1 files changed, 505 insertions(+), 298 deletions(-)
diff --git a/Main/System/Main/FightPowerManager.cs b/Main/System/Main/FightPowerManager.cs
index 76ba0c0..1872349 100644
--- a/Main/System/Main/FightPowerManager.cs
+++ b/Main/System/Main/FightPowerManager.cs
@@ -12,133 +12,59 @@
// 鎵�鏈夋灏嗘垬鍔涘姞璧锋潵 + 鎶�鑳芥垬鍔涙眹鎬伙紙鍏紡锛夊氨鏄暣涓彿鐨勬垬鍔�
public class FightPowerManager : Singleton<FightPowerManager>
{
- // 灞炴�у彉閲忓父閲�
- private const string LV_VALUE = "lvValue";
- private const string EQUIP_VALUE = "equipValue";
- private const string BOOK_VALUE = "bookValue";
- private const string BOOK_PER = "bookPer";
- private const string REALM_VALUE = "realmValue";
- private const string REALM_PER = "realmPer";
- private const string GUBAO_VALUE = "gubaoValue";
- private const string GUBAO_PER = "gubaoPer";
- private const string HJG_VALUE = "hjgValue";
- private const string HJG_PER = "hjgPer";
- private const string HORSE_VALUE = "horseValue";
- private const string HORSE_PER = "horsePer";
- private const string BEAUTY_VALUE = "beautyValue";
- private const string BEAUTY_PER = "beautyPer";
- private const string FATES_VALUE = "fatesValue";
- private const string FATES_PER = "fatesPer";
- private const string LINEUP_HALO_VALUE = "lineupHaloValue";
- private const string LINEUP_HALO_PER = "lineupHaloPer";
- private const string INHERIT_PER = "inheritPer";
- private const string HERO_SELF_VALUE = "heroSelfValue";
- private const string HERO_SELF_PER = "heroSelfPer";
- private const string STAR_TALENT_VALUE = "starTalentValue";
- private const string STAR_TALENT_PER = "starTalentPer";
- private const string BREAK_LV_VALUE = "breakLVValue";
- private const string BREAK_LV_PER = "breakLVPer";
- private const string AWAKE_TALENT_VALUE = "awakeTalentValue";
- private const string AWAKE_TALENT_PER = "awakeTalentPer";
- private const string FETTER_VALUE = "fetterValue";
- private const string FETTER_PER = "fetterPer";
- private const string HERO_LV_VALUE = "heroLVValue";
- private const string HERO_LV_PER = "heroLVPer";
- private const string HERO_CARDPER = "cardPer";
- private const string DINGJUNGE_VALUE = "dingjungeValue";
- private const string DINGJUNGE_PER = "dingjungePer";
-
- // 鎴樺姏鍙橀噺甯搁噺
- private const string ATK_RATIO = "AtkRatio";
- private const string MAX_HP_RATIO = "MaxHPRatio";
- private const string DEF_RATIO = "DefRatio";
- private const string STUN_RATE_RATIO = "StunRateRatio";
- private const string SUPER_HIT_RATE_RATIO = "SuperHitRateRatio";
- private const string COMBO_RATE_RATIO = "ComboRateRatio";
- private const string MISS_RATE_RATIO = "MissRateRatio";
- private const string PARRY_RATE_RATIO = "ParryRateRatio";
- private const string SUCK_HP_PER_RATIO = "SuckHPPerRatio";
- private const string STUN_RATE_DEF_RATIO = "StunRateDefRatio";
- private const string SUPER_HIT_RATE_DEF_RATIO = "SuperHitRateDefRatio";
- private const string COMBO_RATE_DEF_RATIO = "ComboRateDefRatio";
- private const string MISS_RATE_DEF_RATIO = "MissRateDefRatio";
- private const string PARRY_RATE_DEF_RATIO = "ParryRateDefRatio";
- private const string SUCK_HP_PER_DEF_RATIO = "SuckHPPerDefRatio";
- private const string NORMAL_SKILL_PER_RATIO = "NormalSkillPerRatio";
- private const string NORMAL_SKILL_PER_DEF_RATIO = "NormalSkillPerDefRatio";
- private const string ANGER_SKILL_PER_RATIO = "AngerSkillPerRatio";
- private const string ANGER_SKILL_PER_DEF_RATIO = "AngerSkillPerDefRatio";
- private const string SUPER_DAM_PER_RATIO = "SuperDamPerRatio";
- private const string SUPER_DAM_PER_DEF_RATIO = "SuperDamPerDefRatio";
- private const string SHIELD_PER_RATIO = "ShieldPerRatio";
- private const string SHIELD_PER_DEF_RATIO = "ShieldPerDefRatio";
- private const string DOT_PER_RATIO = "DOTPerRatio";
- private const string DOT_PER_DEF_RATIO = "DOTPerDefRatio";
- private const string WEI_FINAL_DAM_PER_RATIO = "WeiFinalDamPerRatio";
- private const string WEI_FINAL_DAM_PER_DEF_RATIO = "WeiFinalDamPerDefRatio";
- private const string SHU_FINAL_DAM_PER_RATIO = "ShuFinalDamPerRatio";
- private const string SHU_FINAL_DAM_PER_DEF_RATIO = "ShuFinalDamPerDefRatio";
- private const string WU_FINAL_DAM_PER_RATIO = "WuFinalDamPerRatio";
- private const string WU_FINAL_DAM_PER_DEF_RATIO = "WuFinalDamPerDefRatio";
- private const string QUN_FINAL_DAM_PER_RATIO = "QunFinalDamPerRatio";
- private const string QUN_FINAL_DAM_PER_DEF_RATIO = "QunFinalDamPerDefRatio";
- private const string FINAL_DAM_PER_RATIO = "FinalDamPerRatio";
- private const string FINAL_DAM_PER_DEF_RATIO = "FinalDamPerDefRatio";
- private const string PHY_DAM_PER_RATIO = "PhyDamPerRatio";
- private const string PHY_DAM_PER_DEF_RATIO = "PhyDamPerDefRatio";
- private const string MAG_DAM_PER_RATIO = "MagDamPerRatio";
- private const string MAG_DAM_PER_DEF_RATIO = "MagDamPerDefRatio";
- private const string CURE_PER_RATIO = "CurePerRatio";
- private const string CURE_PER_DEF_RATIO = "CurePerDefRatio";
- private const string PVP_DAM_PER_RATIO = "PVPDamPerRatio";
- private const string PVP_DAM_PER_DEF_RATIO = "PVPDamPerDefRatio";
- private const string GUANCHUAN_RATIO = "GuanchuanRatio";
- private const string GUANCHUAN_DEF_RATIO = "GuanchuanDefRatio";
- private const string ZHAOJIA_RATIO = "ZhaojiaRatio";
- private const string ZHAOJIA_DEF_RATIO = "ZhaojiaDefRatio";
-
-
- private const string PLAYER_LV = "PlayerLV";
- private const string OFFICIAL_LV = "OfficialLV";
- private const string SKILL_POWER = "SkillPower";
-
-
-
- Dictionary<string, double> propertyVariables = new Dictionary<string, double>();
- Dictionary<string, double> fightPowerVariables = new Dictionary<string, double>(); //鎬绘垬鍔涗腑鐨勫崟姝﹀皢鎴樺姏
- List<PlayerPropertyConfig> pConfig = new List<PlayerPropertyConfig>();
public FightPowerManager()
{
// 鏁板��1锛氬熀纭�涓夌淮灞炴�ц绠楀叕寮�
// 鏁板��2锛氭垬鏂楀睘鎬�/鎴樻枟鎶楁��/鐗规畩灞炴�ц绠楀叕寮�
// 鏁板��3锛氬睘鎬ф垬鍔涜绠楀叕寮忥紝璁$畻鍙傛暟璇﹁ S.灞炴�ф潯鐩厤缃�
- pConfig = PlayerPropertyConfig.GetValues();
JaceCalculator.Init();
}
+ public long lastFightPower = 0; //涓婁竴娆$殑鏈嶅姟绔垬鍔涳紝鐢ㄤ簬閲嶇疆鏄惁閲嶆柊璁$畻姝﹀皢鐧惧垎姣� 缇佺粖绛夛紝娌℃湁鍙樺寲鍒欏噺灏戣绠�
+ public long lastMinggeSkillPower = 0;
+
#region 鍒濆鍖栨垬鍔涜绠楃殑淇℃伅
- TeamType teamTypeCalc = TeamType.Story; //涓嶅悓闃靛鎴樺姏涓嶅悓
+ int teamTypeCalc = 1; //涓嶅悓闃靛鎴樺姏涓嶅悓
bool isPreviewTeamPower; //棰勮闃靛锛堥槦浼嶏級鎴樺姏
int dropIndexCalc = -1; //鎺夎惤瑁呭鍦ㄩ樀瀹圭殑绱㈠紩锛岀敤浜庨瑙堟垬鍔涘姣�
+ int minggePresetID; //鍛芥牸棰勮ID
+ int minggeDropIndex; //鎺夎惤鍛芥牸鍦ㄨ儗鍖呯殑绱㈠紩 锛岀敤浜庨瑙堟垬鍔涘姣�
//璁$畻闃靛鎴樺姏锛岃澶囧姣旂瓑鎯呭喌闇�瑕佷唬鍏�
/// <summary>
///
/// </summary>
- /// <param name="teamType">闃靛绫诲瀷</param>
+ /// <param name="teamType">闃靛绫诲瀷锛氭柟妗圛D涓嬬殑闃熶紞</param>
/// <param name="dropindex">鎺夎惤瑁呭鐨勭储寮曪紝-1浠h〃涓嶆浛鎹㈣绠�</param>
/// <param name="ispreview">棰勮闃靛鎴樺姏</param>
- public void InitFightPowerParam(TeamType teamType = TeamType.Story, int dropindex = -1, bool ispreview = false)
+ public void InitFightPowerParam(int teamType = 0, int dropindex = -1, bool ispreview = false,
+ int _minggePresetID = 0, int _minggeDropIndex = -1)
{
#if !UNITY_EDITOR
openLog = false;
#endif
+ if (teamType == 0)
+ {
+ // 娌℃湁璁剧疆榛樿浣跨敤涓婚樀瀹�
+ teamType = TeamManager.Instance.GetMainTeamID();
+ }
+ if (_minggePresetID == 0)
+ {
+ // 娌℃湁璁剧疆榛樿褰撳墠娴佹淳涓嬪懡鏍兼柟妗�
+ _minggePresetID = FuncPresetManager.Instance.GetFuncPresetID((int)FuncPresetType.Mingge);
+ }
teamTypeCalc = teamType;
+ minggePresetID = _minggePresetID;
isPreviewTeamPower = ispreview;
dropIndexCalc = dropindex;
+ minggeDropIndex = _minggeDropIndex;
#if UNITY_EDITOR
- FightPowerDebug("鎴樺姏锛氬垵濮嬪寲鍙傛暟 dropIndex锛�" + dropIndexCalc + " 闃靛瀷锛�" + teamTypeCalc + " ispreview:" + ispreview);
+ if (openLog)
+ {
+ FightPowerDebug("鎴樺姏锛氬垵濮嬪寲鍙傛暟 dropIndex锛�" + dropIndexCalc + " 闃靛瀷锛�" + teamTypeCalc + " ispreview:" + ispreview
+ + " minggePresetID:" + _minggePresetID + " minggeDropIndex:" + _minggeDropIndex);
+ }
#endif
}
#endregion
@@ -148,15 +74,16 @@
#region 鍏堣绠楁墍鏈夊姛鑳界殑姹囨�诲睘鎬�
//鍔熻兘灞炴�� 绫诲瀷锛氬��
- public Dictionary<int, int> lvAttrs = new Dictionary<int, int>(); //绛夌骇灞炴��
- public Dictionary<int, int> officialAttrs = new Dictionary<int, int>(); //瀹樿亴灞炴��
+ public Dictionary<int, long> lvAttrs = new Dictionary<int, long>(); //绛夌骇灞炴��
+ public Dictionary<int, long> officialAttrs = new Dictionary<int, long>(); //瀹樿亴灞炴��
//鍒嗗紑瀛樺偍棰勮鍜� 鐪熷疄灞炴��
- public Dictionary<int, int> equipAttrs = new Dictionary<int, int>(); //瑁呭灞炴��
+ public Dictionary<int, long> equipAttrs = new Dictionary<int, long>(); //瑁呭灞炴��
// public Dictionary<string, int> lineUpPerDict = new Dictionary<string, int>(); //闃靛灞炴�у姞鎴�
public Dictionary<int, int> countryAttrs = new Dictionary<int, int>(); //闃靛鍥藉锛堝厜鐜級灞炴��
-
- float allHeroAddPer = 0; //鎵�鏈夋灏嗗姞鎴�
+ public Dictionary<int, long> minggeAttrs = new Dictionary<int, long>(); //鍛芥牸灞炴��
+ public Dictionary<int, long> djgAttrs = new Dictionary<int, long>(); //瀹氬啗闃佸睘鎬�
+ double allHeroAddPer = 0; //鎵�鏈夋灏嗗姞鎴�
//绛夌骇灞炴��
void RefreshLVAttrs()
@@ -168,8 +95,13 @@
lvAttrs[attrType] = GetPlayerLVValue(playerLVConfig, attrType);
}
#if UNITY_EDITOR
- FightPowerDebug("鎴樺姏锛氱瓑绾у睘鎬� " + JsonMapper.ToJson(lvAttrs));
- FightPowerDebug("鎴樺姏锛氱孩棰滃睘鎬� " + JsonMapper.ToJson(BeautyMMManager.Instance.allMMTalentAttr));
+
+ if (openLog)
+ {
+ FightPowerDebug("鎴樺姏锛氱瓑绾у睘鎬� " + JsonMapper.ToJson(lvAttrs));
+ FightPowerDebug("鎴樺姏锛氱孩棰滃睘鎬� " + JsonMapper.ToJson(BeautyMMManager.Instance.allMMTalentAttr));
+ FightPowerDebug("鎴樺姏锛氬彜瀹濆睘鎬� " + JsonMapper.ToJson(GubaoManager.Instance.gubaoAllAttrDict));
+ }
#endif
}
@@ -203,7 +135,10 @@
officialAttrs[id] = config.AddAttrNum[i];
}
#if UNITY_EDITOR
- FightPowerDebug("鎴樺姏锛氬畼鑱屽睘鎬� " + JsonMapper.ToJson(officialAttrs));
+ if (openLog)
+ {
+ FightPowerDebug("鎴樺姏锛氬畼鑱屽睘鎬� " + JsonMapper.ToJson(officialAttrs));
+ }
#endif
}
@@ -212,13 +147,18 @@
void RefrehEquipAttrs()
{
equipAttrs.Clear(); //韬笂瑁呭灞炴�ч噸缃�
+ ItemModel dropEquip = null;
+ if (dropIndexCalc != -1)
+ {
+ dropEquip = PackManager.Instance.GetItemByIndex(PackType.DropItem, dropIndexCalc);
+ }
+
for (int i = 0; i < EquipModel.TotleEquip; i++)
{
var equip = EquipModel.Instance.GetEquip(i);
if (dropIndexCalc != -1)
{
- var dropEquip = PackManager.Instance.GetItemByIndex(PackType.DropItem, dropIndexCalc);
- if (dropEquip.config.EquipPlace - 1 == i)
+ if (dropEquip != null && dropEquip.config.EquipPlace - 1 == i)
{
equip = dropEquip; //鏇挎崲璁$畻鎬绘垬鍔�
}
@@ -263,7 +203,10 @@
}
#if UNITY_EDITOR
- FightPowerDebug("鎴樺姏锛氳澶囧睘鎬� " + JsonMapper.ToJson(equipAttrs));
+ if (openLog)
+ {
+ FightPowerDebug("鎴樺姏锛氳澶囧睘鎬� " + JsonMapper.ToJson(equipAttrs));
+ }
#endif
}
@@ -273,15 +216,85 @@
//闃靛灞炴��
// 闃靛锛氭墍鏈夋灏嗕笂闃靛睘鎬�
// lineUpPerDict = HeroUIManager.Instance.GetLineupPer(teamTypeCalc, isPreviewTeamPower);
- allHeroAddPer = HeroUIManager.Instance.GetAllHeroPer() / 10000.0f;
-#if UNITY_EDITOR
- // Debug.Log("鎴樺姏锛氫笂闃靛睘鎬� " + JsonMapper.ToJson(lineUpPerDict));
-#endif
+ allHeroAddPer = HeroUIManager.Instance.GetAllHeroPer() / 10000.0;
+
// 闃靛锛氬浗瀹讹紙鍏夌幆锛夊睘鎬�
countryAttrs = HeroUIManager.Instance.GetCountryAttrs(teamTypeCalc, isPreviewTeamPower);
#if UNITY_EDITOR
- FightPowerDebug("鎴樺姏锛氬浗瀹讹紙鍏夌幆锛夊睘鎬� " + JsonMapper.ToJson(countryAttrs));
+ if (openLog)
+ {
+ FightPowerDebug("鎴樺姏锛氬浗瀹讹紙鍏夌幆锛夊睘鎬� " + JsonMapper.ToJson(countryAttrs));
+ FightPowerDebug("鎴樺姏锛氭灏嗘墍鏈夊姞鎴� " + allHeroAddPer);
+ }
#endif
+ }
+
+ //绫讳技瑁呭闇�瑕佸疄鏃舵浛鎹㈠姣旓紱鍔熻兘澶勬煡鐪嬮噸绠椾竴娆℃樉绀�
+ void RefrehMinggeAttrs()
+ {
+ minggeAttrs.Clear(); //韬笂鍛芥牸灞炴�ч噸缃�
+ ItemModel dropEquip = null;
+ int packIndex = -1;
+ if (minggeDropIndex != -1)
+ {
+ dropEquip = PackManager.Instance.GetItemByIndex(PackType.MinggeDrop, minggeDropIndex);
+ packIndex = MinggeManager.Instance.GetPackIndex(minggePresetID, dropEquip.config.EquipPlace);
+ }
+
+ var starIndex = (minggePresetID - 1) * MinggeManager.TotleEquip;
+
+ for (int i = starIndex; i < starIndex + MinggeManager.TotleEquip; i++)
+ {
+ var equip = PackManager.Instance.GetItemByIndex(PackType.Mingge, i);
+ if (minggeDropIndex != -1)
+ {
+ if (dropEquip != null && packIndex == i)
+ {
+ equip = dropEquip; //鏇挎崲璁$畻鎬绘垬鍔�
+ }
+ }
+ if (equip == null)
+ {
+ continue;
+ }
+
+ var fightIDAttrs = EquipModel.Instance.GetEquipFightAttrs(equip);
+ var fightValueAttrs = EquipModel.Instance.GetEquipFightValues(equip);
+ if (fightIDAttrs != null)
+ {
+ for (int j = 0; j < fightIDAttrs.Count; j++)
+ {
+ if (!minggeAttrs.ContainsKey(fightIDAttrs[j]))
+ {
+ minggeAttrs[fightIDAttrs[j]] = fightValueAttrs[j];
+ }
+ else
+ {
+ minggeAttrs[fightIDAttrs[j]] += fightValueAttrs[j];
+ }
+ }
+ }
+ }
+
+#if UNITY_EDITOR
+ if (openLog)
+ {
+ FightPowerDebug("鎴樺姏锛氬懡鏍煎睘鎬� " + JsonMapper.ToJson(minggeAttrs));
+ }
+#endif
+ }
+
+
+ public int GetAttrPer(int attrID, Dictionary<int, long> attrDic)
+ {
+ if (attrID == 6 || attrID == 7 || attrID == 8)
+ {
+ var pertype = attrID + 10;
+ attrDic.TryGetValue(pertype, out long value);
+ return (int)(value);
+ }
+ return 0;
+
}
#endregion
@@ -309,70 +322,114 @@
#region 灞炴�у叕寮�
// 鍗曞熀纭�灞炴�ц绠�
- public double GetPropertyVaule(int attrType, HeroInfo hero, int type)
+ public double GetPropertyVaule(int attrType, HeroInfo hero)
{
// propertyVariables.Clear();
+
+ lvAttrs.TryGetValue(attrType, out var lvValue);
+ equipAttrs.TryGetValue(attrType, out var equipValue);
+ officialAttrs.TryGetValue(attrType, out var realmValue);
+ var realmPer = GetAttrPer(attrType, officialAttrs) / 10000.0;
+ var gubaoValue = GubaoManager.Instance.GetAttrValue(attrType);
+ var gubaoPer = GubaoManager.Instance.GetAttrPer(attrType) / 10000.0;
+ var hjgValue = PhantasmPavilionManager.Instance.GetAttrValue(attrType);
+ var hjgPer = PhantasmPavilionManager.Instance.GetAttrPer(attrType) / 10000.0;
+ var horseValue = HorseManager.Instance.GetAttrValue(attrType);
+ var horsePer = HorseManager.Instance.GetAttrPer(attrType) / 10000.0;
+ var beautyValue = BeautyMMManager.Instance.GetAttrValue(attrType);
+ var beautyPer = BeautyMMManager.Instance.GetAttrPer(attrType) / 10000.0;
+ var fatesValue = HeroFatesManager.Instance.GetAttrValue(attrType);
+ var fatesPer = HeroFatesManager.Instance.GetAttrPer(attrType) / 10000.0;
+
+ djgAttrs.TryGetValue(attrType, out var dingjungeValue);
+ var dingjungePer = GetAttrPer(attrType, djgAttrs) / 10000.0; //榛樿涓嶉渶瑕佸姞锛岀埇濉旂壒娈婄敤锛岄厤鍚堝叕寮�
+
+ minggeAttrs.TryGetValue(attrType, out var minggeValue);
+ var minggePer = GetAttrPer(attrType, minggeAttrs) / 10000.0;
- propertyVariables[LV_VALUE] = lvAttrs.ContainsKey(attrType) ? lvAttrs[attrType] : 0;
- propertyVariables[EQUIP_VALUE] = equipAttrs.ContainsKey(attrType) ? equipAttrs[attrType] : 0;
- // propertyVariables[BOOK_VALUE] = 0;
- propertyVariables[REALM_VALUE] = officialAttrs.ContainsKey(attrType) ? officialAttrs[attrType] : 0;
- propertyVariables[REALM_PER] = GetOfficialPer(attrType) / 10000.0f;
- // propertyVariables[BOOK_PER] = GetBookPer(attrType) / 10000.0f;
- propertyVariables[GUBAO_VALUE] = 0;
- propertyVariables[GUBAO_PER] = 0;
- propertyVariables[HJG_VALUE] = PhantasmPavilionManager.Instance.GetAttrValue(attrType);
- propertyVariables[HJG_PER] = PhantasmPavilionManager.Instance.GetAttrPer(attrType) / 10000.0f;
- propertyVariables[HORSE_VALUE] = HorseManager.Instance.GetAttrValue(attrType);
- propertyVariables[HORSE_PER] = HorseManager.Instance.GetAttrPer(attrType) / 10000.0f;
- propertyVariables[BEAUTY_VALUE] = BeautyMMManager.Instance.GetAttrValue(attrType);
- propertyVariables[BEAUTY_PER] = BeautyMMManager.Instance.GetAttrPer(attrType) / 10000.0f;
- propertyVariables[FATES_VALUE] = HeroFatesManager.Instance.GetAttrValue(attrType);
- propertyVariables[FATES_PER] = HeroFatesManager.Instance.GetAttrPer(attrType) / 10000.0f;
- propertyVariables[DINGJUNGE_VALUE] = 0; //榛樿涓嶉渶瑕佸姞锛岀埇濉旂壒娈婄敤锛岄厤鍚堝叕寮�
- propertyVariables[DINGJUNGE_PER] = 0; //榛樿涓嶉渶瑕佸姞锛岀埇濉旂壒娈婄敤锛岄厤鍚堝叕寮�
-
-
//鍏ㄤ綋鍗$墝鍔犳垚
- propertyVariables[HERO_CARDPER] = allHeroAddPer;
- //锛侊紒锛佸崟姝﹀皢鎴樺姏棰勮鐨勮瘽闇�瑕佹帓闄ら槦浼嶅奖鍝嶆垬鍔涳紝鍙畻姝﹀皢鑷韩鐨勪笂闃靛睘鎬�
- // propertyVariables[LINEUP_INIT_ADD_PER] = GetLineUpPer(attrType, LINEUP_INIT_ADD_PER) / 10000.0f;
- // propertyVariables[LINEUP_LV_ADD_PER] = GetLineUpPer(attrType, LINEUP_LV_ADD_PER) / 10000.0f;
- // propertyVariables[LINEUP_BREAK_LV_ADD_PER] = GetLineUpPer(attrType, LINEUP_BREAK_LV_ADD_PER) / 10000.0f;
- // propertyVariables[LINEUP_STAR_ADD_PER] = GetLineUpPer(attrType, LINEUP_STAR_ADD_PER) / 10000.0f;
+ double cardPer = 0;
+ if (attrType == 6 || attrType == 7 || attrType == 8)
+ {
+ cardPer = allHeroAddPer;
+ }
//闃靛鍏夌幆 涓夊洿鐧惧垎姣斿姞鎴�
- propertyVariables[LINEUP_HALO_VALUE] = countryAttrs.ContainsKey(attrType) ? countryAttrs[attrType] : 0;
- propertyVariables[LINEUP_HALO_PER] = GetCountryPer(attrType) / 10000.0f;
+ var lineupHaloPer = GetCountryPer(attrType) / 10000.0;
//姝﹀皢灞炴��
- propertyVariables[INHERIT_PER] = hero.GetInheritAttrPer(attrType) / 10000.0f;
- propertyVariables[HERO_SELF_VALUE] = hero.GetSelfAddValue(attrType);
- propertyVariables[HERO_SELF_PER] = hero.GetSelfAddPer(attrType) / 10000.0f;
- propertyVariables[STAR_TALENT_VALUE] = hero.GetTalentAttrValue(attrType);
- propertyVariables[STAR_TALENT_PER] = hero.GetTalentAttrPer(attrType) / 10000.0f;
- propertyVariables[BREAK_LV_VALUE] = hero.GetBreakAttrValue(attrType);
- propertyVariables[BREAK_LV_PER] = hero.GetBreakAttrPer(attrType) / 10000.0f;
- propertyVariables[AWAKE_TALENT_VALUE] = hero.GetAwakeAttrValue(attrType);
- propertyVariables[AWAKE_TALENT_PER] = hero.GetAwakeAttrPer(attrType) / 10000.0f;
- propertyVariables[FETTER_VALUE] = hero.GetFetterAttrValue(attrType);
- propertyVariables[FETTER_PER] = hero.GetFetterAttrPer(attrType) / 10000.0f;
- propertyVariables[HERO_LV_VALUE] = hero.GetHeroLVValue(attrType);
- propertyVariables[HERO_LV_PER] = hero.GetHeroLVPer(attrType) / 10000.0f;
+ var inheritPer = hero.GetInheritAttrPer(attrType) / 10000.0;
+ var heroSelfValue = hero.GetSelfAddValue(attrType);
+ var starTalentPer = hero.GetTalentAttrPer(attrType) / 10000.0;
+ var breakLVPer = hero.GetBreakAttrPer(attrType) / 10000.0;
+ var awakeTalentPer = hero.GetAwakeAttrPer(attrType) / 10000.0;
+ var fetterPer = hero.GetFetterAttrPer(attrType) / 10000.0;
+ var heroLVValue = hero.GetHeroLVValue(attrType);
+
+ //姝﹀皢鐨偆
+ var skinValue = HeroUIManager.Instance.GetSkinAttrValue(attrType);
+ var skinPer = HeroUIManager.Instance.GetSkinAttrPer(attrType) / 10000.0;
+ var heroSkinValue = hero.GetHeroSkinValue(attrType);
+
+
+ double value = (lvValue+equipValue+realmValue+gubaoValue+hjgValue+horseValue+beautyValue+fatesValue+skinValue+dingjungeValue+minggeValue)*(1+lineupHaloPer+realmPer+gubaoPer+hjgPer+horsePer+beautyPer+fatesPer+skinPer+cardPer+minggePer)*(inheritPer+fetterPer+starTalentPer+breakLVPer+awakeTalentPer)*(1+dingjungePer)+heroSelfValue+heroLVValue+heroSkinValue;
+
+ //淇濈暀2浣嶅皬鏁�
+ value = Math.Round(value, 2);
+
#if UNITY_EDITOR
//鎺掗櫎鍊间负0鐨勫睘鎬ц緭鍑�
- var tmpPropertyVariables = propertyVariables.Where(x => x.Value > 0).ToDictionary(x => x.Key, x => x.Value);
- if (!tmpPropertyVariables.IsNullOrEmpty())
- propertyStrForDebug += $"灞炴�D {attrType} - {JsonMapper.ToJson(tmpPropertyVariables)}";
+ // var tmpPropertyVariables = propertyVariables.Where(x => x.Value > 0).ToDictionary(x => x.Key, x => x.Value);
+ // if (!tmpPropertyVariables.IsNullOrEmpty())
+ // {
+ // FightPowerDebug($"鎴樺姏锛氭灏咺D {hero.heroId} 灞炴�D {attrType} 鍊� {value} - {JsonMapper.ToJson(tmpPropertyVariables)}");
+ // }
#endif
- if (type == 0)
- return FightPowerFormula.GetBaseAttr(propertyVariables);
- else
- return FightPowerFormula.GetFightAttr(propertyVariables);
+ return value;
}
+ public double GetFighttPropertyVaule(int attrType, HeroInfo hero)
+ {
+ lvAttrs.TryGetValue(attrType, out var lvValue);
+ equipAttrs.TryGetValue(attrType, out var equipValue);
+ officialAttrs.TryGetValue(attrType, out var realmValue);
+ var gubaoValue = GubaoManager.Instance.GetAttrValue(attrType);
+ var hjgValue = PhantasmPavilionManager.Instance.GetAttrValue(attrType);
+ var horseValue = HorseManager.Instance.GetAttrValue(attrType);
+ var beautyValue = BeautyMMManager.Instance.GetAttrValue(attrType);
+ var fatesValue = HeroFatesManager.Instance.GetAttrValue(attrType);
+ djgAttrs.TryGetValue(attrType, out var dingjungeValue);
+ minggeAttrs.TryGetValue(attrType, out var minggeValue);
+ //闃靛鍏夌幆 涓夊洿鐧惧垎姣斿姞鎴�
+ countryAttrs.TryGetValue(attrType, out var lineupHaloValue);
+
+ //姝﹀皢灞炴��
+ var heroSelfValue = hero.GetSelfAddValue(attrType);
+ var starTalentValue = hero.GetTalentAttrValue(attrType);
+ var breakLVValue = hero.GetBreakAttrValue(attrType);
+ var awakeTalentValue = hero.GetAwakeAttrValue(attrType);
+ var fetterValue = hero.GetFetterAttrValue(attrType);
+
+ //姝﹀皢鐨偆
+ var heroSkinValue = hero.GetHeroSkinValue(attrType);
+
+ double value = (lvValue+equipValue+realmValue+gubaoValue+hjgValue+horseValue+beautyValue+fatesValue+dingjungeValue+minggeValue)+(heroSelfValue+heroSkinValue+lineupHaloValue+starTalentValue+breakLVValue+awakeTalentValue)+fetterValue;
+
+ //淇濈暀2浣嶅皬鏁�
+ value = Math.Round(value, 2);
+
+#if UNITY_EDITOR
+ //鎺掗櫎鍊间负0鐨勫睘鎬ц緭鍑�
+ // var tmpPropertyVariables = propertyVariables.Where(x => x.Value > 0).ToDictionary(x => x.Key, x => x.Value);
+ // if (!tmpPropertyVariables.IsNullOrEmpty())
+ // {
+ // FightPowerDebug($"鎴樺姏锛氭灏咺D {hero.heroId} 灞炴�D {attrType} 鍊� {value} - {JsonMapper.ToJson(tmpPropertyVariables)}");
+ // }
+#endif
+ return value;
+ }
// int GetLineUpPer(int attrType, string key)
// {
@@ -393,23 +450,15 @@
// return HeroUIManager.Instance.allHeroBookPer;
// }
- int GetOfficialPer(int attrType)
- {
- if (PlayerPropertyConfig.baseAttr2perDict.ContainsKey(attrType))
- {
- var pertype = PlayerPropertyConfig.baseAttr2perDict[attrType];
- return officialAttrs.ContainsKey(pertype) ? officialAttrs[pertype] : 0;
- }
- return 0;
- }
-
+ //PlayerPropertyConfig.baseAttr2perDict 棰戠箒璋冪敤瀛楀吀鏁堢巼宸�
int GetCountryPer(int attrType)
{
- if (PlayerPropertyConfig.baseAttr2perDict.ContainsKey(attrType))
+ if (attrType == 6 || attrType == 7 || attrType == 8)
{
- var pertype = PlayerPropertyConfig.baseAttr2perDict[attrType];
- return countryAttrs.ContainsKey(pertype) ? countryAttrs[pertype] : 0;
+ var pertype = attrType + 10;
+ countryAttrs.TryGetValue(pertype, out var value);
+ return value;
}
return 0;
@@ -425,16 +474,29 @@
//瑁呭鎴樺姏涓烘渶缁堟�绘垬鍔涚殑缁撴灉姣旓紙鎻愬崌鏁翠釜瑙掕壊鎬绘垬鍔涳級
//璁$畻鎬绘垬鍔涗腑鐨勬灏嗘垬鍔涳紝鍑犱釜姝﹀皢鍔犺捣鏉ュ氨鏄�绘垬鍔涳紝鍏朵粬鍔熻兘灞炴�ц绠楀簲璇ユ兜鐩栧湪鑻遍泟閲�
- public long CalculatePower()
+ // calcType 璁$畻鎴樺姏缂樼敱 0 姝﹀皢 1 瑁呭 2鍛芥牸锛岀敤浜庤妭鐪侀儴鍒嗗紑閿�
+ public long CalculatePower(int calcType)
{
+
#if UNITY_EDITOR
- FightPowerDebug("鎴樺姏锛氬紑濮嬭绠�");
+ if (openLog)
+ {
+ FightPowerDebug("鎴樺姏锛氬紑濮嬭绠�");
+ }
#endif
// --- 鍏堣绠楁墍鏈夊姛鑳界殑姹囨�诲睘鎬� ---
RefreshLVAttrs();
RefreshOfficialAttrs();
RefrehEquipAttrs();
- RefreshTeamAttrs();
+ RefrehMinggeAttrs();
+ djgAttrs.Clear();
+
+ bool diffFP = lastFightPower != PlayerDatas.Instance.baseData.FightPower; //鎴樺姏鏄惁鏈夊彉鍖�
+ if (diffFP || calcType == 0)
+ {
+ lastFightPower = PlayerDatas.Instance.baseData.FightPower;
+ RefreshTeamAttrs();
+ }
// --- 绠楀崟姝﹀皢鍔熻兘灞炴�ф垬鍔� 鍚庣浉鍔�---
long fightPower = 0;
@@ -460,123 +522,237 @@
}
-// #if UNITY_EDITOR
- FightPowerDebug("鎴樺姏锛氳绠楀畬姣� " + fightPower);
-// #endif
+ if (diffFP || calcType == 2)
+ {
+ lastMinggeSkillPower = GetMinggeSkillPower();
+ }
+
+ fightPower += lastMinggeSkillPower;
+#if UNITY_EDITOR
+ if (openLog)
+ {
+ FightPowerDebug("鍛芥牸鎶�鑳芥垬鍔� " + lastMinggeSkillPower);
+ FightPowerDebug("鎴樺姏锛氳绠楀畬姣� " + fightPower);
+ }
+#endif
return fightPower;
}
-#if UNITY_EDITOR
- string propertyStrForDebug = "";
-#endif
+
//璁$畻闃靛涓灏嗘垬鍔�
public long CalculateTeamHeroPower(HeroInfo hero)
{
-
- fightPowerVariables.Clear();
hero.RefreshFetterAttrsWhenCalcPower(teamTypeCalc); //缇佺粖灞炴�ц瀹炴椂绠�
+ hero.RefreshInheritPer();
-#if UNITY_EDITOR
- propertyStrForDebug = "";
-#endif
- foreach (var config in pConfig)
- {
- if (config.showType < 1 || config.showType > 4)
- {
- continue;
- }
- if (config.showType == 1)
- {
- fightPowerVariables[config.Parameter] = Math.Round(GetPropertyVaule(config.ID, hero, 0), 3);
- }
- else
- {
- fightPowerVariables[config.Parameter] = Math.Round(GetPropertyVaule(config.ID, hero, 1), 3);
- }
- }
+ var Atk = GetPropertyVaule(6, hero);
+ var Def = GetPropertyVaule(7, hero);
+ var MaxHP = GetPropertyVaule(8, hero);
+ var AtkSpeed = GetFighttPropertyVaule(11, hero);
+ var StunRate = GetFighttPropertyVaule(21, hero) + GetFighttPropertyVaule(33, hero);
+ var StunRateDef = GetFighttPropertyVaule(22, hero) + GetFighttPropertyVaule(34, hero);
+ var SuperHitRate = GetFighttPropertyVaule(23, hero) + GetFighttPropertyVaule(33, hero);
+ var SuperHitRateDef = GetFighttPropertyVaule(24, hero) + GetFighttPropertyVaule(34, hero);
+ var ComboRate = GetFighttPropertyVaule(25, hero) + GetFighttPropertyVaule(33, hero);
+ var ComboRateDef = GetFighttPropertyVaule(26, hero) + GetFighttPropertyVaule(34, hero);
+ var MissRate = GetFighttPropertyVaule(27, hero) + GetFighttPropertyVaule(33, hero);
+ var MissRateDef = GetFighttPropertyVaule(28, hero) + GetFighttPropertyVaule(34, hero);
+ var ParryRate = GetFighttPropertyVaule(29, hero) + GetFighttPropertyVaule(33, hero);
+ var ParryRateDef = GetFighttPropertyVaule(30, hero) + GetFighttPropertyVaule(34, hero);
+ var SuckHPPer = GetFighttPropertyVaule(31, hero) + GetFighttPropertyVaule(33, hero);
+ var SuckHPPerDef = GetFighttPropertyVaule(32, hero) + GetFighttPropertyVaule(34, hero);
-#if UNITY_EDITOR
- FightPowerDebug($"鎴樺姏锛氭灏咺D {hero.heroId} 灞炴�т俊鎭� {propertyStrForDebug}");
-#endif
+ var FinalDamPer = GetFighttPropertyVaule(35, hero);
+ var FinalDamPerDef = GetFighttPropertyVaule(36, hero);
+ var PhyDamPer = GetFighttPropertyVaule(37, hero);
+ var PhyDamPerDef = GetFighttPropertyVaule(38, hero);
+ var MagDamPer = GetFighttPropertyVaule(39, hero);
+ var MagDamPerDef = GetFighttPropertyVaule(40, hero);
+ var NormalSkillPer = GetFighttPropertyVaule(41, hero);
+ var NormalSkillPerDef = GetFighttPropertyVaule(42, hero);
+ var AngerSkillPer = GetFighttPropertyVaule(43, hero);
+ var AngerSkillPerDef = GetFighttPropertyVaule(44, hero);
+ var SuperDamPer = GetFighttPropertyVaule(45, hero);
+ var SuperDamPerDef = GetFighttPropertyVaule(46, hero);
+
+ var CurePer = GetFighttPropertyVaule(51, hero);
+ var CurePerDef = GetFighttPropertyVaule(52, hero);
+ var ShieldPer = GetFighttPropertyVaule(53, hero);
+ var ShieldPerDef = GetFighttPropertyVaule(54, hero);
+ var DOTPer = GetFighttPropertyVaule(55, hero);
+ var DOTPerDef = GetFighttPropertyVaule(56, hero);
+ var WeiFinalDamPer = GetFighttPropertyVaule(57, hero);
+ var WeiFinalDamPerDef = GetFighttPropertyVaule(58, hero);
+ var ShuFinalDamPer = GetFighttPropertyVaule(59, hero);
+ var ShuFinalDamPerDef = GetFighttPropertyVaule(60, hero);
+ var WuFinalDamPer = GetFighttPropertyVaule(61, hero);
+ var WuFinalDamPerDef = GetFighttPropertyVaule(62, hero);
+ var QunFinalDamPer = GetFighttPropertyVaule(63, hero);
+ var QunFinalDamPerDef = GetFighttPropertyVaule(64, hero);
+
+ var PVPDamPer = GetFighttPropertyVaule(71, hero);
+ var PVPDamPerDef = GetFighttPropertyVaule(72, hero);
+ var Guanchuan = GetFighttPropertyVaule(77, hero);
+ var GuanchuanDef = GetFighttPropertyVaule(78, hero);
+ var Zhaojia = GetFighttPropertyVaule(79, hero);
+ var ZhaojiaDef = GetFighttPropertyVaule(80, hero);
+
//灞炴�х郴鏁版牴鎹畼鑱岀瓑绾х殑鍔犳垚
var fightPowerRatioConfig = FightPowerRatioConfig.Get(PlayerDatas.Instance.baseData.realmLevel);
+ var AtkSpeedRatio = fightPowerRatioConfig.AtkSpeedRatio;
+ var AtkRatio = fightPowerRatioConfig.AtkRatio;
+ var DefRatio = fightPowerRatioConfig.DefRatio;
+ var MaxHPRatio = fightPowerRatioConfig.MaxHPRatio;
+ var StunRateRatio = fightPowerRatioConfig.StunRateRatio;
+ var SuperHitRateRatio = fightPowerRatioConfig.SuperHitRateRatio;
+ var ComboRateRatio = fightPowerRatioConfig.ComboRateRatio;
+ var MissRateRatio = fightPowerRatioConfig.MissRateRatio;
+ var ParryRateRatio = fightPowerRatioConfig.ParryRateRatio;
+ var SuckHPPerRatio = fightPowerRatioConfig.SuckHPPerRatio;
+ var StunRateDefRatio = fightPowerRatioConfig.StunRateDefRatio;
+ var SuperHitRateDefRatio = fightPowerRatioConfig.SuperHitRateDefRatio;
+ var ComboRateDefRatio = fightPowerRatioConfig.ComboRateDefRatio;
+ var MissRateDefRatio = fightPowerRatioConfig.MissRateDefRatio;
+ var ParryRateDefRatio = fightPowerRatioConfig.ParryRateDefRatio;
+ var SuckHPPerDefRatio = fightPowerRatioConfig.SuckHPPerDefRatio;
+ var NormalSkillPerRatio = fightPowerRatioConfig.NormalSkillPerRatio;
+ var NormalSkillPerDefRatio = fightPowerRatioConfig.NormalSkillPerDefRatio;
+ var AngerSkillPerRatio = fightPowerRatioConfig.AngerSkillPerRatio;
+ var AngerSkillPerDefRatio = fightPowerRatioConfig.AngerSkillPerDefRatio;
+ var SuperDamPerRatio = fightPowerRatioConfig.SuperDamPerRatio;
+ var SuperDamPerDefRatio = fightPowerRatioConfig.SuperDamPerDefRatio;
+ var ShieldPerRatio = fightPowerRatioConfig.ShieldPerRatio;
+ var ShieldPerDefRatio = fightPowerRatioConfig.ShieldPerDefRatio;
+ var DOTPerRatio = fightPowerRatioConfig.DOTPerRatio;
+ var DOTPerDefRatio = fightPowerRatioConfig.DOTPerDefRatio;
+ var WeiFinalDamPerRatio = fightPowerRatioConfig.WeiFinalDamPerRatio;
+ var WeiFinalDamPerDefRatio = fightPowerRatioConfig.WeiFinalDamPerDefRatio;
+ var ShuFinalDamPerRatio = fightPowerRatioConfig.ShuFinalDamPerRatio;
+ var ShuFinalDamPerDefRatio = fightPowerRatioConfig.ShuFinalDamPerDefRatio;
+ var WuFinalDamPerRatio = fightPowerRatioConfig.WuFinalDamPerRatio;
+ var WuFinalDamPerDefRatio = fightPowerRatioConfig.WuFinalDamPerDefRatio;
+ var QunFinalDamPerRatio = fightPowerRatioConfig.QunFinalDamPerRatio;
+ var QunFinalDamPerDefRatio = fightPowerRatioConfig.QunFinalDamPerDefRatio;
+ var FinalDamPerRatio = fightPowerRatioConfig.FinalDamPerRatio;
+ var FinalDamPerDefRatio = fightPowerRatioConfig.FinalDamPerDefRatio;
+ var PhyDamPerRatio = fightPowerRatioConfig.PhyDamPerRatio;
+ var PhyDamPerDefRatio = fightPowerRatioConfig.PhyDamPerDefRatio;
+ var MagDamPerRatio = fightPowerRatioConfig.MagDamPerRatio;
+ var MagDamPerDefRatio = fightPowerRatioConfig.MagDamPerDefRatio;
+ var CurePerRatio = fightPowerRatioConfig.CurePerRatio;
+ var CurePerDefRatio = fightPowerRatioConfig.CurePerDefRatio;
+ var PVPDamPerRatio = fightPowerRatioConfig.PVPDamPerRatio;
+ var PVPDamPerDefRatio = fightPowerRatioConfig.PVPDamPerDefRatio;
+ var GuanchuanRatio = fightPowerRatioConfig.GuanchuanRatio;
+ var GuanchuanDefRatio = fightPowerRatioConfig.GuanchuanDefRatio;
+ var ZhaojiaRatio = fightPowerRatioConfig.ZhaojiaRatio;
+ var ZhaojiaDefRatio = fightPowerRatioConfig.ZhaojiaDefRatio;
- fightPowerVariables[ATK_RATIO] = fightPowerRatioConfig.AtkRatio;
- fightPowerVariables[MAX_HP_RATIO] = fightPowerRatioConfig.MaxHPRatio;
- fightPowerVariables[DEF_RATIO] = fightPowerRatioConfig.DefRatio;
- fightPowerVariables[STUN_RATE_RATIO] = fightPowerRatioConfig.StunRateRatio;
- fightPowerVariables[SUPER_HIT_RATE_RATIO] = fightPowerRatioConfig.SuperHitRateRatio;
- fightPowerVariables[COMBO_RATE_RATIO] = fightPowerRatioConfig.ComboRateRatio;
- fightPowerVariables[MISS_RATE_RATIO] = fightPowerRatioConfig.MissRateRatio;
- fightPowerVariables[PARRY_RATE_RATIO] = fightPowerRatioConfig.ParryRateRatio;
- fightPowerVariables[SUCK_HP_PER_RATIO] = fightPowerRatioConfig.SuckHPPerRatio;
- fightPowerVariables[STUN_RATE_DEF_RATIO] = fightPowerRatioConfig.StunRateDefRatio;
- fightPowerVariables[SUPER_HIT_RATE_DEF_RATIO] = fightPowerRatioConfig.SuperHitRateDefRatio;
- fightPowerVariables[COMBO_RATE_DEF_RATIO] = fightPowerRatioConfig.ComboRateDefRatio;
- fightPowerVariables[MISS_RATE_DEF_RATIO] = fightPowerRatioConfig.MissRateDefRatio;
- fightPowerVariables[PARRY_RATE_DEF_RATIO] = fightPowerRatioConfig.ParryRateDefRatio;
- fightPowerVariables[SUCK_HP_PER_DEF_RATIO] = fightPowerRatioConfig.SuckHPPerDefRatio;
- fightPowerVariables[NORMAL_SKILL_PER_RATIO] = fightPowerRatioConfig.NormalSkillPerRatio;
- fightPowerVariables[NORMAL_SKILL_PER_DEF_RATIO] = fightPowerRatioConfig.NormalSkillPerDefRatio;
- fightPowerVariables[ANGER_SKILL_PER_RATIO] = fightPowerRatioConfig.AngerSkillPerRatio;
- fightPowerVariables[ANGER_SKILL_PER_DEF_RATIO] = fightPowerRatioConfig.AngerSkillPerDefRatio;
- fightPowerVariables[SUPER_DAM_PER_RATIO] = fightPowerRatioConfig.SuperDamPerRatio;
- fightPowerVariables[SUPER_DAM_PER_DEF_RATIO] = fightPowerRatioConfig.SuperDamPerDefRatio;
- fightPowerVariables[SHIELD_PER_RATIO] = fightPowerRatioConfig.ShieldPerRatio;
- fightPowerVariables[SHIELD_PER_DEF_RATIO] = fightPowerRatioConfig.ShieldPerDefRatio;
- fightPowerVariables[DOT_PER_RATIO] = fightPowerRatioConfig.DOTPerRatio;
- fightPowerVariables[DOT_PER_DEF_RATIO] = fightPowerRatioConfig.DOTPerDefRatio;
- fightPowerVariables[WEI_FINAL_DAM_PER_RATIO] = fightPowerRatioConfig.WeiFinalDamPerRatio;
- fightPowerVariables[WEI_FINAL_DAM_PER_DEF_RATIO] = fightPowerRatioConfig.WeiFinalDamPerDefRatio;
- fightPowerVariables[SHU_FINAL_DAM_PER_RATIO] = fightPowerRatioConfig.ShuFinalDamPerRatio;
- fightPowerVariables[SHU_FINAL_DAM_PER_DEF_RATIO] = fightPowerRatioConfig.ShuFinalDamPerDefRatio;
- fightPowerVariables[WU_FINAL_DAM_PER_RATIO] = fightPowerRatioConfig.WuFinalDamPerRatio;
- fightPowerVariables[WU_FINAL_DAM_PER_DEF_RATIO] = fightPowerRatioConfig.WuFinalDamPerDefRatio;
- fightPowerVariables[QUN_FINAL_DAM_PER_RATIO] = fightPowerRatioConfig.QunFinalDamPerRatio;
- fightPowerVariables[QUN_FINAL_DAM_PER_DEF_RATIO] = fightPowerRatioConfig.QunFinalDamPerDefRatio;
- fightPowerVariables[FINAL_DAM_PER_RATIO] = fightPowerRatioConfig.FinalDamPerRatio;
- fightPowerVariables[FINAL_DAM_PER_DEF_RATIO] = fightPowerRatioConfig.FinalDamPerDefRatio;
- fightPowerVariables[PHY_DAM_PER_RATIO] = fightPowerRatioConfig.PhyDamPerRatio;
- fightPowerVariables[PHY_DAM_PER_DEF_RATIO] = fightPowerRatioConfig.PhyDamPerDefRatio;
- fightPowerVariables[MAG_DAM_PER_RATIO] = fightPowerRatioConfig.MagDamPerRatio;
- fightPowerVariables[MAG_DAM_PER_DEF_RATIO] = fightPowerRatioConfig.MagDamPerDefRatio;
- fightPowerVariables[CURE_PER_RATIO] = fightPowerRatioConfig.CurePerRatio;
- fightPowerVariables[CURE_PER_DEF_RATIO] = fightPowerRatioConfig.CurePerDefRatio;
- fightPowerVariables[PVP_DAM_PER_RATIO] = fightPowerRatioConfig.PVPDamPerRatio;
- fightPowerVariables[PVP_DAM_PER_DEF_RATIO] = fightPowerRatioConfig.PVPDamPerDefRatio;
- fightPowerVariables[GUANCHUAN_RATIO] = fightPowerRatioConfig.GuanchuanRatio;
- fightPowerVariables[GUANCHUAN_DEF_RATIO] = fightPowerRatioConfig.GuanchuanDefRatio;
- fightPowerVariables[ZHAOJIA_RATIO] = fightPowerRatioConfig.ZhaojiaRatio;
- fightPowerVariables[ZHAOJIA_DEF_RATIO] = fightPowerRatioConfig.ZhaojiaDefRatio;
-
-
- long fightPower = (long)FightPowerFormula.GetFightPower(fightPowerVariables);
-#if UNITY_EDITOR
- //鎺掗櫎鍊间负0鐨勫睘鎬ц緭鍑�
- var tmpFightPowerVariables = fightPowerVariables.Where(x => x.Value > 0).ToDictionary(x => x.Key, x => x.Value);
- if (!tmpFightPowerVariables.IsNullOrEmpty())
- FightPowerDebug($"鎴樺姏锛氭灏咺D {hero.heroId} 灞炴�ф垬鍔� {fightPower} 灞炴�ф垬鍔涘弬鏁� {JsonMapper.ToJson(tmpFightPowerVariables)}");
-#endif
+ long fightPower = (long)(Atk*AtkRatio+MaxHP*MaxHPRatio+Def*DefRatio+AtkSpeed*AtkSpeedRatio+(StunRate*StunRateRatio+SuperHitRate*SuperHitRateRatio+ComboRate*ComboRateRatio+MissRate*MissRateRatio+ParryRate*ParryRateRatio+SuckHPPer*SuckHPPerRatio+StunRateDef*StunRateDefRatio+SuperHitRateDef*SuperHitRateDefRatio+ComboRateDef*ComboRateDefRatio+MissRateDef*MissRateDefRatio+ParryRateDef*ParryRateDefRatio+SuckHPPerDef*SuckHPPerDefRatio+FinalDamPer*FinalDamPerRatio+FinalDamPerDef*FinalDamPerDefRatio+PhyDamPer*PhyDamPerRatio+PhyDamPerDef*PhyDamPerDefRatio+MagDamPer*MagDamPerRatio+MagDamPerDef*MagDamPerDefRatio+NormalSkillPer*NormalSkillPerRatio+NormalSkillPerDef*NormalSkillPerDefRatio+AngerSkillPer*AngerSkillPerRatio+AngerSkillPerDef*AngerSkillPerDefRatio+SuperDamPer*SuperDamPerRatio+SuperDamPerDef*SuperDamPerDefRatio+CurePer*CurePerRatio+CurePerDef*CurePerDefRatio+ShieldPer*ShieldPerRatio+ShieldPerDef*ShieldPerDefRatio+DOTPer*DOTPerRatio+DOTPerDef*DOTPerDefRatio+WeiFinalDamPer*WeiFinalDamPerRatio+WeiFinalDamPerDef*WeiFinalDamPerDefRatio+ShuFinalDamPer*ShuFinalDamPerRatio+ShuFinalDamPerDef*ShuFinalDamPerDefRatio+WuFinalDamPer*WuFinalDamPerRatio+WuFinalDamPerDef*WuFinalDamPerDefRatio+QunFinalDamPer*QunFinalDamPerRatio+QunFinalDamPerDef*QunFinalDamPerDefRatio+PVPDamPer*PVPDamPerRatio+PVPDamPerDef*PVPDamPerDefRatio+Guanchuan*GuanchuanRatio+GuanchuanDef*GuanchuanDefRatio+Zhaojia*ZhaojiaRatio+ZhaojiaDef*ZhaojiaDefRatio)/100.0-55000);
+
+// #if UNITY_EDITOR
+// //鎺掗櫎鍊间负0鐨勫睘鎬ц緭鍑�
+// var tmpFightPowerVariables = fightPowerVariables.Where(x => x.Value > 0).ToDictionary(x => x.Key, x => x.Value);
+// if (!tmpFightPowerVariables.IsNullOrEmpty())
+// FightPowerDebug($"鎴樺姏锛氭灏咺D {hero.heroId} 灞炴�ф垬鍔� {fightPower} 灞炴�ф垬鍔涘弬鏁� {JsonMapper.ToJson(tmpFightPowerVariables)}");
+// #endif
//鍔犱笂鎶�鑳芥垬鍔�
- fightPowerVariables.Clear();
- fightPowerVariables[PLAYER_LV] = PlayerDatas.Instance.baseData.LV;
- fightPowerVariables[OFFICIAL_LV] = PlayerDatas.Instance.baseData.realmLevel;
- fightPowerVariables[SKILL_POWER] = hero.GetSkillsFightPower();
- long skillPower = (long)FightPowerFormula.GetSkillsFightPower(fightPowerVariables);
+ var SkillPower = hero.GetSkillsFightPower();
+ var OfficialLV = PlayerDatas.Instance.baseData.realmLevel;
+
+ long skillPower = SkillPower*OfficialLV;;
#if UNITY_EDITOR
- FightPowerDebug($"鎴樺姏锛氭灏咺D {hero.heroId} 鎶�鑳芥垬鍔� {skillPower} 鎶�鑳藉弬鏁� {JsonMapper.ToJson(fightPowerVariables)}");
-
+ if (openLog)
+ {
FightPowerDebug($"鎴樺姏锛氭灏咺D {hero.heroId} 鎬绘垬鍔� {fightPower + skillPower}");
+ }
+
#endif
- return fightPower + skillPower;
+ return fightPower + skillPower;
}
+ //鍛芥牸鎶�鑳芥垬鍔涳細鎸変釜鏁拌幏鍙栧搴旂瓑绾х殑鎶�鑳芥垬鍔�
+ long GetMinggeSkillPower()
+ {
+ //褰撳墠鏂规鎶�鑳戒俊鎭�
+ var dict = MinggeManager.Instance.GetMinggeSkillCountDictByPresetID(minggePresetID);
+
+ ItemModel dropEquip = null;
+ if (minggeDropIndex != -1)
+ {
+ dropEquip = PackManager.Instance.GetItemByIndex(PackType.MinggeDrop, minggeDropIndex);
+ //甯︽妧鑳界殑鍛芥牸 闇�鍒ゆ柇鏄惁鎶�鑳戒釜鏁板彉鍖�
+ if (MinggeManager.Instance.minggeSkillEquipPlaceList.Contains(dropEquip.config.EquipPlace))
+ {
+ var packIndex = MinggeManager.Instance.GetPackIndex(minggePresetID, dropEquip.config.EquipPlace);
+ //瑕佸姣旂殑瑁呭
+ var equip = PackManager.Instance.GetItemByIndex(PackType.Mingge, packIndex);
+ var _skillTypeID = EquipModel.Instance.GetEquipSkillID(dropEquip);
+ if (equip == null)
+ {
+ if (dict.ContainsKey(_skillTypeID))
+ {
+ dict[_skillTypeID] += 1;
+ }
+ }
+ else
+ {
+ var oldSkillTypeID = EquipModel.Instance.GetEquipSkillID(equip);
+ if (oldSkillTypeID != _skillTypeID)
+ {
+
+ if (dict.ContainsKey(_skillTypeID))
+ {
+ dict[_skillTypeID] += 1;
+ }
+ else
+ {
+ dict[_skillTypeID] = 1;
+ }
+ if (dict.ContainsKey(oldSkillTypeID))
+ {
+ dict[oldSkillTypeID] -= 1;
+ }
+ }
+ }
+
+ }
+ }
+
+ long skillPower = 0;
+
+ foreach (var item in dict)
+ {
+ if (item.Value == 0)
+ {
+ continue;
+ }
+ var skill = SkillConfig.Get(item.Key + item.Value - 1);
+ if (skill == null)
+ {
+ Debug.LogError("skill is null" + (item.Key + item.Value - 1));
+ continue;
+ }
+ var SkillPower = skill.FightPower;
+ var OfficialLV = PlayerDatas.Instance.baseData.realmLevel;
+ skillPower += SkillPower*OfficialLV;;
+ }
+
+
+#if UNITY_EDITOR
+ if (openLog)
+ {
+ FightPowerDebug($"鍛芥牸鎶�鑳芥垬鍔� {skillPower}");
+ }
+#endif
+ return skillPower;
+ }
/// <summary>
@@ -587,14 +763,29 @@
public long GetFightPowerChange(ItemModel item)
{
InitFightPowerParam();
- var fightPower = CalculatePower();
-
+ var fightPower = CalculatePower(1);
+
InitFightPowerParam(dropindex: item.gridIndex);
- var tmpFightPower = CalculatePower();
- return tmpFightPower - fightPower;
+ var tmpFightPower = CalculatePower(1);
+ EquipRecordManager.Instance.showFightPower = tmpFightPower - fightPower;
+ // 鍚屾椂璁板綍瑁呭鏃ュ織鎴樺姏
+ return EquipRecordManager.Instance.showFightPower;
}
-
+ /// <summary>
+ /// 鍛芥牸瑁呭瀵规瘮
+ /// </summary>
+ /// minggePresetID 鎸囪瀵规瘮鐨勫摢濂楁柟妗堜笅鐨勫懡鏍硷紝鐜╁鍙互鐐瑰嚮鍒囨崲瀵规瘮锛岃嚜鍔ㄩ粯璁や細閬嶅巻鎵�鏈夋縺娲绘柟妗�
+ public long GetFightPowerMinggeChange(ItemModel item, int minggePresetID)
+ {
+ InitFightPowerParam(_minggePresetID: minggePresetID);
+ var fightPower = CalculatePower(2);
+
+ InitFightPowerParam(_minggePresetID: minggePresetID, _minggeDropIndex: item.gridIndex);
+ var tmpFightPower = CalculatePower(2);
+ return tmpFightPower - fightPower;
+ }
+
// 鍗曡嫳闆勬煡鐪嬫垬鍔�
// 1. 涓婇樀鑻遍泟鏄剧ず锛屽湪涓荤嚎闃靛涓嬬殑鎴樺姏
@@ -602,7 +793,7 @@
public long GetHeroFightPower(HeroInfo heroInfo)
{
bool ispreview = false;
- var team = TeamManager.Instance.GetTeam(TeamType.Story);
+ var team = TeamManager.Instance.GetTeam(TeamManager.Instance.GetMainTeamID());
if (!team.HasHero(heroInfo.itemHero.guid))
{
//鏇挎崲涓婇樀浣嶇疆
@@ -621,11 +812,14 @@
InitFightPowerParam(ispreview: ispreview);
RefreshLVAttrs();
RefreshOfficialAttrs();
+ RefrehMinggeAttrs();
RefrehEquipAttrs();
RefreshTeamAttrs();
+ djgAttrs.Clear();
var fightPower = CalculateTeamHeroPower(heroInfo);
-
+ fightPower += GetMinggeSkillPower();
+
//璁$畻瀹屾仮澶嶉槦浼�
if (ispreview)
team.RestoreTeam();
@@ -634,53 +828,66 @@
//鏌ョ湅闃靛鎴樺姏
- public long GetTeamFightPower(TeamType team, bool isPreview)
+ public long GetTeamFightPower(int team, bool isPreview)
{
- InitFightPowerParam(team, -1, isPreview);
- return CalculatePower();
+ InitFightPowerParam(team, ispreview:isPreview);
+ return CalculatePower(0);
}
#endregion
+ //鍜屾垬鍔涜绠楁棤鍏筹紝閲嶇畻灞炴�у睍绀虹敤
public Dictionary<int, long> GetHeroTotalAttr(HeroInfo hero)
{
Dictionary<int, long> tmpAttrs = new Dictionary<int, long>();
- hero.RefreshFetterAttrsWhenCalcPower(TeamType.Story); //缇佺粖灞炴�ц瀹炴椂绠�
+ hero.RefreshFetterAttrsWhenCalcPower(TeamManager.Instance.GetMainTeamID()); //缇佺粖灞炴�ц瀹炴椂绠�
-#if UNITY_EDITOR
- propertyStrForDebug = "";
-#endif
-
+ var pConfig = PlayerPropertyConfig.GetValues();
foreach (var config in pConfig)
{
- if (config.showType < 1 || config.showType > 4)
+ if (config.showType != 1 &&
+ config.showType != 2 &&
+ config.showType != 3 &&
+ config.showType != 4 &&
+ config.showType != 7)
{
continue;
}
- if (config.showType == 1)
+ //绾﹀畾姝� 鍙湁3缁存墠鏄熀纭�灞炴��
+ if (config.showType == 1 && config.ID != 11)
{
- tmpAttrs[config.ID] = (long)GetPropertyVaule(config.ID, hero, 0);
+ tmpAttrs[config.ID] = (long)GetPropertyVaule(config.ID, hero);
}
else
{
- tmpAttrs[config.ID] = (long)GetPropertyVaule(config.ID, hero, 1);
+ tmpAttrs[config.ID] = (long)GetFighttPropertyVaule(config.ID, hero);
}
}
-#if UNITY_EDITOR
- FightPowerDebug($"鎴樺姏锛氭灏咺D {hero.heroId} 灞炴�т俊鎭� {propertyStrForDebug}");
-#endif
+
+ //鍏ぇ鎴樻枟灞炴�ч渶瑕佸啀鍔犱笂鎬荤殑鎴樻枟灞炴��
+ int[] fightAttrList = { 21, 23, 25, 27, 29, 31};
+ foreach (var attr in fightAttrList)
+ {
+ tmpAttrs[attr] += tmpAttrs[33];
+ }
+ int[] fightDefAttrList = { 22, 24, 26, 28, 30, 32};
+ foreach (var attr in fightDefAttrList)
+ {
+ tmpAttrs[attr] += tmpAttrs[34];
+ }
+
return tmpAttrs;
}
- bool openLog = true;
+ bool openLog = false;
void FightPowerDebug(string msg)
{
#if UNITY_EDITOR
if (!openLog) return;
Debug.Log(msg);
- #endif
+#endif
}
}
--
Gitblit v1.8.0