mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-08 14:57:18 +07:00
plastanium balancing
This commit is contained in:
@ -911,7 +911,7 @@ public class Blocks implements ContentList{
|
|||||||
plastaniumConveyor = new StackConveyor("plastanium-conveyor"){{
|
plastaniumConveyor = new StackConveyor("plastanium-conveyor"){{
|
||||||
requirements(Category.distribution, with(Items.plastanium, 1, Items.silicon, 1, Items.graphite, 1));
|
requirements(Category.distribution, with(Items.plastanium, 1, Items.silicon, 1, Items.graphite, 1));
|
||||||
health = 75;
|
health = 75;
|
||||||
speed = 3.5f / 60f;
|
speed = 3f / 60f;
|
||||||
itemCapacity = 10;
|
itemCapacity = 10;
|
||||||
displayedSpeed = 30f;
|
displayedSpeed = 30f;
|
||||||
}};
|
}};
|
||||||
|
@ -27,6 +27,7 @@ public class StackConveyor extends Block implements Autotiler{
|
|||||||
public float speed = 0f;
|
public float speed = 0f;
|
||||||
public boolean splitOut = true;
|
public boolean splitOut = true;
|
||||||
public float displayedSpeed = 30f;
|
public float displayedSpeed = 30f;
|
||||||
|
public float recharge = 2f;
|
||||||
|
|
||||||
public StackConveyor(String name){
|
public StackConveyor(String name){
|
||||||
super(name);
|
super(name);
|
||||||
@ -47,7 +48,7 @@ public class StackConveyor extends Block implements Autotiler{
|
|||||||
public void setStats(){
|
public void setStats(){
|
||||||
super.setStats();
|
super.setStats();
|
||||||
|
|
||||||
stats.add(BlockStat.itemsMoved, displayedSpeed, StatUnit.itemsSecond);
|
stats.add(BlockStat.itemsMoved, Mathf.round(itemCapacity * speed * 60), StatUnit.itemsSecond);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -166,7 +167,7 @@ public class StackConveyor extends Block implements Autotiler{
|
|||||||
@Override
|
@Override
|
||||||
public void updateTile(){
|
public void updateTile(){
|
||||||
// reel in crater
|
// reel in crater
|
||||||
if(cooldown > 0f) cooldown = Mathf.clamp(cooldown - speed * edelta());
|
if(cooldown > 0f) cooldown = Mathf.clamp(cooldown - speed * edelta(), 0f, recharge);
|
||||||
|
|
||||||
if(link == -1){
|
if(link == -1){
|
||||||
return;
|
return;
|
||||||
@ -200,7 +201,7 @@ public class StackConveyor extends Block implements Autotiler{
|
|||||||
link = -1;
|
link = -1;
|
||||||
items.clear();
|
items.clear();
|
||||||
|
|
||||||
cooldown = 1f;
|
cooldown = recharge;
|
||||||
e.cooldown = 1;
|
e.cooldown = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -249,7 +250,7 @@ public class StackConveyor extends Block implements Autotiler{
|
|||||||
@Override
|
@Override
|
||||||
public boolean acceptItem(Building source, Item item){
|
public boolean acceptItem(Building source, Item item){
|
||||||
if(this == source) return true; // player threw items
|
if(this == source) return true; // player threw items
|
||||||
if(cooldown > 0) return false; // still cooling down
|
if(cooldown > recharge - 1f) return false; // still cooling down
|
||||||
return !((state != stateLoad) // not a loading dock
|
return !((state != stateLoad) // not a loading dock
|
||||||
|| (items.total() > 0 && !items.has(item)) // incompatible items
|
|| (items.total() > 0 && !items.has(item)) // incompatible items
|
||||||
|| (items.total() >= getMaximumAccepted(item)) // filled to capacity
|
|| (items.total() >= getMaximumAccepted(item)) // filled to capacity
|
||||||
|
Reference in New Issue
Block a user