Пример #1
0
        public static string CalculateBossDifficulty(Player player, int floor, bool isEliteBoss, Character referenceBoss, double progressDifficultyExponent)
        {
            CharacterInstance activeCharacter = player.ActiveCharacter;
            double            num             = activeCharacter.DamagePerHit(false) * activeCharacter.AttacksPerSecond(false);
            double            num2            = activeCharacter.MaxLife(false);
            double            num3            = activeCharacter.SkillDamage(false);
            double            num4            = App.Binder.ConfigMeta.DIFFICULTY_AVERAGE_SKILL_DAMAGE_MULTIPLIER;
            double            num5            = (num3 * activeCharacter.ActiveSkillTypes.Count) * num4;
            float             num6            = activeCharacter.getTotalNumberOfRandomPerksInEquippedItems() * 0.02f;
            float             num7            = activeCharacter.getTotalNumberOfFixedPerksInEquippedItems() * 0.15f;

            num  *= 1.0 + ((num6 + num7) * 0.5);
            num2 *= 1.0 + ((num6 + num7) * 0.5);
            double num8  = App.Binder.ConfigMeta.BossDamagePerHitCurve(floor, progressDifficultyExponent, false) * referenceBoss.getBaseStatFloat(BaseStatProperty.AttacksPerSecond);
            double num9  = App.Binder.ConfigMeta.BossLifeCurve(floor, progressDifficultyExponent, false);
            double num10 = !isEliteBoss ? 1.0 : 1.4;

            num8 *= num10;
            num9 *= num10;
            num9 -= num5;
            double num11 = (num9 / num) / (num2 / num8);
            double num12 = App.Binder.ConfigMeta.ITEM_DAMAGE_MULTIPLIER * 3.0;
            double num13 = App.Binder.ConfigMeta.ITEM_HEALTH_MULTIPLIER;
            double num14 = App.Binder.ConfigMeta.BOSS_DAMAGE_MULTIPLIER * 1.0;
            double num16 = (App.Binder.ConfigMeta.BOSS_HEALTH_MULTIPLIER / num12) / (num13 / num14);
            double num17 = num11 / num16;

            if (num17 >= 4.5)
            {
                return("impossible");
            }
            if (num17 >= 2.0)
            {
                return("very_hard");
            }
            if (num17 >= 1.33)
            {
                return("hard");
            }
            return("ready");
        }