From c716c167467cb373cb763a6fea1183956a286bae Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 11 Jan 2021 10:11:31 -0500 Subject: [PATCH] Fixed #4305 / Fixed #4309 --- core/src/mindustry/content/Fx.java | 2 +- .../mindustry/entities/comp/BuilderComp.java | 19 ++++++++++++++++--- .../defense/turrets/TractorBeamTurret.java | 1 + 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/core/src/mindustry/content/Fx.java b/core/src/mindustry/content/Fx.java index c862885e2f..7edc5d5cc3 100644 --- a/core/src/mindustry/content/Fx.java +++ b/core/src/mindustry/content/Fx.java @@ -896,7 +896,7 @@ public class Fx{ }); }), - dynamicExplosion = new Effect(30, e -> { + dynamicExplosion = new Effect(30, 100f, e -> { float intensity = e.rotation; e.scaled(5 + intensity * 2, i -> { diff --git a/core/src/mindustry/entities/comp/BuilderComp.java b/core/src/mindustry/entities/comp/BuilderComp.java index a5c55485ec..12f5428324 100644 --- a/core/src/mindustry/entities/comp/BuilderComp.java +++ b/core/src/mindustry/entities/comp/BuilderComp.java @@ -1,6 +1,7 @@ package mindustry.entities.comp; import arc.*; +import arc.func.*; import arc.graphics.*; import arc.graphics.g2d.*; import arc.math.*; @@ -136,10 +137,17 @@ abstract class BuilderComp implements Posc, Teamc, Rotc{ /** Draw all current build plans. Does not draw the beam effect, only the positions. */ void drawBuildPlans(){ + Boolf skip = plan -> plan.progress > 0.01f || (buildPlan() == plan && plan.initialized && (within(plan.x * tilesize, plan.y * tilesize, buildingRange) || state.isEditor())); - for(BuildPlan plan : plans){ - if(plan.progress > 0.01f || (buildPlan() == plan && plan.initialized && (within(plan.x * tilesize, plan.y * tilesize, buildingRange) || state.isEditor()))) continue; - drawPlan(plan, 1f); + for(int i = 0; i < 2; i++){ + for(BuildPlan plan : plans){ + if(skip.get(plan)) continue; + if(i == 0){ + drawPlan(plan, 1f); + }else{ + drawPlanTop(plan, 1f); + } + } } Draw.reset(); @@ -153,7 +161,11 @@ abstract class BuilderComp implements Posc, Teamc, Rotc{ request.block.drawPlan(request, control.input.allRequests(), Build.validPlace(request.block, team, request.x, request.y, request.rotation) || control.input.requestMatches(request), alpha); + } + } + void drawPlanTop(BuildPlan request, float alpha){ + if(!request.breaking){ Draw.reset(); Draw.mixcol(Color.white, 0.24f + Mathf.absin(Time.globalTime, 6f, 0.28f)); Draw.alpha(alpha); @@ -251,6 +263,7 @@ abstract class BuilderComp implements Posc, Teamc, Rotc{ if(core != null && active && !isLocal() && !(tile.block() instanceof ConstructBlock)){ Draw.z(Layer.plans - 1f); drawPlan(plan, 0.5f); + drawPlanTop(plan, 0.5f); Draw.z(Layer.flyingUnit); } diff --git a/core/src/mindustry/world/blocks/defense/turrets/TractorBeamTurret.java b/core/src/mindustry/world/blocks/defense/turrets/TractorBeamTurret.java index 34e960ea2d..162cb1cc70 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/TractorBeamTurret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/TractorBeamTurret.java @@ -46,6 +46,7 @@ public class TractorBeamTurret extends BaseTurret{ //disabled due to version mismatch problems acceptCoolant = false; + expanded = true; } @Override