Class Charmander

java.lang.Object
Pokemon.Pokemon
Pokemon.Fire.Charmander

public class Charmander extends Pokemon
Represents the Pokémon Charmander, a Fire-type Pokémon.

Charmander has a single attack:

  • Ember: Deals base damage plus any elemental bonus against the opponent.
This class defines Charmander's specific attack logic and overrides the abstract Pokemon.hitOpponent(Pokemon, int) method.

  • Field Details

    • attackInfo

      private final AttackInfo[] attackInfo
      Array of attacks available to Charmander.
  • Constructor Details

    • Charmander

      public Charmander()
      Constructs a new Charmander Pokémon with default health, element type, ASCII art, and its single attack.
  • Method Details

    • getAttackResult1

      public int getAttackResult1(ElementType elementTypeOfOpponentPokemon)
      Executes Charmander's Ember attack.

      Deals damage equal to the attack's base damage plus any elemental bonus against the opponent's type.

      Parameters:
      elementTypeOfOpponentPokemon - the element type of the opponent Pokémon
      Returns:
      the total damage dealt by Ember
    • hitOpponent

      public void hitOpponent(Pokemon OpponentPokemon, int attack)
      Performs an attack on an opponent Pokémon.

      Since Charmander has only one attack, this method always executes Ember.

      Specified by:
      hitOpponent in class Pokemon
      Parameters:
      OpponentPokemon - the Pokémon being attacked
      attack - the index of the attack to use (ignored, as Charmander has only one attack)