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
Represents an effect that modifies an attribute of a combat entity.
-
Nested Class Summary
Nested classes/interfaces inherited from class de.gurkenlabs.litiengine.abilities.effects.Effect
Effect.EffectAppliedListener, Effect.EffectCeasedListener -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAttributeEffect(TargetingStrategy targetingStrategy, Modification modification, double delta) Constructs an AttributeEffect with the specified targeting strategy, modification, and delta.protectedAttributeEffect(TargetingStrategy targetingStrategy, ICombatEntity executingEntity, Modification modification, double delta) Constructs an AttributeEffect with the specified targeting strategy, executing entity, modification, and delta. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapply(ICombatEntity affectedEntity) Applies the effect to the specified entity, adding the attribute modifier.voidcease(ICombatEntity affectedEntity) Ceases the effect on the specified entity, removing the attribute modifier.getAttribute(ICombatEntity entity) Gets the attribute to be modified for the specified entity.Gets the attribute modifier associated with this effect.Methods inherited from class de.gurkenlabs.litiengine.abilities.effects.Effect
apply, cease, getActiveAppliances, getDelay, getDuration, getExecutingEntity, getFollowUpEffects, getTargetingStrategy, getTotalDuration, hasEnded, isActive, onEffectApplied, onEffectCeased, removeEffectAppliedListener, removeEffectCeasedListener, setDelay, setDuration, update
-
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 effectmodification- the type of modification to apply to the attributedelta- 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 effectexecutingEntity- the entity executing the effectmodification- the type of modification to apply to the attributedelta- the value to modify the attribute by
-
-
Method Details
-
cease
Ceases the effect on the specified entity, removing the attribute modifier. -
getModifier
Gets the attribute modifier associated with this effect.- Returns:
- the attribute modifier
-
apply
Applies the effect to the specified entity, adding the attribute modifier. -
getAttribute
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
-