From 52ac26b56c712a1d8c0260ebd2212d940cb790de Mon Sep 17 00:00:00 2001 From: Anuken Date: Thu, 20 Oct 2022 09:33:15 -0400 Subject: [PATCH] Do not display missile units on hover --- core/src/mindustry/content/Blocks.java | 6 ++++-- core/src/mindustry/entities/comp/UnitComp.java | 5 +++++ core/src/mindustry/type/UnitType.java | 2 ++ core/src/mindustry/type/unit/MissileUnitType.java | 1 + 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index 2397bba228..573aa75423 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -2934,7 +2934,7 @@ public class Blocks{ }}; coreCitadel = new CoreBlock("core-citadel"){{ - requirements(Category.effect, with(Items.silicon, 4000, Items.beryllium, 5000, Items.tungsten, 3000, Items.oxide, 2000)); + requirements(Category.effect, with(Items.silicon, 4000, Items.beryllium, 5000, Items.tungsten, 3000, Items.oxide, 1000)); unitType = UnitTypes.incite; health = 16000; @@ -2943,6 +2943,7 @@ public class Blocks{ thrusterLength = 40/4f; armor = 10f; incinerateNonBuildable = true; + buildCostMultiplier = 0.7f; unitCapModifier = 15; researchCostMultipliers.put(Items.silicon, 0.5f); @@ -2950,7 +2951,7 @@ public class Blocks{ }}; coreAcropolis = new CoreBlock("core-acropolis"){{ - requirements(Category.effect, with(Items.beryllium, 8000, Items.silicon, 8000, Items.tungsten, 6000, Items.carbide, 5000, Items.oxide, 5000)); + requirements(Category.effect, with(Items.beryllium, 8000, Items.silicon, 7000, Items.tungsten, 6000, Items.carbide, 5000, Items.oxide, 4000)); unitType = UnitTypes.emanate; health = 30000; @@ -2959,6 +2960,7 @@ public class Blocks{ thrusterLength = 48/4f; armor = 15f; incinerateNonBuildable = true; + buildCostMultiplier = 0.7f; unitCapModifier = 15; researchCostMultipliers.put(Items.silicon, 0.4f); diff --git a/core/src/mindustry/entities/comp/UnitComp.java b/core/src/mindustry/entities/comp/UnitComp.java index 1ce32a6867..85df18105f 100644 --- a/core/src/mindustry/entities/comp/UnitComp.java +++ b/core/src/mindustry/entities/comp/UnitComp.java @@ -141,6 +141,11 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I return rotation; } + @Override + public boolean displayable(){ + return type.hoverable; + } + @Override @Replace public boolean isSyncHidden(Player player){ diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index 0745a68933..417360e0a9 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -215,6 +215,8 @@ public class UnitType extends UnlockableContent{ /** if false, RTS AI controlled units do not automatically attack things while moving. This is automatically assigned. */ autoFindTarget = true, + /** whether this unit has a hover tooltip */ + hoverable = true, /** if true, this modded unit always has a -outline region generated for its base. Normally, outlines are ignored if there are no top = false weapons. */ alwaysCreateOutline = false, /** if true, this unit has a square shadow. */ diff --git a/core/src/mindustry/type/unit/MissileUnitType.java b/core/src/mindustry/type/unit/MissileUnitType.java index 33b06aa6b6..6b0d3174fc 100644 --- a/core/src/mindustry/type/unit/MissileUnitType.java +++ b/core/src/mindustry/type/unit/MissileUnitType.java @@ -28,6 +28,7 @@ public class MissileUnitType extends UnitType{ bounded = false; trailLength = 7; hidden = true; + hoverable = false; speed = 4f; lifetime = 60f * 1.7f; rotateSpeed = 2.5f;