Split off CaptureManagerBotModule
from HackyAI. Note: This isn't used in any official mod right know, and known to be bugged on bleed already.
This commit is contained in:
committed by
Oliver Brakmann
parent
d823d38e8c
commit
6db27b1839
@@ -74,6 +74,16 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
|
||||
"MaxBaseRadius",
|
||||
};
|
||||
|
||||
readonly string[] captureManagerFields =
|
||||
{
|
||||
"CapturingActorTypes",
|
||||
"CapturableActorTypes",
|
||||
"MinimumCaptureDelay",
|
||||
"MaximumCaptureTargetOptions",
|
||||
"CheckCaptureTargetsForVisibility",
|
||||
"CapturableStances",
|
||||
};
|
||||
|
||||
public override IEnumerable<string> AfterUpdate(ModData modData)
|
||||
{
|
||||
if (!messageShown)
|
||||
@@ -245,6 +255,21 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
|
||||
requiresConditionNode.ReplaceValue(oldValue + " || " + conditionString);
|
||||
}
|
||||
}
|
||||
|
||||
if (captureManagerFields.Any(f => hackyAINode.ChildrenMatching(f).Any()))
|
||||
{
|
||||
var node = new MiniYamlNode("CaptureManagerBotModule@" + aiType, "");
|
||||
node.AddNode(new MiniYamlNode("RequiresCondition", conditionString));
|
||||
|
||||
foreach (var field in captureManagerFields)
|
||||
{
|
||||
var fieldNode = hackyAINode.LastChildMatching(field);
|
||||
if (fieldNode != null)
|
||||
fieldNode.MoveNode(hackyAINode, node);
|
||||
}
|
||||
|
||||
addNodes.Add(node);
|
||||
}
|
||||
}
|
||||
|
||||
// Only add module if any bot is using/enabling it.
|
||||
|
||||
Reference in New Issue
Block a user