Add KillCargo and FlashScreen to PortableChrono

This commit is contained in:
Jean-Rémy Buchs
2017-05-25 18:11:20 +02:00
committed by abcdefg30
parent 2e7de2874d
commit 2e0d7d0e79

View File

@@ -45,6 +45,12 @@ namespace OpenRA.Mods.Cnc.Traits
[Desc("Cursor to display when the targeted location is blocked.")]
public readonly string TargetBlockedCursor = "move-blocked";
[Desc("Kill cargo on teleporting.")]
public readonly bool KillCargo = true;
[Desc("Flash the screen on teleporting.")]
public readonly bool FlashScreen = false;
[VoiceReference] public readonly string Voice = "Action";
public object Create(ActorInitializer init) { return new PortableChrono(this); }
@@ -93,7 +99,7 @@ namespace OpenRA.Mods.Cnc.Traits
{
var maxDistance = Info.HasDistanceLimit ? Info.MaxDistance : (int?)null;
self.CancelActivity();
self.QueueActivity(new Teleport(self, order.TargetLocation, maxDistance, true, false, Info.ChronoshiftSound));
self.QueueActivity(new Teleport(self, order.TargetLocation, maxDistance, Info.KillCargo, Info.FlashScreen, Info.ChronoshiftSound));
}
}