CMObject
, Tickable
, AbilityComponents
, CMLibrary
, java.lang.Cloneable
, java.lang.Comparable<CMObject>
public class CMAbleComps extends StdLibrary implements AbilityComponents
AbilityComponents.AbilityLimits
Modifier and Type | Field | Description |
---|---|---|
protected java.util.Map<java.lang.String,java.util.List<AbilityComponent>> |
abilitiesWithCompsWithTriggers |
|
protected java.util.Map<java.lang.String,java.util.List<Social>> |
compSocials |
idConverter
isDebugging, name, serviceClient, tickStatus
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
Constructor | Description |
---|---|
CMAbleComps() |
Modifier and Type | Method | Description |
---|---|---|
java.lang.String |
addAbilityComponent(java.lang.String s,
java.util.Map<java.lang.String,java.util.List<AbilityComponent>> H) |
Adds a new coded ability component to the given component map.
|
void |
addAssistingTriggerer(MOB mob,
MOB assistingM,
java.lang.Object key) |
If a component trigger allows otherwise non-qualifying participants,
this will allow it to add other participants to the message
listener for their main triggerer and key, using the INCLUDE
trigger directive.
|
void |
alterAbilityComponentFile(java.lang.String compID,
boolean delete) |
Alters and saved the ability components definition to on the
filesystem (components.txt).
|
java.util.List<java.lang.Object> |
componentCheck(MOB mob,
java.util.List<AbilityComponent> req,
boolean mithrilOK) |
Checks whether the given mob has the given components
required to use a skill available to him/her, and if found,
returns them as a FoundComponents list.
|
protected Triggerer |
confirmAbilityComponentTriggers(MOB mob) |
|
AbilityComponent |
createBlankAbilityComponent(java.lang.String abilityID) |
Creates a new blank ability component object
|
MaterialLibrary.DeadResourceRecord |
destroyAbilityComponents(java.util.List<java.lang.Object> found) |
If the ability component recipe used to build the list of found
components needed to use a skill requires that any of the componenets
are destroyed.
|
PairList<java.lang.String,java.lang.String> |
getAbilityComponentCoded(AbilityComponent comp) |
Breaks an ability component decoded objects into a series of key/value pairs,
where the first is always the connector, and the keys are as follows:
ANDOR, DISPOSITION, FATE, AMOUNT, COMPONENTID, SUBTYPE, MASK.
|
protected java.util.List<PairList<java.lang.String,java.lang.String>> |
getAbilityComponentCodedListLists(java.util.List<AbilityComponent> req) |
|
protected java.util.List<PairList<java.lang.String,java.lang.String>> |
getAbilityComponentCodedPairsList(java.lang.String AID) |
|
java.lang.String |
getAbilityComponentCodedString(java.lang.String AID) |
Reconstructs the coded ability component definition string (ID=parms)
from the internal cached structures, given a particular Ability ID.
|
java.lang.String |
getAbilityComponentCodedString(java.util.List<AbilityComponent> comps) |
Reconstructs the coded ability component definition string (ID=parms)
from the given cached decoded structures list.
|
protected java.lang.String |
getAbilityComponentCodedStringFromCodedList(java.util.List<PairList<java.lang.String,java.lang.String>> comps) |
|
java.lang.String |
getAbilityComponentDesc(MOB mob,
AbilityComponent comp,
boolean useConnector) |
Returns a friendly readable description of a specific component in
the given decoded ability components definition list.
|
java.lang.String |
getAbilityComponentDesc(MOB mob,
java.lang.String AID) |
Returns a friendly readable form of the component requirements
of the given Ability/Skill ID(), or null if that ability has
no requirements.
|
java.lang.String |
getAbilityComponentDesc(MOB mob,
java.util.List<AbilityComponent> req) |
Returns a friendly readable form of the component requirements
of the given Ability/Skill Component List, or null if it has
no requirements.
|
java.util.Map<java.lang.String,java.util.List<AbilityComponent>> |
getAbilityComponentMap() |
Returns the master ability component map, keyed by the Ability ID.
|
java.util.List<AbilityComponent> |
getAbilityComponents(java.lang.String AID) |
Gets the decoded ability component definition for a given Ability ID().
|
protected Triggerer |
getAbilityComponentTriggers(MOB mob,
Ability A) |
|
protected Triggerer |
getActiveTriggerer(MOB mob) |
|
java.util.Map<java.lang.String,java.util.List<Social>> |
getComponentSocials() |
Gets the unique socials applicable to components.
|
java.util.List<Social> |
getSocialsSet(java.lang.String named) |
Returns the social set of the given base name.
|
AbilityComponents.AbilityLimits |
getSpecialSkillLimit(MOB studentM) |
Returns the character-class based common skill ability limits
object applicable to the given mob, or zeroes if there's
a problem.
|
AbilityComponents.AbilityLimits |
getSpecialSkillLimit(MOB studentM,
Ability A) |
Returns the character-class based common skill ability limits
object applicable to the given mob and the given ability.
|
AbilityComponents.AbilityLimits |
getSpecialSkillRemainder(MOB studentM,
Ability A) |
Returns the character-class based common skill ability limits
object applicable to the given mob and the given ability, and
then subtracts the number of each common skill already learned
to derive a remaining number of each type.
|
AbilityComponents.AbilityLimits |
getSpecialSkillRemainders(MOB student) |
Returns the character-class based common skill ability limits
object applicable to the given mob, and
then subtracts the number of each common skill already learned
to derive a remaining number of each type.
|
void |
handleAbilityComponentTriggers(CMMsg msg) |
If the source of the given message has event-triggered ability
components, this will handle any steps in them, possibly causing
an ability/skill to be invoked.
|
java.lang.String |
ID() |
The CoffeeMud Java Class ID shared by all instances of
this object.
|
protected boolean |
isAbilityComponentTriggerCompletedRecently(MOB mob,
Ability A) |
|
protected boolean |
IsItemComponent(MOB mob,
AbilityComponent comp,
int[] amt,
Item I,
java.util.List<java.lang.Object> thisSet,
boolean mithrilOK) |
|
protected boolean |
isRightMaterial(long type,
long itemMaterial,
boolean mithrilOK) |
|
java.util.List<Item> |
makeComponents(MOB mob,
java.util.List<AbilityComponent> req) |
Returns a dirty approximation of the minimal resources in the component
requirement that match the given mob.
|
java.util.List<Item> |
makeComponentsSample(java.util.List<AbilityComponent> req,
boolean mithrilOK) |
Returns a very dirty approximate of a sample of what components appear
to be required.
|
protected Item |
makeItemComponent(AbilityComponent comp,
boolean mithrilOK) |
|
void |
setAbilityComponentCodedFromCodedPairs(PairList<java.lang.String,java.lang.String> decodedDV,
AbilityComponent comp) |
Copies the key/value pairs from a PairList of specific abilitycomponent fields
into the given AbilityComponent object.
|
void |
startAbilityComponentTrigger(MOB mob,
Ability A) |
If the given mob is eligible to automatically run through
a component trigger automatically, this method will kick it off.
|
void |
tickAbilityComponentTriggers(MOB mob) |
If the given mob has event triggered ability components that
require action during a tick, this will manage that.
|
activate, getServiceClient, L, propertiesLoaded, shutdown
copyOf, initializeClass, name, newInstance
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
activate, checkDatabase, compareTo, copyOf, getServiceClient, getTickStatus, initializeClass, L, name, newInstance, propertiesLoaded, setThreadStatus, shutdown, tick
protected final java.util.Map<java.lang.String,java.util.List<AbilityComponent>> abilitiesWithCompsWithTriggers
protected java.util.Map<java.lang.String,java.util.List<Social>> compSocials
public java.lang.String ID()
CMObject
ID
in interface CMObject
ID
in class StdLibrary
protected final boolean isRightMaterial(long type, long itemMaterial, boolean mithrilOK)
protected Item makeItemComponent(AbilityComponent comp, boolean mithrilOK)
protected boolean IsItemComponent(MOB mob, AbilityComponent comp, int[] amt, Item I, java.util.List<java.lang.Object> thisSet, boolean mithrilOK)
public java.util.List<Item> makeComponentsSample(java.util.List<AbilityComponent> req, boolean mithrilOK)
AbilityComponents
makeComponentsSample
in interface AbilityComponents
req
- the ability components rules definitionmithrilOK
- true to allow mithril as a metal substituteAbilityComponents.getAbilityComponents(String)
public java.util.List<java.lang.Object> componentCheck(MOB mob, java.util.List<AbilityComponent> req, boolean mithrilOK)
AbilityComponents
componentCheck
in interface AbilityComponents
mob
- the mob whose inventory or room or both to checkreq
- the ability components rules definitionmithrilOK
- true to allow mithril as a metal substituteAbilityComponents.getAbilityComponents(String)
public java.util.List<Item> makeComponents(MOB mob, java.util.List<AbilityComponent> req)
AbilityComponents
makeComponents
in interface AbilityComponents
mob
- the mob trying to meet the requirementsreq
- the requirements to be metpublic java.util.List<AbilityComponent> getAbilityComponents(java.lang.String AID)
AbilityComponents
getAbilityComponents
in interface AbilityComponents
AID
- the Ability ID()protected java.util.List<PairList<java.lang.String,java.lang.String>> getAbilityComponentCodedPairsList(java.lang.String AID)
public PairList<java.lang.String,java.lang.String> getAbilityComponentCoded(AbilityComponent comp)
AbilityComponents
getAbilityComponentCoded
in interface AbilityComponents
comp
- the decoded ability component to produce fields fromAbilityComponents.setAbilityComponentCodedFromCodedPairs(PairList, AbilityComponent)
public void setAbilityComponentCodedFromCodedPairs(PairList<java.lang.String,java.lang.String> decodedDV, AbilityComponent comp)
AbilityComponents
setAbilityComponentCodedFromCodedPairs
in interface AbilityComponents
decodedDV
- the key/value pairs of the ability component values.comp
- the decoded ability component to copy field data intoAbilityComponents.getAbilityComponentCoded(AbilityComponent)
protected java.util.List<PairList<java.lang.String,java.lang.String>> getAbilityComponentCodedListLists(java.util.List<AbilityComponent> req)
public AbilityComponent createBlankAbilityComponent(java.lang.String abilityID)
AbilityComponents
createBlankAbilityComponent
in interface AbilityComponents
abilityID
- the ability id to based this component onpublic java.lang.String getAbilityComponentCodedString(java.util.List<AbilityComponent> comps)
AbilityComponents
getAbilityComponentCodedString
in interface AbilityComponents
comps
- the decoded ability components definition listAbilityComponents.getAbilityComponentCodedString(String)
protected java.lang.String getAbilityComponentCodedStringFromCodedList(java.util.List<PairList<java.lang.String,java.lang.String>> comps)
public java.lang.String getAbilityComponentCodedString(java.lang.String AID)
AbilityComponents
getAbilityComponentCodedString
in interface AbilityComponents
AID
- the Ability ID()AbilityComponents.getAbilityComponentCodedString(List)
public java.lang.String getAbilityComponentDesc(MOB mob, AbilityComponent comp, boolean useConnector)
AbilityComponents
getAbilityComponentDesc
in interface AbilityComponents
mob
- the mob to check this components applicability to.comp
- the complete ability component decodeduseConnector
- true to use a connector AND/OR, false otherwiseAbilityComponents.getAbilityComponentDesc(MOB, List)
,
AbilityComponents.getAbilityComponentDesc(MOB, String)
public java.lang.String getAbilityComponentDesc(MOB mob, java.lang.String AID)
AbilityComponents
getAbilityComponentDesc
in interface AbilityComponents
mob
- the player mob who wants to knowAID
- the Ability ID() of the skill whose components to checkAbilityComponents.getAbilityComponentDesc(MOB, List)
,
AbilityComponents.getAbilityComponentDesc(MOB, AbilityComponent, boolean)
public java.lang.String getAbilityComponentDesc(MOB mob, java.util.List<AbilityComponent> req)
AbilityComponents
getAbilityComponentDesc
in interface AbilityComponents
mob
- the player mob who wants to knowreq
- the coded requirements listAbilityComponents.getAbilityComponentDesc(MOB, AbilityComponent, boolean)
,
AbilityComponents.getAbilityComponentDesc(MOB, String)
public java.lang.String addAbilityComponent(java.lang.String s, java.util.Map<java.lang.String,java.util.List<AbilityComponent>> H)
AbilityComponents
addAbilityComponent
in interface AbilityComponents
s
- the new coded ability component stringH
- the map to add the new component topublic java.util.Map<java.lang.String,java.util.List<AbilityComponent>> getAbilityComponentMap()
AbilityComponents
getAbilityComponentMap
in interface AbilityComponents
public java.util.Map<java.lang.String,java.util.List<Social>> getComponentSocials()
AbilityComponents
getComponentSocials
in interface AbilityComponents
AbilityComponents.getSocialsSet(String)
public MaterialLibrary.DeadResourceRecord destroyAbilityComponents(java.util.List<java.lang.Object> found)
AbilityComponents
destroyAbilityComponents
in interface AbilityComponents
found
- the components found with componentCheckAbilityComponents.componentCheck(MOB, List, boolean)
,
MaterialLibrary.DeadResourceRecord
public java.util.List<Social> getSocialsSet(java.lang.String named)
AbilityComponents
getSocialsSet
in interface AbilityComponents
named
- the social base nameAbilityComponents.getComponentSocials()
public void alterAbilityComponentFile(java.lang.String compID, boolean delete)
AbilityComponents
alterAbilityComponentFile
in interface AbilityComponents
compID
- the ID of the component being altereddelete
- true to delete, false to add or modifypublic AbilityComponents.AbilityLimits getSpecialSkillLimit(MOB studentM)
AbilityComponents
getSpecialSkillLimit
in interface AbilityComponents
studentM
- the mob to find limits forAbilityComponents.getSpecialSkillLimit(MOB, Ability)
,
AbilityComponents.getSpecialSkillRemainder(MOB, Ability)
,
AbilityComponents.getSpecialSkillRemainders(MOB)
,
AbilityComponents.AbilityLimits
public AbilityComponents.AbilityLimits getSpecialSkillLimit(MOB studentM, Ability A)
AbilityComponents
getSpecialSkillLimit
in interface AbilityComponents
studentM
- the mob to find limits forA
- the ability object to find limits forAbilityComponents.getSpecialSkillLimit(MOB)
,
AbilityComponents.getSpecialSkillRemainder(MOB, Ability)
,
AbilityComponents.getSpecialSkillRemainders(MOB)
,
AbilityComponents.AbilityLimits
,
AbilityComponents.AbilityLimits.specificSkillLimit()
public AbilityComponents.AbilityLimits getSpecialSkillRemainder(MOB studentM, Ability A)
AbilityComponents
getSpecialSkillRemainder
in interface AbilityComponents
studentM
- the mob to find limits forA
- the ability object to find limits forAbilityComponents.getSpecialSkillLimit(MOB, Ability)
,
AbilityComponents.getSpecialSkillLimit(MOB)
,
AbilityComponents.getSpecialSkillRemainders(MOB)
,
AbilityComponents.AbilityLimits
,
AbilityComponents.AbilityLimits.specificSkillLimit()
public AbilityComponents.AbilityLimits getSpecialSkillRemainders(MOB student)
AbilityComponents
getSpecialSkillRemainders
in interface AbilityComponents
student
- the mob to find limits forAbilityComponents.getSpecialSkillLimit(MOB, Ability)
,
AbilityComponents.getSpecialSkillLimit(MOB)
,
AbilityComponents.getSpecialSkillRemainder(MOB, Ability)
,
AbilityComponents.AbilityLimits
public void addAssistingTriggerer(MOB mob, MOB assistingM, java.lang.Object key)
AbilityComponents
addAssistingTriggerer
in interface AbilityComponents
mob
- the mob to be an assistantassistingM
- the mob being assisted, with their triggererkey
- the key to the triggerprotected boolean isAbilityComponentTriggerCompletedRecently(MOB mob, Ability A)
public void startAbilityComponentTrigger(MOB mob, Ability A)
AbilityComponents
startAbilityComponentTrigger
in interface AbilityComponents
mob
- the non-player mobA
- the ability to kick offpublic void tickAbilityComponentTriggers(MOB mob)
AbilityComponents
tickAbilityComponentTriggers
in interface AbilityComponents
mob
- the mob who might needs to do somethingpublic void handleAbilityComponentTriggers(CMMsg msg)
AbilityComponents
handleAbilityComponentTriggers
in interface AbilityComponents
msg
- the event to check