New resources, blocks, core no longer accepts fuel materials

This commit is contained in:
Anuken
2018-02-22 20:12:20 -05:00
parent eae07c15a7
commit 81de9875d3
29 changed files with 497 additions and 417 deletions

View File

@@ -8,7 +8,7 @@ import io.anuke.ucore.core.Timers;
import io.anuke.ucore.entities.BulletEntity;
import io.anuke.ucore.entities.Entities;
import io.anuke.ucore.entities.Entity;
import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.graphics.Fill;
import io.anuke.ucore.util.Mathf;
import static io.anuke.mindustry.Vars.bulletGroup;
@@ -71,13 +71,12 @@ public class Shield extends Entity{
if(!(tile.block() instanceof ShieldBlock) || radius <= 1f){
return;
}
float rad = drawRadius();
Draw.rect("circle2", x, y, rad, rad);
Fill.circle(x, y, drawRadius());
}
float drawRadius(){
return (radius*2 + Mathf.sin(Timers.time(), 25f, 2f));
return (radius + Mathf.sin(Timers.time(), 25f, 1f));
}
public void removeDelay(){

View File

@@ -3,10 +3,7 @@ package io.anuke.mindustry.graphics;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Colors;
import io.anuke.ucore.core.Effects.Effect;
import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.graphics.Hue;
import io.anuke.ucore.graphics.Lines;
import io.anuke.ucore.graphics.Shapes;
import io.anuke.ucore.graphics.*;
import io.anuke.ucore.util.Angles;
import io.anuke.ucore.util.Mathf;
@@ -166,7 +163,6 @@ public class Fx{
Angles.randLenVectors(e.id, 5, e.ifract()*8f, (x, y)->{
float len = e.fract()*4f;
Draw.color(Color.valueOf("d2b29c"), Color.GRAY, e.ifract());
//Draw.alpha(e.fract());
Draw.rect("circle", e.x + x, e.y + y, len, len);
Draw.reset();
});
@@ -176,11 +172,18 @@ public class Fx{
Angles.randLenVectors(e.id, 5, e.ifract()*9f, (x, y)->{
float len = e.fract()*4f;
Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.ifract());
//Draw.alpha(e.fract());
Draw.rect("circle", e.x + x, e.y + y, len, len);
Draw.reset();
});
}),
pulverize = new Effect(25, e -> {
Angles.randLenVectors(e.id, 5, 3f + e.ifract()*5f, (x, y)->{
Draw.color(Color.valueOf("eae4f0"), Color.GRAY, e.ifract());
Fill.poly(e.x + x, e.y + y, 4, e.fract() * 2f + 0.5f, 45);
Draw.reset();
});
}),
laserspark = new Effect(14, e -> {
Angles.randLenVectors(e.id, 8, 1f + e.ifract()*11f, (x, y)->{
@@ -403,29 +406,14 @@ public class Fx{
Draw.reset();
}),
titanExplosion = new Effect(11, 48f, e -> {
Lines.stroke(2f*e.fract()+0.5f);
Draw.color(Color.WHITE, Color.DARK_GRAY, e.powfract());
Lines.circle(e.x, e.y, 5f + e.powfract() * 8f);
Draw.color(e.ifract() < 0.5f ? whiteOrange : Color.DARK_GRAY);
float rad = e.fract()*10f + 5f;
Angles.randLenVectors(e.id, 5, 9f, (x, y)->{
Draw.rect("circle2", e.x + x, e.y + y, rad, rad);
});
Draw.reset();
}),
explosion = new Effect(11, e -> {
Lines.stroke(2f*e.fract()+0.5f);
Draw.color(Color.WHITE, Color.DARK_GRAY, e.powfract());
Lines.circle(e.x, e.y, 5f + e.powfract() * 6f);
Draw.color(e.ifract() < 0.5f ? Color.WHITE : Color.DARK_GRAY);
float rad = e.fract()*10f + 5f;
Angles.randLenVectors(e.id, 5, 8f, (x, y)->{
Draw.rect("circle2", e.x + x, e.y + y, rad, rad);
Fill.circle(e.x + x, e.y + y, e.fract()*5f + 2.5f);
});
Draw.reset();
@@ -445,9 +433,8 @@ public class Fx{
Lines.circle(e.x, e.y, 2f + e.powfract() * 9f);
Draw.color(e.ifract() < 0.5f ? Color.WHITE : Color.DARK_GRAY);
float rad = e.fract()*10f + 2f;
Angles.randLenVectors(e.id, 5, 8f, (x, y)->{
Draw.rect("circle2", e.x + x, e.y + y, rad, rad);
Fill.circle(e.x + x, e.y + y, e.fract()*5f + 1f);
});
Draw.reset();

View File

@@ -11,20 +11,41 @@ public class Item{
public static final Item
stone = new Item("stone"),
iron = new Item("iron"),
coal = new Item("coal"),
coal = new Item("coal"){
{
explosiveness = 0.2f;
flammability = 0.5f;
material = false;
}
},
steel = new Item("steel"),
titanium = new Item("titanium"),
dirium = new Item("dirium"),
uranium = new Item("uranium"),
sand = new Item("sand");
/*glass = new Item("glass"),
silicon = new Item("silicon");*/
uranium = new Item("uranium"){
{
explosiveness = 0.1f;
material = false;
}
},
quartz = new Item("quartz") {
{
material = false;
}
},
glass = new Item("glass"),
silicon = new Item("silicon"){
{
material = false;
}
};
public final int id;
public final String name;
public TextureRegion region;
public float explosiveness = 0f;
public float flammability = 0f;
public boolean material = true;
public Item(String name) {
this.id = items.size;

View File

@@ -51,6 +51,8 @@ public class Recipes {
new Recipe(crafting, ProductionBlocks.oilrefinery, stack(Item.steel, 15), stack(Item.iron, 15)),
new Recipe(crafting, ProductionBlocks.stoneformer, stack(Item.steel, 10), stack(Item.iron, 10)),
new Recipe(crafting, ProductionBlocks.lavasmelter, stack(Item.steel, 30), stack(Item.titanium, 15)),
new Recipe(crafting, ProductionBlocks.pulverizer, stack(Item.steel, 30), stack(Item.titanium, 15)),
new Recipe(crafting, ProductionBlocks.siliconextractor, stack(Item.steel, 30), stack(Item.titanium, 15)),
new Recipe(crafting, ProductionBlocks.weaponFactory, stack(Item.steel, 60), stack(Item.iron, 60)).setDesktop(),
new Recipe(production, ProductionBlocks.stonedrill, stack(Item.stone, 12)),
@@ -58,6 +60,7 @@ public class Recipes {
new Recipe(production, ProductionBlocks.coaldrill, stack(Item.stone, 25), stack(Item.iron, 40)),
new Recipe(production, ProductionBlocks.titaniumdrill, stack(Item.iron, 50), stack(Item.steel, 50)),
new Recipe(production, ProductionBlocks.uraniumdrill, stack(Item.iron, 40), stack(Item.steel, 40)),
new Recipe(production, ProductionBlocks.quartzextractor, stack(Item.titanium, 40), stack(Item.dirium, 40)),
new Recipe(production, ProductionBlocks.omnidrill, stack(Item.titanium, 40), stack(Item.dirium, 40)),
new Recipe(power, ProductionBlocks.coalgenerator, stack(Item.iron, 30), stack(Item.stone, 20)),
@@ -82,8 +85,8 @@ public class Recipes {
new Recipe(liquid, DistributionBlocks.liquidrouter, stack(Item.steel, 2)),
new Recipe(liquid, DistributionBlocks.liquidjunction, stack(Item.steel, 2)),
new Recipe(production, ProductionBlocks.pump, stack(Item.steel, 10)),
new Recipe(production, ProductionBlocks.fluxpump, stack(Item.steel, 10), stack(Item.dirium, 5)),
new Recipe(liquid, ProductionBlocks.pump, stack(Item.steel, 10)),
new Recipe(liquid, ProductionBlocks.fluxpump, stack(Item.steel, 10), stack(Item.dirium, 5)),
new Recipe(units, DebugBlocks.powerVoid, stack(Item.steel, 10)).setDebug(),
new Recipe(units, DebugBlocks.powerInfinite, stack(Item.steel, 10), stack(Item.dirium, 5)).setDebug()

View File

@@ -103,7 +103,9 @@ public class Blocks{
dirt = new Floor("dirt"){},
sand = new Floor("sand"){},
sand = new Floor("sand"){{
drops = new ItemStack(Item.quartz, 1);
}},
ice = new Floor("ice"){},

View File

@@ -108,20 +108,21 @@ public class ProductionBlocks{
pulverizer = new PowerSmelter("pulverizer"){
{
inputs = new ItemStack[]{new ItemStack(Item.stone, 5)};
result = Item.sand;
result = Item.quartz;
health = 50;
craftTime = 60f;
powerDrain = 0.02f;
craftEffect = Fx.pulverize;
}
},
siliconextractor = new LiquidCrafter("siliconextractor"){
{
input = Item.sand;
input = Item.quartz;
inputAmount = 5;
inputLiquid = Liquid.water;
liquidAmount = 18.99f;
output = Item.sand;
output = Item.silicon;
health = 50;
purifyTime = 50;
}
@@ -172,9 +173,11 @@ public class ProductionBlocks{
}
},
sandextractor = new Omnidrill("sandextractor"){
quartzextractor = new Drill("quartzextractor"){
{
time = 4;
resource = Blocks.sand;
result = Item.quartz;
time = 5;
}
},

View File

@@ -35,8 +35,7 @@ public abstract class PowerBlock extends Block implements PowerAcceptor{
return entity.power + 0.001f <= powerCapacity;
}
//TODO voltage requirement so blocks need specific voltage
@Override
public float addPower(Tile tile, float amount){
if(amount < voltage){

View File

@@ -32,6 +32,6 @@ public class CoreBlock extends Block {
@Override
public boolean acceptItem(Item item, Tile tile, Tile source){
return true;
return item.material;
}
}