Skip to content

Commit

Permalink
Different block explosion damage formula
Browse files Browse the repository at this point in the history
  • Loading branch information
Anuken committed Aug 24, 2023
1 parent c829f32 commit c52b966
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion core/src/mindustry/entities/Damage.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,12 @@ public static void dynamicExplosion(float x, float y, float flammability, float
}

int waves = explosiveness <= 2 ? 0 : Mathf.clamp((int)(explosiveness / 11), 1, 25);
float damagePerWave = Mathf.pow(explosiveness / 2f, 0.8f);

for(int i = 0; i < waves; i++){
int f = i;
Time.run(i * 2f, () -> {
damage(ignoreTeam, x, y, Mathf.clamp(radius + explosiveness, 0, 50f) * ((f + 1f) / waves), explosiveness / 2f, false);
damage(ignoreTeam, x, y, Mathf.clamp(radius + explosiveness, 0, 50f) * ((f + 1f) / waves), damagePerWave, false);
Fx.blockExplosionSmoke.at(x + Mathf.range(radius), y + Mathf.range(radius));
});
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/mindustry/entities/comp/BuildingComp.java
Original file line number Diff line number Diff line change
Expand Up @@ -1374,7 +1374,7 @@ public void onDestroyed(){
}

//cap explosiveness so fluid tanks/vaults don't instakill units
Damage.dynamicExplosion(x, y, flammability, Math.min(explosiveness * 3.5f, 1000), power, tilesize * block.size / 2f, state.rules.damageExplosions, block.destroyEffect);
Damage.dynamicExplosion(x, y, flammability, explosiveness * 3.5f, power, tilesize * block.size / 2f, state.rules.damageExplosions, block.destroyEffect);

if(block.createRubble && !floor().solid && !floor().isLiquid){
Effect.rubble(x, y, block.size);
Expand Down
2 changes: 1 addition & 1 deletion core/src/mindustry/input/MobileInput.java
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ public void drawOverSelect(){

//draw last placed plan
if(!plan.breaking && plan == lastPlaced && plan.block != null){
int rot = plan.block.planRotation(rotation);
int rot = plan.block.planRotation(plan.rotation);
boolean valid = validPlace(tile.x, tile.y, plan.block, rot);
Draw.mixcol();
plan.block.drawPlace(tile.x, tile.y, rot, valid);
Expand Down

0 comments on commit c52b966

Please sign in to comment.