diff --git a/core/assets-raw/sprites/items/item-titanium.png b/core/assets-raw/sprites/items/item-titanium.png index fda457e770..8f9214a89c 100644 Binary files a/core/assets-raw/sprites/items/item-titanium.png and b/core/assets-raw/sprites/items/item-titanium.png differ diff --git a/core/src/mindustry/entities/comp/ShieldComp.java b/core/src/mindustry/entities/comp/ShieldComp.java index 659630ecf0..5739a4f81c 100644 --- a/core/src/mindustry/entities/comp/ShieldComp.java +++ b/core/src/mindustry/entities/comp/ShieldComp.java @@ -6,12 +6,14 @@ import mindustry.content.*; import mindustry.entities.*; import mindustry.game.*; import mindustry.gen.*; +import mindustry.type.*; @Component abstract class ShieldComp implements Healthc, Posc{ @Import float health, hitTime, x, y, healthMultiplier; @Import boolean dead; @Import Team team; + @Import UnitType type; /** Absorbs health damage. */ float shield; @@ -51,7 +53,7 @@ abstract class ShieldComp implements Healthc, Posc{ hitTime = 1f; amount -= shieldDamage; - if(amount > 0){ + if(amount > 0 && type.killable){ health -= amount; if(health <= 0 && !dead){ kill(); diff --git a/core/src/mindustry/entities/comp/UnitComp.java b/core/src/mindustry/entities/comp/UnitComp.java index 2fd333d6e5..edb7e5a001 100644 --- a/core/src/mindustry/entities/comp/UnitComp.java +++ b/core/src/mindustry/entities/comp/UnitComp.java @@ -541,7 +541,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I /** Actually destroys the unit, removing it and creating explosions. **/ public void destroy(){ - if(!isAdded()) return; + if(!isAdded() || !type.killable) return; float explosiveness = 2f + item().explosiveness * stack().amount * 1.53f; float flammability = item().flammability * stack().amount / 1.9f; @@ -645,7 +645,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I @Override @Replace public void kill(){ - if(dead || net.client()) return; + if(dead || net.client() || !type.killable) return; //deaths are synced; this calls killed() Call.unitDeath(id); diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index 712f618ebc..3cb412ca7d 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -68,7 +68,9 @@ public class UnitType extends UnlockableContent{ public boolean logicControllable = true; public boolean playerControllable = true; public boolean allowedInPayloads = true; - /** TODO If true, core units will re-appear on this unit when respawning. */ + /** If false, this unit does not take damage and cannot be kill() / destroy()-ed. */ + public boolean killable = true; + /** If true, this core unit will "dock" to other units, making it re-appear when "undocking". */ public boolean coreUnitDock = false; public boolean createWreck = true; public boolean createScorch = true;