diff --git a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj index 67807b257f..9c2c3969ed 100644 --- a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj +++ b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj @@ -232,6 +232,7 @@ + diff --git a/OpenRA.Mods.Common/Scripting/Properties/DemolitionProperties.cs b/OpenRA.Mods.Common/Scripting/Properties/DemolitionProperties.cs new file mode 100644 index 0000000000..83255303ff --- /dev/null +++ b/OpenRA.Mods.Common/Scripting/Properties/DemolitionProperties.cs @@ -0,0 +1,41 @@ +#region Copyright & License Information +/* + * Copyright 2007-2015 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation. For more information, + * see COPYING. + */ +#endregion + +using System; +using System.Linq; +using Eluant; +using OpenRA.Activities; +using OpenRA.Mods.Common.Activities; +using OpenRA.Mods.Common.Traits; +using OpenRA.Scripting; +using OpenRA.Traits; + +namespace OpenRA.Mods.Common.Scripting +{ + [ScriptPropertyGroup("Combat")] + public class DemolitionProperties : ScriptActorProperties, Requires, Requires + { + readonly C4DemolitionInfo info; + + public DemolitionProperties(ScriptContext context, Actor self) + : base(context, self) + { + info = Self.Info.Traits.Get(); + } + + [ScriptActorPropertyActivity] + [Desc("Demolish the target actor.")] + public void Demolish(Actor target) + { + Self.QueueActivity(new Demolish(Self, target, info.C4Delay, info.Flashes, + info.FlashesDelay, info.FlashInterval, info.FlashDuration)); + } + } +} diff --git a/mods/ra/maps/allies-05a/allies05a.lua b/mods/ra/maps/allies-05a/allies05a.lua index 4b0fa2841b..f2b96e0d64 100644 --- a/mods/ra/maps/allies-05a/allies05a.lua +++ b/mods/ra/maps/allies-05a/allies05a.lua @@ -140,8 +140,8 @@ end FreeTanya = function() TanyasColt.Destroy() Tanya = Actor.Create(TanyaType, true, { Owner = greece, Location = Prison.Location + CVec.New(1, 1) }) - Prison.Kill() Tanya.Scatter() + Tanya.Demolish(Prison) if ChangeStance then Tanya.Stance = "HoldFire"