com.planet_ink.coffee_mud.Abilities.Properties
Class Property
java.lang.Object
com.planet_ink.coffee_mud.Abilities.Properties.Property
- All Implemented Interfaces:
- Ability, CMObject, Contingent, Environmental, Modifiable, MsgListener, StatsAffecting, Tickable, java.lang.Cloneable, java.lang.Comparable<CMObject>
- Direct Known Subclasses:
- Prop_AbilityImmunity, Prop_AbsorbDamage, Prop_AddDamage, Prop_AreaForSale, Prop_Artifact, Prop_AstralSpirit, Prop_ClanEquipment, Prop_Climbable, Prop_CloseCommand, Prop_ClosedDayNight, Prop_ClosedSeason, Prop_CombatAdjuster, Prop_CommonTwister, Prop_Crawlspace, Prop_Doppleganger, Prop_EnlargeRoom, Prop_EnterAdjuster, Prop_Familiar, Prop_HaveAdjuster, Prop_HaveResister, Prop_HaveZapper, Prop_Hidden, Prop_IceBox, Prop_ImproveGather, Prop_InstantDeath, Prop_Invisibility, Prop_ItemBinder, Prop_ItemNoRuin, Prop_ItemSlot, Prop_ItemSlotFiller, Prop_ItemTransporter, Prop_ItemTransReceiver, Prop_LangTranslator, Prop_LanguageSpeaker, Prop_LimitedItems, Prop_LocationBound, Prop_MagicFreedom, Prop_MOBEmoter, Prop_ModExperience, Prop_ModFaction, Prop_MoveRestrictor, Prop_NarrowLedge, Prop_NewDeathMsg, Prop_NoChannel, Prop_NoCharm, Prop_NoCraftability, Prop_NoDamage, Prop_NoOrdering, Prop_NoPKill, Prop_NoPurge, Prop_NoRecall, Prop_NoSummon, Prop_NoTeleport, Prop_NoTeleportOut, Prop_NoTelling, Prop_OpenCommand, Prop_OpenPassword, Prop_OutfitContainer, Prop_PeaceMaker, Prop_PracticeDummy, Prop_PrivateProperty, Prop_ReqAlignments, Prop_ReqCapacity, Prop_ReqClasses, Prop_ReqEntry, Prop_ReqHeight, Prop_ReqLevels, Prop_ReqNoMOB, Prop_ReqPKill, Prop_ReqRaces, Prop_ReqStat, Prop_ReqTattoo, Prop_ReRollStats, Prop_RestrictSkills, Prop_RestrictSpells, Prop_Retainable, Prop_RoomDark, Prop_RoomForSale, Prop_RoomLit, Prop_RoomUnmappable, Prop_RoomView, Prop_RoomWatch, Prop_SafePet, Prop_ScrapExplode, Prop_Smell, Prop_Socials, Prop_Sounder, Prop_SparringRoom, Prop_SpellAdder, Prop_SpellReflecting, Prop_StatAdjuster, Prop_StatTrainer, Prop_StayAboard, Prop_Tattoo, Prop_TattooAdder, Prop_TicketTaker, Prop_Transporter, Prop_Trashcan, Prop_Uncampable, Prop_Unsellable, Prop_UseEmoter, Prop_WeakBridge, Prop_WeaponImmunity, Prop_WearOverride, Prop_Weather, Prop_WizInvis
public class Property
- extends java.lang.Object
- implements Ability
Fields inherited from interface com.planet_ink.coffee_mud.Abilities.interfaces.Ability |
ACODE_CHANT, ACODE_COMMON_SKILL, ACODE_DESCS, ACODE_DESCS_, ACODE_DISEASE, ACODE_LANGUAGE, ACODE_POISON, ACODE_PRAYER, ACODE_PROPERTY, ACODE_SKILL, ACODE_SONG, ACODE_SPELL, ACODE_SUPERPOWER, ACODE_TECH, ACODE_THIEF_SKILL, ACODE_TRAP, ALL_ACODES, ALL_DOMAINS, CACHEINDEX_CLASSLESS, CACHEINDEX_EXPERTISE, CACHEINDEX_NORMAL, CACHEINDEX_TOTAL, CAN_AREAS, CAN_DESCS, CAN_EXITS, CAN_ITEMS, CAN_MOBS, CAN_ROOMS, COST_ALL, COST_NORMAL, COST_PCT, DOMAIN_ABJURATION, DOMAIN_ACROBATIC, DOMAIN_ALERT, DOMAIN_ALTERATION, DOMAIN_ANATOMY, DOMAIN_ANIMALAFFINITY, DOMAIN_ARCANELORE, DOMAIN_ARCHON, DOMAIN_ARMORUSE, DOMAIN_ARTISTIC, DOMAIN_BINDING, DOMAIN_BLESSING, DOMAIN_BREEDING, DOMAIN_BUILDINGSKILL, DOMAIN_CALLIGRAPHY, DOMAIN_COMBATFLUIDITY, DOMAIN_COMBATLORE, DOMAIN_COMMUNING, DOMAIN_CONJURATION, DOMAIN_CORRUPTION, DOMAIN_CRAFTINGSKILL, DOMAIN_CREATION, DOMAIN_CRIMINAL, DOMAIN_CURSING, DOMAIN_DANCING, DOMAIN_DEATHLORE, DOMAIN_DECEPTIVE, DOMAIN_DEEPMAGIC, DOMAIN_DESCS, DOMAIN_DETRAP, DOMAIN_DIRTYFIGHTING, DOMAIN_DIVINATION, DOMAIN_EDUCATIONLORE, DOMAIN_ENCHANTMENT, DOMAIN_ENDURING, DOMAIN_EPICUREAN, DOMAIN_EVANGELISM, DOMAIN_EVASIVE, DOMAIN_EVOCATION, DOMAIN_FITNESS, DOMAIN_FOOLISHNESS, DOMAIN_GATHERINGSKILL, DOMAIN_GRAPPLING, DOMAIN_HEALING, DOMAIN_HOLYPROTECTION, DOMAIN_ILLUSION, DOMAIN_INFLUENTIAL, DOMAIN_KICKING, DOMAIN_LEGAL, DOMAIN_MARTIALLORE, DOMAIN_MOONALTERING, DOMAIN_MOONSUMMONING, DOMAIN_NATURELORE, DOMAIN_NEUTRALIZATION, DOMAIN_PLANTCONTROL, DOMAIN_PLANTGROWTH, DOMAIN_PLAYING, DOMAIN_POISONING, DOMAIN_PRESERVING, DOMAIN_PUNCHING, DOMAIN_RACIALABILITY, DOMAIN_RESTORATION, DOMAIN_ROCKCONTROL, DOMAIN_SEATRAVEL, DOMAIN_SHAPE_SHIFTING, DOMAIN_SHIELDUSE, DOMAIN_SINGING, DOMAIN_STEALING, DOMAIN_STEALTHY, DOMAIN_STREETSMARTS, DOMAIN_THEATRE, DOMAIN_TRANSMUTATION, DOMAIN_TRAPPING, DOMAIN_VERBS, DOMAIN_VEXING, DOMAIN_WARDING, DOMAIN_WATERCONTROL, DOMAIN_WATERLORE, DOMAIN_WEAPON_USE, DOMAIN_WEATHER_MASTERY, FLAG_ADJUSTER, FLAG_AGGROFYING, FLAG_AIRBASED, FLAG_BINDING, FLAG_CASTER, FLAG_CHARMING, FLAG_CLANMAGIC, FLAG_DESCS, FLAG_EARTHBASED, FLAG_ENABLER, FLAG_FIREBASED, FLAG_HEALINGMAGIC, FLAG_HEATING, FLAG_HOLY, FLAG_IMMUNER, FLAG_INTOXICATING, FLAG_MINDALTERING, FLAG_MOVING, FLAG_NEUTRAL, FLAG_NOORDERING, FLAG_NOUNINVOKING, FLAG_PARALYZING, FLAG_POTENTIALLY_DEADLY, FLAG_RESISTER, FLAG_SUMMONING, FLAG_SUNSUMMONING, FLAG_TIDEALTERING, FLAG_TORTURING, FLAG_TRACKING, FLAG_TRANSPORTING, FLAG_UNCRAFTABLE, FLAG_UNHOLY, FLAG_WATERBASED, FLAG_WEATHERAFFECTING, FLAG_ZAPPER, QUALITY_BENEFICIAL_OTHERS, QUALITY_BENEFICIAL_SELF, QUALITY_DESCS, QUALITY_INDIFFERENT, QUALITY_MALICIOUS, QUALITY_OK_OTHERS, QUALITY_OK_SELF, RANGE_CHOICES, TICKS_ALMOST_FOREVER, TICKS_FOREVER, USAGE_DESCS, USAGE_HITPOINTS, USAGE_MANA, USAGE_MOVEMENT, USAGE_NADA, USAGEINDEX_HITPOINTS, USAGEINDEX_MANA, USAGEINDEX_MOVEMENT |
Fields inherited from interface com.planet_ink.coffee_mud.core.interfaces.Tickable |
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_BEAMWEAPON, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, 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_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET |
Method Summary |
int |
abilityCode()
Returns an optional numeric value whose purpose is
entirely contextual. |
int |
abstractQuality()
Returns a constant value notifying the system of
the general quality of the skill, whether it is
malicious, beneficial, indifferent, or qualifiably
beneficial (ok), as well as whether it is intended
to target the invoker (self) or others. |
java.lang.String |
accountForYourself()
For use by the identify spell, this should return a
nice description of any properties incorporated
by this effect. |
int |
adjustedLevel(MOB mob,
int asLevel)
This method calculates the strength level of this skill for the
given mob, and taking into account the given override-level (asLevel). |
void |
affectCharState(MOB affectedMob,
CharState affectableMaxState)
This method is called by the recoverCharState() method on other MOB objects. |
void |
affectCharStats(MOB affectedMob,
CharStats affectableStats)
This method is called by the recoverCharStats() method on other MOB objects. |
Physical |
affecting()
Returns a reference to the room, item, mob, or exit
that is currently being affected by this skill. |
void |
affectPhyStats(Physical affected,
PhyStats affectableStats)
This method is called by the recoverPhyStats() method on other Environmental objects. |
boolean |
amDestroyed()
Whether the destroy() method has been previousy called on this object. |
boolean |
appropriateToMyFactions(MOB mob)
Returns whether there are any Faction reasons why the given
mob should not use this skill. |
boolean |
autoInvocation(MOB mob,
boolean force)
An autoinvocating ability is an ability which affects the
mob just by having learned the ability. |
boolean |
bubbleAffect()
This method is used to modify the behavior of the affectPhyStats,
affectCharStats, and affectCharState methods. |
boolean |
canAffect(int can_code)
Returns whether, when used as a property/effect, this ability can affect
the given type of object. |
boolean |
canAffect(Physical P)
Returns whether, when used as a property/effect, this ability can affect
the given object. |
protected int |
canAffectCode()
Designates whether, when used as a property/effect, what sort of objects
this ability can affect. |
boolean |
canBeLearnedBy(MOB teacher,
MOB student)
Returns whether the given student mob is able and allowed to learn
this skill from the given teacher. |
boolean |
canBePracticedBy(MOB teacher,
MOB student)
Returns whether the given teacher mob is able and allowed to practice
this skill with the given student *and* whether the student is able
and allowed to practice this skill. |
boolean |
canBeTaughtBy(MOB teacher,
MOB student)
Returns whether the given teacher mob is able and allowed to teach
this skill to the given student. |
boolean |
canBeUninvoked()
Whether this skill is allowed to be uninvoked. |
boolean |
canTarget(int can_code)
Returns whether, when used as a skill, this ability can target itself
at an object of the given type. |
boolean |
canTarget(Physical P)
Returns whether, when used as a skill, this ability can target itself
at the given object. |
protected int |
canTargetCode()
Designates whether, when invoked as a skill, what sort of objects this
ability can effectively target. |
int |
castingQuality(MOB invoker,
Physical target)
Serves a purpose similar to that of the Ability
abstractQuality() method, but it determines a more
exact quality based on a given invoker, target, and
assumes an imminent use of the skill. |
double |
castingTime(MOB mob,
java.util.List<java.lang.String> cmds)
Returns the number of actions required to completely
activate this skill. |
double |
checkedCastingCost(MOB mob,
java.util.List<java.lang.String> cmds)
Returns the number of actions required to completely
activate this skill. |
int |
classificationCode()
Returns a bitmap describing the general
classification of the skill (spell, skill,
chant, or property, etc) and its domain. |
double |
combatCastingTime(MOB mob,
java.util.List<java.lang.String> cmds)
Returns the number of actions required to completely
activate this skill. |
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.lang.String |
description()
The basic description of this object, as shown when the item is directly LOOKed at. |
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. |
java.lang.String |
displayText()
Gets the raw string used to show what this object looks like in the room. |
int |
enchantQuality()
Identical to abstractQuality() method, but returns
a quality based on how the skill or spell behaves
as a spell effect on a weapon or on armor. |
void |
executeMsg(Environmental myHost,
CMMsg msg)
The general message event handler for the object. |
long |
expirationDate()
If this object expires, it should have a timestamp saying when it expires, in real time. |
java.util.List<java.lang.String> |
externalFiles()
Any external files which may be required to make this ability work
files returned by this method should not be base distrib files! |
long |
flags()
Returns a bitmap giving some specific information about
the scope and purpose of the skill. |
protected int |
getCodeNum(java.lang.String code)
|
int |
getSaveStatIndex()
Returns the index into the stat codes array where extra savable fields begins. |
java.lang.String |
getStat(java.lang.String code)
An alternative means of retreiving the values of those fields on this object which are modifiable at
run-time by builders. |
java.lang.String[] |
getStatCodes()
Returns an array of the string names of those fields which are modifiable on this object at run-time by
builders. |
int |
getTickStatus()
A coded status for this object during the period where
its tick method is being called. |
ExpertiseLibrary.SkillCost |
getTrainingCost(MOB mob)
Returns cost of training up this skill, for the given user. |
void |
helpProficiency(MOB mob,
int adjustment)
This method should, occasionally, add to the proficiency the given mob
has in this skill. |
java.lang.String |
ID()
The CoffeeMud Java Class ID shared by all instances of
this object. |
java.lang.String |
image()
Returns the fully qualified and determined name of the image file displayed for this
object when MXP is used. |
void |
initializeClass()
Called ONCE after all objects are loaded, but before the map is read in
during initialization. |
boolean |
invoke(MOB mob,
java.util.List<java.lang.String> commands,
Physical target,
boolean auto,
int asLevel)
This method is called when a player or the system invokes this skill,
casts this spell, etc. |
boolean |
invoke(MOB mob,
Physical target,
boolean auto,
int asLevel)
This method is called when a player or the system invokes this skill,
casts this spell, etc. |
MOB |
invoker()
Always returns the mob that invoked or initiated the
skill or effect. |
boolean |
isAutoInvoked()
An autoinvocating ability is an ability which affects the
mob just by having learned the ability. |
boolean |
isGeneric()
Whether the fields of this item are set in code, or set by builders. |
boolean |
isNowAnAutoEffect()
An autoinvocating ability is an ability which affects the
mob just by having learned the ability. |
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. |
boolean |
isStat(java.lang.String code)
An alternative means of retreiving the values of those fields on this object which are modifiable at
run-time by builders. |
java.lang.String |
L(java.lang.String str,
java.lang.String... xs)
Localize an internal string -- shortcut. |
void |
makeLongLasting()
If this ability has been added as as temporary effect, like
sleep, or trip, or other typical spells, calling this
method will make it so thatit will not do so on its own for a
long long time. |
void |
makeNonUninvokable()
Designates that this skill should never be uninvoked. |
int |
maxRange()
the maximum range of this object, if applicable. |
int |
minRange()
the minimum range of this object, if applicable. |
java.lang.String |
miscTextFormat()
Unimplemented as of yet, but will hold a string telling the system what
the proper format of any miscText data. |
java.lang.String |
name()
The nice displayable name of this instance of this object |
java.lang.String |
Name()
The raw unmodified name of this object as stored in the database. |
CMObject |
newInstance()
Returns a new instance of this class. |
boolean |
okMessage(Environmental myHost,
CMMsg msg)
The general message event previewer for the object. |
void |
practice(MOB teacher,
MOB student)
Causes the student to practice this skill, presumably with the teacher mob. |
boolean |
preInvoke(MOB mob,
java.util.List<java.lang.String> commands,
Physical givenTarget,
boolean auto,
int asLevel,
int secondsElapsed,
double actionsRemaining)
This method is only called when the mob invoking this skill
does not have enough actions to complete it immediately. |
int |
proficiency()
Returns a number from 0-100 representing the percent of proficiency
the mob or player who has this instance in their Abilities list has in
this skill. |
boolean |
proficiencyCheck(MOB mob,
int adjustment,
boolean auto)
Returns whether the given mob passes their proficiency check in this skill
at this time. |
boolean |
putInCommandlist()
Returns whether this skills triggerStrings should be
places in the master list of commands, unlike
properties or other hidden skills. |
java.lang.String |
rawImage()
Returns the raw name of the image file to display for this object when MXP is used. |
java.lang.String |
requirements(MOB mob)
Returns a string describing the requirements and qualifications that
are required to learn this skill. |
boolean |
sameAs(Environmental E)
Whether this object instance is functionally identical to the object passed in. |
void |
setAbilityCode(int newCode)
Sets an optional numeric value whose purpose is
entirely contextual. |
void |
setAffectedOne(Physical P)
Sets a reference to the room, item, mob, or exit
that is currently being affected by this skill. |
void |
setDescription(java.lang.String newDescription)
Sets the basic description of this object, as shown when the item is directly LOOKed at. |
void |
setDisplayText(java.lang.String newDisplayText)
Sets the raw string used to show what this object looks like in the room. |
void |
setExpirationDate(long time)
If this object expires, it should have a timestamp saying when it expires, in real time. |
void |
setImage(java.lang.String newImage)
Sets the raw name of the image file to display for this object when MXP is used. |
void |
setInvoker(MOB mob)
Sets or changes the mob that invoked or initated the
skill or effect. |
void |
setMiscText(java.lang.String newMiscText)
For objects which have false for their isGeneric method, this is used to set any internally
coded strings to change the nature or behavior of the object. |
void |
setName(java.lang.String newName)
Sets the raw unmodified name of this object as stored in the database. |
void |
setProficiency(int newProficiency)
Sets a number from 0-100 representing the percent of proficiency
the mob or player who has this instance in their Abilities list has in
this skill. |
void |
setSavable(boolean truefalse)
Sets whether this object can be saved as a permanent aspect of
its host. |
void |
setStat(java.lang.String code,
java.lang.String val)
An alternative means of setting the values of those fields on this object which are modifiable at
run-time by builders. |
void |
startTickDown(MOB invokerMOB,
Physical affected,
int tickTime)
Adds THIS Ability object as an effect on the given affected target, and
sets it to unInvoke after the given number of ticks. |
void |
teach(MOB teacher,
MOB student)
Teaches this skill to the student mob, presumably from the teacher mob. |
java.lang.String |
text()
For objects which have false for their isGeneric method, this is used to set any internally
coded strings to change the nature or behavior of the object. |
boolean |
tick(Tickable ticking,
int tickID)
this is the method which is called periodically by the threading engine. |
java.lang.String[] |
triggerStrings()
A set of the command strings the user types to access
this command when it is listed as a skill ability. |
void |
unInvoke()
If this skill is uninvokable, this method will uninvoke it, remove it
as an effect on the target, and shut it down. |
int[] |
usageCost(MOB mob,
boolean ignoreCostOverride)
Returns an integer array telling the system how much mana,
movement, or hit points are required to invoke this skill. |
int |
usageType()
Returns a bitmap made up of constants defined by
Ability.USAGE_*. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
savable
protected boolean savable
miscText
protected java.lang.String miscText
affected
protected Physical affected
empty
public static final java.lang.String[] empty
amDestroyed
protected boolean amDestroyed
Property
public Property()
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, Tech. The name is typically identical
to the class name.
- Specified by:
ID
in interface CMObject
- Returns:
- the name of this class
name
public java.lang.String name()
- Description copied from interface:
Tickable
- The nice displayable name of this instance of this object
- Specified by:
name
in interface CMObject
- Specified by:
name
in interface Tickable
- Returns:
- the displayable name of this object instance
- See Also:
Environmental.Name()
Name
public java.lang.String Name()
- Description copied from interface:
Environmental
- The raw unmodified name of this object as stored in the database.
This is the name set by builders and used as a basis for the name() method.
- Specified by:
Name
in interface Environmental
- Returns:
- the raw base name of this object on the map.
- See Also:
Tickable.name()
description
public java.lang.String description()
- Description copied from interface:
Environmental
- The basic description of this object, as shown when the item is directly LOOKed at.
- Specified by:
description
in interface Environmental
- Returns:
- the basic detail description of this object
displayText
public java.lang.String displayText()
- Description copied from interface:
Environmental
- Gets the raw string used to show what this object looks like in the room.
May be used as a basis for other methods, such as the title of rooms, and
what an exit looks like when open. The value for Items may be null if the item
is not displayed when the room is seen.
- Specified by:
displayText
in interface Environmental
- Returns:
- the string describing how this object looks in the room
canAffectCode
protected int canAffectCode()
- Designates whether, when used as a property/effect, what sort of objects
this ability can affect. Uses the Ability.CAN_* constants.
- Returns:
- a mask showing the type of objects this ability can affect
- See Also:
Ability
canTargetCode
protected int canTargetCode()
- Designates whether, when invoked as a skill, what sort of objects this
ability can effectively target. Uses the Ability.CAN_* constants.
- Returns:
- a mask showing the type of objects this ability can target
- See Also:
Ability
canTarget
public boolean canTarget(int can_code)
- Description copied from interface:
Ability
- Returns whether, when used as a skill, this ability can target itself
at an object of the given type. This method derives its answer from the protected
integer method canTargetCode(), and requires one of the Ability.CAN_*
constants.
- Specified by:
canTarget
in interface Ability
- Parameters:
can_code
- a bitmap of one or more Ability.CAN_* constants
- Returns:
- whether the object type is a valid target
- See Also:
StdAbility.canTargetCode()
canAffect
public boolean canAffect(int can_code)
- Description copied from interface:
Ability
- Returns whether, when used as a property/effect, this ability can affect
the given type of object. This method derives its answer from the protected
integer method canAffectCode(), and requires one of the Ability.CAN_*
constants.
- Specified by:
canAffect
in interface Ability
- Parameters:
can_code
- a bitmap of one or more Ability.CAN_* constants
- Returns:
- whether the object object type may have this as a property/effect
- See Also:
Ability
,
StdAbility.canAffectCode()
castingTime
public double castingTime(MOB mob,
java.util.List<java.lang.String> cmds)
- Description copied from interface:
Ability
- Returns the number of actions required to completely
activate this skill. A value of 0.0 means invoke
instantly. This method only applies when the invoker
is not in combat.
- Specified by:
castingTime
in interface Ability
- Parameters:
mob
- the potential castercmds
- the potential command set
- Returns:
- the number of player free actions required to do this
- See Also:
Ability.combatCastingTime(MOB, List)
,
Ability.checkedCastingCost(MOB, List)
combatCastingTime
public double combatCastingTime(MOB mob,
java.util.List<java.lang.String> cmds)
- Description copied from interface:
Ability
- Returns the number of actions required to completely
activate this skill. A value of 0.0 means invoke
instantly. This method only applies when the invoker
is in combat.
- Specified by:
combatCastingTime
in interface Ability
- Parameters:
mob
- the potential castercmds
- the potential command set
- Returns:
- the number of player free actions required to do this
- See Also:
Ability.castingTime(MOB, List)
,
Ability.checkedCastingCost(MOB, List)
checkedCastingCost
public double checkedCastingCost(MOB mob,
java.util.List<java.lang.String> cmds)
- Description copied from interface:
Ability
- Returns the number of actions required to completely
activate this skill. A value of 0.0 means invoke
instantly. This method should return the correct time depending
on the nature of the skill, and whether the user is in combat.
- Specified by:
checkedCastingCost
in interface Ability
- Parameters:
mob
- the potential castercmds
- the potential command set
- Returns:
- the number of player free actions required to do this
- See Also:
Ability.castingTime(MOB, List)
,
Ability.combatCastingTime(MOB, List)
abilityCode
public int abilityCode()
- Description copied from interface:
Ability
- Returns an optional numeric value whose purpose is
entirely contextual. For many skills, this reflects
some sort of enhancement. Default is 0.
- Specified by:
abilityCode
in interface Ability
- Returns:
- the current optional numeric value or enhancement
setAbilityCode
public void setAbilityCode(int newCode)
- Description copied from interface:
Ability
- Sets an optional numeric value whose purpose is
entirely contextual. For many skills, this reflects
some sort of enhancement. Default is 0.
- Specified by:
setAbilityCode
in interface Ability
- Parameters:
newCode
- the optional numeric value or enhancement
adjustedLevel
public int adjustedLevel(MOB mob,
int asLevel)
- Description copied from interface:
Ability
- This method calculates the strength level of this skill for the
given mob, and taking into account the given override-level (asLevel).
The level returned should be based on a minimum baseline level (usually
the class level of the class that qualifies for this skill at the
lowest level), and should take into account the number of levels the
mob has over and above that in appropriate classes
- Specified by:
adjustedLevel
in interface Ability
- Parameters:
mob
- the mob to evaluate the skill level ofasLevel
- if greater than 0, this method always returns it
- Returns:
- the level of power the given mob has in this skill.
bubbleAffect
public boolean bubbleAffect()
- Description copied from interface:
Ability
- This method is used to modify the behavior of the affectPhyStats,
affectCharStats, and affectCharState methods. If this returns true,
then those methods will be called only on the owner/mob of the item
currently being affected by this skill. If false, those methods
behave normally.
- Specified by:
bubbleAffect
in interface Ability
- Returns:
- whether this skill affects a mob owner of an item
- See Also:
Item.owner()
flags
public long flags()
- Description copied from interface:
Ability
- Returns a bitmap giving some specific information about
the scope and purpose of the skill. The bitmap is
composed of FLAG_* constants from the Ability interface.
- Specified by:
flags
in interface Ability
- Returns:
- FLAG_* constant based bitmap
- See Also:
Ability
getTickStatus
public int getTickStatus()
- Description copied from interface:
Tickable
- A coded status for this object during the period where
its tick method is being called. The statis is defined,
at least in part, by constants in this interface STATUS_*.
STATUS_NOT should be returned when the objects tick method
is not currently in execution. It should never return
STATUS_NOT when the objects tick method is in execution.
- Specified by:
getTickStatus
in interface Tickable
- Returns:
- the numeric status of this object
- See Also:
Tickable.tick(Tickable, int)
usageType
public int usageType()
- Description copied from interface:
Ability
- Returns a bitmap made up of constants defined by
Ability.USAGE_*. It lets the system know which of the
values in the usageCost(MOB,boolean) method are relevant. It
determines whether this skill requires mana, movement,
hit points, or some combination of the three.
- Specified by:
usageType
in interface Ability
- Returns:
- a bitmap defined by Ability.USAGE_*
- See Also:
Ability
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
getTrainingCost
public ExpertiseLibrary.SkillCost getTrainingCost(MOB mob)
- Description copied from interface:
Ability
- Returns cost of training up this skill, for the given user.
- Specified by:
getTrainingCost
in interface Ability
- Parameters:
mob
- the potential caster
- Returns:
- a pair, with the number of the cost type, and the cost type
L
public java.lang.String L(java.lang.String str,
java.lang.String... xs)
- Description copied from interface:
Environmental
- Localize an internal string -- shortcut. Same as calling:
- Specified by:
L
in interface Environmental
- Parameters:
str
- the string to translatexs
- the array of variables to replace
- Returns:
- the translated string, with all variables in place
- See Also:
Call with the string to translate, which may contain variables of the form @x1, @x2, etc. The array in xs
is then used to replace the variables AFTER the string is translated.
setName
public void setName(java.lang.String newName)
- Description copied from interface:
Environmental
- Sets the raw unmodified name of this object as stored in the database.
This is the name set by builders and used as a basis for the name() method.
- Specified by:
setName
in interface Environmental
- Parameters:
newName
- the raw base name of this object on the map.- See Also:
Environmental.Name()
setDescription
public void setDescription(java.lang.String newDescription)
- Description copied from interface:
Environmental
- Sets the basic description of this object, as shown when the item is directly LOOKed at.
- Specified by:
setDescription
in interface Environmental
- Parameters:
newDescription
- the basic detail description of this object
setDisplayText
public void setDisplayText(java.lang.String newDisplayText)
- Description copied from interface:
Environmental
- Sets the raw string used to show what this object looks like in the room.
May be used as a basis for other methods, such as the title of rooms, and
what an exit looks like when open. The value for Items may be null if the item
is not displayed when the room is seen.
- Specified by:
setDisplayText
in interface Environmental
- Parameters:
newDisplayText
- the string describing how this object looks in the room
image
public java.lang.String image()
- Description copied from interface:
Environmental
- Returns the fully qualified and determined name of the image file displayed for this
object when MXP is used. If rawImage() is non-empty, it will return rawImage, and
otherwise use the mxp default data file.
- Specified by:
image
in interface Environmental
- Returns:
- the name of the mxp image to display for this object.
rawImage
public java.lang.String rawImage()
- Description copied from interface:
Environmental
- Returns the raw name of the image file to display for this object when MXP is used. This
is the value set by the builder, and may be returned by image() if it is non-empty.
- Specified by:
rawImage
in interface Environmental
- Returns:
- the raw name of the mxp image file
setImage
public void setImage(java.lang.String newImage)
- Description copied from interface:
Environmental
- Sets the raw name of the image file to display for this object when MXP is used. This
is the value set by the builder, and may be returned by image() if it is non-empty.
- Specified by:
setImage
in interface Environmental
- Parameters:
newImage
- the raw name of the mxp image file
invoker
public MOB invoker()
- Description copied from interface:
Ability
- Always returns the mob that invoked or initiated the
skill or effect.
- Specified by:
invoker
in interface Ability
- Returns:
- the invoker mob
- See Also:
MOB
,
Ability.setInvoker(MOB)
setInvoker
public void setInvoker(MOB mob)
- Description copied from interface:
Ability
- Sets or changes the mob that invoked or initated the
skill or effect.
- Specified by:
setInvoker
in interface Ability
- Parameters:
mob
- the invoker mob- See Also:
MOB
,
Ability.invoker()
triggerStrings
public java.lang.String[] triggerStrings()
- Description copied from interface:
Ability
- A set of the command strings the user types to access
this command when it is listed as a skill ability.
- Specified by:
triggerStrings
in interface Ability
- Returns:
- an array of command invoking string words
- See Also:
Ability.putInCommandlist()
invoke
public boolean invoke(MOB mob,
java.util.List<java.lang.String> commands,
Physical target,
boolean auto,
int asLevel)
- Description copied from interface:
Ability
- This method is called when a player or the system invokes this skill,
casts this spell, etc.
Calls the more complete invoke method without an empty command strings vector
unless target is non-null, in which case the vector will contain the name
of the target.
- Specified by:
invoke
in interface Ability
- Parameters:
mob
- the player or mob invoking the skillcommands
- the parameters entered for the skill (minus trigger word)target
- null, unless being auto-invoked. Represents an override target.auto
- false if player enters command, true if system invokes the commandasLevel
- -1, unless being auto-invoked, when it is the level to invoke it at.
- Returns:
- whether the skill successfully invoked.
invoke
public boolean invoke(MOB mob,
Physical target,
boolean auto,
int asLevel)
- Description copied from interface:
Ability
- This method is called when a player or the system invokes this skill,
casts this spell, etc.
Calls the more complete invoke method without an empty command strings vector
unless target is non-null, in which case the vector will contain the name
of the target.
- Specified by:
invoke
in interface Ability
- Parameters:
mob
- the player or mob invoking the skilltarget
- null, unless being auto-invoked. Represents an override target.auto
- false if player enters command, true if system invokes the commandasLevel
- -1, unless being auto-invoked, when it is the level to invoke it at.
- Returns:
- whether the skill successfully invoked.
- See Also:
Ability.invoke(MOB, List, Physical, boolean, int)
preInvoke
public boolean preInvoke(MOB mob,
java.util.List<java.lang.String> commands,
Physical givenTarget,
boolean auto,
int asLevel,
int secondsElapsed,
double actionsRemaining)
- Description copied from interface:
Ability
- This method is only called when the mob invoking this skill
does not have enough actions to complete it immediately. The
method is called when the command is entered, and every second
afterwards until the invoker has enough actions to complete it.
At completion time, invoke is called.
- Specified by:
preInvoke
in interface Ability
- Parameters:
mob
- the player or mob invoking the skillcommands
- the parameters entered for the skill (minus trigger word)givenTarget
- null, unless being auto-invoked. Represents an override target.auto
- false if player enters command, true if system invokes the commandasLevel
- -1, unless being auto-invoked, when it is the level to invoke it at.secondsElapsed
- 0 at first, and increments every secondactionsRemaining
- number of free actions the player is defficient.
- Returns:
- whether the skill should be allowed to invoke. false cancels altogether.
- See Also:
Ability.invoke(MOB, List, Physical, boolean, int)
autoInvocation
public boolean autoInvocation(MOB mob,
boolean force)
- Description copied from interface:
Ability
- An autoinvocating ability is an ability which affects the
mob just by having learned the ability. Dodge is an example of this.
This method is called to initiate this, and is called whenever
a mob gains this skill as a new Ability. This method will
add the ability to the mob as an effect.
- Specified by:
autoInvocation
in interface Ability
- Parameters:
mob
- the player or npc mob who has this abilityforce
- if the skill has default-off settings, this overrides to ON
- Returns:
- whether the ability autoinvoked correctly
- See Also:
Ability.isAutoInvoked()
,
Ability.isNowAnAutoEffect()
unInvoke
public void unInvoke()
- Description copied from interface:
Ability
- If this skill is uninvokable, this method will uninvoke it, remove it
as an effect on the target, and shut it down.
- Specified by:
unInvoke
in interface Ability
- See Also:
Ability.canBeUninvoked()
canBeUninvoked
public boolean canBeUninvoked()
- Description copied from interface:
Ability
- Whether this skill is allowed to be uninvoked. If it returns false,
then it behaves as a permanent property of the object it is affecting.
Not death, dispelling, or other negations will remove it.
- Specified by:
canBeUninvoked
in interface Ability
- Returns:
- whether this skill can be uninvoked.
- See Also:
Ability.makeNonUninvokable()
isAutoInvoked
public boolean isAutoInvoked()
- Description copied from interface:
Ability
- An autoinvocating ability is an ability which affects the
mob just by having learned the ability. Dodge is an example of this.
This method returns whether this skill is classified as one of
those kinds of abilities.
- Specified by:
isAutoInvoked
in interface Ability
- Returns:
- whether this is an autoinvoking skill
isNowAnAutoEffect
public boolean isNowAnAutoEffect()
- Description copied from interface:
Ability
- An autoinvocating ability is an ability which affects the
mob just by having learned the ability. Dodge is an example of this.
Returns whether this instance was added to a mobs affects for
this reason.
- Specified by:
isNowAnAutoEffect
in interface Ability
- Returns:
- whether this skill is currently an autoinvoked effect
externalFiles
public java.util.List<java.lang.String> externalFiles()
- Description copied from interface:
Ability
- Any external files which may be required to make this ability work
files returned by this method should not be base distrib files!
- Specified by:
externalFiles
in interface Ability
- Returns:
- a list of local path names
canBeTaughtBy
public boolean canBeTaughtBy(MOB teacher,
MOB student)
- Description copied from interface:
Ability
- Returns whether the given teacher mob is able and allowed to teach
this skill to the given student. Error messages should be directed
to both. This method should focus exclusively on the qualifications
of the teacher.
- Specified by:
canBeTaughtBy
in interface Ability
- Parameters:
teacher
- the potential teacher of this skillstudent
- the potential learner of this skill
- Returns:
- whether the teacher can teach the skill to the student
- See Also:
Ability.canBeLearnedBy(MOB, MOB)
,
Ability.teach(MOB, MOB)
canBePracticedBy
public boolean canBePracticedBy(MOB teacher,
MOB student)
- Description copied from interface:
Ability
- Returns whether the given teacher mob is able and allowed to practice
this skill with the given student *and* whether the student is able
and allowed to practice this skill. Error messages should be directed
to both.
- Specified by:
canBePracticedBy
in interface Ability
- Parameters:
teacher
- the potential practice teacher of this skillstudent
- the potential practicer of this skil
- Returns:
- whether the teacher and student are capable of practicing together
- See Also:
Ability.practice(MOB, MOB)
canBeLearnedBy
public boolean canBeLearnedBy(MOB teacher,
MOB student)
- Description copied from interface:
Ability
- Returns whether the given student mob is able and allowed to learn
this skill from the given teacher. Error messages should be directed
to both. This method should focus exclusively on the qualifications
of the student, and the teacher is optional.
- Specified by:
canBeLearnedBy
in interface Ability
- Parameters:
teacher
- the potential teacher of this skill, may be nullstudent
- the potential learner of this skill, may NOT be null
- Returns:
- whether the student can learn the skill from the teacher
- See Also:
Ability.canBeTaughtBy(MOB, MOB)
,
Ability.teach(MOB, MOB)
teach
public void teach(MOB teacher,
MOB student)
- Description copied from interface:
Ability
- Teaches this skill to the student mob, presumably from the teacher mob.
This method assumes that both the teacher and student are authorized.
Authorization comes from canBeTaughtBy and canBeLearnedBy
- Specified by:
teach
in interface Ability
- Parameters:
teacher
- the teacher of this skillstudent
- the learner of this skill- See Also:
Ability.canBeTaughtBy(MOB, MOB)
,
Ability.canBeLearnedBy(MOB, MOB)
practice
public void practice(MOB teacher,
MOB student)
- Description copied from interface:
Ability
- Causes the student to practice this skill, presumably with the teacher mob.
This method assumes that both the teacher and student are authorized.
Authorization comes from canBePracticedBy
- Specified by:
practice
in interface Ability
- Parameters:
teacher
- the teacher of this skillstudent
- the practicer of this skill- See Also:
Ability.canBePracticedBy(MOB, MOB)
maxRange
public int maxRange()
- Description copied from interface:
Environmental
- the maximum range of this object, if applicable. Can refer to the size of a room,
the range of a weapon, or the calculated range of a mob in combat.
- Specified by:
maxRange
in interface Environmental
- Returns:
- the maximum range
minRange
public int minRange()
- Description copied from interface:
Environmental
- the minimum range of this object, if applicable. Can refer to the size of a room,
the range of a weapon, or the calculated range of a mob in combat. Usually 0.
- Specified by:
minRange
in interface Environmental
- Returns:
- the minimum range
expirationDate
public long expirationDate()
- Description copied from interface:
Environmental
- If this object expires, it should have a timestamp saying when it expires, in real time.
When it expires, a MSG_EXPIRE message will be sent to it.
- Specified by:
expirationDate
in interface Environmental
- Returns:
- the time stamp when this thing expires
- See Also:
Environmental.setExpirationDate(long)
setExpirationDate
public void setExpirationDate(long time)
- Description copied from interface:
Environmental
- If this object expires, it should have a timestamp saying when it expires, in real time.
When it expires, a MSG_EXPIRE message will be sent to it.
- Specified by:
setExpirationDate
in interface Environmental
- Parameters:
time
- the time stamp when this thing expires- See Also:
Environmental.expirationDate()
startTickDown
public void startTickDown(MOB invokerMOB,
Physical affected,
int tickTime)
- Description copied from interface:
Ability
- Adds THIS Ability object as an effect on the given affected target, and
sets it to unInvoke after the given number of ticks. This method
intelligently determines whether the target is already going to provide
tick events to the Ability (like a mob) or whether the system should
create a tick event for this ability (like on rooms or items).
- Specified by:
startTickDown
in interface Ability
- Parameters:
invokerMOB
- the invoker of the abilityaffected
- the object to be affected by this abilitytickTime
- the number of ticks to keep the ability ticking.
proficiency
public int proficiency()
- Description copied from interface:
Ability
- Returns a number from 0-100 representing the percent of proficiency
the mob or player who has this instance in their Abilities list has in
this skill. Is also used for other miscellaneous purposes by other non-skill
Abilities, such as Drowning.
- Specified by:
proficiency
in interface Ability
- Returns:
- the proficiency from 0-100
- See Also:
AbilityContainer.addAbility(Ability)
,
Ability.setProficiency(int)
setProficiency
public void setProficiency(int newProficiency)
- Description copied from interface:
Ability
- Sets a number from 0-100 representing the percent of proficiency
the mob or player who has this instance in their Abilities list has in
this skill. Is also used for other miscellaneous purposes by other non-skill
Abilities, such as Drowning.
- Specified by:
setProficiency
in interface Ability
- Parameters:
newProficiency
- the proficiency from 0-100- See Also:
AbilityContainer.addAbility(Ability)
,
Ability.proficiency()
proficiencyCheck
public boolean proficiencyCheck(MOB mob,
int adjustment,
boolean auto)
- Description copied from interface:
Ability
- Returns whether the given mob passes their proficiency check in this skill
at this time. Will accept a numeric adjustment, positive or negative, to
their base proficiency. Will also accept an auto parameter, which forces
this method to always return true.
- Specified by:
proficiencyCheck
in interface Ability
- Parameters:
mob
- the mob whose proficiency to checkadjustment
- a positive or negative adjustment to the mobs base proficiencyauto
- if true, this method returns true always
- Returns:
- whether the mob passes their proficiency check
- See Also:
Ability.proficiency()
helpProficiency
public void helpProficiency(MOB mob,
int adjustment)
- Description copied from interface:
Ability
- This method should, occasionally, add to the proficiency the given mob
has in this skill. There are no guarantees about how often this method
is called, but presumably it is called when the mob is doing something
that exercises this skill in some way. How often proficiency is effected
by this method is up to the method, but is typically time-based, and based
on intelligence and other factors.
- Specified by:
helpProficiency
in interface Ability
- Parameters:
mob
- the mob whose proficiency in this skill to possibly advanceadjustment
- up or down to the chance of becoming more proficient- See Also:
Ability.proficiency()
affecting
public Physical affecting()
- Description copied from interface:
Ability
- Returns a reference to the room, item, mob, or exit
that is currently being affected by this skill. Does
not apply to non-affecting skills like kick, but more
to auto-invoking skills and spells that affect people
like sleep.
- Specified by:
affecting
in interface Ability
- Returns:
- the room, mob, or item being affected
- See Also:
Ability.setAffectedOne(Physical)
setAffectedOne
public void setAffectedOne(Physical P)
- Description copied from interface:
Ability
- Sets a reference to the room, item, mob, or exit
that is currently being affected by this skill. Does
not apply to non-affecting skills like kick, but more
to auto-invoking skills and spells that affect people
like sleep, and especially to properties.
- Specified by:
setAffectedOne
in interface Ability
- Parameters:
P
- the room, mob, or item being affected- See Also:
Ability.affecting()
putInCommandlist
public boolean putInCommandlist()
- Description copied from interface:
Ability
- Returns whether this skills triggerStrings should be
places in the master list of commands, unlike
properties or other hidden skills.
- Specified by:
putInCommandlist
in interface Ability
- Returns:
- whether to add the triggerString to the commands list
- See Also:
Ability.triggerStrings()
abstractQuality
public int abstractQuality()
- Description copied from interface:
Ability
- Returns a constant value notifying the system of
the general quality of the skill, whether it is
malicious, beneficial, indifferent, or qualifiably
beneficial (ok), as well as whether it is intended
to target the invoker (self) or others. These
constants are defined in the Ability interface and
called QUALITY_*
- Specified by:
abstractQuality
in interface Ability
- Returns:
- Ability.QUALITY_* constant classification
- See Also:
Ability
enchantQuality
public int enchantQuality()
- Description copied from interface:
Ability
- Identical to abstractQuality() method, but returns
a quality based on how the skill or spell behaves
as a spell effect on a weapon or on armor. This
helps decide whether this skill is appropriate in
those roles. These constants are defined in the
Ability interface and called QUALITY_*
- Specified by:
enchantQuality
in interface Ability
- Returns:
- Ability.QUALITY_* constant classification
- See Also:
Ability.abstractQuality()
,
Ability
castingQuality
public int castingQuality(MOB invoker,
Physical target)
- Description copied from interface:
Ability
- Serves a purpose similar to that of the Ability
abstractQuality() method, but it determines a more
exact quality based on a given invoker, target, and
assumes an imminent use of the skill. For this
reason, the QUALITY_OK_* constants should be avoided
in favor of the other Ability.QUALITY_* constants.
- Specified by:
castingQuality
in interface Ability
- Parameters:
invoker
- the person to use the skilltarget
- the potential target -- may be invoker
- Returns:
- Ability.QUALITY_* constant classification
- See Also:
Ability
,
Ability.abstractQuality()
classificationCode
public int classificationCode()
- Description copied from interface:
Ability
- Returns a bitmap describing the general
classification of the skill (spell, skill,
chant, or property, etc) and its domain. It
is made up of the ACODE_* constants the Ability
interface, and optionally the DOMAIN_* constants
also defined in this interface.
- Specified by:
classificationCode
in interface Ability
- Returns:
- ACODE_* constant classification
- See Also:
Ability
isSavable
public boolean isSavable()
- Description copied from interface:
Contingent
- 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. It always returns true except
under unique circumstances.
- Specified by:
isSavable
in interface Contingent
- Returns:
- true, usually.
setSavable
public void setSavable(boolean truefalse)
- Description copied from interface:
Contingent
- Sets whether this object can be saved as a permanent aspect of
its host.
- Specified by:
setSavable
in interface Contingent
- Parameters:
truefalse
- whether this behavior can be saved as part of its host.- See Also:
Contingent.isSavable()
destroy
public void destroy()
- Description copied from interface:
Contingent
- Utterly and permanently destroy this object, not only removing it from the map, but
causing this object to be collected as garbage by Java. Containers, rooms. and mobs who have
their destroy() method called will also call the destroy() methods on all items and other
objects listed as content, recursively.
- Specified by:
destroy
in interface Contingent
amDestroyed
public boolean amDestroyed()
- Description copied from interface:
Contingent
- Whether the destroy() method has been previousy called on this object.
- Specified by:
amDestroyed
in interface Contingent
- Returns:
- whether the object is destroy()ed.
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
getSaveStatIndex
public int getSaveStatIndex()
- Description copied from interface:
Modifiable
- Returns the index into the stat codes array where extra savable fields begins.
This number is always the same as getStatCodes().length unless there are extra
fields which need to be saved in xml for generic objects. This method is used
by editors for post-build user-defined fields.
- Specified by:
getSaveStatIndex
in interface Modifiable
- Returns:
- the index into getStatCodes()
- See Also:
Modifiable.getStatCodes()
,
Modifiable.getStat(String)
,
Modifiable.setStat(String, String)
getStatCodes
public java.lang.String[] getStatCodes()
- Description copied from interface:
Modifiable
- Returns an array of the string names of those fields which are modifiable on this object at run-time by
builders.
- Specified by:
getStatCodes
in interface Modifiable
- Returns:
- list of the fields which may be set.
- See Also:
Modifiable.getStat(String)
,
Modifiable.setStat(String, String)
isStat
public boolean isStat(java.lang.String code)
- Description copied from interface:
Modifiable
- An alternative means of retreiving the values of those fields on this object which are modifiable at
run-time by builders. See getStatCodes() for possible values for the code passed to this method.
Values returned are always strings, even if the field itself is numeric or a list.
- Specified by:
isStat
in interface Modifiable
- Parameters:
code
- the name of the field to read.
- Returns:
- true if the code is a real value, false otherwise
- See Also:
Modifiable.getStatCodes()
getCodeNum
protected int getCodeNum(java.lang.String code)
getStat
public java.lang.String getStat(java.lang.String code)
- Description copied from interface:
Modifiable
- An alternative means of retreiving the values of those fields on this object which are modifiable at
run-time by builders. See getStatCodes() for possible values for the code passed to this method.
Values returned are always strings, even if the field itself is numeric or a list.
- Specified by:
getStat
in interface Modifiable
- Parameters:
code
- the name of the field to read.
- Returns:
- the value of the field read
- See Also:
Modifiable.getStatCodes()
setStat
public void setStat(java.lang.String code,
java.lang.String val)
- Description copied from interface:
Modifiable
- An alternative means of setting the values of those fields on this object which are modifiable at
run-time by builders. See getStatCodes() for possible values for the code passed to this method.
The value passed in is always a string, even if the field itself is numeric or a list.
- Specified by:
setStat
in interface Modifiable
- Parameters:
code
- the name of the field to setval
- the value to set the field to- See Also:
Modifiable.getStatCodes()
sameAs
public boolean sameAs(Environmental E)
- Description copied from interface:
Environmental
- Whether this object instance is functionally identical to the object passed in. Works by repeatedly
calling getStat on both objects and comparing the values.
- Specified by:
sameAs
in interface Environmental
- Parameters:
E
- the object to compare this one to
- Returns:
- whether this object is the same as the one passed in
- See Also:
Modifiable.getStatCodes()
,
Modifiable.getStat(String)
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>
setMiscText
public void setMiscText(java.lang.String newMiscText)
- Description copied from interface:
Environmental
- For objects which have false for their isGeneric method, this is used to set any internally
coded strings to change the nature or behavior of the object. For objects which have true
for their isGeneric method, this is used to set and parse the XML which will be used to
fill out the fields in this object. Since Ability objects are never Generic, this will always
be where parameters are read from an Ability instance.
- Specified by:
setMiscText
in interface Environmental
- Parameters:
newMiscText
- either an open internal text string, or XML
text
public java.lang.String text()
- Description copied from interface:
Environmental
- For objects which have false for their isGeneric method, this is used to set any internally
coded strings to change the nature or behavior of the object. For objects which have true
for their isGeneric method, this is used to set and parse the XML which will be used to
fill out the fields in this object. Since Ability objects are never Generic, this will always
be where parameters are read from an Ability instance.
- Specified by:
text
in interface Environmental
- Returns:
- either an open internal text string, or XML
miscTextFormat
public java.lang.String miscTextFormat()
- Description copied from interface:
Environmental
- Unimplemented as of yet, but will hold a string telling the system what
the proper format of any miscText data. Will use the CMParms.MTFORMAT_*
constants for definition.
- Specified by:
miscTextFormat
in interface Environmental
- Returns:
- the format expected for the miscText field
- See Also:
CMParms
,
Environmental.text()
,
Environmental.setMiscText(String)
appropriateToMyFactions
public boolean appropriateToMyFactions(MOB mob)
- Description copied from interface:
Ability
- Returns whether there are any Faction reasons why the given
mob should not use this skill. Used primarily for alignment
checks of Prayers.
- Specified by:
appropriateToMyFactions
in interface Ability
- Parameters:
mob
- the mob whose factions to check
- Returns:
- whether there are any faction reasons not to cast this.
- See Also:
Prayer
,
Faction
accountForYourself
public java.lang.String accountForYourself()
- Description copied from interface:
Ability
- For use by the identify spell, this should return a
nice description of any properties incorporated
by this effect.
- Specified by:
accountForYourself
in interface Ability
- Returns:
- a description of properties incorporated
requirements
public java.lang.String requirements(MOB mob)
- Description copied from interface:
Ability
- Returns a string describing the requirements and qualifications that
are required to learn this skill.
- Specified by:
requirements
in interface Ability
- Parameters:
mob
- the mob whose requirements must be tested
- Returns:
- a description of the learning requirements of this skill.
canAffect
public boolean canAffect(Physical P)
- Description copied from interface:
Ability
- Returns whether, when used as a property/effect, this ability can affect
the given object. This method derives its answer from the protected
integer method canAffectCode()
- Specified by:
canAffect
in interface Ability
- Parameters:
P
- the potential object to have this as a property/effect
- Returns:
- whether E is a valid object to have this as a property/effect
- See Also:
StdAbility.canAffectCode()
canTarget
public boolean canTarget(Physical P)
- Description copied from interface:
Ability
- Returns whether, when used as a skill, this ability can target itself
at the given object. This method derives its answer from the protected
integer method canTargetCode()
- Specified by:
canTarget
in interface Ability
- Parameters:
P
- the potential target of this skill
- Returns:
- whether E is a valid target
- See Also:
StdAbility.canTargetCode()
affectPhyStats
public void affectPhyStats(Physical affected,
PhyStats affectableStats)
- Description copied from interface:
StatsAffecting
- This method is called by the recoverPhyStats() method on other Environmental objects. It is used
to transform the Environmental basePhyStats() object into a finished phyStats() object, both of
which are objects implementing the PhyStats interface. See those methods for more information.
- Specified by:
affectPhyStats
in interface StatsAffecting
- Parameters:
affected
- the host of the PhyStats object being affectedaffectableStats
- the particular PhyStats object being affected- See Also:
PhyStats
,
Environmental
,
Affectable.basePhyStats()
,
Affectable.phyStats()
,
Affectable.recoverPhyStats()
affectCharStats
public void affectCharStats(MOB affectedMob,
CharStats affectableStats)
- Description copied from interface:
StatsAffecting
- This method is called by the recoverCharStats() method on other MOB objects. It is used
to transform the MOB baseCharStats() object into a finished charStats() object, both of
which are objects implementing the CharStats interface. See those methods for more information.
- Specified by:
affectCharStats
in interface StatsAffecting
- Parameters:
affectedMob
- the host of the CharStats object being affectedaffectableStats
- the particular CharStats object being affected- See Also:
CharStats
,
MOB
,
MOB.baseCharStats()
,
MOB.charStats()
,
MOB.recoverCharStats()
affectCharState
public void affectCharState(MOB affectedMob,
CharState affectableMaxState)
- Description copied from interface:
StatsAffecting
- This method is called by the recoverCharState() method on other MOB objects. It is used
to transform the MOB baseCharState() object into a finished charState() object, both of
which are objects implementing the CharState interface. See those methods for more information.
- Specified by:
affectCharState
in interface StatsAffecting
- Parameters:
affectedMob
- the host of the CharState object being affectedaffectableMaxState
- the particular CharState object being affected- See Also:
CharState
,
MOB
,
MOB.baseState()
,
MOB.curState()
,
MOB.recoverMaxState()
executeMsg
public void executeMsg(Environmental myHost,
CMMsg msg)
- Description copied from interface:
MsgListener
- The general message event handler for the object. Messages passed herein
may not necessarily be FOR this object, or from it, but will almost
always represent events happening in the same room. The messages
have already been through an approval process, so this method is
called only to affect the final execution of the meaning of the
message. Every game event goes through these methods.
- Specified by:
executeMsg
in interface MsgListener
- Parameters:
myHost
- either the initiator of the event, or the host of this objectmsg
- the CMMsg that needs to be executed- See Also:
CMMsg
okMessage
public boolean okMessage(Environmental myHost,
CMMsg msg)
- Description copied from interface:
MsgListener
- The general message event previewer for the object. Messages passed herein
are in a pending state, and may be safely modified or rejected without fear
that they might be in the middle of being executed. Messages passed herein
may not necessarily be FOR or FROM this object, but will almost always
represent events which want to happen in the same rom. This method should
always always return true UNLESS this message needs to be canceled, in which
case it is necessary to tell the mob initiating the event (CMMsg.source())
why it is being cancelled. Every game event goes through these methods.
- Specified by:
okMessage
in interface MsgListener
- Parameters:
myHost
- either the initiator of the event, or the host of this objectmsg
- the CMMsg that wants to be executed
- Returns:
- whether this message is allowed to execute
- See Also:
CMMsg
,
CMMsg.source()
tick
public boolean tick(Tickable ticking,
int tickID)
- Description copied from interface:
Tickable
- this is the method which is called periodically by the threading engine. How often it
is called depends on the parameters passed to the threadding engine when it is submitted
for thread access. Typically the period is once per TIME_TICK period, but that is
determined when the object is submitted to the thread engine.
- Specified by:
tick
in interface Tickable
- Parameters:
ticking
- a reference to this Tickable objecttickID
- the TICKID_ constant describing this periodic call, as defined in Tickable
- Returns:
- true always, unless this object no longer wishes to ever tick again, in which case false
- See Also:
Tickable
,
ServiceEngine
,
TickableGroup
makeLongLasting
public void makeLongLasting()
- Description copied from interface:
Ability
- If this ability has been added as as temporary effect, like
sleep, or trip, or other typical spells, calling this
method will make it so thatit will not do so on its own for a
long long time. This method does not make it UNinvokable, but
only makes it last a long time.
- Specified by:
makeLongLasting
in interface Ability
makeNonUninvokable
public void makeNonUninvokable()
- Description copied from interface:
Ability
- Designates that this skill should never be uninvoked. Designates that
this skill is a permanent property of the object it is affecting.
Is normally called by addNonUninvokableAffect
- Specified by:
makeNonUninvokable
in interface Ability
- See Also:
Affectable.addNonUninvokableEffect(Ability)
,
Ability.canBeUninvoked()
usageCost
public int[] usageCost(MOB mob,
boolean ignoreCostOverride)
- Description copied from interface:
Ability
- Returns an integer array telling the system how much mana,
movement, or hit points are required to invoke this skill.
Use the Ability.USAGEINDEX_* constants to index the array.
A value of 0-1000 is an absolute cost. A value of
Ability.COST_ALL means to use all of the mana, movement,
hit points. A value of Ability.COST_PCT and up
represents a percentage of the cost.
The values in this method MUST be accompanied by properly
set usageType() bitmap.
- Specified by:
usageCost
in interface Ability
- Parameters:
mob
- the invoker of the skillignoreCostOverride
- whether to ignore Class Overrides
- Returns:
- an array of costs, indexed by Ability.USAGEINDEX_*
- See Also:
Ability.usageType()
,
Ability
isGeneric
public boolean isGeneric()
- Description copied from interface:
Environmental
- Whether the fields of this item are set in code, or set by builders. Generic means that
they are set by builders, in which case XML is returned by the text() method containing
all of the values for all the fields.
- Specified by:
isGeneric
in interface Environmental
- Returns:
- whether this item is modifiable by builders
- See Also:
Environmental.text()