Cloaked units (not) on radar; untested but is simple enough that it should work

This commit is contained in:
Paul Chote
2010-07-22 20:33:54 +12:00
parent a09a6997b4
commit 53304b3de2

View File

@@ -24,7 +24,7 @@ namespace OpenRA.Traits
public object Create(ActorInitializer init) { return new Cloak(init.self); }
}
public class Cloak : IRenderModifier, INotifyAttack, ITick, INotifyDamage
public class Cloak : IRenderModifier, INotifyAttack, ITick, INotifyDamage, IRadarVisibilityModifier
{
[Sync]
int remainingTime;
@@ -78,6 +78,12 @@ namespace OpenRA.Traits
public bool Cloaked { get { return remainingTime > 0; } }
public bool VisibleOnRadar(Actor self)
{
return !Cloaked || self.Owner == self.World.LocalPlayer;
}
public void Decloak(int time)
{
DoSurface();