Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CheckTallGate()

static void Terraria.WorldGen.CheckTallGate ( int x,
int y,
int type )
inlinestatic

Definition at line 43209 of file WorldGen.cs.

43210 {
43211 if (destroyObject)
43212 {
43213 return;
43214 }
43215 bool flag = false;
43216 Tile tileSafely = Framing.GetTileSafely(x, y);
43217 Point point = new Point(tileSafely.frameX / 18, 0);
43219 point.Y = tileSafely.frameY / tileData.CoordinateFullHeight;
43220 int width = tileData.Width;
43221 int height = tileData.Height;
43222 int i = 0;
43223 for (int num = tileSafely.frameY % tileData.CoordinateFullHeight; i < height && num - tileData.CoordinateHeights[i] >= 0; i++)
43224 {
43225 num -= tileData.CoordinateHeights[i];
43226 }
43227 _ = tileData.CoordinateFullHeight;
43228 y -= i;
43229 int num2 = point.Y * tileData.CoordinateFullHeight;
43230 for (int j = 0; j < height; j++)
43231 {
43232 tileSafely = Framing.GetTileSafely(x, y + j);
43233 if (tileSafely.frameX != point.X * tileData.CoordinateFullWidth || tileSafely.frameY != num2)
43234 {
43235 flag = true;
43236 break;
43237 }
43238 num2 += tileData.CoordinateHeights[j] + tileData.CoordinatePadding;
43239 }
43240 if (!flag && CheckTileAnchors(x, y, width, height, 2, AnchorType.SolidTile))
43241 {
43242 return;
43243 }
43244 destroyObject = true;
43245 for (int k = x; k < x + width; k++)
43246 {
43247 for (int l = y; l < y + height; l++)
43248 {
43249 KillTile(k, l);
43250 }
43251 }
43252 int type2 = 3240;
43253 if (point.Y == 0)
43254 {
43255 type2 = 3240;
43256 }
43257 Item.NewItem(GetItemSource_FromTileBreak(x, y), x * 16, y * 16, width * 16, height * 16, type2);
43258 for (int m = x - 1; m < x + width + 1; m++)
43259 {
43260 for (int n = y - 1; n < y + height + 1; n++)
43261 {
43262 TileFrame(m, n);
43263 }
43264 }
43265 destroyObject = false;
43266 }
static TileObjectData GetTileData(int type, int style, int alternate=0)
static bool destroyObject
Definition WorldGen.cs:1020
static void KillTile(int i, int j, bool fail=false, bool effectOnly=false, bool noItem=false)
static void TileFrame(int i, int j, bool resetFrame=false, bool noBreak=false)
static bool CheckTileAnchors(int sx, int sy, int w, int h, int mode, AnchorType anchor)
static IEntitySource GetItemSource_FromTileBreak(int x, int y)

References Terraria.ObjectData.TileObjectData.GetTileData(), Terraria.Framing.GetTileSafely(), Terraria.Item.NewItem(), System.type, Microsoft.Xna.Framework.Point.X, and Microsoft.Xna.Framework.Point.Y.