Sector production bugfixes

This commit is contained in:
Anuken 2020-10-16 12:16:00 -04:00
parent f5decdaa1c
commit f391e7a5ac
4 changed files with 17 additions and 23 deletions

View File

@ -18,7 +18,7 @@ public class SectorPresets implements ContentList{
groundZero = new SectorPreset("groundZero", serpulo, 15){{
alwaysUnlocked = true;
captureWave = 10;
difficulty = 0;
difficulty = 1;
}};
saltFlats = new SectorPreset("saltFlats", serpulo, 101){{
@ -26,23 +26,23 @@ public class SectorPresets implements ContentList{
}};
frozenForest = new SectorPreset("frozenForest", serpulo, 86){{
captureWave = 40;
difficulty = 1;
captureWave = 20;
difficulty = 2;
}};
craters = new SectorPreset("craters", serpulo, 18){{
captureWave = 40;
captureWave = 20;
difficulty = 2;
}};
ruinousShores = new SectorPreset("ruinousShores", serpulo, 19){{
captureWave = 40;
captureWave = 30;
difficulty = 3;
}};
stainedMountains = new SectorPreset("stainedMountains", serpulo, 20){{
captureWave = 30;
difficulty = 2;
difficulty = 3;
}};
fungalPass = new SectorPreset("fungalPass", serpulo, 21){{
@ -54,7 +54,7 @@ public class SectorPresets implements ContentList{
}};
tarFields = new SectorPreset("tarFields", serpulo, 23){{
captureWave = 40;
captureWave = 50;
difficulty = 5;
}};

View File

@ -196,18 +196,15 @@ public class Universe{
if(!sector.isAttacked() && turn > invasionGracePeriod){
//TODO use factors like difficulty for better invasion chance
if(sector.near().contains(Sector::hasEnemyBase) && Mathf.chance(baseInvasionChance)){
int waveMax = Math.max(sector.info.winWave, sector.isBeingPlayed() ? state.wave : 0) + Mathf.random(2, 4) * 5;
float waveSpace = Math.max(sector.info.waveSpacing - Mathf.random(1, 4) * 5 * 60, 40 * 60);
int waveMax = Math.max(sector.info.winWave, sector.isBeingPlayed() ? state.wave : 0) + Mathf.random(2, 5) * 5;
//assign invasion-related things
if(sector.isBeingPlayed()){
state.rules.winWave = waveMax;
state.rules.waves = true;
state.rules.waveSpacing = waveSpace;
}else{
sector.info.winWave = waveMax;
sector.info.waves = true;
sector.info.waveSpacing = waveSpace;
sector.saveInfo();
}

View File

@ -380,19 +380,15 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
stable.row();
}
if(sector.save != null){
if(sector.save != null && sector.info.resources.any()){
stable.add("@sectors.resources").row();
stable.table(t -> {
if(sector.info.resources.any()){
t.left();
int idx = 0;
int max = 5;
for(UnlockableContent c : sector.info.resources){
t.image(c.icon(Cicon.small)).padRight(3);
if(++idx % max == 0) t.row();
}
}else{
t.add("@unknown").color(Color.lightGray);
t.left();
int idx = 0;
int max = 5;
for(UnlockableContent c : sector.info.resources){
t.image(c.icon(Cicon.small)).padRight(3);
if(++idx % max == 0) t.row();
}
}).fillX().row();
}
@ -414,7 +410,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
if(t.getChildren().any()){
stable.add("@sectors.production").row();
stable.add(t);
stable.add(t).row();
}
}

View File

@ -342,6 +342,7 @@ public class CoreBlock extends StorageBlock{
@Override
public void handleItem(Building source, Item item){
if(net.server() || !net.active()){
state.secinfo.handleCoreItem(item, 1);
if(items.get(item) >= getMaximumAccepted(item)){
//create item incineration effect at random intervals