com.planet_ink.coffee_mud.Behaviors
Class Arrest

java.lang.Object
  extended by com.planet_ink.coffee_mud.Behaviors.StdBehavior
      extended by com.planet_ink.coffee_mud.Behaviors.Arrest
All Implemented Interfaces:
Behavior, LegalBehavior, CMObject, Contingent, Modifiable, MsgListener, Tickable, java.lang.Cloneable, java.lang.Comparable<CMObject>
Direct Known Subclasses:
Conquerable

public class Arrest
extends StdBehavior
implements LegalBehavior


Field Summary
protected  java.util.Map<MOB,java.lang.Double> finesAssessed
           
protected  java.lang.String lastAreaName
           
protected  Room lastBanishR
           
protected  boolean loadAttempt
           
 
Fields inherited from class com.planet_ink.coffee_mud.Behaviors.StdBehavior
CODES, isSavableBehavior, parms
 
Fields inherited from interface com.planet_ink.coffee_mud.Behaviors.interfaces.LegalBehavior
CONTROLTIME, EXPIRATION_MILLIS, ONE_REAL_DAY
 
Fields inherited from interface com.planet_ink.coffee_mud.Behaviors.interfaces.Behavior
CAN_AREAS, CAN_EXITS, CAN_ITEMS, CAN_MOBS, CAN_ROOMS, FLAG_LEGALBEHAVIOR, FLAG_MOBILITY, FLAG_POTENTIALLYAGGRESSIVE, FLAG_POTENTIALLYAUTODEATHING, FLAG_TROUBLEMAKING
 
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
 
Constructor Summary
Arrest()
           
 
Method Summary
 java.lang.String accountForYourself()
          Returns a string describing what this behavior does.
 boolean accuse(Area myArea, MOB accused, MOB victim, java.lang.String[] accusableLaws)
          Issues a LegalWarrant against the accused on behalf of the given victim, for a crime listed in the list of crime keys.
 boolean addWarrant(Area myArea, LegalWarrant W)
          Puts a warrant on the official docket so that officers can act on them.
 boolean addWarrant(Area myArea, MOB accused, MOB victim, java.lang.String crimeLocs, java.lang.String crimeFlags, java.lang.String crime, java.lang.String sentence, java.lang.String warnMsg)
          Fills out and, if possible, issues a warrant for arrest using the given crime data.
 boolean addWarrant(Law laws, LegalWarrant W)
           
 boolean aquit(Area myArea, MOB accused, java.lang.String[] acquittableLaws)
          Removes the first warrant for the given accused criminal, for any one of the given list of official crime KEYS.
 boolean arrest(Area myArea, MOB officer, MOB accused)
          Assigns an officer and begins the automated arresting procedure.
 boolean canFocusOn(MOB officer, MOB criminal)
           
protected  int canImproveCode()
           
 java.lang.String conquestInfo(Area myArea)
          If the legal behavior and area are conquerable by clans or foreign organizations, this method will return the name of the current controlling clan, and some information about the state of the conquest, such as control points achieved.
 int controlPoints()
          Returns the number of control points necessary to conquer the area governed by this legal behavior.
 void debugLogLostConvicts(java.lang.String lead, LegalWarrant W, MOB officer)
           
