Esempio n. 1
0
        public static void NotifyItemCraft(Recipe recipe)
        {
            if (OnItemCraft == null)
                return;

            OnItemCraft((short)recipe.createItem.netID, recipe.createItem.stack);
        }
Esempio n. 2
0
 static Recipe()
 {
     Recipe.maxRequirements = 15;
     Recipe.maxRecipes = 2000;
     Recipe.numRecipes = 0;
     Recipe.newRecipe = new Recipe();
 }
Esempio n. 3
0
        internal static void Create(Recipe r)
        {
            if (r.P_GroupDef as RecipeDef == null)
                r.CreateBasic();
            else
                r.CreateUnion();

            AchievementsHelper.NotifyItemCraft(r);
            AchievementsHelper.NotifyItemPickup(Main.player[Main.myPlayer], r.createItem);
            Recipe.FindRecipes();
        }
Esempio n. 4
0
        static int AlchReduction(Recipe r, int stack)
        {
            if (r.alchemy && Main.player[Main.myPlayer].alchemyTable)
            {
                if (stack > 1)
                {
                    int reduction = 0;
                    for (int i = 0; i < stack; i++)
                        if (Main.rand.Next(3) == 0)
                            reduction++;

                    stack -= reduction;
                }
                else if (Main.rand.Next(3) == 0)
                    stack = 0;
            }

            return stack;
        }
Esempio n. 5
0
        public static void CraftItem(this Terraria.Recipe r)
        {
            int stack = Main.mouseItem.stack;

            Main.mouseItem        = r.createItem.Clone();
            Main.mouseItem.stack += stack;
            if (stack <= 0)
            {
                Main.mouseItem.Prefix(-1);
            }
            Main.mouseItem.position.X = Main.player[Main.myPlayer].position.X + Main.player[Main.myPlayer].width / 2f - Main.mouseItem.width / 2f;
            Main.mouseItem.position.Y = Main.player[Main.myPlayer].position.Y + Main.player[Main.myPlayer].height / 2f - Main.mouseItem.height / 2f;
            ItemText.NewText(Main.mouseItem, r.createItem.stack);
            r.ApiCreate();
            if (Main.mouseItem.type <= ItemID.None && r.createItem.type <= 0)
            {
                return;
            }
            RecipeHooks.OnCraft(Main.mouseItem, r);
            ItemLoader.OnCraft(Main.mouseItem, r);
            //Main.PlaySound(7);
            SoundManager.PlaySound(Sounds.Grass);
        }
        static void CopyDefToVanilla(RecipeDef def, Recipe r)
        {
            var or = SettingUpRecipes;
            SettingUpRecipes = true;

            r.createItem.netDefaults(def.CreateItem.Resolve().NetID);
            r.createItem.stack = def.CreateStack;

            //if (def.RequiredItems.Keys.Any(e => (e.Kind & EitherKind.Left) != 0) ||
            //        def.RequiredTiles .Any(e => (e.Kind & EitherKind.Left) != 0))
            //    r.P_GroupDef = def; // handled by RecipeHooks.FindRecipes

            // for groups: display first the first, it's handled by RecipeHooks.FindRecipes
            int i = 0;
            foreach (var kvp in def.RequiredItems)
            {
                if (i >= Recipe.maxRequirements)
                    break;

                r.requiredItem[i] = new Item();
                r.requiredItem[i].netDefaults(kvp.Key.Match(MiscExtensions.Identity, g => g[0]).Resolve().NetID);
                r.requiredItem[i].stack = kvp.Value;

                i++;
            }

            i = 0;
            foreach (var t in def.RequiredTiles)
            {
                if (i >= Recipe.maxRequirements)
                    break;

                r.requiredTile[i] = t.Match(MiscExtensions.Identity, g => g[0]).Resolve().Type;

                i++;
            }

            r.alchemy = def.AlchemyReduction;

            r.needWater = (def.RequiredLiquids & RecipeLiquids.Water) != 0;
            r.needLava  = (def.RequiredLiquids & RecipeLiquids.Lava ) != 0;
            r.needHoney = (def.RequiredLiquids & RecipeLiquids.Honey) != 0;

            ////TODO: set any* to true when TileGroups are defined & implemented
            // RecipeHooks.FindRecipes handles this

            SettingUpRecipes = or;
        }
Esempio n. 7
0
 private static void addRecipe()
 {
     Main.recipe[numRecipes] = newRecipe;
     newRecipe = new Recipe();
     numRecipes++;
 }
Esempio n. 8
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();
        }
 private static void AddRecipe()
 {
     if (Recipe.newRecipe.requiredTile[0] == 13)
     {
         Recipe.newRecipe.alchemy = true;
     }
     Main.recipe[Recipe.numRecipes] = Recipe.newRecipe;
     Recipe.newRecipe = new Recipe();
     Recipe.numRecipes++;
 }
Esempio n. 10
0
        public static void drawChest(string chestName, Item[] chest, Texture2D invTexture, bool netUpdate, ref string mouseTip)
        {
            SpriteBatch spriteBatch = main.spriteBatch;

            new Color((byte)Main.invAlpha, (byte)Main.invAlpha, (byte)Main.invAlpha, (byte)Main.invAlpha);
            SpriteFont fontMouseText = Main.fontMouseText;
            Vector2    position      = new Vector2(284f, 210f);
            Color      color         = new Color(Main.mouseTextColor, Main.mouseTextColor, Main.mouseTextColor, Main.mouseTextColor);
            float      rotation      = 0f;

            spriteBatch.DrawString(fontMouseText, chestName, position, color, rotation, default(Vector2), 1f, SpriteEffects.None, 0f);
            Main.inventoryScale = 0.75f;
            if (Main.mouseX > 73 && Main.mouseX < (int)(73f + 280f * Main.inventoryScale) && Main.mouseY > 210 && Main.mouseY < (int)(210f + 224f * Main.inventoryScale))
            {
                Main.player[Main.myPlayer].mouseInterface = true;
            }
            for (int i = 0; i < 5; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    int num  = (int)(73f + (float)(i * 56) * Main.inventoryScale);
                    int num2 = (int)(210f + (float)(j * 56) * Main.inventoryScale);
                    int num3 = i + j * 5;
                    new Color(100, 100, 100, 100);
                    if (Main.mouseX >= num && (float)Main.mouseX <= (float)num + (float)Main.inventoryBackTexture.Width * Main.inventoryScale && Main.mouseY >= num2 && (float)Main.mouseY <= (float)num2 + (float)Main.inventoryBackTexture.Height * Main.inventoryScale)
                    {
                        Main.player[Main.myPlayer].mouseInterface = true;
                        if (Main.mouseLeftRelease && Main.mouseLeft)
                        {
                            if (Main.player[Main.myPlayer].selectedItem != num3 || Main.player[Main.myPlayer].itemAnimation <= 0)
                            {
                                Item mouseItem = Main.mouseItem;
                                Main.mouseItem = chest[num3];
                                chest[num3]    = mouseItem;
                                if (chest[num3].type == 0 || chest[num3].stack < 1)
                                {
                                    chest[num3] = new Item();
                                }
                                if (Main.mouseItem.IsTheSameAs(chest[num3]) && chest[num3].stack != chest[num3].maxStack && Main.mouseItem.stack != Main.mouseItem.maxStack)
                                {
                                    if (Main.mouseItem.stack + chest[num3].stack <= Main.mouseItem.maxStack)
                                    {
                                        chest[num3].stack   += Main.mouseItem.stack;
                                        Main.mouseItem.stack = 0;
                                    }
                                    else
                                    {
                                        int num4 = Main.mouseItem.maxStack - chest[num3].stack;
                                        chest[num3].stack    += num4;
                                        Main.mouseItem.stack -= num4;
                                    }
                                }
                                if (Main.mouseItem.type == 0 || Main.mouseItem.stack < 1)
                                {
                                    Main.mouseItem = new Item();
                                }
                                if (Main.mouseItem.type > 0 || chest[num3].type > 0)
                                {
                                    Recipe.FindRecipes();
                                    Main.PlaySound(7);
                                }
                                if (netUpdate && Main.netMode == 1)
                                {
                                    NetMessage.SendData(32, -1, -1, "", Main.player[Main.myPlayer].chest, num3);
                                }
                            }
                        }
                        else if (Main.mouseRight && Main.mouseRightRelease && chest[num3].maxStack == 1)
                        {
                            chest[num3] = Main.armorSwap(chest[num3]);
                            if (netUpdate && Main.netMode == 1)
                            {
                                NetMessage.SendData(32, -1, -1, "", Main.player[Main.myPlayer].chest, num3);
                            }
                        }
                        else if (Main.stackSplit <= 1 && Main.mouseRight && chest[num3].maxStack > 1 && (Main.mouseItem.IsTheSameAs(chest[num3]) || Main.mouseItem.type == 0) && (Main.mouseItem.stack < Main.mouseItem.maxStack || Main.mouseItem.type == 0))
                        {
                            if (Main.mouseItem.type == 0)
                            {
                                Main.mouseItem       = (Item)chest[num3].Clone();
                                Main.mouseItem.stack = 0;
                            }
                            Main.mouseItem.stack++;
                            chest[num3].stack--;
                            if (chest[num3].stack <= 0)
                            {
                                chest[num3] = new Item();
                            }
                            Recipe.FindRecipes();
                            Main.soundInstanceMenuTick.Stop();
                            Main.soundInstanceMenuTick = Main.soundMenuTick.CreateInstance();
                            Main.PlaySound(12);
                            if (Main.stackSplit == 0)
                            {
                                Main.stackSplit = 15;
                            }
                            else
                            {
                                Main.stackSplit = Main.stackDelay;
                            }
                            if (netUpdate && Main.netMode == 1)
                            {
                                NetMessage.SendData(32, -1, -1, "", Main.player[Main.myPlayer].chest, num3);
                            }
                        }
                        mouseTip     = chest[num3].name;
                        Main.toolTip = (Item)chest[num3].ShallowClone();
                        if (chest[num3].stack > 1)
                        {
                            object obj = mouseTip;
                            mouseTip = string.Concat(obj, " (", chest[num3].stack, ")");
                        }
                    }
                    DrawItem(invTexture, chest[num3], num, num2);
                }
            }
        }
