deep water is 2x better to pump
This commit is contained in:
1
annotations/src/main/resources/revisions/Bullet/5.json
Normal file
1
annotations/src/main/resources/revisions/Bullet/5.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{version:5,fields:[{name:collided,type:arc.struct.IntSeq,size:-1},{name:damage,type:float,size:4},{name:data,type:java.lang.Object,size:-1},{name:lifetime,type:float,size:4},{name:owner,type:mindustry.gen.Entityc,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:time,type:float,size:4},{name:type,type:mindustry.entities.bullet.BulletType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{version:5,fields:[{name:color,type:arc.graphics.Color,size:-1},{name:data,type:java.lang.Object,size:-1},{name:effect,type:mindustry.entities.Effect,size:-1},{name:lifetime,type:float,size:4},{name:offsetX,type:float,size:4},{name:offsetY,type:float,size:4},{name:parent,type:mindustry.gen.Posc,size:-1},{name:rotation,type:float,size:4},{name:time,type:float,size:4},{name:x,type:float,size:4},{name:y,type:float,size:4}]}
|
||||||
@@ -135,6 +135,7 @@ public class Blocks implements ContentList{
|
|||||||
speedMultiplier = 0.2f;
|
speedMultiplier = 0.2f;
|
||||||
variants = 0;
|
variants = 0;
|
||||||
liquidDrop = Liquids.water;
|
liquidDrop = Liquids.water;
|
||||||
|
liquidMultiplier = 2f;
|
||||||
isLiquid = true;
|
isLiquid = true;
|
||||||
status = StatusEffects.wet;
|
status = StatusEffects.wet;
|
||||||
statusDuration = 120f;
|
statusDuration = 120f;
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ public class Floor extends Block{
|
|||||||
public float statusDuration = 60f;
|
public float statusDuration = 60f;
|
||||||
/** liquids that drop from this block, used for pumps */
|
/** liquids that drop from this block, used for pumps */
|
||||||
public @Nullable Liquid liquidDrop = null;
|
public @Nullable Liquid liquidDrop = null;
|
||||||
|
/** Multiplier for pumped liquids, used for deep water. */
|
||||||
|
public float liquidMultiplier = 1f;
|
||||||
/** item that drops from this block, used for drills */
|
/** item that drops from this block, used for drills */
|
||||||
public @Nullable Item itemDrop = null;
|
public @Nullable Item itemDrop = null;
|
||||||
/** whether this block can be drowned in */
|
/** whether this block can be drowned in */
|
||||||
|
|||||||
@@ -33,18 +33,18 @@ public class Pump extends LiquidBlock{
|
|||||||
Tile tile = world.tile(x, y);
|
Tile tile = world.tile(x, y);
|
||||||
if(tile == null) return;
|
if(tile == null) return;
|
||||||
|
|
||||||
float tiles = 0f;
|
float amount = 0f;
|
||||||
Liquid liquidDrop = null;
|
Liquid liquidDrop = null;
|
||||||
|
|
||||||
for(Tile other : tile.getLinkedTilesAs(this, tempTiles)){
|
for(Tile other : tile.getLinkedTilesAs(this, tempTiles)){
|
||||||
if(canPump(other)){
|
if(canPump(other)){
|
||||||
liquidDrop = other.floor().liquidDrop;
|
liquidDrop = other.floor().liquidDrop;
|
||||||
tiles++;
|
amount += other.floor().liquidMultiplier;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(liquidDrop != null){
|
if(liquidDrop != null){
|
||||||
float width = drawPlaceText(Core.bundle.formatFloat("bar.pumpspeed", tiles * pumpAmount * 60f, 0), x, y, valid);
|
float width = drawPlaceText(Core.bundle.formatFloat("bar.pumpspeed", amount * pumpAmount * 60f, 0), x, y, valid);
|
||||||
float dx = x * tilesize + offset - width/2f - 4f, dy = y * tilesize + offset + size * tilesize / 2f + 5;
|
float dx = x * tilesize + offset - width/2f - 4f, dy = y * tilesize + offset + size * tilesize / 2f + 5;
|
||||||
Draw.mixcol(Color.darkGray, 1f);
|
Draw.mixcol(Color.darkGray, 1f);
|
||||||
Draw.rect(liquidDrop.icon(Cicon.small), dx, dy - 1);
|
Draw.rect(liquidDrop.icon(Cicon.small), dx, dy - 1);
|
||||||
@@ -80,8 +80,8 @@ public class Pump extends LiquidBlock{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public class PumpEntity extends LiquidBlockEntity{
|
public class PumpEntity extends LiquidBlockEntity{
|
||||||
float tiles = 0f;
|
public float amount = 0f;
|
||||||
Liquid liquidDrop = null;
|
public Liquid liquidDrop = null;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(){
|
public void draw(){
|
||||||
@@ -97,18 +97,18 @@ public class Pump extends LiquidBlock{
|
|||||||
public void onProximityUpdate(){
|
public void onProximityUpdate(){
|
||||||
super.onProximityUpdate();
|
super.onProximityUpdate();
|
||||||
|
|
||||||
tiles = 0f;
|
amount = 0f;
|
||||||
liquidDrop = null;
|
liquidDrop = null;
|
||||||
|
|
||||||
if(isMultiblock()){
|
if(isMultiblock()){
|
||||||
for(Tile other : tile.getLinkedTiles(tempTiles)){
|
for(Tile other : tile.getLinkedTiles(tempTiles)){
|
||||||
if(canPump(other)){
|
if(canPump(other)){
|
||||||
liquidDrop = other.floor().liquidDrop;
|
liquidDrop = other.floor().liquidDrop;
|
||||||
tiles++;
|
amount += other.floor().liquidMultiplier;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
tiles = 1f;
|
amount = tile.floor().liquidMultiplier;
|
||||||
liquidDrop = tile.floor().liquidDrop;
|
liquidDrop = tile.floor().liquidDrop;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -121,7 +121,7 @@ public class Pump extends LiquidBlock{
|
|||||||
@Override
|
@Override
|
||||||
public void updateTile(){
|
public void updateTile(){
|
||||||
if(consValid() && liquidDrop != null){
|
if(consValid() && liquidDrop != null){
|
||||||
float maxPump = Math.min(liquidCapacity - liquids.total(), tiles * pumpAmount * edelta());
|
float maxPump = Math.min(liquidCapacity - liquids.total(), amount * pumpAmount * edelta());
|
||||||
liquids.add(liquidDrop, maxPump);
|
liquids.add(liquidDrop, maxPump);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user