diff --git a/core/assets-raw/sprites/blocks/production/cyanogen-synthesizer-bottom.png b/core/assets-raw/sprites/blocks/production/cyanogen-synthesizer-bottom.png new file mode 100644 index 0000000000..4f4b6a2b8f Binary files /dev/null and b/core/assets-raw/sprites/blocks/production/cyanogen-synthesizer-bottom.png differ diff --git a/core/assets-raw/sprites/blocks/production/cyanogen-synthesizer-heat.png b/core/assets-raw/sprites/blocks/production/cyanogen-synthesizer-heat.png new file mode 100644 index 0000000000..4a2f00108a Binary files /dev/null and b/core/assets-raw/sprites/blocks/production/cyanogen-synthesizer-heat.png differ diff --git a/core/assets-raw/sprites/blocks/production/cyanogen-synthesizer-liquid.png b/core/assets-raw/sprites/blocks/production/cyanogen-synthesizer-liquid.png new file mode 100644 index 0000000000..4bd1161ff0 Binary files /dev/null and b/core/assets-raw/sprites/blocks/production/cyanogen-synthesizer-liquid.png differ diff --git a/core/assets-raw/sprites/blocks/production/cyanogen-synthesizer-top.png b/core/assets-raw/sprites/blocks/production/cyanogen-synthesizer-top.png new file mode 100644 index 0000000000..2926a4396c Binary files /dev/null and b/core/assets-raw/sprites/blocks/production/cyanogen-synthesizer-top.png differ diff --git a/core/assets-raw/sprites/blocks/production/cyanogen-synthesizer.png b/core/assets-raw/sprites/blocks/production/cyanogen-synthesizer.png new file mode 100644 index 0000000000..440678fddb Binary files /dev/null and b/core/assets-raw/sprites/blocks/production/cyanogen-synthesizer.png differ diff --git a/core/assets-raw/sprites/blocks/production/oxidation-chamber.png b/core/assets-raw/sprites/blocks/production/oxidation-chamber.png index 9c2f9518e9..0b74465726 100644 Binary files a/core/assets-raw/sprites/blocks/production/oxidation-chamber.png and b/core/assets-raw/sprites/blocks/production/oxidation-chamber.png differ diff --git a/core/assets-raw/sprites/blocks/turrets/fracture.png b/core/assets-raw/sprites/blocks/turrets/fracture.png new file mode 100644 index 0000000000..a07f8f2ce4 Binary files /dev/null and b/core/assets-raw/sprites/blocks/turrets/fracture.png differ diff --git a/core/assets-raw/sprites/items/liquid-cyanogen.png b/core/assets-raw/sprites/items/liquid-cyanogen.png new file mode 100644 index 0000000000..29c204c89d Binary files /dev/null and b/core/assets-raw/sprites/items/liquid-cyanogen.png differ diff --git a/core/assets/icons/icons.properties b/core/assets/icons/icons.properties index 660fea210b..25cd1d360b 100755 --- a/core/assets/icons/icons.properties +++ b/core/assets/icons/icons.properties @@ -449,3 +449,6 @@ 63257=emanate|unit-emanate-ui 63256=overflow-duct|block-overflow-duct-ui 63255=large-plasma-bore|block-large-plasma-bore-ui +63254=fracture|block-fracture-ui +63253=cyanogen-synthesizer|block-cyanogen-synthesizer-ui +63252=cyanogen|liquid-cyanogen-ui diff --git a/core/assets/logicids.dat b/core/assets/logicids.dat index 54817c3f97..d287989c25 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 ad4562b441..ee15a67d9e 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -60,7 +60,7 @@ public class Blocks implements ContentList{ //crafting siliconSmelter, siliconCrucible, siliconArcFurnace, kiln, graphitePress, plastaniumCompressor, multiPress, phaseWeaver, surgeSmelter, pyratiteMixer, blastMixer, cryofluidMixer, melter, separator, disassembler, sporePress, pulverizer, incinerator, coalCentrifuge, - electrolyzer, oxidationChamber, heatReactor, carbideCrucible, slagCentrifuge, surgeCrucible, + electrolyzer, oxidationChamber, heatReactor, carbideCrucible, slagCentrifuge, surgeCrucible, cyanogenSynthesizer, cellSynthesisChamber, //sandbox @@ -460,14 +460,17 @@ public class Blocks implements ContentList{ regolithWall = new StaticWall("regolith-wall"){{ regolith.asFloor().wall = this; + attributes.set(Attribute.silicate, 1f); }}; yellowStoneWall = new StaticWall("yellow-stone-wall"){{ yellowStone.asFloor().wall = slag.asFloor().wall = this; + attributes.set(Attribute.silicate, 1.5f); }}; rhyoliteWall = new StaticWall("rhyolite-wall"){{ rhyolite.asFloor().wall = rhyoliteCrater.asFloor().wall = this; + attributes.set(Attribute.silicate, 1f); }}; carbonWall = new StaticWall("carbon-wall"){{ @@ -1082,6 +1085,34 @@ public class Blocks implements ContentList{ consumes.power(2f); //TODO necessary? }}; + cyanogenSynthesizer = new HeatCrafter("cyanogen-synthesizer"){{ + //TODO requirements + requirements(Category.crafting, with(Items.tungsten, 60, Items.graphite, 60, Items.carbide, 30)); + + heatRequirement = 5f; + + drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawLiquidRegion(Liquids.hydrogen), new DrawBlock(), new DrawRegion("-top"), new DrawHeatInput(), + new DrawParticlesIn(){{ + color = Color.valueOf("bfe9ff"); + alpha = 0.6f; + particleSize = 4f; + particles = 10; + particleRad = 12f; + particleLife = 140f; + }}); + + size = 3; + + outputLiquid = new LiquidStack(Liquids.cyanogen, 3f); + craftTime = 60f * 1f; + + consumes.liquid(Liquids.hydrogen, 3f / 60f); + consumes.item(Items.graphite); + + consumes.power(2f); + liquidCapacity = 40f; + }}; + //TODO needs to be completely redone from the ground up cellSynthesisChamber = new LiquidConverter("cell-synthesis-chamber"){{ //TODO booster mechanics? @@ -2512,6 +2543,7 @@ public class Blocks implements ContentList{ //TODO no coolant? + acceptCoolant = false; draw = new DrawTurret("reinforced-"); shootLength = 0f; outlineColor = Pal.darkOutline; @@ -2527,41 +2559,43 @@ public class Blocks implements ContentList{ limitRange(); }}; - //TODO implementation; splash damage? shotgun? - if(false) + //TODO implementation; splash damage? shotgun? AA? I have no ideas fracture = new ItemTurret("fracture"){{ requirements(Category.turret, with(Items.tungsten, 35, Items.silicon, 35), true); ammo( - Items.tungsten, new BasicBulletType(7f, 25){{ - width = 8f; - height = 14f; + Items.tungsten, new BasicBulletType(5f, 20){{ + velocityInaccuracy = 0.2f; + width = 6f; + height = 12f; shootEffect = Fx.berylSpark; smokeEffect = Fx.shootBigSmoke; ammoMultiplier = 2; pierce = true; pierceBuilding = true; - hitColor = backColor = trailColor = Pal.berylShot; + hitColor = backColor = trailColor = Items.tungsten.color; frontColor = Color.white; - trailWidth = 1.5f; - trailLength = 10; + trailWidth = 1f; + trailLength = 4; //TODO different effect? hitEffect = despawnEffect = Fx.hitBulletColor; }} ); + acceptCoolant = false; consumes.liquid(Liquids.hydrogen, 1.5f / 60f); - shots = 3; + shots = 5; //TODO cool reload animation draw = new DrawTurret("reinforced-"); - shootLength = 0f; + shootLength = 8f; outlineColor = Pal.darkOutline; size = 2; envEnabled |= Env.space; - reloadTime = 40f; + reloadTime = 30f; restitution = 0.03f; - range = 180; - shootCone = 3f; + range = 90; + shootCone = 15f; + inaccuracy = 20f; health = 300 * size * size; rotateSpeed = 1.8f; diff --git a/core/src/mindustry/content/Liquids.java b/core/src/mindustry/content/Liquids.java index eabc1e9cc8..91c869483e 100644 --- a/core/src/mindustry/content/Liquids.java +++ b/core/src/mindustry/content/Liquids.java @@ -6,7 +6,7 @@ import mindustry.type.*; public class Liquids implements ContentList{ public static Liquid water, slag, oil, cryofluid, neoplasm, - ozone, hydrogen; + ozone, hydrogen, cyanogen; @Override public void load(){ @@ -72,7 +72,13 @@ public class Liquids implements ContentList{ flammability = 1f; }}; - //TODO dicyanoacetylene + cyanogen = new Liquid("cyanogen", Color.valueOf("6fd5d5")){{ + gas = true; + barColor = Color.valueOf("6fd5d5"); + flammability = 2f; + }}; + + //TODO dicyanoacetylene vs cyanogen //TODO molten lead (maybe) } diff --git a/core/src/mindustry/world/blocks/defense/turrets/LaserTurret.java b/core/src/mindustry/world/blocks/defense/turrets/LaserTurret.java index 8dd7cb9d7b..888a7d06be 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/LaserTurret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/LaserTurret.java @@ -17,7 +17,6 @@ public class LaserTurret extends PowerTurret{ public LaserTurret(String name){ super(name); - canOverdrive = false; consumes.add(new ConsumeCoolant(0.01f)).update(false); coolantMultiplier = 1f; @@ -25,7 +24,7 @@ public class LaserTurret extends PowerTurret{ @Override public void init(){ - consumes.powerCond(powerUse, entity -> ((LaserTurretBuild)entity).bullet != null || ((LaserTurretBuild)entity).target != null); + consumes.powerCond(powerUse, (LaserTurretBuild entity) -> entity.bullet != null || entity.target != null); super.init(); } @@ -54,7 +53,7 @@ public class LaserTurret extends PowerTurret{ wasShooting = true; bullet.rotation(rotation); bullet.set(x + bulletOffset.x, y + bulletOffset.y); - bullet.time(0f); + bullet.time = 0f; heat = 1f; recoil = recoilAmount; bulletLife -= Time.delta / Math.max(efficiency(), 0.00001f); @@ -66,7 +65,7 @@ public class LaserTurret extends PowerTurret{ Liquid liquid = liquids.current(); float maxUsed = consumes.get(ConsumeType.liquid).amount; - float used = (cheating() ? maxUsed : Math.min(liquids.get(liquid), maxUsed)) * Time.delta; + float used = (cheating() ? maxUsed : Math.min(liquids.get(liquid), maxUsed)) * delta(); reload -= used * liquid.heatCapacity * coolantMultiplier; liquids.remove(liquid, used); diff --git a/core/src/mindustry/world/draw/DrawParticlesIn.java b/core/src/mindustry/world/draw/DrawParticlesIn.java new file mode 100644 index 0000000000..3ca9f82f08 --- /dev/null +++ b/core/src/mindustry/world/draw/DrawParticlesIn.java @@ -0,0 +1,48 @@ +package mindustry.world.draw; + +import arc.graphics.*; +import arc.graphics.g2d.*; +import arc.math.*; +import arc.math.Interp.*; +import arc.util.*; +import mindustry.gen.*; + +/** Not standalone. */ +public class DrawParticlesIn extends DrawBlock{ + public Color color = Color.valueOf("f2d585"); + + public float alpha = 0.5f; + public int particles = 30; + public float particleLife = 70f, particleRad = 7f, particleSize = 3f, fadeMargin = 0.4f, rotateScl = 3f; + public Interp particleInterp = new PowIn(1.5f); + public Interp particleSizeInterp = Interp.slope; + public Blending blending = Blending.normal; + + @Override + public void drawBase(Building build){ + + if(build.warmup() > 0f){ + + float a = alpha * build.warmup(); + Draw.blend(blending); + Draw.color(color); + + float base = (Time.time / particleLife); + rand.setSeed(build.id); + for(int i = 0; i < particles; i++){ + float fin = (rand.random(1f) + base) % 1f, fout = 1f - fin; + float angle = rand.random(360f) + (Time.time / rotateScl) % 360f; + float len = particleRad * particleInterp.apply(fout); + Draw.alpha(a * (1f - Mathf.curve(fin, 1f - fadeMargin))); + Fill.circle( + build.x + Angles.trnsx(angle, len), + build.y + Angles.trnsy(angle, len), + particleSize * particleSizeInterp.apply(fin) * build.warmup() + ); + } + + Draw.blend(); + Draw.reset(); + } + } +} diff --git a/tools/src/mindustry/tools/Generators.java b/tools/src/mindustry/tools/Generators.java index 838c713a6d..8365903ee3 100644 --- a/tools/src/mindustry/tools/Generators.java +++ b/tools/src/mindustry/tools/Generators.java @@ -459,7 +459,8 @@ public class Generators{ image.draw(get(type.region), true); } - //draw outlines + //TODO draw under for layerOffset < 0 + //draw weapon outlines on base for(Weapon weapon : type.weapons){ weapon.load();