From 33aafbffd63b82d734a98c77b81919bfb5351c96 Mon Sep 17 00:00:00 2001 From: gregchan550 Date: Fri, 22 Sep 2023 10:41:42 +1000 Subject: [PATCH] commtiing small comment changes because I'm about to push --- .../game/components/tasks/bosstask/DemonBossTask.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/source/core/src/main/com/csse3200/game/components/tasks/bosstask/DemonBossTask.java b/source/core/src/main/com/csse3200/game/components/tasks/bosstask/DemonBossTask.java index 9008346cd..267e8611e 100644 --- a/source/core/src/main/com/csse3200/game/components/tasks/bosstask/DemonBossTask.java +++ b/source/core/src/main/com/csse3200/game/components/tasks/bosstask/DemonBossTask.java @@ -9,7 +9,6 @@ import com.csse3200.game.components.CombatStatsComponent; import com.csse3200.game.components.ProjectileEffects; import com.csse3200.game.components.tasks.MovementTask; -import com.csse3200.game.components.tasks.human.HumanWaitTask; import com.csse3200.game.entities.Entity; import com.csse3200.game.entities.factories.ProjectileFactory; import com.csse3200.game.physics.PhysicsEngine; @@ -64,9 +63,7 @@ public class DemonBossTask extends DefaultTask implements PriorityTask { private ProjectileEffects effect = ProjectileEffects.BURN; private boolean aoe = true; private boolean slimeFlag = false; - private HumanWaitTask waitTask; private boolean startFlag = false; - private MovementTask slimeMovementTask; private boolean moving = false; private int health; private boolean halfHealthFlag = false; @@ -141,12 +138,12 @@ public void update() { changeState(DemonState.IDLE); // start sequence } - // detect death stage + // detect death stages if (health <= 0 && !slimeFlag) { slimeFlag = true; changeState(DemonState.TRANSFORM_REVERSE); demon.getComponent(CombatStatsComponent.class).addHealth(500); - } else if (health <= 0 && slimeFlag) { + } else if (health <= 0) { changeState(DemonState.TRANSFORM); } @@ -157,6 +154,7 @@ public void update() { halfHealthFlag = true; } + // detect sequence changes and run accordingly switch (state) { case IDLE -> jump(getJumpPos()); case SMASH -> { @@ -448,7 +446,7 @@ public void run() { */ private void seekAndDestroy() { Entity targetEntity = getClosestHuman(getNearbyHumans(20)); - slimeMovementTask = new MovementTask(targetEntity.getPosition()); + MovementTask slimeMovementTask = new MovementTask(targetEntity.getPosition()); slimeMovementTask.create(owner); slimeMovementTask.start(); demon.getComponent(PhysicsMovementComponent.class).setSpeed(SLIME_SPEED);