public abstract class Ability extends java.lang.Object implements IRenderable
| Modifier | Constructor and Description |
|---|---|
protected |
Ability(Creature executor)
Instantiates a new ability.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addEffect(IEffect 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<IEffect> |
getEffects() |
Creature |
getExecutor() |
java.lang.String |
getName() |
java.awt.geom.Point2D |
getOrigin() |
float |
getRemainingCooldownInSeconds(IGameLoop loop) |
protected java.awt.Shape |
internalCalculateImpactArea(float angle) |
boolean |
isCasting(IGameLoop gameLoop) |
boolean |
isMultiTarget() |
void |
onCast(java.util.function.Consumer<AbilityExecution> castConsumer) |
void |
onEffectApplied(java.util.function.Consumer<EffectArgument> consumer) |
void |
onEffectCeased(java.util.function.Consumer<EffectArgument> consumer) |
void |
render(java.awt.Graphics2D g) |
void |
setOrigin(java.awt.geom.Point2D origin)
Sets a custom offset from the executors map location as origin of this
ability.
|
protected Ability(Creature executor)
executor - the executing entitypublic void addEffect(IEffect 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 java.awt.geom.Point2D getOrigin()
public float getRemainingCooldownInSeconds(IGameLoop loop)
public boolean isCasting(IGameLoop gameLoop)
public boolean isMultiTarget()
public void onCast(java.util.function.Consumer<AbilityExecution> castConsumer)
public void onEffectApplied(java.util.function.Consumer<EffectArgument> consumer)
public void onEffectCeased(java.util.function.Consumer<EffectArgument> consumer)
public void render(java.awt.Graphics2D g)
render in interface IRenderablepublic void setOrigin(java.awt.geom.Point2D origin)
origin - The origin that defines the execution offset for this
Ability.protected java.util.List<IEffect> getEffects()
protected java.awt.Shape internalCalculateImpactArea(float angle)