From 87d5c46997d61523aed87fdb7ed0b07e9dded223 Mon Sep 17 00:00:00 2001 From: hch <305670599@qq.com> Date: 星期二, 30 九月 2025 21:45:08 +0800 Subject: [PATCH] 0312 优化淘金派遣 --- Main/System/Main/FightPowerManager.cs | 40 +++++++++++++++++++++++++++++++++++++--- 1 files changed, 37 insertions(+), 3 deletions(-) diff --git a/Main/System/Main/FightPowerManager.cs b/Main/System/Main/FightPowerManager.cs index ed85d77..37b1765 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,8 @@ 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["lineupInitAddPer"] = GetLineUpPer(attrType, "lineupInitAddPer") / 10000.0f; @@ -260,7 +281,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 +323,7 @@ #endif // --- 鍏堣绠楁墍鏈夊姛鑳界殑姹囨�诲睘鎬� --- RefreshLVAttrs(); + RefreshOfficialAttrs(); RefrehEquipAttrs(); RefreshTeamAttrs(); @@ -347,11 +380,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); } } @@ -471,6 +504,7 @@ InitFightPowerParam(ispreview: ispreview); RefreshLVAttrs(); + RefreshOfficialAttrs(); RefrehEquipAttrs(); RefreshTeamAttrs(); -- Gitblit v1.8.0