當前位置: 首頁>>代碼示例>>C#>>正文


C# Logging.ProgressLogger類代碼示例

本文整理匯總了C#中Terraria_Server.Logging.ProgressLogger的典型用法代碼示例。如果您正苦於以下問題:C# ProgressLogger類的具體用法?C# ProgressLogger怎麽用?C# ProgressLogger使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ProgressLogger類屬於Terraria_Server.Logging命名空間,在下文中一共展示了ProgressLogger類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: initBList

        //pre-blends colors when loading plugin so making the image is faster
        public void initBList()
        {
            //adds all the colors for walls/tiles/global
            UInt32 waterColor = 0x093DBF;
            UInt32 lavaColor = 0xFD2003;
            //blends water and lava with UInt32Defs
            using (var blendprog = new ProgressLogger(Main.maxTilesX - 1, "[map] Blending colors"))
                for (int y = 0; y <= Main.maxTilesY + 331; y++)
                {
                    if (UInt32Defs.ContainsKey(y))
                    {
                        UInt32 c = UInt32Defs[y];

                        //initialize DimColorDefs and DimUInt32Defs first
                        UInt32 dimblend = dimI(c);
                        Color dimresult = dimC(c);
                        DimUInt32Defs[y] = dimblend;
                        DimColorDefs[y] = dimresult;

                        UInt32 d = DimUInt32Defs[y];
                        blendprog.Value = y;

                        doBlendResult(c, waterColor, lavaColor, "regular");
                        doBlendResult(d, waterColor, lavaColor, "dim");
                    }
                }
        }
開發者ID:Enerdy,項目名稱:TDSM_map,代碼行數:28,代碼來源:MapPlugin_Mapper2.cs

示例2: HideWaterTreasure

        public static void HideWaterTreasure(Func<Int32, Int32, ITile> TileRefs)
        {
            if (TileRefs == null)
                TileRefs = TileCollection.ITileAt;

            //Water Treasure
            float num235 = (float)(Main.maxTilesX / 4200);
            int num236 = 0;
            int num237 = 0;
            using (var prog = new ProgressLogger(100, Languages.Generation_HidingWaterTreasure))
            {
                while ((float)num237 < 10f * num235)
                {
                    int contain2 = 0;
                    num236++;
                    if (num236 == 1)
                    {
                        contain2 = 186;
                    }
                    else if (num236 == 2)
                    {
                        contain2 = 277;
                    }
                    else
                    {
                        contain2 = 187;
                        num236 = 0;
                    }
                    bool flag16 = false;
                    while (!flag16)
                    {
                        int num238 = WorldModify.genRand.Next(1, Main.maxTilesX);
                        int num239 = WorldModify.genRand.Next(1, Main.maxTilesY - 200);
                        while (TileRefs(num238, num239).Liquid < 200 || TileRefs(num238, num239).Lava)
                        {
                            num238 = WorldModify.genRand.Next(1, Main.maxTilesX);
                            num239 = WorldModify.genRand.Next(1, Main.maxTilesY - 200);
                        }
                        flag16 = AddBuriedChest(TileRefs, num238, num239, contain2, true);
                    }
                    num237++;
                }
            }
        }
開發者ID:emreuyls,項目名稱:Terraria-s-Dedicated-Server-Mod,代碼行數:44,代碼來源:WorldGen.cs

示例3: EveryTileFrame

        public static void EveryTileFrame()
        {
            using (var prog = new ProgressLogger (Main.maxTilesX, "Finding tile frames"))
            {
                WorldModify.noLiquidCheck = true;
                WorldModify.noTileActions = true;
                for (int i = 0; i < Main.maxTilesX; i++)
                {
                    prog.Value = i;

                    for (int j = 0; j < Main.maxTilesY; j++)
                    {
                        WorldModify.TileFrame(i, j, true, false);
                    }
                }
                WorldModify.noLiquidCheck = false;
                WorldModify.noTileActions = false;
            }
        }
