Skip to content

Commit

Permalink
Remove AttackSuicides trait.
Browse files Browse the repository at this point in the history
  • Loading branch information
pchote committed Feb 1, 2019
1 parent 24a491a commit 810aa74
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 100 deletions.
2 changes: 1 addition & 1 deletion OpenRA.Mods.Common/OpenRA.Mods.Common.csproj
Expand Up @@ -288,7 +288,6 @@
<Compile Include="Traits\Attack\AttackFrontal.cs" />
<Compile Include="Traits\Attack\AttackGarrisoned.cs" />
<Compile Include="Traits\Attack\AttackOmni.cs" />
<Compile Include="Traits\Attack\AttackSuicides.cs" />
<Compile Include="Traits\Attack\AttackTurreted.cs" />
<Compile Include="Traits\AttackWander.cs" />
<Compile Include="Traits\AutoTarget.cs" />
Expand Down Expand Up @@ -599,6 +598,7 @@
<Compile Include="Traits\World\ActorSpawnManager.cs" />
<Compile Include="Traits\ActorSpawner.cs" />
<Compile Include="UpdateRules\Rules\20181215\RemoveAttackIgnoresVisibility.cs" />
<Compile Include="UpdateRules\Rules\20181215\RemoveAttackSuicides.cs" />
<Compile Include="UpdateRules\Rules\20181215\RemovedDemolishLocking.cs" />
<Compile Include="UpdateRules\Rules\20181215\RemoveNegativeDamageFullHealthCheck.cs" />
<Compile Include="UpdateRules\Rules\20181215\RemoveResourceExplodeModifier.cs" />
Expand Down
98 changes: 0 additions & 98 deletions OpenRA.Mods.Common/Traits/Attack/AttackSuicides.cs

This file was deleted.

@@ -0,0 +1,51 @@
#region Copyright & License Information
/*
* Copyright 2007-2018 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 RemoveAttackSuicides : UpdateRule
{
public override string Name { get { return "AttackSuicides trait has been removed."; } }
public override string Description
{
get
{
return "The AttackSuicides trait has been removed, and should be replaced by\n" +
"AttackFrontal + GrantConditionOnAttack + GrantConditionOnDeploy + a dummy\n" +
"weapon for targeting. Affected actors are listed so that these traits can be defined.";
}
}

readonly List<string> locations = new List<string>();

public override IEnumerable<string> AfterUpdate(ModData modData)
{
if (locations.Any())
yield return "The AttackSuicides trait has been removed from the following actors.\n" +
"You must manually define AttackFrontal, GrantConditionOnAttack, GrantConditionOnDeploy\n" +
"traits and create a dummy weapon to use for targeting:\n" +
UpdateUtils.FormatMessageList(locations);

locations.Clear();
}

public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{
if (actorNode.RemoveNodes("AttackSuicides") > 0)
locations.Add("{0} ({1})".F(actorNode.Key, actorNode.Location.Filename));

yield break;
}
}
}
7 changes: 6 additions & 1 deletion OpenRA.Mods.Common/UpdateRules/UpdatePath.cs
Expand Up @@ -86,7 +86,7 @@ public class UpdatePath

new UpdatePath("release-20180923", "release-20181215", new UpdateRule[0]),

new UpdatePath("release-20181215", new UpdateRule[]
new UpdatePath("release-20181215", "playtest-20190106", new UpdateRule[]
{
// Bleed only changes here
new AddCarryableHarvester(),
Expand All @@ -113,6 +113,11 @@ public class UpdatePath
new RemoveAttackIgnoresVisibility(),
new ReplacedWithChargeAnimation(),
new RefactorResourceLevelAnimating(),
}),

new UpdatePath("playtest-20190106", new UpdateRule[]
{
new RemoveAttackSuicides(),
})
};

Expand Down

0 comments on commit 810aa74

Please sign in to comment.