Capture changes - Engis now capture from outside. Added classic (legacy) capturable traits.

This commit is contained in:
Curtis Shmyr
2013-06-11 20:44:06 -06:00
parent d898899de7
commit 6a1b37b5b7
12 changed files with 391 additions and 109 deletions

View File

@@ -29,7 +29,7 @@ namespace OpenRA.Mods.RA
public object Create( ActorInitializer init ) { return new Cargo( init, this ); }
}
public class Cargo : IPips, IIssueOrder, IResolveOrder, IOrderVoice, INotifyKilled
public class Cargo : IPips, IIssueOrder, IResolveOrder, IOrderVoice, INotifyKilled, INotifyCapture
{
readonly Actor self;
readonly CargoInfo info;
@@ -180,6 +180,18 @@ namespace OpenRA.Mods.RA
c.Destroy();
cargo.Clear();
}
public void OnCapture(Actor self, Actor captor, Player oldOwner, Player newOwner)
{
if (cargo == null)
return;
self.World.AddFrameEndTask(w =>
{
foreach (var p in Passengers)
p.Owner = newOwner;
});
}
}
public interface INotifyPassengerEntered { void PassengerEntered(Actor self, Actor passenger); }