com.planet_ink.coffee_mud.Common
Class DefaultCharStats

java.lang.Object
  extended by com.planet_ink.coffee_mud.Common.DefaultCharStats
All Implemented Interfaces:
CharStats, CMCommon, CMObject, Modifiable, java.lang.Cloneable, java.lang.Comparable<CMObject>

public class DefaultCharStats
extends java.lang.Object
implements CharStats


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.Common.interfaces.CharStats
CharStats.CODES
 
Field Summary
protected  java.lang.String arriveStr
           
protected  short[] bodyAlterations
           
protected  int[] breathables
           
protected  java.lang.String displayClassLevel
           
protected  java.lang.String displayClassName
           
protected  java.lang.String genderName
           
protected  java.lang.String leaveStr
           
protected  CharClass[] myClasses
           
protected  java.lang.Integer[] myLevels
           
protected  Race myRace
           
protected  java.util.Map<java.lang.String,java.lang.Integer> profAdj
           
protected  DoubleFilterer<Item>[] proficiencies
           
protected  java.lang.String raceName
           
protected  short[] stats
           
protected  long unwearableBitmap
           
 
Fields inherited from interface com.planet_ink.coffee_mud.Common.interfaces.CharStats
DEFAULT_NUM_STATS, DEFAULT_STAT_ABBR, DEFAULT_STAT_DESC_ATTS, DEFAULT_STAT_DESCS, DEFAULT_STAT_MSG_MAP, DEFAULT_STAT_NAMES, STAT_AGE, STAT_CHARISMA, STAT_CONSTITUTION, STAT_CRIT_CHANCE_PCT_MAGIC, STAT_CRIT_CHANCE_PCT_WEAPON, STAT_CRIT_DAMAGE_PCT_MAGIC, STAT_CRIT_DAMAGE_PCT_WEAPON, STAT_DEXTERITY, STAT_FAITH, STAT_GENDER, STAT_INTELLIGENCE, STAT_MAX_CHARISMA_ADJ, STAT_MAX_CONSTITUTION_ADJ, STAT_MAX_DEXTERITY_ADJ, STAT_MAX_INTELLIGENCE_ADJ, STAT_MAX_STRENGTH_ADJ, STAT_MAX_WISDOM_ADJ, STAT_SAVE_ACID, STAT_SAVE_BLUNT, STAT_SAVE_CHANTS, STAT_SAVE_COLD, STAT_SAVE_DETECTION, STAT_SAVE_DISEASE, STAT_SAVE_ELECTRIC, STAT_SAVE_FIRE, STAT_SAVE_GAS, STAT_SAVE_GENERAL, STAT_SAVE_JUSTICE, STAT_SAVE_MAGIC, STAT_SAVE_MIND, STAT_SAVE_OVERLOOKING, STAT_SAVE_PARALYSIS, STAT_SAVE_PIERCE, STAT_SAVE_POISON, STAT_SAVE_PRAYERS, STAT_SAVE_SLASH, STAT_SAVE_SONGS, STAT_SAVE_SPELLS, STAT_SAVE_TRAPS, STAT_SAVE_UNDEAD, STAT_SAVE_WATER, STAT_STRENGTH, STAT_WEIGHTADJ, STAT_WISDOM, VALUE_ALLSTATS_DEFAULT
 
