public class Monster extends Object implements Comparable<Monster>
Modifier and Type | Field and Description |
---|---|
(package private) Alignment |
alignment |
(package private) int |
armorClass |
(package private) Attack |
attack |
(package private) int |
breathCharges |
(package private) Monster |
charmer |
(package private) ArrayList<SpecialAbility> |
conditionList |
(package private) Dice |
hitDice |
(package private) int |
hitPoints |
(package private) Monster |
host |
(package private) int |
inLairPct |
(package private) int |
killTally |
(package private) static int |
MAX_MELEERS
Maximum enemies who can melee us at once.
|
(package private) int |
maxHitPoints |
(package private) int |
moveInches |
(package private) String |
name |
(package private) Dice |
numberAppearing |
(package private) ArrayList<SpecialAbility> |
specialList |
(package private) int |
tableLevel |
(package private) int |
timesMeleed |
(package private) String |
treasureType |
(package private) String |
type |
(package private) int |
xpSpecialAwards |
Constructor and Description |
---|
Monster(int AC,
int MV,
int HD)
Constructor (primitive stats).
|
Monster(int AC,
int MV,
int HD,
int atkRate,
int damDice)
Constructor (primitive stats, attack rate, damage dice).
|
Monster(Monster src)
Constructor (copy).
|
Monster(String[] s)
Constructor (from String array).
|
Monster(String name,
String type,
Alignment alignment,
int AC,
int MV,
Dice hitDice,
Attack attack)
Constructor (most fields; no special abilities).
|
Modifier and Type | Method and Description |
---|---|
void |
addCondition(SpecialAbility.SpecialType type)
Add a condition suffered from a special ability.
|
void |
addToKillTally(int num)
Add to kill tally.
|
void |
addXP(int xp) |
void |
boundHitPoints()
Bound current hit points.
|
(package private) void |
breatheFireOnEnemy(Party enemy,
int maxNum,
int damage)
Apply area flame-breath damage to an enemy party.
|
(package private) void |
breatheStoneOnEnemy(Party enemy,
int maxNum)
Apply area petrification effect on an enemy party.
|
boolean |
canAttack(Monster target)
Can we feasibly attack this target?
|
boolean |
checkBreathWeapon(Party enemy)
Check for a breath weapon attack.
|
boolean |
checkConstriction()
Constrict host if appropriate.
|
int |
checkDamageReduction(Monster target,
int damage)
Check for damage reduction on target.
|
boolean |
checkDrainBlood()
Drain blood from host if appropriate.
|
void |
checkMagicArmsBoost(int pct) |
void |
checkRegeneration()
Regenerate hit points if appropriate.
|
void |
checkSpecialOnHit(Monster target,
int totalRoll,
boolean isLastAttack)
Check for special ability triggers when we hit.
|
void |
checkSummoning(Party party)
Check if we can summon minions to a party.
|
void |
clearTimesMeleed() |
int |
compareTo(Monster other)
Compare to another monster by hit dice.
|
(package private) int |
countAsterisks(String s)
Count asterisks in a string (e.g., for XP bonus).
|
void |
drawBestWeapon(Monster m) |
SpecialAbility |
findCondition(SpecialAbility.SpecialType type)
Find if we suffer from a given condition.
|
SpecialAbility |
findSpecial(SpecialAbility.SpecialType type)
Find if we have a given type of special ability.
|
void |
fullAttack(Attack attack,
Monster target)
Carry out full attack routine on another creature.
|
int |
getAC() |
Alignment |
getAlignment() |
int |
getArmorClass() |
Attack |
getAttack() |
int |
getHD() |
Dice |
getHitDice() |
int |
getHitDiceNum() |
int |
getHitPoints() |
Monster |
getHost() |
int |
getHP() |
int |
getInLairPct() |
int |
getKillTally() |
int |
getLevel() |
int |
getMagicHitLevel()
Find what level of magic-to-hit we can strike.
|
int |
getMaxHitPoints() |
int |
getMoveInches() |
int |
getMV() |
String |
getName() |
Dice |
getNumberAppearing() |
int |
getTableLevel() |
int |
getTimesMeleed() |
String |
getTreasureType() |
String |
getType() |
Weapon |
getWeapon() |
(package private) int |
getXPAward()
Get the XP award value for defeating this monster.
|
int |
getXpSpecialAwards() |
boolean |
hasCondition(SpecialAbility.SpecialType type)
Check if we suffer from a given condition.
|
boolean |
hasDisablingCondition()
Check if we suffer from a disabling condition.
|
boolean |
hasFeat(Character.Feat feat) |
boolean |
hasSpecial(SpecialAbility.SpecialType type)
Check if this monster has a given type of special ability.
|
(package private) void |
headCount()
Count current heads for multiheaded types.
|
int |
hitModifier(Monster target)
Return hit modifier against a target.
|
boolean |
horsDeCombat()
Check if the monster is out of the fight.
|
void |
incTimesMeleed() |
void |
instaKill()
Kill this monster (reduce to 0 hp).
|
boolean |
isCharmed() |
boolean |
isOpenToMelee()
Check if we are subject to more melee attacks.
|
void |
loseLevel()
Lose a level (e.g., energy drain).
|
static void |
main(String[] args)
Main test method.
|
(package private) void |
makeSpecialAttack(Party enemy)
Make a special attack on an enemy party.
|
private void |
rollHitPoints()
Roll hit points from hit dice.
|
boolean |
rollSave(SavingThrows.SaveType type)
Roll a saving throw with no modifier.
|
boolean |
rollSave(SavingThrows.SaveType type,
int modifier)
Roll a saving throw with modifier.
|
void |
setAlignment(Alignment align) |
void |
setCharmed(Monster charmer)
Indicate that we are charmed by some other creature.
|
void |
setHitPointsToMax()
Set hit points to maxHitPoints.
|
void |
setHost(Monster host)
Attach ourselves to some creature (e.g., blood drain).
|
void |
setType(String type) |
void |
sheatheWeapon() |
void |
singleAttack(Attack attack,
Monster target,
boolean last)
Make one attack on another creature.
|
Monster |
spawn()
Spawn a new monster of this type, with different hit points.
|
String |
specialString()
Identify special abilities as a string.
|
void |
takeDamage(int damage)
Take damage (minimum 0 hp).
|
String |
toString()
Identify this object as a string.
|
static final int MAX_MELEERS
String name
String type
Dice numberAppearing
int armorClass
int moveInches
Dice hitDice
int inLairPct
String treasureType
Attack attack
Alignment alignment
int xpSpecialAwards
int tableLevel
int hitPoints
int maxHitPoints
int breathCharges
int killTally
int timesMeleed
Monster host
Monster charmer
ArrayList<SpecialAbility> specialList
ArrayList<SpecialAbility> conditionList
public Monster(int AC, int MV, int HD)
public Monster(int AC, int MV, int HD, int atkRate, int damDice)
public Monster(String name, String type, Alignment alignment, int AC, int MV, Dice hitDice, Attack attack)
public Monster(String[] s)
s
- The String array.public Monster(Monster src)
public String getName()
public String getType()
public Dice getNumberAppearing()
public int getArmorClass()
public int getMoveInches()
public int getHitPoints()
public int getMaxHitPoints()
public int getInLairPct()
public Dice getHitDice()
public int getHitDiceNum()
public int getLevel()
public String getTreasureType()
public Attack getAttack()
public Alignment getAlignment()
public int getXpSpecialAwards()
public int getTableLevel()
public int getKillTally()
public int getTimesMeleed()
public Monster getHost()
public boolean isCharmed()
public int getAC()
public int getHD()
public int getHP()
public int getMV()
public void setType(String type)
public void setAlignment(Alignment align)
public void clearTimesMeleed()
public void incTimesMeleed()
public Weapon getWeapon()
public void drawBestWeapon(Monster m)
public void sheatheWeapon()
public void checkMagicArmsBoost(int pct)
public void addXP(int xp)
public boolean hasFeat(Character.Feat feat)
public Monster spawn()
private void rollHitPoints()
public void takeDamage(int damage)
public void instaKill()
public boolean horsDeCombat()
public void setHitPointsToMax()
public void boundHitPoints()
public boolean isOpenToMelee()
public void fullAttack(Attack attack, Monster target)
public void singleAttack(Attack attack, Monster target, boolean last)
public boolean canAttack(Monster target)
public int getMagicHitLevel()
public int hitModifier(Monster target)
public int checkDamageReduction(Monster target, int damage)
public void checkSpecialOnHit(Monster target, int totalRoll, boolean isLastAttack)
void makeSpecialAttack(Party enemy)
public SpecialAbility findSpecial(SpecialAbility.SpecialType type)
public boolean hasSpecial(SpecialAbility.SpecialType type)
public void addCondition(SpecialAbility.SpecialType type)
public SpecialAbility findCondition(SpecialAbility.SpecialType type)
public boolean hasCondition(SpecialAbility.SpecialType type)
public boolean hasDisablingCondition()
public void checkRegeneration()
public boolean checkDrainBlood()
public boolean checkConstriction()
public boolean checkBreathWeapon(Party enemy)
void breatheFireOnEnemy(Party enemy, int maxNum, int damage)
void breatheStoneOnEnemy(Party enemy, int maxNum)
public void checkSummoning(Party party)
public void setHost(Monster host)
public void setCharmed(Monster charmer)
void headCount()
public void loseLevel()
public boolean rollSave(SavingThrows.SaveType type)
public boolean rollSave(SavingThrows.SaveType type, int modifier)
public void addToKillTally(int num)
public int compareTo(Monster other)
compareTo
in interface Comparable<Monster>
int countAsterisks(String s)
int getXPAward()
public String toString()
public String specialString()
public static void main(String[] args)