diff --git a/OpenRA.Mods.Common/Traits/Guard.cs b/OpenRA.Mods.Common/Traits/Guard.cs index a2e4b7ac5c..2e0c4a30f3 100644 --- a/OpenRA.Mods.Common/Traits/Guard.cs +++ b/OpenRA.Mods.Common/Traits/Guard.cs @@ -19,10 +19,22 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("The player can give this unit the order to follow and protect friendly units with the Guardable trait.")] - public class GuardInfo : TraitInfo { } + public class GuardInfo : ITraitInfo + { + public readonly string Voice = "Move"; + + public object Create(ActorInitializer init) { return new Guard(this); } + } public class Guard : IResolveOrder, IOrderVoice { + readonly GuardInfo info; + + public Guard(GuardInfo info) + { + this.info = info; + } + public void ResolveOrder(Actor self, Order order) { if (order.OrderString == "Guard") @@ -43,7 +55,7 @@ namespace OpenRA.Mods.Common.Traits public string VoicePhraseForOrder(Actor self, Order order) { - return order.OrderString == "Guard" ? "Move" : null; + return order.OrderString == "Guard" ? info.Voice : null; } } diff --git a/mods/d2k/rules/defaults.yaml b/mods/d2k/rules/defaults.yaml index e7477b01b4..d04ccaaedd 100644 --- a/mods/d2k/rules/defaults.yaml +++ b/mods/d2k/rules/defaults.yaml @@ -31,6 +31,7 @@ RepairBuildings: repaira,repairo,repairh CombatDebugOverlay: Guard: + Voice: Guard Guardable: RenderUnit: BodyOrientation: @@ -83,6 +84,7 @@ RepairBuildings: repaira,repairo,repairh CombatDebugOverlay: Guard: + Voice: Guard Guardable: RenderUnit: BodyOrientation: @@ -209,6 +211,7 @@ CloseEnough: 1 CombatDebugOverlay: Guard: + Voice: Guard Guardable: BodyOrientation: UpdatesPlayerStatistics: diff --git a/mods/d2k/voices.yaml b/mods/d2k/voices.yaml index 1f44df603e..320957599c 100644 --- a/mods/d2k/voices.yaml +++ b/mods/d2k/voices.yaml @@ -6,11 +6,17 @@ GenericVoice: atreides: .WAV ordos: .WAV harkonnen: .WAV + Prefixes: + atreides: A + ordos: O + harkonnen: H Voices: Select: G_SSEL1,G_SSEL2,G_SSEL3 Move: G_SCONF1,G_SCONF2,G_SCONF3 Die: KILLGUY1,KILLGUY2,KILLGUY3,KILLGUY4,KILLGUY5,KILLGUY6,KILLGUY7,KILLGUY8,KILLGUY9 - DisableVariants: Select, Move + Guard: I_GUARD + DisablePrefixes: Select, Move, Die + DisableVariants: Select, Move, Guard VehicleVoice: DefaultVariant: .AUD @@ -21,6 +27,7 @@ VehicleVoice: Voices: Select: _VSEL1,_VSEL2,_VSEL3 Move: _VCONF1,_VCONF2,_VCONF3 + Guard: I_GUARD InfantryVoice: DefaultVariant: .AUD @@ -36,8 +43,9 @@ InfantryVoice: Select: _ISEL1,_ISEL2,_ISEL3 Move: _ICONF1,_ICONF2,_ICONF3 Die: KILLGUY1,KILLGUY2,KILLGUY3,KILLGUY4,KILLGUY5,KILLGUY6,KILLGUY7,KILLGUY8,KILLGUY9 + Guard: I_GUARD DisablePrefixes: Die - DisableVariants: Select, Move + DisableVariants: Select, Move, Guard EngineerVoice: DefaultVariant: .AUD @@ -53,8 +61,9 @@ EngineerVoice: Select: _ESEL1,_ESEL2,_ESEL3 Move: _ECONF1,_ECONF2,_ECONF3 Die: KILLGUY1,KILLGUY2,KILLGUY3,KILLGUY4,KILLGUY5,KILLGUY6,KILLGUY7,KILLGUY8,KILLGUY9 + Guard: I_GUARD DisablePrefixes: Die - DisableVariants: Select, Move + DisableVariants: Select, Move, Guard FremenVoice: DefaultVariant: .AUD @@ -62,11 +71,17 @@ FremenVoice: atreides: .WAV ordos: .WAV harkonnen: .WAV + Prefixes: + atreides: A + ordos: O + harkonnen: H Voices: Select: A_FSEL1,A_FSEL2,A_FSEL3 Move: A_FCONF1,A_FCONF2,A_FCONF3 Die: KILLGUY1,KILLGUY2,KILLGUY3,KILLGUY4,KILLGUY5,KILLGUY6,KILLGUY7,KILLGUY8,KILLGUY9 - DisableVariants: Select, Move + Guard: I_GUARD + DisablePrefixes: Select, Move, Die + DisableVariants: Select, Move, Guard SaboteurVoice: DefaultVariant: .AUD @@ -74,11 +89,17 @@ SaboteurVoice: atreides: .WAV ordos: .WAV harkonnen: .WAV + Prefixes: + atreides: A + ordos: O + harkonnen: H Voices: Select: O_SSEL1,O_SSEL2,O_SSEL3 Move: O_SCONF1,O_SCONF2,O_SCONF3 Die: KILLGUY1,KILLGUY2,KILLGUY3,KILLGUY4,KILLGUY5,KILLGUY6,KILLGUY7,KILLGUY8,KILLGUY9 - DisableVariants: Select, Move + Guard: I_GUARD + DisablePrefixes: Select, Move, Die + DisableVariants: Select, Move, Guard WormVoice: DefaultVariant: .WAV