com.planet_ink.coffee_mud.Races
Class StdRace

java.lang.Object
  extended by com.planet_ink.coffee_mud.Races.StdRace
All Implemented Interfaces:
CMObject, Modifiable, MsgListener, StatsAffecting, Tickable, Race, java.lang.Cloneable, java.lang.Comparable<CMObject>
Direct Known Subclasses:
Aarakocran, AirElemental, Animal, Arachnid, Avariel, Bat, Bear, Beaver, Beholder, Bird, Bullywug, Cat, Centaur, Centipede, Chicken, Cow, Crab, Cricket, Deer, Deva, Dog, Doll, Draconian, Dragon, Dryad, Dwarf, EarthElemental, ElectricityElemental, Elf, Equine, FaerieDragon, Fido, FireElemental, Fish, Fox, Frog, GenRace, Giant, GiantAnimal, GiantInsect, GiantLizard, GiantScorpion, GiantSpider, GiantTurtle, GiantWorm, Gnoll, Gnome, Goat, Goblin, Grasshopper, GreatAmphibian, GreatBird, GreatCat, GreatLizard, GrizzlyBear, HalfElf, Halfling, Hobbit, Hobgoblin, Human, Humanoid, Insect, Kobold, Lizard, LizardMan, ManScorpion, Mephit, Merfolk, MetalGolem, Millipede, Minotaur, Mold, Monkey, Moose, Nymph, Orc, Owl, Pachyderm, Penguin, Pig, Planetar, PolarBear, Rabbit, Raven, Rodent, Scarab, SchoolMonster, Scorpion, SeaHorse, Selkie, Shambler, Sheep, Slime, SmallElfKin, Smurf, Snake, Solar, SongBird, Spider, Stone, StoneGolem, Svirfneblin, Tarantula, Toadstool, TreeGolem, Troll, Tumbleweed, Turtle, UmberHulk, Undead, Unicorn, Unique, Vine, WaterElemental, WaterFowl, Wemic, WereAmphibian, WereAnimal, Wolf, WoodGolem, Worm, Wyvern

public class StdRace
extends java.lang.Object
implements Race


Field Summary
protected  java.lang.String abilitiesDesc
           
protected  java.lang.String baseStatChgDesc
           
protected static int[] breatheAirArray
           
protected static int[] breatheAirWaterArray
           
protected static int[] breatheAnythingArray
           
protected static int[] breatheWaterArray
           
protected static java.lang.String[] CODES
           
protected  java.lang.String dispChgDesc
           
protected static java.util.List empty
           
protected static SearchIDList emptyIDs
           
protected  java.lang.String languagesDesc
           
protected  boolean mappedCulturalAbilities
           
protected  java.util.Set<java.lang.String> naturalAbilImmunities
           
protected  Weapon naturalWeapon
           
protected  java.util.List<Weapon> naturalWeaponChoices
           
protected  java.util.List<Item> outfitChoices
           
protected  java.util.Map<java.lang.Integer,SearchIDList<Ability>> racialAbilityMap
           
protected  java.util.Map<java.lang.Integer,SearchIDList<Ability>> racialEffectMap
           
protected  java.lang.String sensesChgDesc
           
protected  int usageCount
           
 
Fields inherited from interface com.planet_ink.coffee_mud.Races.interfaces.Race
AGE_ANCIENT, AGE_CHILD, AGE_DESCS, AGE_INFANT, AGE_MATURE, AGE_MIDDLEAGED, AGE_OLD, AGE_TODDLER, AGE_VENERABLE, AGE_YOUNGADULT, BODY_ANTENEA, BODY_ARM, BODY_EAR, BODY_EYE, BODY_FOOT, BODY_GILL, BODY_HAND, BODY_HEAD, BODY_LEG, BODY_MOUTH, BODY_NECK, BODY_NOSE, BODY_PARTS, BODY_TAIL, BODY_TORSO, BODY_WAIST, BODY_WEARGRID, BODY_WEARVECTOR, BODY_WING, BODYPARTHASH, BODYPARTHASH_RL_LOWER, BODYPARTSTR, GENFLAG_DESCS, GENFLAG_INFATIGUEABLE, GENFLAG_NOCHARM, GENFLAG_NOCLASS, GENFLAG_NOEXP, GENFLAG_NOFERTILE, GENFLAG_NOLEVELS, YEARS_AGE_LIVES_FOREVER
 
