From f9c0065a993d8ecaf563f3b0e9a1705cb2e60e58 Mon Sep 17 00:00:00 2001 From: Anuken Date: Fri, 18 Feb 2022 15:04:48 -0500 Subject: [PATCH] Minor tweaks --- core/src/mindustry/content/UnitTypes.java | 4 +++- core/src/mindustry/game/FogControl.java | 4 ++-- core/src/mindustry/graphics/FogRenderer.java | 13 ++++++++----- .../world/blocks/units/UnitCargoLoader.java | 2 +- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index 62bcf7e948..4e290046c8 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -2486,7 +2486,7 @@ public class UnitTypes{ heatColor = Color.valueOf("f9350f"); cooldownTime = 80f; - bullet = new BasicBulletType(8f, 140){{ + bullet = new BasicBulletType(8f, 130){{ sprite = "missile-large"; width = 9.5f; height = 15f; @@ -2502,6 +2502,8 @@ public class UnitTypes{ trailWidth = 3.1f; trailLength = 8; hitEffect = despawnEffect = Fx.blastExplosion; + splashDamageRadius = 20f; + splashDamage = 50f; }}; }}); diff --git a/core/src/mindustry/game/FogControl.java b/core/src/mindustry/game/FogControl.java index f945c047dc..29f2e37724 100644 --- a/core/src/mindustry/game/FogControl.java +++ b/core/src/mindustry/game/FogControl.java @@ -16,7 +16,7 @@ import static mindustry.Vars.*; public class FogControl implements CustomChunk{ private static volatile int ww, wh; - private static final int buildLight = 1; + private static final int buildLight = 0; private final Object sync = new Object(); /** indexed by [team] [packed array tile pos] */ @@ -42,7 +42,7 @@ public class FogControl implements CustomChunk{ if(state.rules.fog && read){ for(var build : Groups.build){ synchronized(events){ - events.add(FogEvent.get(build.tile.x, build.tile.y, buildLight, build.team.id)); + events.add(FogEvent.get(build.tile.x, build.tile.y, buildLight + build.block.size, build.team.id)); } } diff --git a/core/src/mindustry/graphics/FogRenderer.java b/core/src/mindustry/graphics/FogRenderer.java index 3536d53a20..d831efb195 100644 --- a/core/src/mindustry/graphics/FogRenderer.java +++ b/core/src/mindustry/graphics/FogRenderer.java @@ -11,12 +11,12 @@ import arc.util.*; import mindustry.game.EventType.*; import mindustry.game.*; import mindustry.gen.*; +import mindustry.world.*; import static mindustry.Vars.*; /** Highly experimental fog-of-war renderer. */ public class FogRenderer{ - private static final float fogSpeed = 1f; private FrameBuffer buffer = new FrameBuffer(); private LongSeq events = new LongSeq(); private Rect rect = new Rect(); @@ -27,9 +27,6 @@ public class FogRenderer{ lastTeam = null; events.clear(); }); - - //TODO draw fog when tile is placed? - } public void handleEvent(long event){ @@ -72,7 +69,13 @@ public class FogRenderer{ //process new fog events for(int i = 0; i < events.size; i++){ long e = events.items[i]; - Fill.poly(FogEvent.x(e) + 0.5f, FogEvent.y(e) + 0.5f, 20, FogEvent.radius(e) + 0.3f); + Tile tile = world.tile(FogEvent.x(e), FogEvent.y(e)); + float o = 0f; + //visual offset for uneven blocks; this is not reflected on the CPU, but it doesn't really matter + if(tile != null && tile.block().size % 2 == 0 && tile.isCenter()){ + o = 0.5f; + } + Fill.poly(FogEvent.x(e) + 0.5f + o, FogEvent.y(e) + 0.5f + o, 20, FogEvent.radius(e) + 0.3f); } events.clear(); diff --git a/core/src/mindustry/world/blocks/units/UnitCargoLoader.java b/core/src/mindustry/world/blocks/units/UnitCargoLoader.java index 147c618865..612ef966c1 100644 --- a/core/src/mindustry/world/blocks/units/UnitCargoLoader.java +++ b/core/src/mindustry/world/blocks/units/UnitCargoLoader.java @@ -61,7 +61,7 @@ public class UnitCargoLoader extends Block{ super.drawPlace(x, y, rotation, valid); if(!Units.canCreate(Vars.player.team(), unitType)){ - drawPlaceText(Core.bundle.get("@bar.cargounitcap"), x, y, valid); + drawPlaceText(Core.bundle.get("bar.cargounitcap"), x, y, valid); } }