예제 #1
0
        private bool AluminumMeteor(On.Terraria.WorldGen.orig_meteor orig, int i, int j)
        {
            Main.LocalPlayer.GetModPlayer <StarlightPlayer>().Shake += 80;
            Main.PlaySound(SoundID.DD2_ExplosiveTrapExplode);

            if (StarlightWorld.HasFlag(WorldFlags.AluminumMeteors))
            {
                Point16 target = new Point16();

                while (!CheckAroundMeteor(target))
                {
                    int x = Main.rand.Next(Main.maxTilesX);

                    for (int y = 0; y < Main.maxTilesY; y++)
                    {
                        if (Framing.GetTileSafely(x, y).active())
                        {
                            target = new Point16(x, y);
                            break;
                        }
                    }
                }

                for (int x = -35; x < 35; x++)
                {
                    for (int y = -35; y < 35; y++)
                    {
                        if (WorldGen.InWorld(target.X + x, target.Y + y) && Framing.GetTileSafely(target.X + x, target.Y + y).collisionType == 1)
                        {
                            float dist = new Vector2(x, y).Length();
                            if (dist < 8)
                            {
                                WorldGen.KillTile(target.X + x, target.Y + y);
                            }

                            if (dist > 8 && dist < 15)
                            {
                                WorldGen.PlaceTile(target.X + x, target.Y + y, ModContent.TileType <Content.Tiles.AstralMeteor.AluminumOre>(), true, true);
                                WorldGen.SlopeTile(target.X + x, target.Y + y, 0);
                            }

                            if (dist > 15 && dist < 30 && Main.rand.Next((int)dist - 15) == 0)
                            {
                                WorldGen.PlaceTile(target.X + x, target.Y + y, ModContent.TileType <Content.Tiles.AstralMeteor.AluminumOre> (), true, true);
                                WorldGen.SlopeTile(target.X + x, target.Y + y, 0);
                            }
                        }
                    }
                }

                if (Main.netMode == NetmodeID.SinglePlayer)
                {
                    Main.NewText("An asteroid has landed!", new Color(107, 233, 231));
                }

                else if (Main.netMode == NetmodeID.Server)
                {
                    NetMessage.BroadcastChatMessage(NetworkText.FromLiteral("An asteroid has landed!"), new Color(107, 233, 231));
                }

                return(true);
            }

            else
            {
                return(orig(i, j));
            }
        }
예제 #2
0
 // public static int marsBiome = 0;
 public override void TileCountsAvailable(int[] tileCounts)
 {
     moonBiome = tileCounts[ModContent.TileType <Regolith>()];
     // marsBiome = tileCounts[ModContent.TileType<NameOfTile>()];
 }
예제 #3
0
        private static void SaveExtraChests(BinaryWriter writer)
        {
            short numberOfChest = 0;

            for (int i = 1000; i < maxChest; i++)
            {
                Chest chest = Main.chest[i];
                if (chest != null)
                {
                    bool flag = false;
                    for (int j = chest.x; j <= chest.x + 1; j++)
                    {
                        for (int k = chest.y; k <= chest.y + 1; k++)
                        {
                            if (j < 0 || k < 0 || j >= Main.maxTilesX || k >= Main.maxTilesY)
                            {
                                flag = true;
                                break;
                            }

                            Tile tile = Main.tile[j, k];
                            if (!tile.active() || !Main.tileContainer[tile.type] && tile.type != ModContent.TileType <MysteryTile>())
                            {
                                flag = true;
                                break;
                            }
                        }
                    }

                    if (flag)
                    {
                        Main.chest[i] = null;
                    }
                    else
                    {
                        numberOfChest += 1;
                    }
                }
            }

            writer.Write(numberOfChest);
            writer.Write((short)40);
            for (int i = 1000; i < maxChest; i++)
            {
                Chest chest = Main.chest[i];
                if (chest != null)
                {
                    writer.Write(chest.x);
                    writer.Write(chest.y);
                    writer.Write(chest.name);
                    for (int l = 0; l < 40; l++)
                    {
                        Item item = chest.item[l];
                        if (item == null || item.modItem != null)
                        {
                            writer.Write((short)0);
                        }
                        else
                        {
                            if (item.stack > item.maxStack)
                            {
                                item.stack = item.maxStack;
                            }

                            if (item.stack < 0)
                            {
                                item.stack = 1;
                            }

                            writer.Write((short)item.stack);
                            if (item.stack > 0)
                            {
                                writer.Write(item.netID);
                                writer.Write(item.prefix);
                            }
                        }
                    }
                }
            }

            Console.Write($"Number of chest in this world {1000 + numberOfChest}");
        }
예제 #4
0
파일: OWorld.cs 프로젝트: Reallyifs/OdeMod
        private void SpawnMosscobble(GenerationProgress progress)
        {
            progress.Message = OLanguage.Get("生成苔石", true);
            int fINT    = 0;
            int sNumber = 0;

            for (int x = 0; x < Main.maxTilesX - 50; x++)
            {
                for (int y = 0; y < Main.maxTilesY - 250; y++)
                {
                    Tile tile = Framing.GetTileSafely(x, y);
                    if (tile.type == TileID.Stone)
                    {
                        if (sNumber <= 0)
                        {
                            fINT = x;
                        }
                        sNumber++;
                    }
                    if (tile.type != TileID.Stone)
                    {
                        if (sNumber >= 10)
                        {
                            int lINT    = y;
                            int maxTile = Main.rand.NextBool() ? sNumber / 3 : 0;
                            WorldGen.TileRunner(fINT, lINT, maxTile, Main.rand.Next(1, 4), ModContent.TileType <TileMosscobble>());
                        }
                        fINT = sNumber = 0;
                    }
                }
            }
            for (int y = 0; y < Main.maxTilesY - 250; y++)
            {
                for (int x = 0; x < Main.maxTilesX - 50; x++)
                {
                    Tile tile = Framing.GetTileSafely(x, y);
                    if (tile.type == TileID.Stone)
                    {
                        if (sNumber <= 0)
                        {
                            fINT = x;
                        }
                        sNumber++;
                    }
                    if (tile.type != TileID.Stone)
                    {
                        if (sNumber >= 10)
                        {
                            int lINT    = y;
                            int maxTile = Main.rand.NextBool() ? sNumber / 3 : 0;
                            WorldGen.TileRunner(fINT, lINT, maxTile, Main.rand.Next(1, 4), ModContent.TileType <TileMosscobble>());
                        }
                        fINT = sNumber = 0;
                    }
                }
            }
        }
예제 #5
0
        public override void SetDefaults()
        {
            Main.tileFrameImportant[Type] = true;
            Main.tileNoAttach[Type]       = true;
            Main.tileLavaDeath[Type]      = true;

            TileObjectData.newTile.Width              = 1;
            TileObjectData.newTile.Height             = 2;
            TileObjectData.newTile.Origin             = new Point16(0, 1);
            TileObjectData.newTile.AnchorBottom       = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Width, 0);
            TileObjectData.newTile.UsesCustomCanPlace = true;
            TileObjectData.newTile.CoordinateHeights  = new[] { 16, 18 };
            TileObjectData.newTile.CoordinateWidth    = 16;
            TileObjectData.newTile.CoordinatePadding  = 2;
            TileObjectData.newTile.AnchorValidTiles   = new[] { ModContent.TileType <Defiled_Grass>(), ModContent.TileType <Defiled_Sand>() };
            TileObjectData.newTile.StyleHorizontal    = true;
            TileObjectData.newTile.DrawFlipHorizontal = true;
            TileObjectData.newTile.WaterPlacement     = LiquidPlacement.NotAllowed;
            TileObjectData.newTile.LavaDeath          = true;
            TileObjectData.newTile.RandomStyleRange   = 3;
            TileObjectData.newTile.StyleMultiplier    = 3;

            /*TileObjectData.newSubTile.CopyFrom(TileObjectData.newTile);
             * TileObjectData.newSubTile.AnchorValidTiles = new int[] { ModContent.TileType<ExampleSand>() };
             * TileObjectData.addSubTile(1);*/
            TileObjectData.addTile(Type);

            ModTranslation name = CreateMapEntryName();

            name.SetDefault("Defiled Sapling");
            //AddMapEntry(new Color(200, 200, 200), name);
            ModTranslation treeName = CreateMapEntryName();

            //name.SetDefault("Defiled Tree");
            //AddMapEntry(new Color(200, 200, 200), treeName);
            //ModContent.GetModTile(ModContent.TileType("Defiled_Tree"));

            sapling  = true;
            adjTiles = new int[] { TileID.Saplings };
        }
