Class AttributeEffect<T extends Number>

java.lang.Object
de.gurkenlabs.litiengine.abilities.effects.Effect
de.gurkenlabs.litiengine.abilities.effects.AttributeEffect<T>
Type Parameters:
T - the type of the attribute value
All Implemented Interfaces:
IUpdateable

public abstract class AttributeEffect<T extends Number> extends Effect
Represents an effect that modifies an attribute of a combat entity.
  • Constructor Details

    • AttributeEffect

      protected AttributeEffect(TargetingStrategy targetingStrategy, Modification modification, double delta)
      Constructs an AttributeEffect with the specified targeting strategy, modification, and delta.
      Parameters:
      targetingStrategy - the strategy to determine the targets of the effect
      modification - the type of modification to apply to the attribute
      delta - the value to modify the attribute by
    • AttributeEffect

      protected AttributeEffect(TargetingStrategy targetingStrategy, ICombatEntity executingEntity, Modification modification, double delta)
      Constructs an AttributeEffect with the specified targeting strategy, executing entity, modification, and delta.
      Parameters:
      targetingStrategy - the strategy to determine the targets of the effect
      executingEntity - the entity executing the effect
      modification - the type of modification to apply to the attribute
      delta - the value to modify the attribute by
  • Method Details

    • cease

      public void cease(ICombatEntity affectedEntity)
      Ceases the effect on the specified entity, removing the attribute modifier.
      Overrides:
      cease in class Effect
      Parameters:
      affectedEntity - the entity affected by the effect
    • getModifier

      public AttributeModifier<T> getModifier()
      Gets the attribute modifier associated with this effect.
      Returns:
      the attribute modifier
    • apply

      protected void apply(ICombatEntity affectedEntity)
      Applies the effect to the specified entity, adding the attribute modifier.
      Overrides:
      apply in class Effect
      Parameters:
      affectedEntity - the entity affected by the effect
    • getAttribute

      protected abstract Attribute<T> getAttribute(ICombatEntity entity)
      Gets the attribute to be modified for the specified entity.
      Parameters:
      entity - the entity whose attribute is to be modified
      Returns:
      the attribute to be modified