com.planet_ink.coffee_mud.Libraries
Class CoffeeLevels

java.lang.Object
  extended by com.planet_ink.coffee_mud.Libraries.StdLibrary
      extended by com.planet_ink.coffee_mud.Libraries.CoffeeLevels
All Implemented Interfaces:
CMObject, CMLibrary, ExpLevelLibrary, java.lang.Cloneable, java.lang.Comparable<CMObject>

public class CoffeeLevels
extends StdLibrary
implements ExpLevelLibrary


Constructor Summary
CoffeeLevels()
           
 
Method Summary
 int adjustedExperience(MOB mob, MOB victim, int amount)
           
 java.lang.StringBuffer baseLevelAdjuster(MOB mob, int adjuster)
           
 void gainExperience(MOB mob, MOB victim, java.lang.String homageMessage, int amount, boolean quiet)
          Called whenever a player actually gains any experience.
 int getLevelExperience(int level)
          Returns how much experience a player must have to be the given level.
 void handleExperienceChange(CMMsg msg)
           
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
 void level(MOB mob)
           
 void loseExperience(MOB mob, int amount)
          Called whenever a member of this class loses any experience.
 boolean postExperience(MOB mob, MOB victim, java.lang.String homage, int amount, boolean quiet)
           
 void unLevel(MOB mob)
           
 
Methods inherited from class com.planet_ink.coffee_mud.Libraries.StdLibrary
activate, compareTo, copyOf, getSupportThread, initializeClass, newInstance, shutdown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.planet_ink.coffee_mud.Libraries.interfaces.CMLibrary
activate, getSupportThread, shutdown
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject
copyOf, initializeClass, newInstance
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

CoffeeLevels

public CoffeeLevels()
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, MiscTech. The name is typically identical to the class name.

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

baseLevelAdjuster

public java.lang.StringBuffer baseLevelAdjuster(MOB mob,
                                                int adjuster)
Specified by:
baseLevelAdjuster in interface ExpLevelLibrary

unLevel

public void unLevel(MOB mob)
Specified by:
unLevel in interface ExpLevelLibrary

loseExperience

public void loseExperience(MOB mob,
                           int amount)
Description copied from interface: ExpLevelLibrary
Called whenever a member of this class loses any experience. It actually does the experience loss for the player as well as determining how much, if any should be taken awa from leiges or clans. Will automatically cause an unleveling if necessary.

Specified by:
loseExperience in interface ExpLevelLibrary
Parameters:
mob - the mob to take experience away from
amount - the amount of experience to take away
See Also:
ExpLevelLibrary.unLevel(MOB)

postExperience

public boolean postExperience(MOB mob,
                              MOB victim,
                              java.lang.String homage,
                              int amount,
                              boolean quiet)
Specified by:
postExperience in interface ExpLevelLibrary

getLevelExperience

public int getLevelExperience(int level)
Description copied from interface: ExpLevelLibrary
Returns how much experience a player must have to be the given level.

Specified by:
getLevelExperience in interface ExpLevelLibrary
Parameters:
level - the level to base the exp on
Returns:
the amount of experiene required to be the given level

level

public void level(MOB mob)
Specified by:
level in interface ExpLevelLibrary

adjustedExperience

public int adjustedExperience(MOB mob,
                              MOB victim,
                              int amount)
Specified by:
adjustedExperience in interface ExpLevelLibrary

gainExperience

public void gainExperience(MOB mob,
                           MOB victim,
                           java.lang.String homageMessage,
                           int amount,
                           boolean quiet)
Description copied from interface: ExpLevelLibrary
Called whenever a player actually gains any experience. It actually does the experience gain for the player as well as determining how much, if any should be distributed to leiges or clans. Will automatically cause a call to level if necessary.

Specified by:
gainExperience in interface ExpLevelLibrary
Parameters:
mob - the mob to distribute experience to
victim - the mob killed, if any, to cause the experience gain
homageMessage - the name, if any, of another mob whose gain experience is causing this gain
amount - the amount of experience to gain
quiet - true if no messages should be given
See Also:
ExpLevelLibrary.level(MOB)

handleExperienceChange

public void handleExperienceChange(CMMsg msg)
Specified by:
handleExperienceChange in interface ExpLevelLibrary