Auto-rebuilding of broken attack sector blocks on restart

This commit is contained in:
Anuken 2020-11-26 20:19:13 -05:00
parent 9863cbc991
commit 0a290d2e10
4 changed files with 13 additions and 1 deletions

Binary file not shown.

View File

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

View File

@ -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){