Package com.deco2800.game.components.npc
Class EffectNearBy
java.lang.Object
com.deco2800.game.components.Component
com.deco2800.game.components.npc.EffectNearBy
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 Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
ConstructorsConstructorDescriptionEffectNearBy
(Boolean affectE, Boolean affectP, Boolean affectS) Constructor method for effects nearby component. -
Method Summary
Modifier and TypeMethodDescriptionchecks to see if the given type can be affected by buffsvoid
disable attack damage buffvoid
disable regen buffvoid
disable speed buffvoid
enable attack damage buffvoid
enable regen buffvoid
enable speed buffvoid
update()
Every 60 frames/updates run affects such as apply speed, apply regen, apply attack buff etcMethods inherited from class com.deco2800.game.components.Component
create, dispose, earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate
-
Field Details
-
destroyed
-
underSpeedAffect
-
underAttackBuff
-
-
Constructor Details
-
EffectNearBy
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 -
canBeApplied
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
-