Class Ivysaur
java.lang.Object
Pokemon.Pokemon
Pokemon.Grass.Ivysaur
Represents the Pokémon Ivysaur, a Grass-type Pokémon.
Ivysaur has two available attacks:
Vine Whip: Deals base damage plus any elemental bonus against the opponent.Poisonpowder: Deals base damage plus any elemental bonus and poisons the opponent Pokémon.
Pokemon.hitOpponent(Pokemon, int) method.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AttackInfo[]Array of attacks available to Ivysaur.Fields inherited from class Pokemon.Pokemon
elementType, tellsIfPokemonIsInvincible, tellsIfPokemonIsPoisoned -
Constructor Summary
ConstructorsConstructorDescriptionIvysaur()Constructs a new Ivysaur Pokémon with default health, element type, ASCII art, and its two attacks. -
Method Summary
Modifier and TypeMethodDescriptionintgetAttackResult1(ElementType elementTypeOfOpponentPokemon) Executes Ivysaur'sVine Whipattack.intgetAttackResult2(ElementType elementTypeOfOpponentPokemon) Executes Ivysaur'sPoisonpowderattack.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 Ivysaur.
-
-
Constructor Details
-
Ivysaur
public Ivysaur()Constructs a new Ivysaur Pokémon with default health, element type, ASCII art, and its two attacks.
-
-
Method Details
-
getAttackResult1
Executes Ivysaur'sVine Whipattack.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
Vine Whip
-
getAttackResult2
Executes Ivysaur'sPoisonpowderattack.Deals damage equal to the attack's base damage plus any elemental bonus against the opponent's type. Additionally, poisons the opponent Pokémon.
- Parameters:
elementTypeOfOpponentPokemon- the element type of the opponent Pokémon- Returns:
- the total damage dealt by
Poisonpowder
-
hitOpponent
Performs an attack on an opponent Pokémon.Executes
Vine Whipifattackequals 1; otherwise, executesPoisonpowderand poisons the opponent Pokémon.- Specified by:
hitOpponentin classPokemon- Parameters:
OpponentPokemon- the Pokémon being attackedattack- the index of the attack to use (1 for Vine Whip, others for Poisonpowder)
-