fixed #2289 - missing chrono effects on return

This commit is contained in:
Chris Forbes
2012-07-01 14:21:43 +12:00
parent 0a4669b925
commit 5fee165692
4 changed files with 11 additions and 24 deletions

View File

@@ -10,6 +10,7 @@
using System.Linq;
using OpenRA.Traits;
using OpenRA.Mods.RA.Render;
namespace OpenRA.Mods.RA.Activities
{
@@ -28,6 +29,9 @@ namespace OpenRA.Mods.RA.Activities
public override Activity Tick(Actor self)
{
Sound.Play("chrono2.aud", self.Location.ToPPos());
Sound.Play("chrono2.aud", destination.ToPPos());
self.Trait<ITeleportable>().SetPosition(self, destination);
if (killCargo && self.HasTrait<Cargo>())
@@ -42,6 +46,13 @@ namespace OpenRA.Mods.RA.Activities
}
}
// Trigger screen desaturate effect
foreach (var a in self.World.ActorsWithTrait<ChronoshiftPaletteEffect>())
a.Trait.Enable();
if (chronosphere != null && !chronosphere.Destroyed && chronosphere.HasTrait<RenderBuilding>())
chronosphere.Trait<RenderBuilding>().PlayCustomAnim(chronosphere, "active");
return NextActivity;
}
}