com.planet_ink.coffee_mud.Common
Class DefaultFaction

java.lang.Object
  extended by com.planet_ink.coffee_mud.Common.DefaultFaction
All Implemented Interfaces:
CMCommon, Faction, CMObject, Contingent, MsgListener, java.lang.Cloneable, java.lang.Comparable<CMObject>

public class DefaultFaction
extends java.lang.Object
implements Faction, MsgListener

Portions Copyright (c) 2003 Jeremy Vyska Portions Copyright (c) 2004-2018 Bo Zimmerman Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


Nested Class Summary
 class DefaultFaction.DefaultFactionAbilityUsage
           
 class DefaultFaction.DefaultFactionChangeEvent
           
 class DefaultFaction.DefaultFactionData
           
 class DefaultFaction.DefaultFactionRange
           
 class DefaultFaction.DefaultFactionReactionItem
           
 class DefaultFaction.DefaultFactionZapFactor
           
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.Common.interfaces.Faction
Faction.Align, Faction.FAbilityUsage, Faction.FactionChangeEvent, Faction.FData, Faction.FRange, Faction.FReactionItem, Faction.FZapFactor
 
Field Summary
protected  CMap<java.lang.String,Faction.FactionChangeEvent[]> abilChangeCache
           
protected  CList<Faction.FAbilityUsage> abilityUsages
           
protected  CMap<java.lang.String,java.lang.String[]> affBehavs
           
protected  CList<java.lang.String> autoDefaults
           
protected  CMap<java.lang.String,Faction.FactionChangeEvent[]> changes
           
protected  java.lang.String choiceIntro
           
protected  CList<java.lang.String> choices
           
protected  CList<java.lang.String> defaults
           
protected  boolean destroyed
           
protected  int difference
           
protected  java.lang.String experienceFlag
           
protected  CList<Faction.FZapFactor> factors
           
protected  int highest
           
protected  java.lang.String ID
           
protected  long internalFlagBitmap
           
protected  boolean isDisabled
           
protected  long[] lastDataChange
           
protected  int lowest
           
protected  int maximum
           
protected  int middle
           
protected  int minimum
           
protected  java.lang.String name
           
protected  Ability presenceReactionPrototype
           
protected  java.util.Map<java.lang.Integer,Faction.FRange> rangeRangeMap
           
protected  CMap<java.lang.String,Faction.FRange> ranges
           
protected  double rateModifier
           
protected  CMap<java.lang.String,CList<Faction.FReactionItem>> reactionHash
           
protected  CList<Faction.FReactionItem> reactions
           
protected  CMap<java.lang.String,java.lang.Double> relations
           
protected  boolean showInEditor
           
protected  boolean showInFacCommand
           
protected  boolean showInScore
           
protected  boolean showInSpecialReport
           
protected  boolean useLightReactions
           
 
Fields inherited from interface com.planet_ink.coffee_mud.Common.interfaces.Faction
EXPAFFECT_DESCS, EXPAFFECT_NAMES, IFLAG_CUSTOMTICK, IFLAG_IGNOREAUTO, IFLAG_NEVERSAVE, TAG_ABILITY_, TAG_AFFBEHAV_, TAG_AUTOCHOICES, TAG_AUTODEFAULTS, TAG_CHANGE_, TAG_CHOICEINTRO, TAG_DEFAULT, TAG_EDITALONE, TAG_EXPERIENCE, TAG_FACTOR_, TAG_MAXIMUM, TAG_MINIMUM, TAG_NAME, TAG_NAMES, TAG_RANGE_, TAG_RATEMODIFIER, TAG_REACTION_, TAG_RELATION_, TAG_SCOREDISPLAY, TAG_SHOWINFACTIONSCMD, TAG_SPECIALREPORTED, TAG_USELIGHTREACTIONS
 
Constructor Summary
DefaultFaction()
           
 
Method Summary
 java.util.Enumeration<Faction.FAbilityUsage> abilityUsages()
          Returns an enumeration of Faction.FactionAbilityUsage objects for this Faction.
 Faction.FAbilityUsage addAbilityUsage(java.lang.String key)
          Adds a new Faction.FactionAbilityUsage object to this Faction based on the given definitional key.
 boolean addAffectBehav(java.lang.String ID, java.lang.String parms, java.lang.String gainMask)
          Adds a new Ability or Behavior to this Faction.
 Faction.FZapFactor addFactor(double gain, double loss, java.lang.String mask)
          Adds a new change factor to this Faction.
 Faction.FRange addRange(java.lang.String key)
          Adds a new Faction.FactionRange object to this faction using an encoded key.
 boolean addReaction(java.lang.String range, java.lang.String mask, java.lang.String abilityID, java.lang.String parms)
          Adds a new reaction to this faction.
 boolean addRelation(java.lang.String factionID, double relation)
          Adds a new faction relation factor to this faction.
 java.util.Enumeration<java.lang.String> affectsBehavs()
          Returns an enumeration of Abilities or Behavior IDs that are automatically but conditionally added to mobs (not players) with this faction.
 java.lang.String ALL_CHANGE_EVENT_TYPES()
          Computed completed at runtime, this method returns all possible valid FactionChangeEvent event ids that can be used to define triggers.
 boolean amDestroyed()
          Whether the destroy() method has been previousy called on this object.
 int asPercent(int faction)
          Returns the given faction value, as a percent from minimum of the range of this faction
 int asPercentFromAvg(int faction)
          Returns the given value faction value, as a percent from average of the range values of this faction.
 java.util.Enumeration<java.lang.String> autoDefaults()
          Returns the automatic default faction mask/value list, which is possibly applied whenever a mob or player is brought to life for the first time.
 boolean canUse(MOB mob, Ability A)
          Returns whether the given player/mob is prevented from using the given Ability based on any of the Faction.FactionAbilityUsage (faction ability usage) criterium defined for this Faction.
 java.util.Enumeration<java.lang.String> changeEventKeys()
          Returns an enumeration of change event keys, which are the code names of the triggers that cause faction values to change automatically.
 java.lang.String choiceIntro()
          Gets the filename of a file, from the resources directory, that is displayed to users when they are given the choice of a starting value to this faction.
 java.util.Enumeration<java.lang.String> choices()
          Returns the player choosable faction mask/value list, which is possibly presented whenever a player creates a new character.
 void clearChangeEvents()
          Removes all FactionChangeEvents
 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.
 Faction.FactionChangeEvent createChangeEvent(java.lang.String key)
          Adds a new FactionChangeEvent object to this faction using the given event code name, or fully encoded event string.
 java.util.Enumeration<java.lang.String> defaults()
          Returns the default faction mask/value list, which is applied whenever a Faction Change Event applies a Faction Add command.
 boolean delAbilityUsage(Faction.FAbilityUsage usage)
          Removes the given Faction.FactionAbilityUsage object from this faction
 boolean delAffectBehav(java.lang.String ID)
          Removes the given ability or behavior from this Faction.
 boolean delChangeEvent(Faction.FactionChangeEvent event)
          Removes a FactionChangeEvent of the given event (trigger) id.
 boolean delFactor(Faction.FZapFactor f)
          Removes the given change factor from this faction.
 boolean delRange(Faction.FRange FR)
          Removes the given FactionRange object from the faction.
 boolean delReaction(Faction.FReactionItem item)
          Removes the given reaction from this Faction.
 boolean delRelation(java.lang.String factionID)
          Removes the give faction relation from this faction.
 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.
 int difference()
          Returns the difference between the highest and lowest range value
 void disable(boolean truefalse)
          Disables this faction, as if it had been added to the DISABLE= entry in the coffeemud.ini file.
 void executeChange(MOB source, MOB target, Faction.FactionChangeEvent event)
          Executes a Faction change event for the given event source and target, and the applicable FactionChangeEvent event object for this faction
 void executeMsg(Environmental myHost, CMMsg msg)
          The general message event handler for the object.
 java.lang.String experienceFlag()
          Returns the string code describing how a faction-holders experience changes from killing another faction holder affect his own faction value.
 java.lang.String factionID()
          The official, unique faction id of this faction.
 java.util.Enumeration<Faction.FZapFactor> factors()
          Returns an enumeration of Object arrays referring to the a factor to multiply times the base amount (100) of faction change (up or down) for particular mobs who match a given Zapper mask.
 Faction.FRange fetchRange(int faction)
          Returns the Faction.FactionRange object that applies to the given faction value.
 Faction.FRange fetchRange(java.lang.String codeName)
          Returns the Faction.FactionRange object that applies to the given faction range code name.
 java.lang.String fetchRangeName(int faction)
          Returns the name of the Faction.FactionRange object that applies to the given faction value.
 Faction.FactionChangeEvent[] findAbilityChangeEvents(Ability key)
          Returns a FactionChangeEvent that applies when the given Ability is used
 int findAutoDefault(MOB mob)
          Returns the automatic default faction value that applies to the given mob.
 java.util.List<java.lang.Integer> findChoices(MOB mob)
          Returns a vector of Integer objects representing the choosable faction values available to the given mob when they create a new character.
 int findDefault(MOB mob)
          Returns the default faction value that applies to the given mob.
 double findFactor(MOB mob, boolean gain)
          Returns the applicable change factor for the given mob, and the whether the faction change was a gain or loss (not a gain).
 Faction.FAbilityUsage getAbilityUsage(int x)
          Returns the enumerated Faction.FactionAbilityUsage object at the given index.
 java.lang.String[] getAffectBehav(java.lang.String ID)
          Returns a string array containing the parms at index 0, and the gainMask at 1.
 Faction.FactionChangeEvent[] getChangeEvents(java.lang.String key)
          Returns a FactionChangeEvent that applies when the given event name (a trigger code) occurs in the game.
 Faction.FZapFactor getFactor(int x)
          Returns the given enumerated change factor
 java.lang.String getINIDef(java.lang.String tag, java.lang.String delimeter)
          Retrieves an entry for an ini properties definition document that describes this faction.
 long getInternalFlags()
          Return the bitmap of internal-use flags for this faction.
 double getRelation(java.lang.String factionID)
          Returns the relation factor of the given faction id.
 java.lang.String getTagValue(java.lang.String tag)
          Returns the value of a given internal faction variable.
 boolean hasFaction(MOB mob)
          Checks to see if the given mob has this faction.
 boolean hasUsage(Ability A)
          Returns whether any of the Faction.FactionAbilityUsage objects for this Faction apply to the given ability.
 int highest()
           
 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.
 void initializeFaction(java.lang.String aname)
          Initializes a new faction with default values
 void initializeFaction(java.lang.StringBuffer file, java.lang.String fID)
          Initializes a new faction from a faction.ini properties formatted document, and a given new faction ID
 boolean isDisabled()
          Returns true if this faction is presently specified in the coffeemud ini file entry "DISABLE", thereby designating that this faction is currently disabled.
 boolean isPreLoaded()
          Returns true if this faction is presently specified in the coffeemud ini file entry "FACTIONS", thereby designating that this faction is loaded at boot-time, as opposed to run-time.
 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.
 int lowest()
           
 Faction.FData makeFactionData(MOB mob)
          Returns a FactionData object for the given mob to store his faction information in.
 int maximum()
          Returns the highest absolute range value
 int middle()
          Gets the median absolute range value
 int minimum()
          Gets the lowest absolute range value
 java.lang.String name()
          The friendly, displayable name of this faction.
 CMObject newInstance()
          Returns a new instance of this class.
 boolean okMessage(Environmental myHost, CMMsg msg)
          The general message event previewer for the object.
 int randomFaction()
          Returns a random value within the valid range of this faction
 java.util.Enumeration<Faction.FRange> ranges()
          Returns an enumeration of all available Faction.FactionRange objects, representing the entire score of available values valid for this faction.
 double rateModifier()
          A modifier of the base amount of faction value change, namely 100.
 java.util.Enumeration<Faction.FReactionItem> reactions()
          Returns an enumeration of Faction.FactionReaction items associated with this faction.
 java.util.Enumeration<Faction.FReactionItem> reactions(java.lang.String rangeName)
          Returns an enumeration of Faction.FactionReaction items associated with this faction and the given range code.
 java.util.Enumeration<java.lang.String> relationFactions()
          Returns an enumeration of faction ids (of other factions) that are automatically changed, up or down, when this faction changes.
 void setAutoDefaults(java.util.List<java.lang.String> v)
          Sets the automatic default faction mask/value list, which is possibly applied whenever a mob or player is brought to life for the first time.
 void setChoiceIntro(java.lang.String newStr)
          Sets the filename of a file, from the resources directory, that is displayed to users when they are given the choice of a starting value to this faction.
 void setChoices(java.util.List<java.lang.String> v)
          Sets the player choosable faction mask/value list, which is possibly presented whenever a player creates a new character.
 void setDefaults(java.util.List<java.lang.String> v)
          Sets the default faction mask/value list, which is applied whenever a Faction Change Event applies a Faction Add command.
 void setExperienceFlag(java.lang.String newStr)
          Sets the string code describing how a faction-holders experience changes from killing another faction holder affect his own faction value.
 void setFactionID(java.lang.String newStr)
          Sets the official, unique faction id of this faction.
 void setInternalFlags(long bitmap)
          Set the bitmap of internal-use flags for this faction.
 void setLightReactions(boolean truefalse)
          Set this faction to use the light-reaction system, which is easier on resources, but not as powerful.
 void setName(java.lang.String newStr)
          Sets the friendly, displayable name of this faction.
 void setRateModifier(double d)
          Sets the modifier of the base amount of faction value change, namely 100.
 void setSavable(boolean truefalse)
          Sets whether this object can be saved as a permanent aspect of its host.
 void setShowInEditor(boolean truefalse)
          Sets whether this factions value is shown as a line item in mob editors
 void setShowInFactionsCommand(boolean truefalse)
          Sets whether this factions value is shown in player Factions command
 void setShowInScore(boolean truefalse)
          Sets whether this faction is displayed in the player Score command.
 void setShowInSpecialReported(boolean truefalse)
          Sets whether this factions value is shown in certain special admins commands.
 boolean showInEditor()
          Returns whether this factions value is shown as a line item in mob editors
 boolean showInFactionsCommand()
          Returns whether this factions value is shown in player Factions command
 boolean showInScore()
          Returns whether this faction is displayed in the player Score command.
 boolean showInSpecialReported()
          Returns whether this factions value is shown in certain special admins commands.
 void updateFactionData(MOB mob, Faction.FData data)
          Updates the given FactionData object that the given mob to store his faction information in.
 java.lang.String usageFactorRangeDescription(Ability A)
          Returns the list of faction ranges that apply based on Faction.FactionAbilityUsage usage factor that apply to the given ability.
 boolean useLightReactions()
          Return whether this faction uses the light-reaction system, which is easier on resources, but not as powerful.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

