Uncloak during resupply when "UncloakOn: Dock" is defined
This commit is contained in:
@@ -45,7 +45,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Measured in game ticks.")]
|
||||
public readonly int CloakDelay = 30;
|
||||
|
||||
[Desc("Events leading to the actor getting uncloaked. Possible values are: Attack, Move, Unload, Infiltrate, Demolish, Dock, Damage, Heal and SelfHeal.")]
|
||||
[Desc("Events leading to the actor getting uncloaked. Possible values are: Attack, Move, Unload, Infiltrate, Demolish, Dock, Damage, Heal and SelfHeal.",
|
||||
"'Dock' is triggered when docking to a refinery or resupplying.")]
|
||||
public readonly UncloakType UncloakOn = UncloakType.Attack
|
||||
| UncloakType.Unload | UncloakType.Infiltrate | UncloakType.Demolish | UncloakType.Dock;
|
||||
|
||||
@@ -66,7 +67,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
|
||||
public class Cloak : PausableConditionalTrait<CloakInfo>, IRenderModifier, INotifyDamage, INotifyUnload, INotifyDemolition, INotifyInfiltration,
|
||||
INotifyAttack, ITick, IVisibilityModifier, IRadarColorModifier, INotifyCreated, INotifyHarvesterAction
|
||||
INotifyAttack, ITick, IVisibilityModifier, IRadarColorModifier, INotifyCreated, INotifyHarvesterAction, INotifyBeingResupplied
|
||||
{
|
||||
[Sync]
|
||||
int remainingTime;
|
||||
@@ -246,5 +247,20 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (Info.UncloakOn.HasFlag(UncloakType.Infiltrate))
|
||||
Uncloak();
|
||||
}
|
||||
|
||||
void INotifyBeingResupplied.StartingResupply(Actor self, Actor host)
|
||||
{
|
||||
if (Info.UncloakOn.HasFlag(UncloakType.Dock))
|
||||
{
|
||||
isDocking = true;
|
||||
Uncloak();
|
||||
}
|
||||
}
|
||||
|
||||
void INotifyBeingResupplied.StoppingResupply(Actor self, Actor host)
|
||||
{
|
||||
if (Info.UncloakOn.HasFlag(UncloakType.Dock))
|
||||
isDocking = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user