Bugfixes
This commit is contained in:
@@ -172,7 +172,7 @@ public class SectorPresets{
|
|||||||
new BuildCountObjective(Blocks.coreBastion, 1).withMarkers(
|
new BuildCountObjective(Blocks.coreBastion, 1).withMarkers(
|
||||||
new ShapeTextMarker("New cores can be placed on [accent]core tiles[].\nNew cores function as forward bases and share a resource inventory with other cores.\nPlace a core.", 287.5f * 8f, 197.5f * 8f, 9f * 2.6f, 0f, 12f)
|
new ShapeTextMarker("New cores can be placed on [accent]core tiles[].\nNew cores function as forward bases and share a resource inventory with other cores.\nPlace a core.", 287.5f * 8f, 197.5f * 8f, 9f * 2.6f, 0f, 12f)
|
||||||
),
|
),
|
||||||
new TimerObjective("Set up defenses", 120 * 60).withMarkers(
|
new TimerObjective("[accent]Set up defenses:[lightgray] {0}", 120 * 60).withMarkers(
|
||||||
new TextMarker("The enemy will be able to detect you in 2 minutes.\nSet up defenses, mining, and production.", 288f * 8f, 202f * 8f)
|
new TextMarker("The enemy will be able to detect you in 2 minutes.\nSet up defenses, mining, and production.", 288f * 8f, 202f * 8f)
|
||||||
).withFlags("openMap")
|
).withFlags("openMap")
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -213,6 +213,7 @@ public class Control implements ApplicationListener, Loadable{
|
|||||||
|
|
||||||
if(state.isCampaign()){
|
if(state.isCampaign()){
|
||||||
|
|
||||||
|
//don't run when hosting, that doesn't really work.
|
||||||
if(state.rules.sector.planet.prebuildBase){
|
if(state.rules.sector.planet.prebuildBase){
|
||||||
toBePlaced.clear();
|
toBePlaced.clear();
|
||||||
float unitsPerTick = 2f;
|
float unitsPerTick = 2f;
|
||||||
@@ -225,19 +226,26 @@ public class Control implements ApplicationListener, Loadable{
|
|||||||
var ccore = build.closestCore();
|
var ccore = build.closestCore();
|
||||||
|
|
||||||
if(ccore != null && build.within(ccore, buildRadius)){
|
if(ccore != null && build.within(ccore, buildRadius)){
|
||||||
build.pickedUp();
|
|
||||||
build.tile.remove();
|
|
||||||
anyBuilds = true;
|
anyBuilds = true;
|
||||||
|
|
||||||
toBePlaced.add(build);
|
if(!net.active()){
|
||||||
|
build.pickedUp();
|
||||||
|
build.tile.remove();
|
||||||
|
|
||||||
Time.run(build.dst(ccore) / unitsPerTick + coreDelay, () -> {
|
toBePlaced.add(build);
|
||||||
if(build.tile.build != build){
|
|
||||||
placeLandBuild(build);
|
|
||||||
|
|
||||||
toBePlaced.remove(build);
|
Time.run(build.dst(ccore) / unitsPerTick + coreDelay, () -> {
|
||||||
}
|
if(build.tile.build != build){
|
||||||
});
|
placeLandBuild(build);
|
||||||
|
|
||||||
|
toBePlaced.remove(build);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
//when already hosting, instantly build everything. this looks bad but it's better than a desync
|
||||||
|
Fx.coreBuildBlock.at(build.x, build.y, 0f, build.block);
|
||||||
|
Fx.placeBlock.at(build.x, build.y, build.block.size);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -495,15 +495,15 @@ public class CoreBlock extends StorageBlock{
|
|||||||
public void handleItem(Building source, Item item){
|
public void handleItem(Building source, Item item){
|
||||||
boolean incinerate = incinerateNonBuildable && !item.buildable;
|
boolean incinerate = incinerateNonBuildable && !item.buildable;
|
||||||
|
|
||||||
|
if(team == state.rules.defaultTeam){
|
||||||
|
state.stats.coreItemCount.increment(item);
|
||||||
|
}
|
||||||
|
|
||||||
if(net.server() || !net.active()){
|
if(net.server() || !net.active()){
|
||||||
if(team == state.rules.defaultTeam && state.isCampaign() && !incinerate){
|
if(team == state.rules.defaultTeam && state.isCampaign() && !incinerate){
|
||||||
state.rules.sector.info.handleCoreItem(item, 1);
|
state.rules.sector.info.handleCoreItem(item, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(team == state.rules.defaultTeam){
|
|
||||||
state.stats.coreItemCount.increment(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(items.get(item) >= storageCapacity || incinerate){
|
if(items.get(item) >= storageCapacity || incinerate){
|
||||||
//create item incineration effect at random intervals
|
//create item incineration effect at random intervals
|
||||||
if(!noEffect){
|
if(!noEffect){
|
||||||
|
|||||||
Reference in New Issue
Block a user