public void PokemonShouldFaint() { IPokemon pokemon = PokemonFactory.CreatePokemon <Pikachu>(); pokemon?.ReceiveDamage((int)pokemon?.TotalHealthPoints); Assert.True(pokemon?.HasFainted()); }
public void PokemonShouldReceiveDamage() { IPokemon pokemon = PokemonFactory.CreatePokemon <Eevee>(); pokemon?.ReceiveDamage(10); Assert.True(pokemon?.CurrentHealthPoints < pokemon.TotalHealthPoints); }
private static void ProcessAttack(IPokemon attackingPokemon, IPokemon targetPokemon, IMove move) { TypeEffect moveEffectOnPokemon = TypeComparer.GetMoveEffectivenessBasedOnPokemonType(move.Type, targetPokemon.Types.FirstOrDefault()); int calculatedDamage = TypeDamageCalculator.CalculateDamage(attackingPokemon, targetPokemon, move, moveEffectOnPokemon); attackingPokemon.UseMove(move); if (move.StatusMoves != null) { BattleAux.ProcessStatusAttack(attackingPokemon, targetPokemon, move); } else { targetPokemon.ReceiveDamage(calculatedDamage); ConsoleBattleInfoPokemon.ShowPokemonReceivedDamage(targetPokemon, calculatedDamage); ConsoleBattleInfoTypes.ShowHowEffectiveTheMoveWas(moveEffectOnPokemon); } }