Advertisement
Guest User

Untitled

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