diff --git a/core/assets-raw/sprites/units/quad.png b/core/assets-raw/sprites/units/quad.png index 878c8eed77..51b20f747d 100644 Binary files a/core/assets-raw/sprites/units/quad.png and b/core/assets-raw/sprites/units/quad.png differ diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index 5feae5c0e1..b3402b6f75 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -2157,6 +2157,7 @@ public class Blocks{ ambientSound = Sounds.smelter; ambientSoundVolume = 0.03f; + generateEffect = Fx.generatespark; consume(new ConsumeItemFlammable()); consume(new ConsumeItemExplode()); @@ -2183,6 +2184,7 @@ public class Blocks{ hasLiquids = true; size = 2; drawer.iconOverride = new String[]{"", "-turbine0", "-turbine1"}; + generateEffect = Fx.generatespark; ambientSound = Sounds.smelter; ambientSoundVolume = 0.06f; @@ -2201,6 +2203,7 @@ public class Blocks{ hasItems = true; size = 3; ambientSound = Sounds.steam; + generateEffect = Fx.generatespark; ambientSoundVolume = 0.03f; drawer = new DrawMulti(new DrawBlock(), new DrawWarmupRegion()); @@ -2215,6 +2218,7 @@ public class Blocks{ powerProduction = 4.5f; itemDuration = 60 * 14f; envEnabled = Env.any; + generateEffect = Fx.generatespark; drawer = new DrawMulti(new DrawBlock(), new DrawWarmupRegion()); consume(new ConsumeItemRadioactive()); diff --git a/core/src/mindustry/content/SerpuloTechTree.java b/core/src/mindustry/content/SerpuloTechTree.java index 391fe20fc8..4c2847b631 100644 --- a/core/src/mindustry/content/SerpuloTechTree.java +++ b/core/src/mindustry/content/SerpuloTechTree.java @@ -166,6 +166,12 @@ public class SerpuloTechTree{ }); }); + node(message, () -> { + + }); + + //logic disabled until further notice + /* node(microProcessor, () -> { node(switchBlock, () -> { node(message, () -> { @@ -188,7 +194,7 @@ public class SerpuloTechTree{ }); }); }); - }); + });*/ node(illuminator, () -> { diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index 546158308b..c5c0b421a5 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -967,7 +967,7 @@ public class UnitTypes{ targetAir = false; targetFlags = new BlockFlag[]{BlockFlag.generator, null}; hitSize = 7; - itemCapacity = 15; + itemCapacity = 0; weapons.add(new Weapon(){{ y = 0f; diff --git a/core/src/mindustry/entities/comp/BuildingComp.java b/core/src/mindustry/entities/comp/BuildingComp.java index f053bf2452..a1f3c43e4d 100644 --- a/core/src/mindustry/entities/comp/BuildingComp.java +++ b/core/src/mindustry/entities/comp/BuildingComp.java @@ -66,13 +66,14 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, transient byte cdump; transient int rotation; transient float payloadRotation; - transient boolean enabled = true; - transient float enabledControlTime; transient String lastAccessed; transient boolean wasDamaged; //used only by the indexer transient boolean wasVisible; //used only by the block renderer when fog is on (TODO replace with discovered check?) transient float visualLiquid; + transient boolean enabled = true; + transient @Nullable Building lastDisabler; + @Nullable PowerModule power; @Nullable ItemModule items; @Nullable LiquidModule liquids; @@ -82,8 +83,8 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, /** Same as efficiency, but for optional consumers only. */ transient float optionalEfficiency; - public transient float healSuppressionTime = -1f; - public transient float lastHealTime = -120f * 10f; + transient float healSuppressionTime = -1f; + transient float lastHealTime = -120f * 10f; private transient float timeScale = 1f, timeScaleDuration; private transient float dumpAccum; @@ -195,9 +196,6 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, if(version >= 1){ byte on = read.b(); this.enabled = on == 1; - if(!this.enabled){ - enabledControlTime = timeToUncontrol; - } } //get which modules should actually be read; this was added in version 2 @@ -497,7 +495,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, } public BlockStatus status(){ - if(enabledControlTime > 0 && !enabled){ + if(!enabled){ return BlockStatus.logicDisable; } @@ -1803,7 +1801,6 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, public void control(LAccess type, double p1, double p2, double p3, double p4){ if(type == LAccess.enabled){ enabled = !Mathf.zero((float)p1); - enabledControlTime = timeToUncontrol; } } @@ -1866,16 +1863,6 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, timeScale = 1f; } - //TODO unacceptable overhead? - if(!enabled && block.autoResetEnabled){ - noSleep(); - enabledControlTime -= Time.delta; - - if(enabledControlTime <= 0){ - enabled = true; - } - } - if(!allowUpdate()){ enabled = false; } diff --git a/core/src/mindustry/logic/LExecutor.java b/core/src/mindustry/logic/LExecutor.java index d22a39ae20..de483e1f6f 100644 --- a/core/src/mindustry/logic/LExecutor.java +++ b/core/src/mindustry/logic/LExecutor.java @@ -560,6 +560,11 @@ public class LExecutor{ public void run(LExecutor exec){ Object obj = exec.obj(target); if(obj instanceof Building b && (exec.privileged || (b.team == exec.team && exec.linkIds.contains(b.id)))){ + + if(type == LAccess.enabled && !exec.bool(p1)){ + b.lastDisabler = exec.build; + } + if(type.isObj && exec.var(p1).isobj){ b.control(type, exec.obj(p1), exec.num(p2), exec.num(p3), exec.num(p4)); }else{ diff --git a/core/src/mindustry/logic/LStatements.java b/core/src/mindustry/logic/LStatements.java index 0488e68444..40809d7cdb 100644 --- a/core/src/mindustry/logic/LStatements.java +++ b/core/src/mindustry/logic/LStatements.java @@ -1244,13 +1244,6 @@ public class LStatements{ rebuild(table); } - /* - unitBuildSpeed, - unitDamage, - blockHealth, - blockDamage - */ - void rebuild(Table table){ table.clearChildren(); diff --git a/core/src/mindustry/type/Weapon.java b/core/src/mindustry/type/Weapon.java index ebde50d2ea..3fe2cfca3b 100644 --- a/core/src/mindustry/type/Weapon.java +++ b/core/src/mindustry/type/Weapon.java @@ -401,7 +401,7 @@ public class Weapon implements Cloneable{ shootAngle = bulletRotation(unit, mount, bulletX, bulletY), lifeScl = bullet.scaleVelocity ? Mathf.clamp(Mathf.dst(shootX, shootY, mount.aimX, mount.aimY) / bullet.range) : 1f; - bullet(mount, unit, shootX, shootY, angleOffset + shootAngle + Mathf.range(inaccuracy), lifeScl, shootAngle, mountX, mountY); + bullet(mount, unit, bulletX, bulletY, angleOffset + shootAngle + Mathf.range(inaccuracy), lifeScl, shootAngle, mountX, mountY); } protected void bullet(WeaponMount mount, Unit unit, float shootX, float shootY, float angle, float lifescl, float mountRotation, float mountX, float mountY){ diff --git a/core/src/mindustry/world/blocks/logic/LogicBlock.java b/core/src/mindustry/world/blocks/logic/LogicBlock.java index 44e9aac01e..62dc305fbb 100644 --- a/core/src/mindustry/world/blocks/logic/LogicBlock.java +++ b/core/src/mindustry/world/blocks/logic/LogicBlock.java @@ -397,6 +397,17 @@ public class LogicBlock extends Block{ } } + @Override + public void removeFromProximity(){ + super.removeFromProximity(); + + for(var link : executor.links){ + if(!link.enabled && link.lastDisabler == this){ + link.enabled = true; + } + } + } + @Override public Cursor getCursor(){ return !accessible() ? SystemCursor.arrow : super.getCursor(); diff --git a/core/src/mindustry/world/consumers/ConsumeItemExplosive.java b/core/src/mindustry/world/consumers/ConsumeItemExplosive.java new file mode 100644 index 0000000000..447928c8f7 --- /dev/null +++ b/core/src/mindustry/world/consumers/ConsumeItemExplosive.java @@ -0,0 +1,20 @@ +package mindustry.world.consumers; + +import mindustry.gen.*; + +public class ConsumeItemExplosive extends ConsumeItemFilter{ + + public ConsumeItemExplosive(float minExplosiveness){ + super(item -> item.explosiveness >= minExplosiveness); + } + + public ConsumeItemExplosive(){ + this(0.2f); + } + + @Override + public float efficiencyMultiplier(Building build){ + var item = getConsumed(build); + return item == null ? 0f : item.explosiveness; + } +} diff --git a/tools/build.gradle b/tools/build.gradle index 057b4a2c47..148da40dee 100644 --- a/tools/build.gradle +++ b/tools/build.gradle @@ -28,7 +28,8 @@ def enableAA = true //it's not compiled for other platforms so they don't get it def useFastAA = project.hasProperty("fastAA") || System.getProperty("user.name") == "anuke" -def antialias = { File file -> +@groovy.transform.CompileStatic +private def antialias(File file, boolean doAntialias, boolean useFastAA){ if(!doAntialias) return if(useFastAA){ @@ -168,7 +169,7 @@ task pack(dependsOn: [classes, configurations.runtimeClasspath]){ if(file.isDirectory() || (file.toString().replace("\\", "/").contains("/ui/") && file.toString().startsWith("icon-")) || file.toString().contains(".9.png")) return executor.submit{ - antialias(file.file) + antialias(file.file, doAntialias, useFastAA) } }