com.planet_ink.coffee_mud.Common.interfaces
Interface Faction.FactionChangeEvent

All Known Implementing Classes:
DefaultFaction.DefaultFactionChangeEvent
Enclosing interface:
Faction

public static interface Faction.FactionChangeEvent

A Faction Change Event is an event that triggers an automatic change in a mob or players faction value. Triggers can be the use of abilities, or certain specific coded events (such as killing another mob).

See Also:
Faction.ALL_CHANGE_EVENT_TYPES(), Faction.executeChange(MOB, MOB, com.planet_ink.coffee_mud.Common.interfaces.Faction.FactionChangeEvent)

Field Summary
static int CHANGE_DIRECTION_ADD
          a direction constant meaning this event adds the faction with a default value
static int CHANGE_DIRECTION_AWAY
          a direction constant meaning this event changes the factions value away from targets value
static java.lang.String[] CHANGE_DIRECTION_DESCS
          the code words for the various direction flags that describe the direction and amount of faction change
static int CHANGE_DIRECTION_DOWN
          a direction constant meaning this event changes the factions value downward
static int CHANGE_DIRECTION_MAXIMUM
          a direction constant meaning this event changes the factions value directly to highest value
static int CHANGE_DIRECTION_MINIMUM
          a direction constant meaning this event changes the factions value directly to lowest value
static int CHANGE_DIRECTION_OPPOSITE
          a direction constant meaning this event changes the factions value opposite of targets faction leanings
static int CHANGE_DIRECTION_REMOVE
          a direction constant meaning this event removes the faction altogether
static int CHANGE_DIRECTION_TOWARD
          a direction constant meaning this event changes the factions value towards the targets value
static int CHANGE_DIRECTION_UP
          a direction constant meaning this event changes the factions value upward
static java.lang.String[] FLAG_DESCS
          the code words for the various evaluation flags to decide if this event applies and other things
static java.lang.String[] MISC_TRIGGERS
          some non-ability-related event trigger ids
 
Method Summary
 boolean applies(MOB mob)
          Returns whether the given mob is a valid target of this event.
 int direction()
          Returns a code for a description of how an event, if applicable, will affect this factions value.
 java.lang.String eventID()
          Returns the event trigger id
 double factor()
          Returns the factor to multiply the base faction change amount (100) by, to determine the amount of this faction changed by this event, in accordance with the given direction.
 java.lang.String flagCache()
          Returns the list of flags that apply to this event.
 int IDclassFilter()
          A derivative of the event id, this will return a value of 0 or above if the event id was of a particular Ability ACODE_.
 int IDdomainFilter()
          A derivative of the event id, this will return a value of 0 or above if the event id was of a particular Ability DOMAIN_.
 int IDflagFilter()
          A derivative of the event id, this will return a value of 0 or above if the event id was of a particular Ability FLAG_.
 boolean just100()
          A derivative of the flag cache, this method returns whether the flag was set that causes the determination of the amount of faction move to apply to NOT take the difference between the source and targets levels into account.
 boolean outsiderTargetOK()
          A derivative of the flag cache, this method returns whether the flag was set that allows this event to trigger when the target of the event does not have any value with this faction
 boolean selfTargetOK()
          A derivative of the flag cache, this method returns whether the flag was set that allows this event to trigger when the target and source of the event are the same.
 void setDirection(int newVal)
          Sets a code for a description of how an event, if applicable, will affect this factions value.
 boolean setEventID(java.lang.String newID)
          Sets the event trigger id
 void setFactor(double newVal)
          Sets the factor to multiply the base faction change amount (100) by, to determine the amount of this faction changed by this event, in accordance with the given direction.
 void setFlags(java.lang.String newFlagCache)
          Sets the list of flags that apply to this event.
 void setZapper(java.lang.String newVal)
          Sets the zapper mask that is used to see if the target of the event qualifies in order to trigger a faction change by this defined event.
 java.lang.String toString()
          Returns a semicolon delimited list of all the settings in this change event
 java.lang.String zapper()
          Returns the zapper mask that is used to see if the target of the event qualifies in order to trigger a faction change by this defined event.
 

Field Detail

CHANGE_DIRECTION_UP

static final int CHANGE_DIRECTION_UP
a direction constant meaning this event changes the factions value upward

See Also:
Constant Field Values

CHANGE_DIRECTION_DOWN

static final int CHANGE_DIRECTION_DOWN
a direction constant meaning this event changes the factions value downward

See Also:
Constant Field Values

CHANGE_DIRECTION_OPPOSITE

static final int CHANGE_DIRECTION_OPPOSITE
a direction constant meaning this event changes the factions value opposite of targets faction leanings

See Also:
Constant Field Values

CHANGE_DIRECTION_MINIMUM

static final int CHANGE_DIRECTION_MINIMUM
a direction constant meaning this event changes the factions value directly to lowest value

See Also:
Constant Field Values

CHANGE_DIRECTION_MAXIMUM

static final int CHANGE_DIRECTION_MAXIMUM
a direction constant meaning this event changes the factions value directly to highest value

See Also:
Constant Field Values

CHANGE_DIRECTION_REMOVE

static final int CHANGE_DIRECTION_REMOVE
a direction constant meaning this event removes the faction altogether

See Also:
Constant Field Values

CHANGE_DIRECTION_ADD

static final int CHANGE_DIRECTION_ADD
a direction constant meaning this event adds the faction with a default value

See Also:
Constant Field Values

CHANGE_DIRECTION_AWAY

static final int CHANGE_DIRECTION_AWAY
a direction constant meaning this event changes the factions value away from targets value

See Also:
Constant Field Values

CHANGE_DIRECTION_TOWARD

static final int CHANGE_DIRECTION_TOWARD
a direction constant meaning this event changes the factions value towards the targets value

