From 8e9a7fd08b352748f07d2e45c95cba2f408465cc Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Mon, 27 Apr 2015 20:54:17 +1200 Subject: [PATCH] Add an ExitDelay field to allow doors to open before exiting. --- OpenRA.Mods.Common/Traits/Buildings/Exit.cs | 3 +++ OpenRA.Mods.Common/Traits/Production.cs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/OpenRA.Mods.Common/Traits/Buildings/Exit.cs b/OpenRA.Mods.Common/Traits/Buildings/Exit.cs index 9f1695ff45..54b35ac4a9 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/Exit.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/Exit.cs @@ -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 { } diff --git a/OpenRA.Mods.Common/Traits/Production.cs b/OpenRA.Mods.Common/Traits/Production.cs index d143263bba..a07d97e7f8 100644 --- a/OpenRA.Mods.Common/Traits/Production.cs +++ b/OpenRA.Mods.Common/Traits/Production.cs @@ -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)));