Class Ability

java.lang.Object
de.gurkenlabs.litiengine.abilities.Ability
All Implemented Interfaces:
IRenderable

public abstract class Ability extends Object implements IRenderable
  • Constructor Details

    • Ability

      protected Ability(Creature executor)
      Initializes a new instance of the Ability class.
      Parameters:
      executor - The executing entity
  • Method Details

    • onCast

      public void onCast(Ability.AbilityCastListener listener)
    • removeAbilityCastListener

      public void removeAbilityCastListener(Ability.AbilityCastListener listener)
    • onEffectApplied

      public void onEffectApplied(Effect.EffectAppliedListener listener)
    • onEffectCeased

      public void onEffectCeased(Effect.EffectCeasedListener listener)
    • addEffect

      public void addEffect(Effect effect)
    • calculateImpactArea

      public Shape calculateImpactArea()
    • calculatePotentialImpactArea

      public Ellipse2D calculatePotentialImpactArea()
    • canCast

      public boolean canCast()
    • isOnCooldown

      public boolean isOnCooldown()
    • cast

      public AbilityExecution 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

      public AbilityAttributes getAttributes()
    • getCastType

      public CastType getCastType()
    • getCooldownInSeconds

      public float getCooldownInSeconds()
    • getCurrentExecution

      public AbilityExecution getCurrentExecution()
    • getDescription

      public String getDescription()
    • getExecutor

      public Creature getExecutor()
    • getName

      public String getName()
    • getPivot

      public EntityPivot getPivot()
    • getRemainingCooldownInSeconds

      public float getRemainingCooldownInSeconds()
    • isActive

      public boolean isActive()
    • isMultiTarget

      public boolean isMultiTarget()
    • render

      public void render(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 interface IRenderable
      Parameters:
      g - The current graphics object onto which this instance will render its visual contents.
      See Also:
    • setName

      public void setName(String name)
    • setDescription

      public void setDescription(String description)
    • setMultiTarget

      public void setMultiTarget(boolean multiTarget)
    • setCastType

      public void setCastType(CastType castType)
    • getEffects

      public List<Effect> getEffects()
    • internalCalculateImpactArea

      protected Shape internalCalculateImpactArea(double angle)