Retire the "release-20190314" path

This commit is contained in:
abcdefg30
2020-05-06 14:50:46 +02:00
committed by Paul Chote
parent 7fb49e383d
commit e12c1dc9aa
19 changed files with 0 additions and 962 deletions

View File

@@ -1,74 +0,0 @@
#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;
using System.Collections.Generic;
using System.Linq;
namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class AddAirAttackTypes : UpdateRule
{
public override string Name { get { return "Add AttackType field to AttackAircraft"; } }
public override string Description
{
get
{
return "Aircraft attack behavior now depends on AttackAircraft.AttackType\n"
+ "instead of Aircraft.CanHover.";
}
}
readonly List<Tuple<string, string>> hoveringActors = new List<Tuple<string, string>>();
public override IEnumerable<string> AfterUpdate(ModData modData)
{
var message = "Aircraft attack behavior (Hover or Strafe) is now controlled via AttackAircraft.AttackType.\n"
+ "Aircraft with CanHover: true will now also need AttackType: Hover on AttackAircraft\n"
+ "to maintain position while attacking as before.\n"
+ "The following places might need manual changes:\n"
+ UpdateUtils.FormatMessageList(hoveringActors.Select(n => n.Item1 + " (" + n.Item2 + ")"));
if (hoveringActors.Any())
yield return message;
hoveringActors.Clear();
}
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{
var aircraftTraits = actorNode.ChildrenMatching("Aircraft");
var attackAircraftTraits = actorNode.ChildrenMatching("AttackAircraft");
foreach (var attackAircraft in attackAircraftTraits)
{
var isHover = false;
foreach (var aircraft in aircraftTraits)
{
var canHoverNode = aircraft.LastChildMatching("CanHover");
if (canHoverNode != null)
isHover = canHoverNode.NodeValue<bool>();
if (isHover)
break;
}
// It's still possible that CanHover: true is inherited, so let modders check manually if 'false',
// otherwise add AttackType: Hover.
if (!isHover)
hoveringActors.Add(Tuple.Create(actorNode.Key, actorNode.Location.Filename));
else
attackAircraft.AddNode("AttackType", "Hover");
}
yield break;
}
}
}

View File

@@ -1,83 +0,0 @@
#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;
using System.Collections.Generic;
using System.Linq;
namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class AddAircraftIdleBehavior : UpdateRule
{
public override string Name { get { return "Several aircraft traits and fields were replaced by Aircraft.IdleBehavior"; } }
public override string Description
{
get
{
return "ReturnOnIdle and FlyAwayOnIdle traits as well as LandWhenIdle boolean\n"
+ "were replaced by Aircraft.IdleBehavior.";
}
}
readonly List<Tuple<string, string>> returnOnIdles = new List<Tuple<string, string>>();
public override IEnumerable<string> AfterUpdate(ModData modData)
{
var message = "ReturnOnIdle trait has been removed from the places listed below.\n"
+ "Since this trait has been dysfunctional for a long time,\n"
+ "IdleBehavior: ReturnToBase is NOT being set automatically.\n"
+ "If you want your aircraft to return when idle, manually set it on the following definitions:\n"
+ UpdateUtils.FormatMessageList(returnOnIdles.Select(n => n.Item1 + " (" + n.Item2 + ")"));
if (returnOnIdles.Any())
yield return message;
returnOnIdles.Clear();
}
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{
var aircraft = actorNode.LastChildMatching("Aircraft");
var returnOnIdle = actorNode.LastChildMatching("ReturnOnIdle");
var flyAwayOnIdle = actorNode.LastChildMatching("FlyAwayOnIdle");
if (aircraft != null)
{
var landWhenIdle = false;
var landWhenIdleNode = aircraft.LastChildMatching("LandWhenIdle");
if (landWhenIdleNode != null)
{
landWhenIdle = landWhenIdleNode.NodeValue<bool>();
aircraft.RemoveNode(landWhenIdleNode);
}
// FlyAwayOnIdle should have had higher priority than LandWhenIdle even if both were 'true'.
// ReturnOnIdle has been broken for so long that it's safer to ignore it here and only inform
// the modder of the places it's been removed from, so they can change the IdleBehavior manually if desired.
if (flyAwayOnIdle != null && !flyAwayOnIdle.IsRemoval())
aircraft.AddNode(new MiniYamlNode("IdleBehavior", "LeaveMap"));
else if (landWhenIdle)
aircraft.AddNode(new MiniYamlNode("IdleBehavior", "Land"));
}
if (flyAwayOnIdle != null)
actorNode.RemoveNode(flyAwayOnIdle);
if (returnOnIdle != null)
{
returnOnIdles.Add(Tuple.Create(actorNode.Key, actorNode.Location.Filename));
actorNode.RemoveNode(returnOnIdle);
}
yield break;
}
}
}

