diff --git a/OpenRA.Game/GameRules/VoiceInfo.cs b/OpenRA.Game/GameRules/VoiceInfo.cs index a3526d1cbe..536df3e783 100644 --- a/OpenRA.Game/GameRules/VoiceInfo.cs +++ b/OpenRA.Game/GameRules/VoiceInfo.cs @@ -21,7 +21,6 @@ namespace OpenRA.GameRules public readonly string[] Move = { }; public readonly string[] Attack = null; public readonly string[] Die = { }; - public readonly string[] Lost = { }; public readonly Lazy> Pools; @@ -36,7 +35,6 @@ namespace OpenRA.GameRules { "Move", new VoicePool(Move) }, { "Attack", new VoicePool( Attack ?? Move ) }, { "Die", new VoicePool(Die) }, - { "Lost", new VoicePool(Lost) }, }); } } diff --git a/OpenRA.Game/Traits/Unit.cs b/OpenRA.Game/Traits/Unit.cs index 8f7b3042f1..86b116cc2a 100755 --- a/OpenRA.Game/Traits/Unit.cs +++ b/OpenRA.Game/Traits/Unit.cs @@ -19,15 +19,8 @@ namespace OpenRA.Traits public object Create( ActorInitializer init ) { return new Unit(); } } - public class Unit : INotifyDamage, IRadarSignature - { - public void Damaged(Actor self, AttackInfo e) - { - if (e.DamageState == DamageState.Dead) - if (self.Owner == self.World.LocalPlayer) - Sound.PlayVoice("Lost", self); - } - + public class Unit : IRadarSignature + { public IEnumerable RadarSignatureCells(Actor self) { yield return self.Location; diff --git a/OpenRA.Mods.RA/ActorLostNotification.cs b/OpenRA.Mods.RA/ActorLostNotification.cs new file mode 100644 index 0000000000..704ab5cae1 --- /dev/null +++ b/OpenRA.Mods.RA/ActorLostNotification.cs @@ -0,0 +1,41 @@ +#region Copyright & License Information +/* + * Copyright 2007-2010 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation. For more information, + * see LICENSE. + */ +#endregion + +using OpenRA.Traits; +namespace OpenRA.Mods.RA +{ + class ActorLostNotificationInfo : ITraitInfo + { + public readonly string Notification = null; + public readonly bool NotifyAll = false; + + public object Create(ActorInitializer init) { return new ActorLostNotification(this); } + } + + class ActorLostNotification : INotifyDamage + { + ActorLostNotificationInfo Info; + public ActorLostNotification(ActorLostNotificationInfo info) + { + Info = info; + } + + public void Damaged(Actor self, AttackInfo e) + { + if (e.DamageState == DamageState.Dead) + { + var player = (Info.NotifyAll) ? self.World.LocalPlayer : self.Owner; + Sound.PlayToPlayer(player, Info.Notification); + } + } + + } +} + diff --git a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj index 593d331470..cda2724e98 100644 --- a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj +++ b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj @@ -232,6 +232,7 @@ + diff --git a/mods/cnc/civilian.yaml b/mods/cnc/civilian.yaml index 1d3a7ebbce..ddf850c6a1 100644 --- a/mods/cnc/civilian.yaml +++ b/mods/cnc/civilian.yaml @@ -192,3 +192,52 @@ BRIDGE4: Building: Footprint: ______ ______ ______ ______ Dimensions: 6,4 + +C1: + Inherits: ^CivInfantry + Selectable: + Voice: CivilianMaleVoice + Bounds: 12,17,0,-9 + + +C2: + Inherits: ^CivInfantry + Selectable: + Voice: CivilianFemaleVoice + Bounds: 12,17,0,-9 +C3: + Inherits: ^CivInfantry + +C4: + Inherits: ^CivInfantry + Selectable: + Voice: CivilianFemaleVoice + Bounds: 12,17,0,-9 + +C5: + Inherits: ^CivInfantry + +C6: + Inherits: ^CivInfantry + Selectable: + Voice: CivilianFemaleVoice + Bounds: 12,17,0,-9 + +C7: + Inherits: ^CivInfantry + +C8: + Inherits: ^CivInfantry + Selectable: + Voice: CivilianFemaleVoice + Bounds: 12,17,0,-9 + +C9: + Inherits: ^CivInfantry + +C10: + Inherits: ^CivInfantry + Selectable: + Voice: CivilianFemaleVoice + Bounds: 12,17,0,-9 + \ No newline at end of file diff --git a/mods/cnc/defaults.yaml b/mods/cnc/defaults.yaml index 8fe7c66312..aae6ed7790 100644 --- a/mods/cnc/defaults.yaml +++ b/mods/cnc/defaults.yaml @@ -18,6 +18,8 @@ GainsExperience: GivesExperience: DrawLineToTarget: + ActorLostNotification: + Notification: unitlost.aud ^Tank: Category: Vehicle @@ -39,6 +41,8 @@ GainsExperience: GivesExperience: DrawLineToTarget: + ActorLostNotification: + Notification: unitlost.aud ^Helicopter: Category: Plane @@ -54,6 +58,8 @@ TerrainTypes: Clear, Rough, Road, Tree, Water, Rock, Wall, Ore, Beach, River TerrainSpeeds: 100%, 100%, 100%, 100%, 100%, 100%, 100%, 100%, 100%, 100% DrawLineToTarget: + ActorLostNotification: + Notification: unitlost.aud ^Infantry: Category: Infantry @@ -79,6 +85,29 @@ GivesExperience: # SharesCell: DrawLineToTarget: + ActorLostNotification: + Notification: unitlost.aud + +^CivInfantry: + Inherits: ^Infantry + Selectable: + Voice: CivilianMaleVoice + Bounds: 12,17,0,-9 + Valued: + Cost: 70 + Description: Civilian + Unit: + Mobile: + Speed: 4 + Health: + HP: 20 + RevealsShroud: + Range: 2 + AttackBase: + PrimaryWeapon: Pistol +# ActorLostNotification: +# Notification: civdead1.aud +# NotifyAll: true ^Plane: Category: Plane @@ -91,6 +120,8 @@ GainsExperience: GivesExperience: DrawLineToTarget: + ActorLostNotification: + Notification: unitlost.aud ^Building: Category: Building @@ -118,6 +149,8 @@ CaptureNotification@NOD: Race: nod Notification: nodcapt1.aud + ActorLostNotification: + Notification: strclost.aud ^CivBuilding: Inherits: ^Building diff --git a/mods/cnc/infantry.yaml b/mods/cnc/infantry.yaml index 470d2d38c9..82cc3df16d 100644 --- a/mods/cnc/infantry.yaml +++ b/mods/cnc/infantry.yaml @@ -163,183 +163,4 @@ RMBO: PrimaryWeapon: Sniper TakeCover: C4Demolition: - C4Delay: .03 - -C1: - Inherits: ^Infantry - Selectable: - Voice: CivilianMaleVoice - Bounds: 12,17,0,-9 - Valued: - Cost: 70 - Description: Technician - Unit: - Mobile: - Speed: 4 - Health: - HP: 20 - RevealsShroud: - Range: 2 - AttackBase: - PrimaryWeapon: Pistol - -C2: - Inherits: ^Infantry - Selectable: - Voice: CivilianFemaleVoice - Bounds: 12,17,0,-9 - Valued: - Cost: 70 - Description: Technician - Unit: - Mobile: - Speed: 4 - Health: - HP: 20 - RevealsShroud: - Range: 2 - AttackBase: - PrimaryWeapon: Pistol - -C3: - Inherits: ^Infantry - Selectable: - Voice: CivilianMaleVoice - Bounds: 12,17,0,-9 - Valued: - Cost: 70 - Description: Technician - Unit: - Mobile: - Speed: 4 - Health: - HP: 20 - RevealsShroud: - Range: 2 - AttackBase: - PrimaryWeapon: Pistol - -C4: - Inherits: ^Infantry - Selectable: - Voice: CivilianFemaleVoice - Bounds: 12,17,0,-9 - Valued: - Cost: 70 - Description: Technician - Unit: - Mobile: - Speed: 4 - Health: - HP: 20 - RevealsShroud: - Range: 2 - AttackBase: - PrimaryWeapon: Pistol - -C5: - Inherits: ^Infantry - Selectable: - Voice: CivilianMaleVoice - Bounds: 12,17,0,-9 - Valued: - Cost: 70 - Description: Technician - Unit: - Mobile: - Speed: 4 - Health: - HP: 20 - RevealsShroud: - Range: 2 - AttackBase: - PrimaryWeapon: Pistol - -C6: - Inherits: ^Infantry - Selectable: - Voice: CivilianMaleVoice - Bounds: 12,17,0,-9 - Valued: - Cost: 70 - Description: Technician - Unit: - Mobile: - Speed: 4 - Health: - HP: 20 - RevealsShroud: - Range: 2 - AttackBase: - PrimaryWeapon: Pistol - -C7: - Inherits: ^Infantry - Selectable: - Voice: CivilianMaleVoice - Bounds: 12,17,0,-9 - Valued: - Cost: 70 - Description: Technician - Unit: - Mobile: - Speed: 4 - Health: - HP: 20 - RevealsShroud: - Range: 2 - AttackBase: - PrimaryWeapon: Pistol -C8: - Inherits: ^Infantry - Selectable: - Voice: CivilianMaleVoice - Bounds: 12,17,0,-9 - Valued: - Cost: 70 - Description: Technician - Unit: - Mobile: - Speed: 4 - Health: - HP: 20 - RevealsShroud: - Range: 2 - AttackBase: - PrimaryWeapon: Pistol - -C9: - Inherits: ^Infantry - Selectable: - Voice: CivilianMaleVoice - Bounds: 12,17,0,-9 - Valued: - Cost: 70 - Description: Technician - Unit: - Mobile: - Speed: 4 - Health: - HP: 20 - RevealsShroud: - Range: 2 - AttackBase: - PrimaryWeapon: Pistol - -C10: - Inherits: ^Infantry - Selectable: - Voice: CivilianMaleVoice - Bounds: 12,17,0,-9 - Valued: - Cost: 70 - Description: Technician - Unit: - Mobile: - Speed: 4 - Health: - HP: 20 - RevealsShroud: - Range: 2 - AttackBase: - PrimaryWeapon: Pistol + C4Delay: .03 \ No newline at end of file diff --git a/mods/cnc/voices.yaml b/mods/cnc/voices.yaml index 452dea964a..4b65d5a408 100644 --- a/mods/cnc/voices.yaml +++ b/mods/cnc/voices.yaml @@ -4,14 +4,12 @@ GenericVoice: Select: await1,ready,report1,yessir1 Move: ackno,affirm1,noprob,ritaway,roger,ugotit Die: nuyell1.aud,nuyell3.aud,nuyell4.aud,nuyell5.aud - Lost: unitlost.aud VehicleVoice: SovietVariants: .v00,.v02 AlliedVariants: .v00,.v02 Select: vehic1,yessir1,report1,await1,unit1 Move: ackno,affirm1,movout1 - Lost: unitlost.aud CivilianMaleVoice: Select: guyyeah1 diff --git a/mods/ra/defaults.yaml b/mods/ra/defaults.yaml index 6d6ee7bda5..16857fbd39 100644 --- a/mods/ra/defaults.yaml +++ b/mods/ra/defaults.yaml @@ -18,6 +18,8 @@ GainsExperience: GivesExperience: DrawLineToTarget: + ActorLostNotification: + Notification: unitlst1.aud ^Tank: Category: Vehicle @@ -39,6 +41,8 @@ GainsExperience: GivesExperience: DrawLineToTarget: + ActorLostNotification: + Notification: unitlst1.aud ^Infantry: Category: Infantry @@ -63,6 +67,8 @@ GainsExperience: GivesExperience: DrawLineToTarget: + ActorLostNotification: + Notification: unitlst1.aud ^Ship: Category: Ship @@ -79,6 +85,8 @@ GainsExperience: GivesExperience: DrawLineToTarget: + ActorLostNotification: + Notification: navylst1.aud ^Plane: Category: Plane @@ -91,6 +99,8 @@ GainsExperience: GivesExperience: DrawLineToTarget: + ActorLostNotification: + Notification: aunitl1.aud ^Building: Category: Building @@ -110,6 +120,7 @@ FrozenUnderFog: CaptureNotification: Notification: strucap1.aud + ^Wall: Category: Building Building: diff --git a/mods/ra/voices.yaml b/mods/ra/voices.yaml index 4f1850ab92..f3cb8ce2a3 100644 --- a/mods/ra/voices.yaml +++ b/mods/ra/voices.yaml @@ -6,81 +6,68 @@ GenericVoice: Select: await1,ready,report1,yessir1 Move: ackno,affirm1,noprob,overout,ritaway,roger,ugotit Die: dedman1.aud,dedman2.aud,dedman3.aud,dedman4.aud,dedman5.aud,dedman6.aud,dedman7.aud,dedman8.aud,dedman10.aud - Lost: unitlst1.aud VehicleVoice: SovietVariants: .r00,.r02 AlliedVariants: .v00,.v02 Select: vehic1,yessir1,report1,await1 Move: ackno,affirm1 - Lost: unitlst1.aud ShipVoice: SovietVariants: .r00,.r02 AlliedVariants: .v00,.v02 Select: vehic1,yessir1,report1,await1 Move: ackno,affirm1 - Lost: navylst1.aud EngineerVoice: Select: eengin1,eyessir1 Move: eaffirm1,emovout1 Die: dedman1,dedman2,dedman3,dedman4,dedman5,dedman6,dedman7,dedman8,dedman10 - Lost: unitlst1.aud MedicVoice: Select: mrespon1,myessir1 Move: maffirm1,mmovout1 Die: dedman1,dedman2,dedman3,dedman4,dedman5,dedman6,dedman7,dedman8,dedman10 - Lost: unitlst1.aud TanyaVoice: Select: yo1,yes1,yeah1 Move: rokroll1,onit1,cmon1 Attack: tuffguy1,bombit1,gotit1 Die: tandeth1 - Lost: unitlst1.aud DogVoice: Select: Move: dogy1 Attack: dogg5p,dogw3px Die: dogw5,dogw6,dogw7 - Lost: unitlst1.aud SpyVoice: Select: syessir1,scomnd1 Move: sonway1,sindeed1 Attack: sking1 Die: dedman1,dedman2,dedman3,dedman4,dedman5,dedman6,dedman7,dedman8,dedman10 - Lost: unitlst1.aud ThiefVoice: Select: swhat1,syeah1 Move: saffirm1,smout1,sokay1 Die: dedman1,dedman2,dedman3,dedman4,dedman5,dedman6,dedman7,dedman8,dedman10 - Lost: unitlst1.aud CivilianMaleVoice: Select: guyyeah1 Move: guyokay1 Die: dedman1,dedman2,dedman3,dedman4,dedman5,dedman6,dedman7,dedman8,dedman10 - Lost: unitlst1.aud CivilianFemaleVoice: Select: girlyeah Move: girlokay Die: dedman1,dedman2,dedman3,dedman4,dedman5,dedman6,dedman7,dedman8,dedman10 - Lost: unitlst1.aud EinsteinVoice: Select: einah1,einok1,einyes1 Move: einah1,einok1,einyes1 Die: dedman1,dedman2,dedman3,dedman4,dedman5,dedman6,dedman7,dedman8,dedman10 - Lost: unitlst1.aud ShokVoice: Select: jchrge1,jjuice1,jjump1,jpower1 Move: jdance1,jyes1 Attack: jburn1,jcrisp1,jshock1,jlight1 - Lost: unitlst1.aud \ No newline at end of file