CMCommon
, Faction
, CMObject
, Contingent
, MsgListener
, java.lang.Cloneable
, java.lang.Comparable<CMObject>
public class DefaultFaction extends java.lang.Object implements Faction, MsgListener
Modifier and Type | Class | Description |
---|---|---|
class |
DefaultFaction.DefaultFactionChangeEvent |
|
class |
DefaultFaction.DefaultFactionData |
|
class |
DefaultFaction.DefaultFactionRange |
|
class |
DefaultFaction.DefaultFactionReactionItem |
|
class |
DefaultFaction.DefaultFactionZapFactor |
Faction.Align, Faction.FAbilityUsage, Faction.FacTag, Faction.FactionChangeEvent, Faction.FData, Faction.FRange, Faction.FReactionItem, Faction.FZapFactor
Modifier and Type | Field | Description |
---|---|---|
protected java.lang.String |
_factionID |
|
protected CMap<java.lang.String,Faction.FactionChangeEvent[]> |
abilChangeCache |
|
protected CList<Faction.FAbilityUsage> |
abilityUsages |
|
protected java.util.Map<java.lang.String,Faction.FAbilityUsage> |
abilityUseCache |
|
protected java.util.Set<java.lang.String> |
abilityUseMisses |
|
protected CMap<java.lang.String,java.lang.String[]> |
affBehavs |
|
protected CList<Pair<java.lang.Integer,java.lang.String>> |
autoDefaults |
|
protected CMap<java.lang.String,Faction.FactionChangeEvent[]> |
changes |
|
protected java.lang.String |
choiceIntro |
|
protected CList<Pair<java.lang.Integer,java.lang.String>> |
choices |
|
protected CList<Pair<java.lang.Integer,java.lang.String>> |
defaults |
|
protected boolean |
destroyed |
|
protected int |
difference |
|
protected java.lang.String |
experienceFlag |
|
protected CList<Faction.FZapFactor> |
factors |
|
protected int |
highest |
|
protected long |
internalFlagBitmap |
|
protected boolean |
isDisabled |
|
protected boolean |
isInherited |
|
protected long[] |
lastDataChange |
|
protected int |
lowest |
|
protected int |
maximum |
|
protected int |
middle |
|
protected int |
minimum |
|
protected CMap<java.lang.Integer,Faction.FactionChangeEvent[]> |
msgChangeCache |
|
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 CMap<java.lang.String,Faction.FactionChangeEvent[]> |
socChangeCache |
|
protected java.lang.String |
upName |
|
protected boolean |
useLightReactions |
idConverter
EXPAFFECT_DESCS, EXPAFFECT_NAMES, IFLAG_CUSTOMTICK, IFLAG_IGNOREAUTO, IFLAG_NEVERSAVE
Constructor | Description |
---|---|
DefaultFaction() |
Modifier and Type | Method | Description |
---|---|---|
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<Pair<java.lang.Integer,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<Pair<java.lang.Integer,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 eventKey,
java.lang.String eventData) |
Adds a new FactionChangeEvent object to this faction using the given event code
name, or fully encoded event string.
|
java.util.Enumeration<Pair<java.lang.Integer,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 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.FactionChangeEvent[] |
findMsgChangeEvents(CMMsg msg) |
Returns a FactionChangeEvent that applies when the given message type is seen
|
Faction.FactionChangeEvent[] |
findSocialChangeEvents(Social soc) |
Returns a FactionChangeEvent that applies when the given Social is used
|
Faction.FAbilityUsage |
getAbilityUsage(int x) |
Returns the enumerated Faction.FactionAbilityUsage object at the given index.
|
protected Faction.FAbilityUsage |
getAbilityUsage(Ability A) |
|
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.
|
protected java.util.Map<java.lang.String,java.lang.Integer> |
getCMMsgTypeMap() |
|
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 |
isInheritable() |
Returns true if this faction is inheritable by children.
|
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.
|
protected CList<Pair<java.lang.Integer,java.lang.String>> |
parseChoifaults(java.util.List<java.lang.String> V) |
|
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 |
setInherited(boolean truefalse) |
Sets whether this faction is inheritable by children.
|
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 |
upperName() |
Returns the full-uppercase version of the faction name, which
might be useful for key-ing and searches.
|
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.
|
protected java.lang.String _factionID
protected java.lang.String name
protected java.lang.String upName
protected java.lang.String choiceIntro
protected long[] lastDataChange
protected int minimum
protected int middle
protected int difference
protected int maximum
protected int highest
protected int lowest
protected long internalFlagBitmap
protected java.lang.String experienceFlag
protected boolean useLightReactions
protected boolean isDisabled
protected boolean showInScore
protected boolean showInSpecialReport
protected boolean showInEditor
protected boolean showInFacCommand
protected boolean isInherited
protected boolean destroyed
protected CMap<java.lang.String,Faction.FRange> ranges
protected java.util.Map<java.lang.Integer,Faction.FRange> rangeRangeMap
protected CMap<java.lang.String,java.lang.String[]> affBehavs
protected double rateModifier
protected CMap<java.lang.String,Faction.FactionChangeEvent[]> changes
protected CMap<java.lang.String,Faction.FactionChangeEvent[]> abilChangeCache
protected CMap<java.lang.String,Faction.FactionChangeEvent[]> socChangeCache
protected CMap<java.lang.Integer,Faction.FactionChangeEvent[]> msgChangeCache
protected CList<Faction.FZapFactor> factors
protected CMap<java.lang.String,java.lang.Double> relations
protected CList<Faction.FAbilityUsage> abilityUsages
protected java.util.Map<java.lang.String,Faction.FAbilityUsage> abilityUseCache
protected java.util.Set<java.lang.String> abilityUseMisses
protected CList<Faction.FReactionItem> reactions
protected CMap<java.lang.String,CList<Faction.FReactionItem>> reactionHash
protected Ability presenceReactionPrototype
public java.lang.String ID()
CMObject
public CMObject newInstance()
CMObject
newInstance
in interface CMObject
public void initializeClass()
CMObject
initializeClass
in interface CMObject
public CMObject copyOf()
CMObject
public int compareTo(CMObject o)
compareTo
in interface java.lang.Comparable<CMObject>
public java.util.Enumeration<Faction.FReactionItem> reactions()
Faction
reactions
in interface Faction
Faction.addReaction(String, String, String, String)
,
Faction.delReaction(Faction.FReactionItem)
public java.util.Enumeration<Faction.FReactionItem> reactions(java.lang.String rangeName)
Faction
reactions
in interface Faction
rangeName
- the range code to filter byFaction.addReaction(String, String, String, String)
,
Faction.delReaction(Faction.FReactionItem)
public java.lang.String factionID()
Faction
factionID
in interface Faction
Faction.setFactionID(String)
public java.lang.String name()
Faction
name
in interface CMObject
name
in interface Faction
Faction.setName(String)
public java.lang.String upperName()
Faction
public long getInternalFlags()
Faction
getInternalFlags
in interface Faction
Faction.setInternalFlags(long)
public java.lang.String choiceIntro()
Faction
choiceIntro
in interface Faction
Faction.findChoices(MOB)
public boolean isInheritable()
Faction
isInheritable
in interface Faction
public int minimum()
Faction
public int middle()
Faction
public int difference()
Faction
difference
in interface Faction
public int maximum()
Faction
public boolean isDisabled()
Faction
Faction.disable(boolean)
isDisabled
in interface Faction
public void disable(boolean truefalse)
Faction
Faction.isDisabled()
public int highest()
public int lowest()
public java.lang.String experienceFlag()
Faction
experienceFlag
in interface Faction
Faction.EXPAFFECT_NAMES
,
Faction.EXPAFFECT_DESCS
public boolean showInScore()
Faction
showInScore
in interface Faction
public boolean showInSpecialReported()
Faction
showInSpecialReported
in interface Faction
public boolean showInEditor()
Faction
showInEditor
in interface Faction
public boolean showInFactionsCommand()
Faction
showInFactionsCommand
in interface Faction
public java.util.Enumeration<Faction.FRange> ranges()
Faction
ranges
in interface Faction
Faction.addRange(String)
,
Faction.delRange(com.planet_ink.coffee_mud.Common.interfaces.Faction.FRange)
,
Faction.FRange
public java.util.Enumeration<Pair<java.lang.Integer,java.lang.String>> defaults()
Faction
defaults
in interface Faction
Faction.changeEventKeys()
,
Faction.setDefaults(List)
,
MaskingLibrary
public java.util.Enumeration<Pair<java.lang.Integer,java.lang.String>> autoDefaults()
Faction
autoDefaults
in interface Faction
MaskingLibrary
,
Faction.setAutoDefaults(List)
public double rateModifier()
Faction
rateModifier
in interface Faction
Faction.setRateModifier(double)
public java.util.Enumeration<java.lang.String> changeEventKeys()
Faction
changeEventKeys
in interface Faction
Faction.FactionChangeEvent
,
Faction.createChangeEvent(String eventKey, String eventData)
,
Faction.delChangeEvent(Faction.FactionChangeEvent event)
,
Faction.ALL_CHANGE_EVENT_TYPES()
,
Faction.executeChange(MOB, MOB, com.planet_ink.coffee_mud.Common.interfaces.Faction.FactionChangeEvent)
public java.util.Enumeration<Faction.FZapFactor> factors()
Faction
factors
in interface Faction
Faction.addFactor(double, double, String)
,
Faction.delFactor(Faction.FZapFactor)
,
Faction.findFactor(MOB, boolean)
,
MaskingLibrary
public java.util.Enumeration<java.lang.String> relationFactions()
Faction
relationFactions
in interface Faction
Faction.factionID()
,
Faction.addRelation(String, double)
,
Faction.delRelation(String)
,
Faction.getRelation(String)
public java.util.Enumeration<Faction.FAbilityUsage> abilityUsages()
Faction
abilityUsages
in interface Faction
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)
public java.util.Enumeration<Pair<java.lang.Integer,java.lang.String>> choices()
Faction
choices
in interface Faction
MaskingLibrary
,
Faction.setChoices(List)
public java.util.Enumeration<java.lang.String> affectsBehavs()
Faction
affectsBehavs
in interface Faction
Ability
,
Behavior
,
Faction.addAffectBehav(String, String, String)
,
Faction.delAffectBehav(String)
,
Faction.getAffectBehav(String)
public void setLightReactions(boolean truefalse)
Faction
setLightReactions
in interface Faction
truefalse
- true to use the light reaction system, false otherwiseFaction.useLightReactions()
public boolean useLightReactions()
Faction
useLightReactions
in interface Faction
Faction.setLightReactions(boolean)
public void setFactionID(java.lang.String newStr)
Faction
setFactionID
in interface Faction
newStr
- the new unique id of this factionFaction.factionID()
public void setName(java.lang.String newStr)
Faction
setName
in interface Faction
newStr
- the new name of this factionFaction.name()
public void setInternalFlags(long bitmap)
Faction
setInternalFlags
in interface Faction
bitmap
- the bitmap of internal-use flags for this faction.Faction.getInternalFlags()
public void setChoiceIntro(java.lang.String newStr)
Faction
setChoiceIntro
in interface Faction
newStr
- the new filename of the choice description fileFaction.findChoices(MOB)
public void setExperienceFlag(java.lang.String newStr)
Faction
setExperienceFlag
in interface Faction
newStr
- the new string code for xp changes to faction changesFaction.EXPAFFECT_NAMES
,
Faction.EXPAFFECT_DESCS
public void setShowInScore(boolean truefalse)
Faction
setShowInScore
in interface Faction
truefalse
- true if displayed in Score, false otherwisepublic void setInherited(boolean truefalse)
Faction
setInherited
in interface Faction
truefalse
- true if its inheritable, false otherwisepublic void setShowInSpecialReported(boolean truefalse)
Faction
setShowInSpecialReported
in interface Faction
truefalse
- true if displayed in special admin commands, false otherwisepublic void setShowInEditor(boolean truefalse)
Faction
setShowInEditor
in interface Faction
truefalse
- true if displayed in mob editors, false otherwisepublic void setShowInFactionsCommand(boolean truefalse)
Faction
setShowInFactionsCommand
in interface Faction
truefalse
- true if displayed in factions command, false otherwiseprotected CList<Pair<java.lang.Integer,java.lang.String>> parseChoifaults(java.util.List<java.lang.String> V)
public void setChoices(java.util.List<java.lang.String> v)
Faction
setChoices
in interface Faction
v
- the list of choosable faction mask/valuesMaskingLibrary
,
Faction.choices()
public void setAutoDefaults(java.util.List<java.lang.String> v)
Faction
setAutoDefaults
in interface Faction
v
- the new automatic default faction mask/value listFaction.defaults()
,
MaskingLibrary
public void setDefaults(java.util.List<java.lang.String> v)
Faction
setDefaults
in interface Faction
v
- the new default faction mask/value listFaction.changeEventKeys()
,
MaskingLibrary
,
Faction.defaults()
public void setRateModifier(double d)
Faction
setRateModifier
in interface Faction
d
- the new modifier of the base amount of faction value changeFaction.rateModifier()
public boolean isPreLoaded()
Faction
isPreLoaded
in interface Faction
public Faction.FAbilityUsage getAbilityUsage(int x)
Faction
getAbilityUsage
in interface Faction
x
- the index of the Faction.FactionAbilityUsage object to returnFaction.FAbilityUsage
,
Faction.abilityUsages()
public boolean delFactor(Faction.FZapFactor f)
Faction
delFactor
in interface Faction
f
- the factor to removeFaction.factors()
public Faction.FZapFactor getFactor(int x)
Faction
getFactor
in interface Faction
x
- which factor (0-number) to returnFaction.factors()
public Faction.FZapFactor addFactor(double gain, double loss, java.lang.String mask)
Faction
addFactor
in interface Faction
gain
- the factor to apply on gains in factionloss
- the factor to apply on losses of factionmask
- the zapper mask to use to determine if this factor applies to a mobFaction.factors()
,
MaskingLibrary
public boolean delRelation(java.lang.String factionID)
Faction
delRelation
in interface Faction
factionID
- the faction id to removeFaction.factionID()
,
Faction.relationFactions()
public boolean addRelation(java.lang.String factionID, double relation)
Faction
addRelation
in interface Faction
factionID
- the faction id of the other factionrelation
- the relation factor to use as a multiplierFaction.factionID()
,
Faction.relationFactions()
public double getRelation(java.lang.String factionID)
Faction
getRelation
in interface Faction
factionID
- the other factions faction idFaction.factionID()
,
Faction.relationFactions()
,
Faction.addRelation(String, double)
public void initializeFaction(java.lang.String aname)
Faction
initializeFaction
in interface Faction
aname
- the factionID (and default name)Faction.initializeFaction(StringBuffer, String)
,
Faction.factionID()
public void initializeFaction(java.lang.StringBuffer file, java.lang.String fID)
Faction
initializeFaction
in interface Faction
file
- the ini properties style documentfID
- the new factionIDFaction.initializeFaction(String)
,
Faction.factionID()
,
Faction.getINIDef(String, String)
public java.lang.String getTagValue(java.lang.String tag)
Faction
getTagValue
in interface Faction
tag
- the tag to get the value ofpublic java.lang.String getINIDef(java.lang.String tag, java.lang.String delimeter)
Faction
getINIDef
in interface Faction
tag
- the tag to retrieve a properties definition fordelimeter
- if the tag represents a list, this is the delimiter for entries.Faction.getINIDef(String, String)
,
Faction.initializeFaction(StringBuffer, String)
public void updateFactionData(MOB mob, Faction.FData data)
Faction
updateFactionData
in interface Faction
mob
- the mob to generate affects and behaviors fordata
- the old faction data objectFaction.FData
public Faction.FData makeFactionData(MOB mob)
Faction
makeFactionData
in interface Faction
mob
- the mob to generate affects and behaviors forFaction.FData
public boolean delAffectBehav(java.lang.String ID)
Faction
delAffectBehav
in interface Faction
ID
- the Abilities or Behavior ID to removeAbility
,
Behavior
,
Faction.affectsBehavs()
public boolean addAffectBehav(java.lang.String ID, java.lang.String parms, java.lang.String gainMask)
Faction
addAffectBehav
in interface Faction
ID
- the Abilities or Behavior ID to addparms
- the parameters for the new affect or behaviorgainMask
- the zapper mask to check to see who qualifiesAbility
,
Behavior
,
Faction.affectsBehavs()
,
Faction.delAffectBehav(String)
public java.lang.String[] getAffectBehav(java.lang.String ID)
Faction
getAffectBehav
in interface Faction
ID
- the Abilities or Behavior IDAbility
,
Behavior
,
Faction.affectsBehavs()
,
Faction.addAffectBehav(String, String, String)
public boolean delReaction(Faction.FReactionItem item)
Faction
delReaction
in interface Faction
item
- the faction reaction item to removeFaction.addReaction(String, String, String, String)
,
Faction.reactions()
public boolean addReaction(java.lang.String range, java.lang.String mask, java.lang.String abilityID, java.lang.String parms)
Faction
addReaction
in interface Faction
range
- the faction range to use as a determinatemask
- the zapper mask to check to see which mob qualifiesabilityID
- the ability/Behavior/or command IDparms
- the parameters for the new affect or behavior or commandFaction.delReaction(Faction.FReactionItem)
,
Faction.reactions()
,
Ability
,
Command
,
Behavior
public Faction.FactionChangeEvent[] getChangeEvents(java.lang.String key)
Faction
getChangeEvents
in interface Faction
key
- the code name of the event that occurredFaction.FactionChangeEvent
,
Faction.changeEventKeys()
,
Faction.FactionChangeEvent.miscEvent()
,
Faction.executeChange(MOB, MOB, com.planet_ink.coffee_mud.Common.interfaces.Faction.FactionChangeEvent)
,
Faction.ALL_CHANGE_EVENT_TYPES()
public java.util.List<java.lang.Integer> findChoices(MOB mob)
Faction
findChoices
in interface Faction
mob
- the player mob to evaluateFaction.choices()
protected java.util.Map<java.lang.String,java.lang.Integer> getCMMsgTypeMap()
public Faction.FactionChangeEvent[] findMsgChangeEvents(CMMsg msg)
Faction
findMsgChangeEvents
in interface Faction
msg
- the CMMsg object whose source code mattersFaction.FactionChangeEvent
,
Faction.changeEventKeys()
,
Faction.executeChange(MOB, MOB, com.planet_ink.coffee_mud.Common.interfaces.Faction.FactionChangeEvent)
,
Faction.ALL_CHANGE_EVENT_TYPES()
public Faction.FactionChangeEvent[] findAbilityChangeEvents(Ability key)
Faction
findAbilityChangeEvents
in interface Faction
key
- the Ability to find a change event for.Faction.FactionChangeEvent
,
Faction.changeEventKeys()
,
Faction.executeChange(MOB, MOB, com.planet_ink.coffee_mud.Common.interfaces.Faction.FactionChangeEvent)
,
Faction.ALL_CHANGE_EVENT_TYPES()
public Faction.FactionChangeEvent[] findSocialChangeEvents(Social soc)
Faction
findSocialChangeEvents
in interface Faction
soc
- the Social to find a change event for.Faction.FactionChangeEvent
,
Faction.changeEventKeys()
,
Faction.executeChange(MOB, MOB, com.planet_ink.coffee_mud.Common.interfaces.Faction.FactionChangeEvent)
,
Faction.ALL_CHANGE_EVENT_TYPES()
public Faction.FRange fetchRange(java.lang.String codeName)
Faction
fetchRange
in interface Faction
codeName
- the code name to find a matching range object forFaction.ranges()
,
Faction.FRange.codeName()
public Faction.FRange fetchRange(int faction)
Faction
fetchRange
in interface Faction
faction
- the value to find a matching range object forFaction.FRange
,
Faction.ranges()
public java.lang.String fetchRangeName(int faction)
Faction
fetchRangeName
in interface Faction
faction
- the value to find a matching range object forFaction.ranges()
public int asPercent(int faction)
Faction
public int asPercentFromAvg(int faction)
Faction
asPercentFromAvg
in interface Faction
faction
- the faction value to convert to a percentpublic int randomFaction()
Faction
randomFaction
in interface Faction
public int findDefault(MOB mob)
Faction
findDefault
in interface Faction
mob
- the mob to find a default faction value forFaction.defaults()
public int findAutoDefault(MOB mob)
Faction
findAutoDefault
in interface Faction
mob
- the mob to find a default value of this faction for.Faction.defaults()
public boolean hasFaction(MOB mob)
Faction
hasFaction
in interface Faction
mob
- the mob to checkprotected Faction.FAbilityUsage getAbilityUsage(Ability A)
public boolean hasUsage(Ability A)
Faction
hasUsage
in interface Faction
A
- the ability to find a usage criterium forFaction.FAbilityUsage
,
Faction.abilityUsages()
public boolean canUse(MOB mob, Ability A)
Faction
canUse
in interface Faction
mob
- the mob/player to evaluateA
- the ability to evaluateFaction.FAbilityUsage
,
Faction.abilityUsages()
public double findFactor(MOB mob, boolean gain)
Faction
findFactor
in interface Faction
mob
- the mob to compare against the zapper masks of the various factorsgain
- return the gain factor if true, or the loss factor if falseFaction.factors()
,
MaskingLibrary
public void executeMsg(Environmental myHost, CMMsg msg)
MsgListener
executeMsg
in interface MsgListener
myHost
- either the initiator of the event, or the host of this objectmsg
- the CMMsg that needs to be executedCMMsg
public boolean okMessage(Environmental myHost, CMMsg msg)
MsgListener
okMessage
in interface MsgListener
myHost
- either the initiator of the event, or the host of this objectmsg
- the CMMsg that wants to be executedCMMsg
,
CMMsg.source()
public void executeChange(MOB source, MOB target, Faction.FactionChangeEvent event)
Faction
executeChange
in interface Faction
source
- the source of the eventtarget
- the target of the eventevent
- the applicable event object for this factionFaction.FactionChangeEvent
,
Faction.changeEventKeys()
,
Faction.ALL_CHANGE_EVENT_TYPES()
public java.lang.String usageFactorRangeDescription(Ability A)
Faction
usageFactorRangeDescription
in interface Faction
A
- the ability to find a usage factor for, and then use to find applicable rangesFaction.FAbilityUsage
,
Faction.abilityUsages()
,
Faction.FRange
public java.lang.String ALL_CHANGE_EVENT_TYPES()
Faction
ALL_CHANGE_EVENT_TYPES
in interface Faction
Faction.FactionChangeEvent
,
Faction.changeEventKeys()
public Faction.FactionChangeEvent createChangeEvent(java.lang.String eventKey, java.lang.String eventData)
Faction
createChangeEvent
in interface Faction
eventKey
- the faction event keyeventData
- the field used to create the new FactionChangeEventFaction.FactionChangeEvent
,
Faction.changeEventKeys()
,
Faction.FactionChangeEvent.miscEvent()
,
Faction.ALL_CHANGE_EVENT_TYPES()
public void clearChangeEvents()
Faction
clearChangeEvents
in interface Faction
Faction.FactionChangeEvent
,
Faction.changeEventKeys()
,
Faction.FactionChangeEvent.miscEvent()
,
Faction.ALL_CHANGE_EVENT_TYPES()
public boolean delChangeEvent(Faction.FactionChangeEvent event)
Faction
delChangeEvent
in interface Faction
event
- the event object to remove from the list of change eventsFaction.FactionChangeEvent
,
Faction.changeEventKeys()
,
Faction.FactionChangeEvent.miscEvent()
,
Faction.ALL_CHANGE_EVENT_TYPES()
public Faction.FRange addRange(java.lang.String key)
Faction
addRange
in interface Faction
key
- the encoded values for the new faction rangeFaction.FRange
,
Faction.ranges()
public boolean delRange(Faction.FRange FR)
Faction
delRange
in interface Faction
FR
- the faction range object to removeFaction.FRange
,
Faction.ranges()
public Faction.FAbilityUsage addAbilityUsage(java.lang.String key)
Faction
addAbilityUsage
in interface Faction
key
- the definitional key, or nullFaction.FAbilityUsage
,
Faction.abilityUsages()
,
Faction.delAbilityUsage(com.planet_ink.coffee_mud.Common.interfaces.Faction.FAbilityUsage)
public boolean delAbilityUsage(Faction.FAbilityUsage usage)
Faction
delAbilityUsage
in interface Faction
usage
- the Faction.FactionAbilityUsage object to removeFaction.FAbilityUsage
,
Faction.abilityUsages()
,
Faction.addAbilityUsage(String)
public void destroy()
Contingent
destroy
in interface Contingent
public boolean isSavable()
Contingent
isSavable
in interface Contingent
public void setSavable(boolean truefalse)
Contingent
setSavable
in interface Contingent
truefalse
- whether this behavior can be saved as part of its host.Contingent.isSavable()
public boolean amDestroyed()
Contingent
amDestroyed
in interface Contingent