開發者ID:Dyrian,項目名稱:Terraria-s-Dedicated-Server-Mod,代碼行數:19,代碼來源:WorldModify.cs

示例4: AddProgressLogger

 public static void AddProgressLogger(ProgressLogger prog)
 {
     Write (new LogEntry (prog, null));
 }
開發者ID:CaptainMuscles,項目名稱:Terraria-s-Dedicated-Server-Mod,代碼行數:4,代碼來源:ProgramLog.cs

示例5: clearWorld

        public static void clearWorld()
        {
            Main.trashItem = new Item();
            WorldModify.spawnEye = false;
            WorldModify.spawnNPC = 0;
            WorldModify.shadowOrbCount = 0;
            Main.helpText = 0;
            Main.dungeonX = 0;
            Main.dungeonY = 0;
            NPC.downedBoss1 = false;
            NPC.downedBoss2 = false;
            NPC.downedBoss3 = false;
            WorldModify.shadowOrbSmashed = false;
            WorldModify.spawnMeteor = false;
            WorldModify.stopDrops = false;
            Main.invasionDelay = 0;
            Main.invasionType = 0;
            Main.invasionSize = 0;
            Main.invasionWarn = 0;
            Main.invasionX = 0.0;
            WorldModify.noLiquidCheck = false;
            Liquid.numLiquid = 0;
            LiquidBuffer.numLiquidBuffer = 0;

            if (WorldModify.lastMaxTilesX > Main.maxTilesX || WorldModify.lastMaxTilesY > Main.maxTilesY)
            {
                using (var prog = new ProgressLogger(WorldModify.lastMaxTilesX - 1, "Freeing unused resources"))
                    for (int i = 0; i < WorldModify.lastMaxTilesX; i++)
                    {
                        prog.Value = i;
                        for (int j = 0; j < WorldModify.lastMaxTilesY; j++)
                        {
                            Main.tile.CreateTileAt(i, j);
                        }
                    }
            }
            WorldModify.lastMaxTilesX = Main.maxTilesX;
            WorldModify.lastMaxTilesY = Main.maxTilesY;

            Server.tile = new TileCollection(Main.maxTilesX, Main.maxTilesY);

            using (var prog = new ProgressLogger(Main.maxTilesX - 1, "Resetting game objects"))
                for (int k = 0; k < Main.maxTilesX; k++)
                {
                    prog.Value = k;
                    for (int l = 0; l < Main.maxTilesY; l++)
                    {
                        Main.tile.CreateTileAt(k, l);
                    }
                }

            for (int num3 = 0; num3 < 200; num3++)
            {
                Main.item[num3] = new Item();
            }
            for (int num4 = 0; num4 < 1000; num4++)
            {
                Main.npcs[num4] = new NPC();
            }
            for (int num5 = 0; num5 < 1000; num5++)
            {
                Main.projectile[num5] = new Projectile();
            }
            for (int num6 = 0; num6 < 1000; num6++)
            {
                Main.chest[num6] = null;
            }
            for (int num7 = 0; num7 < 1000; num7++)
            {
                Main.sign[num7] = null;
            }
            for (int num8 = 0; num8 < Liquid.resLiquid; num8++)
            {
                Main.liquid[num8] = new Liquid();
            }
            for (int num9 = 0; num9 < 10000; num9++)
            {
                Main.liquidBuffer[num9] = new LiquidBuffer();
            }
            setWorldSize();
            worldCleared = true;
        }
開發者ID:CaptainMuscles,項目名稱:Terraria-s-Dedicated-Server-Mod,代碼行數:82,代碼來源:WorldIO.cs

示例6: Main


