117 for (
int i = 0; i < 20; i++)
126 for (
int j = 0;
j < 1000;
j++)
138 for (
int num =
_numMechs - 1; num >= 0; num--)
164 int num4 = tile.frameX / 18;
199 int num5 = tile.frameX % 36 / 18;
200 int num6 = tile.frameY % 36 / 18;
208 for (
int i =
num7; i <
num7 + 2; i++)
288 int num =
Main.
tile[i,
j].frameX / 18 * -1;
397 for (
int i = 0; i < 58; i++)
499 private static void TripWire(
int left,
int top,
int width,
int height)
516 for (
int i = left; i < left + width; i++)
518 for (
int j = top;
j < top + height;
j++)
522 if (tile !=
null && tile.
wire())
544 for (
int k = left;
k < left + width;
k++)
546 for (
int l = top;
l < top + height;
l++)
576 for (
int m = left;
m < left + width;
m++)
578 for (
int n = top;
n < top + height;
n++)
649 tile.frameX = (
short)((tile.
frameX != 18) ? 18 : 0);
707 if (tile.
type == 420)
710 int num = tile.frameY / 18;
711 bool flag = tile.frameX == 18;
712 bool flag2 = tile.frameX == 36;
727 if (
tile2.frameX == 36)
733 num3 += (tile2.frameX == 18).ToInt();
769 _ = tile.frameX % 18 / 18;
804 if (tile.
type != 419)
814 for (
int i = 0; i < next.
Count; i++)
816 Point16 point = next.PopFront();
819 next.PushBack(point);
823 while (next.
Count > 0)
833 for (
int j = 0;
j < 4;
j++)
875 if (tile.
type == 424 || tile.
type == 445)
879 if (
tile2.type == 424)
881 switch (
tile2.frameX / 18)
890 if ((num != 0 ||
j != 3) && (num != 3 ||
j != 0) && (num != 1 ||
j != 2) && (num != 2 ||
j != 1))
896 if ((num != 0 ||
j != 2) && (num != 2 ||
j != 0) && (num != 1 ||
j != 3) && (num != 3 ||
j != 1))
903 if (
tile2.type == 445)
920 1 => tile.
wire() ? 1 : 0,
921 2 => tile.
wire2() ? 1 : 0,
922 3 => tile.
wire3() ? 1 : 0,
923 4 => tile.
wire4() ? 1 : 0,
1045 int num2 = tile.frameX % 54 / 18;
1046 int num3 = tile.frameY % 54 / 18;
1067 int num7 = tile.frameX % 54 / 18;
1068 int num8 = tile.frameY % 54 / 18;
1089 int num12 = tile.frameX % 36 / 18;
1090 int num13 = tile.frameY % 36 / 18;
1111 int num19 = tile.frameX % 36 / 18;
1112 int num20 = tile.frameY % 54 / 18;
1131 int num25 = tile.frameX % 36 / 18;
1132 int num26 = tile.frameY % 54 / 18;
1151 int num31 = tile.frameX % 36 / 18;
1152 int num32 = tile.frameY % 36 / 18;
1213 int num39 = tile.frameX % 72 / 18;
1214 int num40 = tile.frameY % 54 / 18;
1217 int num43 = tile.frameY / 54;
1218 int num44 = tile.frameX / 72;
1287 int num51 = tile.frameX % 54 / 18;
1288 int num52 = tile.frameY % 54 / 18;
1291 int num55 = tile.frameX / 54;
1338 float knockBack = 0f;
1340 if (tile.
frameX / 54 == 0)
1438 int num68 =
j - tile.frameY % 40 / 18;
1451 int num156 =
j - tile.frameY / 18;
1452 int num157 = i - tile.frameX / 18;
1465 int num75 =
j - tile.frameY / 18;
1466 int num76 = i - tile.frameX / 18;
1485 Projectile.
NewProjectile(
GetProjectileSource(
num76,
num75),
num76 * 16 + 8,
num75 * 16 + 2, 0f, 0f,
type3, 0, 0f,
Main.
myPlayer,
num76,
num75);
1491 int num107 = i - tile.frameX / 18;
1549 tile.frameX +=
num79;
1553 tile.frameX -=
num79;
1651 int num81 = tile.frameX / 18;
1699 int num138 = tile.frameY / 18;
1713 int num147 = ((tile.frameX == 0) ? (-1) : ((tile.frameX == 18) ? 1 : 0));
1714 int num148 = ((tile.frameX >= 36) ? ((tile.
frameX >= 72) ? 1 : (-1)) : 0);
1766 switch (tile.
frameX / 18)
1797 switch (tile.
frameX / 18)
1839 vector3.X += 10 *
num154;
1855 vector3.X += 10 *
num150;
1871 vector3.X += 10 *
num155;
1925 int num126 = tile.frameX / 36;
1926 int num127 = tile.frameY / 54;
1971 int num92 =
j - tile.frameY / 18;
1972 int num93 = tile.frameX / 18;
2052 int num108 =
j - tile.frameY / 18;
2053 int num109 = tile.frameX / 18;
2061 num109 = i - tile.frameX % 36 / 18;
2062 num108 =
j - tile.frameY % 54 / 18;
2063 int num111 = tile.frameY / 54;
2126 num115 = Utils.SelectRandom(
Main.
rand,
new short[3] { 487, 486, 485 });
2155 num115 = Utils.SelectRandom(
Main.
rand,
new short[3] { 170, 180, 171 });
2177 num115 = Utils.SelectRandom(
Main.
rand,
new short[6] { 595, 596, 599, 597, 600, 598 });
2180 num115 = Utils.SelectRandom(
Main.
rand,
new short[2] { 616, 617 });
2183 num115 = Utils.SelectRandom(
Main.
rand,
new short[2] { 671, 672 });
2189 num115 = Utils.SelectRandom(
Main.
rand,
new short[2] { 674, 675 });
2201 Utils.PoofOfSmoke(position);
2412 int num86 = tile.frameY / 18;
2443 int num69 = tile.frameY / 18;
2486 bool flag = tileCache.frameX >= 54;
2489 if (tileCache.
frameX < 54)
2491 tileCache.frameX += 54;
2495 tileCache.frameX -= 54;
2504 for (num = tileCache.
frameY / 18; num >= 2; num -= 2)
2509 if (tileCache.
frameX > 0)
2513 bool flag = tileCache.frameX > 0;
2521 SkipWire(i,
num2 + 1);
2530 for (num = tileCache.
frameY / 18; num >= 2; num -= 2)
2534 int num2 = tileCache.frameX / 18;
2554 SkipWire(
num2, num);
2555 SkipWire(
num2 + 1, num);
2556 SkipWire(
num2, num + 1);
2557 SkipWire(
num2 + 1, num + 1);
2565 int num =
j - tileCache.frameY / 18;
2567 if (tileCache.
frameX > 0)
2571 bool flag = tileCache.frameX > 0;
2576 for (
int k = num;
k < num + 6;
k++)
2589 bool flag = tileCache.frameX >= 66;
2592 if (tileCache.
frameX < 66)
2594 tileCache.frameX += 66;
2598 tileCache.frameX -= 66;
2607 if (tileCache.
frameX > 0)
2611 bool flag = tileCache.frameX > 0;
2614 tileCache.frameX += num;
2622 for (num = tileCache.
frameY / 18; num >= 3; num -= 3)
2627 if (tileCache.
frameX > 0)
2631 bool flag = tileCache.frameX > 0;
2640 SkipWire(i, num + 1);
2641 SkipWire(i, num + 2);
2650 for (num = tileCache.
frameY / 18; num >= 3; num -= 3)
2654 int num3 = tileCache.frameX % 108 / 18;
2686 int num = tileCache.frameX % 54 / 18;
2687 int num2 = tileCache.frameY % 36 / 18;
2716 int num = theBlock.frameX % 54 / 18;
2717 int num2 = theBlock.frameY % 36 / 18;
2747 if (tile.
type != 443)
2751 int num = tile.frameX / 36;
2752 int num2 = i - (tile.frameX - num * 36) / 18;
2753 if (CheckMech(
num2,
j, 200))
2778 if (_teleport[0].
X < _teleport[1].
X + 3f && _teleport[0].
X > _teleport[1].
X - 3f && _teleport[0].
Y > _teleport[1].
Y - 3f && _teleport[0].
Y < _teleport[1].
Y)
2783 array[0].
X = (int)(_teleport[0].
X * 16f);
2784 array[0].Width = 48;
2785 array[0].Height = 48;
2786 array[0].Y = (int)(_teleport[0].
Y * 16f - (
float)
array[0].Height);
2787 array[1].X = (int)(_teleport[1].
X * 16f);
2788 array[1].Width = 48;
2789 array[1].Height = 48;
2790 array[1].Y = (int)(_teleport[1].
Y * 16f - (
float)
array[1].Height);
2791 for (
int i = 0; i < 2; i++)
2798 if (!blockPlayerTeleportationForOneIteration)
2800 for (
int j = 0;
j < 255;
j++)
2818 for (
int k = 0;
k < 200;
k++)
2831 for (
int l = 0;
l < 255;
l++)
2835 for (
int m = 0;
m < 200;
m++)
2846 return rectangle.Height <= teleporter.Height + entity.
Height;
2863 if (flag && (!
Main.
tile[i,
j - 1].active() || (!
TileID.
Sets.
BasicChest[
Main.
tile[i,
j - 1].type] &&
Main.
tile[i,
j - 1].type != 26 &&
Main.
tile[i,
j - 1].type != 77 &&
Main.
tile[i,
j - 1].type != 88 &&
Main.
tile[i,
j - 1].type != 470 &&
Main.
tile[i,
j - 1].type != 475 &&
Main.
tile[i,
j - 1].type != 237 &&
Main.
tile[i,
j - 1].type != 597 &&
WorldGen.
CanKillTile(i,
j))))
2865 Main.
tile[i,
j].inActive(inActive:
true);
2876 Main.
tile[i,
j].inActive(inActive:
false);
2989 if (
user !=
null && !
user.CanDoWireStuffHere(
pt.X,
pt.Y))
static double Sqrt(double d)
static double IEEERemainder(double x, double y)
static double Abs(double value)
static int Sign(decimal value)
static void NewTemporaryAnimation(int type, ushort tileType, int x, int y)
static void PlaySound(int type, Vector2 position, int style=1)
static bool SolidTiles(Vector2 position, int width, int height)
static Tile GetTileSafely(Vector2 position)
static void ToggleManualParty()
static MultiToolMode ToolMode
static bool[] TeleportationImmune
static bool[] NotReallySolid
static bool[] BasicChestFake
static void StartCachingType(int t)
static bool MechSpawn(float x, float y, int type)
static void DropCache(IEntitySource reason, Vector2 pos, Vector2 spread, int t, bool stopCaching=true)
static int NewItem(IEntitySource source, Vector2 pos, Vector2 randomBox, int Type, int Stack=1, bool noBroadcast=false, int prefixGiven=0, bool noGrabDelay=false, bool reverseLookup=false)
static NetworkText FromLiteral(string text)
static int AnnouncementBoxRange
static double worldSurface
static int moondialCooldown
static bool fastForwardTimeToDawn
static Projectile[] projectile
static void Moondialing()
static UnifiedRandom rand
static void NewTextMultiline(string text, bool force=false, Microsoft.Xna.Framework.Color c=default(Microsoft.Xna.Framework.Color), int WidthLimit=-1)
static bool AnnouncementBoxDisabled
static int sundialCooldown
static bool fastForwardTimeToDusk
static void FlipSwitchTrack(int i, int j)
static bool MechSpawn(float x, float y, int type)
static int NewNPC(IEntitySource source, int X, int Y, int Type, int Start=0, float ai0=0f, float ai1=0f, float ai2=0f, float ai3=0f, int Target=255)
static bool downedPlantBoss
static void SendData(int msgType, int remoteClient=-1, int ignoreClient=-1, NetworkText text=null, int number=0, float number2=0f, float number3=0f, float number4=0f, int number5=0, int number6=0, int number7=0)
static void SendTileSquare(int whoAmi, int tileX, int tileY, int xSize, int ySize, TileChangeType changeType=TileChangeType.None)
static void SendTemporaryAnimation(int whoAmi, int animationType, int tileType, int xCoord, int yCoord)
bool ConsumeItem(int type, bool reverseOrder=false, bool includeVoidBag=false)
static int NewProjectile(IEntitySource spawnSource, Vector2 position, Vector2 velocity, int Type, int Damage, float KnockBack, int Owner=-1, float ai0=0f, float ai1=0f, float ai2=0f)
static void CheckSection(int playerIndex, Vector2 position, int fluff=1)
static int ReadSign(int i, int j, bool CreateIfMissing=true)
static void PoofOfSmoke(Vector2 position)
static void ToggleCampFire(int i, int j, Tile tileCache, bool? forcedStateWhereTrueIsOn, bool doSkipWires)
static void Toggle2x2Light(int i, int j, Tile tileCache, bool? forcedStateWhereTrueIsOn, bool doSkipWires)
static DoubleStack< byte > _wireDirectionList
static Queue< Point16 > _LampsToCheck
static bool Actuate(int i, int j)
static void ToggleLampPost(int i, int j, Tile tileCache, bool? forcedStateWhereTrueIsOn, bool doSkipWires)
static void ToggleLamp(int i, int j, Tile tileCache, bool? forcedStateWhereTrueIsOn, bool doSkipWires)
static void SkipWire(Point16 point)
static Dictionary< Point16, bool > _wireSkip
static Dictionary< Point16, byte > _PixelBoxTriggers
static void ToggleTorch(int i, int j, Tile tileCache, bool? forcedStateWhereTrueIsOn)
static void HitWire(DoubleStack< Point16 > next, int wireType)
static void ToggleFirePlace(int i, int j, Tile theBlock, bool? forcedStateWhereTrueIsOn, bool doSkipWires)
static bool TeleporterHitboxIntersects(Rectangle teleporter, Rectangle entity)
static void PixelBoxPass()
static bool CheckMech(int i, int j, int time)
static void DeActive(int i, int j)
static void MassWireOperationInner(Player user, Point ps, Point pe, Vector2 dropPoint, bool dir, ref int wireCount, ref int actuatorCount)
static void LogicGatePass()
static DoubleStack< Point16 > _wireList
static IEntitySource GetProjectileSource(int sourceTileX, int sourceTileY)
static Queue< Point16 > _GatesCurrent
static void ToggleCandle(int i, int j, Tile tileCache, bool? forcedStateWhereTrueIsOn)
static void MassWireOperation(Point ps, Point pe, Player master)
static void PokeLogicGate(int lampX, int lampY)
static Vector2[] _teleport
static void ToggleHolidayLight(int i, int j, Tile tileCache, bool? forcedStateWhereTrueIsOn)
static void ActuateForced(int i, int j)
static void ToggleHangingLantern(int i, int j, Tile tileCache, bool? forcedStateWhereTrueIsOn, bool doSkipWires)
static IEntitySource GetItemSource(int sourceTileX, int sourceTileY)
static void ToggleChandelier(int i, int j, Tile tileCache, bool? forcedStateWhereTrueIsOn, bool doSkipWires)
static void SkipWire(int x, int y)
static void CheckLogicGate(int lampX, int lampY)
static Dictionary< Point16, bool > _GatesDone
static void SetCurrentUser(int plr=-1)
static Dictionary< Point16, byte > _toProcess
static void TripWire(int left, int top, int width, int height)
static void HitSwitch(int i, int j)
static void ReActive(int i, int j)
static Queue< Point16 > _GatesNext
static void GeyserTrap(int i, int j)
static int _currentWireColor
static void HitWireSingle(int i, int j)
static bool blockPlayerTeleportationForOneIteration
static ? bool MassWireOperationStep(Player user, Point pt, WiresUI.Settings.MultiToolMode mode, ref int wiresLeftToConsume, ref int actuatorsLeftToConstume)
static IEntitySource GetNPCSource(int sourceTileX, int sourceTileY)
static void SwitchMonolith(int i, int j)
static bool PlaceWire2(int i, int j)
static bool OpenDoor(int i, int j, int direction)
static void SwitchMB(int i, int j)
static void LaunchRocketSmall(int x, int y, bool fromWiring)
static void KillTile(int i, int j, bool fail=false, bool effectOnly=false, bool noItem=false)
static bool KillWire3(int i, int j)
static bool CloseDoor(int i, int j, bool forced=false)
static bool ShiftTallGate(int x, int y, bool closing, bool forced=false)
static bool CanKillTile(int i, int j, SpecialKillTileContext context)
static bool KillWire4(int i, int j)
static bool PlaceWire3(int i, int j)
static bool ShiftTrapdoor(int x, int y, bool playerAbove, int onlyCloseOrOpen=-1)
static bool KillWire(int i, int j)
static bool PlaceWire4(int i, int j)
static void SwitchFountain(int i, int j)
static void TileFrame(int i, int j, bool resetFrame=false, bool noBreak=false)
static bool KillWire2(int i, int j)
static void LaunchRocket(int x, int y, bool fromWiring)
static bool PlaceWire(int i, int j)
static void ExplodeMine(int i, int j, bool fromWiring)
static bool InWorld(int x, int y, int fluff=0)
static void ShootFromCannon(int x, int y, int angle, int ammo, int Damage, float KnockBack, int owner, bool fromWire)
static bool PlaceActuator(int i, int j)
static void SquareTileFrame(int i, int j, bool resetFrame=true)
static bool KillActuator(int i, int j)
static Rectangle Union(Rectangle value1, Rectangle value2)