/// <summary>
        /// Add Monsters to the Round
        ///
        /// Because Monsters can be duplicated, will add 1, 2, 3 to their name
        ///

        /*
         * Hint:
         * I don't have crudi monsters yet so will add 6 new ones...
         * If you have crudi monsters, then pick from the list
         * Consdier how you will scale the monsters up to be appropriate for the characters to fight
         *
         */
        /// </summary>
        /// <returns></returns>
        public int AddMonstersToRound()
        {
            var    monsterModel = MonsterIndexViewModel.Instance;
            Random rnd          = new Random();
            int    TargetLevel  = 1;
            int    MaxLevel     = 20;


            if (CharacterList.Count() > 0)
            {
                // Get the Min Character Level (linq is soo cool....)
                TargetLevel = Convert.ToInt32(CharacterList.Min(m => m.Level));
                MaxLevel    = Convert.ToInt32(CharacterList.Max(m => m.Level));
            }

            /* Hack 31 has been implemented. If the round count is > 100
             * then the monster's speed, defense, attack, current health, and max health
             * are buffed 10x
             */
            for (var i = 0; i < MaxNumberPartyMonsters; i++)
            {
                int index = rnd.Next(0, MaxNumberPartyMonsters - 1);
                var data  = monsterModel.Dataset[index];
                data.Level         = TargetLevel;
                data.Speed         = getAttributeLevel();
                data.Defense       = getAttributeLevel();
                data.Attack        = getAttributeLevel();
                data.MaxHealth     = DiceHelper.RollDice(TargetLevel, 10);
                data.CurrentHealth = data.MaxHealth;

                MonsterList.Add(new PlayerInfoModel(data));
            }

            return(MonsterList.Count());
        }
        /// <summary>
        /// Method to gather the average character level to assist in scaling monsters for the round
        /// </summary>
        /// <returns></returns>
        public int GetAverageCharacterLevel()
        {
            if (CharacterList.Count() == 0)
            {
                return(1);
            }
            var List = new List <int>(CharacterList.Select(o => o.Level));

            return((int)List.Average());
        }
Beispiel #3
0
        public bool CreateCharacterParty()
        {
            foreach (var data in CharacterIndexViewModel.Instance.Dataset)
            {
                if (CharacterList.Count() >= MaxNumberPartyCharacters)
                {
                    break;
                }
                PopulateCharacterList(data);
            }

            return(true);
        }
Beispiel #4
0
        /// <summary>
        /// Create Characters for Party
        /// </summary>
        public bool CreateCharacterParty(bool Ifeelgood)
        {
            // Picks 6 Characters

            // To use your own characters, populate the List before calling RunAutoBattle

            // Will first pull from existing characters
            foreach (var data in CharacterIndexViewModel.Instance.Dataset)
            {
                if (CharacterList.Count() >= MaxNumberPartyCharacters)
                {
                    break;
                }
                PopulateCharacterList(data);
            }

            //If there are not enough will add default ones
            List <CharacterModel> DefaultCharacterList = DefaultData.LoadData(new CharacterModel());

            for (int i = CharacterList.Count; i < MaxNumberPartyCharacters; i++)
            {
                PopulateCharacterList(DefaultCharacterList[i]);
            }
            if (Ifeelgood == true)
            {
                foreach (PlayerInfoModel Character in CharacterList)
                {
                    Character.Attack += 20;
                }

                foreach (PlayerInfoModel Monster in MonsterList)
                {
                    if (Monster.Attack >= 20)
                    {
                        Monster.Attack -= 20;
                    }
                    if (Monster.Attack < 20)
                    {
                        Monster.Attack = 0;
                    }
                }
            }

            return(true);
        }
Beispiel #5
0
        /// <summary>
        /// Create Characters for Party
        /// </summary>
        public bool CreateCharacterParty()
        {
            // Picks 6 Characters

            // To use your own characters, populate the List before calling RunAutoBattle

            // Will first pull from existing characters
            foreach (var data in CharacterIndexViewModel.Instance.Dataset)
            {
                if (CharacterList.Count() >= MaxNumberPartyCharacters)
                {
                    break;
                }
                PopulateCharacterList(data);
            }

            //If there are not enough will add random ones
            for (int i = CharacterList.Count(); i < MaxNumberPartyCharacters; i++)
            {
                PopulateCharacterList(Helpers.RandomPlayerHelper.GetRandomCharacter(1));
            }

            return(true);
        }
        /// <summary>
        /// Add Monsters to the Round
        ///
        /// Because Monsters can be duplicated, will add 1, 2, 3 to their name
        ///

        /*
         * Hint:
         * I don't have crudi monsters yet so will add 6 new ones...
         * If you have crudi monsters, then pick from the list
         *
         * Consdier how you will scale the monsters up to be appropriate for the characters to fight
         *
         */
        /// </summary>
        /// <returns></returns>
        public int AddMonstersToRound()
        {
            // TODO: Teams, You need to implement your own Logic can not use mine.



            int TargetLevel = 1;

            if (CharacterList.Count() > 0)
            {
                // Get the Min Character Level (linq is soo cool....)
                TargetLevel = Convert.ToInt32(CharacterList.Min(m => m.Level));
            }

            for (var i = 0; i < MaxNumberPartyMonsters; i++)
            {
                var data = Helpers.RandomPlayerHelper.GetRandomMonster(TargetLevel);

                // Help identify which Monster it is
                data.Name += " " + MonsterList.Count() + 1;

                //Scenario 31
                if (BattleScore.RoundCount >= 100)
                {
                    data.Attack     *= 10;
                    data.Speed      *= 10;
                    data.Defense    *= 10;
                    data.CurrHealth *= 10;
                    data.MaxHealth  *= 10;
                }


                MonsterList.Add(new PlayerInfoModel(data));
            }


            if ((BossBattleFunctionality && DiceHelper.RollDice(1, 100) > 90) || testBossHack)
            {
                Debug.WriteLine("BOSS MONSTER APPROACHING!!!!!");
                MonsterList.Clear();
                int scaleFactor = 0;
                for (int i = 0; i < CharacterList.Count; i++)
                {
                    scaleFactor += CharacterList[i].Level;
                }
                if (scaleFactor > 20)
                {
                    scaleFactor = 20;
                }



                var data = new BaseMonster();
                data.LevelUpToValue(scaleFactor);

                data.Attack    = 5000;
                data.Defense   = 5000;
                data.Speed     = 10000;
                data.MaxHealth = data.CurrHealth = 1000;

                MonsterList.Add(new PlayerInfoModel(data));
            }


            return(MonsterList.Count());
        }