View File

@@ -1,48 +0,0 @@
#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;
using System.Collections.Generic;
using System.Linq;
namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class AddCanSlide : UpdateRule
{
public override string Name { get { return "Split CanSlide from CanHover"; } }
public override string Description
{
get
{
return "Aircraft.CanHover was split into two flags; CanHover now only makes aircraft hover when idle,\n"
+ "while CanSlide toggles the ability to immediately changing direction without flying a curve.";
}
}
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{
var aircraftTraits = actorNode.ChildrenMatching("Aircraft");
foreach (var aircraft in aircraftTraits)
{
var canHover = false;
var canHoverNode = aircraft.LastChildMatching("CanHover");
if (canHoverNode != null)
canHover = canHoverNode.NodeValue<bool>();
else
yield break;
aircraft.AddNode("CanSlide", canHover.ToString());
}
yield break;
}
}
}

View File

@@ -1,54 +0,0 @@
#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 System.Linq;
namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class MakeMobilePausableConditional : UpdateRule
{
public override string Name { get { return "Change Mobile>RequiresCondition to PauseOnCondition"; } }
public override string Description
{
get
{
return "Mobile is now a PausableConditionalTrait instead of a ConditionalTrait.\n" +
"RequiresCondition is changed to PauseOnCondition.";
}
}
bool displayedMessage;
public override IEnumerable<string> AfterUpdate(ModData modData)
{
var message = "You may want to update the result of PauseOnCondition, as this update\n" +
"just adds ! prefix to RequiresCondition's value to reverse it.";
if (!displayedMessage)
yield return message;
displayedMessage = true;
}
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{
foreach (var node in actorNode.ChildrenMatching("Mobile").Where(t => t.ChildrenMatching("RequiresCondition").Any()))
{
var rc = node.LastChildMatching("RequiresCondition");
rc.ReplaceValue("!(" + rc.Value.Value + ")");
rc.RenameKey("PauseOnCondition");
}
yield break;
}
}
}

View File

@@ -1,60 +0,0 @@
#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;
using System.Collections.Generic;
using System.Linq;
namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class MoveAbortOnResupply : UpdateRule
{
public override string Name { get { return "Moved AbortOnResupply from Aircraft to AttackAircraft"; } }
public override string Description
{
get
{
return "AbortOnResupply boolean was moved to AttackAircraft.";
}
}
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{
var aircraft = actorNode.LastChildMatching("Aircraft");
var attackAircraft = actorNode.ChildrenMatching("AttackAircraft");
if (aircraft != null)
{
var abortOnResupply = aircraft.LastChildMatching("AbortOnResupply");
if (abortOnResupply == null)
yield break;
// Only add field to AttackAircraft if explicitly set to 'false'
if (!abortOnResupply.NodeValue<bool>())
{
if (attackAircraft.Any())
foreach (var a in attackAircraft)
a.AddNode(abortOnResupply);
else
{
var newAttackAircraft = new MiniYamlNode("AttackAircraft", "");
newAttackAircraft.AddNode(abortOnResupply);
actorNode.AddNode(newAttackAircraft);
}
}
aircraft.RemoveNode(abortOnResupply);
}
yield break;
}
}
}

View File

@@ -1,46 +0,0 @@
#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;
using System.Collections.Generic;
namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class MultipleDeploySounds : UpdateRule
{
public override string Name { get { return "'GrantConditionOnDeploy' now supports multiple (un)deploy sounds"; } }
public override string Description
{
get
{
return "Renamed 'DeploySound' to 'DeploySounds' and 'UndeploySound' to 'UndeploySounds'\n" +
"on 'GrantConditionOnDeploy'.";
}
}
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{
var grants = actorNode.ChildrenMatching("GrantConditionOnDeploy");
foreach (var g in grants)
{
var deploy = g.LastChildMatching("DeploySound");
if (deploy != null)
deploy.RenameKey("DeploySounds");
var undeploy = g.LastChildMatching("UndeploySound");
if (undeploy != null)
undeploy.RenameKey("UndeploySounds");
}
yield break;
}
}
}

View File

@@ -1,40 +0,0 @@
#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 System.Linq;
namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class RefactorHarvesterIdle : UpdateRule
{
public override string Name { get { return "Refactor harvester idle behavior."; } }
public override string Description
{
get
{
return "The MaxIdleDuration parameter has been removed from the Harvester trait as part of a\n" +
" refactoring of harvester idling behavior.";
}
}
readonly List<string> locations = new List<string>();
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{
foreach (var t in actorNode.ChildrenMatching("Harvester"))
if (t.RemoveNodes("MaxIdleDuration") > 0)
locations.Add("{0} ({1})".F(actorNode.Key, actorNode.Location.Filename));
yield break;
}
}
}

View File

@@ -1,38 +0,0 @@
#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 System.Linq;
namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class RemoveMoveIntoWorldFromExit : UpdateRule
{
public override string Name { get { return "Remove MoveIntoWorld from Exit."; } }
public override string Description
{
get
{
return "The MoveIntoWorld parameter has been removed from the Exit trait because it no\n" +
"longer serves a purpose (aircraft can now use the same exit procedure as other\n" +
"units).";
}
}
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{
foreach (var t in actorNode.ChildrenMatching("Exit"))
t.RemoveNodes("MoveIntoWorld");
yield break;
}
}
}

View File

@@ -1,40 +0,0 @@
#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;
namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class RemovePlaceBuildingPalettes : UpdateRule
{
public override string Name { get { return "Remove Palette and LineBuildSegmentPalette from PlaceBuilding"; } }
public override string Description
{
get
{
return "The Palette and LineBuildSegmentPalette fields have been moved from PlaceBuilding,\n" +
"to the *PlaceBuildingPreview traits.";
}
}
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{
// Repairable isn't conditional or otherwise supports multiple traits, so LastChildMatching should be fine.
foreach (var placeBuilding in actorNode.ChildrenMatching("PlaceBuilding"))
{
placeBuilding.RemoveNodes("Palette");
placeBuilding.RemoveNodes("LineBuildSegmentPalette");
}
yield break;
}
}
}

View File

@@ -1,55 +0,0 @@
#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;
namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class RemoveSimpleBeacon : UpdateRule
{
public override string Name { get { return "Remove 'PlaceSimpleBeacon'."; } }
public override string Description
{
get
{
return "The 'PlaceSimpleBeacon' trait was removed.\n" +
"Use the new functionality of the 'PlaceBeacon' trait instead.";
}
}
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{
var psb = actorNode.LastChildMatching("PlaceSimpleBeacon");
if (psb == null)
yield break;
psb.RenameKey("PlaceBeacon");
var palette = psb.LastChildMatching("Palette");
var isPlayer = psb.LastChildMatching("IsPlayerPalette");
var sequence = psb.LastChildMatching("BeaconSequence");
if (palette == null)
psb.AddNode("Palette", "effect");
if (isPlayer == null)
psb.AddNode("IsPlayerPalette", "false");
if (sequence == null)
psb.AddNode("BeaconSequence", "idle");
psb.AddNode("ArrowSequence", "");
psb.AddNode("CircleSequence", "");
yield break;
}
}
}

View File

@@ -1,43 +0,0 @@
#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;
namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class RenameAttackMoveConditions : UpdateRule
{
public override string Name { get { return "Rename AttackMove *ScanConditions"; } }
public override string Description
{
get
{
return "AttackMove's AttackMoveScanCondition and AssaultMoveScanCondition\n" +
"now remain active while attacking, and are have been renamed to\n" +
"AttackMoveCondition and AssaultMoveCondition to reflect this.\n";
}
}
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{
foreach (var at in actorNode.ChildrenMatching("AttackMove"))
{
foreach (var node in at.ChildrenMatching("AttackMoveScanCondition"))
node.RenameKey("AttackMoveCondition");
foreach (var node in at.ChildrenMatching("AssaultMoveScanCondition"))
node.RenameKey("AssaultMoveCondition");
}
yield break;
}
}
}

View File

@@ -1,42 +0,0 @@
#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;
namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class RenameCarryallDelays : UpdateRule
{
public override string Name { get { return "Rename Carryall and Cargo delay parameters"; } }
public override string Description
{
get
{
return "Carryall's LoadingDelay and UnloadingDelay parameters have been renamed\n"
+ "to BeforeLoadDelay and BeforeUnloadDelay to match new parameters on Cargo.";
}
}
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{
foreach (var carryall in actorNode.ChildrenMatching("Carryall"))
{
foreach (var node in carryall.ChildrenMatching("LoadingDelay"))
node.RenameKey("BeforeLoadDelay");
foreach (var node in carryall.ChildrenMatching("UnloadingDelay"))
node.RenameKey("BeforeUnloadDelay");
}
yield break;
}
}
}

View File

@@ -1,46 +0,0 @@
#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;
namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class RenameChronoshiftFootprint : UpdateRule
{
public override string Name { get { return "Rename footprint related ChronoshiftPower parameters"; } }
public override string Description
{
get
{
return "The parameters that define the footprint tiles to use in ChronoshiftPower\n" +
"are renamed to follow standard conventions.";
}
}
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{
// Repairable isn't conditional or otherwise supports multiple traits, so LastChildMatching should be fine.
foreach (var placeBuilding in actorNode.ChildrenMatching("ChronoshiftPower"))
{
placeBuilding.RenameChildrenMatching("OverlaySpriteGroup", "FootprintImage");
placeBuilding.RenameChildrenMatching("InvalidTileSequencePrefix", "InvalidFootprintSequence");
placeBuilding.RenameChildrenMatching("SourceTileSequencePrefix", "SourceFootprintSequence");
foreach (var valid in placeBuilding.ChildrenMatching("ValidTileSequencePrefix"))
{
valid.RenameKey("ValidFootprintSequence");
valid.Value.Value = valid.Value.Value.Substring(0, valid.Value.Value.Length - 1);
}
}
yield break;
}
}
}

View File

@@ -1,38 +0,0 @@
#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;
namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class RenameHoversOffsetModifier : UpdateRule
{
public override string Name { get { return "Rename Hovers OffsetModifier"; } }
public override string Description
{
get
{
return "Hovers' OffsetModifier was renamed to BobDistance,\n" +
"as 'Modifier' is a term we don't normally use for distance,\n" +
"while 'Offset' would imply a 3D vector, which isn't the case here.";
}
}
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{
foreach (var h in actorNode.ChildrenMatching("Hovers"))
foreach (var node in h.ChildrenMatching("OffsetModifier"))
node.RenameKey("BobDistance");
yield break;
}
}
}

View File

@@ -1,35 +0,0 @@
#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;
namespace OpenRA.Mods.Common.UpdateRules.Rules
{
class RenameSearchRadius : UpdateRule
{
public override string Name { get { return "Rename SearchFromOrderRadius to SearchFromHarvesterRadius"; } }
public override string Description
{
get
{
return "Renamed 'SearchFromOrderRadius' to 'SearchFromHarvesterRadius'.";
}
}
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{
foreach (var harvester in actorNode.ChildrenMatching("Harvester"))
harvester.RenameChildrenMatching("SearchFromOrderRadius", "SearchFromHarvesterRadius");
yield break;
}
}
}

View File

