Class PauseTask

All Implemented Interfaces:
PriorityTask, Task

public class PauseTask extends ChaseTask
Pauses near a target entity until they move too far away or out of sight. Extends the ChaseTask to include pausing behavior when in proximity to a target.
  • Constructor Details

    • PauseTask

      public PauseTask(Entity target, int priority, float viewDistance, float maxPauseDistance, boolean isBoss)
      Constructs a new PauseTask that will pause near a target entity.
      Parameters:
      target - The entity to pause when seen.
      priority - Task priority when pausing (0 when not pausing).
      viewDistance - Maximum distance from the entity at which pausing can start.
      maxPauseDistance - Maximum distance from the entity to pause.
  • Method Details

    • start

      public void start()
      Starts the pause behavior
      Specified by:
      start in interface Task
      Overrides:
      start in class ChaseTask
    • triggerPauseEvent

      protected void triggerPauseEvent()
      Triggers an event to start the pause behavior. If the entity has a config component, it fetches the dialogue or hint text associated with the entity to provide context for the pause event.
    • triggerPauseEventEnd

      protected void triggerPauseEventEnd()
      Triggers an event to end the pause behavior.
    • update

      public void update()
      Updates the pause behavior by checking the distance to the target entity and determining whether to approach, pause, or end the pause state.
      Specified by:
      update in interface Task
      Overrides:
      update in class ChaseTask
    • stop

      public void stop()
      Stops the pause behavior
      Specified by:
      stop in interface Task
      Overrides:
      stop in class ChaseTask
    • getPriority

      public int getPriority()
      Returns the priority level of the pause behavior. Determines the priority based on whether the task is currently active or inactive.
      Specified by:
      getPriority in interface PriorityTask
      Overrides:
      getPriority in class ChaseTask
      Returns:
      the priority level of the pause behavior.