Add support for applying a target flash to actors through lua

This commit is contained in:
abcdefg30
2016-10-11 11:05:40 +02:00
parent f66883c925
commit bfef8694a1

View File

@@ -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")]