com.planet_ink.coffee_mud.Behaviors.interfaces
Interface Behavior

All Superinterfaces:
java.lang.Cloneable, CMObject, java.lang.Comparable<CMObject>, Contingent, Modifiable, MsgListener, Tickable
All Known Subinterfaces:
ChattyBehavior, LegalBehavior, MobileBehavior
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, NeutralAbilities, NiceAbilities, NoCombatAssist, ObjectGuardian, Patroller, PlayerHelper, PokerDealer, ProtectedCitizen, ProtectedCitizens, PuddleMaker, QuestChat, RaceHelper, RandomItems, RandomMonsters, RandomTeleporter, RandomTraps, ResetWhole, ResourceOverride, ROMGangMember, ROMPatrolman, Sailor, Scavenger, Scriptable, ScriptableEverymob, Sounder, StdBehavior, TargetPlayer, TaxCollector, TaxiBehavior, Thiefness, Vagrant, VeryAggressive, WaterCurrents, WeatherAffects, Wimpy, WimpyAggressive

public interface Behavior
extends Tickable, MsgListener, Contingent, Modifiable

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_POTENTIALLYAUTODEATHING
          constant mask for the flags() method designating that this behavior makes the host capable of killing you instantly
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_BEAMWEAPON, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, 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_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET
 
Method Summary
 java.lang.String accountForYourself()
          Returns a string describing what this behavior does.
 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.
 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.
 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.
 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(PhysicalAgent forMe)
          Called after a behavior is added to a Behavable object.
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Tickable
getTickStatus, name, tick
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.MsgListener
executeMsg, okMessage
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Contingent
amDestroyed, destroy, isSavable
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject
copyOf, ID, initializeClass, newInstance
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Modifiable
getSaveStatIndex, getStat, getStatCodes, isStat, setStat
 

Field Detail

CAN_MOBS

static final int CAN_MOBS
constant mask for the canImprove() and canImproveCode() methods. Means it can improve mobs @see Behavior#canImprove(Behavable)

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(Behavable)

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(Behavable)

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(Behavable)

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(Behavable)

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

FLAG_POTENTIALLYAUTODEATHING

static final long FLAG_POTENTIALLYAUTODEATHING
constant mask for the flags() method designating that this behavior makes the host capable of killing you instantly

See Also:
Constant Field Values
Method Detail

startBehavior

void startBehavior(PhysicalAgent forMe)
Called after a behavior is added to a Behavable 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.List<java.lang.String> 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.

Specified by:
setSavable in interface Contingent
Parameters:
truefalse - whether this behavior can be saved as part of its host.
See Also:
Contingent.isSavable()

canImprove

boolean canImprove(PhysicalAgent 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

accountForYourself

java.lang.String accountForYourself()
Returns a string describing what this behavior does. Mostly for thought and behavior reading systems.

Returns:
a string describing what this behavior does.

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