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 WormManagerInfo info;
|
||||||
readonly Lazy<Actor[]> spawnPointActors;
|
readonly Lazy<Actor[]> spawnPointActors;
|
||||||
readonly Lazy<RadarPings> radarPings;
|
|
||||||
|
|
||||||
int spawnCountdown;
|
int spawnCountdown;
|
||||||
int wormsPresent;
|
int wormsPresent;
|
||||||
@@ -51,7 +50,6 @@ namespace OpenRA.Mods.D2k.Traits
|
|||||||
public WormManager(Actor self, WormManagerInfo info)
|
public WormManager(Actor self, WormManagerInfo info)
|
||||||
{
|
{
|
||||||
this.info = info;
|
this.info = info;
|
||||||
radarPings = Exts.Lazy(() => self.World.WorldActor.Trait<RadarPings>());
|
|
||||||
spawnPointActors = Exts.Lazy(() => self.World.ActorsWithTrait<WormSpawner>().Select(x => x.Actor).ToArray());
|
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.
|
// more we need to reach the defined minimum count.
|
||||||
wormLocations.Add(SpawnWorm(self));
|
wormLocations.Add(SpawnWorm(self));
|
||||||
} while (wormsPresent < info.Minimum);
|
} while (wormsPresent < info.Minimum);
|
||||||
|
|
||||||
AnnounceWormSign(self, wormLocations);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WPos SpawnWorm(Actor self)
|
WPos SpawnWorm(Actor self)
|
||||||
@@ -107,17 +103,5 @@ namespace OpenRA.Mods.D2k.Traits
|
|||||||
{
|
{
|
||||||
wormsPresent--;
|
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
|
Weapon: WormJaw
|
||||||
Sandworm:
|
Sandworm:
|
||||||
WanderMoveRadius: 5
|
WanderMoveRadius: 5
|
||||||
IgnoresCloak:
|
IgnoresCloak:
|
||||||
|
AnnounceOnSeen:
|
||||||
|
Notification: WormSign
|
||||||
|
PingRadar: True
|
||||||
@@ -50,6 +50,8 @@
|
|||||||
UpgradeManager:
|
UpgradeManager:
|
||||||
TemporaryOwnerManager:
|
TemporaryOwnerManager:
|
||||||
MustBeDestroyed:
|
MustBeDestroyed:
|
||||||
|
AnnounceOnSeen:
|
||||||
|
Notification: EnemyUnitsApproaching
|
||||||
|
|
||||||
^Tank:
|
^Tank:
|
||||||
AppearsOnRadar:
|
AppearsOnRadar:
|
||||||
@@ -103,6 +105,8 @@
|
|||||||
UpgradeManager:
|
UpgradeManager:
|
||||||
TemporaryOwnerManager:
|
TemporaryOwnerManager:
|
||||||
MustBeDestroyed:
|
MustBeDestroyed:
|
||||||
|
AnnounceOnSeen:
|
||||||
|
Notification: EnemyUnitsApproaching
|
||||||
|
|
||||||
^Husk:
|
^Husk:
|
||||||
Health:
|
Health:
|
||||||
@@ -230,6 +234,8 @@
|
|||||||
UpgradeMinEnabledLevel: 1
|
UpgradeMinEnabledLevel: 1
|
||||||
UpgradeManager:
|
UpgradeManager:
|
||||||
MustBeDestroyed:
|
MustBeDestroyed:
|
||||||
|
AnnounceOnSeen:
|
||||||
|
Notification: EnemyUnitsApproaching
|
||||||
|
|
||||||
^Plane:
|
^Plane:
|
||||||
AppearsOnRadar:
|
AppearsOnRadar:
|
||||||
@@ -263,6 +269,8 @@
|
|||||||
UpgradeTypes: selfheal
|
UpgradeTypes: selfheal
|
||||||
UpgradeMinEnabledLevel: 1
|
UpgradeMinEnabledLevel: 1
|
||||||
UpgradeManager:
|
UpgradeManager:
|
||||||
|
AnnounceOnSeen:
|
||||||
|
Notification: EnemyUnitsApproaching
|
||||||
|
|
||||||
^Helicopter:
|
^Helicopter:
|
||||||
Inherits: ^Plane
|
Inherits: ^Plane
|
||||||
|
|||||||
@@ -72,4 +72,4 @@ Player:
|
|||||||
ProvidesTechPrerequisite@all:
|
ProvidesTechPrerequisite@all:
|
||||||
Name: Unrestricted
|
Name: Unrestricted
|
||||||
Prerequisites: techlevel.low, techlevel.medium, techlevel.high, techlevel.superweapons
|
Prerequisites: techlevel.low, techlevel.medium, techlevel.high, techlevel.superweapons
|
||||||
|
EnemyWatcher:
|
||||||
|
|||||||
Reference in New Issue
Block a user