Partial 7.0 merge - API preview

This commit is contained in:
Anuken
2021-06-02 11:08:08 -04:00
parent ea75a357ca
commit 28b235ef07
531 changed files with 12356 additions and 6286 deletions

View File

@@ -12,7 +12,6 @@ import arc.util.*;
import arc.util.noise.*;
import mindustry.content.*;
import mindustry.type.*;
import mindustry.ui.*;
import mindustry.world.*;
import mindustry.world.blocks.environment.*;
@@ -30,7 +29,7 @@ public class MenuRenderer implements Disposable{
private float time = 0f;
private float flyerRot = 45f;
private int flyers = Mathf.chance(0.2) ? Mathf.random(35) : Mathf.random(15);
private UnitType flyerType = Structs.select(UnitTypes.flare, UnitTypes.flare, UnitTypes.horizon, UnitTypes.mono, UnitTypes.poly, UnitTypes.mega, UnitTypes.zenith);
private UnitType flyerType = content.units().select(u -> u.hitSize <= 20f && u.flying && u.region.found()).random();
public MenuRenderer(){
Time.mark();
@@ -42,7 +41,7 @@ public class MenuRenderer implements Disposable{
private void generate(){
world.beginMapLoad();
Tiles tiles = world.resize(width, height);
Seq<Block> ores = content.blocks().select(b -> b instanceof OreBlock);
Seq<Block> ores = content.blocks().select(b -> b instanceof OreBlock && !(b instanceof WallOreBlock));
shadows = new FrameBuffer(width, height);
int offset = Mathf.random(100000);
Simplex s1 = new Simplex(offset);
@@ -239,7 +238,7 @@ public class MenuRenderer implements Disposable{
private void drawFlyers(){
Draw.color(0f, 0f, 0f, 0.4f);
TextureRegion icon = flyerType.icon(Cicon.full);
TextureRegion icon = flyerType.fullIcon;
float size = Math.max(icon.width, icon.height) * Draw.scl * 1.6f;
@@ -275,10 +274,12 @@ public class MenuRenderer implements Disposable{
float offset = -100f;
for(int i = 0; i < flyers; i++){
Tmp.v1.trns(flyerRot, time * (2f + flyerType.speed));
Tmp.v1.trns(flyerRot, time * (flyerType.speed));
cons.get((Mathf.randomSeedRange(i, range) + Tmp.v1.x + Mathf.absin(time + Mathf.randomSeedRange(i + 2, 500), 10f, 3.4f) + offset) % (tw + Mathf.randomSeed(i + 5, 0, 500)),
(Mathf.randomSeedRange(i + 1, range) + Tmp.v1.y + Mathf.absin(time + Mathf.randomSeedRange(i + 3, 500), 10f, 3.4f) + offset) % th);
cons.get(
(Mathf.randomSeedRange(i, range) + Tmp.v1.x + Mathf.absin(time + Mathf.randomSeedRange(i + 2, 500), 10f, 3.4f) + offset) % (tw + Mathf.randomSeed(i + 5, 0, 500)),
(Mathf.randomSeedRange(i + 1, range) + Tmp.v1.y + Mathf.absin(time + Mathf.randomSeedRange(i + 3, 500), 10f, 3.4f) + offset) % th
);
}
}