示例#1
0
        public static void PokemonJourney()
        {
            //Object Instantiation
            Pikachu pikachu        = new Pikachu();
            Trainer ash            = new Trainer("Ash", "Pallet Town", 0);
            Trainer defaultTrainer = new Trainer();

            //Story
            ash.Speak();
            Console.WriteLine("\n");
            pikachu.WildPokemonAppears();
            pikachu.Attack();
            ash.CatchPokemon("Poke Ball", "Pikachu");
            pikachu.HasType();
            Console.WriteLine("Alright! I caught a Pikachu! I'm going to call you Sparky!");
            pikachu.GivenName = "Sparky";
            Console.WriteLine("\n");
            Console.WriteLine($"Let's see what your Pokemon ID number is...oh, it's {pikachu.IdNumber}, got it!");
            Console.WriteLine($"{pikachu.GivenName} joined Ash's team!\n");
            Console.WriteLine("\n");
            Console.WriteLine($"{pikachu.GivenName}, I'm going to give you some food to recover from our battle.");
            pikachu.Eats();
            Console.WriteLine("Oh no! That was my last Oran Berry, but you're clearly still hungry. How about a Sitrus Berry?");
            pikachu.FoodType = "Sitrus Berry";
            pikachu.Eats();
            Console.WriteLine("\n");
            Console.WriteLine("Good! I'm glad you liked those Sitrus Berries! Now, let's teach you a stronger attack! Instead of Thunder Shock, you can now use Thunder Bolt!");
            pikachu.AttackName = "Thunder Bolt";
            pikachu.Attack();
            Console.WriteLine("Now you've gotten the hang of it! Let's challenge a gym leader now!");
            Console.WriteLine("\n");
            defaultTrainer.Speak();
            ash.ChallengeTrainer(defaultTrainer.TrainerName);
            Console.WriteLine($"Just wait a number there, {ash.TrainerName}. Firs I need to know what your trainer ID is to make sure it's valid. It must be between 2,000 and 20,000.");
            Console.WriteLine($"My trainer ID is {ash.TrainerID}. Happy now???");
            Console.WriteLine("Yes, we can battle now! ");
            Console.WriteLine("\n");
            defaultTrainer.AcceptChallenge(ash.TrainerName);
            Console.WriteLine("You'll never beat me and my bird Pokemon! Go. Pidgeotto!");
            ash.ChoosePokemon(pikachu.GivenName);
            Console.WriteLine($"{pikachu.GivenName}, use that new move I showed you!");
            pikachu.Attack();
            Console.WriteLine($"Great hit, {pikachu.GivenName}! That super-effective move made {defaultTrainer.TrainerName}'s Pidgeotto faint! We won!");
            Console.WriteLine($"Congratulations, {ash.TrainerName}. Let me give you a gym badge.");
            ash.NumberOfGymBadges = 1;
            Console.WriteLine($"Alright! Thanks for the great battle, {defaultTrainer.TrainerName}! I may only have {ash.NumberOfGymBadges} gym badge, but I will someday defeat the Elite Four with my best friend {pikachu.GivenName}!");
        }