| | |
| | | |
| | | //功能属性 类型:值 |
| | | 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>(); //装备属性 |
| | |
| | | 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 |
| | | |
| | | } |
| | | |
| | | //装备属性:身上装备汇总 |
| | |
| | | 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; |
| | |
| | | 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)) |
| | |
| | | #endif |
| | | // --- 先计算所有功能的汇总属性 --- |
| | | RefreshLVAttrs(); |
| | | RefreshOfficialAttrs(); |
| | | RefrehEquipAttrs(); |
| | | RefreshTeamAttrs(); |
| | | |
| | |
| | | } |
| | | 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); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | InitFightPowerParam(ispreview: ispreview); |
| | | RefreshLVAttrs(); |
| | | RefreshOfficialAttrs(); |
| | | RefrehEquipAttrs(); |
| | | RefreshTeamAttrs(); |
| | | |