// gives the player ability point(s)
        public static void awardAbilityPoint(int amount)
        {
            // if the user has special effects enabled
            if (Character.Settings["SpecialEffects"])
            {
                // if the user has dark theme enabled
                if (Character.Settings["ColourTheme"] == "dark")
                {
                    Console.ForegroundColor = ConsoleColor.Cyan; // set the text colour to cyan
                }
                // if the user has light theme enabled (ew gay)
                else if (Character.Settings["ColourTheme"] == "light")
                {
                    Console.ForegroundColor = ConsoleColor.DarkCyan; // set the text colour to dark cyan
                }
            }

            // if the amount added is > 1
            if (amount > 1)
            {
                Console.WriteLine("+ " + amount.ToString() + " Ability Points\n"); // plural
            }
            else // else
            {
                Console.WriteLine("+ " + amount.ToString() + " Ability Point\n"); // singular
            }
            // Adding the ability points to the character
            Character.abilityPoints += amount;

            // Reverting text colour to original
            EOA.revertColourScheme();

            // Sleeping as there may be a Console.Clear after
            Thread.Sleep(1000);
        }
        // awards magika to the player
        public static void addMagika(int amount)
        {
            // if the user has special effects enabled
            if (Character.Settings["SpecialEffects"])
            {
                // if the user has dark theme
                if (Character.Settings["ColourTheme"] == "dark")
                {
                    Console.ForegroundColor = ConsoleColor.Blue; // set text colour to blue
                }
                // if the user has light theme (ew gay)
                else if (Character.Settings["ColourTheme"] == "light")
                {
                    Console.ForegroundColor = ConsoleColor.DarkBlue; // set text colour to dark blue
                }
            }

            // Printing the amount of magika added
            Console.WriteLine("+ " + amount.ToString() + " Magika\n");

            // Adding to the max amount of magika
            Character.magika["max"] += amount;

            // Changing text colour back to the original
            EOA.revertColourScheme();

            // Sleeping because a Console.Clear may follow
            Thread.Sleep(1000);
        }
        // awards ethyrl to the player
        public static void awardEthryl(int amount)
        {
            bool sign = amount > 0;

            // If the user has special effects enabled
            EOA.ChangeToEffects(new ConsoleColor[] { ConsoleColor.Magenta, ConsoleColor.DarkMagenta });

            // Printing text feedback
            if (sign)
            {
                Console.WriteLine("+ " + amount.ToString() + " Ethryl\n");
            }
            else if (!sign)
            {
                Console.WriteLine("- " + (amount * -1).ToString() + " Ethryl\n");
            }

            // Adding the ethryl to the player
            Character.ethryl += amount;

            // Setting the foreground colour back to the default
            EOA.revertColourScheme();

            // Wait a bit (because why not) (and also incase a Console.Clear() is directly after this.)
            Thread.Sleep(1000);
        }
