diff --git a/core/assets-raw/sprites/blocks/units/basic-reconstructor-top.png b/core/assets-raw/sprites/blocks/units/basic-reconstructor-top.png new file mode 100644 index 0000000000..f092d8f80e Binary files /dev/null and b/core/assets-raw/sprites/blocks/units/basic-reconstructor-top.png differ diff --git a/core/assets-raw/sprites/blocks/units/basic-reconstructor.png b/core/assets-raw/sprites/blocks/units/basic-reconstructor.png new file mode 100644 index 0000000000..101119dbf4 Binary files /dev/null and b/core/assets-raw/sprites/blocks/units/basic-reconstructor.png differ diff --git a/core/assets-raw/sprites/blocks/units/mech-fabricator-top.png b/core/assets-raw/sprites/blocks/units/mech-fabricator-top.png new file mode 100644 index 0000000000..18525479c8 Binary files /dev/null and b/core/assets-raw/sprites/blocks/units/mech-fabricator-top.png differ diff --git a/core/assets-raw/sprites/blocks/units/mech-fabricator.png b/core/assets-raw/sprites/blocks/units/mech-fabricator.png new file mode 100644 index 0000000000..96592251ae Binary files /dev/null and b/core/assets-raw/sprites/blocks/units/mech-fabricator.png differ diff --git a/core/assets-raw/sprites/blocks/units/ship-fabricator-top.png b/core/assets-raw/sprites/blocks/units/ship-fabricator-top.png new file mode 100644 index 0000000000..708e361314 Binary files /dev/null and b/core/assets-raw/sprites/blocks/units/ship-fabricator-top.png differ diff --git a/core/assets-raw/sprites/blocks/units/ship-fabricator.png b/core/assets-raw/sprites/blocks/units/ship-fabricator.png new file mode 100644 index 0000000000..c48284e98b Binary files /dev/null and b/core/assets-raw/sprites/blocks/units/ship-fabricator.png differ diff --git a/core/assets-raw/sprites/blocks/units/fabricator-top.png b/core/assets-raw/sprites/blocks/units/tank-fabricator-top.png similarity index 100% rename from core/assets-raw/sprites/blocks/units/fabricator-top.png rename to core/assets-raw/sprites/blocks/units/tank-fabricator-top.png diff --git a/core/assets-raw/sprites/blocks/units/fabricator.png b/core/assets-raw/sprites/blocks/units/tank-fabricator.png similarity index 100% rename from core/assets-raw/sprites/blocks/units/fabricator.png rename to core/assets-raw/sprites/blocks/units/tank-fabricator.png diff --git a/core/assets-raw/sprites/units/merui-leg-base.png b/core/assets-raw/sprites/units/merui-leg-base.png new file mode 100644 index 0000000000..8592979a68 Binary files /dev/null and b/core/assets-raw/sprites/units/merui-leg-base.png differ diff --git a/core/assets-raw/sprites/units/merui-leg.png b/core/assets-raw/sprites/units/merui-leg.png new file mode 100644 index 0000000000..020566c493 Binary files /dev/null and b/core/assets-raw/sprites/units/merui-leg.png differ diff --git a/core/assets-raw/sprites/units/merui.png b/core/assets-raw/sprites/units/merui.png new file mode 100644 index 0000000000..270c8efc53 Binary files /dev/null and b/core/assets-raw/sprites/units/merui.png differ diff --git a/core/assets-raw/sprites/units/osc-cell.png b/core/assets-raw/sprites/units/osc-cell.png new file mode 100644 index 0000000000..af424fb76a Binary files /dev/null and b/core/assets-raw/sprites/units/osc-cell.png differ diff --git a/core/assets-raw/sprites/units/osc.png b/core/assets-raw/sprites/units/osc.png new file mode 100644 index 0000000000..0f27bb4678 Binary files /dev/null and b/core/assets-raw/sprites/units/osc.png differ diff --git a/core/assets/icons/icons.properties b/core/assets/icons/icons.properties index e0c43b51df..60451df04d 100755 --- a/core/assets/icons/icons.properties +++ b/core/assets/icons/icons.properties @@ -551,3 +551,9 @@ 63141=anthicus-missile|unit-anthicus-missile-ui 63140=shield-breaker|block-shield-breaker-ui 63139=obviate|unit-obviate-ui +63138=tank-fabricator|block-tank-fabricator-ui +63137=mech-fabricator|block-mech-fabricator-ui +63136=ship-fabricator|block-ship-fabricator-ui +63135=unit-repair-tower|block-unit-repair-tower-ui +63134=merui|unit-merui-ui +63133=osc|unit-osc-ui diff --git a/core/assets/logicids.dat b/core/assets/logicids.dat index 5e29923c9e..c18ca7932c 100644 Binary files a/core/assets/logicids.dat and b/core/assets/logicids.dat differ diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index 1117c9f92c..e6bdb36334 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -139,8 +139,11 @@ public class Blocks{ repairPoint, repairTurret, //units - erekir - fabricator, - tankReconstructor, shipReconstructor, mechReconstructor, + tankFabricator, shipFabricator, mechFabricator, + + basicReconstructor, + //tankReconstructor, shipReconstructor, mechReconstructor, + tankAssembler, shipAssembler, mechAssembler, //TODO maybe making it 5x5 would be more appropriate, seems kinda cheap. basicAssemblerModule, @@ -4141,7 +4144,7 @@ public class Blocks{ //endregion //region units - erekir - fabricator = new UnitFactory("fabricator"){{ + tankFabricator = new UnitFactory("tank-fabricator"){{ requirements(Category.units, with(Items.silicon, 200, Items.beryllium, 150)); size = 3; configurable = false; @@ -4152,6 +4155,48 @@ public class Blocks{ consumePower(2f); }}; + mechFabricator = new UnitFactory("mech-fabricator"){{ + requirements(Category.units, with(Items.silicon, 200, Items.beryllium, 150)); + size = 3; + configurable = false; + plans.add(new UnitPlan(UnitTypes.merui, 60f * 35f, with(Items.beryllium, 40f, Items.silicon, 50f))); + researchCost = with(Items.beryllium, 200, Items.graphite, 80, Items.silicon, 80); + regionSuffix = "-dark"; + fogRadius = 3; + consumePower(2f); + }}; + + shipFabricator = new UnitFactory("ship-fabricator"){{ + requirements(Category.units, with(Items.silicon, 200, Items.beryllium, 150)); + size = 3; + configurable = false; + plans.add(new UnitPlan(UnitTypes.osc, 60f * 35f, with(Items.beryllium, 40f, Items.silicon, 50f))); + researchCost = with(Items.beryllium, 200, Items.graphite, 80, Items.silicon, 80); + regionSuffix = "-dark"; + fogRadius = 3; + consumePower(2f); + }}; + + basicReconstructor = new Reconstructor("basic-reconstructor"){{ + requirements(Category.units, with(Items.beryllium, 250, Items.tungsten, 120, Items.silicon, 150)); + regionSuffix = "-dark"; + + size = 3; + consumePower(2f); + consumeLiquid(Liquids.hydrogen, 3f / 60f); + consumeItems(with(Items.silicon, 50, Items.tungsten, 40)); + + constructTime = 60f * 40f; + researchCostMultiplier = 0.75f; + + upgrades.addAll( + new UnitType[]{UnitTypes.stell, UnitTypes.locus}, + new UnitType[]{UnitTypes.merui, UnitTypes.latum}, + new UnitType[]{UnitTypes.osc, UnitTypes.avert} + ); + }}; + + /* mechReconstructor = new Reconstructor("mech-reconstructor"){{ requirements(Category.units, with(Items.beryllium, 250, Items.tungsten, 120, Items.silicon, 150)); regionSuffix = "-dark"; @@ -4199,7 +4244,7 @@ public class Blocks{ upgrades.addAll( new UnitType[]{UnitTypes.stell, UnitTypes.locus} ); - }}; + }};*/ tankAssembler = new UnitAssembler("tank-assembler"){{ requirements(Category.units, with(Items.graphite, 600, Items.beryllium, 600, Items.oxide, 250, Items.tungsten, 400, Items.silicon, 500)); diff --git a/core/src/mindustry/content/ErekirTechTree.java b/core/src/mindustry/content/ErekirTechTree.java index cadc56eafb..95de086bc9 100644 --- a/core/src/mindustry/content/ErekirTechTree.java +++ b/core/src/mindustry/content/ErekirTechTree.java @@ -188,7 +188,7 @@ public class ErekirTechTree{ node(cliffCrusher, () -> { node(siliconArcFurnace, () -> { node(electrolyzer, Seq.with(new OnSector(three)), () -> { - node(oxidationChamber, Seq.with(new Research(mechReconstructor), new OnSector(four)), () -> { + node(oxidationChamber, Seq.with(new Research(basicReconstructor), new OnSector(four)), () -> { node(electricHeater, Seq.with(new OnSector(four)), () -> { node(heatRedirector, () -> { @@ -228,7 +228,7 @@ public class ErekirTechTree{ }); - node(breach, Seq.with(new Research(siliconArcFurnace), new Research(fabricator)), () -> { + node(breach, Seq.with(new Research(siliconArcFurnace), new Research(tankFabricator)), () -> { node(berylliumWall, () -> { node(berylliumWallLarge, () -> { @@ -261,7 +261,7 @@ public class ErekirTechTree{ }); }); - node(radar, Seq.with(new Research(beamNode), new Research(turbineCondenser), new Research(fabricator), new OnSector(SectorPresets.two)), () -> { + node(radar, Seq.with(new Research(beamNode), new Research(turbineCondenser), new Research(tankFabricator), new OnSector(SectorPresets.two)), () -> { }); }); @@ -272,44 +272,39 @@ public class ErekirTechTree{ }); }); - node(fabricator, Seq.with(new Research(siliconArcFurnace), new Research(plasmaBore), new Research(turbineCondenser)), () -> { + node(tankFabricator, Seq.with(new Research(siliconArcFurnace), new Research(plasmaBore), new Research(turbineCondenser)), () -> { node(UnitTypes.stell, () -> { }); - node(mechReconstructor, Seq.with(new OnSector(three)), () -> { + node(basicReconstructor, Seq.with(new OnSector(three)), () -> { node(UnitTypes.latum); + node(UnitTypes.avert); + node(UnitTypes.locus); - node(shipReconstructor, Seq.with(new OnSector(three)), () -> { - node(UnitTypes.avert); + node(tankAssembler, Seq.with(new OnSector(three), new Research(constructor), new Research(atmosphericConcentrator)), () -> { + node(UnitTypes.vanquish, () -> { + node(UnitTypes.conquer, Seq.with(tmpNever), () -> { - node(tankReconstructor, () -> { - node(UnitTypes.locus); + }); + }); - node(tankAssembler, Seq.with(new OnSector(three), new Research(constructor), new Research(atmosphericConcentrator)), () -> { - node(UnitTypes.vanquish, () -> { - node(UnitTypes.conquer, Seq.with(tmpNever), () -> { + node(shipAssembler, Seq.with(new OnSector(five)), () -> { + node(UnitTypes.quell, () -> { + node(UnitTypes.disrupt, Seq.with(tmpNever), () -> { - }); }); + }); - node(shipAssembler, Seq.with(new OnSector(five)), () -> { - node(UnitTypes.quell, () -> { - node(UnitTypes.disrupt, Seq.with(tmpNever), () -> { + node(mechAssembler, Seq.with(tmpNever), () -> { + node(UnitTypes.bulwark, () -> { + node(UnitTypes.krepost, Seq.with(tmpNever), () -> { - }); - }); - - node(mechAssembler, Seq.with(tmpNever), () -> { - node(UnitTypes.bulwark, () -> { - node(UnitTypes.krepost, Seq.with(tmpNever), () -> { - - }); - }); }); }); }); }); + }); }); }); diff --git a/core/src/mindustry/content/SectorPresets.java b/core/src/mindustry/content/SectorPresets.java index 73d154062a..a5ee4b5227 100644 --- a/core/src/mindustry/content/SectorPresets.java +++ b/core/src/mindustry/content/SectorPresets.java @@ -151,7 +151,7 @@ public class SectorPresets{ new TextMarker("The arc furnace needs [accent]sand[] and [accent]graphite[] to create [accent]silicon[].\n[accent]Power[] is also required.", 268f * 8f, 101f * 8f), new TextMarker("Use [accent]cliff crushers[] to mine sand.", 262f * 8f, 88f * 8f) ), - new BuildCountObjective(Blocks.fabricator, 1).withMarkers( + new BuildCountObjective(Blocks.tankFabricator, 1).withMarkers( new TextMarker("Use [accent]units[] to explore the map, defend buildings, and go on the offensive.\n Research and place a [accent]fabricator[]", 258f * 8f, 116f * 8f) ), new UnitCountObjective(UnitTypes.stell, 1).withMarkers( diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index fe692a9f85..31f50ffb43 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -38,7 +38,7 @@ public class UnitTypes{ //legs public static @EntityDef({Unitc.class, Legsc.class}) UnitType corvus, atrax, - latum, anthicus, + merui, latum, anthicus, bulwark, krepost; //legs, legacy @@ -46,7 +46,8 @@ public class UnitTypes{ //air public static @EntityDef({Unitc.class}) UnitType flare, eclipse, horizon, zenith, antumbra, - evoke, avert, obviate; + evoke, avert, obviate, + osc; //air, legacy public static @EntityDef(value = {Unitc.class}, legacy = true) UnitType mono; @@ -2829,6 +2830,35 @@ public class UnitTypes{ //endregion //region erekir - mech + merui = new ErekirUnitType("merui"){{ + speed = 0.75f; + drag = 0.1f; + hitSize = 9f; + rotateSpeed = 3.5f; + health = 700; + armor = 5f; + + legCount = 6; + legLength = 8f; + lockLegBase = true; + legContinuousMove = true; + legExtension = -2f; + legBaseOffset = 3f; + maxStretch = 1.1f; + maxCompress = 0.2f; + legLengthScl = 0.96f; + legTrns = 1.1f; + legGroupSize = 3; + rippleScale = 0.2f; + + legMoveSpace = 1f; + hovering = true; + + visualElevation = 0.1f; + groundLayer = Layer.legUnit - 1f; + + }}; + latum = new ErekirUnitType("latum"){{ speed = 0.7f; drag = 0.1f; @@ -3300,6 +3330,25 @@ public class UnitTypes{ //endregion //region erekir - flying + osc = new ErekirUnitType("osc"){{ + //TODO needs hover passability like legs - move into UnitType? + hovering = true; + visualElevation = 0.1f; + + drag = 0.08f; + speed = 2f; + rotateSpeed = 6f; + + accel = 0.09f; + health = 600f; + armor = 3f; + hitSize = 7f; + engineOffset = 7f; + engineSize = 2f; + itemCapacity = 0; + useEngineElevation = false; + }}; + avert = new ErekirUnitType("avert"){{ lowAltitude = false; flying = true; diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index 41555fefc0..ee7d5e918c 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -150,6 +150,9 @@ public class BulletType extends Content implements Cloneable{ public int fragBullets = 9; public float fragVelocityMin = 0.2f, fragVelocityMax = 1f, fragLifeMin = 1f, fragLifeMax = 1f; public @Nullable BulletType fragBullet = null; + public float bulletInterval = 20f; + public int intervalBulletCount = 1; + public @Nullable BulletType intervalBullet; public Color hitColor = Color.white; public Color healColor = Pal.heal; public Effect healEffect = Fx.healBlockFull; @@ -423,6 +426,15 @@ public class BulletType extends Content implements Cloneable{ updateHoming(b); updateWeaving(b); updateTrailEffects(b); + updateBulletInterval(b); + } + + public void updateBulletInterval(Bullet b){ + if(intervalBullet != null && b.timer.get(2, bulletInterval)){ + for(int i = 0; i < intervalBulletCount; i++){ + intervalBullet.create(b, b.x, b.y, Mathf.random(360f)); + } + } } public void updateHoming(Bullet b){ diff --git a/core/src/mindustry/io/SaveFileReader.java b/core/src/mindustry/io/SaveFileReader.java index 5d450f0e89..d7c16d0931 100644 --- a/core/src/mindustry/io/SaveFileReader.java +++ b/core/src/mindustry/io/SaveFileReader.java @@ -62,7 +62,8 @@ public abstract class SaveFileReader{ "block-loader", "payload-loader", "thermal-pump", "impulse-pump", "alloy-smelter", "surge-smelter", - "steam-vent", "rhyolite-vent" + "steam-vent", "rhyolite-vent", + "fabricator", "tank-fabricator" ); public static final ObjectMap modContentNameMap = ObjectMap.of( diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index c4fc7f0627..2e3aed7657 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -165,6 +165,7 @@ public class UnitType extends UnlockableContent{ public boolean canDrown = true, naval = false; public float drownTimeMultiplier = 1f; public float engineOffset = 5f, engineSize = 2.5f; + public boolean useEngineElevation = true; public @Nullable Color engineColor = null; public @Nullable Color trailColor; public Color engineColorInner = Color.white; @@ -505,6 +506,10 @@ public class UnitType extends UnlockableContent{ mechStepParticles = hitSize > 15f; } + if(engineSize > 0){ + engines.add(new UnitEngine(0f, -engineOffset, engineSize, -90f)); + } + if(treadEffect == null){ treadEffect = new Effect(50, e -> { color(Tmp.c1.set(e.color).mul(1.5f)); @@ -871,7 +876,6 @@ public class UnitType extends UnlockableContent{ if(trailLength > 0 && !naval && unit.isFlying()){ drawTrail(unit); } - if(engineSize > 0) drawEngine(unit); if(engines.size > 0) drawEngines(unit); Draw.z(z); if(drawBody) drawBody(unit); @@ -1010,27 +1014,6 @@ public class UnitType extends UnlockableContent{ } } - public void drawEngine(Unit unit){ - if(!unit.isFlying()) return; - - float scale = unit.elevation; - float offset = engineOffset/2f + engineOffset/2f*scale; - - Draw.color(engineColor == null ? unit.team.color : engineColor); - Fill.circle( - unit.x + Angles.trnsx(unit.rotation + 180, offset), - unit.y + Angles.trnsy(unit.rotation + 180, offset), - (engineSize + Mathf.absin(Time.time, 2f, engineSize / 4f)) * scale - ); - Draw.color(engineColorInner); - Fill.circle( - unit.x + Angles.trnsx(unit.rotation + 180, offset - 1f), - unit.y + Angles.trnsy(unit.rotation + 180, offset - 1f), - (engineSize + Mathf.absin(Time.time, 2f, engineSize / 4f)) / 2f * scale - ); - Draw.color(); - } - public void drawTrail(Unit unit){ if(unit.trail == null){ unit.trail = new Trail(trailLength); @@ -1040,16 +1023,18 @@ public class UnitType extends UnlockableContent{ } public void drawEngines(Unit unit){ - if(!unit.isFlying()) return; + float scale = useEngineElevation ? unit.elevation : 1f; + + if(scale <= 0.0001f) return; - float scale = unit.elevation; float rot = unit.rotation - 90; + Color color = engineColor == null ? unit.team.color : engineColor; for(var engine : engines){ Tmp.v1.set(engine.x, engine.y).rotate(rot); float ex = Tmp.v1.x, ey = Tmp.v1.y; - Draw.color(unit.team.color); + Draw.color(color); Fill.circle( unit.x + ex, unit.y + ey,