Class BuffSpeedEffect

java.lang.Object
com.csse3200.game.components.collectables.effects.BuffSpeedEffect
All Implemented Interfaces:
ItemEffectHandler

public class BuffSpeedEffect extends Object implements ItemEffectHandler
An item effect that temporarily increases the player's movement speed.
  • Constructor Details

    • BuffSpeedEffect

      public BuffSpeedEffect()
  • Method Details

    • apply

      public boolean apply(Entity player, EffectConfig cfg)
      Applies the speed buff effect to the given player entity.

      Immediately triggers the "toggleAdrenaline" event to activate the speed buff. If cfg.duration is greater than zero, schedules a second trigger after the duration to deactivate the buff.

      Specified by:
      apply in interface ItemEffectHandler
      Parameters:
      player - the entity to receive the effect
      cfg - the effect configuration containing duration and parameters
      Returns:
      true once the effect has been applied