Auto-rebuilding of broken attack sector blocks on restart
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -338,6 +338,18 @@ public class Control implements ApplicationListener, Loadable{
|
|||||||
//reset win wave??
|
//reset win wave??
|
||||||
state.rules.winWave = state.rules.attackMode ? -1 : sector.preset != null ? sector.preset.captureWave : 40;
|
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
|
//kill all units, since they should be dead anyway
|
||||||
Groups.unit.clear();
|
Groups.unit.clear();
|
||||||
Groups.fire.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. **/
|
/** Actually destroys the unit, removing it and creating explosions. **/
|
||||||
public void destroy(){
|
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;
|
float flammability = item().flammability * stack().amount / 1.9f;
|
||||||
|
|
||||||
if(!spawnedByCore){
|
if(!spawnedByCore){
|
||||||
|
|||||||
Reference in New Issue
Block a user