Fixed #8733
This commit is contained in:
@@ -10,7 +10,7 @@ import mindustry.type.*;
|
||||
import static mindustry.content.UnitTypes.*;
|
||||
|
||||
public class Waves{
|
||||
public static final int waveVersion = 6;
|
||||
public static final int waveVersion = 7;
|
||||
|
||||
private Seq<SpawnGroup> spawns;
|
||||
|
||||
@@ -303,7 +303,7 @@ public class Waves{
|
||||
|
||||
Intc createProgression = start -> {
|
||||
//main sequence
|
||||
UnitType[] curSpecies = Structs.random(fspec);
|
||||
UnitType[] curSpecies = Structs.random(rand, fspec);
|
||||
int curTier = 0;
|
||||
|
||||
for(int i = start; i < cap;){
|
||||
@@ -348,7 +348,7 @@ public class Waves{
|
||||
|
||||
//small chance to switch species
|
||||
if(rand.chance(0.3)){
|
||||
curSpecies = Structs.random(fspec);
|
||||
curSpecies = Structs.random(rand, fspec);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -368,7 +368,7 @@ public class Waves{
|
||||
int bossTier = difficulty < 0.6 ? 3 : 4;
|
||||
|
||||
//main boss progression
|
||||
out.add(new SpawnGroup(Structs.random(species)[bossTier]){{
|
||||
out.add(new SpawnGroup(Structs.random(rand, species)[bossTier]){{
|
||||
unitAmount = 1;
|
||||
begin = bossWave;
|
||||
spacing = bossSpacing;
|
||||
@@ -380,7 +380,7 @@ public class Waves{
|
||||
}});
|
||||
|
||||
//alt boss progression
|
||||
out.add(new SpawnGroup(Structs.random(species)[bossTier]){{
|
||||
out.add(new SpawnGroup(Structs.random(rand, species)[bossTier]){{
|
||||
unitAmount = 1;
|
||||
begin = bossWave + rand.random(3, 5) * bossSpacing;
|
||||
spacing = bossSpacing;
|
||||
@@ -394,7 +394,7 @@ public class Waves{
|
||||
int finalBossStart = 120 + rand.random(30);
|
||||
|
||||
//final boss waves
|
||||
out.add(new SpawnGroup(Structs.random(species)[bossTier]){{
|
||||
out.add(new SpawnGroup(Structs.random(rand, species)[bossTier]){{
|
||||
unitAmount = 1;
|
||||
begin = finalBossStart;
|
||||
spacing = bossSpacing/2;
|
||||
@@ -406,7 +406,7 @@ public class Waves{
|
||||
}});
|
||||
|
||||
//final boss waves (alt)
|
||||
out.add(new SpawnGroup(Structs.random(species)[bossTier]){{
|
||||
out.add(new SpawnGroup(Structs.random(rand, species)[bossTier]){{
|
||||
unitAmount = 1;
|
||||
begin = finalBossStart + 15;
|
||||
spacing = bossSpacing/2;
|
||||
@@ -419,10 +419,10 @@ public class Waves{
|
||||
|
||||
//add megas to heal the base.
|
||||
if(attack && difficulty >= 0.5){
|
||||
int amount = Mathf.random(1, 3 + (int)(difficulty*2));
|
||||
int amount = rand.random(1, 3 + (int)(difficulty*2));
|
||||
|
||||
for(int i = 0; i < amount; i++){
|
||||
int wave = Mathf.random(3, 20);
|
||||
int wave = rand.random(3, 20);
|
||||
out.add(new SpawnGroup(mega){{
|
||||
unitAmount = 1;
|
||||
begin = wave;
|
||||
|
||||
@@ -34,7 +34,7 @@ public class LAssembler{
|
||||
|
||||
Seq<LStatement> st = read(data, privileged);
|
||||
|
||||
asm.instructions = st.map(l -> l.build(asm)).filter(l -> l != null).toArray(LInstruction.class);
|
||||
asm.instructions = st.map(l -> l.build(asm)).retainAll(l -> l != null).toArray(LInstruction.class);
|
||||
return asm;
|
||||
}
|
||||
|
||||
|
||||
@@ -424,7 +424,7 @@ public class Mods implements Loadable{
|
||||
|
||||
// Add local mods
|
||||
Seq.with(modDirectory.list())
|
||||
.filter(f -> f.extEquals("jar") || f.extEquals("zip") || (f.isDirectory() && Structs.contains(metaFiles, meta -> f.child(meta).exists())))
|
||||
.retainAll(f -> f.extEquals("jar") || f.extEquals("zip") || (f.isDirectory() && Structs.contains(metaFiles, meta -> f.child(meta).exists())))
|
||||
.each(candidates::add);
|
||||
|
||||
// Add Steam workshop mods
|
||||
|
||||
@@ -85,7 +85,7 @@ public class PlayerListFragment{
|
||||
|
||||
players.sort(Structs.comps(Structs.comparing(Player::team), Structs.comparingBool(p -> !p.admin)));
|
||||
if(search.getText().length() > 0){
|
||||
players.filter(p -> Strings.stripColors(p.name().toLowerCase()).contains(search.getText().toLowerCase()));
|
||||
players.retainAll(p -> Strings.stripColors(p.name().toLowerCase()).contains(search.getText().toLowerCase()));
|
||||
}
|
||||
|
||||
for(var user : players){
|
||||
|
||||
@@ -212,7 +212,7 @@ public class UnitFactory extends UnitBlock{
|
||||
|
||||
@Override
|
||||
public void buildConfiguration(Table table){
|
||||
Seq<UnitType> units = Seq.with(plans).map(u -> u.unit).filter(u -> u.unlockedNow() && !u.isBanned());
|
||||
Seq<UnitType> units = Seq.with(plans).map(u -> u.unit).retainAll(u -> u.unlockedNow() && !u.isBanned());
|
||||
|
||||
if(units.any()){
|
||||
ItemSelection.buildTable(UnitFactory.this, table, units, () -> currentPlan == -1 ? null : plans.get(currentPlan).unit, unit -> configure(plans.indexOf(u -> u.unit == unit)), selectionRows, selectionColumns);
|
||||
|
||||
Reference in New Issue
Block a user