public void BeginTargeting(TargetingParameters targetParams, Action <IEnumerable <IntVec3>, Pair <IntVec3, IntVec3> > action, ThingDef bomber, BombingType bombType, Map map, Pawn caster = null, Action actionWhenFinished = null, Texture2D mouseAttachment = null) { this.action = action; this.targetParams = targetParams; this.caster = caster; this.actionWhenFinished = actionWhenFinished; this.mouseAttachment = mouseAttachment; this.selections = new List <LocalTargetInfo>(); this.bomber = bomber; this.map = map; this.bombType = bombType; }
public static BomberSkyfaller SpawnSkyfaller(ThingDef skyfaller, Thing innerThing, IntVec3 start, IntVec3 end, List <IntVec3> bombCells, BombingType bombType, Map map, int idNumber, Thing original, Map originalMap, IntVec3 landingSpot) { BomberSkyfaller thing = BomberSkyfallerMaker.MakeSkyfaller(skyfaller, innerThing); thing.originalMap = originalMap; thing.sourceLandingSpot = landingSpot; thing.numberOfBombs = SRTSMod.GetStatFor <int>(original.def.defName, StatName.numberBombs); thing.precisionBombingNumBombs = SRTSMod.GetStatFor <int>(original.def.defName, StatName.precisionBombingNumBombs); thing.speed = SRTSMod.GetStatFor <float>(original.def.defName, StatName.bombingSpeed); thing.radius = SRTSMod.GetStatFor <int>(original.def.defName, StatName.radiusDrop); thing.sound = original.TryGetComp <CompBombFlyer>().Props.soundFlyBy; thing.bombType = bombType; double angle = start.AngleToPointRelative(end); thing.angle = (float)(angle + 90) * -1; IntVec3 exitPoint = SPTrig.ExitPointCustom(angle, start, map); BomberSkyfaller bomber = (BomberSkyfaller)GenSpawn.Spawn(thing, exitPoint, map, WipeMode.Vanish); bomber.bombCells = bombCells; return(bomber); }
public static void BombWithSRTS(List <ActiveDropPodInfo> srts, IntVec3 targetA, IntVec3 targetB, List <IntVec3> bombCells, BombingType bombType, Map map, Map originalMap, IntVec3 returnSpot) { if (srts.Count > 1) { Log.Error("Initiating bomb run with more than 1 SRTS in Drop Pod Group. This should not happen. - Smash Phil"); } for (int i = 0; i < srts.Count; i++) { MakeSRTSBombingAt(targetA, targetB, bombCells, bombType, map, srts[i], originalMap, returnSpot); } }
public static void MakeSRTSBombingAt(IntVec3 c1, IntVec3 c2, List <IntVec3> bombCells, BombingType bombType, Map map, ActiveDropPodInfo info, Map originalMap, IntVec3 returnSpot) { for (int index = 0; index < info.innerContainer.Count; index++) { if (info.innerContainer[index].TryGetComp <CompLaunchableSRTS>() != null) { Thing ship = info.innerContainer[index]; string shipType = ship.def.defName; ActiveDropPod srts = (ActiveDropPod)ThingMaker.MakeThing(ThingDef.Named(shipType + "_Active"), null); srts.Contents = info; BomberSkyfallerMaker.SpawnSkyfaller(ThingDef.Named(shipType + "_BomberRun"), srts, c1, c2, bombCells, bombType, map, ship.thingIDNumber, ship, originalMap, returnSpot); } } }
public SRTSArrivalActionBombRun(MapParent mapParent, Pair <IntVec3, IntVec3> targetCells, IEnumerable <IntVec3> bombCells, BombingType bombType, Map originalMap, IntVec3 originalLandingSpot) { this.mapParent = mapParent; this.targetCellA = targetCells.First; this.targetCellB = targetCells.Second; this.bombCells = bombCells.ToList(); this.originalMap = originalMap; this.originalLandingSpot = originalLandingSpot; this.bombType = bombType; }