Esempio n. 1
0
 public void playerInfo(Player player)
 {
     Console.WriteLine("Name : " + name);
     Console.WriteLine("HP : " + hP);
     Console.WriteLine("Experience : " + xP);
     Console.WriteLine("Level : " + level);
 }
Esempio n. 2
0
        public void cardLand(Player player)
        {
            map();

            positionX = random.Next(0, 4);
            positionY = random.Next(0, 4);
            positionStart = card[positionX, positionY];

            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.WriteLine(positionStart);
            Console.ResetColor();
            movePlayer(player);
        }
Esempio n. 3
0
        public void initialisePlayer()
        {
            string name = "";
            while (string.IsNullOrEmpty(name))
            {
                Console.WriteLine("What's your name ?");
                Console.Write(">");
                name = Console.ReadLine();
            }

            Player player = new Player(name, 0, 1200, 1200, 1);

            player.playerInfo(player);
            Console.WriteLine("");
            Console.WriteLine("");
            Console.WriteLine("");
        }
Esempio n. 4
0
 public void playGame(Player player, Map map)
 {
     map.cardLand(player);
 }
Esempio n. 5
0
        public void movePlayer(Player player)
        {
            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("Choose your direction");
            Console.WriteLine();
            Console.ResetColor();
            Console.WriteLine("North");
            Console.WriteLine("South");
            Console.WriteLine("East");
            Console.WriteLine("West");
            Console.WriteLine("Info");
            Console.WriteLine("Quit");

            Console.Write(">");

            directionPlayer = Console.ReadLine();
            switch (directionPlayer)
            {
                case "North":
                case "north":
                    try
                    {
                        positionY++;
                        positionPlayer = card[positionX, positionY];

                        Console.ForegroundColor = ConsoleColor.Yellow;
                        Console.WriteLine(positionStart);
                        Console.ResetColor();

                        monsterRate = random.Next(0, 2);

                        if (monsterRate == 1)
                        {
                            Console.ForegroundColor = ConsoleColor.Red;
                            Console.WriteLine("Be careful you are attacked !");
                            Console.ResetColor();

                            Battle battle = new Battle(player);

                        }
                        else
                        {
                            movePlayer(player);
                        }
                    }
                    catch (Exception)
                    {
                        Console.ForegroundColor = ConsoleColor.Red;
                        Console.WriteLine("There are nothing, change direction");
                        Console.ResetColor();

                        movePlayer(player);

                    }

                    break;

                case "South":
                case "south":

                    try
                    {
                        positionX++;
                        positionStart = card[positionX, positionY];
                        Console.ForegroundColor = ConsoleColor.Yellow;
                        Console.WriteLine(positionStart);
                        Console.ResetColor();

                        monsterRate = random.Next(0, 2);

                        if (monsterRate == 1)
                        {
                            Console.ForegroundColor = ConsoleColor.Red;
                            Console.WriteLine("Attention ! Vous vous faîtes attaqué !");
                            Console.ResetColor();
                            Battle battle = new Battle(player);

                        }
                        else
                        {
                            movePlayer(player);
                        }
                    }
                    catch (Exception)
                    {
                        Console.ForegroundColor = ConsoleColor.Red;
                        Console.WriteLine("Il n'y a que l'océan par là ,vous ne pouvez aller dans cette direction");
                        Console.ResetColor();

                        movePlayer(player);
                    }

                    break;

                case "West":
                case "west":

                    try
                    {
                        positionX--;
                        positionStart = card[positionX, positionY];
                        Console.ForegroundColor = ConsoleColor.Yellow;
                        Console.WriteLine(positionStart);
                        Console.ResetColor();

                        monsterRate = random.Next(0, 2);

                        if (monsterRate == 1)
                        {
                            Console.ForegroundColor = ConsoleColor.Red;
                            Console.WriteLine("Attention ! Vous vous faîtes attaqué !");
                            Console.ResetColor();

                            Battle battle = new Battle(player);

                        }
                        else
                        {
                            movePlayer(player);
                        }
                    }
                    catch (Exception)
                    {
                        Console.ForegroundColor = ConsoleColor.Red;
                        Console.WriteLine("Il n'y a que l'océan par là ,vous ne pouvez aller dans cette direction");
                        Console.ResetColor();

                        movePlayer(player);
                    }

                    break;

                case "Info":
                case "info":

                    player.playerInfo(player);
                    movePlayer(player);

                    break;

            }
        }
