Fixes to power system

This commit is contained in:
Anuken 2018-10-20 13:49:58 -04:00
parent 4d6c25c9d3
commit e55f6ecd6b
4 changed files with 13 additions and 1 deletions

View file

@ -46,6 +46,7 @@ public class CraftingBlocks extends BlockList implements ContentList{
craftEffect = BlockFx.smeltsmoke;
result = Items.silicon;
craftTime = 40f;
powerCapacity = 20f;
size = 2;
hasLiquids = false;
flameColor = Color.valueOf("ffef99");
@ -60,6 +61,7 @@ public class CraftingBlocks extends BlockList implements ContentList{
craftTime = 60f;
output = Items.plastanium;
itemCapacity = 30;
powerCapacity = 40f;
size = 2;
health = 320;
hasPower = hasLiquids = true;
@ -75,6 +77,7 @@ public class CraftingBlocks extends BlockList implements ContentList{
craftEffect = BlockFx.smeltsmoke;
result = Items.phasematter;
craftTime = 120f;
powerCapacity = 50f;
size = 2;
consumes.items(new ItemStack[]{new ItemStack(Items.thorium, 4), new ItemStack(Items.sand, 10)});
@ -85,6 +88,7 @@ public class CraftingBlocks extends BlockList implements ContentList{
craftEffect = BlockFx.smeltsmoke;
result = Items.surgealloy;
craftTime = 75f;
powerCapacity = 60f;
size = 2;
useFlux = true;

View file

@ -32,6 +32,12 @@ public class Router extends Block{
@Override
public void update(Tile tile){
SplitterEntity entity = tile.entity();
if(entity.lastItem == null && entity.items.total() > 0){
entity.lastItem = entity.items.take();
entity.items.add(entity.lastItem, 1);
}
if(entity.lastItem != null){
entity.time += 1f/speed * Timers.delta();
Tile target = getTileTarget(tile, entity.lastItem, entity.lastInput, false);

View file

@ -5,6 +5,7 @@ import com.badlogic.gdx.utils.IntSet;
import com.badlogic.gdx.utils.ObjectSet;
import com.badlogic.gdx.utils.Queue;
import io.anuke.mindustry.world.Tile;
import io.anuke.ucore.core.Timers;
import static io.anuke.mindustry.Vars.threads;
@ -55,7 +56,7 @@ public class PowerGraph{
outputs += Math.min(tile.block().powerCapacity - tile.entity.power.amount, toEach) / toEach;
}
float finalEach = toEach / outputs;
float finalEach = toEach / outputs * Timers.delta();
float buffer = 0f;
if(Float.isNaN(finalEach) || Float.isInfinite(finalEach)){

View file

@ -46,6 +46,7 @@ public class PhaseWeaver extends PowerSmelter{
Shaders.build.region = weaveRegion;
Shaders.build.progress = progress;
Shaders.build.color.set(Palette.accent);
Shaders.build.color.a = entity.heat;
Shaders.build.time = -entity.time / 10f;
Graphics.shader(Shaders.build, false);