From 76e21fbd19dd2b4259ec3b858069f057d8bcb587 Mon Sep 17 00:00:00 2001 From: DeltaNedas <deltanedas@gmail.com> Date: Sat, 8 Aug 2020 18:45:25 +0100 Subject: [PATCH 1/2] deep water is 2x better to pump --- .../src/main/resources/revisions/Bullet/5.json | 1 + .../resources/revisions/EffectState/5.json | 1 + core/src/mindustry/content/Blocks.java | 1 + .../world/blocks/environment/Floor.java | 2 ++ .../world/blocks/production/Pump.java | 18 +++++++++--------- 5 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 annotations/src/main/resources/revisions/Bullet/5.json create mode 100644 annotations/src/main/resources/revisions/EffectState/5.json diff --git a/annotations/src/main/resources/revisions/Bullet/5.json b/annotations/src/main/resources/revisions/Bullet/5.json new file mode 100644 index 0000000000..45ea3922f9 --- /dev/null +++ b/annotations/src/main/resources/revisions/Bullet/5.json @@ -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}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/EffectState/5.json b/annotations/src/main/resources/revisions/EffectState/5.json new file mode 100644 index 0000000000..a71a2fe3bb --- /dev/null +++ b/annotations/src/main/resources/revisions/EffectState/5.json @@ -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}]} \ No newline at end of file diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index adf88a4235..5cc9a2f1f8 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -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; diff --git a/core/src/mindustry/world/blocks/environment/Floor.java b/core/src/mindustry/world/blocks/environment/Floor.java index c67f4c4355..89a5918469 100644 --- a/core/src/mindustry/world/blocks/environment/Floor.java +++ b/core/src/mindustry/world/blocks/environment/Floor.java @@ -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 */ diff --git a/core/src/mindustry/world/blocks/production/Pump.java b/core/src/mindustry/world/blocks/production/Pump.java index cc109b57d7..7344fe69ab 100644 --- a/core/src/mindustry/world/blocks/production/Pump.java +++ b/core/src/mindustry/world/blocks/production/Pump.java @@ -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); } From cb4c916ed7aaf6f906e60bc6b0f6f4e4adc5d5ca Mon Sep 17 00:00:00 2001 From: DeltaNedas <deltanedas@gmail.com> Date: Sat, 8 Aug 2020 23:25:02 +0100 Subject: [PATCH 2/2] oops --- annotations/src/main/resources/revisions/Bullet/5.json | 1 - annotations/src/main/resources/revisions/EffectState/5.json | 1 - 2 files changed, 2 deletions(-) delete mode 100644 annotations/src/main/resources/revisions/Bullet/5.json delete mode 100644 annotations/src/main/resources/revisions/EffectState/5.json diff --git a/annotations/src/main/resources/revisions/Bullet/5.json b/annotations/src/main/resources/revisions/Bullet/5.json deleted file mode 100644 index 45ea3922f9..0000000000 --- a/annotations/src/main/resources/revisions/Bullet/5.json +++ /dev/null @@ -1 +0,0 @@ -{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}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/EffectState/5.json b/annotations/src/main/resources/revisions/EffectState/5.json deleted file mode 100644 index a71a2fe3bb..0000000000 --- a/annotations/src/main/resources/revisions/EffectState/5.json +++ /dev/null @@ -1 +0,0 @@ -{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}]} \ No newline at end of file