From c144f3af6db446e28efaf218f323f73c532c4eca Mon Sep 17 00:00:00 2001 From: hch <305670599@qq.com> Date: 星期四, 18 九月 2025 12:28:25 +0800 Subject: [PATCH] 0312 同步公式 --- Main/System/Main/FightPowerManager.cs | 37 +++++++++++++++++++++++++++++++++++-- 1 files changed, 35 insertions(+), 2 deletions(-) diff --git a/Main/System/Main/FightPowerManager.cs b/Main/System/Main/FightPowerManager.cs index dccc0b9..686d806 100644 --- a/Main/System/Main/FightPowerManager.cs +++ b/Main/System/Main/FightPowerManager.cs @@ -64,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>(); //瑁呭灞炴�� @@ -100,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 + } //瑁呭灞炴��:韬笂瑁呭姹囨�� @@ -210,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; @@ -264,6 +284,17 @@ 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) { if (PlayerPropertyConfig.baseAttr2perDict.ContainsKey(attrType)) @@ -292,6 +323,7 @@ #endif // --- 鍏堣绠楁墍鏈夊姛鑳界殑姹囨�诲睘鎬� --- RefreshLVAttrs(); + RefreshOfficialAttrs(); RefrehEquipAttrs(); RefreshTeamAttrs(); @@ -348,11 +380,11 @@ } if (config.showType == 1) { - fightPowerVariables[config.Parameter] = GetPropertyVaule(config.ID, hero, propertyFormula); + fightPowerVariables[config.Parameter] = (ulong)GetPropertyVaule(config.ID, hero, propertyFormula); } else { - fightPowerVariables[config.Parameter] = GetPropertyVaule(config.ID, hero, fightPropertyFormula); + fightPowerVariables[config.Parameter] = (ulong)GetPropertyVaule(config.ID, hero, fightPropertyFormula); } } @@ -472,6 +504,7 @@ InitFightPowerParam(ispreview: ispreview); RefreshLVAttrs(); + RefreshOfficialAttrs(); RefrehEquipAttrs(); RefreshTeamAttrs(); -- Gitblit v1.8.0