Exemplo n.º 1
0
        /// <summary>
        /// Создание монстров в зависимости от уровня игрока
        /// </summary>
        /// <param name="playerLevel">Уровень игрока</param>
        /// <returns>Лист с монстрами</returns>
        public List <Enemy> CreateEnemyForTreasure(int playerLevel)
        {
            int rand = Program.Random.Next(1 + Enemy.LowerBorderEnemyGeneration - 3 * (playerLevel / 2), 151 + Enemy.SupremeBorderEnemyGeneration + 5 * (playerLevel / 2));

            TreasureExist = true;
            rand         %= 300;
            playerLevel++;

            if (rand < 1 + Enemy.LowerBorderEnemyGeneration)
            {
                return(EnemyMix.CreateEnemyMix(playerLevel));
            }
            if (rand > 150 + Enemy.SupremeBorderEnemyGeneration)
            {
                return(EnemyDragon.CreateEnemyDragon(playerLevel));
            }
            if (rand > 0 && rand <= 50)
            {
                return(EnemyBear.CreateEnemyBear(playerLevel));
            }
            if (rand > 50 && rand <= 100)
            {
                return(EnemyOrk.CreateEnemyOrk(playerLevel));
            }
            if (rand > 100 && rand <= 130)
            {
                return(EnemyGriffin.CreateGriffin(playerLevel));
            }
            if (rand > 130 && rand <= 150)
            {
                return(EnemyTriton.CreateEnemyTriton(playerLevel));
            }
            if (rand > 150 && rand <= 200)
            {
                return(EnemyBandit.CreateEnemyBandit(playerLevel));
            }
            if (rand > 200 && rand <= 250)
            {
                return(EnemyDarkKnight.CreateEnemyDarkKnight(playerLevel));
            }
            return(EnemyGolem.CreateEnemyGolem(playerLevel));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Создание монстров в зависимости от уровня игрока
        /// </summary>
        /// <param name="playerLevel">Уровень игрока</param>
        /// <param name="playerPosition">Позиция игрока</param>
        /// <returns>позиция монстров и лист с ними</returns>
        public static Tuple <MainGameStructures.Position, List <Enemy> > CreateEnemy(int playerLevel, MainGameStructures.Position playerPosition)
        {
            EnemyExist = true;
            var  enemyPosition = EnemyGenerationPosition(playerPosition);
            bool exictPosition = false;

            do
            {
                exictPosition = false;
                foreach (var city in Program.Cities)
                {
                    if (city.Position.X == enemyPosition.X && city.Position.Y == enemyPosition.Y)
                    {
                        enemyPosition = EnemyGenerationPosition(playerPosition);
                        exictPosition = true;
                        break;
                    }
                }
            } while (exictPosition);


            /* То, какие виды монстров и с какой вероятностью будут попадаться, завит от уровня персонажа. Чем выше уровень, тем сильнее монстры.
             * На разных уровнях могут быть разные виды монстров. Также, чем больше уровень, тем выше вероятность выпадения дракона и смешанных монстров.
             */
            int rand = Program.Random.Next(1 + LowerBorderEnemyGeneration - (2 * playerLevel < 50? 2 * playerLevel:50),
                                           151 + SupremeBorderEnemyGeneration + (3 * playerLevel < 50 ? 3 * playerLevel : 50));

            rand %= 400;

            if (rand < 1 + LowerBorderEnemyGeneration)
            {
                return(Tuple.Create(enemyPosition, EnemyMix.CreateEnemyMix(playerLevel)));
            }
            if (rand > 150 + SupremeBorderEnemyGeneration)
            {
                return(Tuple.Create(enemyPosition, EnemyDragon.CreateEnemyDragon(playerLevel)));
            }
            if (rand >= 1 && rand <= 50)
            {
                return(Tuple.Create(enemyPosition, EnemyWolf.CreateEnemyWolf(playerLevel)));
            }
            if (rand > 50 && rand <= 100)
            {
                return(Tuple.Create(enemyPosition, EnemyGoblin.CreateEnemyGoblin(playerLevel)));
            }
            if (rand > 100 && rand <= 150)
            {
                return(Tuple.Create(enemyPosition, EnemyBear.CreateEnemyBear(playerLevel)));
            }
            if (rand > 150 && rand <= 200)
            {
                return(Tuple.Create(enemyPosition, EnemyOrk.CreateEnemyOrk(playerLevel)));
            }
            if (rand > 200 && rand <= 220)
            {
                return(Tuple.Create(enemyPosition, EnemyTriton.CreateEnemyTriton(playerLevel)));
            }
            if (rand > 220 && rand <= 250)
            {
                return(Tuple.Create(enemyPosition, EnemyBandit.CreateEnemyBandit(playerLevel)));
            }
            if (rand > 250 && rand <= 300)
            {
                return(Tuple.Create(enemyPosition, EnemyGriffin.CreateGriffin(playerLevel)));
            }
            if (rand > 300 && rand <= 350)
            {
                return(Tuple.Create(enemyPosition, EnemyDarkKnight.CreateEnemyDarkKnight(playerLevel)));
            }
            return(Tuple.Create(enemyPosition, EnemyGolem.CreateEnemyGolem(playerLevel)));
        }