コード例 #1
0
        public static void ShowInflictedStatuses(IPokemon pokemonThatHadItsStatusInflicted, StatusMove[] arrayOfInflictedStatuses)
        {
            for (int i = 0; i < arrayOfInflictedStatuses.Length; i++)
            {
                switch (arrayOfInflictedStatuses[i])
                {
                case StatusMove.ATTACK_UP:
                    ConsoleUtils.ShowMessageAndWaitTwoSeconds($"{pokemonThatHadItsStatusInflicted.GetType().Name}'s attack went up!");
                    break;

                case StatusMove.ATTACK_DOWN:
                    ConsoleUtils.ShowMessageAndWaitTwoSeconds($"{pokemonThatHadItsStatusInflicted.GetType().Name}'s attack went down!");
                    break;

                case StatusMove.DEFENSE_UP:
                    ConsoleUtils.ShowMessageAndWaitTwoSeconds($"{pokemonThatHadItsStatusInflicted.GetType().Name}'s defense went up!");
                    break;

                case StatusMove.DEFENSE_DOWN:
                    ConsoleUtils.ShowMessageAndWaitTwoSeconds($"{pokemonThatHadItsStatusInflicted.GetType().Name}'s defense went down!");
                    break;

                case StatusMove.SPECIALATTACK_UP:
                    ConsoleUtils.ShowMessageAndWaitTwoSeconds($"{pokemonThatHadItsStatusInflicted.GetType().Name}'s special attack went up!");
                    break;

                case StatusMove.SPECIALATTACK_DOWN:
                    ConsoleUtils.ShowMessageAndWaitTwoSeconds($"{pokemonThatHadItsStatusInflicted.GetType().Name}'s special attack went down!");
                    break;

                case StatusMove.SPECIALDEFENSE_UP:
                    ConsoleUtils.ShowMessageAndWaitTwoSeconds($"{pokemonThatHadItsStatusInflicted.GetType().Name}'s special defense went up!");
                    break;

                case StatusMove.SPECIALDEFENSE_DOWN:
                    ConsoleUtils.ShowMessageAndWaitTwoSeconds($"{pokemonThatHadItsStatusInflicted.GetType().Name}'s special defense went down!");
                    break;

                case StatusMove.SPEED_UP:
                    ConsoleUtils.ShowMessageAndWaitTwoSeconds($"{pokemonThatHadItsStatusInflicted.GetType().Name}'s speed went up!");
                    break;

                case StatusMove.SPEED_DOWN:
                    ConsoleUtils.ShowMessageAndWaitTwoSeconds($"{pokemonThatHadItsStatusInflicted.GetType().Name}'s speed went down!");
                    break;
                }
            }
        }
コード例 #2
0
 public static void EnemyTrainerDrawsbackPokemon(IPokemon pokemon)
 {
     ConsoleUtils.WaitOneSecond();
     ConsoleUtils.TrainerAction <EnemyAction>($"{pokemon?.GetType().Name}, come back!");
     ConsoleUtils.WaitOneSecond();
     ConsoleUtils.ClearScreen();
 }
コード例 #3
0
 public static void PlayerSendsPokemon(IPokemon pokemon)
 {
     ConsoleUtils.WaitOneSecond();
     ConsoleUtils.TrainerAction <PlayerAction>($"Go, {pokemon.GetType().Name}!");
     ConsoleUtils.WaitOneSecond();
     ConsoleUtils.ClearScreen();
 }
コード例 #4
0
 public static void PlayerDrawsbackPokemon(IPokemon pokemon)
 {
     ConsoleUtils.WaitOneSecond();
     ConsoleUtils.TrainerAction <PlayerAction>($"Great job, {pokemon.GetType().Name}. Come back!");
     ConsoleUtils.WaitOneSecond();
     ConsoleUtils.ClearScreen();
 }
コード例 #5
0
        public object Clone()
        {
            IPokemon pokemon = PokemonFactory.CreatePokemon();

            foreach (PropertyInfo property in pokemon.GetType().GetProperties())
            {
                property.SetValue(pokemon, property.GetValue(this, null), null);
            }
            pokemon.ResetStats();
            return(pokemon);
        }
コード例 #6
0
        public void SetPokemonAsCurrent(IPokemon pokemon)
        {
            Parallel.ForEach(PokemonTeam, pkmn =>
            {
                if (pkmn.Current)
                {
                    pkmn.Current = false;
                }

                if (pkmn.Pokemon.GetType().Name == pokemon.GetType().Name)
                {
                    pkmn.Current = true;
                }
            });
        }
コード例 #7
0
        private void PokemonAttack(IPokemon attackingPokemon, IPokemon targetPokemon, int chosenMove)
        {
            IMove move = attackingPokemon.Moves[chosenMove];

            if (ConsoleBattleInfoMove.MoveDoesNotHavePowerPointsLeft(move))
            {
                PromptTrainerForPokemonMove();
                return;
            }

            ConsoleBattleInfoPokemon.ShowPokemonUsedMove(attackingPokemon, move.GetType().Name);

            if (TypeComparer.PokemonTypeDoesNotMakeContactWithMove(targetPokemon.Types, move))
            {
                ConsoleUtils.ShowMessageAndWaitOneSecond($"It didn't affect {targetPokemon.GetType().Name}!");
            }
            else
            {
                ProcessAttack(attackingPokemon, targetPokemon, move);
            }

            ConsoleUtils.ClearScreen();
        }
コード例 #8
0
        public TelaPokemonDetalhes(IPokemon pokemon)
        {
            InitializeComponent();

            Id = Convert.ToInt32(pokemon.Id);

            this.lblNome.Text = pokemon.Nome;

            foreach (PropertyInfo pi in pokemon.GetType().GetProperties())
            {
                if (pi.Name != "Nome" && pi.Name != "Foto")
                {
                    pnlDetalhes.Controls.Add(new Label()
                    {
                        Text     = $"{pi.Name} : {pi.GetValue(pokemon).ToString()}",
                        Location = new Point(20, 30 + ((pnlDetalhes.Controls.Count) * 30)),
                        Font     = new Font(lblNome.Font.FontFamily, 10),
                        Size     = new Size(pnlDetalhes.Size.Width - 30, 30)
                    });
                }
            }

            this.ptbFoto.Load(pokemon.Foto);
        }
コード例 #9
0
 public static void ShowItemWasUsedOnPokemon(IItem item, IPokemon pokemon)
 {
     ConsoleUtils.ShowMessageAndWaitTwoSeconds($"{item.GetType().Name} was used on {pokemon.GetType().Name}!");
     ConsoleUtils.ClearScreen();
 }