Exemple #1
0
        public static void TalkCases()
        {
            string input = Console.ReadLine().ToLower();

            switch (input)
            {
            case "y":
            case "yes":
                Console.WriteLine("Excellent, my mighty warrior. Go now and fulfill your fate on the darkest path in the north!");
                break;

            case "n":
            case "no":
                Console.WriteLine("Ohhh little one! You might want to go back and equip yourself to be the strongest monster slayer ever...");
                break;

            case "q":
            case "quit":
                MethodStore.QuitGame();
                break;

            default:
                Console.WriteLine("I'm sorry little one... I could not understand you. Please try again and answer with [yes/y] or [no/n].");
                TalkCases();
                break;
            }
        }
Exemple #2
0
            public static void Fight(Character enemy, string[] input)
            {
                Character godess = Characters["Godess of the forest"];

                input = MethodStore.Words;
                enemy = MethodStore.Enemy;
                switch (input[0])
                {
                case "f":
                case "fight":
                    enemy.Lifepoints = (float)(Math.Round((enemy.Lifepoints - godess.Hitpoints), 2));
                    if (enemy.Lifepoints > 0F)
                    {
                        Console.WriteLine("Woooo!!!" + Environment.NewLine + "Damn! The " + enemy.Name + "'s still alive...He still has got " + enemy.Lifepoints + " lifepoints.");
                        godess.Lifepoints = (float)(Math.Round((godess.Lifepoints - MethodStore.Enemy.Hitpoints), 2));

                        if (godess.Lifepoints > 0F)
                        {
                            Console.WriteLine("You're getting hit!" + Environment.NewLine + "Oouuuch! Augh!!! Oh, you dirty creature! I'm gonna finish you on the spot!" + Environment.NewLine + "You've got " + godess.Lifepoints + " lifepoints left. Fight him 'till the end!");
                        }
                        else
                        {
                            Console.WriteLine("NOOOOOOOO! How could you! Now you're dead! Stupid! Try this game again...");
                            MethodStore.QuitGame();
                        }
                        MethodStore.InputPrompt();
                    }
                    else
                    {
                        Console.WriteLine("Wahhh! Nooo!!!" + Environment.NewLine + "Congratulations, great adventurer! You slayed the " + enemy.Name + "! Awesome!");
                        if (enemy.CharacterInventory.Count != 0)
                        {
                            godess.CharacterInventory.Add(enemy.CharacterInventory[0]);
                            enemy.CharacterInventory.Remove(enemy.CharacterInventory[0]);
                            Console.WriteLine("Awesome! You snatched the enemy's inventory!");
                        }
                        MethodStore.IsFighting = false;
                        enemy.Lifepoints       = 1F;
                    }
                    break;

                default:
                    Console.WriteLine("Ohhh little one! You're far too slow for this. It's kind of impossible...");
                    godess.Lifepoints = (float)(Math.Round((godess.Lifepoints - MethodStore.Enemy.Hitpoints), 2));
                    if (godess.Lifepoints > 0F)
                    {
                        Console.WriteLine("You're getting hit!" + Environment.NewLine + "Oouuuch! Augh!!! Oh, you dirty creature! I'm gonna finish you on the spot!" + Environment.NewLine + "You've got " + godess.Lifepoints + " lifepoints left. Fight him 'till the end!");
                        Console.WriteLine("You can't fight like this! Try another input. Valid inputs are: [fight/f] [arm/a <item>] [use/u <item>] [inventory/i] and [quit/q]");
                        MethodStore.InputPrompt();
                    }
                    else
                    {
                        Console.WriteLine("NOOOOOOOO! How could you! Now you're dead! Stupid! Try this game again...");
                        MethodStore.QuitGame();
                    }
                    break;
                }
            }
 static void Main(string[] args)
 {
     MethodStore.LoadGameData();
     for (;;)
     {
         MethodStore.CheckCharactersInRoom();
         MethodStore.InputPrompt();
     }
 }