Sync superweapon activate animation
This commit is contained in:
@@ -154,5 +154,10 @@ namespace OpenRa.Game
|
||||
{
|
||||
return new Order("CancelProduction", subject.PlayerActor, null, int2.Zero, item);
|
||||
}
|
||||
|
||||
public static Order PlayAnimation(Actor actor, string animationString)
|
||||
{
|
||||
return new Order("PlayAnimation", actor, null, int2.Zero, animationString);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,14 +19,14 @@ namespace OpenRa.Game.SupportPowers
|
||||
|
||||
Sound.Play("chrono2.aud");
|
||||
|
||||
foreach (var a in Game.world.Actors.Where(a => a.traits.Contains<ChronoshiftPaletteEffect>()))
|
||||
a.traits.Get<ChronoshiftPaletteEffect>().DoChronoshift();
|
||||
|
||||
// Play chronosphere active anim
|
||||
var chronosphere = Game.world.Actors.Where(a => a.Owner == p.Owner && a.traits.Contains<Chronosphere>()).FirstOrDefault();
|
||||
|
||||
if (chronosphere != null)
|
||||
chronosphere.traits.Get<RenderBuilding>().PlayCustomAnim(chronosphere, "active");
|
||||
Game.controller.AddOrder(Order.PlayAnimation(chronosphere, "active"));
|
||||
|
||||
// Trigger screen desaturate effect
|
||||
foreach (var a in Game.world.Actors.Where(a => a.traits.Contains<ChronoshiftPaletteEffect>()))
|
||||
a.traits.Get<ChronoshiftPaletteEffect>().DoChronoshift();
|
||||
}
|
||||
SupportPower p;
|
||||
public void Activate(SupportPower p)
|
||||
|
||||
@@ -29,7 +29,8 @@ namespace OpenRa.Game.SupportPowers
|
||||
.Where(a => a.Owner == p.Owner && a.traits.Contains<IronCurtain>())
|
||||
.FirstOrDefault();
|
||||
if (ironCurtain != null)
|
||||
ironCurtain.traits.Get<RenderBuilding>().PlayCustomAnim(ironCurtain, "active");
|
||||
Game.controller.AddOrder(Order.PlayAnimation(ironCurtain, "active"));
|
||||
|
||||
}
|
||||
SupportPower p;
|
||||
public void Activate(SupportPower p)
|
||||
|
||||
@@ -5,8 +5,18 @@ using System.Text;
|
||||
|
||||
namespace OpenRa.Game.Traits
|
||||
{
|
||||
class Chronosphere
|
||||
class Chronosphere : IResolveOrder
|
||||
{
|
||||
public Chronosphere(Actor self) { }
|
||||
|
||||
public void ResolveOrder(Actor self, Order order)
|
||||
{
|
||||
if (order.OrderString == "PlayAnimation")
|
||||
{
|
||||
var rb = self.traits.Get<RenderBuilding>();
|
||||
if (rb != null)
|
||||
rb.PlayCustomAnim(self, order.TargetString);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,8 +5,18 @@ using System.Text;
|
||||
|
||||
namespace OpenRa.Game.Traits
|
||||
{
|
||||
class IronCurtain
|
||||
class IronCurtain : IResolveOrder
|
||||
{
|
||||
public IronCurtain(Actor self) {}
|
||||
|
||||
public void ResolveOrder(Actor self, Order order)
|
||||
{
|
||||
if (order.OrderString == "PlayAnimation")
|
||||
{
|
||||
var rb = self.traits.Get<RenderBuilding>();
|
||||
if (rb != null)
|
||||
rb.PlayCustomAnim(self, order.TargetString);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user