Package com.csse3200.game.components
Class EffectsComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.EffectsComponent
This component applies an effect from the ProjectileEffects enum. This consists of fireball, burn,
slow, and stun. Component also handles the targeting of specific layers and an area of effect
application of effects.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionEffectsComponent
(short targetLayer, float radius, ProjectileEffects effect, boolean aoe) Constructor for the AoEComponent. -
Method Summary
Modifier and TypeMethodDescriptionvoid
applyAoeEffect
(ProjectileEffects effect) Used for aoe projectiles to apply effects to all entities within the area of effect (radius).void
applySingleEffect
(ProjectileEffects effect, CombatStatsComponent targetCombatStats, Entity targetEntity) Used for singe targeting projectiles to apply effects entity it collides with.void
create()
Called when the entity is created and registered.Methods inherited from class com.csse3200.game.components.Component
dispose, earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
EffectsComponent
Constructor for the AoEComponent.- Parameters:
radius
- The radius of the area-of-effect.
-
-
Method Details
-
create
public void create()Description copied from class:Component
Called when the entity is created and registered. Initial logic such as calls to GetComponent should be made here, not in the constructor which is called before an entity is finished. -
applySingleEffect
public void applySingleEffect(ProjectileEffects effect, CombatStatsComponent targetCombatStats, Entity targetEntity) Used for singe targeting projectiles to apply effects entity it collides with.- Parameters:
effect
- effect to be applied to entity
-
applyAoeEffect
Used for aoe projectiles to apply effects to all entities within the area of effect (radius).- Parameters:
effect
- effect to be applied to entities within radius
-