Add a Demolish function to lua
This commit is contained in:
@@ -232,6 +232,7 @@
|
||||
<Compile Include="Scripting\Properties\GuardProperties.cs" />
|
||||
<Compile Include="Scripting\Properties\MissionObjectiveProperties.cs" />
|
||||
<Compile Include="Scripting\Properties\MobileProperties.cs" />
|
||||
<Compile Include="Scripting\Properties\DemolitionProperties.cs" />
|
||||
<Compile Include="Scripting\Properties\PlaneProperties.cs" />
|
||||
<Compile Include="Scripting\Properties\PlayerProperties.cs" />
|
||||
<Compile Include="Scripting\Properties\PowerProperties.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<IMoveInfo>, Requires<C4DemolitionInfo>
|
||||
{
|
||||
readonly C4DemolitionInfo info;
|
||||
|
||||
public DemolitionProperties(ScriptContext context, Actor self)
|
||||
: base(context, self)
|
||||
{
|
||||
info = Self.Info.Traits.Get<C4DemolitionInfo>();
|
||||
}
|
||||
|
||||
[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));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user