Allies share sight
This commit is contained in:
@@ -59,7 +59,7 @@ namespace OpenRA.Traits
|
||||
|
||||
public interface IRadarVisibilityModifier { bool VisibleOnRadar(Actor self); }
|
||||
public interface IRadarColorModifier { Color RadarColorOverride(Actor self); }
|
||||
|
||||
public interface IRevealShroud {}
|
||||
public interface IOccupySpace
|
||||
{
|
||||
int2 TopLeft { get; }
|
||||
|
||||
@@ -14,6 +14,7 @@ using System.Drawing;
|
||||
using System.Linq;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.GameRules;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Traits
|
||||
{
|
||||
@@ -63,7 +64,14 @@ namespace OpenRA.Traits
|
||||
|
||||
void AddActor(Actor a)
|
||||
{
|
||||
if (a.Owner == null || a.Owner != a.Owner.World.LocalPlayer) return;
|
||||
if (a.traits.WithInterface<IRevealShroud>().Count() == 0)
|
||||
return;
|
||||
|
||||
bool shareShroud = true; // Todo: make this a server flag
|
||||
|
||||
if (a.Owner == null || a.Owner.World.LocalPlayer == null
|
||||
|| a.Owner.Stances[a.Owner.World.LocalPlayer] != Stance.Ally) return;
|
||||
if (!shareShroud && a.Owner != a.Owner.World.LocalPlayer) return;
|
||||
|
||||
if (vis.ContainsKey(a))
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace OpenRA.Mods.RA
|
||||
{
|
||||
class RevealsShroudInfo : TraitInfo<RevealsShroud> { }
|
||||
|
||||
class RevealsShroud : ITick
|
||||
class RevealsShroud : ITick, IRevealShroud
|
||||
{
|
||||
int2 previousLocation;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user