Campaign tweaks
This commit is contained in:
@@ -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 */
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ public class SectorPresets implements ContentList{
|
||||
}};
|
||||
|
||||
nuclearComplex = new SectorPreset("nuclearComplex", serpulo, 130){{
|
||||
captureWave = 50;
|
||||
captureWave = 45;
|
||||
difficulty = 7;
|
||||
}};
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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){
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user