fix GDI01 FMV problems and gunboat crash

- show video not only the sound
- start the game after video playback
- don't crash after the win/loose movies are played
- don't crash when moving the gunboat
This commit is contained in:
Matthias Mailänder
2013-02-03 14:58:43 +01:00
parent 15032e3a40
commit 6e9ac71168
2 changed files with 21 additions and 19 deletions

View File

@@ -17,8 +17,9 @@ using OpenRA.Mods.RA.Activities;
using OpenRA.Mods.RA.Move;
using OpenRA.Traits;
using OpenRA.Widgets;
using OpenRA.Scripting;
namespace OpenRA.Mods.Cnc
namespace OpenRA.Mods.Cnc.Missions
{
class Gdi01ScriptInfo : TraitInfo<Gdi01Script> { }
@@ -34,40 +35,37 @@ namespace OpenRA.Mods.Cnc
var b = w.Map.Bounds;
Game.MoveViewport(new CPos(b.Left + b.Width/2, b.Top + b.Height/2).ToFloat2());
Scripting.Media.PlayFMVFullscreen(w, "gdi1.vqa",
() => Scripting.Media.PlayFMVFullscreen(w, "landing.vqa", () =>
Action afterFMV = () =>
{
Sound.PlayMusic(Rules.Music["aoi"]);
started = true;
}));
};
Game.RunAfterDelay(0, () => Media.PlayFMVFullscreen(w, "gdi1.vqa", () =>
Media.PlayFMVFullscreen(w, "landing.vqa", afterFMV)));
}
public void OnVictory(World w)
{
started = false;
Sound.PlayToPlayer(Players["GoodGuy"], "accom1.aud");
Players["GoodGuy"].WinState = WinState.Won;
Action afterFMV = () =>
{
Players["GoodGuy"].WinState = WinState.Won;
started = false;
Sound.StopMusic();
Game.Disconnect();
Sound.PlayToPlayer(Players["GoodGuy"], "accom1.aud");
};
Game.RunAfterDelay(5000, () => Scripting.Media.PlayFMVFullscreen(w, "consyard.vqa", afterFMV));
Game.RunAfterDelay(0, () => Media.PlayFMVFullscreen(w, "consyard.vqa", afterFMV));
}
public void OnLose(World w)
{
started = false;
Sound.PlayToPlayer(Players["GoodGuy"], "fail1.aud");
Players["GoodGuy"].WinState = WinState.Lost;
Action afterFMV = () =>
{
Players["GoodGuy"].WinState = WinState.Lost;
started = false;
Sound.StopMusic();
Game.Disconnect();
Sound.PlayToPlayer(Players["GoodGuy"], "fail1.aud");
};
Game.RunAfterDelay(5000, () => Scripting.Media.PlayFMVFullscreen(w, "gameover.vqa", afterFMV));
Game.RunAfterDelay(0, () => Media.PlayFMVFullscreen(w, "gameover.vqa", afterFMV));
}
int ticks = 0;
@@ -168,6 +166,7 @@ namespace OpenRA.Mods.Cnc
{
var self = Actors[ "Gunboat" ];
var mobile = self.Trait<Mobile>();
self.Trait<AutoTarget>().stance = UnitStance.AttackAnything; //TODO: this is ignored
self.QueueActivity(mobile.ScriptedMove(Actors["gunboatLeft"].Location));
self.QueueActivity(mobile.ScriptedMove(Actors["gunboatRight"].Location));
self.QueueActivity(new CallFunc(() => SetGunboatPath()));

View File

@@ -480,6 +480,9 @@ Rules:
-Buildable:
RMBO:
-Buildable:
BOAT:
Mobile:
OnRails: false # workaround a crash
Sequences: