com.planet_ink.coffee_mud.Behaviors.interfaces
Interface Behavior
- All Superinterfaces:
- java.lang.Cloneable, CMModifiable, CMObject, java.lang.Comparable<CMObject>, MsgListener, Tickable
- All Known Subinterfaces:
- LegalBehavior
- All Known Implementing Classes:
- ActiveTicker, Aggressive, AlignHelper, AntiVagrant, Arrest, Bardness, Beggar, BribeGateGuard, BrotherHelper, ClanHelper, Clericness, CombatAbilities, CombatAssister, CommonSpeaker, Concierge, Conquerable, CorpseEater, CorpseLooter, Decay, DelayedTransporter, DoorwayGuardian, Drowness, Druidness, Emoter, EvilExecutioner, FaithHelper, FasterRecovery, FieryRoom, Fighterness, FightFlee, Follower, GateGuard, GetsAllEquipped, GoldLooter, GoodExecutioner, GoodGuardian, Guard, Healer, Hireling, InstantDeath, ItemGenerator, ItemIdentifier, ItemMender, ItemRefitter, LinkedWeather, Mageness, Mime, MOBEater, MOBHelper, MOBHunter, Mobile, MobileAggressive, MobileGoodGuardian, MOBReSave, MOBTeacher, MoneyChanger, MovingRoom, MudChat, Nanny, NastyAbilities, NiceAbilities, NoCombatAssist, ObjectGuardian, Patroller, PlayerHelper, PokerDealer, ProtectedCitizen, ProtectedCitizens, PuddleMaker, QuestChat, QuestTracker, RaceHelper, RandomItems, RandomMonsters, RandomTeleporter, RandomTraps, ResetWhole, ResourceOverride, ROMGangMember, ROMPatrolman, Scavenger, Scriptable, ScriptableEverymob, Sounder, StdBehavior, TargetPlayer, TaxCollector, Thiefness, Vagrant, VeryAggressive, WaterCurrents, WeatherAffects, Wimpy, WimpyAggressive
public interface Behavior
- extends Tickable, MsgListener, CMObject, CMModifiable
A Behavior is a pro-active modifier of Environmental objects. Behaviors
are expected to do their work in a Tickable.tick(Tickable,int) method which
is called periodically by either the host object, or the serviceengine.
Behaviors are also message listeners however, and can overlap Ability/properties
in that way.
- See Also:
Environmental,
Tickable
|
Field Summary |
static int |
CAN_AREAS
constant mask for the canImprove() and canImproveCode() methods. |
static int |
CAN_EXITS
constant mask for the canImprove() and canImproveCode() methods. |
static int |
CAN_ITEMS
constant mask for the canImprove() and canImproveCode() methods. |
static int |
CAN_MOBS
constant mask for the canImprove() and canImproveCode() methods. |
static int |
CAN_ROOMS
constant mask for the canImprove() and canImproveCode() methods. |
static long |
FLAG_LEGALBEHAVIOR
constant mask for the flags() method designating that this behavior makes the host inforce laws @see Behavior#flags() |
static long |
FLAG_MOBILITY
constant mask for the flags() method designating that this behavior makes the host move @see Behavior#flags() |
static long |
FLAG_POTENTIALLYAGGRESSIVE
constant mask for the flags() method designating that this behavior makes the host aggressive @see Behavior#flags() |
static long |
FLAG_TROUBLEMAKING
constant mask for the flags() method designating that this behavior makes the host a trouble-maker @see Behavior#flags() |
| 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_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_EMAIL, TICKID_EXIT_BEHAVIOR, TICKID_EXIT_REOPEN, TICKID_ITEM_BEHAVIOR, TICKID_ITEM_BOUNCEBACK, TICKID_LIGHT_FLICKERS, TICKID_LIVEAUCTION, TICKID_LONGERMASK, TICKID_MOB, TICKID_QUEST, TICKID_READYTOSTOP, TICKID_ROOM_BEHAVIOR, TICKID_ROOM_ITEM_REJUV, TICKID_SPELL_AFFECT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET, TICKMASK_SOLITARY, TICKS_PER_RLMIN, TIME_MILIS_PER_MUDHOUR, TIME_TICK, TIME_TICK_DOUBLE |
|
Method Summary |
boolean |
canImprove(Environmental E)
Returns whether this behavior is capable of enhancing the given type
of object designated by E. |
boolean |
canImprove(int can_code)
Returns whether this behavior is capable of enhancing the given type
of object designated by the can_code. |
java.util.Vector |
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. |
java.lang.String |
getParms()
Returns the raw parameter string for this behavior. |
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. |
boolean |
isSavable()
Returns whether this behavior can be saved as a permanent aspect of
its host. |
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.String questName)
Called after a behavior is added to an Environmental object. |
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 |
startBehavior(Environmental forMe)
Called after a behavior is added to an Environmental object. |
| Methods inherited from interface java.lang.Comparable |
compareTo |
CAN_MOBS
static final int CAN_MOBS
- constant mask for the canImprove() and canImproveCode() methods. Means it can improve mobs @see Behavior#canImprove(Environmental)
- See Also:
- Constant Field Values
CAN_ITEMS
static final int CAN_ITEMS
- constant mask for the canImprove() and canImproveCode() methods. Means it can improve items @see Behavior#canImprove(Environmental)
- See Also:
- Constant Field Values
CAN_AREAS
static final int CAN_AREAS
- constant mask for the canImprove() and canImproveCode() methods. Means it can improve areas @see Behavior#canImprove(Environmental)
- See Also:
- Constant Field Values
CAN_ROOMS
static final int CAN_ROOMS
- constant mask for the canImprove() and canImproveCode() methods. Means it can improve rooms @see Behavior#canImprove(Environmental)
- See Also:
- Constant Field Values
CAN_EXITS
static final int CAN_EXITS
- constant mask for the canImprove() and canImproveCode() methods. Means it can improve exits @see Behavior#canImprove(Environmental)
- See Also:
- Constant Field Values
FLAG_MOBILITY
static final long FLAG_MOBILITY
- constant mask for the flags() method designating that this behavior makes the host move @see Behavior#flags()
- See Also:
- Constant Field Values
FLAG_TROUBLEMAKING
static final long FLAG_TROUBLEMAKING
- constant mask for the flags() method designating that this behavior makes the host a trouble-maker @see Behavior#flags()
- See Also:
- Constant Field Values
FLAG_POTENTIALLYAGGRESSIVE
static final long FLAG_POTENTIALLYAGGRESSIVE
- constant mask for the flags() method designating that this behavior makes the host aggressive @see Behavior#flags()
- See Also:
- Constant Field Values
FLAG_LEGALBEHAVIOR
static final long FLAG_LEGALBEHAVIOR
- constant mask for the flags() method designating that this behavior makes the host inforce laws @see Behavior#flags()
- See Also:
- Constant Field Values
startBehavior
void startBehavior(Environmental forMe)
- Called after a behavior is added to an Environmental object.
The point is to do any initializing. This method assumes
setParms() has already been called as well.
- Parameters:
forMe - the object to which this behavior has been added- See Also:
Behavable.addBehavior(Behavior),
setParms(String)
registerDefaultQuest
void registerDefaultQuest(java.lang.String questName)
- Called after a behavior is added to an Environmental object.
The point is to register a quest objet, should it be needed or
be useful to the quest.
- Parameters:
questName - the Quest name- See Also:
Quest
getParms
java.lang.String getParms()
- Returns the raw parameter string for this behavior.
Parameters are meant to modify or specify specific behavior of this
Behavior.
- Returns:
- the parameter string for this behavior
- See Also:
setParms(String)
setParms
void setParms(java.lang.String parameters)
- Sets the raw parameter string for this behavior.
Parameters are meant to modify or specify specific behavior of this
Behavior.
- Parameters:
parameters - the parameter string for this behavior- See Also:
getParms()
parmsFormat
java.lang.String parmsFormat()
- Unimplemented as of yet, but will hold a string telling the system what
the proper format of any parms data. Will use the CMParms.MTFORMAT_*
constants for definition.
- Returns:
- the format expected for the parms field
- See Also:
CMParms,
getParms(),
setParms(String)
externalFiles
java.util.Vector externalFiles()
- Returns a string list of any external files which
may be required to make this ability work. Usually
derived from the parameters.
Files returned by this method should not be base distrib files!
- Returns:
- a list of the path/names of files used by this behavior
- See Also:
setParms(String)
setSavable
void setSavable(boolean truefalse)
- Sets whether this behavior can be saved as a permanent aspect of
its host.
- Parameters:
truefalse - whether this behavior can be saved as part of its host.- See Also:
isSavable()
isSavable
boolean isSavable()
- Returns whether this behavior can be saved as a permanent aspect of
its host.
- Returns:
- truefalse whether this behavior can be saved as part of its host.
- See Also:
setSavable(boolean)
canImprove
boolean canImprove(Environmental E)
- Returns whether this behavior is capable of enhancing the given type
of object designated by E. It derives from the protected
Behavior.canImproveCode() method.
- Parameters:
E - the object to evaluate for this behavior
- Returns:
- whether the given object can be enhanced by this behavior
- See Also:
StdBehavior.canImproveCode()
canImprove
boolean canImprove(int can_code)
- Returns whether this behavior is capable of enhancing the given type
of object designated by the can_code. It derives from the protected
Behavior.canImproveCode() method and uses the Behavior.CAN_* constants.
- Parameters:
can_code - the Behavior.CAN_* mask to evaluate for this behavior
- Returns:
- whether the given type can be enhanced by this behavior
- See Also:
StdBehavior.canImproveCode(),
Behavior
flags
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.
- Returns:
- a bitmap made up of Behavior.FLAG_* constants
grantsAggressivenessTo
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.
- Parameters:
M - the target to test for maliciousness to
- Returns:
- whether this behavior would harm the mob