예제 #1
0
        internal static int FindChestSafe(int x, int y)
        {
            if (Main.tile[x, y] != null)
            {
                Point16 pos = FindChestTopLeft(x, y, false);
                return(Chest.FindChest(pos.X, pos.Y));
            }

            return(Chest.FindChestByGuessing(x, y));
        }
예제 #2
0
            //

            bool containsUnsafeChest(int x, int y)
            {
                Tile tile = Main.tile[x, y];

                if (tile.type == TileID.Containers || tile.type == TileID.Containers2 || tile.type == TileID.FakeContainers || tile.type == TileID.FakeContainers2)
                {
                    int chestIdx = Chest.FindChestByGuessing(tileX, tileY);
                    if (chestIdx != -1 && Main.chest[chestIdx].item.Any(i => i?.IsAir == false))
                    {
                        return(true);                          // No non-empty chests
                    }
                }
                return(false);
            }
예제 #3
0
파일: Ping.cs 프로젝트: direwolf420/Pings
        private static string DrawMap_FindChestName(LocalizedText[] chestNames, Tile chestTile, int x, int y, int fullTileWidth = 36)
        {
            int num = Chest.FindChestByGuessing(x, y);

            if (num < 0)
            {
                return(chestNames[0].Value);
            }

            if (Main.chest[num].name != "")
            {
                return(string.Concat(chestNames[chestTile.frameX / fullTileWidth], ": ", Main.chest[num].name));
            }

            return(chestNames[chestTile.frameX / fullTileWidth].Value);
        }