Decloak on demolish and infiltrate
Per issue #7028, infiltrating or demolishing a building will now cause an infantry unit to decloak (if it has a cloak ability). This behaviour is configurable (defaults to true in both cases) using the DecloakOnInfiltrate and DecloakOnDemolish options.
This commit is contained in:
@@ -11,16 +11,22 @@
|
||||
using OpenRA.Activities;
|
||||
using OpenRA.Mods.RA.Buildings;
|
||||
using OpenRA.Traits;
|
||||
using OpenRA.Mods.RA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.RA.Activities
|
||||
{
|
||||
class Infiltrate : Enter
|
||||
{
|
||||
readonly Actor target;
|
||||
|
||||
readonly Cloak cloak;
|
||||
|
||||
public Infiltrate(Actor self, Actor target)
|
||||
: base(self, target)
|
||||
{
|
||||
this.target = target;
|
||||
|
||||
cloak = self.TraitOrDefault<Cloak>();
|
||||
}
|
||||
|
||||
protected override void OnInside(Actor self)
|
||||
@@ -28,6 +34,9 @@ namespace OpenRA.Mods.RA.Activities
|
||||
if (target.IsDead || target.Owner == self.Owner)
|
||||
return;
|
||||
|
||||
if (cloak != null && cloak.Info.UncloakOnInfiltrate)
|
||||
cloak.Uncloak();
|
||||
|
||||
foreach (var t in target.TraitsImplementing<INotifyInfiltrated>())
|
||||
t.Infiltrated(target, self);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user