Пример #1
0
        protected override void Initialize()
        {
            if (webProtect)
            {
                this.getAuth();
                while (!webAuth)
                {
                    base.Exit();
                }
            }
            if (rand == null)
            {
                rand = new Random((int) DateTime.Now.Ticks);
            }
            if (WorldGen.genRand == null)
            {
                WorldGen.genRand = new Random((int) DateTime.Now.Ticks);
            }
            this.OpenSettings();
            switch (rand.Next(5))
            {
                case 0:
                    base.Window.Title = "Terraria: Dig Peon, Dig!";
                    break;

                case 1:
                    base.Window.Title = "Terraria: Epic Dirt";
                    break;

                case 2:
                    base.Window.Title = "Terraria: Hey Guys!";
                    break;

                case 3:
                    base.Window.Title = "Terraria: Sand is Overpowered";
                    goto Label_00CF;
            }
            base.Window.Title = "Terraria: Shut Up and Dig Gaiden!";
            Label_00CF:
            tileSolid[0] = true;
            tileBlockLight[0] = true;
            tileSolid[1] = true;
            tileBlockLight[1] = true;
            tileSolid[2] = true;
            tileBlockLight[2] = true;
            tileSolid[3] = false;
            tileNoAttach[3] = true;
            tileNoFail[3] = true;
            tileSolid[4] = false;
            tileNoAttach[4] = true;
            tileNoFail[4] = true;
            tileNoFail[0x18] = true;
            tileSolid[5] = false;
            tileSolid[6] = true;
            tileBlockLight[6] = true;
            tileSolid[7] = true;
            tileBlockLight[7] = true;
            tileSolid[8] = true;
            tileBlockLight[8] = true;
            tileSolid[9] = true;
            tileBlockLight[9] = true;
            tileBlockLight[10] = true;
            tileSolid[10] = true;
            tileNoAttach[10] = true;
            tileBlockLight[10] = true;
            tileSolid[11] = false;
            tileSolidTop[0x13] = true;
            tileSolid[0x13] = true;
            tileSolid[0x16] = true;
            tileSolid[0x17] = true;
            tileSolid[0x19] = true;
            tileSolid[30] = true;
            tileNoFail[0x20] = true;
            tileBlockLight[0x20] = true;
            tileSolid[0x25] = true;
            tileBlockLight[0x25] = true;
            tileSolid[0x26] = true;
            tileBlockLight[0x26] = true;
            tileSolid[0x27] = true;
            tileBlockLight[0x27] = true;
            tileSolid[40] = true;
            tileBlockLight[40] = true;
            tileSolid[0x29] = true;
            tileBlockLight[0x29] = true;
            tileSolid[0x2b] = true;
            tileBlockLight[0x2b] = true;
            tileSolid[0x2c] = true;
            tileBlockLight[0x2c] = true;
            tileSolid[0x2d] = true;
            tileBlockLight[0x2d] = true;
            tileSolid[0x2e] = true;
            tileBlockLight[0x2e] = true;
            tileSolid[0x2f] = true;
            tileBlockLight[0x2f] = true;
            tileSolid[0x30] = true;
            tileBlockLight[0x30] = true;
            tileSolid[0x35] = true;
            tileBlockLight[0x35] = true;
            tileSolid[0x36] = true;
            tileBlockLight[0x34] = true;
            tileSolid[0x38] = true;
            tileBlockLight[0x38] = true;
            tileSolid[0x39] = true;
            tileBlockLight[0x39] = true;
            tileSolid[0x3a] = true;
            tileBlockLight[0x3a] = true;
            tileSolid[0x3b] = true;
            tileBlockLight[0x3b] = true;
            tileSolid[60] = true;
            tileBlockLight[60] = true;
            tileSolid[0x3f] = true;
            tileBlockLight[0x3f] = true;
            tileStone[0x3f] = true;
            tileSolid[0x40] = true;
            tileBlockLight[0x40] = true;
            tileStone[0x40] = true;
            tileSolid[0x41] = true;
            tileBlockLight[0x41] = true;
            tileStone[0x41] = true;
            tileSolid[0x42] = true;
            tileBlockLight[0x42] = true;
            tileStone[0x42] = true;
            tileSolid[0x43] = true;
            tileBlockLight[0x43] = true;
            tileStone[0x43] = true;
            tileSolid[0x44] = true;
            tileBlockLight[0x44] = true;
            tileStone[0x44] = true;
            tileSolid[0x4b] = true;
            tileBlockLight[0x4b] = true;
            tileSolid[0x4c] = true;
            tileBlockLight[0x4c] = true;
            tileSolid[70] = true;
            tileBlockLight[70] = true;
            tileBlockLight[0x33] = true;
            tileNoFail[50] = true;
            tileNoAttach[50] = true;
            tileDungeon[0x29] = true;
            tileDungeon[0x2b] = true;
            tileDungeon[0x2c] = true;
            tileBlockLight[30] = true;
            tileBlockLight[0x19] = true;
            tileBlockLight[0x17] = true;
            tileBlockLight[0x16] = true;
            tileBlockLight[0x3e] = true;
            tileSolidTop[0x12] = true;
            tileSolidTop[14] = true;
            tileSolidTop[0x10] = true;
            tileNoAttach[20] = true;
            tileNoAttach[0x13] = true;
            tileNoAttach[13] = true;
            tileNoAttach[14] = true;
            tileNoAttach[15] = true;
            tileNoAttach[0x10] = true;
            tileNoAttach[0x11] = true;
            tileNoAttach[0x12] = true;
            tileNoAttach[0x13] = true;
            tileNoAttach[0x15] = true;
            tileNoAttach[0x1b] = true;
            tileFrameImportant[3] = true;
            tileFrameImportant[5] = true;
            tileFrameImportant[10] = true;
            tileFrameImportant[11] = true;
            tileFrameImportant[12] = true;
            tileFrameImportant[13] = true;
            tileFrameImportant[14] = true;
            tileFrameImportant[15] = true;
            tileFrameImportant[0x10] = true;
            tileFrameImportant[0x11] = true;
            tileFrameImportant[0x12] = true;
            tileFrameImportant[20] = true;
            tileFrameImportant[0x15] = true;
            tileFrameImportant[0x18] = true;
            tileFrameImportant[0x1a] = true;
            tileFrameImportant[0x1b] = true;
            tileFrameImportant[0x1c] = true;
            tileFrameImportant[0x1d] = true;
            tileFrameImportant[0x1f] = true;
            tileFrameImportant[0x21] = true;
            tileFrameImportant[0x22] = true;
            tileFrameImportant[0x23] = true;
            tileFrameImportant[0x24] = true;
            tileFrameImportant[0x2a] = true;
            tileFrameImportant[50] = true;
            tileFrameImportant[0x37] = true;
            tileFrameImportant[0x3d] = true;
            tileFrameImportant[0x47] = true;
            tileFrameImportant[0x48] = true;
            tileFrameImportant[0x49] = true;
            tileFrameImportant[0x4a] = true;
            tileFrameImportant[0x4d] = true;
            tileFrameImportant[0x4e] = true;
            tileFrameImportant[0x4f] = true;
            tileTable[14] = true;
            tileTable[0x12] = true;
            tileTable[0x13] = true;
            tileWaterDeath[4] = true;
            tileWaterDeath[0x33] = true;
            tileLavaDeath[3] = true;
            tileLavaDeath[5] = true;
            tileLavaDeath[10] = true;
            tileLavaDeath[11] = true;
            tileLavaDeath[12] = true;
            tileLavaDeath[13] = true;
            tileLavaDeath[14] = true;
            tileLavaDeath[15] = true;
            tileLavaDeath[0x10] = true;
            tileLavaDeath[0x11] = true;
            tileLavaDeath[0x12] = true;
            tileLavaDeath[0x13] = true;
            tileLavaDeath[20] = true;
            tileLavaDeath[0x1b] = true;
            tileLavaDeath[0x1c] = true;
            tileLavaDeath[0x1d] = true;
            tileLavaDeath[0x20] = true;
            tileLavaDeath[0x21] = true;
            tileLavaDeath[0x22] = true;
            tileLavaDeath[0x23] = true;
            tileLavaDeath[0x24] = true;
            tileLavaDeath[0x2a] = true;
            tileLavaDeath[0x31] = true;
            tileLavaDeath[50] = true;
            tileLavaDeath[0x34] = true;
            tileLavaDeath[0x37] = true;
            tileLavaDeath[0x3d] = true;
            tileLavaDeath[0x3e] = true;
            tileLavaDeath[0x45] = true;
            tileLavaDeath[0x47] = true;
            tileLavaDeath[0x48] = true;
            tileLavaDeath[0x49] = true;
            tileLavaDeath[0x4a] = true;
            tileLavaDeath[0x4e] = true;
            tileLavaDeath[0x4f] = true;
            wallHouse[1] = true;
            wallHouse[4] = true;
            wallHouse[5] = true;
            wallHouse[6] = true;
            wallHouse[10] = true;
            wallHouse[11] = true;
            wallHouse[12] = true;
            for (int i = 0; i < maxMenuItems; i++)
            {
                this.menuItemScale[i] = 0.8f;
            }
            for (int j = 0; j < 0x7d0; j++)
            {
                dust[j] = new Dust();
            }
            for (int k = 0; k < 0xc9; k++)
            {
                item[k] = new Item();
            }
            for (int m = 0; m < 0x3e9; m++)
            {
                npc[m] = new NPC();
                npc[m].whoAmI = m;
            }
            for (int n = 0; n < 9; n++)
            {
                player[n] = new Player();
            }
            for (int num7 = 0; num7 < 0x3e9; num7++)
            {
                projectile[num7] = new Projectile();
            }
            for (int num8 = 0; num8 < 0xc9; num8++)
            {
                gore[num8] = new Gore();
            }
            for (int num9 = 0; num9 < 100; num9++)
            {
                cloud[num9] = new Cloud();
            }
            for (int num10 = 0; num10 < 100; num10++)
            {
                combatText[num10] = new CombatText();
            }
            for (int num11 = 0; num11 < Recipe.maxRecipes; num11++)
            {
                recipe[num11] = new Recipe();
                availableRecipeY[num11] = 0x41 * num11;
            }
            Recipe.SetupRecipes();
            for (int num12 = 0; num12 < numChatLines; num12++)
            {
                chatLine[num12] = new ChatLine();
            }
            for (int num13 = 0; num13 < Liquid.resLiquid; num13++)
            {
                liquid[num13] = new Liquid();
            }
            for (int num14 = 0; num14 < 0x2710; num14++)
            {
                liquidBuffer[num14] = new LiquidBuffer();
            }
            this.graphics.PreferredBackBufferWidth = screenWidth;
            this.graphics.PreferredBackBufferHeight = screenHeight;
            this.graphics.ApplyChanges();
            this.shop[0] = new Chest();
            this.shop[1] = new Chest();
            this.shop[1].SetupShop(1);
            this.shop[2] = new Chest();
            this.shop[2].SetupShop(2);
            this.shop[3] = new Chest();
            this.shop[3].SetupShop(3);
            this.shop[4] = new Chest();
            this.shop[4].SetupShop(4);
            teamColor[0] = Color.White;
            teamColor[1] = new Color(230, 40, 20);
            teamColor[2] = new Color(20, 200, 30);
            teamColor[3] = new Color(0x4b, 90, 0xff);
            teamColor[4] = new Color(200, 180, 0);
            Netplay.Init();
            if (skipMenu)
            {
                WorldGen.clearWorld();
                gameMenu = false;
                LoadPlayers();
                player[myPlayer] = (Player) loadPlayer[0].Clone();
                PlayerPath = loadPlayerPath[0];
                LoadWorlds();
                WorldGen.generateWorld(-1);
                WorldGen.EveryTileFrame();
                player[myPlayer].Spawn();
            }
            else
            {
                IntPtr systemMenu = GetSystemMenu(base.Window.Handle, false);
                int menuItemCount = GetMenuItemCount(systemMenu);
                RemoveMenu(systemMenu, menuItemCount - 1, 0x400);
            }
            base.Initialize();
            Star.SpawnStars();
        }
