예제 #1
0
        public static bool Prefix(
            TransportPodsArrivalAction_LandInSpecificCell __instance,
            List <ActiveDropPodInfo> pods,
            int tile)
        {
            foreach (ActiveDropPodInfo pod in pods)
            {
                for (int index = 0; index < pod.innerContainer.Count; index++)
                {
                    if (pod.innerContainer[index].TryGetComp <CompLaunchableSRTS>() != null)
                    {
                        Thing    lookTarget = TransportPodsArrivalActionUtility.GetLookTarget(pods);
                        Traverse traverse   = Traverse.Create((object)__instance);
                        IntVec3  c          = traverse.Field("cell").GetValue <IntVec3>();
                        Map      map        = traverse.Field("mapParent").GetValue <MapParent>().Map;
                        TransportPodsArrivalActionUtility.RemovePawnsFromWorldPawns(pods);

                        for (int i = 0; i < pods.Count; ++i)
                        {
                            pods[i].openDelay = 0;
                            DropPodUtility.MakeDropPodAt(c, map, pods[i]);
                        }
                        Messages.Message("MessageTransportPodsArrived".Translate(), (LookTargets)lookTarget, MessageTypeDefOf.TaskCompletion, true);
                        return(false);
                    }
                }
            }
            return(true);
        }
 public static bool Prefix(TransportPodsArrivalAction_LandInSpecificCell __instance, List <ActiveDropPodInfo> pods, int tile, IntVec3 ___cell, MapParent ___mapParent)
 {
     //    Log.Message(string.Format("pods: {0}", pods.Count));
     foreach (ActiveDropPodInfo info in pods)
     {
         for (int i = 0; i < info.innerContainer.Count; i++)
         {
             Thing        dropship = info.innerContainer[i];
             CompDropship comp     = dropship.TryGetCompFast <CompDropship>();
             if (comp != null)
             {
                 //    Log.Message(string.Format("pods: {0}", info.innerContainer.ContentsString));
                 Thing    lookTarget = TransportPodsArrivalActionUtility.GetLookTarget(pods);
                 Traverse tv         = Traverse.Create(__instance);
                 IntVec3  c          = ___cell;
                 Map      map        = ___mapParent.Map;
                 TransportPodsArrivalActionUtility.RemovePawnsFromWorldPawns(pods);
                 for (int ii = 0; ii < pods.Count; ii++)
                 {
                     DropPodUtility.MakeDropPodAt(c, map, pods[ii]);
                 }
                 Messages.Message("AvP_USCM_Dropship_MessageArrived".Translate(), lookTarget, MessageTypeDefOf.TaskCompletion, true);
                 return(false);
             }
         }
     }
     return(true);
 }
 // Token: 0x0600738E RID: 29582 RVA: 0x002893F0 File Offset: 0x002875F0
 public static void PlaceTravelingTunnelers(List <ActiveDropPodInfo> dropPods, IntVec3 near, Map map)
 {
     TransportPodsArrivalActionUtility.RemovePawnsFromWorldPawns(dropPods);
     for (int i = 0; i < dropPods.Count; i++)
     {
         IntVec3 c;
         DropCellFinder.TryFindDropSpotNear(near, map, out c, false, true, true, null);
         TunnelRaidUtility.MakeTunnelAt(c, map, dropPods[i]);
     }
 }
예제 #4
0
 public static bool DropSRTSExactSpot(List<ActiveDropPodInfo> dropPods, IntVec3 near, Map map)
 {
   foreach (ActiveDropPodInfo pod in dropPods)
   {
     foreach (Thing t in pod.innerContainer)
     {
       if (DefDatabase<ThingDef>.GetNamedSilentFail(t.def.defName.Split('_')[0])?.GetCompProperties<CompProperties_LaunchableSRTS>() != null)
       {
         TransportPodsArrivalActionUtility.RemovePawnsFromWorldPawns(dropPods);
         foreach (ActiveDropPodInfo pod2 in dropPods)
         {
           DropPodUtility.MakeDropPodAt(near, map, pod2);
         }
         return false;
       }
     }
   }
   return true;
 }
예제 #5
0
 public static bool Prefix(TransportPodsArrivalAction_LandInSpecificCell __instance, List <ActiveDropPodInfo> pods, int tile)
 {
     foreach (ActiveDropPodInfo info in pods)
     {
         if (info.innerContainer.Contains(ThingDef.Named("Building_Helicopter")))
         {
             Thing    lookTarget = TransportPodsArrivalActionUtility.GetLookTarget(pods);
             Traverse tv         = Traverse.Create(__instance);
             IntVec3  c          = tv.Field("cell").GetValue <IntVec3>();
             Map      map        = tv.Field("mapParent").GetValue <MapParent>().Map;
             TransportPodsArrivalActionUtility.RemovePawnsFromWorldPawns(pods);
             for (int i = 0; i < pods.Count; i++)
             {
                 DropPodUtility.MakeDropPodAt(c, map, pods[i]);
             }
             Messages.Message("MessageTransportPodsArrived".Translate(), lookTarget, MessageTypeDefOf.TaskCompletion, true);
             return(false);
         }
     }
     return(true);
 }
 public static bool Prefix(TransportPodsArrivalAction_LandInSpecificCell __instance, List <ActiveDropPodInfo> pods, int tile)
 {
     //    Log.Message(string.Format("pods: {0}", pods.Count));
     foreach (ActiveDropPodInfo info in pods)
     {
         if (info.innerContainer.Contains(USCMDefOf.RRY_USCM_DropshipUD4L))
         {
             //    Log.Message(string.Format("pods: {0}", info.innerContainer.ContentsString));
             Thing    lookTarget = TransportPodsArrivalActionUtility.GetLookTarget(pods);
             Traverse tv         = Traverse.Create(__instance);
             IntVec3  c          = tv.Field("cell").GetValue <IntVec3>();
             Map      map        = tv.Field("mapParent").GetValue <MapParent>().Map;
             TransportPodsArrivalActionUtility.RemovePawnsFromWorldPawns(pods);
             for (int i = 0; i < pods.Count; i++)
             {
                 DropPodUtility.MakeDropPodAt(c, map, pods[i]);
             }
             Messages.Message("USCM_Dropship_MessageArrived".Translate(), lookTarget, MessageTypeDefOf.TaskCompletion, true);
             return(false);
         }
     }
     return(true);
 }