From 091f591ffb62c923f8a0c8788a86258c9ef64dfb Mon Sep 17 00:00:00 2001 From: Anuken Date: Thu, 19 Jul 2018 09:58:19 -0400 Subject: [PATCH] Added sector-specific spawns --- core/src/io/anuke/mindustry/ai/WaveSpawner.java | 4 +++- core/src/io/anuke/mindustry/maps/Sector.java | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/core/src/io/anuke/mindustry/ai/WaveSpawner.java b/core/src/io/anuke/mindustry/ai/WaveSpawner.java index b6221b180f..063a79e1d8 100644 --- a/core/src/io/anuke/mindustry/ai/WaveSpawner.java +++ b/core/src/io/anuke/mindustry/ai/WaveSpawner.java @@ -168,8 +168,10 @@ public class WaveSpawner{ groundSpawns.clear(); quadrants = new Bits(quadWidth() * quadHeight()); - if(groups == null){ + if(world.getSector() == null){ groups = Waves.getSpawns(); + }else{ + groups = world.getSector().spawns; } } diff --git a/core/src/io/anuke/mindustry/maps/Sector.java b/core/src/io/anuke/mindustry/maps/Sector.java index 3eb20a7285..126fd84016 100644 --- a/core/src/io/anuke/mindustry/maps/Sector.java +++ b/core/src/io/anuke/mindustry/maps/Sector.java @@ -1,7 +1,9 @@ package io.anuke.mindustry.maps; import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.utils.Array; import io.anuke.mindustry.game.Saves.SaveSlot; +import io.anuke.mindustry.game.SpawnGroup; import io.anuke.mindustry.maps.goals.Goal; import io.anuke.mindustry.maps.goals.WaveGoal; import io.anuke.ucore.util.Bits; @@ -15,12 +17,14 @@ public class Sector{ public boolean complete; /**Slot ID of this sector's save. -1 means no save has been created.*/ public int saveID = -1; + /**Sector size; if more than 1, the coordinates are the bottom left corner.*/ + public int size = 1; /**Display texture. Needs to be disposed.*/ public transient Texture texture; /**Goal of this sector-- what needs to be accomplished to unlock it.*/ public transient Goal goal = new WaveGoal(30); - /**Sector size; if more than 1, the coordinates are the bottom left corner.*/ - public int size = 1; + /**Enemies spawned at this sector.*/ + public transient Array spawns = new Array<>(); public SaveSlot getSave(){ return control.getSaves().getByID(saveID);