Esempio n. 11
0
        public static void ApiCreate(this Terraria.Recipe recipe)
        {
            for (int requirementIndex = 0; requirementIndex < Terraria.Recipe.maxRequirements; requirementIndex++)
            {
                Item requiredItem = recipe.requiredItem[requirementIndex];
                if (requiredItem.type == ItemID.None)
                {
                    break;
                }
                int requiredAmount = requiredItem.stack;
                if (recipe is ModRecipe modRecipe)
                {
                    requiredAmount = modRecipe.ConsumeItem(requiredItem.type, requiredItem.stack);
                }
                if (recipe.alchemy && Main.player[Main.myPlayer].alchemyTable)
                {
                    if (requiredAmount > 1)
                    {
                        int num2 = 0;
                        for (int j = 0; j < requiredAmount; j++)
                        {
                            if (Main.rand.Next(3) == 0)
                            {
                                num2++;
                            }
                        }
                        requiredAmount -= num2;
                    }
                    else if (Main.rand.Next(3) == 0)
                    {
                        requiredAmount = 0;
                    }
                }

                if (requiredAmount <= 0)
                {
                    continue;
                }

                Item[] array = Main.player[Main.myPlayer].inventory;
                InvLogic(recipe, array, requiredItem, requiredAmount);
                PlayerCharacter character = Main.LocalPlayer.GetModPlayer <PlayerCharacter>();
                for (int j = 0; j < character.Inventories.Length; j += 1)
                {
                    if (character.ActiveInvPage != j)
                    {
                        array = character.Inventories[j];
                        InvLogic(recipe, array, requiredItem, requiredAmount);
                    }
                }

                if (Main.player[Main.myPlayer].chest == -1)
                {
                    continue;
                }
                if (Main.player[Main.myPlayer].chest > -1)
                {
                    array = Main.chest[Main.player[Main.myPlayer].chest].item;
                }
                else
                {
                    switch (Main.player[Main.myPlayer].chest)
                    {
                    case -2:
                        array = Main.player[Main.myPlayer].bank.item;
                        break;

                    case -3:
                        array = Main.player[Main.myPlayer].bank2.item;
                        break;

                    case -4:
                        array = Main.player[Main.myPlayer].bank3.item;
                        break;
                    }
                }

                for (int l = 0; l < 40; l++)
                {
                    Item item3 = array[l];
                    if (requiredAmount <= 0)
                    {
                        break;
                    }

                    if (!item3.IsTheSameAs(requiredItem) && !recipe.useWood(item3.type, requiredItem.type) &&
                        !recipe.useSand(item3.type, requiredItem.type) && !recipe.useIronBar(item3.type, requiredItem.type) &&
                        !recipe.usePressurePlate(item3.type, requiredItem.type) && !recipe.useFragment(item3.type, requiredItem.type) &&
                        !recipe.AcceptedByItemGroups(item3.type, requiredItem.type))
                    {
                        continue;
                    }
                    if (item3.stack > requiredAmount)
                    {
                        item3.stack -= requiredAmount;
                        if (Main.netMode == NetmodeID.MultiplayerClient && Main.player[Main.myPlayer].chest >= 0)
                        {
                            NetMessage.SendData(32, -1, -1, null, Main.player[Main.myPlayer].chest, l);
                        }
                        requiredAmount = 0;
                    }
                    else
                    {
                        requiredAmount -= item3.stack;
                        array[l]        = new Item();
                        if (Main.netMode == NetmodeID.MultiplayerClient && Main.player[Main.myPlayer].chest >= 0)
                        {
                            NetMessage.SendData(32, -1, -1, null, Main.player[Main.myPlayer].chest, l);
                        }
                    }
                }
            }

            AchievementsHelper.NotifyItemCraft(recipe);
            AchievementsHelper.NotifyItemPickup(Main.player[Main.myPlayer], recipe.createItem);
            FindRecipes();
        }
