示例#1
0
        public override bool CanUseItem(Player player)
        {
            int   num  = 0;
            float num2 = Main.maxTilesX / 4200;
            int   num3 = (int)(400f * num2);

            for (int j = 5; j < Main.maxTilesX - 5; j++)
            {
                int num4 = 5;
                while (num4 < Main.worldSurface)
                {
                    if (Main.tile[j, num4].active() && Main.tile[j, num4].type == (ushort)ModContent.TileType <Tiles.CometOre>())
                    {
                        num++;
                        if (num > num3)
                        {
                            BaseUtility.Chat("Another comet exists in this world in some form or another already...", new Color(136, 151, 255), true);
                            return(false);
                        }
                    }
                    num4++;
                }
            }
            CWorld.DropMeteor();
            return(true);
        }