private void DoChargeAttack(LocalTargetInfo t)
 {
     if (t != null && t.Cell.DistanceToEdge(this.Pawn.Map) > 6)
     {
         this.Pawn.rotationTracker.Face(t.CenterVector3);
         // Log.Message("flying to " + t.Cell);
         LongEventHandler.QueueLongEvent(delegate
         {
             FlyingObject_Flight flyingObject = (FlyingObject_Flight)GenSpawn.Spawn(ThingDef.Named("FlyingObject_Flight"), this.Pawn.Position, this.Pawn.Map);
             flyingObject.Launch(this.Pawn, t.Cell, this.Pawn);
         }, "LaunchingFlyer", false, null);
         this.flightTarget = null;
     }
 }
Exemple #2
0
        public virtual void Effect()
        {
            LocalTargetInfo t    = this.TargetsAoE[0];
            bool            flag = t.Cell != default(IntVec3);

            if (flag)
            {
                this.Ability.PostAbilityAttempt();
                base.CasterPawn.rotationTracker.Face(t.CenterVector3);
                LongEventHandler.QueueLongEvent(delegate
                {
                    FlyingObject_Flight flyingObject = (FlyingObject_Flight)GenSpawn.Spawn(ThingDef.Named("FlyingObject_Flight"), this.CasterPawn.Position, this.CasterPawn.Map);
                    flyingObject.Launch(this.CasterPawn, t.Cell, base.CasterPawn);
                }, "LaunchingFlyer", false, null);
            }
        }