Added OwnerLostAction
Allows customisation of what will happen to an actor when its owner loses.
This commit is contained in:
committed by
Paul Chote
parent
0d23070c8e
commit
367a7f617c
@@ -0,0 +1,46 @@
|
||||
#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 DefineOwnerLostAction : UpdateRule
|
||||
{
|
||||
public override string Name { get { return "Add OwnerLostAction to player-controlled actors"; } }
|
||||
public override string Description
|
||||
{
|
||||
get
|
||||
{
|
||||
return "A new OwnerLostAction trait has been introduced to control what happens to a\n" +
|
||||
"player's actors when they are defeated. A warning is displayed notifying that\nthis trait must be added to actors.";
|
||||
}
|
||||
}
|
||||
|
||||
bool reported;
|
||||
public override IEnumerable<string> AfterUpdate(ModData modData)
|
||||
{
|
||||
if (!reported)
|
||||
yield return "All player-controlled (or player-capturable) actors should define an OwnerLostAction trait\n" +
|
||||
"specifying an action (Kill, Dispose, ChangeOwner) to apply when the actor's owner is defeated.\n" +
|
||||
"You must manually define this trait on the appropriate default actor templates.\n" +
|
||||
"Actors missing this trait will remain controllable by their owner after they have been defeated.";
|
||||
|
||||
reported = true;
|
||||
}
|
||||
|
||||
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,8 @@ namespace OpenRA.Mods.Common.UpdateRules
|
||||
new AddShakeToBridge(),
|
||||
new AddEditorPlayer(),
|
||||
new RemovePaletteFromCurrentTileset(),
|
||||
new DefineLocomotors()
|
||||
new DefineLocomotors(),
|
||||
new DefineOwnerLostAction()
|
||||
})
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user