public abstract class Ability extends java.lang.Object implements IRenderable
| Modifier and Type | Class and Description |
|---|---|
static interface |
Ability.AbilityCastListener |
| Modifier | Constructor and Description |
|---|---|
protected |
Ability(Creature executor)
Instantiates a new ability.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addEffect(Effect effect) |
java.awt.Shape |
calculateImpactArea() |
java.awt.geom.Ellipse2D |
calculatePotentialImpactArea() |
boolean |
canCast() |
AbilityExecution |
cast()
Casts the ability by the temporal conditions of the specified game loop and
the spatial circumstances of the specified environment.
|
AbilityAttributes |
getAttributes() |
CastType |
getCastType() |
float |
getCooldownInSeconds() |
AbilityExecution |
getCurrentExecution() |
java.lang.String |
getDescription() |
protected java.util.List<Effect> |
getEffects() |
Creature |
getExecutor() |
java.lang.String |
getName() |
java.awt.geom.Point2D |
getOrigin() |
AbilityOrigin |
getOriginType() |
float |
getRemainingCooldownInSeconds() |
protected java.awt.Shape |
internalCalculateImpactArea(double angle) |
boolean |
isActive() |
boolean |
isMultiTarget() |
void |
onCast(Ability.AbilityCastListener listener) |
void |
onEffectApplied(Effect.EffectAppliedListener listener) |
void |
onEffectCeased(Effect.EffectCeasedListener listener) |
void |
removeAbilityCastListener(Ability.AbilityCastListener listener) |
void |
render(java.awt.Graphics2D g)
Renders the visual contents of this instance onto the provided graphics context.
|
void |
setCastType(CastType castType) |
protected void |
setCurrentExecution(AbilityExecution ae) |
void |
setDescription(java.lang.String description) |
void |
setMultiTarget(boolean multiTarget) |
void |
setName(java.lang.String name) |
void |
setOrigin(java.awt.geom.Point2D origin)
Sets a custom offset from the executors map location as origin of this
ability.
|
void |
setOriginType(AbilityOrigin originType) |
protected Ability(Creature executor)
executor - the executing entitypublic void onCast(Ability.AbilityCastListener listener)
public void removeAbilityCastListener(Ability.AbilityCastListener listener)
public void onEffectApplied(Effect.EffectAppliedListener listener)
public void onEffectCeased(Effect.EffectCeasedListener listener)
public void addEffect(Effect effect)
public java.awt.Shape calculateImpactArea()
public java.awt.geom.Ellipse2D calculatePotentialImpactArea()
public boolean canCast()
public AbilityExecution cast()
AbilityExecution object that wraps all information about
this execution of the ability.public AbilityAttributes getAttributes()
public CastType getCastType()
public float getCooldownInSeconds()
public AbilityExecution getCurrentExecution()
public java.lang.String getDescription()
public Creature getExecutor()
public java.lang.String getName()
public AbilityOrigin getOriginType()
public java.awt.geom.Point2D getOrigin()
public float getRemainingCooldownInSeconds()
public boolean isActive()
public boolean isMultiTarget()
public void render(java.awt.Graphics2D g)
IRenderable
If an Entity implements this interface, this method will be called right after the entity was rendered from the environment.
Allowing for a custom rendering mechanism.
This interface can be implemented in general by anything that should be rendered to the game's screen.
render in interface IRenderableg - The current graphics object onto which this instance will render its visual contents.RenderEngine.renderEntity(Graphics2D, de.gurkenlabs.litiengine.entities.IEntity)public void setOrigin(java.awt.geom.Point2D origin)
origin - The origin that defines the execution offset for this
Ability.public void setOriginType(AbilityOrigin originType)
public void setName(java.lang.String name)
public void setDescription(java.lang.String description)
public void setMultiTarget(boolean multiTarget)
public void setCastType(CastType castType)
protected void setCurrentExecution(AbilityExecution ae)
protected java.util.List<Effect> getEffects()
protected java.awt.Shape internalCalculateImpactArea(double angle)