This commit is contained in:
Anuken
2020-11-24 10:23:28 -05:00
parent 058b2ddfce
commit 7d43856735
8 changed files with 22 additions and 6 deletions

View File

@@ -23,6 +23,7 @@ import mindustry.gen.*;
import mindustry.input.*;
import mindustry.io.*;
import mindustry.io.SaveIO.*;
import mindustry.maps.*;
import mindustry.maps.Map;
import mindustry.net.*;
import mindustry.type.*;
@@ -322,6 +323,13 @@ public class Control implements ApplicationListener, Loadable{
return;
}
//set spawn for sector damage to use
Tile spawn = world.tile(sector.info.spawnPosition);
spawn.setBlock(Blocks.coreShard, state.rules.defaultTeam);
//add extra damage.
SectorDamage.apply(1f);
//reset wave so things are more fair
state.wave = 1;
@@ -331,8 +339,8 @@ public class Control implements ApplicationListener, Loadable{
//kill all units, since they should be dead anyway
Groups.unit.clear();
Groups.fire.clear();
Groups.puddle.clear();
Tile spawn = world.tile(sector.info.spawnPosition);
Schematics.placeLaunchLoadout(spawn.x, spawn.y);
//set up camera/player locations

View File

@@ -12,5 +12,6 @@ class GroupDefs<G>{
@GroupDef(value = Syncc.class, mapping = true) G sync;
@GroupDef(value = Drawc.class) G draw;
@GroupDef(value = Firec.class) G fire;
@GroupDef(value = Puddlec.class) G puddle;
@GroupDef(value = WeatherStatec.class) G weather;
}

View File

@@ -317,11 +317,11 @@ public abstract class BulletType extends Content{
}
public Bullet create(Bullet parent, float x, float y, float angle){
return create(parent.owner(), parent.team, x, y, angle);
return create(parent.owner, parent.team, x, y, angle);
}
public Bullet create(Bullet parent, float x, float y, float angle, float velocityScl, float lifeScale){
return create(parent.owner(), parent.team, x, y, angle, velocityScl, lifeScale);
return create(parent.owner, parent.team, x, y, angle, velocityScl, lifeScale);
}
public Bullet create(Bullet parent, float x, float y, float angle, float velocityScl){

View File

@@ -208,6 +208,8 @@ public class Universe{
//add production, making sure that it's capped
sector.info.production.each((item, stat) -> sector.info.items.add(item, Math.min((int)(stat.mean * newSecondsPassed * scl), sector.info.storageCapacity - sector.info.items.get(item))));
//prevent negative values with unloaders
sector.info.items.checkNegative();
sector.saveInfo();
}

View File

@@ -286,7 +286,7 @@ public abstract class SaveVersion extends SaveFileReader{
public void writeEntities(DataOutput stream) throws IOException{
//write team data with entities.
Seq<TeamData> data = state.teams.getActive();
Seq<TeamData> data = state.teams.getActive().and(Team.sharded.data());
stream.writeInt(data.size);
for(TeamData team : data){
stream.writeInt(team.team.id);

View File

@@ -356,7 +356,7 @@ public class SectorDamage{
for(Tile tile : tiles){
if((tile.block() instanceof CoreBlock && tile.team() == state.rules.waveTeam) || tile.overlay() == Blocks.spawn){
frontier.add(tile);
values[tile.x][tile.y] = fraction * 80;
values[tile.x][tile.y] = fraction * 23;
}
}

View File

@@ -92,6 +92,11 @@ public class ItemLiquidGenerator extends PowerGenerator{
return generateTime > 0;
}
@Override
public float ambientVolume(){
return Mathf.clamp(productionEfficiency);
}
@Override
public void updateTile(){
//Note: Do not use this delta when calculating the amount of power or the power efficiency, but use it for resource consumption if necessary.