Package wizardquest.entity
Class Player
java.lang.Object
wizardquest.entity.Player
- All Implemented Interfaces:
EntityInterface,PlayerInterface
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcalcDamage(int base, DamageEnum type) Calculate the damage inflicted by one entity onto another.voidgainCoins(int amount) Increases a player's coin total by a given amount.voidgainMagic(int amount) Increases a player's magic points by a given amount.List the abilities that are currently usable by the entity.intgetCoins()Gets the amount of coins a player currently has.intGets an entity's current health.intgetLives()Gets the remaining lives that a player has in a session.intgetMagic()Gets the amount of magic points a player currently has.intGets the rate at which a player's magic points regenerates between each stage.intGets an entity's maximum health.intGets the maximum amount of magic points a player can have.getType()Get the enumerated type of the entity.List the upgrades that have been purchased between encounters by the player.voidloseCoins(int amount) Decrements a player's coin total by a given amount.voidloseHealth(int amount, DamageEnum type) Decrements an entity's health by a given amount, as a result of a certain damage type being inflicted upon them.voidloseLives(int amount) Decrements a player's remaining lives by a given amount.voidloseMagic(int amount) Decrements a player's magic total by a given amount.voidReset an entity's health to its starting value.voidResets the player's magic to 0.
-
Constructor Details
-
Player
-
-
Method Details
-
loseHealth
Description copied from interface:EntityInterfaceDecrements an entity's health by a given amount, as a result of a certain damage type being inflicted upon them.- Specified by:
loseHealthin interfaceEntityInterface- Parameters:
amount- the total health that the entity will lose.type- the inflicted damage type that has caused this health loss.- Throws:
IllegalArgumentException- if amount is not a non-negative number.
-
getHealth
public int getHealth()Description copied from interface:EntityInterfaceGets an entity's current health.- Specified by:
getHealthin interfaceEntityInterface- Returns:
- the entity's current health.
-
getMaxHealth
public int getMaxHealth()Description copied from interface:EntityInterfaceGets an entity's maximum health.- Specified by:
getMaxHealthin interfaceEntityInterface- Returns:
- the entity's maximum health.
-
calcDamage
Description copied from interface:EntityInterfaceCalculate the damage inflicted by one entity onto another. Applies damage type modifiers to the base damage to calculate the final amount.- Specified by:
calcDamagein interfaceEntityInterface- Parameters:
base- the base damage dealt by the entity's attack.type- the damage type of the entity's attack.- Returns:
- the total damage inflicted by this attack.
-
getAbilities
Description copied from interface:EntityInterfaceList the abilities that are currently usable by the entity.- Specified by:
getAbilitiesin interfaceEntityInterface- Returns:
- a list of abilities.
-
resetHealth
public void resetHealth()Description copied from interface:EntityInterfaceReset an entity's health to its starting value.- Specified by:
resetHealthin interfaceEntityInterface
-
getType
Description copied from interface:EntityInterfaceGet the enumerated type of the entity.- Specified by:
getTypein interfaceEntityInterface- Returns:
- the entity type.
-
getCoins
public int getCoins()Description copied from interface:PlayerInterfaceGets the amount of coins a player currently has.- Specified by:
getCoinsin interfacePlayerInterface- Returns:
- the player's current coin total.
-
loseCoins
Description copied from interface:PlayerInterfaceDecrements a player's coin total by a given amount.- Specified by:
loseCoinsin interfacePlayerInterface- Parameters:
amount- the total coins that the player will lose.- Throws:
IllegalArgumentException- if amount is not a non-negative number.
-
gainCoins
Description copied from interface:PlayerInterfaceIncreases a player's coin total by a given amount.- Specified by:
gainCoinsin interfacePlayerInterface- Parameters:
amount- the total coins that the player will gain.- Throws:
IllegalArgumentException- if amount is not a non-negative number.
-
getMagic
public int getMagic()Description copied from interface:PlayerInterfaceGets the amount of magic points a player currently has.- Specified by:
getMagicin interfacePlayerInterface- Returns:
- the player's current magic total.
-
getMaxMagic
public int getMaxMagic()Description copied from interface:PlayerInterfaceGets the maximum amount of magic points a player can have.- Specified by:
getMaxMagicin interfacePlayerInterface- Returns:
- the player's maximum magic total.
-
getMagicRegenRate
public int getMagicRegenRate()Description copied from interface:PlayerInterfaceGets the rate at which a player's magic points regenerates between each stage.- Specified by:
getMagicRegenRatein interfacePlayerInterface- Returns:
- the player's magic regeneration rate per stage.
-
gainMagic
Description copied from interface:PlayerInterfaceIncreases a player's magic points by a given amount.- Specified by:
gainMagicin interfacePlayerInterface- Parameters:
amount- the total magic points that the player will gain.- Throws:
IllegalArgumentException- if amount is not a non-negative number.
-
loseMagic
Description copied from interface:PlayerInterfaceDecrements a player's magic total by a given amount.- Specified by:
loseMagicin interfacePlayerInterface- Parameters:
amount- the total magic points that the player will lose.- Throws:
IllegalArgumentException- if amount is not a non-negative number.
-
getLives
public int getLives()Description copied from interface:PlayerInterfaceGets the remaining lives that a player has in a session.- Specified by:
getLivesin interfacePlayerInterface- Returns:
- the player's total remaining lives.
-
loseLives
Description copied from interface:PlayerInterfaceDecrements a player's remaining lives by a given amount.- Specified by:
loseLivesin interfacePlayerInterface- Parameters:
amount- the total lives that the player will lose.- Throws:
IllegalArgumentException- if amount is not a non-negative number.
-
getUpgrades
Description copied from interface:PlayerInterfaceList the upgrades that have been purchased between encounters by the player.- Specified by:
getUpgradesin interfacePlayerInterface- Returns:
- a list of purchased upgrades.
-
resetMagic
public void resetMagic()Description copied from interface:PlayerInterfaceResets the player's magic to 0.- Specified by:
resetMagicin interfacePlayerInterface
-