CMObject
, Tickable
, CMLibrary
, CMMiscUtils
, java.lang.Cloneable
, java.lang.Comparable<CMObject>
public class CoffeeUtensils extends StdLibrary implements CMMiscUtils
CMMiscUtils.ItemState
Modifier and Type | Field | Description |
---|---|---|
protected Pair<java.lang.String,Race> |
defaultSteed |
|
static int |
LOOTFLAG_LOSS |
|
static int |
LOOTFLAG_RUIN |
|
static int |
LOOTFLAG_UNWORN |
|
static int |
LOOTFLAG_WORN |
|
protected static java.lang.String[] |
steedSkills |
idConverter
isDebugging, name, serviceClient, tickStatus
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_BALLISTICK, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, TICKID_EVENT, 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_SHORTERMASK, TICKID_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET
Constructor | Description |
---|---|
CoffeeUtensils() |
Modifier and Type | Method | Description |
---|---|---|
protected void |
addExtRecipe(MOB mob,
Recipes R,
java.util.List<java.util.List<java.lang.String>> recipes) |
|
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.
|
protected CostManager |
createCostManager(CostDef.CostType costType,
java.lang.Double value,
java.lang.String curr) |
|
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 oldItem) |
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 E) |
Returns any corpses found in the given container, recursively.
|
PairList<java.lang.String,Race> |
getFavoredMounts(MOB mob) |
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.
|
Race |
getSimpleRace(java.lang.String rule,
java.lang.String fatherRaceID,
java.lang.String motherRaceID) |
|
protected int |
getSimpleWeight(Physical P) |
|
java.lang.String |
getUnsubscribeURL(java.lang.String name) |
Does its best to come up with a specially encoded unsubscribe url for
a particular user.
|
java.lang.String |
ID() |
The CoffeeMud Java Class ID shared by all instances of
this object.
|
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.
|
protected TriadVector<java.lang.Integer,java.lang.Integer,MaskingLibrary.CompiledZMask> |
parseLootPolicyFor(MOB mob) |
|
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.
|
protected java.lang.String |
raceMixRuleCheck(java.lang.String rule,
java.lang.String motherRaceID,
java.lang.String fatherRaceID) |
|
protected java.lang.String |
raceMixRuleRace(java.lang.String racePick) |
|
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, shutdown
copyOf, initializeClass, name, newInstance
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
activate, checkDatabase, compareTo, copyOf, getServiceClient, getTickStatus, initializeClass, L, name, newInstance, propertiesLoaded, setThreadStatus, shutdown, tick
public static final int LOOTFLAG_RUIN
public static final int LOOTFLAG_LOSS
public static final int LOOTFLAG_WORN
public static final int LOOTFLAG_UNWORN
protected static final java.lang.String[] steedSkills
public java.lang.String ID()
CMObject
ID
in interface CMObject
ID
in class StdLibrary
public java.lang.String niceCommaList(java.util.List<?> V, boolean andTOrF)
CMMiscUtils
niceCommaList
in interface CMMiscUtils
V
- the objects to listandTOrF
- true for trailing and, false for trailing orprotected int getSimpleWeight(Physical P)
public int getPullWeight(Physical P)
CMMiscUtils
getPullWeight
in interface CMMiscUtils
P
- the item to get the pull weight of.public java.lang.String getFormattedDate(Environmental E)
CMMiscUtils
getFormattedDate
in interface CMMiscUtils
E
- the object curious about the dateprotected void addExtRecipe(MOB mob, Recipes R, java.util.List<java.util.List<java.lang.String>> recipes)
public 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)
CMMiscUtils
addExtRecipes
in interface CMMiscUtils
mob
- the mob who might have more recipesID
- the Ability ID of the RecipeDriven objectrecipes
- the existing recipesCMMiscUtils.loadRecipeList(String)
public java.util.List<java.util.List<java.lang.String>> loadRecipeList(java.lang.String str)
CMMiscUtils
loadRecipeList
in interface CMMiscUtils
str
- the unparsed dataCMMiscUtils.addExtRecipes(MOB, String, List)
public void outfit(MOB mob, java.util.List<Item> items)
CMMiscUtils
outfit
in interface CMMiscUtils
mob
- the mob to outfititems
- the items to outfit the mob withpublic Trap makeADeprecatedTrap(Physical unlockThis)
CMMiscUtils
makeADeprecatedTrap
in interface CMMiscUtils
unlockThis
- the exit, container, room, whateverpublic void setTrapped(Physical myThang)
CMMiscUtils
setTrapped
in interface CMMiscUtils
myThang
- the thing to set the trap on.CMMiscUtils.makeADeprecatedTrap(Physical)
,
CMMiscUtils.setTrapped(Physical, Trap)
,
CMMiscUtils.fetchMyTrap(Physical)
public void setTrapped(Physical myThang, Trap theTrap)
CMMiscUtils
setTrapped
in interface CMMiscUtils
myThang
- the thing to set the trap on.theTrap
- the deprecated trap to set on itCMMiscUtils.makeADeprecatedTrap(Physical)
,
CMMiscUtils.setTrapped(Physical)
public Trap fetchMyTrap(Physical myThang)
CMMiscUtils
fetchMyTrap
in interface CMMiscUtils
myThang
- the thing to check for a trapCMMiscUtils.makeADeprecatedTrap(Physical)
public boolean reachableItem(MOB mob, Environmental E)
CMMiscUtils
reachableItem
in interface CMMiscUtils
mob
- the mob who wants to reachE
- the Item to reach forpublic double memoryUse(Environmental E, int number)
CMMiscUtils
memoryUse
in interface CMMiscUtils
E
- the object to check for a footprint ofnumber
- the accuracy -- higher is betterpublic Language getLanguageSpoken(Physical P)
CMMiscUtils
getLanguageSpoken
in interface CMMiscUtils
P
- the mob to checkpublic void extinguish(MOB source, Physical target, boolean mundane)
CMMiscUtils
extinguish
in interface CMMiscUtils
source
- the mob doing the extinguishingtarget
- the thing to extinguishmundane
- true to skip magic and elemental targetspublic void roomAffectFully(CMMsg msg, Room room, int dirCode)
CMMiscUtils
roomAffectFully
in interface CMMiscUtils
msg
- the message to sendroom
- the room to send the message todirCode
- if known, the direction of the target exitpublic int disenchantItem(Item target)
CMMiscUtils
disenchantItem
in interface CMMiscUtils
target
- the object to disenchant.public boolean disInvokeEffects(Environmental E)
CMMiscUtils
disInvokeEffects
in interface CMMiscUtils
E
- the object to diseffectpublic int processVariableEquipment(MOB mob, boolean isRejuv)
CMMiscUtils
processVariableEquipment
in interface CMMiscUtils
mob
- the npc mob to process variable equipment onisRejuv
- true if the mob is rejuving after deathpublic void recursiveDropMOB(MOB mob, Room room, Item thisContainer, boolean bodyFlag)
CMMiscUtils
recursiveDropMOB
in interface CMMiscUtils
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 otherwisepublic MOB getMobPossessingAnother(MOB mob)
CMMiscUtils
getMobPossessingAnother
in interface CMMiscUtils
mob
- the mob to check for possessionpublic boolean armorCheck(MOB mob, Item I, int allowedArmorLevel)
CMMiscUtils
armorCheck
in interface CMMiscUtils
mob
- the mob to checkI
- the item to checkallowedArmorLevel
- the allowed armor levelCharClass.ARMOR_DESCS
public boolean armorCheck(MOB mob, int allowedArmorLevel)
CMMiscUtils
armorCheck
in interface CMMiscUtils
mob
- the mob to checkallowedArmorLevel
- the allowed armor levelCharClass.ARMOR_DESCS
public java.util.List<DeadBody> getDeadBodies(Environmental E)
CMMiscUtils
getDeadBodies
in interface CMMiscUtils
E
- the container that possibly has corpsespublic boolean canBePlayerDestroyed(MOB mob, Item I, boolean ignoreBodies, boolean ignoreWeight)
CMMiscUtils
canBePlayerDestroyed
in interface CMMiscUtils
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 itemprotected TriadVector<java.lang.Integer,java.lang.Integer,MaskingLibrary.CompiledZMask> parseLootPolicyFor(MOB mob)
public void confirmWearability(MOB mob)
CMMiscUtils
confirmWearability
in interface CMMiscUtils
mob
- the mob to confirm the equipment ofpublic boolean canBeRuined(Item I)
CMMiscUtils
canBeRuined
in interface CMMiscUtils
I
- the item to checkCMMiscUtils.isRuinedLoot(MOB, Item)
,
CMMiscUtils.ruinItem(Item)
public Item ruinItem(Item I)
CMMiscUtils
ruinItem
in interface CMMiscUtils
I
- the item to ruinCMMiscUtils.isRuinedLoot(MOB, Item)
,
CMMiscUtils.canBeRuined(Item)
public Item isRuinedLoot(MOB mob, Item I)
CMMiscUtils
isRuinedLoot
in interface CMMiscUtils
mob
- the mob to get ruin policies forI
- the item to potentially ruinCMMiscUtils.canBeRuined(Item)
,
CMMiscUtils.ruinItem(Item)
public void reloadCharClasses(CharClass oldC)
CMMiscUtils
reloadCharClasses
in interface CMMiscUtils
oldC
- the old charclass objectCMMiscUtils.swapRaces(Race, Race)
public void swapRaces(Race newR, Race oldR)
CMMiscUtils
swapRaces
in interface CMMiscUtils
newR
- the new race objectoldR
- the old race objectCMMiscUtils.reloadCharClasses(CharClass)
public boolean resurrect(MOB tellMob, Room corpseRoom, DeadBody body, int XPLevel)
CMMiscUtils
resurrect
in interface CMMiscUtils
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 restoredpublic long[][] compileConditionalRange(java.util.List<java.lang.String> condV, int numDigits, int startOfRange, int endOfRange)
CMMiscUtils
compileConditionalRange
in interface CMMiscUtils
condV
- the list of fully expressionsnumDigits
- the min number of digits in each expressionstartOfRange
- the starting range to returnendOfRange
- the ending range to return > startOfRangepublic CostDef.Cost compileCost(double amt, java.lang.String poss)
CMMiscUtils
compileCost
in interface CMMiscUtils
amt
- the given amountposs
- string describing an amountpublic CostDef.Cost[][] compileConditionalCosts(java.util.List<java.lang.String> condV, int numDigits, int startOfRange, int endOfRange)
CMMiscUtils
compileConditionalCosts
in interface CMMiscUtils
condV
- the list of fully expressionsnumDigits
- the min number of digits in each expressionstartOfRange
- the starting range to returnendOfRange
- the ending range to return > startOfRangepublic java.util.List<Item> deepCopyOf(Item oldItem)
CMMiscUtils
deepCopyOf
in interface CMMiscUtils
oldItem
- the container or item to copypublic java.lang.String buildPrompt(MOB mob, java.lang.String prompt)
CMMiscUtils
buildPrompt
in interface CMMiscUtils
mob
- the mob to build a prompt forprompt
- the players prompt template stringprotected java.lang.String raceMixRuleRace(java.lang.String racePick)
protected java.lang.String raceMixRuleCheck(java.lang.String rule, java.lang.String motherRaceID, java.lang.String fatherRaceID)
public java.lang.String getUnsubscribeURL(java.lang.String name)
CMMiscUtils
getUnsubscribeURL
in interface CMMiscUtils
name
- the account or player namepublic java.util.List<Race> getConstituantRaces(java.lang.String raceID)
CMMiscUtils
getConstituantRaces
in interface CMMiscUtils
raceID
- the raceID to break apartpublic PairList<Item,java.lang.Long> getSeenEquipment(MOB mob, long wornMask)
CMMiscUtils
getSeenEquipment
in interface CMMiscUtils
mob
- the mob to get equipment fromwornMask
- 0, or a bitmap of allowed wear locationspublic Race getSimpleRace(java.lang.String rule, java.lang.String fatherRaceID, java.lang.String motherRaceID)
public Race getMixedRace(java.lang.String motherRaceID, java.lang.String fatherRaceID, boolean ignoreRules)
CMMiscUtils
getMixedRace
in interface CMMiscUtils
motherRaceID
- the mother racefatherRaceID
- the father raceignoreRules
- ignore the ini file override rulespublic PairList<java.lang.String,Race> getFavoredMounts(MOB mob)
CMMiscUtils
getFavoredMounts
in interface CMMiscUtils
mob
- the mob to find favored mounts forpublic boolean isItemInState(Room R, MOB mob, CMMiscUtils.ItemState state, Item I)
CMMiscUtils
isItemInState
in interface CMMiscUtils
R
- the room containermob
- the mob containerstate
- the item stateI
- the item to checkprotected CostManager createCostManager(CostDef.CostType costType, java.lang.Double value, java.lang.String curr)
public CostManager createCostManager(CostDef.CostType costType, java.lang.Double value)
CMMiscUtils
createCostManager
in interface CMMiscUtils
costType
- the type of codevalue
- the amount of the typeCMMiscUtils.createCostManager(Cost)
public CostManager createCostManager(CostDef.Cost cost)
CMMiscUtils
createCostManager
in interface CMMiscUtils
cost
- the costCMMiscUtils.createCostManager(Cost)
public 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)
CMMiscUtils
deAlias
in interface CMMiscUtils
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 off