CoffeeUtensilspublic interface CMMiscUtils extends CMLibrary
| Modifier and Type | Interface | Description | 
|---|---|---|
| static class  | CMMiscUtils.ItemState | A enum for item state flags | 
idConverter| Modifier and Type | Method | Description | 
|---|---|---|
| java.util.List<java.util.List<java.lang.String>> | addExtRecipes(MOB mob,
             java.lang.String ID,
             java.util.List<java.util.List<java.lang.String>> recipes) | Adds any custom recipes known to the given mob to the given existing
 recipe list, for the given skill ID. | 
| 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 | buildPrompt(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. | 
| boolean | canBeRuined(Item I) | Returns whether the given item is allowed to be ruined
 by anything. | 
| CostDef.Cost[][] | compileConditionalCosts(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 type number type , etc. | 
| 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. | 
| CostDef.Cost | compileCost(double amt,
           java.lang.String poss) | Compiles a cost object based on the amount, and the given possible
 train, practice, or a currency, or any other type. | 
| 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. | 
| CostManager | createCostManager(CostDef.Cost cost) | Creates a new CostManager object reflecting the given cost object. | 
| CostManager | createCostManager(CostDef.CostType costType,
                 java.lang.Double value) | Creates a new CostManager object reflecting the given type and value. | 
| void | deAlias(java.lang.String rawAliasDefinition,
       java.util.List<java.lang.String> parsedInput,
       java.util.List<java.util.List<java.lang.String>> executableCommands,
       boolean[] doEcho) | Parses a given raw alias definition, putting the resulting
 commands into the executeable commands, and returning whether
 they should be echoed. | 
| 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. | 
| PairList<java.lang.String,Race> | getFavoredMounts(MOB M) | Returns any favored mounts, usually based on cavalier skills,
 but returns a horse otherwise. | 
| 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 motherRaceID,
            java.lang.String fatherRaceID,
            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 | 
| int | getPullWeight(Physical P) | Returns the calculated "pull weight" of a physical item. | 
| 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. | 
| boolean | isItemInState(Room R,
             MOB mob,
             CMMiscUtils.ItemState state,
             Item I) | Returns whether the given item is in the given state | 
| Item | isRuinedLoot(MOB mob,
            Item I) | This method parses the item ruinning rules and possibly ruins the given item
 by returning the ruined version. | 
| java.util.List<java.util.List<java.lang.String>> | loadRecipeList(java.lang.String str) | Parses a DataDriven recipe file into a list of rows
 which is a list of column data. | 
| 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,
                        boolean isRejuv) | 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. | 
activate, getServiceClient, L, propertiesLoaded, shutdowncopyOf, ID, initializeClass, name, newInstancejava.lang.String buildPrompt(MOB mob, java.lang.String prompt)
mob - the mob to build a prompt forprompt - the players prompt template stringjava.lang.String getFormattedDate(Environmental E)
E - the object curious about the datejava.util.List<java.util.List<java.lang.String>> loadRecipeList(java.lang.String str)
str - the unparsed dataaddExtRecipes(MOB, String, List)java.util.List<java.util.List<java.lang.String>> addExtRecipes(MOB mob, java.lang.String ID, java.util.List<java.util.List<java.lang.String>> recipes)
mob - the mob who might have more recipesID - the Ability ID of the RecipeDriven objectrecipes - the existing recipesloadRecipeList(String)double memoryUse(Environmental E, int number)
E - the object to check for a footprint ofnumber - the accuracy -- higher is betterjava.lang.String niceCommaList(java.util.List<?> V,
                               boolean andTOrF)
V - the objects to listandTOrF - true for trailing and, false for trailing orint getPullWeight(Physical P)
P - the item to get the pull weight of.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 > startOfRangeCostDef.Cost[][] compileConditionalCosts(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 > startOfRangeCostDef.Cost compileCost(double amt, java.lang.String poss)
amt - the given amountposs - string describing an amountvoid 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 checkboolean reachableItem(MOB mob, Environmental E)
mob - the mob who wants to reachE - the Item to reach forvoid 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 levelCharClass.ARMOR_DESCSboolean armorCheck(MOB mob, Item I, int allowedArmorLevel)
mob - the mob to checkI - the item to checkallowedArmorLevel - the allowed armor levelCharClass.ARMOR_DESCSvoid 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 copyvoid confirmWearability(MOB mob)
mob - the mob to confirm the equipment ofint processVariableEquipment(MOB mob, boolean isRejuv)
mob - the npc mob to process variable equipment onisRejuv - true if the mob is rejuving after deathTrap makeADeprecatedTrap(Physical unlockThis)
unlockThis - the exit, container, room, whatevervoid 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 trapmakeADeprecatedTrap(Physical)MOB getMobPossessingAnother(MOB mob)
mob - the mob to check for possessionvoid 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 corpsesPairList<java.lang.String,Race> getFavoredMounts(MOB M)
M - the mob to find favored mounts forboolean 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 restoredItem isRuinedLoot(MOB mob, Item I)
mob - the mob to get ruin policies forI - the item to potentially ruincanBeRuined(Item), 
ruinItem(Item)boolean canBeRuined(Item I)
I - the item to checkisRuinedLoot(MOB, Item), 
ruinItem(Item)Item ruinItem(Item I)
I - the item to ruinisRuinedLoot(MOB, Item), 
canBeRuined(Item)void deAlias(java.lang.String rawAliasDefinition,
             java.util.List<java.lang.String> parsedInput,
             java.util.List<java.util.List<java.lang.String>> executableCommands,
             boolean[] doEcho)
rawAliasDefinition - the raw alias definitionparsedInput - the original user input, parsedexecutableCommands - the resulting list of commandsdoEcho - 1 dim array to put whether echo is on or offvoid 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 - true to ignore weight of the itemboolean disInvokeEffects(Environmental E)
E - the object to diseffectint disenchantItem(Item target)
target - the object to disenchant.Race getMixedRace(java.lang.String motherRaceID, java.lang.String fatherRaceID, boolean ignoreRules)
motherRaceID - the mother racefatherRaceID - the father raceignoreRules - ignore the ini file override rulesjava.util.List<Race> getConstituantRaces(java.lang.String raceID)
raceID - the raceID to break apartPairList<Item,java.lang.Long> getSeenEquipment(MOB mob, long wornMask)
mob - the mob to get equipment fromwornMask - 0, or a bitmap of allowed wear locationsjava.lang.String getUnsubscribeURL(java.lang.String name)
name - the account or player nameCostManager createCostManager(CostDef.CostType costType, java.lang.Double value)
costType - the type of codevalue - the amount of the typecreateCostManager(Cost)CostManager createCostManager(CostDef.Cost cost)
cost - the costcreateCostManager(Cost)boolean isItemInState(Room R, MOB mob, CMMiscUtils.ItemState state, Item I)
R - the room containermob - the mob containerstate - the item stateI - the item to check