Class EffectNearBy

java.lang.Object
com.deco2800.game.components.Component
com.deco2800.game.components.npc.EffectNearBy

public class EffectNearBy extends Component
Component that applies affects to enemies tagged with the ENEMY enum type Some affects include regen on enemies, speed buffs and attack/damage buffs
  • Field Details

  • Constructor Details

    • EffectNearBy

      public EffectNearBy(Boolean affectE, Boolean affectP, Boolean affectS)
      Constructor method for effects nearby component. Tells the buff to what to affect
      Parameters:
      affectE - affect enemies?
      affectP - affect players?
      affectS - affect structures?
  • Method Details

    • update

      public void update()
      Every 60 frames/updates run affects such as apply speed, apply regen, apply attack buff etc
      Overrides:
      update in class Component
    • canBeApplied

      public Boolean canBeApplied(EntityClassification.NPCClassification type)
      checks to see if the given type can be affected by buffs
      Parameters:
      type - the type of entity
      Returns:
      true/false if it can be affected by the buff
    • enableSpeed

      public void enableSpeed()
      enable speed buff
    • disableSpeed

      public void disableSpeed()
      disable speed buff
    • enableRegen

      public void enableRegen()
      enable regen buff
    • disableRegen

      public void disableRegen()
      disable regen buff
    • enableAttackDamageBuff

      public void enableAttackDamageBuff()
      enable attack damage buff
    • disableAttackDamageBuff

      public void disableAttackDamageBuff()
      disable attack damage buff