diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 1d4331be15..5e179bfba2 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -900,6 +900,7 @@ stat.repairspeed = Repair Speed stat.weapons = Weapons stat.bullet = Bullet stat.moduletier = Module Tier +stat.unittype = Unit Type stat.speedincrease = Speed Increase stat.range = Range stat.drilltier = Drillables @@ -1796,54 +1797,54 @@ hint.payloadDrop.mobile = [accent]Tap and hold[] an empty location to drop a pay hint.waveFire = [accent]Wave[] turrets with water as ammunition will automatically put out nearby fires. hint.generator = \uF879 [accent]Combustion Generators[] burn coal and transmit power to adjacent blocks.\n\nPower transmission range can be extended with \uF87F [accent]Power Nodes[]. hint.guardian = [accent]Guardian[] units are armored. Weak ammo such as [accent]Copper[] and [accent]Lead[] is [scarlet]not effective[].\n\nUse higher tier turrets or \uF835 [accent]Graphite[] \uF861Duo/\uF859Salvo ammunition to take Guardians down. -hint.coreUpgrade = Cores can be upgraded by [accent]placing higher-tier cores over them[].\n\nPlace a \uf868 [accent]Foundation[] core over the \uf869 [accent]Shard[] core. Make sure it is free from nearby obstructions. +hint.coreUpgrade = Cores can be upgraded by [accent]placing higher-tier cores over them[].\n\nPlace a \uF868 [accent]Foundation[] core over the \uF869 [accent]Shard[] core. Make sure it is free from nearby obstructions. hint.presetLaunch = Gray [accent]landing zone sectors[], such as [accent]Frozen Forest[], can be launched to from anywhere. They do not require capture of nearby territory.\n\n[accent]Numbered sectors[], such as this one, are [accent]optional[]. hint.presetDifficulty = This sector has a [scarlet]high enemy threat level[].\nLaunching to such sectors is [accent]not recommended[] without proper technology and preparation. hint.coreIncinerate = After the core is filled to capacity with an item, any extra items of that type it receives will be [accent]incinerated[]. hint.factoryControl = To set a unit factory's [accent]output destination[], click a factory block while in command mode, then right-click a location.\nUnits produced by it will automatically move there. hint.factoryControl.mobile = To set a unit factory's [accent]output destination[], tap a factory block while in command mode, then tap a location.\nUnits produced by it will automatically move there. -gz.mine = Move near the \uf8c4 [accent]copper ore[] on the ground and click to begin mining. -gz.mine.mobile = Move near the \uf8c4 [accent]copper ore[] on the ground and tap it to begin mining. -gz.research = Open the \ue875 tech tree.\nResearch the \uf870 [accent]Mechanical Drill[], then select it from the menu in the bottom right.\nClick on a copper patch to place it. -gz.research.mobile = Open the \ue875 tech tree.\nResearch the \uf870 [accent]Mechanical Drill[], then select it from the menu in the bottom right.\nTap on a copper patch to place it.\n\nPress the \uE800 [accent]checkmark[] at the bottom right to confirm. -gz.conveyors = Research and place \uf896 [accent]conveyors[] to move the mined resources\nfrom drills to the core.\n\nClick and drag to place multiple conveyors.\n[accent]Scroll[] to rotate. -gz.conveyors.mobile = Research and place \uf896 [accent]conveyors[] to move the mined resources\nfrom drills to the core.\n\nHold down your finger for a second and drag to place multiple conveyors. +gz.mine = Move near the \uF8C4 [accent]copper ore[] on the ground and click to begin mining. +gz.mine.mobile = Move near the \uF8C4 [accent]copper ore[] on the ground and tap it to begin mining. +gz.research = Open the \uE875 tech tree.\nResearch the \uF870 [accent]Mechanical Drill[], then select it from the menu in the bottom right.\nClick on a copper patch to place it. +gz.research.mobile = Open the \uE875 tech tree.\nResearch the \uF870 [accent]Mechanical Drill[], then select it from the menu in the bottom right.\nTap on a copper patch to place it.\n\nPress the \uE800 [accent]checkmark[] at the bottom right to confirm. +gz.conveyors = Research and place \uF896 [accent]conveyors[] to move the mined resources\nfrom drills to the core.\n\nClick and drag to place multiple conveyors.\n[accent]Scroll[] to rotate. +gz.conveyors.mobile = Research and place \uF896 [accent]conveyors[] to move the mined resources\nfrom drills to the core.\n\nHold down your finger for a second and drag to place multiple conveyors. gz.drills = Expand the mining operation.\nPlace more Mechanical Drills.\nMine 100 copper. -gz.lead = \uf837 [accent]Lead[] is another commonly used resource.\nSet up drills to mine lead. -gz.moveup = \ue804 Move up for further objectives. -gz.turrets = Research and place 2 \uf861 [accent]Duo[] turrets to defend the core.\nDuo turrets require \uf838 [accent]ammo[] from conveyors. +gz.lead = \uF837 [accent]Lead[] is another commonly used resource.\nSet up drills to mine lead. +gz.moveup = \uE804 Move up for further objectives. +gz.turrets = Research and place 2 \uF861 [accent]Duo[] turrets to defend the core.\nDuo turrets require \uF838 [accent]ammo[] from conveyors. gz.duoammo = Supply the Duo turrets with [accent]copper[], using conveyors. -gz.walls = [accent]Walls[] can prevent oncoming damage from reaching buildings.\nPlace \uf8ae [accent]copper walls[] around the turrets. +gz.walls = [accent]Walls[] can prevent oncoming damage from reaching buildings.\nPlace \uF8AE [accent]copper walls[] around the turrets. gz.defend = Enemy incoming, prepare to defend. -gz.aa = Flying units cannot easily be dispatched with standard turrets.\n\uf860 [accent]Scatter[] turrets provide excellent anti-air, but require \uf837 [accent]lead[] as ammo. -gz.scatterammo = Supply the Scatter turret with \uf837 [accent]lead[], using conveyors. +gz.aa = Flying units cannot easily be dispatched with standard turrets.\n\uF860 [accent]Scatter[] turrets provide excellent anti-air, but require \uF837 [accent]lead[] as ammo. +gz.scatterammo = Supply the Scatter turret with \uF837 [accent]lead[], using conveyors. gz.supplyturret = [accent]Supply Turret gz.zone1 = This is the enemy drop zone. gz.zone2 = Anything built in the radius is destroyed when a wave starts. gz.zone3 = A wave will begin now.\nGet ready. gz.finish = Build more turrets, mine more resources,\nand defend against all the waves to [accent]capture the sector[]. -onset.mine = Click to mine \uf748 [accent]beryllium[] from walls.\n\nUse [accent][[WASD] to move. -onset.mine.mobile = Tap to mine \uf748 [accent]beryllium[] from walls. -onset.research = Open the \ue875 tech tree.\nResearch, then place a \uf73e [accent]turbine condenser[] on the vent.\nThis will generate [accent]power[]. -onset.bore = Research and place a \uf741 [accent]plasma bore[].\nThis automatically mines resources from walls. -onset.power = To [accent]power[] the plasma bore, research and place a \uf73d [accent]beam node[].\nConnect the turbine condenser to the plasma bore. -onset.ducts = Research and place \uf799 [accent]ducts[] to move the mined resources from the plasma bore to the core.\nClick and drag to place multiple ducts.\n[accent]Scroll[] to rotate. -onset.ducts.mobile = Research and place \uf799 [accent]ducts[] to move the mined resources from the plasma bore to the core.\n\nHold down your finger for a second and drag to place multiple ducts. +onset.mine = Click to mine \uF748 [accent]beryllium[] from walls.\n\nUse [accent][[WASD] to move. +onset.mine.mobile = Tap to mine \uF748 [accent]beryllium[] from walls. +onset.research = Open the \uE875 tech tree.\nResearch, then place a \uF73E [accent]turbine condenser[] on the vent.\nThis will generate [accent]power[]. +onset.bore = Research and place a \uF741 [accent]plasma bore[].\nThis automatically mines resources from walls. +onset.power = To [accent]power[] the plasma bore, research and place a \uF73D [accent]beam node[].\nConnect the turbine condenser to the plasma bore. +onset.ducts = Research and place \uF799 [accent]ducts[] to move the mined resources from the plasma bore to the core.\nClick and drag to place multiple ducts.\n[accent]Scroll[] to rotate. +onset.ducts.mobile = Research and place \uF799 [accent]ducts[] to move the mined resources from the plasma bore to the core.\n\nHold down your finger for a second and drag to place multiple ducts. onset.moremine = Expand the mining operation.\nPlace more Plasma Bores and use beam nodes and ducts to support them.\nMine 200 beryllium. -onset.graphite = More complex blocks require \uf835 [accent]graphite[].\nSet up plasma bores to mine graphite. -onset.research2 = Begin researching [accent]factories[].\nResearch the \uf74d [accent]cliff crusher[] and \uf779 [accent]silicon arc furnace[]. -onset.arcfurnace = The arc furnace needs \uf834 [accent]sand[] and \uf835 [accent]graphite[] to create \uf82f [accent]silicon[].\n[accent]Power[] is also required. -onset.crusher = Use \uf74d [accent]cliff crushers[] to mine sand. -onset.fabricator = Use [accent]units[] to explore the map, defend buildings, and attack the enemy. Research and place a \uf6a2 [accent]tank fabricator[]. +onset.graphite = More complex blocks require \uF835 [accent]graphite[].\nSet up plasma bores to mine graphite. +onset.research2 = Begin researching [accent]factories[].\nResearch the \uF74D [accent]cliff crusher[] and \uF779 [accent]silicon arc furnace[]. +onset.arcfurnace = The arc furnace needs \uF834 [accent]sand[] and \uF835 [accent]graphite[] to create \uF82F [accent]silicon[].\n[accent]Power[] is also required. +onset.crusher = Use \uF74D [accent]cliff crushers[] to mine sand. +onset.fabricator = Use [accent]units[] to explore the map, defend buildings, and attack the enemy. Research and place a \uF6A2 [accent]tank fabricator[]. onset.makeunit = Produce a unit.\nUse the "?" button to see selected factory requirements. -onset.turrets = Units are effective, but [accent]turrets[] provide better defensive capabilities if used effectively.\nPlace a \uf6eb [accent]Breach[] turret.\nTurrets require \uf748 [accent]ammo[]. +onset.turrets = Units are effective, but [accent]turrets[] provide better defensive capabilities if used effectively.\nPlace a \uF6EB [accent]Breach[] turret.\nTurrets require \uF748 [accent]ammo[]. onset.turretammo = Supply the turret with [accent]beryllium ammo.[] -onset.walls = [accent]Walls[] can prevent oncoming damage from reaching buildings.\nPlace some \uf6ee [accent]beryllium walls[] around the turret. +onset.walls = [accent]Walls[] can prevent oncoming damage from reaching buildings.\nPlace some \uF6EE [accent]beryllium walls[] around the turret. onset.enemies = Enemy incoming, prepare to defend. onset.attack = The enemy is vulnerable. Counter-attack. -onset.cores = New cores can be placed on [accent]core tiles[].\nNew cores function as forward bases and share a resource inventory with other cores.\nPlace a \uf725 core. +onset.cores = New cores can be placed on [accent]core tiles[].\nNew cores function as forward bases and share a resource inventory with other cores.\nPlace a \uF725 core. onset.detect = The enemy will be able to detect you in 2 minutes.\nSet up defenses, mining, and production. split.pickup = Some blocks can be picked up by the core unit.\nPick up this [accent]container[] and place it onto the [accent]payload loader[].\n(Default keys are [[ and ] to pick up and drop) diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index fd20b9c792..df14a6ff7f 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -619,7 +619,7 @@ public class UnitType extends UnlockableContent{ if(mineTier >= 1){ stats.addPercent(Stat.mineSpeed, mineSpeed); - stats.add(Stat.mineTier, StatValues.blocks(b -> + stats.add(Stat.mineTier, StatValues.drillables(mineSpeed, 1f, 1, null, b -> b.itemDrop != null && (b instanceof Floor f && (((f.wallOre && mineWalls) || (!f.wallOre && mineFloor))) || (!(b instanceof Floor) && mineWalls)) && diff --git a/core/src/mindustry/world/blocks/defense/BuildTurret.java b/core/src/mindustry/world/blocks/defense/BuildTurret.java index 63e1535f1b..9dfaca633f 100644 --- a/core/src/mindustry/world/blocks/defense/BuildTurret.java +++ b/core/src/mindustry/world/blocks/defense/BuildTurret.java @@ -65,6 +65,13 @@ public class BuildTurret extends BaseTurret{ }}; } + @Override + public void setStats(){ + super.setStats(); + + stats.addPercent(Stat.buildSpeed, buildSpeed); + } + @Override public TextureRegion[] icons(){ return new TextureRegion[]{baseRegion, region}; diff --git a/core/src/mindustry/world/blocks/defense/ForceProjector.java b/core/src/mindustry/world/blocks/defense/ForceProjector.java index 82ad1aed5a..2dc036d97b 100644 --- a/core/src/mindustry/world/blocks/defense/ForceProjector.java +++ b/core/src/mindustry/world/blocks/defense/ForceProjector.java @@ -100,8 +100,9 @@ public class ForceProjector extends Block{ stats.add(Stat.cooldownTime, (int) (shieldHealth / cooldownBrokenBase / 60f), StatUnit.seconds); if(consItems){ - stats.add(Stat.boostEffect, phaseRadiusBoost / tilesize, StatUnit.blocks); - stats.add(Stat.boostEffect, phaseShieldBoost, StatUnit.shieldHealth); + stats.remove(Stat.booster); + stats.add(Stat.booster, StatValues.itemBoosters("+{0} " + StatUnit.shieldHealth.localized(), stats.timePeriod, phaseShieldBoost, phaseRadiusBoost, ((ConsumeItems)findConsumer(f -> f instanceof ConsumeItems)).items, this::consumesItem)); + stats.add(Stat.booster, StatValues.speedBoosters("", coolantConsumption, Float.MAX_VALUE, true, this::consumesLiquid)); } } diff --git a/core/src/mindustry/world/blocks/defense/MendProjector.java b/core/src/mindustry/world/blocks/defense/MendProjector.java index 751873d70a..873849bd6a 100644 --- a/core/src/mindustry/world/blocks/defense/MendProjector.java +++ b/core/src/mindustry/world/blocks/defense/MendProjector.java @@ -11,6 +11,7 @@ import mindustry.gen.*; import mindustry.graphics.*; import mindustry.logic.*; import mindustry.world.*; +import mindustry.world.consumers.*; import mindustry.world.meta.*; import static mindustry.Vars.*; @@ -53,8 +54,8 @@ public class MendProjector extends Block{ stats.add(Stat.repairTime, (int)(100f / healPercent * reload / 60f), StatUnit.seconds); stats.add(Stat.range, range / tilesize, StatUnit.blocks); - stats.add(Stat.boostEffect, phaseRangeBoost / tilesize, StatUnit.blocks); - stats.add(Stat.boostEffect, (phaseBoost + healPercent) / healPercent, StatUnit.timesSpeed); + stats.remove(Stat.booster); + stats.add(Stat.booster, StatValues.itemBoosters("{0}" + StatUnit.timesSpeed.localized(), stats.timePeriod, (phaseBoost + healPercent) / healPercent, phaseRangeBoost, ((ConsumeItems)findConsumer(f -> f instanceof ConsumeItems)).items, this::consumesItem)); } @Override diff --git a/core/src/mindustry/world/blocks/defense/OverdriveProjector.java b/core/src/mindustry/world/blocks/defense/OverdriveProjector.java index ed83edcee4..b0aa7801c6 100644 --- a/core/src/mindustry/world/blocks/defense/OverdriveProjector.java +++ b/core/src/mindustry/world/blocks/defense/OverdriveProjector.java @@ -13,6 +13,7 @@ import mindustry.graphics.*; import mindustry.logic.*; import mindustry.ui.*; import mindustry.world.*; +import mindustry.world.consumers.*; import mindustry.world.meta.*; import static mindustry.Vars.*; @@ -68,8 +69,8 @@ public class OverdriveProjector extends Block{ stats.add(Stat.productionTime, useTime / 60f, StatUnit.seconds); if(hasBoost){ - stats.add(Stat.boostEffect, (range + phaseRangeBoost) / tilesize, StatUnit.blocks); - stats.add(Stat.boostEffect, "+" + (int)((speedBoost + speedBoostPhase) * 100f - 100) + "%"); + stats.remove(Stat.booster); + stats.add(Stat.booster, StatValues.itemBoosters("+{0}%", stats.timePeriod, speedBoostPhase * 100f, phaseRangeBoost, ((ConsumeItems)findConsumer(f -> f instanceof ConsumeItems)).items, this::consumesItem)); } } diff --git a/core/src/mindustry/world/blocks/defense/turrets/ReloadTurret.java b/core/src/mindustry/world/blocks/defense/turrets/ReloadTurret.java index f406f84678..5bf13c7c91 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/ReloadTurret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/ReloadTurret.java @@ -18,6 +18,7 @@ public class ReloadTurret extends BaseTurret{ super.setStats(); if(coolant != null){ + stats.remove(Stat.booster); stats.add(Stat.booster, StatValues.boosters(reload, coolant.amount, coolantMultiplier, true, l -> l.coolant && consumesLiquid(l))); } } diff --git a/core/src/mindustry/world/blocks/production/BeamDrill.java b/core/src/mindustry/world/blocks/production/BeamDrill.java index fd29072102..f5473c36f2 100644 --- a/core/src/mindustry/world/blocks/production/BeamDrill.java +++ b/core/src/mindustry/world/blocks/production/BeamDrill.java @@ -17,6 +17,7 @@ import mindustry.type.*; import mindustry.ui.*; import mindustry.world.*; import mindustry.world.blocks.environment.*; +import mindustry.world.consumers.*; import mindustry.world.meta.*; import static mindustry.Vars.*; @@ -110,11 +111,12 @@ public class BeamDrill extends Block{ public void setStats(){ super.setStats(); - stats.add(Stat.drillTier, StatValues.blocks(b -> (b instanceof Floor f && f.wallOre && f.itemDrop != null && f.itemDrop.hardness <= tier) || (b instanceof StaticWall w && w.itemDrop != null && w.itemDrop.hardness <= tier))); + stats.add(Stat.drillTier, StatValues.drillables(drillTime, 0f, size, drillMultipliers, b -> (b instanceof Floor f && f.wallOre && f.itemDrop != null && f.itemDrop.hardness <= tier) || (b instanceof StaticWall w && w.itemDrop != null && w.itemDrop.hardness <= tier))); stats.add(Stat.drillSpeed, 60f / drillTime * size, StatUnit.itemsSecond); if(optionalBoostIntensity != 1){ - stats.add(Stat.boostEffect, optionalBoostIntensity, StatUnit.timesSpeed); + stats.remove(Stat.booster); + stats.add(Stat.booster, StatValues.speedBoosters("{0}" + StatUnit.timesSpeed.localized(), ((ConsumeLiquidBase)findConsumer(f -> f instanceof ConsumeLiquidBase)).amount, optionalBoostIntensity, false, l -> (consumesLiquid(l) && (findConsumer(f -> f instanceof ConsumeLiquid).booster || ((ConsumeLiquid)findConsumer(f -> f instanceof ConsumeLiquid)).liquid != l)))); } } diff --git a/core/src/mindustry/world/blocks/production/Drill.java b/core/src/mindustry/world/blocks/production/Drill.java index e92d7c0971..af677767f9 100644 --- a/core/src/mindustry/world/blocks/production/Drill.java +++ b/core/src/mindustry/world/blocks/production/Drill.java @@ -19,6 +19,7 @@ import mindustry.type.*; import mindustry.ui.*; import mindustry.world.*; import mindustry.world.blocks.environment.*; +import mindustry.world.consumers.*; import mindustry.world.meta.*; import static mindustry.Vars.*; @@ -170,12 +171,13 @@ public class Drill extends Block{ public void setStats(){ super.setStats(); - stats.add(Stat.drillTier, StatValues.blocks(b -> b instanceof Floor f && !f.wallOre && f.itemDrop != null && + stats.add(Stat.drillTier, StatValues.drillables(drillTime, hardnessDrillMultiplier, size * size, drillMultipliers, b -> b instanceof Floor f && !f.wallOre && f.itemDrop != null && f.itemDrop.hardness <= tier && f.itemDrop != blockedItem && (indexer.isBlockPresent(f) || state.isMenu()))); stats.add(Stat.drillSpeed, 60f / drillTime * size * size, StatUnit.itemsSecond); if(liquidBoostIntensity != 1){ - stats.add(Stat.boostEffect, liquidBoostIntensity * liquidBoostIntensity, StatUnit.timesSpeed); + stats.remove(Stat.booster); + stats.add(Stat.booster, StatValues.speedBoosters("{0}" + StatUnit.timesSpeed.localized(), ((ConsumeLiquidBase)findConsumer(f -> f instanceof ConsumeLiquidBase)).amount, liquidBoostIntensity * liquidBoostIntensity, false, this::consumesLiquid)); } } diff --git a/core/src/mindustry/world/blocks/storage/CoreBlock.java b/core/src/mindustry/world/blocks/storage/CoreBlock.java index 203e9daea8..aa0ed7ba29 100644 --- a/core/src/mindustry/world/blocks/storage/CoreBlock.java +++ b/core/src/mindustry/world/blocks/storage/CoreBlock.java @@ -95,6 +95,20 @@ public class CoreBlock extends StorageBlock{ super.setStats(); stats.remove(Stat.buildTime); + stats.add(Stat.unitType, table -> { + table.row(); + table.table(Styles.grayPanel, b -> { + b.image(unitType.uiIcon).size(40).pad(10f).left().scaling(Scaling.fit); + b.table(info -> { + info.add(unitType.localizedName).left(); + if(Core.settings.getBool("console")){ + info.row(); + info.add(unitType.name).left().color(Color.lightGray); + } + }); + b.button("?", Styles.flatBordert, () -> ui.content.show(unitType)).size(40f).pad(10).right().grow().visible(() -> unitType.unlockedNow()); + }).growX().pad(5).row(); + }); } @Override diff --git a/core/src/mindustry/world/blocks/units/RepairTurret.java b/core/src/mindustry/world/blocks/units/RepairTurret.java index ffc106c267..87624efb84 100644 --- a/core/src/mindustry/world/blocks/units/RepairTurret.java +++ b/core/src/mindustry/world/blocks/units/RepairTurret.java @@ -1,5 +1,6 @@ package mindustry.world.blocks.units; +import arc.*; import arc.graphics.*; import arc.graphics.g2d.*; import arc.math.*; @@ -70,7 +71,8 @@ public class RepairTurret extends Block{ stats.add(Stat.repairSpeed, repairSpeed * 60f, StatUnit.perSecond); if(acceptCoolant){ - stats.add(Stat.booster, StatValues.strengthBoosters(coolantMultiplier, this::consumesLiquid)); + stats.remove(Stat.booster); + stats.add(Stat.booster, StatValues.speedBoosters(Core.bundle.get("bar.strength"), coolantUse, coolantMultiplier, true, this::consumesLiquid)); } } diff --git a/core/src/mindustry/world/meta/Stat.java b/core/src/mindustry/world/meta/Stat.java index 44f64c50cd..c63db17653 100644 --- a/core/src/mindustry/world/meta/Stat.java +++ b/core/src/mindustry/world/meta/Stat.java @@ -90,6 +90,7 @@ public class Stat implements Comparable{ shieldHealth = new Stat("shieldHealth", StatCat.function), cooldownTime = new Stat("cooldownTime", StatCat.function), moduleTier = new Stat("moduletier", StatCat.function), + unitType = new Stat("unittype", StatCat.function), booster = new Stat("booster", StatCat.optional), boostEffect = new Stat("boostEffect", StatCat.optional), diff --git a/core/src/mindustry/world/meta/StatUnit.java b/core/src/mindustry/world/meta/StatUnit.java index 3d986f0e9b..1c2408ad74 100644 --- a/core/src/mindustry/world/meta/StatUnit.java +++ b/core/src/mindustry/world/meta/StatUnit.java @@ -16,9 +16,9 @@ public class StatUnit{ blocksSquared = new StatUnit("blocksSquared"), tilesSecond = new StatUnit("tilesSecond"), powerSecond = new StatUnit("powerSecond", "[accent]" + Iconc.power + "[]"), - liquidSecond = new StatUnit("liquidSecond"), + liquidSecond = new StatUnit("liquidSecond", "[sky]" + Iconc.liquid + "[]"), itemsSecond = new StatUnit("itemsSecond"), - liquidUnits = new StatUnit("liquidUnits"), + liquidUnits = new StatUnit("liquidUnits", "[sky]" + Iconc.liquid + "[]"), powerUnits = new StatUnit("powerUnits", "[accent]" + Iconc.power + "[]"), heatUnits = new StatUnit("heatUnits", "[red]" + Iconc.waves + "[]"), degrees = new StatUnit("degrees"), diff --git a/core/src/mindustry/world/meta/StatValues.java b/core/src/mindustry/world/meta/StatValues.java index 02697f4b9b..bf6fd1490f 100644 --- a/core/src/mindustry/world/meta/StatValues.java +++ b/core/src/mindustry/world/meta/StatValues.java @@ -2,6 +2,7 @@ package mindustry.world.meta; import arc.*; import arc.func.*; +import arc.graphics.*; import arc.graphics.g2d.*; import arc.math.*; import arc.scene.ui.*; @@ -235,6 +236,32 @@ public class StatValues{ return content(list.as()); } + public static StatValue drillables(float drillTime, float drillMultiplier, float size, ObjectFloatMap multipliers, Boolf filter){ + return table -> { + table.row(); + table.table(c -> { + int i = 0; + for(Block block : content.blocks()){ + if(!filter.get(block)) continue; + + c.table(Styles.grayPanel, b -> { + b.image(block.uiIcon).size(40).pad(10f).left().scaling(Scaling.fit); + b.table(info -> { + info.left(); + info.add(block.localizedName).left().row(); + info.add(block.itemDrop.emoji()).left(); + }).grow(); + if(multipliers != null){ + b.add(Strings.autoFixed(60f / (Math.max(drillTime + drillMultiplier * block.itemDrop.hardness, drillTime) / multipliers.get(block.itemDrop, 1f)) * size, 2) + StatUnit.perSecond.localized()) + .right().pad(10f).padRight(15f).color(Color.lightGray); + } + }).growX().pad(5); + if(++i % 2 == 0) c.row(); + } + }).growX().colspan(table.getColumns()); + }; + } + public static StatValue boosters(float reload, float maxUsed, float multiplier, boolean baseReload, Boolf filter){ return table -> { table.row(); @@ -242,41 +269,78 @@ public class StatValues{ for(Liquid liquid : content.liquids()){ if(!filter.get(liquid)) continue; - c.image(liquid.uiIcon).size(3 * 8).scaling(Scaling.fit).padRight(4).right().top(); - c.add(liquid.localizedName).padRight(10).left().top(); - c.table(Tex.underline, bt -> { - bt.left().defaults().padRight(3).left(); + c.table(Styles.grayPanel, b -> { + b.image(liquid.uiIcon).size(40).pad(10f).left().scaling(Scaling.fit); + b.table(info -> { + info.add(liquid.localizedName).left().row(); + info.add(Strings.autoFixed(maxUsed * 60f, 1) + StatUnit.perSecond.localized()).left().color(Color.lightGray); + }); - float reloadRate = (baseReload ? 1f : 0f) + maxUsed * multiplier * liquid.heatCapacity; - float standardReload = baseReload ? reload : reload / (maxUsed * multiplier * 0.4f); - float result = standardReload / (reload / reloadRate); - bt.add(Core.bundle.format("bullet.reload", Strings.autoFixed(result * 100, 1))); - }).left().padTop(-9); - c.row(); + b.table(bt -> { + bt.right().defaults().padRight(3).left(); + + float reloadRate = (baseReload ? 1f : 0f) + maxUsed * multiplier * liquid.heatCapacity; + float standardReload = baseReload ? reload : reload / (maxUsed * multiplier * 0.4f); + float result = standardReload / (reload / reloadRate); + bt.add(Core.bundle.format("bullet.reload", Strings.autoFixed(result * 100, 1))).pad(5); + }).right().grow().pad(10f).padRight(15f); + }).growX().pad(5).row(); } - }).colspan(table.getColumns()); + }).growX().colspan(table.getColumns()); table.row(); }; } - public static StatValue strengthBoosters(float multiplier, Boolf filter){ + public static StatValue speedBoosters(String unit, float amount, float speed, boolean strength, Boolf filter){ return table -> { table.row(); table.table(c -> { for(Liquid liquid : content.liquids()){ if(!filter.get(liquid)) continue; - c.image(liquid.uiIcon).size(3 * 8).scaling(Scaling.fit).padRight(4).right().top(); - c.add(liquid.localizedName).padRight(10).left().top(); - c.table(Tex.underline, bt -> { - bt.left().defaults().padRight(3).left(); + c.table(Styles.grayPanel, b -> { + b.image(liquid.uiIcon).size(40).pad(10f).left().scaling(Scaling.fit); + b.table(info -> { + info.add(liquid.localizedName).left().row(); + info.add(Strings.autoFixed(amount * 60f, 1) + StatUnit.perSecond.localized()).left().color(Color.lightGray); + }); - float newRate = (1f + multiplier * liquid.heatCapacity); - bt.add(Core.bundle.format("bar.strength", Strings.autoFixed(newRate, 2))); - }).left().padTop(-9); - c.row(); + b.table(bt -> { + bt.right().defaults().padRight(3).left(); + if(speed != Float.MAX_VALUE) bt.add(unit.replace("{0}", "[stat]" + Strings.autoFixed(speed * (strength ? liquid.heatCapacity : 1f) + (strength ? 1f : 0f), 2) + "[lightgray]")).pad(5); + }).right().grow().pad(10f).padRight(15f); + }).growX().pad(5).row(); } - }).colspan(table.getColumns()); + }).growX().colspan(table.getColumns()); + table.row(); + }; + } + + public static StatValue itemBoosters(String unit, float timePeriod, float speedBoost, float rangeBoost, ItemStack[] items, Boolf filter){ + return table -> { + table.row(); + table.table(c -> { + for(Item item : content.items()){ + if(!filter.get(item)) continue; + + c.table(Styles.grayPanel, b -> { + for(ItemStack stack : items){ + if(timePeriod < 0){ + b.add(new ItemDisplay(stack.item, stack.amount, true)).pad(20f).left(); + }else{ + b.add(new ItemDisplay(stack.item, stack.amount, timePeriod, true)).pad(20f).left(); + } + if(items.length > 1) b.row(); + } + + b.table(bt -> { + bt.right().defaults().padRight(3).left(); + if(rangeBoost != 0) bt.add("[lightgray]+[stat]" + Strings.autoFixed(rangeBoost / tilesize, 2) + "[lightgray] " + StatUnit.blocks.localized()).row(); + if(speedBoost != 0) bt.add("[lightgray]" + unit.replace("{0}", "[stat]" + Strings.autoFixed(speedBoost, 2) + "[lightgray]")); + }).right().grow().pad(10f).padRight(15f); + }).growX().pad(5).padBottom(-5).row(); + } + }).growX().colspan(table.getColumns()); table.row(); }; } @@ -468,4 +532,4 @@ public class StatValues{ private static TextureRegion icon(UnlockableContent t){ return t.uiIcon; } -} +} \ No newline at end of file