Boss waves, health bars / Better lasers / Bugfixes
This commit is contained in:
@@ -1,7 +1,22 @@
|
||||
package io.anuke.mindustry.game;
|
||||
|
||||
import io.anuke.mindustry.content.Blocks;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
|
||||
public abstract class Loadout{
|
||||
public enum Loadout{
|
||||
test(Blocks.coreShard){
|
||||
@Override
|
||||
public void setup(Tile tile){
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
public final Block core;
|
||||
|
||||
Loadout(Block core){
|
||||
this.core = core;
|
||||
}
|
||||
|
||||
public abstract void setup(Tile tile);
|
||||
}
|
||||
|
||||
@@ -11,10 +11,12 @@ import io.anuke.mindustry.type.UnitType;
|
||||
* Each spawn group can have multiple sub-groups spawned in different areas of the map.
|
||||
*/
|
||||
public class SpawnGroup{
|
||||
protected static final int never = Integer.MAX_VALUE;
|
||||
|
||||
/**The unit type spawned*/
|
||||
public final UnitType type;
|
||||
/**When this spawn should end*/
|
||||
protected int end = Integer.MAX_VALUE;
|
||||
protected int end = never;
|
||||
/**When this spawn should start*/
|
||||
protected int begin;
|
||||
/**The spacing, in waves, of spawns. For example, 2 = spawns every other wave*/
|
||||
@@ -34,9 +36,7 @@ public class SpawnGroup{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the amount of units spawned on a specific wave.
|
||||
*/
|
||||
/**Returns the amount of units spawned on a specific wave.*/
|
||||
public int getUnitsSpawned(int wave){
|
||||
if(wave < begin || wave > end || (wave - begin) % spacing != 0){
|
||||
return 0;
|
||||
|
||||
@@ -6,6 +6,9 @@ import io.anuke.arc.collection.ObjectSet;
|
||||
import io.anuke.mindustry.Vars;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
|
||||
import static io.anuke.mindustry.Vars.waveTeam;
|
||||
import static io.anuke.mindustry.Vars.world;
|
||||
|
||||
/**Class for various team-based utilities.*/
|
||||
public class Teams{
|
||||
private TeamData[] map = new TeamData[Team.all.length];
|
||||
@@ -23,7 +26,8 @@ public class Teams{
|
||||
/**Returns team data by type.*/
|
||||
public TeamData get(Team team){
|
||||
if(map[team.ordinal()] == null){
|
||||
add(team, Array.with(Team.all).select(t -> t != team && t != Team.none && team != Team.none).toArray(Team.class));
|
||||
Array<Team> enemies = Array.with(Team.all).select(t -> t != team && ((t != Team.none && team != Team.none) || (world.isZone() && team == waveTeam)));
|
||||
add(team, enemies.toArray(Team.class));
|
||||
}
|
||||
return map[team.ordinal()];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user