Add an ExitDelay field to allow doors to open before exiting.

This commit is contained in:
Paul Chote
2015-04-27 20:54:17 +12:00
parent ccf9d8fe97
commit 8e9a7fd08b
2 changed files with 6 additions and 0 deletions

View File

@@ -26,6 +26,9 @@ namespace OpenRA.Mods.Common.Traits
[Desc("AttackMove to a RallyPoint or stay where you are spawned.")]
public readonly bool MoveIntoWorld = true;
[Desc("Number of ticks to wait before moving into the world.")]
public readonly int ExitDelay = 0;
}
public class Exit { }

View File

@@ -77,6 +77,9 @@ namespace OpenRA.Mods.Common.Traits
{
if (exitinfo.MoveIntoWorld)
{
if (exitinfo.ExitDelay > 0)
newUnit.QueueActivity(new Wait(exitinfo.ExitDelay));
newUnit.QueueActivity(move.MoveIntoWorld(newUnit, exit));
newUnit.QueueActivity(new AttackMoveActivity(
newUnit, move.MoveTo(exitLocation, 1)));