Add new interfaces for support powers.

This commit is contained in:
Matthias Mailänder
2020-03-08 19:37:20 +01:00
committed by atlimit8
parent e42d177920
commit b3b0aa75ae
2 changed files with 7 additions and 0 deletions

View File

@@ -152,6 +152,9 @@ namespace OpenRA.Mods.Common.Traits
Game.Sound.PlayToPlayer(SoundType.UI, self.Owner, Info.EndChargeSound);
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech",
Info.EndChargeSpeechNotification, self.Owner.Faction.InternalName);
foreach (var notify in self.TraitsImplementing<INotifySupportPower>())
notify.Charged(self);
}
public virtual void SelectTarget(Actor self, string order, SupportPowerManager manager)
@@ -172,6 +175,9 @@ namespace OpenRA.Mods.Common.Traits
order.Player.Color,
Info.RadarPingDuration);
}
foreach (var notify in self.TraitsImplementing<INotifySupportPower>())
notify.Activated(self);
}
public virtual void PlayLaunchSounds()

View File

@@ -133,6 +133,7 @@ namespace OpenRA.Mods.Common.Traits
[RequireExplicitImplementation]
public interface INotifyPowerLevelChanged { void PowerLevelChanged(Actor self); }
public interface INotifySupportPower { void Charged(Actor self); void Activated(Actor self); }
public interface INotifyBuildingPlaced { void BuildingPlaced(Actor self); }
public interface INotifyNuke { void Launching(Actor self); }