public override void TravelingTransportPodsArrived(List <ActiveDropPodInfo> dropPods, Map map) { if (!DropCellFinder.TryFindRaidDropCenterClose(out IntVec3 spot, map)) { spot = DropCellFinder.FindRaidDropCenterDistant(map); } TransportPodsArrivalActionUtility.DropTravelingTransportPods(dropPods, spot, map); }
public override bool TryResolveRaidSpawnCenter(IncidentParms parms) { Map map = (Map)parms.target; if (!parms.spawnCenter.IsValid) { parms.spawnCenter = DropCellFinder.FindRaidDropCenterDistant(map); } parms.spawnRotation = Rot4.Random; return(true); }
protected virtual bool ResolveRaidSpawnCenter(IncidentParms parms) { Map map = (Map)parms.target; if (parms.spawnCenter.IsValid) { return(true); } if (parms.raidArrivalMode == PawnsArriveMode.CenterDrop || parms.raidArrivalMode == PawnsArriveMode.EdgeDrop) { if (parms.raidArrivalMode == PawnsArriveMode.CenterDrop) { parms.raidPodOpenDelay = 520; parms.spawnRotation = Rot4.Random; if (Rand.Value < 0.40000000596046448 && map.listerBuildings.ColonistsHaveBuildingWithPowerOn(ThingDefOf.OrbitalTradeBeacon)) { parms.spawnCenter = DropCellFinder.TradeDropSpot(map); } else if (!DropCellFinder.TryFindRaidDropCenterClose(out parms.spawnCenter, map)) { parms.raidArrivalMode = PawnsArriveMode.EdgeDrop; } } if (parms.raidArrivalMode == PawnsArriveMode.EdgeDrop) { parms.raidPodOpenDelay = 140; parms.spawnCenter = DropCellFinder.FindRaidDropCenterDistant(map); parms.spawnRotation = Rot4.Random; } } else { if (!RCellFinder.TryFindRandomPawnEntryCell(out parms.spawnCenter, map, CellFinder.EdgeRoadChance_Hostile, (Predicate <IntVec3>)null)) { return(false); } parms.spawnRotation = Rot4.FromAngleFlat((map.Center - parms.spawnCenter).AngleFlat); } return(true); }
private static IntVec3 FindNewMapEdgeGroupCenter(Map map, List <Pair <List <Pawn>, IntVec3> > groups, bool arriveInPods) { IntVec3 result = IntVec3.Invalid; float num = 0f; for (int i = 0; i < 4; i++) { IntVec3 intVec; if (arriveInPods) { intVec = DropCellFinder.FindRaidDropCenterDistant(map); } else if (!RCellFinder.TryFindRandomPawnEntryCell(out intVec, map, CellFinder.EdgeRoadChance_Hostile, null)) { intVec = DropCellFinder.FindRaidDropCenterDistant(map); } if (!groups.Any <Pair <List <Pawn>, IntVec3> >()) { result = intVec; break; } float num2 = float.MaxValue; for (int j = 0; j < groups.Count; j++) { float num3 = (float)intVec.DistanceToSquared(groups[j].Second); if (num3 < num2) { num2 = num3; } } if (!result.IsValid || num2 > num) { num = num2; result = intVec; } } return(result); }
public override void TravelingTransportPodsArrived(List <ActiveDropPodInfo> dropPods, Map map) { IntVec3 near = DropCellFinder.FindRaidDropCenterDistant(map); TransportPodsArrivalActionUtility.DropTravelingTransportPods(dropPods, near, map); }