From 2f83ba7f5c658d44193c30547b9788687a89fad2 Mon Sep 17 00:00:00 2001 From: Anuken Date: Fri, 8 Jan 2021 12:22:32 -0500 Subject: [PATCH] Logic battery control + Slight swarmer range buff --- core/src/mindustry/content/Blocks.java | 2 +- .../mindustry/entities/bullet/MissileBulletType.java | 2 +- core/src/mindustry/world/blocks/defense/Wall.java | 1 + .../mindustry/world/blocks/logic/LogicDisplay.java | 1 + .../src/mindustry/world/blocks/logic/MemoryBlock.java | 1 + .../mindustry/world/blocks/logic/MessageBlock.java | 1 + core/src/mindustry/world/blocks/power/PowerGraph.java | 11 +++++------ core/src/mindustry/world/blocks/power/PowerNode.java | 1 + .../src/mindustry/world/blocks/storage/CoreBlock.java | 1 + gradle.properties | 2 +- 10 files changed, 14 insertions(+), 9 deletions(-) diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index d071e7dab9..1665d28b8f 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -1595,7 +1595,7 @@ public class Blocks implements ContentList{ shots = 4; burstSpacing = 5; inaccuracy = 10f; - range = 190f; + range = 200f; xRand = 6f; size = 2; health = 300 * size * size; diff --git a/core/src/mindustry/entities/bullet/MissileBulletType.java b/core/src/mindustry/entities/bullet/MissileBulletType.java index 274a806f5e..7d8cf7b8a3 100644 --- a/core/src/mindustry/entities/bullet/MissileBulletType.java +++ b/core/src/mindustry/entities/bullet/MissileBulletType.java @@ -15,7 +15,7 @@ public class MissileBulletType extends BasicBulletType{ height = 8f; hitSound = Sounds.explosion; trailChance = 0.2f; - lifetime = 49f; + lifetime = 52f; } public MissileBulletType(float speed, float damage){ diff --git a/core/src/mindustry/world/blocks/defense/Wall.java b/core/src/mindustry/world/blocks/defense/Wall.java index 6f59fb8e34..cde36ba964 100644 --- a/core/src/mindustry/world/blocks/defense/Wall.java +++ b/core/src/mindustry/world/blocks/defense/Wall.java @@ -37,6 +37,7 @@ public class Wall extends Block{ group = BlockGroup.walls; buildCostMultiplier = 6f; canOverdrive = false; + drawDisabled = false; } @Override diff --git a/core/src/mindustry/world/blocks/logic/LogicDisplay.java b/core/src/mindustry/world/blocks/logic/LogicDisplay.java index 22e2b0fb6e..419be008a9 100644 --- a/core/src/mindustry/world/blocks/logic/LogicDisplay.java +++ b/core/src/mindustry/world/blocks/logic/LogicDisplay.java @@ -35,6 +35,7 @@ public class LogicDisplay extends Block{ update = true; solid = true; group = BlockGroup.logic; + drawDisabled = false; } @Override diff --git a/core/src/mindustry/world/blocks/logic/MemoryBlock.java b/core/src/mindustry/world/blocks/logic/MemoryBlock.java index 5b91425a27..cff63b98a3 100644 --- a/core/src/mindustry/world/blocks/logic/MemoryBlock.java +++ b/core/src/mindustry/world/blocks/logic/MemoryBlock.java @@ -13,6 +13,7 @@ public class MemoryBlock extends Block{ destructible = true; solid = true; group = BlockGroup.logic; + drawDisabled = false; } @Override diff --git a/core/src/mindustry/world/blocks/logic/MessageBlock.java b/core/src/mindustry/world/blocks/logic/MessageBlock.java index f47b613d72..0e34825b49 100644 --- a/core/src/mindustry/world/blocks/logic/MessageBlock.java +++ b/core/src/mindustry/world/blocks/logic/MessageBlock.java @@ -29,6 +29,7 @@ public class MessageBlock extends Block{ solid = true; destructible = true; group = BlockGroup.logic; + drawDisabled = false; config(String.class, (MessageBuild tile, String text) -> { if(text.length() > maxTextLength){ diff --git a/core/src/mindustry/world/blocks/power/PowerGraph.java b/core/src/mindustry/world/blocks/power/PowerGraph.java index 26c34268d9..8c79b63804 100644 --- a/core/src/mindustry/world/blocks/power/PowerGraph.java +++ b/core/src/mindustry/world/blocks/power/PowerGraph.java @@ -102,7 +102,7 @@ public class PowerGraph{ float totalAccumulator = 0f; for(Building battery : batteries){ Consumers consumes = battery.block.consumes; - if(consumes.hasPower()){ + if(battery.enabled && consumes.hasPower()){ totalAccumulator += battery.power.status * consumes.getPower().capacity; } } @@ -112,7 +112,7 @@ public class PowerGraph{ public float getBatteryCapacity(){ float totalCapacity = 0f; for(Building battery : batteries){ - if(battery.block.consumes.hasPower()){ + if(battery.enabled && battery.block.consumes.hasPower()){ ConsumePower power = battery.block.consumes.getPower(); totalCapacity += (1f - battery.power.status) * power.capacity; } @@ -123,7 +123,7 @@ public class PowerGraph{ public float getTotalBatteryCapacity(){ float totalCapacity = 0f; for(Building battery : batteries){ - if(battery.block.consumes.hasPower()){ + if(battery.enabled && battery.block.consumes.hasPower()){ totalCapacity += battery.block.consumes.getPower().capacity; } } @@ -138,7 +138,7 @@ public class PowerGraph{ float consumedPowerPercentage = Math.min(1.0f, needed / stored); for(Building battery : batteries){ Consumers consumes = battery.block.consumes; - if(consumes.hasPower()){ + if(battery.enabled && consumes.hasPower()){ battery.power.status *= (1f-consumedPowerPercentage); } } @@ -153,7 +153,7 @@ public class PowerGraph{ for(Building battery : batteries){ Consumers consumes = battery.block.consumes; - if(consumes.hasPower()){ + if(battery.enabled && consumes.hasPower()){ ConsumePower consumePower = consumes.getPower(); if(consumePower.capacity > 0f){ battery.power.status += (1f- battery.power.status) * chargedPercent; @@ -216,7 +216,6 @@ public class PowerGraph{ lastScaledPowerIn = powerProduced / Time.delta; lastScaledPowerOut = powerNeeded / Time.delta; lastCapacity = getTotalBatteryCapacity(); - lastPowerStored = getBatteryStored(); powerBalance.add((lastPowerProduced - lastPowerNeeded) / Time.delta); diff --git a/core/src/mindustry/world/blocks/power/PowerNode.java b/core/src/mindustry/world/blocks/power/PowerNode.java index f5801d98a7..1e77e2b41d 100644 --- a/core/src/mindustry/world/blocks/power/PowerNode.java +++ b/core/src/mindustry/world/blocks/power/PowerNode.java @@ -43,6 +43,7 @@ public class PowerNode extends PowerBlock{ outputsPower = false; canOverdrive = false; swapDiagonalPlacement = true; + drawDisabled = false; config(Integer.class, (entity, value) -> { PowerModule power = entity.power; diff --git a/core/src/mindustry/world/blocks/storage/CoreBlock.java b/core/src/mindustry/world/blocks/storage/CoreBlock.java index 13e84e1dd8..da2ac30b8f 100644 --- a/core/src/mindustry/world/blocks/storage/CoreBlock.java +++ b/core/src/mindustry/world/blocks/storage/CoreBlock.java @@ -53,6 +53,7 @@ public class CoreBlock extends StorageBlock{ loopSound = Sounds.respawning; loopSoundVolume = 1f; group = BlockGroup.none; + drawDisabled = false; } @Remote(called = Loc.server) diff --git a/gradle.properties b/gradle.properties index 203de61508..ad549888ac 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ org.gradle.daemon=true org.gradle.jvmargs=-Xms256m -Xmx1024m -archash=71b1c84015119f57bf4d215f594ead1ffc9e8744 +archash=b2f3d212c1a88a62f140f5cb04f4c86e61332d1c