Exemple #1
0
        private double CalculateChance(Mob target)
        {
            Stat   health       = target.Stats[StatType.health];
            Stat   defence      = target.Stats[StatType.defence];
            float  coeficient   = -2;
            double lifeRatio    = GenericOperations.GetRatio(health.MinValue, health.MaxValue, health.Value);
            double baseChance   = lifeRatio * (lifeRatio + coeficient) + 1;
            double defenceRatio = GenericOperations.GetRatio(defence.DefaultValue * .75, defence.MaxValue, defence.Value);
            double result       = baseChance - defenceRatio;

            if (result < 0)
            {
                result = 0;
            }
            return(result);
        }
Exemple #2
0
        private double CalculateMean()
        {
            double levelRatio = GenericOperations.GetRatio(Settings.MinLevel, Settings.MaxLevel, Level);

            return(GenericOperations.GetProportion(Settings.MinEncounters, Settings.MaxEncounters, levelRatio));
        }