unit-lost sounds through voice

This commit is contained in:
Chris Forbes
2010-07-20 17:39:35 +12:00
parent cb44844639
commit 2684284c27
4 changed files with 35 additions and 6 deletions

View File

@@ -21,6 +21,7 @@ namespace OpenRA.GameRules
public readonly string[] Move = { }; public readonly string[] Move = { };
public readonly string[] Attack = null; public readonly string[] Attack = null;
public readonly string[] Die = { }; public readonly string[] Die = { };
public readonly string[] Lost = { };
public readonly Lazy<Dictionary<string, VoicePool>> Pools; public readonly Lazy<Dictionary<string, VoicePool>> Pools;
@@ -35,6 +36,7 @@ namespace OpenRA.GameRules
{ "Move", new VoicePool(Move) }, { "Move", new VoicePool(Move) },
{ "Attack", new VoicePool( Attack ?? Move ) }, { "Attack", new VoicePool( Attack ?? Move ) },
{ "Die", new VoicePool(Die) }, { "Die", new VoicePool(Die) },
{ "Lost", new VoicePool(Lost) },
}); });
} }
} }

View File

@@ -16,7 +16,7 @@ namespace OpenRA.Traits
public readonly int ROT = 255; public readonly int ROT = 255;
public readonly int Speed = 1; public readonly int Speed = 1;
public object Create( ActorInitializer init ) { return new Unit( init.self ); } public object Create( ActorInitializer init ) { return new Unit(); }
} }
public class Unit : INotifyDamage public class Unit : INotifyDamage
@@ -26,14 +26,11 @@ namespace OpenRA.Traits
[Sync] [Sync]
public int Altitude; public int Altitude;
public Unit(Actor self) { }
public void Damaged(Actor self, AttackInfo e) public void Damaged(Actor self, AttackInfo e)
{ {
var eva = self.World.WorldActor.Info.Traits.Get<EvaAlertsInfo>(); var eva = self.World.WorldActor.Info.Traits.Get<EvaAlertsInfo>();
if (e.DamageState == DamageState.Dead) if (e.DamageState == DamageState.Dead)
Sound.PlayToPlayer(self.Owner, Sound.PlayVoice("Lost", self);
self.Info.Traits.Get<OwnedActorInfo>().WaterBound ? eva.NavalUnitLost : eva.UnitLost);
} }
} }
} }

View File

@@ -389,6 +389,8 @@ SS:
Chronoshiftable: Chronoshiftable:
IronCurtainable: IronCurtainable:
RepairableNear: RepairableNear:
Selectable:
Voice: ShipVoice
MSUB: MSUB:
Inherits: ^Ship Inherits: ^Ship
@@ -419,6 +421,8 @@ MSUB:
Chronoshiftable: Chronoshiftable:
IronCurtainable: IronCurtainable:
RepairableNear: RepairableNear:
Selectable:
Voice: ShipVoice
DD: DD:
Inherits: ^Ship Inherits: ^Ship
@@ -448,6 +452,8 @@ DD:
Chronoshiftable: Chronoshiftable:
IronCurtainable: IronCurtainable:
RepairableNear: RepairableNear:
Selectable:
Voice: ShipVoice
CA: CA:
Inherits: ^Ship Inherits: ^Ship
@@ -481,6 +487,8 @@ CA:
Chronoshiftable: Chronoshiftable:
IronCurtainable: IronCurtainable:
RepairableNear: RepairableNear:
Selectable:
Voice: ShipVoice
LST: LST:
Inherits: ^Ship Inherits: ^Ship
@@ -503,6 +511,8 @@ LST:
Passengers: 5 Passengers: 5
IronCurtainable: IronCurtainable:
RepairableNear: RepairableNear:
Selectable:
Voice: ShipVoice
PT: PT:
Inherits: ^Ship Inherits: ^Ship
@@ -532,6 +542,8 @@ PT:
Chronoshiftable: Chronoshiftable:
IronCurtainable: IronCurtainable:
RepairableNear: RepairableNear:
Selectable:
Voice: ShipVoice
MIG: MIG:
Inherits: ^Plane Inherits: ^Plane

View File

