Merge pull request #11483 from Mailaender/supportpower-factionspeech

Added support power speech notifications
This commit is contained in:
reaperrr
2016-06-20 12:21:48 +02:00
committed by GitHub
9 changed files with 30 additions and 44 deletions

View File

@@ -129,6 +129,8 @@ namespace OpenRA.Mods.Common.Traits
{ {
var notification = self.Owner.IsAlliedWith(self.World.RenderPlayer) ? Info.LaunchSound : Info.IncomingSound; var notification = self.Owner.IsAlliedWith(self.World.RenderPlayer) ? Info.LaunchSound : Info.IncomingSound;
Game.Sound.Play(notification); Game.Sound.Play(notification);
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech",
Info.IncomingSpeechNotification, self.Owner.Faction.InternalName);
Actor distanceTestActor = null; Actor distanceTestActor = null;
for (var i = -info.SquadSize / 2; i <= info.SquadSize / 2; i++) for (var i = -info.SquadSize / 2; i <= info.SquadSize / 2; i++)

View File

@@ -96,7 +96,11 @@ namespace OpenRA.Mods.Common.Traits
if (self.Owner.IsAlliedWith(self.World.RenderPlayer)) if (self.Owner.IsAlliedWith(self.World.RenderPlayer))
Game.Sound.Play(Info.LaunchSound); Game.Sound.Play(Info.LaunchSound);
else else
{
Game.Sound.Play(Info.IncomingSound); Game.Sound.Play(Info.IncomingSound);
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech",
Info.IncomingSpeechNotification, self.Owner.Faction.InternalName);
}
if (!string.IsNullOrEmpty(info.ActivationSequence)) if (!string.IsNullOrEmpty(info.ActivationSequence))
{ {

View File

@@ -32,11 +32,15 @@ namespace OpenRA.Mods.Common.Traits
public readonly string[] Prerequisites = { }; public readonly string[] Prerequisites = { };
public readonly string BeginChargeSound = null; public readonly string BeginChargeSound = null;
public readonly string BeginChargeSpeechNotification = null;
public readonly string EndChargeSound = null; public readonly string EndChargeSound = null;
public readonly string EndChargeSpeechNotification = null;
public readonly string SelectTargetSound = null; public readonly string SelectTargetSound = null;
public readonly string SelectTargetSpeechNotification = null;
public readonly string InsufficientPowerSound = null; public readonly string InsufficientPowerSound = null;
public readonly string LaunchSound = null; public readonly string LaunchSound = null;
public readonly string IncomingSound = null; public readonly string IncomingSound = null;
public readonly string IncomingSpeechNotification = null;
public readonly bool DisplayTimer = false; public readonly bool DisplayTimer = false;
@@ -83,16 +87,22 @@ namespace OpenRA.Mods.Common.Traits
public virtual void Charging(Actor self, string key) public virtual void Charging(Actor self, string key)
{ {
Game.Sound.PlayToPlayer(self.Owner, Info.BeginChargeSound); Game.Sound.PlayToPlayer(self.Owner, Info.BeginChargeSound);
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech",
Info.BeginChargeSpeechNotification, self.Owner.Faction.InternalName);
} }
public virtual void Charged(Actor self, string key) public virtual void Charged(Actor self, string key)
{ {
Game.Sound.PlayToPlayer(self.Owner, Info.EndChargeSound); Game.Sound.PlayToPlayer(self.Owner, Info.EndChargeSound);
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech",
Info.EndChargeSpeechNotification, self.Owner.Faction.InternalName);
} }
public virtual void SelectTarget(Actor self, string order, SupportPowerManager manager) public virtual void SelectTarget(Actor self, string order, SupportPowerManager manager)
{ {
Game.Sound.PlayToPlayer(manager.Self.Owner, Info.SelectTargetSound); Game.Sound.PlayToPlayer(manager.Self.Owner, Info.SelectTargetSound);
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech",
Info.SelectTargetSpeechNotification, self.Owner.Faction.InternalName);
self.World.OrderGenerator = new SelectGenericPowerTarget(order, manager, info.Cursor, MouseButton.Left); self.World.OrderGenerator = new SelectGenericPowerTarget(order, manager, info.Cursor, MouseButton.Left);
} }

View File

@@ -63,7 +63,7 @@ Sounds:
DisablePower: POWRUP1 DisablePower: POWRUP1
EnablePower: POWRDN1 EnablePower: POWRDN1
CashTickUp: CASHTIK1 CashTickUp: CASHTIK1
CashTickDown:CASHTIK1 CashTickDown: CASHTIK1
LevelUp: SCORTIK1 LevelUp: SCORTIK1
ChatLine: CHAT1 ChatLine: CHAT1
BuildPaletteOpen: BUTTON1 BuildPaletteOpen: BUTTON1

View File

