Added new crafters, pumps and conduits
This commit is contained in:
@@ -151,6 +151,13 @@ public class Fx{
|
||||
Draw.reset();
|
||||
}),
|
||||
|
||||
purifystone = new Effect(10, e -> {
|
||||
Draw.color(Color.ORANGE, Color.GRAY, e.ifract());
|
||||
Draw.thickness(2f);
|
||||
Draw.spikes(e.x, e.y, e.ifract() * 4f, 2, 6);
|
||||
Draw.reset();
|
||||
}),
|
||||
|
||||
generate = new Effect(11, e -> {
|
||||
Draw.color(Color.ORANGE, Color.YELLOW, e.ifract());
|
||||
Draw.thickness(1f);
|
||||
|
||||
@@ -245,7 +245,7 @@ public class UI extends SceneModule{
|
||||
|
||||
int rows = 4;
|
||||
int maxcol = 0;
|
||||
float size = 46;
|
||||
float size = 48;
|
||||
|
||||
Stack stack = new Stack();
|
||||
ButtonGroup<ImageButton> group = new ButtonGroup<>();
|
||||
|
||||
@@ -236,7 +236,7 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
|
||||
lifetime = 65f;
|
||||
}
|
||||
public void draw(Bullet b){
|
||||
Draw.color(Color.valueOf("c2efd7"), Color.valueOf("72deaf"), b.time/lifetime);
|
||||
Draw.color(Color.valueOf("efa66c"), Color.valueOf("72deaf"), b.time/lifetime);
|
||||
float size = 7f-b.time/lifetime*6f;
|
||||
Draw.rect("circle", b.x, b.y, size, size);
|
||||
Draw.reset();
|
||||
|
||||
@@ -82,7 +82,7 @@ public class EMP extends TimedEntity{
|
||||
}
|
||||
|
||||
Draw.thick(fract()*2f);
|
||||
Draw.circle(x, y, radius * Vars.tilesize);
|
||||
Draw.polygon(34, x, y, radius * Vars.tilesize);
|
||||
|
||||
Draw.reset();
|
||||
}
|
||||
|
||||
@@ -16,17 +16,16 @@ public enum Recipe{
|
||||
//compositewall(defense, DefenseBlocks.compositewall, stack(Item.dirium, 2), stack(Item.titanium, 2), stack(Item.steel, 2), stack(Item.iron, 2)),
|
||||
titaniumwalllarge(defense, DefenseBlocks.titaniumwalllarge, stack(Item.titanium, 8)),
|
||||
duriumwalllarge(defense, DefenseBlocks.diriumwalllarge, stack(Item.dirium, 8)),
|
||||
healturret(defense, DefenseBlocks.repairturret, stack(Item.iron, 30)),
|
||||
megahealturret(defense, DefenseBlocks.megarepairturret, stack(Item.iron, 20), stack(Item.steel, 30)),
|
||||
titaniumshieldwall(defense, DefenseBlocks.titaniumshieldwall, stack(Item.titanium, 2)),
|
||||
shieldgenerator(defense, DefenseBlocks.shieldgenerator, stack(Item.titanium, 10), stack(Item.dirium, 10)),
|
||||
|
||||
conveyor(distribution, DistributionBlocks.conveyor, stack(Item.stone, 1)),
|
||||
steelconveyor(distribution, DistributionBlocks.steelconveyor, stack(Item.steel, 1)),
|
||||
poweredconveyor(distribution, DistributionBlocks.poweredconveyor, stack(Item.dirium, 1)),
|
||||
poweredconveyor(distribution, DistributionBlocks.pulseconveyor, stack(Item.dirium, 1)),
|
||||
router(distribution, DistributionBlocks.router, stack(Item.stone, 2)),
|
||||
junction(distribution, DistributionBlocks.junction, stack(Item.iron, 2)),
|
||||
conduit(distribution, DistributionBlocks.conduit, stack(Item.steel, 1)),
|
||||
pulseconduit(distribution, DistributionBlocks.pulseconduit, stack(Item.titanium, 1), stack(Item.steel, 1)),
|
||||
liquidrouter(distribution, DistributionBlocks.liquidrouter, stack(Item.steel, 2)),
|
||||
liquidjunction(distribution, DistributionBlocks.liquidjunction, stack(Item.steel, 2)),
|
||||
liquiditemjunction(distribution, DistributionBlocks.liquiditemjunction, stack(Item.steel, 1), stack(Item.iron, 1)),
|
||||
@@ -67,7 +66,11 @@ public enum Recipe{
|
||||
powerlaserrouter(power, DistributionBlocks.powerlaserrouter, stack(Item.titanium, 10), stack(Item.dirium, 10)),
|
||||
teleporter(power, DistributionBlocks.teleporter, stack(Item.titanium, 10), stack(Item.dirium, 10)),
|
||||
|
||||
pump(production, ProductionBlocks.pump, stack(Item.steel, 10));
|
||||
healturret(power, DefenseBlocks.repairturret, stack(Item.iron, 30)),
|
||||
megahealturret(power, DefenseBlocks.megarepairturret, stack(Item.iron, 20), stack(Item.steel, 30)),
|
||||
|
||||
pump(production, ProductionBlocks.pump, stack(Item.steel, 10)),
|
||||
fluxpump(production, ProductionBlocks.fluxpump, stack(Item.steel, 10), stack(Item.dirium, 5));
|
||||
|
||||
public Block result;
|
||||
public ItemStack[] requirements;
|
||||
|
||||
@@ -57,6 +57,8 @@ public class Block{
|
||||
public Liquid liquidDrop = null;
|
||||
/**multiblock width/height*/
|
||||
public int width = 1, height = 1;
|
||||
/**Detailed description of the block. Can be as long as necesary.*/
|
||||
public String fullDescription; //TODO show this
|
||||
|
||||
public Block(String name) {
|
||||
blocks.add(this);
|
||||
|
||||
@@ -9,7 +9,13 @@ public class DistributionBlocks{
|
||||
public static final Block
|
||||
|
||||
conduit = new LiquidBlock("conduit"){{
|
||||
|
||||
health = 45;
|
||||
}},
|
||||
|
||||
pulseconduit = new LiquidBlock("pulseconduit"){{
|
||||
liquidCapacity = 16f;
|
||||
flowfactor = 4.9f;
|
||||
health = 65;
|
||||
}},
|
||||
|
||||
liquidrouter = new LiquidRouter("liquidrouter"){{
|
||||
@@ -27,7 +33,7 @@ public class DistributionBlocks{
|
||||
}},
|
||||
|
||||
//TODO
|
||||
poweredconveyor = new Conveyor("poweredconveyor"){{
|
||||
pulseconveyor = new Conveyor("poweredconveyor"){{
|
||||
health = 90;
|
||||
speed = 0.09f;
|
||||
formalName = "pulse conveyor";
|
||||
|
||||
@@ -42,6 +42,10 @@ public class ProductionBlocks{
|
||||
|
||||
}},
|
||||
|
||||
fluxpump = new Pump("fluxpump"){{
|
||||
pumpspeed = 3f;
|
||||
}},
|
||||
|
||||
smelter = new Crafter("smelter"){
|
||||
{
|
||||
health = 70;
|
||||
@@ -51,7 +55,7 @@ public class ProductionBlocks{
|
||||
|
||||
@Override
|
||||
public String description(){
|
||||
return "Takes in coal + iron, outputs steel.";
|
||||
return "Converts coal + iron to steel.";
|
||||
}
|
||||
},
|
||||
|
||||
@@ -64,7 +68,7 @@ public class ProductionBlocks{
|
||||
|
||||
@Override
|
||||
public String description(){
|
||||
return "Takes in steel + titanium, outputs dirium.";
|
||||
return "Converts steel + titanium to dirium.";
|
||||
}
|
||||
},
|
||||
|
||||
@@ -82,7 +86,7 @@ public class ProductionBlocks{
|
||||
|
||||
@Override
|
||||
public String description(){
|
||||
return "Takes in stone + water, outputs coal.";
|
||||
return "Converts stone + water to coal.";
|
||||
}
|
||||
},
|
||||
|
||||
@@ -101,7 +105,7 @@ public class ProductionBlocks{
|
||||
|
||||
@Override
|
||||
public String description(){
|
||||
return "Takes in iron + water, outputs titanium.";
|
||||
return "Converts iron + water to titanium.";
|
||||
}
|
||||
},
|
||||
|
||||
@@ -119,7 +123,45 @@ public class ProductionBlocks{
|
||||
|
||||
@Override
|
||||
public String description(){
|
||||
return "Takes in oil, outputs coal.";
|
||||
return "Converts oil to coal.";
|
||||
}
|
||||
},
|
||||
|
||||
stoneformer = new LiquidCrafter("stoneformer"){
|
||||
{
|
||||
formalName = "stone former";
|
||||
input = Item.iron;
|
||||
inputAmount = 2;
|
||||
inputLiquid = Liquid.lava;
|
||||
liquidAmount = 20f;
|
||||
liquidCapacity = 21f;
|
||||
purifyTime = 10;
|
||||
output = Item.stone;
|
||||
health = 80;
|
||||
craftEffect = Fx.purifystone;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description(){
|
||||
return "Converts lava to stone.";
|
||||
}
|
||||
},
|
||||
|
||||
lavasmelter = new LiquidCrafter("lavasmelter"){
|
||||
{
|
||||
formalName = "lava smelter";
|
||||
inputLiquid = Liquid.lava;
|
||||
liquidAmount = 40f;
|
||||
liquidCapacity = 41f;
|
||||
purifyTime = 25;
|
||||
output = Item.stone;
|
||||
health = 80;
|
||||
craftEffect = Fx.purifystone;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description(){
|
||||
return "Converts iron + lava to steel.";
|
||||
}
|
||||
},
|
||||
|
||||
@@ -156,7 +198,7 @@ public class ProductionBlocks{
|
||||
|
||||
omnidrill = new Drill("omnidrill"){
|
||||
{
|
||||
time = 2;
|
||||
time = 3;
|
||||
formalName = "omnidrill";
|
||||
}
|
||||
|
||||
|
||||
@@ -76,7 +76,8 @@ public class LiquidBlock extends Block implements LiquidAcceptor{
|
||||
if(next != null && next.block() instanceof LiquidAcceptor && entity.liquidAmount > 0.01f){
|
||||
LiquidAcceptor other = (LiquidAcceptor)next.block();
|
||||
|
||||
float flow = Math.min(other.getLiquidCapacity(next) - other.getLiquid(next) - 0.001f, Math.min(entity.liquidAmount/flowfactor, entity.liquidAmount));
|
||||
float flow = Math.min(other.getLiquidCapacity(next) - other.getLiquid(next) - 0.001f,
|
||||
Math.min(entity.liquidAmount/flowfactor, entity.liquidAmount));
|
||||
|
||||
if(flow <= 0f || entity.liquidAmount < flow) return;
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@ public class RepairTurret extends Turret{
|
||||
|
||||
if(entity.blockTarget.health > entity.blockTarget.health)
|
||||
entity.blockTarget.health = entity.blockTarget.maxhealth;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@ import io.anuke.ucore.util.Angles;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
|
||||
public class Turret extends Block{
|
||||
public static final int targetInterval = 15;
|
||||
private static boolean drawDebug = false;
|
||||
static final int targetInterval = 15;
|
||||
static boolean drawDebug = false;
|
||||
|
||||
protected float range = 50f;
|
||||
protected float reload = 10f;
|
||||
@@ -118,7 +118,7 @@ public class Turret extends Block{
|
||||
if(entity.target != null && entity.target.isDead())
|
||||
entity.target = null;
|
||||
|
||||
if(hasAmmo(tile)){
|
||||
if(hasAmmo(tile) || (Vars.debug && Vars.infiniteAmmo)){
|
||||
|
||||
if(Timers.get(entity, "target", targetInterval)){
|
||||
entity.target = (Enemy)Entities.getClosest(tile.worldx(), tile.worldy(), range, e->{
|
||||
|
||||
@@ -29,6 +29,15 @@ public class Pump extends LiquidBlock{
|
||||
@Override
|
||||
public void draw(Tile tile){
|
||||
Draw.rect(name(), tile.worldx(), tile.worldy());
|
||||
|
||||
LiquidEntity entity = tile.entity();
|
||||
|
||||
if(entity.liquid == null) return;
|
||||
|
||||
Draw.color(entity.liquid.color);
|
||||
Draw.alpha(entity.liquidAmount / liquidCapacity);
|
||||
Draw.rect("blank", tile.worldx(), tile.worldy(), 2, 2);
|
||||
Draw.color();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -47,7 +56,7 @@ public class Pump extends LiquidBlock{
|
||||
if(tile.floor().liquidDrop != null &&
|
||||
Timers.get(tile, "pump", 8) && entity.liquidAmount < liquidCapacity){
|
||||
entity.liquid = tile.floor().liquidDrop;
|
||||
entity.liquidAmount += pumpspeed;
|
||||
entity.liquidAmount += Math.min(pumpspeed, this.liquidCapacity - entity.liquidAmount);
|
||||
}
|
||||
|
||||
if(Timers.get(tile, "dump", 1)){
|
||||
|
||||
Reference in New Issue
Block a user