Beispiel #1
0
        private void CollectionPlate()
        {
            if (Isgoldthere && !MainPlayer.CheckItem("Cross"))
            {
                Console.WriteLine(@"There is a collection plate with 5 gold pieces on it:
To steal the gold enter S
To return enter R
");

                while (PlayerInput != "S" && PlayerInput != "R")
                {
                    PlayerInput = FilterInput(Console.ReadLine());
                }

                if (PlayerInput == "S")
                {
                    MainPlayer.AddGold(5);
                    Isgoldthere = false;
                    Console.WriteLine("Press enter to continue");
                    Console.Read();
                }
            }
            else if (!Isgoldthere)
            {
                Console.WriteLine(@"You have already taken the gold

Press enter to continue
");
                Console.Read();
            }
            else
            {
                Console.WriteLine(@"As a member of the church you are happy to see 5 gold on the donation plate.

Press enter to contine");
                Console.Read();
            }

            BrokenFace();
        }
Beispiel #2
0
        private void Battle()
        {
            Gardener.HP -= MainPlayer.Attack;

            if (Gardener.HP > 0)
            {
                Console.WriteLine($@"


You attack the Gardener.
Gardener HP -{MainPlayer.Attack} 
New Gardener HP:{Gardener.HP}/{Gardener.MaxHP}

The Gardener attacks you.");
                if (MainPlayer.CheckItem("Armour"))
                {
                    Console.WriteLine("Your HP -{ Gardener.Attack/2} ");
                    MainPlayer.ReduceHealth(Gardener.Attack / 2);
                }
                else
                {
                    Console.WriteLine("Your HP -{ Gardener.Attack} ");
                    MainPlayer.ReduceHealth(Gardener.Attack);
                }


                if (Gardener.HP < 100 && Gardener.NumPotions > 0)
                {
                    Console.WriteLine("Gardener uses a health potion.");
                    Gardener.NumPotions -= 1;
                    Gardener.HP         += 50;
                    Console.WriteLine($"Gardener HP:{Gardener.HP}/{Gardener.MaxHP}");
                }
            }
            else
            {
                Console.WriteLine($@"


You attack the Gardener.
The Gardener is defeated!!");
                if (GardenerHasKey)
                {
                    GardenerHasKey = false;
                    MainPlayer.NewItem("Castle Key");
                    Console.WriteLine("You find the Castle Door key in the Gardeners coat pocket.");
                }

                Console.WriteLine();
                Console.WriteLine("Press enter to return to the castle door.");
                Gardener.Alive = false;
                Console.Read();
                MainPlayer.Place = "CastleDoor";
            }


            if (MainPlayer.Alive == true && Gardener.Alive == true)
            {
                Console.WriteLine(@"To attack again enter A
To run away to the Castle Door enter C");

                string PlayerInput = " ";
                while (PlayerInput != "A" && PlayerInput != "C")
                {
                    PlayerInput = FilterInput(Console.ReadLine());
                }

                switch (PlayerInput)
                {
                case "C":
                    MainPlayer.Place = "CastleDoor";
                    break;

                case "A":
                    Battle();
                    break;
                }
            }
        }
Beispiel #3
0
        private void FaceBrokenTrue()
        {
            int SwordCost;


            if (MainPlayer.CheckItem("Letter from the Tavern"))
            {
                Letter();
            }

            if (MainPlayer.CheckItem("Badge from Weapon Merchant"))
            {
                SwordCost = 10;
            }
            else
            {
                SwordCost = 100;
            }



            Console.WriteLine($@"

""Would you like to buy any weapons sir?
We have an excellent sword with an attack power of 40.
For you the price will be only {SwordCost} gold!!""
Enter B to buy
Enter R to return
");
            string PlayerInput = " ";

            while (PlayerInput != "B" && PlayerInput != "R")
            {
                PlayerInput = FilterInput(Console.ReadLine());
            }

            switch (PlayerInput)
            {
            case "B":
                if (MainPlayer.Gold >= SwordCost)
                {
                    MainPlayer.Gold  -= SwordCost;
                    MainPlayer.Sword += 40;
                    MainPlayer.NewItem("Sword");
                    MainPlayer.Attack = MainPlayer.Attack;     //updates attack
                    Console.WriteLine(@"""I hope this sword brings you luck""

press enter to return to the village");
                    Console.Read();
                }
                else
                {
                    Console.WriteLine("You do not have the required funds");
                    Console.WriteLine("Press enter to return to the vilage");
                    Console.Read();
                }

                MainPlayer.Place = "Village";
                break;

            case "R":
                break;
            }
        }
Beispiel #4
0
        private void Battle()
        {
            King.HP -= MainPlayer.Attack;

            if (King.HP > 0)
            {
                Console.WriteLine($@"


You attack the King.
King's HP -{MainPlayer.Attack} 
New King's HP:{King.HP}/{King.MaxHP}

The King attacks you.");
                if (MainPlayer.CheckItem("Armour"))
                {
                    Console.WriteLine($"Your HP - {King.Attack / 2}");
                    MainPlayer.ReduceHealth(King.Attack / 2);
                }
                else
                {
                    Console.WriteLine("Your HP -{ King.Attack} ");
                    MainPlayer.ReduceHealth(King.Attack);
                }
                if (King.HP < 20 && King.NumPotions > 0)
                {
                    Console.WriteLine();
                    Console.WriteLine("The king uses a health potion");
                    King.HP += 50;
                    Console.WriteLine($"King's HP:{King.HP}/{King.MaxHP}");
                }
            }
            else
            {
                Console.WriteLine($@"


You attack the King.
The King is defeated!!

Your quest is fulfilled and you never forgot what has happened. 


Press enter to end the game.");
                MainPlayer.Won = true;
                King.Alive     = false;
                Console.Read();
            }


            if (MainPlayer.Alive == true && King.Alive == true)
            {
                Console.WriteLine(@"To attack again enter A");

                string PlayerInput = " ";
                while (PlayerInput != "A")
                {
                    PlayerInput = FilterInput(Console.ReadLine());
                }

                Battle();
            }
        }
Beispiel #5
0
        private void Bar()
        {
            String PlayerInput = " ";

            while (PlayerInput != "D" && PlayerInput != "E" && PlayerInput != "R" && PlayerInput != "W")
            {
                PlayerInput = FilterInput(Console.ReadLine());
            }

            Console.WriteLine(@"

                                ");
            switch (PlayerInput)
            {
            case "D":

                Console.WriteLine(@"The pirates are constantly speaking about their treasure.
Problem is they would never tell you where it is.
Maybe if you sit on an empty table nearby you might overhear them talking.");
                SpokenAboutGold = true;
                Bar();

                break;

            case "E":
                if (!MainPlayer.CheckItem("Sword"))
                {
                    Console.WriteLine(@"Talk to me about improving your health once you have a sword.
Our top priority is for you to be able to attack the king and you can’t do that without a sword!!");
                }
                else if (HasPotion && !MainPlayer.CheckItem("Cross"))
                {
                    Console.WriteLine(@"I have one potion left. It will give you restore 50HP.
I will sell you it for only 5 gold. That’s less than I paid for it!!

Enter B to buy
Enter R to not buy");

                    while (PlayerInput != "B" && PlayerInput != "R")
                    {
                        PlayerInput = FilterInput(Console.ReadLine());
                    }

                    Console.WriteLine(@"

                                            ");
                    if (PlayerInput == "B")
                    {
                        if (MainPlayer.Gold >= 5)
                        {
                            MainPlayer.Gold       -= 5;
                            MainPlayer.NumPotions += 1;
                            Console.WriteLine("I hope this potion is useful to your quest");
                        }
                        else
                        {
                            Console.WriteLine("You don’t have the required funds");
                        }
                    }
                }
                else if (!HasPotion)
                {
                    Console.WriteLine("I unfortunately don’t have any other potions to sell you.");
                }
                else
                {
                    Console.WriteLine(@"You have all the health you could need as a member of the clergy.
I couldn’t give you anything that would help you anymore than you have already been helped.
With god on your side I’m sure your health will always be the best.");
                }

                Bar();

                break;

            case "W":

                if (MainPlayer.CheckItem("Sword"))
                {
                    Console.WriteLine(@"Well done on buying the sword. Now you can show the king whose boss!");
                }
                else if (MainPlayer.CheckItem("Badge from Weapon Merchant"))
                {
                    Console.WriteLine(@"I see you gave the letter to the Weapon Merchant.
I hope you can afford a sword now.");
                }
                else if (MainPlayer.CheckItem("Letter from the Tavern"))
                {
                    Console.WriteLine("Take the letter I gave you to the Weapon Merchant");
                }
                else
                {
                    Console.WriteLine(@"The Weapon Merchant should be able to sell you a sword.
However his prices are very high. 
Please take this letter to him.
It explains that you need a weapon to defeat the king.
He should lower the price he sells you the sword for.
");
                    MainPlayer.NewItem("Letter from the Tavern");
                }
                Bar();

                break;

            case "R":
                break;
            }
        }