@@ -6,57 +6,75 @@ GenericVoice:
Select: await1,ready,report1,yessir1 Select: await1,ready,report1,yessir1
Move: ackno,affirm1,noprob,overout,ritaway,roger,ugotit 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 Die: dedman1.aud,dedman2.aud,dedman3.aud,dedman4.aud,dedman5.aud,dedman6.aud,dedman7.aud,dedman8.aud,dedman10.aud
Lost: unitlst1.aud
VehicleVoice: VehicleVoice:
SovietVariants: .r00,.r02 SovietVariants: .r00,.r02
AlliedVariants: .v00,.v02 AlliedVariants: .v00,.v02
Select: vehic1,yessir1,report1,await1 Select: vehic1,yessir1,report1,await1
Move: ackno,affirm1 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: EngineerVoice:
Select: eengin1,eyessir1 Select: eengin1,eyessir1
Move: eaffirm1,emovout1 Move: eaffirm1,emovout1
Die: dedman1,dedman2,dedman3,dedman4,dedman5,dedman6,dedman7,dedman8,dedman10 Die: dedman1,dedman2,dedman3,dedman4,dedman5,dedman6,dedman7,dedman8,dedman10
Lost: unitlst1.aud
MedicVoice: MedicVoice:
Select: mrespon1,myessir1 Select: mrespon1,myessir1
Move: maffirm1,mmovout1 Move: maffirm1,mmovout1
Die: dedman1,dedman2,dedman3,dedman4,dedman5,dedman6,dedman7,dedman8,dedman10 Die: dedman1,dedman2,dedman3,dedman4,dedman5,dedman6,dedman7,dedman8,dedman10
Lost: unitlst1.aud
TanyaVoice: TanyaVoice:
Select: yo1,yes1,yeah1 Select: yo1,yes1,yeah1
Move: rokroll1,onit1,cmon1 Move: rokroll1,onit1,cmon1
Attack: tuffguy1,bombit1,gotit1 Attack: tuffguy1,bombit1,gotit1
Die: tandeth1 Die: tandeth1
Lost: unitlst1.aud
DogVoice: DogVoice:
Select: Select:
Move: dogy1 Move: dogy1
Attack: dogg5p,dogw3px Attack: dogg5p,dogw3px
Die: dogw5,dogw6,dogw7 Die: dogw5,dogw6,dogw7
Lost: unitlst1.aud
SpyVoice: SpyVoice:
Select: syessir1,scomnd1 Select: syessir1,scomnd1
Move: sonway1,sindeed1 Move: sonway1,sindeed1
Attack: sking1 Attack: sking1
Die: dedman1,dedman2,dedman3,dedman4,dedman5,dedman6,dedman7,dedman8,dedman10 Die: dedman1,dedman2,dedman3,dedman4,dedman5,dedman6,dedman7,dedman8,dedman10
Lost: unitlst1.aud
ThiefVoice: ThiefVoice:
Select: swhat1,syeah1 Select: swhat1,syeah1
Move: saffirm1,smout1,sokay1 Move: saffirm1,smout1,sokay1
Die: dedman1,dedman2,dedman3,dedman4,dedman5,dedman6,dedman7,dedman8,dedman10 Die: dedman1,dedman2,dedman3,dedman4,dedman5,dedman6,dedman7,dedman8,dedman10
Lost: unitlst1.aud
CivilianMaleVoice: CivilianMaleVoice:
Select: guyyeah1 Select: guyyeah1
Move: guyokay1 Move: guyokay1
Die: dedman1,dedman2,dedman3,dedman4,dedman5,dedman6,dedman7,dedman8,dedman10 Die: dedman1,dedman2,dedman3,dedman4,dedman5,dedman6,dedman7,dedman8,dedman10
Lost: unitlst1.aud
CivilianFemaleVoice: CivilianFemaleVoice:
Select: girlyeah Select: girlyeah
Move: girlokay Move: girlokay
Die: dedman1,dedman2,dedman3,dedman4,dedman5,dedman6,dedman7,dedman8,dedman10 Die: dedman1,dedman2,dedman3,dedman4,dedman5,dedman6,dedman7,dedman8,dedman10
Lost: unitlst1.aud
EinsteinVoice: EinsteinVoice:
Select: einah1,einok1,einyes1 Select: einah1,einok1,einyes1
Move: einah1,einok1,einyes1 Move: einah1,einok1,einyes1
Die: dedman1,dedman2,dedman3,dedman4,dedman5,dedman6,dedman7,dedman8,dedman10 Die: dedman1,dedman2,dedman3,dedman4,dedman5,dedman6,dedman7,dedman8,dedman10
Lost: unitlst1.aud