Class Ability
java.lang.Object
de.gurkenlabs.litiengine.abilities.Ability
- All Implemented Interfaces:
IRenderable
public abstract class Ability
extends java.lang.Object
implements IRenderable
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Ability.AbilityCastListener
Constructor Summary
Method Summary
Modifier and Type Method 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()
java.util.List<Effect>
getEffects()
Creature
getExecutor()
java.lang.String
getName()
EntityPivot
getPivot()
float
getRemainingCooldownInSeconds()
protected java.awt.Shape
internalCalculateImpactArea(double angle)
boolean
isActive()
boolean
isMultiTarget()
boolean
isOnCooldown()
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)
void
setDescription(java.lang.String description)
void
setMultiTarget(boolean multiTarget)
void
setName(java.lang.String name)
Constructor Details
Ability
Initializes a new instance of theAbility
class.- Parameters:
executor
- The executing entity
Method Details
onCast
removeAbilityCastListener
onEffectApplied
onEffectCeased
addEffect
calculateImpactArea
public java.awt.Shape calculateImpactArea()calculatePotentialImpactArea
public java.awt.geom.Ellipse2D calculatePotentialImpactArea()canCast
public boolean canCast()isOnCooldown
public boolean isOnCooldown()cast
Casts the ability by the temporal conditions of the specified game loop and the spatial circumstances of the specified environment. An ability execution will be taken out that start applying all the effects of this ability.- Returns:
- An
AbilityExecution
object that wraps all information about this execution of the ability.
getAttributes
getCastType
getCooldownInSeconds
public float getCooldownInSeconds()getCurrentExecution
getDescription
public java.lang.String getDescription()getExecutor
getName
public java.lang.String getName()getPivot
getRemainingCooldownInSeconds
public float getRemainingCooldownInSeconds()isActive
public boolean isActive()isMultiTarget
public boolean isMultiTarget()render
public void render(java.awt.Graphics2D g)Description copied from interface:IRenderable
Renders the visual contents of this instance onto the provided graphics context.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.
- Specified by:
render
in interfaceIRenderable
- Parameters:
g
- The current graphics object onto which this instance will render its visual contents.- See Also:
RenderEngine.renderEntity(Graphics2D, de.gurkenlabs.litiengine.entities.IEntity)
setName
public void setName(java.lang.String name)setDescription
public void setDescription(java.lang.String description)setMultiTarget
public void setMultiTarget(boolean multiTarget)setCastType
getEffects
internalCalculateImpactArea
protected java.awt.Shape internalCalculateImpactArea(double angle)