protected  boolean defaultModifiableNames()
           
 boolean deleteWarrant(Area myArea, LegalWarrant W)
          Removes the given warrants from the list of issued warrants.
 void dismissOfficer(MOB officer)
           
 void executeMsg(Environmental affecting, 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.
 void fileAllWarrants(Law laws, LegalWarrant W1, MOB mob)
           
protected  void fileArrestResister(Law laws, Area myArea, LegalWarrant W)
           
 boolean fillOutWarrant(MOB criminalM, Law laws, Area myArea, Environmental victimM, java.lang.String crimeLocs, java.lang.String crimeFlags, java.lang.String crime, java.lang.String sentence, java.lang.String warnMsg)
          Inspects the circumstances of, and if necessary, assigns a warrant to be handled by local law enforcement and judges.
 Room findTheBanishingPoint(MOB mob, Area myArea, Law laws, LegalWarrant W)
           
 Room findTheDetentionCenter(MOB mob, Area myArea, Law laws, LegalWarrant W)
           
 Room findTheJail(MOB mob, Area myArea, Law laws)
           
 Room findTheJudge(Law laws, Area myArea)
           
 double finesOwed(MOB mob)
          Returns the amount of base currency owed by the given mob, if any.
 java.lang.String fixCharge(LegalWarrant W)
           
 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.
 boolean frame(Area myArea, MOB accused, MOB framed)
          A method that transfers a warrant out on the accused to a different framed individual
 MOB getAnyElligibleOfficer(Law laws, Area myArea, MOB criminal, MOB victim)
           
 MOB getAWitnessHere(Area myArea, Room R, MOB accused)
           
 int getBanishmentTicks(Law laws, LegalWarrant W, MOB criminal)
           
protected  java.lang.String getBanishRoom(Law laws, LegalWarrant W, MOB criminal)
           
 int getControlPoints(java.lang.String clanID)
          Returns the number of control points earned by the given clanID.
 java.util.List<MOB> getCriminals(Area myArea, java.lang.String searchStr)
          Searches the list of warrants, returning those criminal mobs whose names match the search string, and still have legal warrants available for them.
protected  java.lang.String getDetainParm(Law laws, LegalWarrant W, MOB criminal)
           
protected  java.lang.String getDetainRoom(Law laws, LegalWarrant W, MOB criminal)
           
protected  int getDetainTime(Law laws, LegalWarrant W, MOB criminal)
           
 MOB getElligibleOfficer(Law laws, Area myArea, MOB criminal, MOB victim)
           
 MOB getElligibleOfficerHere(Law laws, Area myArea, Room R, MOB criminal, MOB victim)
           
 java.util.Properties getExtraLawParms()
           
 java.lang.String getExtraLawString()
           
 double getFine(Law laws, LegalWarrant W, MOB criminal)
           
protected  java.lang.String getLawParms()
           
protected  Law getLaws(Environmental what, boolean cleanOnly)
           
 Room getReleaseRoom(Law laws, Area myArea, MOB criminal, LegalWarrant W)
           
 java.util.List<LegalWarrant> getRelevantWarrants(java.util.List<LegalWarrant> warrants, LegalWarrant W, MOB criminal)
           
 java.lang.String getResourceKey(java.lang.String lawName)
           
 Room getRoom(Area A, java.util.List<java.lang.String> V)
           
 Room getRoom(Area A, java.lang.String which)
           
 java.util.List<Room> getRooms(Area A, java.util.List<java.lang.String> V)
           
 int getShameTicks(Law laws, LegalWarrant W, MOB criminal)
           
 MOB getTheJudgeHere(Law laws, Room R)
           
 java.util.List<LegalWarrant> getWarrantsOf(Area myArea, MOB accused)
          Returns a list of all active legal warrants available on the given mob.
 MOB getWitness(Area A, MOB accused)
           
 boolean hasWarrant(Area myArea, MOB accused)
          Returns whether the given mob has a valid warrant out for his/her arrest.
 void haveMobReactToLaw(MOB mob, MOB officer)
           
 int highestCrimeAction(Law laws, LegalWarrant W, MOB criminal)
           
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
protected  boolean isAnUltimateAuthorityHere(MOB M, Law laws)
           
 boolean isAnyKindOfOfficer(Law laws, MOB M)
           
 boolean isAnyOfficer(Area myArea, MOB mob)
          Returns whether the given mob qualifies as an arresting officer of any sort in the given legal area.
 boolean isBusyWithJustice(Law laws, MOB M)
           
 boolean isElligibleOfficer(Area myArea, MOB mob)
          Returns whether the given mob is both an officer of the law, and not otherwise engaged in an arrest, and so is available to make one
 boolean isElligibleOfficer(Law laws, MOB M, Area myArea)
           
 boolean isFullyControlled()
          Returns whether this legalbehavior governs an area that is presently legally stable.
 boolean isJailRoom(Area myArea, java.util.List<Room> jails)
          Returns whether any of the given Room objects in the jails Vector is indeed an official Jail room as defined by this legal behavior.
 boolean isJudge(Area myArea, MOB mob)
          Returns whether the given mob qualifies as the judge in the given legal area.
 boolean isStillACrime(LegalWarrant W, boolean debugging)
          Returns whether or not the given legal warrant is still a valid, timely warrant that can be acted upon by law enforcement.
 boolean isTheJudge(Law laws, MOB M)
           
 boolean isTroubleMaker(MOB M)
           
 boolean judgeMe(Law laws, MOB judge, MOB officer, MOB criminal, LegalWarrant W, Area A, boolean debugging)
           
 Law legalInfo(Area myArea)
          Returns the set of laws governing the given geographic legal area, assuming that this LegalBehavior is the behavior governing the same.
 void makePeace(Room R)
           
 void modifyAssessedFines(double d, MOB mob)
          A method to change the amount of base currency currently listed as fines owed by the given mob.
protected  void processWarrant(Area myArea, Law laws, LegalWarrant W, boolean debugging)
           
 void release(Area myArea, LegalWarrant warrant)
          If the warrant reflects someone in prison, it releases them.
 java.lang.String restOfCharges(Law laws, MOB mob)
           
 int revoltChance()
          The present chance (percent) that the area may collapse into revolt and remove itself from control.
 java.lang.String rulingOrganization()
          Get the name of the clan that currently rules this area, if applicable.
 void setControlPoints(java.lang.String clanID, int newControlPoints)
          Modify the number of control points earned by the given clanID.
 void setParms(java.lang.String newParms)
          Sets the raw parameter string for this behavior.
 boolean startTracking(MOB officer, Room R)
           
 void testEntryLaw(Law laws, Area myArea, MOB testMOB, Room R)
           
protected  boolean theLawIsEnabled()
           
 boolean tick(Tickable ticking, int tickID)
          this is the method which is called periodically by the threading engine.
protected  java.lang.String trackingModifiers(MOB officer)
           
 void unCuff(MOB mob)
           
 boolean updateLaw(Area myArea)
          This method notifies the legal behavior that its laws have changed and need to be updated.
 
Methods inherited from class com.planet_ink.coffee_mud.Behaviors.StdBehavior
amDestroyed, canActAtAll, canFreelyBehaveNormal, canImprove, canImprove, compareTo, copyOf, destroy, getBehaversMOB, getBehaversRoom, getCodeNum, getParms, getSaveStatIndex, getStat, getStatCodes, getTickStatus, grantsAggressivenessTo, initializeClass, isSavable, isStat, L, name, newInstance, okMessage, parmsFormat, registerDefaultQuest, sameAs, setSavable, setStat, startBehavior
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.planet_ink.coffee_mud.Behaviors.interfaces.Behavior
canImprove, canImprove, getParms, grantsAggressivenessTo, parmsFormat, registerDefaultQuest, setSavable, startBehavior
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Tickable
getTickStatus, name
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.MsgListener
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, 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

lastAreaName

protected java.lang.String lastAreaName

loadAttempt

protected boolean loadAttempt

finesAssessed

protected java.util.Map<MOB,java.lang.Double> finesAssessed

lastBanishR

protected volatile Room lastBanishR
Constructor Detail

Arrest

public Arrest()
Method Detail

ID

public java.lang.String ID()
Description copied from interface: CMObject
The CoffeeMud Java Class ID shared by all instances of this object. Unlike the Java Class name, this method does not include package information. However, it must return a String value unique to its class category in the ClassLoader. Class categories include Libraries, Common, Areas, Abilities, Behaviors, CharClasses, Commands, Exits Locales, MOBS, Races, WebMacros, Basic Items, Armor, Weapons, ClanItems, Tech. The name is typically identical to the class name.

Specified by:
ID in interface CMObject
Overrides:
ID in class StdBehavior
Returns:
the name of this class

flags

public long flags()
Description copied from interface: Behavior
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.

Specified by:
flags in interface Behavior
Overrides:
flags in class StdBehavior
Returns:
a bitmap made up of Behavior.FLAG_* constants

canImproveCode

protected int canImproveCode()
Overrides:
canImproveCode in class StdBehavior

isFullyControlled

public boolean isFullyControlled()
Description copied from interface: LegalBehavior
Returns whether this legalbehavior governs an area that is presently legally stable. Unconquerable areas are always stable, and areas conquered and controlled for a sufficient amount of time are also stable.

Specified by:
isFullyControlled in interface LegalBehavior
Returns:
Whether order has been restored.

getLawParms

protected java.lang.String getLawParms()

getExtraLawString

public final java.lang.String getExtraLawString()

getExtraLawParms

public final java.util.Properties getExtraLawParms()

accountForYourself

public java.lang.String accountForYourself()
Description copied from interface: Behavior
Returns a string describing what this behavior does. Mostly for thought and behavior reading systems.

Specified by:
accountForYourself in interface Behavior
Overrides:
accountForYourself in class StdBehavior
Returns:
a string describing what this behavior does.

debugLogLostConvicts

public void debugLogLostConvicts(java.lang.String lead,
                                 LegalWarrant W,
                                 MOB officer)

frame

public boolean frame(Area myArea,
                     MOB accused,
                     MOB framed)
Description copied from interface: LegalBehavior
A method that transfers a warrant out on the accused to a different framed individual

Specified by:
frame in interface LegalBehavior
Parameters:
myArea - the geographical legal area
accused - the mob with actual warrants out on him/her
framed - the person to transfer the first warrant to.
Returns:
whether warrants were actually transferred from the accused to the framed

arrest

public boolean arrest(Area myArea,
                      MOB officer,
                      MOB accused)
Description copied from interface: LegalBehavior
Assigns an officer and begins the automated arresting procedure. The target criminal must have a warrant out for this to end well for the state.

Specified by:
arrest in interface LegalBehavior
Parameters:
myArea - the geographic legal area
officer - the mob to assign as the arresting officer
accused - the mob to arrest
Returns:
whether the arrest began successfully.

revoltChance

public int revoltChance()
Description copied from interface: LegalBehavior
The present chance (percent) that the area may collapse into revolt and remove itself from control. Not applicable if the legal behavior doesn't permit government changes or conquest.

Specified by:
revoltChance in interface LegalBehavior
Returns:
the percent chance of revolt

legalInfo

public Law legalInfo(Area myArea)
Description copied from interface: LegalBehavior
Returns the set of laws governing the given geographic legal area, assuming that this LegalBehavior is the behavior governing the same.

Specified by:
legalInfo in interface LegalBehavior
Parameters:
myArea - the geographic legal area
Returns:
the Law object that governs the area and behavior
See Also:
Law

isElligibleOfficer

public boolean isElligibleOfficer(Area myArea,
                                  MOB mob)
Description copied from interface: LegalBehavior
Returns whether the given mob is both an officer of the law, and not otherwise engaged in an arrest, and so is available to make one

Specified by:
isElligibleOfficer in interface LegalBehavior
Parameters:
myArea - the geographic legal area
mob - the pc/npc to test
Returns:
whether the mob is an officer of the law

hasWarrant

public boolean hasWarrant(Area myArea,
                          MOB accused)
Description copied from interface: LegalBehavior
Returns whether the given mob has a valid warrant out for his/her arrest.

Specified by:
hasWarrant in interface LegalBehavior
Parameters:
myArea - the geographic legal area
accused - the mob to test
Returns:
whether a warrant is available for the accused

isAnyOfficer

public boolean isAnyOfficer(Area myArea,
                            MOB mob)
Description copied from interface: LegalBehavior
Returns whether the given mob qualifies as an arresting officer of any sort in the given legal area.

Specified by:
isAnyOfficer in interface LegalBehavior
Parameters:
myArea - the geographic legal area
mob - the mob to test for officerhood
Returns:
true if the mob is an officer, false otherwise

isJudge

public boolean isJudge(Area myArea,
                       MOB mob)
Description copied from interface: LegalBehavior
Returns whether the given mob qualifies as the judge in the given legal area.

Specified by:
isJudge in interface LegalBehavior
Parameters:
myArea - the geographic legal area
mob - the mob to test for judgehood
Returns:
true if the mob is a judge, false otherwise

modifyAssessedFines

public void modifyAssessedFines(double d,
                                MOB mob)
Description copied from interface: LegalBehavior
A method to change the amount of base currency currently listed as fines owed by the given mob. A value of 0 erases.

Specified by:
modifyAssessedFines in interface LegalBehavior
Parameters:
d - the amount of base currency the mob owes
mob - the mob who owes money to the state

finesOwed

public double finesOwed(MOB mob)
Description copied from interface: LegalBehavior
Returns the amount of base currency owed by the given mob, if any.

Specified by:
finesOwed in interface LegalBehavior
Parameters:
mob - the mob who might owe money
Returns:
the amount owed, or 0 if none.

updateLaw

public boolean updateLaw(Area myArea)
Description copied from interface: LegalBehavior
This method notifies the legal behavior that its laws have changed and need to be updated. Call this method whenever the behaviors/ areas laws have changed.

Specified by:
updateLaw in interface LegalBehavior
Parameters:
myArea - the geographic legal area
Returns:
Whether the update was necessary due to the legal parameters

rulingOrganization

public java.lang.String rulingOrganization()
Description copied from interface: LegalBehavior
Get the name of the clan that currently rules this area, if applicable.

Specified by:
rulingOrganization in interface LegalBehavior
Returns:
Empty string if the area is unruled, or ruled by the system. ClanID otherwise.
See Also:
Clan

conquestInfo

public java.lang.String conquestInfo(Area myArea)
Description copied from interface: LegalBehavior
If the legal behavior and area are conquerable by clans or foreign organizations, this method will return the name of the current controlling clan, and some information about the state of the conquest, such as control points achieved.

Specified by:
conquestInfo in interface LegalBehavior
Parameters:
myArea - the geographic legal area
Returns:
information about the conquest of this area, in readable form.

controlPoints

public int controlPoints()
Description copied from interface: LegalBehavior
Returns the number of control points necessary to conquer the area governed by this legal behavior. Not applicable if the legal behavior doesn't permit government changes or conquest.

Specified by:
controlPoints in interface LegalBehavior
Returns:
the number of control points needed to control this legal behavior
See Also:
LegalBehavior.setControlPoints(String, int), LegalBehavior.getControlPoints(String)

setControlPoints

public void setControlPoints(java.lang.String clanID,
                             int newControlPoints)
Description copied from interface: LegalBehavior
Modify the number of control points earned by the given clanID. Not applicable if the legal behavior doesn't permit government changes or conquest.

Specified by:
setControlPoints in interface LegalBehavior
Parameters:
clanID - the clan to assign the control points to
newControlPoints - the number of points to assign
See Also:
LegalBehavior.controlPoints(), LegalBehavior.getControlPoints(String)

getControlPoints

public int getControlPoints(java.lang.String clanID)
Description copied from interface: LegalBehavior
Returns the number of control points earned by the given clanID. Not applicable if the legal behavior doesn't permit government changes or conquest.

Specified by:
getControlPoints in interface LegalBehavior
Parameters:
clanID - the clan to assign the control points to
Returns:
The number of control points earned by this clan/organization
See Also:
LegalBehavior.controlPoints(), LegalBehavior.setControlPoints(String, int)

getCriminals

public java.util.List<MOB> getCriminals(Area myArea,
                                        java.lang.String searchStr)
Description copied from interface: LegalBehavior
Searches the list of warrants, returning those criminal mobs whose names match the search string, and still have legal warrants available for them. Use a search name of NULL to return all criminals.

Specified by:
getCriminals in interface LegalBehavior
Parameters:
myArea - the geographic legal area
searchStr - the name/search string to use
Returns:
a list of MOB objects
See Also:
MOB

getWarrantsOf

public java.util.List<LegalWarrant> getWarrantsOf(Area myArea,
                                                  MOB accused)
Description copied from interface: LegalBehavior
Returns a list of all active legal warrants available on the given mob.

Specified by:
getWarrantsOf in interface LegalBehavior
Parameters:
myArea - the geographic legal area
accused - the mob to look for warrants for
Returns:
a list of LegalWarrant objects
See Also:
LegalWarrant

addWarrant

public boolean addWarrant(Law laws,
                          LegalWarrant W)

addWarrant

public boolean addWarrant(Area myArea,
                          LegalWarrant W)
Description copied from interface: LegalBehavior
Puts a warrant on the official docket so that officers can act on them. This method is called by other methods to finish off their work. Any WARRANTS channels are also notified.

Specified by:
addWarrant in interface LegalBehavior
Parameters:
myArea - the geographic legal area
W - the LegalWarrant to put on the docket
Returns:
whether the warrant was successfully added
See Also:
LegalBehavior.fillOutWarrant(MOB, Law, Area, Environmental, String, String, String, String, String), LegalBehavior.addWarrant(Area, MOB, MOB, String, String, String, String, String), LegalWarrant

addWarrant

public boolean addWarrant(Area myArea,
                          MOB accused,
                          MOB victim,
                          java.lang.String crimeLocs,
                          java.lang.String crimeFlags,
                          java.lang.String crime,
                          java.lang.String sentence,
                          java.lang.String warnMsg)
Description copied from interface: LegalBehavior
Fills out and, if possible, issues a warrant for arrest using the given crime data. Calls fillOutWarrant to do its work.

Specified by:
addWarrant in interface LegalBehavior
Parameters:
myArea - the geographic legal area
accused - the accused character
victim - the victim of a crime, if any
crimeLocs - string of location flags, e.g. !indoors !home keyword !keyword
crimeFlags - string of crime situation flags, e.g. !recently !combat
crime - string description of the crime, e.g. robbing T-NAME
sentence - string sentence action, e.g. warn, parole1, jail1, death
warnMsg - string the officer will say to explain the seriousness of the crime
Returns:
whether or not the warrant was successfully issued
See Also:
LegalBehavior.fillOutWarrant(MOB, Law, Area, Environmental, String, String, String, String, String)

deleteWarrant

public boolean deleteWarrant(Area myArea,
                             LegalWarrant W)
Description copied from interface: LegalBehavior
Removes the given warrants from the list of issued warrants. Does not update the old-warrants (prior convictions) record, but erases the warrant completely.

Specified by:
deleteWarrant in interface LegalBehavior
Parameters:
myArea - the geographic legal area
W - the legal warrant to remove
Returns:
true if the warrant was found to remove, false otherwise
See Also:
LegalWarrant

aquit

public boolean aquit(Area myArea,
                     MOB accused,
                     java.lang.String[] acquittableLaws)
Description copied from interface: LegalBehavior
Removes the first warrant for the given accused criminal, for any one of the given list of official crime KEYS. Crime KEYS are the key names of crimed, such as TAXEVASION.

Specified by:
aquit in interface LegalBehavior
Parameters:
myArea - the geographic legal area
accused - the mob possible accused of one of the crimes
acquittableLaws - the list of crime keys.
Returns:
whether an acquittable crime was found, and removed

isJailRoom

public boolean isJailRoom(Area myArea,
                          java.util.List<Room> jails)
Description copied from interface: LegalBehavior
Returns whether any of the given Room objects in the jails Vector is indeed an official Jail room as defined by this legal behavior.

Specified by:
isJailRoom in interface LegalBehavior
Parameters:
myArea - the geographic legal area
jails - a list of Room objects to inspect
Returns:
whether any one of the room objects is, in fact, a jail
See Also:
Room

accuse

public boolean accuse(Area myArea,
                      MOB accused,
                      MOB victim,
                      java.lang.String[] accusableLaws)
Description copied from interface: LegalBehavior
Issues a LegalWarrant against the accused on behalf of the given victim, for a crime listed in the list of crime keys. Calls fillOutWarrant after retreiving the remaining information about the crime key described by the parameter accusableLaws.

Specified by:
accuse in interface LegalBehavior
Parameters:
myArea - the geographic legal area
accused - the accused mob
victim - the victim of the crime
accusableLaws - a crime key, such as TAXEVASION
Returns:
whether one of the laws was found, and a warrant successfully filled out
See Also:
LegalBehavior.fillOutWarrant(MOB, Law, Area, Environmental, String, String, String, String, String)

setParms

public void setParms(java.lang.String newParms)
Description copied from interface: Behavior
Sets the raw parameter string for this behavior. Parameters are meant to modify or specify specific behavior of this Behavior.

Specified by:
setParms in interface Behavior
Overrides:
setParms in class StdBehavior
Parameters:
newParms - the parameter string for this behavior
See Also:
Behavior.getParms()

defaultModifiableNames

protected boolean defaultModifiableNames()

externalFiles

public java.util.List<java.lang.String> externalFiles()
Description copied from interface: Behavior
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!

Specified by:
externalFiles in interface Behavior
Overrides:
externalFiles in class StdBehavior
Returns:
a list of the path/names of files used by this behavior
See Also:
Behavior.setParms(String)

getResourceKey

public final java.lang.String getResourceKey(java.lang.String lawName)

getLaws

protected Law getLaws(Environmental what,
                      boolean cleanOnly)

unCuff

public void unCuff(MOB mob)

dismissOfficer

public void dismissOfficer(MOB officer)

getAWitnessHere

public MOB getAWitnessHere(Area myArea,
                           Room R,
                           MOB accused)

getWitness

public MOB getWitness(Area A,
                      MOB accused)

isAnyKindOfOfficer

public boolean isAnyKindOfOfficer(Law laws,
                                  MOB M)

isElligibleOfficer

public boolean isElligibleOfficer(Law laws,
                                  MOB M,
                                  Area myArea)

getElligibleOfficerHere

public MOB getElligibleOfficerHere(Law laws,
                                   Area myArea,
                                   Room R,
                                   MOB criminal,
                                   MOB victim)

getAnyElligibleOfficer

public MOB getAnyElligibleOfficer(Law laws,
                                  Area myArea,
                                  MOB criminal,
                                  MOB victim)

getElligibleOfficer

public MOB getElligibleOfficer(Law laws,
                               Area myArea,
                               MOB criminal,
                               MOB victim)

canFocusOn

public boolean canFocusOn(MOB officer,
                          MOB criminal)

isStillACrime

public boolean isStillACrime(LegalWarrant W,
                             boolean debugging)
Description copied from interface: LegalBehavior
Returns whether or not the given legal warrant is still a valid, timely warrant that can be acted upon by law enforcement.

Specified by:
isStillACrime in interface LegalBehavior
Parameters:
W - the legal warrant to inspect
debugging - whether debug information should be sent to the log
Returns:
whether the given warrant is still a valid, timely crime.
See Also:
LegalWarrant

getRelevantWarrants

public java.util.List<LegalWarrant> getRelevantWarrants(java.util.List<LegalWarrant> warrants,
                                                        LegalWarrant W,
                                                        MOB criminal)

getFine

public double getFine(Law laws,
                      LegalWarrant W,
                      MOB criminal)

getBanishmentTicks

public int getBanishmentTicks(Law laws,
                              LegalWarrant W,
                              MOB criminal)

getShameTicks

public int getShameTicks(Law laws,
                         LegalWarrant W,
                         MOB criminal)

getDetainParm

protected java.lang.String getDetainParm(Law laws,
                                         LegalWarrant W,
                                         MOB criminal)

getBanishRoom

protected java.lang.String getBanishRoom(Law laws,
                                         LegalWarrant W,
                                         MOB criminal)

getDetainRoom

protected java.lang.String getDetainRoom(Law laws,
                                         LegalWarrant W,
                                         MOB criminal)

getDetainTime

protected int getDetainTime(Law laws,
                            LegalWarrant W,
                            MOB criminal)

highestCrimeAction

public int highestCrimeAction(Law laws,
                              LegalWarrant W,
                              MOB criminal)

isBusyWithJustice

public boolean isBusyWithJustice(Law laws,
                                 MOB M)

fixCharge

public java.lang.String fixCharge(LegalWarrant W)

restOfCharges

public java.lang.String restOfCharges(Law laws,
                                      MOB mob)

makePeace

public void makePeace(Room R)

isTheJudge

public boolean isTheJudge(Law laws,
                          MOB M)

getTheJudgeHere

public MOB getTheJudgeHere(Law laws,
                           Room R)

findTheJudge

public Room findTheJudge(Law laws,
                         Area myArea)

trackingModifiers

protected java.lang.String trackingModifiers(MOB officer)

startTracking

public boolean startTracking(MOB officer,
                             Room R)

getReleaseRoom

public Room getReleaseRoom(Law laws,
                           Area myArea,
                           MOB criminal,
                           LegalWarrant W)

isTroubleMaker

public boolean isTroubleMaker(MOB M)

getRooms

public java.util.List<Room> getRooms(Area A,
                                     java.util.List<java.lang.String> V)

getRoom

public Room getRoom(Area A,
                    java.lang.String which)

getRoom

public Room getRoom(Area A,
                    java.util.List<java.lang.String> V)

fileAllWarrants

public void fileAllWarrants(Law laws,
                            LegalWarrant W1,
                            MOB mob)

findTheJail

public Room findTheJail(MOB mob,
                        Area myArea,
                        Law laws)

findTheDetentionCenter

public Room findTheDetentionCenter(MOB mob,
                                   Area myArea,
                                   Law laws,
                                   LegalWarrant W)

findTheBanishingPoint

public Room findTheBanishingPoint(MOB mob,
                                  Area myArea,
                                  Law laws,
                                  LegalWarrant W)

judgeMe

public boolean judgeMe(Law laws,
                       MOB judge,
                       MOB officer,
                       MOB criminal,
                       LegalWarrant W,
                       Area A,
                       boolean debugging)

fillOutWarrant

public boolean fillOutWarrant(MOB criminalM,
                              Law laws,
                              Area myArea,
                              Environmental victimM,
                              java.lang.String crimeLocs,
                              java.lang.String crimeFlags,
                              java.lang.String crime,
                              java.lang.String sentence,
                              java.lang.String warnMsg)
Description copied from interface: LegalBehavior
Inspects the circumstances of, and if necessary, assigns a warrant to be handled by local law enforcement and judges. Call this method if you want to add a warrant for a custom crime with your own qualifying flags. For recognized crimes with crime keys, however, use the accuse command.

Specified by:
fillOutWarrant in interface LegalBehavior
Parameters:
criminalM - the accused character
laws - the system of laws to use as a basis
myArea - the geographical domain that the laws apply to
victimM - the victim of a crime, if any
crimeLocs - string of location flags, e.g. !indoors !home keyword !keyword
crimeFlags - string of crime situation flags, e.g. !recently !combat
crime - string description of the crime, e.g. robbing T-NAME
sentence - string sentence action, e.g. warn, parole1, jail1, death
warnMsg - string the officer will say to explain the seriousness of the crime
Returns:
whether or not the warrant was successfully issued
See Also:
LegalBehavior.accuse(Area, MOB, MOB, String[]), Law, Law.PUNISHMENTMASK_DESCS

isAnUltimateAuthorityHere

protected boolean isAnUltimateAuthorityHere(MOB M,
                                            Law laws)

theLawIsEnabled

protected boolean theLawIsEnabled()

testEntryLaw

public void testEntryLaw(Law laws,
                         Area myArea,
                         MOB testMOB,
                         Room R)

executeMsg

public void executeMsg(Environmental affecting,
                       CMMsg msg)
Description copied from interface: MsgListener
The general message event handler for the object. Messages passed herein may not necessarily be FOR this object, or from it, but will almost always represent events happening in the same room. The messages have already been through an approval process, so this method is called only to affect the final execution of the meaning of the message. Every game event goes through these methods.

Specified by:
executeMsg in interface MsgListener
Overrides:
executeMsg in class StdBehavior
Parameters:
affecting - either the initiator of the event, or the host of this object
msg - the CMMsg that needs to be executed
See Also:
CMMsg

haveMobReactToLaw

public void haveMobReactToLaw(MOB mob,
                              MOB officer)

tick

public boolean tick(Tickable ticking,
                    int tickID)
Description copied from interface: Tickable
this is the method which is called periodically by the threading engine. How often it is called depends on the parameters passed to the threadding engine when it is submitted for thread access. Typically the period is once per TIME_TICK period, but that is determined when the object is submitted to the thread engine.

Specified by:
tick in interface Tickable
Overrides:
tick in class StdBehavior
Parameters:
ticking - a reference to this Tickable object
tickID - the TICKID_ constant describing this periodic call, as defined in Tickable
Returns:
true always, unless this object no longer wishes to ever tick again, in which case false
See Also:
Tickable, ServiceEngine, TickableGroup

fileArrestResister

protected void fileArrestResister(Law laws,
                                  Area myArea,
                                  LegalWarrant W)

processWarrant

protected void processWarrant(Area myArea,
                              Law laws,
                              LegalWarrant W,
                              boolean debugging)

release

public void release(Area myArea,
                    LegalWarrant warrant)
Description copied from interface: LegalBehavior
If the warrant reflects someone in prison, it releases them. If the warrant reflects someone being arrested, it releases the arrest and temporarily ignores the warrant.

Specified by:
release in interface LegalBehavior
Parameters:
myArea - the legal area
warrant - the warrant to excuse