hch
11 小时以前 4849eb50367b07e9c9ff07bc52eb164b24ed7775
Main/System/Main/FightPowerManager.cs
@@ -221,54 +221,54 @@
    #region 属性公式
    // 单基础属性计算
    public double GetPropertyVaule(int attrType, HeroInfo hero, string formula)
    {
        propertyVariables.Clear();
        propertyVariables["lvValue"] = lvAttrs.ContainsKey(attrType) ? lvAttrs[attrType] : 0;
        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;
//     public double GetPropertyVaule(int attrType, HeroInfo hero, string formula)
//     {
//         propertyVariables.Clear();
//         propertyVariables["lvValue"] = lvAttrs.ContainsKey(attrType) ? lvAttrs[attrType] : 0;
//         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;
        propertyVariables["lineupLVAddPer"] = GetLineUpPer(attrType, "lineupLVAddPer") / 10000.0f;
        propertyVariables["lineupBreakLVAddPer"] = GetLineUpPer(attrType, "lineupBreakLVAddPer") / 10000.0f;
        propertyVariables["lineupStarAddPer"] = GetLineUpPer(attrType, "lineupStarAddPer") / 10000.0f;
//         //!!!单武将战力预览的话需要排除队伍影响战力,只算武将自身的上阵属性
//         propertyVariables["lineupInitAddPer"] = GetLineUpPer(attrType, "lineupInitAddPer") / 10000.0f;
//         propertyVariables["lineupLVAddPer"] = GetLineUpPer(attrType, "lineupLVAddPer") / 10000.0f;
//         propertyVariables["lineupBreakLVAddPer"] = GetLineUpPer(attrType, "lineupBreakLVAddPer") / 10000.0f;
//         propertyVariables["lineupStarAddPer"] = GetLineUpPer(attrType, "lineupStarAddPer") / 10000.0f;
        //阵容光环 三围百分比加成
        propertyVariables["lineupHaloValue"] = countryAttrs.ContainsKey(attrType) ? countryAttrs[attrType] : 0;
        propertyVariables["lineupHaloPer"] = GetCountryPer(attrType) / 10000.0f;
//         //阵容光环 三围百分比加成
//         propertyVariables["lineupHaloValue"] = countryAttrs.ContainsKey(attrType) ? countryAttrs[attrType] : 0;
//         propertyVariables["lineupHaloPer"] = GetCountryPer(attrType) / 10000.0f;
        //武将属性
        propertyVariables["inheritPer"] = hero.GetInheritAttrPer(attrType) / 10000.0f;
        propertyVariables["heroSelfValue"] = hero.GetSelfAddValue(attrType);
        propertyVariables["heroSelfPer"] = hero.GetSelfAddPer(attrType) / 10000.0f;
        propertyVariables["starTalentValue"] = hero.GetTalentAttrValue(attrType);
        propertyVariables["starTalentPer"] = hero.GetTalentAttrPer(attrType) / 10000.0f;
        propertyVariables["breakLVValue"] = hero.GetBreakAttrValue(attrType);
        propertyVariables["breakLVPer"] = hero.GetBreakAttrPer(attrType) / 10000.0f;
        propertyVariables["awakeTalentValue"] = hero.GetAwakeAttrValue(attrType);
        propertyVariables["awakeTalentPer"] = hero.GetAwakeAttrPer(attrType) / 10000.0f;
        propertyVariables["fetterValue"] = hero.GetFetterAttrValue(attrType);
        propertyVariables["fetterPer"] = hero.GetFetterAttrPer(attrType) / 10000.0f;
//         //武将属性
//         propertyVariables["inheritPer"] = hero.GetInheritAttrPer(attrType) / 10000.0f;
//         propertyVariables["heroSelfValue"] = hero.GetSelfAddValue(attrType);
//         propertyVariables["heroSelfPer"] = hero.GetSelfAddPer(attrType) / 10000.0f;
//         propertyVariables["starTalentValue"] = hero.GetTalentAttrValue(attrType);
//         propertyVariables["starTalentPer"] = hero.GetTalentAttrPer(attrType) / 10000.0f;
//         propertyVariables["breakLVValue"] = hero.GetBreakAttrValue(attrType);
//         propertyVariables["breakLVPer"] = hero.GetBreakAttrPer(attrType) / 10000.0f;
//         propertyVariables["awakeTalentValue"] = hero.GetAwakeAttrValue(attrType);
//         propertyVariables["awakeTalentPer"] = hero.GetAwakeAttrPer(attrType) / 10000.0f;
//         propertyVariables["fetterValue"] = hero.GetFetterAttrValue(attrType);
//         propertyVariables["fetterPer"] = hero.GetFetterAttrPer(attrType) / 10000.0f;
#if UNITY_EDITOR
        //排除值为0的属性输出
        // var tmpPropertyVariables = propertyVariables.Where(x => x.Value > 0).ToDictionary(x => x.Key, x => x.Value);
        // if (!tmpPropertyVariables.IsNullOrEmpty())
        //     propertyStrForDebug += $"属性ID {attrType} - {JsonMapper.ToJson(tmpPropertyVariables)}";
#endif
        return JaceCalculator.Calculate(formula, propertyVariables);
    }
// #if UNITY_EDITOR
//         //排除值为0的属性输出
//         // var tmpPropertyVariables = propertyVariables.Where(x => x.Value > 0).ToDictionary(x => x.Key, x => x.Value);
//         // if (!tmpPropertyVariables.IsNullOrEmpty())
//         //     propertyStrForDebug += $"属性ID {attrType} - {JsonMapper.ToJson(tmpPropertyVariables)}";
// #endif
//         return JaceCalculator.Calculate(formula, propertyVariables);
//     }
    public double GetPropertyVaule(int attrType, HeroInfo hero, int type)
    {
@@ -442,15 +442,15 @@
            {
                if (useFormulaType == 0)
                    fightPowerVariables[config.Parameter] = Math.Round(GetPropertyVaule(config.ID, hero, 0), 3);
                else
                    fightPowerVariables[config.Parameter] = Math.Round(GetPropertyVaule(config.ID, hero, propertyFormula), 3);
                // else
                //     fightPowerVariables[config.Parameter] = Math.Round(GetPropertyVaule(config.ID, hero, propertyFormula), 3);
            }
            else
            {
                if (useFormulaType == 0)
                    fightPowerVariables[config.Parameter] = Math.Round(GetPropertyVaule(config.ID, hero, 1), 3);
                else
                    fightPowerVariables[config.Parameter] = Math.Round(GetPropertyVaule(config.ID, hero, fightPropertyFormula), 3);
                // else
                //     fightPowerVariables[config.Parameter] = Math.Round(GetPropertyVaule(config.ID, hero, fightPropertyFormula), 3);
            }
        }