Class Squirtle
java.lang.Object
Pokemon.Pokemon
Pokemon.Water.Squirtle
Represents the Pokémon Squirtle, a Water-type Pokémon.
Squirtle has a single attack:
Shell Attack: Deals base damage plus any elemental bonus against the opponent.
Pokemon.hitOpponent(Pokemon, int) method.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AttackInfo[]Array of attacks available to Squirtle.Fields inherited from class Pokemon.Pokemon
elementType, tellsIfPokemonIsInvincible, tellsIfPokemonIsPoisoned -
Constructor Summary
ConstructorsConstructorDescriptionSquirtle()Constructs a new Squirtle Pokémon with default health, element type, ASCII art, and its single attack. -
Method Summary
Modifier and TypeMethodDescriptionintgetAttackResult1(ElementType elementTypeOfOpponentPokemon) Executes Squirtle'sShell Attack.voidhitOpponent(Pokemon OpponentPokemon, int attack) Performs an attack on an opponent Pokémon.Methods inherited from class Pokemon.Pokemon
getAsciiArt, getAttackAndDamageInfo, getAttackInfo, getCounterToIncreaseAttackDamage, getElementType, getHealth, getName, getTellsIfPokemonIsInvincible, getTellsIfPokemonIsPoisoned, ifPoisonedChangeHealth, IncreaseCounterToIncreaseAttackDamage, printBuffsAndDebuffs, setHealth, setHealthIfPokemonDamagesItsSelf, setHealthIfPokemonHealsItsSelf, setTellsIfPokemonIsInvincible, setTellsIfPokemonIsPoisoned
-
Field Details
-
attackInfo
Array of attacks available to Squirtle.
-
-
Constructor Details
-
Squirtle
public Squirtle()Constructs a new Squirtle Pokémon with default health, element type, ASCII art, and its single attack.
-
-
Method Details
-
getAttackResult1
Executes Squirtle'sShell 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:
- total damage dealt by
Shell Attack
-
hitOpponent
Performs an attack on an opponent Pokémon.Since Squirtle has only one attack, this method always executes
Shell Attack.- Specified by:
hitOpponentin classPokemon- Parameters:
OpponentPokemon- the Pokémon being attackedattack- the index of the attack to use (ignored, as Squirtle has only one attack)
-