Class Effect
java.lang.Object
de.gurkenlabs.litiengine.abilities.effects.Effect
- All Implemented Interfaces:
IUpdateable
- Direct Known Subclasses:
AttributeEffect,ForceEffect,SoundEffect
The Class Effect seeks for affected entities in the game's current environment to apply certain
effects to them defined by the overwritten implementation of apply/cease.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interface -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapply(ICombatEntity entity) voidApplies the effect in the specified impact area on the specified environment.protected booleancanAffectEntity(ICombatEntity entity) protected voidcease(EffectApplication appliance) voidcease(ICombatEntity entity) protected booleancustomTarget(ICombatEntity entity) Overwrite this method to implement a custom target predicate that determines whether an entity can be affected by this effect.intgetDelay()intprotected Collection<ICombatEntity> getEntitiesInImpactArea(Shape impactArea) protected longprotected booleanhasEnded(EffectApplication appliance) booleanisActive(ICombatEntity entity) protected booleanisAliveFriendlyEntity(ICombatEntity entity) protected booleanisDeadFriendlyEntity(ICombatEntity entity) protected List<ICombatEntity> lookForAffectedEntities(Shape impactArea) voidonEffectApplied(Effect.EffectAppliedListener listener) voidonEffectCeased(Effect.EffectCeasedListener listener) voidvoidvoidsetDelay(int delay) voidsetDuration(int duration) voidsetTargetPriorityComparator(RelativeEntityComparator targetPriorityComparator) voidupdate()1.
-
Constructor Details
-
Effect
-
-
Method Details
-
onEffectApplied
-
removeEffectAppliedListener
-
onEffectCeased
-
removeEffectCeasedListener
-
apply
Applies the effect in the specified impact area on the specified environment.- Parameters:
impactArea- The impact area
-
cease
-
getAbility
-
getActiveAppliances
-
getDelay
public int getDelay() -
getDuration
public int getDuration() -
getEffectTargets
-
getFollowUpEffects
-
getTargetPriorityComparator
-
isActive
-
setDelay
public void setDelay(int delay) -
setDuration
public void setDuration(int duration) -
setTargetPriorityComparator
-
update
public void update()1. Cease the effect after its duration. 2. apply all follow-up effects 3. remove appliance 4. unregister from loop if all appliances are done- Specified by:
updatein interfaceIUpdateable- See Also:
-
apply
-
cease
-
getEntitiesInImpactArea
-
getTotalDuration
protected long getTotalDuration() -
hasEnded
-
lookForAffectedEntities
-
customTarget
Overwrite this method to implement a custom target predicate that determines whether an entity can be affected by this effect. The targets of this effect need to include theCUSTOMvalue in order for this function to be evaluated.- Parameters:
entity- The entity to check against the custom target predicate.- Returns:
- True if the entity can be affected by this effect; otherwise false.
- See Also:
-
canAffectEntity
-
isAliveFriendlyEntity
-
isDeadFriendlyEntity
-