//.........這裏部分代碼省略.........
						ProgramLog.Log ("PID File Created, Process ID: " + ProcessUID);
					}
				}

				ParseArgs(args);

				try
				{
					if (UpdateManager.performProcess())
					{
						ProgramLog.Log ("Restarting into new update!");
						return;
					}
				}
				catch (UpdateCompleted)
				{
					throw;
				}
				catch (Exception e)
				{
					ProgramLog.Log (e, "Error updating");
				}
				
				LoadMonitor.Start ();
				
				ProgramLog.Log ("Starting remote console server");
				RemoteConsole.RConServer.Start ("rcon_logins.properties");

				ProgramLog.Log("Starting permissions manager");
				permissionManager = new PermissionManager();
				
				ProgramLog.Log ("Preparing Server Data...");
				
				using (var prog = new ProgressLogger (1, "Loading item definitions"))
					Collections.Registries.Item.Load ();
				using (var prog = new ProgressLogger (1, "Loading NPC definitions"))
					Collections.Registries.NPC.Load (Collections.Registries.NPC_FILE);
				using (var prog = new ProgressLogger (1, "Loading projectile definitions"))
					Collections.Registries.Projectile.Load (Collections.Registries.PROJECTILE_FILE);
                                
                commandParser = new CommandParser();
                commandParser.ReadPermissionNodes();
				
				ProgramLog.Log("Loading plugins...");
                Terraria_Server.Plugins.PluginManager.Initialize(Statics.PluginPath, Statics.LibrariesPath);

                var ctx = new HookContext()
                {
                    Sender = new ConsoleSender()
                };

                var eArgs = new HookArgs.ServerStateChange()
                {
                    ServerChangeState = ServerState.INITIALIZING
                };

                HookPoints.ServerStateChange.Invoke(ref ctx, ref eArgs);
				PluginManager.LoadPlugins ();
				ProgramLog.Log("Plugins loaded: " + PluginManager.PluginCount);
				
                string worldFile = properties.WorldPath;
				FileInfo file = new FileInfo(worldFile);

				if (!file.Exists)
				{
					try
開發者ID:rakiru,項目名稱:Terraria-s-Dedicated-Server-Mod,代碼行數:67,代碼來源:Program.cs

示例7: EveryTileFrame

        public static void EveryTileFrame(Func<Int32, Int32, ITile> TileRefs, ISandbox sandbox)
        {
            if (TileRefs == null)
                TileRefs = TileCollection.ITileAt;

            using (var prog = new ProgressLogger(Main.maxTilesX, "Finding tile frames"))
            {
                noLiquidCheck = true;
                noTileActions = true;
                for (int i = 0; i < Main.maxTilesX; i++)
                {
                    prog.Value = i;

                    for (int j = 0; j < Main.maxTilesY; j++)
                    {
                        if (TileRefs(i, j).Active)
                        {
                            TileFrame(TileRefs, sandbox, i, j, true, false);
                        }
                        if (TileRefs(i, j).Wall > 0)
                        {
                            WallFrame(TileRefs, i, j, true);
                        }
                    }
                }
                noLiquidCheck = false;
                noTileActions = false;
            }
        }
開發者ID:jason14747,項目名稱:Terraria-s-Dedicated-Server-Mod,代碼行數:29,代碼來源:WorldModify.cs

示例8: clearWorld

        public static void clearWorld()
        {
            Statics.WorldLoaded = false;

            Main.trashItem = new Item();
            WorldModify.spawnEye = false;
            WorldModify.spawnNPC = 0;
            WorldModify.shadowOrbCount = 0;
            Main.helpText = 0;
            Main.dungeonX = 0;
            Main.dungeonY = 0;
            NPC.downedBoss1 = false;
            NPC.downedBoss2 = false;
            NPC.downedBoss3 = false;
            WorldModify.shadowOrbSmashed = false;
            WorldModify.spawnMeteor = false;
            WorldModify.stopDrops = false;
            Main.invasionDelay = 0;
            Main.invasionType = 0;
            Main.invasionSize = 0;
            Main.invasionWarn = 0;
            Main.invasionX = 0.0;
            WorldModify.noLiquidCheck = false;
            Liquid.numLiquid = 0;
            LiquidBuffer.numLiquidBuffer = 0;

            //			if (WorldModify.lastMaxTilesX > Main.maxTilesX || WorldModify.lastMaxTilesY > Main.maxTilesY)
            //			{
            //				using (var prog = new ProgressLogger(WorldModify.lastMaxTilesX - 1, "Freeing unused resources"))
            //					for (int i = 0; i < WorldModify.lastMaxTilesX; i++)
            //					{
            //						prog.Value = i;
            //						for (int j = 0; j < WorldModify.lastMaxTilesY; j++)
            //						{
            //							Main.tile.CreateTileAt(i, j);
            //						}
            //					}
            //			}
            WorldModify.lastMaxTilesX = Main.maxTilesX;
            WorldModify.lastMaxTilesY = Main.maxTilesY;

            if (Main.tile == null || Main.tile.SizeX != Main.maxTilesX || Main.tile.SizeY != Main.maxTilesY)
            {
                Main.tile = null;
                GC.Collect ();
                Main.tile = new TileCollection(Main.maxTilesX, Main.maxTilesY);
            }
            else
            {
                using (var prog = new ProgressLogger(Main.maxTilesX - 1, "Clearing world tiles"))
                    for (int k = 0; k < Main.maxTilesX; k++)
                    {
                        prog.Value = k;
                        for (int l = 0; l < Main.maxTilesY; l++)
                        {
                            Main.tile.CreateTileAt(k, l);
            // for testing
            //							if ((l == 25 || l == 26) && k > 4000 && k < 5000)
            //							{
            //								Main.tile.At(k, l).SetLiquid (250);
            //								Liquid.AddWater (k, l);
            //							}
                        }
                    }
            }

            using (var prog = new ProgressLogger(12212 + Liquid.resLiquid - 1, "Resetting game objects"))
            {
                for (int num3 = 0; num3 < 200; num3++)
                {
                    Main.item[num3] = null;
                }
                prog.Value++;

                for (int num4 = 0; num4 < 1000; num4++)
                {
                    Main.npcs[num4] = null;
                    Main.projectile[num4] = null;
                    Main.chest[num4] = null;
                    Main.sign[num4] = null;
                }
                prog.Value++;

            //				for (int num8 = 0; num8 < Liquid.resLiquid; num8++)
            //				{
            //					Main.liquid[num8] = null;
            //				}
            //				prog.Value++;

            //				for (int num9 = 0; num9 < 10000; num9++)
            //				{
            //					Main.liquidBuffer[num9] = null;
            //				}
            //				prog.Value += 10;

                GC.Collect ();
                prog.Value += 10;

                for (int num3 = 0; num3 < 200; num3++)
                {
//.........這裏部分代碼省略.........
開發者ID:rakiru,項目名稱:Terraria-s-Dedicated-Server-Mod,代碼行數:101,代碼來源:WorldIO.cs

示例9: PlaceHellforges

        public static void PlaceHellforges(Func<Int32, Int32, ITile> TileRefs)
        {
            if (TileRefs == null)
                TileRefs = TileCollection.ITileAt;

            var max = Main.maxTilesX / 200;
            using (var prog = new ProgressLogger(max - 1, Languages.Generation_PlacingHellForges))
            {
                for (int num294 = 0; num294 < Main.maxTilesX / 200; num294++)
                {
                    float num295 = (float)(num294 / (Main.maxTilesX / 200));
                    bool flag21 = false;
                    int num296 = 0;
                    while (!flag21)
                    {
                        int num297 = WorldModify.genRand.Next(1, Main.maxTilesX);
                        int num298 = WorldModify.genRand.Next(Main.maxTilesY - 250, Main.maxTilesY - 5);
                        try
                        {
                            if (TileRefs(num297, num298).Wall != 13 && TileRefs(num297, num298).Wall != 14)
                                continue;

                            while (!TileRefs(num297, num298).Active)
                                num298++;

                            num298--;
                            WorldModify.PlaceTile(TileRefs, null, num297, num298, 77, false, false, -1, 0);
                            if (TileRefs(num297, num298).Type == 77)
                                flag21 = true;
                            else
                            {
                                num296++;
                                if (num296 >= 10000)
                                    flag21 = true;
                            }
                        }
                        catch
                        { }
                    }
                }
                prog.Value++;
            }
        }
開發者ID:emreuyls,項目名稱:Terraria-s-Dedicated-Server-Mod,代碼行數:43,代碼來源:WorldGen.cs

示例10: PlaceBreakables

        public static void PlaceBreakables(Func<Int32, Int32, ITile> TileRefs)
        {
            if (TileRefs == null)
                TileRefs = TileCollection.ITileAt;

            var num241max = (int)((double)(Main.maxTilesX * Main.maxTilesY) * 0.0008);
            using (var prog = new ProgressLogger(num241max - 1, Languages.Generation_PlacingBreakables))
            {
                for (int num241 = 0; num241 < num241max; num241++)
                {
                    float num242 = (float)((double)num241 / ((double)(Main.maxTilesX * Main.maxTilesY) * 0.0008));

                    prog.Value = num241;

                    bool flag17 = false;
                    int num243 = 0;
                    while (!flag17)
                    {
                        int num244 = WorldModify.genRand.Next((int)worldSurface, Main.maxTilesY - 10);
                        if ((double)num242 > 0.93)
                        {
                            num244 = Main.maxTilesY - 150;
                        }
                        else if ((double)num242 > 0.75)
                        {
                            num244 = (int)terrarainMaxY;
                        }
                        int num245 = WorldModify.genRand.Next(1, Main.maxTilesX);
                        bool flag18 = false;
                        for (int num246 = num244; num246 < Main.maxTilesY; num246++)
                        {
                            if (!flag18)
                            {
                                if (TileRefs(num245, num246).Active && Main.tileSolid[(int)TileRefs(num245, num246).Type] && !TileRefs(num245, num246 - 1).Lava)
                                {
                                    flag18 = true;
                                }
                            }
                            else
                            {
                                if (WorldModify.PlacePot(TileRefs, num245, num246, 28))
                                {
                                    flag17 = true;
                                    break;
                                }
                                num243++;
                                if (num243 >= 10000)
                                {
                                    flag17 = true;
                                    break;
                                }
                            }
                        }
                    }
                }
            } // end breakables
        }
開發者ID:emreuyls,項目名稱:Terraria-s-Dedicated-Server-Mod,代碼行數:57,代碼來源:WorldGen.cs

示例11: AddClay

        public static void AddClay(Func<Int32, Int32, ITile> TileRefs)
        {
            if (TileRefs == null)
                TileRefs = TileCollection.ITileAt;

            var Max = (int)((double)(Main.maxTilesX * Main.maxTilesY) * 2E-05);
            var Max2 = (int)((double)(Main.maxTilesX * Main.maxTilesY) * 5E-05);
            var Max3 = (int)((double)(Main.maxTilesX * Main.maxTilesY) * 2E-05);
            var Max4 = Main.maxTilesX - 5;
            using (var clayProg = new ProgressLogger(Max + Max2 + Max3 + Max4, Languages.Generation_AddingClay))
            {
                for (int i = 0; i < Max; i++)
                {
                    TileRunner(TileRefs, WorldModify.genRand.Next(0, Main.maxTilesX), WorldModify.genRand.Next(0, (int)terrarainMaxY), (double)WorldModify.genRand.Next(4, 14), WorldModify.genRand.Next(10, 50), 40, false, 0f, 0f, false, true);
                    clayProg.Value++;
                }
                for (int i = 0; i < Max2; i++)
                {
                    TileRunner(TileRefs, WorldModify.genRand.Next(0, Main.maxTilesX), WorldModify.genRand.Next((int)terrarainMaxY, (int)worldSurface + 1), (double)WorldModify.genRand.Next(8, 14), WorldModify.genRand.Next(15, 45), 40, false, 0f, 0f, false, true);
                    clayProg.Value++;
                }
                for (int i = 0; i < Max3; i++)
                {
                    TileRunner(TileRefs, WorldModify.genRand.Next(0, Main.maxTilesX), WorldModify.genRand.Next((int)worldSurface, (int)rockLayer + 1), (double)WorldModify.genRand.Next(8, 15), WorldModify.genRand.Next(5, 50), 40, false, 0f, 0f, false, true);
                    clayProg.Value++;
                }
                for (int posX = 5; posX < Max4; posX++)
                {
                    int startY = 1;
                    while ((double)startY < Main.worldSurface - 1.0)
                    {
                        if (TileRefs(posX, startY).Active)
                        {
                            for (int posY = startY; posY < startY + 5; posY++)
                            {
                                if (TileRefs(posX, posY).Type == 40)
                                {
                                    TileRefs(posX, posY).SetType(0);
                                }
                            }
                            break;
                        }
                        startY++;
                    }
                    clayProg.Value++;
                }
            }
        }
開發者ID:emreuyls,項目名稱:Terraria-s-Dedicated-Server-Mod,代碼行數:48,代碼來源:WorldGen.cs

示例12: PlaceAltars

        public static void PlaceAltars(Func<Int32, Int32, ITile> TileRefs)
        {
            if (TileRefs == null)
                TileRefs = TileCollection.ITileAt;

            var MaxAltar = (int)((double)(Main.maxTilesX * Main.maxTilesY) * 2E-05);
            using (var prog = new ProgressLogger(MaxAltar - 1, Languages.Generation_PlacingAltars))
            {
                for (int i = 0; i < MaxAltar; i++)
                {
                    prog.Value = i;

                    //bool flag11 = false;
                    int maxAltar = 0;
                    while (true)
                    {
                        int tileX = WorldModify.genRand.Next(1, Main.maxTilesX);
                        int tileY = (int)(worldSurface + 20.0);
                        WorldModify.Place3x2(TileRefs, tileX, tileY, 26);
                        if (TileRefs(tileX, tileY).Type == 26)
                        {
                            //flag11 = true;
                            break;
                        }
                        else
                        {
                            maxAltar++;
                            if (maxAltar >= 10000)
                            {
                                //flag11 = true;
                                break;
                            }
                        }
                    }
                }
            }
        }
開發者ID:emreuyls,項目名稱:Terraria-s-Dedicated-Server-Mod,代碼行數:37,代碼來源:WorldGen.cs

示例13: MakeWorldEvil

        public static void MakeWorldEvil(Func<Int32, Int32, ITile> TileRefs)
        {
            if (TileRefs == null)
                TileRefs = TileCollection.ITileAt;

            int evilSegment = 0;

            using (var prog = new ProgressLogger(100, Languages.Generation_MakingTheWorldEvil))
            {
                while ((double)evilSegment < (double)Main.maxTilesX * 0.00045)
                {
                    float num145 = (float)((double)evilSegment / ((double)Main.maxTilesX * 0.00045));

                    prog.Value = (int)(num145 * 100f);

                    bool flag8 = false;
                    int chasmX = 0;
                    int chasmStartX = 0;
                    int chasmEndX = 0;
                    while (!flag8)
                    {
                        int jungleLength = 0;
                        flag8 = true;
                        int MaxTileX_d2 = Main.maxTilesX / 2;
                        int cOutlier = 200;
                        chasmX = WorldModify.genRand.Next(320, Main.maxTilesX - 320);
                        chasmStartX = chasmX - WorldModify.genRand.Next(200) - 100;
                        chasmEndX = chasmX + WorldModify.genRand.Next(200) + 100;
                        if (chasmStartX < 285)
                        {
                            chasmStartX = 285;
                        }
                        if (chasmEndX > Main.maxTilesX - 285)
                        {
                            chasmEndX = Main.maxTilesX - 285;
                        }
                        if (chasmX > MaxTileX_d2 - cOutlier && chasmX < MaxTileX_d2 + cOutlier)
                        {
                            flag8 = false;
                        }
                        if (chasmStartX > MaxTileX_d2 - cOutlier && chasmStartX < MaxTileX_d2 + cOutlier)
                        {
                            flag8 = false;
                        }
                        if (chasmEndX > MaxTileX_d2 - cOutlier && chasmEndX < MaxTileX_d2 + cOutlier)
                        {
                            flag8 = false;
                        }
                        for (int tileX = chasmStartX; tileX < chasmEndX; tileX++)
                        {
                            for (int tileY = 0; tileY < (int)Main.worldSurface; tileY += 5)
                            {
                                if (TileRefs(tileX, tileY).Active && Main.tileDungeon[(int)TileRefs(tileX, tileY).Type])
                                {
                                    flag8 = false;
                                    break;
                                }
                                if (!flag8)
                                {
                                    break;
                                }
                            }
                        }
                        if (jungleLength < 200 && JungleX > chasmStartX && JungleX < chasmEndX)
                        {
                            jungleLength++;
                            flag8 = false;
                        }
                    }
                    int tilePass = 0;
                    for (int tileX = chasmStartX; tileX < chasmEndX; tileX++)
                    {
                        if (tilePass > 0)
                        {
                            tilePass--;
                        }
                        if (tileX == chasmX || tilePass == 0)
                        {
                            int tileY = (int)terrarainMaxY;
                            while ((double)tileY < Main.worldSurface - 1.0)
                            {
                                if (TileRefs(tileX, tileY).Active || TileRefs(tileX, tileY).Wall > 0)
                                {
                                    if (tileX == chasmX)
                                    {
                                        tilePass = 20;
                                        ChasmRunner(TileRefs, tileX, tileY, WorldModify.genRand.Next(150) + 150, true);
                                    }
                                    if (WorldModify.genRand.Next(35) == 0 && tilePass == 0)
                                    {
                                        tilePass = 30;
                                        ChasmRunner(TileRefs, tileX, tileY, WorldModify.genRand.Next(50) + 50, true);
                                    }
                                    break;
                                }
                                else
                                {
                                    tileY++;
                                }
                            }
//.........這裏部分代碼省略.........
開發者ID:emreuyls,項目名稱:Terraria-s-Dedicated-Server-Mod,代碼行數:101,代碼來源:WorldGen.cs

示例14: MakeRandomHoles

        public static void MakeRandomHoles(Func<Int32, Int32, ITile> TileRefs)
        {
            if (TileRefs == null)
                TileRefs = TileCollection.ITileAt;

            var MaxRandomHoles = (int)((double)(Main.maxTilesX * Main.maxTilesY) * 0.0015);

            using (var prog = new ProgressLogger(MaxRandomHoles - 1, Languages.Generation_MakingRandomHoles))
            {
                for (int i = 0; i < MaxRandomHoles; i++)
                {
                    prog.Value = i;

                    int type = -1;
                    if (WorldModify.genRand.Next(5) == 0)
                    {
                        type = -2;
                    }
                    TileRunner(TileRefs, WorldModify.genRand.Next(0, Main.maxTilesX), WorldModify.genRand.Next((int)worldSurface, Main.maxTilesY), (double)WorldModify.genRand.Next(2, 5), WorldModify.genRand.Next(2, 20), type, false, 0f, 0f, false, true);
                    TileRunner(TileRefs, WorldModify.genRand.Next(0, Main.maxTilesX), WorldModify.genRand.Next((int)worldSurface, Main.maxTilesY), (double)WorldModify.genRand.Next(8, 15), WorldModify.genRand.Next(7, 30), type, false, 0f, 0f, false, true);
                }
            }
        }
開發者ID:emreuyls,項目名稱:Terraria-s-Dedicated-Server-Mod,代碼行數:23,代碼來源:WorldGen.cs

示例15: MakeDungeon

        public static void MakeDungeon(Func<Int32, Int32, ITile> TileRefs, int x, int y, int tileType = 41, int wallType = 7)
        {
            if (TileRefs == null)
                TileRefs = TileCollection.ITileAt;

            using (var prog = new ProgressLogger(100, Languages.Generation_CreatingDungeons))
            {
                int num = WorldModify.genRand.Next(3);
                int num2 = WorldModify.genRand.Next(3);
                if (num == 1)
                {
                    tileType = 43;
                }
                else if (num == 2)
                {
                    tileType = 44;
                }
                if (num2 == 1)
                {
                    wallType = 8;
                }
                else if (num2 == 2)
                {
                    wallType = 9;
                }
                numDDoors = 0;
                numDPlats = 0;
                numDRooms = 0;
                dungeonX = x;
                dungeonY = y;
                dMinX = x;
                dMaxX = x;
                dMinY = y;
                dMaxY = y;
                dxStrength1 = (double)WorldModify.genRand.Next(25, 30);
                dyStrength1 = (double)WorldModify.genRand.Next(20, 25);
                dxStrength2 = (double)WorldModify.genRand.Next(35, 50);
                dyStrength2 = (double)WorldModify.genRand.Next(10, 15);
                float num3 = (float)(Main.maxTilesX / 60);
                num3 += (float)WorldModify.genRand.Next(0, (int)(num3 / 3f));
                float num4 = num3;
                int num5 = 5;
                DungeonRoom(TileRefs, dungeonX, dungeonY, tileType, wallType);
                while (num3 > 0f)
                {
                    if (dungeonX < dMinX)
                    {
                        dMinX = dungeonX;
                    }
                    if (dungeonX > dMaxX)
                    {
                        dMaxX = dungeonX;
                    }
                    if (dungeonY > dMaxY)
                    {
                        dMaxY = dungeonY;
                    }
                    num3 -= 1f;

                    prog.Value = (int)((num4 - num3) / num4 * 60f);

                    if (num5 > 0)
                    {
                        num5--;
                    }
                    if (num5 == 0 & WorldModify.genRand.Next(3) == 0)
                    {
                        num5 = 5;
                        if (WorldModify.genRand.Next(2) == 0)
                        {
                            int num6 = dungeonX;
                            int num7 = dungeonY;
                            DungeonHalls(TileRefs, dungeonX, dungeonY, tileType, wallType, false);
                            if (WorldModify.genRand.Next(2) == 0)
                            {
                                DungeonHalls(TileRefs, dungeonX, dungeonY, tileType, wallType, false);
                            }
                            DungeonRoom(TileRefs, dungeonX, dungeonY, tileType, wallType);
                            dungeonX = num6;
                            dungeonY = num7;
                        }
                        else
                        {
                            DungeonRoom(TileRefs, dungeonX, dungeonY, tileType, wallType);
                        }
                    }
                    else
                    {
                        DungeonHalls(TileRefs, dungeonX, dungeonY, tileType, wallType, false);
                    }
                }
                DungeonRoom(TileRefs, dungeonX, dungeonY, tileType, wallType);
                int num8 = dRoomX[0];
                int num9 = dRoomY[0];
                for (int i = 0; i < numDRooms; i++)
                {
                    if (dRoomY[i] < num9)
                    {
                        num8 = dRoomX[i];
                        num9 = dRoomY[i];
//.........這裏部分代碼省略.........
開發者ID:emreuyls,項目名稱:Terraria-s-Dedicated-Server-Mod,代碼行數:101,代碼來源:WorldGen.cs


注:本文中的Terraria_Server.Logging.ProgressLogger類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。