public void RandomPlayerHelper_GetRandomMonsterEscapingSchool_2_Should_Return_Administrator()
        {
            // Arrange
            DiceHelper.EnableForcedRolls();
            DiceHelper.SetForcedRollValue(2);

            // Act
            var result = RandomPlayerHelper.GetRandomMonsterEscapingSchool(20);

            // Reset
            DiceHelper.DisableForcedRolls();

            // Assert
            Assert.AreEqual(MonsterTypeEnum.Administrator, result.MonsterTypeEnum);
        }
Пример #2
0
        /// <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 override int AddMonstersToRound()
        {
            // TODO: Teams, You need to implement your own Logic can not use mine.

            int TargetLevel = 1;

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

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

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

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

            return(EngineSettings.MonsterList.Count());
        }
Пример #3
0
        /// <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 override int AddMonstersToRound()
        {
            // Teams, You need to implement your own Logic can not use mine.

            /*
             * Ideas for adding monsters to round:
             * 1. check what levels are in character list, maybe take it as an average of the levels.
             * 2. add in the monsters similar to base by adding in random monster, except we
             * add them based on specific monster type. then adjust the values based on average level of monster.
             * 3. if any character is on level 18+, they will need to fight the Graduation Office Administrator
             * which will hold Graduation cap and robe.
             */

            int  TargetLevel = 1;
            bool ContainHighLevelCharacter = false;
            int  MaxParty = EngineSettings.MaxNumberPartyMonsters;

            // get the average level of characters
            if (EngineSettings.CharacterList.Count() > 0)
            {
                // Get the average
                TargetLevel = Convert.ToInt32(EngineSettings.CharacterList.Average(m => m.Level));

                // if character list contains level higher than 17
                if (EngineSettings.CharacterList.Find(m => (m.Level > 17)) != null)
                {
                    ContainHighLevelCharacter = true;
                    // Add graduate monster
                    MaxParty--;
                }
            }

            // load the monsters list
            for (var i = 0; i < MaxParty; i++)
            {
                var data = RandomPlayerHelper.GetRandomMonsterEscapingSchool(TargetLevel);

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

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

            // if the character contains level higher than 17+ then we add a big boss monster
            // if player beats this monster the student will graduate!
            if (ContainHighLevelCharacter)
            {
                MonsterModel BigBoss = ViewModels.MonsterIndexViewModel.Instance.GetDefaultMonster(SpecificMonsterTypeEnum.GraduationOfficeAdministrator);
                if (BigBoss == null)
                {
                    var Item = ViewModels.ItemIndexViewModel.Instance.GetDefaultItemTypeItem(ItemTypeEnum.GraduationCapAndRobe);
                    BigBoss = new MonsterModel {
                        PlayerType              = PlayerTypeEnum.Monster,
                        MonsterTypeEnum         = MonsterTypeEnum.Administrator,
                        SpecificMonsterTypeEnum = SpecificMonsterTypeEnum.GraduationOfficeAdministrator,
                        Name           = "Mr. Smith",
                        Description    = "You have graduated!!!",
                        Attack         = 8,
                        Difficulty     = DifficultyEnum.Difficult,
                        UniqueDropItem = Item.Id,
                        ImageURI       = Constants.SpecificMonsterTypeGraduationOfficeAdministratorImageURI
                    };
                }

                EngineSettings.MonsterList.Add(new PlayerInfoModel(BigBoss));
                // Add MaxNumberPartyMonster back.
                MaxParty++;
            }


            if (EngineSettingsModel.Instance.HackathonDebug == true)
            {
                var d2 = DiceHelper.RollDice(1, 100);
                // 50/50 chance of it occuring with boss battle
                var percentage = EngineSettingsModel.Instance.BossBattleLikelihood;

                if (d2 >= percentage)
                {
                    // clear the monster list
                    EngineSettings.MonsterList.Clear();

                    // add in the new badass monster
                    MonsterModel BigBoss = new MonsterModel
                    {
                        PlayerType              = PlayerTypeEnum.Monster,
                        MonsterTypeEnum         = MonsterTypeEnum.Faculty,
                        SpecificMonsterTypeEnum = SpecificMonsterTypeEnum.Professor,
                        Name        = "Mike Koenig",
                        Description = "You will never graduate!!!",
                        Attack      = 10,
                        Range       = 5,
                        Level       = 20,
                        Difficulty  = DifficultyEnum.Difficult,
                        ImageURI    = Constants.SpecificMonsterTypeProfessorImageURI,
                    };

                    EngineSettings.MonsterList.Add(new PlayerInfoModel(BigBoss));
                }
            }

            return(EngineSettings.MonsterList.Count());
        }