add CloakInfo.UncloakOnMove option
This commit is contained in:
@@ -23,6 +23,7 @@ namespace OpenRA.Mods.RA
|
||||
public string CloakSound = "subshow1.aud";
|
||||
public string UncloakSound = "subshow1.aud";
|
||||
public readonly string Palette = "cloak";
|
||||
public readonly bool UncloakOnMove = false;
|
||||
|
||||
public object Create(ActorInitializer init) { return new Cloak(init.self, this); }
|
||||
}
|
||||
@@ -34,6 +35,7 @@ namespace OpenRA.Mods.RA
|
||||
|
||||
Actor self;
|
||||
CloakInfo info;
|
||||
CPos? lastPos;
|
||||
|
||||
public Cloak(Actor self, CloakInfo info)
|
||||
{
|
||||
@@ -83,6 +85,12 @@ namespace OpenRA.Mods.RA
|
||||
Sound.Play(info.CloakSound, self.CenterLocation);
|
||||
if (self.IsDisabled())
|
||||
Uncloak();
|
||||
|
||||
if (info.UncloakOnMove && (lastPos == null || lastPos.Value != self.Location))
|
||||
{
|
||||
Uncloak();
|
||||
lastPos = self.Location;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsVisible(Actor self)
|
||||
|
||||
Reference in New Issue
Block a user