diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index 95f062bd91..0a2e09fd21 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -2489,6 +2489,7 @@ public class Blocks{ maxNodes = 10; laserRange = 6; underBullets = true; + crushFragile = true; }}; powerNodeLarge = new PowerNode("power-node-large"){{ @@ -2658,7 +2659,7 @@ public class Blocks{ range = 10; fogRadius = 1; researchCost = with(Items.beryllium, 5); - buildCostMultiplier = 2.5f; + crushFragile = true; consumePowerBuffered(1000f); }}; diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index 10364fe776..f596519b76 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -2723,6 +2723,7 @@ public class UnitTypes{ itemCapacity = 0; floorMultiplier = 0.8f; treadRects = new Rect[]{new Rect(17 - 96f/2f, 10 - 96f/2f, 19, 76)}; + crushFragile = true; researchCostMultiplier = 0f; tankMoveVolume *= 0.55f; @@ -2807,6 +2808,7 @@ public class UnitTypes{ drownTimeMultiplier = 1.2f; immunities.addAll(StatusEffects.burning, StatusEffects.melting); treadRects = new Rect[]{new Rect(16 - 60f, 48 - 70f, 30, 75), new Rect(44 - 60f, 17 - 70f, 17, 60)}; + crushFragile = true; researchCostMultiplier = 0f; weapons.add(new Weapon("precept-weapon"){{ @@ -2879,6 +2881,7 @@ public class UnitTypes{ floorMultiplier = 0.5f; drownTimeMultiplier = 1.25f; immunities.addAll(StatusEffects.burning, StatusEffects.melting); + crushFragile = true; treadRects = new Rect[]{new Rect(22 - 154f/2f, 16 - 154f/2f, 28, 130)}; tankMoveVolume *= 1.25f; @@ -2984,6 +2987,7 @@ public class UnitTypes{ tankMoveVolume *= 1.5f; tankMoveSound = Sounds.tankMoveHeavy; + crushFragile = true; float xo = 231f/2f, yo = 231f/2f; treadRects = new Rect[]{new Rect(27 - xo, 152 - yo, 56, 73), new Rect(24 - xo, 51 - 9 - yo, 29, 17), new Rect(59 - xo, 18 - 9 - yo, 39, 19)}; diff --git a/core/src/mindustry/entities/comp/TankComp.java b/core/src/mindustry/entities/comp/TankComp.java index 4fa36348ba..8c79a3e958 100644 --- a/core/src/mindustry/entities/comp/TankComp.java +++ b/core/src/mindustry/entities/comp/TankComp.java @@ -57,6 +57,16 @@ abstract class TankComp implements Posc, Hitboxc, Unitc, ElevationMovec{ lastDeepFloor = null; boolean anyNonDeep = false; + if(type.crushFragile){ + for(int i = 0; i < 8; i++){ + Point2 offset = Geometry.d8[i]; + var other = Vars.world.buildWorld(x + offset.x * tilesize, y + offset.y * tilesize); + if(other != null && other.team != team && other.block.crushFragile){ + other.damage(team, 999999999f); + } + } + } + //calculate overlapping tiles so it slows down when going "over" walls int r = Math.max((int)(hitSize * 0.75f / tilesize), 0); diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index 2d1c2823d3..e6ebce1042 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -465,6 +465,8 @@ public class UnitType extends UnlockableContent implements Senseable{ public int treadFrames = 18; /** how much of a top part of a tread sprite is "cut off" relative to the pattern; this is corrected for */ public int treadPullOffset = 0; + /** if true, 'fragile' blocks will instantly be crushed in a 1x1 area around the tank */ + public boolean crushFragile = false; //SEGMENTED / CRAWL UNITS (this is WIP content!) diff --git a/core/src/mindustry/world/Block.java b/core/src/mindustry/world/Block.java index 606a1a5351..fea0bfca8e 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -224,6 +224,8 @@ public class Block extends UnlockableContent implements Senseable{ public float placeOverlapRange = 50f; /** Multiplier of damage dealt to this block by tanks. Does not apply to crawlers. */ public float crushDamageMultiplier = 1f; + /** If true, this block is instantly destroyed by tanks with crushFragile set to true. */ + public boolean crushFragile = false; /** Max of timers used. */ public int timers = 0; /** Cache layer. Only used for 'cached' rendering. */