Using support power can uncloak actor
This commit is contained in:
@@ -31,7 +31,8 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
Damage = 32,
|
Damage = 32,
|
||||||
Heal = 64,
|
Heal = 64,
|
||||||
SelfHeal = 128,
|
SelfHeal = 128,
|
||||||
Dock = 256
|
Dock = 256,
|
||||||
|
SupportPower = 512,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Type tag for DetectionTypes
|
// Type tag for DetectionTypes
|
||||||
@@ -46,8 +47,9 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
[Desc("Measured in game ticks.")]
|
[Desc("Measured in game ticks.")]
|
||||||
public readonly int CloakDelay = 30;
|
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, SelfHeal and SupportPower.",
|
||||||
"'Dock' is triggered when docking to a refinery or resupplying.")]
|
"'Dock' is triggered when docking to a refinery or resupplying.",
|
||||||
|
"'SupportPower' is triggered when using a support power.")]
|
||||||
public readonly UncloakType UncloakOn = UncloakType.Attack
|
public readonly UncloakType UncloakOn = UncloakType.Attack
|
||||||
| UncloakType.Unload | UncloakType.Infiltrate | UncloakType.Demolish | UncloakType.Dock;
|
| UncloakType.Unload | UncloakType.Infiltrate | UncloakType.Demolish | UncloakType.Dock;
|
||||||
|
|
||||||
@@ -92,7 +94,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
}
|
}
|
||||||
|
|
||||||
public class Cloak : PausableConditionalTrait<CloakInfo>, IRenderModifier, INotifyDamage, INotifyUnload, INotifyDemolition, INotifyInfiltration,
|
public class Cloak : PausableConditionalTrait<CloakInfo>, IRenderModifier, INotifyDamage, INotifyUnload, INotifyDemolition, INotifyInfiltration,
|
||||||
INotifyAttack, ITick, IVisibilityModifier, IRadarColorModifier, INotifyCreated, INotifyDockClient
|
INotifyAttack, ITick, IVisibilityModifier, IRadarColorModifier, INotifyCreated, INotifyDockClient, INotifySupportPower
|
||||||
{
|
{
|
||||||
[Sync]
|
[Sync]
|
||||||
int remainingTime;
|
int remainingTime;
|
||||||
@@ -302,5 +304,13 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (Info.UncloakOn.HasFlag(UncloakType.Infiltrate))
|
if (Info.UncloakOn.HasFlag(UncloakType.Infiltrate))
|
||||||
Uncloak();
|
Uncloak();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void INotifySupportPower.Charged(Actor self) { return; }
|
||||||
|
|
||||||
|
void INotifySupportPower.Activated(Actor self)
|
||||||
|
{
|
||||||
|
if (Info.UncloakOn.HasFlag(UncloakType.SupportPower))
|
||||||
|
Uncloak();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user