diff --git a/source/core/src/main/com/csse3200/game/areas/ForestGameArea.java b/source/core/src/main/com/csse3200/game/areas/ForestGameArea.java index df0b0302b..0006c54f2 100644 --- a/source/core/src/main/com/csse3200/game/areas/ForestGameArea.java +++ b/source/core/src/main/com/csse3200/game/areas/ForestGameArea.java @@ -336,8 +336,8 @@ private void spawnProjectile(Vector2 position, short targetLayer, int space, in private void spawnXenoGrunts() { - GridPoint2 minPos = terrain.getMapBounds(0).sub(1, 5); - GridPoint2 maxPos = terrain.getMapBounds(0).sub(1, 25); + GridPoint2 minPos = terrain.getMapBounds(0).sub(1, 0); + GridPoint2 maxPos = terrain.getMapBounds(0).sub(1, 10); for (int i = 0; i < NUM_GRUNTS; i++) { GridPoint2 randomPos = RandomUtils.random(maxPos, minPos); System.out.println(randomPos); diff --git a/source/core/src/main/com/csse3200/game/components/tasks/MobAttackTask.java b/source/core/src/main/com/csse3200/game/components/tasks/MobAttackTask.java index 9c4b32366..60df50b4a 100644 --- a/source/core/src/main/com/csse3200/game/components/tasks/MobAttackTask.java +++ b/source/core/src/main/com/csse3200/game/components/tasks/MobAttackTask.java @@ -101,18 +101,19 @@ public void updateMobState() { case IDLE -> { if (isTargetVisible()) { // targets detected in idle mode - start deployment - //owner.getEntity().getEvents().trigger(DEPLOY); + owner.getEntity().getEvents().trigger(DEPLOY); mobState = STATE.DEPLOY; } } case DEPLOY -> { // currently deploying, - if (isTargetVisible()) { - //owner.getEntity().getEvents().trigger(FIRING); + if (isTargetVisible() || this.meleeOrProjectile() != null) { + owner.getEntity().getComponent(PhysicsMovementComponent.class).setEnabled(false); + owner.getEntity().getEvents().trigger(FIRING); mobState = STATE.FIRING; } else { - //owner.getEntity().getEvents().trigger(STOW); + owner.getEntity().getEvents().trigger(STOW); mobState = STATE.STOW; } } @@ -139,10 +140,10 @@ public void updateMobState() { case STOW -> { // currently stowing if (isTargetVisible()) { - //owner.getEntity().getEvents().trigger(DEPLOY); + owner.getEntity().getEvents().trigger(DEPLOY); mobState = STATE.DEPLOY; } else { - //owner.getEntity().getEvents().trigger(IDLE); + owner.getEntity().getEvents().trigger(IDLE); mobState = STATE.IDLE; } } @@ -168,7 +169,6 @@ public void stop() { */ @Override public int getPriority() { -// return -1; if (status == Status.ACTIVE) { return getActivePriority(); } @@ -223,8 +223,6 @@ private Weapon meleeOrProjectile() { Weapon chosenWeapon = null; if (comp != null) { chosenWeapon = comp.chooseWeapon(hitraycast); - if (chosenWeapon != null) { - } } return chosenWeapon;