Serpulo transport stuff + qol (#10706)
* death penalty, instant * idk if to leave to exactly 11/s or 12/s * yass display changes * broke * hhh * a * welp, good enough * ok fixed * totally not stealing from foos. Yup * revert dump * a
This commit is contained in:
@@ -4,12 +4,14 @@ import arc.util.io.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.type.*;
|
||||
import mindustry.world.*;
|
||||
import mindustry.world.meta.*;
|
||||
|
||||
public class BufferedItemBridge extends ItemBridge{
|
||||
public final int timerAccept = timers++;
|
||||
|
||||
public float speed = 40f;
|
||||
public int bufferCapacity = 50;
|
||||
public float displayedSpeed = 11f;
|
||||
|
||||
public BufferedItemBridge(String name){
|
||||
super(name);
|
||||
@@ -17,6 +19,15 @@ public class BufferedItemBridge extends ItemBridge{
|
||||
hasItems = true;
|
||||
canOverdrive = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStats(){
|
||||
super.setStats();
|
||||
|
||||
//Hard to calculate, fps and overdive reliant. Movement speed taken from testing
|
||||
stats.add(Stat.itemsMoved, displayedSpeed, StatUnit.itemsSecond);
|
||||
}
|
||||
|
||||
|
||||
public class BufferedItemBridgeBuild extends ItemBridgeBuild{
|
||||
ItemBuffer buffer = new ItemBuffer(bufferCapacity);
|
||||
@@ -40,16 +51,18 @@ public class BufferedItemBridge extends ItemBridge{
|
||||
dump();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void write(Writes write){
|
||||
super.write(write);
|
||||
buffer.write(write);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void read(Reads read, byte revision){
|
||||
super.read(read, revision);
|
||||
buffer.read(read);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,8 @@ package mindustry.world.blocks.distribution;
|
||||
|
||||
import mindustry.gen.*;
|
||||
import mindustry.type.*;
|
||||
import mindustry.world.*;
|
||||
import mindustry.world.meta.*;
|
||||
|
||||
public class DuctBridge extends DirectionBridge{
|
||||
public float speed = 5f;
|
||||
@@ -15,6 +17,12 @@ public class DuctBridge extends DirectionBridge{
|
||||
isDuct = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStats(){
|
||||
super.setStats();
|
||||
stats.add(Stat.itemsMoved, 60f / speed, StatUnit.itemsSecond);
|
||||
}
|
||||
|
||||
public class DuctBridgeBuild extends DirectionBridgeBuild{
|
||||
public float progress = 0f;
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ public class ItemBridge extends Block{
|
||||
public final int timerCheckMoved = timers ++;
|
||||
|
||||
public int range;
|
||||
public float transportTime = 2f;
|
||||
public float transportTime;
|
||||
public @Load("@-end") TextureRegion endRegion;
|
||||
public @Load("@-bridge") TextureRegion bridgeRegion;
|
||||
public @Load("@-arrow") TextureRegion arrowRegion;
|
||||
@@ -65,6 +65,14 @@ public class ItemBridge extends Block{
|
||||
config(Integer.class, (ItemBridgeBuild tile, Integer i) -> tile.link = i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStats() {
|
||||
super.setStats();
|
||||
if(transportTime != 0f){
|
||||
stats.add(Stat.itemsMoved, 60f / transportTime, StatUnit.itemsSecond);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawPlanConfigTop(BuildPlan plan, Eachable<BuildPlan> list){
|
||||
otherReq = null;
|
||||
@@ -518,4 +526,4 @@ public class ItemBridge extends Block{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import static mindustry.Vars.*;
|
||||
public class Junction extends Block{
|
||||
public float speed = 26; //frames taken to go through this junction
|
||||
public int capacity = 6;
|
||||
public float displayedSpeed = 13f;
|
||||
|
||||
public Junction(String name){
|
||||
super(name);
|
||||
@@ -24,6 +25,15 @@ public class Junction extends Block{
|
||||
noUpdateDisabled = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStats(){
|
||||
super.setStats();
|
||||
|
||||
//(60f / speed * capacity) returns 13.84 which is not the actual value (non linear, depends on fps)
|
||||
stats.add(Stat.itemsMoved, displayedSpeed, StatUnit.itemsSecond);
|
||||
stats.add(Stat.itemCapacity, capacity, StatUnit.items);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean outputsItems(){
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user