Constructor Summary
DefaultCharStats()
           
 
Method Summary
 void addItemDeficiency(java.lang.String zapperMask)
          Adds a new weapon or armor deficiency, compiling it into the deficiency filter.
 void addItemProficiency(java.lang.String zapperMask)
          Adds a new weapon or armor proficiency, compiling it into the proficiency filter.
 void adjStat(int statNum, int value)
          Adjusts the value of one of the STAT_ constants, representing attributes, saving throws, and max attributes, from the CharStats interface.
 void adjustAbilityAdjustment(java.lang.String ableID, int newValue)
          Sets the adjustments to mob abilities, whether proficiency or something else numeric.
 int ageCategory()
          Returns the age category for this mob, based on the age stat constant stored here.
 java.lang.String ageName()
          Returns the string name of the age category for this mob, based on the age stat constant stored here.
 void alterBodypart(int racialPartNumber, int deviation)
          Alter the number of a given body part which this mob has.
 int combinedLevels()
           
 int combinedSubLevels()
          Returns the combined number of class levels the mob has in all of his classes, except for the current one.
 int compareTo(CMObject o)
           
 void copyInto(CharStats intoStats)
          Copies the internal data of this object into another of kind.
 CMObject copyOf()
          Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed.
 java.lang.String displayClassLevel(MOB mob, boolean shortForm)
          Returns a combination of the displayClassName and displayClassLevel for the given mob.
 java.lang.String displayClassLevelOnly(MOB mob)
          Returns either the given mobs authentic classlevel/total level, or the value set through setDisplayClassLevel method.
 java.lang.String displayClassName()
          Returns the displayable name of this mobs current class.
 java.lang.String genderName()
          Returns the apparent gender of the mob.
 int getAbilityAdjustment(java.lang.String ableID)
          Returns the adjustments to mob abilities, whether proficiency or something else numeric.
 java.lang.String getArriveStr()
          Returns the term seen when a character arrives into a room By default, these come from the current actual race, unless set to something new.
 int getBodyPart(int racialPartNumber)
          Return the number of a given body part which this mob has.
 int getBodypartAlteration(int racialPartNumber)
          Check the difference between the number of a given body part which this mob has and the number he or she should have.
 java.lang.String getBodyPartsAsString()
          Returns the entire current body part situation as a string list.
 int[] getBreathables()
          Returns resource codes of what this race can breathe as an atmosphere.
 java.util.Collection<CharClass> getCharClasses()
          Returns all CharClass objects for this mob.
 int getClassLevel(CharClass aClass)
          Returns the number of levels this mob has in the given character class.
 int getClassLevel(java.lang.String aClass)
          Returns the number of levels this mob has in the given character class by name.
 int getCode(java.lang.String abilityName)
          This method cross-references the given stat name string with the STAT_DESCS string list in the CharStats interface to return the STAT_ constant which the given string represents.
 CharClass getCurrentClass()
          Returns the CharClass object for this mob which corresponds to the the final index.
 int getCurrentClassLevel()
          Returns the number of levels that this mob has in the CharClass object which corresponds to the final index.
 DoubleFilterer<Item>[] getItemProficiencies()
          Returns the list of special weapon or armor proficiencies, or special detriments, that this character has.
 java.lang.String getLeaveStr()
          Returns the term seen when a character leaves a room By default, these come from the current actual race, unless set to something new.
 int getMaxStat(int abilityCode)
          A method that simply calculates the nomimal max of the given ordinary stat code from available data.
 CharClass getMyClass(int i)
          Returns the CharClass object for this mob which corresponds to the the given index.
 java.lang.String getMyClassesStr()
          Returns the enumerated set of character class names stored here as a semicolon list of string names
 java.lang.String getMyLevelsStr()
          Returns the enumerated set of character class levels stored here as a semicolon list of levels.
 Race getMyRace()
          Returns the race of the mob.
 java.lang.String getNonBaseStatsAsString()
          Get saving throw and max stat info as an semicolon string list.
 int getRacialStat(MOB mob, int statNum)
          Get one of the basic attributes after racial adjustment.
 int getSave(int which)
          Uses the saving throw stats stored here the mob, modified by basic attributes, to return a final Saving Throw value for this mob.
 int getSaveStatIndex()
          Returns the index into the stat codes array where extra savable fields begins.
 int getStat(int abilityCode)
          Get the value of one of the STAT_ constants, representing attributes, saving throws, and max attributes, from the CharStats interface.
 java.lang.String getStat(java.lang.String abilityName)
          An alternative means of retreiving the values of those fields on this object which are modifiable at run-time by builders.
 java.lang.String[] getStatCodes()
          Returns an array of the string names of those fields which are modifiable on this object at run-time by builders.
 long getWearableRestrictionsBitmap()
          Returns the sum of local and race-based unwearability codes.
 java.lang.String heshe()
          Based on the apparent gender of the mob, return the appropriate word "he", "she", or "it".
 java.lang.String HeShe()
          Based on the apparent gender of the mob, return the appropriate word "He", "She", or "It".
 java.lang.String himher()
          Based on the apparent gender of the mob, return the appropriate word "him", "her", or "it".
 java.lang.String hisher()
          Based on the apparent gender of the mob, return the appropriate word "his", "her", or "its".
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
 void initializeClass()
          Called ONCE after all objects are loaded, but before the map is read in during initialization.
 boolean isLevelCapped(CharClass C)
          Returns true if this user is capped by the given classes level cap (if one exists)
 boolean isStat(java.lang.String code)
          An alternative means of retreiving the values of those fields on this object which are modifiable at run-time by builders.
 java.lang.String MisterMadam()
          Based on the apparent gender of the mob, return the appropriate word "Mister", or "Madam".
 java.lang.String MrMs()
          Based on the apparent gender of the mob, return the appropriate word "Mr.", or "Ms.".
 java.lang.String name()
          The displayable name of this object.
 CMObject newInstance()
          Returns a new instance of this class.
 int numClasses()
          Returns the number of character classes that this mob has 0 or more levels in.
 java.lang.String raceName()
          Returns the displayable name of this mobs current race.
 void reset()
          Resets all the stats in this object to their factory defaults.
 void setAllBaseValues(int def)
          Resets all of the basic 1-6 stats in this object, to the same given value
 void setAllValues(int def)
          Resets all of the stats in this object, attributes and saves alike, to the same given value
 void setArriveLeaveStr(java.lang.String arriveStr, java.lang.String leaveStr)
          Changes the terms seen when a character arrives into a room and leaves it.
 void setBodyPartsFromStringAfterRace(java.lang.String str)
          Sets the body part situation for this mob from a string list.
 void setBreathables(int[] newArray)
          Sets resource codes of what this race can breathe as an atmosphere.
 void setClassLevel(CharClass aClass, int level)
          Changes the number of class levels the mob has in the given character class to the given level.
 void setCurrentClass(CharClass aClass)
          Adds the character class to the mob to the given class, automatically making the class level 0, and making the class current.
 void setCurrentClassLevel(int level)
          Sets the current class level for the mob to the given level.
 void setDisplayClassLevel(java.lang.String newLevel)
          Changes the apparent level of ths mob by setting a new name.
 void setDisplayClassName(java.lang.String newName)
          Changes the apparent char class of ths mob by setting a new name.
 void setGenderName(java.lang.String gname)
          Sets the apparent gender of the mob.
 void setItemProficiencies(DoubleFilterer<Item>[] newArray)
          Sets the list of special weapon or armor proficiencies, or special detriments, that this character has.
 void setMyClasses(java.lang.String classes)
          Creates the enumerated set of character class objects stored here from a semicolon list of string names
 void setMyLevels(java.lang.String levels)
          Creates the enumerated set of character class levels stored here from a semicolon list of levels.
 void setMyRace(Race newVal)
          Sets the race of the mob.
 void setNonBaseStatsFromString(java.lang.String str)
          set saving throw and max stat info from a semicolon string list.
 void setPermanentStat(int abilityCode, int value)
          Set one of the basic attributes to a given value.
 void setRaceName(java.lang.String newRaceName)
          Changes the apparent race of ths mob by setting a new name.
 void setRacialStat(int abilityCode, int racialMax)
          Set one of the basic attributes to approx the value.
 void setStat(int abilityCode, int value)
          Set the value of one of the STAT_ constants, representing attributes, saving throws, and max attributes, from the CharStats interface.
 void setStat(java.lang.String code, java.lang.String val)
          An alternative means of setting the values of those fields on this object which are modifiable at run-time by builders.
 void setWearableRestrictionsBitmap(long bitmap)
          Sets the sum of local and race-based unwearability codes.
 java.lang.String sirmadam()
          Based on the apparent gender of the mob, return the appropriate word "sir", "madam", or "sir".
 java.lang.String SirMadam()
          Based on the apparent gender of the mob, return the appropriate word "Sir", "Madam", or "Sir".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stats