예제 #6
0
        public override void RandomUpdate(int i, int j, int type)
        {
            float u       = 160 * ModContent.GetInstance <SurvivariaConfigServer>().PlantGrowthRateMulti;
            bool  wetSand = false;

            if (SurvivariaMod.Instance.overLoaded)
            {
                if (Main.tile[i, j].type == ModLoader.GetMod("TerrariaOverhaul").TileType("WetSand"))
                {
                    wetSand = true;
                }
            }
            if (Main.expertMode)
            {
                u *= 1.1f;
            }
            if ((Main.tile[i, j].type == TileID.Grass && Main.tile[i, j + 1].wall != WallID.Cloud && (Main.tile[i, j - 1].type == TileID.Plants || Main.tile[i, j - 1].type == TileID.Plants2 || !Main.tile[i, j - 1].active())) && Main.tile[i, j].slope() == 0 && j < Main.worldSurface && Main.dayTime && Main.hardMode && NPC.downedMechBossAny)
            {
                if (Main.rand.NextFloat(u * 1.1f) < 1)
                {
                    WorldGen.PlaceTile(i, j - 2, ModContent.TileType <PeppermintPlant>(), true, true);
                    //Main.NewText("Plant placed at: " + new Vector2(i, j));
                }
            }
            if ((Main.tile[i, j].type == TileID.JungleGrass && (Main.tile[i, j - 1].type == TileID.JunglePlants || Main.tile[i, j - 1].type == TileID.JunglePlants2 || !Main.tile[i, j - 1].active())) && Main.tile[i, j].slope() == 0 && j < Main.rockLayer && Main.dayTime && NPC.downedQueenBee)
            {
                if (Main.rand.NextFloat(u * 1.25f) < 1)
                {
                    WorldGen.PlaceTile(i, j - 3, ModContent.TileType <CorneyPlant>(), true, true);
                }
            }
            if (Main.tile[i, j].type == TileID.JungleGrass && (Main.tile[i, j + 1].type == TileID.JunglePlants || Main.tile[i, j + 1].type == TileID.JunglePlants2 || Main.tile[i, j + 1].type == TileID.JungleVines || !Main.tile[i, j + 1].active()) && Main.tile[i, j].slope() == 0 && j > Main.rockLayer)
            {
                if (Main.rand.NextFloat(u * 1.5f) < 1)
                {
                    WorldGen.PlaceTile(i, j + 1, ModContent.TileType <EnigmaticRootPlant>(), true, true);
                }
            }
            if ((Main.tile[i, j].type == TileID.MushroomGrass && (Main.tile[i, j - 1].type == TileID.MushroomPlants || !Main.tile[i, j - 1].active()) && Main.tile[i, j].slope() == 0))
            {
                if (Main.rand.NextFloat(u * 1.1f) < 1)
                {
                    WorldGen.PlaceTile(i, j - 1, ModContent.TileType <MushyCarrotPlant>(), true, true);
                }
            }
            if ((Main.tile[i, j].type == TileID.CorruptGrass && (Main.tile[i, j - 1].type == TileID.CorruptPlants || !Main.tile[i, j - 1].active()) && Main.tile[i, j].slope() == 0 && !Main.dayTime) && j < Main.worldSurface && NPC.downedBoss2)
            {
                if (Main.rand.NextFloat(u * 0.9f) < 1)
                {
                    WorldGen.PlaceTile(i, j - 1, ModContent.TileType <CursedEggplantPlant>(), true, true);
                }
            }
            if ((Main.tile[i, j].type == TileID.FleshGrass && (Main.tile[i, j - 1].type == TileID.FleshWeeds || !Main.tile[i, j - 1].active()) && Main.tile[i, j].slope() == 0 && !Main.dayTime) && j < Main.worldSurface && NPC.downedBoss2)
            {
                if (Main.rand.NextFloat(u * 0.9f) < 1)
                {
                    WorldGen.PlaceTile(i, j - 1, ModContent.TileType <BleedRootPlant>(), true, true);
                }
            }
            if (Main.tile[i, j].type == TileID.SnowBlock && Main.tile[i, j].slope() == 0 && !Main.tile[i, j - 1].active() && j < Main.rockLayer && Main.dayTime)
            {
                if (Main.rand.NextFloat(u * 1.5f) < 1)
                {
                    WorldGen.PlaceTile(i, j - 1, ModContent.TileType <PearlBerryPlant>(), true, true);
                }
            }
            if ((Main.tile[i, j].type == TileID.Grass && Main.tile[i, j + 1].wall != WallID.Cloud && (Main.tile[i, j - 1].type == TileID.Plants || Main.tile[i, j - 1].type == TileID.Plants2 || !Main.tile[i, j - 1].active())) && Main.tile[i, j].slope() == 0 && j < Main.worldSurface && Main.dayTime)
            {
                if (Main.rand.NextFloat(u * 1.3f) < 1)
                {
                    WorldGen.PlaceTile(i, j - 1, ModContent.TileType <ReecePlant>(), true, true);
                }
            }
            if ((Main.tile[i, j].type == TileID.HallowedGrass && (Main.tile[i, j - 1].type == TileID.HallowedPlants || Main.tile[i, j - 1].type == TileID.HallowedPlants2 || !Main.tile[i, j - 1].active())) && Main.tile[i, j].slope() == 0 && j < Main.rockLayer && Main.dayTime)
            {
                if (Main.rand.NextFloat(u) < 1)
                {
                    WorldGen.PlaceTile(i, j - 2, ModContent.TileType <SparklingBerryPlant>(), true, true);
                }
            }
            if ((Main.tile[i, j].type == TileID.Sand || wetSand) && !Main.tile[i, j - 1].active() && Main.tile[i, j - 1].liquid > 0 && Main.tile[i, j].slope() == 0 && (i <380 || i> Main.maxTilesX - 380) && j < Main.worldSurface && Main.dayTime)
            {
                if (Main.rand.NextFloat(u * 1.1f) < 1)
                {
                    WorldGen.PlaceTile(i, j - 3, ModContent.TileType <AmalgaePlant>(), true, true);
                }
            }
            if ((Main.tile[i, j].type == TileID.Sand || wetSand) && !Main.tile[i, j - 1].active() && !Main.tile[i + 1, j - 1].active() && Main.tile[i, j].slope() == 0 && 380 < i && i < Main.maxTilesX - 380 && j < Main.worldSurface && Main.dayTime)
            {
                if (Main.rand.NextFloat(u * 1.15f) < 1)
                {
                    switch (Main.rand.Next(5))
                    {
                    case 0:
                        WorldGen.PlaceTile(i, j - 1, ModContent.TileType <PricklyPearOrangePlant>(), true, true);
                        break;

                    case 1:
                        WorldGen.PlaceTile(i, j - 1, ModContent.TileType <PricklyPearMagentaPlant>(), true, true);
                        break;

                    case 2:
                        WorldGen.PlaceTile(i, j - 1, ModContent.TileType <PricklyPearRedPlant>(), true, true);
                        break;

                    case 3:
                        WorldGen.PlaceTile(i, j - 1, ModContent.TileType <PricklyPearWhitePlant>(), true, true);
                        break;

                    case 4:
                        WorldGen.PlaceTile(i, j - 1, ModContent.TileType <PricklyPearYellowPlant>(), true, true);
                        break;
                    }
                }
            }
            if (Main.tile[i, j].type == TileID.Ash && !Main.tile[i, j + 1].active() && Main.tile[i, j].slope() == 0 && j > Main.maxTilesY - 220)
            {
                if (Main.rand.NextFloat(u * 1.3f) < 1)
                {
                    WorldGen.PlaceTile(i, j + 1, ModContent.TileType <FireTuberPlant>(), true, true);
                }
            }
            if (Main.tile[i, j].type == TileID.Ash && !Main.tile[i, j - 1].active() && Main.tile[i, j].slope() == 0 && j > Main.maxTilesY - 220 && NPC.downedBoss3)
            {
                if (Main.rand.NextFloat(u * 1.3f) < 1)
                {
                    WorldGen.PlaceTile(i, j - 1, ModContent.TileType <AshStrawPlant>(), true, true);
                }
            }
            if (Main.tile[i, j].type == TileID.Grass && Main.tile[i, j + 1].wall == WallID.Cloud && (Main.tile[i, j - 1].type == TileID.Plants || Main.tile[i, j - 1].type == TileID.Plants2 || !Main.tile[i, j - 1].active()) && Main.tile[i, j].slope() == 0 && j < Main.worldSurface)
            {
                if (Main.rand.NextFloat(u * 1f) < 1)
                {
                    WorldGen.PlaceTile(i, j - 1, ModContent.TileType <StarfruitPlant>(), true, true);
                }
            }
            if ((Main.tile[i, j].type == TileID.Cloud) && !Main.tile[i, j + 1].active() && Main.tile[i, j].slope() == 0 && j < Main.worldSurface && NPC.downedSlimeKing)
            {
                if (Main.rand.NextFloat(u * 1.1f) < 1)
                {
                    WorldGen.PlaceTile(i, j + 1, ModContent.TileType <CloudstalkPlant>(), true, true);
                }
            }
            if (Main.tile[i, j].type == TileID.JungleGrass && (Main.tile[i, j - 1].type == TileID.JunglePlants || Main.tile[i, j - 1].type == TileID.JunglePlants2 || !Main.tile[i, j - 1].active()) && Main.tile[i, j].slope() == 0 && j > Main.rockLayer && NPC.downedPlantBoss)
            {
                if (Main.rand.NextFloat(u * 1.25f) < 1)
                {
                    WorldGen.PlaceTile(i, j - 1, ModContent.TileType <GuarleekPlant>(), true, true);
                }
            }
            if (Main.tile[i, j].type == TileID.Granite && !Main.tile[i, j - 1].active() && Main.tile[i, j].slope() == 0 && NPC.downedBoss1)
            {
                if (Main.rand.NextFloat(u * 1.25f) < 1)
                {
                    WorldGen.PlaceTile(i, j - 1, ModContent.TileType <GranutPlant>(), true, true);
                }
            }
            if (Main.tile[i, j].type == TileID.Marble && !Main.tile[i, j + 1].active() && Main.tile[i, j].slope() == 0 && NPC.downedBoss1)
            {
                if (Main.rand.NextFloat(u * 1.2f) < 1)
                {
                    WorldGen.PlaceTile(i, j + 1, ModContent.TileType <FrambosiaPlant>(), true, true);
                }
            }
            if (Main.tile[i, j].type == TileID.Grass && Main.tile[i, j + 1].wall != WallID.Cloud && (Main.tile[i, j - 1].type == TileID.Plants || Main.tile[i, j - 1].type == TileID.Plants2 || !Main.tile[i, j - 1].active()) && Main.tile[i, j].slope() == 0 && j < Main.worldSurface && Main.dayTime)
            {
                if (Main.rand.NextFloat(u * 1.3f) < 1)
                {
                    WorldGen.PlaceTile(i, j - 1, ModContent.TileType <BlossomWheatPlant>(), true, true);
                }
            }
            base.RandomUpdate(i, j, type);
        }
