Package characters.heroes
Class Warrior
java.lang.Object
characters.DungeonCharacter
characters.heroes.Hero
characters.heroes.Warrior
- All Implemented Interfaces:
java.lang.Comparable<java.lang.Object>
public class Warrior extends Hero
Warrior character.
-
Field Summary
Fields inherited from class characters.heroes.Hero
chanceToBlock, numTurns
Fields inherited from class characters.DungeonCharacter
attackSpeed, chanceToHit, damageMax, damageMin, hitPoints, name, randomInt
-
Constructor Summary
Constructors Constructor Description Warrior()
Constructor. -
Method Summary
Modifier and Type Method Description void
attack(DungeonCharacter opponent)
Allows characters to attempt an attack on an opponent.void
battleChoices(DungeonCharacter opponent)
Provides the user with possible actions to perform during their turn.void
crushingBlow(DungeonCharacter opponent)
Special move.Methods inherited from class characters.heroes.Hero
numOfTurns, readName, subtractHitPoints
Methods inherited from class characters.DungeonCharacter
addHitPoints, compareTo, getAttackSpeed, getHitPoints, getName, isAlive
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Warrior
public Warrior()Constructor.
-
-
Method Details
-
crushingBlow
Special move.- Parameters:
opponent
- The opponent to attack.
-
attack
Description copied from class:DungeonCharacter
Allows characters to attempt an attack on an opponent. First, chance to hit is considered. If a hit can occur, then the damage is calculated based on character's damage range. This damage is then applied to the opponent.- Overrides:
attack
in classDungeonCharacter
- Parameters:
opponent
- The opponent being attacked.
-
battleChoices
Provides the user with possible actions to perform during their turn.- Specified by:
battleChoices
in classDungeonCharacter
- Parameters:
opponent
- The opponent to attack.
-