コード例 #1
0
        // Token: 0x060011D5 RID: 4565 RVA: 0x000EC6D0 File Offset: 0x000EA8D0
        public static bool Prefix(IntVec3 c, Map map, ActiveDropPodInfo info)
        {
            bool result = true;

            if (info.innerContainer.Any(x => x.def.thingClass == typeof(Pawn) && (x.Faction != null && x.Faction.def.HasModExtension <FactionDefExtension>())))
            {
                List <Thing>        list      = info.innerContainer.Where(x => x.def.thingClass == typeof(Pawn) && (x.Faction != null && x.Faction.def.HasModExtension <FactionDefExtension>())).ToList();
                FactionDefExtension extension = list.RandomElement().Faction.def.GetModExtension <FactionDefExtension>();
                if (extension.DropPodOverride == DeepStrikeType.Drop)
                {
                    DeepStrikeUtility.MakeDropPodAt(c, map, info, extension);
                    result = false;
                }
                else if (extension.DropPodOverride == DeepStrikeType.Fly)
                {
                    DeepStrikeUtility.MakeFlyerLandAt(c, map, info, extension);
                    result = false;
                }
                else if (extension.DropPodOverride == DeepStrikeType.Teleport)
                {
                    DeepStrikeUtility.MakeTeleportAt(c, map, info, extension);
                    result = false;
                }
                else if (extension.DropPodOverride == DeepStrikeType.Tunnel)
                {
                    DeepStrikeUtility.MakeTunnelAt(c, map, info, extension);
                    result = false;
                }
            }
            return(result);
        }
コード例 #2
0
        // Token: 0x060011D5 RID: 4565 RVA: 0x000EC6D0 File Offset: 0x000EA8D0
        public static bool Prefix(IntVec3 c, Map map, ActiveDropPodInfo info)
        {
            bool         result = true;
            List <Thing> list   = new List <Thing>();

            for (int i = 0; i < info.innerContainer.Count; i++)
            {
                Thing t = info.innerContainer[i];
                if (t?.Faction?.def.GetModExtensionFast <FactionDefExtension>() != null)
                {
                    list.Add(t);
                }
            }
            if (!list.NullOrEmpty())
            {
                Thing thing = list.RandomElement();
                FactionDefExtension extension = thing.Faction.def.GetModExtensionFast <FactionDefExtension>();
                if (thing.Faction.IsPlayer || extension.DropPodOverride == DeepStrikeType.DropPod && extension.DropPodIncoming == ThingDefOf.DropPodIncoming)
                {
                    return(result);
                }
                if (extension.DropPodOverride == DeepStrikeType.DropPod)
                {
                    DeepStrikeUtility.MakeDropPodAt(c, map, info, extension);
                    result = false;
                }
                else if (extension.DropPodOverride == DeepStrikeType.Fly)
                {
                    DeepStrikeUtility.MakeFlyerLandAt(c, map, info, extension);
                    result = false;
                }
                else if (extension.DropPodOverride == DeepStrikeType.Teleport)
                {
                    DeepStrikeUtility.MakeTeleportAt(c, map, info, extension);
                    result = false;
                }
                else if (extension.DropPodOverride == DeepStrikeType.Tunnel)
                {
                    DeepStrikeUtility.MakeTunnelAt(c, map, info, extension);
                    result = false;
                }
            }
            return(result);
        }