예제 #7
0
        public override bool ValidTile(int i, int j)
        {
            var tile = Main.tile[i, j];

            return(tile.active() && tile.type == ModContent.TileType <RedChimney>() && tile.frameX == 0 && tile.frameY == 0);
        }
예제 #8
0
        public override bool ValidTile(int i, int j)
        {
            Tile tile = Main.tile[i, j];

            return(tile.type == ModContent.TileType <Siphon>() && tile.active() && tile.frameX == 0 && tile.frameY == 0);
        }
        public static void PlaceCaiburnShrine(Vector2 placementspot, int type)
        {
            Tile tstart       = Framing.GetTileSafely(placementspot);
            int  heighestTile = Main.maxTilesY;
            int  lowestTile   = 0;

            List <Vector2> deways         = new List <Vector2>();
            List <Vector2> dewaysMainroom = new List <Vector2>();

            int buffersizex = 12 + WorldGen.genRand.Next(7);
            int buffersizey = 8 + WorldGen.genRand.Next(3);
            int x           = (int)placementspot.X;
            int y           = (int)placementspot.Y;
            int xbuffer     = -buffersizex;
            int ybuffer     = -buffersizey;

            //ushort[] stoneTypes = new ushort[] { TileID.Stone, TileID.Dirt, TileID.Mud, TileID.ClayBlock };
            for (xbuffer = -buffersizex; xbuffer < buffersizex; xbuffer++)
            {
                for (ybuffer = -buffersizey; ybuffer < buffersizey; ybuffer++)
                {
                    Point loc  = new Point((int)placementspot.X + (int)xbuffer, (int)placementspot.Y + (int)ybuffer);
                    Tile  tile = Framing.GetTileSafely(loc.X, loc.Y);
                    IDGWorldGen.PlaceMulti(placementspot + new Vector2(xbuffer, ybuffer), SGAmod.Instance.TileType("MoistStone"), 4, SGAmod.Instance.WallType("SwampWall"));
                    dewaysMainroom.Add(new Vector2(loc.X, loc.Y));
                    allDankWater.Add(loc);
                }
            }

            int t1 = SGAmod.Instance.TileType("MoistStone");
            int t2 = SGAmod.Instance.WallType("SwampWall");

            PlaceCaiburnHallway(placementspot + new Vector2(buffersizex * 1, 0), 12, 6, 0, ref deways, 0, t1, t2);
            PlaceCaiburnHallway(placementspot + new Vector2(-buffersizex * 1, 0), 12, 6, 2, ref deways, 0, t1, t2);


            //Clear out area
            for (int aaa = 0; aaa < deways.Count; aaa++)
            {
                if ((int)deways[aaa].Y < heighestTile)
                {
                    heighestTile = (int)deways[aaa].Y;
                }
                if ((int)deways[aaa].Y > lowestTile)
                {
                    lowestTile = (int)deways[aaa].Y;
                }

                Tile tile = Framing.GetTileSafely((int)deways[aaa].X, (int)deways[aaa].Y);
                tile.active(false);
            }

            //Turn to water
            foreach (Vector2 point in deways.Where(testby => testby.Y > lowestTile - 150))
            {
                if (point.Y + WorldGen.genRand.Next(150) > lowestTile)
                {
                    Tile tile = Framing.GetTileSafely((int)point.X, (int)point.Y);
                    tile.liquid = 20;
                }
            }

            //Remove top area
            HashSet <Point16> removes = new HashSet <Point16>();

            foreach (Vector2 point in deways.Where(testby => testby.Y < heighestTile + 3))
            {
                Point16 point2 = point.ToPoint16();
                if (WorldGen.InWorld(point2.X - 4, point2.Y - 2) && WorldGen.InWorld(point2.X + 4, point2.Y - 2))
                {
                    // if (Main.tile[point2.X - 4, point2.Y-2].type == ModContent.TileType<MoistStone>() && Main.tile[point2.X + 4, point2.Y-2].type == ModContent.TileType<MoistStone>() &&
                    //    Main.tile[point2.X - 4, point2.Y].active() && Main.tile[point2.X - 4, point2.Y].type == ModContent.TileType<MoistStone>() && Main.tile[point2.X + 4, point2.Y].active() && Main.tile[point2.X + 4, point2.Y].type == ModContent.TileType<MoistStone>())
                    //{
                    removes.Add(new Point16(point2.X, point2.Y - 1));
                    removes.Add(new Point16(point2.X, point2.Y - 2));
                    removes.Add(new Point16(point2.X, point2.Y - 3));
                    //}
                }
            }

            //turn to biomass
            foreach (Point16 point2 in removes)
            {
                Tile tile = Framing.GetTileSafely(point2.X, point2.Y);
                if (tile.type == ModContent.TileType <MoistStone>())
                {
                    tile.type = (ushort)ModContent.TileType <Biomass>();
                }
            }


            //Fill some water area with Moist Sand
            //Liquid.QuickWater(3);
            //WaterCheck();

            //Do general object placement
            for (int aaa = 0; aaa < deways.Count; aaa++)
            {
                if (WorldGen.genRand.Next(0, 100) < 20)
                {
                    Tile tile = Framing.GetTileSafely((int)deways[aaa].X, (int)deways[aaa].Y + 1);
                    if (tile.active())
                    {
                        string[] onts = new string[] { "SwampGrassGrow", "SwampGrassGrow2", "SwampGrassGrow3" };
                        WorldGen.PlaceObject((int)deways[aaa].X, (int)deways[aaa].Y, SGAmod.Instance.TileType(onts[WorldGen.genRand.Next(onts.Length)]), true);
                    }
                }

                if (WorldGen.genRand.Next(0, 100) < 5)
                {
                    Tile tile = Framing.GetTileSafely((int)deways[aaa].X, (int)deways[aaa].Y - 1);
                    if (tile.active())
                    {
                        WorldGen.PlaceObject((int)deways[aaa].X, (int)deways[aaa].Y, TileID.HangingLanterns, false, 16);
                    }
                }
                if (WorldGen.genRand.Next(0, 100) < 5)
                {
                    Tile tile = Framing.GetTileSafely((int)deways[aaa].X, (int)deways[aaa].Y + 1);
                    if (tile.active())
                    {
                        WorldGen.placeTrap((int)deways[aaa].X, (int)deways[aaa].Y, 0);
                    }
                }
                if (WorldGen.genRand.Next(0, 100) < 2)
                {
                    Tile tile1 = Framing.GetTileSafely((int)deways[aaa].X, (int)deways[aaa].Y + 1);
                    Tile tile2 = Framing.GetTileSafely((int)deways[aaa].X + 1, (int)deways[aaa].Y + 1);
                    Tile tile3 = Framing.GetTileSafely((int)deways[aaa].X + 1, (int)deways[aaa].Y);
                    Tile tile4 = Framing.GetTileSafely((int)deways[aaa].X, (int)deways[aaa].Y);

                    Vector2 findone = Vector2.Zero;

                    findone = dewaysMainroom.Find(location => new Rectangle((int)location.X - 1, (int)location.Y - 1, 3, 3).Intersects(new Rectangle((int)deways[aaa].X - 1, (int)deways[aaa].Y - 1, 3, 3)));

                    if (tile1.active() && tile2.active() && !tile3.active() && !tile4.active() && findone == Vector2.Zero)
                    {
                        Point loc      = new Point((int)deways[aaa].X, (int)deways[aaa].Y);
                        int   thechest = WorldGen.PlaceChest(loc.X, loc.Y, 21, false, 12);

                        if (thechest > 0)
                        {
                            for (int xx = 0; xx < 2; xx += 1)
                            {
                                for (int yy = 0; yy < 2; yy += 1)
                                {
                                    Tile tile = Framing.GetTileSafely((int)deways[aaa].X + xx, (int)deways[aaa].Y + yy - 1);
                                    tile.color((byte)Paints.DeepGreen);
                                }
                            }


                            List <int> loot = new List <int> {
                                2344, 2345, 2346, 2347, 2348, 2349, 2350, 2351, 2352, 2353, 2354, 2355, 2356, 2359, 301, 302, 303, 304, 305, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 226, 188, 189, 110, 28
                            };

                            List <int> lootmain = new List <int> {
                                SGAWorld.WorldIsNovus?SGAmod.Instance.ItemType("UnmanedOre") : SGAmod.Instance.ItemType("NoviteOre"), SGAmod.Instance.ItemType("DankWood"), SGAmod.Instance.ItemType("DankWood"), SGAmod.Instance.ItemType("Biomass"), SGAmod.Instance.ItemType("DankWood"), ItemID.SilverCoin, ItemID.LesserManaPotion
                            };
                            List <int> lootrare = new List <int> {
                                SGAmod.Instance.ItemType("DankCore"), SGAmod.Instance.ItemType("DankCore")
                            };
                            List <int> dankrare = new List <int> {
                                SGAmod.Instance.ItemType("DankWoodShield"), SGAmod.Instance.ItemType("MurkyCharm")
                            };
                            int e = 0;

                            for (int kk = 0; kk < 2 + (Main.expertMode ? 1 : 0); kk += 1)
                            {
                                //for (int i = 0; i < WorldGen.genRand.Next(15, Main.expertMode ? 25 : 30); i += 1)
                                //{
                                int index = WorldGen.genRand.Next(0, loot.Count);
                                Main.chest[thechest].item[e].SetDefaults(loot[index]);
                                Main.chest[thechest].item[e].stack = WorldGen.genRand.Next(1, Main.expertMode ? 3 : 2);
                                //}
                                e += 1;
                            }
                            if (WorldGen.genRand.Next(0, 100) < 25)
                            {
                                int index = WorldGen.genRand.Next(0, lootrare.Count);
                                Main.chest[thechest].item[e].SetDefaults(lootrare[index]);
                                Main.chest[thechest].item[e].stack = WorldGen.genRand.Next(1, Main.expertMode ? 3 : 1);
                                //}
                                e += 1;
                            }
                            if (WorldGen.genRand.Next(0, 20) == 0)
                            {
                                int index = WorldGen.genRand.Next(0, dankrare.Count);
                                Main.chest[thechest].item[e].SetDefaults(dankrare[index]);
                                Main.chest[thechest].item[e].stack = 1;
                                //}
                                e += 1;
                            }
                            for (int kk = 0; kk < 3 + (Main.expertMode ? 1 : 0); kk += 1)
                            {
                                //for (int i = 0; i < WorldGen.genRand.Next(15, Main.expertMode ? 25 : 30); i += 1)
                                //{
                                int index = WorldGen.genRand.Next(0, lootmain.Count);
                                Main.chest[thechest].item[e].SetDefaults(lootmain[index]);
                                Main.chest[thechest].item[e].stack = WorldGen.genRand.Next(15, Main.expertMode ? 25 : 45);

                                //}
                                e += 1;
                            }
                        }

                        ///WorldGen.PlaceChestDirect((int)deways[aaa].X, (int)deways[aaa].Y, (ushort)SGAmod.Instance.TileType("OvergrownChest"), 0, 0);
                    }
                }
            }

            for (int aaa = 0; aaa < dewaysMainroom.Count; aaa++)
            {
                Tile tile = Framing.GetTileSafely((int)dewaysMainroom[aaa].X, (int)dewaysMainroom[aaa].Y);
                //Chest.DestroyChest((int)deways[aaa].X, (int)deways[aaa].Y);
                WorldGen.KillTile((int)deways[aaa].X, (int)deways[aaa].Y);
                tile.active(false);
            }


            //Place Sword
            for (int kk = 3; kk < 6; kk += 1)
            {
                Main.tile[(int)placementspot.X, (int)placementspot.Y + buffersizey - kk].active(false);
                for (int xx = 0; xx < 6; xx += 1)
                {
                    Main.tile[(int)placementspot.X - xx, (int)placementspot.Y + buffersizey - kk].active(false);
                    Main.tile[(int)placementspot.X + xx, (int)placementspot.Y + buffersizey - kk].active(false);
                }
            }
            Main.tile[(int)placementspot.X, (int)placementspot.Y + buffersizey - 1].active(true);
            WorldGen.SlopeTile((int)placementspot.X, (int)placementspot.Y + buffersizey - 1, 0);

            for (int xx = 0; xx < 4; xx += 1)
            {
                Main.tile[(int)placementspot.X - xx, (int)placementspot.Y + buffersizey - 1].active(true);
                Main.tile[(int)placementspot.X + xx, (int)placementspot.Y + buffersizey - 1].active(true);
                WorldGen.SlopeTile((int)placementspot.X - xx, (int)placementspot.Y + buffersizey - 1, 0);
                WorldGen.SlopeTile((int)placementspot.X + xx, (int)placementspot.Y + buffersizey - 1, 0);
            }

            Main.tile[(int)placementspot.X - 2, (int)placementspot.Y + buffersizey - 2].active(true); WorldGen.SlopeTile((int)placementspot.X - 2, (int)placementspot.Y + buffersizey - 2, 0);
            Main.tile[(int)placementspot.X - 1, (int)placementspot.Y + buffersizey - 2].active(true); WorldGen.SlopeTile((int)placementspot.X - 1, (int)placementspot.Y + buffersizey - 2, 0);
            Main.tile[(int)placementspot.X, (int)placementspot.Y + buffersizey - 2].active(true); WorldGen.SlopeTile((int)placementspot.X, (int)placementspot.Y + buffersizey - 2, 0);
            Main.tile[(int)placementspot.X + 1, (int)placementspot.Y + buffersizey - 2].active(true); WorldGen.SlopeTile((int)placementspot.X + 1, (int)placementspot.Y + buffersizey - 2, 0);
            Main.tile[(int)placementspot.X + 2, (int)placementspot.Y + buffersizey - 2].active(true); WorldGen.SlopeTile((int)placementspot.X + 2, (int)placementspot.Y + buffersizey - 2, 0);

            Point offset    = new Point(0, -3);
            int   altertype = type == 0 ? SGAmod.Instance.TileType("CaliburnAltar") : (type == 1 ? SGAmod.Instance.TileType("CaliburnAltarB") : SGAmod.Instance.TileType("CaliburnAltarC"));

            WorldGen.PlaceObject((int)placementspot.X + offset.X, (int)placementspot.Y + buffersizey + offset.Y, altertype, false, 0);
            SGAWorld.CaliburnAlterCoordsX[type] = (int)placementspot.X * 16;
            SGAWorld.CaliburnAlterCoordsY[type] = (int)placementspot.Y * 16;
        }