Fields inherited from interface com.planet_ink.coffee_mud.core.interfaces.Tickable
STATUS_AFFECT, STATUS_ALIVE, STATUS_BEHAVIOR, STATUS_CLASS, STATUS_DEAD, STATUS_END, STATUS_FIGHT, STATUS_MISC, STATUS_MISC2, STATUS_MISC3, STATUS_MISC4, STATUS_MISC5, STATUS_MISC6, STATUS_MISC7, STATUS_NOT, STATUS_OTHER, STATUS_RACE, STATUS_REBIRTH, STATUS_SCRIPT, STATUS_START, STATUS_WEATHER, TICKID_AREA, TICKID_BEAMWEAPON, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, TICKID_EXIT_BEHAVIOR, TICKID_EXIT_REOPEN, TICKID_ITEM_BEHAVIOR, TICKID_ITEM_BOUNCEBACK, TICKID_LIGHT_FLICKERS, TICKID_LIVEAUCTION, TICKID_LONGERMASK, TICKID_MISCELLANEOUS, TICKID_MOB, TICKID_PROPERTY_SPECIAL, TICKID_QUEST, TICKID_READYTOSTOP, TICKID_ROOM_BEHAVIOR, TICKID_ROOM_ITEM_REJUV, TICKID_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET
 
Constructor Summary
StdRace()
           
 
Method Summary
 java.lang.String[] abilityImmunities()
          Returns the list of ability IDs of skills that this race is flatly and quietly immune to, whether malicious or not -- it just won't happen.
 int adjustExperienceGain(MOB host, MOB mob, MOB victim, int amount)
          Whenever a player or mob of this race gains experience, this method gets a chance to modify the amount before the gain actually occurs.
 void affectCharState(MOB affectedMob, CharState affectableMaxState)
          This method is called by the recoverCharState() method on other MOB objects.
 void affectCharStats(MOB affectedMob, CharStats charStats)
          This method is called by the recoverCharStats() method on other MOB objects.
 void affectPhyStats(Physical affected, PhyStats affectableStats)
          This method is called by the recoverPhyStats() method on other Environmental objects.
 void agingAffects(MOB mob, CharStats baseStats, CharStats charStats)
          Apply any affects of the given mob at the given age to the given base and/or current char stats.
 java.lang.String arriveStr()
          Returns the string describing what folks see when a member of this race enters a room.
 int availabilityCode()
          Returns one or a combination of the Area.THEME_* constants from the Area interface.
 int[] bodyMask()
          Returns an array indexed by body part codes as defined by the BODY_* constants in the Race interface.
 boolean canBreedWith(Race R)
          Returns true if the given race is actually the same as the current race.
 boolean classless()
          Whether this race can be associated with a character class.
protected  void clrStatChgDesc()
           
 int compareTo(CMObject o)
           
 CMObject copyOf()
          Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed.
 QuadVector<java.lang.String,java.lang.Integer,java.lang.Integer,java.lang.Boolean> culturalAbilities()
          Return a vector of skills, spells, and other ability ids granted to the given mob when they are created as this race.
protected  boolean[] culturalAbilityAutoGains()
           
protected  int[] culturalAbilityLevels()
           
protected  java.lang.String[] culturalAbilityNames()
           
protected  int[] culturalAbilityProficiencies()
           
protected  boolean destroyBodyAfterUse()
           
 void executeMsg(Environmental myHost, CMMsg msg)
          The general message event handler for the object.
 boolean expless()
          Whether players of this race can gain or lose experience points.
 boolean fertile()
           
 long forbiddenWornBits()
          A bitmap showing which on locations a member of this race can not wear clothing, even if the members have one or more of the required limbs.
protected  Weapon funHumanoidWeapon()
           
 java.lang.String getAbilitiesDesc()
          Returns the list of racial abilities granted to those of this race or nothing.
 int[] getAgingChart()
          Returns an integer array equal in size and index to the Race.AGE_* constants in the Race interface.
 int[] getBreathables()
          Returns resource codes of what this race can breathe as an atmosphere.
