Add an ExitDelay field to allow doors to open before exiting.
This commit is contained in:
@@ -26,6 +26,9 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
[Desc("AttackMove to a RallyPoint or stay where you are spawned.")]
|
[Desc("AttackMove to a RallyPoint or stay where you are spawned.")]
|
||||||
public readonly bool MoveIntoWorld = true;
|
public readonly bool MoveIntoWorld = true;
|
||||||
|
|
||||||
|
[Desc("Number of ticks to wait before moving into the world.")]
|
||||||
|
public readonly int ExitDelay = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Exit { }
|
public class Exit { }
|
||||||
|
|||||||
@@ -77,6 +77,9 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
{
|
{
|
||||||
if (exitinfo.MoveIntoWorld)
|
if (exitinfo.MoveIntoWorld)
|
||||||
{
|
{
|
||||||
|
if (exitinfo.ExitDelay > 0)
|
||||||
|
newUnit.QueueActivity(new Wait(exitinfo.ExitDelay));
|
||||||
|
|
||||||
newUnit.QueueActivity(move.MoveIntoWorld(newUnit, exit));
|
newUnit.QueueActivity(move.MoveIntoWorld(newUnit, exit));
|
||||||
newUnit.QueueActivity(new AttackMoveActivity(
|
newUnit.QueueActivity(new AttackMoveActivity(
|
||||||
newUnit, move.MoveTo(exitLocation, 1)));
|
newUnit, move.MoveTo(exitLocation, 1)));
|
||||||
|
|||||||
Reference in New Issue
Block a user