Exemple #1
0
 public void OnCapture(Actor self, Actor captor, Player oldOwner, Player newOwner)
 {
     var facing = self.TraitOrDefault<IFacing>();
     var transform = new Transform(self, Info.IntoActor) { ForceHealthPercentage = Info.ForceHealthPercentage };
     if (facing != null) transform.Facing = facing.Facing;
     transform.SkipMakeAnims = Info.SkipMakeAnims;
     self.CancelActivity();
     self.QueueActivity(transform);
 }
        void MaybeTransform(Actor self, Actor passenger, string transformTo)
        {
            if (info.PassengerTypes.Contains(passenger.Info.Name) && transformTo != null)
            {
                self.World.AddFrameEndTask( w =>
                {
                    var facing = self.TraitOrDefault<IFacing>();
                    var transform = new Transform(self, transformTo) { SkipMakeAnims = info.SkipMakeAnims };
                    if (facing != null) transform.Facing = facing.Facing;

                    self.CancelActivity();
                    self.QueueActivity(transform);
                    if (info.BecomeNeutral) self.ChangeOwner(self.World.WorldActor.Owner);
                });
            }
        }