@@ -1,78 +0,0 @@
#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 System.Linq;
namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class ReplaceSpecialMoveConsiderations : UpdateRule
{
public override string Name { get { return "Replaced special-case movement type considerations"; } }
public override string Description
{
get
{
return "Removed AlwaysConsiderTurnAsMove from Mobile and ConsiderVerticalMovement\n" +
"from GrantConditionOnMovement. Add 'Turn' and/or 'Vertical' on new ValidMovementTypes\n" +
"fields on WithMoveAnimation and GrantConditionOnMovement instead.";
}
}
readonly Dictionary<string, List<string>> locations = new Dictionary<string, List<string>>();
public override IEnumerable<string> AfterUpdate(ModData modData)
{
if (locations.Any())
yield return "The following definitions implement WithMoveAnimation\n" +
"or GrantConditionOnMovement. Check if they need updated ValidMovementTypes:\n" +
UpdateUtils.FormatMessageList(locations.Select(
kv => kv.Key + ":\n" + UpdateUtils.FormatMessageList(kv.Value)));
locations.Clear();
}
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{
var mobileNode = actorNode.ChildrenMatching("Mobile").FirstOrDefault(m => !m.IsRemoval());
if (mobileNode != null)
{
var considerTurnAsMoveNode = mobileNode.LastChildMatching("AlwaysConsiderTurnAsMove");
if (considerTurnAsMoveNode != null)
mobileNode.RemoveNode(considerTurnAsMoveNode);
}
var used = new List<string>();
var grantMoveConditions = actorNode.ChildrenMatching("GrantConditionOnMovement");
foreach (var g in grantMoveConditions)
{
var considerVerticalNode = g.LastChildMatching("ConsiderVerticalMovement");
if (considerVerticalNode != null)
g.RemoveNode(considerVerticalNode);
}
if (grantMoveConditions.Any())
used.Add("GrantConditionOnMovement");
var moveAnim = actorNode.LastChildMatching("WithMoveAnimation");
if (moveAnim != null)
used.Add("WithMoveAnimation");
if (used.Any())
{
var location = "{0} ({1})".F(actorNode.Key, actorNode.Location.Filename);
locations[location] = used;
}
yield break;
}
}
}

View File

@@ -1,64 +0,0 @@
#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;
using System.Collections.Generic;
using System.Linq;
namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class SplitHarvesterSpriteBody : UpdateRule
{
public override string Name { get { return "Split fullness display from WithHarvestAnimation to new WithHarvesterSpriteBody"; } }
public override string Description
{
get
{
return "WithHarvestAnimation.PrefixByFullness logic was moved to a dedicated WithHarvesterSpriteBody.";
}
}
readonly List<Tuple<string, string>> fullnessPrefixes = new List<Tuple<string, string>>();
public override IEnumerable<string> AfterUpdate(ModData modData)
{
var message = "PrefixByFullness has been removed from WithHarvestAnimation.\n"
+ "To display fullness levels, use the new WithHarvesterSpriteBody\n"
+ "to switch between separate image sprites instead (see RA mod harvester for reference).\n"
+ "The following places most likely need manual changes:\n"
+ UpdateUtils.FormatMessageList(fullnessPrefixes.Select(n => n.Item1 + " (" + n.Item2 + ")"));
if (fullnessPrefixes.Any())
yield return message;
fullnessPrefixes.Clear();
}
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{
var harvAnim = actorNode.LastChildMatching("WithHarvestAnimation");
if (harvAnim != null)
{
var fullnessPrefix = harvAnim.LastChildMatching("PrefixByFullness");
// If PrefixByFullness is empty, no changes are needed.
if (fullnessPrefix == null)
yield break;
harvAnim.RemoveNode(fullnessPrefix);
fullnessPrefixes.Add(Tuple.Create(actorNode.Key, actorNode.Location.Filename));
}
yield break;
}
}
}

View File

@@ -1,56 +0,0 @@
#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;
namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class StreamlineRepairableTraits : UpdateRule
{
public override string Name { get { return "Streamline RepairableNear and Repairable"; } }
public override string Description
{
get
{
return "Renamed Repairable.RepairBuildings and RepairableNear.Buildings to RepairActors,\n" +
"for consistency with RearmActors (and since repairing at other actors should already be possible).\n" +
"Additionally, removed internal 'fix' and 'spen, syrd' default values.";
}
}
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{
// Repairable isn't conditional or otherwise supports multiple traits, so LastChildMatching should be fine.
var repairableNode = actorNode.LastChildMatching("Repairable");
if (repairableNode != null)
{
var repairBuildings = repairableNode.LastChildMatching("RepairBuildings");
if (repairBuildings != null)
repairBuildings.RenameKey("RepairActors");
else
repairableNode.AddNode(new MiniYamlNode("RepairActors", "fix"));
}
// RepairableNear isn't conditional or otherwise supports multiple traits, so LastChildMatching should be fine.
var repairableNearNode = actorNode.LastChildMatching("RepairableNear");
if (repairableNearNode != null)
{
var repairBuildings = repairableNearNode.LastChildMatching("Buildings");
if (repairBuildings != null)
repairBuildings.RenameKey("RepairActors");
else
repairableNearNode.AddNode(new MiniYamlNode("RepairActors", "spen, syrd"));
}
yield break;
}
}
}