Add RevealGeneratedShroud toggle to NukePower

To give modders a choice.
This commit is contained in:
reaperrr
2016-12-05 21:49:47 +01:00
parent e582ba759f
commit f6924d740e

View File

@@ -57,6 +57,9 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Range of cells the camera should reveal around target cell.")]
public readonly WDist CameraRange = WDist.Zero;
[Desc("Can the camera reveal shroud generated by the GeneratesShroud trait?")]
public readonly bool RevealGeneratedShroud = true;
[Desc("Reveal cells to players with these stances only.")]
public readonly Stance CameraStances = Stance.Ally;
@@ -118,7 +121,10 @@ namespace OpenRA.Mods.Common.Traits
if (info.CameraRange != WDist.Zero)
{
self.World.AddFrameEndTask(w => w.Add(new RevealShroudEffect(targetPosition, info.CameraRange, Shroud.SourceType.Visibility, self.Owner, info.CameraStances,
var type = info.RevealGeneratedShroud ? Shroud.SourceType.Visibility
: Shroud.SourceType.PassiveVisibility;
self.World.AddFrameEndTask(w => w.Add(new RevealShroudEffect(targetPosition, info.CameraRange, type, self.Owner, info.CameraStances,
info.FlightDelay - info.CameraSpawnAdvance, info.CameraSpawnAdvance + info.CameraRemoveDelay)));
}