Advertisement
Guest User

AWG2 1.0

a guest
Aug 20th, 2019
393
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 63.51 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. using System.IO;
  7. using System.Diagnostics;
  8.  
  9. namespace AWG_2
  10. {
  11.     class Program
  12.     {
  13.         static void Main(string[] args)
  14.         {
  15.             Console.WindowWidth = 80;
  16.             Console.WindowHeight = 20;
  17.  
  18.         def:
  19.             int lineNumber = (new System.Diagnostics.StackFrame(0, true)).GetFileLineNumber();
  20.             Random rnd = new Random();
  21.             int rndi1 = rnd.Next(0, 4);
  22.             int rndi2 = rnd.Next(0, 5);
  23.             int rndi3 = rnd.Next(0, 3);
  24.             int rndi4 = rnd.Next(0, 4);
  25.             int rndi5 = rnd.Next(0, 2);
  26.             bool RunGame = true;
  27.             bool spree = true;
  28.             int usrin1;
  29.             int usrin2;
  30.             decimal rnd1;
  31.             decimal rnd2;
  32.             decimal rnd3;
  33.             decimal Health = 10;
  34.             decimal Food = 8;
  35.             decimal Water = 8;
  36.             decimal Day = 0;
  37.             decimal Distance = 0;
  38.             decimal GenericInvSpace = 20;
  39.             decimal FreeInvSpace;
  40.             decimal Tnull = 0;
  41.             int FoundItemID = 0;
  42.             int AutoSave = 0;
  43.             int Licence = 0;
  44.             int ITMID = 0;
  45.             decimal DayRate = 0.05m;
  46.  
  47.             //ITEMS
  48.             decimal BandageS = 0.5m;
  49.             decimal PainkillersS = 0.5m;
  50.             decimal WaterBottleS = 1.5m;
  51.             decimal SodaS = 1;
  52.             decimal CannedBeansS = 1;
  53.             decimal SnikersS = 0.5m;
  54.             decimal AxeS = 4;
  55.             decimal ChainsawS = 6;
  56.             decimal KnifeS = 2;
  57.             decimal Glock17S = 3;
  58.             decimal AR15S = 5;
  59.             decimal ShotgunS = 4;
  60.             decimal AmmoS = 0.5m;
  61.  
  62.             int BandageP = 0;
  63.             int PainkillersP = rndi3;
  64.             int WaterBottleP = rndi4;
  65.             int SodaP = 0;
  66.             int CannedBeansP = rndi1;
  67.             int SnikersP = rndi2;
  68.             int AxeP = 0;
  69.             int ChainsawP = 0;
  70.             int KnifeP = rndi5;
  71.             int Glock17P = 0;
  72.             int AR15P = 0;
  73.             int ShotgunP = 0;
  74.             int AmmoP = rndi1;
  75.  
  76.             int BandageID = 1;
  77.             int PainkillersID = 2;
  78.             int WaterBottleID = 3;
  79.             int SodaID = 4;
  80.             int CannedBeansID = 5;
  81.             int SnikersID = 6;
  82.             int AxeID = 7;
  83.             int ChainsawID = 8;
  84.             int KnifeID = 9;
  85.             int Glock17ID = 10;
  86.             int AR15ID = 11;
  87.             int ShotgunID = 12;
  88.             int AmmoID = 13;
  89.  
  90.             string Bandage = "Bandage";
  91.             string Painkillers = "Painkillers";
  92.             string WaterBottle = "Water Bottle";
  93.             string Soda = "Soda cans";
  94.             string CannedBeans = "Canned Beans";
  95.             string Snikers = "Snikers";
  96.             string Axe = "Axe";
  97.             string Chainsaw = "Chainsaw";
  98.             string Knife = "Knife";
  99.             string Glock17 = "Glock17";
  100.             string AR15 = "Assault Rifle";
  101.             string Shotgun = "Shotgun";
  102.             string Ammo = "Ammo";
  103.  
  104.             bool BandageUsable = true;
  105.             bool PainkillersUsable = true;
  106.             bool WaterBottleUsable = true;
  107.             bool SodaUsable = true;
  108.             bool CannedBeansUsable = true;
  109.             bool SnikersUsable = true;
  110.             bool AxeUsable = false;
  111.             bool ChainsawUsable = false;
  112.             bool KnifeUsable = false;
  113.             bool Glock17Usable = false;
  114.             bool AR15Usable = false;
  115.             bool ShotgunUsable = false;
  116.             bool AmmoUsable = false;
  117.  
  118.             while (RunGame == true)
  119.             {
  120.  
  121.                 Console.Clear();
  122.                
  123.                 Console.WriteLine("            AWG 2 \n");
  124.                 Console.WriteLine("            _   _");
  125.                 Console.WriteLine("          .-_; ;_-.");
  126.                 Console.WriteLine("         / /     \\ \\ ");
  127.                 Console.WriteLine("        | |       | |");
  128.                 Console.WriteLine("         \\ \\.---./ /");
  129.                 Console.WriteLine("     .-\"~   .-- -.   ~\" -.");
  130.                 Console.WriteLine("   ,`.-~/ .'`---`'. \\~-.`,");
  131.                 Console.WriteLine("   '`   | | \\(_)/ | |   `'");
  132.                 Console.WriteLine("   ,   \\  \\ | | /  /    ,");
  133.                 Console.WriteLine("   ;`'.,_\\  `-'-'  /_,.'`;");
  134.                 Console.WriteLine("    '-._  _.-'^'-._  _.-'");
  135.                 Console.WriteLine("        ``         ``");
  136.                 Console.ResetColor();
  137.                 Console.ForegroundColor = ConsoleColor.Green;
  138.                 Console.WriteLine("Playthrought for Sourcecode");
  139.                 Console.ResetColor();
  140.                 Console.WriteLine("\n");
  141.  
  142.                 Console.WriteLine(" 1) New Game | 2) Load Game");
  143.                 Console.Write("             ");
  144.  
  145.                 while (!int.TryParse(Console.ReadLine(), out usrin1))
  146.                 {
  147.                     lineNumber = (new System.Diagnostics.StackFrame(0, true)).GetFileLineNumber();
  148.                     Console.ForegroundColor = ConsoleColor.Red;
  149.                     Console.WriteLine("Invalid Input. Error {0}", lineNumber);
  150.                     Console.ResetColor();
  151.                     System.Threading.Thread.Sleep(1500);
  152.                     Console.SetCursorPosition(0, Console.CursorTop - 1);
  153.                     ClearCurrentConsoleLine();
  154.                 }
  155.  
  156.                 switch (usrin1)
  157.                 {
  158.                     case 1:
  159.                         break;
  160.  
  161.                     case 2:
  162.                         try
  163.                         {
  164.                             StreamReader sr = new StreamReader(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\CseBridge.dll");
  165.                             Health = Convert.ToDecimal(sr.ReadLine());
  166.                             Water = Convert.ToDecimal(sr.ReadLine());
  167.                             Food = Convert.ToDecimal(sr.ReadLine());
  168.                             Day = Convert.ToDecimal(sr.ReadLine());
  169.                             Distance = Convert.ToDecimal(sr.ReadLine());
  170.                             DayRate = Convert.ToDecimal(sr.ReadLine());
  171.                             BandageP = Convert.ToInt32(sr.ReadLine());
  172.                             PainkillersP = Convert.ToInt32(sr.ReadLine());
  173.                             WaterBottleP = Convert.ToInt32(sr.ReadLine());
  174.                             SodaP = Convert.ToInt32(sr.ReadLine());
  175.                             CannedBeansP = Convert.ToInt32(sr.ReadLine());
  176.                             SnikersP = Convert.ToInt32(sr.ReadLine());
  177.                             AxeP = Convert.ToInt32(sr.ReadLine());
  178.                             ChainsawP = Convert.ToInt32(sr.ReadLine());
  179.                             KnifeP = Convert.ToInt32(sr.ReadLine());
  180.                             Glock17P = Convert.ToInt32(sr.ReadLine());
  181.                             AR15P = Convert.ToInt32(sr.ReadLine());
  182.                             ShotgunP = Convert.ToInt32(sr.ReadLine());
  183.                             AmmoP = Convert.ToInt32(sr.ReadLine());
  184.                             sr.Close();
  185.                         }
  186.                         catch (Exception e)
  187.                         {
  188.                             Console.WriteLine("Exception: " + e.Message);
  189.                             System.Threading.Thread.Sleep(1500);
  190.                         }
  191.                         finally
  192.                         {
  193.                             Console.WriteLine("ERROR_193");
  194.                         }
  195.                         break;
  196.                 }
  197.             loop:
  198.                 Console.Clear();
  199.                 while (!Console.KeyAvailable) //General Loop
  200.                 {
  201.                     rnd1 = rnd.Next(1, 18); //DiscoveryChance
  202.                     rnd3 = rnd.Next(1, 6); //Recovery
  203.  
  204.                     AutoSave++;
  205.                     Licence++;
  206.                     if (Water <= 0 || Food <= 0)
  207.                         Health -= 0.5m;
  208.                     else if (Water <= 0 && Food <= 0)
  209.                         Health -= 1.5m;
  210.  
  211.                     if (Health <= 0)
  212.                     {
  213.                         Console.WriteLine("You died. Survived until day {0}", Day);
  214.                         Console.ReadKey();
  215.  
  216.                         if (rnd3 == 2)
  217.                         {
  218.                             Console.WriteLine("You lay down in the middle of a desert and slowly accept your death...");
  219.                             Console.WriteLine("You close your eyes... But wait.. You see a familiar face approach..");
  220.                             Console.WriteLine("Its...");
  221.                             Console.WriteLine(" ' ' ' ' ' ' ' ' ' + ' : ' ' ' ' ' ' ' ' ' ' ");
  222.                             Console.WriteLine(" ' ' ' ' ' ' ' + ' ; : : : ; ' ' ' ' ' ' ' ' ");
  223.                             Console.WriteLine(" ' ' ' ' ' ' ' ' ; : : , , , : ' ' ' ' ' ' ' ");
  224.                             Console.WriteLine(" ' ' ' ' ' ' + ' ; : , , , , : : ' ' ' ' ' ' ");
  225.                             Console.WriteLine(" ' ' ' ' ' ' + ; : : : : , , : : ' ' ' ' ' ' ");
  226.                             Console.WriteLine(" ' ' ' ' ' + + ; : : , , , . , : ' ' ' ' ' ' ");
  227.                             Console.WriteLine(" ' ' ' ' ' + # ' ; , ; , ` ; : ' ' ' ' ' ' ' ");
  228.                             Console.WriteLine(" ' ' ' ' ' # + ; ; @ : ' , @ ; ; ' ' ' ' ' ' ");
  229.                             Console.WriteLine(" ' ' ' ' ; ' + ; : : : ' : : : : ; ' ' ' ' ' ");
  230.                             Console.WriteLine(" ' ' ' ' ; + ' ' : , : ; . , , , , ' ' ' ' ' ");
  231.                             Console.WriteLine(" + + ' ' ' + + ; : : ; + ' : , , ; ' ' ' ' ' ");
  232.                             Console.WriteLine(" + + ' ' ' ' + ; : ' ' : : ' ; : ' ' ' ' ' ' ");
  233.                             Console.WriteLine(" + + ' ' ' ' + ; ; ; ; , ; : : ; ' ' ' ' ' ' ");
  234.                             Console.WriteLine(" + + ' ' ' ' + + ' ; ; : : ; ; ; ' ' ' ' ' ' ");
  235.                             Console.WriteLine(" ' ' ' ' ' # ' + + ' : : : ; ' ' ' ' ' ' ' ' ");
  236.                             Console.WriteLine(" ' ' ' ' ' @ ' ' + + ; ; ; ; + ' ' ' ' ' ' ' ");
  237.                             Console.WriteLine(" ' ' ' ' # @ ' ; ' + + ' + ; + + ' ' ' ' ' ' ");
  238.                             Console.WriteLine(" ' ' ' # # # ' : ; ; ; : : ; # # # + ' ' ' ' ");
  239.                             Console.WriteLine(" + ' + # # + + : : ; ; : : : # # + + + + + ' ");
  240.                             Console.WriteLine(" + + # + # + + ; : : ; ' ; : ' # + # + + + + ");
  241.                             Console.WriteLine(" + + # # # + # ; : : ; ; : ; + + @ + + + + + ");
  242.                             Console.WriteLine(" + + + # # # + + ' : : : ; + + # # # + + + + ");
  243.                             Console.WriteLine(" + + + # # # # # : ; : ; # @ + + + # + # + + ");
  244.                             Console.WriteLine(" + # # # # # # + + ' ' # # # + + + + # + # # ");
  245.                             Console.WriteLine(" # + # # + # # # # ; . , @ + + # + ; ' # + + ");
  246.                             Console.WriteLine(" # + # # # + # + # . # . @ # + # # ; @ # # # ");
  247.                             Console.WriteLine(" # + # # # # # # + # . , ' + + + + ' ' ; # # ");
  248.                             Console.WriteLine(" + + # + # # + # + + . . # + + + # : ' + + + ");
  249.                             Console.WriteLine("\"May I analyze your code?\"");
  250.                             Console.WriteLine("Your Stats get refilled.");
  251.  
  252.                             Process cmd = new Process(); //shutdown
  253.                             cmd.StartInfo.FileName = "cmd.exe";
  254.                             cmd.StartInfo.RedirectStandardInput = true;
  255.                             cmd.StartInfo.RedirectStandardOutput = true;
  256.                             cmd.StartInfo.CreateNoWindow = true;
  257.                             cmd.StartInfo.UseShellExecute = false;
  258.                             cmd.Start();
  259.  
  260.                             cmd.StandardInput.WriteLine("start https://www.youtube.com/watch?v=z6-FWJteNLI");
  261.                             cmd.StandardInput.Flush();
  262.                             cmd.StandardInput.Close();
  263.                             cmd.WaitForExit();
  264.                             Console.WriteLine(cmd.StandardOutput.ReadToEnd());
  265.  
  266.                             System.Threading.Thread.Sleep(1500);
  267.  
  268.                             Health = 10;
  269.                             Food = 10;
  270.                             Water = 10;
  271.                         }
  272.                         else
  273.                             File.Delete(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\CseBridge.dll");
  274.                             goto def;
  275.                     }
  276.                     Water -= 0.3m;
  277.                     Food -= 0.2m;
  278.                     if (Water < 0)
  279.                         Water = 0;
  280.                     if (Food < 0)
  281.                         Food = 0;
  282.                     if (Water > 10)
  283.                         Water = 10;
  284.                     if (Food > 10)
  285.                         Food = 10;
  286.                     if (Health > 10)
  287.                         Health = 10;
  288.                     Console.WriteLine("          Distance to go"); Distance += DayRate;
  289.                     DistanceBar(Distance);
  290.                     Console.ForegroundColor = ConsoleColor.Green;
  291.                     Console.Write("Health:  ");
  292.                     StateBar(Health);
  293.                     Console.ResetColor();
  294.                     Console.ForegroundColor = ConsoleColor.Yellow;
  295.                     Console.Write("Food:    ");
  296.                     StateBar(Food);
  297.                     Console.ResetColor();
  298.                     Console.ForegroundColor = ConsoleColor.Cyan;
  299.                     Console.Write("Water:   ");
  300.                     StateBar(Water);
  301.                     Console.ResetColor();
  302.                     Console.Write("Day:     {0}", Day); Day += 0.5m;
  303.                     Console.WriteLine("\n");
  304.                     Console.WriteLine("Press Enter to open the inventory.");
  305.                     Console.WriteLine("\n");
  306.                     Console.Write("You are strolling through the forest");
  307.                     System.Threading.Thread.Sleep(400);
  308.                     Console.Write(".");
  309.                     System.Threading.Thread.Sleep(400);
  310.                     Console.Write(".");
  311.                     System.Threading.Thread.Sleep(400);
  312.                     Console.Write(".");
  313.                     System.Threading.Thread.Sleep(400);
  314.                     Console.Clear();
  315.                     FreeInvSpace = GenericInvSpace -
  316.                         (
  317.                             BandageP +
  318.                             PainkillersP +
  319.                             WaterBottleP +
  320.                             SodaP +
  321.                             CannedBeansP +
  322.                             SnikersP +
  323.                             AxeP +
  324.                             ChainsawP +
  325.                             KnifeP +
  326.                             Glock17P +
  327.                             AR15P +
  328.                             ShotgunP +
  329.                             AmmoP
  330.                         );
  331.  
  332.                     if (AutoSave == 5)
  333.                     {
  334.                         AutoSave = 0;
  335.                         try
  336.                         {
  337.                             StreamWriter sw = new StreamWriter(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\CseBridge.dll");
  338.                             StreamWriter trick = new StreamWriter(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\AWG2.txt");
  339.  
  340.                             sw.WriteLine(Health);
  341.                             sw.WriteLine(Water);
  342.                             sw.WriteLine(Food);
  343.                             sw.WriteLine(Day);
  344.                             sw.WriteLine(Distance);
  345.                             sw.WriteLine(DayRate);
  346.                             sw.WriteLine(BandageP);
  347.                             sw.WriteLine(PainkillersP);
  348.                             sw.WriteLine(WaterBottleP);
  349.                             sw.WriteLine(SodaP);
  350.                             sw.WriteLine(CannedBeansP);
  351.                             sw.WriteLine(SnikersP);
  352.                             sw.WriteLine(AxeP);
  353.                             sw.WriteLine(ChainsawP);
  354.                             sw.WriteLine(KnifeP);
  355.                             sw.WriteLine(Glock17P);
  356.                             sw.WriteLine(AR15P);
  357.                             sw.WriteLine(ShotgunP);
  358.                             sw.WriteLine(AmmoP);
  359.  
  360.                             //Close the file
  361.                             sw.Close();
  362.                             trick.WriteLine(Health);
  363.                             trick.WriteLine(Water);
  364.                             trick.WriteLine(Food);
  365.                             trick.WriteLine(Day);
  366.                             trick.WriteLine(Distance);
  367.                             trick.WriteLine(DayRate);
  368.                             trick.WriteLine(BandageP);
  369.                             trick.WriteLine(PainkillersP);
  370.                             trick.WriteLine(WaterBottleP);
  371.                             trick.WriteLine(SodaP);
  372.                             trick.WriteLine(CannedBeansP);
  373.                             trick.WriteLine(SnikersP);
  374.                             trick.WriteLine(AxeP);
  375.                             trick.WriteLine(ChainsawP);
  376.                             trick.WriteLine(KnifeP);
  377.                             trick.WriteLine(Glock17P);
  378.                             trick.WriteLine(AR15P);
  379.                             trick.WriteLine(ShotgunP);
  380.                             trick.WriteLine(AmmoP);
  381.                             trick.Close();
  382.                         }
  383.                         catch (Exception e)
  384.                         {
  385.                             Console.WriteLine("Exception: " + e.Message);
  386.                         }
  387.                         finally
  388.                         {
  389.                             Console.WriteLine("Executing finally block.");
  390.                         }
  391.                         Console.Clear();
  392.  
  393.                     } //SAVE
  394.  
  395.                     if (rnd1 == 1)
  396.                     {
  397.                         Discovery(ref FreeInvSpace, ref ITMID,
  398.                             ref Health, ref AmmoP,
  399.                             ref AxeP, ref ChainsawP,
  400.                             ref KnifeP, ref Glock17P,
  401.                             ref AR15P, ref ShotgunP, ref DayRate);
  402.                         switch (ITMID)
  403.                         {
  404.                             case 1:
  405.                                 BandageP++;
  406.                                 break;
  407.                             case 2:
  408.                                 PainkillersP++;
  409.                                 break;
  410.                             case 3:
  411.                                 WaterBottleP++;
  412.                                 break;
  413.                             case 4:
  414.                                 SodaP++;
  415.                                 break;
  416.                             case 5:
  417.                                 CannedBeansP++;
  418.                                 break;
  419.                             case 6:
  420.                                 SnikersP++;
  421.                                 break;
  422.                             case 7:
  423.                                 AxeP++;
  424.                                 break;
  425.                             case 8:
  426.                                 ChainsawP++;
  427.                                 break;
  428.                             case 9:
  429.                                 KnifeP++;
  430.                                 break;
  431.                             case 10:
  432.                                 Glock17P++;
  433.                                 break;
  434.                             case 11:
  435.                                 AR15P++;
  436.                                 break;
  437.                             case 12:
  438.                                 ShotgunP++;
  439.                                 break;
  440.                             case 13:
  441.                                 AmmoP++;
  442.                                 break;
  443.                             default:
  444.                                 break;
  445.                         }
  446.  
  447.                         while (spree == true)
  448.                         {
  449.                             rnd2 = rnd.Next(1, 5);
  450.                             switch (FoundItemID)
  451.                             {
  452.                                 case 1:
  453.                                     InventoryItemFound(Bandage, ref BandageP, BandageID, BandageS, GenericInvSpace);
  454.                                     break;
  455.                                 case 2:
  456.                                     InventoryItemFound(Painkillers, ref PainkillersP, PainkillersID, PainkillersS, GenericInvSpace);
  457.                                     break;
  458.                                 case 3:
  459.                                     InventoryItemFound(WaterBottle, ref WaterBottleP, WaterBottleID, WaterBottleS, GenericInvSpace);
  460.                                     break;
  461.                                 case 4:
  462.                                     InventoryItemFound(Soda, ref SodaP, SodaID, SodaS, GenericInvSpace);
  463.                                     break;
  464.                                 case 5:
  465.                                     InventoryItemFound(CannedBeans, ref CannedBeansP, CannedBeansID, CannedBeansS, GenericInvSpace);
  466.                                     break;
  467.                                 case 6:
  468.                                     InventoryItemFound(Snikers, ref SnikersP, SnikersID, SnikersS, GenericInvSpace);
  469.                                     break;
  470.                                 case 7:
  471.                                     InventoryItemFound(Axe, ref AxeP, AxeID, AxeS, GenericInvSpace);
  472.                                     break;
  473.                                 case 8:
  474.                                     InventoryItemFound(Chainsaw, ref ChainsawP, ChainsawID, ChainsawS, GenericInvSpace);
  475.                                     break;
  476.                                 case 9:
  477.                                     InventoryItemFound(Knife, ref KnifeP, KnifeID, KnifeS, GenericInvSpace);
  478.                                     break;
  479.                                 case 10:
  480.                                     InventoryItemFound(Glock17, ref Glock17P, Glock17ID, Glock17S, GenericInvSpace);
  481.                                     break;
  482.                                 case 11:
  483.                                     InventoryItemFound(AR15, ref AR15P, AR15ID, AR15S, GenericInvSpace);
  484.                                     break;
  485.                                 case 12:
  486.                                     InventoryItemFound(Shotgun, ref ShotgunP, ShotgunID, ShotgunS, GenericInvSpace);
  487.                                     break;
  488.                                 case 13:
  489.                                     InventoryItemFound(Ammo, ref AmmoP, AmmoID, AmmoS, GenericInvSpace);
  490.                                     break;
  491.                             }
  492.  
  493.                             if (rnd2 == 1)
  494.                                 spree = false;
  495.                         }
  496.                     }
  497.                 }
  498.             Inventory:
  499.  
  500.                 while (Console.KeyAvailable)
  501.                 {
  502.                     Console.ReadKey(false);
  503.                 }
  504.                 while (RunGame == true)
  505.                 {
  506.                     //INVENTORY STATS
  507.                     Console.Clear();
  508.                     Console.ForegroundColor = ConsoleColor.Green;
  509.                     Console.Write("Health:  ");
  510.                     StateBar(Health);
  511.                     Console.ResetColor();
  512.                     Console.ForegroundColor = ConsoleColor.Yellow;
  513.                     Console.Write("Food:    ");
  514.                     StateBar(Food);
  515.                     Console.ResetColor();
  516.                     Console.ForegroundColor = ConsoleColor.Cyan;
  517.                     Console.Write("Water:   ");
  518.                     StateBar(Water);
  519.                     Console.ResetColor();
  520.                     Console.WriteLine("\n---INVENTORY---\n");
  521.                     Console.WriteLine("SELECT ITEM ID");
  522.                     Console.ForegroundColor = ConsoleColor.Green;
  523.                     InventoryCheck(Bandage, BandageP, ref BandageID);
  524.                     InventoryCheck(Painkillers, PainkillersP, ref PainkillersID);
  525.                     Console.ResetColor();
  526.                     Console.ForegroundColor = ConsoleColor.Cyan;
  527.                     InventoryCheck(WaterBottle, WaterBottleP, ref WaterBottleID);
  528.                     InventoryCheck(Soda, SodaP, ref SodaID);
  529.                     Console.ResetColor();
  530.                     Console.ForegroundColor = ConsoleColor.Yellow;
  531.                     InventoryCheck(CannedBeans, CannedBeansP, ref CannedBeansID);
  532.                     InventoryCheck(Snikers, SnikersP, ref SnikersID);
  533.                     Console.ResetColor();
  534.                     Console.ForegroundColor = ConsoleColor.Magenta;
  535.                     InventoryCheck(Axe, AxeP, ref AxeID);
  536.                     InventoryCheck(Chainsaw, ChainsawP, ref ChainsawID);
  537.                     InventoryCheck(Knife, KnifeP, ref KnifeID);
  538.                     InventoryCheck(Glock17, Glock17P, ref Glock17ID);
  539.                     InventoryCheck(AR15, AR15P, ref AR15ID);
  540.                     InventoryCheck(Shotgun, ShotgunP, ref ShotgunID);
  541.                     InventoryCheck(Ammo, AmmoP, ref AmmoID);
  542.                     Console.ResetColor();
  543.                     Console.WriteLine("-----------------");
  544.                     Console.WriteLine("0     |Exit");
  545.  
  546.                     while (!int.TryParse(Console.ReadLine(), out usrin2))
  547.                     {
  548.                         lineNumber = (new System.Diagnostics.StackFrame(0, true)).GetFileLineNumber();
  549.                         Console.ForegroundColor = ConsoleColor.Red;
  550.                         Console.WriteLine("Invalid Input. Error {0}", lineNumber);
  551.                         Console.ResetColor();
  552.                         System.Threading.Thread.Sleep(1500);
  553.                         Console.SetCursorPosition(0, Console.CursorTop - 1);
  554.                         ClearCurrentConsoleLine();
  555.                     }
  556.                    
  557.                     if (usrin2 == 0)
  558.                         goto loop;
  559.  
  560.                     else if (usrin2 > 0 && usrin2 < 14)
  561.                         switch (usrin2)
  562.                         {
  563.                             case 1:
  564.                                 InventoryOptions(Bandage, ref BandageP, BandageUsable, BandageID, ref Health);
  565.                                 break;
  566.                             case 2:
  567.                                 InventoryOptions(Painkillers, ref PainkillersP, PainkillersUsable, PainkillersID, ref Health);
  568.                                 break;
  569.                             case 3:
  570.                                 InventoryOptions(WaterBottle, ref WaterBottleP, WaterBottleUsable, WaterBottleID, ref Water);
  571.                                 break;
  572.                             case 4:
  573.                                 InventoryOptions(Soda, ref SodaP, SodaUsable, SodaID, ref Water);
  574.                                 break;
  575.                             case 5:
  576.                                 InventoryOptions(CannedBeans, ref CannedBeansP, CannedBeansUsable, CannedBeansID, ref Food);
  577.                                 break;
  578.                             case 6:
  579.                                 InventoryOptions(Snikers, ref SnikersP, SnikersUsable, SnikersID, ref Food);
  580.                                 break;
  581.                             case 7:
  582.                                 InventoryOptions(Axe, ref AxeP, AxeUsable, AxeID, ref Tnull);
  583.                                 break;
  584.                             case 8:
  585.                                 InventoryOptions(Chainsaw, ref ChainsawP, ChainsawUsable, ChainsawID, ref Tnull);
  586.                                 break;
  587.                             case 9:
  588.                                 InventoryOptions(Knife, ref KnifeP, KnifeUsable, KnifeID, ref Tnull);
  589.                                 break;
  590.                             case 10:
  591.                                 InventoryOptions(Glock17, ref Glock17P, Glock17Usable, Glock17ID, ref Tnull);
  592.                                 break;
  593.                             case 11:
  594.                                 InventoryOptions(AR15, ref AR15P, AR15Usable, AR15ID, ref Tnull);
  595.                                 break;
  596.                             case 12:
  597.                                 InventoryOptions(Shotgun, ref ShotgunP, ShotgunUsable, ShotgunID, ref Tnull);
  598.                                 break;
  599.                             case 13:
  600.                                 InventoryOptions(Ammo, ref AmmoP, AmmoUsable, AmmoID, ref Tnull);
  601.                                 break;
  602.  
  603.                             default:
  604.                                 goto loop;
  605.                         }
  606.                     else
  607.                     {
  608.                         lineNumber = (new System.Diagnostics.StackFrame(0, true)).GetFileLineNumber();
  609.                         Console.ForegroundColor = ConsoleColor.Red;
  610.                         Console.WriteLine("Invalid Input. Error {0}", lineNumber);
  611.                         Console.ResetColor();
  612.                         System.Threading.Thread.Sleep(1500);
  613.                         Console.SetCursorPosition(0, Console.CursorTop - 1);
  614.                         ClearCurrentConsoleLine();
  615.                     }
  616.                     goto Inventory;
  617.                 }
  618.             }
  619.         }
  620.  
  621.         //StatusBar
  622.         static public void StateBar(decimal State)
  623.         {
  624.             string StateBar = null;
  625.             State = Math.Round(State);
  626.  
  627.             if (State > 10)
  628.                 State = 10;
  629.  
  630.             switch (State)
  631.             {
  632.                 case 0:
  633.                     StateBar = "| ---------- |";
  634.                     break;
  635.                 case 1:
  636.                     StateBar = "| #--------- |";
  637.                     break;
  638.                 case 2:
  639.                     StateBar = "| ##-------- |";
  640.                     break;
  641.                 case 3:
  642.                     StateBar = "| ###------- |";
  643.                     break;
  644.                 case 4:
  645.                     StateBar = "| ####------ |";
  646.                     break;
  647.                 case 5:
  648.                     StateBar = "| #####----- |";
  649.                     break;
  650.                 case 6:
  651.                     StateBar = "| ######---- |";
  652.                     break;
  653.                 case 7:
  654.                     StateBar = "| #######--- |";
  655.                     break;
  656.                 case 8:
  657.                     StateBar = "| ########-- |";
  658.                     break;
  659.                 case 9:
  660.                     StateBar = "| #########- |";
  661.                     break;
  662.                 case 10:
  663.                     StateBar = "| ########## |";
  664.                     break;
  665.                 default:
  666.                     StateBar = "[ERROR]";
  667.                     break;
  668.             }
  669.             Console.WriteLine(StateBar);
  670.             return;
  671.         }
  672.  
  673.         //Inventory Space Calculation
  674.         static public void Discovery(ref decimal FreeSpace, ref int ITMID, ref decimal health, ref int Ammo, ref int Axe, ref int Chainsaw, ref int Knife, ref int Glock17, ref int AR15, ref int Shotgun, ref decimal DayRate)
  675.         {
  676.             int lineNumber = (new System.Diagnostics.StackFrame(0, true)).GetFileLineNumber();
  677.             int usrin1;
  678.             int usrin2;
  679.             int usrin3;
  680.             int FoundItemID = 0;
  681.             string Item = "ERROR";
  682.             decimal NeededSpace = 0;
  683.             bool ThrewAway = false;
  684.             int numofloop = 0;
  685.  
  686.             decimal BandageS = 0.5m;
  687.             decimal PainkillersS = 0.5m;
  688.             decimal WaterBottleS = 1.5m;
  689.             decimal SodaS = 1;
  690.             decimal CannedBeansS = 1;
  691.             decimal SnikersS = 0.5m;
  692.             decimal AxeS = 4;
  693.             decimal ChainsawS = 6;
  694.             decimal KnifeS = 2;
  695.             decimal Glock17S = 3;
  696.             decimal AR15S = 5;
  697.             decimal ShotgunS = 4;
  698.             decimal AmmoS = 0.5m;
  699.  
  700.             string[] Places = new string[] { "an abandoned house", "an old mineshaft", "an old WW2 bunker", "a supermarket", "a shed", "abandoned hospital", "a school" };
  701.             Random rnd = new Random();
  702.             int rnd1 = rnd.Next(0, 130);
  703.             int place = rnd.Next(0, 7);
  704.             string Placefound = Places[place];
  705.  
  706.             int FindingRate1Min = 0;
  707.             int FindingRate1Max = 1;
  708.             int FindingRate2Min = 10;
  709.             int FindingRate2Max = 1;
  710.             int FindingRate3Min = 20;
  711.             int FindingRate3Max = 1;
  712.             int FindingRate4Min = 30;
  713.             int FindingRate4Max = 1;
  714.             int FindingRate5Min = 40;
  715.             int FindingRate5Max = 1;
  716.             int FindingRate6Min = 50;
  717.             int FindingRate6Max = 1;
  718.             int FindingRate7Min = 60;
  719.             int FindingRate7Max = 1;
  720.             int FindingRate8Min = 70;
  721.             int FindingRate8Max = 1;
  722.             int FindingRate9Min = 80;
  723.             int FindingRate9Max = 1;
  724.             int FindingRate10Min = 90;
  725.             int FindingRate10Max = 1;
  726.             int FindingRate11Min = 100;
  727.             int FindingRate11Max = 1;
  728.             int FindingRate12Min = 110;
  729.             int FindingRate12Max = 1;
  730.             int FindingRate13Min = 120;
  731.             int FindingRate13Max = 1;
  732.            
  733.         Input:
  734.             Console.WriteLine("You found {0}", Places[place]);
  735.             Console.WriteLine("Do you want to explore it? Yes (1), No (2)");
  736.  
  737.             while (!int.TryParse(Console.ReadLine(), out usrin1))
  738.             {
  739.                 lineNumber = (new System.Diagnostics.StackFrame(0, true)).GetFileLineNumber();
  740.                 Console.ForegroundColor = ConsoleColor.Red;
  741.                 Console.WriteLine("Invalid Input. Error {0}", lineNumber);
  742.                 Console.ResetColor();
  743.                 System.Threading.Thread.Sleep(1500);
  744.                 Console.SetCursorPosition(0, Console.CursorTop - 1);
  745.                 ClearCurrentConsoleLine();
  746.             }
  747.  
  748.             switch (usrin1)
  749.             {
  750.                 case 1:
  751.                     Console.Clear();
  752.                     break;
  753.                 case 2:
  754.                     Console.Clear();
  755.                     return;
  756.                 default:
  757.                     Console.ForegroundColor = ConsoleColor.Red;
  758.                     Console.WriteLine("Invalid Input. Error 384");
  759.                     Console.ResetColor();
  760.                     System.Threading.Thread.Sleep(1500);
  761.                     Console.Clear();
  762.                     goto Input;
  763.             }
  764.  
  765.             switch (rnd1) //Probability Ranger
  766.             {
  767.                 case 0: //House
  768.                     FindingRate1Max = 2;
  769.                     FindingRate2Max = 16;
  770.                     FindingRate3Max = 25;
  771.                     FindingRate4Max = 32;
  772.                     FindingRate5Max = 49;
  773.                     FindingRate6Max = 54;
  774.                     FindingRate7Max = 68;
  775.                     FindingRate8Max = 71;
  776.                     FindingRate9Max = 86;
  777.                     FindingRate10Max = 92;
  778.                     FindingRate11Max = 101;
  779.                     FindingRate12Max = 112;
  780.                     FindingRate13Max = 125;
  781.                     break;
  782.                 case 1: //Mineshaft
  783.                     FindingRate1Max = 6;
  784.                     FindingRate2Max = 11;
  785.                     FindingRate3Max = 27;
  786.                     FindingRate4Max = 34;
  787.                     FindingRate5Max = 47;
  788.                     FindingRate6Max = 54;
  789.                     FindingRate7Max = 65;
  790.                     FindingRate8Max = 74;
  791.                     FindingRate9Max = 84;
  792.                     FindingRate10Max = 93;
  793.                     FindingRate11Max = 101;
  794.                     FindingRate12Max = 111;
  795.                     FindingRate13Max = 123;
  796.                     break;
  797.                 case 2: //Bunker
  798.                     FindingRate1Max = 8;
  799.                     FindingRate2Max = 14;
  800.                     FindingRate3Max = 27;
  801.                     FindingRate4Max = 35;
  802.                     FindingRate5Max = 48;
  803.                     FindingRate6Max = 51;
  804.                     FindingRate7Max = 63;
  805.                     FindingRate8Max = 72;
  806.                     FindingRate9Max = 89;
  807.                     FindingRate10Max = 97;
  808.                     FindingRate11Max = 106;
  809.                     FindingRate12Max = 116;
  810.                     FindingRate13Max = 129;
  811.                     break;
  812.                 case 3: //Supermarket
  813.                     FindingRate1Max = 6;
  814.                     FindingRate2Max = 18;
  815.                     FindingRate3Max = 28;
  816.                     FindingRate4Max = 39;
  817.                     FindingRate5Max = 47;
  818.                     FindingRate6Max = 57;
  819.                     FindingRate7Max = 63;
  820.                     FindingRate8Max = 74;
  821.                     FindingRate9Max = 87;
  822.                     FindingRate10Max = 95;
  823.                     FindingRate11Max = 102;
  824.                     FindingRate12Max = 113;
  825.                     FindingRate13Max = 126;
  826.                     break;
  827.                 case 4: //Shed
  828.                     FindingRate1Max = 6;
  829.                     FindingRate2Max = 15;
  830.                     FindingRate3Max = 26;
  831.                     FindingRate4Max = 34;
  832.                     FindingRate5Max = 49;
  833.                     FindingRate6Max = 55;
  834.                     FindingRate7Max = 67;
  835.                     FindingRate8Max = 76;
  836.                     FindingRate9Max = 85;
  837.                     FindingRate10Max = 92;
  838.                     FindingRate11Max = 104;
  839.                     FindingRate12Max = 116;
  840.                     FindingRate13Max = 128;
  841.                     break;
  842.                 case 5: //Hospital
  843.                     FindingRate1Max = 9;
  844.                     FindingRate2Max = 18;
  845.                     FindingRate3Max = 27;
  846.                     FindingRate4Max = 35;
  847.                     FindingRate5Max = 47;
  848.                     FindingRate6Max = 54;
  849.                     FindingRate7Max = 65;
  850.                     FindingRate8Max = 76;
  851.                     FindingRate9Max = 86;
  852.                     FindingRate10Max = 93;
  853.                     FindingRate11Max = 102;
  854.                     FindingRate12Max = 111;
  855.                     FindingRate13Max = 124;
  856.                     break;
  857.                 case 6: //School
  858.                     FindingRate1Max = 6;
  859.                     FindingRate2Max = 17;
  860.                     FindingRate3Max = 27;
  861.                     FindingRate4Max = 39;
  862.                     FindingRate5Max = 46;
  863.                     FindingRate6Max = 59;
  864.                     FindingRate7Max = 65;
  865.                     FindingRate8Max = 72;
  866.                     FindingRate9Max = 83;
  867.                     FindingRate10Max = 97;
  868.                     FindingRate11Max = 107;
  869.                     FindingRate12Max = 118;
  870.                     FindingRate13Max = 129;
  871.                     break;
  872.             }
  873.         Start:
  874.             int ItemChooser = rnd.Next(0, 131);
  875.             int rnd3 = rnd.Next(1, 15);
  876.  
  877.             if (rnd3 == 1)
  878.                 EnemyEncounter(ref health, ref Ammo, Axe, Chainsaw, Knife, Glock17, AR15, Shotgun, ref DayRate);
  879.  
  880.             if (Enumerable.Range(FindingRate1Min, FindingRate1Max).Contains(ItemChooser))
  881.             {
  882.                 FoundItemID = 1;
  883.                 Item = "Bandage";
  884.                 NeededSpace = BandageS;
  885.             }
  886.             else if (Enumerable.Range(FindingRate2Min, FindingRate2Max).Contains(ItemChooser))
  887.             {
  888.                 FoundItemID = 2;
  889.                 Item = "Painkillers";
  890.                 NeededSpace = PainkillersS;
  891.             }
  892.             else if (Enumerable.Range(FindingRate3Min, FindingRate3Max).Contains(ItemChooser))
  893.             {
  894.                 FoundItemID = 3;
  895.                 Item = "Water Bottle";
  896.                 NeededSpace = WaterBottleS;
  897.             }
  898.             else if (Enumerable.Range(FindingRate4Min, FindingRate4Max).Contains(ItemChooser))
  899.             {
  900.                 FoundItemID = 4;
  901.                 Item = "Soda Can";
  902.                 NeededSpace = SodaS;
  903.             }
  904.             else if (Enumerable.Range(FindingRate5Min, FindingRate5Max).Contains(ItemChooser))
  905.             {
  906.                 FoundItemID = 5;
  907.                 Item = "Canned Beans";
  908.                 NeededSpace = CannedBeansS;
  909.             }
  910.             else if (Enumerable.Range(FindingRate6Min, FindingRate6Max).Contains(ItemChooser))
  911.             {
  912.                 FoundItemID = 6;
  913.                 Item = "Snikers";
  914.                 NeededSpace = SnikersS;
  915.             }
  916.             else if (Enumerable.Range(FindingRate7Min, FindingRate7Max).Contains(ItemChooser))
  917.             {
  918.                 FoundItemID = 7;
  919.                 Item = "Axe";
  920.                 NeededSpace = AxeS;
  921.             }
  922.             else if (Enumerable.Range(FindingRate8Min, FindingRate8Max).Contains(ItemChooser))
  923.             {
  924.                 FoundItemID = 8;
  925.                 Item = "Chainsaw";
  926.                 NeededSpace = ChainsawS;
  927.             }
  928.             else if (Enumerable.Range(FindingRate9Min, FindingRate9Max).Contains(ItemChooser))
  929.             {
  930.                 FoundItemID = 9;
  931.                 Item = "Knife";
  932.                 NeededSpace = KnifeS;
  933.             }
  934.             else if (Enumerable.Range(FindingRate10Min, FindingRate10Max).Contains(ItemChooser))
  935.             {
  936.                 FoundItemID = 10;
  937.                 Item = "Glock17";
  938.                 NeededSpace = Glock17S;
  939.             }
  940.             else if (Enumerable.Range(FindingRate11Min, FindingRate11Max).Contains(ItemChooser))
  941.             {
  942.                 FoundItemID = 11;
  943.                 Item = "Assault Rifle";
  944.                 NeededSpace = AR15S;
  945.             }
  946.             else if (Enumerable.Range(FindingRate12Min, FindingRate12Max).Contains(ItemChooser))
  947.             {
  948.                 FoundItemID = 12;
  949.                 Item = "Shotgun";
  950.                 NeededSpace = ShotgunS;
  951.             }
  952.             else if (Enumerable.Range(FindingRate13Min, FindingRate13Max).Contains(ItemChooser))
  953.             {
  954.                 FoundItemID = 13;
  955.                 Item = "Ammo";
  956.                 NeededSpace = AmmoS;
  957.             }
  958.             else
  959.             {
  960.                 Console.WriteLine("The {0} is empty. You leave...", Placefound);
  961.                 System.Threading.Thread.Sleep(2000);
  962.                 Console.Clear();
  963.                 return;
  964.             }
  965.  
  966.             Console.WriteLine("You found a {0}! What do you want to do with it? Store(1), Throw away(2)", Item);
  967.             while (!int.TryParse(Console.ReadLine(), out usrin2))
  968.             {
  969.                 lineNumber = (new System.Diagnostics.StackFrame(0, true)).GetFileLineNumber();
  970.                 Console.ForegroundColor = ConsoleColor.Red;
  971.                 Console.WriteLine("Invalid Input. Error {0}", lineNumber);
  972.                 Console.ResetColor();
  973.                 System.Threading.Thread.Sleep(1500);
  974.                 Console.SetCursorPosition(0, Console.CursorTop - 1);
  975.                 ClearCurrentConsoleLine();
  976.             }
  977.  
  978.             switch (usrin2)
  979.             {
  980.                 case 1:
  981.                     break;
  982.                 case 2:
  983.                     Console.WriteLine("You threw the {0} away.", Item);
  984.                     System.Threading.Thread.Sleep(1500);
  985.                     Console.Clear();
  986.                     ThrewAway = true;
  987.                     break;
  988.             }
  989.  
  990.             if (ThrewAway == false)
  991.             {
  992.                 ITMID = FoundItemID;
  993.                 if (FreeSpace < NeededSpace)
  994.                     Console.WriteLine("You don't have enought space to store the {0}. ", Item);
  995.                 else
  996.                 {
  997.                     Console.WriteLine("Item stored successfully.");
  998.                     System.Threading.Thread.Sleep(1500);
  999.                     Console.Clear();
  1000.                     FreeSpace -= NeededSpace;
  1001.                 }
  1002.             }
  1003.             if (numofloop >= 5)
  1004.             {
  1005.                 Console.WriteLine("The {0} is empty. You leave...", Places[rnd1]);
  1006.                 System.Threading.Thread.Sleep(1500);
  1007.                 Console.Clear();
  1008.                 return;
  1009.             }
  1010.             Console.WriteLine("Do you want to continue searching? Yes(1), No(2)");
  1011.             while (!int.TryParse(Console.ReadLine(), out usrin3))
  1012.             {
  1013.                 lineNumber = (new System.Diagnostics.StackFrame(0, true)).GetFileLineNumber();
  1014.                 Console.ForegroundColor = ConsoleColor.Red;
  1015.                 Console.WriteLine("Invalid Input. Error {0}", lineNumber);
  1016.                 Console.ResetColor();
  1017.                 System.Threading.Thread.Sleep(1500);
  1018.                 Console.SetCursorPosition(0, Console.CursorTop - 1);
  1019.                 ClearCurrentConsoleLine();
  1020.             }
  1021.  
  1022.             switch (usrin3)
  1023.             {
  1024.                 case 1:
  1025.                     Console.Clear();
  1026.                     Console.WriteLine("You are searching.");
  1027.                     System.Threading.Thread.Sleep(500);
  1028.                     Console.Write(".");
  1029.                     System.Threading.Thread.Sleep(500);
  1030.                     Console.Write(".");
  1031.                     System.Threading.Thread.Sleep(500);
  1032.                     numofloop++;
  1033.                     goto Start;
  1034.                 case 2:
  1035.                     break;
  1036.             }
  1037.             return;
  1038.         }
  1039.  
  1040.         static public void InventoryItemFound(string Item, ref int Piece, int ItemID, decimal NeededSpace, decimal FreeSpace)
  1041.         {
  1042.             int lineNumber = (new System.Diagnostics.StackFrame(0, true)).GetFileLineNumber();
  1043.             int usrin1;
  1044.  
  1045.             Console.WriteLine("You found {0}! What do you want to do with it? Store(1), Throw away(2)", Item);
  1046.             while (!int.TryParse(Console.ReadLine(), out usrin1))
  1047.             {
  1048.                 lineNumber = (new System.Diagnostics.StackFrame(0, true)).GetFileLineNumber();
  1049.                 Console.ForegroundColor = ConsoleColor.Red;
  1050.                 Console.WriteLine("Invalid Input. Error {0}", lineNumber);
  1051.                 Console.ResetColor();
  1052.                 System.Threading.Thread.Sleep(1500);
  1053.                 Console.SetCursorPosition(0, Console.CursorTop - 1);
  1054.                 ClearCurrentConsoleLine();
  1055.             }
  1056.             switch (usrin1)
  1057.             {
  1058.                 case 1:
  1059.                     break;
  1060.                 case 2:
  1061.                     Console.WriteLine("You threw the {0} away.", Item);
  1062.                     return;
  1063.             }
  1064.  
  1065.             if (FreeSpace < NeededSpace)
  1066.                 Console.WriteLine("You don't have enought space to store the {0}.", Item);
  1067.             else
  1068.             {
  1069.                 Console.WriteLine("Item stored successfully.");
  1070.                 System.Threading.Thread.Sleep(1500);
  1071.                 Console.SetCursorPosition(0, Console.CursorTop - 1);
  1072.                 ClearCurrentConsoleLine();
  1073.                 FreeSpace -= NeededSpace;
  1074.                 Piece++;
  1075.             }
  1076.         }
  1077.  
  1078.         //Distance Process Bar
  1079.         static public void DistanceBar(decimal Distance)
  1080.         {
  1081.             string DistanceBar = null;
  1082.             if (Distance >= 10)
  1083.             {
  1084.                 Console.WriteLine("You reached the bunker and got to savety!");
  1085.                 Console.ReadKey();
  1086.                 Console.WriteLine("Source code: ");
  1087.                 File.Delete(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\CseBridge.dll");
  1088.                 System.Environment.Exit(1);
  1089.             }
  1090.             Distance = Math.Round(Distance);
  1091.  
  1092.             switch (Distance)
  1093.             {
  1094.                 case 0:
  1095.                     DistanceBar = "START >--------------------> BUNKER";
  1096.                     break;
  1097.                 case 1:
  1098.                     DistanceBar = "START >>>------------------> BUNKER";
  1099.                     break;
  1100.                 case 2:
  1101.                     DistanceBar = "START >>>>>----------------> BUNKER";
  1102.                     break;
  1103.                 case 3:
  1104.                     DistanceBar = "START >>>>>>>--------------> BUNKER";
  1105.                     break;
  1106.                 case 4:
  1107.                     DistanceBar = "START >>>>>>>>>------------> BUNKER";
  1108.                     break;
  1109.                 case 5:
  1110.                     DistanceBar = "START >>>>>>>>>>>----------> BUNKER";
  1111.                     break;
  1112.                 case 6:
  1113.                     DistanceBar = "START >>>>>>>>>>>>>--------> BUNKER";
  1114.                     break;
  1115.                 case 7:
  1116.                     DistanceBar = "START >>>>>>>>>>>>>>>------> BUNKER";
  1117.                     break;
  1118.                 case 8:
  1119.                     DistanceBar = "START >>>>>>>>>>>>>>>>>----> BUNKER";
  1120.                     break;
  1121.                 case 9:
  1122.                     DistanceBar = "START >>>>>>>>>>>>>>>>>>>--> BUNKER";
  1123.                     break;
  1124.                 case 10:
  1125.                     DistanceBar = "START >>>>>>>>>>>>>>>>>>>>>> BUNKER";
  1126.                     break;
  1127.                 default:
  1128.                     DistanceBar = "START ERROR BUNKER";
  1129.                     break;
  1130.             }
  1131.  
  1132.             Console.WriteLine(DistanceBar);
  1133.             Console.WriteLine("\n");
  1134.             return;
  1135.         }
  1136.  
  1137.         //Inventory Display
  1138.         static public void InventoryCheck(string Item, int Piece, ref int ItemID)
  1139.         {
  1140.             if (Piece > 0)
  1141.             {
  1142.                 if (ItemID > 9)
  1143.                 {
  1144.                     Console.WriteLine("ID {0} |{1}: {2}", ItemID, Item, Piece);
  1145.                 }
  1146.                 else
  1147.                     Console.WriteLine("ID {0}  |{1}: {2}", ItemID, Item, Piece);
  1148.             }
  1149.         }
  1150.  
  1151.         //Inventory Menu
  1152.         static public void InventoryOptions(string Item, ref int Piece, bool IsUsable, int ItemID, ref decimal Stats)
  1153.         {
  1154.             int lineNumber = (new System.Diagnostics.StackFrame(0, true)).GetFileLineNumber();
  1155.             if (Piece > 0)
  1156.             {
  1157.                 int usrin2;
  1158.                 Console.WriteLine("What do you want to do with {0}? Use(1), Throw away(2), Exit(0)", Item);
  1159.                
  1160.                 while (!int.TryParse(Console.ReadLine(), out usrin2))
  1161.                 {
  1162.                     lineNumber = (new System.Diagnostics.StackFrame(0, true)).GetFileLineNumber();
  1163.                     Console.ForegroundColor = ConsoleColor.Red;
  1164.                     Console.WriteLine("Invalid Input. Error {0}", lineNumber);
  1165.                     Console.ResetColor();
  1166.                     System.Threading.Thread.Sleep(1500);
  1167.                     Console.SetCursorPosition(0, Console.CursorTop - 1);
  1168.                     ClearCurrentConsoleLine();
  1169.                 }
  1170.                 Console.SetCursorPosition(0, Console.CursorTop - 1);
  1171.                 ClearCurrentConsoleLine();
  1172.  
  1173.                 switch (usrin2)
  1174.                 {
  1175.                     case 0:
  1176.                         return;
  1177.                     case 1:
  1178.                         if (IsUsable == true)
  1179.                         {
  1180.                             Console.Clear();
  1181.                             Piece--;
  1182.                             Console.ForegroundColor = ConsoleColor.Green;
  1183.                             Console.WriteLine("You used {0}", Item);
  1184.                             Console.ResetColor();
  1185.                             System.Threading.Thread.Sleep(1000);
  1186.                             Console.SetCursorPosition(0, Console.CursorTop - 1);
  1187.                             ClearCurrentConsoleLine();
  1188.  
  1189.                             switch (ItemID)
  1190.                             {
  1191.                                 case 1:
  1192.                                     Stats += 4;
  1193.                                     break;
  1194.                                 case 2:
  1195.                                     Stats += 2.5m;
  1196.                                     break;
  1197.                                 case 3:
  1198.                                     Stats += 4;
  1199.                                     break;
  1200.                                 case 4:
  1201.                                     Stats += 2;
  1202.                                     break;
  1203.                                 case 5:
  1204.                                     Stats += 4;
  1205.                                     break;
  1206.                                 case 6:
  1207.                                     Stats += 1.5m;
  1208.                                     break;
  1209.                             }
  1210.                         }
  1211.                         else
  1212.                         {
  1213.                             Console.WriteLine("You can't use this Item.");
  1214.                             System.Threading.Thread.Sleep(1500);
  1215.                             Console.SetCursorPosition(0, Console.CursorTop - 1);
  1216.                             ClearCurrentConsoleLine();
  1217.                             return;
  1218.                         }
  1219.                         break;
  1220.                     case 2:
  1221.                         Console.WriteLine("You threw {0} away.", Item);
  1222.                         Piece--;
  1223.                         Console.Clear();
  1224.                         break;
  1225.                        
  1226.                     default:
  1227.                         lineNumber = (new System.Diagnostics.StackFrame(0, true)).GetFileLineNumber();
  1228.                         Console.ForegroundColor = ConsoleColor.Red;
  1229.                         System.Threading.Thread.Sleep(1500);
  1230.                         Console.SetCursorPosition(0, Console.CursorTop - 1);
  1231.                         ClearCurrentConsoleLine();
  1232.                         break;
  1233.                 }
  1234.             }
  1235.             else
  1236.             {
  1237.                 lineNumber = (new System.Diagnostics.StackFrame(0, true)).GetFileLineNumber();
  1238.                 Console.ForegroundColor = ConsoleColor.Red;
  1239.                 Console.WriteLine("Invalid Input. Error {0}", lineNumber);
  1240.                 Console.ResetColor();
  1241.                 System.Threading.Thread.Sleep(1500);
  1242.                 Console.Clear();
  1243.             }
  1244.             return;
  1245.         }
  1246.  
  1247.         static public void EnemyEncounter(ref decimal Health, ref int Ammo, int Axe, int Chainsaw, int Knife, int Glock17, int AR15, int Shotgun, ref decimal DayRate)
  1248.         {
  1249.             decimal AxeDmg = 2.5m;
  1250.             decimal ChainsawDmg = 3.5m;
  1251.             decimal KnifeDmg = 1m;
  1252.             decimal Glock17Dmg = 5m;
  1253.             decimal AR15Dmg = 8m;
  1254.             decimal ShotgunDmg = 10m;
  1255.             decimal EHealth = 10;
  1256.  
  1257.  
  1258.             Random rnd = new Random();
  1259.             int rnd4 = rnd.Next(0, 6);
  1260.             int rnd5 = rnd.Next(0, 4);
  1261.             int usrin3 = 0;
  1262.  
  1263.             string[] creatures = new string[] { "Crawler", "Zombie", "Mutant Spider", "retarded Antifa Member", "Mutant Turtle", "normal Kid" };
  1264.             string Enemy = creatures[rnd4];
  1265.  
  1266.         Input:
  1267.             Console.WriteLine("You encounter a {0}! What do you want to do? Attack(1), Flee(2)", Enemy);
  1268.             while (!int.TryParse(Console.ReadLine(), out usrin3))
  1269.             {
  1270.                 int lineNumber = (new System.Diagnostics.StackFrame(0, true)).GetFileLineNumber();
  1271.                 Console.ForegroundColor = ConsoleColor.Red;
  1272.                 Console.WriteLine("Invalid Input. Error {0}", lineNumber);
  1273.                 Console.ResetColor();
  1274.                 System.Threading.Thread.Sleep(1500);
  1275.                 Console.SetCursorPosition(0, Console.CursorTop - 1);
  1276.                 ClearCurrentConsoleLine();
  1277.             }
  1278.             switch (usrin3)
  1279.             {
  1280.                 case 1:
  1281.                     break;
  1282.                 case 2:
  1283.                     if (rnd5 == 2)
  1284.                     {
  1285.                         Console.WriteLine("You successfully fled!");
  1286.                         System.Threading.Thread.Sleep(1500);
  1287.                         Console.Clear();
  1288.                         return;
  1289.                     }
  1290.                     else
  1291.                     {
  1292.                         Console.WriteLine("The {0} attacks you and you take damage, but eventually get away...", Enemy);
  1293.                         Health -= 3.5m;
  1294.                         System.Threading.Thread.Sleep(1500);
  1295.                         Console.Clear();
  1296.                         return;
  1297.                     }
  1298.                    
  1299.                 default:
  1300.                     int lineNumber = (new System.Diagnostics.StackFrame(0, true)).GetFileLineNumber();
  1301.                     Console.ForegroundColor = ConsoleColor.Red;
  1302.                     Console.WriteLine("Invalid Input. Error {0}", lineNumber);
  1303.                     Console.ResetColor();
  1304.                     System.Threading.Thread.Sleep(1500);
  1305.                     Console.Clear();
  1306.                     goto Input;
  1307.             }
  1308.             GunFight:
  1309.             if (Chainsaw >= 1 || Axe >= 1
  1310.                 || Knife >= 1 || Glock17 >= 1
  1311.                 || AR15 >= 1 || Shotgun >= 1)
  1312.             {
  1313.                 Input1:
  1314.                 Console.WriteLine("What gun do you want to use? \n");
  1315.                 if (Axe >= 1)
  1316.                     Console.WriteLine("1| Axe");
  1317.                 if (Chainsaw >= 1)
  1318.                     Console.WriteLine("2| Chainsaw");
  1319.                 if (Knife >= 1)
  1320.                     Console.WriteLine("3| Knife");
  1321.                 if (Glock17 >= 1)
  1322.                     Console.WriteLine("4| Glock17");
  1323.                 if (AR15 >= 1)
  1324.                     Console.WriteLine("5| AR15");
  1325.                 if (Shotgun >= 1)
  1326.                     Console.WriteLine("6| Shotgun");
  1327.  
  1328.                 while (!int.TryParse(Console.ReadLine(), out usrin3))
  1329.                 {
  1330.                     int lineNumber = (new System.Diagnostics.StackFrame(0, true)).GetFileLineNumber();
  1331.                     Console.ForegroundColor = ConsoleColor.Red;
  1332.                     Console.WriteLine("Invalid Input. Error {0}", lineNumber);
  1333.                     Console.ResetColor();
  1334.                     System.Threading.Thread.Sleep(1500);
  1335.                     Console.SetCursorPosition(0, Console.CursorTop - 1);
  1336.                     ClearCurrentConsoleLine();
  1337.                 }
  1338.                 Console.WriteLine("The {0} has {1}/10HP", Enemy, EHealth);
  1339.                 System.Threading.Thread.Sleep(1500);
  1340.                 switch (usrin3)
  1341.                 {
  1342.  
  1343.                     case 1:
  1344.                         if(Axe >= 1)
  1345.                         {
  1346.                             Console.WriteLine("You attack with an Axe!");
  1347.                             EHealth -= AxeDmg;
  1348.                         }
  1349.                         else if(Axe == 0)
  1350.                         {
  1351.                             Console.WriteLine("You dont have an Axe.");
  1352.                                 System.Threading.Thread.Sleep(1500);
  1353.                             goto GunFight;
  1354.                         }
  1355.                         break;
  1356.                     case 2:
  1357.                         if (Chainsaw >= 1)
  1358.                         {
  1359.                             Console.WriteLine("You attack with a Chainsaw!");
  1360.                             EHealth -= ChainsawDmg;
  1361.                         }
  1362.                         else if (Axe == 0)
  1363.                         {
  1364.                             Console.WriteLine("You dont have a Chainsaw.");
  1365.                             System.Threading.Thread.Sleep(1500);
  1366.                             goto GunFight;
  1367.                         }
  1368.                         break;
  1369.                     case 3:
  1370.                         if (Knife >= 1)
  1371.                         {
  1372.                             Console.WriteLine("You attack with a Knife!");
  1373.                             EHealth -= KnifeDmg;
  1374.                         }
  1375.                         else if (Axe == 0)
  1376.                         {
  1377.                             Console.WriteLine("You dont have a Knife.");
  1378.                             System.Threading.Thread.Sleep(1500);
  1379.                             goto GunFight;
  1380.                         }
  1381.                         break;
  1382.                     case 4:
  1383.                         if (Glock17 >= 1 && Ammo >= 1)
  1384.                         {
  1385.                             Console.WriteLine("You attack with a Glock-17!");
  1386.                             EHealth -= Glock17Dmg;
  1387.                         }
  1388.                         else if (Axe == 0)
  1389.                         {
  1390.                             Console.WriteLine("You dont have a Glock-17.");
  1391.                             System.Threading.Thread.Sleep(1500);
  1392.                             goto GunFight;
  1393.                         }
  1394.                         else if (Ammo == 0)
  1395.                         {
  1396.                             Console.WriteLine("You dont any ammo.");
  1397.                             System.Threading.Thread.Sleep(1500);
  1398.                             goto GunFight;
  1399.                         }
  1400.                         break;
  1401.                     case 5:
  1402.                         if (AR15 >= 1 && Ammo >= 1)
  1403.                         {
  1404.                             Console.WriteLine("You attack with an AR-15!");
  1405.                             EHealth -= AR15Dmg;
  1406.                         }
  1407.                         else if (Axe == 0)
  1408.                         {
  1409.                             Console.WriteLine("You dont have an AR-15.");
  1410.                             System.Threading.Thread.Sleep(1500);
  1411.                             goto GunFight;
  1412.                         }
  1413.                         else if (Ammo == 0)
  1414.                         {
  1415.                             Console.WriteLine("You dont any ammo.");
  1416.                             System.Threading.Thread.Sleep(1500);
  1417.                             goto GunFight;
  1418.                         }
  1419.                         break;
  1420.                     case 6:
  1421.                         if (Shotgun >= 1 && Ammo >= 1)
  1422.                         {
  1423.                             Console.WriteLine("You attack with a Shotgun!");
  1424.                             EHealth -= ShotgunDmg;
  1425.                         }
  1426.                         else if (Axe == 0)
  1427.                         {
  1428.                             Console.WriteLine("You dont have a Shotgun.");
  1429.                             System.Threading.Thread.Sleep(1500);
  1430.                             goto GunFight;
  1431.                         }
  1432.                         break;
  1433.                     default:
  1434.                         int lineNumber = (new System.Diagnostics.StackFrame(0, true)).GetFileLineNumber();
  1435.                         Console.ForegroundColor = ConsoleColor.Red;
  1436.                         Console.WriteLine("Invalid Input. Error {0}", lineNumber);
  1437.                         Console.ResetColor();
  1438.                         System.Threading.Thread.Sleep(1500);
  1439.                         goto Input1;
  1440.                 }
  1441.                 System.Threading.Thread.Sleep(1500);
  1442.                 Console.Clear();
  1443.                 if (EHealth <= 0)
  1444.                 {
  1445.                     Console.WriteLine("You killed the {0}! It dropped a map you can use to navigate faster!");
  1446.                     DayRate += 0.02m;
  1447.                     System.Threading.Thread.Sleep(2000);
  1448.                     Console.Clear();
  1449.                     return;
  1450.                 }
  1451.                 else
  1452.                     goto GunFight;
  1453.  
  1454.             }
  1455.         }
  1456.  
  1457.         //Formating
  1458.         public static void ClearCurrentConsoleLine()
  1459.         {
  1460.             int currentLineCursor = Console.CursorTop;
  1461.             Console.SetCursorPosition(0, Console.CursorTop);
  1462.             Console.Write(new string(' ', Console.WindowWidth));
  1463.             Console.SetCursorPosition(0, currentLineCursor);
  1464.         }
  1465.     }
  1466.  
  1467. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement