diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 644e336282..aca308463d 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -843,6 +843,7 @@ bar.output = Output bar.strength = [stat]{0}[lightgray]x strength units.processorcontrol = [lightgray]Processor Controlled +units.nocontroller = [lightgray]\ue815 No Controller bullet.damage = [stat]{0}[lightgray] damage bullet.splashdamage = [stat]{0}[lightgray] area dmg ~[stat] {1}[lightgray] tiles @@ -862,7 +863,7 @@ bullet.reload = [stat]{0}[lightgray]x fire rate bullet.range = [stat]{0}[lightgray] tiles range unit.blocks = blocks -unit.blockssquared = blocks² +unit.blockssquared = blocks² unit.powersecond = power units/second unit.tilessecond = tiles/second unit.liquidsecond = liquid units/second diff --git a/core/src/mindustry/content/Fx.java b/core/src/mindustry/content/Fx.java index 44f6514f44..89e15a6516 100644 --- a/core/src/mindustry/content/Fx.java +++ b/core/src/mindustry/content/Fx.java @@ -190,9 +190,17 @@ public class Fx{ }), upgradeCore = new Effect(120f, e -> { - color(Color.white, Pal.accent, e.fin()); + if(!(e.data instanceof Block block)) return; + + mixcol(Tmp.c1.set(Color.white).lerp(Pal.accent, e.fin()), 1f); alpha(e.fout()); - Fill.square(e.x, e.y, tilesize / 2f * e.rotation); + rect(block.fullIcon, e.x, e.y); + }).layer(Layer.turret - 5f), + + upgradeCoreBloom = new Effect(80f, e -> { + color(Pal.accent); + stroke(4f * e.fout()); + Lines.square(e.x, e.y, tilesize / 2f * e.rotation + 2f); }), placeBlock = new Effect(16, e -> { diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index 4378828ea1..24ec257ec4 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -2816,7 +2816,7 @@ public class UnitTypes{ rotateSpeed = 0.4f; rotate = true; - x = 43/4f; + x = 43 / 4f; y = -20f / 4f; shootY = 39 / 4f; shootX = -5f / 4f; diff --git a/core/src/mindustry/entities/Units.java b/core/src/mindustry/entities/Units.java index e3bd7b850c..17ffc49d56 100644 --- a/core/src/mindustry/entities/Units.java +++ b/core/src/mindustry/entities/Units.java @@ -125,7 +125,11 @@ public class Units{ * @return whether the target is invalid */ public static boolean invalidateTarget(Posc target, Team team, float x, float y, float range){ - return target == null || (range != Float.MAX_VALUE && !target.within(x, y, range + (target instanceof Sized hb ? hb.hitSize()/2f : 0f))) || (target instanceof Teamc t && t.team() == team) || (target instanceof Healthc h && !h.isValid()); + return target == null || + (range != Float.MAX_VALUE && !target.within(x, y, range + (target instanceof Sized hb ? hb.hitSize()/2f : 0f))) || + (target instanceof Teamc t && t.team() == team) || + (target instanceof Healthc h && !h.isValid()) || + (target instanceof Unit u && !u.type.targetable); } /** See {@link #invalidateTarget(Posc, Team, float, float, float)} */ @@ -253,7 +257,7 @@ public class Units{ cdist = 0f; nearbyEnemies(team, x - range, y - range, range*2f, range*2f, e -> { - if(e.dead() || !predicate.get(e) || e.team == Team.derelict) return; + if(e.dead() || !predicate.get(e) || e.team == Team.derelict || !e.type.targetable) return; float dst2 = e.dst2(x, y) - (e.hitSize * e.hitSize); if(dst2 < range*range && (result == null || dst2 < cdist)){ @@ -274,7 +278,7 @@ public class Units{ cpriority = -99999f; nearbyEnemies(team, x - range, y - range, range*2f, range*2f, e -> { - if(e.dead() || !predicate.get(e) || e.team == Team.derelict || !e.within(x, y, range + e.hitSize/2f)) return; + if(e.dead() || !predicate.get(e) || e.team == Team.derelict || !e.within(x, y, range + e.hitSize/2f) || !e.type.targetable) return; float cost = sort.cost(e, x, y); if((result == null || cost < cdist) && e.type.targetPriority >= cpriority){ diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index 6f25251e88..f4db78b718 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -85,6 +85,8 @@ public class UnitType extends UnlockableContent{ public float buildBeamOffset = 3.8f; /** WIP: Units of low priority will always be ignored in favor of those with higher priority, regardless of distance. */ public float targetPriority = 0f; + /** If false, this unit is not targeted by anything. */ + public boolean targetable = true; public boolean drawBuildBeam = true; public boolean rotateToBuilding = true; public int commandLimit = 8; @@ -290,6 +292,10 @@ public class UnitType extends UnlockableContent{ } }).growX(); + if(coreUnitDock && !defaultAI){ + table.row().add("@units.nocontroller").growX().left().row(); + } + if(unit.controller() instanceof LogicAI){ table.row(); table.add(Blocks.microProcessor.emoji() + " " + Core.bundle.get("units.processorcontrol")).growX().wrap().left(); diff --git a/core/src/mindustry/world/blocks/storage/CoreBlock.java b/core/src/mindustry/world/blocks/storage/CoreBlock.java index b94fceba31..63505ce503 100644 --- a/core/src/mindustry/world/blocks/storage/CoreBlock.java +++ b/core/src/mindustry/world/blocks/storage/CoreBlock.java @@ -134,7 +134,8 @@ public class CoreBlock extends StorageBlock{ if(previous instanceof CoreBlock){ tile.setBlock(this, tile.team()); Fx.placeBlock.at(tile, tile.block().size); - Fx.upgradeCore.at(tile, tile.block().size); + Fx.upgradeCore.at(tile.drawx(), tile.drawy(), 0f, tile.block()); + Fx.upgradeCoreBloom.at(tile, tile.block().size); //set up the correct items if(nextItems != null){