protected java.lang.String ID

name

protected java.lang.String name

choiceIntro

protected java.lang.String choiceIntro

lastDataChange

protected long[] lastDataChange

minimum

protected int minimum

middle

protected int middle

difference

protected int difference

maximum

protected int maximum

highest

protected int highest

lowest

protected int lowest

internalFlagBitmap

protected long internalFlagBitmap

experienceFlag

protected java.lang.String experienceFlag

useLightReactions

protected boolean useLightReactions

isDisabled

protected boolean isDisabled

showInScore

protected boolean showInScore

showInSpecialReport

protected boolean showInSpecialReport

showInEditor

protected boolean showInEditor

showInFacCommand

protected boolean showInFacCommand

destroyed

protected boolean destroyed

defaults

protected CList<java.lang.String> defaults

autoDefaults

protected CList<java.lang.String> autoDefaults

ranges

protected CMap<java.lang.String,Faction.FRange> ranges

rangeRangeMap

protected java.util.Map<java.lang.Integer,Faction.FRange> rangeRangeMap

affBehavs

protected CMap<java.lang.String,java.lang.String[]> affBehavs

rateModifier

protected double rateModifier

changes

protected CMap<java.lang.String,Faction.FactionChangeEvent[]> changes

abilChangeCache

protected CMap<java.lang.String,Faction.FactionChangeEvent[]> abilChangeCache

factors

protected CList<Faction.FZapFactor> factors

relations

protected CMap<java.lang.String,java.lang.Double> relations

abilityUsages

protected CList<Faction.FAbilityUsage> abilityUsages

choices

protected CList<java.lang.String> choices

reactions

protected CList<Faction.FReactionItem> reactions

reactionHash

protected CMap<java.lang.String,CList<Faction.FReactionItem>> reactionHash

presenceReactionPrototype

protected Ability presenceReactionPrototype
Constructor Detail

DefaultFaction

public DefaultFaction()
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
Returns:
the name of this class

newInstance

public CMObject newInstance()
Description copied from interface: CMObject
Returns a new instance of this class.

Specified by:
newInstance in interface CMObject
Returns:
a new instance of this class

initializeClass

public void initializeClass()
Description copied from interface: CMObject
Called ONCE after all objects are loaded, but before the map is read in during initialization.

Specified by:
initializeClass in interface CMObject

copyOf

public CMObject copyOf()
Description copied from interface: CMObject
Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed.

Specified by:
copyOf in interface CMObject
Returns:
a clone of this object

compareTo

public int compareTo(CMObject o)
Specified by:
compareTo in interface java.lang.Comparable<CMObject>

reactions

public java.util.Enumeration<Faction.FReactionItem> reactions()
Description copied from interface: Faction
Returns an enumeration of Faction.FactionReaction items associated with this faction. These are automatically added to mobs in the presence of one with this faction.

Specified by:
reactions in interface Faction
Returns:
an enumeration of Faction.FactionReaction items
See Also:
Faction.addReaction(String, String, String, String), Faction.delReaction(Faction.FReactionItem)

reactions

public java.util.Enumeration<Faction.FReactionItem> reactions(java.lang.String rangeName)
Description copied from interface: Faction
Returns an enumeration of Faction.FactionReaction items associated with this faction and the given range code. These are automatically added to mobs in the presence of one with this faction.

Specified by:
reactions in interface Faction
Parameters:
rangeName - the range code to filter by
Returns:
an enumeration of Faction.FactionReaction items
See Also:
Faction.addReaction(String, String, String, String), Faction.delReaction(Faction.FReactionItem)

factionID

public java.lang.String factionID()
Description copied from interface: Faction
The official, unique faction id of this faction. FactionIDs are usually the CoffeeMud VFS path from the resources directory, of the properties ini file that defines the faction. The ID (and therefore the properties file location) should not be changed once a faction is "deployed".

Specified by:
factionID in interface Faction
Returns:
the unique id of this faction
See Also:
Faction.setFactionID(String)

name

public java.lang.String name()
Description copied from interface: Faction
The friendly, displayable name of this faction.

Specified by:
name in interface Faction
Specified by:
name in interface CMObject
Returns:
the name of this faction
See Also:
Faction.setName(String)

getInternalFlags

public long getInternalFlags()
Description copied from interface: Faction
Return the bitmap of internal-use flags for this faction.

Specified by:
getInternalFlags in interface Faction
Returns:
the bitmap of internal-use flags for this faction.
See Also:
Faction.setInternalFlags(long)

choiceIntro

public java.lang.String choiceIntro()
Description copied from interface: Faction
Gets the filename of a file, from the resources directory, that is displayed to users when they are given the choice of a starting value to this faction. Requires more than one choice range be available.

Specified by:
choiceIntro in interface Faction
Returns:
the filename of the choice description file
See Also:
Faction.findChoices(MOB)

minimum

public int minimum()
Description copied from interface: Faction
Gets the lowest absolute range value

Specified by:
minimum in interface Faction
Returns:
the lowest absolute range value

middle

public int middle()
Description copied from interface: Faction
Gets the median absolute range value

Specified by:
middle in interface Faction
Returns:
the median absolute range value

difference

public int difference()
Description copied from interface: Faction
Returns the difference between the highest and lowest range value

Specified by:
difference in interface Faction
Returns:
the difference between the highest and lowest range value

maximum

public int maximum()
Description copied from interface: Faction
Returns the highest absolute range value

Specified by:
maximum in interface Faction
Returns:
the highest absolute range value

isDisabled

public boolean isDisabled()
Description copied from interface: Faction
Returns true if this faction is presently specified in the coffeemud ini file entry "DISABLE", thereby designating that this faction is currently disabled. See also Faction.disable(boolean)

Specified by:
isDisabled in interface Faction
Returns:
true if its disabled, false otherwise.

disable

public void disable(boolean truefalse)
Description copied from interface: Faction
Disables this faction, as if it had been added to the DISABLE= entry in the coffeemud.ini file. See also Faction.isDisabled()

Specified by:
disable in interface Faction
Parameters:
truefalse - disable true to disable, false otherwise

highest

public int highest()

lowest

public int lowest()

experienceFlag

public java.lang.String experienceFlag()
Description copied from interface: Faction
Returns the string code describing how a faction-holders experience changes from killing another faction holder affect his own faction value.

Specified by:
experienceFlag in interface Faction
Returns:
the string code for xp changes to faction changes
See Also:
Faction.EXPAFFECT_NAMES, Faction.EXPAFFECT_DESCS

showInScore

public boolean showInScore()
Description copied from interface: Faction
Returns whether this faction is displayed in the player Score command.

Specified by:
showInScore in interface Faction
Returns:
true if displayed in Score, false otherwise

showInSpecialReported

public boolean showInSpecialReported()
Description copied from interface: Faction
Returns whether this factions value is shown in certain special admins commands.

Specified by:
showInSpecialReported in interface Faction
Returns:
true if displayed in special admin commands, false otherwise

showInEditor

public boolean showInEditor()
Description copied from interface: Faction
Returns whether this factions value is shown as a line item in mob editors

Specified by:
showInEditor in interface Faction
Returns:
true if displayed in mob editors, false otherwise

showInFactionsCommand

public boolean showInFactionsCommand()
Description copied from interface: Faction
Returns whether this factions value is shown in player Factions command

Specified by:
showInFactionsCommand in interface Faction
Returns:
true if displayed in factions command, false otherwise

ranges

public java.util.Enumeration<Faction.FRange> ranges()
Description copied from interface: Faction
Returns an enumeration of all available Faction.FactionRange objects, representing the entire score of available values valid for this faction.

Specified by:
ranges in interface Faction
Returns:
an enumeration of all available ranges
See Also:
Faction.addRange(String), Faction.delRange(com.planet_ink.coffee_mud.Common.interfaces.Faction.FRange), Faction.FRange

defaults

public java.util.Enumeration<java.lang.String> defaults()
Description copied from interface: Faction
Returns the default faction mask/value list, which is applied whenever a Faction Change Event applies a Faction Add command. A default faction mask/value is defined as a number, along with an optional Zapper mask describing to whom the value is applied.

Specified by:
defaults in interface Faction
Returns:
the default faction mask/value list
See Also:
Faction.changeEventKeys(), Faction.setDefaults(List), MaskingLibrary

autoDefaults

public java.util.Enumeration<java.lang.String> autoDefaults()
Description copied from interface: Faction
Returns the automatic default faction mask/value list, which is possibly applied whenever a mob or player is brought to life for the first time. An automatic default faction mask/value is defined as a number, along with an optional Zapper mask describing to whom the value is applied. Each list item is a string.

Specified by:
autoDefaults in interface Faction
Returns:
the automatic default faction mask/value list
See Also:
MaskingLibrary, Faction.setAutoDefaults(List)

rateModifier

public double rateModifier()
Description copied from interface: Faction
A modifier of the base amount of faction value change, namely 100.

Specified by:
rateModifier in interface Faction
Returns:
a modifier of the base amount of faction change
See Also:
Faction.setRateModifier(double)

changeEventKeys

public java.util.Enumeration<java.lang.String> changeEventKeys()
Description copied from interface: Faction
Returns an enumeration of change event keys, which are the code names of the triggers that cause faction values to change automatically.

Specified by:
changeEventKeys in interface Faction
Returns:
an enumeration of the event keys (triggers)
See Also:
Faction.FactionChangeEvent, Faction.createChangeEvent(String eventID), Faction.delChangeEvent(Faction.FactionChangeEvent event), Faction.ALL_CHANGE_EVENT_TYPES(), Faction.executeChange(MOB, MOB, com.planet_ink.coffee_mud.Common.interfaces.Faction.FactionChangeEvent)

factors

public java.util.Enumeration<Faction.FZapFactor> factors()
Description copied from interface: Faction
Returns an enumeration of Object arrays referring to the a factor to multiply times the base amount (100) of faction change (up or down) for particular mobs who match a given Zapper mask. Each Object array consists of a factor to apply on faction gains, a factor to apply on factor drops, and the zapper mask to decide which mobs it applies to (or mob states).

Specified by:
factors in interface Faction
Returns:
the enumeration of change factor object arrays
See Also:
Faction.addFactor(double, double, String), Faction.delFactor(Faction.FZapFactor), Faction.findFactor(MOB, boolean), MaskingLibrary

relationFactions

public java.util.Enumeration<java.lang.String> relationFactions()
Description copied from interface: Faction
Returns an enumeration of faction ids (of other factions) that are automatically changed, up or down, when this faction changes. A relation factor is a number multiplied by the change in this faction to determine the amount that another faction on the same mob is changed by. The factor can be positive or negative to cause the other faction to rise or fall.

Specified by:
relationFactions in interface Faction
Returns:
an enumeration of faction ids
See Also:
Faction.factionID(), Faction.addRelation(String, double), Faction.delRelation(String), Faction.getRelation(String)

abilityUsages

public java.util.Enumeration<Faction.FAbilityUsage> abilityUsages()
Description copied from interface: Faction
Returns an enumeration of Faction.FactionAbilityUsage objects for this Faction. A FactionAbilityUsage object defines restrictions on the use of a mob or players abilities based on values in this faction and other variables.

Specified by:
abilityUsages in interface Faction
Returns:
an enumeration of Faction.FactionAbilityUsage objects for this Faction
See Also:
Faction.FAbilityUsage, Faction.addAbilityUsage(String), Faction.delAbilityUsage(com.planet_ink.coffee_mud.Common.interfaces.Faction.FAbilityUsage), Faction.usageFactorRangeDescription(Ability), Faction.hasUsage(Ability), Faction.canUse(MOB, Ability)

choices

public java.util.Enumeration<java.lang.String> choices()
Description copied from interface: Faction
Returns the player choosable faction mask/value list, which is possibly presented whenever a player creates a new character. An faction mask/value is defined as a number, along with an optional Zapper mask describing to whom the value is applied. Each list item is a string.

Specified by:
choices in interface Faction
Returns:
the choosable faction mask/value list
See Also:
MaskingLibrary, Faction.setChoices(List)

affectsBehavs

public java.util.Enumeration<java.lang.String> affectsBehavs()
Description copied from interface: Faction
Returns an enumeration of Abilities or Behavior IDs that are automatically but conditionally added to mobs (not players) with this faction.

Specified by:
affectsBehavs in interface Faction
Returns:
an enumeration of Abilities or Behavior ID
See Also:
Ability, Behavior, Faction.addAffectBehav(String, String, String), Faction.delAffectBehav(String), Faction.getAffectBehav(String)

setLightReactions

public void setLightReactions(boolean truefalse)
Description copied from interface: Faction
Set this faction to use the light-reaction system, which is easier on resources, but not as powerful.

Specified by:
setLightReactions in interface Faction
Parameters:
truefalse - true to use the light reaction system, false otherwise
See Also:
Faction.useLightReactions()

useLightReactions

public boolean useLightReactions()
Description copied from interface: Faction
Return whether this faction uses the light-reaction system, which is easier on resources, but not as powerful.

Specified by:
useLightReactions in interface Faction
Returns:
true if this faction to use the light-reaction system
See Also:
Faction.setLightReactions(boolean)

setFactionID

public void setFactionID(java.lang.String newStr)
Description copied from interface: Faction
Sets the official, unique faction id of this faction. FactionIDs are usually the CoffeeMud VFS path from the resources directory, of the properties ini file that defines the faction. The ID (and therefore the properties file location) should not be changed once a faction is "deployed".

Specified by:
setFactionID in interface Faction
Parameters:
newStr - the new unique id of this faction
See Also:
Faction.factionID()

setName

public void setName(java.lang.String newStr)
Description copied from interface: Faction
Sets the friendly, displayable name of this faction.

Specified by:
setName in interface Faction
Parameters:
newStr - the new name of this faction
See Also:
Faction.name()

setInternalFlags

public void setInternalFlags(long bitmap)
Description copied from interface: Faction
Set the bitmap of internal-use flags for this faction.

Specified by:
setInternalFlags in interface Faction
Parameters:
bitmap - the bitmap of internal-use flags for this faction.
See Also:
Faction.getInternalFlags()

setChoiceIntro

public void setChoiceIntro(java.lang.String newStr)
Description copied from interface: Faction
Sets the filename of a file, from the resources directory, that is displayed to users when they are given the choice of a starting value to this faction. Requires more than one choice range be available.

Specified by:
setChoiceIntro in interface Faction
Parameters:
newStr - the new filename of the choice description file
See Also:
Faction.findChoices(MOB)

setExperienceFlag

public void setExperienceFlag(java.lang.String newStr)
Description copied from interface: Faction
Sets the string code describing how a faction-holders experience changes from killing another faction holder affect his own faction value.

Specified by:
setExperienceFlag in interface Faction
Parameters:
newStr - the new string code for xp changes to faction changes
See Also:
Faction.EXPAFFECT_NAMES, Faction.EXPAFFECT_DESCS

setShowInScore

public void setShowInScore(boolean truefalse)
Description copied from interface: Faction
Sets whether this faction is displayed in the player Score command.

Specified by:
setShowInScore in interface Faction
Parameters:
truefalse - true if displayed in Score, false otherwise

setShowInSpecialReported

public void setShowInSpecialReported(boolean truefalse)
Description copied from interface: Faction
Sets whether this factions value is shown in certain special admins commands.

Specified by:
setShowInSpecialReported in interface Faction
Parameters:
truefalse - true if displayed in special admin commands, false otherwise

setShowInEditor

public void setShowInEditor(boolean truefalse)
Description copied from interface: Faction
Sets whether this factions value is shown as a line item in mob editors

Specified by:
setShowInEditor in interface Faction
Parameters:
truefalse - true if displayed in mob editors, false otherwise

setShowInFactionsCommand

public void setShowInFactionsCommand(boolean truefalse)
Description copied from interface: Faction
Sets whether this factions value is shown in player Factions command

Specified by:
setShowInFactionsCommand in interface Faction
Parameters:
truefalse - true if displayed in factions command, false otherwise

setChoices

public void setChoices(java.util.List<java.lang.String> v)
Description copied from interface: Faction
Sets the player choosable faction mask/value list, which is possibly presented whenever a player creates a new character. An faction mask/value is defined as a number, along with an optional Zapper mask describing to whom the value is applied. Each list item is a string.

Specified by:
setChoices in interface Faction
Parameters:
v - the list of choosable faction mask/values
See Also:
MaskingLibrary, Faction.choices()

setAutoDefaults

public void setAutoDefaults(java.util.List<java.lang.String> v)
Description copied from interface: Faction
Sets the automatic default faction mask/value list, which is possibly applied whenever a mob or player is brought to life for the first time. An automatic default faction mask/value is defined as a number, along with an optional Zapper mask describing to whom the value is applied. Each list item is a string.

Specified by:
setAutoDefaults in interface Faction
Parameters:
v - the new automatic default faction mask/value list
See Also:
Faction.defaults(), MaskingLibrary

setDefaults

public void setDefaults(java.util.List<java.lang.String> v)
Description copied from interface: Faction
Sets the default faction mask/value list, which is applied whenever a Faction Change Event applies a Faction Add command. A default faction mask/value is defined as a number, along with an optional Zapper mask describing to whom the value is applied. Each list item is a string.

Specified by:
setDefaults in interface Faction
Parameters:
v - the new default faction mask/value list
See Also:
Faction.changeEventKeys(), MaskingLibrary, Faction.defaults()

setRateModifier

public void setRateModifier(double d)
Description copied from interface: Faction
Sets the modifier of the base amount of faction value change, namely 100.

Specified by:
setRateModifier in interface Faction
Parameters:
d - the new modifier of the base amount of faction value change
See Also:
Faction.rateModifier()

isPreLoaded

public boolean isPreLoaded()
Description copied from interface: Faction
Returns true if this faction is presently specified in the coffeemud ini file entry "FACTIONS", thereby designating that this faction is loaded at boot-time, as opposed to run-time.

Specified by:
isPreLoaded in interface Faction
Returns:
true if its pre-loaded, false otherwise.

getAbilityUsage

public Faction.FAbilityUsage getAbilityUsage(int x)
Description copied from interface: Faction
Returns the enumerated Faction.FactionAbilityUsage object at the given index.

Specified by:
getAbilityUsage in interface Faction
Parameters:
x - the index of the Faction.FactionAbilityUsage object to return
Returns:
the Faction.FactionAbilityUsage object at that index
See Also:
Faction.FAbilityUsage, Faction.abilityUsages()

delFactor

public boolean delFactor(Faction.FZapFactor f)
Description copied from interface: Faction
Removes the given change factor from this faction.

Specified by:
delFactor in interface Faction
Parameters:
f - the factor to remove
Returns:
whether the given factor was found to remove
See Also:
Faction.factors()

getFactor

public Faction.FZapFactor getFactor(int x)
Description copied from interface: Faction
Returns the given enumerated change factor

Specified by:
getFactor in interface Faction
Parameters:
x - which factor (0-number) to return
Returns:
the given factor, or null.
See Also:
Faction.factors()

