From ff07e99e39fb01e8578085bf19edbde62c68569f Mon Sep 17 00:00:00 2001 From: Anuken Date: Wed, 27 Jun 2018 21:53:52 -0400 Subject: [PATCH] Added more detailed drill tier lists --- core/assets/bundles/bundle.properties | 2 +- .../world/blocks/production/Cultivator.java | 13 +++++++++++- .../world/blocks/production/Drill.java | 21 ++++++++++++++++++- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 5e717c5d82..4f7fa2c655 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -274,7 +274,7 @@ text.blocks.inputliquid=Input Liquid text.blocks.inputitem=Input Item text.blocks.inputitems=Input Items text.blocks.outputitem=Output Item -text.blocks.drilltier=Drill Tier +text.blocks.drilltier=Drillables text.blocks.drillspeed=Base Drill Speed text.blocks.liquidoutput=Liquid Output text.blocks.liquiduse=Liquid Use diff --git a/core/src/io/anuke/mindustry/world/blocks/production/Cultivator.java b/core/src/io/anuke/mindustry/world/blocks/production/Cultivator.java index 248aca5b43..e9d24ad75e 100644 --- a/core/src/io/anuke/mindustry/world/blocks/production/Cultivator.java +++ b/core/src/io/anuke/mindustry/world/blocks/production/Cultivator.java @@ -4,10 +4,11 @@ import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.g2d.TextureRegion; import io.anuke.mindustry.content.Items; import io.anuke.mindustry.content.blocks.Blocks; -import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.content.fx.Fx; +import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.type.Item; import io.anuke.mindustry.world.Tile; +import io.anuke.mindustry.world.meta.BlockStat; import io.anuke.ucore.core.Timers; import io.anuke.ucore.graphics.Draw; import io.anuke.ucore.graphics.Lines; @@ -33,6 +34,16 @@ public class Cultivator extends Drill { drillEffect = Fx.none; } + @Override + public void setStats() { + super.setStats(); + + stats.remove(BlockStat.drillTier); + stats.add(BlockStat.drillTier, table -> { + table.addImage("grass1").size(8*3); + }); + } + @Override public void update(Tile tile) { super.update(tile); diff --git a/core/src/io/anuke/mindustry/world/blocks/production/Drill.java b/core/src/io/anuke/mindustry/world/blocks/production/Drill.java index 4a890d1bd8..5ea1d90a05 100644 --- a/core/src/io/anuke/mindustry/world/blocks/production/Drill.java +++ b/core/src/io/anuke/mindustry/world/blocks/production/Drill.java @@ -120,8 +120,27 @@ public class Drill extends Block{ super.setStats(); //TODO add drill speed stats - stats.add(BlockStat.drillTier, tier, StatUnit.none); + stats.add(BlockStat.drillTier, table -> { + Array list = new Array<>(); + + for(Item item : Item.all()){ + if(tier >= item.hardness && Draw.hasRegion(item.name + "1")){ + list.add(item); + } + } + + for (int i = 0; i < list.size; i++) { + Item item = list.get(i); + table.addImage(item.name + "1").size(8*3).padRight(2).padLeft(2); + if(i != list.size - 1){ + table.add("/"); + } + } + }); stats.add(BlockStat.drillSpeed, 60f/drillTime, StatUnit.itemsSecond); + if(inputLiquid != null){ + stats.add(BlockStat.inputLiquid, inputLiquid); + } } @Override