private static void MovingHandler(ICharacters character) { OnBuildingActions.InDoors(character); CityMap.ShowWSAD(); CityMap.Move(OnInputWork.MovingOnMapHandler(), out MoveX, out MoveY); CityMap.ShowMap(character); }
private static string[,] GenerateMap(out int width, out int height, out int PositionX, out int PositionY) { CityMap.MapSize(out width, out height); string[,] GameMap = new string[width, height]; GameMap = CityMap.StartMap(width, height); GameMap = CityMap.LimitsOfMap(width, height, out PositionX, out PositionY, ref tempPositionX, ref tempPositionY); return(GameMap); }
public static void Buying(string choice, ICharacters character) { choice = choice.ToUpper(); if (choice == "D") { CityMap.ShowMap(choice, character); } }
private static string[,] StartMap(int width, int height) { string[,] GameMap = new string[width, height]; GameMap = CityMap.BlankArray(width, height); GameMap = CityMap.Rectangle(width, height, 0, 0, GameMap); GameMap = CityMap.Building(width, height, 11, 5, 4, 2, "Shop", "right", GameMap); GameMap = CityMap.Building(width, height, 21, 5, 20, 2, "ArmorSmith", "down", GameMap); GameMap = CityMap.Building(width, height, 21, 5, 4, 9, "WeaponSmith", "right", GameMap); GameMap = CityMap.Building(width, height, 15, 10, 4, 14, "Arena", "right", GameMap); return(GameMap); }
public static void FightInArena(ICharacters myHero, int choice) { switch (choice) { case 1: { ICharacters opponent; int enemy = Arena.TypeOfEnemy(3); if (enemy == 1) { opponent = new OpponentDracula(myHero.Level); } else if (enemy == 2) { opponent = new OpponentDragon(myHero.Level); } else if (enemy == 3) { opponent = new OpponentRay(myHero.Level); } else { opponent = new OpponentDracula(myHero.Level); } Arena.FightLayout(myHero, opponent, true); break; } case 2: { ICharacters opponent; opponent = new ThreeHeadedDragon(16); if (myHero.Level >= opponent.Level && myHero.Money >= opponent.RequiredMoney) { Arena.FightLayout(myHero, opponent, true); } else { Console.WriteLine("You are not allowed to enter there. You have to have the " + opponent.Level + " and " + opponent.RequiredMoney + " money"); Thread.Sleep(2000); CityMap.ShowMap(myHero); } break; } default: { Console.WriteLine(); Console.WriteLine("You chose life!"); Console.WriteLine(); break; } } }
public static void ShowMap(string choice, ICharacters character) { Console.Clear(); string[,] GameMap = new string[width, height]; GameMap = CityMap.GenerateMap(out width, out height, out PositionX, out PositionY); for (int i = 0; i < height; i++) { for (int j = 0; j < width; j++) { Console.Write(GameMap[j, i]); } Console.WriteLine(); } CityMap.MovingHandler(choice, character); }
public static void AfterFight(ref ICharacters character, ref ICharacters opponent) { if (opponent.HitPoints <= 80) { Console.Clear(); Console.WriteLine("YOU WIN!!! :)"); Thread.Sleep(2000); character.AmountOfAtributes += 5; Arena.CharacterStatsAfterFight(ref character, ref opponent); MoneyAssignment.MoneyAfterFight(ref character); Increase.Add(character); character.Level += 1; } if (character.HitPoints <= 80) { Console.WriteLine("YOU LOST!"); Thread.Sleep(2000); Arena.CharacterStatsAfterFight(ref character, ref opponent); MoneyAfterDefeat.MoneyAfterFight(character); CityMap.ShowMap(character); } }
private static string[,] Building(int width, int height, int buildingWidth, int buildingHeight, int OffSetX, int OffSetY, string text, string WhereDoors, string[,] rectangle) { string[,] GameBulding = new string[width, height]; GameBulding = CityMap.Rectangle(buildingWidth, buildingHeight, OffSetX, OffSetY, rectangle); string Text = text; for (int i = 0; i < text.Length; i++) { GameBulding[2 + OffSetX + i, (buildingHeight / 2) + OffSetY] = Convert.ToString(text[i]); } switch (WhereDoors) { case "up": { GameBulding[buildingWidth / 2 + OffSetX, OffSetY - 1] = "D"; break; } case "down": { GameBulding[buildingWidth / 2 + OffSetX, buildingHeight + OffSetY] = "D"; break; } case "left": { GameBulding[OffSetX - 1, height / 2 + OffSetY] = "D"; break; } case "right": { GameBulding[buildingWidth + 1 + OffSetX, buildingHeight / 2 + OffSetY] = "D"; break; } } return(GameBulding); }
public static void Boss(ICharacters character, ICharacters opponent) { if (opponent.HitPoints <= 80) { Console.Clear(); Console.WriteLine("YOU WIN with bossss!!! :)"); Thread.Sleep(2000); character.AmountOfAtributes += 5; Arena.CharacterStatsAfterFight(ref character, ref opponent); MoneyAssignment.MoneyAfterFight(ref character); Console.WriteLine("YOU WIN THE GAME. YOU ARE THE BEST! :D"); Thread.Sleep(5000); Ending.TheEnd(); } if (character.HitPoints <= 80) { Console.WriteLine("YOU LOST :("); Thread.Sleep(2000); Arena.CharacterStatsAfterFight(ref character, ref opponent); MoneyAfterDefeat.MoneyAfterFight(character); CityMap.ShowMap(character); } }
private static string[,] LimitsOfMap(int width, int height, out int PositionX, out int PositionY, ref int tempPositionX, ref int tempPositionY) { string[,] GameMap = new string[width, height]; GameMap = CityMap.StartMap(width, height); CityMap.CalculatePosition(out PositionX, out PositionY, ref tempPositionX, ref tempPositionY); if (GameMap[PositionX, PositionY] == " ") { GameMap[PositionX, PositionY] = "X"; } else if (GameMap[PositionX, PositionY] == "D") { GameMap[PositionX, PositionY] = "B"; } else { PositionX = tempPositionX - MoveX; PositionY = tempPositionY - MoveY; GameMap[PositionX, PositionY] = "X"; tempPositionX = PositionX; tempPositionY = PositionY; } return(GameMap); }
public static void Choice(ICharacters character) { Console.Clear(); Console.WriteLine("You have: "); ChangeNumbersToPlus.Durability(character); ChangeNumbersToPlus.Intelligence(character); ChangeNumbersToPlus.Skill(character); ChangeNumbersToPlus.Strength(character); Console.WriteLine("Do you want to do Sometching else? You have: " + character.AmountOfAtributes + " atributes to allocate"); Console.WriteLine("1.Decrease mode"); Console.WriteLine("2.Increase mode"); Console.WriteLine("3.GO TO MAP"); int choice = OnInputWork.ChoiceHandler(); switch (choice) { case 1: { Decrease.DecreaseAtribute(character); break; } case 2: { Increase.Add(character); break; } case 3: { if (character.AmountOfAtributes == 0) { Console.Clear(); Console.WriteLine("Are you sure? You couldn't go back from there"); Console.WriteLine("Click Y if yes N to go back"); string Map = Console.ReadLine(); Map = Map.ToUpper(); if (Map == "Y") { CityMap.ShowMap(character); } else if (Map == "N") { MoreOnChoices.Choice(character); } else { Console.Clear(); Console.WriteLine("Wrong Letter. Try Again"); MoreOnChoices.Choice(character); } } else { Console.Clear(); Console.WriteLine("You couldn't go to arena. You have: " + character.AmountOfAtributes + " atributes to allocate!"); Thread.Sleep(1500); MoreOnChoices.Choice(character); } break; } default: { Console.Clear(); Console.WriteLine("Wrong number try again"); Thread.Sleep(750); Console.Clear(); CreationACharacter.Choice(character); break; } } }
private static void MovingHandler(string choice, ICharacters character) { CityMap.ShowWSAD(); CityMap.Move(choice, out MoveX, out MoveY); CityMap.ShowMap(character); }