From 742e6f216acb0f174c3b83fd8d78141ab507d0ad Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期日, 01 二月 2026 02:18:49 +0800
Subject: [PATCH] 0312 修复淘金网络延迟可能会采集错误的问题;优化战力计算卡顿问题需真机测试
---
Main/System/InternalAffairs/GoldRushRefreshWin.cs | 6
Main/System/Main/EquipRecordManager.cs | 6
Main/Core/GameEngine/Launch/ConfigInitTask.cs | 4
Main/System/Main/FightPowerManager.cs | 558 ++++++++++++++++++++++++-------------------------
Main/System/Main/FightPowerFormula.cs | 2
Main/System/Equip/EquipExchangeCell.cs | 5
Main/System/InternalAffairs/GoldRushManager.cs | 55 ++++
7 files changed, 341 insertions(+), 295 deletions(-)
diff --git a/Main/Core/GameEngine/Launch/ConfigInitTask.cs b/Main/Core/GameEngine/Launch/ConfigInitTask.cs
index bb9162e..3b3d4ce 100644
--- a/Main/Core/GameEngine/Launch/ConfigInitTask.cs
+++ b/Main/Core/GameEngine/Launch/ConfigInitTask.cs
@@ -88,7 +88,9 @@
allVariables.UnionWith(fightPropertyVariables);
allVariables.UnionWith(fightPowerVariables);
allVariables.UnionWith(skillFightPowerVariables);
-
+
+ code.AppendLine(" // 锛侊紒锛佽鏂囦欢宸插簾寮冿紝鍏紡鍦� FightPowerManager 涓洿鎺ュ鐞嗭紝瀛楀吀澶ч噺琚皟鐢ㄤ細浜х敓鎬ц兘鍙奊C闂");
+ code.AppendLine(" // 姝ゆ枃浠剁幇鍦ㄧ殑鐢ㄩ�斾负鎻愰啋绋嬪簭鍏紡鍙戠敓浜嗗彉鍖栵紝闇�鎵嬪姩淇敼FightPowerManager浠g爜");
code.AppendLine(" // 鍙橀噺鍚嶅父閲忓畾涔�");
foreach (var variable in allVariables)
{
diff --git a/Main/System/Equip/EquipExchangeCell.cs b/Main/System/Equip/EquipExchangeCell.cs
index 86cab66..bdbe329 100644
--- a/Main/System/Equip/EquipExchangeCell.cs
+++ b/Main/System/Equip/EquipExchangeCell.cs
@@ -45,6 +45,7 @@
putonButton.AddListener(() =>
{
AutoFightModel.Instance.hasAutoExchanged = true;
+ EquipRecordManager.Instance.showFightPower = -1;
EquipModel.Instance.SendEquipOP(new ushort[] { (ushort)EquipModel.Instance.selectFloorEquip.gridIndex }, 2);
});
@@ -217,6 +218,7 @@
if (ok)
{
AutoFightModel.Instance.hasAutoExchanged = true;
+ EquipRecordManager.Instance.showFightPower = -1;
EquipModel.Instance.SendEquipOP(new ushort[] { (ushort)EquipModel.Instance.selectFloorEquip.gridIndex }, 2, decomposeCheck.isOn);
}
@@ -225,6 +227,7 @@
else
{
AutoFightModel.Instance.hasAutoExchanged = true;
+ EquipRecordManager.Instance.showFightPower = -1;
EquipModel.Instance.SendEquipOP(new ushort[] { (ushort)EquipModel.Instance.selectFloorEquip.gridIndex }, 2, decomposeCheck.isOn);
}
@@ -242,6 +245,7 @@
if (ok)
{
AutoFightModel.Instance.hasAutoExchanged = true;
+ EquipRecordManager.Instance.showFightPower = -1;
EquipModel.Instance.SendEquipOP(new ushort[] { (ushort)EquipModel.Instance.selectFloorEquip.gridIndex }, 1);
}
@@ -250,6 +254,7 @@
else
{
AutoFightModel.Instance.hasAutoExchanged = true;
+ EquipRecordManager.Instance.showFightPower = -1;
EquipModel.Instance.SendEquipOP(new ushort[] { (ushort)EquipModel.Instance.selectFloorEquip.gridIndex }, 1);
}
}
diff --git a/Main/System/InternalAffairs/GoldRushManager.cs b/Main/System/InternalAffairs/GoldRushManager.cs
index c512ef5..9d2a3e2 100644
--- a/Main/System/InternalAffairs/GoldRushManager.cs
+++ b/Main/System/InternalAffairs/GoldRushManager.cs
@@ -3,6 +3,7 @@
using System.Collections.Generic;
using System.Linq;
+using UnityEngine;
//娣橀噾鍔熻兘
public class GoldRushManager : GameSystemManager<GoldRushManager>
@@ -13,7 +14,7 @@
public int lastRecoverTime; // 涓婃鍏嶈垂鎭㈠娣橀噾浠ゆ椂闂存埑锛屼负0鏃跺彲涓嶇敤鍊掕鏃�
public int housekeeperEndTime; // 鑷姩绠″鍒版湡鏃堕棿鎴筹紝鏈夊�煎悓鏃朵篃浠h〃鍏嶈垂璇曠敤宸蹭娇鐢�
public byte[] warehouseIDList; //瀹屾垚鐨勶紝鍖呭惈0绌猴紝涓昏鐢ㄤ簬棰嗗彇鐨勭储寮�
- public Dictionary<int, HB037_tagSCGoldRushCampInfo.tagSCGoldRushCamp> campInfoDict = new Dictionary<int, HB037_tagSCGoldRushCampInfo.tagSCGoldRushCamp>();
+ public Dictionary<int, GoldRushCamp> campInfoDict = new Dictionary<int, GoldRushCamp>();
public Dictionary<int, List<int>> tmpCampWorkerSkinIDDict = new Dictionary<int, List<int>>(); //鏈�鍚庝竴娆¤惀鍦版窐閲戝搴旂殑鐨偆锛堥鍒嗛厤锛夛紝绾补鐢ㄤ簬鏄剧ず妯″瀷
public event Action<int> OnGoldRushCampEvent; //鏈嶅姟绔�氱煡钀ュ湴淇℃伅
@@ -260,7 +261,7 @@
public int GetWorkerSkinID(int campID, int index)
{
if (tmpCampWorkerSkinIDDict.ContainsKey(campID))
- {
+ {
var skinIDs = tmpCampWorkerSkinIDDict[campID];
if (index < skinIDs.Count)
{
@@ -312,7 +313,16 @@
{
for (int i = 0; i < netPack.CampCnt; i++)
{
- campInfoDict[netPack.CampList[i].CampID] = netPack.CampList[i];
+ campInfoDict[netPack.CampList[i].CampID] = new GoldRushCamp()
+ {
+ CampID = netPack.CampList[i].CampID,
+ GoldID = netPack.CampList[i].GoldID,
+ RefreshCnt = netPack.CampList[i].RefreshCnt,
+ IsRefreshing = false,
+ LastRequestTime = 0,
+ EndTime = netPack.CampList[i].EndTime,
+ WorkerCnt = netPack.CampList[i].WorkerCnt
+ };
InitWorkerSkinID(netPack.CampList[i]);
OnGoldRushCampEvent?.Invoke(netPack.CampList[i].CampID);
@@ -434,14 +444,32 @@
public int forceStopCampID;
// 0-鍙戝竷娣橀噾(娑堣�楁窐閲戜护)锛�1-鍒锋柊娣橀噾锛�2-寮�濮嬫窐閲戞垨璋冩暣鐩戝伐鏁帮紱3-鍙栨秷娣橀噾
- public void SendGoldRushOP(int opType, int campID, int workerCnt)
+ public bool SendGoldRushOP(int opType, int campID, int workerCnt)
{
+ if (opType == 1)
+ {
+ //鍒锋柊娣橀噾闇�瑕佸垽鏂洖鍖咃紝涓嶇劧浼氬洜涓虹綉缁滀笉濂藉娆″埛鏂帮紝瀵艰嚧閲囬泦閿欒
+ if (campInfoDict.ContainsKey(campID))
+ {
+ if (campInfoDict[campID].IsRefreshing)
+ {
+ if (Time.time - campInfoDict[campID].LastRequestTime > 10f)
+ {
+ Debug.LogError("绛夊緟鍒锋柊娣橀噾鏃堕棿杩囬暱锛岄噸缃负鍙姹�");
+ campInfoDict[campID].IsRefreshing = false;
+ }
+ return false;
+ }
+ campInfoDict[campID].IsRefreshing = true;
+ campInfoDict[campID].LastRequestTime = Time.time;
+ }
+ }
if (opType == 3)
{
forceStopCampID = campID;
}
if (opType == 2 && workerCnt < GetCampWorkerCnt(campID))
- {
+ {
forceStopCampID = campID;
}
var pack = new CB036_tagCSGoldRushOP();
@@ -453,6 +481,8 @@
{
OnRefreshItemEvent?.Invoke(campID);
}
+
+ return true;
}
//瑙i攣 0-钀ュ湴锛�1-鐩戝伐
@@ -507,7 +537,7 @@
campRedpoint.state = RedPointState.None;
if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.GoldRush))
return;
-
+
if (CheckCanUnLockWorker())
{
workerRedpoint.state = RedPointState.Simple;
@@ -855,7 +885,7 @@
var refreshCnt = GetCampRefreshCnt(campID);
return refreshMoneyList[Math.Min(refreshCnt, refreshMoneyList.Length - 1)];
}
-
+
public bool IsLock(int itemID, out int funcID)
{
funcID = 0;
@@ -873,3 +903,14 @@
}
}
+
+public class GoldRushCamp {
+ public byte CampID; // 钀ュ湴ID锛屼粠1寮�濮�
+ public byte GoldID; // 娣橀噾ID锛屼负0鏃朵唬琛ㄨ钀ュ湴涓虹┖
+ public ushort RefreshCnt; // 宸插埛鏂版鏁�
+ public bool IsRefreshing; //鏄惁姝e湪鍒锋柊涓�
+ public float LastRequestTime; //涓婁竴娆¤姹傚埛鏂版椂闂� Time.time
+ public uint EndTime; // 棰勮瀹屾垚鏃剁殑鏃堕棿鎴筹紝涓�0鏃朵唬琛ㄨ繕鏈紑濮嬫窐閲戯紝閫氳繃璇ユ椂闂磋繘琛屽�掕鏃�
+ public byte WorkerCnt; // 浣跨敤鐩戝伐鏁�
+}
+
diff --git a/Main/System/InternalAffairs/GoldRushRefreshWin.cs b/Main/System/InternalAffairs/GoldRushRefreshWin.cs
index 86e6e22..c9da8d5 100644
--- a/Main/System/InternalAffairs/GoldRushRefreshWin.cs
+++ b/Main/System/InternalAffairs/GoldRushRefreshWin.cs
@@ -235,9 +235,11 @@
return;
}
- GoldRushManager.Instance.SendGoldRushOP(1, GoldRushManager.Instance.selectCampID, 0);
+ if (GoldRushManager.Instance.SendGoldRushOP(1, GoldRushManager.Instance.selectCampID, 0))
+ {
+ SysNotifyMgr.Instance.ShowTip("GoldRush4");
+ }
- SysNotifyMgr.Instance.ShowTip("GoldRush4");
}
void CallBackWorker()
diff --git a/Main/System/Main/EquipRecordManager.cs b/Main/System/Main/EquipRecordManager.cs
index 1098e08..69cbace 100644
--- a/Main/System/Main/EquipRecordManager.cs
+++ b/Main/System/Main/EquipRecordManager.cs
@@ -7,6 +7,7 @@
{
private List<EquipRecordData> recordList = new List<EquipRecordData>();
public int maxCnt;
+ public long showFightPower; //澶栭儴璁$畻鎴樺姏鍚庯紝鏃ュ織璁板綍锛岄伩鍏嶉噸澶嶈绠楋紝-1琛ㄧず鏈绠�
public override void Init()
{
DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += OnBeforePlayerDataInitializeEventOnRelogin;
@@ -111,7 +112,10 @@
{
if (newEquip == null)
return;
- long showFightPower = FightPowerManager.Instance.GetFightPowerChange(newEquip);
+ if (showFightPower == -1)
+ {
+ showFightPower = FightPowerManager.Instance.GetFightPowerChange(newEquip);
+ }
// 鏂拌澶囨垬鍔涗綆浜庢棫瑁呭鎴樺姏锛屼笉鍏佽娣诲姞
if (showFightPower <= 0)
return;
diff --git a/Main/System/Main/FightPowerFormula.cs b/Main/System/Main/FightPowerFormula.cs
index 50965ec..fa2e92e 100644
--- a/Main/System/Main/FightPowerFormula.cs
+++ b/Main/System/Main/FightPowerFormula.cs
@@ -2,6 +2,8 @@
public class FightPowerFormula
{
+ // 锛侊紒锛佽鏂囦欢宸插簾寮冿紝鍏紡鍦� FightPowerManager 涓洿鎺ュ鐞嗭紝瀛楀吀澶ч噺琚皟鐢ㄤ細浜х敓鎬ц兘鍙奊C闂
+ // 姝ゆ枃浠剁幇鍦ㄧ殑鐢ㄩ�斾负鎻愰啋绋嬪簭鍏紡鍙戠敓浜嗗彉鍖栵紝闇�鎵嬪姩淇敼FightPowerManager浠g爜
// 鍙橀噺鍚嶅父閲忓畾涔�
private const string LVVALUE_VALUE = "lvValue";
private const string EQUIPVALUE_VALUE = "equipValue";
diff --git a/Main/System/Main/FightPowerManager.cs b/Main/System/Main/FightPowerManager.cs
index f487dcd..b376955 100644
--- a/Main/System/Main/FightPowerManager.cs
+++ b/Main/System/Main/FightPowerManager.cs
@@ -12,112 +12,16 @@
// 鎵�鏈夋灏嗘垬鍔涘姞璧锋潵 + 鎶�鑳芥垬鍔涙眹鎬伙紙鍏紡锛夊氨鏄暣涓彿鐨勬垬鍔�
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 MINGGE_VALUE = "minggeValue";
- private const string MINGGE_PER = "minggePer";
-
- // 鎴樺姏鍙橀噺甯搁噺
- 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 ATKSPEEDRATIO_VALUE = "AtkSpeedRatio";
-
-
- 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 鍒濆鍖栨垬鍔涜绠楃殑淇℃伅
int teamTypeCalc = 1; //涓嶅悓闃靛鎴樺姏涓嶅悓
@@ -156,8 +60,11 @@
dropIndexCalc = dropindex;
minggeDropIndex = _minggeDropIndex;
#if UNITY_EDITOR
- FightPowerDebug("鎴樺姏锛氬垵濮嬪寲鍙傛暟 dropIndex锛�" + dropIndexCalc + " 闃靛瀷锛�" + teamTypeCalc + " ispreview:" + ispreview
- + " minggePresetID:" + _minggePresetID + " minggeDropIndex:" + _minggeDropIndex);
+ if (openLog)
+ {
+ FightPowerDebug("鎴樺姏锛氬垵濮嬪寲鍙傛暟 dropIndex锛�" + dropIndexCalc + " 闃靛瀷锛�" + teamTypeCalc + " ispreview:" + ispreview
+ + " minggePresetID:" + _minggePresetID + " minggeDropIndex:" + _minggeDropIndex);
+ }
#endif
}
#endregion
@@ -188,9 +95,13 @@
lvAttrs[attrType] = GetPlayerLVValue(playerLVConfig, attrType);
}
#if UNITY_EDITOR
- FightPowerDebug("鎴樺姏锛氱瓑绾у睘鎬� " + JsonMapper.ToJson(lvAttrs));
- FightPowerDebug("鎴樺姏锛氱孩棰滃睘鎬� " + JsonMapper.ToJson(BeautyMMManager.Instance.allMMTalentAttr));
- FightPowerDebug("鎴樺姏锛氬彜瀹濆睘鎬� " + JsonMapper.ToJson(GubaoManager.Instance.gubaoAllAttrDict));
+
+ if (openLog)
+ {
+ FightPowerDebug("鎴樺姏锛氱瓑绾у睘鎬� " + JsonMapper.ToJson(lvAttrs));
+ FightPowerDebug("鎴樺姏锛氱孩棰滃睘鎬� " + JsonMapper.ToJson(BeautyMMManager.Instance.allMMTalentAttr));
+ FightPowerDebug("鎴樺姏锛氬彜瀹濆睘鎬� " + JsonMapper.ToJson(GubaoManager.Instance.gubaoAllAttrDict));
+ }
#endif
}
@@ -224,7 +135,10 @@
officialAttrs[id] = config.AddAttrNum[i];
}
#if UNITY_EDITOR
- FightPowerDebug("鎴樺姏锛氬畼鑱屽睘鎬� " + JsonMapper.ToJson(officialAttrs));
+ if (openLog)
+ {
+ FightPowerDebug("鎴樺姏锛氬畼鑱屽睘鎬� " + JsonMapper.ToJson(officialAttrs));
+ }
#endif
}
@@ -289,7 +203,10 @@
}
#if UNITY_EDITOR
- FightPowerDebug("鎴樺姏锛氳澶囧睘鎬� " + JsonMapper.ToJson(equipAttrs));
+ if (openLog)
+ {
+ FightPowerDebug("鎴樺姏锛氳澶囧睘鎬� " + JsonMapper.ToJson(equipAttrs));
+ }
#endif
}
@@ -300,14 +217,15 @@
// 闃靛锛氭墍鏈夋灏嗕笂闃靛睘鎬�
// lineUpPerDict = HeroUIManager.Instance.GetLineupPer(teamTypeCalc, isPreviewTeamPower);
allHeroAddPer = HeroUIManager.Instance.GetAllHeroPer() / 10000.0;
-#if UNITY_EDITOR
- // Debug.Log("鎴樺姏锛氫笂闃靛睘鎬� " + JsonMapper.ToJson(lineUpPerDict));
-#endif
+
// 闃靛锛氬浗瀹讹紙鍏夌幆锛夊睘鎬�
countryAttrs = HeroUIManager.Instance.GetCountryAttrs(teamTypeCalc, isPreviewTeamPower);
#if UNITY_EDITOR
- FightPowerDebug("鎴樺姏锛氬浗瀹讹紙鍏夌幆锛夊睘鎬� " + JsonMapper.ToJson(countryAttrs));
- FightPowerDebug("鎴樺姏锛氭灏嗘墍鏈夊姞鎴� " + allHeroAddPer);
+ if (openLog)
+ {
+ FightPowerDebug("鎴樺姏锛氬浗瀹讹紙鍏夌幆锛夊睘鎬� " + JsonMapper.ToJson(countryAttrs));
+ FightPowerDebug("鎴樺姏锛氭灏嗘墍鏈夊姞鎴� " + allHeroAddPer);
+ }
#endif
}
@@ -359,20 +277,24 @@
}
#if UNITY_EDITOR
- FightPowerDebug("鎴樺姏锛氬懡鏍煎睘鎬� " + JsonMapper.ToJson(minggeAttrs));
+ if (openLog)
+ {
+ FightPowerDebug("鎴樺姏锛氬懡鏍煎睘鎬� " + JsonMapper.ToJson(minggeAttrs));
+ }
#endif
}
public int GetAttrPer(int attrID, Dictionary<int, long> attrDic)
{
- if (PlayerPropertyConfig.baseAttr2perDict.ContainsKey(attrID))
+ if (attrID == 6 || attrID == 7 || attrID == 8)
{
- var pertype = PlayerPropertyConfig.baseAttr2perDict[attrID];
+ var pertype = attrID + 10;
attrDic.TryGetValue(pertype, out long value);
return (int)(value);
}
return 0;
+
}
#endregion
@@ -400,91 +322,103 @@
#region 灞炴�у叕寮�
// 鍗曞熀纭�灞炴�ц绠�
- public double GetPropertyVaule(int attrType, HeroInfo hero, int type)
+ public double GetPropertyVaule(int attrType, HeroInfo hero)
{
// propertyVariables.Clear();
- 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] = GetAttrPer(attrType, officialAttrs) / 10000.0;
- // propertyVariables[BOOK_PER] = GetBookPer(attrType) / 10000.0;
- propertyVariables[GUBAO_VALUE] = GubaoManager.Instance.GetAttrValue(attrType);
- propertyVariables[GUBAO_PER] = GubaoManager.Instance.GetAttrPer(attrType) / 10000.0;
- propertyVariables[HJG_VALUE] = PhantasmPavilionManager.Instance.GetAttrValue(attrType);
- propertyVariables[HJG_PER] = PhantasmPavilionManager.Instance.GetAttrPer(attrType) / 10000.0;
- propertyVariables[HORSE_VALUE] = HorseManager.Instance.GetAttrValue(attrType);
- propertyVariables[HORSE_PER] = HorseManager.Instance.GetAttrPer(attrType) / 10000.0;
- propertyVariables[BEAUTY_VALUE] = BeautyMMManager.Instance.GetAttrValue(attrType);
- propertyVariables[BEAUTY_PER] = BeautyMMManager.Instance.GetAttrPer(attrType) / 10000.0;
- propertyVariables[FATES_VALUE] = HeroFatesManager.Instance.GetAttrValue(attrType);
- propertyVariables[FATES_PER] = HeroFatesManager.Instance.GetAttrPer(attrType) / 10000.0;
- propertyVariables[DINGJUNGE_VALUE] = 0; //榛樿涓嶉渶瑕佸姞锛岀埇濉旂壒娈婄敤锛岄厤鍚堝叕寮�
- propertyVariables[DINGJUNGE_PER] = 0; //榛樿涓嶉渶瑕佸姞锛岀埇濉旂壒娈婄敤锛岄厤鍚堝叕寮�
- propertyVariables[MINGGE_VALUE] = minggeAttrs.ContainsKey(attrType) ? minggeAttrs[attrType] : 0;
- propertyVariables[MINGGE_PER] = GetAttrPer(attrType, minggeAttrs) / 10000.0;
-
+ 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;
+ var dingjungeValue = 0; //榛樿涓嶉渶瑕佸姞锛岀埇濉旂壒娈婄敤锛岄厤鍚堝叕寮�
+ var dingjungePer = 0; //榛樿涓嶉渶瑕佸姞锛岀埇濉旂壒娈婄敤锛岄厤鍚堝叕寮�
+ minggeAttrs.TryGetValue(attrType, out var minggeValue);
+ var minggePer = GetAttrPer(attrType, minggeAttrs) / 10000.0;
+
//鍏ㄤ綋鍗$墝鍔犳垚
+ double cardPer = 0;
if (attrType == 6 || attrType == 7 || attrType == 8)
{
- propertyVariables[HERO_CARDPER] = allHeroAddPer;
+ cardPer = allHeroAddPer;
}
- else
- {
- propertyVariables[HERO_CARDPER] = 0;
- }
- //锛侊紒锛佸崟姝﹀皢鎴樺姏棰勮鐨勮瘽闇�瑕佹帓闄ら槦浼嶅奖鍝嶆垬鍔涳紝鍙畻姝﹀皢鑷韩鐨勪笂闃靛睘鎬�
- // propertyVariables[LINEUP_INIT_ADD_PER] = GetLineUpPer(attrType, LINEUP_INIT_ADD_PER) / 10000.0;
- // propertyVariables[LINEUP_LV_ADD_PER] = GetLineUpPer(attrType, LINEUP_LV_ADD_PER) / 10000.0;
- // propertyVariables[LINEUP_BREAK_LV_ADD_PER] = GetLineUpPer(attrType, LINEUP_BREAK_LV_ADD_PER) / 10000.0;
- // propertyVariables[LINEUP_STAR_ADD_PER] = GetLineUpPer(attrType, LINEUP_STAR_ADD_PER) / 10000.0;
//闃靛鍏夌幆 涓夊洿鐧惧垎姣斿姞鎴�
- propertyVariables[LINEUP_HALO_VALUE] = countryAttrs.ContainsKey(attrType) ? countryAttrs[attrType] : 0;
- propertyVariables[LINEUP_HALO_PER] = GetCountryPer(attrType) / 10000.0;
+ var lineupHaloPer = GetCountryPer(attrType) / 10000.0;
//姝﹀皢灞炴��
- propertyVariables[INHERIT_PER] = hero.GetInheritAttrPer(attrType) / 10000.0;
- propertyVariables[HERO_SELF_VALUE] = hero.GetSelfAddValue(attrType);
- propertyVariables[HERO_SELF_PER] = hero.GetSelfAddPer(attrType) / 10000.0;
- propertyVariables[STAR_TALENT_VALUE] = hero.GetTalentAttrValue(attrType);
- propertyVariables[STAR_TALENT_PER] = hero.GetTalentAttrPer(attrType) / 10000.0;
- propertyVariables[BREAK_LV_VALUE] = hero.GetBreakAttrValue(attrType);
- propertyVariables[BREAK_LV_PER] = hero.GetBreakAttrPer(attrType) / 10000.0;
- propertyVariables[AWAKE_TALENT_VALUE] = hero.GetAwakeAttrValue(attrType);
- propertyVariables[AWAKE_TALENT_PER] = hero.GetAwakeAttrPer(attrType) / 10000.0;
- propertyVariables[FETTER_VALUE] = hero.GetFetterAttrValue(attrType);
- propertyVariables[FETTER_PER] = hero.GetFetterAttrPer(attrType) / 10000.0;
- propertyVariables[HERO_LV_VALUE] = hero.GetHeroLVValue(attrType);
- propertyVariables[HERO_LV_PER] = hero.GetHeroLVPer(attrType) / 10000.0;
-
- double value;
- if (type == 0)
- {
- value = FightPowerFormula.GetBaseAttr(propertyVariables);
- }
- else
- {
- value = FightPowerFormula.GetFightAttr(propertyVariables);
- }
+ 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);
+
+ double value = (lvValue+equipValue+realmValue+gubaoValue+hjgValue+horseValue+beautyValue+fatesValue+dingjungeValue+minggeValue)*(1+lineupHaloPer+realmPer+gubaoPer+hjgPer+horsePer+beautyPer+fatesPer+cardPer+minggePer)*(inheritPer+fetterPer+starTalentPer+breakLVPer+awakeTalentPer)*(1+dingjungePer)+heroSelfValue+heroLVValue;
//淇濈暀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)}");
- }
+ // 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;
}
+ 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);
+ var dingjungeValue = 0; //榛樿涓嶉渶瑕佸姞锛岀埇濉旂壒娈婄敤锛岄厤鍚堝叕寮�
+ 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);
+
+ double value = (lvValue + equipValue + realmValue + gubaoValue + hjgValue + horseValue + beautyValue + fatesValue + dingjungeValue + minggeValue) + (heroSelfValue + 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)
// {
@@ -506,12 +440,14 @@
// }
+ //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;
@@ -527,17 +463,28 @@
//瑁呭鎴樺姏涓烘渶缁堟�绘垬鍔涚殑缁撴灉姣旓紙鎻愬崌鏁翠釜瑙掕壊鎬绘垬鍔涳級
//璁$畻鎬绘垬鍔涗腑鐨勬灏嗘垬鍔涳紝鍑犱釜姝﹀皢鍔犺捣鏉ュ氨鏄�绘垬鍔涳紝鍏朵粬鍔熻兘灞炴�ц绠楀簲璇ユ兜鐩栧湪鑻遍泟閲�
- public long CalculatePower()
+ // calcType 璁$畻鎴樺姏缂樼敱 0 姝﹀皢 1 瑁呭 2鍛芥牸锛岀敤浜庤妭鐪侀儴鍒嗗紑閿�
+ public long CalculatePower(int calcType)
{
+
#if UNITY_EDITOR
- FightPowerDebug("鎴樺姏锛氬紑濮嬭绠�");
+ if (openLog)
+ {
+ FightPowerDebug("鎴樺姏锛氬紑濮嬭绠�");
+ }
#endif
// --- 鍏堣绠楁墍鏈夊姛鑳界殑姹囨�诲睘鎬� ---
RefreshLVAttrs();
RefreshOfficialAttrs();
RefrehEquipAttrs();
RefrehMinggeAttrs();
- RefreshTeamAttrs();
+
+ bool diffFP = lastFightPower != PlayerDatas.Instance.baseData.FightPower; //鎴樺姏鏄惁鏈夊彉鍖�
+ if (diffFP || calcType == 0)
+ {
+ lastFightPower = PlayerDatas.Instance.baseData.FightPower;
+ RefreshTeamAttrs();
+ }
// --- 绠楀崟姝﹀皢鍔熻兘灞炴�ф垬鍔� 鍚庣浉鍔�---
long fightPower = 0;
@@ -563,10 +510,19 @@
}
- fightPower += GetMinggeSkillPower();
-// #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;
}
@@ -575,107 +531,137 @@
//璁$畻闃靛涓灏嗘垬鍔�
public long CalculateTeamHeroPower(HeroInfo hero)
{
-
- fightPowerVariables.Clear();
hero.RefreshFetterAttrsWhenCalcPower(teamTypeCalc); //缇佺粖灞炴�ц瀹炴椂绠�
+ 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);
+ var StunRateDef = GetFighttPropertyVaule(22, hero);
+ var SuperHitRate = GetFighttPropertyVaule(23, hero);
+ var SuperHitRateDef = GetFighttPropertyVaule(24, hero);
+ var ComboRate = GetFighttPropertyVaule(25, hero);
+ var ComboRateDef = GetFighttPropertyVaule(26, hero);
+ var MissRate = GetFighttPropertyVaule(27, hero);
+ var MissRateDef = GetFighttPropertyVaule(28, hero);
+ var ParryRate = GetFighttPropertyVaule(29, hero);
+ var ParryRateDef = GetFighttPropertyVaule(30, hero);
+ var SuckHPPer = GetFighttPropertyVaule(31, hero);
+ var SuckHPPerDef = GetFighttPropertyVaule(32, hero);
- foreach (var config in pConfig)
- {
- if (config.showType < 1 || config.showType > 4)
- {
- continue;
- }
+ 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);
- //绾﹀畾姝� 鍙湁3缁存墠鏄熀纭�灞炴��
- if (config.showType == 1 && config.ID != 11)
- {
- fightPowerVariables[config.Parameter] = Math.Round(GetPropertyVaule(config.ID, hero, 0), 3);
- }
- else
- {
- fightPowerVariables[config.Parameter] = Math.Round(GetPropertyVaule(config.ID, hero, 1), 3);
- }
- }
-
+ 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;
- fightPowerVariables[ATKSPEEDRATIO_VALUE] = fightPowerRatioConfig.AtkSpeedRatio;
-
-
- 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;
}
//鍛芥牸鎶�鑳芥垬鍔涳細鎸変釜鏁拌幏鍙栧搴旂瓑绾х殑鎶�鑳芥垬鍔�
@@ -730,10 +716,6 @@
foreach (var item in dict)
{
- // //鍔犱笂鎶�鑳芥垬鍔�
- fightPowerVariables.Clear();
- fightPowerVariables[PLAYER_LV] = PlayerDatas.Instance.baseData.LV;
- fightPowerVariables[OFFICIAL_LV] = PlayerDatas.Instance.baseData.realmLevel;
if (item.Value == 0)
{
continue;
@@ -744,12 +726,17 @@
Debug.LogError("skill is null" + (item.Key + item.Value - 1));
continue;
}
- fightPowerVariables[SKILL_POWER] = skill.FightPower;
- skillPower += (long)FightPowerFormula.GetSkillsFightPower(fightPowerVariables);
+ var SkillPower = skill.FightPower;
+ var OfficialLV = PlayerDatas.Instance.baseData.realmLevel;
+ skillPower += SkillPower*OfficialLV;;
}
+
#if UNITY_EDITOR
+ if (openLog)
+ {
FightPowerDebug($"鍛芥牸鎶�鑳芥垬鍔� {skillPower}");
+ }
#endif
return skillPower;
}
@@ -763,11 +750,13 @@
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>
@@ -777,10 +766,10 @@
public long GetFightPowerMinggeChange(ItemModel item, int minggePresetID)
{
InitFightPowerParam(_minggePresetID: minggePresetID);
- var fightPower = CalculatePower();
+ var fightPower = CalculatePower(2);
InitFightPowerParam(_minggePresetID: minggePresetID, _minggeDropIndex: item.gridIndex);
- var tmpFightPower = CalculatePower();
+ var tmpFightPower = CalculatePower(2);
return tmpFightPower - fightPower;
}
@@ -828,7 +817,7 @@
public long GetTeamFightPower(int team, bool isPreview)
{
InitFightPowerParam(team, ispreview:isPreview);
- return CalculatePower();
+ return CalculatePower(0);
}
#endregion
@@ -839,6 +828,7 @@
Dictionary<int, long> tmpAttrs = new Dictionary<int, long>();
hero.RefreshFetterAttrsWhenCalcPower(TeamManager.Instance.GetMainTeamID()); //缇佺粖灞炴�ц瀹炴椂绠�
+ var pConfig = PlayerPropertyConfig.GetValues();
foreach (var config in pConfig)
{
if (config.showType < 1 || config.showType > 4)
@@ -848,11 +838,11 @@
//绾﹀畾姝� 鍙湁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);
}
}
--
Gitblit v1.8.0