From b96191f6d6039ceeb02b37f5069d8b547ce79d05 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sat, 8 Feb 2025 19:33:23 -0500 Subject: [PATCH] Closes #8590 --- .../sprites/items/liquid-cryofluid.png | Bin 525 -> 529 bytes core/src/mindustry/content/Blocks.java | 2 +- core/src/mindustry/entities/comp/LegsComp.java | 6 ++++++ core/src/mindustry/entities/comp/TankComp.java | 11 ++++++++--- core/src/mindustry/world/Block.java | 2 ++ .../world/blocks/environment/Prop.java | 1 + 6 files changed, 18 insertions(+), 4 deletions(-) diff --git a/core/assets-raw/sprites/items/liquid-cryofluid.png b/core/assets-raw/sprites/items/liquid-cryofluid.png index a72f3b4d6273bda102e3ab3b8e0f105a1372fab9..760127f3695ff27a18e4dbe65599af0f5678ffb8 100644 GIT binary patch delta 490 zcmeBWnaDE1u>Q2Ci(^Pc>)EOMy`2I@j_=oZy5+RO)rtL}y@EzYUT531Eh`mccxEkf zo!2d3`-go=R18;3Mp4G*&>({qI}f&7OzDo^acA1S&$jn>zMog_`)2pv-;d{<|9P+a z9;=v6vy_OFkKHcTkRI*w1sYxlZD((P=*eTm%fH~0mB^J@3?3ZyM`9Q}1UOwJ4g^Jf zc>c}0@B03yyBY6)e9^&kucnfjAw{UL{LR1Y*5@n_o3=5>ZJhf;Y=`1ghM6vR!fnH? z1ajD)E%jhnmE6$AU0kT(m97)q%zxI5;Xy{ZG=svsbLx|;uh&ejFXzL+^O zN||=QCN1aN=G5$axbPhl=LG31iP4dBrp;e+a&PE4rIpN6-dY9iJdou)^K1P>CQgB+ zzakZ<@D=FAotFFMu*jixTVlw|9UuS8FOFNhIiewQsa6B)g4ayx@|+3BvKq_nlet{h zUo5;Hym3$06;{81$m~}Zs;madrq17-AE^a}@?VwRq4{2$`OL2AEGzmhF)-XdwQ1Fi zX_BiYw@po5J5|oHbjq=tuiB*rdd!{J%O3t>WP83{F}m)rE&~GtgQu&X%Q~loCIG{q B;e!AG delta 486 zcmbQp(#tZzu>QEGi(^Pc>)EOH-pq~yNAGvG&SlxcIZ27pzM)lNnwci6@M;mWNr$|0 zoSarYn5Zw{qGQX^(V9BzMr%SBN7U>`9GWJ+R=c-O*nQ_|T7LR>o{y#5>(lB!mpvDY z*r<~gz+w1bV%o(m>;5)&t#JMR=I$}|jVDZO8lJrl3CLDbFchfwW>j!g5h!HHE<8A& z{k=wR{poV%g^vvdCHMUP#Kv&LcljT~=h@BASspfRWOm#*S7O>u#itCrUxuuxTIZv1 zgHOjhieXhU!?lDYqD9)?uO#up0jKsQiVKa7vz{vJjEI&eQM2rZgCHWxvwTW zX~;f^*|X1@xABF;(QOOY`P}*OzyIQj%h9?HK`Xfu7-#G{aMPXX%0riXwXz+7@ynmD zU!KIe^eSsyKxFnT3su$?hc~9!tK=z#ermdKI;Vst02(>l761SM diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index 673d66e77a..e62a70f62a 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -2412,7 +2412,7 @@ public class Blocks{ }}; solarPanel = new SolarGenerator("solar-panel"){{ - requirements(Category.power, with(Items.lead, 10, Items.silicon, 10)); + requirements(Category.power, with(Items.lead, 10, Items.silicon, 8)); powerProduction = 0.12f; }}; diff --git a/core/src/mindustry/entities/comp/LegsComp.java b/core/src/mindustry/entities/comp/LegsComp.java index 32ddc9b09f..cc57b1e87d 100644 --- a/core/src/mindustry/entities/comp/LegsComp.java +++ b/core/src/mindustry/entities/comp/LegsComp.java @@ -13,6 +13,7 @@ import mindustry.game.*; import mindustry.gen.*; import mindustry.graphics.*; import mindustry.type.*; +import mindustry.world.blocks.*; import mindustry.world.blocks.environment.*; import static mindustry.Vars.*; @@ -194,6 +195,11 @@ abstract class LegsComp implements Posc, Rotc, Hitboxc, Flyingc, Unitc{ if(type.legSplashDamage > 0 && !disarmed){ Damage.damage(team, l.base.x, l.base.y, type.legSplashRange, type.legSplashDamage * state.rules.unitDamage(team), false, true); + + var tile = Vars.world.tileWorld(l.base.x, l.base.y); + if(tile != null && tile.block().unitMoveBreakable){ + ConstructBlock.deconstructFinish(tile, tile.block(), self()); + } } } diff --git a/core/src/mindustry/entities/comp/TankComp.java b/core/src/mindustry/entities/comp/TankComp.java index afd4076ff5..eb324b2158 100644 --- a/core/src/mindustry/entities/comp/TankComp.java +++ b/core/src/mindustry/entities/comp/TankComp.java @@ -11,6 +11,7 @@ import mindustry.game.*; import mindustry.gen.*; import mindustry.type.*; import mindustry.world.*; +import mindustry.world.blocks.*; import mindustry.world.blocks.environment.*; import static mindustry.Vars.*; @@ -57,16 +58,20 @@ abstract class TankComp implements Posc, Flyingc, Hitboxc, Unitc, ElevationMovec for(int dx = -r; dx <= r; dx++){ for(int dy = -r; dy <= r; dy++){ Tile t = Vars.world.tileWorld(x + dx*tilesize, y + dy*tilesize); - if(t == null || t.solid()){ + if(t == null || t.solid()){ solids ++; } //TODO should this apply to the player team(s)? currently PvE due to balancing - if(type.crushDamage > 0 && !disarmed && (walked || deltaLen() >= 0.01f) && t != null && t.build != null && t.build.team != team + if(type.crushDamage > 0 && !disarmed && (walked || deltaLen() >= 0.01f) && t != null //damage radius is 1 tile smaller to prevent it from just touching walls as it passes && Math.max(Math.abs(dx), Math.abs(dy)) <= r - 1){ - t.build.damage(team, type.crushDamage * Time.delta * t.block().crushDamageMultiplier * state.rules.unitDamage(team)); + if(t.build != null && t.build.team != team){ + t.build.damage(team, type.crushDamage * Time.delta * t.block().crushDamageMultiplier * state.rules.unitDamage(team)); + }else if(t.block().unitMoveBreakable){ + ConstructBlock.deconstructFinish(t, t.block(), self()); + } } } } diff --git a/core/src/mindustry/world/Block.java b/core/src/mindustry/world/Block.java index 9daa65d5aa..45b45f707d 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -124,6 +124,8 @@ public class Block extends UnlockableContent implements Senseable{ public boolean saveData; /** whether you can break this with rightclick */ public boolean breakable; + /** if true, this block will be broken by certain units stepping/moving over it */ + public boolean unitMoveBreakable; /** whether to add this block to brokenblocks */ public boolean rebuildable = true; /** if true, this logic-related block can only be used with privileged processors (or is one itself) */ diff --git a/core/src/mindustry/world/blocks/environment/Prop.java b/core/src/mindustry/world/blocks/environment/Prop.java index 1564ee6795..44611e5ba3 100644 --- a/core/src/mindustry/world/blocks/environment/Prop.java +++ b/core/src/mindustry/world/blocks/environment/Prop.java @@ -16,6 +16,7 @@ public class Prop extends Block{ breakable = true; alwaysReplace = true; instantDeconstruct = true; + unitMoveBreakable = true; breakEffect = Fx.breakProp; breakSound = Sounds.rockBreak; }