Exemple #1
0
        /****** Battle Engine der skal styrer alle fights ******/
        public void BattleEngine_Monster(EnemyEncounters enemyEncounters, Player player, Reward reward, Obstacles obstacles, SwitchBoard switchBoard, MonsterObstacle monsterObstacle, BattleSwitchBoard battleSwitchBoard, BattleEngine battleEngine, SoundFx soundFx)//Parametere til at føre data vidre
        {
            bool IsrunningPlayer = true;

            while (IsrunningPlayer)
            {
                bool IsrunningMonster = true;
                Console.WriteLine("monster got hp: " + enemyEncounters.MonsterHP);
                soundFx.AttackSound();
                Console.Write("You do " + player.PlayerDMG + " amount of dmg");
                Console.WriteLine();

                if (enemyEncounters.MonsterHP < player.PlayerDMG)     // Lower than varibel
                {
                    Console.ForegroundColor = ConsoleColor.DarkMagenta;
                    Console.WriteLine("\nThe Monster lies Bleeding violently at your feet ");
                    soundFx.EnemyKillSound();
                    reward.GoldLoot(player, switchBoard, obstacles, monsterObstacle, reward, battleSwitchBoard, enemyEncounters, battleEngine, soundFx);
                    Console.ForegroundColor = ConsoleColor.Gray;
                    IsrunningPlayer         = false;
                }

                if (enemyEncounters.MonsterHP == player.PlayerDMG)     // Equal varibel
                {
                    Console.ForegroundColor = ConsoleColor.DarkMagenta;
                    Console.WriteLine("\nThe Monster dies ");
                    soundFx.EnemyKillSound();
                    reward.GoldLoot(player, switchBoard, obstacles, monsterObstacle, reward, battleSwitchBoard, enemyEncounters, battleEngine, soundFx);
                    Console.ForegroundColor = ConsoleColor.Gray;
                    IsrunningPlayer         = false;
                }

                else if (enemyEncounters.MonsterHP > player.PlayerDMG)     // higher than varibel
                {
                    enemyEncounters.MonsterHP -= player.PlayerDMG;
                    Console.WriteLine("Monster has " + enemyEncounters.MonsterHP + " Hp left");
                    Console.ForegroundColor = ConsoleColor.DarkCyan;
                    Console.WriteLine("You didnt kill it. \nMonster fights back");
                    Console.ReadLine();
                    Console.ForegroundColor = ConsoleColor.Gray;

                    //Monster Fights Back
                    while (IsrunningMonster)
                    {
                        soundFx.EnemyAttackSound();
                        Console.Write("Monster do " + enemyEncounters.MonsterDMG + " amount of dmg");
                        Console.WriteLine();

                        if (player.PlayerHP < enemyEncounters.MonsterDMG)     // Lower than varibel
                        {
                            Console.ForegroundColor = ConsoleColor.Red;
                            Console.WriteLine("\nYou are Defeated \nand lie Bleeding violently at its feet ");
                            IsrunningPlayer         = false;
                            IsrunningMonster        = false;
                            Console.ForegroundColor = ConsoleColor.Gray;
                            Environment.Exit(0);    // lukker console
                        }

                        else if (player.PlayerHP == enemyEncounters.MonsterDMG)     // Equal varibel
                        {
                            Console.ForegroundColor = ConsoleColor.DarkRed;
                            Console.WriteLine("\nYou are Defeated ");
                            IsrunningPlayer         = false;
                            IsrunningMonster        = false;
                            Console.ForegroundColor = ConsoleColor.Gray;
                            Environment.Exit(0);
                        }

                        else if (player.PlayerHP > enemyEncounters.MonsterDMG)
                        {
                            player.PlayerHP -= enemyEncounters.MonsterDMG;

                            Console.WriteLine("You have " + player.PlayerHP + " Hp left");
                            Console.ForegroundColor = ConsoleColor.DarkCyan;
                            Console.WriteLine("It didnt kill you. \nFight back");
                            Console.ForegroundColor = ConsoleColor.Gray;
                            Console.ReadLine();
                            IsrunningMonster = false;
                        }
                    }
                }
            }
        }
Exemple #2
0
        public void dialogueOptions2(MonsterObstacle monsterObstacle, SwitchBoard switchBoard, Obstacles obstacles, Player player, Reward reward, BattleSwitchBoard battleSwitchBoard, EnemyEncounters enemyEncounters, BattleEngine battleEngine, SoundFx soundFx)
        {
            Console.WriteLine("\nWhat do you say? ");
            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine("1. Thank you for the warning Friend... \n2. Hmph I dont need care im invinsible");
            Console.ForegroundColor = ConsoleColor.Gray;
            string playerResponse = Console.ReadLine();

            switch (playerResponse.ToLower())
            {
            case "1":
                Console.ForegroundColor = ConsoleColor.Yellow;
                Console.WriteLine("He Smiles politely \nalways nice to help a fellow traveler");
                Console.ForegroundColor = ConsoleColor.Gray;
                break;

            case "2":
                Console.ForegroundColor = ConsoleColor.DarkYellow;
                Console.WriteLine("He smirk at your response. \nShaking his head as he walks away");
                Console.ForegroundColor = ConsoleColor.Gray;
                break;

            default:
                Console.ForegroundColor = ConsoleColor.DarkGray;
                Console.WriteLine("You do nothing and continue onwards");
                Console.ForegroundColor = ConsoleColor.Gray;
                break;
            }
            switchBoard.TwoPaths(monsterObstacle, switchBoard, obstacles, player, reward, battleSwitchBoard, enemyEncounters, battleEngine, soundFx);
        }
