Example #1
0
        /// <summary>
        /// Create Random Character for the battle
        /// </summary>
        /// <param name="MaxLevel"></param>
        /// <returns></returns>
        public static BaseMonster GetRandomMonster(int MaxLevel)
        {
            // If there are no Monsters in the system, return a default one
            if (MonsterViewModel.Instance.Dataset.Count == 0)
            {
                return(new BaseMonster());
            }

            var rnd = DiceHelper.RollDice(1, MonsterViewModel.Instance.Dataset.Count);

            var result = new BaseMonster(MonsterViewModel.Instance.Dataset.ElementAt(rnd - 1))
            {
                Level = DiceHelper.RollDice(1, MaxLevel),

                // Randomize Name
                Name        = GetMonsterName(),
                Description = GetMonsterDescription(),

                // Randomize the Attributes
                Attack  = GetAbilityValue(),
                Speed   = GetAbilityValue(),
                Defense = GetAbilityValue(),

                ImageURI = GetMonsterImage(),

                Difficulty = GetMonsterDifficultyValue()
            };

            // Adjust values based on Difficulty
            result.Attack  = result.Difficulty.ToModifier(result.Attack);
            result.Defense = result.Difficulty.ToModifier(result.Defense);
            result.Speed   = result.Difficulty.ToModifier(result.Speed);
            result.Level   = result.Difficulty.ToModifier(result.Level);

            // Get the new Max Health
            result.MaxHealth = DiceHelper.RollDice(result.Level, 10);

            // Adjust the health, If the new Max Health is above the rule for the level, use the original
            var MaxHealthAdjusted = result.Difficulty.ToModifier(result.MaxHealth);

            if (MaxHealthAdjusted < result.Level * 10)
            {
                result.MaxHealth = MaxHealthAdjusted;
            }

            // Level up to the new level
            result.LevelUpToValue(result.Level);

            // Set ExperienceRemaining so Monsters can both use this method
            result.ExperienceRemaining = LevelTableHelper.Instance.LevelDetailsList[result.Level + 1].Experience;

            // Enter Battle at full health
            result.CurrHealth = result.MaxHealth;

            return(result);
        }
        /// <summary>
        /// Get Description
        ///
        /// Return a random description
        /// </summary>
        /// <returns></returns>
        public static string GetCharacterDescription()
        {
            List <String> StringList = new List <String> {
                "the terrible", "the awesome", "the lost", "the old", "the younger", "the quiet", "the loud", "the helpless", "the happy", "the sleepy", "the angry", "the clever"
            };

            var result = StringList.ElementAt(DiceHelper.RollDice(1, StringList.Count()) - 1);

            return(result);
        }
        /// <summary>
        /// Get Random Image
        /// </summary>
        /// <returns></returns>
        public static string GetMonsterImage()
        {
            List <String> FirstNameList = new List <String> {
                "troll1.png", "troll2.png", "troll3.png", "troll4.png", "troll5.png", "troll6.png"
            };

            var result = FirstNameList.ElementAt(DiceHelper.RollDice(1, FirstNameList.Count()) - 1);

            return(result);
        }
        /// <summary>
        /// Get Name
        ///
        /// Return a Random Name
        /// </summary>
        /// <returns></returns>
        public static string GetMonsterName()
        {
            List <String> FirstNameList = new List <String> {
                "Arg", "Deg", "Ase", "Xes", "Zez", "Klk", "Oi", "Oni", "Tanu"
            };

            var result = FirstNameList.ElementAt(DiceHelper.RollDice(1, FirstNameList.Count()) - 1);

            return(result);
        }
        /// <summary>
        /// Get Random Image
        /// </summary>
        /// <returns></returns>
        public static string GetCharacterImage()
        {
            List <String> FirstNameList = new List <String> {
                "elf1.png", "elf2.png", "elf3.png", "elf4.png", "elf5.png", "elf6.png", "elf7.png"
            };

            var result = FirstNameList.ElementAt(DiceHelper.RollDice(1, FirstNameList.Count()) - 1);

            return(result);
        }
        /// <summary>
        /// Get A Random Difficulty
        /// </summary>
        /// <returns></returns>
        public static DifficultyEnum GetMonsterDifficultyValue()
        {
            var DifficultyList = DifficultyEnumHelper.GetListMonster;

            var RandomDifficulty = DifficultyList.ElementAt(DiceHelper.RollDice(1, DifficultyList.Count()) - 1);

            var result = DifficultyEnumHelper.ConvertStringToEnum(RandomDifficulty);

            return(result);
        }
        /// <summary>
        /// Get Name
        ///
        /// Return a Random Name
        /// </summary>
        /// <returns></returns>
        public static string GetCharacterName()
        {
            List <String> FirstNameList = new List <String> {
                "Mike", "Doug", "Jea", "Sue", "Tim", "Daren", "Dani", "Mami", "Mari", "Ryu", "Hucky", "Peanut", "Sumi", "Apple", "Ami", "Honami", "Sonomi", "Pat", "Sakue", "Isamu"
            };

            var result = FirstNameList.ElementAt(DiceHelper.RollDice(1, FirstNameList.Count()) - 1);

            return(result);
        }
        /// <summary>
        /// Get Description
        ///
        /// Return a random description
        /// </summary>
        /// <returns></returns>
        public static string GetMonsterDescription()
        {
            List <String> StringList = new List <String> {
                "eats Elf", "the Elf hater", "Elf destoryer", "Elf Hunter", "Elf Killer", "Can't we all get along?"
            };

            var result = StringList.ElementAt(DiceHelper.RollDice(1, StringList.Count()) - 1);

            return(result);
        }
