Re-added option for RTS AI on Serpulo (likely buggy)
This commit is contained in:
@@ -5968,6 +5968,7 @@ public class Blocks{
|
|||||||
);
|
);
|
||||||
size = 3;
|
size = 3;
|
||||||
consumePower(1.2f);
|
consumePower(1.2f);
|
||||||
|
researchCostMultiplier = 0.5f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
airFactory = new UnitFactory("air-factory"){{
|
airFactory = new UnitFactory("air-factory"){{
|
||||||
@@ -5978,6 +5979,7 @@ public class Blocks{
|
|||||||
);
|
);
|
||||||
size = 3;
|
size = 3;
|
||||||
consumePower(1.2f);
|
consumePower(1.2f);
|
||||||
|
researchCostMultiplier = 0.5f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
navalFactory = new UnitFactory("naval-factory"){{
|
navalFactory = new UnitFactory("naval-factory"){{
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ public class Planets{
|
|||||||
};
|
};
|
||||||
campaignRuleDefaults.fog = true;
|
campaignRuleDefaults.fog = true;
|
||||||
campaignRuleDefaults.showSpawns = true;
|
campaignRuleDefaults.showSpawns = true;
|
||||||
|
campaignRuleDefaults.rtsAI = true;
|
||||||
|
|
||||||
unlockedOnLand.add(Blocks.coreBastion);
|
unlockedOnLand.add(Blocks.coreBastion);
|
||||||
}};
|
}};
|
||||||
@@ -148,6 +149,7 @@ public class Planets{
|
|||||||
r.showSpawns = false;
|
r.showSpawns = false;
|
||||||
r.coreDestroyClear = true;
|
r.coreDestroyClear = true;
|
||||||
};
|
};
|
||||||
|
showRtsAIRule = true;
|
||||||
iconColor = Color.valueOf("7d4dff");
|
iconColor = Color.valueOf("7d4dff");
|
||||||
atmosphereColor = Color.valueOf("3c1b8f");
|
atmosphereColor = Color.valueOf("3c1b8f");
|
||||||
atmosphereRadIn = 0.02f;
|
atmosphereRadIn = 0.02f;
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ public class UnitTypes{
|
|||||||
//region ground attack
|
//region ground attack
|
||||||
|
|
||||||
dagger = new UnitType("dagger"){{
|
dagger = new UnitType("dagger"){{
|
||||||
|
researchCostMultiplier = 0.5f;
|
||||||
speed = 0.5f;
|
speed = 0.5f;
|
||||||
hitSize = 8f;
|
hitSize = 8f;
|
||||||
health = 150;
|
health = 150;
|
||||||
@@ -606,6 +607,7 @@ public class UnitTypes{
|
|||||||
//region ground legs
|
//region ground legs
|
||||||
|
|
||||||
crawler = new UnitType("crawler"){{
|
crawler = new UnitType("crawler"){{
|
||||||
|
researchCostMultiplier = 0.5f;
|
||||||
aiController = SuicideAI::new;
|
aiController = SuicideAI::new;
|
||||||
|
|
||||||
speed = 1f;
|
speed = 1f;
|
||||||
@@ -977,6 +979,7 @@ public class UnitTypes{
|
|||||||
//region air attack
|
//region air attack
|
||||||
|
|
||||||
flare = new UnitType("flare"){{
|
flare = new UnitType("flare"){{
|
||||||
|
researchCostMultiplier = 0.5f;
|
||||||
speed = 2.7f;
|
speed = 2.7f;
|
||||||
accel = 0.08f;
|
accel = 0.08f;
|
||||||
drag = 0.04f;
|
drag = 0.04f;
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package mindustry.game;
|
package mindustry.game;
|
||||||
|
|
||||||
|
import mindustry.*;
|
||||||
|
import mindustry.gen.*;
|
||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
|
|
||||||
public class CampaignRules{
|
public class CampaignRules{
|
||||||
@@ -9,12 +11,26 @@ public class CampaignRules{
|
|||||||
public boolean sectorInvasion;
|
public boolean sectorInvasion;
|
||||||
public boolean randomWaveAI;
|
public boolean randomWaveAI;
|
||||||
public boolean legacyLaunchPads;
|
public boolean legacyLaunchPads;
|
||||||
|
public boolean rtsAI;
|
||||||
|
|
||||||
public void apply(Planet planet, Rules rules){
|
public void apply(Planet planet, Rules rules){
|
||||||
rules.staticFog = rules.fog = fog;
|
rules.staticFog = rules.fog = fog;
|
||||||
rules.showSpawns = showSpawns;
|
rules.showSpawns = showSpawns;
|
||||||
rules.randomWaveAI = randomWaveAI;
|
rules.randomWaveAI = randomWaveAI;
|
||||||
rules.objectiveTimerMultiplier = difficulty.waveTimeMultiplier;
|
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).blockHealthMultiplier = difficulty.enemyHealthMultiplier;
|
||||||
rules.teams.get(rules.waveTeam).unitHealthMultiplier = difficulty.enemyHealthMultiplier;
|
rules.teams.get(rules.waveTeam).unitHealthMultiplier = difficulty.enemyHealthMultiplier;
|
||||||
rules.teams.get(rules.waveTeam).unitCostMultiplier = 1f / difficulty.enemySpawnMultiplier;
|
rules.teams.get(rules.waveTeam).unitCostMultiplier = 1f / difficulty.enemySpawnMultiplier;
|
||||||
|
|||||||
@@ -165,7 +165,8 @@ public class Planet extends UnlockableContent{
|
|||||||
public CampaignRules campaignRuleDefaults = new CampaignRules();
|
public CampaignRules campaignRuleDefaults = new CampaignRules();
|
||||||
/** Sets up rules on game load for any sector on this planet. */
|
/** Sets up rules on game load for any sector on this planet. */
|
||||||
public Cons<Rules> ruleSetter = r -> {};
|
public Cons<Rules> ruleSetter = r -> {};
|
||||||
|
/** If true, RTS AI can be customized. */
|
||||||
|
public boolean showRtsAIRule = false;
|
||||||
|
|
||||||
public Planet(String name, Planet parent, float radius){
|
public Planet(String name, Planet parent, float radius){
|
||||||
super(name);
|
super(name);
|
||||||
|
|||||||
@@ -69,6 +69,10 @@ public class CampaignRulesDialog extends BaseDialog{
|
|||||||
check("@rules.showspawns", b -> rules.showSpawns = b, () -> rules.showSpawns);
|
check("@rules.showspawns", b -> rules.showSpawns = b, () -> rules.showSpawns);
|
||||||
check("@rules.randomwaveai", b -> rules.randomWaveAI = b, () -> rules.randomWaveAI);
|
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
|
//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){
|
if(planet.allowLegacyLaunchPads){
|
||||||
// check("@rules.legacylaunchpads", b -> rules.legacyLaunchPads = b, () -> rules.legacyLaunchPads);
|
// check("@rules.legacylaunchpads", b -> rules.legacyLaunchPads = b, () -> rules.legacyLaunchPads);
|
||||||
|
|||||||
Reference in New Issue
Block a user