voices now support prefixes

required for d2k
This commit is contained in:
Matthias Mailänder
2012-06-21 15:31:12 +02:00
parent 033dd10192
commit 6bc3249685
7 changed files with 41 additions and 83 deletions

View File

@@ -18,8 +18,10 @@ namespace OpenRA.GameRules
public class VoiceInfo public class VoiceInfo
{ {
[FieldLoader.Ignore] public readonly Dictionary<string,string[]> Variants; [FieldLoader.Ignore] public readonly Dictionary<string,string[]> Variants;
[FieldLoader.Ignore] public readonly Dictionary<string,string[]> Prefixes;
[FieldLoader.Ignore] public readonly Dictionary<string,string[]> Voices; [FieldLoader.Ignore] public readonly Dictionary<string,string[]> Voices;
public readonly string DefaultVariant = ".aud" ; public readonly string DefaultVariant = ".aud" ;
public readonly string DefaultPrefix = "" ;
public readonly string[] DisableVariants = { }; public readonly string[] DisableVariants = { };
static Dictionary<string, string[]> Load( MiniYaml y, string name ) static Dictionary<string, string[]> Load( MiniYaml y, string name )
@@ -37,6 +39,7 @@ namespace OpenRA.GameRules
{ {
FieldLoader.Load( this, y ); FieldLoader.Load( this, y );
Variants = Load(y, "Variants"); Variants = Load(y, "Variants");
Prefixes = Load(y, "Prefixes");
Voices = Load(y, "Voices"); Voices = Load(y, "Voices");
if (!Voices.ContainsKey("Attack")) if (!Voices.ContainsKey("Attack"))

View File

@@ -259,7 +259,9 @@ namespace OpenRA
var variantExt = (vi.Variants.ContainsKey(variant) && !vi.DisableVariants.Contains(phrase)) ? var variantExt = (vi.Variants.ContainsKey(variant) && !vi.DisableVariants.Contains(phrase)) ?
vi.Variants[variant][voicedUnit.ActorID % vi.Variants[variant].Length] : vi.DefaultVariant; vi.Variants[variant][voicedUnit.ActorID % vi.Variants[variant].Length] : vi.DefaultVariant;
Play(clip + variantExt); var prefix = (vi.Prefixes.ContainsKey(variant)) ?
vi.Prefixes[variant][voicedUnit.ActorID % vi.Prefixes[variant].Length] : vi.DefaultPrefix;
Play(prefix + clip + variantExt);
return true; return true;
} }
} }

View File

@@ -13,7 +13,7 @@
ROT: 5 ROT: 5
SelectionDecorations: SelectionDecorations:
Selectable: Selectable:
Voice: GenericVoice Voice: VehicleVoice
TargetableUnit: TargetableUnit:
TargetTypes: Ground TargetTypes: Ground
Passenger: Passenger:
@@ -54,7 +54,7 @@
ROT: 5 ROT: 5
SelectionDecorations: SelectionDecorations:
Selectable: Selectable:
Voice: GenericVoice Voice: VehicleVoice
TargetableUnit: TargetableUnit:
TargetTypes: Ground TargetTypes: Ground
Passenger: Passenger:
@@ -102,7 +102,7 @@
Rough: 60 Rough: 60
SelectionDecorations: SelectionDecorations:
Selectable: Selectable:
Voice: GenericVoice Voice: InfantryVoice
TargetableUnit: TargetableUnit:
TargetTypes: Ground TargetTypes: Ground
RenderInfantry: RenderInfantry:

View File

@@ -202,7 +202,8 @@
-RenderBuilding: -RenderBuilding:
OreRefinery: OreRefinery:
StoresOre: StoresOre:
PipCount: 17 PipColor: Green
PipCount: 20
Capacity: 2000 Capacity: 2000
CustomSellValue: CustomSellValue:
Value: 600 Value: 600
@@ -234,6 +235,7 @@
-RenderBuilding: -RenderBuilding:
RenderBuildingSilo: RenderBuildingSilo:
StoresOre: StoresOre:
PipColor: Green
PipCount: 5 PipCount: 5
Capacity: 1500 Capacity: 1500
-EmitInfantryOnSell: -EmitInfantryOnSell:

View File

@@ -148,7 +148,7 @@ World:
SpriteNames: spice0 SpriteNames: spice0
ValuePerUnit: 35 ValuePerUnit: 35
Name: Spice Name: Spice
PipColor: Yellow PipColor: Green
AllowedTerrainTypes: Sand AllowedTerrainTypes: Sand
AllowUnderActors: false AllowUnderActors: false
SmudgeLayer@CRATER: SmudgeLayer@CRATER:

View File

