From 416afddd0698ca407760b9a1bf76cd37e5f8b7e9 Mon Sep 17 00:00:00 2001 From: MiniSoda17 Date: Sun, 1 Oct 2023 19:35:42 +1000 Subject: [PATCH 1/7] Better improved the invisible mob bug --- .../csse3200/game/components/tasks/MobMeleeAttackTask.java | 4 ++-- .../csse3200/game/components/tasks/MobRangedAttackTask.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/core/src/main/com/csse3200/game/components/tasks/MobMeleeAttackTask.java b/source/core/src/main/com/csse3200/game/components/tasks/MobMeleeAttackTask.java index 461428870..3ac8c6c3c 100644 --- a/source/core/src/main/com/csse3200/game/components/tasks/MobMeleeAttackTask.java +++ b/source/core/src/main/com/csse3200/game/components/tasks/MobMeleeAttackTask.java @@ -208,7 +208,7 @@ private int getInactivePriority() { * @return true if a target is visible, false otherwise */ private boolean isTargetVisible() { - Vector2 newVector = new Vector2(owner.getEntity().getPosition().x - 10f, owner.getEntity().getPosition().y - 2f); + Vector2 newVector = new Vector2(owner.getEntity().getPosition().x - 100f, owner.getEntity().getPosition().y - 2f); return physics.raycast(owner.getEntity().getPosition(), newVector, TARGET, hit); } @@ -236,7 +236,7 @@ private Weapon meleeOrProjectile() { } private void setTarget() { - Vector2 newVector = new Vector2(owner.getEntity().getPosition().x - 10f, owner.getEntity().getPosition().y - 2f); + Vector2 newVector = new Vector2(owner.getEntity().getPosition().x - 100f, owner.getEntity().getPosition().y - 2f); target = physics.raycastGetHit(owner.getEntity().getPosition(), newVector, TARGET); } } diff --git a/source/core/src/main/com/csse3200/game/components/tasks/MobRangedAttackTask.java b/source/core/src/main/com/csse3200/game/components/tasks/MobRangedAttackTask.java index e3885ae8b..b10dad91f 100644 --- a/source/core/src/main/com/csse3200/game/components/tasks/MobRangedAttackTask.java +++ b/source/core/src/main/com/csse3200/game/components/tasks/MobRangedAttackTask.java @@ -214,7 +214,7 @@ private int getInactivePriority() { * @return true if a target is visible, false otherwise */ private boolean isTargetVisible() { - Vector2 newVector = new Vector2(owner.getEntity().getPosition().x - 10f, owner.getEntity().getPosition().y - 2f); + Vector2 newVector = new Vector2(owner.getEntity().getPosition().x - 100f, owner.getEntity().getPosition().y - 2f); return physics.raycast(owner.getEntity().getPosition(), newVector, TARGET, hit); } @@ -242,7 +242,7 @@ private Weapon meleeOrProjectile() { } private void setTarget() { - Vector2 newVector = new Vector2(owner.getEntity().getPosition().x - 10f, owner.getEntity().getPosition().y - 2f); + Vector2 newVector = new Vector2(owner.getEntity().getPosition().x - 100f, owner.getEntity().getPosition().y - 2f); target = physics.raycastGetHit(owner.getEntity().getPosition(), newVector, TARGET); } } From fab774cf7302655e43672a5c7161bbb3be9412eb Mon Sep 17 00:00:00 2001 From: cindyle1 Date: Mon, 2 Oct 2023 11:36:32 +1000 Subject: [PATCH 2/7] Fixed animations for ice baby on death --- .../src/main/com/csse3200/game/areas/ForestGameArea.java | 5 +++-- .../csse3200/game/components/tasks/bosstask/IceBabyTask.java | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) 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 3b99a5b86..1096f3e7a 100644 --- a/source/core/src/main/com/csse3200/game/areas/ForestGameArea.java +++ b/source/core/src/main/com/csse3200/game/areas/ForestGameArea.java @@ -217,9 +217,8 @@ private void spawnWave() { case 2: spawnWaterQueen(); spawnWaterSlime(); - spawnIceBaby(); logger.info("Lol"); - + break; case 3: logger.info("Lol"); @@ -236,6 +235,8 @@ private void spawnWave() { break; case 5: spawnDemonBoss(); + case 6: + spawnIceBaby(); default: // Handle other wave scenarios if needed break; diff --git a/source/core/src/main/com/csse3200/game/components/tasks/bosstask/IceBabyTask.java b/source/core/src/main/com/csse3200/game/components/tasks/bosstask/IceBabyTask.java index 78599c6da..596d245e2 100644 --- a/source/core/src/main/com/csse3200/game/components/tasks/bosstask/IceBabyTask.java +++ b/source/core/src/main/com/csse3200/game/components/tasks/bosstask/IceBabyTask.java @@ -124,7 +124,10 @@ public void update() { } if (health <= 0) { changeState(STATE.DEATH); - iceBaby.setFlagForDelete(true); + animate(); + if (animation.isFinished()) { + iceBaby.setFlagForDelete(true); + } } switch (iceBabyState) { From 9b59e921895d3e424475ba5a0e2238622bafed34 Mon Sep 17 00:00:00 2001 From: freshc0w <121275444+freshc0w@users.noreply.github.com> Date: Mon, 2 Oct 2023 23:50:21 +1000 Subject: [PATCH 3/7] Fix demon boss task bug after losing screen with projectiles --- .../game/components/tasks/bosstask/DemonBossTask.java | 9 +++++++++ 1 file changed, 9 insertions(+) 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 e9fc0e514..6349e51ab 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 @@ -123,6 +123,10 @@ public void run() { */ @Override public void update() { + // * Don't know if this is actually needed. + if(ServiceLocator.getGameEndService().hasGameEnded()) { + stop(); + } // give game time to load in then start if (!startFlag) { return; @@ -381,6 +385,11 @@ private void fireBreath() { Timer.schedule(new Timer.Task() { @Override public void run() { + // service locator getting a service could be anything here. + if(ServiceLocator.getTimeSource() == null) { + stop(); + return; // prevent current iteration from running. + } Entity projectile = ProjectileFactory.createEffectProjectile(PhysicsLayer.HUMANS, destination, new Vector2(2, 2), effect, aoe); projectile.setPosition(demon.getPosition().x, demon.getPosition().y); From 8250a2571f16ebe71184d14fdef3bd8acb8f6a6e Mon Sep 17 00:00:00 2001 From: MiniSoda17 Date: Tue, 3 Oct 2023 09:48:09 +1000 Subject: [PATCH 4/7] Added back demon boss --- .../main/com/csse3200/game/entities/factories/WaveFactory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/core/src/main/com/csse3200/game/entities/factories/WaveFactory.java b/source/core/src/main/com/csse3200/game/entities/factories/WaveFactory.java index c0fe2af57..eaf4e4a59 100644 --- a/source/core/src/main/com/csse3200/game/entities/factories/WaveFactory.java +++ b/source/core/src/main/com/csse3200/game/entities/factories/WaveFactory.java @@ -25,7 +25,7 @@ public static Entity createWaves() { mobs.put("WaterQueen", 3); mobs.put("FireWorm", 3); mobs.put("Skeleton", 3); - // mobs.put("DemonBoss", 1); + mobs.put("DemonBoss", 1); mobs.put("PatrickBoss", 1); mobs.put("IceBoss", 1); HashMap mobs2 = new HashMap<>(); From 3e9ae87435620ede4ce8469a0af6b84b0f99a519 Mon Sep 17 00:00:00 2001 From: MiniSoda17 Date: Tue, 3 Oct 2023 11:11:59 +1000 Subject: [PATCH 5/7] Readded demon boss within wave factory after fixing bugs --- .../com/csse3200/game/entities/factories/WaveFactory.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/core/src/main/com/csse3200/game/entities/factories/WaveFactory.java b/source/core/src/main/com/csse3200/game/entities/factories/WaveFactory.java index 23c76f4eb..c3376095d 100644 --- a/source/core/src/main/com/csse3200/game/entities/factories/WaveFactory.java +++ b/source/core/src/main/com/csse3200/game/entities/factories/WaveFactory.java @@ -97,9 +97,9 @@ public static LevelWaves createLevel(int maxDiff, int maxWaves, int chosenLevel) String boss1 = "IceBoss"; // String boss1 = "PatrickBoss"; String boss2 = "PatrickBoss"; - String boss3 = "IceBoss"; + // String boss3 = "IceBoss"; //TODO change this to a fire boss in sprint 4 -// String boss3 = "FireBoss"; + String boss3 = "FireBoss"; LevelWaves level = new LevelWaves(5); ArrayList possibleMobs; From fadbb691c97955ec4bf676242f6478aafc28b740 Mon Sep 17 00:00:00 2001 From: MiniSoda17 Date: Tue, 3 Oct 2023 11:25:07 +1000 Subject: [PATCH 6/7] Fixed wave factory test with fire boss --- .../com/csse3200/game/entities/factories/WaveFactoryTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/core/src/test/com/csse3200/game/entities/factories/WaveFactoryTest.java b/source/core/src/test/com/csse3200/game/entities/factories/WaveFactoryTest.java index a5f666ff4..8e43b601e 100644 --- a/source/core/src/test/com/csse3200/game/entities/factories/WaveFactoryTest.java +++ b/source/core/src/test/com/csse3200/game/entities/factories/WaveFactoryTest.java @@ -59,7 +59,7 @@ class WaveFactoryTest { private final int LVL3_WAVES = 15; private final int LVL3_CHOSEN_LVL = 2; private final ArrayList LVL3_MOBS = new ArrayList<>(Arrays.asList("Xeno", "DodgingDragon", "FireWorm")); - private final String LVL3_BOSS = "IceBoss"; + private final String LVL3_BOSS = "FireBoss"; // private final String LVL3_BOSS = "FireBoss"; //TODO: make this a fire boss in sprint 4 From f9f5aa6d589fc8abcd353ebacad5d324a57ac4b1 Mon Sep 17 00:00:00 2001 From: gregchan550 Date: Tue, 3 Oct 2023 11:30:01 +1000 Subject: [PATCH 7/7] fixed patrick melee attack null target bug --- .../csse3200/game/components/tasks/bosstask/PatrickTask.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/core/src/main/com/csse3200/game/components/tasks/bosstask/PatrickTask.java b/source/core/src/main/com/csse3200/game/components/tasks/bosstask/PatrickTask.java index 9e41941dd..ee06a9d44 100644 --- a/source/core/src/main/com/csse3200/game/components/tasks/bosstask/PatrickTask.java +++ b/source/core/src/main/com/csse3200/game/components/tasks/bosstask/PatrickTask.java @@ -251,6 +251,10 @@ private void meleeAttack() { initialPos = patrick.getPosition(); meleeTarget = ServiceLocator.getEntityService().getClosestEntityOfLayer( patrick, PhysicsLayer.HUMANS); + // check if melee target exists + if (meleeTarget == null) { + return; + } teleport(meleeTarget.getPosition()); meleeFlag = true; }