Esempio n. 6
0
        public void fight(Player player, Monster monster)
        {
            Console.WriteLine("");
            Console.WriteLine("What do you do ? ");
            Console.WriteLine("1. Fist flash");
            Console.WriteLine("2. Facial cumshot");
            Console.WriteLine("3. Inventory");
            Console.WriteLine("4. Run like a coward");

            do
            {

                attackPlayer = int.Parse(Console.ReadLine());

                switch (attackPlayer)
                {
                    case 1:
                        degatPlayer = random.Next(1, 50);
                        Console.ForegroundColor = ConsoleColor.Yellow;
                        Console.BackgroundColor = ConsoleColor.Red;
                        Console.WriteLine("You fisted the monster on his face !");
                        Console.WriteLine("You dealt " + degatPlayer + " of degats");

                        monster.HP = Math.Abs(monster.HP - degatPlayer);

                        Console.WriteLine("Il reste " + monster.HP + " HP au " + monster.Name);
                        Console.ResetColor();

                        degatMonster = random.Next(1, 35);

                        Console.ForegroundColor = ConsoleColor.Red;
                        Console.BackgroundColor = ConsoleColor.Yellow;

                        Console.WriteLine("");
                        Console.WriteLine(monster.AttackName);
                        Console.WriteLine("Il vous a infligé " + degatMonster + "degats");

                        player.HP = Math.Abs(player.HP - degatMonster);

                        Console.WriteLine("Il vous reste " + player.HP + "de vie");
                        Console.ResetColor();
                        break;

                    case 2:

                        degatPlayer = random.Next(1, 75);
                        Console.ForegroundColor = ConsoleColor.Yellow;
                        Console.BackgroundColor = ConsoleColor.Red;
                        Console.WriteLine("Vous vous infiltrez dans le dos du monstre et lui faites un german suplex");

                        Console.WriteLine("Vous avez infligé " + degatPlayer + " degats");

                        monster.HP = Math.Abs(monster.HP - degatPlayer);

                        Console.WriteLine("Il reste " + monster.HP + " HP au " + monster.Name);
                        Console.ResetColor();

                        degatMonster = random.Next(1, 35);
                        Console.ForegroundColor = ConsoleColor.Red;
                        Console.BackgroundColor = ConsoleColor.Yellow;

                        Console.WriteLine("");
                        Console.WriteLine(monster.AttackName);

                        Console.WriteLine("Il vous a infligé " + degatMonster + "degats");

                        player.HP = Math.Abs(player.HP - degatMonster);

                        Console.WriteLine("Il vous reste " + player.HP + "de vie");
                        Console.ResetColor();
                        break;

                    case 3:
                        Console.WriteLine("Sorry I have nothing for you right now :) ");
                        break;
                }

            } while (monster.HP > 0 && player.HP > 0);

            if (monster.HP < 1)
            {
                Console.WriteLine("GREAT you killed " + monster.Name + " !!!");
            }

            if (player.HP < 1)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.BackgroundColor = ConsoleColor.Yellow;
                Console.WriteLine("");
                Console.WriteLine("You died !");
                Console.WriteLine("");
                Console.ResetColor();
            }
        }
Esempio n. 7
0
 public Battle(Player player)
 {
     invokeMonster(player);
 }
Esempio n. 8
0
        public void invokeMonster(Player player)
        {
            Monster monster = new Monster();

            Random typemonst = new Random();

            numberMonster = typemonst.Next(4);

                switch (numberMonster)
                {
                    case 0:

                        monster.Choubaka();

                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("Choubaka appears !");
                Console.ResetColor();
                fight(player, monster);

                        break;

                    case 1:

                        monster.Zombie();

                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("Zombie appears !");
                Console.ResetColor();
                fight(player, monster);
                        break;

                    case 2:

                        monster.Bogeyman();
                    Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("Bogeyman appears !");
                Console.ResetColor();
                fight(player, monster);

                        break;

                    case 3:
                    monster.Vampire();

                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("Vampire appears !");
                Console.ResetColor();
                fight(player, monster);
                        break;

                }
        }