@@ -908,32 +908,21 @@ deviatortank:
Start: 0 Start: 0
Facings: 32 Facings: 32
#TODO: add Dune 2000 SHPs
pips: pips:
groups: groups:
Start: 8 Start: 8
Length: 10 Length: 10
medic:
Start: 20
ready: ready:
Start: 3 Start: 3
hold: hold:
Start: 4 Start: 4
tag-fake:
Start: 18
tag-primary: tag-primary:
Start: 2 Start: 2
pip-empty: dots pip-empty: dots
Start: 0 Start: 0
pip-green: dots pip-green: dots
Start: 1 Start: 1
pip-yellow: dots
Start: 1
pip-gray: dots
Start: 0
pip-red: dots
Start: 1
pip-blue: dots
Start: 1
clock: clock:
idle: idle:

View File

@@ -1,87 +1,49 @@
# requires Dune 2000/DATA/GAMESFX copied to ~/.openra/Content/d2k # requires Dune 2000/DATA/GAMESFX copied to ~/.openra/Content/d2k
GenericVoice: GenericVoice:
Variants: DefaultVariant: .AUD
atreides: .AUD
harkonnen: .AUD
ordos: .AUD
Voices: Voices:
Select: G_SSEL1,G_SSEL2,G_SSEL3 Select: G_SSEL1,G_SSEL2,G_SSEL3
Move: G_SCONF1,G_SCONF2,G_SCONF3 Move: G_SCONF1,G_SCONF2,G_SCONF3
AtreidesVehicleVoice: VehicleVoice:
Variants: DefaultVariant: .AUD
atreides: .AUD Prefixes:
atreides: A
ordos: O
harkonnen: H
Voices: Voices:
Select: A_VSEL1,A_VSEL2,A_VSEL3 Select: _VSEL1,_VSEL2,_VSEL3
Move: A_VCONF1,A_VCONF2,A_VCONF3 Move: _VCONF1,_VCONF2,_VCONF3
AtreidesInfantryVoice: InfantryVoice:
Variants: DefaultVariant: .AUD
atreides: .AUD Prefixes:
atreides: A
ordos: O
harkonnen: H
Voices: Voices:
Select: A_ISEL1,A_ISEL2,A_ISEL3 Select: _ISEL1,_ISEL2,_ISEL3
Move: A_ICONF1,A_ICONF2,A_ICONF3 Move: _ICONF1,_ICONF2,_ICONF3
AtreidesEngineerVoice: EngineerVoice:
Variants: DefaultVariant: .AUD
atreides: .AUD Prefixes:
atreides: A
ordos: O
harkonnen: H
Voices: Voices:
Select: A_ESEL1,A_ESEL2,A_ESEL3 Select: _ESEL1,_ESEL2,_ESEL3
Move: A_ECONF1,A_ECONF2,A_ECONF3 Move: _ECONF1,_ECONF2,_ECONF3
FremenVoice: FremenVoice:
Variants: DefaultVariant: .AUD
atreides: .AUD
Voices: Voices:
Select: A_FSEL1,A_FSEL2,A_FSEL3 Select: A_FSEL1,A_FSEL2,A_FSEL3
Move: A_FCONF1,A_FCONF2,A_FCONF3 Move: A_FCONF1,A_FCONF2,A_FCONF3
HarkonnenVehicleVoice:
Variants:
harkonnen: .AUD
Voices:
Select: H_VSEL1,H_VSEL2,H_VSEL3
Move: H_VCONF1,H_VCONF2,H_VCONF3
HarkonnenInfantryVoice:
Variants:
harkonnen: .AUD
Voices:
Select: H_ISEL1,H_ISEL2,H_ISEL3
Move: H_ICONF1,H_ICONF2,H_ICONF3
HarkonnenEngineerVoice:
Variants:
harkonnen: .AUD
Voices:
Select: H_ESEL1,H_ESEL2,H_ESEL3
Move: H_ECONF1,H_ECONF2,H_ECONF3
OrdosVehicleVoice:
Variants:
ordos: .AUD
Voices:
Select: O_VSEL1,O_VSEL2,O_VSEL3
Move: O_VCONF1,O_VCONF2,O_VCONF3
OrdosInfantryVoice:
Variants:
ordos: .AUD
Voices:
Select: O_ISEL1,O_ISEL2,O_ISEL3
Move: O_ICONF1,O_ICONF2,O_ICONF3
OrdosEngineerVoice:
Variants:
ordos: .AUD
Voices:
Select: O_ESEL1,O_ESEL2,O_ESEL3
Move: O_ECONF1,O_ECONF2,O_ECONF3
SaboteurVoice: SaboteurVoice:
Variants: DefaultVariant: .AUD
ordos: .AUD
Voices: Voices:
Select: O_SSEL1,O_SSEL2,O_SSEL3 Select: O_SSEL1,O_SSEL2,O_SSEL3
Move: O_SCONF1,O_SCONF2,O_SCONF3 Move: O_SCONF1,O_SCONF2,O_SCONF3