Exemple #3
0
        /****** Npc encounters for dialogue muligheder ******/
        public void NpcEncounter(MonsterObstacle monsterObstacle, SwitchBoard switchBoard, Obstacles obstacles, Player player, Reward reward, BattleSwitchBoard battleSwitchBoard, EnemyEncounters enemyEncounters, BattleEngine battleEngine, SoundFx soundFx)
        {
            Random random       = new Random();
            int    randomNumber = random.Next(1, 5);

            switch (randomNumber)
            {
            case 1:
                Console.ForegroundColor = ConsoleColor.DarkCyan;
                Console.WriteLine("\n'Hello' the person said");
                Console.WriteLine("Be wary on the Road here adventurer. \nSeveral nasty looking Xmas creatures are seen roaming around");
                Console.ForegroundColor = ConsoleColor.Gray;
                dialogueOptions1(monsterObstacle, switchBoard, obstacles, player, reward, battleSwitchBoard, enemyEncounters, battleEngine, soundFx);
                break;

            case 2:
                Console.ForegroundColor = ConsoleColor.DarkCyan;
                Console.WriteLine("\n'Hi' the person said");
                Console.WriteLine("Take care on the road friend. \nThe Road is slippery in this weather \nand Santas little helpers are messing around");
                Console.ForegroundColor = ConsoleColor.Gray;
                dialogueOptions2(monsterObstacle, switchBoard, obstacles, player, reward, battleSwitchBoard, enemyEncounters, battleEngine, soundFx);
                break;

            case 3:
                Console.ForegroundColor = ConsoleColor.DarkCyan;
                Console.WriteLine("\n'Sup' the person said");
                Console.WriteLine("Carefull not to slip in the corpse of that gnome back there as i did");
                Console.ForegroundColor = ConsoleColor.Gray;
                dialogueOptions3(monsterObstacle, switchBoard, obstacles, player, reward, battleSwitchBoard, enemyEncounters, battleEngine, soundFx);
                break;

            case 4:    //Healer som jule gave selvfølgelig med 24 som amount heal i forhold til tema
                Console.ForegroundColor = ConsoleColor.DarkGreen;
                Console.WriteLine("\nMerry Xmas!");
                Console.WriteLine("Here have a present from me to you in these Xmas times");
                Console.ForegroundColor = ConsoleColor.Green;
                Console.WriteLine("HP has been restored and boosted. You gained 24 HP!");
                player.PlayerHP        += 24;
                Console.ForegroundColor = ConsoleColor.Gray;
                switchBoard.TwoPaths(monsterObstacle, switchBoard, obstacles, player, reward, battleSwitchBoard, enemyEncounters, battleEngine, soundFx);
                break;

            default:
                Console.ForegroundColor = ConsoleColor.DarkCyan;
                Console.WriteLine("\nIdk what the f**k just happened");
                Console.WriteLine("He says with a very confused look on his face");
                Console.WriteLine("He doesn't seem to notice you as he walks past you...");
                Console.ForegroundColor = ConsoleColor.Gray;
                switchBoard.TwoPaths(monsterObstacle, switchBoard, obstacles, player, reward, battleSwitchBoard, enemyEncounters, battleEngine, soundFx);
                break;
            }
        }
Exemple #4
0
        /*****************Dialogue Options******************/
        public void dialogueOptions1(MonsterObstacle monsterObstacle, SwitchBoard switchBoard, Obstacles obstacles, Player player, Reward reward, BattleSwitchBoard battleSwitchBoard, EnemyEncounters enemyEncounters, BattleEngine battleEngine, SoundFx soundFx)
        {
            Console.WriteLine("\nWhat do you say? ");
            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine("1. Thank you friend \n2. Mind your own business");
            Console.ForegroundColor = ConsoleColor.Gray;
            string playerResponse = Console.ReadLine();

            switch (playerResponse.ToLower())
            {
            case "1":
                Console.ForegroundColor = ConsoleColor.Yellow;
                Console.WriteLine("He Smiles politely at your response \nand move on with his journey");
                Console.ForegroundColor = ConsoleColor.Gray;
                break;

            case "2":
                Console.ForegroundColor = ConsoleColor.DarkYellow;
                Console.WriteLine("He grunts at your response. \nClearly dissatisfied with your attitude");
                Console.ForegroundColor = ConsoleColor.Gray;
                break;

            default:
                Console.ForegroundColor = ConsoleColor.DarkGray;
                Console.WriteLine("You do nothing and continue onwards");
                Console.ForegroundColor = ConsoleColor.Gray;
                break;
            }
            switchBoard.TwoPaths(monsterObstacle, switchBoard, obstacles, player, reward, battleSwitchBoard, enemyEncounters, battleEngine, soundFx);
        }
