Campaign tweaks

This commit is contained in:
Anuken
2020-11-27 11:56:01 -05:00
parent e39eceee28
commit 8dd66fb942
8 changed files with 25 additions and 9 deletions

View File

@@ -88,7 +88,7 @@ public class Vars implements Loadable{
/** duration of time between turns in ticks */
public static final float turnDuration = 2 * Time.toMinutes;
/** chance of an invasion per turn, 1 = 100% */
public static final float baseInvasionChance = 1f / 85f;
public static final float baseInvasionChance = 1f / 90f;
/** how many turns have to pass before invasions start */
public static final int invasionGracePeriod = 20;
/** min armor fraction damage; e.g. 0.05 = at least 5% damage */

View File

@@ -55,11 +55,12 @@ public class BaseAI{
public void update(){
if(data.team.rules().aiCoreSpawn && timer.get(timerSpawn, 60 * 2.5f) && data.hasCore()){
CoreBlock block = (CoreBlock)data.core().block;
int coreUnits = Groups.unit.count(u -> u.team == data.team && u.type == block.unitType);
//create AI core unit
if(!state.isEditor() && !Groups.unit.contains(u -> u.team() == data.team && u.type == block.unitType)){
//create AI core unit(s)
if(!state.isEditor() && coreUnits < data.cores.size){
Unit unit = block.unitType.create(data.team);
unit.set(data.core());
unit.set(data.cores.random());
unit.add();
Fx.spawn.at(unit);
}

View File

@@ -88,7 +88,7 @@ public class SectorPresets implements ContentList{
}};
nuclearComplex = new SectorPreset("nuclearComplex", serpulo, 130){{
captureWave = 50;
captureWave = 45;
difficulty = 7;
}};

View File

@@ -620,7 +620,7 @@ public class UnitTypes implements ContentList{
drag = 0.4f;
hitSize = 12f;
rotateSpeed = 3f;
health = 800;
health = 900;
immunities = ObjectSet.with(StatusEffects.burning, StatusEffects.melting);
legCount = 6;
legLength = 13f;
@@ -651,7 +651,7 @@ public class UnitTypes implements ContentList{
bullet = new SapBulletType(){{
sapStrength = 0.4f;
length = 75f;
damage = 18;
damage = 20;
shootEffect = Fx.shootSmall;
hitColor = color = Color.valueOf("bf92f9");
despawnEffect = Fx.none;
@@ -671,7 +671,7 @@ public class UnitTypes implements ContentList{
bullet = new SapBulletType(){{
sapStrength = 0.8f;
length = 40f;
damage = 15;
damage = 16;
shootEffect = Fx.shootSmall;
hitColor = color = Color.valueOf("bf92f9");
despawnEffect = Fx.none;

View File

@@ -6,6 +6,7 @@ import arc.struct.*;
import arc.util.*;
import mindustry.content.*;
import mindustry.game.EventType.*;
import mindustry.game.SectorInfo.*;
import mindustry.maps.*;
import mindustry.type.*;
import mindustry.world.blocks.storage.*;
@@ -199,6 +200,13 @@ public class Universe{
}
}
sector.info.export.each((item, amount) -> {
if(sector.info.items.get(item) <= 0 && sector.info.production.get(item, ExportStat::new).mean <= 0){
//disable export when production is negative.
sector.info.export.get(item).mean = 0f;
}
});
//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

View File

@@ -262,7 +262,7 @@ public abstract class Weather extends UnlockableContent{
/** Creates a weather entry with some approximate weather values. */
public WeatherEntry(Weather weather){
this(weather, weather.duration * 3f, weather.duration * 6f, weather.duration / 2f, weather.duration * 1.5f);
this(weather, weather.duration * 2f, weather.duration * 6f, weather.duration / 2f, weather.duration * 1.5f);
}
public WeatherEntry(Weather weather, float minFrequency, float maxFrequency, float minDuration, float maxDuration){

View File

@@ -57,6 +57,13 @@ public class StorageBlock extends Block{
}
}
@Override
public void itemTaken(Item item){
if(linkedCore != null){
linkedCore.itemTaken(item);
}
}
@Override
public int getMaximumAccepted(Item item){
return itemCapacity;