Advertisement
DanDelatt

Survival text Update 2.2

Sep 7th, 2017
363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 32.44 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Runtime.Serialization;
  6. using System.Runtime.Serialization.Formatters.Binary;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9.  
  10. namespace ConsoleApplication4
  11. {
  12.     class Program
  13.     {
  14.  
  15.         static private BehindTheScenes bts;
  16.         static void Main(string[] args)
  17.         {
  18.             bts = new BehindTheScenes();      
  19.             bts.GetBiomeNumber();
  20.             bts.GetBiome();
  21.             Console.WriteLine("You appeared in a" + bts.biome + ". ");
  22.             System.Threading.Thread.Sleep(10);
  23.             bts.BiomeData();
  24.             while (bts.GameRunning == true)
  25.             {
  26.                 System.Threading.Thread.Sleep(10);
  27.                 bts.Choices();
  28.                 bts.answer = Console.ReadLine();
  29.                 bts.MakeChoice();
  30.                
  31.             }
  32.         }
  33.     }
  34.  
  35.     [Serializable]
  36.     class BehindTheScenes
  37.     {
  38.         public string biome;
  39.         int biomeChooser;
  40.         public string answer;
  41.         string animals = "";
  42.         int chance = 0;
  43.         int hunger = 10;
  44.         string word;
  45.         int foodAmount;
  46.         string foodType;
  47.         int Food1Amount = 0;
  48.         int Food2Amount = 0;
  49.         int Food3Amount = 0;
  50.         int Food4Amount = 0;
  51.         int Food5Amount = 0;
  52.         int KillTime = 5000;
  53.         int TravelTime = 7000;
  54.         int hungerLoss;
  55.         public bool GameRunning = true;
  56.         string eatAnswer;
  57.         int foodTypeID;
  58.         int VillageFoodAmount;
  59.         int hungerLimit = 10;
  60.         int health = 10;
  61.         int healthLimit = 10;
  62.         int torches;
  63.         int caveLootID;
  64.         int woodAmount;
  65.         int canLootStructures = 0;
  66.         int torchPlaced = 0;
  67.         int healthLoss;
  68.         int healthRegen = 0;
  69.         int IfCanLootVillage = 0;
  70.         int woodValue;
  71.         int secretIngredient;
  72.         int caravanchance = 0;
  73.         string answeraddition = "";
  74.         int caravanlootID;
  75.         int ifcanrobcaravan = 0;
  76.         int caravanWood;
  77.         public void Save() //not yet used
  78.         {
  79.             IFormatter formatter = new BinaryFormatter();
  80.             Stream stream = new FileStream("TextSurvivalSave.bin",
  81.             FileMode.Create,
  82.             FileAccess.Write, FileShare.None);
  83.             formatter.Serialize(stream, this);
  84.             stream.Close();
  85.         }
  86.  
  87.         public static void Load(ref BehindTheScenes bts) //not yet used
  88.         {
  89.             IFormatter formatter = new BinaryFormatter();
  90.             Stream stream = new FileStream("TextSurvivalSave.bin",
  91.                                       FileMode.Open,
  92.                                       FileAccess.Read,
  93.                                       FileShare.Read);
  94.             bts = (BehindTheScenes)formatter.Deserialize(stream);
  95.             stream.Close();
  96.         }
  97.  
  98.         public void CaravanGen()
  99.         {
  100.             if(biome == " desert")
  101.             {
  102.                 Random rnd = new Random();
  103.                 caravanchance = rnd.Next(1, 1);
  104.                 if (caravanchance == 1)
  105.                 {
  106.                     answeraddition = " and a caravan...";
  107.                     ifcanrobcaravan = 1;
  108.                 }
  109.                 else
  110.                 {
  111.                     answeraddition = "";
  112.                 }
  113.  
  114.             }
  115.         }
  116.  
  117.         public void GetVilllage()
  118.         {
  119.             Random rnd = new Random();
  120.             if (biome == " forest")
  121.             {
  122.                 chance = rnd.Next(1, 3);
  123.                 if(chance == 1)
  124.                 {
  125.                     IfCanLootVillage = 1;
  126.                     Console.WriteLine("----------------------");
  127.                     Console.WriteLine("You entered a village!");
  128.                 }
  129.             }
  130.             if (biome == " plain")
  131.             {
  132.                 chance = rnd.Next(1, 3);
  133.                 if (chance == 1)
  134.                 {
  135.                     IfCanLootVillage = 1;
  136.                     Console.WriteLine("----------------------");
  137.                     Console.WriteLine("You entered a village!");
  138.                 }
  139.             }
  140.       }
  141.  
  142.         public void GetBiomeNumber()
  143.         {
  144.             Random rnd = new Random();
  145.             biomeChooser = rnd.Next(1 , 12);
  146.         }
  147.         public void GetBiome()
  148.         {
  149.             if (biomeChooser == 1| biomeChooser == 2)
  150.             {
  151.                 biome = " forest";
  152.             }
  153.             if (biomeChooser == 3 | biomeChooser == 4)
  154.             {
  155.                 biome = " desert";
  156.             }
  157.             if (biomeChooser == 5 | biomeChooser == 6)
  158.             {
  159.                 biome = " jungle";
  160.             }
  161.             if (biomeChooser == 7 | biomeChooser == 8)
  162.             {
  163.                 biome = "n ocean";
  164.             }
  165.             if (biomeChooser == 9 | biomeChooser == 10)
  166.             {
  167.                 biome = " plain";
  168.             }
  169.             if (biomeChooser == 11 | biomeChooser == 12)
  170.             {
  171.                 canLootStructures = 1;
  172.                 biome = " cave";
  173.             }
  174.         }
  175.         public void BiomeData()
  176.         {
  177.             if(biome == " forest")
  178.             {
  179.                 Console.WriteLine("You feel cold.");
  180.             }
  181.             if(biome == " desert")
  182.             {
  183.                 Console.WriteLine("You feel hot!");
  184.             }
  185.             if(biome == " jungle")
  186.             {
  187.                 Console.WriteLine("It is too damp to breathe properly!");
  188.             }
  189.             if(biome == "n ocean")
  190.             {
  191.                 Console.WriteLine("At least you can swim");
  192.             }
  193.             if(biome == " plain")
  194.             {
  195.                 Console.WriteLine("You can see something in the distance... maybe...");
  196.             }
  197.             if (biome == " cave")
  198.             {
  199.                 Console.WriteLine("It is dark around");
  200.             }
  201.                
  202.          }
  203.         public void AnimalCalculation()
  204.         {
  205.             if (biome == " desert")
  206.             {
  207.                 animals = "no animals";
  208.             }
  209.             if (biome == "n ocean")
  210.             {
  211.                 animals = "squids";
  212.             }
  213.             if (biome == " jungle")
  214.             {
  215.                 animals = "chickens";
  216.             }
  217.             if (biome == " forest")
  218.             {
  219.                 animals = "cows";
  220.             }
  221.             if(biome == " plain")
  222.             {
  223.                 animals = "sheep";
  224.             }
  225.             if (biome == " cave")
  226.             {
  227.                 animals = "zombies";
  228.             }
  229.         }
  230.         public void WordChooser /*????????*/ ()
  231.         {
  232.             Random rnd = new Random();
  233.             int WordChance = rnd.Next(1, 4);
  234.             if (WordChance == 1)
  235.             {
  236.                 word = "several ";
  237.             }
  238.             if (WordChance == 2)
  239.             {
  240.                 word = "some ";
  241.             }
  242.             if (WordChance == 3)
  243.             {
  244.                 word = "a few ";
  245.             }
  246.             if (WordChance == 4)
  247.             {
  248.                 word = " ";
  249.             }
  250.         }
  251.         public void Choices()
  252.         {
  253.             Console.WriteLine("----------------------");
  254.             Console.WriteLine("1.Look around");
  255.             Console.WriteLine("2.Attack closest animal");
  256.             Console.WriteLine("3.Move north");
  257.             Console.WriteLine("4.Move south");
  258.             Console.WriteLine("5.Move east");
  259.             Console.WriteLine("6.Move west");
  260.             Console.WriteLine("7.Loot village");
  261.             Console.WriteLine("8.Eat");
  262.             Console.WriteLine("9.Try looting the cave");
  263.             Console.WriteLine("10.Place a torch");
  264.             Console.WriteLine("11.Make a torch");
  265.             Console.WriteLine("12.Remove a nearby tree");
  266.             Console.WriteLine("13.Inventory");
  267.             if(caravanchance == 1)
  268.             {
  269.                 Console.WriteLine("14.Rob caravan");
  270.             }
  271.             Console.WriteLine("----------------------");
  272.  
  273.         }
  274.         public void lootCalculation()
  275.         {
  276.             if (animals == "cows")
  277.             {
  278.                 Random rnd = new Random();
  279.                 foodAmount = rnd.Next(1, 5);
  280.                 Food1Amount = Food1Amount + foodAmount;
  281.                 foodType = "beef";
  282.             }
  283.             if (animals == "chickens")
  284.             {
  285.                 Random rnd = new Random();
  286.                 foodAmount = rnd.Next(1, 2);
  287.                 Food2Amount = Food2Amount + foodAmount;
  288.                 foodType = "chicken";
  289.             }
  290.             if (animals == "sheep")
  291.             {
  292.                 Random rnd = new Random();
  293.                 foodAmount = rnd.Next(1, 4);
  294.                 Food3Amount = Food3Amount + foodAmount;
  295.                 foodType = "mutton";
  296.             }
  297.         }
  298.         public void FoodTypeID()
  299.         {
  300.             Random rnd = new Random();
  301.             foodTypeID = rnd.Next(1, secretIngredient);
  302.         }
  303.         public void VillageFoodAmountCalc()
  304.         {
  305.             Random rnd = new Random();
  306.             VillageFoodAmount = rnd.Next(1, 4);
  307.             foodAmount = VillageFoodAmount;
  308.         }
  309.         public void VillageLootCalculation()
  310.         {
  311.             if (IfCanLootVillage == 1)
  312.             {
  313.                 Random rnd = new Random();
  314.                 int LootNumber = rnd.Next(1, 3);
  315.                 if (LootNumber == 1)
  316.                 {
  317.                     Console.WriteLine("----------------------");
  318.                     Console.WriteLine("You found a mighty sword! Kill time reduced by 2 seconds!");
  319.                     KillTimeProtection();
  320.                     KillTime = KillTime - 2000;
  321.                     IfCanLootVillage = 0;
  322.                 }
  323.                 if (LootNumber == 2)
  324.                 {
  325.                     Console.WriteLine("----------------------");
  326.                     Console.WriteLine("You found stirdy boots! Travel time reduced by 3 seconds!");
  327.                     TravelTimeProtection();
  328.                     TravelTime = TravelTime - 3000;
  329.                     IfCanLootVillage = 0;
  330.                 }
  331.                 if (LootNumber == 3)
  332.                 {
  333.                     FoodTypeID();
  334.                     VillageFoodAmountCalc();
  335.                     if (foodTypeID == 1)
  336.                     {
  337.                         Food1Amount = Food1Amount + VillageFoodAmount;
  338.                     }
  339.                     if (foodTypeID == 2)
  340.                     {
  341.                         Food2Amount = Food2Amount + VillageFoodAmount;
  342.                     }
  343.                     if (secretIngredient == 4 && foodTypeID == 3)
  344.                     {
  345.                         Food3Amount = Food3Amount + VillageFoodAmount;
  346.                     }
  347.                     if (secretIngredient == 4 && foodTypeID == 4)
  348.                     {
  349.                         foodType = "secret ingredient";
  350.                         Food4Amount = Food4Amount + foodAmount;
  351.                     }
  352.                     Console.WriteLine("----------------------");
  353.                     Console.WriteLine("You found " + foodAmount + " " + foodType);
  354.                     IfCanLootVillage = 0;
  355.                 }
  356.             }
  357.             else
  358.             {
  359.                 if (chance == 1)
  360.                 {
  361.                     Console.WriteLine("----------------------");
  362.                     Console.WriteLine("You already did that!");
  363.                 }
  364.                 else
  365.                 {
  366.                     Console.WriteLine("----------------------");
  367.                     Console.WriteLine("You arent in a village!");
  368.                 }
  369.             }
  370.         }
  371.         public void KillTimeProtection()
  372.         {
  373.             if (KillTime - 2000 < 0)
  374.             {
  375.                 KillTime = 500;
  376.             }
  377.         }
  378.         public void TravelTimeProtection()
  379.         {
  380.             if (TravelTime - 3000 < 0)
  381.             {
  382.                 TravelTime = 500;
  383.             }
  384.         }
  385.         public void Hunger()
  386.         {
  387.             Random rnd = new Random();
  388.             hungerLoss = rnd.Next(1, 3);
  389.             hunger = hunger - hungerLoss;
  390.             Console.WriteLine("You lost " + hungerLoss + " hunger. You have " + hunger + " left");
  391.             Death();
  392.         }
  393.         public void Eat()
  394.         {
  395.             if (Food1Amount >= 1 | Food2Amount >= 1 | Food3Amount >= 1 | Food4Amount >= 0)
  396.             {
  397.                 Console.WriteLine("----------------------");
  398.                 Console.WriteLine("----1.Eat Beef (" + Food1Amount + ")");
  399.                 Console.WriteLine("----2.Eat Chicken (" + Food2Amount + ")");
  400.                 Console.WriteLine("----3.Eat Mutton (" + Food3Amount + ")");
  401.                 Console.WriteLine("----4.Eat Secret Ingredient (" + Food4Amount + ")");
  402.                 eatAnswer = Console.ReadLine();
  403.                 if (eatAnswer == "1")
  404.                 {
  405.                     if (Food1Amount > 0)
  406.                     {
  407.                         Food1Amount = Food1Amount - 1;
  408.                         hunger = hunger + 3;
  409.                         if (hunger > hungerLimit)
  410.                         {
  411.                             hunger = hungerLimit;
  412.                         }
  413.                         Console.WriteLine("-----------------------------------");
  414.                         Console.WriteLine("You replenished 3 hunger! You have " + hunger + " hunger now!");
  415.                         Random rnd = new Random();
  416.                         healthRegen = rnd.Next(3);
  417.                         HealthRegen();
  418.                     }
  419.                     else
  420.                     {
  421.                         Console.WriteLine("-----------------------------------");
  422.                         Console.WriteLine("You haven't got any of it left!");
  423.                     }
  424.                 }
  425.                 if (eatAnswer == "2")
  426.                 {
  427.                     if (Food2Amount > 0)
  428.                     {
  429.                         Food2Amount = Food2Amount - 1;
  430.                         hunger = hunger + 1;
  431.                         if (hunger > hungerLimit)
  432.                         {
  433.                             hunger = hungerLimit;
  434.                         }
  435.                         Console.WriteLine("-----------------------------------");
  436.                         Console.WriteLine("You replenished 2 hunger! You have " + hunger + " hunger now!");
  437.                         Random rnd = new Random();
  438.                         healthRegen = rnd.Next(1);
  439.                         HealthRegen();
  440.                     }
  441.                     else
  442.                     {
  443.                         Console.WriteLine("-----------------------------------");
  444.                         Console.WriteLine("You haven't got any of this left!");
  445.                     }
  446.                 }
  447.                 if (eatAnswer == "3")
  448.                 {
  449.                     if (Food3Amount > 0)
  450.                     {
  451.                         Food3Amount = Food3Amount - 1;
  452.                         hunger = hunger + 2;
  453.                         if (hunger > hungerLimit)
  454.                         {
  455.                             hunger = hungerLimit;
  456.                         }
  457.                         Console.WriteLine("-----------------------------------");
  458.                         Console.WriteLine("You replenished 2 hunger! You have " + hunger + " hunger now!");
  459.                         Random rnd = new Random();
  460.                         healthRegen = rnd.Next(2);
  461.                         HealthRegen();
  462.                     }
  463.                     else
  464.                     {
  465.                         Console.WriteLine("-----------------------------------");
  466.                         Console.WriteLine("You haven't got any of it!");
  467.                     }
  468.                 }
  469.                 if (eatAnswer == "4")
  470.                 {
  471.                     if (Food4Amount > 0)
  472.                     {
  473.                         Food4Amount = Food4Amount - 1;
  474.                         hunger = hunger + 100;
  475.                         if (hunger > hungerLimit)
  476.                         {
  477.                             hunger = hungerLimit;
  478.                         }
  479.                         Console.WriteLine("-----------------------------------");
  480.                         Console.WriteLine("You replenished 100 hunger! You have " + hunger + " hunger now!");
  481.                         Random rnd = new Random();
  482.                         healthRegen = rnd.Next(100, 110);
  483.                         HealthRegen();
  484.                     }
  485.                     else
  486.                     {
  487.                         Console.WriteLine("-----------------------------------");
  488.                         Console.WriteLine("You dont have any!");
  489.                     }
  490.                 }
  491.                 if (eatAnswer == "" | eatAnswer == " ")
  492.                 {
  493.  
  494.                 }
  495.             }
  496.             else
  497.             {
  498.                 Console.WriteLine("----------------------");
  499.                 Console.WriteLine("You dont have any food!");
  500.             }
  501.         }
  502.         public void AnimalLoot()
  503.         {
  504.             if (biome == " forest" | biome == " plain" | biome == " jungle")
  505.             {
  506.                 if (animals == "cows")
  507.                 {
  508.                     Console.WriteLine("----------------------");
  509.                     Console.WriteLine("You got " + foodAmount + " " + foodType);
  510.                 }
  511.                 if (animals == "chickens")
  512.                 {
  513.                     Console.WriteLine("----------------------");
  514.                     Console.WriteLine("You got " + foodAmount + " " + foodType);
  515.                 }
  516.                 if (animals == "sheep")
  517.                 {
  518.                     Console.WriteLine("----------------------");
  519.                     Console.WriteLine("You got " + foodAmount + " " + foodType);
  520.                 }
  521.             }
  522.             else
  523.             {
  524.                 int TempKillTime = 0;
  525.                 TempKillTime = KillTime;
  526.                 KillTime = 0;
  527.                 Console.WriteLine("----------------------");
  528.                 Console.WriteLine("There are no useful animals around!");
  529.                 KillTime = TempKillTime;
  530.             }
  531.         }
  532.         public void HealthLoss()
  533.         {
  534.             Random rnd = new Random();
  535.             healthLoss = rnd.Next(1, 2);
  536.             health = health - healthLoss;
  537.             Console.WriteLine("You lost " + healthLoss + " health in the process. You have " + health + " health left");
  538.             Death();
  539.         }
  540.         public void HealthRegen()
  541.         {
  542.             health = health + healthRegen;
  543.             healthLimiter();
  544.             Console.WriteLine("You regenerated " + healthRegen + " health! You have " + health + " now!");
  545.         }
  546.  
  547.         public void healthLimiter()
  548.         {
  549.             if (health > healthLimit)
  550.             {
  551.                 health = healthLimit;
  552.             }
  553.         }
  554.  
  555.         public void Death()
  556.         {
  557.             if (hunger <= 0)
  558.             {
  559.                 Console.WriteLine("----------------------");
  560.                 Console.WriteLine("You starved to death! Game Over!");
  561.                 Console.WriteLine("Please consider subscribing to my VK group vk.com/dandelay");
  562.                 Console.WriteLine("----------------------");
  563.                 Console.ReadLine();
  564.                 GameRunning = false;
  565.             }
  566.             if (health <= 0)
  567.             {
  568.                 Console.WriteLine("----------------------");
  569.                 Console.WriteLine("You were killed! Game Over!");
  570.                 Console.WriteLine("Please consider subscribing to my VK group vk.com/dandelay");
  571.                 Console.WriteLine("----------------------");
  572.                 Console.ReadLine();
  573.                 GameRunning = false;
  574.             }
  575.         }
  576.  
  577.         public void caveLoot()
  578.         {
  579.             if (biome == " cave" && canLootStructures == 1)
  580.             {
  581.                 Console.WriteLine("Looting...");
  582.                 System.Threading.Thread.Sleep(5000);
  583.                 Random rnd = new Random();
  584.                 caveLootID = rnd.Next(1, 7);
  585.                 if (caveLootID == 1)
  586.                 {
  587.                     Console.WriteLine("----------------------");
  588.                     Console.WriteLine("You found very well made boots! Travel time reduced by 4 seconds");
  589.                     TravelTime = TravelTime - 4000;
  590.                     TravelTimeProtection();
  591.                     canLootStructures = 0;
  592.                 }
  593.                 if (caveLootID == 2)
  594.                 {
  595.                     Console.WriteLine("----------------------");
  596.                     Console.WriteLine("You found 10 chicken!");
  597.                     Food2Amount = Food2Amount + 10;
  598.                     canLootStructures = 0;
  599.                 }
  600.                 if (caveLootID == 3)
  601.                 {
  602.                     Console.WriteLine("----------------------");
  603.                     Console.WriteLine("You found a big heavy sword! Travel time increased by 3 seconds and kill time reduced by 3 seconds!");
  604.                     TravelTime = TravelTime + 3000;
  605.                     KillTime = KillTime - 3000;
  606.                     KillTimeProtection();
  607.                     canLootStructures = 0;
  608.                 }
  609.                 if (caveLootID == 4)
  610.                 {
  611.                     Console.WriteLine("----------------------");
  612.                     Console.WriteLine("You found 3 torches");
  613.                     torches = torches + 3;
  614.                     canLootStructures = 0;
  615.                 }
  616.                 if (caveLootID == 5)
  617.                 {
  618.                     Console.WriteLine("----------------------");
  619.                     Console.WriteLine("You found 5 wood!");
  620.                     woodAmount = woodAmount + 5;
  621.                     canLootStructures = 0;
  622.                 }
  623.                 if (caveLootID == 6 | caveLootID == 7)
  624.                 {
  625.                     Console.WriteLine("----------------------");
  626.                     Console.WriteLine("You found nothing!");
  627.                 }
  628.                 HealthLoss();
  629.             }
  630.             else
  631.             {
  632.                 if (biome == " cave")
  633.                 {
  634.                     Console.WriteLine("----------------------");
  635.                     Console.WriteLine("You already did that!");
  636.                 }
  637.                 else
  638.                 {
  639.                     Console.WriteLine("----------------------");
  640.                     Console.WriteLine("You aren't in a cave now!");
  641.                 }
  642.             }
  643.         }
  644.         public void PlaceTorch()
  645.         {
  646.             if (torches > 0)
  647.             {
  648.                 if (biome == " cave")
  649.                 {
  650.                     torchPlaced = 1;
  651.                     torches = torches - 1;
  652.                     Console.WriteLine("----------------------");
  653.                     Console.WriteLine("Placed 1 torch");
  654.                 }
  655.                 else
  656.                 {
  657.                     Console.WriteLine("You dont need them here!");
  658.                 }
  659.             }
  660.             else
  661.             {
  662.                 Console.WriteLine("----------------------");
  663.  
  664.                 Console.WriteLine("You dont have any!");
  665.             }
  666.         }
  667.        
  668.         public void showInventory()
  669.         {
  670.             Console.WriteLine("----------------------");
  671.             Console.WriteLine("---- 1. You have " + health + " health.");
  672.             Console.WriteLine("---- 1. You have " + hunger + " hunger.");
  673.             Console.WriteLine("---- 1. You have " + Food1Amount + " beef.");
  674.             Console.WriteLine("---- 2. You have " + Food2Amount + " chicken.");
  675.             Console.WriteLine("---- 3. You have " + Food3Amount + " mutton.");
  676.             Console.WriteLine("---- 4. You have " + Food4Amount + " secret ingredients.");
  677.             Console.WriteLine("---- 5. You have " + Food5Amount + " camel meat.");
  678.             Console.WriteLine("---- 6. You have " + torches + " torches.");
  679.             Console.WriteLine("---- 7. You have " + woodAmount + " wood.");
  680.         }
  681.  
  682.         public void MakeTorch()
  683.         {
  684.             if (woodAmount >= 5)
  685.             {
  686.                 torches = torches + 1;
  687.                 woodAmount = woodAmount - 5;
  688.                 Console.WriteLine("Making torch...");
  689.                 System.Threading.Thread.Sleep(2000);
  690.                 Console.WriteLine("----------------------------");
  691.                 Console.WriteLine("Made 1 torch, lost 5 wood");
  692.             }
  693.             else
  694.             {
  695.                 Console.WriteLine("----------------------------");      
  696.                 Console.WriteLine("You dont have enought wood. You need 5, and you have " + woodAmount);
  697.             }
  698.         }
  699.  
  700.         public void RemoveTrees()
  701.         {
  702.             if (biome == " forest" | biome == " jungle")
  703.             {
  704.                 Random rnd = new Random();
  705.                 woodValue = rnd.Next(5, 10);
  706.                 Console.WriteLine("Removing...");
  707.                 System.Threading.Thread.Sleep(5000);
  708.                 woodAmount = woodAmount + woodValue;
  709.                 Console.WriteLine("You acquired " + woodValue + " wood!");
  710.             }
  711.             else
  712.             {
  713.                 Console.WriteLine("----------------------");
  714.                 Console.WriteLine("You can't see any trees around!");
  715.             }
  716.         }
  717.         public void RobCaravan()
  718.         {
  719.             Random rnd = new Random();
  720.             caravanlootID = rnd.Next(1, 5);
  721.             Console.WriteLine("Robbing...");
  722.             System.Threading.Thread.Sleep(5000);
  723.             if (ifcanrobcaravan == 1)
  724.             {
  725.                 if (caravanlootID == 1)
  726.                 {
  727.                     Random Random = new Random();
  728.                     caravanWood = rnd.Next(10, 15);
  729.                     woodAmount = woodAmount + caravanWood;
  730.                     Console.WriteLine("You found " + caravanWood + " wood!");
  731.                 }
  732.                 if (caravanlootID == 2)
  733.                 {
  734.                     int caravanTorch;
  735.                     Random Random = new Random();
  736.                     caravanTorch = Random.Next(1, 10);
  737.                     torches = torches + caravanTorch;
  738.                     Console.WriteLine("You found " + caravanTorch + " torches!");
  739.                 }
  740.                 if (caravanlootID == 3)
  741.                 {
  742.                     int caravanFood;
  743.                     Random Random = new Random();
  744.                     caravanFood = rnd.Next(1, 4);
  745.                     Food5Amount = Food5Amount + caravanFood;
  746.                     Console.WriteLine("You found " + caravanFood + " camel meat!");
  747.                 }
  748.                 if(caravanlootID == 4 | caravanlootID == 5)
  749.                 {
  750.                     Console.WriteLine("Bad luck, you found nothing!");
  751.                 }
  752.                 ifcanrobcaravan = 0;
  753.                 Random rand = new Random();
  754.                 healthLoss = rand.Next(5, 6);
  755.                 HealthLoss();
  756.             }
  757.             else
  758.             {
  759.                 Console.WriteLine("You already did it!");
  760.             }
  761.         }
  762.         public void MakeChoice()
  763.         {
  764.            
  765.             System.Threading.Thread.Sleep(100);
  766.             if (answer == "1")
  767.             {
  768.                 WordChooser();
  769.                 AnimalCalculation();
  770.                 if (biome == " desert")
  771.                 {
  772.                     CaravanGen();
  773.                     Console.WriteLine("----------------------");
  774.                     Console.WriteLine("You only see infinite sand" + answeraddition + "...");
  775.                 }
  776.                 if (biome == "n ocean")
  777.                     {
  778.                     Console.WriteLine("----------------------");
  779.                     Console.WriteLine("You see " + word + animals);
  780.                     }
  781.                 if (biome == " forest" | biome == " plain" || biome == " jungle")
  782.                 {
  783.                     Console.WriteLine("----------------------");
  784.                     Console.WriteLine("You see " + word + animals);
  785.                 }
  786.                 if (biome == " cave")
  787.                 {
  788.                     if (torchPlaced == 1)
  789.                     {
  790.                         Console.WriteLine("----------------------");
  791.                         Console.WriteLine("You see " + word + animals);
  792.                     }
  793.                     else
  794.                     {
  795.                         if (torchPlaced == 0)
  796.                         {
  797.                             Console.WriteLine("It is too dark to see!");
  798.                         }
  799.                     }
  800.                 }
  801.             }
  802.             if (answer == "2")
  803.             {
  804.                 torchPlaced = 0;
  805.                 if (biome == " forest" | biome == " plain" | biome == " jungle")
  806.                 {
  807.                     lootCalculation();
  808.                     Console.WriteLine("----------------------");
  809.                     Console.WriteLine("Attacking...");
  810.                     if (animals == "")
  811.                     {
  812.                         int TempKillTime;
  813.                         TempKillTime = KillTime;
  814.                         KillTime = 0;
  815.                         Console.WriteLine("------------------------------------------------------------");
  816.                         Console.WriteLine("You didnt discover any animals here yet! Try looking around!");
  817.                         KillTime = TempKillTime;
  818.                     }
  819.                     else
  820.                     {
  821.                         System.Threading.Thread.Sleep(KillTime);
  822.                         AnimalLoot();
  823.                         Hunger();
  824.                     }
  825.                 }
  826.                 else
  827.                 {
  828.                     int TempKillTime = 0;
  829.                     TempKillTime = KillTime;
  830.                     KillTime = 0;
  831.                     Console.WriteLine("----------------------");
  832.                     Console.WriteLine("There are no useful animals around!");
  833.                     KillTime = TempKillTime;
  834.                 }
  835.             }
  836.             if (answer == "3" | answer == "4" | answer == "5" | answer == "6")
  837.             {
  838.                 torchPlaced = 0;
  839.                 Console.WriteLine("Travelling...");
  840.                 TravelTimeProtection();
  841.                 System.Threading.Thread.Sleep(TravelTime);              
  842.                 GetBiomeNumber();
  843.                 GetBiome();
  844.                 Console.WriteLine("-----------------------------------");
  845.                 Console.WriteLine("You moved to a" + biome + ". ");
  846.                 GetVilllage();
  847.                 Hunger();
  848.             }
  849.             if (answer == "7")
  850.             {
  851.                 VillageLootCalculation();
  852.             }
  853.             if (answer == "8")
  854.             {
  855.                 Eat();
  856.             }
  857.             if (answer == "9")
  858.             {
  859.                 caveLoot();
  860.             }
  861.             if (answer == "10")
  862.             {
  863.                 PlaceTorch();
  864.             }
  865.             if (answer == "11")
  866.             {
  867.                 MakeTorch();
  868.             }
  869.             if (answer == "12")
  870.             {
  871.                 RemoveTrees();
  872.             }
  873.             if (answer == "13")
  874.             {
  875.                 showInventory();
  876.             }
  877.             if (answeraddition == " and a caravan...")
  878.             {
  879.                 if (answer == "14")
  880.                 {
  881.                     RobCaravan();
  882.                 }
  883.             }
  884.             else
  885.             {
  886.  
  887.             }
  888.             if (answer == "/gamemode creative")
  889.             {
  890.                 hunger = 21474836;
  891.                 hungerLimit = 21474836;
  892.                 health = 21474836;
  893.                 healthLimit = 21474836;
  894.                 KillTime = 500;
  895.                 TravelTime = 500;
  896.                 secretIngredient = 4;
  897.                 Console.WriteLine("----------------------------");
  898.                 Console.WriteLine("YOU ARE NOW IN CREATIVE MODE");
  899.             }
  900.             if (answer == "/gamemode survival")
  901.             {
  902.                 hunger = 10;
  903.                 hungerLimit = 10;
  904.                 health = 10;
  905.                 healthLimit = 10;
  906.                 KillTime = 5000;
  907.                 TravelTime = 7000;
  908.                 secretIngredient = 3;
  909.                 Console.WriteLine("----------------------------");
  910.                 Console.WriteLine("YOU ARE NOW IN SURVIVAL MODE");
  911.             }
  912.         }
  913.     }            
  914. }
  915. //vk.com/dandelay
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement