java.lang.Cloneable
, CMLibrary
, CMObject
, java.lang.Comparable<CMObject>
, Tickable
Factions
public interface FactionManager extends CMLibrary, Tickable
Faction
Modifier and Type | Interface | Description |
---|---|---|
static class |
FactionManager.FAbilityMaskType |
This enum identifies the different types of ability masks
and flags that are found in faciton definitions.
|
idConverter
STATUS_AFFECT, STATUS_ALIVE, STATUS_BEHAVIOR, STATUS_CLASS, STATUS_DEAD, STATUS_END, STATUS_FIGHT, STATUS_MISC, STATUS_MISC2, STATUS_MISC3, STATUS_MISC4, STATUS_MISC5, STATUS_MISC6, STATUS_MISC7, STATUS_NOT, STATUS_OTHER, STATUS_RACE, STATUS_REBIRTH, STATUS_SCRIPT, STATUS_START, STATUS_WEATHER, TICKID_AREA, TICKID_BALLISTICK, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, TICKID_EVENT, TICKID_EXIT_BEHAVIOR, TICKID_EXIT_REOPEN, TICKID_ITEM_BEHAVIOR, TICKID_ITEM_BOUNCEBACK, TICKID_LIGHT_FLICKERS, TICKID_LIVEAUCTION, TICKID_LONGERMASK, TICKID_MISCELLANEOUS, TICKID_MOB, TICKID_PROPERTY_SPECIAL, TICKID_QUEST, TICKID_READYTOSTOP, TICKID_ROOM_BEHAVIOR, TICKID_ROOM_ITEM_REJUV, TICKID_SHORTERMASK, TICKID_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET
Modifier and Type | Method | Description |
---|---|---|
boolean |
addFaction(Faction F) |
Adds a new faction to the memory cache, or modify one
with the same id.
|
void |
clearFactions() |
Clears out all cached factions, which
is part of the shutdown process
|
java.util.Enumeration<Faction> |
factions() |
Returns the enumeration of all the factions
|
FactionManager.FAbilityMaskType |
getAbilityFlagType(java.lang.String strflag) |
Returns what type of ability mask is represented by the string,
as one of the FAbilityMaskType enums, which includes things like
the Ability Code, Domain, Ability Flag (usually prefixed with "!"),
or an Ability ID
|
Faction.Align |
getAlignEnum(java.lang.String str) |
Returns the Align enum that matches the given string,
or INDIFF if not found.
|
int |
getAlignMedianFacValue(Faction.Align eq) |
Returns the purist alignment/inclination faction value associated with the given
Align enum.
|
java.lang.String |
getAlignmentID() |
Returns the faction ID assigned to 'alignment' (good, evil, neutral)
|
int |
getAlignPurity(int faction,
Faction.Align eq) |
Returns the percentage 0-100 of distance that the given
faction value is from the given alignment enum.
|
Faction |
getFaction(java.lang.String factionID) |
Returns the faction with the given faction id.
|
Faction |
getFactionByName(java.lang.String factionNamed) |
Returns the faction object with the given
exact case-insensitive display name.
|
Faction |
getFactionByNumber(int index) |
Returns the faction with the given enum index
number.
|
Faction |
getFactionByRangeCodeName(java.lang.String rangeCodeName) |
Returns the Faction that contains the given range code name.
|
Faction.FRange |
getFactionRangeByCodeName(java.lang.String rangeCodeName) |
Returns the faction range object whose range code matches
the given string.
|
Faction.FacTag |
getFactionTag(java.lang.String tag) |
Returns which faction tag (FacTag) enum
is represented by the given string, which is
typically a parameter from a faction definition/ini
file.
|
java.lang.String |
getInclinationID() |
Returns the faction ID assigned to 'inclination' (lawful, mod, chaotic)
|
int |
getInclinationPurity(int faction,
Faction.Align eq) |
Returns the percentage 0-100 of distance that the given
faction value is from the given alignment enum.
|
int |
getMaximum(java.lang.String factionID) |
Returns the absolute maximum possible faction
value that the faction with the given id can
be assigned.
|
int |
getMinimum(java.lang.String factionID) |
Returns the absolute minimum possible faction
value that the faction with the given id can
be assigned.
|
java.lang.String |
getName(java.lang.String factionID) |
Returns the friendly faction display name
associated with the given faction id
|
int |
getPercent(java.lang.String factionID,
int faction) |
Returns the percentage of the total faction numeric
range (0 to 100) that the given faction number
represents.
|
int |
getPercentFromAvg(java.lang.String factionID,
int faction) |
Returns the percentage of the total faction numeric
range (0 to 100) that the given faction number
represents.
|
int |
getRandom(java.lang.String factionID) |
Returns a random faction number in the range
from its minimum to maximum, given a faction
id.
|
Faction.FRange |
getRange(java.lang.String factionID,
int faction) |
Returns the faction range from the faction with the given faction
id whose range covers the given faction value.
|
double |
getRangePercent(java.lang.String factionID,
int faction) |
Returns the percentage of the total faction numeric
range (0.00 to 100.00) that the given faction number
represents.
|
java.util.Enumeration<Faction.FRange> |
getRanges(java.lang.String factionID) |
Returns an enumerator of all faction range objects in the
faction with the given id.
|
Faction |
getSpecialAreaFaction(Area A) |
If area reactions are enabled, and the given area has one of them, then this
will return the areas faction.
|
Faction[] |
getSpecialFactions(MOB mob,
Room R) |
If reaction factions are enabled, and the given location has one of them,
then this will return the applicable faction.
|
int |
getTotal(java.lang.String factionID) |
Gets the absolute number of points in this faction,
essentially the max - min.
|
boolean |
isAlignmentLoaded(Faction.Align align) |
Returns whether any factions are loaded that grant alignment.
|
boolean |
isFactionedThisWay(MOB mob,
Faction.FRange rangeCode) |
Returns whether the given mob has the faction represented
by the range, and whether their faction value falls within
that range.
|
boolean |
isFactionID(java.lang.String key) |
Returns whether the given string is a legitimate,
loadable faction id.
|
boolean |
isFactionLoaded(java.lang.String key) |
Returns whether the given string is the faction
id of an already loaded and cached faction.
|
boolean |
isRangeCodeName(java.lang.String key) |
Returns whether the given string is, in fact, a range
code for any existing faction.
|
java.lang.String |
listFactions() |
Returns a friendly column based list of
all factions, formatted for 80 col screen.
|
java.lang.String |
makeFactionFilename(java.lang.String factionID) |
Returns a cmfs path, relative to /resources (so, not including
that prefix) that the given faction id should be saved into.
|
Faction |
makeReactionFaction(java.lang.String prefix,
java.lang.String classID,
java.lang.String Name,
java.lang.String code,
java.lang.String baseTemplateFilename) |
Creates a reaction faction based from a template, to represent a specific
entity in the reaction category.
|
void |
modifyFaction(MOB mob,
Faction meF) |
This is an archon/system editor function to modify the specific
attributes and parameters of the given faction.
|
int |
numFactions() |
Return the total number of factions
|
boolean |
postChangeAllFactions(MOB mob,
MOB victim,
int amount,
boolean quiet) |
Posts an official faction change event to the system
without actually designating a faction that changed.
|
boolean |
postSkillFactionChange(MOB mob,
Ability skillA,
java.lang.String factionID,
int amount) |
Posts an official faction change even to the system
that is related to a skill that changes faction.
|
java.lang.String |
rangeDescription(Faction.FRange FR,
java.lang.String andOr) |
Returns a friendly list of the ranges and the faction
name whose code matches a range in the given faction.
|
void |
reloadFactions(java.lang.String factionList) |
Given a semi-colon delimited list of faction
ids, this method will cause them all to be
cached into memory, if they exist.
|
boolean |
removeFaction(java.lang.String factionID) |
Deletes the faction from the memory cache with the
given faction id, or all of the factions if the faction
id is null.
|
java.lang.String |
resaveFaction(Faction F) |
Re-saves the given faction back to the cmfs.
|
void |
setAlignment(MOB mob,
Faction.Align newAlignment) |
Changes the alignment of the given mob to the value of the
Align enum given.
|
void |
setAlignmentOldRange(MOB mob,
int oldRange) |
A legacy method for changing alignment according to
the legacy values where 1000 is pure good, and 0 is evil.
|
void |
updatePlayerFactions(MOB mob,
Room R,
boolean forceAutoCheck) |
This function makes sure that any publicly available factions
which the given mob in the given location are applied to the
given mob, if they can be.
|
activate, getServiceClient, L, propertiesLoaded, shutdown
copyOf, ID, initializeClass, newInstance
getTickStatus, name, tick
boolean addFaction(Faction F)
F
- the faction to addFaction
,
removeFaction(String)
,
resaveFaction(Faction)
boolean removeFaction(java.lang.String factionID)
factionID
- the id to remove, or null for alladdFaction(Faction)
,
resaveFaction(Faction)
java.lang.String resaveFaction(Faction F)
F
- the faction to saveFaction
,
addFaction(Faction)
,
removeFaction(String)
java.util.Enumeration<Faction> factions()
Faction
,
numFactions()
,
getFaction(String)
,
getFactionByNumber(int)
int numFactions()
factions()
,
getFaction(String)
,
getFactionByNumber(int)
Faction getFaction(java.lang.String factionID)
factionID
- the faction id to look forfactions()
,
numFactions()
,
getFactionByNumber(int)
Faction getFactionByNumber(int index)
index
- the index numberfactions()
,
numFactions()
,
getFaction(String)
java.lang.String listFactions()
void reloadFactions(java.lang.String factionList)
factionList
- the list of factionsvoid clearFactions()
boolean isRangeCodeName(java.lang.String key)
key
- the string to checkFaction.FRange
java.lang.String rangeDescription(Faction.FRange FR, java.lang.String andOr)
FR
- the faction range to matchandOr
- the word to use when combining multiplesFaction getFactionByRangeCodeName(java.lang.String rangeCodeName)
rangeCodeName
- the range code name to search forgetFactionRangeByCodeName(String)
,
getRange(String, int)
,
getRanges(String)
Faction.FRange getFactionRangeByCodeName(java.lang.String rangeCodeName)
rangeCodeName
- the range code name to search forgetFactionByRangeCodeName(String)
,
getRange(String, int)
,
getRanges(String)
Faction.FRange getRange(java.lang.String factionID, int faction)
factionID
- the faction id of the faction to checkfaction
- the amount of faction to find the range forgetFactionByRangeCodeName(String)
,
getFactionRangeByCodeName(String)
,
getRanges(String)
java.util.Enumeration<Faction.FRange> getRanges(java.lang.String factionID)
factionID
- the faction id of the faction to checkgetFactionByRangeCodeName(String)
,
getFactionRangeByCodeName(String)
,
getRange(String, int)
boolean isFactionID(java.lang.String key)
key
- the string to checkisFactionLoaded(String)
boolean isFactionLoaded(java.lang.String key)
key
- the faction id to checkisFactionID(String)
Faction getFactionByName(java.lang.String factionNamed)
factionNamed
- the display name to look forgetFaction(String)
java.lang.String getName(java.lang.String factionID)
factionID
- the faction id to look forint getMinimum(java.lang.String factionID)
factionID
- the faction id to look forgetMaximum(String)
int getMaximum(java.lang.String factionID)
factionID
- the faction id to look forgetMinimum(String)
double getRangePercent(java.lang.String factionID, int faction)
factionID
- the faction id to get a range percent for.faction
- the faction number to find the percent ingetPercent(String, int)
,
getPercentFromAvg(String, int)
int getPercent(java.lang.String factionID, int faction)
factionID
- the faction id to get a range percent for.faction
- the faction number to find the percent ingetRangePercent(String, int)
,
getPercentFromAvg(String, int)
int getPercentFromAvg(java.lang.String factionID, int faction)
factionID
- the faction id to get a range percent for.faction
- the faction number to find the percent ingetRangePercent(String, int)
,
getPercent(String, int)
,
getPercentFromAvg(String, int)
int getTotal(java.lang.String factionID)
factionID
- the faction id to checkint getRandom(java.lang.String factionID)
factionID
- the faction id to checkFaction.FacTag getFactionTag(java.lang.String tag)
tag
- the string to checkFaction.FacTag
Faction makeReactionFaction(java.lang.String prefix, java.lang.String classID, java.lang.String Name, java.lang.String code, java.lang.String baseTemplateFilename)
prefix
- prefix to add to the faction id to identify the reaction categoryclassID
- the literal entity class/ID() - for use in masksName
- the friendly name of the entity, prob also for masks or comm.code
- the unique identifier for the entity, w/o spacesbaseTemplateFilename
- the cmfs path of the template to base the reaction onFaction getSpecialAreaFaction(Area A)
A
- the Area to checkgetSpecialFactions(MOB, Room)
Faction[] getSpecialFactions(MOB mob, Room R)
mob
- the mob involvedR
- the mobs locationgetSpecialAreaFaction(Area)
FactionManager.FAbilityMaskType getAbilityFlagType(java.lang.String strflag)
strflag
- the string to find a flag type rep ofFactionManager.FAbilityMaskType
java.lang.String makeFactionFilename(java.lang.String factionID)
factionID
- the faction id to build a filename forboolean isFactionedThisWay(MOB mob, Faction.FRange rangeCode)
mob
- the mob to checkrangeCode
- the faction range object to check the mob forvoid updatePlayerFactions(MOB mob, Room R, boolean forceAutoCheck)
mob
- the player/npc mob to confirm against existing factionsR
- the room the mob is inforceAutoCheck
- just set this to falseboolean postChangeAllFactions(MOB mob, MOB victim, int amount, boolean quiet)
mob
- the mob whose factions have changedvictim
- the victim causing the change, if anyamount
- the amount of factions plus or minusquiet
- true to be silent about the change, or false otherwiseboolean postSkillFactionChange(MOB mob, Ability skillA, java.lang.String factionID, int amount)
mob
- the mob whose faction has changedskillA
- the skill that caused the faction changefactionID
- the faction id of the faction to changeamount
- the amount, plus or minus, to changevoid modifyFaction(MOB mob, Faction meF) throws java.io.IOException
mob
- the player doing the editing, with a sessionmeF
- the faction object being editedjava.io.IOException
- session i/o errorsjava.lang.String getAlignmentID()
void setAlignment(MOB mob, Faction.Align newAlignment)
mob
- the mob to changenewAlignment
- the new alignment by enumFaction.Align
void setAlignmentOldRange(MOB mob, int oldRange)
mob
- the mob to changeoldRange
- the 0-1000 valueint getAlignPurity(int faction, Faction.Align eq)
faction
- the faction valueeq
- the alignment enumFaction.Align
,
isAlignmentLoaded(com.planet_ink.coffee_mud.Common.interfaces.Faction.Align)
,
getAlignMedianFacValue(com.planet_ink.coffee_mud.Common.interfaces.Faction.Align)
,
getAlignEnum(String)
int getAlignMedianFacValue(Faction.Align eq)
eq
- the align fac value to return a pure value forFaction.Align
,
isAlignmentLoaded(com.planet_ink.coffee_mud.Common.interfaces.Faction.Align)
,
getAlignPurity(int, com.planet_ink.coffee_mud.Common.interfaces.Faction.Align)
,
getAlignEnum(String)
Faction.Align getAlignEnum(java.lang.String str)
str
- the Align enum stringFaction.Align
,
isAlignmentLoaded(com.planet_ink.coffee_mud.Common.interfaces.Faction.Align)
,
getAlignMedianFacValue(com.planet_ink.coffee_mud.Common.interfaces.Faction.Align)
,
getAlignPurity(int, com.planet_ink.coffee_mud.Common.interfaces.Faction.Align)
boolean isAlignmentLoaded(Faction.Align align)
align
- the align enum to checkFaction.Align
,
getAlignPurity(int, com.planet_ink.coffee_mud.Common.interfaces.Faction.Align)
,
getAlignMedianFacValue(com.planet_ink.coffee_mud.Common.interfaces.Faction.Align)
,
getAlignEnum(String)
java.lang.String getInclinationID()
int getInclinationPurity(int faction, Faction.Align eq)
faction
- the faction valueeq
- the alignment enumFaction.Align