Class BombDropTask

java.lang.Object
com.csse3200.game.ai.tasks.DefaultTask
com.csse3200.game.components.tasks.BombDropTask
All Implemented Interfaces:
PriorityTask, Task

public class BombDropTask extends DefaultTask implements PriorityTask
Task that makes drone drop bombs when player is directly below. Higher priority than chase when conditions are met.
  • Constructor Details

    • BombDropTask

      public BombDropTask(Entity target, int priority, float dropRange, float minHeight, float cooldown)
      Create a bomb dropping task.
      Parameters:
      target - player or other entity to attack
      priority - priority to task
      dropRange - max horizontal distance to consider "below"
      minHeight - min vertical different (drone above target) to allow bomb drops
      cooldown - min time between consecutive drops in seconds
  • Method Details

    • getPriority

      public int getPriority()
      Computes scheduling priority
      Specified by:
      getPriority in interface PriorityTask
      Returns:
      priority of the task
    • start

      public void start()
      Start drone attack and trigger a dropStart event on owner entity
      Specified by:
      start in interface Task
      Overrides:
      start in class DefaultTask
    • update

      public void update()
      Advance attack sequence when attack
      Specified by:
      update in interface Task
      Overrides:
      update in class DefaultTask
    • stop

      public void stop()
      Stop attack task
      Specified by:
      stop in interface Task
      Overrides:
      stop in class DefaultTask