/****** 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; } }
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); }
/*****************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); }
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); }
/****** 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); } }
// -------- Gold Loot Program Randomizer arrays ---------- public void GoldLoot(Player player, SwitchBoard switchBoard, Obstacles obstacles, MonsterObstacle monsterObstacle, Reward reward, BattleSwitchBoard battleSwitchBoard, EnemyEncounters enemyEncounters, BattleEngine battleEngine, SoundFx soundFx) { Random Randomizer = new Random(); int[] GoldPieces = { 3, 6, 9, 12, 15, 18, 21 }; //player.PlayerStats(); int GoldIndex = Randomizer.Next(0, GoldPieces.Length); // randomly picks a number between chosen range Array Console.Write("You Get " + GoldPieces[GoldIndex] + " Gold pieces as reward "); Thread.Sleep(500); soundFx.LootSound(); player.PlayerGold += GoldPieces[GoldIndex]; Console.WriteLine("Your Current Gold is now: " + player.PlayerGold); Console.ForegroundColor = ConsoleColor.Gray; switchBoard.TwoPaths(monsterObstacle, switchBoard, obstacles, player, reward, battleSwitchBoard, enemyEncounters, battleEngine, soundFx); }
/* -------------------------- Main Code ------------------------------- */ static void Main(string[] args) { Player player = new Player(); TextMethods textMethods = new TextMethods(); SwitchBoard switchBoard = new SwitchBoard(); Reward reward = new Reward(); Obstacles obstacles = new Obstacles(); BattleEngine battleEngine = new BattleEngine(); BattleSwitchBoard battleSwitchBoard = new BattleSwitchBoard(); MonsterObstacle monsterObstacle = new MonsterObstacle(); EnemyEncounters enemyEncounters = new EnemyEncounters(); SoundFx soundFx = new SoundFx(); //GameTitle textMethods.GameTitle(); //Game start song soundFx.IntroMusic(); player.PlayerStats(); Console.WriteLine("your stats are: "); Console.WriteLine("Health: " + player.PlayerHP); Console.WriteLine("Damage: " + player.PlayerDMG); Console.WriteLine("Your Gold is: " + player.PlayerGold); //StartGameText Method Console.WriteLine(textMethods.StartGameText()); Console.WriteLine(""); bool gameloop = true; while (gameloop) { //TwoPaths Function switchBoard.TwoPaths(monsterObstacle, switchBoard, obstacles, player, reward, battleSwitchBoard, enemyEncounters, battleEngine, soundFx); //Continue On Method Console.WriteLine(textMethods.ContinueOn()); } }
/***************** Attack Switc ********************/ public void MonsterAttackSwitch(EnemyEncounters enemyEncounters, BattleEngine battleEngine, Player player, Reward reward, Obstacles obstacles, MonsterObstacle monsterObstacle, SwitchBoard switchBoard, BattleSwitchBoard battleSwitchBoard, SoundFx soundFx)//Parametere til at føre data vidre { Console.WriteLine("The Monster Looks at you with a mean gaze"); Console.WriteLine("monster got hp: " + enemyEncounters.MonsterHP); Console.ForegroundColor = ConsoleColor.White; Console.WriteLine("\nAttack? \nRunaway"); Console.ForegroundColor = ConsoleColor.Gray; string userResponse = Console.ReadLine(); switch (userResponse.ToLower()) { case "attack": case "atk": case "attk": case "atck": case "a": Console.WriteLine("\nYou attack"); battleEngine.BattleEngine_Monster(enemyEncounters, player, reward, obstacles, switchBoard, monsterObstacle, battleSwitchBoard, battleEngine, soundFx); break; case "runaway": case "run": case "r": Console.WriteLine("You Run away"); soundFx.RunAwaySound(); Console.WriteLine("But You wont get far"); Console.WriteLine(""); switchBoard.TwoPaths(monsterObstacle, switchBoard, obstacles, player, reward, battleSwitchBoard, enemyEncounters, battleEngine, soundFx); break; default: Console.WriteLine("Sorry didn't understand that"); MonsterAttackSwitch(enemyEncounters, battleEngine, player, reward, obstacles, monsterObstacle, switchBoard, battleSwitchBoard, soundFx); break; } }