Exemple #1
0
        public void KillBenchedPokemonTest()
        {
            var player  = new Player();
            var pokemon = new PokemonCard()
            {
                Owner = player,
                Hp    = 50
            };

            player.ActivePokemonCard = new PokemonCard();
            player.BenchedPokemon.Add(pokemon);

            pokemon.DamageCounters = 60;
            pokemon.ApplyStatusEffect(StatusEffect.Burn, null);
            pokemon.ApplyStatusEffect(StatusEffect.Confuse, null);
            pokemon.ApplyStatusEffect(StatusEffect.Paralyze, null);
            pokemon.ApplyStatusEffect(StatusEffect.Poison, null);
            pokemon.ApplyStatusEffect(StatusEffect.Sleep, null);

            player.KillBenchedPokemon(pokemon);

            Assert.Single(player.DiscardPile);
            Assert.Equal(0, player.BenchedPokemon.Count);

            Assert.False(pokemon.IsAsleep);
            Assert.False(pokemon.IsPoisoned);
            Assert.False(pokemon.IsParalyzed);
            Assert.False(pokemon.IsBurned);
            Assert.False(pokemon.IsConfused);
            Assert.Equal(0, pokemon.DamageCounters);
        }
        public void ApplyStatusEffectTest(StatusEffect status)
        {
            var pokemon = new PokemonCard();

            pokemon.ApplyStatusEffect(status, null);

            switch (status)
            {
            case StatusEffect.Sleep:
                Assert.True(pokemon.IsAsleep);
                break;

            case StatusEffect.Poison:
                Assert.True(pokemon.IsPoisoned);
                break;

            case StatusEffect.Paralyze:
                Assert.True(pokemon.IsParalyzed);
                break;

            case StatusEffect.Burn:
                Assert.True(pokemon.IsBurned);
                break;

            case StatusEffect.Confuse:
                Assert.True(pokemon.IsConfused);
                break;

            case StatusEffect.None:
                break;

            default:
                break;
            }
        }
Exemple #3
0
        private void ApplyEffectTo(PokemonCard pokemon, StatusEffect effect, GameField game)
        {
            if (effect == StatusEffect.None)
            {
                return;
            }

            pokemon?.ApplyStatusEffect(effect, game);
        }
Exemple #4
0
 public static void FlipCoinIfHeadsParalyzed(GameLog log, PokemonCard target)
 {
     if (CoinFlipper.FlipCoin())
     {
         log.AddMessage("Coin flipped heads defending pokemon is now Paralyzed");
         target.ApplyStatusEffect(StatusEffect.Paralyze, new GameField());
     }
     else
     {
         log.AddMessage("Coin flipped tails, nothing happened");
     }
 }