diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 0ba749cc57..8149f4ff3c 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -593,6 +593,11 @@ sector.tarFields.description = The outskirts of an oil production zone, between sector.desolateRift.description = An extremely dangerous zone. Plentiful resources, but little space. High risk of destruction. Leave as soon as possible. Do not be fooled by the long spacing between enemy attacks. sector.nuclearComplex.description = A former facility for the production and processing of thorium, reduced to ruins.\n[lightgray]Research the thorium and its many uses.\n\nThe enemy is present here in great numbers, constantly scouting for attackers. sector.fungalPass.description = A transition area between high mountains and lower, spore-ridden lands. A small enemy reconnaissance base is located here.\nDestroy it.\nUse Dagger and Crawler units. Take out the two cores. +sector.biomassFacility.description = The origin of spores. This is the facility in which they were researched and initially produced.\nResearch the technology contained within. Cultivate spores for the production of fuel and plastics.\n\n[lightgray]Upon this facility's demise, the spores were released. Nothing in the local ecosystem could compete with such an invasive organism. +sector.windsweptIslands.description = Further past the shoreline is this remote chain of islands. Records show they once had [accent]Plastanium[]-producing structures.\n\nFend off the enemy's naval units. Establish a base on the islands. Research these factories. +sector.extractionOutpost.description = A remote outpost, constructed by the enemy for the purpose of launching resources to other sectors.\n\nCross-sector transport technology is essential for further conquest. Destroy the base. Research their Launch Pads. +sector.impact0078.description = Here lie remnants of the interstellar transport vessel that first entered this system.\n\nSalvage as much as possible from the wreckage. Research any intact technology. +sector.planetaryTerminal.description = The final target.\n\nThis coastal base contains a structure capable of launching Cores to local planets. It is extremely well guarded.\n\nProduce naval units. Eliminate the enemy as quickly as possible. Research the launch structure. settings.language = Language settings.data = Game Data diff --git a/core/assets/maps/saltFlats.msav b/core/assets/maps/saltFlats.msav index d0f1a672c4..f01aa3a0f3 100644 Binary files a/core/assets/maps/saltFlats.msav and b/core/assets/maps/saltFlats.msav differ diff --git a/core/src/mindustry/ai/BaseAI.java b/core/src/mindustry/ai/BaseAI.java index 7900b6608c..395493d57f 100644 --- a/core/src/mindustry/ai/BaseAI.java +++ b/core/src/mindustry/ai/BaseAI.java @@ -17,6 +17,7 @@ import mindustry.gen.*; import mindustry.type.*; import mindustry.world.*; import mindustry.world.blocks.defense.*; +import mindustry.world.blocks.distribution.*; import mindustry.world.blocks.production.*; import mindustry.world.blocks.storage.*; import mindustry.world.blocks.storage.CoreBlock.*; @@ -271,6 +272,10 @@ public class BaseAI{ } Tile o = world.tile(tile.x + p.x, tile.y + p.y); + if(o != null && (o.block() instanceof PayloadAcceptor || o.block() instanceof PayloadConveyor)){ + break; + } + if(o != null && o.team() == data.team && !(o.block() instanceof Wall)){ any = true; break; diff --git a/core/src/mindustry/content/TechTree.java b/core/src/mindustry/content/TechTree.java index e68688b0b1..30d6c60207 100644 --- a/core/src/mindustry/content/TechTree.java +++ b/core/src/mindustry/content/TechTree.java @@ -121,7 +121,7 @@ public class TechTree implements ContentList{ }); - node(waterExtractor, () -> { + node(waterExtractor, Seq.with(new SectorComplete(saltFlats)), () -> { node(oilExtractor, () -> { }); diff --git a/core/src/mindustry/game/Waves.java b/core/src/mindustry/game/Waves.java index 5958d5f22f..c8667e7e76 100644 --- a/core/src/mindustry/game/Waves.java +++ b/core/src/mindustry/game/Waves.java @@ -340,10 +340,10 @@ public class Waves{ step += (int)(rand.random(15, 30) * Mathf.lerp(1f, 0.5f, difficulty)); } - int bossWave = (int)(rand.random(50, 70) * Mathf.lerp(1f, 0.5f, difficulty)); + int bossWave = (int)(rand.random(50, 70) * Mathf.lerp(1f, 0.75f, difficulty)); int bossSpacing = (int)(rand.random(25, 40) * Mathf.lerp(1f, 0.6f, difficulty)); - int bossTier = difficulty < 0.5 ? 3 : 4; + int bossTier = difficulty < 0.6 ? 3 : 4; //main boss progression out.add(new SpawnGroup(Structs.random(species)[bossTier]){{ @@ -411,7 +411,7 @@ public class Waves{ } //shift back waves on higher difficulty for a harder start - int shift = Math.max((int)(difficulty * 15 - 5), 0); + int shift = Math.max((int)(difficulty * 14 - 5), 0); for(SpawnGroup group : out){ group.begin -= shift; diff --git a/core/src/mindustry/input/InputHandler.java b/core/src/mindustry/input/InputHandler.java index c2ab8423c9..2df91588b6 100644 --- a/core/src/mindustry/input/InputHandler.java +++ b/core/src/mindustry/input/InputHandler.java @@ -47,6 +47,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ /** Maximum line length. */ final static int maxLength = 100; final static Rect r1 = new Rect(), r2 = new Rect(); + final static Seq tmpPoints = new Seq<>(), tmpPoints2 = new Seq<>(); public final OverlayFragment frag = new OverlayFragment(); @@ -1164,27 +1165,39 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ points = Placement.normalizeLine(startX, startY, endX, endY); } - if(block instanceof PowerNode){ - Seq skip = new Seq<>(); + if(block instanceof PowerNode node){ + var base = tmpPoints2; + var result = tmpPoints.clear(); - for(int i = 1; i < points.size; i++){ - int overlaps = 0; - Point2 point = points.get(i); + base.selectFrom(points, p -> p == points.first() || p == points.peek() || Build.validPlace(block, player.team(), p.x, p.y, rotation, false)); + boolean addedLast = false; - //check with how many powernodes the *next* tile will overlap - for(int j = 0; j < i; j++){ - if(!skip.contains(points.get(j)) && ((PowerNode)block).overlaps(world.tile(point.x, point.y), world.tile(points.get(j).x, points.get(j).y))){ - overlaps++; + outer: + for(int i = 0; i < base.size;){ + var point = base.get(i); + result.add(point); + if(i == base.size - 1) addedLast = true; + + //find the furthest node that overlaps this one + for(int j = base.size - 1; j > i; j--){ + var other = base.get(j); + boolean over = node.overlaps(world.tile(point.x, point.y), world.tile(other.x, other.y)); + + if(over){ + //add node to list and start searching for node that overlaps the next one + i = j; + continue outer; } } - //if it's more than one, it can bridge the gap - if(overlaps > 1){ - skip.add(points.get(i-1)); - } + //if it got here, that means nothing was found. try to proceed to the next node anyway + i ++; } - //remove skipped points - points.removeAll(skip); + + if(!addedLast) result.add(base.peek()); + + points.clear(); + points.addAll(result); } float angle = Angles.angle(startX, startY, endX, endY); diff --git a/core/src/mindustry/input/Placement.java b/core/src/mindustry/input/Placement.java index 1d713f7f75..59af8ac517 100644 --- a/core/src/mindustry/input/Placement.java +++ b/core/src/mindustry/input/Placement.java @@ -241,35 +241,10 @@ public class Placement{ } public static class NormalizeDrawResult{ - float x, y, x2, y2; + public float x, y, x2, y2; } public static class NormalizeResult{ public int x, y, x2, y2, rotation; - - boolean isX(){ - return Math.abs(x2 - x) > Math.abs(y2 - y); - } - - /** - * Returns length of greater edge of the selection. - */ - int getLength(){ - return Math.max(x2 - x, y2 - y); - } - - /** - * Returns the X position of a specific index along this area as a line. - */ - int getScaledX(int i){ - return x + (x2 - x > y2 - y ? i : 0); - } - - /** - * Returns the Y position of a specific index along this area as a line. - */ - int getScaledY(int i){ - return y + (x2 - x > y2 - y ? 0 : i); - } } } diff --git a/core/src/mindustry/type/Planet.java b/core/src/mindustry/type/Planet.java index b4917e519e..f12cdb5c53 100644 --- a/core/src/mindustry/type/Planet.java +++ b/core/src/mindustry/type/Planet.java @@ -187,7 +187,7 @@ public class Planet extends UnlockableContent{ } if(sector.hasEnemyBase()){ - sum += 1f; + sum += 0.88f; } sector.threat = sector.preset == null ? Math.min(sum / 5f, 1.2f) : Mathf.clamp(sector.preset.difficulty / 10f);