Add EnemyWatcher trait to D2k and AnnounceOnSeen to D2k units and sandworms; remove sandworm announcement on worm spawn

This commit is contained in:
penev92
2015-01-13 17:10:06 +02:00
parent e2832bb3d7
commit a4a8a793df
4 changed files with 13 additions and 18 deletions

View File

@@ -43,7 +43,6 @@ namespace OpenRA.Mods.D2k.Traits
{
readonly WormManagerInfo info;
readonly Lazy<Actor[]> spawnPointActors;
readonly Lazy<RadarPings> radarPings;
int spawnCountdown;
int wormsPresent;
@@ -51,7 +50,6 @@ namespace OpenRA.Mods.D2k.Traits
public WormManager(Actor self, WormManagerInfo info)
{
this.info = info;
radarPings = Exts.Lazy(() => self.World.WorldActor.Trait<RadarPings>());
spawnPointActors = Exts.Lazy(() => self.World.ActorsWithTrait<WormSpawner>().Select(x => x.Actor).ToArray());
}
@@ -80,8 +78,6 @@ namespace OpenRA.Mods.D2k.Traits
// more we need to reach the defined minimum count.
wormLocations.Add(SpawnWorm(self));
} while (wormsPresent < info.Minimum);
AnnounceWormSign(self, wormLocations);
}
WPos SpawnWorm(Actor self)
@@ -107,17 +103,5 @@ namespace OpenRA.Mods.D2k.Traits
{
wormsPresent--;
}
void AnnounceWormSign(Actor self, IEnumerable<WPos> wormLocations)
{
if (self.World.LocalPlayer != null)
Sound.PlayNotification(self.World.Map.Rules, self.World.LocalPlayer, "Speech", info.WormSignNotification, self.World.LocalPlayer.Country.Race);
if (radarPings.Value == null)
return;
foreach (var wormLocation in wormLocations)
radarPings.Value.Add(() => true, wormLocation, Color.Red, 50);
}
}
}

View File

@@ -50,4 +50,7 @@ SANDWORM:
Weapon: WormJaw
Sandworm:
WanderMoveRadius: 5
IgnoresCloak:
IgnoresCloak:
AnnounceOnSeen:
Notification: WormSign
PingRadar: True

View File

@@ -50,6 +50,8 @@
UpgradeManager:
TemporaryOwnerManager:
MustBeDestroyed:
AnnounceOnSeen:
Notification: EnemyUnitsApproaching
^Tank:
AppearsOnRadar:
@@ -103,6 +105,8 @@
UpgradeManager:
TemporaryOwnerManager:
MustBeDestroyed:
AnnounceOnSeen:
Notification: EnemyUnitsApproaching
^Husk:
Health:
@@ -230,6 +234,8 @@
UpgradeMinEnabledLevel: 1
UpgradeManager:
MustBeDestroyed:
AnnounceOnSeen:
Notification: EnemyUnitsApproaching
^Plane:
AppearsOnRadar:
@@ -263,6 +269,8 @@
UpgradeTypes: selfheal
UpgradeMinEnabledLevel: 1
UpgradeManager:
AnnounceOnSeen:
Notification: EnemyUnitsApproaching
^Helicopter:
Inherits: ^Plane

View File

@@ -72,4 +72,4 @@ Player:
ProvidesTechPrerequisite@all:
Name: Unrestricted
Prerequisites: techlevel.low, techlevel.medium, techlevel.high, techlevel.superweapons
EnemyWatcher: