Class BombDropTask
java.lang.Object
com.csse3200.game.ai.tasks.DefaultTask
com.csse3200.game.components.tasks.BombDropTask
- All Implemented Interfaces:
PriorityTask
,Task
Task that makes drone drop bombs when player is directly below.
Higher priority than chase when conditions are met.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.csse3200.game.ai.tasks.Task
Task.Status
-
Field Summary
Fields inherited from class com.csse3200.game.ai.tasks.DefaultTask
owner, status
-
Constructor Summary
ConstructorsConstructorDescriptionBombDropTask
(Entity target, int priority, float dropRange, float minHeight, float cooldown) Create a bomb dropping task. -
Method Summary
Methods inherited from class com.csse3200.game.ai.tasks.DefaultTask
create, getStatus
-
Constructor Details
-
BombDropTask
Create a bomb dropping task.- Parameters:
target
- player or other entity to attackpriority
- priority to taskdropRange
- max horizontal distance to consider "below"minHeight
- min vertical different (drone above target) to allow bomb dropscooldown
- min time between consecutive drops in seconds
-
-
Method Details
-
getPriority
public int getPriority()Computes scheduling priority- Specified by:
getPriority
in interfacePriorityTask
- Returns:
- priority of the task
-
start
public void start()Start drone attack and trigger a dropStart event on owner entity- Specified by:
start
in interfaceTask
- Overrides:
start
in classDefaultTask
-
update
public void update()Advance attack sequence when attack- Specified by:
update
in interfaceTask
- Overrides:
update
in classDefaultTask
-
stop
public void stop()Stop attack task- Specified by:
stop
in interfaceTask
- Overrides:
stop
in classDefaultTask
-