protected short[] stats

myClasses

protected CharClass[] myClasses

myLevels

protected java.lang.Integer[] myLevels

myRace

protected Race myRace

raceName

protected java.lang.String raceName

genderName

protected java.lang.String genderName

displayClassName

protected java.lang.String displayClassName

displayClassLevel

protected java.lang.String displayClassLevel

bodyAlterations

protected short[] bodyAlterations

unwearableBitmap

protected long unwearableBitmap

breathables

protected int[] breathables

arriveStr

protected java.lang.String arriveStr

leaveStr

protected java.lang.String leaveStr

profAdj

protected java.util.Map<java.lang.String,java.lang.Integer> profAdj

proficiencies

protected DoubleFilterer<Item>[] proficiencies
Constructor Detail

DefaultCharStats

public DefaultCharStats()
Method Detail

ID

public java.lang.String ID()
Description copied from interface: CMObject
The CoffeeMud Java Class ID shared by all instances of this object. Unlike the Java Class name, this method does not include package information. However, it must return a String value unique to its class category in the ClassLoader. Class categories include Libraries, Common, Areas, Abilities, Behaviors, CharClasses, Commands, Exits Locales, MOBS, Races, WebMacros, Basic Items, Armor, Weapons, ClanItems, Tech. The name is typically identical to the class name.

Specified by:
ID in interface CMObject
Returns:
the name of this class

name

public java.lang.String name()
Description copied from interface: CMObject
The displayable name of this object. May be modified by phyStats() object. Is derived from the Name().

Specified by:
name in interface CMObject
Returns:
the modified final name of this object on the map.
See Also:
Environmental.Name()

newInstance

public CMObject newInstance()
Description copied from interface: CMObject
Returns a new instance of this class.

Specified by:
newInstance in interface CMObject
Returns:
a new instance of this class

initializeClass

public void initializeClass()
Description copied from interface: CMObject
Called ONCE after all objects are loaded, but before the map is read in during initialization.

Specified by:
initializeClass in interface CMObject

setAllBaseValues

public void setAllBaseValues(int def)
Description copied from interface: CharStats
Resets all of the basic 1-6 stats in this object, to the same given value

Specified by:
setAllBaseValues in interface CharStats
Parameters:
def - the value to set all stats to.

setAllValues

public void setAllValues(int def)
Description copied from interface: CharStats
Resets all of the stats in this object, attributes and saves alike, to the same given value

Specified by:
setAllValues in interface CharStats
Parameters:
def - the value to set all stats to.

reset

public void reset()
Description copied from interface: CharStats
Resets all the stats in this object to their factory defaults.

Specified by:
reset in interface CharStats

copyInto

public void copyInto(CharStats intoStats)
Description copied from interface: CharStats
Copies the internal data of this object into another of kind.

Specified by:
copyInto in interface CharStats
Parameters:
intoStats - another CharStats object.

setMyClasses

public void setMyClasses(java.lang.String classes)
Description copied from interface: CharStats
Creates the enumerated set of character class objects stored here from a semicolon list of string names

Specified by:
setMyClasses in interface CharStats
Parameters:
classes - the semicolon list of character class names

setMyLevels

public void setMyLevels(java.lang.String levels)
Description copied from interface: CharStats
Creates the enumerated set of character class levels stored here from a semicolon list of levels.

Specified by:
setMyLevels in interface CharStats
Parameters:
levels - the semicolon list of levels

getMyClassesStr

public java.lang.String getMyClassesStr()
Description copied from interface: CharStats
Returns the enumerated set of character class names stored here as a semicolon list of string names

