Re-added option for RTS AI on Serpulo (likely buggy)

This commit is contained in:
Anuken
2025-04-12 00:34:49 -04:00
parent c096c5858e
commit da729c3ffd
6 changed files with 29 additions and 1 deletions

View File

@@ -5968,6 +5968,7 @@ public class Blocks{
);
size = 3;
consumePower(1.2f);
researchCostMultiplier = 0.5f;
}};
airFactory = new UnitFactory("air-factory"){{
@@ -5978,6 +5979,7 @@ public class Blocks{
);
size = 3;
consumePower(1.2f);
researchCostMultiplier = 0.5f;
}};
navalFactory = new UnitFactory("naval-factory"){{

View File

@@ -87,6 +87,7 @@ public class Planets{
};
campaignRuleDefaults.fog = true;
campaignRuleDefaults.showSpawns = true;
campaignRuleDefaults.rtsAI = true;
unlockedOnLand.add(Blocks.coreBastion);
}};
@@ -148,6 +149,7 @@ public class Planets{
r.showSpawns = false;
r.coreDestroyClear = true;
};
showRtsAIRule = true;
iconColor = Color.valueOf("7d4dff");
atmosphereColor = Color.valueOf("3c1b8f");
atmosphereRadIn = 0.02f;

View File

@@ -98,6 +98,7 @@ public class UnitTypes{
//region ground attack
dagger = new UnitType("dagger"){{
researchCostMultiplier = 0.5f;
speed = 0.5f;
hitSize = 8f;
health = 150;
@@ -606,6 +607,7 @@ public class UnitTypes{
//region ground legs
crawler = new UnitType("crawler"){{
researchCostMultiplier = 0.5f;
aiController = SuicideAI::new;
speed = 1f;
@@ -977,6 +979,7 @@ public class UnitTypes{
//region air attack
flare = new UnitType("flare"){{
researchCostMultiplier = 0.5f;
speed = 2.7f;
accel = 0.08f;
drag = 0.04f;

View File

@@ -1,5 +1,7 @@
package mindustry.game;
import mindustry.*;
import mindustry.gen.*;
import mindustry.type.*;
public class CampaignRules{
@@ -9,12 +11,26 @@ public class CampaignRules{
public boolean sectorInvasion;
public boolean randomWaveAI;
public boolean legacyLaunchPads;
public boolean rtsAI;
public void apply(Planet planet, Rules rules){
rules.staticFog = rules.fog = fog;
rules.showSpawns = showSpawns;
rules.randomWaveAI = randomWaveAI;
rules.objectiveTimerMultiplier = difficulty.waveTimeMultiplier;
if(planet.showRtsAIRule && rules.attackMode){
boolean swapped = rules.teams.get(rules.waveTeam).rtsAi != rtsAI;
rules.teams.get(rules.waveTeam).rtsAi = rtsAI;
rules.teams.get(rules.waveTeam).rtsMinWeight = 1.2f * difficulty.enemyHealthMultiplier;
if(swapped && Vars.state.isGame()){
Groups.unit.each(u -> {
if(u.team == rules.waveTeam && !u.isPlayer()){
u.resetController();
}
});
}
}
rules.teams.get(rules.waveTeam).blockHealthMultiplier = difficulty.enemyHealthMultiplier;
rules.teams.get(rules.waveTeam).unitHealthMultiplier = difficulty.enemyHealthMultiplier;
rules.teams.get(rules.waveTeam).unitCostMultiplier = 1f / difficulty.enemySpawnMultiplier;

View File

@@ -165,7 +165,8 @@ public class Planet extends UnlockableContent{
public CampaignRules campaignRuleDefaults = new CampaignRules();
/** Sets up rules on game load for any sector on this planet. */
public Cons<Rules> ruleSetter = r -> {};
/** If true, RTS AI can be customized. */
public boolean showRtsAIRule = false;
public Planet(String name, Planet parent, float radius){
super(name);

View File

@@ -69,6 +69,10 @@ public class CampaignRulesDialog extends BaseDialog{
check("@rules.showspawns", b -> rules.showSpawns = b, () -> rules.showSpawns);
check("@rules.randomwaveai", b -> rules.randomWaveAI = b, () -> rules.randomWaveAI);
if(planet.showRtsAIRule){
check("@rules.rtsai.campaign", b -> rules.rtsAI = b, () -> rules.rtsAI);
}
//TODO: this is intentionally hidden until the new mechanics have been well-tested. I don't want people immediately switching to the old mechanics
if(planet.allowLegacyLaunchPads){
// check("@rules.legacylaunchpads", b -> rules.legacyLaunchPads = b, () -> rules.legacyLaunchPads);