Skip to content

Commit

Permalink
Closes #8590
Browse files Browse the repository at this point in the history
  • Loading branch information
Anuken committed Feb 9, 2025
1 parent ebaf88e commit b96191f
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 4 deletions.
Binary file modified core/assets-raw/sprites/items/liquid-cryofluid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion core/src/mindustry/content/Blocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -2412,7 +2412,7 @@ public static void load(){
}};

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;
}};

Expand Down
6 changes: 6 additions & 0 deletions core/src/mindustry/entities/comp/LegsComp.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.type.*;
import mindustry.world.blocks.*;
import mindustry.world.blocks.environment.*;

import static mindustry.Vars.*;
Expand Down Expand Up @@ -194,6 +195,11 @@ public void update(){

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());
}
}
}

Expand Down
11 changes: 8 additions & 3 deletions core/src/mindustry/entities/comp/TankComp.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import mindustry.gen.*;
import mindustry.type.*;
import mindustry.world.*;
import mindustry.world.blocks.*;
import mindustry.world.blocks.environment.*;

import static mindustry.Vars.*;
Expand Down Expand Up @@ -57,16 +58,20 @@ public void update(){
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());
}
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions core/src/mindustry/world/Block.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) */
Expand Down
1 change: 1 addition & 0 deletions core/src/mindustry/world/blocks/environment/Prop.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public Prop(String name){
breakable = true;
alwaysReplace = true;
instantDeconstruct = true;
unitMoveBreakable = true;
breakEffect = Fx.breakProp;
breakSound = Sounds.rockBreak;
}
Expand Down

0 comments on commit b96191f

Please sign in to comment.