diff --git a/source/core/assets/images/mobs/skeleton.atlas b/source/core/assets/images/mobs/skeleton.atlas index f0117d879..9e1c78e17 100644 --- a/source/core/assets/images/mobs/skeleton.atlas +++ b/source/core/assets/images/mobs/skeleton.atlas @@ -69,7 +69,7 @@ skeleton_attack index: -1 skeleton_attack rotate: false - xy: 514, 2 + xy: 578, 52 size: 62, 48 orig: 62, 48 offset: 0, 0 @@ -83,7 +83,7 @@ skeleton_attack index: -1 skeleton_attack rotate: false - xy: 770, 2 + xy: 834, 52 size: 62, 48 orig: 62, 48 offset: 0, 0 @@ -95,41 +95,6 @@ skeleton_attack orig: 62, 48 offset: 0, 0 index: -1 -skeleton_death - rotate: false - xy: 1026, 2 - size: 62, 48 - orig: 62, 48 - offset: 0, 0 - index: -1 -skeleton_death - rotate: false - xy: 66, 52 - size: 62, 48 - orig: 62, 48 - offset: 0, 0 - index: -1 -skeleton_death - rotate: false - xy: 834, 52 - size: 62, 48 - orig: 62, 48 - offset: 0, 0 - index: -1 -skeleton_death - rotate: false - xy: 1154, 55 - size: 62, 45 - orig: 62, 45 - offset: 0, 0 - index: -1 -skeleton_death - rotate: false - xy: 578, 2 - size: 62, 48 - orig: 62, 48 - offset: 0, 0 - index: -1 skeleton_death rotate: false xy: 194, 52 @@ -188,7 +153,7 @@ skeleton_walk index: -1 skeleton_walk rotate: false - xy: 514, 52 + xy: 514, 2 size: 62, 48 orig: 62, 48 offset: 0, 0 @@ -202,7 +167,7 @@ skeleton_walk index: -1 skeleton_walk rotate: false - xy: 770, 52 + xy: 770, 2 size: 62, 48 orig: 62, 48 offset: 0, 0 @@ -237,21 +202,21 @@ skeleton_walk index: -1 skeleton_walk rotate: false - xy: 578, 52 + xy: 514, 52 size: 62, 48 orig: 62, 48 offset: 0, 0 index: -1 skeleton_walk rotate: false - xy: 130, 2 + xy: 66, 52 size: 62, 48 orig: 62, 48 offset: 0, 0 index: -1 skeleton_walk rotate: false - xy: 834, 2 + xy: 770, 52 size: 62, 48 orig: 62, 48 offset: 0, 0 diff --git a/source/core/assets/images/mobs/skeleton.png b/source/core/assets/images/mobs/skeleton.png index cbcbd1ed1..9d75bb066 100644 Binary files a/source/core/assets/images/mobs/skeleton.png and b/source/core/assets/images/mobs/skeleton.png differ 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 8fccaf74b..1d5327884 100644 --- a/source/core/src/main/com/csse3200/game/areas/ForestGameArea.java +++ b/source/core/src/main/com/csse3200/game/areas/ForestGameArea.java @@ -263,30 +263,9 @@ public void create() { waves = WaveFactory.createWaves(); spawnEntity(waves); waves.getEvents().addListener("spawnWave", this::spawnMob); - // spawnCoat(); -// spawnDodgingDragonKnight(17,4); -// spawnDeflectWizard(17, 3); -// spawnSplittingXenoGrunt(17, 2); -// spawnPatrick(); -// spawnDemonBoss(); - // spawnSplittingRocky(17, 4); - // spawnFireWizard(17, 3); - // spawnNecromancer(17, 2); - - - spawnScrap(); spawnGapScanners(); - -// spawnTNTTower(); -// spawnWeaponTower(); -// spawnGapScanners(); -// spawnDroidTower(); -// spawnFireWorksTower(); // Commented these out until they are needed for Demonstration -// spawnPierceTower(); -// spawnRicochetTower(); -// spawnBombship(); } private void displayUI() { @@ -344,90 +323,6 @@ private Entity spawnPlayer(GridPoint2 position) { return newPlayer; } - // commented 383 - 386 out as there was a missing arg? - private void spawnDemonBoss() { - Entity demon = MobBossFactory.createDemonBoss(5000); - spawnEntityAt(demon, new GridPoint2(19, 5), true, false); - } - - private void spawnPatrick() { - Entity patrick = MobBossFactory.createPatrickBoss(3000); - spawnEntityAt(patrick, new GridPoint2(18, 5), true, false); - } - - private void spawnPatrickDeath() { - Entity patrickDeath = MobBossFactory.patrickDead(); - spawnEntityAt(patrickDeath, new GridPoint2(18, 5), true, false); - } - // commented 398 - 401 out as there was a missing arg? -// private void spawnIceBaby() { -// Entity iceBaby = MobBossFactory.createIceBoss(); -// spawnEntityAt(iceBaby, new GridPoint2(19, 5), true, false); -// } - -// private void spawnDemonBoss() { -// Entity demon = MobBossFactory.createDemonBoss(); -// spawnEntityAt(demon, new GridPoint2(19, 5), true, false); -// } - -// private void spawnPatrick() { -// Entity patrick = MobBossFactory.createPatrickBoss(3000); -// spawnEntityAt(patrick, new GridPoint2(18, 5), true, false); -// } -// -// private void spawnPatrickDeath() { -// Entity patrickDeath = MobBossFactory.patrickDead(); -// spawnEntityAt(patrickDeath, new GridPoint2(18, 5), true, false); -// } -// -// private void spawnIceBaby() { -// Entity iceBaby = MobBossFactory.createIceBoss(); -// spawnEntityAt(iceBaby, new GridPoint2(19, 5), true, false); -// } - - /** - * Spawns a projectile that only heads towards the enemies in its lane. - * - * @param position The position of the Entity that's shooting the projectile. - * @param targetLayer The enemy layer of the "shooter". - * @param direction The direction the projectile should head towards. - * @param speed The speed of the projectiles. - */ - private void spawnProjectile(Vector2 position, short targetLayer, int direction, Vector2 speed) { - Entity Projectile = ProjectileFactory.createFireBall(targetLayer, new Vector2(direction, position.y), speed); - Projectile.setPosition(position); - spawnEntity(Projectile); - } - - /** - * Spawns a projectile specifically for general mobs/xenohunters - * - * @param position The position of the Entity that's shooting the projectile. - * @param targetLayer The enemy layer of the "shooter". - * @param direction The direction the projectile should head towards. - * @param speed The speed of the projectiles. - */ - private void spawnProjectileTest(Vector2 position, short targetLayer, int direction, Vector2 speed) { - Entity Projectile = ProjectileFactory.createEngineerBullet(targetLayer, new Vector2(direction, position.y), speed); - Projectile.setPosition(position); - spawnEntity(Projectile); - } - - /** - * Spawns a projectile to be used for multiple projectile function. - * - * @param position The position of the Entity that's shooting the projectile. - * @param targetLayer The enemy layer of the "shooter". - * @param space The space between the projectiles' destination. - * @param direction The direction the projectile should head towards. - * @param speed The speed of the projectiles. - */ - private void spawnProjectile(Vector2 position, short targetLayer, int space, int direction, Vector2 speed) { - Entity Projectile = ProjectileFactory.createFireBall(targetLayer, new Vector2(direction, position.y + space), speed); - Projectile.setPosition(position); - spawnEntity(Projectile); - } - /** * Spawn an entity on the map. Is called during a wave. Add cases here for each mob type * @param entity mob to be spawned @@ -449,7 +344,7 @@ public void spawnMob(String entity, GridPoint2 randomPos, int health) { case "Skeleton": mob = NPCFactory.createSkeleton(health); break; - case "DeflectWizard": + case "Wizard": mob = NPCFactory.createWizard(health); break; case "WaterQueen": @@ -499,301 +394,6 @@ public void spawnMob(String entity, GridPoint2 randomPos, int health) { spawnEntityAt(mob, randomPos, true, false); } - // * TEMPORARY FOR TESTING -// private void spawnSplittingXenoGrunt(int x, int y) { -// GridPoint2 pos = new GridPoint2(x, y); -// Entity xenoGrunt = NPCFactory.createSplittingXenoGrunt(); -// xenoGrunt.setScale(1.5f, 1.5f); -// spawnEntityAt(xenoGrunt, pos, true, true); -// } - // * TEMPORARY FOR TESTING - private void spawnSplittingRocky(int x, int y) { - GridPoint2 pos = new GridPoint2(x, y); - Entity rocky = NPCFactory.createSplittingRocky(60); - rocky.setScale(1.5f, 1.5f); - spawnEntityAt(rocky, pos, true, true); - } - - private void spawnFireWizard(int x, int y) { - GridPoint2 pos = new GridPoint2(x, y); - Entity firewiz = NPCFactory.createDeflectFireWizard(60); - firewiz.setScale(1.5f, 1.5f); - spawnEntityAt(firewiz, pos, true, true); - } - - private void spawnNecromancer(int x, int y) { - GridPoint2 pos = new GridPoint2(x, y); - Entity Necromancer = NPCFactory.createNecromancer(60); - Necromancer.setScale(1.5f, 1.5f); - spawnEntityAt(Necromancer, pos, true, true); - } - - // * TEMPORARY FOR TESTING -// private void spawnDodgingDragonKnight(int x, int y) { -// GridPoint2 pos = new GridPoint2(x, y); -// Entity fireworm = NPCFactory.createDodgingDragonKnight(); -// fireworm.setScale(1.5f, 1.5f); -// spawnEntityAt(fireworm, pos, true, true); -// } -// -// // * TEMPORARY FOR TESTING -// private void spawnDeflectXenoGrunt(int x, int y) { -// GridPoint2 pos = new GridPoint2(x, y); -// Entity xenoGrunt = NPCFactory.createDeflectXenoGrunt(); -// xenoGrunt.setScale(1.5f, 1.5f); -// spawnEntityAt(xenoGrunt, pos, true, true); -// } -// -// private void spawnFireWorm() { -// int[] pickedLanes = random.ints(1, 7) -// .distinct().limit(5).toArray(); -// for (int i = 0; i < NUM_GRUNTS; i++) { -// GridPoint2 randomPos = new GridPoint2(19, pickedLanes[i]); -// Entity fireWorm = NPCFactory.createFireWorm(); -// fireWorm.setScale(1.5f, 1.5f); -// spawnEntityAt(fireWorm, randomPos, true, false); -// } -// } -// -// private void spawnSkeleton() { -// int[] pickedLanes = new Random().ints(1, 7) -// .distinct().limit(5).toArray(); -// for (int i = 0; i < NUM_GRUNTS; i++) { -// GridPoint2 randomPos = new GridPoint2(19, pickedLanes[i]); -// Entity skeleton = NPCFactory.createSkeleton(); -// skeleton.setScale(1.5f, 1.5f); -// spawnEntityAt(skeleton, randomPos, true, false); -// } -// } - -// private void spawnDragonKnight() { -// int[] pickedLanes = random.ints(1, 7) -// .distinct().limit(5).toArray(); -// for (int i = 0; i < NUM_GRUNTS; i++) { -// GridPoint2 randomPos = new GridPoint2(19, pickedLanes[i]); -// Entity fireWorm = NPCFactory.createDragonKnight(); -// fireWorm.setScale(1.5f, 1.5f); -// spawnEntityAt(fireWorm, randomPos, true, false); -// } -// } -// -// private void spawnWizard() { -// int[] pickedLanes = new Random().ints(1, 7) -// .distinct().limit(5).toArray(); -// for (int i = 0; i < NUM_GRUNTS; i++) { -// GridPoint2 randomPos = new GridPoint2(19, pickedLanes[i]); -// Entity wizard = NPCFactory.createWizard(); -// wizard.setScale(1.5f, 1.5f); -// spawnEntityAt(wizard, randomPos, true, false); -// } -// } -// -// private void spawnWaterQueen() { -// int[] pickedLanes = new Random().ints(1, 7) -// .distinct().limit(5).toArray(); -// for (int i = 0; i < NUM_GRUNTS; i++) { -// GridPoint2 randomPos = new GridPoint2(19, pickedLanes[i]); -// Entity waterQueen = NPCFactory.createWaterQueen(); -// waterQueen.setScale(1.5f, 1.5f); -// spawnEntityAt(waterQueen, randomPos, true, false); -// } -// } -// -// private void spawnWaterSlime() { -// int[] pickedLanes = new Random().ints(1, 7) -// .distinct().limit(5).toArray(); -// for (int i = 0; i < NUM_GRUNTS; i++) { -// GridPoint2 randomPos = new GridPoint2(19, pickedLanes[i]); -// Entity waterSlime = NPCFactory.createWaterSlime(); -// waterSlime.setScale(1.5f, 1.5f); -// spawnEntityAt(waterSlime, randomPos, true, false); -// } -// } - - // * TEMPORARY FOR TESTING - private void spawnDodgingDragonKnight(int x, int y) { - GridPoint2 pos = new GridPoint2(x, y); - Entity fireworm = NPCFactory.createDodgingDragonKnight(100); - fireworm.setScale(1.5f, 1.5f); - spawnEntityAt(fireworm, pos, true, true); - } -// -// // * TEMPORARY FOR TESTING - private void spawnDeflectWizard(int x, int y) { - GridPoint2 pos = new GridPoint2(x, y); - Entity xenoGrunt = NPCFactory.createDeflectWizard(100); - xenoGrunt.setScale(1.5f, 1.5f); - spawnEntityAt(xenoGrunt, pos, true, true); - } -// -// private void spawnFireWorm() { -// -// int[] pickedLanes = rand.ints(0, ServiceLocator.getMapService().getHeight() ) -// -// .distinct().limit(5).toArray(); -// for (int i = 0; i < NUM_GRUNTS; i++) { -// GridPoint2 randomPos = new GridPoint2(19, pickedLanes[i]); -// Entity fireWorm = NPCFactory.createFireWorm(); -// fireWorm.setScale(1.5f, 1.5f); -// spawnEntityAt(fireWorm, randomPos, true, false); -// } -// } -// -// private void spawnSkeleton() { -// -// int[] pickedLanes = new Random().ints(0, ServiceLocator.getMapService().getHeight() ) -// .distinct().limit(5).toArray(); -// for (int i = 0; i < NUM_GRUNTS; i++) { -// GridPoint2 randomPos = new GridPoint2(19, pickedLanes[i]); -// Entity skeleton = NPCFactory.createSkeleton(); -// skeleton.setScale(1.5f, 1.5f); -// spawnEntityAt(skeleton, randomPos, true, false); -// } -// } -// -// private void spawnDragonKnight() { -// -// int[] pickedLanes = rand.ints(0, ServiceLocator.getMapService().getHeight() ) -// -// .distinct().limit(5).toArray(); -// for (int i = 0; i < NUM_GRUNTS; i++) { -// GridPoint2 randomPos = new GridPoint2(19, pickedLanes[i]); -// Entity fireWorm = NPCFactory.createDodgingDragonKnight(); -// fireWorm.setScale(1.5f, 1.5f); -// spawnEntityAt(fireWorm, randomPos, true, false); -// } -// } -// -// private void spawnWizard() { -// -// int[] pickedLanes = rand.ints(0, ServiceLocator.getMapService().getHeight() ) -// -// .distinct().limit(5).toArray(); -// for (int i = 0; i < NUM_GRUNTS; i++) { -// GridPoint2 randomPos = new GridPoint2(19, pickedLanes[i]); -// Entity wizard = NPCFactory.createDeflectWizard(); -// wizard.setScale(1.5f, 1.5f); -// spawnEntityAt(wizard, randomPos, true, false); -// } -// } -// -// private void spawnWaterQueen() { -// -// int[] pickedLanes = new Random().ints(0, ServiceLocator.getMapService().getHeight() ) -// -// .distinct().limit(5).toArray(); -// for (int i = 0; i < NUM_GRUNTS; i++) { -// GridPoint2 randomPos = new GridPoint2(19, pickedLanes[i]); -// Entity waterQueen = NPCFactory.createWaterQueen(); -// waterQueen.setScale(1.5f, 1.5f); -// spawnEntityAt(waterQueen, randomPos, true, false); -// } -// } -// -// private void spawnWaterSlime() { -// -// int[] pickedLanes = new Random().ints(0, ServiceLocator.getMapService().getHeight() ) -// -// .distinct().limit(5).toArray(); -// for (int i = 0; i < NUM_GRUNTS; i++) { -// GridPoint2 randomPos = new GridPoint2(19, pickedLanes[i]); -// Entity waterSlime = NPCFactory.createSplittingWaterSlime(); -// waterSlime.setScale(1.5f, 1.5f); -// spawnEntityAt(waterSlime, randomPos, true, false); -// } -// } - - private void spawnCoat() { - Entity gregMob = NPCFactory.createCoat(100); - gregMob.setScale(1.5f, 1.5f); - spawnEntityAt(gregMob, new GridPoint2(17, 4), false, false); - } - - /** - * Creates multiple projectiles that travel simultaneous. They all have same - * the starting point but different destinations. - * - * @param position The position of the Entity that's shooting the projectile. - * @param targetLayer The enemy layer of the "shooter". - * @param direction The direction the projectile should head towards. - * @param space The space between the projectiles' destination. - * @param speed The speed of the projectiles. - * @param quantity The amount of projectiles to spawn. - */ - private void spawnMultiProjectile(Vector2 position, short targetLayer, int direction, int space, Vector2 speed, int quantity) { - int half = quantity / 2; - for (int i = 0; i < quantity; i++) { - spawnProjectile(position, targetLayer, space * half, direction, speed); - --half; - } - } - - /** - * Returns projectile that can do an area of effect damage - * - * @param position The position of the Entity that's shooting the projectile. - * @param targetLayer The enemy layer of the "shooter". - * @param direction The direction the projectile should head towards. - * @param speed The speed of the projectiles. - * @param effect Type of effect. - * @param aoe Whether it is an aoe projectile. - */ - private void spawnEffectProjectile(Vector2 position, short targetLayer, int direction, Vector2 speed, - ProjectileEffects effect, boolean aoe) { - Entity Projectile = ProjectileFactory.createEffectProjectile(targetLayer, new Vector2(direction, position.y), speed, effect, aoe); - Projectile.setPosition(position); - spawnEntity(Projectile); - } - - /** - * Spawns a pierce fireball. - * Pierce fireball can go through targetlayers without disappearing but damage - * will still be applied. - * - * @param position The position of the Entity that's shooting the projectile. - * @param targetLayer The enemy layer of the "shooter". - * @param direction The direction the projectile should head towards. - * @param speed The speed of the projectiles. - */ - private void spawnPierceFireBall(Vector2 position, short targetLayer, int direction, Vector2 speed) { - Entity projectile = ProjectileFactory.createPierceFireBall(targetLayer, new Vector2(direction, position.y), speed); - projectile.setPosition(position); - spawnEntity(projectile); - } - - /** - * Spawns a ricochet fireball - * Ricochet fireballs bounce off targets with a specified maximum count of 3 - * Possible extensions: Make the bounce count flexible with a param. - * - * @param position The position of the Entity that's shooting the projectile. - * @param targetLayer The enemy layer of the "shooter". - * @param direction The direction the projectile should head towards. - * @param speed The speed of the projectiles. - */ - private void spawnRicochetFireball(Vector2 position, short targetLayer, int direction, Vector2 speed) { - // Bounce count set to 0. - Entity projectile = ProjectileFactory.createRicochetFireball(targetLayer, new Vector2(direction, position.y), speed, 0); - projectile.setPosition(position); - spawnEntity(projectile); - } - - /** - * Spawns a split firework fireball. - * Splits into mini projectiles that spreads out after collision. - * - * @param position The position of the Entity that's shooting the projectile. - * @param targetLayer The enemy layer of the "shooter". - * @param direction The direction the projectile should towards. - * @param speed The speed of the projectiles. - * @param amount The amount of projectiles appearing after collision. - */ - private void spawnSplitFireWorksFireBall(Vector2 position, short targetLayer, int direction, Vector2 speed, int amount) { - Entity projectile = ProjectileFactory.createSplitFireWorksFireball(targetLayer, new Vector2(direction, position.y), speed, amount); - projectile.setPosition(position); - spawnEntity(projectile); - } - private void spawnWeaponTower() { GridPoint2 minPos = new GridPoint2(0, 0); GridPoint2 maxPos = terrain.getMapBounds(0).sub(5, 1); diff --git a/source/core/src/main/com/csse3200/game/entities/factories/NPCFactory.java b/source/core/src/main/com/csse3200/game/entities/factories/NPCFactory.java index 513f92eeb..943023e48 100644 --- a/source/core/src/main/com/csse3200/game/entities/factories/NPCFactory.java +++ b/source/core/src/main/com/csse3200/game/entities/factories/NPCFactory.java @@ -622,7 +622,7 @@ public static Entity createSplittingRocky(int health) { * @return Splitting Night Borne */ public static Entity createSplittingNightBorne(int health) { - return createNightBorne(health).addComponent(new SplitMoblings(MobType.NIGHT_BORNE, 7, 0.5f)); + return createNightBorne(health).addComponent(new SplitMoblings(MobType.NIGHT_BORNE, 7, 0.3f)); } /** 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 de95970f8..955da4cc4 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 @@ -41,10 +41,10 @@ public class WaveFactory { private static final ArrayList> lvl2Structure = new ArrayList<>(Arrays.asList( new ArrayList<>(Arrays.asList("Skeleton" - )), new ArrayList<>(Arrays.asList("Skeleton", "ArcaneArcher" + )), new ArrayList<>(Arrays.asList("Skeleton", "Wizard" )), new ArrayList<>(Arrays.asList("Skeleton", "Wizard" )), new ArrayList<>(Arrays.asList("Skeleton", "SplittingNightBorne" - )), new ArrayList<>(Arrays.asList("Wizard", "SplittingNightBorne" + )), new ArrayList<>(Arrays.asList("ArcaneArcher", "SplittingNightBorne" )), new ArrayList<>(Arrays.asList("SplittingNightBorne", "Skeleton" )), new ArrayList<>(Arrays.asList("Wizard", "SplittingNightBorne" )), new ArrayList<>(Arrays.asList("ArcaneArcher", "SplittingNightBorne", "Wizard"