Example #9
0
        /// <summary>
        /// Get Random Image
        /// </summary>
        /// <returns></returns>
        public static string GetMonsterImage()
        {
            List <String> FirstNameList = new List <String> {
                "Fire_monster.png", "Shadow_monster.png", "Will.png"
            };

            var result = FirstNameList.ElementAt(DiceHelper.RollDice(1, FirstNameList.Count()) - 1);

            return(result);
        }
        /// <summary>
        /// Get a Random Item for the Location
        ///
        /// Return the String for the ID
        /// </summary>
        /// <param name="location"></param>
        /// <returns></returns>
        public static string GetItem(ItemLocationEnum location)
        {
            var ItemList = ItemIndexViewModel.Instance.GetLocationItems(location);

            // Add Noe to the list
            ItemList.Add(new ItemModel {
                Id = null, Name = "None"
            });

            var result = ItemList.ElementAt(DiceHelper.RollDice(1, ItemList.Count()) - 1).Id;

            return(result);
        }
Example #11
0
        /// <summary>
        /// Get Name
        ///
        /// Return a Random Name for a Character
        /// </summary>
        /// <returns></returns>
        public static string GetCharacterName()
        {
            List <String> FirstNameList = new List <String> {
                "Frankie", "DJ Thunder", "Kit", "Vic", "Spark", "Ace", "Rudy", "Bogus", "Wednesday",
                "Charlie", "Crazy Danni Chill", "Big Celeste Koopa", "Sovereign", "Avery", "Riley", "Dakota", "Reese", "Remi", "Mr. Laura",
                "Nicki Mythic", "Harley", "Dr. Funk", "Sage", "Dallas", "River", "Eden", "Angel Skye", "Sutton", "Ali", "MC Alex Duke",
                "Lennox", "Quincy", "Ally A Trigga", "Monroe", "Devon", "Blade", "Francis", "Blair", "Memphis", "Bowie", "Lane", "Silver",
                "Rebel", "Ripley", "Indigo", "Zephyr", "Ari", "Sasha", "Jojo", "Mimi", "Maverick", "Rambo", "Jax", "Harper", "Rowan",
                "T. Riddle", "Juniper", "DJ Rumor", "Lil Dizzee", "C. Dolla", "Jade", "Shade", "Bennie", "Jude", "Marley", "Enigma",
                "MC McFly", "Lil Ice", "Eazy", "Young Spyda", "Commander Keys", "Mac Rocket", "Riri", "Aria", "Harmony", "Cadenza",
                "Chanson", "Lark", "Piper", "Rhapsody"
            };

            var result = FirstNameList.ElementAt(DiceHelper.RollDice(1, FirstNameList.Count()) - 1);

            return(result);
        }
        /// <summary>
        /// Create Random Character for the battle
        /// </summary>
        /// <param name="MaxLevel"></param>
        /// <returns></returns>
        public static CharacterModel GetRandomCharacter(int MaxLevel)
        {
            // If there are no characters in the system, return a default one
            if (CharacterIndexViewModel.Instance.Dataset.Count == 0)
            {
                return(new CharacterModel());
            }

            var rnd = DiceHelper.RollDice(1, CharacterIndexViewModel.Instance.Dataset.Count);

            var result = new CharacterModel(CharacterIndexViewModel.Instance.Dataset.ElementAt(rnd - 1))
            {
                Level = DiceHelper.RollDice(1, MaxLevel),

                // Randomize Name
                Name        = GetCharacterName(),
                Description = GetCharacterDescription(),

                // Randomize the Attributes
                OffenseAttribute = GetAbilityValue(),
                SpeedAttribute   = GetAbilityValue(),
                DefenseAttribute = GetAbilityValue(),

                // Randomize an Item for Location
                Head        = GetItem(ItemLocationEnum.Head),
                Necklass    = GetItem(ItemLocationEnum.Necklass),
                PrimaryHand = GetItem(ItemLocationEnum.PrimaryHand),
                OffHand     = GetItem(ItemLocationEnum.OffHand),
                RightFinger = GetItem(ItemLocationEnum.Finger),
                LeftFinger  = GetItem(ItemLocationEnum.Finger),
                Feet        = GetItem(ItemLocationEnum.Feet),

                ImageURI = GetCharacterImage()
            };

            result.MaxHealth = DiceHelper.RollDice(MaxLevel, 10);

            // Level up to the new level
            result.LevelUpToValue(result.Level);

            // Enter Battle at full health
            result.CurrentHealth = result.MaxHealth;

            return(result);
        }
