Exemplo n.º 1
0
      public void PlayerAttack(EnemySamurai jerk, Dictionary <string, int> dict, Object enemyName)
      {
          var    singleAttack = dict.ElementAt(rnd.Next(dict.Count));
          int    attackVall   = singleAttack.Value;
          string attackName   = singleAttack.Key;

          Console.WriteLine("You attacked with {0} and deals {1} amount of damage.", attackName, attackVall);
          jerk.PowerLevel -= attackVall;
          Console.WriteLine("{0} power is at {1}%", jerk.Name, jerk.PowerLevel);
      }
Exemplo n.º 2
0
 public void PlayerAttack(EnemySamurai jerk)
 {
     PlayerAttack(jerk, Fighting, this.PlayerName);
 }
Exemplo n.º 3
0
        static void Main(string[] args)
        {                ////////////      WE ARE ROBIN vs COURT of OWLS    ////////////////
            //SpeechSynthesizer talkingConsole = new SpeechSynthesizer();
            //talkingConsole.Speak("what is your name?");


            //user input
            MainAppTitle();
            Console.WriteLine("Choose your warrior.\n" +
                              "Option 0: Ninja Assassin\n" +
                              "Option 1: Berserker\n" +
                              "Option 2: Spy\n" +
                              "Option 3: Samurai");
            int playerType = int.Parse(Console.ReadLine());

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

            Console.WriteLine("What is your name?");
            string name = Console.ReadLine();

            Console.WriteLine("What is your clan name?");
            string clan = Console.ReadLine();

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

            Player player = new Player(name, clan);

            // Console.WriteLine(player.PlayerName);
            //player.ShowPower();
            player.ChooseType(playerType);
            Console.WriteLine(player.ToString());
            Console.WriteLine("You are starting out with {0}Hp", player.CurrentPower);
            Console.WriteLine("");
            int choice = 0;

            do
            {
                Console.WriteLine("What do you want to do?\n" +
                                  "Option 0: Fight\n" +
                                  "Option 1: Farm\n" +
                                  "Option 2: Travel\n" +
                                  "Option 3: Quit");
                choice = Int32.Parse(Console.ReadLine());
                Console.WriteLine("");

                if (choice == 0)    //FIGHT
                {
                    bool         continueChoice = true;
                    EnemySamurai eSamurai       = new EnemySamurai();
                    Console.WriteLine("{0} came acrossed a enemy.", player.PlayerName);
                    Console.WriteLine("He has: " + eSamurai.PowerLevel + "Hp his name is: {0}.", eSamurai.Name);
                    while (continueChoice == true)
                    {
                        eSamurai.Insult();
                        Console.WriteLine("Do you want to fight? y/n");
                        string userAnswer = Console.ReadLine();
                        if (userAnswer == "y")
                        {
                            eSamurai.JerkAttack(player);
                            player.PlayerAttack(eSamurai);

                            if (player.CurrentPower <= 0)
                            {
                                Console.WriteLine("DISHONORED");
                                Console.WriteLine("");
                                continueChoice = false;
                            }
                            else if ((eSamurai.PowerLevel <= 0))
                            {
                                Console.WriteLine("VICTORY");
                                Console.WriteLine("");
                                continueChoice = false;
                                break;
                            }
                        }
                        else
                        {
                            Console.WriteLine("DISHONOR ON YOUR FAMILY");
                            continueChoice = false;
                            break;
                        }
                    }
                }
                if (choice == 1)
                {
                    Console.WriteLine("You choose to live a peacefull life in the country tending to your farm.\nYou grow crops and raise animals. You die peacefully surrounded by family.");
                    Console.WriteLine("You win.");
                    break;
                }
            } while (choice != 3);



            Console.ReadLine();
        }