Пример #4
0
        public static void subtractHealth(int amount)
        {
            Character.health["max"] -= amount;
            // If the user has special effects enabled
            EOA.ChangeToEffects(new ConsoleColor[] { ConsoleColor.Red, ConsoleColor.DarkRed });

            Console.WriteLine($"- {0} health!", amount.ToString());

            // Setting the foreground colour back to the default
            EOA.revertColourScheme();

            // Wait a bit (because why not) (and also incase a Console.Clear() is directly after this.)
            Thread.Sleep(1000);
        }
 //Play a morbid death speel and end the game
 public static void death(string reason)
 {
     //Slow things down so the death speel is more creepy
     Character.Settings["SpeechSpeed"] = 2;
     CharacterDeath.Speel(reason);
     showCharInfoGUI();
     EOA.pressAnyKeyToContinue();
     if (CharacterDeath.lastCheckpoint())
     {
         CharacterDeath.resetStats();                 // reset character
         ast.start.Menu start = new ast.start.Menu(); //initialise new menu
         start.menuSeq();                             // restart
     }
     else
     {
         new ast.story().Run();
     }
 }
        // award experience points
        public static void awardXP(int amount)
        {
            //making sure maxXP is up to date
            maxXP = (level + 1) * 100;

            // If user has special effects enabled
            if (Character.Settings["SpecialEffects"])
            {
                // If the user has dark theme
                if (Character.Settings["ColourTheme"] == "dark")
                {
                    Console.ForegroundColor = ConsoleColor.Yellow; // Setting the text colour to yellow
                }
                // If the use has ligth theme
                else if (Character.Settings["ColourTheme"] == "light")
                {
                    Console.ForegroundColor = ConsoleColor.DarkYellow; // Setting the text colour to dark yellow
                }
            }

            // If the player has reached max xp current level
            if (currentXP + amount >= maxXP)
            {
                level++;                     // Adding to the level
                currentXP += amount - maxXP; // Current XP gets what is left over after leveling up
                // Printing that you leveled up and more data about levels
                Console.WriteLine("+ " + amount.ToString() + " XP \nYou leveled up to level " + level.ToString() + "!\n(" + currentXP.ToString() + "/" + maxXP.ToString() + " needed to gain the next level.\n)");
            }
            else // If the player didn't level up
            {
                currentXP += amount; // adding amount to currentXP
                // Printing data about levels and XP
                Console.WriteLine("+ " + amount.ToString() + " XP (" + currentXP.ToString() + "/" + maxXP.ToString() + ")\n");
            }

            // revert back to normal colours
            EOA.revertColourScheme();

            // Make sure maxxp is up to date, again
            maxXP = (level + 1) * 100;

            // Waiting just incase a Console.Clear follows
            Thread.Sleep(1000);
        }
            // Checking if user wishes to go to last checkpoint
            internal static bool lastCheckpoint()
            {
                while (1 != 0)
                {
                    EOA.wd("Do you wish to restart from the previous checkpoint?\n> ", true);
                    switch ((Console.ReadLine().ToUpper() + " ").Substring(0, 1))
                    {
                    case "Y":
                        return(false);

                    case "N":
                        return(true);

                    default:
                        Console.WriteLine("That is not an option!");
                        break;
                    }
                }
                throw new NotImplementedException();
            }
 internal static void Speel(string reason)
 {
     //Morbid death speel about the relativity of reality
     EOA.wd("Your eyes fall dark, and your eyelids grow heavy.");
     EOA.wd("Though not much can be said about the darkness,");
     EOA.wd("It does not exist anyway.");
     EOA.wd("Anymore at least.");
     EOA.wd("Not for you, at least.");
     EOA.wd("Others still breathe.");
     EOA.wd("Their hearts still pump.");
     EOA.wd("Their bodies tirelessly work for the same thing.");
     EOA.wd("To live.");
     EOA.wd("But for you, your body turns still.");
     EOA.wd("What is reality, if one cannot sense it?");
     EOA.wd("What can be so real if all is so abstract?");
     EOA.wd("Mortality is so literal.");
     EOA.wd("What is reality?");
     EOA.wd("What is consciousness?");
     EOA.wd("What is the meaning of it all?");
     EOA.wd("...");
     EOA.wd("Everything falls silent.");
     EOA.wd("But nothing falls silent, because, well, silence does not exist.");
     EOA.wd("For you anyway.");
     EOA.wd("You have moven on past reality.");
     EOA.wd("Almost.");
     EOA.wd("Yet, well, reality can't possibly exist anymore. At least for the souls of the deceased.");
     EOA.wd("Or could it?");
     EOA.wd("A final beat.");
     EOA.wd("A final thought.");
     Thread.Sleep(5000);
     EOA.wd("You surrender to the void.");
     EOA.pressAnyKeyToContinue();
     Character.Settings["SpeechSpeed"] = 4;
     EOA.wd($"{Character.name} died with a level of {Character.level} because {reason}.");
     EOA.wd($"A document was left in {Character.name}'s pocket.");
 }