public class Character extends Monster
Modifier and Type | Class and Description |
---|---|
static class |
Character.AgeCategory
Age categories.
|
static class |
Character.Feat
Optional OED fighter feats.
|
Modifier and Type | Field and Description |
---|---|
(package private) static Dice |
ABILITY_DICE
Dice for ability scores.
|
(package private) int[] |
abilityScore
The six ability scores.
|
(package private) int |
age
Age in years
|
(package private) static boolean |
APPLY_BONUS_XP
Whether we apply the prime-requisite XP bonus.
|
(package private) Armor |
armor
Armor worn.
|
(package private) static int |
BASE_ARMOR_CLASS
Base armor class.
|
(package private) static int |
BASE_MOVEMENT
Base movement.
|
(package private) ArrayList<ClassRecord> |
classList
List of classes with XP scores.
|
(package private) ArrayList<Equipment> |
equipList
Equipment carried.
|
(package private) ArrayList<Character.Feat> |
featList
Feats acquired.
|
(package private) static int |
NPC_PCT_MAGIC_PER_LEVEL
Percent per level for NPC magic items.
|
(package private) Armor |
shield
Shield held.
|
(package private) static int |
STARTING_AGE
Starting age.
|
(package private) static boolean |
useFeats
Use feats?
|
(package private) Weapon |
weaponInHand
Weapon in hand.
|
alignment, armorClass, attack, breathCharges, charmer, conditionList, hitDice, hitPoints, host, inLairPct, killTally, MAX_MELEERS, maxHitPoints, moveInches, name, numberAppearing, specialList, tableLevel, timesMeleed, treasureType, type, xpSpecialAwards
Constructor and Description |
---|
Character(String name,
String type,
String className,
int level,
Alignment align)
Constructor (single class, no equipment).
|
Modifier and Type | Method and Description |
---|---|
(package private) String |
abilityString()
String representation of all ability scores.
|
void |
addEquipment(Equipment equip) |
void |
addFeat()
Add a random feat to this character.
|
void |
addXP(int xp)
Add XP to the first character class.
|
void |
addXP(int XP,
int classIdx)
Add XP to a specified character class.
|
(package private) void |
adjustAbilityScores(int... modifiers) |
(package private) int |
adjustForPrimeReq(int XP,
ClassRecord cr)
Adjust XP award for the class prime requisite.
|
(package private) void |
ageAdjustAbilities()
Adjust ability scores on reaching a new age category.
|
(package private) void |
ageAdjustLevels()
Adjust levels on advancing age.
|
(package private) int |
baseAttackBonus()
Returns base attack bonus (max over all classes).
|
(package private) ClassRecord |
bestClassForSave(SavingThrows.SaveType saveType)
Find the best class to use for a given saving throw.
|
(package private) Weapon |
bestWeaponAgainst(Monster monster)
Decide on the best weapon against a given monster.
|
void |
checkMagicArmsBoost(int percent)
Make rolls to possibly boost magic arms.
|
(package private) String |
classString()
String representation of all class and levels.
|
(package private) int |
computeArmorClass()
Get adjusted armor class.
|
(package private) Attack |
computeAttack()
Get weapon-based melee attack routine.
|
(package private) int |
computeMoveInches()
Get movement based on armor.
|
(package private) void |
createRandomAbilityScores()
Creates random ability scores.
|
void |
drawBestWeapon(Monster monster)
Draw best weapon against a given monster.
|
void |
drawWeapon(Weapon weapon)
Draw a particular weapon from equipment.
|
void |
dropAllEquipment() |
(package private) String |
equipString()
String representation of equipment.
|
(package private) String |
featString()
String representation of feats.
|
(package private) int |
findSupMaxHitPoints()
Find maximum hit points (supremum over all classes).
|
(package private) String |
formatFeat(Character.Feat feat)
Format feat name with spaces.
|
(package private) int |
getAbilityBonus(Ability ability)
Get an ability score bonus/modifier.
|
(package private) int |
getAbilityScore(Ability ability)
Get an ability score.
|
int |
getAge()
Get the age of the character.
|
(package private) Character.AgeCategory |
getAgeCategory()
Get the age category of the character.
|
Armor |
getArmor() |
int |
getHitDiceNum()
Get raw number of hit dice.
|
int |
getLevel()
Get highest class level.
|
int |
getMagicHitLevel()
Find what level of magic-to-hit we can strike.
|
Armor |
getShield() |
ClassRecord |
getTopClass()
Get highest level class.
|
Weapon |
getWeapon() |
(package private) void |
handleConChange(int oldCon)
Handle a Constitution change to hit points.
|
boolean |
hasFeat(Character.Feat feat)
Does this character have a given feat?
|
void |
incrementAge(boolean ageEffects)
Increment the age of the character.
|
void |
loseFeat()
Lose the last feat for this character.
|
void |
loseLevel()
Lose a level (e.g., energy drain).
|
static void |
main(String[] args)
Main test method.
|
(package private) int |
maxDamageVsMonster(Monster monster)
Compute max damage against a given monster.
|
static Character |
newNPCFromTitle(String title,
Alignment align)
Create human NPC with equipment from class title.
|
boolean |
rollSave(SavingThrows.SaveType type,
int modifier)
Roll a saving throw with modifier.
|
void |
setArmor(Armor armor)
Set armor worn.
|
void |
setBasicEquipment()
Set basic equipment by top class.
|
static void |
setFeatUsage(boolean permit)
Set if we should be using optional feats.
|
void |
setShield(Armor shield)
Set shield carried.
|
void |
sheatheWeapon()
Sheathe weapon in hand back to equipment.
|
String |
toString()
Identify this object as a string.
|
int |
totalXP()
Returns total XP (sum over all classes).
|
(package private) void |
updateStats()
Update derived statistics after any character changes.
|
static boolean |
useFeats()
Are we using optional feats?
|
addCondition, addToKillTally, boundHitPoints, breatheFireOnEnemy, breatheStoneOnEnemy, canAttack, checkBreathWeapon, checkConstriction, checkDamageReduction, checkDrainBlood, checkRegeneration, checkSpecialOnHit, checkSummoning, clearTimesMeleed, compareTo, countAsterisks, findCondition, findSpecial, fullAttack, getAC, getAlignment, getArmorClass, getAttack, getHD, getHitDice, getHitPoints, getHost, getHP, getInLairPct, getKillTally, getMaxHitPoints, getMoveInches, getMV, getName, getNumberAppearing, getTableLevel, getTimesMeleed, getTreasureType, getType, getXPAward, getXpSpecialAwards, hasCondition, hasDisablingCondition, hasSpecial, headCount, hitModifier, horsDeCombat, incTimesMeleed, instaKill, isCharmed, isOpenToMelee, makeSpecialAttack, rollSave, setAlignment, setCharmed, setHitPointsToMax, setHost, setType, singleAttack, spawn, specialString, takeDamage
static final int BASE_ARMOR_CLASS
static final int BASE_MOVEMENT
static final int NPC_PCT_MAGIC_PER_LEVEL
static final boolean APPLY_BONUS_XP
static final Dice ABILITY_DICE
static final int STARTING_AGE
int[] abilityScore
ArrayList<ClassRecord> classList
Armor armor
Armor shield
Weapon weaponInHand
ArrayList<Character.Feat> featList
static boolean useFeats
int age
public Armor getArmor()
public Armor getShield()
public void addEquipment(Equipment equip)
public void dropAllEquipment()
void createRandomAbilityScores()
int getAbilityBonus(Ability ability)
int getAbilityScore(Ability ability)
void adjustAbilityScores(int... modifiers)
void handleConChange(int oldCon)
void updateStats()
public ClassRecord getTopClass()
public int getHitDiceNum()
getHitDiceNum
in class Monster
int computeArmorClass()
int computeMoveInches()
Attack computeAttack()
int baseAttackBonus()
public int getMagicHitLevel()
getMagicHitLevel
in class Monster
public void setArmor(Armor armor)
public void setShield(Armor shield)
public void drawWeapon(Weapon weapon)
public void sheatheWeapon()
sheatheWeapon
in class Monster
public void drawBestWeapon(Monster monster)
drawBestWeapon
in class Monster
Weapon bestWeaponAgainst(Monster monster)
int maxDamageVsMonster(Monster monster)
public int totalXP()
public void addXP(int xp)
public void addXP(int XP, int classIdx)
int adjustForPrimeReq(int XP, ClassRecord cr)
public void loseLevel()
int findSupMaxHitPoints()
public static Character newNPCFromTitle(String title, Alignment align)
public void setBasicEquipment()
public void checkMagicArmsBoost(int percent)
checkMagicArmsBoost
in class Monster
public boolean rollSave(SavingThrows.SaveType type, int modifier)
ClassRecord bestClassForSave(SavingThrows.SaveType saveType)
public static void setFeatUsage(boolean permit)
public static boolean useFeats()
public boolean hasFeat(Character.Feat feat)
public void addFeat()
public void loseFeat()
public int getAge()
public void incrementAge(boolean ageEffects)
Character.AgeCategory getAgeCategory()
void ageAdjustAbilities()
void ageAdjustLevels()
public String toString()
String classString()
String abilityString()
String featString()
String formatFeat(Character.Feat feat)
String equipString()
public static void main(String[] args)