Merge branch 'master' of https://github.com/Anuken/Mindustry into 7.0-features
Conflicts: core/src/mindustry/ui/dialogs/PlanetDialog.java
This commit is contained in:
@@ -5,8 +5,6 @@ import arc.func.*;
|
||||
import arc.util.*;
|
||||
import mindustry.maps.*;
|
||||
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
/** Defines preset rule sets. */
|
||||
public enum Gamemode{
|
||||
survival(rules -> {
|
||||
@@ -25,7 +23,7 @@ public enum Gamemode{
|
||||
|
||||
rules.waveSpacing = 2f * Time.toMinutes;
|
||||
rules.teams.get(rules.waveTeam).infiniteResources = true;
|
||||
}, map -> map.teams.contains(state.rules.waveTeam.id)),
|
||||
}, map -> map.teams.size > 1),
|
||||
pvp(rules -> {
|
||||
rules.pvp = true;
|
||||
rules.enemyCoreBuildRadius = 600f;
|
||||
|
||||
@@ -33,6 +33,7 @@ import mindustry.world.blocks.power.*;
|
||||
import mindustry.world.blocks.production.*;
|
||||
import mindustry.world.blocks.sandbox.*;
|
||||
import mindustry.world.blocks.storage.*;
|
||||
import mindustry.world.blocks.storage.CoreBlock.*;
|
||||
import mindustry.world.meta.*;
|
||||
|
||||
import java.io.*;
|
||||
@@ -450,6 +451,10 @@ public class Schematics implements Loadable{
|
||||
if(st.block instanceof Drill){
|
||||
tile.getLinkedTiles(t -> t.setOverlay(resource));
|
||||
}
|
||||
|
||||
if(tile.build instanceof CoreBuild cb){
|
||||
state.teams.registerCore(cb);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -48,11 +48,11 @@ public class Teams{
|
||||
return Geometry.findClosest(x, y, get(team).cores);
|
||||
}
|
||||
|
||||
public boolean eachEnemyCore(Team team, Boolf<CoreBuild> ret){
|
||||
public boolean anyEnemyCoresWithin(Team team, float x, float y, float radius){
|
||||
for(TeamData data : active){
|
||||
if(team != data.team){
|
||||
for(CoreBuild tile : data.cores){
|
||||
if(ret.get(tile)){
|
||||
if(tile.within(x, y, radius)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -261,6 +261,10 @@ public class Waves{
|
||||
}
|
||||
|
||||
public static Seq<SpawnGroup> generate(float difficulty, Rand rand, boolean attack){
|
||||
return generate(difficulty, rand, attack, false);
|
||||
}
|
||||
|
||||
public static Seq<SpawnGroup> generate(float difficulty, Rand rand, boolean attack, boolean airOnly){
|
||||
UnitType[][] species = {
|
||||
{dagger, mace, fortress, scepter, reign},
|
||||
{nova, pulsar, quasar, vela, corvus},
|
||||
@@ -268,6 +272,12 @@ public class Waves{
|
||||
{flare, horizon, zenith, rand.chance(0.5) ? quad : antumbra, rand.chance(0.1) ? quad : eclipse}
|
||||
};
|
||||
|
||||
if(airOnly){
|
||||
species = Structs.filter(UnitType[].class, species, v -> v[0].flying);
|
||||
}
|
||||
|
||||
UnitType[][] fspec = species;
|
||||
|
||||
//required progression:
|
||||
//- extra periodic patterns
|
||||
|
||||
@@ -281,7 +291,7 @@ public class Waves{
|
||||
|
||||
Intc createProgression = start -> {
|
||||
//main sequence
|
||||
UnitType[] curSpecies = Structs.random(species);
|
||||
UnitType[] curSpecies = Structs.random(fspec);
|
||||
int curTier = 0;
|
||||
|
||||
for(int i = start; i < cap;){
|
||||
@@ -326,7 +336,7 @@ public class Waves{
|
||||
|
||||
//small chance to switch species
|
||||
if(rand.chance(0.3)){
|
||||
curSpecies = Structs.random(species);
|
||||
curSpecies = Structs.random(fspec);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user