From d321ec5ed11104eff1887245765b9e94e9c2c70e Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 14 Apr 2019 10:37:15 -0400 Subject: [PATCH] Fixed impact reactor not requiring blast compound --- .../src/io/anuke/mindustry/content/Blocks.java | 2 +- .../world/blocks/power/ImpactReactor.java | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/core/src/io/anuke/mindustry/content/Blocks.java b/core/src/io/anuke/mindustry/content/Blocks.java index 5483cb67ed..286dc95e9c 100644 --- a/core/src/io/anuke/mindustry/content/Blocks.java +++ b/core/src/io/anuke/mindustry/content/Blocks.java @@ -1112,7 +1112,7 @@ public class Blocks implements ContentList{ powerProduction = 110f; itemDuration = 40f; consumes.power(25f); - consumes.item(Items.blastCompound).optional(true, false); + consumes.item(Items.blastCompound); consumes.liquid(Liquids.cryofluid, 0.3f); }}; diff --git a/core/src/io/anuke/mindustry/world/blocks/power/ImpactReactor.java b/core/src/io/anuke/mindustry/world/blocks/power/ImpactReactor.java index 8f8cfefc4a..6a4823069a 100644 --- a/core/src/io/anuke/mindustry/world/blocks/power/ImpactReactor.java +++ b/core/src/io/anuke/mindustry/world/blocks/power/ImpactReactor.java @@ -32,6 +32,8 @@ public class ImpactReactor extends PowerGenerator{ protected Color plasma1 = Color.valueOf("ffd06b"), plasma2 = Color.valueOf("ff361b"); protected Color ind1 = Color.valueOf("858585"), ind2 = Color.valueOf("fea080"); + protected int bottomRegion, topRegion, lightRegion; + protected int[] plasmaRegions; public ImpactReactor(String name){ super(name); @@ -40,6 +42,14 @@ public class ImpactReactor extends PowerGenerator{ liquidCapacity = 30f; hasItems = true; outputsPower = consumesPower = true; + + bottomRegion = reg("-bottom"); + topRegion = reg("-top"); + lightRegion = reg("-light"); + plasmaRegions = new int[plasmas]; + for(int i = 0; i < plasmas; i++){ + plasmaRegions[i] = reg("-plasma-" + i); + } } @Override @@ -86,7 +96,7 @@ public class ImpactReactor extends PowerGenerator{ public void draw(Tile tile){ FusionReactorEntity entity = tile.entity(); - Draw.rect(name + "-bottom", tile.drawx(), tile.drawy()); + Draw.rect(reg(bottomRegion), tile.drawx(), tile.drawy()); for(int i = 0; i < plasmas; i++){ float r = 29f + Mathf.absin(Time.time(), 2f + i * 1f, 5f - i * 0.5f); @@ -94,7 +104,7 @@ public class ImpactReactor extends PowerGenerator{ Draw.color(plasma1, plasma2, (float)i / plasmas); Draw.alpha((0.3f + Mathf.absin(Time.time(), 2f + i * 2f, 0.3f + i * 0.05f)) * entity.warmup); Draw.blend(Blending.additive); - Draw.rect(name + "-plasma-" + i, tile.drawx(), tile.drawy(), r, r, Time.time() * (12 + i * 6f) * entity.warmup); + Draw.rect(reg(plasmaRegions[i]), tile.drawx(), tile.drawy(), r, r, Time.time() * (12 + i * 6f) * entity.warmup); Draw.blend(); } @@ -102,10 +112,10 @@ public class ImpactReactor extends PowerGenerator{ Draw.rect(region, tile.drawx(), tile.drawy()); - Draw.rect(name + "-top", tile.drawx(), tile.drawy()); + Draw.rect(reg(topRegion), tile.drawx(), tile.drawy()); Draw.color(ind1, ind2, entity.warmup + Mathf.absin(entity.productionEfficiency, 3f, entity.warmup * 0.5f)); - Draw.rect(name + "-light", tile.drawx(), tile.drawy()); + Draw.rect(reg(lightRegion), tile.drawx(), tile.drawy()); Draw.color(); }