public static bool HumanUser(ref JobGiver_AIFightEnemy __instance, ref Job __result, ref Pawn pawn, bool player) { if (pawn.abilities != null) { bool hasRangedVerb = false; List <Verb> rangeList = new List <Verb>(); foreach (Ability ability in pawn.abilities.abilities) { AbilitesExtended.EquipmentAbility equipmentAbility = ability as AbilitesExtended.EquipmentAbility; if (equipmentAbility != null) { if (equipmentAbility.CanCast && equipmentAbility.verb.verbProps.range < 1.5f) { Log.Message("Adding " + equipmentAbility.def.LabelCap + "to " + pawn + ""); rangeList.Add(equipmentAbility.verb); hasRangedVerb = true; } } } if (!rangeList.NullOrEmpty() && hasRangedVerb) { Log.Message("found " + rangeList.Count + " eqabilities for " + pawn); } } return(true); }
public override void Apply(LocalTargetInfo target, LocalTargetInfo dest) { AbilitesExtended.EquipmentAbility equipmentAbility = this.parent as AbilitesExtended.EquipmentAbility; // Log.Message("Try use JumpPack"); if (parent.CooldownTicksRemaining > 0) { // Log.Message("jump disabled "); return; } bool cd = false; switch (Props.type) { case DeepStrikeType.Fly: cd = TryJumpTo(target, dest); break; case DeepStrikeType.Teleport: cd = TryTeleportTo(target, dest); break; case DeepStrikeType.Tunnel: break; default: break; } if (cd) { this.parent.StartCooldown(equipmentAbility.CooldownTicksLeft); } /* * if (target.HasThing) * { * base.Apply(target, dest); * LocalTargetInfo destination = base.GetDestination(dest.IsValid ? dest : target); * if (destination.IsValid) * { * Pawn pawn = this.parent.pawn; * Vector3 drawPos = target.Thing.DrawPos; * target.Thing.Position = destination.Cell; * Pawn pawn2 = target.Thing as Pawn; * if (pawn2 != null) * { * pawn2.stances.stunner.StunFor(this.Props.stunTicks.RandomInRange, this.parent.pawn, false); * pawn2.Notify_Teleported(true, true); * } * if (this.Props.destClamorType != null) * { * GenClamor.DoClamor(pawn, target.Cell, (float)this.Props.destClamorRadius, this.Props.destClamorType); * } * MoteMaker.MakeConnectingLine(drawPos, target.Thing.DrawPos, ThingDefOf.Mote_PsycastSkipLine, pawn.Map, 1f); * AdeptusMoteMaker.MakeStaticMote(drawPos, pawn.Map, ThingDefOf.Mote_PsycastSkipEffectSource, 1f); * } * } */ }