Behavior, CMObject, Contingent, Modifiable, MsgListener, Tickable, java.lang.Cloneable, java.lang.Comparable<CMObject>ActiveTicker, Aggressive, AlignHelper, Arrest, Beggar, BribeGateGuard, BrotherHelper, ClanHelper, CombatAssister, CommonSpeaker, Concierge, CorpseLooter, DoorwayGuardian, Drowness, EvilExecutioner, FaithHelper, FasterRecovery, GateGuard, GoldLooter, GoodExecutioner, GoodGuardian, Guard, Hireling, ItemIdentifier, ItemMender, ItemRefitter, LinkedWeather, MOBHelper, MoneyChanger, MudChat, Nanny, NoCombatAssist, ObjectGuardian, PlayerHelper, PokerDealer, PuddleMaker, RaceHelper, ResetWhole, ROMGangMember, ROMPatrolman, Sailor, Scriptable, ScriptableEverymob, Sounder, TaxCollector, Vagrant, Wimpypublic class StdBehavior extends java.lang.Object implements Behavior
| Modifier and Type | Field | Description |
|---|---|---|
protected static java.lang.String[] |
CODES |
|
protected boolean |
isSavableBehavior |
|
protected java.lang.String |
parms |
CAN_AREAS, CAN_EXITS, CAN_ITEMS, CAN_MOBS, CAN_ROOMS, FLAG_LEGALBEHAVIOR, FLAG_MOBILITY, FLAG_POTENTIALLYAGGRESSIVE, FLAG_POTENTIALLYAUTODEATHING, FLAG_TROUBLEMAKINGidConverterSTATUS_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 |
|---|---|
StdBehavior() |
| Modifier and Type | Method | Description |
|---|---|---|
java.lang.String |
accountForYourself() |
Returns a string describing what this behavior does.
|
boolean |
amDestroyed() |
Whether the destroy() method has been previousy called on this object.
|
static boolean |
canActAtAll(Tickable affecting) |
|
static boolean |
canFreelyBehaveNormal(Tickable affecting) |
|
boolean |
canImprove(int can_code) |
Returns whether this behavior is capable of enhancing the given type
of object designated by the can_code.
|
boolean |
canImprove(PhysicalAgent E) |
Returns whether this behavior is capable of enhancing the given type
of object designated by E.
|
protected int |
canImproveCode() |
|
int |
compareTo(CMObject o) |
|
CMObject |
copyOf() |
Similar to Cloneable.clone(), but does its best to make sure that
any internal objects to this class are also copyOfed.
|
void |
destroy() |
Utterly and permanently destroy this object, not only removing it from the map, but
causing this object to be collected as garbage by Java.
|
void |
endBehavior(PhysicalAgent forMe) |
Called when a behavior is cleanly removed from a mob,
such as when a quest does so.
|
void |
executeMsg(Environmental host,
CMMsg msg) |
The general message event handler for the object.
|
java.util.List<java.lang.String> |
externalFiles() |
Returns a string list of any external files which
may be required to make this ability work.
|
long |
flags() |
Returns a bitmap made of up Behavior.FLAG_* constant masks which
designates certain aspects about this behavior the rest of the
system may need to know.
|
protected MOB |
getBehaversMOB(Tickable ticking) |
|
protected Room |
getBehaversRoom(Tickable ticking) |
|
protected int |
getCodeNum(java.lang.String code) |
|
protected int |
getInternalCodeNum(java.lang.String code) |
|
java.lang.String |
getParms() |
Returns the raw parameter string for this behavior.
|
int |
getSaveStatIndex() |
Returns the index into the stat codes array where extra savable fields begins.
|
java.lang.String |
getStat(java.lang.String code) |
An alternative means of retreiving the values of those fields on this object which are modifiable at
run-time by builders.
|
java.lang.String[] |
getStatCodes() |
Returns an array of the string names of those fields which are modifiable on this object at run-time by
builders.
|
int |
getTickStatus() |
A coded status for this object during the period where
its tick method is being called.
|
boolean |
grantsAggressivenessTo(MOB M) |
Returns the result of a very specific test, namely whether this
behavior would be the direct cause of a malicious act against
the given MOB object.
|
protected static java.lang.String |
I(java.lang.String str) |
|
java.lang.String |
ID() |
The CoffeeMud Java Class ID shared by all instances of
this object.
|
void |
initializeClass() |
Called ONCE after all objects are loaded, but before the map is read in
during initialization.
|
boolean |
isSavable() |
Whether, if this object is in a room, whether it is appropriate to save this object to
the database as a permanent feature of its container.
|
boolean |
isStat(java.lang.String code) |
An alternative means of retreiving the values of those fields on this object which are modifiable at
run-time by builders.
|
java.lang.String |
L(java.lang.String str,
java.lang.String... xs) |
Localize an internal string -- shortcut.
|
java.lang.String |
name() |
The nice displayable name of this instance of this object
|
CMObject |
newInstance() |
return a new instance of the object
|
boolean |
okMessage(Environmental host,
CMMsg msg) |
The general message event previewer for the object.
|
java.lang.String |
parmsFormat() |
Unimplemented as of yet, but will hold a string telling the system what
the proper format of any parms data.
|
void |
registerDefaultQuest(java.lang.Object questName) |
Called after a behavior is added to an Environmental object.
|
boolean |
sameAs(Behavior E) |
|
void |
setParms(java.lang.String parameters) |
Sets the raw parameter string for this behavior.
|
void |
setSavable(boolean truefalse) |
Sets whether this behavior can be saved as a permanent aspect of
its host.
|
void |
setStat(java.lang.String code,
java.lang.String val) |
An alternative means of setting the values of those fields on this object which are modifiable at
run-time by builders.
|
void |
startBehavior(PhysicalAgent forMe) |
Called after a behavior is added to a Behavable object.
|
boolean |
tick(Tickable ticking,
int tickID) |
this is the method which is called periodically by the threading engine.
|
protected java.lang.String parms
protected boolean isSavableBehavior
protected static final java.lang.String[] CODES
public java.lang.String ID()
CMObjectpublic java.lang.String name()
Tickablename in interface CMObjectname in interface TickableEnvironmental.Name()protected int canImproveCode()
public long flags()
Behaviorpublic boolean grantsAggressivenessTo(MOB M)
BehaviorgrantsAggressivenessTo in interface BehaviorM - the target to test for maliciousness topublic int getTickStatus()
TickablegetTickStatus in interface TickableTickable.tick(Tickable, int)public void initializeClass()
CMObjectinitializeClass in interface CMObjectpublic java.lang.String accountForYourself()
BehavioraccountForYourself in interface Behaviorpublic CMObject newInstance()
newInstance in interface CMObjectpublic CMObject copyOf()
CMObjectpublic void registerDefaultQuest(java.lang.Object questName)
BehaviorregisterDefaultQuest in interface BehaviorquestName - the Quest nameQuestpublic void startBehavior(PhysicalAgent forMe)
BehaviorstartBehavior in interface BehaviorforMe - the object to which this behavior has been addedBehavable.addBehavior(Behavior),
Behavior.setParms(String)public void endBehavior(PhysicalAgent forMe)
BehaviorendBehavior in interface BehaviorforMe - the object to which this behavior has been removedBehavable.delBehavior(Behavior),
Behavior.setParms(String)public void setSavable(boolean truefalse)
BehaviorsetSavable in interface BehaviorsetSavable in interface Contingenttruefalse - whether this behavior can be saved as part of its host.Contingent.isSavable()public boolean isSavable()
ContingentisSavable in interface Contingentpublic boolean amDestroyed()
ContingentamDestroyed in interface Contingentpublic void destroy()
Contingentdestroy in interface Contingentpublic java.lang.String getParms()
BehaviorgetParms in interface BehaviorBehavior.setParms(String)public void setParms(java.lang.String parameters)
BehaviorsetParms in interface Behaviorparameters - the parameter string for this behaviorBehavior.getParms()public java.lang.String parmsFormat()
BehaviorparmsFormat in interface BehaviorCMParms,
Behavior.getParms(),
Behavior.setParms(String)public int compareTo(CMObject o)
compareTo in interface java.lang.Comparable<CMObject>public java.util.List<java.lang.String> externalFiles()
BehaviorexternalFiles in interface BehaviorBehavior.setParms(String)public void executeMsg(Environmental host, CMMsg msg)
MsgListenerexecuteMsg in interface MsgListenerhost - either the initiator of the event, or the host of this objectmsg - the CMMsg that needs to be executedCMMsgpublic boolean okMessage(Environmental host, CMMsg msg)
MsgListenerokMessage in interface MsgListenerhost - either the initiator of the event, or the host of this objectmsg - the CMMsg that wants to be executedCMMsg,
CMMsg.source()public boolean canImprove(int can_code)
BehaviorcanImprove in interface Behaviorcan_code - the Behavior.CAN_* mask to evaluate for this behaviorcanImproveCode(),
Behaviorpublic boolean canImprove(PhysicalAgent E)
BehaviorcanImprove in interface BehaviorE - the object to evaluate for this behaviorcanImproveCode()protected static java.lang.String I(java.lang.String str)
public static boolean canActAtAll(Tickable affecting)
public static boolean canFreelyBehaveNormal(Tickable affecting)
public boolean tick(Tickable ticking, int tickID)
Tickabletick in interface Tickableticking - a reference to this Tickable objecttickID - the TICKID_ constant describing this periodic call, as defined in TickableTickable,
ServiceEngine,
TickableGrouppublic java.lang.String L(java.lang.String str,
java.lang.String... xs)
str - the string to translatexs - the array of variables to replaceCall with the string to translate, which may contain variables of the form @x1, @x2, etc. The array in xs
is then used to replace the variables AFTER the string is translated.public java.lang.String[] getStatCodes()
ModifiablegetStatCodes in interface ModifiableModifiable.getStat(String),
Modifiable.setStat(String, String)protected int getCodeNum(java.lang.String code)
protected int getInternalCodeNum(java.lang.String code)
public java.lang.String getStat(java.lang.String code)
ModifiablegetStat in interface Modifiablecode - the name of the field to read.Modifiable.getStatCodes()public void setStat(java.lang.String code,
java.lang.String val)
ModifiablesetStat in interface Modifiablecode - the name of the field to setval - the value to set the field toModifiable.getStatCodes()public int getSaveStatIndex()
ModifiablegetSaveStatIndex in interface ModifiableModifiable.getStatCodes(),
Modifiable.getStat(String),
Modifiable.setStat(String, String)public boolean isStat(java.lang.String code)
ModifiableisStat in interface Modifiablecode - the name of the field to read.Modifiable.getStatCodes()public boolean sameAs(Behavior E)