Beispiel #1
0
        public int Roll(DiceOptions options)
        {
            int value = 0;

            for (int i = 0; i < number; i++)
            {
                int minRoll = 1;

                if ((options & DiceOptions.Reroll1and2s) == DiceOptions.Reroll1and2s)
                {
                    minRoll = 3;
                }
                else if ((options & DiceOptions.Reroll1s) == DiceOptions.Reroll1s)
                {
                    minRoll = 2;
                }

                if ((options & DiceOptions.RerollAndAddOnHighest) == DiceOptions.RerollAndAddOnHighest)
                {
                    value += InternalRollWithRerollAndAddHighest(_base, minRoll);
                }
                else
                {
                    value += GetRandomInt(minRoll, _base + 1);
                }
            }

            return(value);
        }
Beispiel #2
0
        public int RollMultiple(int numberOfRolls, DiceOptions options)
        {
            int value = 0;

            for (int i = 0; i < numberOfRolls; i++)
            {
                value += Roll();
            }

            return(value);
        }
Beispiel #3
0
 public static int Roll(int _base, DiceOptions options)
 {
     return(Roll(1, _base, options));
 }
Beispiel #4
0
 public static int Roll(int number, int _base, DiceOptions options)
 {
     return(Get(number, _base).Roll(options));
 }