Specified by:
getMyClassesStr in interface CharStats
Returns:
the semicolon list of character class names

getMyLevelsStr

public java.lang.String getMyLevelsStr()
Description copied from interface: CharStats
Returns the enumerated set of character class levels stored here as a semicolon list of levels.

Specified by:
getMyLevelsStr in interface CharStats
Returns:
levels the semicolon list of levels

getArriveStr

public java.lang.String getArriveStr()
Description copied from interface: CharStats
Returns the term seen when a character arrives into a room By default, these come from the current actual race, unless set to something new.

Specified by:
getArriveStr in interface CharStats
Returns:
the arrive string
See Also:
Race, CharStats.setArriveLeaveStr(String,String)

getLeaveStr

public java.lang.String getLeaveStr()
Description copied from interface: CharStats
Returns the term seen when a character leaves a room By default, these come from the current actual race, unless set to something new.

Specified by:
getLeaveStr in interface CharStats
Returns:
the leave string
See Also:
Race, CharStats.setArriveLeaveStr(String,String)

setArriveLeaveStr

public void setArriveLeaveStr(java.lang.String arriveStr,
                              java.lang.String leaveStr)
Description copied from interface: CharStats
Changes the terms seen when a character arrives into a room and leaves it. By default, these come from the current actual race.

Specified by:
setArriveLeaveStr in interface CharStats
Parameters:
arriveStr - the arrive string
leaveStr - the leave string
See Also:
Race, CharStats.getArriveStr(), CharStats.getLeaveStr()

getWearableRestrictionsBitmap

public long getWearableRestrictionsBitmap()
Description copied from interface: CharStats
Returns the sum of local and race-based unwearability codes.

Specified by:
getWearableRestrictionsBitmap in interface CharStats
Returns:
a bitmap of unwearable locations
See Also:
Item

setWearableRestrictionsBitmap

public void setWearableRestrictionsBitmap(long bitmap)
Description copied from interface: CharStats
Sets the sum of local and race-based unwearability codes.

Specified by:
setWearableRestrictionsBitmap in interface CharStats
Parameters:
bitmap - a bitmap of unwearable locations
See Also:
Item

numClasses

public int numClasses()
Description copied from interface: CharStats
Returns the number of character classes that this mob has 0 or more levels in.

Specified by:
numClasses in interface CharStats
Returns:
number of character classes

combinedSubLevels

public int combinedSubLevels()
Description copied from interface: CharStats
Returns the combined number of class levels the mob has in all of his classes, except for the current one.

Specified by:
combinedSubLevels in interface CharStats
Returns:
combined levels minus the current one.

combinedLevels

public int combinedLevels()

setDisplayClassName

public void setDisplayClassName(java.lang.String newName)
Description copied from interface: CharStats
Changes the apparent char class of ths mob by setting a new name. A value of null will reset this setting, allowing the mobs TRUE current class to be displayed through the displayClassName method instead of the string set through this one.

Specified by:
setDisplayClassName in interface CharStats
Parameters:
newName - the name of the mobs apparent current class
See Also:
CharClass, CharStats.displayClassName(), CharStats.displayClassLevel(MOB, boolean), CharStats.displayClassLevelOnly(MOB)

displayClassName

public java.lang.String displayClassName()
Description copied from interface: CharStats
Returns the displayable name of this mobs current class. If this method is called on the mobs charStats() object, as opposed to baseCharStats(), it may return something different than charStats().getCurrentClass().name(). For this reason, you should ONLY use this method when you want to display the mobs current class.

Specified by:
displayClassName in interface CharStats
Returns:
the name of this mobs current class.
See Also:
CharClass, CharStats.setDisplayClassName(String), CharStats.displayClassLevel(MOB, boolean), CharStats.displayClassLevelOnly(MOB)

setDisplayClassLevel

public void setDisplayClassLevel(java.lang.String newLevel)
Description copied from interface: CharStats
Changes the apparent level of ths mob by setting a new name. A value of null will reset this setting, allowing the mobs TRUE level to be displayed through the displayClassLevel method instead of the string set through this one.

Specified by:
setDisplayClassLevel in interface CharStats
Parameters:
newLevel - the name of the mobs apparent level
See Also:
CharClass, CharStats.displayClassName(), CharStats.displayClassLevel(MOB, boolean), CharStats.displayClassLevelOnly(MOB), CharStats.setDisplayClassName(String)

displayClassLevel

public java.lang.String displayClassLevel(MOB mob,
                                          boolean shortForm)
Description copied from interface: CharStats
Returns a combination of the displayClassName and displayClassLevel for the given mob. If either are null, authentic values will be used.

Specified by:
displayClassLevel in interface CharStats
Parameters:
mob - the mob whose class and overall level to display
shortForm - if true, display only the class and level, no extra wording
Returns:
the name of this mobs current class.
See Also:
CharClass, CharStats.displayClassName(), CharStats.setDisplayClassName(String), CharStats.displayClassLevelOnly(MOB)

displayClassLevelOnly

public java.lang.String displayClassLevelOnly(MOB mob)
Description copied from interface: CharStats
Returns either the given mobs authentic classlevel/total level, or the value set through setDisplayClassLevel method.

