Added phaseweaver to recipe list
This commit is contained in:
@@ -59,7 +59,6 @@ public class Recipes implements ContentList{
|
||||
new Recipe(crafting, CraftingBlocks.siliconsmelter, new ItemStack(Items.tungsten, 60), new ItemStack(Items.lead, 50));
|
||||
|
||||
//other crafting
|
||||
//TODO phaseweaver sprites
|
||||
new Recipe(crafting, CraftingBlocks.phaseweaver, new ItemStack(Items.silicon, 160), new ItemStack(Items.lead, 160), new ItemStack(Items.thorium, 150));
|
||||
//TODO implement alloy smelter
|
||||
// new Recipe(crafting, CraftingBlocks.alloySmelter, new ItemStack(Items.silicon, 160), new ItemStack(Items.lead, 160), new ItemStack(Items.thorium, 140));
|
||||
|
||||
@@ -68,14 +68,14 @@ public class CraftingBlocks extends BlockList implements ContentList {
|
||||
updateEffect = BlockFx.plasticburn;
|
||||
}};
|
||||
|
||||
phaseweaver = new PowerSmelter("phase-weaver") {{
|
||||
phaseweaver = new PhaseWeaver("phase-weaver") {{
|
||||
health = 90;
|
||||
craftEffect = BlockFx.smeltsmoke;
|
||||
inputs = new ItemStack[]{new ItemStack(Items.thorium, 2), new ItemStack(Items.sand, 6)};
|
||||
inputs = new ItemStack[]{new ItemStack(Items.thorium, 4), new ItemStack(Items.sand, 10)};
|
||||
result = Items.phasematter;
|
||||
powerUse = 0.4f;
|
||||
craftTime = 100f;
|
||||
size = 3;
|
||||
craftTime = 120f;
|
||||
size = 2;
|
||||
}};
|
||||
|
||||
alloysmelter = new PowerSmelter("alloy-smelter") {{
|
||||
|
||||
@@ -111,7 +111,7 @@ public class ContentLoader {
|
||||
}
|
||||
|
||||
if(Block.all().size >= 256){
|
||||
throw new IllegalArgumentException("THE TIME HAS COME. More than 256 blocks have been created..");
|
||||
throw new IllegalArgumentException("THE TIME HAS COME. More than 256 blocks have been created.");
|
||||
}
|
||||
|
||||
Log.info("--- CONTENT INFO ---");
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package io.anuke.mindustry.world.blocks.production;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||
import io.anuke.mindustry.Vars;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.mindustry.graphics.Shaders;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.ucore.core.Graphics;
|
||||
import io.anuke.ucore.graphics.Draw;
|
||||
import io.anuke.ucore.graphics.Lines;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
|
||||
public class PhaseWeaver extends PowerSmelter{
|
||||
protected TextureRegion bottomRegion;
|
||||
protected TextureRegion weaveRegion;
|
||||
|
||||
public PhaseWeaver(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
super.load();
|
||||
|
||||
bottomRegion = Draw.region(name + "-bottom");
|
||||
weaveRegion = Draw.region(name + "-weave");
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureRegion[] getIcon() {
|
||||
if(icon == null){
|
||||
icon = new TextureRegion[]{Draw.region(name + "-bottom"), Draw.region(name)};
|
||||
}
|
||||
return icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Tile tile) {
|
||||
PowerSmelterEntity entity = tile.entity();
|
||||
|
||||
Draw.rect(bottomRegion, tile.drawx(), tile.drawy());
|
||||
|
||||
if(entity.heat > 0.001f){
|
||||
float progress = 0.5f;
|
||||
|
||||
Shaders.build.region = weaveRegion;
|
||||
Shaders.build.progress = progress;
|
||||
Shaders.build.color.set(Palette.accent);
|
||||
Shaders.build.time = -entity.time / 10f;
|
||||
|
||||
Graphics.shader(Shaders.build, false);
|
||||
Shaders.build.apply();
|
||||
Draw.rect(weaveRegion, tile.drawx(), tile.drawy(), entity.time);
|
||||
Graphics.shader();
|
||||
|
||||
Draw.color(Palette.accent);
|
||||
|
||||
Lines.lineAngleCenter(
|
||||
tile.drawx() + Mathf.sin(entity.time, 6f, Vars.tilesize / 3f * size),
|
||||
tile.drawy(),
|
||||
90,
|
||||
size * Vars.tilesize /2f);
|
||||
|
||||
Draw.reset();
|
||||
}
|
||||
|
||||
Draw.rect(name, tile.drawx(), tile.drawy());
|
||||
}
|
||||
}
|
||||
@@ -100,6 +100,7 @@ public class PowerSmelter extends PowerBlock {
|
||||
}
|
||||
|
||||
entity.heat = Mathf.clamp(entity.heat);
|
||||
entity.time += entity.heat * Timers.delta();
|
||||
|
||||
//make sure it has all the items
|
||||
for(ItemStack item : inputs){
|
||||
@@ -191,6 +192,7 @@ public class PowerSmelter extends PowerBlock {
|
||||
|
||||
class PowerSmelterEntity extends TileEntity{
|
||||
public float heat;
|
||||
public float time;
|
||||
|
||||
@Override
|
||||
public void write(DataOutputStream stream) throws IOException {
|
||||
|
||||
Reference in New Issue
Block a user