public void IsSuccess(double roll, double skillCheck, bool expectedResult)
        {
            var rpg = new RolePlayingSystem();

            Assert.AreEqual(expectedResult, rpg.IsSuccess(roll, skillCheck));
            Assert.IsFalse(rpg.IsCriticalFailure(roll, skillCheck));
        }
        public void IsCritucalSuccess_WithCriticalSuccessProbability(double roll, double skillCheck,
                                                                     bool expectedResult)
        {
            var rpg = new RolePlayingSystem().WithCriticalSuccessProbability(0.2);

            Assert.AreEqual(expectedResult, rpg.IsCriticalSuccess(roll, skillCheck));
        }
        public void PrintCrits()
        {
            var rpg = new RolePlayingSystem().WithCriticalSuccessProbability(0.02).WithCriticalFailureProbability(0.02);

            foreach (var tuple in levels)
            {
                var probability        = MathHelper.ArgumentFromProbability(tuple.Item2 * 0.01);
                var successProbability = rpg.GetCriticalSuccessProbability(probability);
                var failureProbability = rpg.GetCriticalFailureProbability(probability);
                Console.WriteLine("{0}:\tsuccess chance: {1:0.00}%\tcrit success: {2:0.00}%\tcrit failure: {3:0.00}%)", tuple.Item1, tuple.Item2, successProbability * 100, failureProbability * 100);
            }
        }
        public void PrintBoost()
        {
            double boost = 0.1f;

            Console.WriteLine("Boost in {0:0.000} adds to success probability:", boost);
            var rpg = new RolePlayingSystem();

            foreach (var tuple in levels)
            {
                var probability        = tuple.Item2 * 0.01;
                var successProbability = MathHelper.SuccessProbability(MathHelper.ArgumentFromProbability(probability) + boost);
                Console.WriteLine("{0}:\t{1:0.00}% (from {2:0.00}% to {3:0.00}%)", tuple.Item1, (successProbability - probability) * 100, tuple.Item2, successProbability * 100);
            }
        }
        public void IsCriticalFailure_WithCriticalFailureOffset(double roll, double skillCheck, bool expectedResult)
        {
            var rpg = new RolePlayingSystem().WithCriticalFailureOffset(0.8);

            Assert.AreEqual(expectedResult, rpg.IsCriticalFailure(roll, skillCheck));
        }