Specified by:
displayClassLevelOnly in interface CharStats
Parameters:
mob - the mob whose class and overall level to display
Returns:
the name of this mobs current class.
See Also:
CharClass, CharStats.displayClassName(), CharStats.setDisplayClassName(String), CharStats.displayClassLevel(MOB, boolean)

getNonBaseStatsAsString

public java.lang.String getNonBaseStatsAsString()
Description copied from interface: CharStats
Get saving throw and max stat info as an semicolon string list.

Specified by:
getNonBaseStatsAsString in interface CharStats
Returns:
semicolon string

setNonBaseStatsFromString

public void setNonBaseStatsFromString(java.lang.String str)
Description copied from interface: CharStats
set saving throw and max stat info from a semicolon string list.

Specified by:
setNonBaseStatsFromString in interface CharStats
Parameters:
str - semicolon string

setRaceName

public void setRaceName(java.lang.String newRaceName)
Description copied from interface: CharStats
Changes the apparent race of ths mob by setting a new name. A value of null will reset this setting, allowing the mobs TRUE race to be displayed through the raceName method instead of the string set through this one.

Specified by:
setRaceName in interface CharStats
Parameters:
newRaceName - the name of the mobs apparent race
See Also:
Race, CharStats.raceName()

raceName

public java.lang.String raceName()
Description copied from interface: CharStats
Returns the displayable name of this mobs current race. If this method is called on the mobs charStats() object, as opposed to baseCharStats(), it may return something different than charStats().getMyRace().name(). For this reason, you should ONLY use this method when you want to display the mobs current race.

Specified by:
raceName in interface CharStats
Returns:
the name of this mobs current race.
See Also:
Race, CharStats.setRaceName(String)

getMyClass

public CharClass getMyClass(int i)
Description copied from interface: CharStats
Returns the CharClass object for this mob which corresponds to the the given index. The oldest class is always indexed at 0, with next newest at 1, and the current one last.

Specified by:
getMyClass in interface CharStats
Parameters:
i - the index into the charclass list.
Returns:
the CharClass object
See Also:
CharClass

getClassLevel

public int getClassLevel(java.lang.String aClass)
Description copied from interface: CharStats
Returns the number of levels this mob has in the given character class by name. -1 means the mob has NO levels in that class.

Specified by:
getClassLevel in interface CharStats
Parameters:
aClass - the name of the Character Class to check
Returns:
the number of levels the mob has in the class, or -1
See Also:
CharClass

getClassLevel

public int getClassLevel(CharClass aClass)
Description copied from interface: CharStats
Returns the number of levels this mob has in the given character class. -1 means the mob has NO levels in that class.

Specified by:
getClassLevel in interface CharStats
Parameters:
aClass - the CharClass object to check
Returns:
the number of levels the mob has in the class, or -1
See Also:
CharClass

setClassLevel

public void setClassLevel(CharClass aClass,
                          int level)
Description copied from interface: CharStats
Changes the number of class levels the mob has in the given character class to the given level. If the mob does not have any levels in the given class, then setCurrentClass will be called first.

Specified by:
setClassLevel in interface CharStats
Parameters:
aClass - the character class to set a level for
level - the level to set for the given character class
See Also:
CharStats.setCurrentClass(CharClass), CharClass

isLevelCapped

public boolean isLevelCapped(CharClass C)
Description copied from interface: CharStats
Returns true if this user is capped by the given classes level cap (if one exists)

Specified by:
isLevelCapped in interface CharStats
Parameters:
C - the class to check
Returns:
true if the player is level capped, false otherwise
See Also:
CharClass.getLevelCap()

setCurrentClassLevel

public void setCurrentClassLevel(int level)
Description copied from interface: CharStats
Sets the current class level for the mob to the given level.

Specified by:
setCurrentClassLevel in interface CharStats
Parameters:
level - The chararacter class level to set the current class to

setCurrentClass

public void setCurrentClass(CharClass aClass)
Description copied from interface: CharStats
Adds the character class to the mob to the given class, automatically making the class level 0, and making the class current.

Specified by:
setCurrentClass in interface CharStats
Parameters:
aClass - The charclass object to set the current class to
See Also:
CharStats.getCurrentClass(), CharClass

getCurrentClass

public CharClass getCurrentClass()
Description copied from interface: CharStats
Returns the CharClass object for this mob which corresponds to the the final index. The oldest class is always indexed at 0, with next newest at 1, and the current one last.

Specified by:
getCurrentClass in interface CharStats
Returns:
the 0 index CharClass object
See Also:
CharStats.numClasses(), CharStats.getCharClasses(), CharClass

getCharClasses

public java.util.Collection<CharClass> getCharClasses()
Description copied from interface: CharStats
Returns all CharClass objects for this mob. The oldest class is always indexed at 0, with next newest at 1, and the current one last.

Specified by:
getCharClasses in interface CharStats
Returns:
the Collection of CharClass objects
See Also:
CharStats.numClasses(), CharClass

getCurrentClassLevel

public int getCurrentClassLevel()
Description copied from interface: CharStats
Returns the number of levels that this mob has in the CharClass object which corresponds to the final index. The oldest class is always indexed at 0, with next newest at 1, and the current one last.

Specified by:
getCurrentClassLevel in interface CharStats
Returns:
the number of levels in the 0 index class
See Also:
CharStats.numClasses()

getMyRace

