Change "Cannot deploy here" to a notification.
This commit is contained in:
@@ -22,6 +22,7 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
public CVec Offset = CVec.Zero;
|
public CVec Offset = CVec.Zero;
|
||||||
public int Facing = 96;
|
public int Facing = 96;
|
||||||
public string[] Sounds = { };
|
public string[] Sounds = { };
|
||||||
|
public string Notification = null;
|
||||||
public int ForceHealthPercentage = 0;
|
public int ForceHealthPercentage = 0;
|
||||||
public bool SkipMakeAnims = false;
|
public bool SkipMakeAnims = false;
|
||||||
public string Race = null;
|
public string Race = null;
|
||||||
@@ -51,6 +52,8 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
foreach (var s in Sounds)
|
foreach (var s in Sounds)
|
||||||
Sound.PlayToPlayer(self.Owner, s, self.CenterPosition);
|
Sound.PlayToPlayer(self.Owner, s, self.CenterPosition);
|
||||||
|
|
||||||
|
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Notification, self.Owner.Country.Race);
|
||||||
|
|
||||||
var init = new TypeDictionary
|
var init = new TypeDictionary
|
||||||
{
|
{
|
||||||
new LocationInit(self.Location + Offset),
|
new LocationInit(self.Location + Offset),
|
||||||
|
|||||||
@@ -24,6 +24,12 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
public readonly string[] TransformSounds = { };
|
public readonly string[] TransformSounds = { };
|
||||||
public readonly string[] NoTransformSounds = { };
|
public readonly string[] NoTransformSounds = { };
|
||||||
|
|
||||||
|
[Desc("Notification to play when transforming.")]
|
||||||
|
public readonly string TransformNotification = null;
|
||||||
|
|
||||||
|
[Desc("Notification to play when the transformation is blocked.")]
|
||||||
|
public readonly string NoTransformNotification = null;
|
||||||
|
|
||||||
public virtual object Create(ActorInitializer init) { return new Transforms(init, this); }
|
public virtual object Create(ActorInitializer init) { return new Transforms(init, this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,6 +84,8 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
foreach (var s in info.NoTransformSounds)
|
foreach (var s in info.NoTransformSounds)
|
||||||
Sound.PlayToPlayer(self.Owner, s);
|
Sound.PlayToPlayer(self.Owner, s);
|
||||||
|
|
||||||
|
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.NoTransformNotification, self.Owner.Country.Race);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,7 +98,15 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
foreach (var nt in self.TraitsImplementing<INotifyTransform>())
|
foreach (var nt in self.TraitsImplementing<INotifyTransform>())
|
||||||
nt.BeforeTransform(self);
|
nt.BeforeTransform(self);
|
||||||
|
|
||||||
var transform = new Transform(self, info.IntoActor) { Offset = info.Offset, Facing = info.Facing, Sounds = info.TransformSounds, Race = race };
|
var transform = new Transform(self, info.IntoActor)
|
||||||
|
{
|
||||||
|
Offset = info.Offset,
|
||||||
|
Facing = info.Facing,
|
||||||
|
Sounds = info.TransformSounds,
|
||||||
|
Notification = info.TransformNotification,
|
||||||
|
Race = race
|
||||||
|
};
|
||||||
|
|
||||||
var makeAnimation = self.TraitOrDefault<WithMakeAnimation>();
|
var makeAnimation = self.TraitOrDefault<WithMakeAnimation>();
|
||||||
if (makeAnimation != null)
|
if (makeAnimation != null)
|
||||||
makeAnimation.Reverse(self, transform);
|
makeAnimation.Reverse(self, transform);
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ MCV:
|
|||||||
Offset: -1,-1
|
Offset: -1,-1
|
||||||
Facing: 108
|
Facing: 108
|
||||||
TransformSounds: constru2.aud, hvydoor1.aud
|
TransformSounds: constru2.aud, hvydoor1.aud
|
||||||
NoTransformSounds: deploy1.aud
|
NoTransformNotification: BuildingCannotPlaceAudio
|
||||||
RenderUnit:
|
RenderUnit:
|
||||||
MustBeDestroyed:
|
MustBeDestroyed:
|
||||||
RequiredForShortGame: true
|
RequiredForShortGame: true
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ Speech:
|
|||||||
WormAttack: WATTK
|
WormAttack: WATTK
|
||||||
EnemyUnitsApproaching: ENEMY
|
EnemyUnitsApproaching: ENEMY
|
||||||
UnitRepaired: GANEW
|
UnitRepaired: GANEW
|
||||||
|
CannotDeploy: DPLOY
|
||||||
|
|
||||||
Sounds:
|
Sounds:
|
||||||
DefaultVariant: .WAV
|
DefaultVariant: .WAV
|
||||||
|
|||||||
@@ -104,10 +104,7 @@ MCVA:
|
|||||||
Buildable:
|
Buildable:
|
||||||
Prerequisites: ~heavya, repair
|
Prerequisites: ~heavya, repair
|
||||||
Transforms:
|
Transforms:
|
||||||
Facing: 16
|
|
||||||
IntoActor: conyarda
|
IntoActor: conyarda
|
||||||
Offset: -1,-1
|
|
||||||
NoTransformSounds: AI_DPLOY.AUD
|
|
||||||
RenderUnit:
|
RenderUnit:
|
||||||
Image: DMCV
|
Image: DMCV
|
||||||
|
|
||||||
|
|||||||
@@ -107,10 +107,7 @@ MCVH:
|
|||||||
Buildable:
|
Buildable:
|
||||||
Prerequisites: ~heavyh, repair
|
Prerequisites: ~heavyh, repair
|
||||||
Transforms:
|
Transforms:
|
||||||
Facing: 16
|
|
||||||
IntoActor: conyardh
|
IntoActor: conyardh
|
||||||
Offset: -1,-1
|
|
||||||
NoTransformSounds: HI_DPLOY.AUD
|
|
||||||
RenderUnit:
|
RenderUnit:
|
||||||
Image: DMCV
|
Image: DMCV
|
||||||
|
|
||||||
|
|||||||
@@ -100,10 +100,7 @@ MCVO:
|
|||||||
Buildable:
|
Buildable:
|
||||||
Prerequisites: ~heavyo, repair
|
Prerequisites: ~heavyo, repair
|
||||||
Transforms:
|
Transforms:
|
||||||
Facing: 16
|
|
||||||
IntoActor: conyardo
|
IntoActor: conyardo
|
||||||
Offset: -1,-1
|
|
||||||
NoTransformSounds: OI_DPLOY.AUD
|
|
||||||
RenderUnit:
|
RenderUnit:
|
||||||
Image: DMCV
|
Image: DMCV
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,10 @@
|
|||||||
Weapon: UnitExplodeScale
|
Weapon: UnitExplodeScale
|
||||||
EmptyWeapon: UnitExplodeScale
|
EmptyWeapon: UnitExplodeScale
|
||||||
Transforms:
|
Transforms:
|
||||||
|
Facing: 16
|
||||||
|
Offset: -1,-1
|
||||||
TransformSounds: BUILD1.WAV
|
TransformSounds: BUILD1.WAV
|
||||||
|
NoTransformNotification: CannotDeploy
|
||||||
LeavesHusk:
|
LeavesHusk:
|
||||||
HuskActor: MCV.Husk
|
HuskActor: MCV.Husk
|
||||||
AttractsWorms:
|
AttractsWorms:
|
||||||
|
|||||||
@@ -308,7 +308,7 @@ MCV:
|
|||||||
Offset: -1,-1
|
Offset: -1,-1
|
||||||
Facing: 96
|
Facing: 96
|
||||||
TransformSounds: placbldg.aud, build5.aud
|
TransformSounds: placbldg.aud, build5.aud
|
||||||
NoTransformSounds: nodeply1.aud
|
NoTransformNotification: BuildingCannotPlaceAudio
|
||||||
RenderUnit:
|
RenderUnit:
|
||||||
MustBeDestroyed:
|
MustBeDestroyed:
|
||||||
RequiredForShortGame: true
|
RequiredForShortGame: true
|
||||||
|
|||||||
Reference in New Issue
Block a user