Skip to content

Commit

Permalink
commtiing small comment changes because I'm about to push
Browse files Browse the repository at this point in the history
  • Loading branch information
gregchan550 committed Sep 22, 2023
1 parent 6168360 commit 33aafbf
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}

Expand All @@ -157,6 +154,7 @@ public void update() {
halfHealthFlag = true;
}

// detect sequence changes and run accordingly
switch (state) {
case IDLE -> jump(getJumpPos());
case SMASH -> {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 33aafbf

Please sign in to comment.