Class Fortune
Object
Fortune
- All Implemented Interfaces:
Attributes
Fortunes are bonuses that can be applied to knights before they go on quests.
As the bonus can apply to any attribute, they implement the Attributes interface.
Fortunes are immutable.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
getArmor()
Return the amount of bonus to the knights armorReturns the replacement damage dice for the knight.int
Returns the the bonus to the knights hit modifier.int
getMaxHP()
return the amount of bonus to the knights maxHPgetName()
returns the name of the fortune card - often named after the knightly virtues.toString()
Returns a nicely formatted String value of the fortune.
-
Constructor Details
-
Fortune
Basic constructor assuming no DamageDice replacement- Parameters:
name
- name of fortune cardhpBonus
- hp bonusarmor
- armor bonushitModifier
- to hit bonus
-
Fortune
Constructor with a damage dice replacement by DiceType type- Parameters:
name
- name of fortune cardhpBonus
- hp bonusarmor
- armor bonushitModifier
- to hit bonustype
- the damage dice replacement value
-
-
Method Details
-
getArmor
public int getArmor()Return the amount of bonus to the knights armor- Specified by:
getArmor
in interfaceAttributes
- Returns:
- whole number value
-
getMaxHP
public int getMaxHP()return the amount of bonus to the knights maxHP- Specified by:
getMaxHP
in interfaceAttributes
- Returns:
- whole number value
-
getDamageDie
Returns the replacement damage dice for the knight.- Specified by:
getDamageDie
in interfaceAttributes
- Returns:
- DiceType of the knight damage die
-
getHitModifier
public int getHitModifier()Returns the the bonus to the knights hit modifier.- Specified by:
getHitModifier
in interfaceAttributes
- Returns:
- whole number value
-
getName
returns the name of the fortune card - often named after the knightly virtues.- Returns:
- Name of the knight card
-
toString
Returns a nicely formatted String value of the fortune. Examples look like:+======================+ |Nobility | |HP Bonus: +10| |AC Bonus: +1| |Hit Bonus: +1| |Damage Adj: -| +======================+
Spacing is -22s for the name, 12s for the HP Bonus, 12s for the AC bonus, 11s for the hit bonus and 10s for the damage adj. Note: AC is armor., so you are looking at using the following methods:getName()
getMaxHP()
(for HP Bonus)getArmor()
(for AC Bonus)getHitModifier()
(For hit bonus)getDamageDie()
(For Damage Adj. Note if null, put in a dash)
-