Exemple #5
0
        public void dialogueOptions3(MonsterObstacle monsterObstacle, SwitchBoard switchBoard, Obstacles obstacles, Player player, Reward reward, BattleSwitchBoard battleSwitchBoard, EnemyEncounters enemyEncounters, BattleEngine battleEngine, SoundFx soundFx)
        {
            Console.WriteLine("\nWhat do you say?");
            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine("1. Thank you. Hope you are okay \n2. HA HA HA you Fool");
            Console.ForegroundColor = ConsoleColor.Gray;
            string playerResponse = Console.ReadLine();

            switch (playerResponse.ToLower())
            {
            case "1":
                Console.ForegroundColor = ConsoleColor.Yellow;
                Console.WriteLine("'who me? yeah just wanted to give \nyou a headsup thats all' \nHe says as he walks on");
                Console.ForegroundColor = ConsoleColor.Gray;
                break;

            case "2":
                Console.ForegroundColor = ConsoleColor.DarkYellow;
                Console.WriteLine("He clench his fist at you for a second. \nBut realize you are not worth the effort ");
                Console.ForegroundColor = ConsoleColor.Gray;
                break;

            default:
                Console.ForegroundColor = ConsoleColor.DarkGray;
                Console.WriteLine("You do nothing and continue onwards");
                Console.ForegroundColor = ConsoleColor.Gray;
                break;
            }
            switchBoard.TwoPaths(monsterObstacle, switchBoard, obstacles, player, reward, battleSwitchBoard, enemyEncounters, battleEngine, soundFx);
        }
Exemple #6
0
        /****** Array randomizer af Monster liste ******/
        public void MonsterEncounter(EnemyEncounters enemyEncounters, BattleEngine battleEngine, Player player, Reward reward, Obstacles obstacles, BattleSwitchBoard battleSwitchBoard, SwitchBoard switchBoard, MonsterObstacle monsterObstacle, SoundFx soundFx)
        {
            var RandomMonster = new Random(); //Randomizer

            bool isrunning = true;

            string[] MonsterList = { "AdultReindeer ", "XmasGnome ", "XmasElf " }; //Monster Array list

            while (isrunning)
            {
                int    i       = RandomMonster.Next(0, 3);
                string Youmeet = MonsterList[i];

                if (Youmeet == "AdultReindeer ")
                {
                    Console.ForegroundColor = ConsoleColor.DarkYellow;
                    Console.WriteLine("\nYou Encounter an Adult Reindeer");
                    enemyEncounters.AdultReindeer();
                    Console.WriteLine("HP: " + enemyEncounters.MonsterHP);
                    Console.WriteLine("DMG Value: " + enemyEncounters.MonsterDMG);
                    Console.ForegroundColor = ConsoleColor.Gray;
                    battleSwitchBoard.MonsterAttackSwitch(enemyEncounters, battleEngine, player, reward, obstacles, monsterObstacle, switchBoard, battleSwitchBoard, soundFx);
                }

                else if (Youmeet == "XmasGnome ")
                {
                    Console.ForegroundColor = ConsoleColor.DarkYellow;
                    Console.WriteLine("\nYou encounter a Xmas Gnome");
                    enemyEncounters.XmasGnome();
                    Console.WriteLine("HP: " + enemyEncounters.MonsterHP);
                    Console.WriteLine("DMG Value: " + enemyEncounters.MonsterDMG);
                    Console.ForegroundColor = ConsoleColor.Gray;
                    battleSwitchBoard.MonsterAttackSwitch(enemyEncounters, battleEngine, player, reward, obstacles, monsterObstacle, switchBoard, battleSwitchBoard, soundFx);
                }

                else if (Youmeet == "XmasElf ")
                {
                    Console.ForegroundColor = ConsoleColor.DarkYellow;
                    enemyEncounters.AdultReindeer();
                    Console.WriteLine("\nYou encounter a Xmas Elf");
                    enemyEncounters.XmasGnome();
                    Console.WriteLine("HP: " + enemyEncounters.MonsterHP);
                    Console.WriteLine("DMG Value: " + enemyEncounters.MonsterDMG);
                    Console.ForegroundColor = ConsoleColor.Gray;
                    battleSwitchBoard.MonsterAttackSwitch(enemyEncounters, battleEngine, player, reward, obstacles, monsterObstacle, switchBoard, battleSwitchBoard, soundFx);
                }

                else
                {
                    isrunning = false;
                }
                Console.ReadLine();
                switchBoard.TwoPaths(monsterObstacle, switchBoard, obstacles, player, reward, battleSwitchBoard, enemyEncounters, battleEngine, soundFx);
            }
        }