Add infiltration sounds support to InfiltrateForSupportPowerReset
This commit is contained in:
@@ -21,6 +21,14 @@ namespace OpenRA.Mods.Cnc.Traits
|
|||||||
[Desc("The `TargetTypes` from `Targetable` that are allowed to enter.")]
|
[Desc("The `TargetTypes` from `Targetable` that are allowed to enter.")]
|
||||||
public readonly BitSet<TargetableType> Types = default(BitSet<TargetableType>);
|
public readonly BitSet<TargetableType> Types = default(BitSet<TargetableType>);
|
||||||
|
|
||||||
|
[NotificationReference("Speech")]
|
||||||
|
[Desc("Sound the victim will hear when technology gets stolen.")]
|
||||||
|
public readonly string InfiltratedNotification = null;
|
||||||
|
|
||||||
|
[NotificationReference("Speech")]
|
||||||
|
[Desc("Sound the perpetrator will hear after successful infiltration.")]
|
||||||
|
public readonly string InfiltrationNotification = null;
|
||||||
|
|
||||||
public object Create(ActorInitializer init) { return new InfiltrateForSupportPowerReset(this); }
|
public object Create(ActorInitializer init) { return new InfiltrateForSupportPowerReset(this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,6 +46,12 @@ namespace OpenRA.Mods.Cnc.Traits
|
|||||||
if (!info.Types.Overlaps(types))
|
if (!info.Types.Overlaps(types))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (info.InfiltratedNotification != null)
|
||||||
|
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.InfiltratedNotification, self.Owner.Faction.InternalName);
|
||||||
|
|
||||||
|
if (info.InfiltrationNotification != null)
|
||||||
|
Game.Sound.PlayNotification(self.World.Map.Rules, infiltrator.Owner, "Speech", info.InfiltrationNotification, infiltrator.Owner.Faction.InternalName);
|
||||||
|
|
||||||
var manager = self.Owner.PlayerActor.Trait<SupportPowerManager>();
|
var manager = self.Owner.PlayerActor.Trait<SupportPowerManager>();
|
||||||
var powers = manager.GetPowersForActor(self).Where(sp => !sp.Disabled);
|
var powers = manager.GetPowersForActor(self).Where(sp => !sp.Disabled);
|
||||||
foreach (var power in powers)
|
foreach (var power in powers)
|
||||||
|
|||||||
Reference in New Issue
Block a user