Expose a parameter for reveal behaviour.

VisibilityType.CenterPosition reveals the actor
only if its CenterPosition is inside a cell that
is visible.

VisibilityType.Footprint reveals the actor if any
of its footprint cells are visible (this includes
Mobile actors moving between two cells).
This commit is contained in:
Paul Chote
2015-06-14 09:48:03 +01:00
parent 27f492b793
commit 7053e59acb
2 changed files with 18 additions and 12 deletions

View File

@@ -28,10 +28,11 @@ namespace OpenRA.Mods.Common.Traits
protected override bool IsVisibleInner(Actor self, Player byPlayer)
{
if (!VisibilityFootprint(self).Any(byPlayer.Shroud.IsVisible))
return false;
if (Info.Type == VisibilityType.Footprint)
return self.OccupiesSpace.OccupiedCells()
.Any(o => byPlayer.Shroud.IsVisible(o.First));
return base.IsVisibleInner(self, byPlayer);
return byPlayer.Shroud.IsVisible(self.CenterPosition);
}
}
}