From 42fb6ffa0dd24b61127b78ded16cae7b056375cb Mon Sep 17 00:00:00 2001 From: Patrick 'Quezler' Mounier Date: Tue, 5 Jan 2021 16:37:37 +0100 Subject: [PATCH 1/5] Add core incineration to custom rules dialog (#4264) * Update CustomRulesDialog.java * Update bundle.properties * Update core/assets/bundles/bundle.properties Co-authored-by: YellOw139 <70975516+YellOw139@users.noreply.github.com> Co-authored-by: YellOw139 <70975516+YellOw139@users.noreply.github.com> --- core/assets/bundles/bundle.properties | 1 + core/src/mindustry/ui/dialogs/CustomRulesDialog.java | 1 + 2 files changed, 2 insertions(+) diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index ca33ac045b..9834514f8c 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -935,6 +935,7 @@ mode.custom = Custom Rules rules.infiniteresources = Infinite Resources rules.reactorexplosions = Reactor Explosions +rules.coreincinerates = Core Incinerates Overflow rules.schematic = Schematics Allowed rules.wavetimer = Wave Timer rules.waves = Waves diff --git a/core/src/mindustry/ui/dialogs/CustomRulesDialog.java b/core/src/mindustry/ui/dialogs/CustomRulesDialog.java index 6026232f39..2e6d923063 100644 --- a/core/src/mindustry/ui/dialogs/CustomRulesDialog.java +++ b/core/src/mindustry/ui/dialogs/CustomRulesDialog.java @@ -141,6 +141,7 @@ public class CustomRulesDialog extends BaseDialog{ check("@rules.infiniteresources", b -> rules.infiniteResources = b, () -> rules.infiniteResources); check("@rules.reactorexplosions", b -> rules.reactorExplosions = b, () -> rules.reactorExplosions); check("@rules.schematic", b -> rules.schematicsAllowed = b, () -> rules.schematicsAllowed); + check("@rules.coreincinerates", b -> rules.coreIncinerates = b, () -> rules.coreIncinerates); number("@rules.buildcostmultiplier", false, f -> rules.buildCostMultiplier = f, () -> rules.buildCostMultiplier, () -> !rules.infiniteResources); number("@rules.buildspeedmultiplier", f -> rules.buildSpeedMultiplier = f, () -> rules.buildSpeedMultiplier, 0.001f, 50f); number("@rules.deconstructrefundmultiplier", false, f -> rules.deconstructRefundMultiplier = f, () -> rules.deconstructRefundMultiplier, () -> !rules.infiniteResources); From fdf08ed51d9d589a1e939873b37671d4f5ea30a1 Mon Sep 17 00:00:00 2001 From: Patrick 'Quezler' Mounier Date: Tue, 5 Jan 2021 16:43:36 +0100 Subject: [PATCH 2/5] Highlight all linked inventories on core selection (#4256) * Highlight all linked inventories on core selection * Loop cores instead of storage blocks --- .../mindustry/world/blocks/storage/CoreBlock.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/src/mindustry/world/blocks/storage/CoreBlock.java b/core/src/mindustry/world/blocks/storage/CoreBlock.java index 677c3a83b6..13e84e1dd8 100644 --- a/core/src/mindustry/world/blocks/storage/CoreBlock.java +++ b/core/src/mindustry/world/blocks/storage/CoreBlock.java @@ -296,17 +296,17 @@ public class CoreBlock extends StorageBlock{ @Override public void drawSelect(){ Lines.stroke(1f, Pal.accent); - Cons outline = t -> { + Cons outline = b -> { for(int i = 0; i < 4; i++){ Point2 p = Geometry.d8edge[i]; - float offset = -Math.max(t.block.size - 1, 0) / 2f * tilesize; - Draw.rect("block-select", t.x + offset * p.x, t.y + offset * p.y, i * 90); + float offset = -Math.max(b.block.size - 1, 0) / 2f * tilesize; + Draw.rect("block-select", b.x + offset * p.x, b.y + offset * p.y, i * 90); } }; - if(proximity.contains(e -> owns(e) && e.items == items)){ - outline.get(this); - } - proximity.each(e -> owns(e) && e.items == items, outline); + team.cores().each(core -> { + outline.get(core); + core.proximity.each(storage -> storage.items == items, outline); + }); Draw.reset(); } From 5c24254d8485c8668b10c24a5bffe7c53e3126c4 Mon Sep 17 00:00:00 2001 From: PAP6 <68839421+PAP6@users.noreply.github.com> Date: Wed, 6 Jan 2021 01:52:21 +1000 Subject: [PATCH 3/5] Update servers_v6.json (#4263) Reason: This server is currently running version 104.10, so it shouldn't be here. --- servers_v6.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/servers_v6.json b/servers_v6.json index ff486ea497..115b18db01 100644 --- a/servers_v6.json +++ b/servers_v6.json @@ -35,10 +35,6 @@ "name": "TWS", "address": ["twsmindustry.24x7.hk:6701", "twsmindustry.24x7.hk:6702"] }, - { - "address": "cheginde.ddns.net" - - }, { "name": "mindustry.ddns.net", "address": ["mindustry.ddns.net:1000", "mindustry.ddns.net:2000", "mindustry.ddns.net:3000", "mindustry.ddns.net:4000"] From 5516435619843e0b1781c97a5208f0983bdd1779 Mon Sep 17 00:00:00 2001 From: VozDuh <61590217+Voz-Duh@users.noreply.github.com> Date: Tue, 5 Jan 2021 23:17:18 +0300 Subject: [PATCH 4/5] Custom Launch Pad Pod Textures (#4203) * Custom Launch Pad Pod Textures * Facepalm * Fix * Fix * Fix Co-authored-by: Anuken * Fix Anuke! Co-authored-by: Anuken --- core/src/mindustry/world/blocks/campaign/LaunchPad.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/world/blocks/campaign/LaunchPad.java b/core/src/mindustry/world/blocks/campaign/LaunchPad.java index d0804bd4cf..838efde720 100644 --- a/core/src/mindustry/world/blocks/campaign/LaunchPad.java +++ b/core/src/mindustry/world/blocks/campaign/LaunchPad.java @@ -32,7 +32,7 @@ public class LaunchPad extends Block{ public Sound launchSound = Sounds.none; public @Load("@-light") TextureRegion lightRegion; - public @Load("launchpod") TextureRegion podRegion; + public @Load(value = "@-pod", fallback = "launchpod") TextureRegion podRegion; public Color lightColor = Color.valueOf("eab678"); public LaunchPad(String name){ @@ -200,7 +200,7 @@ public class LaunchPad extends Block{ Draw.z(Layer.weather - 1); - TextureRegion region = Core.atlas.find("launchpod"); + TextureRegion region = blockOn() instanceof mindustry.world.blocks.campaign.LaunchPad p ? p.podRegion : Core.atlas.find("launchpod"); float rw = region.width * Draw.scl * scale, rh = region.height * Draw.scl * scale; Draw.alpha(alpha); From f4bf8fd998087d6620b953dcb35b48a7483e1e09 Mon Sep 17 00:00:00 2001 From: Patrick 'Quezler' Mounier Date: Tue, 5 Jan 2021 21:32:43 +0100 Subject: [PATCH 5/5] Add boost bars to overdrive projectors (#4255) * Add boost bars to overdrive projectors * Add bar.boost to bundle * Intelij lied to me --- core/assets/bundles/bundle.properties | 1 + .../blocks/defense/OverdriveProjector.java | 25 +++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 9834514f8c..2bd0b64eaf 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -720,6 +720,7 @@ bar.corereq = Core Base Required bar.drillspeed = Drill Speed: {0}/s bar.pumpspeed = Pump Speed: {0}/s bar.efficiency = Efficiency: {0}% +bar.boost = Boost: {0}% bar.powerbalance = Power: {0}/s bar.powerstored = Stored: {0}/{1} bar.poweramount = Power: {0} diff --git a/core/src/mindustry/world/blocks/defense/OverdriveProjector.java b/core/src/mindustry/world/blocks/defense/OverdriveProjector.java index ad845991c7..5066186e71 100644 --- a/core/src/mindustry/world/blocks/defense/OverdriveProjector.java +++ b/core/src/mindustry/world/blocks/defense/OverdriveProjector.java @@ -1,5 +1,6 @@ package mindustry.world.blocks.defense; +import arc.*; import arc.graphics.*; import arc.graphics.g2d.*; import arc.math.*; @@ -9,6 +10,7 @@ import mindustry.annotations.Annotations.*; import mindustry.gen.*; import mindustry.graphics.*; import mindustry.logic.*; +import mindustry.ui.*; import mindustry.world.*; import mindustry.world.meta.*; @@ -62,6 +64,12 @@ public class OverdriveProjector extends Block{ } } + @Override + public void setBars(){ + super.setBars(); + bars.add("boost", (OverdriveBuild entity) -> new Bar(() -> Core.bundle.format("bar.boost", (int)(entity.realBoost() * 100)), () -> Pal.accent, () -> entity.realBoost() / (hasBoost ? speedBoost + speedBoostPhase : speedBoost))); + } + public class OverdriveBuild extends Building implements Ranged{ float heat; float charge = Mathf.random(reload); @@ -88,17 +96,20 @@ public class OverdriveProjector extends Block{ phaseHeat = Mathf.lerpDelta(phaseHeat, Mathf.num(cons.optionalValid()), 0.1f); } + if(charge >= reload){ + float realRange = range + phaseHeat * phaseRangeBoost; + + charge = 0f; + indexer.eachBlock(this, realRange, other -> true, other -> other.applyBoost(realBoost(), reload + 1f)); + } + if(timer(timerUse, useTime) && efficiency() > 0 && consValid()){ consume(); } + } - if(charge >= reload){ - float realRange = range + phaseHeat * phaseRangeBoost; - float realBoost = (speedBoost + phaseHeat * speedBoostPhase) * efficiency(); - - charge = 0f; - indexer.eachBlock(this, realRange, other -> true, other -> other.applyBoost(realBoost, reload + 1f)); - } + public float realBoost(){ + return consValid() ? (speedBoost + phaseHeat * speedBoostPhase) * efficiency() : 0f; } @Override