From 0ff3c56d4fde8daf5156d069e9b3c898924007ec Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Mon, 24 Sep 2012 20:34:54 +1200 Subject: [PATCH] add Chronoshiftable:ExplodeInstead option --- OpenRA.Mods.RA/Chronoshiftable.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.RA/Chronoshiftable.cs b/OpenRA.Mods.RA/Chronoshiftable.cs index 90de1a7e56..9cb43f8406 100755 --- a/OpenRA.Mods.RA/Chronoshiftable.cs +++ b/OpenRA.Mods.RA/Chronoshiftable.cs @@ -13,7 +13,10 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { - class ChronoshiftableInfo : TraitInfo { } + class ChronoshiftableInfo : TraitInfo + { + public readonly bool ExplodeInstead = false; + } public class Chronoshiftable : ITick, ISync { @@ -51,6 +54,17 @@ namespace OpenRA.Mods.RA public virtual bool Teleport(Actor self, CPos targetLocation, int duration, bool killCargo, Actor chronosphere) { + var info = self.Info.Traits.Get(); + if (info.ExplodeInstead) // some things appear chronoshiftable, but instead they just die. + { + self.World.AddFrameEndTask(w => + { + // damage is inflicted by the chronosphere + if (!self.Destroyed) self.InflictDamage(chronosphere, int.MaxValue, null); + }); + return true; + } + /// Set up return-to-sender info chronoshiftOrigin = self.Location; chronoshiftReturnTicks = duration;