Пример #2
0
        protected override void Initialize()
        {
            NPC.clrNames();
            NPC.setNames();
            bgAlpha[0] = 1f;
            bgAlpha2[0] = 1f;
            for (int i = 0; i < 0x6f; i++)
            {
                projFrames[i] = 1;
            }
            projFrames[0x48] = 4;
            projFrames[0x56] = 4;
            projFrames[0x57] = 4;
            projFrames[0x66] = 2;
            debuff[20] = true;
            debuff[0x15] = true;
            debuff[0x16] = true;
            debuff[0x17] = true;
            debuff[0x18] = true;
            debuff[0x19] = true;
            debuff[0x1c] = true;
            debuff[30] = true;
            debuff[0x1f] = true;
            debuff[0x20] = true;
            debuff[0x21] = true;
            debuff[0x22] = true;
            debuff[0x23] = true;
            debuff[0x24] = true;
            debuff[0x25] = true;
            debuff[0x26] = true;
            debuff[0x27] = true;
            buffName[1] = "Obsidian Skin";
            buffTip[1] = "Immune to lava";
            buffName[2] = "Regeneration";
            buffTip[2] = "Provides life regeneration";
            buffName[3] = "Swiftness";
            buffTip[3] = "25% increased movement speed";
            buffName[4] = "Gills";
            buffTip[4] = "Breathe water instead of air";
            buffName[5] = "Ironskin";
            buffTip[5] = "Increase defense by 8";
            buffName[6] = "Mana Regeneration";
            buffTip[6] = "Increased mana regeneration";
            buffName[7] = "Magic Power";
            buffTip[7] = "20% increased magic damage";
            buffName[8] = "Featherfall";
            buffTip[8] = "Press UP or DOWN to control speed of descent";
            buffName[9] = "Spelunker";
            buffTip[9] = "Shows the location of treasure and ore";
            buffName[10] = "Invisibility";
            buffTip[10] = "Grants invisibility";
            buffName[11] = "Shine";
            buffTip[11] = "Emitting light";
            buffName[12] = "Night Owl";
            buffTip[12] = "Increased night vision";
            buffName[13] = "Battle";
            buffTip[13] = "Increased enemy spawn rate";
            buffName[14] = "Thorns";
            buffTip[14] = "Attackers also take damage";
            buffName[15] = "Water Walking";
            buffTip[15] = "Press DOWN to enter water";
            buffName[0x10] = "Archery";
            buffTip[0x10] = "20% increased arrow damage and speed";
            buffName[0x11] = "Hunter";
            buffTip[0x11] = "Shows the location of enemies";
            buffName[0x12] = "Gravitation";
            buffTip[0x12] = "Press UP or DOWN to reverse gravity";
            buffName[0x13] = "Orb of Light";
            buffTip[0x13] = "A magical orb that provides light";
            buffName[20] = "Poisoned";
            buffTip[20] = "Slowly losing life";
            buffName[0x15] = "Potion Sickness";
            buffTip[0x15] = "Cannot consume anymore healing items";
            buffName[0x16] = "Darkness";
            buffTip[0x16] = "Decreased light vision";
            buffName[0x17] = "Cursed";
            buffTip[0x17] = "Cannot use any items";
            buffName[0x18] = "On Fire!";
            buffTip[0x18] = "Slowly losing life";
            buffName[0x19] = "Tipsy";
            buffTip[0x19] = "Increased melee abilities, lowered defense";
            buffName[0x1a] = "Well Fed";
            buffTip[0x1a] = "Minor improvements to all stats";
            buffName[0x1b] = "Fairy";
            buffTip[0x1b] = "A fairy is following you";
            buffName[0x1c] = "Werewolf";
            buffTip[0x1c] = "Physical abilities are increased";
            buffName[0x1d] = "Clairvoyance";
            buffTip[0x1d] = "Magic powers are increased";
            buffName[30] = "Bleeding";
            buffTip[30] = "Cannot regenerate life";
            buffName[0x1f] = "Confused";
            buffTip[0x1f] = "Movement is reversed";
            buffName[0x20] = "Slow";
            buffTip[0x20] = "Movement speed is reduced";
            buffName[0x21] = "Weak";
            buffTip[0x21] = "Physical abilities are decreased";
            buffName[0x22] = "Merfolk";
            buffTip[0x22] = "Can breathe and move easily underwater";
            buffName[0x23] = "Silenced";
            buffTip[0x23] = "Cannot use items that require mana";
            buffName[0x24] = "Broken Armor";
            buffTip[0x24] = "Defense is cut in half";
            buffName[0x25] = "Horrified";
            buffTip[0x25] = "You have seen something nasty, there is no escape.";
            buffName[0x26] = "The Tongue";
            buffTip[0x26] = "You are being sucked into the mouth";
            buffName[0x27] = "Cursed Inferno";
            buffTip[0x27] = "Losing life";
            for (int j = 0; j < 10; j++)
            {
                recentWorld[j] = "";
                recentIP[j] = "";
                recentPort[j] = 0;
            }
            if (rand == null)
            {
                rand = new Random((int)DateTime.Now.Ticks);
            }
            if (WorldGen.genRand == null)
            {
                WorldGen.genRand = new Random((int)DateTime.Now.Ticks);
            }
            switch (rand.Next(15))
            {
                case 0:
                    base.Window.Title = "Terraria: Dig Peon, Dig!";
                    break;

                case 1:
                    base.Window.Title = "Terraria: Epic Dirt";
                    break;

                case 2:
                    base.Window.Title = "Terraria: Hey Guys!";
                    break;

                case 3:
                    base.Window.Title = "Terraria: Sand is Overpowered";
                    break;

                case 4:
                    base.Window.Title = "Terraria Part 3: The Return of the Guide";
                    break;

                case 5:
                    base.Window.Title = "Terraria: A Bunnies Tale";
                    break;

                case 6:
                    base.Window.Title = "Terraria: Dr. Bones and The Temple of Blood Moon";
                    break;

                case 7:
                    base.Window.Title = "Terraria: Slimeassic Park";
                    break;

                case 8:
                    base.Window.Title = "Terraria: The Grass is Greener on This Side";
                    break;

                case 9:
                    base.Window.Title = "Terraria: Small Blocks, Not for Children Under the Age of 5";
                    break;

                case 10:
                    base.Window.Title = "Terraria: Digger T' Blocks";
                    break;

                case 11:
                    base.Window.Title = "Terraria: There is No Cow Layer";
                    break;

                case 12:
                    base.Window.Title = "Terraria: Suspicous Looking Eyeballs";
                    break;

                case 13:
                    base.Window.Title = "Terraria: Purple Grass!";
                    break;

                case 14:
                    base.Window.Title = "Terraria: Noone Dug Behind!";
                    break;

                default:
                    base.Window.Title = "Terraria: Shut Up and Dig Gaiden!";
                    break;
            }
            lo = rand.Next(6);
            //ADDED TILEOPTIONS for flags:  (tiki = 0x56)
            tileHammer[150] = true;
            tileLighted[150] = true;
            tileLavaDeath[150] = true;
            tileFrameImportant[150] = true;
            tileNoAttach[150] = true;
            tileName[150] = "Red Flag";     //CHANGED: ADDED

            tileHammer[151] = true;
            //tileLighted[151] = true;
            tileLavaDeath[151] = true;
            //tileFrameImportant[151] = true;
            tileNoAttach[151] = true;
            tileName[151] = "Blue Flag";     //CHANGED: ADDED

            //ORIG
            tileShine2[6] = true;
            tileShine2[7] = true;
            tileShine2[8] = true;
            tileShine2[9] = true;
            tileShine2[12] = true;
            tileShine2[0x15] = true;
            tileShine2[0x16] = true;
            tileShine2[0x19] = true;
            tileShine2[0x2d] = true;
            tileShine2[0x2e] = true;
            tileShine2[0x2f] = true;
            tileShine2[0x3f] = true;
            tileShine2[0x40] = true;
            tileShine2[0x41] = true;
            tileShine2[0x42] = true;
            tileShine2[0x43] = true;
            tileShine2[0x44] = true;
            tileShine2[0x6b] = true;
            tileShine2[0x6c] = true;
            tileShine2[0x6f] = true;
            tileShine2[0x79] = true;
            tileShine2[0x7a] = true;
            tileShine2[0x75] = true;
            tileShine[0x81] = 300;
            tileHammer[0x8d] = true;
            tileHammer[4] = true;
            tileHammer[10] = true;
            tileHammer[11] = true;
            tileHammer[12] = true;
            tileHammer[13] = true;
            tileHammer[14] = true;
            tileHammer[15] = true;
            tileHammer[0x10] = true;
            tileHammer[0x11] = true;
            tileHammer[0x12] = true;
            tileHammer[0x13] = true;
            tileHammer[0x15] = true;
            tileHammer[0x1a] = true;
            tileHammer[0x1c] = true;
            tileHammer[0x1d] = true;
            tileHammer[0x1f] = true;
            tileHammer[0x21] = true;
            tileHammer[0x22] = true;
            tileHammer[0x23] = true;
            tileHammer[0x24] = true;
            tileHammer[0x2a] = true;
            tileHammer[0x30] = true;
            tileHammer[0x31] = true;
            tileHammer[50] = true;
            tileHammer[0x36] = true;
            tileHammer[0x37] = true;
            tileHammer[0x4d] = true;
            tileHammer[0x4e] = true;
            tileHammer[0x4f] = true;
            tileHammer[0x51] = true;
            tileHammer[0x55] = true;
            tileHammer[0x56] = true;
            tileHammer[0x57] = true;
            tileHammer[0x58] = true;
            tileHammer[0x59] = true;
            tileHammer[90] = true;
            tileHammer[0x5b] = true;
            tileHammer[0x5c] = true;
            tileHammer[0x5d] = true;
            tileHammer[0x5e] = true;
            tileHammer[0x5f] = true;
            tileHammer[0x60] = true;
            tileHammer[0x61] = true;
            tileHammer[0x62] = true;
            tileHammer[0x63] = true;
            tileHammer[100] = true;
            tileHammer[0x65] = true;
            tileHammer[0x66] = true;
            tileHammer[0x67] = true;
            tileHammer[0x68] = true;
            tileHammer[0x69] = true;
            tileHammer[0x6a] = true;
            tileHammer[0x72] = true;
            tileHammer[0x7d] = true;
            tileHammer[0x7e] = true;
            tileHammer[0x80] = true;
            tileHammer[0x81] = true;
            tileHammer[0x84] = true;
            tileHammer[0x85] = true;
            tileHammer[0x86] = true;
            tileHammer[0x87] = true;
            tileHammer[0x88] = true;
            tileFrameImportant[0x8b] = true;
            tileHammer[0x8b] = true;
            tileLighted[0x95] = true;
            tileFrameImportant[0x95] = true;
            tileHammer[0x95] = true;
            tileFrameImportant[0x8e] = true;
            tileHammer[0x8e] = true;
            tileFrameImportant[0x8f] = true;
            tileHammer[0x8f] = true;
            tileFrameImportant[0x90] = true;
            tileHammer[0x90] = true;
            tileStone[0x83] = true;
            tileFrameImportant[0x88] = true;
            tileFrameImportant[0x89] = true;
            tileFrameImportant[0x8a] = true;
            tileBlockLight[0x89] = true;
            tileSolid[0x89] = true;
            tileBlockLight[0x91] = true;
            tileSolid[0x91] = true;
            tileMergeDirt[0x91] = true;
            tileBlockLight[0x92] = true;
            tileSolid[0x92] = true;
            tileMergeDirt[0x92] = true;
            tileBlockLight[0x93] = true;
            tileSolid[0x93] = true;
            tileMergeDirt[0x93] = true;
            tileBlockLight[0x94] = true;
            tileSolid[0x94] = true;
            tileMergeDirt[0x94] = true;
            tileBlockLight[0x8a] = true;
            tileSolid[0x8a] = true;
            tileBlockLight[140] = true;
            tileSolid[140] = true;
            tileAxe[5] = true;
            tileAxe[30] = true;
            tileAxe[0x48] = true;
            tileAxe[80] = true;
            tileAxe[0x7c] = true;
            tileShine[0x16] = 0x47e;
            tileShine[6] = 0x47e;
            tileShine[7] = 0x44c;
            tileShine[8] = 0x3e8;
            tileShine[9] = 0x41a;
            tileShine[12] = 0x3e8;
            tileShine[0x15] = 0x4b0;
            tileShine[0x3f] = 900;
            tileShine[0x40] = 900;
            tileShine[0x41] = 900;
            tileShine[0x42] = 900;
            tileShine[0x43] = 900;
            tileShine[0x44] = 900;
            tileShine[0x2d] = 0x76c;
            tileShine[0x2e] = 0x7d0;
            tileShine[0x2f] = 0x834;
            tileShine[0x7a] = 0x708;
            tileShine[0x79] = 0x73a;
            tileShine[0x7d] = 600;
            tileShine[0x6d] = 0x2328;
            tileShine[110] = 0x2328;
            tileShine[0x74] = 0x2328;
            tileShine[0x75] = 0x2328;
            tileShine[0x76] = 0x1f40;
            tileShine[0x6b] = 950;
            tileShine[0x6c] = 900;
            tileShine[0x6f] = 850;
            tileLighted[4] = true;
            tileLighted[0x11] = true;
            tileLighted[0x85] = true;
            tileLighted[0x1f] = true;
            tileLighted[0x21] = true;
            tileLighted[0x22] = true;
            tileLighted[0x23] = true;
            tileLighted[0x24] = true;
            tileLighted[0x25] = true;
            tileLighted[0x2a] = true;
            tileLighted[0x31] = true;
            tileLighted[0x3a] = true;
            tileLighted[0x3d] = true;
            tileLighted[70] = true;
            tileLighted[0x47] = true;
            tileLighted[0x48] = true;
            tileLighted[0x4c] = true;
            tileLighted[0x4d] = true;
            tileLighted[0x13] = true;
            tileLighted[0x16] = true;
            tileLighted[0x1a] = true;
            tileLighted[0x53] = true;
            tileLighted[0x54] = true;
            tileLighted[0x5c] = true;
            tileLighted[0x5d] = true;
            tileLighted[0x5f] = true;
            tileLighted[0x62] = true;
            tileLighted[100] = true;
            tileLighted[0x6d] = true;
            tileLighted[0x7d] = true;
            tileLighted[0x7e] = true;
            tileLighted[0x81] = true;
            tileLighted[140] = true;
            tileMergeDirt[1] = true;
            tileMergeDirt[6] = true;
            tileMergeDirt[7] = true;
            tileMergeDirt[8] = true;
            tileMergeDirt[9] = true;
            tileMergeDirt[0x16] = true;
            tileMergeDirt[0x19] = true;
            tileMergeDirt[30] = true;
            tileMergeDirt[0x25] = true;
            tileMergeDirt[0x26] = true;
            tileMergeDirt[40] = true;
            tileMergeDirt[0x35] = true;
            tileMergeDirt[0x38] = true;
            tileMergeDirt[0x6b] = true;
            tileMergeDirt[0x6c] = true;
            tileMergeDirt[0x6f] = true;
            tileMergeDirt[0x70] = true;
            tileMergeDirt[0x74] = true;
            tileMergeDirt[0x75] = true;
            tileMergeDirt[0x7b] = true;
            tileMergeDirt[140] = true;
            tileMergeDirt[0x27] = true;
            tileMergeDirt[0x7a] = true;
            tileMergeDirt[0x79] = true;
            tileMergeDirt[120] = true;
            tileMergeDirt[0x77] = true;
            tileMergeDirt[0x76] = true;
            tileMergeDirt[0x2f] = true;
            tileMergeDirt[0x2e] = true;
            tileMergeDirt[0x2d] = true;
            tileMergeDirt[0x2c] = true;
            tileMergeDirt[0x2b] = true;
            tileMergeDirt[0x29] = true;
            tileFrameImportant[3] = true;
            tileFrameImportant[4] = true;
            tileFrameImportant[5] = true;
            tileFrameImportant[10] = true;
            tileFrameImportant[11] = true;
            tileFrameImportant[12] = true;
            tileFrameImportant[13] = true;
            tileFrameImportant[14] = true;
            tileFrameImportant[15] = true;
            tileFrameImportant[0x10] = true;
            tileFrameImportant[0x11] = true;
            tileFrameImportant[0x12] = true;
            tileFrameImportant[20] = true;
            tileFrameImportant[0x15] = true;
            tileFrameImportant[0x18] = true;
            tileFrameImportant[0x1a] = true;
            tileFrameImportant[0x1b] = true;
            tileFrameImportant[0x1c] = true;
            tileFrameImportant[0x1d] = true;
            tileFrameImportant[0x1f] = true;
            tileFrameImportant[0x21] = true;
            tileFrameImportant[0x22] = true;
            tileFrameImportant[0x23] = true;
            tileFrameImportant[0x24] = true;
            tileFrameImportant[0x2a] = true;
            tileFrameImportant[50] = true;
            tileFrameImportant[0x37] = true;
            tileFrameImportant[0x3d] = true;
            tileFrameImportant[0x47] = true;
            tileFrameImportant[0x48] = true;
            tileFrameImportant[0x49] = true;
            tileFrameImportant[0x4a] = true;
            tileFrameImportant[0x4d] = true;
            tileFrameImportant[0x4e] = true;
            tileFrameImportant[0x4f] = true;
            tileFrameImportant[0x51] = true;
            tileFrameImportant[0x52] = true;
            tileFrameImportant[0x53] = true;
            tileFrameImportant[0x54] = true;
            tileFrameImportant[0x55] = true;
            tileFrameImportant[0x56] = true;
            tileFrameImportant[0x57] = true;
            tileFrameImportant[0x58] = true;
            tileFrameImportant[0x59] = true;
            tileFrameImportant[90] = true;
            tileFrameImportant[0x5b] = true;
            tileFrameImportant[0x5c] = true;
            tileFrameImportant[0x5d] = true;
            tileFrameImportant[0x5e] = true;
            tileFrameImportant[0x5f] = true;
            tileFrameImportant[0x60] = true;
            tileFrameImportant[0x61] = true;
            tileFrameImportant[0x62] = true;
            tileFrameImportant[0x63] = true;
            tileFrameImportant[0x65] = true;
            tileFrameImportant[0x66] = true;
            tileFrameImportant[0x67] = true;
            tileFrameImportant[0x68] = true;
            tileFrameImportant[0x69] = true;
            tileFrameImportant[100] = true;
            tileFrameImportant[0x6a] = true;
            tileFrameImportant[110] = true;
            tileFrameImportant[0x71] = true;
            tileFrameImportant[0x72] = true;
            tileFrameImportant[0x7d] = true;
            tileFrameImportant[0x7e] = true;
            tileFrameImportant[0x80] = true;
            tileFrameImportant[0x81] = true;
            tileFrameImportant[0x84] = true;
            tileFrameImportant[0x85] = true;
            tileFrameImportant[0x86] = true;
            tileFrameImportant[0x87] = true;
            tileFrameImportant[0x8d] = true;
            tileCut[3] = true;
            tileCut[0x18] = true;
            tileCut[0x1c] = true;
            tileCut[0x20] = true;
            tileCut[0x33] = true;
            tileCut[0x34] = true;
            tileCut[0x3d] = true;
            tileCut[0x3e] = true;
            tileCut[0x45] = true;
            tileCut[0x47] = true;
            tileCut[0x49] = true;
            tileCut[0x4a] = true;
            tileCut[0x52] = true;
            tileCut[0x53] = true;
            tileCut[0x54] = true;
            tileCut[110] = true;
            tileCut[0x71] = true;
            tileCut[0x73] = true;
            tileAlch[0x52] = true;
            tileAlch[0x53] = true;
            tileAlch[0x54] = true;
            tileLavaDeath[0x68] = true;
            tileLavaDeath[110] = true;
            tileLavaDeath[0x71] = true;
            tileLavaDeath[0x73] = true;
            tileSolid[0x7f] = true;
            tileSolid[130] = true;
            tileBlockLight[130] = true;
            tileBlockLight[0x83] = true;
            tileSolid[0x6b] = true;
            tileBlockLight[0x6b] = true;
            tileSolid[0x6c] = true;
            tileBlockLight[0x6c] = true;
            tileSolid[0x6f] = true;
            tileBlockLight[0x6f] = true;
            tileSolid[0x6d] = true;
            tileBlockLight[0x6d] = true;
            tileSolid[110] = false;
            tileNoAttach[110] = true;
            tileNoFail[110] = true;
            tileSolid[0x70] = true;
            tileBlockLight[0x70] = true;
            tileSolid[0x74] = true;
            tileBlockLight[0x74] = true;
            tileSolid[0x75] = true;
            tileBlockLight[0x75] = true;
            tileSolid[0x7b] = true;
            tileBlockLight[0x7b] = true;
            tileSolid[0x76] = true;
            tileBlockLight[0x76] = true;
            tileSolid[0x77] = true;
            tileBlockLight[0x77] = true;
            tileSolid[120] = true;
            tileBlockLight[120] = true;
            tileSolid[0x79] = true;
            tileBlockLight[0x79] = true;
            tileSolid[0x7a] = true;
            tileBlockLight[0x7a] = true;
            tileBlockLight[0x73] = true;
            tileSolid[0] = true;
            tileBlockLight[0] = true;
            tileSolid[1] = true;
            tileBlockLight[1] = true;
            tileSolid[2] = true;
            tileBlockLight[2] = true;
            tileSolid[3] = false;
            tileNoAttach[3] = true;
            tileNoFail[3] = true;
            tileSolid[4] = false;
            tileNoAttach[4] = true;
            tileNoFail[4] = true;
            tileNoFail[0x18] = true;
            tileSolid[5] = false;
            tileSolid[6] = true;
            tileBlockLight[6] = true;
            tileSolid[7] = true;
            tileBlockLight[7] = true;
            tileSolid[8] = true;
            tileBlockLight[8] = true;
            tileSolid[9] = true;
            tileBlockLight[9] = true;
            tileBlockLight[10] = true;
            tileSolid[10] = true;
            tileNoAttach[10] = true;
            tileBlockLight[10] = true;
            tileSolid[11] = false;
            tileSolidTop[0x13] = true;
            tileSolid[0x13] = true;
            tileSolid[0x16] = true;
            tileSolid[0x17] = true;
            tileSolid[0x19] = true;
            tileSolid[30] = true;
            tileNoFail[0x20] = true;
            tileBlockLight[0x20] = true;
            tileSolid[0x25] = true;
            tileBlockLight[0x25] = true;
            tileSolid[0x26] = true;
            tileBlockLight[0x26] = true;
            tileSolid[0x27] = true;
            tileBlockLight[0x27] = true;
            tileSolid[40] = true;
            tileBlockLight[40] = true;
            tileSolid[0x29] = true;
            tileBlockLight[0x29] = true;
            tileSolid[0x2b] = true;
            tileBlockLight[0x2b] = true;
            tileSolid[0x2c] = true;
            tileBlockLight[0x2c] = true;
            tileSolid[0x2d] = true;
            tileBlockLight[0x2d] = true;
            tileSolid[0x2e] = true;
            tileBlockLight[0x2e] = true;
            tileSolid[0x2f] = true;
            tileBlockLight[0x2f] = true;
            tileSolid[0x30] = true;
            tileBlockLight[0x30] = true;
            tileSolid[0x35] = true;
            tileBlockLight[0x35] = true;
            tileSolid[0x36] = true;
            tileBlockLight[0x34] = true;
            tileSolid[0x38] = true;
            tileBlockLight[0x38] = true;
            tileSolid[0x39] = true;
            tileBlockLight[0x39] = true;
            tileSolid[0x3a] = true;
            tileBlockLight[0x3a] = true;
            tileSolid[0x3b] = true;
            tileBlockLight[0x3b] = true;
            tileSolid[60] = true;
            tileBlockLight[60] = true;
            tileSolid[0x3f] = true;
            tileBlockLight[0x3f] = true;
            tileStone[0x3f] = true;
            tileStone[130] = true;
            tileSolid[0x40] = true;
            tileBlockLight[0x40] = true;
            tileStone[0x40] = true;
            tileSolid[0x41] = true;
            tileBlockLight[0x41] = true;
            tileStone[0x41] = true;
            tileSolid[0x42] = true;
            tileBlockLight[0x42] = true;
            tileStone[0x42] = true;
            tileSolid[0x43] = true;
            tileBlockLight[0x43] = true;
            tileStone[0x43] = true;
            tileSolid[0x44] = true;
            tileBlockLight[0x44] = true;
            tileStone[0x44] = true;
            tileSolid[0x4b] = true;
            tileBlockLight[0x4b] = true;
            tileSolid[0x4c] = true;
            tileBlockLight[0x4c] = true;
            tileSolid[70] = true;
            tileBlockLight[70] = true;
            tileNoFail[50] = true;
            tileNoAttach[50] = true;
            tileDungeon[0x29] = true;
            tileDungeon[0x2b] = true;
            tileDungeon[0x2c] = true;
            tileBlockLight[30] = true;
            tileBlockLight[0x19] = true;
            tileBlockLight[0x17] = true;
            tileBlockLight[0x16] = true;
            tileBlockLight[0x3e] = true;
            tileSolidTop[0x12] = true;
            tileSolidTop[14] = true;
            tileSolidTop[0x10] = true;
            tileSolidTop[0x72] = true;
            tileNoAttach[20] = true;
            tileNoAttach[0x13] = true;
            tileNoAttach[13] = true;
            tileNoAttach[14] = true;
            tileNoAttach[15] = true;
            tileNoAttach[0x10] = true;
            tileNoAttach[0x11] = true;
            tileNoAttach[0x12] = true;
            tileNoAttach[0x13] = true;
            tileNoAttach[0x15] = true;
            tileNoAttach[0x1b] = true;
            tileNoAttach[0x72] = true;
            tileTable[14] = true;
            tileTable[0x12] = true;
            tileTable[0x13] = true;
            tileTable[0x72] = true;
            tileNoAttach[0x56] = true;
            tileNoAttach[0x57] = true;
            tileNoAttach[0x58] = true;
            tileNoAttach[0x59] = true;
            tileNoAttach[90] = true;
            tileLavaDeath[0x56] = true;
            tileLavaDeath[0x57] = true;
            tileLavaDeath[0x58] = true;
            tileLavaDeath[0x59] = true;
            tileLavaDeath[0x7d] = true;
            tileLavaDeath[0x7e] = true;
            tileLavaDeath[0x65] = true;
            tileTable[0x65] = true;
            tileNoAttach[0x65] = true;
            tileLavaDeath[0x66] = true;
            tileNoAttach[0x66] = true;
            tileNoAttach[0x5e] = true;
            tileNoAttach[0x5f] = true;
            tileNoAttach[0x60] = true;
            tileNoAttach[0x61] = true;
            tileNoAttach[0x62] = true;
            tileNoAttach[0x63] = true;
            tileLavaDeath[0x5e] = true;
            tileLavaDeath[0x5f] = true;
            tileLavaDeath[0x60] = true;
            tileLavaDeath[0x61] = true;
            tileLavaDeath[0x62] = true;
            tileLavaDeath[0x63] = true;
            tileLavaDeath[100] = true;
            tileLavaDeath[0x67] = true;
            tileTable[0x57] = true;
            tileTable[0x58] = true;
            tileSolidTop[0x57] = true;
            tileSolidTop[0x58] = true;
            tileSolidTop[0x65] = true;
            tileNoAttach[0x5b] = true;
            tileLavaDeath[0x5b] = true;
            tileNoAttach[0x5c] = true;
            tileLavaDeath[0x5c] = true;
            tileNoAttach[0x5d] = true;
            tileLavaDeath[0x5d] = true;
            tileWaterDeath[4] = true;
            tileWaterDeath[0x33] = true;
            tileWaterDeath[0x5d] = true;
            tileWaterDeath[0x62] = true;
            tileLavaDeath[3] = true;
            tileLavaDeath[5] = true;
            tileLavaDeath[10] = true;
            tileLavaDeath[11] = true;
            tileLavaDeath[12] = true;
            tileLavaDeath[13] = true;
            tileLavaDeath[14] = true;
            tileLavaDeath[15] = true;
            tileLavaDeath[0x10] = true;
            tileLavaDeath[0x11] = true;
            tileLavaDeath[0x12] = true;
            tileLavaDeath[0x13] = true;
            tileLavaDeath[20] = true;
            tileLavaDeath[0x1b] = true;
            tileLavaDeath[0x1c] = true;
            tileLavaDeath[0x1d] = true;
            tileLavaDeath[0x20] = true;
            tileLavaDeath[0x21] = true;
            tileLavaDeath[0x22] = true;
            tileLavaDeath[0x23] = true;
            tileLavaDeath[0x24] = true;
            tileLavaDeath[0x2a] = true;
            tileLavaDeath[0x31] = true;
            tileLavaDeath[50] = true;
            tileLavaDeath[0x34] = true;
            tileLavaDeath[0x37] = true;
            tileLavaDeath[0x3d] = true;
            tileLavaDeath[0x3e] = true;
            tileLavaDeath[0x45] = true;
            tileLavaDeath[0x47] = true;
            tileLavaDeath[0x48] = true;
            tileLavaDeath[0x49] = true;
            tileLavaDeath[0x4a] = true;
            tileLavaDeath[0x4f] = true;
            tileLavaDeath[80] = true;
            tileLavaDeath[0x51] = true;
            tileLavaDeath[0x6a] = true;
            wallHouse[1] = true;
            wallHouse[4] = true;
            wallHouse[5] = true;
            wallHouse[6] = true;
            wallHouse[10] = true;
            wallHouse[11] = true;
            wallHouse[12] = true;
            wallHouse[0x10] = true;
            wallHouse[0x11] = true;
            wallHouse[0x12] = true;
            wallHouse[0x13] = true;
            wallHouse[20] = true;
            wallHouse[0x15] = true;
            wallHouse[0x16] = true;
            wallHouse[0x17] = true;
            wallHouse[0x18] = true;
            wallHouse[0x19] = true;
            wallHouse[0x1a] = true;
            wallHouse[0x1b] = true;
            wallHouse[0x1d] = true;
            wallHouse[30] = true;
            wallHouse[0x1f] = true;
            for (int k = 0; k < 0x20; k++)
            {
                switch (k)
                {
                    case 20:
                        wallBlend[k] = 14;
                        break;

                    case 0x13:
                        wallBlend[k] = 9;
                        break;

                    case 0x12:
                        wallBlend[k] = 8;
                        break;

                    case 0x11:
                        wallBlend[k] = 7;
                        break;

                    case 0x10:
                        wallBlend[k] = 2;
                        break;

                    default:
                        wallBlend[k] = k;
                        break;
                }
            }
            tileNoFail[0x20] = true;
            tileNoFail[0x3d] = true;
            tileNoFail[0x45] = true;
            tileNoFail[0x49] = true;
            tileNoFail[0x4a] = true;
            tileNoFail[0x52] = true;
            tileNoFail[0x53] = true;
            tileNoFail[0x54] = true;
            tileNoFail[110] = true;
            tileNoFail[0x71] = true;
            for (int m = 0; m < maxTileSets; m++)    //CHANGED: orig 150
            {
                tileName[m] = "";
                if (tileSolid[m])
                {
                    tileNoSunLight[m] = true;
                }
            }
            tileNoSunLight[0x13] = false;
            tileNoSunLight[11] = true;
            tileName[13] = "Bottle";
            tileName[14] = "Table";
            tileName[15] = "Chair";
            tileName[0x10] = "Anvil";
            tileName[0x11] = "Furnace";
            tileName[0x12] = "Workbench";
            tileName[0x1a] = "Demon Altar";
            tileName[0x4d] = "Hellforge";
            tileName[0x56] = "Loom";
            tileName[0x5e] = "Keg";
            tileName[0x60] = "Cooking Pot";
            tileName[0x65] = "Bookcase";
            tileName[0x6a] = "Sawmill";
            tileName[0x72] = "Tinkerer's Workshop";
            tileName[0x85] = "Adamantite Forge";
            tileName[0x86] = "Mythril Anvil";

            for (int n = 0; n < maxMenuItems; n++)
            {
                this.menuItemScale[n] = 0.8f;
            }
            for (int num7 = 0; num7 < 0x7d1; num7++)
            {
                dust[num7] = new Dust();
            }
            for (int num8 = 0; num8 < 0xc9; num8++)
            {
                Main.item[num8] = new Item();
            }
            for (int num9 = 0; num9 < 0xc9; num9++)
            {
                npc[num9] = new NPC();
                npc[num9].whoAmI = num9;
            }
            for (int num10 = 0; num10 < 0x100; num10++)
            {
                player[num10] = new Player();
            }
            for (int num11 = 0; num11 < 0x3e9; num11++)
            {
                projectile[num11] = new Projectile();
            }
            for (int num12 = 0; num12 < 0xc9; num12++)
            {
                gore[num12] = new Gore();
            }
            for (int num13 = 0; num13 < 100; num13++)
            {
                cloud[num13] = new Cloud();
            }
            for (int num14 = 0; num14 < 100; num14++)
            {
                combatText[num14] = new CombatText();
            }
            for (int num15 = 0; num15 < 20; num15++)
            {
                itemText[num15] = new ItemText();
            }
            for (int num16 = 0; num16 < maxItemTypes; num16++) //CHANGED, orig 0x25b
            {
                Item item = new Item();
                item.SetDefaults(num16, false);
                itemName[num16] = item.name;
                if (item.headSlot > 0)
                {
                    Item.headType[item.headSlot] = item.type;
                }
                if (item.bodySlot > 0)
                {
                    Item.bodyType[item.bodySlot] = item.type;
                }
                if (item.legSlot > 0)
                {
                    Item.legType[item.legSlot] = item.type;
                }
            }
            for (int num17 = 0; num17 < Recipe.maxRecipes; num17++)
            {
                recipe[num17] = new Recipe();
                availableRecipeY[num17] = 0x41 * num17;
            }
            Recipe.SetupRecipes();
            for (int num18 = 0; num18 < numChatLines; num18++)
            {
                chatLine[num18] = new ChatLine();
            }
            for (int num19 = 0; num19 < Liquid.resLiquid; num19++)
            {
                liquid[num19] = new Liquid();
            }
            for (int num20 = 0; num20 < 0x2710; num20++)
            {
                liquidBuffer[num20] = new LiquidBuffer();
            }
            this.shop[0] = new Chest();
            this.shop[1] = new Chest();
            this.shop[1].SetupShop(1);
            this.shop[2] = new Chest();
            this.shop[2].SetupShop(2);
            this.shop[3] = new Chest();
            this.shop[3].SetupShop(3);
            this.shop[4] = new Chest();
            this.shop[4].SetupShop(4);
            this.shop[5] = new Chest();
            this.shop[5].SetupShop(5);
            this.shop[6] = new Chest();
            this.shop[6].SetupShop(6);
            this.shop[7] = new Chest();
            this.shop[7].SetupShop(7);
            this.shop[8] = new Chest();
            this.shop[8].SetupShop(8);
            this.shop[9] = new Chest();
            this.shop[9].SetupShop(9);
            teamColor[0] = Color.White;
            teamColor[1] = new Color(230, 40, 20);
            teamColor[2] = new Color(20, 200, 30);
            teamColor[3] = new Color(0x4b, 90, 0xff);
            teamColor[4] = new Color(200, 180, 0);
            if (menuMode == 1)
            {
                LoadPlayers();
            }
            Netplay.Init();
            /*if (skipMenu) // CHANGED: wasnt working so made new skipmenu (line 17280)
            {
                WorldGen.clearWorld();
                gameMenu = false;
                LoadPlayers();
                player[myPlayer] = (Player)loadPlayer[0].Clone();
                PlayerPath = loadPlayerPath[0];
                LoadWorlds();
                WorldGen.generateWorld(-1);
                WorldGen.EveryTileFrame();
                player[myPlayer].Spawn();
            }
            else
            {*/
                IntPtr systemMenu = GetSystemMenu(base.Window.Handle, false);
                int menuItemCount = GetMenuItemCount(systemMenu);
                RemoveMenu(systemMenu, menuItemCount - 1, 0x400);
            //}
            if (!dedServ)
            {
                this.graphics.PreferredBackBufferWidth = screenWidth;
                this.graphics.PreferredBackBufferHeight = screenHeight;
                this.graphics.ApplyChanges();
                base.Initialize();
                base.Window.AllowUserResizing = true;
                this.OpenSettings();
                this.OpenRecent();
                Star.SpawnStars();
                foreach (DisplayMode mode in GraphicsAdapter.DefaultAdapter.SupportedDisplayModes)
                {
                    if (((mode.Width < minScreenW) || (mode.Height < minScreenH)) || ((mode.Width > maxScreenW) || (mode.Height > maxScreenH)))
                    {
                        continue;
                    }
                    bool flag = true;
                    for (int num22 = 0; num22 < this.numDisplayModes; num22++)
                    {
                        if ((mode.Width == this.displayWidth[num22]) && (mode.Height == this.displayHeight[num22]))
                        {
                            flag = false;
                            break;
                        }
                    }
                    if (flag)
                    {
                        this.displayHeight[this.numDisplayModes] = mode.Height;
                        this.displayWidth[this.numDisplayModes] = mode.Width;
                        this.numDisplayModes++;
                    }
                }
                if (autoJoin)
                {
                    LoadPlayers();
                    menuMode = 1;
                    menuMultiplayer = true;
                }
                fpsTimer.Start();
                updateTimer.Start();
            }
            if(Mods.ModMain.skipMenu)
            {
                Mods.ModMain.skipMenus();   //CHANGED: Try to skip menus
            }
        }
