コード例 #1
0
        public static bool Prefix(IEntitySlot slot, out EntitySlot.Filler __result)
        {
            __result = default(EntitySlot.Filler);

            bool isMultiplayer = (Multiplayer.Main != null && Multiplayer.Main.IsMultiplayer());

            return(!isMultiplayer);
        }
コード例 #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());
        }
コード例 #3
0
        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);
        }
コード例 #4
0
ファイル: SlotsHelper.cs プロジェクト: joeeyaura/Nitrox
        public static List <EntitySlot.Type> GetEntitySlotTypes(IEntitySlot entitySlot)
        {
            if (entitySlot is EntitySlot)
            {
                return(((EntitySlot)entitySlot).allowedTypes);
            }
            else if (entitySlot is EntitySlotData)
            {
                return(ConvertSlotTypes(((EntitySlotData)entitySlot).allowedTypes));
            }

            throw new System.Exception("Unknown EntitySlotType " + entitySlot.GetType());
        }
コード例 #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);
                }
            }
        }
コード例 #6
0
        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);
        }
コード例 #7
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);
        }
コード例 #8
0
        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++;
                }
            }
        }
コード例 #9
0
        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);
        }
コード例 #10
0
        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);
        }
コード例 #11
0
 public static bool Prefix(IEntitySlot slot, out EntitySlot.Filler __result)
 {
     __result = default(EntitySlot.Filler);
     return(!Multiplayer.Active);
 }