public static void SelfFrame8Way(int i, int j, Tile centerTile, bool resetFrame) { if (!centerTile.active()) { return; } ushort gemsparkFramingType = TileID.Sets.GemsparkFramingTypes[(int)centerTile.type]; Framing.BlockStyle blockStyle1 = Framing.FindBlockStyle(centerTile); int index = 0; Framing.BlockStyle blockStyle2 = new Framing.BlockStyle(); if (blockStyle1.top) { Tile tileSafely = Framing.GetTileSafely(i, j - 1); if (tileSafely.active() && (int)TileID.Sets.GemsparkFramingTypes[(int)tileSafely.type] == (int)gemsparkFramingType) { blockStyle2 = Framing.FindBlockStyle(tileSafely); if (blockStyle2.bottom) { index |= 1; } else { blockStyle2.Clear(); } } } Framing.BlockStyle blockStyle3 = new Framing.BlockStyle(); if (blockStyle1.left) { Tile tileSafely = Framing.GetTileSafely(i - 1, j); if (tileSafely.active() && (int)TileID.Sets.GemsparkFramingTypes[(int)tileSafely.type] == (int)gemsparkFramingType) { blockStyle3 = Framing.FindBlockStyle(tileSafely); if (blockStyle3.right) { index |= 2; } else { blockStyle3.Clear(); } } } Framing.BlockStyle blockStyle4 = new Framing.BlockStyle(); if (blockStyle1.right) { Tile tileSafely = Framing.GetTileSafely(i + 1, j); if (tileSafely.active() && (int)TileID.Sets.GemsparkFramingTypes[(int)tileSafely.type] == (int)gemsparkFramingType) { blockStyle4 = Framing.FindBlockStyle(tileSafely); if (blockStyle4.left) { index |= 4; } else { blockStyle4.Clear(); } } } Framing.BlockStyle blockStyle5 = new Framing.BlockStyle(); if (blockStyle1.bottom) { Tile tileSafely = Framing.GetTileSafely(i, j + 1); if (tileSafely.active() && (int)TileID.Sets.GemsparkFramingTypes[(int)tileSafely.type] == (int)gemsparkFramingType) { blockStyle5 = Framing.FindBlockStyle(tileSafely); if (blockStyle5.top) { index |= 8; } else { blockStyle5.Clear(); } } } if (blockStyle2.left && blockStyle3.top) { Tile tileSafely = Framing.GetTileSafely(i - 1, j - 1); if (tileSafely.active() && (int)TileID.Sets.GemsparkFramingTypes[(int)tileSafely.type] == (int)gemsparkFramingType) { Framing.BlockStyle blockStyle6 = Framing.FindBlockStyle(tileSafely); if (blockStyle6.right && blockStyle6.bottom) { index |= 16; } } } if (blockStyle2.right && blockStyle4.top) { Tile tileSafely = Framing.GetTileSafely(i + 1, j - 1); if (tileSafely.active() && (int)TileID.Sets.GemsparkFramingTypes[(int)tileSafely.type] == (int)gemsparkFramingType) { Framing.BlockStyle blockStyle6 = Framing.FindBlockStyle(tileSafely); if (blockStyle6.left && blockStyle6.bottom) { index |= 32; } } } if (blockStyle5.left && blockStyle3.bottom) { Tile tileSafely = Framing.GetTileSafely(i - 1, j + 1); if (tileSafely.active() && (int)TileID.Sets.GemsparkFramingTypes[(int)tileSafely.type] == (int)gemsparkFramingType) { Framing.BlockStyle blockStyle6 = Framing.FindBlockStyle(tileSafely); if (blockStyle6.right && blockStyle6.top) { index |= 64; } } } if (blockStyle5.right && blockStyle4.bottom) { Tile tileSafely = Framing.GetTileSafely(i + 1, j + 1); if (tileSafely.active() && (int)TileID.Sets.GemsparkFramingTypes[(int)tileSafely.type] == (int)gemsparkFramingType) { Framing.BlockStyle blockStyle6 = Framing.FindBlockStyle(tileSafely); if (blockStyle6.left && blockStyle6.top) { index |= 128; } } } if (resetFrame) { centerTile.frameNumber((byte)WorldGen.genRand.Next(0, 3)); } Point16 point16 = Framing.selfFrame8WayLookup[index][(int)centerTile.frameNumber()]; centerTile.frameX = point16.X; centerTile.frameY = point16.Y; }
// Token: 0x0600087C RID: 2172 RVA: 0x003AD110 File Offset: 0x003AB310 public static void SelfFrame8Way(int i, int j, Tile centerTile, bool resetFrame) { if (!centerTile.active()) { return; } ushort num = TileID.Sets.GemsparkFramingTypes[(int)centerTile.type]; Framing.BlockStyle arg_28_0 = Framing.FindBlockStyle(centerTile); int num2 = 0; Framing.BlockStyle blockStyle = default(Framing.BlockStyle); if (arg_28_0.top) { Tile tileSafely = Framing.GetTileSafely(i, j - 1); if (tileSafely.active() && TileID.Sets.GemsparkFramingTypes[(int)tileSafely.type] == num) { blockStyle = Framing.FindBlockStyle(tileSafely); if (blockStyle.bottom) { num2 |= 1; } else { blockStyle.Clear(); } } } Framing.BlockStyle blockStyle2 = default(Framing.BlockStyle); if (arg_28_0.left) { Tile tileSafely2 = Framing.GetTileSafely(i - 1, j); if (tileSafely2.active() && TileID.Sets.GemsparkFramingTypes[(int)tileSafely2.type] == num) { blockStyle2 = Framing.FindBlockStyle(tileSafely2); if (blockStyle2.right) { num2 |= 2; } else { blockStyle2.Clear(); } } } Framing.BlockStyle blockStyle3 = default(Framing.BlockStyle); if (arg_28_0.right) { Tile tileSafely3 = Framing.GetTileSafely(i + 1, j); if (tileSafely3.active() && TileID.Sets.GemsparkFramingTypes[(int)tileSafely3.type] == num) { blockStyle3 = Framing.FindBlockStyle(tileSafely3); if (blockStyle3.left) { num2 |= 4; } else { blockStyle3.Clear(); } } } Framing.BlockStyle blockStyle4 = default(Framing.BlockStyle); if (arg_28_0.bottom) { Tile tileSafely4 = Framing.GetTileSafely(i, j + 1); if (tileSafely4.active() && TileID.Sets.GemsparkFramingTypes[(int)tileSafely4.type] == num) { blockStyle4 = Framing.FindBlockStyle(tileSafely4); if (blockStyle4.top) { num2 |= 8; } else { blockStyle4.Clear(); } } } if (blockStyle.left && blockStyle2.top) { Tile tileSafely5 = Framing.GetTileSafely(i - 1, j - 1); if (tileSafely5.active() && TileID.Sets.GemsparkFramingTypes[(int)tileSafely5.type] == num) { Framing.BlockStyle blockStyle5 = Framing.FindBlockStyle(tileSafely5); if (blockStyle5.right && blockStyle5.bottom) { num2 |= 16; } } } if (blockStyle.right && blockStyle3.top) { Tile tileSafely6 = Framing.GetTileSafely(i + 1, j - 1); if (tileSafely6.active() && TileID.Sets.GemsparkFramingTypes[(int)tileSafely6.type] == num) { Framing.BlockStyle blockStyle6 = Framing.FindBlockStyle(tileSafely6); if (blockStyle6.left && blockStyle6.bottom) { num2 |= 32; } } } if (blockStyle4.left && blockStyle2.bottom) { Tile tileSafely7 = Framing.GetTileSafely(i - 1, j + 1); if (tileSafely7.active() && TileID.Sets.GemsparkFramingTypes[(int)tileSafely7.type] == num) { Framing.BlockStyle blockStyle7 = Framing.FindBlockStyle(tileSafely7); if (blockStyle7.right && blockStyle7.top) { num2 |= 64; } } } if (blockStyle4.right && blockStyle3.bottom) { Tile tileSafely8 = Framing.GetTileSafely(i + 1, j + 1); if (tileSafely8.active() && TileID.Sets.GemsparkFramingTypes[(int)tileSafely8.type] == num) { Framing.BlockStyle blockStyle8 = Framing.FindBlockStyle(tileSafely8); if (blockStyle8.left && blockStyle8.top) { num2 |= 128; } } } if (resetFrame) { centerTile.frameNumber((byte)WorldGen.genRand.Next(0, 3)); } Point16 point = Framing.selfFrame8WayLookup[num2][(int)centerTile.frameNumber()]; centerTile.frameX = point.X; centerTile.frameY = point.Y; }
public static void SelfFrame8Way(int i, int j, Tile centerTile, bool resetFrame) { if (!centerTile.active()) { return; } ushort type = centerTile.type; Framing.BlockStyle blockStyle = Framing.FindBlockStyle(centerTile); int num = 0; Framing.BlockStyle blockStyle2 = default(Framing.BlockStyle); if (blockStyle.top) { Tile tileSafely = Framing.GetTileSafely(i, j - 1); if (tileSafely.active() && tileSafely.type == type) { blockStyle2 = Framing.FindBlockStyle(tileSafely); if (blockStyle2.bottom) { num |= 1; } else { blockStyle2.Clear(); } } } Framing.BlockStyle blockStyle3 = default(Framing.BlockStyle); if (blockStyle.left) { Tile tileSafely2 = Framing.GetTileSafely(i - 1, j); if (tileSafely2.active() && tileSafely2.type == type) { blockStyle3 = Framing.FindBlockStyle(tileSafely2); if (blockStyle3.right) { num |= 2; } else { blockStyle3.Clear(); } } } Framing.BlockStyle blockStyle4 = default(Framing.BlockStyle); if (blockStyle.right) { Tile tileSafely3 = Framing.GetTileSafely(i + 1, j); if (tileSafely3.active() && tileSafely3.type == type) { blockStyle4 = Framing.FindBlockStyle(tileSafely3); if (blockStyle4.left) { num |= 4; } else { blockStyle4.Clear(); } } } Framing.BlockStyle blockStyle5 = default(Framing.BlockStyle); if (blockStyle.bottom) { Tile tileSafely4 = Framing.GetTileSafely(i, j + 1); if (tileSafely4.active() && tileSafely4.type == type) { blockStyle5 = Framing.FindBlockStyle(tileSafely4); if (blockStyle5.top) { num |= 8; } else { blockStyle5.Clear(); } } } if (blockStyle2.left && blockStyle3.top) { Tile tileSafely5 = Framing.GetTileSafely(i - 1, j - 1); if (tileSafely5.active() && tileSafely5.type == type) { Framing.BlockStyle blockStyle6 = Framing.FindBlockStyle(tileSafely5); if (blockStyle6.right && blockStyle6.bottom) { num |= 16; } } } if (blockStyle2.right && blockStyle4.top) { Tile tileSafely6 = Framing.GetTileSafely(i + 1, j - 1); if (tileSafely6.active() && tileSafely6.type == type) { Framing.BlockStyle blockStyle7 = Framing.FindBlockStyle(tileSafely6); if (blockStyle7.left && blockStyle7.bottom) { num |= 32; } } } if (blockStyle5.left && blockStyle3.bottom) { Tile tileSafely7 = Framing.GetTileSafely(i - 1, j + 1); if (tileSafely7.active() && tileSafely7.type == type) { Framing.BlockStyle blockStyle8 = Framing.FindBlockStyle(tileSafely7); if (blockStyle8.right && blockStyle8.top) { num |= 64; } } } if (blockStyle5.right && blockStyle4.bottom) { Tile tileSafely8 = Framing.GetTileSafely(i + 1, j + 1); if (tileSafely8.active() && tileSafely8.type == type) { Framing.BlockStyle blockStyle9 = Framing.FindBlockStyle(tileSafely8); if (blockStyle9.left && blockStyle9.top) { num |= 128; } } } if (resetFrame) { centerTile.frameNumber((byte)WorldGen.genRand.Next(0, 3)); } Point16 point = Framing.selfFrame8WayLookup[num][(int)centerTile.frameNumber()]; centerTile.frameX = point.x; centerTile.frameY = point.y; }
public static void SelfFrame8Way(int i, int j, Tile centerTile, bool resetFrame) { if (!centerTile.active()) { return; } ushort num = centerTile.type; Framing.BlockStyle blockStyle = Framing.FindBlockStyle(centerTile); int num1 = 0; Framing.BlockStyle blockStyle1 = new Framing.BlockStyle(); if (blockStyle.top) { Tile tileSafely = Framing.GetTileSafely(i, j - 1); if (tileSafely.active() && tileSafely.type == num) { blockStyle1 = Framing.FindBlockStyle(tileSafely); if (!blockStyle1.bottom) { blockStyle1.Clear(); } else { num1 = num1 | 1; } } } Framing.BlockStyle blockStyle2 = new Framing.BlockStyle(); if (blockStyle.left) { Tile tile = Framing.GetTileSafely(i - 1, j); if (tile.active() && tile.type == num) { blockStyle2 = Framing.FindBlockStyle(tile); if (!blockStyle2.right) { blockStyle2.Clear(); } else { num1 = num1 | 2; } } } Framing.BlockStyle blockStyle3 = new Framing.BlockStyle(); if (blockStyle.right) { Tile tileSafely1 = Framing.GetTileSafely(i + 1, j); if (tileSafely1.active() && tileSafely1.type == num) { blockStyle3 = Framing.FindBlockStyle(tileSafely1); if (!blockStyle3.left) { blockStyle3.Clear(); } else { num1 = num1 | 4; } } } Framing.BlockStyle blockStyle4 = new Framing.BlockStyle(); if (blockStyle.bottom) { Tile tile1 = Framing.GetTileSafely(i, j + 1); if (tile1.active() && tile1.type == num) { blockStyle4 = Framing.FindBlockStyle(tile1); if (!blockStyle4.top) { blockStyle4.Clear(); } else { num1 = num1 | 8; } } } if (blockStyle1.left && blockStyle2.top) { Tile tileSafely2 = Framing.GetTileSafely(i - 1, j - 1); if (tileSafely2.active() && tileSafely2.type == num) { Framing.BlockStyle blockStyle5 = Framing.FindBlockStyle(tileSafely2); if (blockStyle5.right && blockStyle5.bottom) { num1 = num1 | 16; } } } if (blockStyle1.right && blockStyle3.top) { Tile tile2 = Framing.GetTileSafely(i + 1, j - 1); if (tile2.active() && tile2.type == num) { Framing.BlockStyle blockStyle6 = Framing.FindBlockStyle(tile2); if (blockStyle6.left && blockStyle6.bottom) { num1 = num1 | 32; } } } if (blockStyle4.left && blockStyle2.bottom) { Tile tileSafely3 = Framing.GetTileSafely(i - 1, j + 1); if (tileSafely3.active() && tileSafely3.type == num) { Framing.BlockStyle blockStyle7 = Framing.FindBlockStyle(tileSafely3); if (blockStyle7.right && blockStyle7.top) { num1 = num1 | 64; } } } if (blockStyle4.right && blockStyle3.bottom) { Tile tile3 = Framing.GetTileSafely(i + 1, j + 1); if (tile3.active() && tile3.type == num) { Framing.BlockStyle blockStyle8 = Framing.FindBlockStyle(tile3); if (blockStyle8.left && blockStyle8.top) { num1 = num1 | 128; } } } if (resetFrame) { centerTile.frameNumber((byte)WorldGen.genRand.Next(0, 3)); } Point16 point16 = Framing.selfFrame8WayLookup[num1][centerTile.frameNumber()]; centerTile.frameX = point16.X; centerTile.frameY = point16.Y; }