From bfef8694a16b674be0efa2542854c743fc6e3e9d Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Tue, 11 Oct 2016 11:05:40 +0200 Subject: [PATCH] Add support for applying a target flash to actors through lua --- .../Scripting/Properties/GeneralProperties.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/OpenRA.Mods.Common/Scripting/Properties/GeneralProperties.cs b/OpenRA.Mods.Common/Scripting/Properties/GeneralProperties.cs index c0e8269b46..dcaae3d36a 100644 --- a/OpenRA.Mods.Common/Scripting/Properties/GeneralProperties.cs +++ b/OpenRA.Mods.Common/Scripting/Properties/GeneralProperties.cs @@ -11,6 +11,7 @@ using Eluant; using OpenRA.Mods.Common.Activities; +using OpenRA.Mods.Common.Effects; using OpenRA.Mods.Common.Traits; using OpenRA.Scripting; using OpenRA.Traits; @@ -72,6 +73,13 @@ namespace OpenRA.Mods.Common.Scripting { return Self.HasScriptProperty(name); } + + [Desc("Render a target flash on the actor. If set, 'asPlayer'", + "defines which player palette to use. Duration is in ticks.")] + public void Flash(int duration = 4, Player asPlayer = null) + { + Self.World.Add(new FlashTarget(Self, asPlayer, duration)); + } } [ScriptPropertyGroup("General")]