Use support sequences for scripted powers

This commit is contained in:
JovialFeline
2025-07-09 14:56:19 -04:00
committed by Gustas Kažukauskas
parent 8833e95f21
commit 74ead504ec
4 changed files with 12 additions and 0 deletions

View File

@@ -30,6 +30,9 @@ namespace OpenRA.Mods.Common.Scripting
[Desc("Activate the actor's Airstrike Power. Returns the aircraft that will attack.")]
public Actor[] TargetAirstrike(WPos target, WAngle? facing = null)
{
foreach (var notify in Self.TraitsImplementing<INotifySupportPower>())
notify.Activated(Self);
return ap.SendAirstrike(Self, target, facing);
}
}

View File

@@ -31,6 +31,9 @@ namespace OpenRA.Mods.Common.Scripting
public void ActivateNukePower(CPos target)
{
np.Activate(Self, Self.World.Map.CenterOfCell(target));
foreach (var notify in Self.TraitsImplementing<INotifySupportPower>())
notify.Activated(Self);
}
}
}

View File

@@ -31,6 +31,9 @@ namespace OpenRA.Mods.Common.Scripting
[Desc("Command transport to paradrop passengers near the target cell.")]
public void Paradrop(CPos cell)
{
foreach (var notify in Self.TraitsImplementing<INotifySupportPower>())
notify.Activated(Self);
paradrop.SetLZ(cell, true);
Self.QueueActivity(new Fly(Self, Target.FromCell(Self.World, cell)));
Self.QueueActivity(new FlyOffMap(Self));

View File

@@ -30,6 +30,9 @@ namespace OpenRA.Mods.Common.Scripting
[Desc("Activate the actor's Paratroopers Power. Returns the aircraft that will drop the reinforcements.")]
public Actor[] TargetParatroopers(WPos target, WAngle? facing = null)
{
foreach (var notify in Self.TraitsImplementing<INotifySupportPower>())
notify.Activated(Self);
var actors = pp.SendParatroopers(Self, target, facing);
return actors.Aircraft;
}