diff --git a/core/assets/shaders/fog.frag b/core/assets/shaders/darkness.frag similarity index 100% rename from core/assets/shaders/fog.frag rename to core/assets/shaders/darkness.frag diff --git a/core/src/mindustry/content/Fx.java b/core/src/mindustry/content/Fx.java index da98b5e99a..16d6fd9fac 100644 --- a/core/src/mindustry/content/Fx.java +++ b/core/src/mindustry/content/Fx.java @@ -8,6 +8,7 @@ import arc.math.geom.*; import arc.struct.*; import arc.util.*; import mindustry.entities.*; +import mindustry.game.*; import mindustry.gen.*; import mindustry.graphics.*; import mindustry.type.*; @@ -526,7 +527,7 @@ public class Fx{ color(); - Drawf.light(e.x, e.y, 20f * e.fslope(), Pal.lightFlame, 0.5f); + Drawf.light(Team.derelict, e.x, e.y, 20f * e.fslope(), Pal.lightFlame, 0.5f); }), fireSmoke = new Effect(35f, e -> { diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index 6191f882bf..ea9babae9c 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -166,7 +166,7 @@ public abstract class BulletType extends Content{ } public void drawLight(Bulletc b){ - Drawf.light(b, lightRadius, lightColor, lightOpacity); + Drawf.light(b.team(), b, lightRadius, lightColor, lightOpacity); } public void init(Bulletc b){ diff --git a/core/src/mindustry/entities/bullet/ContinuousLaserBulletType.java b/core/src/mindustry/entities/bullet/ContinuousLaserBulletType.java index 5166c800b8..ea77877b76 100644 --- a/core/src/mindustry/entities/bullet/ContinuousLaserBulletType.java +++ b/core/src/mindustry/entities/bullet/ContinuousLaserBulletType.java @@ -72,7 +72,7 @@ public class ContinuousLaserBulletType extends BulletType{ Tmp.v1.trns(b.rotation(), baseLen * 1.1f); - Drawf.light(b.x(), b.y(), b.x() + Tmp.v1.x, b.y() + Tmp.v1.y, 40, Color.orange, 0.7f); + Drawf.light(b.team(), b.x(), b.y(), b.x() + Tmp.v1.x, b.y() + Tmp.v1.y, 40, Color.orange, 0.7f); Draw.reset(); } diff --git a/core/src/mindustry/entities/bullet/LaserBulletType.java b/core/src/mindustry/entities/bullet/LaserBulletType.java index cf54709f3c..c9a3977f77 100644 --- a/core/src/mindustry/entities/bullet/LaserBulletType.java +++ b/core/src/mindustry/entities/bullet/LaserBulletType.java @@ -93,7 +93,7 @@ public class LaserBulletType extends BulletType{ Draw.reset(); Tmp.v1.trns(b.rotation(), baseLen * 1.1f); - Drawf.light(b.x(), b.y(), b.x() + Tmp.v1.x, b.y() + Tmp.v1.y, width * 1.4f * b.fout(), colors[0], 0.6f); + Drawf.light(b.team(), b.x(), b.y(), b.x() + Tmp.v1.x, b.y() + Tmp.v1.y, width * 1.4f * b.fout(), colors[0], 0.6f); } @Override diff --git a/core/src/mindustry/entities/comp/MinerComp.java b/core/src/mindustry/entities/comp/MinerComp.java index dff81a95a1..eca9ef3ef6 100644 --- a/core/src/mindustry/entities/comp/MinerComp.java +++ b/core/src/mindustry/entities/comp/MinerComp.java @@ -94,7 +94,7 @@ abstract class MinerComp implements Itemsc, Posc, Teamc, Rotc, Drawc{ Draw.color(Color.lightGray, Color.white, 1f - flashScl + Mathf.absin(Time.time(), 0.5f, flashScl)); - Drawf.laser(Core.atlas.find("minelaser"), Core.atlas.find("minelaser-end"), px, py, ex, ey, 0.75f); + Drawf.laser(team(), Core.atlas.find("minelaser"), Core.atlas.find("minelaser-end"), px, py, ex, ey, 0.75f); //TODO hack? if(isLocal()){ diff --git a/core/src/mindustry/entities/comp/PuddleComp.java b/core/src/mindustry/entities/comp/PuddleComp.java index f2cd086d7e..909d074f19 100644 --- a/core/src/mindustry/entities/comp/PuddleComp.java +++ b/core/src/mindustry/entities/comp/PuddleComp.java @@ -8,13 +8,14 @@ import arc.util.*; import mindustry.annotations.Annotations.*; import mindustry.content.*; import mindustry.entities.*; +import mindustry.game.*; import mindustry.gen.*; import mindustry.graphics.*; import mindustry.type.*; import mindustry.world.*; -import static mindustry.Vars.world; -import static mindustry.entities.Puddles.maxLiquid; +import static mindustry.Vars.*; +import static mindustry.entities.Puddles.*; @EntityDef(value = {Puddlec.class}, pooled = true) @Component @@ -111,7 +112,7 @@ abstract class PuddleComp implements Posc, Puddlec, Drawc{ if(liquid.lightColor.a > 0.001f && f > 0){ Color color = liquid.lightColor; float opacity = color.a * f; - Drawf.light(tile.drawx(), tile.drawy(), 30f * f, color, opacity * 0.8f); + Drawf.light(Team.derelict, tile.drawx(), tile.drawy(), 30f * f, color, opacity * 0.8f); } } diff --git a/core/src/mindustry/entities/comp/TileComp.java b/core/src/mindustry/entities/comp/TileComp.java index b56cd00edd..0198ec1b34 100644 --- a/core/src/mindustry/entities/comp/TileComp.java +++ b/core/src/mindustry/entities/comp/TileComp.java @@ -758,7 +758,7 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree float fract = 1f; float opacity = color.a * fract; if(opacity > 0.001f){ - Drawf.light(x, y, block.size * 30f * fract, color, opacity); + Drawf.light(team, x, y, block.size * 30f * fract, color, opacity); } } } diff --git a/core/src/mindustry/game/Rules.java b/core/src/mindustry/game/Rules.java index bb9e42b278..eea56a5c65 100644 --- a/core/src/mindustry/game/Rules.java +++ b/core/src/mindustry/game/Rules.java @@ -16,7 +16,7 @@ import mindustry.world.*; * Does not store game state, just configuration. */ public class Rules{ - /** Whether ever team has infinite resources and instant build speed. */ + /** Whether every team has infinite resources and instant build speed. */ public boolean infiniteResources; /** Team-specific rules. */ public TeamRules teams = new TeamRules(); @@ -76,8 +76,11 @@ public class Rules{ public Seq weather = new Seq<>(1); /** Blocks that cannot be placed. */ public ObjectSet bannedBlocks = new ObjectSet<>(); - /** Whether everything is dark. Enables lights. Experimental. */ + /** Whether ambient lighting is enabled. */ public boolean lighting = false; + /** Whether enemy lighting is visible. + * If lighting is enabled and this is false, a fog-of-war effect is partially achieved. */ + public boolean enemyLights = true; /** Ambient light color, used when lighting is enabled. */ public Color ambientLight = new Color(0.01f, 0.01f, 0.04f, 0.99f); /** Multiplier for solar panel power output. diff --git a/core/src/mindustry/graphics/BlockRenderer.java b/core/src/mindustry/graphics/BlockRenderer.java index 6610f6341e..af2b66700f 100644 --- a/core/src/mindustry/graphics/BlockRenderer.java +++ b/core/src/mindustry/graphics/BlockRenderer.java @@ -27,11 +27,12 @@ public class BlockRenderer implements Disposable{ public final FloorRenderer floor = new FloorRenderer(); private Seq tileview = new Seq<>(false, initialRequests, Tile.class); + private Seq lightview = new Seq<>(false, initialRequests, Tile.class); private int lastCamX, lastCamY, lastRangeX, lastRangeY; private float brokenFade = 0f; private FrameBuffer shadows = new FrameBuffer(); - private FrameBuffer fog = new FrameBuffer(); + private FrameBuffer dark = new FrameBuffer(); private Seq outArray2 = new Seq<>(); private Seq shadowEvents = new Seq<>(); private IntSet processedEntities = new IntSet(); @@ -61,11 +62,11 @@ public class BlockRenderer implements Disposable{ Draw.color(); shadows.end(); - fog.getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear); - fog.resize(world.width(), world.height()); - fog.begin(); + dark.getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear); + dark.resize(world.width(), world.height()); + dark.begin(); Core.graphics.clear(Color.white); - Draw.proj().setOrtho(0, 0, fog.getWidth(), fog.getHeight()); + Draw.proj().setOrtho(0, 0, dark.getWidth(), dark.getHeight()); for(Tile tile : world.tiles){ float darkness = world.getDarkness(tile.x, tile.y); @@ -78,7 +79,7 @@ public class BlockRenderer implements Disposable{ Draw.flush(); Draw.color(); - fog.end(); + dark.end(); }); Events.on(TileChangeEvent.class, event -> { @@ -96,18 +97,8 @@ public class BlockRenderer implements Disposable{ } public void drawDarkness(){ - float ww = world.width() * tilesize, wh = world.height() * tilesize; - float x = camera.position.x + tilesize / 2f, y = camera.position.y + tilesize / 2f; - float u = (x - camera.width / 2f) / ww, - v = (y - camera.height / 2f) / wh, - u2 = (x + camera.width / 2f) / ww, - v2 = (y + camera.height / 2f) / wh; - - Tmp.tr1.set(fog.getTexture()); - Tmp.tr1.set(u, v2, u2, v); - - Draw.shader(Shaders.fog); - Draw.rect(Tmp.tr1, camera.position.x, camera.position.y, camera.width, camera.height); + Draw.shader(Shaders.darkness); + Draw.fbo(dark, world.width(), world.height(), tilesize); Draw.shader(); } @@ -167,7 +158,7 @@ public class BlockRenderer implements Disposable{ Tmp.tr1.set(shadows.getTexture()); Tmp.tr1.set(u, v2, u2, v); - Draw.shader(Shaders.fog); + Draw.shader(Shaders.darkness); Draw.rect(Tmp.tr1, camera.position.x, camera.position.y, camera.width, camera.height); Draw.shader(); } @@ -187,6 +178,7 @@ public class BlockRenderer implements Disposable{ } tileview.clear(); + lightview.clear(); processedEntities.clear(); int minx = Math.max(avgx - rangex - expandr, 0); @@ -208,6 +200,11 @@ public class BlockRenderer implements Disposable{ if(tile.entity != null) processedEntities.add(tile.entity.id()); } + //lights are drawn even in the expanded range + if(tile.entity != null){ + lightview.add(tile); + } + if(tile.entity != null && tile.entity.power() != null && tile.entity.power().links.size > 0){ for(Tilec other : tile.entity.getPowerConnections(outArray2)){ if(other.block() instanceof PowerNode){ //TODO need a generic way to render connections! @@ -228,6 +225,7 @@ public class BlockRenderer implements Disposable{ public void drawBlocks(){ drawDestroyed(); + //draw most tile stuff for(int i = 0; i < tileview.size; i++){ Tile tile = tileview.items[i]; Block block = tile.block(); @@ -250,8 +248,6 @@ public class BlockRenderer implements Disposable{ Draw.z(Layer.block); } - entity.drawLight(); - if(displayStatus && block.consumes.any()){ entity.drawStatus(); } @@ -259,13 +255,23 @@ public class BlockRenderer implements Disposable{ Draw.reset(); } } + + //draw lights + for(int i = 0; i < lightview.size; i++){ + Tile tile = lightview.items[i]; + Tilec entity = tile.entity; + + if(entity != null){ + entity.drawLight(); + } + } } @Override public void dispose(){ shadows.dispose(); - fog.dispose(); - shadows = fog = null; + dark.dispose(); + shadows = dark = null; floor.dispose(); } } diff --git a/core/src/mindustry/graphics/Drawf.java b/core/src/mindustry/graphics/Drawf.java index 61795a5e2c..b64ebc3877 100644 --- a/core/src/mindustry/graphics/Drawf.java +++ b/core/src/mindustry/graphics/Drawf.java @@ -8,6 +8,7 @@ import arc.math.geom.*; import arc.util.*; import mindustry.*; import mindustry.ctype.*; +import mindustry.game.*; import mindustry.gen.*; import mindustry.ui.*; import mindustry.world.*; @@ -48,24 +49,28 @@ public class Drawf{ return z; } - public static void light(float x, float y, float radius, Color color, float opacity){ - renderer.lights.add(x, y, radius, color, opacity); + public static void light(Team team, float x, float y, float radius, Color color, float opacity){ + if(allowLight(team)) renderer.lights.add(x, y, radius, color, opacity); } - public static void light(Position pos, float radius, Color color, float opacity){ - light(pos.getX(), pos.getY(), radius, color, opacity); + public static void light(Team team, Position pos, float radius, Color color, float opacity){ + light(team, pos.getX(), pos.getY(), radius, color, opacity); } - public static void light(float x, float y, TextureRegion region, Color color, float opacity){ - renderer.lights.add(x, y, region, color, opacity); + public static void light(Team team, float x, float y, TextureRegion region, Color color, float opacity){ + if(allowLight(team)) renderer.lights.add(x, y, region, color, opacity); } - public static void light(float x, float y, float x2, float y2){ - renderer.lights.line(x, y, x2, y2, 30, Color.orange, 0.3f); + public static void light(Team team, float x, float y, float x2, float y2){ + if(allowLight(team)) renderer.lights.line(x, y, x2, y2, 30, Color.orange, 0.3f); } - public static void light(float x, float y, float x2, float y2, float stroke, Color tint, float alpha){ - renderer.lights.line(x, y, x2, y2, stroke, tint, alpha); + public static void light(Team team, float x, float y, float x2, float y2, float stroke, Color tint, float alpha){ + if(allowLight(team)) renderer.lights.line(x, y, x2, y2, stroke, tint, alpha); + } + + private static boolean allowLight(Team team){ + return team == Team.derelict || team == Vars.player.team() || state.rules.enemyLights; } public static void selected(Tilec tile, Color color){ @@ -155,15 +160,15 @@ public class Drawf{ Draw.color(); } - public static void laser(TextureRegion line, TextureRegion edge, float x, float y, float x2, float y2, float scale){ - laser(line, edge, x, y, x2, y2, Mathf.angle(x2 - x, y2 - y), scale); + public static void laser(Team team, TextureRegion line, TextureRegion edge, float x, float y, float x2, float y2, float scale){ + laser(team, line, edge, x, y, x2, y2, Mathf.angle(x2 - x, y2 - y), scale); } - public static void laser(TextureRegion line, TextureRegion edge, float x, float y, float x2, float y2){ - laser(line, edge, x, y, x2, y2, Mathf.angle(x2 - x, y2 - y), 1f); + public static void laser(Team team, TextureRegion line, TextureRegion edge, float x, float y, float x2, float y2){ + laser(team, line, edge, x, y, x2, y2, Mathf.angle(x2 - x, y2 - y), 1f); } - public static void laser(TextureRegion line, TextureRegion edge, float x, float y, float x2, float y2, float rotation, float scale){ + public static void laser(Team team, TextureRegion line, TextureRegion edge, float x, float y, float x2, float y2, float rotation, float scale){ Tmp.v1.trns(rotation, 8f * scale * Draw.scl); Draw.rect(edge, x, y, edge.getWidth() * scale * Draw.scl, edge.getHeight() * scale * Draw.scl, rotation + 180); @@ -175,7 +180,7 @@ public class Drawf{ Lines.precise(false); Lines.stroke(1f); - Drawf.light(x, y, x2, y2); + light(team, x, y, x2, y2); } public static void tri(float x, float y, float width, float length, float rotation){ diff --git a/core/src/mindustry/graphics/Shaders.java b/core/src/mindustry/graphics/Shaders.java index bf89f8364b..cf4a827713 100644 --- a/core/src/mindustry/graphics/Shaders.java +++ b/core/src/mindustry/graphics/Shaders.java @@ -18,7 +18,7 @@ public class Shaders{ public static BlockBuild blockbuild; public static @Nullable ShieldShader shield; public static UnitBuild build; - public static FogShader fog; + public static DarknessShader darkness; public static LightShader light; public static SurfaceShader water, tar, slag; public static PlanetShader planet; @@ -38,7 +38,7 @@ public class Shaders{ t.printStackTrace(); } build = new UnitBuild(); - fog = new FogShader(); + darkness = new DarknessShader(); light = new LightShader(); water = new SurfaceShader("water"); tar = new SurfaceShader("tar"); @@ -131,9 +131,9 @@ public class Shaders{ } - public static class FogShader extends LoadShader{ - public FogShader(){ - super("fog", "default"); + public static class DarknessShader extends LoadShader{ + public DarknessShader(){ + super("darkness", "default"); } } diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index ead8327f1c..0f80ce6ba2 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -342,7 +342,7 @@ public class UnitType extends UnlockableContent{ public void drawLight(Unitc unit){ if(lightRadius > 0){ - Drawf.light(unit, lightRadius, lightColor, lightOpacity); + Drawf.light(unit.team(), unit, lightRadius, lightColor, lightOpacity); } } diff --git a/core/src/mindustry/world/blocks/defense/MendProjector.java b/core/src/mindustry/world/blocks/defense/MendProjector.java index dbaad0d859..cd8d979a56 100644 --- a/core/src/mindustry/world/blocks/defense/MendProjector.java +++ b/core/src/mindustry/world/blocks/defense/MendProjector.java @@ -110,7 +110,7 @@ public class MendProjector extends Block{ @Override public void drawLight(){ - Drawf.light(x, y, 50f * efficiency(), baseColor, 0.7f * efficiency()); + Drawf.light(team, x, y, 50f * efficiency(), baseColor, 0.7f * efficiency()); } @Override diff --git a/core/src/mindustry/world/blocks/defense/OverdriveProjector.java b/core/src/mindustry/world/blocks/defense/OverdriveProjector.java index a6f174eaf3..239c6ecaac 100644 --- a/core/src/mindustry/world/blocks/defense/OverdriveProjector.java +++ b/core/src/mindustry/world/blocks/defense/OverdriveProjector.java @@ -67,7 +67,7 @@ public class OverdriveProjector extends Block{ @Override public void drawLight(){ - Drawf.light(x, y, 50f * efficiency(), baseColor, 0.7f * efficiency()); + Drawf.light(team, x, y, 50f * efficiency(), baseColor, 0.7f * efficiency()); } @Override diff --git a/core/src/mindustry/world/blocks/power/ImpactReactor.java b/core/src/mindustry/world/blocks/power/ImpactReactor.java index 2c46a7b598..ec95ffd9de 100644 --- a/core/src/mindustry/world/blocks/power/ImpactReactor.java +++ b/core/src/mindustry/world/blocks/power/ImpactReactor.java @@ -115,8 +115,7 @@ public class ImpactReactor extends PowerGenerator{ @Override public void drawLight(){ - float fract = tile.ent().warmup; - Drawf.light(x, y, (110f + Mathf.absin(5, 5f)) * fract, Tmp.c1.set(plasma2).lerp(plasma1, Mathf.absin(7f, 0.2f)), 0.8f * fract); + Drawf.light(team, x, y, (110f + Mathf.absin(5, 5f)) * warmup, Tmp.c1.set(plasma2).lerp(plasma1, Mathf.absin(7f, 0.2f)), 0.8f * warmup); } @Override diff --git a/core/src/mindustry/world/blocks/power/ItemLiquidGenerator.java b/core/src/mindustry/world/blocks/power/ItemLiquidGenerator.java index 5820e4715a..4b4d99aac7 100644 --- a/core/src/mindustry/world/blocks/power/ItemLiquidGenerator.java +++ b/core/src/mindustry/world/blocks/power/ItemLiquidGenerator.java @@ -85,9 +85,7 @@ public class ItemLiquidGenerator extends PowerGenerator{ } public class ItemLiquidGeneratorEntity extends GeneratorEntity{ - public float explosiveness; - public float heat; - public float totalTime; + public float explosiveness, heat, totalTime; @Override public boolean productionValid(){ @@ -100,6 +98,8 @@ public class ItemLiquidGenerator extends PowerGenerator{ //Power amount is delta'd by PowerGraph class already. float calculationDelta = delta(); + heat = Mathf.lerpDelta(heat, generateTime >= 0.001f ? 1f : 0f, 0.05f); + if(!consValid()){ productionEfficiency = 0.0f; return; @@ -113,7 +113,6 @@ public class ItemLiquidGenerator extends PowerGenerator{ } } - heat = Mathf.lerpDelta(heat, generateTime >= 0.001f ? 1f : 0f, 0.05f); totalTime += heat; //liquid takes priority over solids @@ -175,7 +174,7 @@ public class ItemLiquidGenerator extends PowerGenerator{ @Override public void drawLight(){ - Drawf.light(x, y, (60f + Mathf.absin(10f, 5f)) * productionEfficiency * size, Color.orange, 0.5f); + Drawf.light(team, x, y, (60f + Mathf.absin(10f, 5f)) * size, Color.orange, 0.5f * heat); } } } diff --git a/core/src/mindustry/world/blocks/power/LightBlock.java b/core/src/mindustry/world/blocks/power/LightBlock.java index 0415b04a77..aa3a2e577e 100644 --- a/core/src/mindustry/world/blocks/power/LightBlock.java +++ b/core/src/mindustry/world/blocks/power/LightBlock.java @@ -50,7 +50,7 @@ public class LightBlock extends Block{ @Override public void drawLight(){ - Drawf.light(x, y, radius, Tmp.c1.set(color), brightness * efficiency()); + Drawf.light(team, x, y, radius, Tmp.c1.set(color), brightness * efficiency()); } @Override diff --git a/core/src/mindustry/world/blocks/power/NuclearReactor.java b/core/src/mindustry/world/blocks/power/NuclearReactor.java index ec2e8b6461..5e08c32b27 100644 --- a/core/src/mindustry/world/blocks/power/NuclearReactor.java +++ b/core/src/mindustry/world/blocks/power/NuclearReactor.java @@ -143,7 +143,7 @@ public class NuclearReactor extends PowerGenerator{ @Override public void drawLight(){ float fract = productionEfficiency; - Drawf.light(x, y, (90f + Mathf.absin(5, 5f)) * fract, Tmp.c1.set(lightColor).lerp(Color.scarlet, heat), 0.6f * fract); + Drawf.light(team, x, y, (90f + Mathf.absin(5, 5f)) * fract, Tmp.c1.set(lightColor).lerp(Color.scarlet, heat), 0.6f * fract); } @Override diff --git a/core/src/mindustry/world/blocks/power/PowerNode.java b/core/src/mindustry/world/blocks/power/PowerNode.java index e282f27db2..911827f247 100644 --- a/core/src/mindustry/world/blocks/power/PowerNode.java +++ b/core/src/mindustry/world/blocks/power/PowerNode.java @@ -11,6 +11,7 @@ import arc.util.ArcAnnotate.*; import arc.util.*; import mindustry.annotations.Annotations.*; import mindustry.entities.units.*; +import mindustry.game.*; import mindustry.gen.*; import mindustry.graphics.*; import mindustry.ui.*; @@ -131,7 +132,7 @@ public class PowerNode extends PowerBlock{ Draw.reset(); } - protected void drawLaser(float x1, float y1, float x2, float y2, float satisfaction, int size1, int size2){ + protected void drawLaser(Team team, float x1, float y1, float x2, float y2, float satisfaction, int size1, int size2){ float opacity = Core.settings.getInt("lasersopacity") / 100f; if(Mathf.zero(opacity)) return; @@ -148,7 +149,7 @@ public class PowerNode extends PowerBlock{ Draw.color(Color.white, Pal.powerLight, fract * 0.86f + Mathf.absin(3f, 0.1f)); Draw.alpha(opacity); - Drawf.laser(laser, laserEnd, x1, y1, x2, y2, 0.25f); + Drawf.laser(team, laser, laserEnd, x1, y1, x2, y2, 0.25f); Draw.color(); } @@ -213,7 +214,7 @@ public class PowerNode extends PowerBlock{ if(otherReq == null || otherReq.block == null) return; - drawLaser(req.drawx(), req.drawy(), otherReq.drawx(), otherReq.drawy(), 1f, size, otherReq.block.size); + drawLaser(player.team(), req.drawx(), req.drawy(), otherReq.drawx(), otherReq.drawy(), 1f, size, otherReq.block.size); } } } @@ -386,7 +387,7 @@ public class PowerNode extends PowerBlock{ } protected void drawLaserTo(Tilec target){ - drawLaser(x, y, target.x(), target.y(), power.graph.getSatisfaction(), size, target.block().size); + drawLaser(team, x, y, target.x(), target.y(), power.graph.getSatisfaction(), size, target.block().size); } @Override diff --git a/core/src/mindustry/world/blocks/power/ThermalGenerator.java b/core/src/mindustry/world/blocks/power/ThermalGenerator.java index 2eaa29da29..a4904a4616 100644 --- a/core/src/mindustry/world/blocks/power/ThermalGenerator.java +++ b/core/src/mindustry/world/blocks/power/ThermalGenerator.java @@ -45,7 +45,7 @@ public class ThermalGenerator extends PowerGenerator{ @Override public void drawLight(){ - Drawf.light(x, y, (40f + Mathf.absin(10f, 5f)) * productionEfficiency * size, Color.scarlet, 0.4f); + Drawf.light(team, x, y, (40f + Mathf.absin(10f, 5f)) * productionEfficiency * size, Color.scarlet, 0.4f); } @Override diff --git a/core/src/mindustry/world/blocks/production/GenericSmelter.java b/core/src/mindustry/world/blocks/production/GenericSmelter.java index 297803c694..bb1260d3c7 100644 --- a/core/src/mindustry/world/blocks/production/GenericSmelter.java +++ b/core/src/mindustry/world/blocks/production/GenericSmelter.java @@ -41,7 +41,7 @@ public class GenericSmelter extends GenericCrafter{ @Override public void drawLight(){ - Drawf.light(x, y, (60f + Mathf.absin(10f, 5f)) * warmup * size, flameColor, 0.65f); + Drawf.light(team, x, y, (60f + Mathf.absin(10f, 5f)) * warmup * size, flameColor, 0.65f); } } } diff --git a/core/src/mindustry/world/blocks/storage/CoreBlock.java b/core/src/mindustry/world/blocks/storage/CoreBlock.java index 3d6f59e7a2..5950be05c6 100644 --- a/core/src/mindustry/world/blocks/storage/CoreBlock.java +++ b/core/src/mindustry/world/blocks/storage/CoreBlock.java @@ -103,7 +103,7 @@ public class CoreBlock extends StorageBlock{ @Override public void drawLight(){ - Drawf.light(x, y, 30f * size, Pal.accent, 0.5f + Mathf.absin(20f, 0.1f)); + Drawf.light(team, x, y, 30f * size, Pal.accent, 0.5f + Mathf.absin(20f, 0.1f)); } @Override diff --git a/core/src/mindustry/world/blocks/units/RepairPoint.java b/core/src/mindustry/world/blocks/units/RepairPoint.java index 5ddb955955..971a9c6ec6 100644 --- a/core/src/mindustry/world/blocks/units/RepairPoint.java +++ b/core/src/mindustry/world/blocks/units/RepairPoint.java @@ -76,7 +76,7 @@ public class RepairPoint extends Block{ float len = 5f; Draw.color(Color.valueOf("e8ffd7")); - Drawf.laser(laser, laserEnd, + Drawf.laser(team, laser, laserEnd, x + Angles.trnsx(ang, len), y + Angles.trnsy(ang, len), target.x(), target.y(), strength); Draw.color();