addFactor

public Faction.FZapFactor addFactor(double gain,
                                    double loss,
                                    java.lang.String mask)
Description copied from interface: Faction
Adds a new change factor to this Faction. A change factor is a state dependent multiplier by a change in faction. It consists of a Zapper mask to determine whether the factor applies to the given mob/player state, and a factor to apply on gains in faction or losses in faction.

Specified by:
addFactor in interface Faction
Parameters:
gain - the factor to apply on gains in faction
loss - the factor to apply on losses of faction
mask - the zapper mask to use to determine if this factor applies to a mob
Returns:
the newly created factor Object[] array
See Also:
Faction.factors(), MaskingLibrary

delRelation

public boolean delRelation(java.lang.String factionID)
Description copied from interface: Faction
Removes the give faction relation from this faction. Requires a faction id of another faction.

Specified by:
delRelation in interface Faction
Parameters:
factionID - the faction id to remove
Returns:
whether the faction id was found and removed
See Also:
Faction.factionID(), Faction.relationFactions()

addRelation

public boolean addRelation(java.lang.String factionID,
                           double relation)
Description copied from interface: Faction
Adds a new faction relation factor to this faction. The faction id is the id of another complementary or rival faction, and the relation is a number multiplied by thge change in this faction to determine the amount the given faction id faction is changed by. The relation factor can be positive or negative to cause the faction id faction to rise or fall.

Specified by:
addRelation in interface Faction
Parameters:
factionID - the faction id of the other faction
relation - the relation factor to use as a multiplier
Returns:
whether the new faction id was successfully added
See Also:
Faction.factionID(), Faction.relationFactions()

getRelation

public double getRelation(java.lang.String factionID)
Description copied from interface: Faction
Returns the relation factor of the given faction id. See addRelation for more information.

Specified by:
getRelation in interface Faction
Parameters:
factionID - the other factions faction id
Returns:
the factor to multiply a change in the other faction by
See Also:
Faction.factionID(), Faction.relationFactions(), Faction.addRelation(String, double)

initializeFaction

public void initializeFaction(java.lang.String aname)
Description copied from interface: Faction
Initializes a new faction with default values

Specified by:
initializeFaction in interface Faction
Parameters:
aname - the factionID (and default name)
See Also:
Faction.initializeFaction(StringBuffer, String), Faction.factionID()

initializeFaction

public void initializeFaction(java.lang.StringBuffer file,
                              java.lang.String fID)
Description copied from interface: Faction
Initializes a new faction from a faction.ini properties formatted document, and a given new faction ID

Specified by:
initializeFaction in interface Faction
Parameters:
file - the ini properties style document
fID - the new factionID
See Also:
Faction.initializeFaction(String), Faction.factionID(), Faction.getINIDef(String, String)

getTagValue

public java.lang.String getTagValue(java.lang.String tag)
Description copied from interface: Faction
Returns the value of a given internal faction variable.

Specified by:
getTagValue in interface Faction
Parameters:
tag - the tag to get the value of
Returns:
the value of the given tag
See Also:
Faction.TAG_NAMES

getINIDef

public java.lang.String getINIDef(java.lang.String tag,
                                  java.lang.String delimeter)
Description copied from interface: Faction
Retrieves an entry for an ini properties definition document that describes this faction.

Specified by:
getINIDef in interface Faction
Parameters:
tag - the tag to retrieve a properties definition for
delimeter - if the tag represents a list, this is the delimiter for entries.
Returns:
the ini properties definition entry for the tag
See Also:
Faction.getINIDef(String, String), Faction.initializeFaction(StringBuffer, String), Faction.TAG_NAMES

updateFactionData

public void updateFactionData(MOB mob,
                              Faction.FData data)
Description copied from interface: Faction
Updates the given FactionData object that the given mob to store his faction information in. It will contain all the affects and behaviors, and other information necessary to maintain a relationship between the given mob and this faction. Any parameters should be set on the affects or behaviors before returning them.

Specified by:
updateFactionData in interface Faction
Parameters:
mob - the mob to generate affects and behaviors for
data - the old faction data object
See Also:
Faction.FData

makeFactionData

public Faction.FData makeFactionData(MOB mob)
Description copied from interface: Faction
Returns a FactionData object for the given mob to store his faction information in. It will contain all the affects and behaviors, and other information necessary to maintain a relationship between the given mob and this faction. Any parameters should be set on the affects or behaviors before returning them.

Specified by:
makeFactionData in interface Faction
Parameters:
mob - the mob to generate affects and behaviors for
Returns:
a FactionData object with all the appropriate affects and behaviors
See Also:
Faction.FData

delAffectBehav

public boolean delAffectBehav(java.lang.String ID)
Description copied from interface: Faction
Removes the given ability or behavior from this Faction. It will require the mob be reset or rejuved in order for this to take affect.

Specified by:
delAffectBehav in interface Faction
Parameters:
ID - the Abilities or Behavior ID to remove
Returns:
whether the Abilities or Behavior ID was found and removed
See Also:
Ability, Behavior, Faction.affectsBehavs()

addAffectBehav

public boolean addAffectBehav(java.lang.String ID,
                              java.lang.String parms,
                              java.lang.String gainMask)
Description copied from interface: Faction
Adds a new Ability or Behavior to this Faction. The ID must match a Behavior or, if one is not found, an Ability. The parms are any parameters required by the Behavior or Ability. The gainMask is a simple mask to further narrow what kind of mobs receive the given Ability or Behavior when first receiving this Faction. It will require the mob be reset or rejuved in order for this to take affect.

Specified by:
addAffectBehav in interface Faction
Parameters:
ID - the Abilities or Behavior ID to add
parms - the parameters for the new affect or behavior
gainMask - the zapper mask to check to see who qualifies
Returns:
whether the new Abilities or Behavior ID was successfully added
See Also:
Ability, Behavior, Faction.affectsBehavs(), Faction.delAffectBehav(String)

getAffectBehav

public java.lang.String[] getAffectBehav(java.lang.String ID)
Description copied from interface: Faction
Returns a string array containing the parms at index 0, and the gainMask at 1. See addAffectBehav for more information.

Specified by:
getAffectBehav in interface Faction
Parameters:
ID - the Abilities or Behavior ID
Returns:
a string array containing the parms at index 0, and the gainMask at 1
See Also:
Ability, Behavior, Faction.affectsBehavs(), Faction.addAffectBehav(String, String, String)

delReaction

public boolean delReaction(Faction.FReactionItem item)
Description copied from interface: Faction
Removes the given reaction from this Faction.

Specified by:
delReaction in interface Faction
Parameters:
item - the faction reaction item to remove
Returns:
whether the reaction was found and removed
See Also:
Faction.addReaction(String, String, String, String), Faction.reactions()

addReaction

public boolean addReaction(java.lang.String range,
                           java.lang.String mask,
                           java.lang.String abilityID,
                           java.lang.String parms)
Description copied from interface: Faction
Adds a new reaction to this faction.

Specified by:
addReaction in interface Faction
Parameters:
range - the faction range to use as a determinate
mask - the zapper mask to check to see which mob qualifies
abilityID - the ability/Behavior/or command ID
parms - the parameters for the new affect or behavior or command
Returns:
whether the new reaction was successfully added
See Also:
Faction.delReaction(Faction.FReactionItem), Faction.reactions(), Ability, Command, Behavior

getChangeEvents

public Faction.FactionChangeEvent[] getChangeEvents(java.lang.String key)
Description copied from interface: Faction
Returns a FactionChangeEvent that applies when the given event name (a trigger code) occurs in the game.

Specified by:
getChangeEvents in interface Faction
Parameters:
key - the code name of the event that occurred
Returns:
the FactionChangeEvent triggered by that event
See Also:
Faction.FactionChangeEvent, Faction.changeEventKeys(), Faction.FactionChangeEvent.MISC_TRIGGERS, Faction.executeChange(MOB, MOB, com.planet_ink.coffee_mud.Common.interfaces.Faction.FactionChangeEvent), Faction.ALL_CHANGE_EVENT_TYPES()

findChoices

public java.util.List<java.lang.Integer> findChoices(MOB mob)
Description copied from interface: Faction
Returns a vector of Integer objects representing the choosable faction values available to the given mob when they create a new character.

Specified by:
findChoices in interface Faction
Parameters:
mob - the player mob to evaluate
Returns:
a vector of integer faction values that applies
See Also:
Faction.choices()

findAbilityChangeEvents

public Faction.FactionChangeEvent[] findAbilityChangeEvents(Ability key)
Description copied from interface: Faction
Returns a FactionChangeEvent that applies when the given Ability is used

Specified by:
findAbilityChangeEvents in interface Faction
Parameters:
key - the Ability to find a change event for.
Returns:
the FactionChangeEvent that applies, or null.
See Also:
Faction.FactionChangeEvent, Faction.changeEventKeys(), Faction.executeChange(MOB, MOB, com.planet_ink.coffee_mud.Common.interfaces.Faction.FactionChangeEvent), Faction.ALL_CHANGE_EVENT_TYPES()

fetchRange

public Faction.FRange fetchRange(java.lang.String codeName)
Description copied from interface: Faction
Returns the Faction.FactionRange object that applies to the given faction range code name.

Specified by:
fetchRange in interface Faction
Parameters:
codeName - the code name to find a matching range object for
Returns:
the correct faction range object, or null
See Also:
Faction.ranges(), Faction.FRange.codeName()

fetchRange

public Faction.FRange fetchRange(int faction)
Description copied from interface: Faction
Returns the Faction.FactionRange object that applies to the given faction value.

Specified by:
fetchRange in interface Faction
Parameters:
faction - the value to find a matching range object for
Returns:
the range object that matches the given faction value
See Also:
Faction.FRange, Faction.ranges()

fetchRangeName

public java.lang.String fetchRangeName(int faction)
Description copied from interface: Faction
Returns the name of the Faction.FactionRange object that applies to the given faction value.

Specified by:
fetchRangeName in interface Faction
Parameters:
faction - the value to find a matching range object for
Returns:
the name of the given faction object
See Also:
Faction.ranges()

asPercent

public int asPercent(int faction)
Description copied from interface: Faction
Returns the given faction value, as a percent from minimum of the range of this faction

Specified by:
asPercent in interface Faction
Parameters:
faction - the faction value to convert to a percent
Returns:
the percentage value (0-100)

asPercentFromAvg

public int asPercentFromAvg(int faction)
Description copied from interface: Faction
Returns the given value faction value, as a percent from average of the range values of this faction.

Specified by:
asPercentFromAvg in interface Faction
Parameters:
faction - the faction value to convert to a percent
Returns:
the percentage value (0-100)

randomFaction

public int randomFaction()
Description copied from interface: Faction
Returns a random value within the valid range of this faction

Specified by:
randomFaction in interface Faction
Returns:
a random valid value

findDefault

public int findDefault(MOB mob)
Description copied from interface: Faction
Returns the default faction value that applies to the given mob. This method is called when a Faction Change event applies a Faction Add command. Returns Integer.MAX_VALUE if no default value applies to this mob. Each list item is a string.

Specified by:
findDefault in interface Faction
Parameters:
mob - the mob to find a default faction value for
Returns:
the faction value that applies, or Integer.MAX_VALUE
See Also:
Faction.defaults()

findAutoDefault

public int findAutoDefault(MOB mob)
Description copied from interface: Faction
Returns the automatic default faction value that applies to the given mob. This method is called when a mob is brought into the world. Returns Integer.MAX_VALUE if no default value applies to this mob.

Specified by:
findAutoDefault in interface Faction
Parameters:
mob - the mob to find a default value of this faction for.
Returns:
the value to give to the given mob, or Integer.MAX_VALUE
See Also:
Faction.defaults()

hasFaction

public boolean hasFaction(MOB mob)
Description copied from interface: Faction
Checks to see if the given mob has this faction. Same as checking if mob.fetchFaction(this.factionID())!=Integer.MAX_VALUE.

Specified by:
hasFaction in interface Faction
Parameters:
mob - the mob to check
Returns:
true if the mob has this faction, false otherwise

hasUsage

public boolean hasUsage(Ability A)
Description copied from interface: Faction
Returns whether any of the Faction.FactionAbilityUsage objects for this Faction apply to the given ability.

Specified by:
hasUsage in interface Faction
Parameters:
A - the ability to find a usage criterium for
Returns:
true if a criterium exists, false otherwise.
See Also:
Faction.FAbilityUsage, Faction.abilityUsages()

canUse

public boolean canUse(MOB mob,
                      Ability A)
Description copied from interface: Faction
Returns whether the given player/mob is prevented from using the given Ability based on any of the Faction.FactionAbilityUsage (faction ability usage) criterium defined for this Faction.

Specified by:
canUse in interface Faction
Parameters:
mob - the mob/player to evaluate
A - the ability to evaluate
Returns:
true if the player can use the ability, false otherwise
See Also:
Faction.FAbilityUsage, Faction.abilityUsages()

findFactor

public double findFactor(MOB mob,
                         boolean gain)
Description copied from interface: Faction
Returns the applicable change factor for the given mob, and the whether the faction change was a gain or loss (not a gain).

Specified by:
findFactor in interface Faction
Parameters:
mob - the mob to compare against the zapper masks of the various factors
gain - return the gain factor if true, or the loss factor if false
Returns:
the factor value that applies, or 1.0 (meaning no change).
See Also:
Faction.factors(), MaskingLibrary

executeMsg

