diff --git a/annotations/src/main/java/mindustry/annotations/entity/EntityProcess.java b/annotations/src/main/java/mindustry/annotations/entity/EntityProcess.java index a9ada9f45c..6aded8c817 100644 --- a/annotations/src/main/java/mindustry/annotations/entity/EntityProcess.java +++ b/annotations/src/main/java/mindustry/annotations/entity/EntityProcess.java @@ -336,7 +336,7 @@ public class EntityProcess extends BaseProcessor{ fbuilder.initializer(varInitializers.get(f.descString())); } - fbuilder.addModifiers(f.has(ReadOnly.class) ? Modifier.PROTECTED : Modifier.PUBLIC); + fbuilder.addModifiers(f.has(ReadOnly.class) || f.is(Modifier.PRIVATE) ? Modifier.PROTECTED : Modifier.PUBLIC); fbuilder.addAnnotations(f.annotations().map(AnnotationSpec::get)); FieldSpec spec = fbuilder.build(); diff --git a/core/assets-raw/sprites/units/locus-treads.png b/core/assets-raw/sprites/units/locus-treads.png new file mode 100644 index 0000000000..e39c164a76 Binary files /dev/null and b/core/assets-raw/sprites/units/locus-treads.png differ diff --git a/core/assets-raw/sprites/units/locus-weapon.png b/core/assets-raw/sprites/units/locus-weapon.png new file mode 100644 index 0000000000..f349a25b87 Binary files /dev/null and b/core/assets-raw/sprites/units/locus-weapon.png differ diff --git a/core/assets-raw/sprites/units/locus.png b/core/assets-raw/sprites/units/locus.png index 453eeddadf..7d69b23f04 100644 Binary files a/core/assets-raw/sprites/units/locus.png and b/core/assets-raw/sprites/units/locus.png differ diff --git a/core/src/mindustry/editor/MapEditorDialog.java b/core/src/mindustry/editor/MapEditorDialog.java index 3c1b5b9f08..cb87788202 100644 --- a/core/src/mindustry/editor/MapEditorDialog.java +++ b/core/src/mindustry/editor/MapEditorDialog.java @@ -273,7 +273,13 @@ public class MapEditorDialog extends Dialog implements Disposable{ world.endMapLoad(); player.set(world.width() * tilesize/2f, world.height() * tilesize/2f); player.clearUnit(); - Groups.unit.clear(); + + for(var unit : Groups.unit){ + if(unit.spawnedByCore){ + unit.remove(); + } + } + Groups.build.clear(); Groups.weather.clear(); logic.play(); diff --git a/core/src/mindustry/entities/bullet/EmpBulletType.java b/core/src/mindustry/entities/bullet/EmpBulletType.java index e7c702b5ad..05b74a9bf0 100644 --- a/core/src/mindustry/entities/bullet/EmpBulletType.java +++ b/core/src/mindustry/entities/bullet/EmpBulletType.java @@ -20,9 +20,8 @@ public class EmpBulletType extends BasicBulletType{ if(!b.absorbed){ Vars.indexer.allBuildings(x, y, radius, other -> { if(other.team == b.team){ - if(other.block.hasPower && other.block.canOverdrive && other.timeScale < timeIncrease){ - other.timeScale = Math.max(other.timeScale, timeIncrease); - other.timeScaleDuration = Math.max(other.timeScaleDuration, timeDuration); + if(other.block.hasPower && other.block.canOverdrive && other.timeScale() < timeIncrease){ + other.applyBoost(timeIncrease, timeDuration); chainEffect.at(x, y, 0, hitColor, other); applyEffect.at(other, other.block.size * 7f); } @@ -39,8 +38,7 @@ public class EmpBulletType extends BasicBulletType{ } if(other.power != null && other.power.graph.getLastPowerProduced() > 0f){ - other.timeScale = Math.min(other.timeScale, powerSclDecrease); - other.timeScaleDuration = timeDuration; + other.applySlowdown(powerSclDecrease, timeDuration); other.damage(damage * powerDamageScl); hitPowerEffect.at(other.x, other.y, b.angleTo(other), hitColor); chainEffect.at(x, y, 0, hitColor, other); diff --git a/core/src/mindustry/entities/comp/BuildingComp.java b/core/src/mindustry/entities/comp/BuildingComp.java index acf0cb00f3..ce908627b1 100644 --- a/core/src/mindustry/entities/comp/BuildingComp.java +++ b/core/src/mindustry/entities/comp/BuildingComp.java @@ -346,6 +346,14 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, timeScale = Math.max(timeScale, intensity); } + public void applySlowdown(float intensity, float duration){ + //do not refresh time scale when getting a weaker intensity + if(intensity <= this.timeScale - 0.001f){ + timeScaleDuration = Math.max(timeScaleDuration, duration); + } + timeScale = Math.min(timeScale, intensity); + } + public void applyHealSuppression(float amount){ healSuppressionTime = Math.max(healSuppressionTime, Time.time + amount); } diff --git a/core/src/mindustry/maps/SectorDamage.java b/core/src/mindustry/maps/SectorDamage.java index 949d62a2e8..a1bc023531 100644 --- a/core/src/mindustry/maps/SectorDamage.java +++ b/core/src/mindustry/maps/SectorDamage.java @@ -291,16 +291,16 @@ public class SectorDamage{ } if(build.block instanceof MendProjector m){ - sumRps += m.healPercent / m.reload * avgHealth * 60f / 100f * e * build.timeScale; + sumRps += m.healPercent / m.reload * avgHealth * 60f / 100f * e * build.timeScale(); } //point defense turrets act as flat health right now if(build.block instanceof PointDefenseTurret && build.consValid()){ - sumHealth += 150f * build.timeScale; + sumHealth += 150f * build.timeScale(); } if(build.block instanceof ForceProjector f){ - sumHealth += f.shieldHealth * e * build.timeScale; + sumHealth += f.shieldHealth * e * build.timeScale(); sumRps += e; } } diff --git a/core/src/mindustry/world/blocks/power/ImpactReactor.java b/core/src/mindustry/world/blocks/power/ImpactReactor.java index 0b4dfa909b..75039604d3 100644 --- a/core/src/mindustry/world/blocks/power/ImpactReactor.java +++ b/core/src/mindustry/world/blocks/power/ImpactReactor.java @@ -52,7 +52,7 @@ public class ImpactReactor extends PowerGenerator{ addBar("poweroutput", (GeneratorBuild entity) -> new Bar(() -> Core.bundle.format("bar.poweroutput", - Strings.fixed(Math.max(entity.getPowerProduction() - consPower.usage, 0) * 60 * entity.timeScale, 1)), + Strings.fixed(Math.max(entity.getPowerProduction() - consPower.usage, 0) * 60 * entity.timeScale(), 1)), () -> Pal.powerBar, () -> entity.productionEfficiency)); } diff --git a/core/src/mindustry/world/blocks/production/Drill.java b/core/src/mindustry/world/blocks/production/Drill.java index a1b324c5bb..c32b9292c2 100644 --- a/core/src/mindustry/world/blocks/production/Drill.java +++ b/core/src/mindustry/world/blocks/production/Drill.java @@ -104,7 +104,7 @@ public class Drill extends Block{ super.setBars(); addBar("drillspeed", (DrillBuild e) -> - new Bar(() -> Core.bundle.format("bar.drillspeed", Strings.fixed(e.lastDrillSpeed * 60 * e.timeScale, 2)), () -> Pal.ammo, () -> e.warmup)); + new Bar(() -> Core.bundle.format("bar.drillspeed", Strings.fixed(e.lastDrillSpeed * 60 * e.timeScale(), 2)), () -> Pal.ammo, () -> e.warmup)); } public Item getDrop(Tile tile){