예제 #10
0
        public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
        {
            Tile tileBelow = Framing.GetTileSafely(i, j + 1);

            if (!tileBelow.active() || tileBelow.halfBrick() || tileBelow.topSlope() || tileBelow.type != ModContent.TileType <Block.BriarGrass>())
            {
                WorldGen.KillTile(i, j);
            }

            return(true);
        }
예제 #11
0
        /*public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
         * {
         * r = 0.2f;
         * g = 0.1f;
         * b = 0.2f;
         * }
         *
         * public override bool CanExplode(int i, int j)
         * {
         * return false;
         * }*/

        public override int SaplingGrowthType(ref int style)
        {
            style = 0;
            return(ModContent.TileType <RebornSapling>());
        }
예제 #12
0
 public DebugPlacer3() : base("Debug Placer 3", "Suck my huge dragon dong", ModContent.TileType <VitricSpike>(), 0)
 {
 }
예제 #13
0
 public DebugPlacer2() : base("Debug Placer 2", "Suck my huge dragon dong", ModContent.TileType <AncientSandstone>(), 0)
 {
 }
예제 #14
0
 public DebugPlacer1() : base("Debug Placer 1", "Suck my huge dragon dong", ModContent.TileType <Tiles.Overgrow.SetpieceAltar>(), 0)
 {
 }
