Class EffectsComponent

java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.EffectsComponent

public class EffectsComponent extends Component
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.
  • Constructor Details

    • EffectsComponent

      public EffectsComponent(short targetLayer, float radius, ProjectileEffects effect, boolean aoe)
      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.
      Overrides:
      create in class Component
    • 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

      public void applyAoeEffect(ProjectileEffects effect)
      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