mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-11 18:39:16 +07:00
Auto-rebuilding of broken attack sector blocks on restart
This commit is contained in:
parent
9863cbc991
commit
0a290d2e10
Binary file not shown.
Binary file not shown.
@ -338,6 +338,18 @@ public class Control implements ApplicationListener, Loadable{
|
||||
//reset win wave??
|
||||
state.rules.winWave = state.rules.attackMode ? -1 : sector.preset != null ? sector.preset.captureWave : 40;
|
||||
|
||||
//replace all broken blocks
|
||||
for(var plan : state.rules.waveTeam.data().blocks){
|
||||
Tile tile = world.tile(plan.x, plan.y);
|
||||
if(tile != null){
|
||||
tile.setBlock(content.block(plan.block), state.rules.waveTeam, plan.rotation);
|
||||
if(plan.config != null && tile.build != null){
|
||||
tile.build.configure(plan.config);
|
||||
}
|
||||
}
|
||||
}
|
||||
state.rules.waveTeam.data().blocks.clear();
|
||||
|
||||
//kill all units, since they should be dead anyway
|
||||
Groups.unit.clear();
|
||||
Groups.fire.clear();
|
||||
|
@ -397,7 +397,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
||||
|
||||
/** Actually destroys the unit, removing it and creating explosions. **/
|
||||
public void destroy(){
|
||||
float explosiveness = 2f + item().explosiveness * stack().amount * 1.4f;
|
||||
float explosiveness = 2f + item().explosiveness * stack().amount * 1.53f;
|
||||
float flammability = item().flammability * stack().amount / 1.9f;
|
||||
|
||||
if(!spawnedByCore){
|
||||
|
Loading…
Reference in New Issue
Block a user