public Race getMyRace()
Description copied from interface: CharStats
Returns the race of the mob.

Specified by:
getMyRace in interface CharStats
Returns:
the Race of the mob
See Also:
Race

setMyRace

public void setMyRace(Race newVal)
Description copied from interface: CharStats
Sets the race of the mob. Race.startRacing should be called after this method is.

Specified by:
setMyRace in interface CharStats
Parameters:
newVal - the Race of the mob
See Also:
Race.startRacing(MOB, boolean), Race

getBreathables

public int[] getBreathables()
Description copied from interface: CharStats
Returns resource codes of what this race can breathe as an atmosphere. The list is guaranteed sorted. If the list is empty, the race can breathe anything at all.

Specified by:
getBreathables in interface CharStats
Returns:
a list of resource codes that this race can breathe
See Also:
RawMaterial, CharStats.setBreathables(int[])

setBreathables

public void setBreathables(int[] newArray)
Description copied from interface: CharStats
Sets resource codes of what this race can breathe as an atmosphere. The list MUST BE sorted. If the list is empty, the race can breathe anything at all.

Specified by:
setBreathables in interface CharStats
Parameters:
newArray - a list of resource codes that this race can breathe
See Also:
RawMaterial, CharStats.getBreathables()

getBodyPart

public int getBodyPart(int racialPartNumber)
Description copied from interface: CharStats
Return the number of a given body part which this mob has. The racial part number comes from the Race interface BODY_ constants.

Specified by:
getBodyPart in interface CharStats
Parameters:
racialPartNumber - the BODY_ constant from Race interface
Returns:
the number of the given body part this mob has
See Also:
Race

getBodyPartsAsString

public java.lang.String getBodyPartsAsString()
Description copied from interface: CharStats
Returns the entire current body part situation as a string list.

Specified by:
getBodyPartsAsString in interface CharStats
Returns:
the body parts alteration list

setBodyPartsFromStringAfterRace

public void setBodyPartsFromStringAfterRace(java.lang.String str)
Description copied from interface: CharStats
Sets the body part situation for this mob from a string list. The name is a reminder to make sure the mobs Race is established first.

Specified by:
setBodyPartsFromStringAfterRace in interface CharStats
Parameters:
str - the string list representing the body part situation

getBodypartAlteration

public int getBodypartAlteration(int racialPartNumber)
Description copied from interface: CharStats
Check the difference between the number of a given body part which this mob has and the number he or she should have. The racial part number comes from the Race interface BODY_ constants. The return value is positive or negative reflecting the change.

Specified by:
getBodypartAlteration in interface CharStats
Parameters:
racialPartNumber - the BODY_ constant from Race interface
Returns:
the difference between parts he has and should have
See Also:
Race

alterBodypart

public void alterBodypart(int racialPartNumber,
                          int deviation)
Description copied from interface: CharStats
Alter the number of a given body part which this mob has. The racial part number comes from the Race interface BODY_ constants. The number is positive or negative reflecting the change.

Specified by:
alterBodypart in interface CharStats
Parameters:
racialPartNumber - the BODY_ constant from Race interface
deviation - the amount to change by, positive or negative
See Also:
Race

ageCategory

public int ageCategory()
Description copied from interface: CharStats
Returns the age category for this mob, based on the age stat constant stored here. The age categories are defined in the Race interface as AGE_ constants.

Specified by:
ageCategory in interface CharStats
Returns:
the numeric age category of this mob
See Also:
Race

ageName

public java.lang.String ageName()
Description copied from interface: CharStats
Returns the string name of the age category for this mob, based on the age stat constant stored here. The age category names are defined in the Race interface in the AGE_DESCS_ constant.

Specified by:
ageName in interface CharStats
Returns:
the name of the age category for this mob
See Also:
Race.AGE_DESCS

getSave

public int getSave(int which)
Description copied from interface: CharStats
Uses the saving throw stats stored here the mob, modified by basic attributes, to return a final Saving Throw value for this mob.

Specified by:
getSave in interface CharStats
Parameters:
which - which STAT_SAVE_ constant from CharStats interface to use
Returns:
the final saving throw value
See Also:
CharStats

copyOf

public CMObject copyOf()
Description copied from interface: CMObject
Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed.

Specified by:
copyOf in interface CMObject
Returns:
a clone of this object

getAbilityAdjustment

public int getAbilityAdjustment(java.lang.String ableID)
Description copied from interface: CharStats
Returns the adjustments to mob abilities, whether proficiency or something else numeric. Ability adjustments begin with "prof+" to adjust proficiency. They begin with "level+" to adjust the adjusted level. The are followed by the exact ID() of the ability, or * for All, or the skill classification name in uppercase, or the domain name in uppercase.

Specified by:
getAbilityAdjustment in interface CharStats
Parameters:
ableID - the ability ID, with an appropriate prefix
Returns:
the numeric value associated with the adjustment.

adjustAbilityAdjustment

public void adjustAbilityAdjustment(java.lang.String ableID,
                                    int newValue)
Description copied from interface: CharStats
Sets the adjustments to mob abilities, whether proficiency or something else numeric. Ability adjustments begin with "prof+" to adjust proficiency. They begin with "level+" to adjust the adjusted level. The are followed by the exact ID() of the ability, or * for All, or the skill classification name in uppercase, or the domain name in uppercase.

