Class Wartortle
java.lang.Object
Pokemon.Pokemon
Pokemon.Water.Wartortle
Represents the Pokémon Wartortle, a Water-type Pokémon.
Wartortle has two available attacks:
Withdraw: May grant temporary invincibility based on a coin flip.Bite: 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 Wartortle.Fields inherited from class Pokemon.Pokemon
elementType, tellsIfPokemonIsInvincible, tellsIfPokemonIsPoisoned -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new Wartortle Pokémon with default health, element type, ASCII art, and its two attacks. -
Method Summary
Modifier and TypeMethodDescriptionintgetAttackResult1(ElementType elementTypeOfOpponentPokemon) Executes Wartortle'sWithdrawattack.intgetAttackResult2(ElementType elementTypeOfOpponentPokemon) Executes Wartortle'sBiteattack.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 Wartortle.
-
-
Constructor Details
-
Wartortle
public Wartortle()Constructs a new Wartortle Pokémon with default health, element type, ASCII art, and its two attacks.
-
-
Method Details
-
getAttackResult1
Executes Wartortle'sWithdrawattack.Performs a coin flip to determine if Wartortle becomes invincible for the opponent's next turn. This attack does not deal direct damage.
- Parameters:
elementTypeOfOpponentPokemon- the opponent's elemental type (ignored, Withdraw does no damage)- Returns:
- 0 as
Withdrawdoes not deal damage
-
getAttackResult2
Executes Wartortle'sBiteattack.Deals damage equal to the attack's base damage plus any elemental bonus against the opponent's type.
- Parameters:
elementTypeOfOpponentPokemon- the opponent's elemental type- Returns:
- total damage dealt by
Bite
-
hitOpponent
Performs an attack on an opponent Pokémon.Executes
Withdrawifattackequals 1; otherwise, executesBite.- Specified by:
hitOpponentin classPokemon- Parameters:
OpponentPokemon- the Pokémon being attackedattack- the index of the attack to use (1 for Withdraw, others for Bite)
-