Class BombshipCombatTask
java.lang.Object
com.csse3200.game.ai.tasks.DefaultTask
com.csse3200.game.components.tasks.bombship.BombshipCombatTask
- All Implemented Interfaces:
PriorityTask,Task
The AI Task for the Engineer entity. The Engineer will scan for targets within its detection range
and trigger events to change its state accordingly. This task must be called once the Engineer has
appropiately moved into position.
-
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintSimplified getPriority function, returns the priority of the taskbooleanUses a raycast to determine whether there are any targets in detection range.voidstart()Runs the task and triggers Bombship's idle animation.voidstop()For stopping the running taskvoidupdate()The update method is what is run every time the TaskRunner in the AiTaskComponent calls update().voidBombship state machineMethods inherited from class com.csse3200.game.ai.tasks.DefaultTask
create, getStatus
-
Constructor Details
-
BombshipCombatTask
public BombshipCombatTask(float maxRange)
-
-
Method Details
-
start
public void start()Runs the task and triggers Bombship's idle animation.- Specified by:
startin interfaceTask- Overrides:
startin classDefaultTask
-
update
public void update()The update method is what is run every time the TaskRunner in the AiTaskComponent calls update(). triggers events depending on the presence or otherwise of targets in the detection range- Specified by:
updatein interfaceTask- Overrides:
updatein classDefaultTask
-
updateBombshipState
public void updateBombshipState()Bombship state machine -
stop
public void stop()For stopping the running task- Specified by:
stopin interfaceTask- Overrides:
stopin classDefaultTask
-
getPriority
public int getPriority()Simplified getPriority function, returns the priority of the task- Specified by:
getPriorityin interfacePriorityTask- Returns:
- priority as an integer value. If mobs are visible, return the current priority, otherwise return 0.
-
isEngineerDied
public boolean isEngineerDied()Uses a raycast to determine whether there are any targets in detection range. Performs multiple raycasts to a range of points at x = engineer.x + maxRange, and a range of y values above and below current y position. Allows the bombship entity to detect mobs in adjacent lanes.- Returns:
- true if a target is detected, false otherwise
-