Ejemplo n.º 1
0
        private void PickDecorationStructure(int s, int structX, int structY, bool mirrored)
        {
            switch (s)
            {
            case 0:
                TreeRuin.StructureGen(structX, structY, mirrored);
                break;

            case 1:
                PetrifiedTitans.StructureGen(structX, structY, mirrored);
                break;

            case 2:
                ObsidiumChalice.StructureGen(structX, structY, mirrored);
                break;

            case 3:
                LycorisCave.StructureGen(structX, structY, mirrored);
                break;

            case 4:
                LavaCave1.StructureGen(structX, structY, mirrored);
                break;

            case 5:
                LavaCave2.StructureGen(structX, structY, mirrored);
                break;

            case 6:
                LavaCave3.StructureGen(structX, structY, mirrored);
                break;

            case 7:
                LivingLycoris.StructureGen(structX, structY, mirrored);
                break;

            default:
                LavaCave1.StructureGen(structX, structY, mirrored);
                break;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Refactor This to be short
        /// </summary>
        private void GenerateObsidiumStructure(int xO, int yO)
        {
//progress.Message = "Obsidium Core";
            int numStructs = 7 * sizeMult;
            int structX    = xO;
            int structY    = yO + 35 * sizeMult;

            //Deco Structs
            numStructs = 7 * sizeMult;
            int  q        = 0;
            int  s        = Main.rand.Next(7);
            bool mirrored = false;

            structX = xO - 225 * sizeMult + Main.rand.Next(225 * sizeMult * 2);
            structY = yO - 275 * sizeMult + Main.rand.Next(275 * sizeMult / 2);
            while (q < numStructs)
            {
                //structX = xO - 225 * sizeMult + Main.rand.Next(225 * sizeMult * 2);
                //structY = yO - 275 * sizeMult + Main.rand.Next(275 * sizeMult * 2);
                if (TileCheckSafe(structX, structY))
                {
                    if (Main.tile[structX, structY].wall == (ushort)mod.WallType("ObsidiumRockWall"))
                    {
                        if (Main.rand.Next(2) == 0)
                        {
                            mirrored = true;
                        }
                        else
                        {
                            mirrored = false;
                        }
                        switch (s)
                        {
                        case 0:
                            TreeRuin.StructureGen(structX, structY, mirrored);
                            break;

                        case 1:
                            PetrifiedTitans.StructureGen(structX, structY, mirrored);
                            break;

                        case 2:
                            ObsidiumChalice.StructureGen(structX, structY, mirrored);
                            break;

                        case 3:
                            LycorisCave.StructureGen(structX, structY, mirrored);
                            break;

                        case 4:
                            LavaCave1.StructureGen(structX, structY, mirrored);
                            break;

                        case 5:
                            LavaCave2.StructureGen(structX, structY, mirrored);
                            break;

                        case 6:
                            LavaCave3.StructureGen(structX, structY, mirrored);
                            break;

                        default:
                            LavaCave1.StructureGen(structX, structY, mirrored);
                            break;
                        }

                        s++;
                        if (s >= 7)
                        {
                            s = 0;
                        }
                    }
                }

                q++;
                structX += Main.rand.Next(225 * sizeMult);
                if (structX > xO + 225 * sizeMult)
                {
                    structX -= 225 * sizeMult * 2;
                    structY += Main.rand.Next(275 * sizeMult / 4, 275 * sizeMult / 2);
                    if (structY > yO + 275 * sizeMult)
                    {
                        structY -= 275 * sizeMult * 2;
                    }
                }
            }

            //Loot Structs
            numStructs = 5 * sizeMult;
            q          = 0;
            s          = Main.rand.Next(3);
            structX    = xO - 225 * sizeMult + Main.rand.Next(225 * sizeMult * 2);
            structY    = yO - 275 * sizeMult + Main.rand.Next(275 * sizeMult / 2);
            while (q < numStructs)
            {
                if (TileCheckSafe(structX, structY))
                {
                    if (Main.tile[structX, structY].wall == (ushort)mod.WallType("ObsidiumRockWall"))
                    {
                        switch (s)
                        {
                        case 0:
                            LivingLycoris.StructureGen(structX, structY, mirrored);
                            break;

                        case 1:
                            ObsidiumHouse1.StructureGen(structX, structY, mirrored);
                            break;

                        case 2:
                            ObsidiumHouse2.StructureGen(structX, structY, mirrored);
                            break;
                        }

                        s++;
                        if (s >= 3)
                        {
                            s = 0;
                        }
                    }
                }

                q++;
                structX += Main.rand.Next(225 * sizeMult);
                if (structX > xO + 225 * sizeMult)
                {
                    structX -= 225 * sizeMult * 2;
                    structY += Main.rand.Next(275 * sizeMult / 4, 275 * sizeMult / 2);
                    if (structY > yO + 275 * sizeMult)
                    {
                        structY -= 275 * sizeMult * 2;
                    }
                }
            }

            //Obsidium Heart
            int heartX = xO - 60;
            int heartY = yO - 90;

            HeartWorld.HeartGen(heartX, heartY);
        }