mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-10 12:49:37 +07:00
deep water is 2x better to pump
This commit is contained in:
parent
3fbeb33390
commit
76e21fbd19
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;
|
||||
variants = 0;
|
||||
liquidDrop = Liquids.water;
|
||||
liquidMultiplier = 2f;
|
||||
isLiquid = true;
|
||||
status = StatusEffects.wet;
|
||||
statusDuration = 120f;
|
||||
|
@ -42,6 +42,8 @@ public class Floor extends Block{
|
||||
public float statusDuration = 60f;
|
||||
/** liquids that drop from this block, used for pumps */
|
||||
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 */
|
||||
public @Nullable Item itemDrop = null;
|
||||
/** whether this block can be drowned in */
|
||||
|
@ -33,18 +33,18 @@ public class Pump extends LiquidBlock{
|
||||
Tile tile = world.tile(x, y);
|
||||
if(tile == null) return;
|
||||
|
||||
float tiles = 0f;
|
||||
float amount = 0f;
|
||||
Liquid liquidDrop = null;
|
||||
|
||||
for(Tile other : tile.getLinkedTilesAs(this, tempTiles)){
|
||||
if(canPump(other)){
|
||||
liquidDrop = other.floor().liquidDrop;
|
||||
tiles++;
|
||||
amount += other.floor().liquidMultiplier;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
Draw.mixcol(Color.darkGray, 1f);
|
||||
Draw.rect(liquidDrop.icon(Cicon.small), dx, dy - 1);
|
||||
@ -80,8 +80,8 @@ public class Pump extends LiquidBlock{
|
||||
}
|
||||
|
||||
public class PumpEntity extends LiquidBlockEntity{
|
||||
float tiles = 0f;
|
||||
Liquid liquidDrop = null;
|
||||
public float amount = 0f;
|
||||
public Liquid liquidDrop = null;
|
||||
|
||||
@Override
|
||||
public void draw(){
|
||||
@ -97,18 +97,18 @@ public class Pump extends LiquidBlock{
|
||||
public void onProximityUpdate(){
|
||||
super.onProximityUpdate();
|
||||
|
||||
tiles = 0f;
|
||||
amount = 0f;
|
||||
liquidDrop = null;
|
||||
|
||||
if(isMultiblock()){
|
||||
for(Tile other : tile.getLinkedTiles(tempTiles)){
|
||||
if(canPump(other)){
|
||||
liquidDrop = other.floor().liquidDrop;
|
||||
tiles++;
|
||||
amount += other.floor().liquidMultiplier;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
tiles = 1f;
|
||||
amount = tile.floor().liquidMultiplier;
|
||||
liquidDrop = tile.floor().liquidDrop;
|
||||
}
|
||||
}
|
||||
@ -121,7 +121,7 @@ public class Pump extends LiquidBlock{
|
||||
@Override
|
||||
public void updateTile(){
|
||||
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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user