Add EVA voices

Use new WaitFor when waiting for Einstein
Have a small delay before the Soviets counterattack
Have the Soviets Attack-Move towards Einstein during the counterattack, this makes them much more damaging
Spawn the signal flare only after Einstein has been spawned, also add EVA voice for this
This commit is contained in:
ScottNZ
2012-06-21 22:53:20 +12:00
parent 0b98a8ce5e
commit 9ff69b7946
2 changed files with 222 additions and 221 deletions

View File

@@ -23,7 +23,7 @@ namespace OpenRA.Mods.RA.Missions
public class Allies01Script : IWorldLoaded, ITick
{
private string[] objectives =
private static readonly string[] objectives =
{
"Find Einstein.",
"Wait for the helicopter and extract Einstein."
@@ -55,7 +55,7 @@ namespace OpenRA.Mods.RA.Missions
private static readonly string[] ships = { "ca", "ca", "ca", "ca" };
private static readonly string[] attackWave = { "e1", "e1", "e1", "e1", "e2", "e2", "e2", "e2", "dog" };
private int currentAttackWaveFrameNumber = -600;
private int currentAttackWaveFrameNumber;
private int currentAttackWave;
private const int einsteinChinookArrivesAtAttackWave = 5;
@@ -63,6 +63,7 @@ namespace OpenRA.Mods.RA.Missions
private const string einsteinName = "c1";
private const string tanyaName = "e7";
private const string chinookName = "tran";
private const string signalFlareName = "flare";
private void NextObjective()
{
@@ -87,6 +88,7 @@ namespace OpenRA.Mods.RA.Missions
actor.Kill(actor);
}
self.World.LocalShroud.Disabled = true;
Sound.Play("misnlst1.aud", 5);
}
private void MissionAccomplished(Actor self, string text)
@@ -98,6 +100,7 @@ namespace OpenRA.Mods.RA.Missions
allies.WinState = WinState.Won;
Game.AddChatLine(Color.Blue, "Mission accomplished", text);
self.World.LocalShroud.Disabled = true;
Sound.Play("misnwon1.aud", 5);
}
public void Tick(Actor self)
@@ -126,11 +129,14 @@ namespace OpenRA.Mods.RA.Missions
{
if (AlliesControlLab(self))
{
SpawnSignalFlare(self);
Sound.Play("flaren1.aud", 5);
SpawnEinsteinAtLab(self); // spawn Einstein once the area is clear
Sound.Play("einok1.aud"); // "Incredible!" - Einstein
SendShips(self);
NextObjective();
DisplayObjective();
currentAttackWaveFrameNumber = self.World.FrameNumber;
}
if (lab.Destroyed)
{
@@ -141,25 +147,19 @@ namespace OpenRA.Mods.RA.Missions
{
if (self.World.FrameNumber >= currentAttackWaveFrameNumber + 600)
{
Sound.Play("enmyapp1.aud", 5);
SendAttackWave(self, attackWave);
currentAttackWave++;
currentAttackWaveFrameNumber = self.World.FrameNumber;
if (currentAttackWave == einsteinChinookArrivesAtAttackWave)
{
FlyToExtractionLZ(self);
FlyEinsteinFromExtractionLZ(self);
}
}
if (einsteinChinook != null)
{
if (einsteinChinook.Trait<Cargo>().Passengers.Contains(einstein))
{
FlyEinsteinFromExtractionLZ();
}
if (!self.World.Map.IsInMap(einsteinChinook.Location) && !einstein.IsInWorld)
if (einsteinChinook != null && !self.World.Map.IsInMap(einsteinChinook.Location) && !einstein.IsInWorld)
{
MissionAccomplished(self, "Einstein was rescued.");
}
}
if (einstein.Destroyed)
{
MissionFailed(self, "Einstein was killed.");
@@ -171,14 +171,18 @@ namespace OpenRA.Mods.RA.Missions
}
}
private void SpawnSignalFlare(Actor self)
{
self.World.CreateActor(signalFlareName, new TypeDictionary { new OwnerInit(allies), new LocationInit(extractionLZ.Location) });
}
private void SendAttackWave(Actor self, IEnumerable<string> wave)
{
foreach (var unit in wave)
{
var spawnActor = self.World.SharedRandom.Next(2) == 0 ? attackEntryPoint1 : attackEntryPoint2;
var targetActor = self.World.SharedRandom.Next(2) == 0 ? einstein : tanya;
var actor = self.World.CreateActor(unit, new TypeDictionary { new OwnerInit(soviets), new LocationInit(spawnActor.Location) });
actor.QueueActivity(new Attack(Target.FromActor(targetActor), 2));
actor.QueueActivity(new AttackMove.AttackMoveActivity(actor, new Attack(Target.FromActor(einstein), 3))); // better way of doing this?
}
}
@@ -191,7 +195,7 @@ namespace OpenRA.Mods.RA.Missions
private bool AlliesControlLab(Actor self)
{
var units = UnitsNearActor(self, lab, labRange);
return units.Count() >= 1 && units.All(a => a.Owner == allies);
return units.Any() && units.All(a => a.Owner == allies);
}
private void SpawnEinsteinAtLab(Actor self)
@@ -209,19 +213,16 @@ namespace OpenRA.Mods.RA.Missions
}
}
private void FlyEinsteinFromExtractionLZ()
{
einsteinChinook.QueueActivity(new Wait(150));
einsteinChinook.QueueActivity(new HeliFly(chinookExitPoint.CenterLocation));
einsteinChinook.QueueActivity(new RemoveSelf());
}
private void FlyToExtractionLZ(Actor self)
private void FlyEinsteinFromExtractionLZ(Actor self)
{
einsteinChinook = self.World.CreateActor(chinookName, new TypeDictionary { new OwnerInit(allies), new LocationInit(extractionLZEntryPoint.Location) });
einsteinChinook.QueueActivity(new HeliFly(extractionLZ.CenterLocation));
einsteinChinook.QueueActivity(new Turn(0));
einsteinChinook.QueueActivity(new HeliLand(true));
einsteinChinook.QueueActivity(new WaitFor(() => einsteinChinook.Trait<Cargo>().Passengers.Contains(einstein)));
einsteinChinook.QueueActivity(new Wait(150));
einsteinChinook.QueueActivity(new HeliFly(chinookExitPoint.CenterLocation));
einsteinChinook.QueueActivity(new RemoveSelf());
}
private void FlyTanyaToInsertionLZ(Actor self)

Binary file not shown.