Specified by:
adjustAbilityAdjustment in interface CharStats
Parameters:
ableID - the ability ID, with an appropriate prefix
newValue - the numeric value associated with the adjustment.

setGenderName

public void setGenderName(java.lang.String gname)
Description copied from interface: CharStats
Sets the apparent gender of the mob. If null is used, this value is reset and the mobs real gender name will be displayed through the genderName method instead of the one set here.

Specified by:
setGenderName in interface CharStats
Parameters:
gname - the name of the mobs gender to display
See Also:
CharStats.genderName()

genderName

public java.lang.String genderName()
Description copied from interface: CharStats
Returns the apparent gender of the mob. If this method is called on the mobs charStats() object, as opposed to baseCharStats(), it may return something different than charStats().getStat(GENDER) For this reason, you should ONLY use this method when you want to display the mobs current gender.

Specified by:
genderName in interface CharStats
Returns:
the apparent gender of the mob
See Also:
CharStats.setGenderName(String)

himher

public java.lang.String himher()
Description copied from interface: CharStats
Based on the apparent gender of the mob, return the appropriate word "him", "her", or "it".

Specified by:
himher in interface CharStats
Returns:
the gender-correct pronoun for this mob

hisher

public java.lang.String hisher()
Description copied from interface: CharStats
Based on the apparent gender of the mob, return the appropriate word "his", "her", or "its".

Specified by:
hisher in interface CharStats
Returns:
the gender-correct pronoun for this mob

heshe

public java.lang.String heshe()
Description copied from interface: CharStats
Based on the apparent gender of the mob, return the appropriate word "he", "she", or "it".

Specified by:
heshe in interface CharStats
Returns:
the gender-correct pronoun for this mob

sirmadam

public java.lang.String sirmadam()
Description copied from interface: CharStats
Based on the apparent gender of the mob, return the appropriate word "sir", "madam", or "sir".

Specified by:
sirmadam in interface CharStats
Returns:
the gender-correct title for this mob

SirMadam

public java.lang.String SirMadam()
Description copied from interface: CharStats
Based on the apparent gender of the mob, return the appropriate word "Sir", "Madam", or "Sir".

Specified by:
SirMadam in interface CharStats
Returns:
the gender-correct title for this mob

MrMs

public java.lang.String MrMs()
Description copied from interface: CharStats
Based on the apparent gender of the mob, return the appropriate word "Mr.", or "Ms.".

Specified by:
MrMs in interface CharStats
Returns:
the gender-correct title for this mob

MisterMadam

public java.lang.String MisterMadam()
Description copied from interface: CharStats
Based on the apparent gender of the mob, return the appropriate word "Mister", or "Madam".

Specified by:
MisterMadam in interface CharStats
Returns:
the gender-correct title for this mob

HeShe

public java.lang.String HeShe()
Description copied from interface: CharStats
Based on the apparent gender of the mob, return the appropriate word "He", "She", or "It".

Specified by:
HeShe in interface CharStats
Returns:
the gender-correct pronoun for this mob

getStat

public int getStat(int abilityCode)
Description copied from interface: CharStats
Get the value of one of the STAT_ constants, representing attributes, saving throws, and max attributes, from the CharStats interface.

Specified by:
getStat in interface CharStats
Parameters:
abilityCode - which STAT_ constant to get a value for
Returns:
the value of the given STAT
See Also:
CharStats

setPermanentStat

public void setPermanentStat(int abilityCode,
                             int value)
Description copied from interface: CharStats
Set one of the basic attributes to a given value. The basic attributes are defined as the first 6 STAT_ constants from the CharStats interface. Using this method will also update the STAT_MAX_* attributes to make sure that they are not able to be modifed upwards.

Specified by:
setPermanentStat in interface CharStats
Parameters:
abilityCode - which STAT_ constant to get a value for
value - the value of the given STAT
See Also:
CharStats

getMaxStat

public int getMaxStat(int abilityCode)
Description copied from interface: CharStats
A method that simply calculates the nomimal max of the given ordinary stat code from available data.

Specified by:
getMaxStat in interface CharStats
Parameters:
abilityCode - (str, int, etc)
Returns:
the max stat.

getRacialStat

public int getRacialStat(MOB mob,
                         int statNum)
Description copied from interface: CharStats
Get one of the basic attributes after racial adjustment.

Specified by:
getRacialStat in interface CharStats
Parameters:
mob - the mob to get adjustments for
statNum - which STAT_ constant to get
Returns:
the value
See Also:
CharStats

setRacialStat

public void setRacialStat(int abilityCode,
                          int racialMax)
Description copied from interface: CharStats
Set one of the basic attributes to approx the value. The basic attributes are defined as the first 6 STAT_ constants from the CharStats interface. Using this method will also update the STAT_MAX_* attributes to make sure that they are not able to be trained upwards.

Specified by:
setRacialStat in interface CharStats
Parameters:
abilityCode - which STAT_ constant to get an approx value for
racialMax - the value of the max, and approxvalue of the given STAT
See Also:
CharStats

setStat

public void setStat(int abilityCode,
                    int value)
Description copied from interface: CharStats
Set the value of one of the STAT_ constants, representing attributes, saving throws, and max attributes, from the CharStats interface.

