From cb653cf75b17b9bdca0b5b9e6b88edf1ca72e90c Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期五, 17 十月 2025 09:54:11 +0800
Subject: [PATCH] 0312 删除旧的日常代码3
---
Main/System/Main/FightPowerManager.cs | 48 +++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 43 insertions(+), 5 deletions(-)
diff --git a/Main/System/Main/FightPowerManager.cs b/Main/System/Main/FightPowerManager.cs
index ed85d77..7272789 100644
--- a/Main/System/Main/FightPowerManager.cs
+++ b/Main/System/Main/FightPowerManager.cs
@@ -31,6 +31,7 @@
fightPropertyFormula = config.Numerical2;
fightPowerFormula = config.Numerical3;
skillFightPowerFormula = config.Numerical4;
+ JaceCalculator.Init();
}
#region 鍒濆鍖栨垬鍔涜绠楃殑淇℃伅
@@ -63,6 +64,7 @@
//鍔熻兘灞炴�� 绫诲瀷锛氬��
public Dictionary<int, int> lvAttrs = new Dictionary<int, int>(); //绛夌骇灞炴��
+ public Dictionary<int, int> officialAttrs = new Dictionary<int, int>(); //瀹樿亴灞炴��
//鍒嗗紑瀛樺偍棰勮鍜� 鐪熷疄灞炴��
public Dictionary<int, int> equipAttrs = new Dictionary<int, int>(); //瑁呭灞炴��
@@ -99,6 +101,23 @@
return config.MaxHP;
}
return 0;
+ }
+
+
+ //瀹樿亴灞炴��
+ void RefreshOfficialAttrs()
+ {
+ officialAttrs.Clear();
+ var config = RealmConfig.Get(PlayerDatas.Instance.baseData.realmLevel);
+ for (int i = 0; i < config.AddAttrType.Length; i++)
+ {
+ var id = config.AddAttrType[i];
+ officialAttrs[id] = config.AddAttrNum[i];
+ }
+#if UNITY_EDITOR
+ Debug.Log("鎴樺姏锛氬畼鑱屽睘鎬� " + JsonMapper.ToJson(officialAttrs));
+#endif
+
}
//瑁呭灞炴��:韬笂瑁呭姹囨��
@@ -209,6 +228,12 @@
propertyVariables["equipValue"] = equipAttrs.ContainsKey(attrType) ? equipAttrs[attrType] : 0;
propertyVariables["bookValue"] = 0;
propertyVariables["bookPer"] = GetBookPer(attrType) / 10000.0f;
+ propertyVariables["realmValue"] = officialAttrs.ContainsKey(attrType) ? officialAttrs[attrType] : 0;
+ propertyVariables["realmPer"] = GetOfficialPer(attrType) / 10000.0f;
+ propertyVariables["gubaoValue"] = 0;
+ propertyVariables["gubaoPer"] = 0;
+ propertyVariables["hjgValue"] = 0;
+ propertyVariables["hjgPer"] = 0;
//锛侊紒锛佸崟姝﹀皢鎴樺姏棰勮鐨勮瘽闇�瑕佹帓闄ら槦浼嶅奖鍝嶆垬鍔涳紝鍙畻姝﹀皢鑷韩鐨勪笂闃靛睘鎬�
propertyVariables["lineupInitAddPer"] = GetLineUpPer(attrType, "lineupInitAddPer") / 10000.0f;
@@ -260,7 +285,18 @@
{
return 0;
}
- return HeroUIManager.Instance.bookPer;
+ 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;
}
int GetCountryPer(int attrType)
@@ -291,6 +327,7 @@
#endif
// --- 鍏堣绠楁墍鏈夊姛鑳界殑姹囨�诲睘鎬� ---
RefreshLVAttrs();
+ RefreshOfficialAttrs();
RefrehEquipAttrs();
RefreshTeamAttrs();
@@ -347,11 +384,11 @@
}
if (config.showType == 1)
{
- fightPowerVariables[config.Parameter] = (ulong)GetPropertyVaule(config.ID, hero, propertyFormula);
+ fightPowerVariables[config.Parameter] = Math.Round(GetPropertyVaule(config.ID, hero, propertyFormula), 3);
}
else
{
- fightPowerVariables[config.Parameter] = (ulong)GetPropertyVaule(config.ID, hero, fightPropertyFormula);
+ fightPowerVariables[config.Parameter] = Math.Round(GetPropertyVaule(config.ID, hero, fightPropertyFormula), 3);
}
}
@@ -461,16 +498,17 @@
var index = team.GetEmptyPosition();
if (index < 0)
{
- team.AddHero(heroInfo, 5);
+ team.AddHero(heroInfo, 5, false);
}
else
{
- team.AddHero(heroInfo, index);
+ team.AddHero(heroInfo, index, false);
}
}
InitFightPowerParam(ispreview: ispreview);
RefreshLVAttrs();
+ RefreshOfficialAttrs();
RefrehEquipAttrs();
RefreshTeamAttrs();
--
Gitblit v1.8.0