I have spent far too much time redrawing this stupid sprite

This commit is contained in:
Anuken 2021-11-19 20:32:09 -05:00
parent f3ace3a526
commit 7d849b7ea0
15 changed files with 112 additions and 21 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 462 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 351 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

View File

@ -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

Binary file not shown.

View File

@ -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;

View File

@ -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)
}

View File

@ -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.<ConsumeLiquidBase>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);

View File

@ -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();
}
}
}

View File

@ -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();