diff --git a/build.gradle b/build.gradle index 224253c31c..7250cf4c2e 100644 --- a/build.gradle +++ b/build.gradle @@ -233,11 +233,11 @@ project(":core"){ def androidLogList = loglines.findAll{ line -> !line.endsWith("]") || line.endsWith("[Mobile]") || line.endsWith("[Android]")} def result = "" - androidLogList.forEach({line -> + androidLogList.forEach{line -> if(result.length() + line.length() + 1 < maxLength){ result += line + "\n" } - }) + } def changelogs = file("../fastlane/metadata/android/en-US/changelogs/") new File(changelogs, buildVersion + ".txt").text = (result) new File(changelogs, androidVersion + ".txt").text = (result) diff --git a/core/assets/maps/tarFields.msav b/core/assets/maps/tarFields.msav index e4a99d71bf..41e30e2a61 100644 Binary files a/core/assets/maps/tarFields.msav and b/core/assets/maps/tarFields.msav differ diff --git a/core/assets/sprites/sprites.png b/core/assets/sprites/sprites.png index 395ee381c4..c438349642 100644 Binary files a/core/assets/sprites/sprites.png and b/core/assets/sprites/sprites.png differ diff --git a/core/assets/sprites/sprites2.png b/core/assets/sprites/sprites2.png index 1498297e35..0d8970e586 100644 Binary files a/core/assets/sprites/sprites2.png and b/core/assets/sprites/sprites2.png differ diff --git a/core/src/mindustry/content/SectorPresets.java b/core/src/mindustry/content/SectorPresets.java index b47176592a..59b8020499 100644 --- a/core/src/mindustry/content/SectorPresets.java +++ b/core/src/mindustry/content/SectorPresets.java @@ -1,9 +1,11 @@ package mindustry.content; import mindustry.ctype.*; +import mindustry.game.Objectives.*; import mindustry.type.*; -import static mindustry.content.Items.copper; +import static arc.struct.Array.with; +import static mindustry.content.Items.*; import static mindustry.content.Planets.starter; import static mindustry.type.ItemStack.list; @@ -25,62 +27,8 @@ public class SectorPresets implements ContentList{ launchPeriod = 5; }}; - //TODO remove - /* - desertWastes = new Zone("desertWastes", starter){{ - startingItems = list(copper, 120); - conditionWave = 20; - launchPeriod = 10; - loadout = Loadouts.advancedShard; - resources = with(copper, lead, coal, sand); - rules = r -> { - r.waves = true; - r.waveTimer = true; - r.launchWaveMultiplier = 3f; - r.waveSpacing = 60 * 50f; - r.spawns = with( - new SpawnGroup(UnitTypes.crawler){{ - unitScaling = 3f; - }}, - new SpawnGroup(UnitTypes.dagger){{ - unitScaling = 4f; - begin = 2; - spacing = 2; - }}, - new SpawnGroup(UnitTypes.wraith){{ - unitScaling = 3f; - begin = 11; - spacing = 3; - }}, - new SpawnGroup(UnitTypes.eruptor){{ - unitScaling = 3f; - begin = 22; - unitAmount = 1; - spacing = 4; - }}, - new SpawnGroup(UnitTypes.titan){{ - unitScaling = 3f; - begin = 37; - unitAmount = 2; - spacing = 4; - }}, - new SpawnGroup(UnitTypes.fortress){{ - unitScaling = 2f; - effect = StatusEffects.boss; - begin = 41; - spacing = 20; - }} - ); - }; - requirements = with( - new ZoneWave(groundZero, 20), - new Unlock(Blocks.combustionGenerator) - ); - }};*/ - - /* - saltFlats = new SectorPreset("saltFlats", starter){{ - startingItems = list(copper, 200, Items.silicon, 200, lead, 200); + saltFlats = new SectorPreset("saltFlats", starter, 16){{ + startingItems = list(copper, 200, silicon, 200, lead, 200); loadout = Loadouts.basicFoundation; conditionWave = 10; launchPeriod = 5; @@ -93,7 +41,7 @@ public class SectorPresets implements ContentList{ ); }}; - frozenForest = new SectorPreset("frozenForest", starter){{ + frozenForest = new SectorPreset("frozenForest", starter, 17){{ loadout = Loadouts.basicFoundation; startingItems = list(copper, 250); conditionWave = 10; @@ -104,7 +52,7 @@ public class SectorPresets implements ContentList{ ); }}; - craters = new SectorPreset("craters", starter){{ + craters = new SectorPreset("craters", starter, 18){{ startingItems = list(copper, 100); conditionWave = 10; requirements = with( @@ -114,7 +62,7 @@ public class SectorPresets implements ContentList{ ); }}; - ruinousShores = new SectorPreset("ruinousShores", starter){{ + ruinousShores = new SectorPreset("ruinousShores", starter, 19){{ loadout = Loadouts.basicFoundation; startingItems = list(copper, 140, lead, 50); conditionWave = 20; @@ -129,7 +77,7 @@ public class SectorPresets implements ContentList{ ); }}; - stainedMountains = new SectorPreset("stainedMountains", starter){{ + stainedMountains = new SectorPreset("stainedMountains", starter, 20){{ loadout = Loadouts.basicFoundation; startingItems = list(copper, 200, lead, 50); conditionWave = 10; @@ -142,7 +90,7 @@ public class SectorPresets implements ContentList{ ); }}; - fungalPass = new SectorPreset("fungalPass", starter){{ + fungalPass = new SectorPreset("fungalPass", starter, 21){{ startingItems = list(copper, 250, lead, 250, Items.metaglass, 100, Items.graphite, 100); requirements = with( new ZoneWave(stainedMountains, 15), @@ -153,7 +101,7 @@ public class SectorPresets implements ContentList{ ); }}; - overgrowth = new SectorPreset("overgrowth", starter){{ + overgrowth = new SectorPreset("overgrowth", starter, 22){{ startingItems = list(copper, 1500, lead, 1000, Items.silicon, 500, Items.metaglass, 250); conditionWave = 12; launchPeriod = 4; @@ -168,7 +116,7 @@ public class SectorPresets implements ContentList{ ); }}; - tarFields = new SectorPreset("tarFields", starter){{ + tarFields = new SectorPreset("tarFields", starter, 23){{ loadout = Loadouts.basicFoundation; startingItems = list(copper, 250, lead, 100); conditionWave = 15; @@ -181,7 +129,7 @@ public class SectorPresets implements ContentList{ ); }}; - desolateRift = new SectorPreset("desolateRift", starter){{ + desolateRift = new SectorPreset("desolateRift", starter, 24){{ loadout = Loadouts.basicNucleus; startingItems = list(copper, 1000, lead, 1000, Items.graphite, 250, titanium, 250, Items.silicon, 250); conditionWave = 3; @@ -194,18 +142,7 @@ public class SectorPresets implements ContentList{ }}; - crags = new Zone("crags", new MapGenerator("crags").dist(2f)){{ - loadout = Loadouts.basicFoundation; - baseLaunchCost = ItemStack.with(); - startingItems = ItemStack.list(Items.copper, 2000, Items.lead, 2000, Items.graphite, 500, Items.titanium, 500, Items.silicon, 500); - conditionWave = 3; - launchPeriod = 2; - requirements = with(stainedMountains, 40); - blockRequirements = new Block[]{Blocks.thermalGenerator}; - resources = Array.with(Items.copper, Items.scrap, Items.lead, Items.coal, Items.sand}; - }}; - - nuclearComplex = new SectorPreset("nuclearComplex", starter){{ + nuclearComplex = new SectorPreset("nuclearComplex", starter, 25){{ loadout = Loadouts.basicNucleus; startingItems = list(copper, 1250, lead, 1500, Items.silicon, 400, Items.metaglass, 250); conditionWave = 30; @@ -217,6 +154,18 @@ public class SectorPresets implements ContentList{ ); }}; + /* + crags = new Zone("crags", new MapGenerator("crags").dist(2f)){{ + loadout = Loadouts.basicFoundation; + baseLaunchCost = ItemStack.with(); + startingItems = ItemStack.list(Items.copper, 2000, Items.lead, 2000, Items.graphite, 500, Items.titanium, 500, Items.silicon, 500); + conditionWave = 3; + launchPeriod = 2; + requirements = with(stainedMountains, 40); + blockRequirements = new Block[]{Blocks.thermalGenerator}; + resources = Array.with(Items.copper, Items.scrap, Items.lead, Items.coal, Items.sand}; + }}; + impact0078 = new SectorPreset("impact0078"){{ loadout = Loadouts.basicNucleus; diff --git a/core/src/mindustry/core/World.java b/core/src/mindustry/core/World.java index 3c7be3c4e5..ed2e594c9a 100644 --- a/core/src/mindustry/core/World.java +++ b/core/src/mindustry/core/World.java @@ -240,6 +240,10 @@ public class World{ } } + public Context filterContext(Map map){ + return new FilterContext(map); + } + public void loadMap(Map map){ loadMap(map, new Rules()); } @@ -472,6 +476,7 @@ public class World{ @Override public void end(){ Array filters = map.filters(); + if(!filters.isEmpty()){ //input for filter queries GenerateInput input = new GenerateInput(); diff --git a/core/src/mindustry/maps/Maps.java b/core/src/mindustry/maps/Maps.java index 48ff34d979..7089c95943 100644 --- a/core/src/mindustry/maps/Maps.java +++ b/core/src/mindustry/maps/Maps.java @@ -330,7 +330,7 @@ public class Maps{ }else{ try{ return JsonIO.read(Array.class, str); - }catch(Exception e){ + }catch(Throwable e){ e.printStackTrace(); return readFilters(""); } diff --git a/core/src/mindustry/maps/filters/CoreSpawnFilter.java b/core/src/mindustry/maps/filters/CoreSpawnFilter.java index 1f1c5aefae..b418c3d56a 100644 --- a/core/src/mindustry/maps/filters/CoreSpawnFilter.java +++ b/core/src/mindustry/maps/filters/CoreSpawnFilter.java @@ -2,11 +2,10 @@ package mindustry.maps.filters; import arc.struct.*; import arc.util.*; -import mindustry.maps.filters.FilterOption.*; import mindustry.world.*; import mindustry.world.blocks.storage.*; -import static mindustry.Vars.*; +import static mindustry.Vars.state; /** Selects X spawns from the core spawn pool.*/ public class CoreSpawnFilter extends GenerateFilter{ @@ -15,7 +14,8 @@ public class CoreSpawnFilter extends GenerateFilter{ @Override public FilterOption[] options(){ return Structs.arr( - new SliderOption("amount", () -> amount, f -> amount = (int)f, 1, 10).display() + //disabled until necessary + // SliderOption("amount", () -> amount, f -> amount = (int)f, 1, 10).display() ); } @@ -23,7 +23,7 @@ public class CoreSpawnFilter extends GenerateFilter{ public void apply(Tiles tiles, GenerateInput in){ IntArray spawns = new IntArray(); for(Tile tile : tiles){ - if(tile.team() == state.rules.defaultTeam && tile.block() instanceof CoreBlock){ + if(tile.team() == state.rules.defaultTeam && tile.block() instanceof CoreBlock && tile.isCenter()){ spawns.add(tile.pos()); } } diff --git a/core/src/mindustry/maps/generators/FileMapGenerator.java b/core/src/mindustry/maps/generators/FileMapGenerator.java index 702e73d38f..ee3018c519 100644 --- a/core/src/mindustry/maps/generators/FileMapGenerator.java +++ b/core/src/mindustry/maps/generators/FileMapGenerator.java @@ -24,8 +24,9 @@ public class FileMapGenerator implements WorldGenerator{ public void generate(Tiles tiles){ if(map == null) throw new RuntimeException("Generator has null map, cannot be used."); - SaveIO.load(map.file); - world.beginMapLoad(); + world.setGenerating(false); + SaveIO.load(map.file, world.filterContext(map)); + world.setGenerating(true); tiles = world.tiles; @@ -52,14 +53,14 @@ public class FileMapGenerator implements WorldGenerator{ }); } - if(tile.block() instanceof CoreBlock && tile.team() == state.rules.defaultTeam && !anyCores){ + if(tile.isCenter() && tile.block() instanceof CoreBlock && tile.team() == state.rules.defaultTeam && !anyCores){ //TODO PLACE THE (CORRECT) LOADOUT Schematics.placeLoadout(Loadouts.basicShard, tile.x, tile.y); anyCores = true; } //add random decoration - if(Mathf.chance(0.01) && !tile.floor().isLiquid && tile.block() == Blocks.air){ + if(Mathf.chance(0.015) && !tile.floor().isLiquid && tile.block() == Blocks.air){ tile.setBlock(tile.floor().decoration); } } diff --git a/core/src/mindustry/type/Sector.java b/core/src/mindustry/type/Sector.java index bcc031bf4e..33a64256c6 100644 --- a/core/src/mindustry/type/Sector.java +++ b/core/src/mindustry/type/Sector.java @@ -58,7 +58,7 @@ public class Sector{ return Vars.state.isGame() && Vars.state.rules.sector == this && !Vars.state.launched && !Vars.state.gameOver; } - /** @return whether waves are present, e.g. any bases here will be attacked. */ + /** @return whether waves are present - if true, any bases here will be attacked. */ public boolean hasWaves(){ return save != null && save.meta.rules.waves; } diff --git a/core/src/mindustry/ui/dialogs/PlanetDialog.java b/core/src/mindustry/ui/dialogs/PlanetDialog.java index 7336297e77..aab1d97ee0 100644 --- a/core/src/mindustry/ui/dialogs/PlanetDialog.java +++ b/core/src/mindustry/ui/dialogs/PlanetDialog.java @@ -285,6 +285,8 @@ public class PlanetDialog extends FloatingDialog{ float stroke = 0.026f; if(sec.hasBase()){ drawSelection(sec, Tmp.c1.set(Team.sharded.color).mul(0.8f).a(selectAlpha), stroke, -0.01f); + }else if(sec.preset != null){ + drawSelection(sec, Tmp.c1.set(Team.derelict.color).mul(0.8f).a(selectAlpha), stroke, -0.02f); }else if(sec.hasEnemyBase()){ drawSelection(sec, Tmp.c1.set(Team.crux.color).mul(0.8f).a(selectAlpha), stroke, -0.02f); } diff --git a/core/src/mindustry/ui/fragments/HudFragment.java b/core/src/mindustry/ui/fragments/HudFragment.java index e9894f7ac5..7c9e0340aa 100644 --- a/core/src/mindustry/ui/fragments/HudFragment.java +++ b/core/src/mindustry/ui/fragments/HudFragment.java @@ -49,6 +49,7 @@ public class HudFragment extends Fragment{ showToast("New turn: [accent]" + universe.getTurn() + "[]" + (attacked > 0 ? "\n[scarlet]" + Iconc.warning + " " + attacked + " sectors attacked!": "")); }); + //TODO tear this all down //menu at top left parent.fill(cont -> { cont.setName("overlaymarker"); @@ -133,6 +134,13 @@ public class HudFragment extends Fragment{ cont.row(); } + //TODO BUTTONS FOR VIEWING EXPORTS/IMPORTS/RESEARCH + /* + cont.table(t -> { + + }); + cont.row();*/ + cont.update(() -> { if(Core.input.keyTap(Binding.toggle_menus) && !ui.chatfrag.shown() && !Core.scene.hasDialog() && !(Core.scene.getKeyboardFocus() instanceof TextField)){ toggleMenus(); diff --git a/tools/build.gradle b/tools/build.gradle index e22e3cbd70..a187320aab 100644 --- a/tools/build.gradle +++ b/tools/build.gradle @@ -36,7 +36,7 @@ def transformColors = { List> list -> transformColors([["6e7080", "989aa4", "b0bac0"], ["bc5452", "ea8878", "feb380"], ["de9458", "f8c266", "ffe18f"], ["feb380", "ea8878", "bc5452"]]) def antialias = { File file -> - if(!doAntialias || file.lastModified() <= 1000) return + if(!doAntialias) return def image = ImageIO.read(file) def out = ImageIO.read(file) @@ -319,9 +319,9 @@ task pack(dependsOn: classes){ } } - executor.shutdown(); + executor.shutdown() try{ - executor.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS); + executor.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS) }catch(InterruptedException e){ e.printStackTrace() }