Пример #3
0
        protected override void Initialize()
        {
            if (rand == null)
            {
                rand = new Random((int) DateTime.Now.Ticks);
            }
            if (WorldGen.genRand == null)
            {
                WorldGen.genRand = new Random((int) DateTime.Now.Ticks);
            }
            switch (rand.Next(5))
            {
                case 0:
                    base.Window.Title = "Terraria: Dig Peon, Dig!";
                    break;

                case 1:
                    base.Window.Title = "Terraria: Epic Dirt";
                    break;

                case 2:
                    base.Window.Title = "Terraria: Hey Guys!";
                    break;

                case 3:
                    base.Window.Title = "Terraria: Sand is Overpowered";
                    goto Label_00AD;
            }
            base.Window.Title = "Terraria: Shut Up and Dig Gaiden!";
            Label_00AD:
            tileShine[0x16] = 0x47e;
            tileShine[6] = 0x47e;
            tileShine[7] = 0x44c;
            tileShine[8] = 0x3e8;
            tileShine[9] = 0x41a;
            tileShine[12] = 0x3e8;
            tileShine[0x15] = 0x3e8;
            tileShine[0x3f] = 900;
            tileShine[0x40] = 900;
            tileShine[0x41] = 900;
            tileShine[0x42] = 900;
            tileShine[0x43] = 900;
            tileShine[0x44] = 900;
            tileShine[0x2d] = 0x76c;
            tileShine[0x2e] = 0x7d0;
            tileShine[0x2f] = 0x834;
            tileCut[3] = true;
            tileCut[0x18] = true;
            tileCut[0x1c] = true;
            tileCut[0x20] = true;
            tileCut[0x33] = true;
            tileCut[0x34] = true;
            tileCut[0x3d] = true;
            tileCut[0x3e] = true;
            tileCut[0x45] = true;
            tileCut[0x47] = true;
            tileCut[0x49] = true;
            tileCut[0x4a] = true;
            tileCut[0x52] = true;
            tileCut[0x53] = true;
            tileCut[0x54] = true;
            tileAlch[0x52] = true;
            tileAlch[0x53] = true;
            tileAlch[0x54] = true;
            tileFrameImportant[0x52] = true;
            tileFrameImportant[0x53] = true;
            tileFrameImportant[0x54] = true;
            tileFrameImportant[0x55] = true;
            tileSolid[0] = true;
            tileBlockLight[0] = true;
            tileSolid[1] = true;
            tileBlockLight[1] = true;
            tileSolid[2] = true;
            tileBlockLight[2] = true;
            tileSolid[3] = false;
            tileNoAttach[3] = true;
            tileNoFail[3] = true;
            tileSolid[4] = false;
            tileNoAttach[4] = true;
            tileNoFail[4] = true;
            tileNoFail[0x18] = true;
            tileSolid[5] = false;
            tileSolid[6] = true;
            tileBlockLight[6] = true;
            tileSolid[7] = true;
            tileBlockLight[7] = true;
            tileSolid[8] = true;
            tileBlockLight[8] = true;
            tileSolid[9] = true;
            tileBlockLight[9] = true;
            tileBlockLight[10] = true;
            tileSolid[10] = true;
            tileNoAttach[10] = true;
            tileBlockLight[10] = true;
            tileSolid[11] = false;
            tileSolidTop[0x13] = true;
            tileSolid[0x13] = true;
            tileSolid[0x16] = true;
            tileSolid[0x17] = true;
            tileSolid[0x19] = true;
            tileSolid[30] = true;
            tileNoFail[0x20] = true;
            tileBlockLight[0x20] = true;
            tileSolid[0x25] = true;
            tileBlockLight[0x25] = true;
            tileSolid[0x26] = true;
            tileBlockLight[0x26] = true;
            tileSolid[0x27] = true;
            tileBlockLight[0x27] = true;
            tileSolid[40] = true;
            tileBlockLight[40] = true;
            tileSolid[0x29] = true;
            tileBlockLight[0x29] = true;
            tileSolid[0x2b] = true;
            tileBlockLight[0x2b] = true;
            tileSolid[0x2c] = true;
            tileBlockLight[0x2c] = true;
            tileSolid[0x2d] = true;
            tileBlockLight[0x2d] = true;
            tileSolid[0x2e] = true;
            tileBlockLight[0x2e] = true;
            tileSolid[0x2f] = true;
            tileBlockLight[0x2f] = true;
            tileSolid[0x30] = true;
            tileBlockLight[0x30] = true;
            tileSolid[0x35] = true;
            tileBlockLight[0x35] = true;
            tileSolid[0x36] = true;
            tileBlockLight[0x34] = true;
            tileSolid[0x38] = true;
            tileBlockLight[0x38] = true;
            tileSolid[0x39] = true;
            tileBlockLight[0x39] = true;
            tileSolid[0x3a] = true;
            tileBlockLight[0x3a] = true;
            tileSolid[0x3b] = true;
            tileBlockLight[0x3b] = true;
            tileSolid[60] = true;
            tileBlockLight[60] = true;
            tileSolid[0x3f] = true;
            tileBlockLight[0x3f] = true;
            tileStone[0x3f] = true;
            tileSolid[0x40] = true;
            tileBlockLight[0x40] = true;
            tileStone[0x40] = true;
            tileSolid[0x41] = true;
            tileBlockLight[0x41] = true;
            tileStone[0x41] = true;
            tileSolid[0x42] = true;
            tileBlockLight[0x42] = true;
            tileStone[0x42] = true;
            tileSolid[0x43] = true;
            tileBlockLight[0x43] = true;
            tileStone[0x43] = true;
            tileSolid[0x44] = true;
            tileBlockLight[0x44] = true;
            tileStone[0x44] = true;
            tileSolid[0x4b] = true;
            tileBlockLight[0x4b] = true;
            tileSolid[0x4c] = true;
            tileBlockLight[0x4c] = true;
            tileSolid[70] = true;
            tileBlockLight[70] = true;
            tileBlockLight[0x33] = true;
            tileNoFail[50] = true;
            tileNoAttach[50] = true;
            tileDungeon[0x29] = true;
            tileDungeon[0x2b] = true;
            tileDungeon[0x2c] = true;
            tileBlockLight[30] = true;
            tileBlockLight[0x19] = true;
            tileBlockLight[0x17] = true;
            tileBlockLight[0x16] = true;
            tileBlockLight[0x3e] = true;
            tileSolidTop[0x12] = true;
            tileSolidTop[14] = true;
            tileSolidTop[0x10] = true;
            tileNoAttach[20] = true;
            tileNoAttach[0x13] = true;
            tileNoAttach[13] = true;
            tileNoAttach[14] = true;
            tileNoAttach[15] = true;
            tileNoAttach[0x10] = true;
            tileNoAttach[0x11] = true;
            tileNoAttach[0x12] = true;
            tileNoAttach[0x13] = true;
            tileNoAttach[0x15] = true;
            tileNoAttach[0x1b] = true;
            tileFrameImportant[3] = true;
            tileFrameImportant[5] = true;
            tileFrameImportant[10] = true;
            tileFrameImportant[11] = true;
            tileFrameImportant[12] = true;
            tileFrameImportant[13] = true;
            tileFrameImportant[14] = true;
            tileFrameImportant[15] = true;
            tileFrameImportant[0x10] = true;
            tileFrameImportant[0x11] = true;
            tileFrameImportant[0x12] = true;
            tileFrameImportant[20] = true;
            tileFrameImportant[0x15] = true;
            tileFrameImportant[0x18] = true;
            tileFrameImportant[0x1a] = true;
            tileFrameImportant[0x1b] = true;
            tileFrameImportant[0x1c] = true;
            tileFrameImportant[0x1d] = true;
            tileFrameImportant[0x1f] = true;
            tileFrameImportant[0x21] = true;
            tileFrameImportant[0x22] = true;
            tileFrameImportant[0x23] = true;
            tileFrameImportant[0x24] = true;
            tileFrameImportant[0x2a] = true;
            tileFrameImportant[50] = true;
            tileFrameImportant[0x37] = true;
            tileFrameImportant[0x3d] = true;
            tileFrameImportant[0x47] = true;
            tileFrameImportant[0x48] = true;
            tileFrameImportant[0x49] = true;
            tileFrameImportant[0x4a] = true;
            tileFrameImportant[0x4d] = true;
            tileFrameImportant[0x4e] = true;
            tileFrameImportant[0x4f] = true;
            tileFrameImportant[0x51] = true;
            tileTable[14] = true;
            tileTable[0x12] = true;
            tileTable[0x13] = true;
            tileWaterDeath[4] = true;
            tileWaterDeath[0x33] = true;
            tileLavaDeath[3] = true;
            tileLavaDeath[5] = true;
            tileLavaDeath[10] = true;
            tileLavaDeath[11] = true;
            tileLavaDeath[12] = true;
            tileLavaDeath[13] = true;
            tileLavaDeath[14] = true;
            tileLavaDeath[15] = true;
            tileLavaDeath[0x10] = true;
            tileLavaDeath[0x11] = true;
            tileLavaDeath[0x12] = true;
            tileLavaDeath[0x13] = true;
            tileLavaDeath[20] = true;
            tileLavaDeath[0x1b] = true;
            tileLavaDeath[0x1c] = true;
            tileLavaDeath[0x1d] = true;
            tileLavaDeath[0x20] = true;
            tileLavaDeath[0x21] = true;
            tileLavaDeath[0x22] = true;
            tileLavaDeath[0x23] = true;
            tileLavaDeath[0x24] = true;
            tileLavaDeath[0x2a] = true;
            tileLavaDeath[0x31] = true;
            tileLavaDeath[50] = true;
            tileLavaDeath[0x34] = true;
            tileLavaDeath[0x37] = true;
            tileLavaDeath[0x3d] = true;
            tileLavaDeath[0x3e] = true;
            tileLavaDeath[0x45] = true;
            tileLavaDeath[0x47] = true;
            tileLavaDeath[0x48] = true;
            tileLavaDeath[0x49] = true;
            tileLavaDeath[0x4a] = true;
            tileLavaDeath[0x4f] = true;
            tileLavaDeath[80] = true;
            tileLavaDeath[0x51] = true;
            wallHouse[1] = true;
            wallHouse[4] = true;
            wallHouse[5] = true;
            wallHouse[6] = true;
            wallHouse[10] = true;
            wallHouse[11] = true;
            wallHouse[12] = true;
            tileNoFail[0x3d] = true;
            tileNoFail[0x49] = true;
            tileNoFail[0x4a] = true;
            tileNoFail[0x52] = true;
            tileNoFail[0x53] = true;
            tileNoFail[0x54] = true;

            for (int i = 0; i < 0x56; i++)
            {
                tileName[i] = "";
            }
            tileName[13] = "Bottle";
            tileName[14] = "Table";
            tileName[15] = "Chair";
            tileName[0x10] = "Anvil";
            tileName[0x11] = "Furnace";
            tileName[0x12] = "Workbench";
            tileName[0x1a] = "Demon Altar";
            tileName[0x4d] = "Hellforge";

            tileName[254] = "Portal"; //Mod

            for (int j = 0; j < maxMenuItems; j++)
            {
                this.menuItemScale[j] = 0.8f;
            }
            for (int k = 0; k < 0x3e8; k++)
            {
                dust[k] = new Dust();
            }
            for (int m = 0; m < 0xc9; m++)
            {
                Main.item[m] = new Item();
            }
            for (int n = 0; n < 0x3e9; n++)
            {
                npc[n] = new NPC();
                npc[n].whoAmI = n;
            }
            for (int num7 = 0; num7 < 0x100; num7++)
            {
                player[num7] = new Player();
            }
            for (int num8 = 0; num8 < 0x3e9; num8++)
            {
                projectile[num8] = new Projectile();
            }
            for (int num9 = 0; num9 < 0xc9; num9++)
            {
                gore[num9] = new Gore();
            }
            for (int num10 = 0; num10 < 100; num10++)
            {
                cloud[num10] = new Cloud();
            }
            for (int num11 = 0; num11 < 100; num11++)
            {
                combatText[num11] = new CombatText();
            }
            for (int num12 = 0; num12 < 100; num12++)
            {
                itemText[num12] = new ItemText();
            }
            for (int num13 = 0; num13 < 0x1000; num13++) //Mod: added more items
            {
                if (num13 < 0x147 || (num13 >= minAddedItems && num13 <= maxAddedItems)) //Mod
                {
                    Item item = new Item();
                    item.SetDefaults(num13, false);
                    itemName[num13] = item.name;
                }
            }
            for (int num14 = 0; num14 < Recipe.maxRecipes; num14++)
            {
                recipe[num14] = new Recipe();
                availableRecipeY[num14] = 0x41 * num14;
            }
            Recipe.SetupRecipes();
            for (int num15 = 0; num15 < numChatLines; num15++)
            {
                chatLine[num15] = new ChatLine();
            }
            for (int num16 = 0; num16 < Liquid.resLiquid; num16++)
            {
                liquid[num16] = new Liquid();
            }
            for (int num17 = 0; num17 < 0x2710; num17++)
            {
                liquidBuffer[num17] = new LiquidBuffer();
            }
            this.shop[0] = new Chest();
            this.shop[1] = new Chest();
            this.shop[1].SetupShop(1);
            this.shop[2] = new Chest();
            this.shop[2].SetupShop(2);
            this.shop[3] = new Chest();
            this.shop[3].SetupShop(3);
            this.shop[4] = new Chest();
            this.shop[4].SetupShop(4);
            this.shop[5] = new Chest();
            this.shop[5].SetupShop(5);
            teamColor[0] = Color.White;
            teamColor[1] = new Color(230, 40, 20);
            teamColor[2] = new Color(20, 200, 30);
            teamColor[3] = new Color(0x4b, 90, 0xff);
            teamColor[4] = new Color(200, 180, 0);
            if (menuMode == 1)
            {
                LoadPlayers();
            }
            Netplay.Init();
            if (skipMenu)
            {
                WorldGen.clearWorld();
                gameMenu = false;
                LoadPlayers();
                player[myPlayer] = (Player) loadPlayer[0].Clone();
                PlayerPath = loadPlayerPath[0];
                LoadWorlds();
                WorldGen.generateWorld(-1);
                WorldGen.EveryTileFrame();
                player[myPlayer].Spawn();
            }
            else
            {
                IntPtr systemMenu = GetSystemMenu(base.Window.Handle, false);
                int menuItemCount = GetMenuItemCount(systemMenu);
                RemoveMenu(systemMenu, menuItemCount - 1, 0x400);
            }
            if (!dedServ)
            {
                this.graphics.PreferredBackBufferWidth = screenWidth;
                this.graphics.PreferredBackBufferHeight = screenHeight;
                this.graphics.ApplyChanges();
                base.Initialize();
                base.Window.AllowUserResizing = true;
                this.OpenSettings();
                Star.SpawnStars();
                foreach (DisplayMode mode in GraphicsAdapter.DefaultAdapter.SupportedDisplayModes)
                {
                    if (((mode.Width < minScreenW) || (mode.Height < minScreenH)) || ((mode.Width > maxScreenW) || (mode.Height > maxScreenH)))
                    {
                        continue;
                    }
                    bool flag = true;
                    for (int num19 = 0; num19 < this.numDisplayModes; num19++)
                    {
                        if ((mode.Width == this.displayWidth[num19]) && (mode.Height == this.displayHeight[num19]))
                        {
                            flag = false;
                            break;
                        }
                    }
                    if (flag)
                    {
                        this.displayHeight[this.numDisplayModes] = mode.Height;
                        this.displayWidth[this.numDisplayModes] = mode.Width;
                        this.numDisplayModes++;
                    }
                }
                if (autoJoin)
                {
                    LoadPlayers();
                    menuMode = 1;
                    menuMultiplayer = true;
                }
            }
        }