@@ -838,7 +838,6 @@ high_tech_factory:
SquadSize: 3 SquadSize: 3
LongDesc: Ornithopters hit the target with bombs LongDesc: Ornithopters hit the target with bombs
UnitType: ornithopter UnitType: ornithopter
SelectTargetSound:
DisplayBeacon: True DisplayBeacon: True
CameraActor: camera CameraActor: camera
WithProductionOverlay@WELDING: WithProductionOverlay@WELDING:
@@ -951,11 +950,9 @@ palace:
ChargeTime: 300 ChargeTime: 300
Description: Death Hand Description: Death Hand
LongDesc: Launches an atomic missile at a target location LongDesc: Launches an atomic missile at a target location
BeginChargeSound: HI_PREP.AUD BeginChargeSpeechNotification: DeathHandMissilePrepping
EndChargeSound: HI_DHRDY.AUD EndChargeSpeechNotification: DeathHandMissileReady
SelectTargetSound: MissileLaunchDetected: MissileLaunchDetected
LaunchSound:
IncomingSound:
MissileWeapon: atomic MissileWeapon: atomic
SpawnOffset: -512,1c171,0 SpawnOffset: -512,1c171,0
DisplayBeacon: True DisplayBeacon: True

View File

@@ -403,11 +403,8 @@ GAPLUG:
ChargeTime: 180 ChargeTime: 180
Description: Ion Cannon Description: Ion Cannon
LongDesc: Initiate an Ion Cannon strike.\nApplies instant damage to a small area. LongDesc: Initiate an Ion Cannon strike.\nApplies instant damage to a small area.
BeginChargeSound: EndChargeSpeechNotification: IonCannonReady
EndChargeSound: 00-i156.aud SelectTargetSpeechNotification: SelectTarget
LaunchSound:
SelectTargetSound:
InsufficientPowerSound:
DisplayRadarPing: True DisplayRadarPing: True
CameraActor: camera CameraActor: camera
ProduceActorPower: ProduceActorPower:

View File

@@ -4,9 +4,7 @@ GAWALL:
Queue: Defense Queue: Defense
BuildPaletteOrder: 20 BuildPaletteOrder: 20
Prerequisites: ~structures.gdi Prerequisites: ~structures.gdi
SoundOnDamageTransition: -SoundOnDamageTransition:
DamagedSounds:
DestroyedSounds:
Valued: Valued:
Cost: 50 Cost: 50
CustomSellValue: CustomSellValue:

View File

@@ -4,9 +4,7 @@ NAWALL:
Queue: Defense Queue: Defense
BuildPaletteOrder: 1001 BuildPaletteOrder: 1001
Prerequisites: ~structures.nod Prerequisites: ~structures.nod
SoundOnDamageTransition: -SoundOnDamageTransition:
DamagedSounds:
DestroyedSounds:
Valued: Valued:
Cost: 50 Cost: 50
CustomSellValue: CustomSellValue:
@@ -240,11 +238,9 @@ NAMISL:
ChargeTime: 540 ChargeTime: 540
Description: Cluster Missile Description: Cluster Missile
LongDesc: Launches a conventional warhead\nat a target location. LongDesc: Launches a conventional warhead\nat a target location.
BeginChargeSound: EndChargeSpeechNotification: ClusterMissileReady
EndChargeSound: 00-i154.aud SelectTargetSpeechNotification: SelectTarget
SelectTargetSound: IncomingSpeechNotification: MissileLaunchDetected
InsufficientPowerSound:
IncomingSound: 00-i150.aud
LaunchSound: icbm1.aud LaunchSound: icbm1.aud
MissileWeapon: ClusterMissile MissileWeapon: ClusterMissile
SpawnOffset: 0,427,0 SpawnOffset: 0,427,0

View File

@@ -43,30 +43,12 @@ NAPULS:
gdi: napuls.gdi gdi: napuls.gdi
nod: napuls.nod nod: napuls.nod
ProvidesPrerequisite@gdi: ProvidesPrerequisite@gdi:
Prerequisite: emp.gdi
Factions: gdi
ResetOnOwnerChange: true ResetOnOwnerChange: true
ProvidesPrerequisite@nod: AttackOrderPower:
Prerequisite: emp.nod
Factions: nod
ResetOnOwnerChange: true
AttackOrderPower@nod:
Cursor: emp Cursor: emp
Icon: emp Icon: emp
ChargeTime: 135 ChargeTime: 135
Description: E.M. Pulse Description: E.M. Pulse
LongDesc: Fires a pulse blast which disables\nall mechanical units in the area. LongDesc: Fires a pulse blast which disables\nall mechanical units in the area.
EndChargeSound: speech-nod|00-i158.aud EndChargeSpeechNotification: EmPulseCannonReady
SelectTargetSound: speech-nod|00-i042.aud SelectTargetSpeechNotification: SelectTarget
Prerequisites: emp.nod
OrderName: Nodemp
AttackOrderPower@gdi:
Cursor: emp
Icon: emp
ChargeTime: 135
Description: E.M. Pulse
LongDesc: Fires a pulse blast which disables\nall mechanical units in the area.
EndChargeSound: speech-gdi|00-i158.aud
SelectTargetSound: speech-gdi|00-i042.aud
Prerequisites: emp.gdi
OrderName: GDIemp