Split fixed-wing attack and strafe attack types.

This commit is contained in:
Paul Chote
2020-01-02 16:17:10 +00:00
committed by reaperrr
parent 85bc843554
commit adb3c8e39c
5 changed files with 100 additions and 5 deletions

View File

@@ -0,0 +1,48 @@
#region Copyright & License Information
/*
* Copyright 2007-2020 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version. For more
* information, see COPYING.
*/
#endregion
using System.Collections.Generic;
using OpenRA.Mods.Common.Traits;
namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class ReplaceAttackTypeStrafe : UpdateRule
{
public override string Name { get { return "Replaced AttackAircraft AttackType: Strafe logic."; } }
public override string Description
{
get
{
return "The AttackType: Strafe behaviour on AttackAircraft has been renamed to Default,\n"
+ "and AttackTurnDelay has been removed. A new AttackType: Strafe has been added, with a\n"
+ "new StrafeRunLength parameter, designed for use with the FirstBurstTargetOffset and\n"
+ "FollowingBurstTargetOffset weapon parameters.";
}
}
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{
var aircraft = actorNode.LastChildMatching("Aircraft");
if (aircraft != null)
{
var attackAircraft = actorNode.LastChildMatching("AttackAircraft");
if (attackAircraft == null)
yield break;
var attackType = attackAircraft.LastChildMatching("AttackType");
if (attackType.NodeValue<AirAttackType>() == AirAttackType.Strafe)
attackAircraft.RemoveNode(attackType);
attackAircraft.RemoveNodes("AttackTurnDelay");
}
}
}
}

View File

@@ -144,6 +144,7 @@ namespace OpenRA.Mods.Common.UpdateRules
new RemoveInitialFacingHardcoding(),
new RemoveAirdropActorTypeDefault(),
new RenameProneTime(),
new ReplaceAttackTypeStrafe(),
})
};