Skip to content

Commit

Permalink
Fixed an error with MobTask directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
max9753 committed Oct 16, 2023
2 parents 75f7790 + 86fadf7 commit 29fb35a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.csse3200.game.rendering.AnimationRenderComponent;
import com.csse3200.game.services.GameTime;
import com.csse3200.game.services.ServiceLocator;
import com.csse3200.game.components.tasks.MobTask.MobType;

/**
* The AI Task for all general mobs. This task handles the sequencing for melee
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,23 @@ public class WaveFactory {

private static final Logger logger = LoggerFactory.getLogger(WaveFactory.class);
private static Random rand = new Random();

// TODO: include necromancer
private static final ArrayList<String> MELEE_MOBS = new ArrayList<>(Arrays.asList(
"Skeleton", "Coat", "DragonKnight"
"Skeleton", "Coat", "DragonKnight", "Necromancer"
));

private static final ArrayList<ArrayList<String>> lvl1Structure = new ArrayList<>(Arrays.asList(
new ArrayList<>(Arrays.asList("Coat"
)), new ArrayList<>(Arrays.asList("Coat", "WaterQueen"
)), new ArrayList<>(Arrays.asList("WaterQueen", "WaterQueen"
)), new ArrayList<>(Arrays.asList("Coat", "WaterQueen", "Coat"
)), new ArrayList<>(Arrays.asList("WaterQueen", "SplittingWaterSlime"
)), new ArrayList<>(Arrays.asList("Coat", "WaterQueen", "SplittingWaterSlime"
))
));

private static final ArrayList<ArrayList<String>> lvl2Structure = new ArrayList<>(Arrays.asList(
new ArrayList<>(Arrays.asList("Skeleton"
)), new ArrayList<>(Arrays.asList("Skeleton", "SplittingNightBorne"
)), new ArrayList<>(Arrays.asList("Skeleton", "Wizard"
)), new ArrayList<>(Arrays.asList("Skeleton", "ArcaneArcher"
)), new ArrayList<>(Arrays.asList("Skeleton", "Wizard"
)), new ArrayList<>(Arrays.asList("Skeleton", "SplittingNightBorne"
)), new ArrayList<>(Arrays.asList("Wizard", "SplittingNightBorne"
)), new ArrayList<>(Arrays.asList("SplittingNightBorne", "Skeleton"
)), new ArrayList<>(Arrays.asList("Wizard", "SplittingNightBorne"
Expand All @@ -58,28 +56,20 @@ public class WaveFactory {
new ArrayList<>(Arrays.asList("Necromancer"
)), new ArrayList<>(Arrays.asList("Necromancer", "DodgingDragon"
)), new ArrayList<>(Arrays.asList("Necromancer", "FireWorm"
)), new ArrayList<>(Arrays.asList("Necromancer", "FireWorm"
)), new ArrayList<>(Arrays.asList("SplittingRocky", "FireWorm"
)), new ArrayList<>(Arrays.asList("Necromancer", "DeflectFireWizard"
)), new ArrayList<>(Arrays.asList("DeflectFireWizard", "FireWorm"
)), new ArrayList<>(Arrays.asList("DodgingDragon", "FireWorm"
)), new ArrayList<>(Arrays.asList("DodgingDragon", "Necromancer"
)), new ArrayList<>(Arrays.asList("FireWorm", "Necromancer"
)), new ArrayList<>(Arrays.asList("DeflectFireWiza","SplittingRocky", "Necromancer"
)), new ArrayList<>(Arrays.asList("DodgingDragon", "DeflectFireWizard", "SplittingRocky", "Necromancer"
)), new ArrayList<>(Arrays.asList("FireWorm", "DeflectWizard", "DodgingDragon"
)), new ArrayList<>(Arrays.asList("FireWorm", "DeflectWizard", "Necromancer"
)), new ArrayList<>(Arrays.asList("Necromancer", "DeflectFireWizard", "SplittingRocky", "DodgingDragon", "FireWorm"
)), new ArrayList<>(Arrays.asList("DeflectFireWizard", "Necromancer"
)), new ArrayList<>(Arrays.asList("DodgingDragon", "DeflectFireWizard", "Necromancer"
)), new ArrayList<>(Arrays.asList("FireWorm", "Necromancer", "DodgingDragon"
)), new ArrayList<>(Arrays.asList("FireWorm", "SplittingRocky", "Necromancer"
)), new ArrayList<>(Arrays.asList("SplittingRocky", "DeflectFireWizard", "FireWorm"
)), new ArrayList<>(Arrays.asList("DeflectFireWizard", "SplittingRocky", "Necromancer", "DodgingDragon", "FireWorm"
))
));

// The base health for the different mobs
private static int MELEE_BASE_HEALTH = 80;
private static int RANGE_BASE_HEALTH = 60;

// Base health of the bosses
private static int LVL1_BOSS_BASE_HEALTH = 500;
private static int LVL2_BOSS_BASE_HEALTH = 1000;
private static int LVL3_BOSS_BASE_HEALTH = 2000;

private static final String BOSS_1 = "IceBoss";
private static final String BOSS_2 = "PatrickBoss";
private static final String BOSS_3 = "FireBoss";
Expand Down Expand Up @@ -139,6 +129,11 @@ public static LevelWaves createLevel(int chosenLevel) {
String boss = "";
int bossHealth;
int minMobs;
// Base health of the bosses
int LVL1_BOSS_BASE_HEALTH = 500;
int LVL2_BOSS_BASE_HEALTH = 1000;
int LVL3_BOSS_BASE_HEALTH = 2000;

switch (chosenLevel) {
case 2:
boss = BOSS_2;
Expand Down Expand Up @@ -176,14 +171,19 @@ public static LevelWaves createLevel(int chosenLevel) {
// Calculate the number of mobs for the wave
if (leftToSort == 0) {
num = minMobs - currentMobs;
System.out.println(num + " for " + mob + " at wave " + atWave);
} else {
num = rand.nextInt(minMobs - currentMobs - (2 * leftToSort)) + 2;
num = rand.nextInt(minMobs - currentMobs - (2 * leftToSort) - 2) + 2;
System.out.println(num + " for " + mob + " at wave " + atWave);
currentMobs += num;
}

// Calculate the health
int RANGE_BASE_HEALTH = 60;
int health = RANGE_BASE_HEALTH;
if (MELEE_MOBS.contains(mob)) {
// The base health for the different mobs
int MELEE_BASE_HEALTH = 80;
health = MELEE_BASE_HEALTH;
}
int[] mobStats = {num, health + (atWave * chosenLevel)};
Expand Down

0 comments on commit 29fb35a

Please sign in to comment.