diff --git a/OpenRA.Mods.Cnc/Missions/Nod01Script.cs b/OpenRA.Mods.Cnc/Missions/Nod01Script.cs index de88d228f9..27b754bc1d 100644 --- a/OpenRA.Mods.Cnc/Missions/Nod01Script.cs +++ b/OpenRA.Mods.Cnc/Missions/Nod01Script.cs @@ -41,7 +41,6 @@ namespace OpenRA.Mods.Cnc.Missions Player gdi; Player nod; - //actors and the likes go here Actor nikoomba; Actor vil01; Actor vil02; @@ -64,17 +63,14 @@ namespace OpenRA.Mods.Cnc.Missions Actor civ06; Actor civ07; - //waypoints Actor nr1; Actor nr2; - Actor gr1; + Actor nr3; World world; - //in the allies01 script stuff was here not needed for me so far - const string NRName = "E1"; - const string GRName = "E2"; - const string GRName2 = "JEEP"; + const string ReInfE1 = "E1"; + const string ReInfE3 = "E3"; void MissionFailed(string text) { @@ -90,7 +86,6 @@ namespace OpenRA.Mods.Cnc.Missions { if (nod.WinState != WinState.Undefined) return; - //spawns nod reinf if (world.FrameNumber == 700) { NODReinforceNthA(); @@ -101,7 +96,7 @@ namespace OpenRA.Mods.Cnc.Missions NODReinforceNthB(); Sound.Play("reinfor1.aud"); } - // objectives + if (killnikoomba.Status == ObjectiveStatus.InProgress) { if (nikoomba.Destroyed) @@ -109,8 +104,8 @@ namespace OpenRA.Mods.Cnc.Missions killnikoomba.Status = ObjectiveStatus.Completed; levelvillage.Status = ObjectiveStatus.InProgress; OnObjectivesUpdated(true); - //DisplayObjective(); - //GDIReinforceNth(); + NODReinforceNWstA(); + Sound.Play("reinfor1.aud"); } } if (levelvillage.Status == ObjectiveStatus.InProgress) @@ -122,41 +117,47 @@ namespace OpenRA.Mods.Cnc.Missions { levelvillage.Status = ObjectiveStatus.Completed; OnObjectivesUpdated(true); + Sound.StopMusic(); MissionAccomplished("Nikoomba was killed and the village was destroyed."); + //does an fmv play at this point? } } - if (!world.Actors.Any(a => (a.Owner == nod) && a.IsInWorld && !a.IsDead())) + if (!world.Actors.Any(a => (a.Owner == nod))) { - MissionFailed("The Nod forces in the area have been wiped out."); + Action afterFMV = () => + { + Sound.StopMusic(); + MissionFailed("The Nod forces in the area have been wiped out."); + }; + Game.RunAfterDelay(0, () => Media.PlayFMVFullscreen(world, "gameover.vqa", afterFMV)); //this is the wrong fmv i believe } } - IEnumerable UnitsNearActor(Actor actor, int range) - { - return world.FindActorsInCircle(actor.CenterPosition, WRange.FromCells(range)) - .Where(a => a.IsInWorld && a != world.WorldActor && !a.Destroyed && a.HasTrait() && !a.Owner.NonCombatant); - } - void NODReinforceNthA() { - nr1 = world.CreateActor(true, NRName, new TypeDictionary { new OwnerInit(nod), new LocationInit(nr1.Location) }); - nr1 = world.CreateActor(true, NRName, new TypeDictionary { new OwnerInit(nod), new LocationInit(nr1.Location) }); + nr1 = world.CreateActor(true, ReInfE1, new TypeDictionary { new OwnerInit(nod), new LocationInit(nr1.Location) }); + nr1.QueueActivity(nr1.Trait().ScriptedMove(nr1.Location - new CVec(0, -2))); + nr1 = world.CreateActor(true, ReInfE1, new TypeDictionary { new OwnerInit(nod), new LocationInit(nr1.Location) }); + nr1.QueueActivity(nr1.Trait().ScriptedMove(nr1.Location - new CVec(0, -2))); } void NODReinforceNthB() { - nr2 = world.CreateActor(true, NRName, new TypeDictionary { new OwnerInit(nod), new LocationInit(nr2.Location) }); - nr2 = world.CreateActor(true, NRName, new TypeDictionary { new OwnerInit(nod), new LocationInit(nr2.Location) }); - //nr1.QueueActivity(new Move.Move(nr1.Location - new CVec(0, 2))); + nr2 = world.CreateActor(true, ReInfE1, new TypeDictionary { new OwnerInit(nod), new LocationInit(nr2.Location) }); + nr2.QueueActivity(nr2.Trait().ScriptedMove(nr2.Location - new CVec(0, -2))); + nr2 = world.CreateActor(true, ReInfE1, new TypeDictionary { new OwnerInit(nod), new LocationInit(nr2.Location) }); + nr2.QueueActivity(nr2.Trait().ScriptedMove(nr2.Location - new CVec(0, -2))); } - void GDIReinforceNth() + void NODReinforceNWstA() { - gr1 = world.CreateActor(true, GRName, new TypeDictionary { new OwnerInit(gdi), new LocationInit(gr1.Location) }); - gr1 = world.CreateActor(true, GRName, new TypeDictionary { new OwnerInit(gdi), new LocationInit(gr1.Location) }); - gr1 = world.CreateActor(true, GRName2, new TypeDictionary { new OwnerInit(gdi), new LocationInit(gr1.Location) }); - //gr1.QueueActivity(new Move.Move(nr1.Location - new CVec(0, 2))); + nr3 = world.CreateActor(true, ReInfE3, new TypeDictionary { new OwnerInit(nod), new LocationInit(nr3.Location) }); + nr3.QueueActivity(nr3.Trait().ScriptedMove(nr3.Location - new CVec(0, -5))); + nr3 = world.CreateActor(true, ReInfE3, new TypeDictionary { new OwnerInit(nod), new LocationInit(nr3.Location) }); + nr3.QueueActivity(nr3.Trait().ScriptedMove(nr3.Location - new CVec(0, -5))); + nr3 = world.CreateActor(true, ReInfE3, new TypeDictionary { new OwnerInit(nod), new LocationInit(nr3.Location) }); + nr3.QueueActivity(nr3.Trait().ScriptedMove(nr3.Location - new CVec(0, -5))); } public void WorldLoaded(World w) @@ -164,6 +165,7 @@ namespace OpenRA.Mods.Cnc.Missions world = w; gdi = w.Players.Single(p => p.InternalName == "GDI"); nod = w.Players.Single(p => p.InternalName == "NOD"); + nod.PlayerActor.Trait().Cash = 0; var actors = w.WorldActor.Trait().Actors; nikoomba = actors["Nikoomba"]; vil01 = actors["Vil01"]; @@ -188,11 +190,11 @@ namespace OpenRA.Mods.Cnc.Missions civ07 = actors["Civ07"]; nr1 = actors["NODReinforceNthA"]; nr2 = actors["NODReinforceNthB"]; - gr1 = actors["GDIReinforceNth"]; + nr3 = actors["NODReinforceNWstA"]; Game.MoveViewport(nr1.Location.ToFloat2()); Action afterFMV = () => { - Sound.PlayMusic(Rules.Music["aoi"]); + MissionUtils.PlayMissionMusic(); }; Game.RunAfterDelay(0, () => Media.PlayFMVFullscreen(w, "nod1pre.vqa", () => Media.PlayFMVFullscreen(w, "nod1.vqa", afterFMV))); diff --git a/mods/cnc/maps/nod01/map.yaml b/mods/cnc/maps/nod01/map.yaml index ec171cb53b..9c0e8c69ac 100644 --- a/mods/cnc/maps/nod01/map.yaml +++ b/mods/cnc/maps/nod01/map.yaml @@ -266,13 +266,13 @@ Actors: Location: 54,16 Owner: NOD NODReinforceNthA: waypoint - Location: 52,18 + Location: 52,14 + Owner: NOD + NODReinforceNWstA: waypoint + Location: 24,14 Owner: NOD - GDIReinforceNth: waypoint - Location: 24,15 - Owner: GDI NODReinforceNthB: waypoint - Location: 55,18 + Location: 56,14 Owner: NOD Actor27: jeep Location: 31,28