public void executeMsg(Environmental myHost,
                       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
Parameters:
myHost - either the initiator of the event, or the host of this object
msg - the CMMsg that needs to be executed
See Also:
CMMsg

okMessage

public boolean okMessage(Environmental myHost,
                         CMMsg msg)
Description copied from interface: MsgListener
The general message event previewer for the object. Messages passed herein are in a pending state, and may be safely modified or rejected without fear that they might be in the middle of being executed. Messages passed herein may not necessarily be FOR or FROM this object, but will almost always represent events which want to happen in the same rom. This method should always always return true UNLESS this message needs to be canceled, in which case it is necessary to tell the mob initiating the event (CMMsg.source()) why it is being cancelled. Every game event goes through these methods.

Specified by:
okMessage in interface MsgListener
Parameters:
myHost - either the initiator of the event, or the host of this object
msg - the CMMsg that wants to be executed
Returns:
whether this message is allowed to execute
See Also:
CMMsg, CMMsg.source()

executeChange

public void executeChange(MOB source,
                          MOB target,
                          Faction.FactionChangeEvent event)
Description copied from interface: Faction
Executes a Faction change event for the given event source and target, and the applicable FactionChangeEvent event object for this faction

Specified by:
executeChange in interface Faction
Parameters:
source - the source of the event
target - the target of the event
event - the applicable event object for this faction
See Also:
Faction.FactionChangeEvent, Faction.changeEventKeys(), Faction.ALL_CHANGE_EVENT_TYPES()

usageFactorRangeDescription

public java.lang.String usageFactorRangeDescription(Ability A)
Description copied from interface: Faction
Returns the list of faction ranges that apply based on Faction.FactionAbilityUsage usage factor that apply to the given ability. An empty string means it does not apply.

Specified by:
usageFactorRangeDescription in interface Faction
Parameters:
A - the ability to find a usage factor for, and then use to find applicable ranges
Returns:
the list of faction range names that apply to this ability from usage factors
See Also:
Faction.FAbilityUsage, Faction.abilityUsages(), Faction.FRange

ALL_CHANGE_EVENT_TYPES

public java.lang.String ALL_CHANGE_EVENT_TYPES()
Description copied from interface: Faction
Computed completed at runtime, this method returns all possible valid FactionChangeEvent event ids that can be used to define triggers.

Specified by:
ALL_CHANGE_EVENT_TYPES in interface Faction
Returns:
a list of all valid event trigger ids.
See Also:
Faction.FactionChangeEvent, Faction.changeEventKeys()

createChangeEvent

public Faction.FactionChangeEvent createChangeEvent(java.lang.String key)
Description copied from interface: Faction
Adds a new FactionChangeEvent object to this faction using the given event code name, or fully encoded event string. The key must be either a single event trigger code (an ability name, event code name), or a fully encoded string which is a semicolon delimited field consisting of event (trigger) id, direction code, and amount

Specified by:
createChangeEvent in interface Faction
Parameters:
key - the field used to create the new FactionChangeEvent
Returns:
the FactionChangeEvent object created and added to this faction, or null
See Also:
Faction.FactionChangeEvent, Faction.changeEventKeys(), Faction.FactionChangeEvent.MISC_TRIGGERS, Faction.ALL_CHANGE_EVENT_TYPES()

clearChangeEvents

public void clearChangeEvents()
Description copied from interface: Faction
Removes all FactionChangeEvents

Specified by:
clearChangeEvents in interface Faction
See Also:
Faction.FactionChangeEvent, Faction.changeEventKeys(), Faction.FactionChangeEvent.MISC_TRIGGERS, Faction.ALL_CHANGE_EVENT_TYPES()

delChangeEvent

public boolean delChangeEvent(Faction.FactionChangeEvent event)
Description copied from interface: Faction
Removes a FactionChangeEvent of the given event (trigger) id.

Specified by:
delChangeEvent in interface Faction
Parameters:
event - the event object to remove from the list of change events
Returns:
whether the event id was found to remove
See Also:
Faction.FactionChangeEvent, Faction.changeEventKeys(), Faction.FactionChangeEvent.MISC_TRIGGERS, Faction.ALL_CHANGE_EVENT_TYPES()

addRange

public Faction.FRange addRange(java.lang.String key)
Description copied from interface: Faction
Adds a new Faction.FactionRange object to this faction using an encoded key. The key is encoded as semicolon separated values of low, high, name, code name, and alignment flag.

Specified by:
addRange in interface Faction
Parameters:
key - the encoded values for the new faction range
Returns:
the faction range object created and added.
See Also:
Faction.FRange, Faction.ranges()

delRange

public boolean delRange(Faction.FRange FR)
Description copied from interface: Faction
Removes the given FactionRange object from the faction.

Specified by:
delRange in interface Faction
Parameters:
FR - the faction range object to remove
Returns:
whether a removal was necessary
See Also:
Faction.FRange, Faction.ranges()

addAbilityUsage

public Faction.FAbilityUsage addAbilityUsage(java.lang.String key)
Description copied from interface: Faction
Adds a new Faction.FactionAbilityUsage object to this Faction based on the given definitional key. The key is NULL to create an empty usage, or a definitional string that consists of one or more ability names, domains, flags, etc followed by a semicolon and a minimum faction value, and another semicolon and a maximum faction value.

Specified by:
addAbilityUsage in interface Faction
Parameters:
key - the definitional key, or null
Returns:
the new Faction.FactionAbilityUsage added
See Also:
Faction.FAbilityUsage, Faction.abilityUsages(), Faction.delAbilityUsage(com.planet_ink.coffee_mud.Common.interfaces.Faction.FAbilityUsage)

delAbilityUsage

public boolean delAbilityUsage(Faction.FAbilityUsage usage)
Description copied from interface: Faction
Removes the given Faction.FactionAbilityUsage object from this faction

Specified by:
delAbilityUsage in interface Faction
Parameters:
usage - the Faction.FactionAbilityUsage object to remove
Returns:
true if the object was found and removed
See Also:
Faction.FAbilityUsage, Faction.abilityUsages(), Faction.addAbilityUsage(String)

destroy

public void destroy()
Description copied from interface: Contingent
Utterly and permanently destroy this object, not only removing it from the map, but causing this object to be collected as garbage by Java. Containers, rooms. and mobs who have their destroy() method called will also call the destroy() methods on all items and other objects listed as content, recursively.

Specified by:
destroy in interface Contingent

isSavable

public boolean isSavable()
Description copied from interface: Contingent
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. It always returns true except under unique circumstances.

Specified by:
isSavable in interface Contingent
Returns:
true, usually.

setSavable

public void setSavable(boolean truefalse)
Description copied from interface: Contingent
Sets whether this object 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()

amDestroyed

public boolean amDestroyed()
Description copied from interface: Contingent
Whether the destroy() method has been previousy called on this object.

Specified by:
amDestroyed in interface Contingent
Returns:
whether the object is destroy()ed.