diff --git a/core/src/mindustry/ai/BaseAI.java b/core/src/mindustry/ai/BaseAI.java index 4a4a267217..51c5be43b3 100644 --- a/core/src/mindustry/ai/BaseAI.java +++ b/core/src/mindustry/ai/BaseAI.java @@ -24,7 +24,7 @@ public class BaseAI{ private static final Vec2 axis = new Vec2(), rotator = new Vec2(); private static final float correctPercent = 0.5f; private static final float step = 5; - private static final int attempts = 5; + private static final int attempts = 4; private static final float emptyChance = 0.01f; private static final int timerStep = 0, timerSpawn = 1; diff --git a/core/src/mindustry/ai/Pathfinder.java b/core/src/mindustry/ai/Pathfinder.java index 900a481a13..78a596bb9d 100644 --- a/core/src/mindustry/ai/Pathfinder.java +++ b/core/src/mindustry/ai/Pathfinder.java @@ -103,7 +103,7 @@ public class Pathfinder implements Runnable{ boolean nearLiquid = false, nearSolid = false, nearGround = false; for(int i = 0; i < 4; i++){ - Tile other = tile.getNearby(i); + Tile other = tile.nearby(i); if(other != null){ if(other.floor().isLiquid) nearLiquid = true; if(other.solid()) nearSolid = true; diff --git a/core/src/mindustry/editor/EditorTile.java b/core/src/mindustry/editor/EditorTile.java index 5ff533325d..2d08b9d3d2 100644 --- a/core/src/mindustry/editor/EditorTile.java +++ b/core/src/mindustry/editor/EditorTile.java @@ -105,9 +105,9 @@ public class EditorTile extends Tile{ } @Override - protected void changeEntity(Team team, Prov entityprov, int rotation){ + protected void changeBuild(Team team, Prov entityprov, int rotation){ if(skip()){ - super.changeEntity(team, entityprov, rotation); + super.changeBuild(team, entityprov, rotation); return; } diff --git a/core/src/mindustry/editor/MapGenerateDialog.java b/core/src/mindustry/editor/MapGenerateDialog.java index fae31dc7d5..6a06e0b966 100644 --- a/core/src/mindustry/editor/MapGenerateDialog.java +++ b/core/src/mindustry/editor/MapGenerateDialog.java @@ -51,7 +51,7 @@ public class MapGenerateDialog extends BaseDialog{ CachedTile ctile = new CachedTile(){ //nothing. @Override - protected void changeEntity(Team team, Prov entityprov, int rotation){ + protected void changeBuild(Team team, Prov entityprov, int rotation){ } }; diff --git a/core/src/mindustry/entities/comp/BuildingComp.java b/core/src/mindustry/entities/comp/BuildingComp.java index e81c867988..45b1042660 100644 --- a/core/src/mindustry/entities/comp/BuildingComp.java +++ b/core/src/mindustry/entities/comp/BuildingComp.java @@ -464,7 +464,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, */ public boolean movePayload(Payload todump){ int trns = block.size/2 + 1; - Tile next = tile.getNearby(Geometry.d4(rotation).x * trns, Geometry.d4(rotation).y * trns); + Tile next = tile.nearby(Geometry.d4(rotation).x * trns, Geometry.d4(rotation).y * trns); if(next != null && next.build != null && next.build.team == team && next.build.acceptPayload(self(), todump)){ next.build.handlePayload(self(), todump); @@ -547,7 +547,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, } public float moveLiquidForward(boolean leaks, Liquid liquid){ - Tile next = tile.getNearby(rotation); + Tile next = tile.nearby(rotation); if(next == null) return 0; diff --git a/core/src/mindustry/game/EventType.java b/core/src/mindustry/game/EventType.java index cc71e17224..1ab946c4ac 100644 --- a/core/src/mindustry/game/EventType.java +++ b/core/src/mindustry/game/EventType.java @@ -229,8 +229,8 @@ public class EventType{ } /** - * Called when block building begins by placing down the BuildBlock. - * The tile's block will nearly always be a BuildBlock. + * Called when block building begins by placing down the ConstructBlock. + * The tile's block will nearly always be a ConstructBlock. */ public static class BlockBuildBeginEvent{ public final Tile tile; @@ -262,7 +262,7 @@ public class EventType{ /** * Called when a player or drone begins building something. - * This does not necessarily happen when a new BuildBlock is created. + * This does not necessarily happen when a new ConstructBlock is created. */ public static class BuildSelectEvent{ public final Tile tile; diff --git a/core/src/mindustry/maps/planet/SerpuloPlanetGenerator.java b/core/src/mindustry/maps/planet/SerpuloPlanetGenerator.java index 9065467dff..7e2b5e9aaa 100644 --- a/core/src/mindustry/maps/planet/SerpuloPlanetGenerator.java +++ b/core/src/mindustry/maps/planet/SerpuloPlanetGenerator.java @@ -414,7 +414,7 @@ public class SerpuloPlanetGenerator extends PlanetGenerator{ state.rules.attackMode = sector.info.attack = true; }else{ - state.rules.winWave = sector.info.winWave = 15 * (int)Math.max(difficulty * 10, 1); + state.rules.winWave = sector.info.winWave = 10 + 5 * (int)Math.max(difficulty * 10, 1); } state.rules.waves = sector.info.waves = true; diff --git a/core/src/mindustry/world/Build.java b/core/src/mindustry/world/Build.java index 070ddab553..98409e6d18 100644 --- a/core/src/mindustry/world/Build.java +++ b/core/src/mindustry/world/Build.java @@ -45,7 +45,7 @@ public class Build{ Core.app.post(() -> Events.fire(new BlockBuildBeginEvent(tile, team, true))); } - /** Places a BuildBlock at this location. */ + /** Places a ConstructBlock at this location. */ @Remote(called = Loc.server) public static void beginPlace(Block result, Team team, int x, int y, int rotation){ if(!validPlace(result, team, x, y, rotation)){ diff --git a/core/src/mindustry/world/CachedTile.java b/core/src/mindustry/world/CachedTile.java index 3c14ade132..5777ece759 100644 --- a/core/src/mindustry/world/CachedTile.java +++ b/core/src/mindustry/world/CachedTile.java @@ -21,7 +21,7 @@ public class CachedTile extends Tile{ } @Override - protected void changeEntity(Team team, Prov entityprov, int rotation){ + protected void changeBuild(Team team, Prov entityprov, int rotation){ build = null; Block block = block(); diff --git a/core/src/mindustry/world/Tile.java b/core/src/mindustry/world/Tile.java index 8fdfd6c009..18696d8930 100644 --- a/core/src/mindustry/world/Tile.java +++ b/core/src/mindustry/world/Tile.java @@ -45,7 +45,7 @@ public class Tile implements Position, QuadTreeObject, Displayable{ this.block = wall; //update entity and create it if needed - changeEntity(Team.derelict, wall::newBuilding, 0); + changeBuild(Team.derelict, wall::newBuilding, 0); changed(); } @@ -186,7 +186,7 @@ public class Tile implements Position, QuadTreeObject, Displayable{ this.block = type; preChanged(); - changeEntity(team, entityprov, (byte)Mathf.mod(rotation, 4)); + changeBuild(team, entityprov, (byte)Mathf.mod(rotation, 4)); if(build != null){ build.team(team); @@ -430,15 +430,15 @@ public class Tile implements Position, QuadTreeObject, Displayable{ getHitbox(rect); } - public Tile getNearby(Point2 relative){ + public Tile nearby(Point2 relative){ return world.tile(x + relative.x, y + relative.y); } - public Tile getNearby(int dx, int dy){ + public Tile nearby(int dx, int dy){ return world.tile(x + dx, y + dy); } - public Tile getNearby(int rotation){ + public Tile nearby(int rotation){ if(rotation == 0) return world.tile(x + 1, y); if(rotation == 1) return world.tile(x, y + 1); if(rotation == 2) return world.tile(x - 1, y); @@ -446,7 +446,7 @@ public class Tile implements Position, QuadTreeObject, Displayable{ return null; } - public Building getNearbyEntity(int rotation){ + public Building nearbyBuild(int rotation){ if(rotation == 0) return world.build(x + 1, y); if(rotation == 1) return world.build(x, y + 1); if(rotation == 2) return world.build(x - 1, y); @@ -503,7 +503,7 @@ public class Tile implements Position, QuadTreeObject, Displayable{ } } - protected void changeEntity(Team team, Prov entityprov, int rotation){ + protected void changeBuild(Team team, Prov entityprov, int rotation){ if(build != null){ int size = build.block.size; build.remove(); diff --git a/core/src/mindustry/world/blocks/Autotiler.java b/core/src/mindustry/world/blocks/Autotiler.java index 2989436fac..027ac93b31 100644 --- a/core/src/mindustry/world/blocks/Autotiler.java +++ b/core/src/mindustry/world/blocks/Autotiler.java @@ -133,7 +133,7 @@ public interface Autotiler{ for(int i = 0; i < 4; i++){ int realDir = Mathf.mod(rotation - i, 4); - if(blends(tile, rotation, directional, i, world) && (tile != null && tile.getNearbyEntity(realDir) != null && !tile.getNearbyEntity(realDir).block.squareSprite)){ + if(blends(tile, rotation, directional, i, world) && (tile != null && tile.nearbyBuild(realDir) != null && !tile.nearbyBuild(realDir).block.squareSprite)){ blendresult[4] |= (1 << i); } } @@ -194,7 +194,7 @@ public interface Autotiler{ // TODO docs -- use for direction? default boolean blends(Tile tile, int rotation, int direction){ - Building other = tile.getNearbyEntity(Mathf.mod(rotation - direction, 4)); + Building other = tile.nearbyBuild(Mathf.mod(rotation - direction, 4)); return other != null && other.team == tile.team() && blends(tile, rotation, other.tileX(), other.tileY(), other.rotation, other.block); } diff --git a/core/src/mindustry/world/blocks/ConstructBlock.java b/core/src/mindustry/world/blocks/ConstructBlock.java index c228397a32..cefdfa6887 100644 --- a/core/src/mindustry/world/blocks/ConstructBlock.java +++ b/core/src/mindustry/world/blocks/ConstructBlock.java @@ -42,7 +42,7 @@ public class ConstructBlock extends Block{ consBlocks[size - 1] = this; } - /** Returns a BuildBlock by size. */ + /** Returns a ConstructBlock by size. */ public static ConstructBlock get(int size){ if(size > maxSize) throw new IllegalArgumentException("No. Don't place ConstructBlock of size greater than " + maxSize); return consBlocks[size - 1]; diff --git a/core/src/mindustry/world/blocks/distribution/ItemBridge.java b/core/src/mindustry/world/blocks/distribution/ItemBridge.java index 2d09c69eba..87fcb11a7e 100644 --- a/core/src/mindustry/world/blocks/distribution/ItemBridge.java +++ b/core/src/mindustry/world/blocks/distribution/ItemBridge.java @@ -202,7 +202,7 @@ public class ItemBridge extends Block{ for(int i = 1; i <= range; i++){ for(int j = 0; j < 4; j++){ - Tile other = tile.getNearby(Geometry.d4[j].x * i, Geometry.d4[j].y * i); + Tile other = tile.nearby(Geometry.d4[j].x * i, Geometry.d4[j].y * i); if(linkValid(tile, other)){ boolean linked = other.pos() == link; diff --git a/core/src/mindustry/world/blocks/distribution/PayloadConveyor.java b/core/src/mindustry/world/blocks/distribution/PayloadConveyor.java index 7c0bbb7821..08035d9c84 100644 --- a/core/src/mindustry/world/blocks/distribution/PayloadConveyor.java +++ b/core/src/mindustry/world/blocks/distribution/PayloadConveyor.java @@ -87,7 +87,7 @@ public class PayloadConveyor extends Block{ } int ntrns = 1 + size/2; - Tile next = tile.getNearby(Geometry.d4(rotation).x * ntrns, Geometry.d4(rotation).y * ntrns); + Tile next = tile.nearby(Geometry.d4(rotation).x * ntrns, Geometry.d4(rotation).y * ntrns); blocked = (next != null && next.solid() && !next.block().outputsPayload) || (this.next != null && (this.next.rotation + 2)%4 == rotation); } diff --git a/core/src/mindustry/world/blocks/environment/Floor.java b/core/src/mindustry/world/blocks/environment/Floor.java index a70056717a..cacf375cef 100644 --- a/core/src/mindustry/world/blocks/environment/Floor.java +++ b/core/src/mindustry/world/blocks/environment/Floor.java @@ -183,7 +183,7 @@ public class Floor extends Block{ for(int i = 0; i < 8; i++){ Point2 point = Geometry.d8[i]; - Tile other = tile.getNearby(point); + Tile other = tile.nearby(point); if(other != null && other.floor().cacheLayer == layer && other.floor().edges() != null){ if(!blended.getAndSet(other.floor().id)){ blenders.add(other.floor()); @@ -200,7 +200,7 @@ public class Floor extends Block{ for(int i = 0; i < 8; i++){ Point2 point = Geometry.d8[i]; - Tile other = tile.getNearby(point); + Tile other = tile.nearby(point); if(other != null && doEdge(other.floor()) && other.floor().cacheLayer == cacheLayer && other.floor().edges() != null){ if(!blended.getAndSet(other.floor().id)){ blenders.add(other.floor()); @@ -217,7 +217,7 @@ public class Floor extends Block{ for(Block block : blenders){ for(int i = 0; i < 8; i++){ Point2 point = Geometry.d8[i]; - Tile other = tile.getNearby(point); + Tile other = tile.nearby(point); if(other != null && other.floor() == block){ TextureRegion region = edge((Floor)block, 1 - point.x, 1 - point.y); Draw.rect(region, tile.worldx(), tile.worldy()); @@ -229,7 +229,7 @@ public class Floor extends Block{ //'new' style of edges with shadows instead of colors, not used currently protected void drawEdgesFlat(Tile tile, boolean sameLayer){ for(int i = 0; i < 4; i++){ - Tile other = tile.getNearby(i); + Tile other = tile.nearby(i); if(other != null && doEdge(other.floor())){ Color color = other.floor().mapColor; Draw.color(color.r, color.g, color.b, 1f); diff --git a/core/src/mindustry/world/blocks/environment/StaticTree.java b/core/src/mindustry/world/blocks/environment/StaticTree.java index 78c6133d2f..9b1a7063f4 100644 --- a/core/src/mindustry/world/blocks/environment/StaticTree.java +++ b/core/src/mindustry/world/blocks/environment/StaticTree.java @@ -21,7 +21,7 @@ public class StaticTree extends StaticWall{ float oy = 0; for(int i = 0; i < 4; i++){ - if(tile.getNearby(i) != null && tile.getNearby(i).block() instanceof StaticWall){ + if(tile.nearby(i) != null && tile.nearby(i).block() instanceof StaticWall){ if(i == 0){ r.setWidth(r.width - crop);