|
|||||||||
| Version 1.5 | APIs subject to change! | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmultiverse.mars.core.MarsAbility
public class MarsAbility
The MarsAbility object describes an action that a mob can perform.
When an ability is triggered, a MarsAbility.State object is generated that represents the current state of that instance of the ability. It progresses through a sequence of states, dependent on the configuration of the MarsAbility object.
As each state is entered or exitted, a method is called that can be overriden to create different types of abilities.
| Nested Class Summary | |
|---|---|
static class |
MarsAbility.AbilityResult
|
static class |
MarsAbility.ActivationState
|
static class |
MarsAbility.Entry
|
class |
MarsAbility.State
|
static class |
MarsAbility.TargetType
|
| Field Summary | |
|---|---|
protected int |
activationCost
|
protected long |
activationTime
|
protected int |
activeCost
|
protected long |
activePulseTime
|
protected int |
channelCost
|
protected boolean |
channelled
|
protected int |
channelPulses
|
protected long |
channelPulseTime
|
protected java.lang.String |
completeAnimation
|
protected java.lang.String |
completeSound
|
protected java.util.Map<java.lang.String,Cooldown> |
cooldownMap
|
protected java.util.Map<MarsAbility.ActivationState,java.util.Set<CoordinatedEffect>> |
coordEffectMap
|
protected java.lang.String |
costProp
|
protected java.lang.String |
icon
|
protected java.util.concurrent.locks.Lock |
lock
MarsAbility lock |
protected int |
maxRange
|
protected int |
minRange
|
protected boolean |
persistent
|
protected java.util.ArrayList<java.lang.String> |
reagentList
|
protected boolean |
stationary
|
protected MarsAbility.TargetType |
targetType
|
protected java.util.ArrayList<java.lang.String> |
toolList
|
protected boolean |
useGlobalCooldown
|
| Constructor Summary | |
|---|---|
MarsAbility(java.lang.String name)
|
|
| Method Summary | |
|---|---|
void |
addCooldown(Cooldown cd)
Adds a cooldown to this ability. |
boolean |
addCoordEffect(MarsAbility.ActivationState state,
CoordinatedEffect effect)
|
void |
addReagent(java.lang.String reagent)
Adds a reagent requirement to this ability. |
void |
addTool(java.lang.String tool)
Adds a tool requirement to this ability. |
void |
beginActivated(MarsAbility.State state)
|
void |
beginActivation(MarsAbility.State state)
|
void |
beginChannelling(MarsAbility.State state)
|
MarsAbility.AbilityResult |
checkAbility(CombatInfo obj,
CombatInfo target)
|
protected MarsAbility.AbilityResult |
checkAbility(CombatInfo obj,
CombatInfo target,
MarsAbility.ActivationState state)
|
protected MarsAbility.AbilityResult |
checkCost(CombatInfo obj,
CombatInfo target,
MarsAbility.ActivationState state)
|
protected MarsAbility.AbilityResult |
checkRange(CombatInfo obj,
CombatInfo target,
float rangeTollerance)
|
protected MarsAbility.AbilityResult |
checkReady(CombatInfo obj,
CombatInfo target)
|
protected MarsAbility.AbilityResult |
checkReagent(CombatInfo obj,
CombatInfo target,
MarsAbility.ActivationState state)
|
protected MarsAbility.AbilityResult |
checkTarget(CombatInfo obj,
CombatInfo target)
|
protected MarsAbility.AbilityResult |
checkTool(CombatInfo obj,
CombatInfo target,
MarsAbility.ActivationState state)
|
void |
completeActivation(MarsAbility.State state)
|
void |
completeChannelling(MarsAbility.State state)
|
void |
endActivated(MarsAbility.State state)
|
boolean |
equals(java.lang.Object other)
Returns if two objects are the same - tested by comparing the ability name. |
protected MarsAbility.State |
generateState(CombatInfo obj,
CombatInfo target,
MarsItem item)
|
int |
getActivationCost()
Returns the stat cost for successfully activating the ability. |
long |
getActivationTime()
Returns the time the ability takes to activate. |
int |
getActiveCost()
Returns the stat cost charged for each pulse of the active phase. |
long |
getActivePulseTime()
Returns the time in ms for each pulse of the active phase. |
int |
getBaseExpThreshold()
-Experience system component- Returns the default max experience that will be needed before the ability gains a level. |
int |
getChannelCost()
Returns the stat cost charged for each channelling pulse. |
boolean |
getChannelled()
|
int |
getChannelPulses()
Returns the number of pulses during the channelled phase. |
long |
getChannelPulseTime()
Returns the time in ms for each pulse of a channelled ability. |
java.lang.String |
getCompleteAnimation()
|
java.lang.String |
getCompleteSound()
|
java.util.Map<java.lang.String,Cooldown> |
getCooldownMap()
|
java.util.Collection<CoordinatedEffect> |
getCoordEffects(MarsAbility.ActivationState state)
|
java.lang.String |
getCostProperty()
Returns the name of the property that stat costs are deducted from. |
int |
getExperiencePerUse()
-Experience system component- Returns the amount of experience should be gained by successful use of this ability. |
java.lang.String |
getIcon()
Returns the icon name for this ability. |
LevelingMap |
getLevelingMap()
|
int |
getMaxRange()
Returns the maximum range in mm for this ability. |
int |
getMaxRank()
-Experience system component- Returns the max rank that an ability may achieve. |
int |
getMinRange()
Returns the minimum range in mm for this ability. |
java.lang.String |
getName()
Returns the name of the ability. |
boolean |
getPersistent()
|
java.util.ArrayList<java.lang.String> |
getReagentList()
|
MarsSkill |
getRequiredSkill()
|
int |
getRequiredSkillLevel()
|
java.lang.String |
getSlashCommand()
|
boolean |
getStationary()
|
MarsAbility.TargetType |
getTargetType()
Returns the target type for this ability. |
java.util.ArrayList<java.lang.String> |
getToolList()
|
boolean |
getUseGlobalCooldown()
|
int |
hashCode()
Returns a hash of the ability name |
void |
interrupt(MarsAbility.State state)
|
static void |
interruptAbility(MarsAbility.State state,
MarsAbility.AbilityResult reason)
|
boolean |
isInstant()
Returns if the ability has 0 activation time. |
void |
pulseActivated(MarsAbility.State state)
|
void |
pulseChannelling(MarsAbility.State state)
|
void |
removeCooldown(java.lang.String id)
Removes a cooldown from this ability. |
boolean |
removeCoordEffect(MarsAbility.ActivationState state,
CoordinatedEffect effect)
|
void |
setActivationCost(int cost)
Sets the stat cost for successfully activating the ability. |
void |
setActivationTime(long time)
Sets the time the ability takes to activate. |
void |
setActiveCost(int cost)
Sets the stat cost charged for each pulse of the active phase. |
void |
setActivePulseTime(long time)
Set the time in ms for each pulse of the active phase. |
void |
setBaseExpThreshold(int max)
-Experience system component- Sets the default max experience that will be needed before the ability gains a level. |
void |
setChannelCost(int cost)
Sets the stat cost charged for each channelling pulse. |
void |
setChannelled(boolean val)
|
void |
setChannelPulses(int pulses)
Sets the number of pulses during the channelled phase. |
void |
setChannelPulseTime(long time)
Sets the time in ms for each pulse of a channelled ability. |
void |
setCompleteAnimation(java.lang.String anim)
|
void |
setCompleteSound(java.lang.String sound)
|
void |
setCooldownMap(java.util.Map<java.lang.String,Cooldown> cooldownMap)
|
void |
setCostProperty(java.lang.String name)
Sets the name of the property that stat costs are deducted from. |
void |
setExperiencePerUse(int xp)
-Experience system component- Sets the amount of experience should be gained by successsful use of this ability. |
void |
setIcon(java.lang.String icon)
Sets the icon name for this ability. |
void |
setLevelingMap(LevelingMap lm)
|
void |
setMaxRange(int range)
Sets the maximum range in mm for this ability. |
void |
setMaxRank(int rank)
-Experience system component- Sets the max rank that an ability may achieve. |
void |
setMinRange(int range)
Sets the minimum range in mm for this ability. |
void |
setName(java.lang.String name)
Sets the name of the ability. |
void |
setPersistent(boolean val)
|
void |
setReagentList(java.util.ArrayList<java.lang.String> reagentList)
|
void |
setRequiredSkill(MarsSkill skill,
int level)
|
void |
setSlashCommand(java.lang.String slashCommand)
exposes a way for the client to execute ability with a slash command |
void |
setStationary(boolean val)
|
void |
setTargetType(MarsAbility.TargetType type)
Sets the target type for this ability. |
void |
setToolList(java.util.ArrayList<java.lang.String> toolList)
|
void |
setUseGlobalCooldown(boolean val)
|
static void |
startAbility(MarsAbility ability,
CombatInfo obj,
CombatInfo target,
MarsItem item)
|
java.lang.String |
toString()
Returns the string describing this ability, useful for logging. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected transient java.util.concurrent.locks.Lock lock
protected long activationTime
protected int activationCost
protected java.lang.String costProp
protected long channelPulseTime
protected int channelPulses
protected int channelCost
protected long activePulseTime
protected int activeCost
protected java.lang.String icon
protected int minRange
protected int maxRange
protected java.util.Map<java.lang.String,Cooldown> cooldownMap
protected java.util.ArrayList<java.lang.String> reagentList
protected java.util.ArrayList<java.lang.String> toolList
protected MarsAbility.TargetType targetType
protected boolean useGlobalCooldown
protected boolean stationary
protected boolean channelled
protected boolean persistent
protected java.util.Map<MarsAbility.ActivationState,java.util.Set<CoordinatedEffect>> coordEffectMap
protected java.lang.String completeAnimation
protected java.lang.String completeSound
| Constructor Detail |
|---|
public MarsAbility(java.lang.String name)
| Method Detail |
|---|
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic void setName(java.lang.String name)
name - name for this ability.public java.lang.String getName()
public long getActivationTime()
public void setActivationTime(long time)
time - time in ms that the ability takes to activate.public boolean isInstant()
public int getActivationCost()
public void setActivationCost(int cost)
cost - stat cost for activating the ability.public java.lang.String getCostProperty()
public void setCostProperty(java.lang.String name)
name - name of the property that stat costs are deducted from.public long getChannelPulseTime()
public void setChannelPulseTime(long time)
time - time in ms for each pulse of a channelled ability.public int getChannelPulses()
public void setChannelPulses(int pulses)
pulses - number of pulses during the channelled phase for the ability.public int getChannelCost()
public void setChannelCost(int cost)
cost - stat cost charged for each channelling pulse.public long getActivePulseTime()
public void setActivePulseTime(long time)
time - time in ms for each pulse of the active phase.public int getActiveCost()
public void setActiveCost(int cost)
cost - stat cost charged for each pulse of hte active phase.public java.lang.String getIcon()
public void setIcon(java.lang.String icon)
icon - icon name for this ability.public int getMinRange()
public void setMinRange(int range)
range - minimum range in mm for this ability.public int getMaxRange()
public void setMaxRange(int range)
range - Maximum range in mm for this ability.public void addCooldown(Cooldown cd)
cd - Cooldown to add to this ability.public void removeCooldown(java.lang.String id)
id - id of the cooldown to remove.public java.util.Map<java.lang.String,Cooldown> getCooldownMap()
public void setCooldownMap(java.util.Map<java.lang.String,Cooldown> cooldownMap)
public void addReagent(java.lang.String reagent)
reagent - name of the template the reagent was created from.public java.util.ArrayList<java.lang.String> getReagentList()
public void setReagentList(java.util.ArrayList<java.lang.String> reagentList)
public void addTool(java.lang.String tool)
tool - name of the template the tool was created from.public java.util.ArrayList<java.lang.String> getToolList()
public void setToolList(java.util.ArrayList<java.lang.String> toolList)
public MarsAbility.TargetType getTargetType()
public void setTargetType(MarsAbility.TargetType type)
type - target type for this ability.public boolean getUseGlobalCooldown()
public void setUseGlobalCooldown(boolean val)
public boolean getStationary()
public void setStationary(boolean val)
public boolean getChannelled()
public void setChannelled(boolean val)
public boolean getPersistent()
public void setPersistent(boolean val)
public boolean addCoordEffect(MarsAbility.ActivationState state,
CoordinatedEffect effect)
public boolean removeCoordEffect(MarsAbility.ActivationState state,
CoordinatedEffect effect)
public java.util.Collection<CoordinatedEffect> getCoordEffects(MarsAbility.ActivationState state)
public java.lang.String getCompleteAnimation()
public void setCompleteAnimation(java.lang.String anim)
public java.lang.String getCompleteSound()
public void setCompleteSound(java.lang.String sound)
public void beginActivation(MarsAbility.State state)
public void completeActivation(MarsAbility.State state)
public void beginChannelling(MarsAbility.State state)
public void pulseChannelling(MarsAbility.State state)
public void completeChannelling(MarsAbility.State state)
public void beginActivated(MarsAbility.State state)
public void pulseActivated(MarsAbility.State state)
public void endActivated(MarsAbility.State state)
public void interrupt(MarsAbility.State state)
public void setSlashCommand(java.lang.String slashCommand)
public java.lang.String getSlashCommand()
public void setRequiredSkill(MarsSkill skill,
int level)
public MarsSkill getRequiredSkill()
public int getRequiredSkillLevel()
protected MarsAbility.AbilityResult checkTarget(CombatInfo obj,
CombatInfo target)
protected MarsAbility.AbilityResult checkRange(CombatInfo obj,
CombatInfo target,
float rangeTollerance)
protected MarsAbility.AbilityResult checkReady(CombatInfo obj,
CombatInfo target)
protected MarsAbility.AbilityResult checkCost(CombatInfo obj,
CombatInfo target,
MarsAbility.ActivationState state)
protected MarsAbility.AbilityResult checkReagent(CombatInfo obj,
CombatInfo target,
MarsAbility.ActivationState state)
protected MarsAbility.AbilityResult checkTool(CombatInfo obj,
CombatInfo target,
MarsAbility.ActivationState state)
public MarsAbility.AbilityResult checkAbility(CombatInfo obj,
CombatInfo target)
protected MarsAbility.AbilityResult checkAbility(CombatInfo obj,
CombatInfo target,
MarsAbility.ActivationState state)
protected MarsAbility.State generateState(CombatInfo obj,
CombatInfo target,
MarsItem item)
public static void startAbility(MarsAbility ability,
CombatInfo obj,
CombatInfo target,
MarsItem item)
public static void interruptAbility(MarsAbility.State state,
MarsAbility.AbilityResult reason)
public int getExperiencePerUse()
public void setExperiencePerUse(int xp)
public void setLevelingMap(LevelingMap lm)
public LevelingMap getLevelingMap()
public int getBaseExpThreshold()
public void setBaseExpThreshold(int max)
public int getMaxRank()
public void setMaxRank(int rank)
|
Copyright © 2008 The Multiverse Network, Inc. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||