add INotifyOtherCaptured, for reacting to other units changing ownership
This commit is contained in:
@@ -61,6 +61,7 @@ namespace OpenRA.Traits
|
|||||||
public interface INotifyBuildComplete { void BuildingComplete(Actor self); }
|
public interface INotifyBuildComplete { void BuildingComplete(Actor self); }
|
||||||
public interface INotifyProduction { void UnitProduced(Actor self, Actor other, int2 exit); }
|
public interface INotifyProduction { void UnitProduced(Actor self, Actor other, int2 exit); }
|
||||||
public interface INotifyCapture { void OnCapture(Actor self, Actor captor, Player oldOwner, Player newOwner); }
|
public interface INotifyCapture { void OnCapture(Actor self, Actor captor, Player oldOwner, Player newOwner); }
|
||||||
|
public interface INotifyOtherCaptured { void OnActorCaptured(Actor self, Actor captured, Actor captor, Player oldOwner, Player newOwner); }
|
||||||
public interface IAcceptSpy { void OnInfiltrate(Actor self, Actor spy); }
|
public interface IAcceptSpy { void OnInfiltrate(Actor self, Actor spy); }
|
||||||
public interface IStoreOre { int Capacity { get; }}
|
public interface IStoreOre { int Capacity { get; }}
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,9 @@ namespace OpenRA.Mods.RA.Activities
|
|||||||
foreach (var t in target.TraitsImplementing<INotifyCapture>())
|
foreach (var t in target.TraitsImplementing<INotifyCapture>())
|
||||||
t.OnCapture(target, self, oldOwner, self.Owner);
|
t.OnCapture(target, self, oldOwner, self.Owner);
|
||||||
|
|
||||||
|
foreach (var t in self.World.Queries.WithTrait<INotifyOtherCaptured>())
|
||||||
|
t.Trait.OnActorCaptured(t.Actor, target, self, oldOwner, self.Owner);
|
||||||
|
|
||||||
self.Destroy();
|
self.Destroy();
|
||||||
});
|
});
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
Reference in New Issue
Block a user