Anuken/Mindustry-Suggestions/issues/2810

This commit is contained in:
Anuken
2021-08-07 12:22:34 -04:00
parent d3745d043c
commit 6cb2c0e8a7
3 changed files with 33 additions and 6 deletions

View File

@@ -429,7 +429,7 @@ public class UnitTypes implements ContentList{
lowAltitude = true; lowAltitude = true;
riseSpeed = 0.02f; riseSpeed = 0.02f;
health = 8000f; health = 8200f;
armor = 9f; armor = 9f;
canBoost = true; canBoost = true;
landShake = 4f; landShake = 4f;
@@ -454,7 +454,7 @@ public class UnitTypes implements ContentList{
cooldownTime = 200f; cooldownTime = 200f;
bullet = new ContinuousLaserBulletType(){{ bullet = new ContinuousLaserBulletType(){{
damage = 32f; damage = 35f;
length = 180f; length = 180f;
hitEffect = Fx.hitMeltHeal; hitEffect = Fx.hitMeltHeal;
drawSize = 420f; drawSize = 420f;

View File

@@ -32,6 +32,8 @@ public class Conveyor extends Block implements Autotiler{
public float speed = 0f; public float speed = 0f;
public float displayedSpeed = 0f; public float displayedSpeed = 0f;
public @Nullable Block junctionReplacement, bridgeReplacement;
public Conveyor(String name){ public Conveyor(String name){
super(name); super(name);
rotate = true; rotate = true;
@@ -55,6 +57,14 @@ public class Conveyor extends Block implements Autotiler{
stats.add(Stat.itemsMoved, displayedSpeed, StatUnit.itemsSecond); stats.add(Stat.itemsMoved, displayedSpeed, StatUnit.itemsSecond);
} }
@Override
public void init(){
super.init();
if(junctionReplacement == null) junctionReplacement = Blocks.junction;
if(bridgeReplacement == null || !(bridgeReplacement instanceof ItemBridge)) bridgeReplacement = Blocks.itemBridge;
}
@Override @Override
public void drawRequestRegion(BuildPlan req, Eachable<BuildPlan> list){ public void drawRequestRegion(BuildPlan req, Eachable<BuildPlan> list){
int[] bits = getTiling(req, list); int[] bits = getTiling(req, list);
@@ -79,7 +89,9 @@ public class Conveyor extends Block implements Autotiler{
@Override @Override
public void handlePlacementLine(Seq<BuildPlan> plans){ public void handlePlacementLine(Seq<BuildPlan> plans){
Placement.calculateBridges(plans, (ItemBridge)Blocks.itemBridge); if(bridgeReplacement == null) return;
Placement.calculateBridges(plans, (ItemBridge)bridgeReplacement);
} }
@Override @Override
@@ -94,12 +106,14 @@ public class Conveyor extends Block implements Autotiler{
@Override @Override
public Block getReplacement(BuildPlan req, Seq<BuildPlan> requests){ public Block getReplacement(BuildPlan req, Seq<BuildPlan> requests){
if(junctionReplacement == null) return this;
Boolf<Point2> cont = p -> requests.contains(o -> o.x == req.x + p.x && o.y == req.y + p.y && (req.block instanceof Conveyor || req.block instanceof Junction)); Boolf<Point2> cont = p -> requests.contains(o -> o.x == req.x + p.x && o.y == req.y + p.y && (req.block instanceof Conveyor || req.block instanceof Junction));
return cont.get(Geometry.d4(req.rotation)) && return cont.get(Geometry.d4(req.rotation)) &&
cont.get(Geometry.d4(req.rotation - 2)) && cont.get(Geometry.d4(req.rotation - 2)) &&
req.tile() != null && req.tile() != null &&
req.tile().block() instanceof Conveyor && req.tile().block() instanceof Conveyor &&
Mathf.mod(req.tile().build.rotation - req.rotation, 2) == 1 ? Blocks.junction : this; Mathf.mod(req.tile().build.rotation - req.rotation, 2) == 1 ? junctionReplacement : this;
} }
public class ConveyorBuild extends Building implements ChainedBuilding{ public class ConveyorBuild extends Building implements ChainedBuilding{

View File

@@ -31,6 +31,7 @@ public class Conduit extends LiquidBlock implements Autotiler{
public @Load("@-cap") TextureRegion capRegion; public @Load("@-cap") TextureRegion capRegion;
public boolean leaks = true; public boolean leaks = true;
public @Nullable Block junctionReplacement, bridgeReplacement;
public Conduit(String name){ public Conduit(String name){
super(name); super(name);
@@ -41,6 +42,14 @@ public class Conduit extends LiquidBlock implements Autotiler{
noUpdateDisabled = true; noUpdateDisabled = true;
} }
@Override
public void init(){
super.init();
if(junctionReplacement == null) junctionReplacement = Blocks.liquidJunction;
if(bridgeReplacement == null || !(bridgeReplacement instanceof ItemBridge)) bridgeReplacement = Blocks.bridgeConduit;
}
@Override @Override
public void drawRequestRegion(BuildPlan req, Eachable<BuildPlan> list){ public void drawRequestRegion(BuildPlan req, Eachable<BuildPlan> list){
int[] bits = getTiling(req, list); int[] bits = getTiling(req, list);
@@ -58,12 +67,14 @@ public class Conduit extends LiquidBlock implements Autotiler{
@Override @Override
public Block getReplacement(BuildPlan req, Seq<BuildPlan> requests){ public Block getReplacement(BuildPlan req, Seq<BuildPlan> requests){
if(junctionReplacement == null) return this;
Boolf<Point2> cont = p -> requests.contains(o -> o.x == req.x + p.x && o.y == req.y + p.y && o.rotation == req.rotation && (req.block instanceof Conduit || req.block instanceof LiquidJunction)); Boolf<Point2> cont = p -> requests.contains(o -> o.x == req.x + p.x && o.y == req.y + p.y && o.rotation == req.rotation && (req.block instanceof Conduit || req.block instanceof LiquidJunction));
return cont.get(Geometry.d4(req.rotation)) && return cont.get(Geometry.d4(req.rotation)) &&
cont.get(Geometry.d4(req.rotation - 2)) && cont.get(Geometry.d4(req.rotation - 2)) &&
req.tile() != null && req.tile() != null &&
req.tile().block() instanceof Conduit && req.tile().block() instanceof Conduit &&
Mathf.mod(req.build().rotation - req.rotation, 2) == 1 ? Blocks.liquidJunction : this; Mathf.mod(req.build().rotation - req.rotation, 2) == 1 ? junctionReplacement : this;
} }
@Override @Override
@@ -73,7 +84,9 @@ public class Conduit extends LiquidBlock implements Autotiler{
@Override @Override
public void handlePlacementLine(Seq<BuildPlan> plans){ public void handlePlacementLine(Seq<BuildPlan> plans){
Placement.calculateBridges(plans, (ItemBridge)Blocks.bridgeConduit); if(bridgeReplacement == null) return;
Placement.calculateBridges(plans, (ItemBridge)bridgeReplacement);
} }
@Override @Override