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, 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-2008 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
static class DefaultFaction.DefaultFactionAbilityUsage
           
static class DefaultFaction.DefaultFactionChangeEvent
           
static class DefaultFaction.DefaultFactionData
           
static class DefaultFaction.DefaultFactionRange
           
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.Common.interfaces.Faction
Faction.FactionAbilityUsage, Faction.FactionChangeEvent, Faction.FactionData, Faction.FactionRange
 
Field Summary
protected  java.util.Vector abilityUsages
           
protected  java.util.Hashtable affBehavs
           
protected  java.util.Vector autoDefaults
           
protected  java.util.Hashtable changes
           
protected  java.lang.String choiceIntro
           
protected  java.util.Vector choices
           
protected  java.util.Vector defaults
           
protected  int difference
           
protected  java.lang.String experienceFlag
           
protected  java.util.Vector factors
           
protected  int highest
           
protected  java.lang.String ID
           
protected  long[] lastAffectBehaviorChange
           
protected  int lowest
           
protected  int maximum
           
protected  int middle
           
protected  int minimum
           
protected  java.lang.String name
           
protected  java.util.Hashtable ranges
           
protected  double rateModifier
           
protected  java.util.Hashtable relations
           
protected  boolean showInEditor
           
protected  boolean showInFactionsCommand
           
protected  boolean showInScore
           
protected  boolean showInSpecialReported
           
 
Fields inherited from interface com.planet_ink.coffee_mud.Common.interfaces.Faction
ALIGN_EVIL, ALIGN_GOOD, ALIGN_INDIFF, ALIGN_NAMES, ALIGN_NEUTRAL, EXPAFFECT_DESCS, EXPAFFECT_NAMES, 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_RELATION_, TAG_SCOREDISPLAY, TAG_SHOWINFACTIONSCMD, TAG_SPECIALREPORTED
 
Constructor Summary
DefaultFaction()
           
 
Method Summary
 java.util.Enumeration abilityUsages()
          Returns an enumeration of Faction.FactionAbilityUsage objects for this Faction.
 Faction.FactionAbilityUsage 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.FactionChangeEvent addChangeEvent(java.lang.String key)
          Adds a new FactionChangeEvent object to this faction using the given event code name, or fully encoded event string.
 java.lang.Object[] addFactor(double gain, double loss, java.lang.String mask)
          Adds a new change factor to this Faction.
 Faction.FactionRange addRange(java.lang.String key)
          Adds a new Faction.FactionRange object to this faction using an encoded key.
 boolean addRelation(java.lang.String factionID, double relation)
          Adds a new faction relation factor to this faction.
 java.util.Enumeration 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.
 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 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 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 choices()
          Returns the player choosable faction mask/value list, which is possibly presented whenever a player creates a new character.
 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.
 java.util.Enumeration defaults()
          Returns the default faction mask/value list, which is applied whenever a Faction Change Event applies a Faction Add command.
 boolean delAbilityUsage(Faction.FactionAbilityUsage 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(java.lang.String eventKey)
          Removes a FactionChangeEvent of the given event (trigger) id.
 boolean delFactor(java.lang.Object[] o)
          Removes the given change factor from this faction.
 boolean delRange(Faction.FactionRange FR)
          Removes the given FactionRange object from the faction.
 boolean delRelation(java.lang.String factionID)
          Removes the give faction relation from this faction.
 int difference()
          Returns the difference between the highest and lowest range value
 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 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.FactionRange fetchRange(int faction)
          Returns the Faction.FactionRange object that applies to the given faction value.
 Faction.FactionRange 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.
 int findAutoDefault(MOB mob)
          Returns the automatic default faction value that applies to the given mob.
 Faction.FactionChangeEvent findChangeEvent(Ability key)
          Returns a FactionChangeEvent that applies when the given Ability is used
 java.util.Vector 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.FactionAbilityUsage 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 getChangeEvent(java.lang.String key)
          Returns a FactionChangeEvent that applies when the given event name (a trigger code) occurs in the game.
 java.lang.Object[] getFactor(int x)
          Returns the given enumerated change factor
 java.lang.String getINIDef(java.lang.String tag, java.lang.String delimeter)
          Retreives an entry for an ini properties definition document that describes 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
 int lowest()
           
 Faction.FactionData 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 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 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.Vector 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.Vector v)
          Sets the player choosable faction mask/value list, which is possibly presented whenever a player creates a new character.
 void setDefaults(java.util.Vector 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 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 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.
 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.
 
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

lastAffectBehaviorChange

protected long[] lastAffectBehaviorChange

minimum

protected int minimum

middle

protected int middle

difference

protected int difference

maximum

protected int maximum

highest

protected int highest

lowest

protected int lowest

experienceFlag

protected java.lang.String experienceFlag

showInScore

protected boolean showInScore

showInSpecialReported

protected boolean showInSpecialReported

showInEditor

protected boolean showInEditor

showInFactionsCommand

protected boolean showInFactionsCommand

ranges

protected java.util.Hashtable ranges

affBehavs

protected java.util.Hashtable affBehavs

defaults

protected java.util.Vector defaults

autoDefaults

protected java.util.Vector autoDefaults

rateModifier

protected double rateModifier

changes

protected java.util.Hashtable changes

factors

protected java.util.Vector factors

relations

protected java.util.Hashtable relations

abilityUsages

protected java.util.Vector abilityUsages

choices

protected java.util.Vector choices
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, MiscTech. 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>

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
Returns:
the name of this faction
See Also:
Faction.setName(String)

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

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->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 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.FactionRange), Faction.FactionRange

defaults

public java.util.Enumeration 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(Vector), MaskingLibrary

autoDefaults

public java.util.Enumeration 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(Vector)

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 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.addChangeEvent(String), Faction.delChangeEvent(String), Faction.ALL_CHANGE_EVENT_TYPES(), Faction.executeChange(MOB, MOB, com.planet_ink.coffee_mud.Common.interfaces.Faction.FactionChangeEvent)

factors

public java.util.Enumeration 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(Object[]), Faction.findFactor(MOB, boolean), MaskingLibrary

relationFactions

public java.util.Enumeration 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 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.FactionAbilityUsage, Faction.addAbilityUsage(String), Faction.delAbilityUsage(com.planet_ink.coffee_mud.Common.interfaces.Faction.FactionAbilityUsage), Faction.usageFactorRangeDescription(Ability), Faction.hasUsage(Ability), Faction.canUse(MOB, Ability)

choices

public java.util.Enumeration 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(Vector)

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

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->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.Vector 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.Vector 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.Vector 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()

getAbilityUsage

public Faction.FactionAbilityUsage 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.FactionAbilityUsage, Faction.abilityUsages()

delFactor

public boolean delFactor(java.lang.Object[] o)
Description copied from interface: Faction
Removes the given change factor from this faction.

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

getFactor

public java.lang.Object[] 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 java.lang.Object[] 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 cop