Esempio n. 12
0
 private static void addRecipe()
 {
     Main.recipe[Recipe.numRecipes] = Recipe.newRecipe;
     Recipe.newRecipe = new Recipe();
     Recipe.numRecipes++;
 }
Esempio n. 13
0
        static void CopyDefToVanilla(RecipeDef def, Recipe r)
        {
            r.createItem.netDefaults(def.CreateItem.Resolve().NetID);
            r.createItem.stack = def.CreateStack;

            int i = 0;
            foreach (var kvp in def.RequiredItems)
            {
                if (i >= Recipe.maxRequirements)
                    break;

                r.requiredItem[i] = new Item();
                r.requiredItem[i].netDefaults(kvp.Key.Resolve().NetID);
                r.requiredItem[i].stack = kvp.Value;

                i++;
            }

            i = 0;
            foreach (var t in def.RequiredTiles)
            {
                if (i >= Recipe.maxRequirements)
                    break;

                r.requiredTile[i] = t;

                i++;
            }

            r.needWater = (def.RequiredLiquids & RecipeLiquids.Water) != 0;
            r.needLava  = (def.RequiredLiquids & RecipeLiquids.Lava ) != 0;
            r.needHoney = (def.RequiredLiquids & RecipeLiquids.Honey) != 0;

            r.alchemy = def.RequiredTiles.Any(id => id == TileID.Bottles);

            //TODO: set any* to true when TileGroups are defined & implemented
        }
Esempio n. 14
0
		public virtual void OnCraft(Item item, Recipe recipe)
		{
		}
Esempio n. 15
0
		public virtual bool RecipeAvailable(Recipe recipe)
		{
			return true;
		}
 public static void NotifyItemCraft(Recipe recipe)
 {
     if (AchievementsHelper.OnItemCraft != null)
     {
         AchievementsHelper.OnItemCraft((short)recipe.createItem.netID, recipe.createItem.stack);
     }
 }
Esempio n. 17
0
 private static void addRecipe()
 {
     Main.recipe[numRecipes] = newRecipe;
     newRecipe = new Recipe();
     numRecipes++;
 }
Esempio n. 18
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
            }
        }
Esempio n. 19
0
        static KeyValuePair<ItemUnion, int>? UsesItem(Recipe r, int netID)
        {
            if (netID == 0)
                return null;

            if (r.P_GroupDef as RecipeDef != null)
            {
                var rd = (RecipeDef)r.P_GroupDef;

                foreach (var id in rd.RequiredItems)
                {
                    var e = RefEq(netID);

                    if (id.Key.Match(e, ig => ig.Any(e)))
                        return id;
                }
            }
            else
                for (int i = 0; i < r.requiredItem.Length && !r.requiredItem[i].IsEmpty(); i++)
                {
                    var it = r.requiredItem[i];

                    if (it.netID == netID ||
                            r.useWood         (netID, it.type) ||
                            r.useSand         (netID, it.type) ||
                            r.useIronBar      (netID, it.type) ||
                            r.useFragment     (netID, it.type) ||
                            r.usePressurePlate(netID, it.type))
                        return new KeyValuePair<ItemUnion, int>(ItemUnion.NewRight(ItemDef.Defs[it.netID]), it.stack);
                }

            return null;
        }
Esempio n. 20
0
		public virtual void OnCraft(Recipe recipe)
		{
		}
Esempio n. 21
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;
                }
            }
        }