AI base builder power tweaks

This commit is contained in:
reaperrr
2015-06-27 02:01:28 +02:00
parent 9594dd7e30
commit 27ffd4967a
6 changed files with 17 additions and 3 deletions

View File

@@ -135,7 +135,7 @@ namespace OpenRA.Mods.Common.AI
var buildableThings = queue.BuildableItems();
// First priority is to get out of a low power situation
if (playerPower.ExcessPower < 0)
if (playerPower.ExcessPower < ai.Info.MinimumExcessPower)
{
var power = GetProducibleBuilding("Power", buildableThings, a => a.Traits.WithInterface<PowerInfo>().Where(i => i.UpgradeMinEnabledLevel < 1).Sum(p => p.Amount));
if (power != null && power.Traits.WithInterface<PowerInfo>().Where(i => i.UpgradeMinEnabledLevel < 1).Sum(p => p.Amount) > 0)
@@ -202,7 +202,7 @@ namespace OpenRA.Mods.Common.AI
// Will this put us into low power?
var actor = world.Map.Rules.Actors[frac.Key];
var pis = actor.Traits.WithInterface<PowerInfo>().Where(i => i.UpgradeMinEnabledLevel < 1);
if (playerPower.ExcessPower < 0 || playerPower.ExcessPower < pis.Sum(pi => pi.Amount))
if (playerPower.ExcessPower < ai.Info.MinimumExcessPower || playerPower.ExcessPower < pis.Sum(pi => pi.Amount))
{
// Try building a power plant instead
var power = GetProducibleBuilding("Power",

View File

@@ -49,6 +49,9 @@ namespace OpenRA.Mods.Common.AI
[Desc("Minimum delay (in ticks) between creating squads.")]
public readonly int MinimumAttackForceDelay = 0;
[Desc("Minimum excess power the AI should try to maintain.")]
public readonly int MinimumExcessPower = 0;
[Desc("How long to wait (in ticks) between structure production checks when there is no active production.")]
public readonly int StructureProductionInactiveDelay = 125;

View File

@@ -1,6 +1,7 @@
Player:
HackyAI@Cabal:
Name: Cabal
MinimumExcessPower: 60
BuildingCommonNames:
ConstructionYard: fact
Refinery: proc
@@ -119,6 +120,7 @@ Player:
CheckRadius: 7c0
HackyAI@Watson:
Name: Watson
MinimumExcessPower: 60
BuildingCommonNames:
ConstructionYard: fact
Refinery: proc
@@ -237,6 +239,7 @@ Player:
CheckRadius: 7c0
HackyAI@HAL9001:
Name: HAL 9001
MinimumExcessPower: 60
BuildingCommonNames:
ConstructionYard: fact
Refinery: proc

View File

@@ -1,6 +1,7 @@
Player:
HackyAI@Omnius:
Name: Omnius
MinimumExcessPower: 60
BuildingQueues: Building, Upgrade
UnitQueues: Infantry, Vehicle, Armor, Starport
BuildingCommonNames:
@@ -127,6 +128,7 @@ Player:
CheckRadius: 7c0
HackyAI@Vidius:
Name: Vidious
MinimumExcessPower: 60
BuildingQueues: Building, Upgrade
UnitQueues: Infantry, Vehicle, Armor, Starport
BuildingCommonNames:
@@ -253,6 +255,7 @@ Player:
CheckRadius: 7c0
HackyAI@Gladius:
Name: Gladius
MinimumExcessPower: 60
BuildingQueues: Building, Upgrade
UnitQueues: Infantry, Vehicle, Armor, Starport
BuildingCommonNames:

View File

@@ -1,6 +1,7 @@
Player:
HackyAI@RushAI:
Name: Rush AI
MinimumExcessPower: 40
BuildingCommonNames:
ConstructionYard: fact
Refinery: proc
@@ -25,7 +26,8 @@ Player:
fix: 1
BuildingFractions:
proc: 30%
powr: 35%
powr: 15%
apwr: 20%
barr: 1%
tent: 1%
kenn: 0.5%
@@ -109,6 +111,7 @@ Player:
CheckRadius: 7c0
HackyAI@NormalAI:
Name: Normal AI
MinimumExcessPower: 60
BuildingCommonNames:
ConstructionYard: fact
Refinery: proc
@@ -235,6 +238,7 @@ Player:
CheckRadius: 7c0
HackyAI@TurtleAI:
Name: Turtle AI
MinimumExcessPower: 100
BuildingCommonNames:
ConstructionYard: fact
Refinery: proc

View File

@@ -1,6 +1,7 @@
Player:
HackyAI@TestAI:
Name: Test AI
MinimumExcessPower: 60
BuildingCommonNames:
ConstructionYard: gacnst
Refinery: proc