From 2fabd39ea1fb7fbd0ea0abe7005259d897d457ce Mon Sep 17 00:00:00 2001 From: Anuken Date: Tue, 8 Feb 2022 14:56:34 -0500 Subject: [PATCH] No sector default AI --- core/src/mindustry/content/Planets.java | 1 + core/src/mindustry/core/Logic.java | 3 ++- core/src/mindustry/type/Planet.java | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/content/Planets.java b/core/src/mindustry/content/Planets.java index ef25688f35..6cbdcf77bc 100644 --- a/core/src/mindustry/content/Planets.java +++ b/core/src/mindustry/content/Planets.java @@ -102,6 +102,7 @@ public class Planets{ allowWaveSimulation = true; allowSectorInvasion = true; allowLaunchSchematics = true; + defaultAI = true; atmosphereColor = Color.valueOf("3c1b8f"); atmosphereRadIn = 0.02f; atmosphereRadOut = 0.3f; diff --git a/core/src/mindustry/core/Logic.java b/core/src/mindustry/core/Logic.java index 102635fbfd..a18bdaad0d 100644 --- a/core/src/mindustry/core/Logic.java +++ b/core/src/mindustry/core/Logic.java @@ -115,9 +115,10 @@ public class Logic implements ApplicationListener{ if(state.isCampaign()){ //enable building AI on campaign unless the preset disables it //TODO should be configurable, I don't want building AI everywhere. - if(!(state.getSector().preset != null && !state.getSector().preset.useAI)){ + if(state.getSector().planet.defaultAI && !(state.getSector().preset != null && !state.getSector().preset.useAI)){ state.rules.waveTeam.rules().ai = true; } + state.rules.coreIncinerates = true; state.rules.waveTeam.rules().aiTier = state.getSector().threat * 0.8f; state.rules.waveTeam.rules().infiniteResources = true; diff --git a/core/src/mindustry/type/Planet.java b/core/src/mindustry/type/Planet.java index 028149967d..bcaa41442c 100644 --- a/core/src/mindustry/type/Planet.java +++ b/core/src/mindustry/type/Planet.java @@ -90,6 +90,8 @@ public class Planet extends UnlockableContent{ public boolean allowWaveSimulation = false; /** Whether to simulate sector invasions from enemy bases. */ public boolean allowSectorInvasion = false; + /** If true, builder AI is turned on for all sectors on this planet by default. */ + public boolean defaultAI = false; /** Parent body that this planet orbits around. If null, this planet is considered to be in the middle of the solar system.*/ public @Nullable Planet parent; /** The root parent of the whole solar system this planet is in. */