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, Tickable, CMLibrary, ExpLevelLibrary, java.lang.Cloneable, java.lang.Comparable<CMObject>

public class CoffeeLevels
extends StdLibrary
implements ExpLevelLibrary


Field Summary
 
Fields inherited from class com.planet_ink.coffee_mud.Libraries.StdLibrary
isDebugging, name, serviceClient, tickStatus
 
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
CoffeeLevels()
           
 
Method Summary
 int adjustedExperience(MOB mob, MOB victim, int amount)
           
protected  void checkLevelDown(MOB mob)
           
protected  void checkLevelGain(MOB mob)
           
 Command deferCommandCheck(MOB mob, Command C, java.util.List<java.lang.String> cmds)
           
 java.lang.String doBaseLevelAdjustment(MOB mob, int adjuster)
           
protected  void ensureMaxDeferredXP(MOB mob, PlayerStats pStats)
           
protected  void ensureMaxRPXP(MOB mob, PlayerStats pStats)
           
 MOB fillOutMOB(CharClass C, int level)
          This method fills in combat and rejuvenation related stats for the given mob of the given class at the given level.
 MOB fillOutMOB(MOB mob, int level)
          This method fills in combat and rejuvenation related stats for the given mob of their current base class at the given level.
protected  boolean fixMobStatsIfNecessary(MOB mob, int direction)
           
protected  int gainClanExperience(MOB mob, int amount)
           
 void gainExperience(MOB mob, MOB victim, java.lang.String homageMessage, int amount, boolean quiet)
          Called whenever a player actually gains any experience.
protected  int gainLeigeExperience(MOB mob, int amount, boolean quiet)
           
 void gainRPExperience(MOB mob, MOB target, java.lang.String homageMessage, int amount, boolean quiet)
           
 int getAttackBonusNextLevel(MOB mob)
           
 int getLevelAttack(MOB mob)
          Returns the amount of combat prowess the given mob would have being their current base class.
 int getLevelExperience(int level)
          Returns how much experience a player must have to be the given level.
 int getLevelExperienceJustThisLevel(int level)
          Returns how much experience a player must gain at this level to advance to the next.
 int getLevelMana(MOB mob)
          Returns the amount of mana the given mob would have being their current base class.
 int getLevelMOBArmor(MOB mob)
          Returns the armor rating the given mob would have being their current base class.
 int getLevelMOBDamage(MOB mob)
          Returns the amount of damage per hit the given mob would have being their current base class.
 double getLevelMOBSpeed(MOB mob)
          Returns the number of attacks the given mob would have being their current base class.
 double[] getLevelMoneyRange(MOB mob)
          Returns the range of money the given mob would have being their current base class.
 int getLevelMove(MOB mob)
          Returns the amount of movement the given mob would have being their current base class.
 int getManaBonusNextLevel(MOB mob)
           
 int getMoveBonusNextLevel(MOB mob)
           
 int getPlayerHitPoints(MOB mob)
          Returns the amount of hp the given player would have being their current base class.
 int getPlayerHPBonusNextLevel(MOB mob)
           
 void handleExperienceChange(CMMsg msg)
           
 void handleRPExperienceChange(CMMsg msg)
           
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
 boolean isFilledOutMOB(MOB mob)
           
 void level(MOB mob)
           
protected  int loseClanExperience(MOB mob, int amount)
           
 void loseExperience(MOB mob, int amount)
          Called whenever a member of this class loses any experience.
protected  int loseLeigeExperience(MOB mob, int amount)
           
 void loseRPExperience(MOB mob, int amount)
           
 boolean postExperience(MOB mob, MOB victim, java.lang.String homage, int amount, boolean quiet)
           
 boolean postExperienceToAllAboard(Physical possibleShip, int amount)
          If the given item is a boardable, this method will post the given amount of experience to all abord.
 boolean postRPExperience(MOB mob, MOB target, java.lang.String homage, int amount, boolean quiet)
           
 void propertiesLoaded()
          This method is called whenever system properties are altered by the user.
 void unLevel(MOB mob)
           
 
Methods inherited from class com.planet_ink.coffee_mud.Libraries.StdLibrary
activate, checkDatabase, compareTo, copyOf, getServiceClient, getTickStatus, initializeClass, L, name, newInstance, setThreadStatus, shutdown, tick
 
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, getServiceClient, L, shutdown
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject
copyOf, initializeClass, name, 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, Tech. 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

getManaBonusNextLevel

public int getManaBonusNextLevel(MOB mob)

getLevelMana

public int getLevelMana(MOB mob)
Description copied from interface: ExpLevelLibrary
Returns the amount of mana the given mob would have being their current base class.

Specified by:
getLevelMana in interface ExpLevelLibrary
Parameters:
mob - the mob who would be this class
Returns:
the amount of mana an npc of this class should have

getAttackBonusNextLevel

public int getAttackBonusNextLevel(MOB mob)

getLevelAttack

public int getLevelAttack(MOB mob)
Description copied from interface: ExpLevelLibrary
Returns the amount of combat prowess the given mob would have being their current base class.

Specified by:
getLevelAttack in interface ExpLevelLibrary
Parameters:
mob - the mob who would be this class
Returns:
the amount of combat prowess an npc of this class should have

getLevelMOBArmor

public int getLevelMOBArmor(MOB mob)
Description copied from interface: ExpLevelLibrary
Returns the armor rating the given mob would have being their current base class.

Specified by:
getLevelMOBArmor in interface ExpLevelLibrary
Parameters:
mob - the mob who would be this class
Returns:
the armor rating an npc of this class should have

getLevelMOBDamage

public int getLevelMOBDamage(MOB mob)
Description copied from interface: ExpLevelLibrary
Returns the amount of damage per hit the given mob would have being their current base class.

