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
-
Nested Class Summary
Nested classes/interfaces inherited from class Effect
Effect.EffectAppliedListener, Effect.EffectCeasedListener -
Field Summary
Fields inherited from interface IUpdateable
DEFAULT_UPDATE_PRIORITY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAttributeEffect(TargetingStrategy targetingStrategy, Modification modification, double delta) Constructs an AttributeEffect with the specified targeting strategy, modification, and delta.protectedAttributeEffect(TargetingStrategy targetingStrategy, Modification modification, double delta, int duration) 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.protectedAttributeEffect(TargetingStrategy targetingStrategy, ICombatEntity executingEntity, Modification modification, double delta, int duration) 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 Effect
apply, cease, getActiveAppliances, getDelay, getDuration, getExecutingEntity, getFollowUpEffects, getTargetingStrategy, getTotalDuration, hasEnded, isActive, onEffectApplied, onEffectCeased, removeEffectAppliedListener, removeEffectCeasedListener, setDelay, setDuration, updateMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IUpdateable
getUpdatePriority
-
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, Modification modification, double delta, int duration) 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 byduration- the duration of the effect in milliseconds
-
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
-
AttributeEffect
protected AttributeEffect(TargetingStrategy targetingStrategy, ICombatEntity executingEntity, Modification modification, double delta, int duration) 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 byduration- the duration of the effect in milliseconds
-
-
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
-