Пример #1
0
        public static void Story()
        {
            Console.WriteLine("You find yourself awakening in an unfamiliar location, drowsy and disoriented.  You're in what appears to be a once-fine tavern that has gone to disrepair.  \n");
            Console.WriteLine("There are no patrons, and the fire is unlit. You are sitting hunched over in a corner table, with a decent view of the entire room. \n");
            Console.WriteLine("You can see that the door is hanging off it's hinges and there's no propieter in sight.  The whole room appears to be covered in a substantial layer of dust.  \n");
            Console.WriteLine("Oddly, you have what appears to be a clean glass full of ale on the table in front of you. In this game, you will be presented with 3 options for each action you may take.  Remember to choose wisely.");
            Console.WriteLine("You have three options you may take: \n1.) Drink from the glass, \n2.) Ignore the glass \n3.) Destroy the glass.");

            char choice  = UserInput.InputKey();
            char choice2 = ' ';
            char choice3 = ' ';

            if (choice == '1')
            {
                Console.WriteLine("As you bring the glass to your lips, you notice the ale has a strong, earthy scent.  It smells like ale, but not exactly like the ale you're used to.");
                Console.WriteLine("This is your first hint that wherever you are, it must not be anywhere near where you come from.  You shrug your shoulders slightly, deciding to let fate control your path.");
                Console.WriteLine("The ale's taste perfectly matches its scent, and the drink renews your body and helps you shake off the remaining traces of confusion from waking up in an empty and unfamiliar tavern.");
                Console.WriteLine("Since the first drink seemed to be nothing short of helpful, you decide to down the rest of the glass.  Just as you're wiping the foam from your lips, you hear a voice coming from nowhere.\n");
                Console.WriteLine($"\"Hello, {Game.player1.UserName}!  Allow me to be the first to welcome you to the wonderful land of Calden.  Well, I suppose I will be the only one to welcome you.");
                Console.WriteLine($"You see, my fledgeling {Game.player1.Class}, the people of Calden have fallen under a rather cruel curse.  This curse warps their minds and in some cases transforms their bodies.");
                Console.WriteLine($"It is my hope that you will save these people.  I would do it myself, but my rival is preventing me from intervening.  She's a powerful wizardess and the one who cast this curse.");
                Console.WriteLine("You will need to fight your way through the many guardians she has set around her castle, and then destroy her throne.  Only then will the curse be lifted.  I truly believe you can do this.");
                Console.WriteLine("If it feels like your agency has been taken from you, and you didn't ask for this quest, all I can do is apologize.  It wasn't my desire, but my only option.  You are all my people have.");
                Console.WriteLine("I will aid you in every way possible throughout your journey, but I will be limited in the ways I can assist.\"\n \n");
                Console.WriteLine("As the voice finishes speaking, you hear a commotion outside.  There appear to be two distinct voices arguing with each other, though you can't quite make out their words.");
                Console.WriteLine("Your options are:  \n1.) Investigate the commotion \n2.) Attempt to hide \n3.) Prepare for battle");
                choice2 = UserInput.InputKey();
            }


            else if (choice == '2')
            {
                Console.WriteLine("You choose to ignore the glass, distrustful of a drink you haven't seen prepared.  You glance around your surroundings, but you remain a bit disoriented.");
                Console.WriteLine("As you survey your surroundings, you rise from your seat.  You walk around the room, checking to see if there is anything of interest.");
                Console.WriteLine("After around a minute of exploring, you hear a disembodied voice speak to you from nowhere in particular.");
                Console.WriteLine($"\"Hello, {Game.player1.UserName}!  I had hoped you would accept my olive branch, but time has run out.  I must be brief, but allow me to summarize.  You are in the land of Calden.");
                Console.WriteLine("The people of Calden have fallen to a foul curse, and you are the only one who can save them.  Coincidentally, saving them is the only way to save yourself.  It's unfortunate but true.");
                Console.WriteLine("You must break into the castle outside of the town you are in and find the throne room.  You must then destroy the throne.  I will attempt to aid in any way I can, though it won't be much.");
                Console.WriteLine($"Right now, there are two bandits approaching this tavern.  They have been hired to kill you.  I suggest you kill them first.  I will talk to you more when I can.  Goodbye, fledgling {Game.player1.Class}\"");
                Console.WriteLine("Your options are:  \n1.) Investigate the commotion \n2.) Attempt to hide \n3.) Prepare for battle");
                choice2 = UserInput.InputKey();
            }

            else if (choice == '3')
            {
                Console.WriteLine("You pick up the glass, lobbing it across the room.  As the glass hits the wall, it explodes in a shower of glass shards and ale.");
                Console.WriteLine("As the ale runs down the wall, you hear a disembodied voice coming from nowhere you can tell.");
                Console.WriteLine("\"You should NOT have done that,\" the voice says.  \"I'm quite certain you will regret it.  I don't have the time to explain why at the moment, so you will have to take my word.");
                Console.WriteLine("There are two bandits outside this tavern that will be storming in at any moment.  I suggest you prepare yourself.  They will be here on strict orders to kill you.  I would help if I could.");
                Console.WriteLine("Unfortunately, I don't have the time to explain why that isn't possible.  All I can say is that if you want to go home you will need to fight your way into the castle outside of town.");
                Console.WriteLine("Once you're inside, find the throne room and destroy the throne.  We're out of time.  Prepare yourself!\"");
                Console.WriteLine("As the voice finishes speaking you hear two new voices coming from outside the tavern.  It appears the sound of you destroying the glass has alerted them to your location.");
                Console.WriteLine("Your options are:  \n1.) Investigate and attempt to talk to the men  \n2.) Attempt to hide \n3.) Prepare for battle");
                choice2 = UserInput.InputKey();
            }

            if (choice2 == '1')
            {
                Console.WriteLine("You have chosen to investigate the men outside the tavern.  As you walk toward the door, you focus your attention on being stealthy.");
                bool success = Game.player1.StealthCheck();
                if (success)
                {
                    choice3 = Part1StealthSuccess.Part1Success();
                }
                else
                {
                    choice3 = Part1StealthFailure.Part1Failure();
                }
            }
            if (choice2 == '2' || choice3 == '2')
            {
                Console.WriteLine("You've decided to hide in the tavern.  Maybe the people outside will just go away?");
                bool success = Game.player1.StealthCheck();
                if (success)
                {
                    choice3 = Part1StealthSuccess.Part2Success(choice2);
                }
                else
                {
                    choice3 = Part1StealthFailure.Part2Failure(choice2);
                }
            }
            if (choice2 == '3' || choice3 == '3')
            {
                Bandit bandit1 = new Bandit();
                Bandit bandit2 = new Bandit();
                if (Game.player1.Class == "fighter")
                {
                    Console.WriteLine("You draw your longsword in your dominant hand and your shortsword in the other.  You are ready to destroy anyone in your way.");
                    Console.WriteLine("As you prepare to do battle, you let your adrenaline start to build.  You become hyper-focused.");
                    Console.WriteLine("You let your battle cry leap from your lips with a fierce roar, preparing to challenge your enemies.");
                    Console.WriteLine("You are confronted with two men wielding some rather nasty looking crude cudgels.  When you battle, the game works a bit differently.");
                    Console.WriteLine("Each combatant has a chance to make a move one after the other.  You attack until you are dead or all of your enemies are.");
                    while (bandit1.Health > 0 && Game.player1.Health > 0)
                    {
                        Game.player1.DealDamage(bandit1);
                        if (bandit1.Health > 0)
                        {
                            int damage = bandit1.DealDamage();
                            Game.player1.TakeDamage(damage);
                        }
                        if (Game.player1.Health <= 0)
                        {
                            Game.EndGame();
                        }
                        Console.WriteLine("Press enter to continue.");
                        Console.ReadLine();
                    }
                }
                else if (Game.player1.Class == "barbarian")
                {
                    Console.WriteLine("You draw your axe in your dominant hand and your shield in the other.  You are ready to destroy anyone in your way.");
                    Console.WriteLine("As you prepare to do battle, you let the battle lust consume you.  You feel the fires of war course through your veins.");
                    Console.WriteLine("Your voice explodes from you in a wordless roar, as you prepare to crush your enemies.");
                    Console.WriteLine("You are confronted with two men wielding some rather nasty looking crude cudgels.  When you battle, the game works a bit differently.");
                    Console.WriteLine("Each combatant automatically makes a move one after the other.  You attack until you are dead or all of your enemies are.");
                    while (bandit1.Health > 0 && Game.player1.Health > 0)
                    {
                        Game.player1.DealDamage(bandit1);
                        if (bandit1.Health > 0)
                        {
                            int damage = bandit1.DealDamage();
                            Game.player1.TakeDamage(damage);
                        }
                        if (Game.player1.Health <= 0)
                        {
                            Game.EndGame();
                        }
                        Console.WriteLine("Press enter to continue.");
                        Console.ReadLine();
                    }
                }
                else if (Game.player1.Class == "wizard")
                {
                    Console.WriteLine("You open your arcane channels to the ethereal powers of creation, allowing it to flow through your veins.");
                    Console.WriteLine("AS you prepare for battle, you feel your focus reign in.  Nothing can stop the incredible powers you wield.");
                    Console.WriteLine("You choose not to let out a battle cry, as you are a person of culture.");
                    Console.WriteLine("You are confronted with two men wielding some rather nasty looking crude cudgels.  When you battle, the game works a bit differently.");
                    Console.WriteLine("You will be prompted to choose a spell or attack with a weapon.  Each combatant automatically attacks one after the other.");
                    Console.WriteLine("You attack until you are dead or all of your enemies are.");
                    while (bandit1.Health > 0 && Game.player1.Health > 0)
                    {
                        Game.player1.DealDamage(bandit1);
                        if (bandit1.Health > 0)
                        {
                            int damage = bandit1.DealDamage();
                            Game.player1.TakeDamage(damage);
                        }
                        if (Game.player1.Health <= 0)
                        {
                            Game.EndGame();
                        }
                        Console.WriteLine("Press enter to continue.");
                        Console.ReadLine();
                    }
                }
            }


            Console.ReadLine();
        }
        public CharacterData CreateCharacter()
        {
            //create variables to hold user data
            int userAge;

            Console.WriteLine(@"|`-._/\_.-`|   _____                _                                __    _____      _     _                /\    ");
            Console.WriteLine(@"|    ||    |  / ____|              | |                              / _|  / ____|    | |   | |               ||    ");
            Console.WriteLine(@"|___o()o___| | |     _ __ ___  __ _| |_ _   _ _ __ ___  ___    ___ | |_  | |     __ _| | __| | ___ _ __      ||    ");
            Console.WriteLine(@"|__((<>))__| | |    | '__/ _ \/ _` | __| | | | '__/ _ \/ __|  / _ \|  _| | |    / _` | |/ _` |/ _ \ '_ \     ||    ");
            Console.WriteLine(@"\   o\/o   / | |____| | |  __/ (_| | |_| |_| | | |  __/\__ \ | (_) | |   | |___| (_| | | (_| |  __/ | | | ()====() ");
            Console.WriteLine(@" \        /   \_____|_|  \___|\__,_|\__|\__,_|_|  \___||___/  \___/|_|    \_____\__,_|_|\__,_|\___|_| |_|    ||    ");
            Console.WriteLine(@"  \______/                                                                                                   ()    ");
            Console.WriteLine("\n \n \n");



            //prints opening message
            Console.WriteLine("Welcome to the world.");
            Console.WriteLine("Please input your user name.");

            //write user name to screen
            string userName = UserInput.Input();

            Console.WriteLine($"Hello, {userName}");

            //obtains user age
            Console.WriteLine("Please input your age.");
            userAge = int.Parse(UserInput.Input());

            //closes the app if user is underage.
            if (userAge < 18)
            {
                System.Environment.Exit(0);
            }

            //introduces the user to the world
            Console.WriteLine("We're glad to see that you meet our age requirements.  Prepare to be immersed in a world of danger and violence.");
            Console.WriteLine("In the world of Calden, there are many dangerous creatures.  Many of them will be too strong for you to defeat early on.");
            Console.WriteLine("Throughout this game, you will be presented with different choices based on any given situation.  Your choices will affect what happens to you.");
            Console.WriteLine("Press any key to continue.");
            Console.ReadLine();
            Console.WriteLine("If your health reaches 0, you will die, and the game will end.  There are a few ways you can restore health as you progress through the game");
            Console.WriteLine("Drinking a potion will restore a set amount of health based on the type of potion.  Sleeping will restore you to full health.  Some items will also restore you to full health.");

            //determine the class the user wishes to play
            Console.WriteLine("Please choose a class for your adventure");
            Console.WriteLine("Your options are as follows:");
            Console.WriteLine("Rogue, Wizard, Barbarian, Fighter, Monk");
            char classChoice = UserInput.InputKey();

            Console.WriteLine("");
            string userClass = "";


            //close application if user chooses monk
            if (classChoice == 'm')
            {
                Console.WriteLine("Rocks Fall.  Everyone Dies.");
                System.Environment.Exit(0);
                Console.ReadLine();
            }



            else if (classChoice == 'r')
            {
                userClass = "rogue";
                Console.WriteLine("Rogues start with two knives and a crossbow.");
                Console.WriteLine("Rogues can wear light or medium armor.");
                Console.WriteLine("At first level, rogues can sneak attack and disengage. \n");
                Console.WriteLine("Press any key to continue.");
            }

            else if (classChoice == 'w')
            {
                userClass = "wizard";
                Console.WriteLine("Wizards start with a pouch of spell components, a spellbook, and a knife.");
                Console.WriteLine("Wizards are not permitted to wear any armor per the Rialto Concord.");
                Console.WriteLine("Wizards know three basic spells at Level 1 and learn more as they progress.");
                Console.WriteLine("At Level 1, all wizards know the magic bolt, summon fire, and telekinesis spells.");
                Console.WriteLine("To access your spellbook, simply type \"s\" when prompted. \n");
                Console.WriteLine("Press any key to continue.");
            }
            else if (classChoice == 'b')
            {
                userClass = "barbarian";
                Console.WriteLine("Barbarians start with an axe and a wooden shield.");
                Console.WriteLine("Barbarians are tough, and thus cannot wear armor, or their family will disown them.");
                Console.WriteLine("At first level, barbarians can entle bloodlust twice a day. \n");
                Console.WriteLine("Press any key to continue.");
            }
            else if (classChoice == 'f')
            {
                userClass = "fighter";
                Console.WriteLine("Fighters start with a longsword, a shortsword, and rusty armor.");
                Console.WriteLine("Fighters can wear any armor, as long they have a sufficient strength score. \n");
                Console.WriteLine("Press any key to continue.");
            }
            else
            {
                Console.WriteLine("It looks like you mistyped.  Please Try again.");
            }
            CharacterData newCharacter = new CharacterData(userClass);



            //This will make sure the app stays open
            Console.ReadKey();
            return(newCharacter);
        }