Class BuffSpeedEffect
java.lang.Object
com.csse3200.game.components.collectables.effects.BuffSpeedEffect
- All Implemented Interfaces:
ItemEffectHandler
An item effect that temporarily increases the player's movement speed.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
apply
(Entity player, EffectConfig cfg) Applies the speed buff effect to the given player entity.
-
Constructor Details
-
BuffSpeedEffect
public BuffSpeedEffect()
-
-
Method Details
-
apply
Applies the speed buff effect to the given player entity.Immediately triggers the
"toggleAdrenaline"
event to activate the speed buff. Ifcfg.duration
is greater than zero, schedules a second trigger after the duration to deactivate the buff.- Specified by:
apply
in interfaceItemEffectHandler
- Parameters:
player
- the entity to receive the effectcfg
- the effect configuration containing duration and parameters- Returns:
true
once the effect has been applied
-