See Also:
Constant Field Values

CHANGE_DIRECTION_DESCS

static final java.lang.String[] CHANGE_DIRECTION_DESCS
the code words for the various direction flags that describe the direction and amount of faction change


FLAG_DESCS

static final java.lang.String[] FLAG_DESCS
the code words for the various evaluation flags to decide if this event applies and other things


MISC_TRIGGERS

static final java.lang.String[] MISC_TRIGGERS
some non-ability-related event trigger ids

Method Detail

eventID

java.lang.String eventID()
Returns the event trigger id

Returns:
the event trigger id
See Also:
Faction.ALL_CHANGE_EVENT_TYPES(), setEventID(String), IDclassFilter(), IDdomainFilter(), IDflagFilter()

setEventID

boolean setEventID(java.lang.String newID)
Sets the event trigger id

Parameters:
newID - the new event trigger id
Returns:
true if the event id is valid
See Also:
Faction.ALL_CHANGE_EVENT_TYPES(), eventID(), IDclassFilter(), IDdomainFilter(), IDflagFilter()

IDclassFilter

int IDclassFilter()
A derivative of the event id, this will return a value of 0 or above if the event id was of a particular Ability ACODE_. Returns -1 if this value does not apply, or an index into ACODE_DESCS.

Returns:
-1, or an index into an Ability ACODE
See Also:
Ability.ACODE_DESCS, eventID(), IDdomainFilter(), IDflagFilter()

IDflagFilter

int IDflagFilter()
A derivative of the event id, this will return a value of 0 or above if the event id was of a particular Ability FLAG_. Returns -1 if this value does not apply, or an index into FLAG_DESCS.

Returns:
-1, or an index into an Ability FLAG
See Also:
Ability.FLAG_DESCS, eventID(), IDclassFilter(), IDdomainFilter()

IDdomainFilter

int IDdomainFilter()
A derivative of the event id, this will return a value of 0 or above if the event id was of a particular Ability DOMAIN_. Returns -1 if this value does not apply, or an index into DOMAIN_DESCS.

Returns:
-1, or an index into an Ability ACODE
See Also:
Ability.DOMAIN_DESCS, eventID(), IDclassFilter(), IDflagFilter()

flagCache

java.lang.String flagCache()
Returns the list of flags that apply to this event.

Returns:
the list of applicable flags
See Also:
FLAG_DESCS, setFlags(String), outsiderTargetOK(), selfTargetOK(), just100()

setFlags

void setFlags(java.lang.String newFlagCache)
Sets the list of flags that apply to this event.

Parameters:
newFlagCache - the new list of applicable flags
See Also:
FLAG_DESCS, flagCache(), outsiderTargetOK(), selfTargetOK(), just100()

outsiderTargetOK

boolean outsiderTargetOK()
A derivative of the flag cache, this method returns whether the flag was set that allows this event to trigger when the target of the event does not have any value with this faction

Returns:
true if the target does not have to have this faction, false otherwise
See Also:
flagCache(), selfTargetOK(), just100()

selfTargetOK

boolean selfTargetOK()
A derivative of the flag cache, this method returns whether the flag was set that allows this event to trigger when the target and source of the event are the same.

Returns:
true if src and target are the same, false otherwise
See Also:
flagCache(), outsiderTargetOK(), just100()

just100

boolean just100()
A derivative of the flag cache, this method returns whether the flag was set that causes the determination of the amount of faction move to apply to NOT take the difference between the source and targets levels into account.

Returns:
true to NOT take level into account when determining amount of faction change
See Also:
flagCache(), outsiderTargetOK(), selfTargetOK()

direction

int direction()
Returns a code for a description of how an event, if applicable, will affect this factions value. The direction is an index into CHANGE_DIRECTION_DESCS, or one of the CHANGE_DIRECTION_ constants.

Returns:
a FactionChangeEvent#CHANGE_DIRECTION_ constant
See Also:
CHANGE_DIRECTION_DESCS, setDirection(int)

setDirection

void setDirection(int newVal)
Sets a code for a description of how an event, if applicable, will affect this factions value. The direction is an index into CHANGE_DIRECTION_DESCS, or one of the CHANGE_DIRECTION_ constants.

Parameters:
newVal - a new FactionChangeEvent#CHANGE_DIRECTION_ constant
See Also:
CHANGE_DIRECTION_DESCS, direction()

factor

double factor()
Returns the factor to multiply the base faction change amount (100) by, to determine the amount of this faction changed by this event, in accordance with the given direction.

Returns:
the factor to multiply the base amount of the faction by
See Also:
direction(), setFactor(double)

setFactor

void setFactor(double newVal)
Sets the factor to multiply the base faction change amount (100) by, to determine the amount of this faction changed by this event, in accordance with the given direction.

Parameters:
newVal -
See Also:
direction(), factor()

zapper

java.lang.String zapper()
Returns the zapper mask that is used to see if the target of the event qualifies in order to trigger a faction change by this defined event.

Returns:
the zapper mask string
See Also:
setZapper(String), MaskingLibrary

setZapper

void setZapper(java.lang.String newVal)
Sets the zapper mask that is used to see if the target of the event qualifies in order to trigger a faction change by this defined event.

Parameters:
newVal - the new zapper mask string
See Also:
zapper(), MaskingLibrary

toString

java.lang.String toString()
Returns a semicolon delimited list of all the settings in this change event

Overrides:
toString in class java.lang.Object
Returns:
a semicolon delimited list of all the settings in this change event
See Also:
Faction.addChangeEvent(String)

applies

boolean applies(MOB mob)
Returns whether the given mob is a valid target of this event.

Parameters:
mob - the mob to evaluate
Returns:
true if this event applies to the target mob, false otherwise