Ejemplo n.º 1
0
        public void GhostTypePokemonShouldNotTakeDamageFromPhysicalAttack()
        {
            IPokemon ghostTypePokemon = PokemonFactory.CreatePokemon <Gengar>();
            IMove    move             = new Tackle();

            Assert.True(TypeComparer.PokemonTypeDoesNotMakeContactWithMove(ghostTypePokemon?.Types, move));
        }
Ejemplo n.º 2
0
        public void GhostTypePokemonShouldTakeDamageFromSpecialAttack()
        {
            IPokemon ghostTypePokemon = PokemonFactory.CreatePokemon <Gengar>();
            IMove    move             = new ShadowBall();

            Assert.False(TypeComparer.PokemonTypeDoesNotMakeContactWithMove(ghostTypePokemon?.Types, move));
        }
Ejemplo n.º 3
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();
        }