예제 #15
0
 public override void SetDefaults()
 {
     item.CloneDefaults(ItemID.Furnace);
     item.createTile = ModContent.TileType <AssemblerTile>();
 }
        public static void GenCaliburnShrine(int type)
        {
            bool    foundspot = false;
            Vector2 here      = new Vector2();
            Tile    tstart;

            allDankWater = new List <Point>();



            for (int tries = 0; tries < 50000; tries++)
            {
startover:
                here   = new Vector2(WorldGen.genRand.Next(200, Main.maxTilesX - 200), WorldGen.genRand.Next((int)WorldGen.worldSurfaceLow + 400, Main.maxTilesY - 300));
                tstart = Framing.GetTileSafely(here);// tile1.type=TileID.RainCloud; tile1.active(true);
                int      buffersizex = 100;
                int      buffersizey = 100;
                int      x           = (int)here.X;
                int      y           = (int)here.Y;
                int      xbuffer     = -buffersizex;
                int      ybuffer     = -buffersizey;
                bool     foundspot2  = true;
                ushort[] stoneTypes  = new ushort[] { TileID.BlueDungeonBrick, TileID.GreenDungeonBrick, TileID.PinkDungeonBrick, TileID.LihzahrdBrick, (ushort)ModContent.TileType <MoistStone>() };
                for (xbuffer = -buffersizex; xbuffer < buffersizex; xbuffer++)
                {
                    for (ybuffer = -buffersizey; ybuffer < buffersizey; ybuffer++)
                    {
                        Tile tile = Framing.GetTileSafely((int)here.X + xbuffer, (int)here.Y + ybuffer);
                        if (stoneTypes.Any(iii => iii == tile.type))
                        {
                            foundspot2 = false;
                            goto startover;
                        }
                    }
                }
                if (foundspot2)
                {
                    foundspot = true;
                    break;
                }
            }

            if (foundspot)
            {
                NormalWorldGeneration.PlaceCaiburnShrine(here, type);
            }
        }
