Make Shroud object- instead of actor-based

This commit is contained in:
reaperrr
2016-10-23 20:09:52 +02:00
parent 6eade2dd3f
commit 0aefd87485
3 changed files with 31 additions and 50 deletions

View File

@@ -20,7 +20,13 @@ namespace OpenRA.Mods.Common.Traits
{
public RevealsShroud(Actor self, RevealsShroudInfo info)
: base(self, info) { }
protected override void AddCellsToPlayerShroud(Actor self, Player p, PPos[] uv) { p.Shroud.AddProjectedVisibility(self, uv); }
protected override void RemoveCellsFromPlayerShroud(Actor self, Player p) { p.Shroud.RemoveVisibility(self); }
protected override void AddCellsToPlayerShroud(Actor self, Player p, PPos[] uv)
{
if (self.Owner.IsAlliedWith(p))
p.Shroud.AddProjectedVisibility(this, uv);
}
protected override void RemoveCellsFromPlayerShroud(Actor self, Player p) { p.Shroud.RemoveVisibility(this); }
}
}