コード例 #1
0
        private void Event()// determines where you go
        {
            Random random      = new Random();
            int    eventChance = random.Next(1, 101); //1-101

            //eventChance = 52; //determinism used to test specific events
            if (eventChance <= 65) // triggers maintence issues, some dangerous
            {
                Console.Clear();
                if (eventChance <= 20)//20%
                {
                    Console.WriteLine("You found a very soft pocket of material and went double the speed you expected");
                    DrillDown(20);
                    Thread.Sleep(4_000);
                }
                else if (eventChance <= 50)//30%
                {
                    Console.WriteLine("The engines have stopped.\n\nYou will have to send someone out to repair them.\n\nBe warned it is dangerous out there.\n\n");
                    RepairEngines();
                    Thread.Sleep(4_000);
                }
                else if (eventChance <= 55) //5%
                {
                    Console.WriteLine("You hear the whistle of escaping steam but it is too late a pipe bursts.\n");
                    int i = RandomCrewPerson();
                    CrewPeople[i].Injury();
                    if (CrewPeople[i].Chances == 0)
                    {
                        CrewPeople[i].Death();
                        Console.WriteLine($"{CrewPeople[i].FirstName} died from their injuries");
                        Sounds.DeathScream();
                    }
                    else
                    {
                        Console.WriteLine($"{CrewPeople[i].FirstName} was hit by the blast.\n\nLuckily it wasn't deadly.");
                    }
                    DrillDown();
                    Debug.WriteLine($"{CrewPeople[i].FirstName} is {CrewPeople[i].Dead}");
                    Thread.Sleep(3_000);
                }
                else if (eventChance <= 60) //5%
                {
                    Console.WriteLine("Odd. It felt like you went nowhere. Try digging again.");
                    Thread.Sleep(4_000);
                }
                else if (eventChance <= 65)//5%
                {
                    Console.WriteLine($"You found a way to boost the drill sytem.");
                    DrillDamage(-10);
                    Thread.Sleep(4_000);
                }
                else//0%
                {
                    Console.WriteLine("All operations normal");
                    DrillDown();
                    Thread.Sleep(4_000);
                }
            }
            if (Depth <= 100 && eventChance > 65) // triggers crust level scenarios
            {
                if (!VistedLostCity)
                {
                    if (eventChance > 65 && eventChance <= 85)//Archaeologist
                    {
                        Coloring.LostCityColor();
                        Texts.LostCityText(HaveTrait("Archaeologist"));
                        if (HaveTrait("Archaeologist"))
                        {
                            DrillDamage(-20);
                            DrillDown(40);
                            VistedLostCity = true;
                        }
                        else if (!HaveTrait("Archaeologist"))
                        {
                            DrillDamage(20);
                            DrillDown(20);
                            VistedLostCity = true;
                        }
                    }
                }
                else
                {
                    DrillDown();
                }

                if (!VistedTardisCave)
                {
                    if (eventChance > 85)// doctor
                    {
                        Coloring.TardisCaveColor();
                        Texts.TardisCaveText(HaveTrait("Doctor"));
                        if (HaveTrait("Doctor"))
                        {
                            for (int i = 0; i < CrewPeople.Count; i++)
                            {
                                if (CrewPeople[i].Trait == "Doctor")
                                {
                                    CrewPeople[i].Death();
                                }
                            }
                            DrillDown(60);
                            VistedTardisCave = true;
                        }
                        else if (!HaveTrait("Doctor"))
                        {
                            DrillDown(40);
                            VistedTardisCave = true;
                        }
                    }
                }
                else
                {
                    DrillDown();
                }
            }
            else if (Depth <= 300 && eventChance >= 65) // triggers mantle level scenarios
            {
                if (!VistedCoreMantel)
                {
                    if (eventChance > 65 && eventChance < 77) //geologist
                    {
                        Console.Clear();                      //no custom color for this event
                        Texts.MagmaFlowText(HaveTrait("Geologist"));
                        if (HaveTrait("Geologist"))
                        {
                            DrillDown(150);
                            DrillDamage();
                            VistedCoreMantel = true;
                        }
                        else if (!HaveTrait("Geologist"))
                        {
                            DrillDown(50);
                            DrillDamage(30);
                            VistedCoreMantel = true;
                        }
                    }
                }
                else
                {
                    DrillDown();
                }

                if (!VistedSatan)
                {
                    if (eventChance >= 77 && eventChance <= 88)// priest
                    {
                        Coloring.HeySatanColor();
                        Texts.HeySatanText(HaveTrait("Priest"));
                        if (HaveTrait("Priest"))
                        {
                            DrillDown(50);
                            VistedSatan = true;
                        }
                        else if (!HaveTrait("Priest"))
                        {
                            DrillDamage(30);
                            VistedSatan = true;
                        }
                    }
                }
                else
                {
                    DrillDown();
                }

                if (!VistedDinoDNA)
                {
                    if (eventChance > 88)// dinos
                    {
                        Coloring.DinosaursColor();
                        Texts.DinosaursText(HaveTrait("Paleontologist"));
                        if (HaveTrait("Paleontologist"))
                        {
                            for (int i = 0; i < CrewPeople.Count; i++)
                            {
                                if (CrewPeople[i].Trait == "Paleontologist")
                                {
                                    Sounds.DeathScream();
                                    CrewPeople[i].Death();
                                }
                            }
                            VistedDinoDNA = true;
                        }
                        else if (!HaveTrait("Paleontologist"))
                        {
                            for (int i = 0; i < CrewPeople.Count; i++)
                            {
                                if (CrewPeople[i].Chances == 1 && !CrewPeople[i].Dead)
                                {
                                    CrewPeople[i].Injury(-1);
                                }
                            }
                            DrillDown(20);
                            VistedDinoDNA = true;
                        }
                    }
                }
                else
                {
                    DrillDown();
                }
            }
            else if (Depth > 300 && eventChance >= 65) // triggers core level scenarios
            {
                if (!VistedCthulu)
                {
                    if (eventChance > 65 && eventChance <= 85)//Cthulu
                    {
                        Coloring.HeyCthulhuColor();
                        Texts.HeyCthulhuText(HaveTrait("Priest"));
                        if (HaveTrait("Priest"))
                        {
                            Coloring.YouFreakingSummonedCthulhuColor();
                            Texts.YouFreakingSummonedCthulhuEnding();
                            VistedCthulu = true;
                        }
                        else if (!HaveTrait("Priest"))
                        {
                            DrillDown(40);
                            VistedCthulu = true;
                        }
                    }
                }
                else
                {
                    DrillDown();
                }

                if (!VistedLizardPeeps)
                {
                    if (eventChance > 85) // Lizard Peeps
                    {
                        Coloring.HeyLizardPeepsColor();
                        Texts.HeyLizardPeepsText(HaveTrait("Mechanist"));
                        if (HaveTrait("Mechanist"))
                        {
                            Texts.BowToTheRobotsIMeanLizardsEnding();
                            VistedLizardPeeps = true;
                        }
                        else if (!HaveTrait("Mechanist"))
                        {
                            DrillDown(50);
                            DrillDamage(50);
                            VistedLizardPeeps = true;
                        }
                    }
                }
                else
                {
                    DrillDown();
                }
            }
        }
