Unhardcode defenses in BaseBuilderBotModule
This commit is contained in:
@@ -42,6 +42,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Tells the AI what building types are considered silos (resource storage).")]
|
||||
public readonly HashSet<string> SiloTypes = new HashSet<string>();
|
||||
|
||||
[Desc("Tells the AI what building types are considered defenses.")]
|
||||
public readonly HashSet<string> DefenseTypes = new HashSet<string>();
|
||||
|
||||
[Desc("Production queues AI uses for buildings.")]
|
||||
public readonly HashSet<string> BuildingQueues = new HashSet<string> { "Building" };
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
else
|
||||
{
|
||||
// Check if Building is a defense and if we should place it towards the enemy or not.
|
||||
if (actorInfo.HasTraitInfo<AttackBaseInfo>() && world.LocalRandom.Next(100) < baseBuilder.Info.PlaceDefenseTowardsEnemyChance)
|
||||
if (baseBuilder.Info.DefenseTypes.Contains(actorInfo.Name) && world.LocalRandom.Next(100) < baseBuilder.Info.PlaceDefenseTowardsEnemyChance)
|
||||
type = BuildingType.Defense;
|
||||
else if (baseBuilder.Info.RefineryTypes.Contains(actorInfo.Name))
|
||||
type = BuildingType.Refinery;
|
||||
|
||||
Reference in New Issue
Block a user