Add ability to use IonCannonPower via lua.

This commit is contained in:
Mustafa Alperen Seki
2018-02-06 12:52:39 +03:00
committed by Matthias Mailänder
parent 2387e49ee7
commit 51c207dd28
3 changed files with 48 additions and 3 deletions

View File

@@ -74,11 +74,16 @@ namespace OpenRA.Mods.Cnc.Traits
{
base.Activate(self, order, manager);
Activate(self, order.TargetLocation);
}
public void Activate(Actor self, CPos targetLocation)
{
self.World.AddFrameEndTask(w =>
{
PlayLaunchSounds();
Game.Sound.Play(SoundType.World, info.OnFireSound, self.World.Map.CenterOfCell(order.TargetLocation));
w.Add(new IonCannon(self.Owner, info.WeaponInfo, w, self.CenterPosition, order.TargetLocation,
Game.Sound.Play(SoundType.World, info.OnFireSound, self.World.Map.CenterOfCell(targetLocation));
w.Add(new IonCannon(self.Owner, info.WeaponInfo, w, self.CenterPosition, targetLocation,
info.Effect, info.EffectSequence, info.EffectPalette, info.WeaponDelay));
if (info.CameraActor == null)
@@ -86,7 +91,7 @@ namespace OpenRA.Mods.Cnc.Traits
var camera = w.CreateActor(info.CameraActor, new TypeDictionary
{
new LocationInit(order.TargetLocation),
new LocationInit(targetLocation),
new OwnerInit(self.Owner),
});