Add EnemyWatcher trait to D2k and AnnounceOnSeen to D2k units and sandworms; remove sandworm announcement on worm spawn
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,4 +50,7 @@ SANDWORM:
|
||||
Weapon: WormJaw
|
||||
Sandworm:
|
||||
WanderMoveRadius: 5
|
||||
IgnoresCloak:
|
||||
IgnoresCloak:
|
||||
AnnounceOnSeen:
|
||||
Notification: WormSign
|
||||
PingRadar: True
|
||||
@@ -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
|
||||
|
||||
@@ -72,4 +72,4 @@ Player:
|
||||
ProvidesTechPrerequisite@all:
|
||||
Name: Unrestricted
|
||||
Prerequisites: techlevel.low, techlevel.medium, techlevel.high, techlevel.superweapons
|
||||
|
||||
EnemyWatcher:
|
||||
|
||||
Reference in New Issue
Block a user