//bool validTarg; //public override bool CanHitTargetFrom(IntVec3 root, LocalTargetInfo targ) //{ // if (targ.Thing != null && targ.Thing == this.caster) // { // return this.verbProps.targetParams.canTargetSelf; // } // if (targ.IsValid && targ.CenterVector3.InBounds(base.CasterPawn.Map) && !targ.Cell.Fogged(base.CasterPawn.Map) && targ.Cell.Walkable(base.CasterPawn.Map)) // { // if ((root - targ.Cell).LengthHorizontal < this.verbProps.range) // { // ShootLine shootLine; // validTarg = this.TryFindShootLineFromTo(root, targ, out shootLine); // } // else // { // validTarg = false; // } // } // else // { // validTarg = false; // } // return validTarg; //} public virtual void Effect() { LocalTargetInfo t = this.TargetsAoE[0]; bool flag = t.Cell != default(IntVec3); if (flag) { Pawn casterPawn = base.CasterPawn; this.Ability.PostAbilityAttempt(); LongEventHandler.QueueLongEvent(delegate { FlyingObject_PsionicStorm flyingObject = (FlyingObject_PsionicStorm)GenSpawn.Spawn(ThingDef.Named("FlyingObject_PsionicStorm"), this.CasterPawn.Position, this.CasterPawn.Map); flyingObject.Launch(this.CasterPawn, t.Cell, this.CasterPawn, this); }, "LaunchingFlyer", false, null); } }
//bool validTarg; //public override bool CanHitTargetFrom(IntVec3 root, LocalTargetInfo targ) //{ // if (targ.Thing != null && targ.Thing == this.caster) // { // return this.verbProps.targetParams.canTargetSelf; // } // if (targ.IsValid && targ.CenterVector3.InBounds(base.CasterPawn.Map) && !targ.Cell.Fogged(base.CasterPawn.Map) && targ.Cell.Walkable(base.CasterPawn.Map)) // { // if ((root - targ.Cell).LengthHorizontal < this.verbProps.range) // { // ShootLine shootLine; // validTarg = this.TryFindShootLineFromTo(root, targ, out shootLine); // } // else // { // validTarg = false; // } // } // else // { // validTarg = false; // } // return validTarg; //} public virtual void Effect() { LocalTargetInfo t = this.TargetsAoE[0]; bool flag = t.Cell != default(IntVec3); if (flag) { Pawn casterPawn = base.CasterPawn; //this.Ability.PostAbilityAttempt(); if (ModCheck.Validate.GiddyUp.Core_IsInitialized()) { ModCheck.GiddyUp.ForceDismount(base.CasterPawn); } LongEventHandler.QueueLongEvent(delegate { FlyingObject_PsionicStorm flyingObject = (FlyingObject_PsionicStorm)GenSpawn.Spawn(ThingDef.Named("FlyingObject_PsionicStorm"), this.CasterPawn.Position, this.CasterPawn.Map); flyingObject.Launch(this.CasterPawn, t.Cell, this.CasterPawn, this); }, "LaunchingFlyer", false, null); } }