Example #1
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();
        }
Example #2
0
 public bool Beats(IMove other)
 {
     return(other.GetType() == typeof(Rock));
 }
Example #3
0
 public bool Beats(IMove other)
 {
     return(other.GetType() == typeof(Scissors));
 }
 public bool WinAgainst(IMove move) => !move.GetType().IsEquivalentTo(typeof(Scissors));
 public bool WinAgainst(IMove move) => !move.GetType().IsEquivalentTo(typeof(Paper));