Specified by:
setStat in interface CharStats
Parameters:
abilityCode - which STAT_ constant to get a value for
value - the value of the given STAT
See Also:
CharStats

adjStat

public void adjStat(int statNum,
                    int value)
Description copied from interface: CharStats
Adjusts the value of one of the STAT_ constants, representing attributes, saving throws, and max attributes, from the CharStats interface.

Specified by:
adjStat in interface CharStats
Parameters:
statNum - which STAT_ constant to adjust
value - the amount + or -, to adjust by
See Also:
CharStats

getCode

public int getCode(java.lang.String abilityName)
Description copied from interface: CharStats
This method cross-references the given stat name string with the STAT_DESCS string list in the CharStats interface to return the STAT_ constant which the given string represents.

Specified by:
getCode in interface CharStats
Parameters:
abilityName - name of which constant to determine the STAT_ constant for
Returns:
the STAT_ constant value from CharStats interface
See Also:
CharStats

compareTo

public int compareTo(CMObject o)
Specified by:
compareTo in interface java.lang.Comparable<CMObject>

getSaveStatIndex

public int getSaveStatIndex()
Description copied from interface: Modifiable
Returns the index into the stat codes array where extra savable fields begins. This number is always the same as getStatCodes().length unless there are extra fields which need to be saved in xml for generic objects. This method is used by editors for post-build user-defined fields.

Specified by:
getSaveStatIndex in interface Modifiable
Returns:
the index into getStatCodes()
See Also:
Modifiable.getStatCodes(), Modifiable.getStat(String), Modifiable.setStat(String, String)

getStat

public java.lang.String getStat(java.lang.String abilityName)
Description copied from interface: Modifiable
An alternative means of retreiving the values of those fields on this object which are modifiable at run-time by builders. See getStatCodes() for possible values for the code passed to this method. Values returned are always strings, even if the field itself is numeric or a list.

Specified by:
getStat in interface Modifiable
Parameters:
abilityName - the name of the field to read.
Returns:
the value of the field read
See Also:
Modifiable.getStatCodes()

getStatCodes

public java.lang.String[] getStatCodes()
Description copied from interface: Modifiable
Returns an array of the string names of those fields which are modifiable on this object at run-time by builders.

Specified by:
getStatCodes in interface Modifiable
Returns:
list of the fields which may be set.
See Also:
Modifiable.getStat(String), Modifiable.setStat(String, String)

isStat

public boolean isStat(java.lang.String code)
Description copied from interface: Modifiable
An alternative means of retreiving the values of those fields on this object which are modifiable at run-time by builders. See getStatCodes() for possible values for the code passed to this method. Values returned are always strings, even if the field itself is numeric or a list.

Specified by:
isStat in interface Modifiable
Parameters:
code - the name of the field to read.
Returns:
true if the code is a real value, false otherwise
See Also:
Modifiable.getStatCodes()

setStat

public void setStat(java.lang.String code,
                    java.lang.String val)
Description copied from interface: Modifiable
An alternative means of setting the values of those fields on this object which are modifiable at run-time by builders. See getStatCodes() for possible values for the code passed to this method. The value passed in is always a string, even if the field itself is numeric or a list.

Specified by:
setStat in interface Modifiable
Parameters:
code - the name of the field to set
val - the value to set the field to
See Also:
Modifiable.getStatCodes()

getItemProficiencies

public DoubleFilterer<Item>[] getItemProficiencies()
Description copied from interface: CharStats
Returns the list of special weapon or armor proficiencies, or special detriments, that this character has. Each one is a filterer which, if passes, means the character can always use the armor or weapon, even if class or race or other considerations might not permit it.

Specified by:
getItemProficiencies in interface CharStats
Returns:
a list of proficiency or deficiency codes
See Also:
CharStats.setItemProficiencies(DoubleFilterer[])

setItemProficiencies

public void setItemProficiencies(DoubleFilterer<Item>[] newArray)
Description copied from interface: CharStats
Sets the list of special weapon or armor proficiencies, or special detriments, that this character has. Each one is a filterer which, if passes, means the character can always use the armor or weapon, even if class or race or other considerations might not permit it.

Specified by:
setItemProficiencies in interface CharStats
Parameters:
newArray - a list of proficiency or deficiency codes
See Also:
CharStats.getItemProficiencies(), CharStats.addItemDeficiency(String), CharStats.addItemProficiency(String)

addItemProficiency

public void addItemProficiency(java.lang.String zapperMask)
Description copied from interface: CharStats
Adds a new weapon or armor proficiency, compiling it into the proficiency filter. The argument is a zapper mask describing the type of item that the player is newly proficient at.

Specified by:
addItemProficiency in interface CharStats
Parameters:
zapperMask - the zapper mask
See Also:
CharStats.getItemProficiencies(), CharStats.addItemDeficiency(String), MaskingLibrary

addItemDeficiency

public void addItemDeficiency(java.lang.String zapperMask)
Description copied from interface: CharStats
Adds a new weapon or armor deficiency, compiling it into the deficiency filter. The argument is a zapper mask describing the type of item that the player is newly deficient at.

Specified by:
addItemDeficiency in interface CharStats
Parameters:
zapperMask - the zapper mask
See Also:
CharStats.getItemProficiencies(), CharStats.addItemProficiency(String), MaskingLibrary