diff --git a/OpenRA.Mods.Cnc/Missions/Gdi01Script.cs b/OpenRA.Mods.Cnc/Missions/Gdi01Script.cs index 14ffbc8e68..ea4209702c 100644 --- a/OpenRA.Mods.Cnc/Missions/Gdi01Script.cs +++ b/OpenRA.Mods.Cnc/Missions/Gdi01Script.cs @@ -8,6 +8,7 @@ */ #endregion +using System; using System.Collections.Generic; using System.Linq; using OpenRA.FileFormats; @@ -15,10 +16,11 @@ using OpenRA.Mods.RA; using OpenRA.Mods.RA.Activities; using OpenRA.Mods.RA.Move; using OpenRA.Traits; +using OpenRA.Widgets; namespace OpenRA.Mods.Cnc { - class Gdi01ScriptInfo : TraitInfo, Requires { } + class Gdi01ScriptInfo : TraitInfo, Requires { } class Gdi01Script: IWorldLoaded, ITick { @@ -39,8 +41,6 @@ namespace OpenRA.Mods.Cnc started = true; })); } - - // THIS IS SHIT public void OnVictory(World w) { @@ -48,16 +48,14 @@ namespace OpenRA.Mods.Cnc Sound.PlayToPlayer(Players["GoodGuy"], "accom1.aud"); Players["GoodGuy"].WinState = WinState.Won; - w.WorldActor.CancelActivity(); - w.WorldActor.QueueActivity(new Wait(125)); - w.WorldActor.QueueActivity(new CallFunc( - () => Scripting.Media.PlayFMVFullscreen(w, "consyard.vqa", () => + Action afterFMV = () => { Sound.StopMusic(); - //Game.Disconnect(); - //Widget.CloseWindow(); - //Widget.LoadWidget("MENU_BACKGROUND"); - }))); + Game.Disconnect(); + Widget.ResetAll(); + Game.LoadShellMap(); + }; + Game.RunAfterDelay(5000, () => Scripting.Media.PlayFMVFullscreen(w, "consyard.vqa", afterFMV)); } public void OnLose(World w) @@ -66,16 +64,14 @@ namespace OpenRA.Mods.Cnc Sound.PlayToPlayer(Players["GoodGuy"], "fail1.aud"); Players["GoodGuy"].WinState = WinState.Lost; - w.WorldActor.CancelActivity(); - w.WorldActor.QueueActivity(new Wait(125)); - w.WorldActor.QueueActivity(new CallFunc( - () => Scripting.Media.PlayFMVFullscreen(w, "gameover.vqa", () => + Action afterFMV = () => { Sound.StopMusic(); - //Game.Disconnect(); - //Widget.CloseWindow(); - //Widget.LoadWidget("MENU_BACKGROUND"); - }))); + Game.Disconnect(); + Widget.ResetAll(); + Game.LoadShellMap(); + }; + Game.RunAfterDelay(5000, () => Scripting.Media.PlayFMVFullscreen(w, "gameover.vqa", afterFMV)); } int ticks = 0; @@ -111,7 +107,8 @@ namespace OpenRA.Mods.Cnc } // GoodGuy win conditions // BadGuy is dead - var badcount = self.World.Actors.Count(a => a.Owner == Players["BadGuy"] && !a.IsDead()); + var badcount = self.World.Actors.Count(a => a != a.Owner.PlayerActor && + a.Owner == Players["BadGuy"] && !a.IsDead()); if (badcount != lastBadCount) { Game.Debug("{0} badguys remain".F(badcount)); @@ -121,9 +118,10 @@ namespace OpenRA.Mods.Cnc OnVictory(self.World); } - //GoodGuy lose conditions - var goodCount = self.World.Actors.Count(a => a.Owner == Players["GoodGuy"] && !a.IsDead()); - if (goodCount == 0) + //GoodGuy lose conditions: MCV/cyard must survive + var hasAnything = self.World.ActorsWithTrait() + .Any( a => a.Actor.Owner == Players["GoodGuy"] ); + if (!hasAnything) OnLose(self.World); // GoodGuy reinforcements diff --git a/OpenRA.Mods.RA/ConquestVictoryConditions.cs b/OpenRA.Mods.RA/ConquestVictoryConditions.cs index feabe66a4e..84b5d9a6eb 100644 --- a/OpenRA.Mods.RA/ConquestVictoryConditions.cs +++ b/OpenRA.Mods.RA/ConquestVictoryConditions.cs @@ -84,6 +84,6 @@ namespace OpenRA.Mods.RA /* tag trait for things that must be destroyed for a short game to end */ - class MustBeDestroyedInfo : TraitInfo { } - class MustBeDestroyed { } + public class MustBeDestroyedInfo : TraitInfo { } + public class MustBeDestroyed { } } diff --git a/mods/cnc/chrome/ingame.yaml b/mods/cnc/chrome/ingame.yaml index e14f9ae4d4..7c47126c51 100644 --- a/mods/cnc/chrome/ingame.yaml +++ b/mods/cnc/chrome/ingame.yaml @@ -141,4 +141,16 @@ Container@INGAME_ROOT: Height:30 Image:repair Description:Repair - LongDesc:Repair damaged buildings \ No newline at end of file + LongDesc:Repair damaged buildings +Background@FMVPLAYER: + Id:FMVPLAYER + Width:WINDOW_RIGHT + Height:WINDOW_BOTTOM + Background:dialog4 + Children: + VqaPlayer: + Id:PLAYER + X:0 + Y:0 + Width:WINDOW_RIGHT + Height:WINDOW_BOTTOM \ No newline at end of file diff --git a/mods/cnc/maps/gdi01/map.yaml b/mods/cnc/maps/gdi01/map.yaml index 368228303b..5f6936e186 100644 --- a/mods/cnc/maps/gdi01/map.yaml +++ b/mods/cnc/maps/gdi01/map.yaml @@ -4,9 +4,9 @@ MapFormat: 5 RequiresMod: cnc -Title: Gdi 01 +Title: Storm the Beachhead -Description: Describe your map here +Description: Remake of the first GDI Mission Author: Westwood Studios @@ -321,7 +321,7 @@ Actors: Health: 0.1875 Facing: 160 ActorStance: None - Actor86: mcv + mcv: mcv Location: 56,53 Owner: GoodGuy Health: 1 @@ -431,31 +431,31 @@ Actors: Facing: 96 ActorStance: Hunt SubCell: 4 - spawn27: mpspawn + spawn27: waypoint Location: 51,47 Owner: Neutral - nod0: mpspawn + nod0: waypoint Location: 36,39 Owner: Neutral - nod1: mpspawn + nod1: waypoint Location: 37,46 Owner: Neutral - nod2: mpspawn + nod2: waypoint Location: 38,55 Owner: Neutral - nod3: mpspawn + nod3: waypoint Location: 52,52 Owner: Neutral - gunboatRight: mpspawn + gunboatRight: waypoint Location: 61,59 Owner: Neutral - gunboatLeft: mpspawn + gunboatLeft: waypoint Location: 35,59 Owner: Neutral - lstStart: mpspawn + lstStart: waypoint Location: 54,61 Owner: Neutral - lstEnd: mpspawn + lstEnd: waypoint Location: 54,56 Owner: Neutral @@ -469,8 +469,6 @@ Rules: Gdi01Script: Player: -ConquestVictoryConditions: - PROC.proxy: - -Buildable: SILO: -Buildable: WEAP: