コード例 #1
0
        /// <summary>
        /// Get A Random Difficulty
        /// </summary>
        /// <returns></returns>
        public static string GetMonsterUniqueItem()
        {
            var result = ItemIndexViewModel.Instance.Dataset.ElementAt(DiceHelper.RollDice(1, ItemIndexViewModel.Instance.Dataset.Count()) - 1).Id;

            return(result);
        }
コード例 #2
0
 /// <summary>
 /// Get a Random Level
 /// </summary>
 /// <returns></returns>
 public static int GetLevel()
 {
     // 1-20
     return(DiceHelper.RollDice(1, 20));
 }
コード例 #3
0
 /// <summary>
 /// Get Health
 /// </summary>
 /// <param name="level"></param>
 /// <returns></returns>
 public static int GetHealth(int level)
 {
     // Roll the Dice and reset the Health
     return(DiceHelper.RollDice(level, 10));
 }
コード例 #4
0
 /// <summary>
 /// Get Random Ability Number
 /// </summary>
 /// <returns></returns>
 public static int GetAbilityValue()
 {
     // 0 to 9, not 1-10
     return(DiceHelper.RollDice(1, 10) - 1);
 }
コード例 #5
0
        /// <summary>
        /// Get Random Monster type
        /// </summary>
        /// <returns></returns>
        public static MonsterTypeEnum GetMonsterType()
        {
            var result = (MonsterTypeEnum)(DiceHelper.RollDice(1, 22));

            return(result);
        }
コード例 #6
0
        /// <summary>
        /// Selects a random item from a list of items
        /// </summary>
        /// <returns></returns>
        public static ItemModel GetRandomItem()
        {
            int item = DiceHelper.RollDice(1, ItemIndexViewModel.Instance.Dataset.Count) - 1;

            return(ItemIndexViewModel.Instance.Dataset[item]);
        }