Update bleed update rule folder and update path

The release is out now, so it's time for updating this.
This commit is contained in:
reaperrr
2019-03-23 03:23:23 +01:00
committed by Oliver Brakmann
parent 5782dde1c7
commit 9a15df9dde
6 changed files with 7 additions and 7 deletions

View File

@@ -0,0 +1,54 @@
#region Copyright & License Information
/*
* Copyright 2007-2019 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

@@ -0,0 +1,46 @@
#region Copyright & License Information
/*
* Copyright 2007-2019 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

@@ -0,0 +1,55 @@
#region Copyright & License Information
/*
* Copyright 2007-2019 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

@@ -0,0 +1,56 @@
#region Copyright & License Information
/*
* Copyright 2007-2019 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;
}
}
}