From 560914bebe945e297408579a77de72976e52f084 Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 8 Feb 2021 09:42:49 -0500 Subject: [PATCH] Added more unit stats to database --- core/assets/bundles/bundle.properties | 1 + core/src/mindustry/type/UnitType.java | 1 + core/src/mindustry/world/blocks/units/UnitFactory.java | 1 + core/src/mindustry/world/meta/Stat.java | 1 + 4 files changed, 4 insertions(+) diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 9150b552c5..8ba5a6a27c 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -683,6 +683,7 @@ stat.drillspeed = Base Drill Speed stat.boosteffect = Boost Effect stat.maxunits = Max Active Units stat.health = Health +stat.armor = Armor stat.buildtime = Build Time stat.maxconsecutive = Max Consecutive stat.buildcost = Build Cost diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index 9520c43669..30d4e5155b 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -225,6 +225,7 @@ public class UnitType extends UnlockableContent{ Unit inst = constructor.get(); stats.add(Stat.health, health); + stats.add(Stat.armor, armor); stats.add(Stat.speed, speed); stats.add(Stat.itemCapacity, itemCapacity); stats.add(Stat.range, (int)(maxRange / tilesize), StatUnit.blocks); diff --git a/core/src/mindustry/world/blocks/units/UnitFactory.java b/core/src/mindustry/world/blocks/units/UnitFactory.java index 9f62c198e6..798c6fe26e 100644 --- a/core/src/mindustry/world/blocks/units/UnitFactory.java +++ b/core/src/mindustry/world/blocks/units/UnitFactory.java @@ -100,6 +100,7 @@ public class UnitFactory extends UnitBlock{ if(plan.unit.unlockedNow()){ table.image(plan.unit.icon(Cicon.small)).size(8 * 3).padRight(2).right(); table.add(plan.unit.localizedName).left(); + table.add(Strings.autoFixed(plan.time / 60f, 1) + " " + Core.bundle.get("unit.seconds")).color(Color.lightGray).padLeft(12).left(); table.row(); } } diff --git a/core/src/mindustry/world/meta/Stat.java b/core/src/mindustry/world/meta/Stat.java index 2a1b864c7c..24e96fcaf8 100644 --- a/core/src/mindustry/world/meta/Stat.java +++ b/core/src/mindustry/world/meta/Stat.java @@ -7,6 +7,7 @@ import java.util.*; /** Describes one type of stat for content. */ public enum Stat{ health, + armor, size, displaySize, buildTime,