Specified by:
getLevelMOBDamage in interface ExpLevelLibrary
Parameters:
mob - the mob who would be this class
Returns:
the amount of damage per hit an npc of this class should have

getLevelMOBSpeed

public double getLevelMOBSpeed(MOB mob)
Description copied from interface: ExpLevelLibrary
Returns the number of attacks the given mob would have being their current base class.

Specified by:
getLevelMOBSpeed in interface ExpLevelLibrary
Parameters:
mob - the mob who would be this class
Returns:
the number of attacks an npc of this class should have

getMoveBonusNextLevel

public int getMoveBonusNextLevel(MOB mob)

getLevelMove

public int getLevelMove(MOB mob)
Description copied from interface: ExpLevelLibrary
Returns the amount of movement the given mob would have being their current base class.

Specified by:
getLevelMove in interface ExpLevelLibrary
Parameters:
mob - the mob who would be this class
Returns:
the amount of movement an npc of this class should have

getPlayerHPBonusNextLevel

public int getPlayerHPBonusNextLevel(MOB mob)

getPlayerHitPoints

public int getPlayerHitPoints(MOB mob)
Description copied from interface: ExpLevelLibrary
Returns the amount of hp the given player would have being their current base class.

Specified by:
getPlayerHitPoints in interface ExpLevelLibrary
Parameters:
mob - the mob who would be this class
Returns:
the amount of hp a pc of this class should have

fillOutMOB

public MOB fillOutMOB(CharClass C,
                      int level)
Description copied from interface: ExpLevelLibrary
This method fills in combat and rejuvenation related stats for the given mob of the given class at the given level. This method should create a mob for the caller.

Specified by:
fillOutMOB in interface ExpLevelLibrary
Parameters:
C - the class to use.
level - the level of the mob
Returns:
the filled in mob

isFilledOutMOB

public boolean isFilledOutMOB(MOB mob)

fillOutMOB

public MOB fillOutMOB(MOB mob,
                      int level)
Description copied from interface: ExpLevelLibrary
This method fills in combat and rejuvenation related stats for the given mob of their current base class at the given level. This method should create a mob for the caller if mob==null.

Specified by:
fillOutMOB in interface ExpLevelLibrary
Parameters:
mob - the mob to fill out, or null
level - the level of the mob
Returns:
the filled in mob

getLevelMoneyRange

public double[] getLevelMoneyRange(MOB mob)
Description copied from interface: ExpLevelLibrary
Returns the range of money the given mob would have being their current base class. Since money is variable, this is a range low-high

Specified by:
getLevelMoneyRange in interface ExpLevelLibrary
Parameters:
mob - the mob who would be this class
Returns:
the range of money an npc of this class should have

doBaseLevelAdjustment

public java.lang.String doBaseLevelAdjustment(MOB mob,
                                              int adjuster)
Specified by:
doBaseLevelAdjustment 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)

checkLevelDown

protected void checkLevelDown(MOB mob)

loseClanExperience

protected int loseClanExperience(MOB mob,
                                 int amount)

loseLeigeExperience

protected int loseLeigeExperience(MOB mob,
                                  int amount)

loseRPExperience

public void loseRPExperience(MOB mob,
                             int amount)
Specified by:
loseRPExperience in interface ExpLevelLibrary

gainClanExperience

protected int gainClanExperience(MOB mob,
                                 int amount)

gainLeigeExperience

protected int gainLeigeExperience(MOB mob,
                                  int amount,
                                  boolean quiet)

checkLevelGain

protected void checkLevelGain(MOB mob)

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)

gainRPExperience

public void gainRPExperience(MOB mob,
                             MOB target,
                             java.lang.String homageMessage,
                             int amount,
                             boolean quiet)
Specified by:
gainRPExperience in interface ExpLevelLibrary

postExperience

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

postRPExperience

public boolean postRPExperience(MOB mob,
                                MOB target,
                                java.lang.String homage,
                                int amount,
                                boolean quiet)
Specified by:
postRPExperience 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

getLevelExperienceJustThisLevel

public int getLevelExperienceJustThisLevel(int level)
Description copied from interface: ExpLevelLibrary
Returns how much experience a player must gain at this level to advance to the next.

Specified by:
getLevelExperienceJustThisLevel in interface ExpLevelLibrary
Parameters:
level - the level to check at
Returns:
the amount of experience

level

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

ensureMaxDeferredXP

protected void ensureMaxDeferredXP(MOB mob,
                                   PlayerStats pStats)

ensureMaxRPXP

protected void ensureMaxRPXP(MOB mob,
                             PlayerStats pStats)

fixMobStatsIfNecessary

protected boolean fixMobStatsIfNecessary(MOB mob,
                                         int direction)

adjustedExperience

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

handleExperienceChange

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

deferCommandCheck

public Command deferCommandCheck(MOB mob,
                                 Command C,
                                 java.util.List<java.lang.String> cmds)
Specified by:
deferCommandCheck in interface ExpLevelLibrary

handleRPExperienceChange

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

postExperienceToAllAboard

public boolean postExperienceToAllAboard(Physical possibleShip,
                                         int amount)
Description copied from interface: ExpLevelLibrary
If the given item is a boardable, this method will post the given amount of experience to all abord.

Specified by:
postExperienceToAllAboard in interface ExpLevelLibrary
Parameters:
possibleShip - the ship to give experience to
amount - amount of experience to give to each person found
Returns:
true if experience is posted, false otherwise

propertiesLoaded

public void propertiesLoaded()
Description copied from interface: CMLibrary
This method is called whenever system properties are altered by the user. This allows the library to react to any important properties they monitor.

Specified by:
propertiesLoaded in interface CMLibrary
Overrides:
propertiesLoaded in class StdLibrary