Advertisement
Guest User

Untitled

a guest
Nov 12th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 18.73 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace RPGGame
  8. {
  9.     class Movement
  10.     {
  11.         public int X { get; set; }
  12.         public int Y { get; set; }
  13.     }
  14.     public static class Game
  15.     {
  16.         public static void StartGame()
  17.         {
  18.             Console.ForegroundColor = ConsoleColor.Blue;
  19.             Console.BackgroundColor = ConsoleColor.Black;
  20.             Console.WriteLine(
  21. "_|_|_|_|  _|      _|  _|_|_|  _|        _|_|_|_|        _|_|      _|    _|  _|_|_|_|    _|_|_|  _|_|_|_|_|\n" +
  22. "_|          _|  _|      _|    _|        _|            _|    _|    _|    _|  _|        _|            _|\n" +
  23. "_|_|_|        _|        _|    _|        _|_|_|        _|  _|_|    _|    _|  _|_|_|      _|_|        _|\n" +
  24. "_|          _|  _|      _|    _|        _|            _|    _|    _|    _|  _|              _|      _|\n" +
  25. "_|_|_|_|  _|      _|  _|_|_|  _|_|_|_|  _|_|_|_|        _|_|  _|    _|_|    _|_|_|_|  _|_|_|        _|\n");
  26.             Console.WriteLine("STEROWANIE \n" +
  27.                 "W,S,A,D - PORUSZANIE SIĘ\n" +
  28.                 "ENTER - PRZEJŚCIE DALEJ W DIALOGU\n" +
  29.                 "ESCAPE - WYJDŹ\n");
  30.             Console.ReadKey();
  31.             Console.Clear();
  32.             NewCharacter();
  33.             Console.ReadKey();
  34.             Console.Clear();
  35.         }
  36.         static void TurtleEncounter()
  37.         {
  38.             Console.WriteLine("   ______________________________");
  39.             Console.WriteLine(" /|_ Głęboko w piasku zauważasz  |.                    ___ ");
  40.             Console.WriteLine("|   |małego zółwia.Mag uśmiecha  |.         .,-;-;-,. /'_'/ ");
  41.             Console.WriteLine("|__ |się i mówi                  |.       _/_/_/_|_|_|) /| ");
  42.             Console.WriteLine("    |'Poznaj Tima, stażystę      |.     '-<_><_><_><_>=//|                                                  ");
  43.             Console.WriteLine("    |lokalnej biblioteki.Został  |.       `/_/====/_/-'/_/                                                  ");
  44.             Console.WriteLine("    |zamieniony w zółwia w wyniku|.        ''     ''    '' ");
  45.             Console.WriteLine("    |upuszczenia księgi zaklęć ze|.");
  46.             Console.WriteLine("    |świata zwierząt.Od tamtej   |.");
  47.             Console.WriteLine("    |pory spędza czas tutaj.-Wyja|.");
  48.             Console.WriteLine("    |śnił Medivh.                |.");
  49.             Console.WriteLine("    |Tim byłby ważnym źródłem    |.");
  50.             Console.WriteLine("    |informacji, lecz niestety   |.");
  51.             Console.WriteLine("    |nawet najlepsi magowie nie  |.");
  52.             Console.WriteLine("    |mogą się z nim porozumieć   |.");
  53.             Console.WriteLine("    |   _________________________|___");
  54.             Console.WriteLine("    |  /                            /.");
  55.             Console.WriteLine("    /_/____________________________/.");
  56.             Console.ReadKey();
  57.             Console.Clear();
  58.         }
  59.         static void ChestEncounter()
  60.         {
  61.             Console.ForegroundColor = ConsoleColor.DarkGray;
  62.             Console.BackgroundColor = ConsoleColor.DarkYellow;
  63.             Console.WriteLine(
  64.                 "                    ____...------------...____\n" +
  65.                 "               _.- ` /o/ __ ____ __ __  __|o|_`-._\n" +
  66.                 "             .'     |o|                    |o|     '.\n" +
  67.                 "             |=====/o|======================|o|=====|\n" +
  68.                 "             |____|_|________..____..________|_|____|\n" +
  69.                 "             |   _/ |_     <==========>     _/ |_   |\n" +
  70.                 "             |________________|=00=|________________|\n" +
  71.                 "              |===|!/========================|!/===|\n" +
  72.                 "              |   |=|          .---.         |=|   |\n" +
  73.                 "              |===|o|=========|     |========|o|===|\n" +
  74.                 "              |   | |         |() ()|        | |   |\n" +
  75.                 "              |===|o|======{'-.) A (.-'}=====|o|===|\n" +
  76.                 "              | __/ |__     '-.|vvv|.-'    __/ |__ |\n" +
  77.                 "              |===|o/ .'.'^'.'.|===|.'.'^'.'.|o/===|\n" +
  78.                 "              |  _|o/   __  {.' __  '.} _   _|o/  _|\n" +
  79.                 "              llllllllllllllllllllllllllllllllllllll\n");
  80.             Console.ReadKey();
  81.             Console.Clear();
  82.             Console.WriteLine("   ______________________________");
  83.             Console.WriteLine(" /|_ 'Dziwne'- rzekł Medivh -    |.");
  84.             Console.WriteLine("|   |'Pierwszy raz widzę taką    |.");
  85.             Console.WriteLine("|__ |skrzynię.Jest otwór na klucz|.");
  86.             Console.WriteLine("    |lecz samego klucza nie ma.  |.");
  87.             Console.WriteLine("    |Spróbujmy to otworzyć.'     |.");
  88.             Console.WriteLine("    |Patrzysz jak medivh rzuca   |.");
  89.             Console.WriteLine("    |zaklęcie na skrzynie, a ona |.");
  90.             Console.WriteLine("    |bez oporu się otwiera       |.");
  91.             Console.WriteLine("    |Ukazując w sobie pełno złota|.");
  92.             Console.WriteLine("    |'Co my z tym zrobimy?- zapy |.");
  93.             Console.WriteLine("    |tałeś.                      |.");
  94.             Console.WriteLine("    |'Oddamy je dla miasta oraz  |.");
  95.             Console.WriteLine("    |znajdziemy wskazówki co do  |.");
  96.             Console.WriteLine("    |pochodzenia skarbu          |.");
  97.             Console.WriteLine("    |   _________________________|___");
  98.             Console.WriteLine("    |  /                            /.");
  99.             Console.WriteLine("    /_/____________________________/.");
  100.             Console.ReadKey();
  101.             Console.Clear();
  102.         }
  103.         static void ShipEncounter()
  104.         {
  105.             Console.ForegroundColor = ConsoleColor.DarkGray;
  106.             Console.BackgroundColor = ConsoleColor.DarkCyan;
  107.             Console.WriteLine(
  108.                 "     ~~~             |\n" +
  109.                 "~~~~     ~~~~      -----                    |\n" +
  110.                 "     ~~~           )___(                  -----\n" +
  111.                 "                     |                    )___(\n" +
  112.                 "                 ---------                  |\n" +
  113.                 "                /         |              -------|n" +
  114.                 "               /___________|            /       |\n" +
  115.                 "                     |                 /_________|\n" +
  116.                 "              ---------------               |\n" +
  117.                 "             /               |        -------------|\n" +
  118.                 "            /                 |      /             |\n" +
  119.                 "           /___________________|    /_______________|\n" +
  120.                 "         ____________|______________________|__________\n" +
  121.                 "          |_                                        _/\n" +
  122.                 "            |______________________________________/\n" +
  123.                 "     ~~..             ...~~~.           ....~~~...     ..~\n");
  124.             Console.ReadKey();
  125.             Console.Clear();
  126.             Console.ForegroundColor = ConsoleColor.Blue;
  127.             Console.BackgroundColor = ConsoleColor.Black;
  128.  
  129.  
  130.             Console.WriteLine("   ______________________________");
  131.             Console.WriteLine(" /|_ Statek,niezwykłe osiągnięcie|.");
  132.             Console.WriteLine("|   |ludzkości leżało rozbite na |.");
  133.             Console.WriteLine("|__ |plaży.                      |.");
  134.             Console.WriteLine("    |Obok pozostałości kabiny    |.");
  135.             Console.WriteLine("    |kapitana zauważasz złoto    |.");
  136.             Console.WriteLine("    |'Weź je, im niestety już się|.");
  137.             Console.WriteLine("    |nie przyda'-rzekł zasmucony |.");
  138.             Console.WriteLine("    |Medivh.                     |.");
  139.             Console.WriteLine("    |Z racji, że nic więcej nie  |.");
  140.             Console.WriteLine("    |pozostało ze statku,wkładasz|.");
  141.             Console.WriteLine("    |złoto do torby i odchodzisz.|.");
  142.             Console.WriteLine("    |                            |.");
  143.             Console.WriteLine("    |                            |.");
  144.             Console.WriteLine("    |                            |.");
  145.             Console.WriteLine("    |   _________________________|___");
  146.             Console.WriteLine("    |  /                            /.");
  147.             Console.WriteLine("    /_/____________________________/.");
  148.             Console.ReadKey();
  149.             Console.Clear();
  150.         }
  151.         static void NewCharacter()
  152.         {
  153.             Console.ForegroundColor = ConsoleColor.Blue;
  154.             Console.BackgroundColor = ConsoleColor.Black;
  155.             string PlayerName;
  156.             Console.WriteLine("   ______________________________");
  157.             Console.WriteLine(" /|_ Twoja historia zaczyna się  |.");
  158.             Console.WriteLine("|   |na plaży nieznanej wyspy.   |.");
  159.             Console.WriteLine("|__ |Nie pamiętasz co się stało, |.");
  160.             Console.WriteLine("    |ale po widoku porozrzucanych|.");
  161.             Console.WriteLine("    |desek wygląda to na rozbity |.");
  162.             Console.WriteLine("    |statek.                     |.");
  163.             Console.WriteLine("    |Ocalała twoja torba, która  |.");
  164.             Console.WriteLine("    |nie zawiera nic cennego lub |.");
  165.             Console.WriteLine("    |wartego uwagi.              |.");
  166.             Console.WriteLine("    |Postanawiasz poszukać czegoś|.");
  167.             Console.WriteLine("    |wartościowego w zgliszczach |.");
  168.             Console.WriteLine("    |rozbitego statku.           |.");
  169.             Console.WriteLine("    |                            |.");
  170.             Console.WriteLine("    |                            |.");
  171.             Console.WriteLine("    |   _________________________|___");
  172.             Console.WriteLine("    |  /                            /.");
  173.             Console.WriteLine("    /_/____________________________/.");
  174.             Console.ReadKey();
  175.             Console.Clear();
  176.             Console.WriteLine("   ______________________________");
  177.             Console.WriteLine(" /|_ Spotykasz maga, który widząc|.");
  178.             Console.WriteLine("|   |zniszczony statek, przybiegł|.");
  179.             Console.WriteLine("|__ |na plażę.Widząc go, zadajesz|.");
  180.             Console.WriteLine("    |pytanie.                    |.");
  181.             Console.WriteLine("    |'Kim jesteś?'               |.");
  182.             Console.WriteLine("    |'Jestem Medivh, wielki mag  |.");
  183.             Console.WriteLine("    |tego miasta, przybyłem na   |.");
  184.             Console.WriteLine("    |ratunek poszkodowanym, ale  |.");
  185.             Console.WriteLine("    |jedynym ocalałym jesteś ty.'|.");
  186.             Console.WriteLine("    |'Powiedz mi' -kontynuował-  |.");
  187.             Console.WriteLine("    |'Jak masz na imię, ocalały?'|.");
  188.             Console.WriteLine("    |                            |.");
  189.             Console.WriteLine("    |                            |.");
  190.             Console.WriteLine("    |                            |.");
  191.             Console.WriteLine("    |   _________________________|___");
  192.             Console.WriteLine("    |  /                            /.");
  193.             Console.WriteLine("    /_/____________________________/.");
  194.             PlayerName = Console.ReadLine();
  195.  
  196.             Console.Clear();
  197.             Console.WriteLine("   ______________________________");
  198.             Console.WriteLine(" /|_ 'Hmm," + PlayerName + ",to imie|.");
  199.             Console.WriteLine("|   |nie jest z tych stron.'     |.");
  200.             Console.WriteLine("|__ |Zapewne po takim wypadku nie|.");
  201.             Console.WriteLine("    |pamiętasz z jakich lądów    |.");
  202.             Console.WriteLine("    |pochodzisz'- rzekł mag      |.");
  203.             Console.WriteLine("    |'Moje imie oraz moja torba  |.");
  204.             Console.WriteLine("    |to jedyne co mi zostało po  |.");
  205.             Console.WriteLine("    |rozbitym statku'-odpowiadasz|.");
  206.             Console.WriteLine("    |'Dobrze więc, postarajmy się|.");
  207.             Console.WriteLine("    |znaleźć więcej wskazówek na |.");
  208.             Console.WriteLine("    |temat twojej podróży. W tym |.");
  209.             Console.WriteLine("    |miejscu zostało wiele do    |.");
  210.             Console.WriteLine("    |przeszukania, chodźmy'-rzekł|.");
  211.             Console.WriteLine("    |Mag wstając z piasku.       |.");
  212.             Console.WriteLine("    |   _________________________|___");
  213.             Console.WriteLine("    |  /                            /.");
  214.             Console.WriteLine("    /_/____________________________/.");
  215.         }
  216.        
  217.  
  218.             static void Main()
  219.             {
  220.  
  221.                 Game.StartGame();
  222.  
  223.                 bool early_game = true;
  224.                 char player = 'O';
  225.                 char ship = 'S';
  226.                 char turtle = 'T';
  227.                 char chest = 'C';
  228.                 char[,] map = new char[20, 20]
  229.                 {
  230.                 {'╔','═','═','═','═','═','═','═','═','═','═','═','═','═','═','═','═','═','═','╗'},
  231.                 {'║',player,'\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','║'},
  232.                 {'║','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','║'},
  233.                 {'║','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','║'},
  234.                 {'║','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','║'},
  235.                 {'║','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','║'},
  236.                 {'║','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','║'},
  237.                 {'║','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','║'},
  238.                 {'║','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','║'},
  239.                 {'║','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','║'},
  240.                 {'║','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','║'},
  241.                 {'║','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','║'},
  242.                 {'║','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','║'},
  243.                 {'║','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','║'},
  244.                 {'║','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','║'},
  245.                 {'║','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','║'},
  246.                 {'║','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','║'},
  247.                 {'║','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','║'},
  248.                 {'║','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','║'},
  249.                 {'╚','═','═','═','═','═','═','═','═','═','═','═','═','═','═','═','═','═','═','╝'}
  250.                 };
  251.                 map[2, 4] = turtle;
  252.                 map[1, 10] = ship;
  253.                 map[15, 15] = chest;
  254.                 int player_X = 1, player_Y = 1;
  255.                 while(early_game == true)
  256.                 {
  257.                         for (int i = 0; i < 20; i++)
  258.                         {
  259.                             for (int j = 0; j < 20; j++)
  260.                             {
  261.                                 Console.Write(map[i, j] + " ");
  262.                             }
  263.                             Console.WriteLine();
  264.                         }
  265.                     Console.WriteLine("ExileQuest Beta 0.2");
  266.                     }
  267.                 char movement = Console.ReadKey(true).KeyChar;
  268.                 if (movement == 'W' && map[player_X - 1, player_Y] != '=' && map[player_X - 1, player_Y] != '║')
  269.                 {
  270.                    
  271.                         map[player_X, player_Y] = '\0';
  272.                         map[player_X - 1, player_Y] = player;
  273.                         player_X--;
  274.                  }
  275.                 else
  276.                 {
  277.                     map[player_X, player_Y] = player;
  278.                 }
  279.                 if (movement == 'S' && map[player_X + 1, player_Y] != '=' && map[player_X + 1, player_Y] != '║')
  280.                 {
  281.                    
  282.                     map[player_X, player_Y] = '\0';
  283.                     map[player_X + 1, player_Y] = player;
  284.                     player_X++;
  285.                 }
  286.                 else
  287.                 {
  288.                     map[player_X, player_Y] = player;
  289.                 }
  290.                     if (movement == 'A' && map[player_X, player_Y - 1] != '=' && map[player_X, player_Y - 1] != '║')
  291.                     {
  292.                        
  293.                             map[player_X, player_Y] = '\0';
  294.                             map[player_X, player_Y - 1] = player;
  295.                             player_Y--;
  296.                        
  297.                     }
  298.                     else
  299.                     {
  300.                         map[player_X, player_Y] = player;
  301.                     }
  302.                     if (movement == 'D' && map[player_X, player_Y + 1] != '=' && map[player_X, player_Y + 1] != '║')
  303.                     {
  304.                        
  305.                             map[player_X, player_Y] = '\0';
  306.                             map[player_X, player_Y + 1] = player;
  307.                             player_Y++;
  308.                        
  309.                     }
  310.                     else
  311.                     {
  312.                         map[player_X, player_Y] = player;
  313.                     }
  314.                 if (map[player_X, player_Y] == map[2, 4])
  315.                 {
  316.                     Console.Clear();
  317.                     TurtleEncounter();
  318.                 }
  319.                 if (map[player_X, player_Y] == map[1,10])
  320.                 {
  321.                 Console.Clear();
  322.                     ShipEncounter();
  323.                     early_game = false;
  324.                 }
  325.                 if (map[player_X, player_Y] == map[15,15])
  326.                 {
  327.                     Console.Clear();
  328.                     ChestEncounter();
  329.                 }
  330.         }
  331.           }
  332.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement