|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CMMiscUtils
The MiscUtils (Miscellaneous Utilities) library should not exist. Its purpose is to expose universal functionality that doesn't seem to fit anywhere else. Usually, however, it does fit elsewhere just fine, but the elsewhere felt too crowded already to receive it. I'm sure this library will always exist, but the interface is definitely subject to change.
Method Summary | |
---|---|
boolean |
armorCheck(MOB mob,
int allowedArmorLevel)
Given the allowedArmorLevel code and the mob, this method returns whether the given mob is only wearing permitted items on the applicable armor slots. |
boolean |
armorCheck(MOB mob,
Item I,
int allowedArmorLevel)
Given the allowedArmorLevel code and the mob, this method returns whether the given mob is permitted to wear the given item is applicable armor slots given the armor level code. |
java.lang.String |
builtPrompt(MOB mob,
java.lang.String prompt)
Checks the given player mob for the format of their prompt in their playerstats and generates a fully formed prompt, complete with all variables filled in. |
boolean |
canBePlayerDestroyed(MOB mob,
Item I,
boolean ignoreBodies,
boolean ignoreWeight)
Returns whether the given item can be destroyed by the given mob, probably magically. |
long[][] |
compileConditionalRange(java.util.List<java.lang.String> condV,
int numDigits,
int startOfRange,
int endOfRange)
This strange method takes a list of space-delimited expressions of the form [CONDITION]number number number number, etc. |
void |
confirmWearability(MOB mob)
This method removes all equipment from the mob and quickly attempt to re-wear/hold/wield it all where it originally was by issueing wear messages which are previewed and executed. |
java.util.List<Item> |
deepCopyOf(Item theContainer)
Returns a copy of the given item/container and a copy of every item in that container, recursively. |
int |
disenchantItem(Item target)
Removes magical effects from wands, and other spell holders, deletes any effects after attempting to uninvoke. |
boolean |
disInvokeEffects(Environmental E)
Calls unInvoke on all effects on the given environmental. |
void |
extinguish(MOB source,
Physical target,
boolean mundane)
Recursively extinguishes everything from the given target on down. |
Trap |
fetchMyTrap(Physical myThang)
Returns any trap found on the given thing, or null. |
java.util.List<Race> |
getConstituantRaces(java.lang.String raceID)
Breaks apart a given generic mixed race ID to figure out which races were combined to make it up. |
java.util.List<DeadBody> |
getDeadBodies(Environmental container)
Returns any corpses found in the given container, recursively. |
java.lang.String |
getFormattedDate(Environmental E)
Returns the current mud-month-day-year for the object, depending on the timeclock where the environmental is located. |
Language |
getLanguageSpoken(Physical P)
Returns the language being spoke by the given object (mob, usually). |
Race |
getMixedRace(java.lang.String race1,
java.lang.String race2,
boolean ignoreRules)
Absolutely returns the correct race when mixing races of the two given IDs. |
MOB |
getMobPossessingAnother(MOB mob)
If any mob (probably a player) is possessing the given mob, this will return that mob, or null |
PairList<Item,java.lang.Long> |
getSeenEquipment(MOB mob,
long wornMask)
Returns a list of worn equipment at the top layer, where it can be seen. |
java.lang.String |
getUnsubscribeURL(java.lang.String name)
Does its best to come up with a specially encoded unsubscribe url for a particular user. |
Item |
isRuinedLoot(MOB mob,
Item I)
This method parses the item ruinning rules and possibly ruins the given item by returning the ruined version. |
Trap |
makeADeprecatedTrap(Physical unlockThis)
Creates one of the deprecated traps depending on what sort of object is passed in, whether it has a lid or a lock, etc. |
double |
memoryUse(Environmental E,
int number)
Returns a rediculous best guess on the amount of memory used by the given environmental. |
java.lang.String |
niceCommaList(java.util.List<?> V,
boolean andTOrF)
Nice english comma-delimited list, with oxford commas and trailing "and" or "or" at the end. |
void |
outfit(MOB mob,
java.util.List<Item> items)
Outfits the given mob with the list of given items. |
int |
processVariableEquipment(MOB mob)
Assumes that every inventory item, equipped item, and store inventory are for an NPC mob, where "rejuv" doesn't really matter. |
boolean |
reachableItem(MOB mob,
Environmental E)
Returns whether the given Item is reachable by the given mob. |
void |
recursiveDropMOB(MOB mob,
Room room,
Item thisContainer,
boolean bodyFlag)
Drops all items from the given mob into the given room which are inside the given container (or are the given item). |
void |
reloadCharClasses(CharClass oldC)
Iterates through every mob and player in the game, replacing the old char class object given with the new one of the same ID from CMClass. |
boolean |
resurrect(MOB tellMob,
Room corpseRoom,
DeadBody body,
int XPLevel)
Resurrects the given body according to all system rules. |
void |
roomAffectFully(CMMsg msg,
Room room,
int dirCode)
Normally just sends the message to the room by calling Room.send. |
Item |
ruinItem(Item I)
Always converts the given item into the Ruined version |
void |
setTrapped(Physical myThang)
Creates and sets a deprecated trap on the given exit, room, container, or whatever. |
void |
setTrapped(Physical myThang,
Trap theTrap)
Sets the given deprecated trap on the given exit, room, container, or whatever. |
void |
swapRaces(Race newR,
Race oldR)
Iterates through every mob and player in the game, replacing the old race object with the new one. |
Methods inherited from interface com.planet_ink.coffee_mud.Libraries.interfaces.CMLibrary |
---|
activate, getServiceClient, L, propertiesLoaded, shutdown |
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject |
---|
copyOf, ID, initializeClass, name, newInstance |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Method Detail |
---|
java.lang.String builtPrompt(MOB mob, java.lang.String prompt)
mob
- the mob to build a prompt forprompt
- TODO
java.lang.String getFormattedDate(Environmental E)
E
- the object curious about the date
double memoryUse(Environmental E, int number)
E
- the object to check for a footprint ofnumber
- the accuracy -- higher is better
java.lang.String niceCommaList(java.util.List<?> V, boolean andTOrF)
V
- the objects to listandTOrF
- true for trailing and, false for trailing or
long[][] compileConditionalRange(java.util.List<java.lang.String> condV, int numDigits, int startOfRange, int endOfRange)
condV
- the list of fully expressionsnumDigits
- the min number of digits in each expressionstartOfRange
- the starting range to returnendOfRange
- the ending range to return > startOfRange
void outfit(MOB mob, java.util.List<Item> items)
mob
- the mob to outfititems
- the items to outfit the mob withLanguage getLanguageSpoken(Physical P)
P
- the mob to check
boolean reachableItem(MOB mob, Environmental E)
mob
- the mob who wants to reachE
- the Item to reach for
void extinguish(MOB source, Physical target, boolean mundane)
source
- the mob doing the extinguishingtarget
- the thing to extinguishmundane
- true to skip magic and elemental targetsboolean armorCheck(MOB mob, int allowedArmorLevel)
mob
- the mob to checkallowedArmorLevel
- the allowed armor level
CharClass.ARMOR_DESCS
boolean armorCheck(MOB mob, Item I, int allowedArmorLevel)
mob
- the mob to checkI
- the item to checkallowedArmorLevel
- the allowed armor level
CharClass.ARMOR_DESCS
void recursiveDropMOB(MOB mob, Room room, Item thisContainer, boolean bodyFlag)
mob
- the mob who is droppingroom
- the room where it's being droppedthisContainer
- the item or container where the items must bebodyFlag
- true if the container is a body, false otherwisejava.util.List<Item> deepCopyOf(Item theContainer)
theContainer
- the container or item to copy
void confirmWearability(MOB mob)
mob
- the mob to confirm the equipment ofint processVariableEquipment(MOB mob)
mob
- the npc mob to process variable equipment on
Trap makeADeprecatedTrap(Physical unlockThis)
unlockThis
- the exit, container, room, whatever
void setTrapped(Physical myThang)
myThang
- the thing to set the trap on.makeADeprecatedTrap(Physical)
,
setTrapped(Physical, Trap)
,
fetchMyTrap(Physical)
void setTrapped(Physical myThang, Trap theTrap)
myThang
- the thing to set the trap on.theTrap
- the deprecated trap to set on itmakeADeprecatedTrap(Physical)
,
setTrapped(Physical)
Trap fetchMyTrap(Physical myThang)
myThang
- the thing to check for a trap
makeADeprecatedTrap(Physical)
MOB getMobPossessingAnother(MOB mob)
mob
- the mob to check for possession
void roomAffectFully(CMMsg msg, Room room, int dirCode)
msg
- the message to sendroom
- the room to send the message todirCode
- if known, the direction of the target exitjava.util.List<DeadBody> getDeadBodies(Environmental container)
container
- the container that possibly has corpses
boolean resurrect(MOB tellMob, Room corpseRoom, DeadBody body, int XPLevel)
tellMob
- if the corpse could not be resurrected, tell this mob.corpseRoom
- room to bring the mob to after resurrection, probably same as body's locationbody
- the corpse to resurrectXPLevel
- if > 0, and rules allow, bonus xp restored
Item isRuinedLoot(MOB mob, Item I)
mob
- the mob to get ruin policies forI
- the item to potentially ruin
Item ruinItem(Item I)
I
- the item to ruin
isRuinedLoot(MOB, Item)
void swapRaces(Race newR, Race oldR)
newR
- the new race objectoldR
- the old race objectreloadCharClasses(CharClass)
void reloadCharClasses(CharClass oldC)
oldC
- the old charclass objectswapRaces(Race, Race)
boolean canBePlayerDestroyed(MOB mob, Item I, boolean ignoreBodies, boolean ignoreWeight)
mob
- the mob who wants to destroy the itemI
- the item to destroyignoreBodies
- true to ignore corpse checks, false otherwiseignoreWeight
- TODO
boolean disInvokeEffects(Environmental E)
E
- the object to diseffect
int disenchantItem(Item target)
target
- the object to disenchant.
Race getMixedRace(java.lang.String race1, java.lang.String race2, boolean ignoreRules)
race1
- the mother racerace2
- the father raceignoreRules
- TODO
java.util.List<Race> getConstituantRaces(java.lang.String raceID)
raceID
- the raceID to break apart
PairList<Item,java.lang.Long> getSeenEquipment(MOB mob, long wornMask)
mob
- the mob to get equipment fromwornMask
- 0, or a bitmap of allowed wear locations
java.lang.String getUnsubscribeURL(java.lang.String name)
name
- the account or player name
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |