public static bool Prefix(CellManager __instance, IEntitySlot slot, ref EntitySlot.Filler __result)
        {
            int  num    = 0;
            bool flag   = __instance.spawner == null;
            bool result = true;

            if (flag)
            {
                __result = default;
                result   = false;
            }
            else if (!slot.IsCreatureSlot() && Config.ToggleValue)
            {
                while (string.IsNullOrEmpty(__result.classId) && num < Config.SliderValue)
                {
                    num++;
                    __result = __instance.spawner.GetPrefabForSlot(slot, true);
                    if (!string.IsNullOrEmpty(__result.classId))
                    {
                        WorldEntityInfo wei;
                        if (WorldEntityDatabase.TryGetInfo(__result.classId, out wei))
                        {
                            if (wei.techType == TechType.TimeCapsule)
                            {
                                ErrorMessage.AddWarning("!!!!!Time Capsule Spawned!!!!!");
                            }
                        }
                    }
                }
                ;
                result = false;
            }
            else if (slot.IsCreatureSlot() && Config.ToggleValue)
            {
                __result = __instance.spawner.GetPrefabForSlot(slot, true);
                WorldEntityInfo wei;
                if (!string.IsNullOrEmpty(__result.classId))
                {
                    if (WorldEntityDatabase.TryGetInfo(__result.classId, out wei))
                    {
                        if (wei.techType == TechType.ReaperLeviathan)
                        {
                            ErrorMessage.AddWarning("!!!!!WARNING Reaper Leviathan WARNING!!!!!");
                        }
                    }
                }
                result = false;
            }
            return(result);
        }
Beispiel #2
0
        public static bool Prefix(IEntitySlot slot, out EntitySlot.Filler __result)
        {
            __result = default(EntitySlot.Filler);

            // NOTE: We currently only disable spawning of creature but we can later extend this to all slot types to make the server the authority.

            return(!slot.IsCreatureSlot());
        }
        public static EntitySpawnPoint From(AbsoluteEntityCell absoluteEntityCell, Vector3 localPosition, Quaternion localRotation, Vector3 scale, string classId, IEntitySlot entitySlot)
        {
            EntitySpawnPoint spawnPoint = From(absoluteEntityCell, localPosition, localRotation, scale, classId);

            spawnPoint.BiomeType        = entitySlot.GetBiomeType();
            spawnPoint.Density          = entitySlot.GetDensity();
            spawnPoint.CanSpawnCreature = entitySlot.IsCreatureSlot();
            spawnPoint.AllowedTypes     = SlotsHelper.GetEntitySlotTypes(entitySlot);

            return(spawnPoint);
        }
        public static bool Prefix(CellManager __instance, IEntitySlot slot, ref EntitySlot.Filler __result)
        {
            int  num    = 0;
            bool flag   = __instance.spawner == null;
            bool result = true;

            if (flag)
            {
                __result = default(EntitySlot.Filler);
                result   = false;
            }
            else if (!slot.IsCreatureSlot() && Config.ToggleValue)
            {
                while (string.IsNullOrEmpty(__result.classId) && num < Config.SliderValue)
                {
                    num++;
                    __result = __instance.spawner.GetPrefabForSlot(slot, true);

                    /*if (!string.IsNullOrEmpty(__result.classId))
                     * {
                     *  WorldEntityInfo wei;
                     *  if (WorldEntityDatabase.TryGetInfo(__result.classId, out wei))
                     *  {
                     *      if (wei.techType == TechType.TimeCapsule)
                     *      {
                     *          ErrorMessage.AddWarning("!!!!!Time Capsule Spawned!!!!!");
                     *          Console.WriteLine("\n\n\n\n\n\n!!!!!Time Capsule Spawned!!!!!\n\n\n\n\n\n\n");
                     *      }
                     *  }
                     * }*/
                }
                ;
                result = false;
            }/*
              * else if (slot.IsCreatureSlot() && Config.ToggleValue)
              * {
              * __result = __instance.spawner.GetPrefabForSlot(slot, true);
              * WorldEntityInfo wei;
              * if (!string.IsNullOrEmpty(__result.classId))
              * {
              *     if (WorldEntityDatabase.TryGetInfo(__result.classId, out wei))
              *     {
              *         if (wei.techType == TechType.ReaperLeviathan)
              *         {
              *             ErrorMessage.AddWarning("WARNING !!!!!Reaper Leviathan Spawned!!!!!");
              *             Console.WriteLine("\n\n\n\n\n\n\nWARNING !!!!!Reaper Leviathan Spawned!!!!!\n\n\n\n\n\n\n");
              *         }
              *     }
              * }
              * result = false;
              * }*/
            return(result);
        }
Beispiel #5
0
        public static void Postfix(CellManager __instance, IEntitySlot slot, ref EntitySlot.Filler __result)
        {
            int num = 0;

            if (__instance.spawner != null && !slot.IsCreatureSlot() && Config.ResourceMultiplier > 1)
            {
                while (string.IsNullOrEmpty(__result.classId) && (float)num < Config.ResourceMultiplier)
                {
                    num++;
                    __result = __instance.spawner.GetPrefabForSlot(slot, true);
                }
            }
        }
Beispiel #6
0
        static bool Prefix(CellManager __instance, IEntitySlot slot, ref EntitySlot.Filler __result)
        {
            if (__instance.spawner == null || __instance.streamer.debugDisableSlotEnts)
            {
                __result = default;
                return(false);
            }

            for (int i = 0; i < Main.config.dbg.lootSpawnRerollCount; i++)
            {
                __result = __instance.spawner.GetPrefabForSlot(slot, true);

                if (__result.count > 0 || slot.IsCreatureSlot())
                {
                    break;
                }
            }

            return(false);
        }
        public static void Postfix(CellManager __instance, IEntitySlot slot, ref EntitySlot.Filler __result)
        {
            int num = 0;

            if (__instance.spawner != null && !slot.IsCreatureSlot() && Main.config.ResourceMultiplier > 1)
            {
                while (string.IsNullOrEmpty(__result.classId) && num < Main.config.ResourceMultiplier)
                {
                    EntitySlot.Filler found = __instance.spawner.GetPrefabForSlot(slot, true);
                    if (!string.IsNullOrEmpty(found.classId) &&
                        WorldEntityDatabase.TryGetInfo(found.classId, out WorldEntityInfo entityInfo) &&
                        entityInfo.techType != TechType.None &&
                        !Main.config.Blacklist.Contains(entityInfo.techType.AsString()))
                    {
                        if (Main.config.WhiteList.Count == 0 || Main.config.WhiteList.Contains(entityInfo.techType.AsString()))
                        {
                            __result = found;
                        }
                    }
                    num++;
                }
            }
        }
        public static bool Prefix(CellManager __instance, IEntitySlot slot, ref EntitySlot.Filler __result)
        {
            int  num    = 0;
            bool flag   = __instance.spawner == null;
            bool result = true;

            if (flag)
            {
                __result = default(EntitySlot.Filler);
                result   = false;
            }
            else if (!slot.IsCreatureSlot() && Config.ToggleValue)
            {
                while (string.IsNullOrEmpty(__result.classId) && num < Config.SliderValue)
                {
                    num++;
                    __result = __instance.spawner.GetPrefabForSlot(slot, true);
                }
                ;
                result = false;
            }
            return(result);
        }