Example #13
0
        /// <summary>
        /// Create Random Character for the battle
        /// </summary>
        /// <param name="MaxLevel"></param>
        /// <returns></returns>
        public static MonsterModel GetRandomMonster(int MaxLevel)
        {
            // If there are no Monsters in the system, return a default one
            if (MonsterIndexViewModel.Instance.Dataset.Count == 0)
            {
                return(new MonsterModel());
            }

            var rnd = DiceHelper.RollDice(1, MonsterIndexViewModel.Instance.Dataset.Count);

            var result = new MonsterModel(MonsterIndexViewModel.Instance.Dataset.ElementAt(rnd - 1))
            {
                Level = DiceHelper.RollDice(1, MaxLevel),

                // Randomize Name
                Name        = GetMonsterName(),
                Description = GetMonsterDescription(),

                // Randomize the Attributes
                Attack  = GetAbilityValue(),
                Speed   = GetAbilityValue(),
                Defense = GetAbilityValue(),

                ImageURI = GetMonsterImage(),
            };


            // Get the new Max Health
            result.MaxHealth = DiceHelper.RollDice(result.Level, 10);


            // Level up to the new level
            result.LevelUpToValue(result.Level);

            // Set ExperienceRemaining so Monsters can both use this method
            result.ExperienceRemaining = LevelTableHelper.Instance.LevelDetailsList[result.Level + 1].Experience;

            // Enter Battle at full health
            result.CurrentHealth = result.MaxHealth;

            return(result);
        }
        /// <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);
        }
 /// <summary>
 /// Get a Random Level
 /// </summary>
 /// <returns></returns>
 public static int GetLevel()
 {
     // 1-20
     return(DiceHelper.RollDice(1, 20));
 }
 /// <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));
 }
Example #17
0
        /// <summary>
        /// Get Random Monster type
        /// </summary>
        /// <returns></returns>
        public static MonsterTypeEnum GetMonsterType()
        {
            var result = (MonsterTypeEnum)(DiceHelper.RollDice(1, 22));

            return(result);
        }
 /// <summary>
 /// Get Random Ability Number
 /// </summary>
 /// <returns></returns>
 public static int GetAbilityValue()
 {
     // 0 to 9, not 1-10
     return(DiceHelper.RollDice(1, 10) - 1);
 }
Example #19
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]);
        }