예제 #17
0
 public class StonePureItem : QuickTileItem { public StonePureItem() : base("Purestone", "It shines brilliantly", ModContent.TileType <Tiles.Purified.StonePure2>(), 0)
                                              {
                                              }
        public static void MuddifyShrines()
        {
            Liquid.QuickWater(3);
            WorldGen.WaterCheck();
            int num78 = 0;

            Liquid.quickSettle = true;
            while (num78 < 10)
            {
                int num79 = Liquid.numLiquid + LiquidBuffer.numLiquidBuffer;
                num78++;
                float num80 = 0f;
                while (Liquid.numLiquid > 0)
                {
                    float num81 = (float)(num79 - (Liquid.numLiquid + LiquidBuffer.numLiquidBuffer)) / (float)num79;
                    if (Liquid.numLiquid + LiquidBuffer.numLiquidBuffer > num79)
                    {
                        num79 = Liquid.numLiquid + LiquidBuffer.numLiquidBuffer;
                    }
                    if (num81 > num80)
                    {
                        num80 = num81;
                    }
                    else
                    {
                        num81 = num80;
                    }
                    if (num78 == 1)
                    {
                        //progress.Set(num81 / 3f + 0.33f);
                    }
                    int num82 = 10;
                    if (num78 > num82)
                    {
                        num82 = num78;
                    }
                    Liquid.UpdateLiquid();
                }
                WorldGen.WaterCheck();
            }
            Liquid.quickSettle = false;



            foreach (List <Point> waterPoints in eachShrineWater)
            {
                int indexWaterTile = 0;
                foreach (Point floodedTilePoint in waterPoints.Distinct().Where(testby => Main.tile[testby.X, testby.Y].liquid > 250).OrderBy(testby => 100000 - testby.Y + WorldGen.genRand.Next(-4, 4)))
                {
                    if (indexWaterTile < waterPoints.Count / 2)
                    {
                        Tile tileAbove = Framing.GetTileSafely(floodedTilePoint.X, floodedTilePoint.Y - WorldGen.genRand.Next(2, 5));
                        if (tileAbove.liquid > 250)
                        {
                            Tile tile = Framing.GetTileSafely(floodedTilePoint.X, floodedTilePoint.Y);
                            if (!tile.active() || Main.tileCut[tile.type])
                            {
                                WorldGen.PlaceTile(floodedTilePoint.X, floodedTilePoint.Y, ModContent.TileType <MoistSand>(), false, true);
                            }
                        }
                    }
                    //indexWaterTile += 1;
                }
            }
        }
예제 #19
0
 public override int SaplingGrowthType(ref int style)
 {
     style = 1;
     return(ModContent.TileType <The404Sapling>());
 }
예제 #20
0
        public override bool ValidTile(int i, int j)
        {
            Tile tile = Main.tile[i, j];

            return(tile.active() && tile.type == ModContent.TileType <CrimsonPustuleTile>() && tile.frameY % 36 == 0 && tile.frameY == 0);
        }
예제 #21
0
파일: OWorld.cs 프로젝트: Reallyifs/OdeMod
 internal static void SpawnBrightironOre()
 {
     if (!SpawnBrightironOreAlready)
     {
         int maxTile = (int)(Main.maxTilesX * Main.maxTilesY * 9E-04);
         for (int i = 0; i < maxTile; i++)
         {
             int x = WorldGen.genRand.Next(0, Main.maxTilesX);
             int y = WorldGen.genRand.Next((int)WorldGen.rockLayerHigh, Main.maxTilesY);
             WorldGen.TileRunner(x, y, Main.rand.Next(1, 5), Main.rand.Next(2, 5), ModContent.TileType <TileBrightironOre>());
         }
         SpawnBrightironOreAlready = true;
     }
 }
예제 #22
0
        private static bool IsShipAreaClear(Point16 location, ushort structureID, bool centered = false)        //used before PlaceShipStructure()
        {
            if (centered)
            {
                location -= new Point16(ShipStructureSizes[structureID].X / 2, ShipStructureSizes[structureID].Y / 2);
            }

            for (int i = 0; i < ShipStructureSizes[structureID].X; i++)             //fills subworld with tile, this is here to stop escaping (example: RoD)
            {
                for (int j = 0; j < ShipStructureSizes[structureID].Y; j++)         //fills subworld with tile, this is here to stop escaping (example: RoD)
                {
                    //Dust.NewDustPerfect(new Vector2(location.X + i + 0.5f, location.Y + j + 0.5f) * 16, DustID.Fire);
                    Tile tile = Main.tile[location.X + i, location.Y + j];
                    if (tile.active() && (tile.type != ModContent.TileType <Tiles.Barrier>() || (tile.type == ModContent.TileType <Tiles.Barrier>() && (tile.frameX != short.MaxValue || tile.frameY != 0))))
                    {
                        return(false);
                    }
                }
            }
            return(true);
        }
        public override void Kill(int timeLeft)
        {
            Vector2 position = projectile.Center;

            Main.PlaySound(SoundID.Item14, (int)position.X, (int)position.Y);
            int radius = 8;     //this is the explosion radius, the highter is the value the bigger is the explosion

            bool placeTile       = false;
            int  placeTileAmount = Main.rand.Next(5);

            //damage part of the bomb
            ExplosionDamageProjectile.DamageRadius = (float)(radius * 1.5f);
            Projectile.NewProjectile(position.X, position.Y, 0, 0, mod.ProjectileType("ExplosionDamageProjectile"), 3000, 100, projectile.owner, 0.0f, 0);

            for (int x = -radius; x <= radius; x++)
            {
                for (int y = -radius; y <= radius; y++)
                {
                    int xPosition = (int)(x + position.X / 16.0f);
                    int yPosition = (int)(y + position.Y / 16.0f);

                    Main.tile[xPosition, yPosition].liquid = Tile.Liquid_Water;
                    WorldGen.SquareTileFrame(xPosition, yPosition, true);

                    if (Main.tile[xPosition, yPosition].type == TileID.LihzahrdBrick || Main.tile[xPosition, yPosition].type == TileID.LihzahrdAltar || Main.tile[xPosition, yPosition].type == TileID.LihzahrdFurnace || Main.tile[xPosition, yPosition].type == TileID.Cobalt || Main.tile[xPosition, yPosition].type == TileID.Palladium || Main.tile[xPosition, yPosition].type == TileID.Mythril || Main.tile[xPosition, yPosition].type == TileID.Orichalcum || Main.tile[xPosition, yPosition].type == TileID.Adamantite || Main.tile[xPosition, yPosition].type == TileID.Titanium ||
                        Main.tile[xPosition, yPosition].type == TileID.Chlorophyte || Main.tile[xPosition, yPosition].type == TileID.DefendersForge || Main.tile[xPosition, yPosition].type == TileID.DemonAltar)
                    {
                    }
                    else if (CalamityMod != null && (Main.tile[xPosition, yPosition].type == CalamityMod.TileType("SeaPrism") || Main.tile[xPosition, yPosition].type == CalamityMod.TileType("AerialiteOre") || Main.tile[xPosition, yPosition].type == CalamityMod.TileType("CryonicOre") ||
                                                     Main.tile[xPosition, yPosition].type == CalamityMod.TileType("CharredOre") || Main.tile[xPosition, yPosition].type == CalamityMod.TileType("PerennialOre") || Main.tile[xPosition, yPosition].type == CalamityMod.TileType("ScoriaOre") ||
                                                     Main.tile[xPosition, yPosition].type == CalamityMod.TileType("AstralOre") || Main.tile[xPosition, yPosition].type == CalamityMod.TileType("ExodiumOre") || Main.tile[xPosition, yPosition].type == CalamityMod.TileType("UelibloomOre") ||
                                                     Main.tile[xPosition, yPosition].type == CalamityMod.TileType("AuricOre") || Main.tile[xPosition, yPosition].type == CalamityMod.TileType("AbyssGravel") || Main.tile[xPosition, yPosition].type == CalamityMod.TileType("Voidstone") || Main.tile[xPosition, yPosition].type == CalamityMod.TileType("PlantyMush") ||
                                                     Main.tile[xPosition, yPosition].type == CalamityMod.TileType("Tenebris") || Main.tile[xPosition, yPosition].type == CalamityMod.TileType("ArenaBlock") || Main.tile[xPosition, yPosition].type == CalamityMod.TileType("Cinderplate") || Main.tile[xPosition, yPosition].type == CalamityMod.TileType("ExodiumClusterOre")))
                    {
                        if (Main.tile[xPosition, yPosition].type == TileID.Dirt)
                        {
                            WorldGen.KillTile(xPosition, yPosition, false, false, false);  //this makes the explosion destroy tiles
                            //if (CanBreakWalls) WorldGen.KillWall(xPosition, yPosition, false);
                        }
                    }
                    else if (ThoriumMod != null && (Main.tile[xPosition, yPosition].type == ThoriumMod.TileType("Aquaite") || Main.tile[xPosition, yPosition].type == ThoriumMod.TileType("LodeStone") || Main.tile[xPosition, yPosition].type == ThoriumMod.TileType("ValadiumChunk") || Main.tile[xPosition, yPosition].type == ThoriumMod.TileType("IllumiteChunk") ||
                                                    Main.tile[xPosition, yPosition].type == ThoriumMod.TileType("PearlStone") || Main.tile[xPosition, yPosition].type == ThoriumMod.TileType("DepthChestPlatform")))
                    {
                        if (Main.tile[xPosition, yPosition].type == TileID.Dirt)
                        {
                            WorldGen.KillTile(xPosition, yPosition, false, false, false);  //this makes the explosion destroy tiles
                            //if (CanBreakWalls) WorldGen.KillWall(xPosition, yPosition, false);
                        }
                    }
                    else //WorldGen.KillTile(xPosition, yPosition, false, false, true);  //this makes the explosion destroy tiles
                    {
                        if (Main.tile[xPosition, yPosition].type != null)
                        {
                        }
                        else
                        {
                            placeTile = true;

                            if (placeTileAmount-- > 0)
                            {
                                WorldGen.KillTile(xPosition, yPosition, false, false, true);  //this makes the explosion destroy tiles
                                WorldGen.PlaceTile(xPosition, yPosition, ModContent.TileType <NuclearWasteSurfaceTile>());
                            }
                        }
                    }
                }
                placeTile       = false;
                placeTileAmount = Main.rand.Next(5);
            }
        }
예제 #24
0
 public override void Kill(int timeLeft)
 {
     if (projectile.owner == Main.myPlayer && !projectile.noDropItem)
     {
         int tileX = (int)(projectile.position.X + projectile.width / 2) / 16;
         int tileY = (int)(projectile.position.Y + projectile.width / 2) / 16;
         if (Main.tile[tileX, tileY].halfBrick() && projectile.velocity.Y > 0f && System.Math.Abs(projectile.velocity.Y) > System.Math.Abs(projectile.velocity.X))
         {
             tileY--;
         }
         if (!Main.tile[tileX, tileY].active())
         {
             bool onMinecartTrack = tileY < Main.maxTilesY - 2 && Main.tile[tileX, tileY + 1] != null && Main.tile[tileX, tileY + 1].active() && Main.tile[tileX, tileY + 1].type == TileID.MinecartTrack;
             if (!onMinecartTrack)
             {
                 WorldGen.PlaceTile(tileX, tileY, ModContent.TileType <Depthsand>(), false, true, -1, 0);
             }
             if (!onMinecartTrack && Main.tile[tileX, tileY].active() && Main.tile[tileX, tileY].type == ModContent.TileType <Depthsand>())
             {
                 if (Main.tile[tileX, tileY + 1].halfBrick() || Main.tile[tileX, tileY + 1].slope() != 0)
                 {
                     WorldGen.SlopeTile(tileX, tileY + 1, 0);
                     if (Main.netMode == NetmodeID.Server)
                     {
                         NetMessage.SendData(17, -1, -1, null, 14, tileX, tileY + 1, 0f, 0, 0, 0);
                     }
                 }
                 if (Main.netMode != 0)
                 {
                     NetMessage.SendData(17, -1, -1, null, 1, tileX, tileY, ModContent.TileType <Depthsand>(), 0, 0, 0);
                 }
             }
         }
     }
 }
예제 #25
0
파일: DBTMod.cs 프로젝트: LinkatriX/DBT
        public override void Load()
        {
            if (!Main.dedServ)
            {
                HairGFX.LoadHairGFX(this);
                WishMenuGFX.LoadWishGFX(this);

                SteamHelper.Initialize();

                #region HotKeys

                characterMenuKey    = RegisterHotKey("Character Menu", "K");
                energyChargeKey     = RegisterHotKey("Energy Charge", "C");
                speedToggleKey      = RegisterHotKey("Speed Toggle", "Z");
                transformDownKey    = RegisterHotKey("Transform Down", "V");
                transformUpKey      = RegisterHotKey("Transform Up", "X");
                flightToggleKey     = RegisterHotKey("Flight Toggle", "Q");
                instantTransmission = RegisterHotKey("Instant Transmission", "I");
                techniqueMenuKey    = RegisterHotKey("Technique Menu", "N");

                #endregion

                kiBar = new KiBar();
                kiBar.Activate();

                kiBarInterface = new UserInterface();
                kiBarInterface.SetState(kiBar);
                kiBarInterface = new UserInterface();
                kiBarInterface.SetState(kiBar);

                kiBar.Visible = true;

                overloadBar = new OverloadBar();
                overloadBar.Activate();
                overloadBarInterface = new UserInterface();
                overloadBarInterface.SetState(overloadBar);

                dbtMenu = new DBTMenu();
                dbtMenu.Activate();

                characterTransformationsMenu = new CharacterTransformationsMenu(this);
                characterTransformationsMenu.Activate();
                characterMenuInterface = new UserInterface();
                characterMenuInterface.SetState(characterTransformationsMenu);

                techniqueMenu = new TechniqueMenu(this);
                techniqueMenu.Activate();
                techniqueMenuInterface = new UserInterface();
                techniqueMenuInterface.SetState(techniqueMenu);

                wishMenu = new WishMenu();
                wishMenu.Activate();
                wishMenuInterface = new UserInterface();
                wishMenuInterface.SetState(wishMenu);

                hairMenu = new HairMenu();
                hairMenu.Activate();
                hairMenuInterface = new UserInterface();
                hairMenuInterface.SetState(hairMenu);

                namekBookUI = new NamekianBookUI();
                namekBookUI.Activate();
                namekBookInterface = new UserInterface();
                namekBookInterface.SetState(namekBookUI);

                Ref <Effect> screenRef = new Ref <Effect>(GetEffect("Effects/ShockwaveEffect"));

                Filters.Scene["Shockwave"] = new Filter(new ScreenShaderData(screenRef, "Shockwave"), EffectPriority.VeryHigh);
                Filters.Scene["Shockwave"].Load();

                circle = new CircleShader(new Ref <Effect>(GetEffect("Effects/CircleShader")), "Pass1");

                AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/MusicBoxes/BirthOfAGod"), ModContent.ItemType <AngelStaffBoxItem>(), ModContent.TileType <AngelStaffBoxTile>());
                AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/MusicBoxes/HeadChala"), ModContent.ItemType <OneStarBoxItem>(), ModContent.TileType <OneStarBoxTile>());
                AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/MusicBoxes/Budokai2"), ModContent.ItemType <TwoStarBoxItem>(), ModContent.TileType <TwoStarBoxTile>());
                AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/MusicBoxes/Budokai3"), ModContent.ItemType <ThreeStarBoxItem>(), ModContent.TileType <ThreeStarBoxTile>());
                AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/MusicBoxes/SSJ3Song"), ModContent.ItemType <FourStarBoxItem>(), ModContent.TileType <FourStarBoxTile>());
                AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/MusicBoxes/Challenge"), ModContent.ItemType <FiveStarBoxItem>(), ModContent.TileType <FiveStarBoxTile>());
                AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/MusicBoxes/LostCourage"), ModContent.ItemType <SixStarBoxItem>(), ModContent.TileType <SixStarBoxTile>());
                AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/MusicBoxes/VegetaSSJ"), ModContent.ItemType <SevenStarBoxItem>(), ModContent.TileType <SevenStarBoxTile>());
                AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/MusicBoxes/XV2Villain"), ModContent.ItemType <DragonBallsBoxItem>(), ModContent.TileType <DragonBallsBoxTile>());
                AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/MusicBoxes/BurstLimit"), ModContent.ItemType <BabidisMagicBoxItem>(), ModContent.TileType <BabidisMagicBoxTile>());
                AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/TheBarrenWastelands"), ModContent.ItemType <WastelandsBoxItem>(), ModContent.TileType <WastelandsBoxTile>());
                AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/TheUnexpectedArrival"), ModContent.ItemType <FFBoxItem>(), ModContent.TileType <FFBoxTile>());
            }
        }
예제 #26
0
        public override float SpawnChance(NPCSpawnInfo spawnInfo)
        {
            Player player = spawnInfo.player;

            if (!player.GetSpiritPlayer().ZoneSpirit)
            {
                return(0f);
            }
            if (SpawnTiles.Length == 0)
            {
                int[] Tiles = { ModContent.TileType <SpiritDirt>(), ModContent.TileType <SpiritStone>(), ModContent.TileType <SpiritGrass>(), ModContent.TileType <SpiritIce>() };
                SpawnTiles = Tiles;
            }
            return(SpawnTiles.Contains(Main.tile[spawnInfo.spawnTileX, spawnInfo.spawnTileY].type) && player.position.Y / 16 >= Main.maxTilesY - 330 && player.GetSpiritPlayer().ZoneSpirit&& !spawnInfo.playerSafe ? 3f : 0f);
        }
예제 #27
0
        public override void SetDefaults()
        {
            base.SetDefaults();

            item.createTile = ModContent.TileType <TabidachiMusicBoxTile>();
        }
        protected override void AddRecipes()
        {
            int
            //foldedMetal = ModContent.ItemType<FoldedMetal>(),
                                               arcaneArmorFabricator = ModContent.TileType <ArcaneArmorFabricator>();


            /*ModRecipe recipe = new ModRecipe(CallerMod);
             *
             * recipe.AddIngredient(foldedMetal);
             * recipe.AddTile(arcaneArmorFabricator);
             *
             * recipe.SetResult(ModContent.ItemType<SteelArrow>());
             * recipe.AddRecipe();
             *
             *
             *
             * recipe = new ModRecipe(CallerMod);
             *
             * recipe.AddIngredient(foldedMetal);
             * recipe.AddTile(arcaneArmorFabricator);
             *
             * recipe.SetResult(ModContent.ItemType<SteelAxe>());
             * recipe.AddRecipe();
             *
             *
             *
             * recipe = new ModRecipe(CallerMod);
             *
             * recipe.AddIngredient(foldedMetal);
             * recipe.AddTile(arcaneArmorFabricator);
             *
             * recipe.SetResult(ModContent.ItemType<SteelBattleAxe>(), 10);
             * recipe.AddRecipe();
             *
             *
             *
             * recipe = new ModRecipe(CallerMod);
             *
             * recipe.AddIngredient(foldedMetal);
             * recipe.AddTile(arcaneArmorFabricator);
             *
             * recipe.SetResult(ModContent.ItemType<SteelBlade>());
             * recipe.AddRecipe();
             *
             *
             *
             * recipe = new ModRecipe(CallerMod);
             *
             * recipe.AddIngredient(foldedMetal);
             * recipe.AddTile(arcaneArmorFabricator);
             *
             * recipe.SetResult(ModContent.ItemType<SteelBow>());
             * recipe.AddRecipe();
             *
             *
             *
             * recipe = new ModRecipe(CallerMod);
             *
             * recipe.AddIngredient(foldedMetal);
             * recipe.AddTile(arcaneArmorFabricator);
             *
             * recipe.SetResult(ModContent.ItemType<SteelChestplate>());
             * recipe.AddRecipe();
             *
             *
             *
             * recipe = new ModRecipe(CallerMod);
             *
             * recipe.AddIngredient(foldedMetal);
             * recipe.AddTile(arcaneArmorFabricator);
             *
             * recipe.SetResult(ModContent.ItemType<SteelGreaves>());
             * recipe.AddRecipe();
             *
             *
             *
             * recipe = new ModRecipe(CallerMod);
             *
             * recipe.AddIngredient(foldedMetal);
             * recipe.AddTile(arcaneArmorFabricator);
             *
             * recipe.SetResult(ModContent.ItemType<SteelHelmet>());
             * recipe.AddRecipe();
             *
             *
             *
             * recipe = new ModRecipe(CallerMod);
             *
             * recipe.AddIngredient(foldedMetal);
             * recipe.AddTile(arcaneArmorFabricator);
             *
             * recipe.SetResult(ModContent.ItemType<SteelMallet>());
             * recipe.AddRecipe();
             *
             *
             *
             * recipe = new ModRecipe(CallerMod);
             *
             * recipe.AddIngredient(foldedMetal);
             * recipe.AddTile(arcaneArmorFabricator);
             *
             * recipe.SetResult(ModContent.ItemType<SteelPickaxe>());
             * recipe.AddRecipe();*/
        }
예제 #29
0
        public static void HandleTransportion(int i, int j, int playernum, bool inServer = false)
        {
            int     statX            = i;
            int     addX             = 0;
            int     PortalType       = ModContent.TileType <UnderworldPortal>();
            Vector2 PortalUnderworld = Vector2.Zero;

            if (j >= Main.maxTilesY - 360) // 如果在地狱附近(传送目标地表)
            {
                Player player = Main.player[playernum];
                // 搜索可用的在地表附近的地狱门
                while (PortalUnderworld == Vector2.Zero)
                {
                    addX++;
                    for (int y = 10; y < Main.maxTilesY - 360; y++)
                    {
                        if (Main.tile[statX + addX, y] == null)
                        {
                            Main.tile[statX + addX, y] = new Tile();
                        }
                        if (Main.tile[statX - addX, y] == null)
                        {
                            Main.tile[statX - addX, y] = new Tile();
                        }
                        if (WorldGen.InWorld(statX + addX, y) && Main.tile[statX + addX, y].type == PortalType)
                        {
                            PortalUnderworld = new Vector2(statX + addX, y);
                        }
                        if (WorldGen.InWorld(statX - addX, y) && Main.tile[statX - addX, y].type == PortalType)
                        {
                            PortalUnderworld = new Vector2(statX - addX, y);
                        }
                    }
                    // 如果左右300格范围内没有,直接传送至出生点
                    if (addX >= 300)
                    {
                        ModHelper.Return(player);
                        return;
                    }
                }
                // 如果搜索到,传送
                player.HandleTeleport(PortalUnderworld.ToWorldCoordinates(0, -16));
            }
            else // 在地表
            {
                // 搜索可用的在地狱高度的地狱门
                while (PortalUnderworld == Vector2.Zero)
                {
                    for (int y = Main.maxTilesY - 180; y < Main.maxTilesY - 30; y++)
                    {
                        if (Main.tile[statX + addX, y] == null)
                        {
                            Main.tile[statX + addX, y] = new Tile();
                        }
                        if (Main.tile[statX - addX, y] == null)
                        {
                            Main.tile[statX - addX, y] = new Tile();
                        }
                        if (WorldGen.InWorld(statX + addX, y) && Main.tile[statX + addX, y].type == PortalType)
                        {
                            PortalUnderworld = new Vector2(statX + addX, y);
                        }
                        if (WorldGen.InWorld(statX - addX, y) && Main.tile[statX - addX, y].type == PortalType)
                        {
                            PortalUnderworld = new Vector2(statX - addX, y);
                        }
                    }
                    // 如果左右150格范围内没有,停止搜索
                    if (addX >= 150)
                    {
                        break;
                    }
                    addX++;
                }
                // 如果没有找到,转而生成地狱门
                if (PortalUnderworld == Vector2.Zero)
                {
                    PortalUnderworld.X = statX;
                    PortalUnderworld.Y = Main.maxTilesY - Main.rand.Next(160, 210);
                    if (PortalUnderworld.X < 30)
                    {
                        PortalUnderworld.X = 30;
                    }
                    if (PortalUnderworld.X > Main.maxTilesX - 30 - 6)
                    {
                        PortalUnderworld.X = Main.maxTilesX - 30 - 6;
                    }
                    // 创建物块
                    if (inServer)
                    {
                        MessageHelper.BuildBuilding("Buildings/UnderworldPortal.ebuilding", PortalUnderworld.ToWorldCoordinates());
                    }
                    else
                    {
                        Buildings.Build("Buildings/UnderworldPortal.ebuilding", PortalUnderworld.ToWorldCoordinates());
                    }
                    // 定位到左上角的传送门方块
                    PortalUnderworld.X += 1;
                    PortalUnderworld.Y += 2;
                }
                // 2:进行传送
                Player player = Main.player[playernum];
                player.HandleTeleport(PortalUnderworld.ToWorldCoordinates(8, -16));
            }
        }
예제 #30
0
 public ColorCartridgeBlendRecipe(BetterPaintMod mymod, ColorCartridgeItem myitem) : base(mymod)
 {
     this.AddTile(ModContent.TileType <PaintMixerTile>());
     this.AddIngredient(myitem, 2);
     this.SetResult(myitem, 1);
 }