protected  int getCodeNum(java.lang.String code)
           
 DeadBody getCorpseContainer(MOB mob, Room room)
          Returns the corpse of a member of this race, populates it with the equipment of the given mob, and places it in the given room.
 java.lang.String getDispositionChgDesc()
          Returns the list of modifications to disposition done by this race or nothing.
 java.lang.String getLanguagesDesc()
          Returns the list of racial languages granted to those of this race or nothing.
 java.lang.String getPracAdjDesc()
          Returns the adjustment to practices made by this race (or nothing)
 int getSaveStatIndex()
          Returns the index into the stat codes array where extra savable fields begins.
 java.lang.String getSensesChgDesc()
          Returns the list of modifications to senses done by this race or nothing.
 java.lang.String getStat(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 getStatAdjDesc()
          Returns a list of the stat adjustments made by this race
 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.
 int getTickStatus()
          A coded status for this object during the period where its tick method is being called.
 java.lang.String getTrainAdjDesc()
          Returns the adjustment to trains made by this race (or nothing)
 int getXPAdjustment()
          Returns the amount, as a positive or negative % to adjust all experience gains.
protected  boolean giveMobAbility(MOB mob, Ability A, int proficiency, java.lang.String defaultParm, boolean isBorrowedRace)
           
protected  boolean giveMobAbility(MOB mob, Ability A, int proficiency, java.lang.String defaultParm, boolean isBorrowedRace, boolean autoInvoke)
           
 void grantAbilities(MOB mob, boolean isBorrowedRace)
          Typically called when a mob gains a level with this base-race, to allow the race to assign any new skills.
protected  void grantAbilities(MOB mob, boolean isBorrowedRace, boolean skipCultural)
           
 Race healthBuddy()
           
 java.lang.String healthText(MOB viewer, MOB mob)
          Returns a description of the given mobs description, by consulting the mobs curState().getHitPoints method.
 int heightVariance()
          The amount from 0-this to add to the minimum height to achieve a random height.
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
 boolean infatigueable()
           
 void initializeClass()
          Called ONCE after all objects are loaded, but before the map is read in during initialization.
 boolean isGeneric()
          Whether this race object represents a Generic Race, or one which is modifiable by builders at run-time.
 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 L(java.lang.String str, java.lang.String... xs)
           
 java.lang.String leaveStr()
          Returns the string describing what folks see when a member of this race leaves a room.
 void level(MOB mob, java.util.List<java.lang.String> gainedAbilityIDs)
          This method is called whenever a player gains a level while a member of this race.
 boolean leveless()
          Whether players of this race can be associated with an experience level.
 int lightestWeight()
          The lightest weight for a member of this race
 Race makeGenRace()
          Converts this race to a generic race (if it isn't already) and returns it.
 java.lang.String makeMobName(char gender, int age)
          Sends back a generic mob name appropriate to a mob of this race, at the given gender and age-group.
protected  RawMaterial makeResource(java.lang.String name, int type)
           
protected  RawMaterial makeResource(java.lang.String name, int type, java.lang.String subType)
           
protected  void makeStatChgDesc()
           
protected  void mapCulturalAbilities()
           
 Race mixRace(Race race, java.lang.String newRaceID, java.lang.String newRaceName)
          Converts this race to a generic race (if it isn't already) and mixes its attributes with the race passed it.
 Weapon myNaturalWeapon()
          Returns a Weapon object representing what a member of this race fights with when unarmed.
 java.util.List<RawMaterial> myResources()
          Returns a list of RawMaterial objects (usually GenFoodResource, GenLiquidResource, or GenResource items) representing what is left over of a member of this race after they've been butchered and cut up.
 java.lang.String name()
          Return a nice, displayable name for this race
 CMObject newInstance()
          Returns a new instance of this class.
 int numRacialEffects(MOB mob)
          Returns the number of racial effects elligible to the given lob.
 boolean okMessage(Environmental myHost, CMMsg msg)
          The general message event previewer for the object.
 java.util.List<Item> outfit(MOB myChar)
          Returns a vector of Item objects representing the standard clothing, weapons, or other objects commonly given to players of this race just starting out.
protected  int practicesAtFirstLevel()
           
 SearchIDList<Ability> racialAbilities(MOB mob)
          Return a vector of skills, spells, and other abilities granted to the given mob of the given mobs level.
protected  int[] racialAbilityLevels()
           
protected  java.lang.String[] racialAbilityNames()
           
protected  java.lang.String[] racialAbilityParms()
           
protected  int[] racialAbilityProficiencies()
           
protected  boolean[] racialAbilityQuals()
           
 java.lang.String racialCategory()
          Which racial category this race falls in.
protected  int[] racialEffectLevels()
           
protected  java.lang.String[] racialEffectNames()
           
protected  java.lang.String[] racialEffectParms()
           
 ChameleonList<Ability> racialEffects(MOB mob)
          Return a vector of skills, spells, and other abilities granted to the given mob of the given mobs level.
 java.util.List<Ability> racialEffectsList(MOB mob)
           
 java.lang.String racialParms()
          If this race is modifiable at run time, this method will return an xml document describing the several attributes of this race.
 boolean sameAs(Race E)
           
 void setHeightWeight(PhyStats stats, char gender)
          Will initialize a player or mobs height and weight based on this races parameters.
 void setRacialParms(java.lang.String parms)
          If this race is modifiable at run time, this method will use the given xml document describing the several attributes of this race to populate this races fields and attributes.
 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.
 int shortestFemale()
          The minimum height of females of this race.
 int shortestMale()
          The minimum height of males of this race.
 void startRacing(MOB mob, boolean verifyOnly)
          After a mob is set or changed to a new race, this method should be called to finalize or initialize any settings from this race.
 boolean tick(Tickable myChar, int tickID)
          this is the method which is called periodically by the threading engine.
protected  int trainsAtFirstLevel()
           
protected  boolean uncharmable()
           
 int usageCount(int alter)
          Returns the number of registered usages of this race as of the moment of the call.
 boolean useRideClass()
          Whether this race is usually rideable; helps determine the appropriate java class to use.
 int weightVariance()
          The amount from 0-this to add to the minumum weight to achieve a random weight.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

breatheAnythingArray

protected static final int[] breatheAnythingArray

breatheAirArray

protected static final int[] breatheAirArray

breatheWaterArray

protected static final int[] breatheWaterArray

breatheAirWaterArray

protected static final int[] breatheAirWaterArray

empty

protected static final java.util.List empty

emptyIDs

protected static final SearchIDList emptyIDs

baseStatChgDesc

protected java.lang.String baseStatChgDesc

sensesChgDesc

protected java.lang.String sensesChgDesc

dispChgDesc

protected java.lang.String dispChgDesc

abilitiesDesc

protected java.lang.String abilitiesDesc

languagesDesc

protected java.lang.String languagesDesc

naturalWeapon

protected Weapon naturalWeapon

mappedCulturalAbilities

protected boolean mappedCulturalAbilities

outfitChoices

protected java.util.List<Item> outfitChoices

naturalWeaponChoices

protected java.util.List<Weapon> naturalWeaponChoices

naturalAbilImmunities

protected java.util.Set<java.lang.String> naturalAbilImmunities

usageCount

protected int usageCount

racialAbilityMap

protected java.util.Map<java.lang.Integer,SearchIDList<Ability>> racialAbilityMap

racialEffectMap

protected java.util.Map<java.lang.Integer,SearchIDList<Ability>> racialEffectMap

CODES

protected static java.lang.String[] CODES
Constructor Detail

StdRace

public StdRace()
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: Race
Return a nice, displayable name for this race

Specified by:
name in interface CMObject
Specified by:
name in interface Tickable
Specified by:
name in interface Race
Returns:
the races name
See Also:
Environmental.Name()

shortestMale

public int shortestMale()
Description copied from interface: Race
The minimum height of males of this race.

Specified by:
shortestMale in interface Race
Returns:
minimum height of males in inches

shortestFemale

public int shortestFemale()
Description copied from interface: Race
The minimum height of females of this race.

Specified by:
shortestFemale in interface Race
Returns:
minimum height of females in inches

heightVariance

public int heightVariance()
Description copied from interface: Race
The amount from 0-this to add to the minimum height to achieve a random height.

Specified by:
heightVariance in interface Race
Returns:
a range of inches to add to the mimiumum height

lightestWeight

public int lightestWeight()
Description copied from interface: Race
The lightest weight for a member of this race

Specified by:
lightestWeight in interface Race
Returns:
the lightest weight for something of this race

weightVariance

public int weightVariance()
Description copied from interface: Race
The amount from 0-this to add to the minumum weight to achieve a random weight.

Specified by:
weightVariance in interface Race
Returns:
a range of pounds to add to the minimum weight

forbiddenWornBits

public long forbiddenWornBits()
Description copied from interface: Race
A bitmap showing which on locations a member of this race can not wear clothing, even if the members have one or more of the required limbs. The bitmap is made from Wearable.WORN_* constant values.

Specified by:
forbiddenWornBits in interface Race
Returns:
the illegal wear location bitmap
See Also:
Item

racialCategory

public java.lang.String racialCategory()
Description copied from interface: Race
Which racial category this race falls in.

Specified by:
racialCategory in interface Race
Returns:
racial category

isGeneric

public boolean isGeneric()
Description copied from interface: Race
Whether this race object represents a Generic Race, or one which is modifiable by builders at run-time.

Specified by:
isGeneric in interface Race
Returns:
whether this race is modifiable at run-time.

classless

public boolean classless()
Description copied from interface: Race
Whether this race can be associated with a character class.

Specified by:
classless in interface Race
Returns:
whether this race can have a class
See Also:
CharClass

leveless

public boolean leveless()
Description copied from interface: Race
Whether players of this race can be associated with an experience level.

Specified by:
leveless in interface Race
Returns:
whether players of this race can have a level

expless

public boolean expless()
Description copied from interface: Race
Whether players of this race can gain or lose experience points.

Specified by:
expless in interface Race
Returns:
whether players of this race can gain or lose experience points

getXPAdjustment

public int getXPAdjustment()
Description copied from interface: Race
Returns the amount, as a positive or negative % to adjust all experience gains.

Specified by:
getXPAdjustment in interface Race
Returns:
xp adjustment 0-100, or -1 - -100 to adjust experience gains by.

bodyMask

public int[] bodyMask()
Description copied from interface: Race
Returns an array indexed by body part codes as defined by the BODY_* constants in the Race interface. Each value is either -1 to show that the body part does not apply, 0 to show that the body part is not found on this race, and 1 or more to show how many of that part this race normally has.

Specified by:
bodyMask in interface Race
Returns:
an array of body parts

getAgingChart

public int[] getAgingChart()
Description copied from interface: Race
Returns an integer array equal in size and index to the Race.AGE_* constants in the Race interface. Each value in the index represents the first mudyear age of that age category.

Specified by:
getAgingChart in interface Race
Returns:
an integer array mapping ages to age categories
See Also:
Race

getBreathables

public int[] getBreathables()
Description copied from interface: Race
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 Race
Returns:
a list of resource codes that this race can breathe
See Also:
RawMaterial

useRideClass

public boolean useRideClass()
Description copied from interface: Race
Whether this race is usually rideable; helps determine the appropriate java class to use.

Specified by:
useRideClass in interface Race
Returns:
whether this race is generally rideable

practicesAtFirstLevel

protected int practicesAtFirstLevel()

trainsAtFirstLevel

protected int trainsAtFirstLevel()

racialEffectNames

protected java.lang.String[] racialEffectNames()

racialEffectLevels

protected int[] racialEffectLevels()

racialEffectParms

protected java.lang.String[] racialEffectParms()

racialAbilityNames

protected java.lang.String[] racialAbilityNames()

racialAbilityParms

protected java.lang.String[] racialAbilityParms()

racialAbilityLevels

protected int[] racialAbilityLevels()

racialAbilityProficiencies

protected int[] racialAbilityProficiencies()

racialAbilityQuals

protected boolean[] racialAbilityQuals()

culturalAbilityNames

protected java.lang.String[] culturalAbilityNames()

culturalAbilityLevels

protected int[] culturalAbilityLevels()

culturalAbilityAutoGains

protected boolean[] culturalAbilityAutoGains()

culturalAbilityProficiencies

protected int[] culturalAbilityProficiencies()

abilityImmunities

public java.lang.String[] abilityImmunities()
Description copied from interface: Race
Returns the list of ability IDs of skills that this race is flatly and quietly immune to, whether malicious or not -- it just won't happen.

Specified by:
abilityImmunities in interface Race
Returns:
the list of Ability IDs.

uncharmable

protected boolean uncharmable()

destroyBodyAfterUse

protected boolean destroyBodyAfterUse()

availabilityCode

public int availabilityCode()
Description copied from interface: Race
Returns one or a combination of the Area.THEME_* constants from the Area interface. This bitmap then describes the types of areas, skills, and classes which can interact. This bitmap is also used to to tell whether the race is available for selection by users at char creation time, whether they can change to this race via spells, or whether the race is utterly unavailable to them.

Specified by:
availabilityCode in interface Race
Returns:
the availability/theme of this race
See Also:
Area

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

fertile

public boolean fertile()

infatigueable

public boolean infatigueable()

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

healthBuddy

public Race healthBuddy()

canBreedWith

public boolean canBreedWith(Race R)
Description copied from interface: Race
Returns true if the given race is actually the same as the current race. Usually just ID().equals(ID()), or if either is human. Passing the race to itself in this method is a good way to check for general fertility.

Specified by:
canBreedWith in interface Race
Parameters:
R - the race to check
Returns:
true if its the same as this one, false otherwise

affectPhyStats

public void affectPhyStats(Physical affected,
                           PhyStats affectableStats)
Description copied from interface: StatsAffecting
This method is called by the recoverPhyStats() method on other Environmental objects. It is used to transform the Environmental basePhyStats() object into a finished phyStats() object, both of which are objects implementing the PhyStats interface. See those methods for more information.

Specified by:
affectPhyStats in interface StatsAffecting
Parameters:
affected - the host of the PhyStats object being affected
affectableStats - the particular PhyStats object being affected
See Also:
PhyStats, Environmental, Affectable.basePhyStats(), Affectable.phyStats(), Affectable.recoverPhyStats()

affectCharStats

public void affectCharStats(MOB affectedMob,
                            CharStats charStats)
Description copied from interface: StatsAffecting
This method is called by the recoverCharStats() method on other MOB objects. It is used to transform the MOB baseCharStats() object into a finished charStats() object, both of which are objects implementing the CharStats interface. See those methods for more information.

Specified by:
affectCharStats in interface StatsAffecting
Parameters:
affectedMob - the host of the CharStats object being affected
charStats - the particular CharStats object being affected
See Also:
CharStats, MOB, MOB.baseCharStats(), MOB.charStats(), MOB.recoverCharStats()

makeMobName

public java.lang.String makeMobName(char gender,
                                    int age)
Description copied from interface: Race
Sends back a generic mob name appropriate to a mob of this race, at the given gender and age-group.

Specified by:
makeMobName in interface Race
Parameters:
gender - the gender of the mob
age - the age category
Returns:
a good name

agingAffects

public void agingAffects(MOB mob,
                         CharStats baseStats,
                         CharStats charStats)
Description copied from interface: Race
Apply any affects of the given mob at the given age to the given base and/or current char stats.

Specified by:
agingAffects in interface Race
Parameters:
mob - the mob to apply changes to
baseStats - permanent charstats changes
charStats - temporary charstats changes
See Also:
CharState

affectCharState

public void affectCharState(MOB affectedMob,
                            CharState affectableMaxState)
Description copied from interface: StatsAffecting
This method is called by the recoverCharState() method on other MOB objects. It is used to transform the MOB baseCharState() object into a finished charState() object, both of which are objects implementing the CharState interface. See those methods for more information.

Specified by:
affectCharState in interface StatsAffecting
Parameters:
affectedMob - the host of the CharState object being affected
affectableMaxState - the particular CharState object being affected
See Also:
CharState, MOB, MOB.baseState(), MOB.curState(), MOB.recoverMaxState()

okMessage

public boolean okMessage(Environmental myHost,
                         CMMsg msg)
Description copied from interface: MsgListener
The general message event previewer for the object. Messages passed herein are in a pending state, and may be safely modified or rejected without fear that they might be in the middle of being executed. Messages passed herein may not necessarily be FOR or FROM this object, but will almost always represent events which want to happen in the same rom. This method should always always return true UNLESS this message needs to be canceled, in which case it is necessary to tell the mob initiating the event (CMMsg.source()) why it is being cancelled. Every game event goes through these methods.

Specified by:
okMessage in interface MsgListener
Parameters:
myHost - either the initiator of the event, or the host of this object
msg - the CMMsg that wants to be executed
Returns:
whether this message is allowed to execute
See Also:
CMMsg, CMMsg.source()

executeMsg

public void executeMsg(Environmental myHost,
                       CMMsg msg)
Description copied from interface: MsgListener
The general message event handler for the object. Messages passed herein may not necessarily be FOR this object, or from it, but will almost always represent events happening in the same room. The messages have already been through an approval process, so this method is called only to affect the final execution of the meaning of the message. Every game event goes through these methods.

Specified by:
executeMsg in interface MsgListener
Parameters:
myHost - either the initiator of the event, or the host of this object
msg - the CMMsg that needs to be executed
See Also:
CMMsg

arriveStr

public java.lang.String arriveStr()
Description copied from interface: Race
Returns the string describing what folks see when a member of this race enters a room. Should give an idea of the gate or walking style of this race.

Specified by:
arriveStr in interface Race
Returns:
what people see what this race enters a room

leaveStr

public java.lang.String leaveStr()
Description copied from interface: Race
Returns the string describing what folks see when a member of this race leaves a room. Should give an idea of the gate or walking style of this race.

Specified by:
leaveStr in interface Race
Returns:
what people see what this race leaves a room

level

public void level(MOB mob,
                  java.util.List<java.lang.String> gainedAbilityIDs)
Description copied from interface: Race
This method is called whenever a player gains a level while a member of this race. If there are any special things which need to be done to a player who gains a level, they can be done in this method. By default, it doesn't do anything.

Specified by:
level in interface Race
Parameters:
mob - the mob to level up
gainedAbilityIDs - the set of abilities/skill IDs gained during this leveling process

adjustExperienceGain

public int adjustExperienceGain(MOB host,
                                MOB mob,
                                MOB victim,
                                int amount)
Description copied from interface: Race
Whenever a player or mob of this race gains experience, this method gets a chance to modify the amount before the gain actually occurs.

Specified by:
adjustExperienceGain in interface Race
Parameters:
host - the player or mob whose race object this is
mob - the player or mob gaining experience
victim - if applicable, the mob or player who died to give the exp
amount - the amount of exp on track for gaining
Returns:
the adjusted amount of experience to gain

getTickStatus

public int getTickStatus()
Description copied from interface: Tickable
A coded status for this object during the period where its tick method is being called. The statis is defined, at least in part, by constants in this interface STATUS_*. STATUS_NOT should be returned when the objects tick method is not currently in execution. It should never return STATUS_NOT when the objects tick method is in execution.

Specified by:
getTickStatus in interface Tickable
Returns:
the numeric status of this object
See Also:
Tickable.tick(Tickable, int)

tick

public boolean tick(Tickable myChar,
                    int tickID)
Description copied from interface: Tickable
this is the method which is called periodically by the threading engine. How often it is called depends on the parameters passed to the threadding engine when it is submitted for thread access. Typically the period is once per TIME_TICK period, but that is determined when the object is submitted to the thread engine.

Specified by:
tick in interface Tickable
Parameters:
myChar - a reference to this Tickable object
tickID - the TICKID_ constant describing this periodic call, as defined in Tickable
Returns:
true always, unless this object no longer wishes to ever tick again, in which case false
See Also:
Tickable, ServiceEngine, TickableGroup

L

public java.lang.String L(java.lang.String str,
                          java.lang.String... xs)

giveMobAbility

protected boolean giveMobAbility(MOB mob,
                                 Ability A,
                                 int proficiency,
                                 java.lang.String defaultParm,
                                 boolean isBorrowedRace)

giveMobAbility

protected boolean giveMobAbility(MOB mob,
                                 Ability A,
                                 int proficiency,
                                 java.lang.String defaultParm,
                                 boolean isBorrowedRace,
                                 boolean autoInvoke)

grantAbilities

public void grantAbilities(MOB mob,
                           boolean isBorrowedRace)
Description copied from interface: Race
Typically called when a mob gains a level with this base-race, to allow the race to assign any new skills. Can also be called just to populate a mob with race skills, so it should also confirm any lower level skills also.

Specified by:
grantAbilities in interface Race
Parameters:
mob - the mob to give abilities to.
isBorrowedRace - whether the skills are savable (false) or temporary (true)
See Also:
AbilityContainer.addAbility(Ability)

grantAbilities

protected void grantAbilities(MOB mob,
                              boolean isBorrowedRace,
                              boolean skipCultural)

mapCulturalAbilities

protected void mapCulturalAbilities()

startRacing

public void startRacing(MOB mob,
                        boolean verifyOnly)
Description copied from interface: Race
After a mob is set or changed to a new race, this method should be called to finalize or initialize any settings from this race. The verify flag is almost always true, unless the mob is a new player being created, in which case false is sent.

Specified by:
startRacing in interface Race
Parameters:
mob - the mob or player being set to this race
verifyOnly - true flag unless this is a new player character

myNaturalWeapon

public Weapon myNaturalWeapon()
Description copied from interface: Race
Returns a Weapon object representing what a member of this race fights with when unarmed. This method may change what it returns on every call to mix things up a bit.

Specified by:
myNaturalWeapon in interface Race
Returns:
a Weapon object representing claws or teeth, etc..
See Also:
Weapon

outfit

public java.util.List<Item> outfit(MOB myChar)
Description copied from interface: Race
Returns a vector of Item objects representing the standard clothing, weapons, or other objects commonly given to players of this race just starting out.

Specified by:
outfit in interface Race
Parameters:
myChar - one who will receive the objects
Returns:
a vector of Item objects

healthText

public java.lang.String healthText(MOB viewer,
                                   MOB mob)
Description copied from interface: Race
Returns a description of the given mobs description, by consulting the mobs curState().getHitPoints method.

Specified by:
healthText in interface Race
Parameters:
viewer - the mob observing the health of this one
mob - the mob whose health to check
Returns:
a string describing his health
See Also:
MOB.curState(), CharState.getHitPoints()

funHumanoidWeapon

protected Weapon funHumanoidWeapon()

myResources

public java.util.List<RawMaterial> myResources()
Description copied from interface: Race
Returns a list of RawMaterial objects (usually GenFoodResource, GenLiquidResource, or GenResource items) representing what is left over of a member of this race after they've been butchered and cut up.

Specified by:
myResources in interface Race
Returns:
a list of rawmaterial objects
See Also:
RawMaterial

setHeightWeight

public void setHeightWeight(PhyStats stats,
                            char gender)
Description copied from interface: Race
Will initialize a player or mobs height and weight based on this races parameters.

Specified by:
setHeightWeight in interface Race
Parameters:
stats - the PhyStats object to change
gender - the mobs gender 'M' or 'F'
See Also:
PhyStats

compareTo

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

makeResource

protected RawMaterial makeResource(java.lang.String name,
                                   int type)

makeResource

protected RawMaterial makeResource(java.lang.String name,
                                   int type,
                                   java.lang.String subType)

getCorpseContainer

public DeadBody getCorpseContainer(MOB mob,
                                   Room room)
Description copied from interface: Race
Returns the corpse of a member of this race, populates it with the equipment of the given mob, and places it in the given room. If the destroyBodyAfterUse returns true, it will also populate the body with the contents of the myResources method.

Specified by:
getCorpseContainer in interface Race
Parameters:
mob - the mob to use as a template for the body
room - the room to place the corpse in
Returns:
the corpse generated and placed in the room
See Also:
Race.myResources()

numRacialEffects

public int numRacialEffects(MOB mob)
Description copied from interface: Race
Returns the number of racial effects elligible to the given lob. Must faster and more efficient than getting the whole list and checking its size.

Specified by:
numRacialEffects in interface Race
Parameters:
mob - the mob to grant the abilities to
Returns:
number of entries in the ability object vector

racialEffects

public ChameleonList<Ability> racialEffects(MOB mob)
Description copied from interface: Race
Return a vector of skills, spells, and other abilities granted to the given mob of the given mobs level. This method is not functionally used because it doesn't quite work correctly yet.

Specified by:
racialEffects in interface Race
Parameters:
mob - the mob to grant the abilities to
Returns:
a vector of the Ability objects
See Also:
Ability, Race.numRacialEffects(MOB)

racialEffectsList

public final java.util.List<Ability> racialEffectsList(MOB mob)

makeGenRace

public Race makeGenRace()
Description copied from interface: Race
Converts this race to a generic race (if it isn't already) and returns it. Returns itself if its already generic.

Specified by:
makeGenRace in interface Race
Returns:
the generic race.

mixRace

public Race mixRace(Race race,
                    java.lang.String newRaceID,
                    java.lang.String newRaceName)
Description copied from interface: Race
Converts this race to a generic race (if it isn't already) and mixes its attributes with the race passed it. A new race ID and a new race name must also be provided.

Specified by:
mixRace in interface Race
Parameters:
race - the race to use as a baseline
newRaceID - the id of the new race
newRaceName - the name of the new race
Returns:
the generic race.

culturalAbilities

public QuadVector<java.lang.String,java.lang.Integer,java.lang.Integer,java.lang.Boolean> culturalAbilities()
Description copied from interface: Race
Return a vector of skills, spells, and other ability ids granted to the given mob when they are created as this race. The entries are the ability id, the default proficiency, the level, and whether it is auto-gained.

Specified by:
culturalAbilities in interface Race
Returns:
a quadvector of the Ability IDs, profs, levels, auto-gained
See Also:
Ability

racialAbilities

public SearchIDList<Ability> racialAbilities(MOB mob)
Description copied from interface: Race
Return a vector of skills, spells, and other abilities granted to the given mob of the given mobs level.

Specified by:
racialAbilities in interface Race
Parameters:
mob - the mob to grant the abilities to
Returns:
a vector of the Ability objects
See Also:
Ability

getStatAdjDesc

public java.lang.String getStatAdjDesc()
Description copied from interface: Race
Returns a list of the stat adjustments made by this race

Specified by:
getStatAdjDesc in interface Race
Returns:
a list of the stat adjustments made by this race

getSensesChgDesc

public java.lang.String getSensesChgDesc()
Description copied from interface: Race
Returns the list of modifications to senses done by this race or nothing.

Specified by:
getSensesChgDesc in interface Race
Returns:
the list of modifications to senses done by this race

getDispositionChgDesc

public java.lang.String getDispositionChgDesc()
Description copied from interface: Race
Returns the list of modifications to disposition done by this race or nothing.

Specified by:
getDispositionChgDesc in interface Race
Returns:
the list of modifications to disposition done by this race

getTrainAdjDesc

public java.lang.String getTrainAdjDesc()
Description copied from interface: Race
Returns the adjustment to trains made by this race (or nothing)

Specified by:
getTrainAdjDesc in interface Race
Returns:
the adjustment to trains made by this race (or nothing)

getPracAdjDesc

public java.lang.String getPracAdjDesc()
Description copied from interface: Race
Returns the adjustment to practices made by this race (or nothing)

Specified by:
getPracAdjDesc in interface Race
Returns:
the adjustment to practices made by this race (or nothing)

getAbilitiesDesc

public java.lang.String getAbilitiesDesc()
Description copied from interface: Race
Returns the list of racial abilities granted to those of this race or nothing.

Specified by:
getAbilitiesDesc in interface Race
Returns:
the list of racial abilities granted to those of this race

getLanguagesDesc

public java.lang.String getLanguagesDesc()
Description copied from interface: Race
Returns the list of racial languages granted to those of this race or nothing.

Specified by:
getLanguagesDesc in interface Race
Returns:
the list of racial languages granted to those of this race

racialParms

public java.lang.String racialParms()
Description copied from interface: Race
If this race is modifiable at run time, this method will return an xml document describing the several attributes of this race.

Specified by:
racialParms in interface Race
Returns:
an xml document describing this race
See Also:
Race.isGeneric(), Race.setRacialParms(String)

usageCount

public int usageCount(int alter)
Description copied from interface: Race
Returns the number of registered usages of this race as of the moment of the call. It includes mobs loaded at boot-time.

Specified by:
usageCount in interface Race
Parameters:
alter - TODO
Returns:
the usage count.

setRacialParms

public void setRacialParms(java.lang.String parms)
Description copied from interface: Race
If this race is modifiable at run time, this method will use the given xml document describing the several attributes of this race to populate this races fields and attributes.

Specified by:
setRacialParms in interface Race
Parameters:
parms - an xml document describing this race
See Also:
Race.isGeneric(), Race.racialParms()

clrStatChgDesc

protected void clrStatChgDesc()

makeStatChgDesc

protected void makeStatChgDesc()

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 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:
getStat in interface Modifiable
Parameters:
code - the name of the field to read.
Returns:
the value of the field read
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()

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()

getCodeNum

protected int getCodeNum(java.lang.String code)

sameAs

public boolean sameAs(Race E)