protected void StartEncounter(Encounter e) { lastEncounter = e; BattleManager.Instance.StartBattle(battleScene, e); }
public void movement(char side, ref Hero hero, ref Map world, SoundPlayer Overworld) //ruch postaci { int column = 0; int row = 0; foreach (bool x in partyposition) { if (x == true) { partyposition[row, column] = false; break; } column++; if (column > EncounterID.GetLength(0) - 1) { column = 0; row++; } } switch (side) { case 'w': if (row == 0) { goto default; } row -= 1; if (impassable[row, column] == true) { row += 1; } partyposition[row, column] = true; break; case 'a': if (column == 0) { goto default; } column -= 1; if (impassable[row, column] == true) { column += 1; } partyposition[row, column] = true; break; case 'd': if (column == EncounterID.GetLength(0) - 1) { goto default; } column += 1; if (impassable[row, column] == true) { column -= 1; } partyposition[row, column] = true; break; case 's': if (row == EncounterID.GetLength(1) - 1) { goto default; } row += 1; if (impassable[row, column] == true) { row -= 1; } partyposition[row, column] = true; break; default: partyposition[row, column] = true; break; } if (EncounterID[row, column] == 3) { revisitable[row, column] = true; } Encounter.explore(EncounterID[row, column], explored[row, column], ref hero, ref revisitable[row, column], Overworld); explored[row, column] = true; }
public static void plainsAdventure(bool encounter) { bool input = true; if (encounter) { Console.Clear(); Console.WriteLine("You begin travelling through a large plains area"); string[] randomContext = { "camp", "watchtower", "field" }; string r = randomContext[rnd.Next(0, 3)]; Console.WriteLine("While traveling through this expanse of land, you see a " + r + " in the distance\n"); Console.ReadKey(); while (input) { Console.WriteLine("Continue searching?(Y/N)"); string playerInput = Console.ReadLine(); Console.Clear(); if (playerInput.ToUpper() == "Y") { input = false; Console.WriteLine("\nYou decide to investigate the " + r + ", only to find out it was an elaborate trap! You are ambushed."); Console.ReadKey(); Encounter.Combat(true, "", 0, 0); } else if (playerInput.ToUpper() == "N") { input = false; bool transitionCheck = true; if (transitionCheck) { Console.WriteLine("You hastily make your way though the plains"); Console.WriteLine("Would you like to CONTINUE exploring or head to the SHOP?"); if (playerInput.ToUpper() == "CONTINUE") { transitionCheck = false; Exploration.Explore(true, "", 0); } else if (playerInput.ToUpper() == "SHOP") { transitionCheck = false; MainGame.Shop(); } } } } } else { Console.Clear(); Console.WriteLine("You begin travelling through a large plains area"); string[] randomContext = { "camp", "watchtower", "field" }; string r = randomContext[rnd.Next(0, 3)]; Console.WriteLine("While traveling through this expanse of land, you see a " + r + " in the distance\n"); Console.ReadKey(); while (input) { Console.WriteLine("Continue searching?(Y/N)"); string playerInput = Console.ReadLine(); Console.Clear(); if (playerInput.ToUpper() == "Y") { input = false; Console.WriteLine("In the " + r + " you find a chest full of loot!"); int randomCoin = rnd.Next(10, 21); Player.coins += randomCoin; Console.WriteLine("You found " + randomCoin + " coins in the chest!"); Console.ReadKey(); //restock shop TheShop.potions = 5; TheShop.shield = 1; MainGame.Shop(); } else if (playerInput.ToUpper() == "N") { input = false; Console.WriteLine("You make your way through the plains, returning to the shop"); Console.ReadKey(); MainGame.Shop(); } } } }
public static void dungeonAdventure(bool encounter) { bool input = true; if (encounter) { Console.Clear(); Console.WriteLine("You enter a dark and ominous dungeon"); string[] randomContext = { "temple", "prison", "mineshaft" }; string r = randomContext[rnd.Next(0, 3)]; Console.WriteLine("From the looks of it, it appears this dungeon was used as a " + r + " long before you discovered it\n"); Console.ReadKey(); while (input) { Console.WriteLine("Continue searching?(Y/N)"); string playerInput = Console.ReadLine(); Console.Clear(); if (playerInput.ToUpper() == "Y") { //input = false; Console.WriteLine("\nWhile looking for valuables you alert yourself to whomever dwells in this " + r); Console.ReadKey(); Encounter.Combat(true, "", 0, 0); } else if (playerInput.ToUpper() == "N") { //input = false; bool transitionCheck = true; if (transitionCheck) { Console.WriteLine("You exit the dungeon"); Console.WriteLine("Would you like to CONTINUE exploring or head to the SHOP?"); if (playerInput.ToUpper() == "CONTINUE") { transitionCheck = false; Exploration.Explore(true, "", 0); } else if (playerInput.ToUpper() == "SHOP") { transitionCheck = false; MainGame.Shop(); } } } } } else { Console.Clear(); Console.WriteLine("You enter a dark and ominous dungeon"); string[] randomContext = { "temple", "prison", "mineshaft" }; string r = randomContext[rnd.Next(0, 3)]; Console.WriteLine("From the looks of it, it appears this dungeon was used as a " + r + " long before you discovered it\n"); Console.ReadKey(); while (input) { Console.WriteLine("Continue searching?(Y/N)"); string playerInput = Console.ReadLine(); Console.Clear(); if (playerInput.ToUpper() == "Y") { input = false; Console.WriteLine("While exploring the ruins of what remaind of this " + r + " you came across a chest"); int randomCoin = rnd.Next(10, 21); Player.coins += randomCoin; Console.WriteLine("You found " + randomCoin + " coins in the chest!"); Console.ReadKey(); //restock shop TheShop.potions = 5; TheShop.shield = 1; MainGame.Shop(); } else if (playerInput.ToUpper() == "N") { input = false; Console.WriteLine("You exit the dungeon, making your way back to a shop"); Console.ReadKey(); MainGame.Shop(); } } } }
public static void villageAdventure(bool encounter) { bool input = true; if (encounter) { Console.Clear(); Console.WriteLine("A village catches your eye in the distance. You decide to head over and attempt to explore it"); string[] randomContext = { "farming community", "raider stronghold", "ruin" }; string r = randomContext[rnd.Next(0, 3)]; Console.WriteLine("Upon closer investigation, you discover that this village is a " + r + "\n"); Console.ReadKey(); while (input) { Console.WriteLine("Continue searching?(Y/N)"); string playerInput = Console.ReadLine(); Console.Clear(); if (playerInput.ToUpper() == "Y") { input = false; Console.WriteLine("\nAs you continue to search this " + r + " its inhabitants leap out and attack"); Console.ReadKey(); Encounter.Combat(true, "", 0, 0); } else if (playerInput.ToUpper() == "N") { input = false; bool transitionCheck = true; if (transitionCheck) { Console.WriteLine("You exit the dungeon"); Console.WriteLine("Would you like to CONTINUE exploring or head to the SHOP?"); if (playerInput.ToUpper() == "CONTINUE") { transitionCheck = false; Exploration.Explore(true, "", 0); } else if (playerInput.ToUpper() == "SHOP") { transitionCheck = false; MainGame.Shop(); } } } } } else { Console.Clear(); Console.WriteLine("A village catches your eye in the distance. You decide to head over and attempt to explore it"); string[] randomContext = { "farming community", "raider stronghold", "ruin" }; string r = randomContext[rnd.Next(0, 3)]; Console.WriteLine("Upon closer investigation, you discover that this village is a " + r + "\n"); Console.ReadKey(); while (input) { Console.WriteLine("Continue searching?(Y/N)"); string playerInput = Console.ReadLine(); Console.Clear(); if (playerInput.ToUpper() == "Y") { input = false; Console.WriteLine("While exploring the village some inhabitants approach you"); int randomCoin = rnd.Next(10, 21); Player.coins += randomCoin; Console.WriteLine("They give you " + randomCoin + " coins!"); Console.WriteLine("\nInhabitant: Most people come here to attack, we're glad you came with friendly intentions! " + "Thank you " + MainGame.currentPlayer.name + "."); string attackInput = Console.ReadLine(); if (attackInput.ToUpper() == "ATTACK") { Encounter.Combat(false, "Villager", 1, 6); } else { // Console.ReadKey(); //restock shop TheShop.potions = 5; TheShop.shield = 1; MainGame.Shop(); } } else if (playerInput.ToUpper() == "N") { input = false; bool transitionCheck = true; if (transitionCheck) { Console.WriteLine("You depart from the village"); Console.WriteLine("Would you like to CONTINUE exploring or head to the SHOP?"); if (playerInput.ToUpper() == "CONTINUE") { transitionCheck = false; Exploration.Explore(true, "", 0); } else if (playerInput.ToUpper() == "SHOP") { transitionCheck = false; MainGame.Shop(); } } } } } }