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(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() |
float |
getRemainingCooldownInSeconds() |
protected java.awt.Shape |
internalCalculateImpactArea(double angle) |
boolean |
isActive() |
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) |
protected void |
setCurrentExecution(AbilityExecution ae) |
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(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 java.awt.geom.Point2D getOrigin()
public float getRemainingCooldownInSeconds()
public boolean isActive()
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 IRenderable
public void setOrigin(java.awt.geom.Point2D origin)
origin
- The origin that defines the execution offset for this
Ability
.protected void setCurrentExecution(AbilityExecution ae)
protected java.util.List<Effect> getEffects()
protected java.awt.Shape internalCalculateImpactArea(double angle)