Update variables for Flash lua function.

This commit is contained in:
Mustafa Alperen Seki
2022-03-02 16:00:23 +03:00
committed by abcdefg30
parent 7e4c3acda3
commit 0203476da9

View File

@@ -73,11 +73,11 @@ namespace OpenRA.Mods.Common.Scripting
return Self.HasScriptProperty(name); return Self.HasScriptProperty(name);
} }
[Desc("Render a target flash on the actor. If set, 'asPlayer'", [Desc("Render a target flash on the actor.")]
"defines which player palette to use. Duration is in ticks.")] public void Flash(Color color, int count = 2, int interval = 2, int delay = 0)
public void Flash(int duration = 4, Player asPlayer = null)
{ {
Self.World.Add(new FlashTarget(Self, asPlayer?.Color ?? Color.White, duration)); // TODO: We can't use floats with Lua, so use the default 0.5f here
Self.World.Add(new FlashTarget(Self, color, 0.5f, count, interval, delay));
} }
[Desc("The effective owner of the actor.")] [Desc("The effective owner of the actor.")]