mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-12 10:59:22 +07:00
Balancing & bugfixes
This commit is contained in:
parent
5cfd784501
commit
973d907218
@ -25,17 +25,16 @@ public class TeamIndexProcess implements AsyncProcess{
|
||||
}
|
||||
|
||||
public int countType(Team team, UnitType type){
|
||||
return typeCounts[team.id].length < type.id ? 0 : typeCounts[team.id][type.id];
|
||||
return typeCounts[team.id].length <= type.id ? 0 : typeCounts[team.id][type.id];
|
||||
}
|
||||
|
||||
public void updateCount(Team team, UnitType type, int amount){
|
||||
int tid = type.id;
|
||||
|
||||
counts[team.id] += amount;
|
||||
if(typeCounts[team.id].length < tid){
|
||||
if(typeCounts[team.id].length <= type.id){
|
||||
typeCounts[team.id] = new int[Vars.content.units().size];
|
||||
}
|
||||
typeCounts[team.id][tid] += amount;
|
||||
typeCounts[team.id][type.id] += amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1004,17 +1004,17 @@ public class Blocks implements ContentList{
|
||||
|
||||
rotaryPump = new Pump("rotary-pump"){{
|
||||
requirements(Category.liquid, with(Items.copper, 70, Items.metaglass, 50, Items.silicon, 20, Items.titanium, 35));
|
||||
pumpAmount = 0.8f;
|
||||
consumes.power(0.15f);
|
||||
pumpAmount = 0.2f;
|
||||
consumes.power(0.3f);
|
||||
liquidCapacity = 30f;
|
||||
hasPower = true;
|
||||
size = 2;
|
||||
}};
|
||||
|
||||
thermalPump = new Pump("thermal-pump"){{
|
||||
requirements(Category.liquid, with(Items.copper, 80, Items.metaglass, 70, Items.silicon, 30, Items.titanium, 40, Items.thorium, 35));
|
||||
pumpAmount = 1.5f;
|
||||
consumes.power(0.30f);
|
||||
requirements(Category.liquid, with(Items.copper, 80, Items.metaglass, 90, Items.silicon, 30, Items.titanium, 40, Items.thorium, 35));
|
||||
pumpAmount = 0.22f;
|
||||
consumes.power(1f);
|
||||
liquidCapacity = 40f;
|
||||
hasPower = true;
|
||||
size = 3;
|
||||
@ -1228,6 +1228,9 @@ public class Blocks implements ContentList{
|
||||
rotateSpeed = 6f;
|
||||
warmupSpeed = 0.01f;
|
||||
|
||||
//more than the laser drill
|
||||
liquidBoostIntensity = 1.8f;
|
||||
|
||||
consumes.power(3f);
|
||||
consumes.liquid(Liquids.water, 0.1f).boost();
|
||||
}};
|
||||
|
@ -977,7 +977,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
||||
l.left();
|
||||
l.image(() -> liquids.current().icon(Cicon.small)).padRight(3f);
|
||||
l.label(() -> liquids.getFlowRate() < 0 ? "..." : Strings.fixed(liquids.getFlowRate(), 2) + ps).color(Color.lightGray);
|
||||
});
|
||||
}).left();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -34,6 +34,7 @@ public class PlacementFragment extends Fragment{
|
||||
ObjectMap<Category,Block> selectedBlocks = new ObjectMap<>();
|
||||
ObjectFloatMap<Category> scrollPositions = new ObjectFloatMap<>();
|
||||
Block menuHoverBlock;
|
||||
Displayable hover;
|
||||
Object lastDisplayState;
|
||||
boolean wasHovered;
|
||||
Table blockTable, toggler, topTable;
|
||||
@ -262,7 +263,7 @@ public class PlacementFragment extends Fragment{
|
||||
top.add(new Table()).growX().update(topTable -> {
|
||||
|
||||
//find current hovered thing
|
||||
Displayable hovered = hovered();
|
||||
Displayable hovered = hover;
|
||||
Block displayBlock = menuHoverBlock != null ? menuHoverBlock : control.input.block;
|
||||
Object displayState = displayBlock != null ? displayBlock : hovered;
|
||||
boolean isHovered = displayBlock == null; //use hovered thing if displayblock is null
|
||||
@ -430,7 +431,8 @@ public class PlacementFragment extends Fragment{
|
||||
}
|
||||
|
||||
boolean hasInfoBox(){
|
||||
return control.input.block != null || menuHoverBlock != null || hovered() != null;
|
||||
hover = hovered();
|
||||
return control.input.block != null || menuHoverBlock != null || hover != null;
|
||||
}
|
||||
|
||||
/** Returns the thing being hovered over. */
|
||||
@ -451,7 +453,7 @@ public class PlacementFragment extends Fragment{
|
||||
if(hoverTile != null){
|
||||
//if the tile has a building, display it
|
||||
if(hoverTile.build != null){
|
||||
hoverTile.build.updateFlow(true);
|
||||
hoverTile.build.updateFlow = true;
|
||||
return hoverTile.build;
|
||||
}
|
||||
|
||||
|
@ -13,8 +13,8 @@ import mindustry.world.meta.*;
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
public class Pump extends LiquidBlock{
|
||||
/** Pump amount, total. */
|
||||
protected float pumpAmount = 1f;
|
||||
/** Pump amount per tile. */
|
||||
protected float pumpAmount = 0.2f;
|
||||
|
||||
public Pump(String name){
|
||||
super(name);
|
||||
@ -25,7 +25,7 @@ public class Pump extends LiquidBlock{
|
||||
@Override
|
||||
public void setStats(){
|
||||
super.setStats();
|
||||
stats.add(BlockStat.output, 60f * pumpAmount, StatUnit.liquidSecond);
|
||||
stats.add(BlockStat.output, 60f * pumpAmount * size * size, StatUnit.liquidSecond);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -44,7 +44,7 @@ public class Pump extends LiquidBlock{
|
||||
}
|
||||
|
||||
if(liquidDrop != null){
|
||||
float width = drawPlaceText(Core.bundle.formatFloat("bar.pumpspeed", tiles * pumpAmount / size / size * 60f, 0), x, y, valid);
|
||||
float width = drawPlaceText(Core.bundle.formatFloat("bar.pumpspeed", tiles * pumpAmount * 60f, 0), x, y, valid);
|
||||
float dx = x * tilesize + offset - width/2f - 4f, dy = y * tilesize + offset + size * tilesize / 2f + 5;
|
||||
Draw.mixcol(Color.darkGray, 1f);
|
||||
Draw.rect(liquidDrop.icon(Cicon.small), dx, dy - 1);
|
||||
@ -80,6 +80,8 @@ public class Pump extends LiquidBlock{
|
||||
}
|
||||
|
||||
public class PumpEntity extends LiquidBlockEntity{
|
||||
float tiles = 0f;
|
||||
Liquid liquidDrop = null;
|
||||
|
||||
@Override
|
||||
public void draw(){
|
||||
@ -92,9 +94,11 @@ public class Pump extends LiquidBlock{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTile(){
|
||||
float tiles = 0f;
|
||||
Liquid liquidDrop = null;
|
||||
public void onProximityUpdate(){
|
||||
super.onProximityUpdate();
|
||||
|
||||
tiles = 0f;
|
||||
liquidDrop = null;
|
||||
|
||||
if(isMultiblock()){
|
||||
for(Tile other : tile.getLinkedTiles(tempTiles)){
|
||||
@ -107,9 +111,12 @@ public class Pump extends LiquidBlock{
|
||||
tiles = 1f;
|
||||
liquidDrop = tile.floor().liquidDrop;
|
||||
}
|
||||
}
|
||||
|
||||
if(cons.valid() && liquidDrop != null){
|
||||
float maxPump = Math.min(liquidCapacity - liquids.total(), tiles * pumpAmount * delta() / size / size) * efficiency();
|
||||
@Override
|
||||
public void updateTile(){
|
||||
if(consValid() && liquidDrop != null){
|
||||
float maxPump = Math.min(liquidCapacity - liquids.total(), tiles * pumpAmount * edelta());
|
||||
liquids.add(liquidDrop, maxPump);
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ public class LiquidModule extends BlockModule{
|
||||
|
||||
/** @return current liquid's flow rate in u/s; any value < 0 means 'not ready'. */
|
||||
public float getFlowRate(){
|
||||
return currentFlowRate;
|
||||
return currentFlowRate * 60;
|
||||
}
|
||||
|
||||
public float smoothAmount(){
|
||||
|
@ -1,3 +1,3 @@
|
||||
org.gradle.daemon=true
|
||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||
archash=1209e8cb8ef99b3cc089758f536b771b49078278
|
||||
archash=d1a629e5f26a038828d72d15c7c9acc01f84e77c
|
||||
|
Loading…
Reference in New Issue
Block a user