Fix Chronoshift / Demotruck interaction
This commit is contained in:
@@ -48,20 +48,24 @@ namespace OpenRa.Traits
|
||||
|
||||
var chronosphere = self.World.Actors.Where(a => a.Owner == self.Owner
|
||||
&& a.traits.Contains<Chronosphere>()).FirstOrDefault();
|
||||
if (chronosphere != null)
|
||||
chronosphere.traits.Get<RenderBuilding>().PlayCustomAnim( chronosphere, "active" );
|
||||
|
||||
// Trigger screen desaturate effect
|
||||
foreach (var a in self.World.Actors.Where(a => a.traits.Contains<ChronoshiftPaletteEffect>()))
|
||||
a.traits.Get<ChronoshiftPaletteEffect>().DoChronoshift();
|
||||
|
||||
Sound.Play("chrono2.aud");
|
||||
|
||||
order.TargetActor.traits.Get<Chronoshiftable>().Activate(order.TargetActor,
|
||||
|
||||
bool success = order.TargetActor.traits.Get<Chronoshiftable>().Activate(order.TargetActor,
|
||||
order.TargetLocation,
|
||||
(int)((Info as ChronoshiftPowerInfo).Duration * 25 * 60),
|
||||
(Info as ChronoshiftPowerInfo).KillCargo,
|
||||
chronosphere);
|
||||
|
||||
if (success)
|
||||
{
|
||||
Sound.Play("chrono2.aud");
|
||||
|
||||
// Trigger screen desaturate effect
|
||||
foreach (var a in self.World.Actors.Where(a => a.traits.Contains<ChronoshiftPaletteEffect>()))
|
||||
a.traits.Get<ChronoshiftPaletteEffect>().DoChronoshift();
|
||||
|
||||
if (chronosphere != null)
|
||||
chronosphere.traits.Get<RenderBuilding>().PlayCustomAnim(chronosphere, "active");
|
||||
}
|
||||
|
||||
Game.controller.CancelInputMode();
|
||||
FinishActivate();
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace OpenRa.Traits
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void Activate(Actor self, int2 targetLocation, int duration, bool killCargo, Actor chronosphere)
|
||||
public virtual bool Activate(Actor self, int2 targetLocation, int duration, bool killCargo, Actor chronosphere)
|
||||
{
|
||||
/// Set up return-to-sender info
|
||||
chronoshiftOrigin = self.Location;
|
||||
@@ -57,6 +57,8 @@ namespace OpenRa.Traits
|
||||
// Set up the teleport
|
||||
self.CancelActivity();
|
||||
self.QueueActivity(new Activities.Teleport(targetLocation));
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user