From 3b2a6bb9047cfce9f501593b3669a9c1af6c5df4 Mon Sep 17 00:00:00 2001
From: lcy <1459594991@qq.com>
Date: 星期三, 05 十一月 2025 17:40:23 +0800
Subject: [PATCH] 130 战斗修改回合样式
---
Main/System/Main/FightPowerManager.cs | 80 +++++++++++++++++++++++++++++++++++++--
1 files changed, 75 insertions(+), 5 deletions(-)
diff --git a/Main/System/Main/FightPowerManager.cs b/Main/System/Main/FightPowerManager.cs
index f1a254d..05a4476 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,14 @@
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["horseValue"] = 0;
+ propertyVariables["horsePer"] = 0;
//锛侊紒锛佸崟姝﹀皢鎴樺姏棰勮鐨勮瘽闇�瑕佹帓闄ら槦浼嶅奖鍝嶆垬鍔涳紝鍙畻姝﹀皢鑷韩鐨勪笂闃靛睘鎬�
propertyVariables["lineupInitAddPer"] = GetLineUpPer(attrType, "lineupInitAddPer") / 10000.0f;
@@ -260,7 +287,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 +329,7 @@
#endif
// --- 鍏堣绠楁墍鏈夊姛鑳界殑姹囨�诲睘鎬� ---
RefreshLVAttrs();
+ RefreshOfficialAttrs();
RefrehEquipAttrs();
RefreshTeamAttrs();
@@ -347,11 +386,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 +500,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();
@@ -492,6 +532,36 @@
#endregion
+ public Dictionary<int, long> GetHeroTotalAttr(HeroInfo hero)
+ {
+
+ Dictionary<int, long> tmpAttrs = new Dictionary<int, long>();
+ hero.RefreshFetterAttrsWhenCalcPower(TeamType.Story); //缇佺粖灞炴�ц瀹炴椂绠�
+
+#if UNITY_EDITOR
+ propertyStrForDebug = "";
+#endif
+
+ foreach (var config in PlayerPropertyConfig.GetValues())
+ {
+ if (config.showType < 1 || config.showType > 4)
+ {
+ continue;
+ }
+ if (config.showType == 1)
+ {
+ tmpAttrs[config.ID] = (long)GetPropertyVaule(config.ID, hero, propertyFormula);
+ }
+ else
+ {
+ tmpAttrs[config.ID] = (long)GetPropertyVaule(config.ID, hero, fightPropertyFormula);
+ }
+ }
+#if UNITY_EDITOR
+ Debug.Log($"鎴樺姏锛氭灏咺D {hero.heroId} 灞炴�т俊鎭� {propertyStrForDebug}");
+#endif
+ return tmpAttrs;
+ }
}
--
Gitblit v1.8.0