コード例 #2
0
 private void CrewStatus()// displayed on main screen
 {
     if (Health <= 0)
     {
         if (HaveTrait("Brave"))
         {
             for (int i = 0; i < CrewPeople.Count; i++)
             {
                 if (CrewPeople[i].Trait == "Brave")
                 {
                     Console.WriteLine($"{CrewPeople[i].FirstName} sacrifices themselves to perform a last minute fix.\n\n" +
                                       $"The drill manages to not explode.\n\n" +
                                       $"Their bravery will hopefully live on through us.");
                     DrillDamage(-30);
                     Sounds.DeathScream();
                     CrewPeople[i].Death();
                     Thread.Sleep(5_000);
                     Console.Clear();
                 }
             }
         }
         else
         {
             Texts.DrillHealthDepletedEnding();
             Sounds.DeathScream();
         }
     }
     else if (AreAllDeadValidation())
     {
         Coloring.CrewAllDeadColor();
         Texts.CrewAllDeadEnding();
     }
     else if (Depth > 490)
     {
         Coloring.AtTheCenterColor();
         Texts.AtTheCenterEnding();
     }
     Console.Clear();
     Console.WriteLine($"{Player.FirstName} \"The {Player.Trait}\" {Player.LastName}\n");
     Texts.DrillApperanceText(this.Health);
     Texts.KitInventoryText(this.HealKits, this.RepairKits);
     for (int i = 0; i < CrewSize - 1; i++)
     {
         char healthSymbol = '*';
         if (CrewPeople[i].Chances > 1)
         {
             healthSymbol = ')';
         }
         else if (CrewPeople[i].Chances == 1)
         {
             healthSymbol = '(';
         }
         else if (CrewPeople[i].Chances < 1)
         {
             CrewPeople[i].Death();
             healthSymbol = 'X';
         }
         Console.WriteLine($"{i + 1}. :{healthSymbol} - {CrewPeople[i].FirstName} \"The {CrewPeople[i].Trait}\" {CrewPeople[i].LastName}\n");
     }
     Console.WriteLine($"To drill down press the \"d\" key\n" +
                       $"To heal push \"s\"\n" +
                       $"To fix the drill push \"f\"\n");
 }